/* global.css - 谷歌趋势风格简洁设计 */

/* 通用卡片 */
.card {
  background: var(--card);
  border-radius: 8px;
  padding: 16px;
  border: 1px solid var(--outline);
  transition: none;
}

/* 卡片标题 */
.title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 16px;
  text-transform: none;
}

/* 谷歌风格的相关搜索词列表 */
.item {
  position: relative;
  padding: 12px 0;
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  color: var(--text);
  border-bottom: 1px solid #e8eaed;
  line-height: 1.5;
  min-height: 48px;
}

.item:last-child {
  border-bottom: none;
}

.item:hover {
  background-color: #f8f9fa;
  border-radius: 4px;
  margin: 0 -8px;
  padding: 12px 8px;
}

/* 序号样式 */
.item-number {
  color: #5f6368;
  font-weight: 400;
  margin-right: 12px;
  min-width: 20px;
  text-align: right;
  font-size: 14px;
}

/* 搜索词内容区域 */
.item-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* 操作区域 - 包含复制按钮和徽章 */
.item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
}

/* 复制按钮样式 */
.copy-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #5f6368;
  padding: 0;
  position: relative;
}

.copy-btn:hover {
  background-color: #f1f3f4;
  color: #202124;
  transform: scale(1.05);
}

.copy-btn:active {
  transform: scale(0.95);
}

.copy-btn:focus {
  outline: 2px solid #1a73e8;
  outline-offset: 2px;
}

/* 复制图标样式 */
.copy-icon {
  transition: all 0.2s ease;
}

/* 成功状态 */
.copy-btn.success {
  color: #137333;
  background-color: #e6f4ea;
}

.copy-btn.success .copy-icon {
  animation: checkmark 0.3s ease;
}

/* 错误状态 */
.copy-btn.error {
  color: #d93025;
  background-color: #fce8e6;
}

.copy-btn.error .copy-icon {
  animation: shake 0.5s ease;
}

/* 成功动画 */
@keyframes checkmark {
  0% {
    transform: scale(0.8);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* 错误动画 */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

/* 主搜索词 */
.query-text {
  color: #202124;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  word-break: break-word;
}

/* 中文翻译 */
.query-translation {
  color: #5f6368;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.3;
  margin-top: 2px;
}

/* 查询链接样式 */
.query-link {
  text-decoration: none;
  color: inherit;
  display: block;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.query-link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(13, 148, 136, 0.1), transparent);
  transition: left 0.3s ease;
}

.query-link:hover {
  background-color: rgba(13, 148, 136, 0.05);
  transform: translateX(2px);
}

.query-link:hover::before {
  left: 100%;
}

.query-link:hover .query-text {
  color: #0d9488;
  font-weight: 500;
}

.query-link:hover .query-translation {
  color: #0d9488;
}

.query-link:active {
  transform: translateX(1px);
}

/* 移除进度条 */
.progress {
  display: none;
}

/* 谷歌风格的徽章 */
.badge {
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
  color: #5f6368;
  border-radius: 4px;
  background: #f1f3f4;
  text-transform: none;
  white-space: nowrap;
  align-self: flex-start;
}

/* Breakout 徽章特殊样式 */
.badge.breakout {
  background: #e8f0fe;
  color: #1a73e8;
}

/* 高增长率徽章 */
.badge.high-growth {
  background: #e6f4ea;
  color: #137333;
}

/* 滚动条简化 */
::-webkit-scrollbar { 
  width: 6px; 
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--outline); 
  border-radius: 3px;
}

/* 响应式网格 */
.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr;
  }
  
  .item {
    padding: 10px 0;
    min-height: 40px;
  }
  
  .item:hover {
    margin: 0 -4px;
    padding: 10px 4px;
  }
  
  .item-number {
    margin-right: 8px;
    min-width: 16px;
  }
  
  .query-text {
    font-size: 13px;
  }
  
  .query-translation {
    font-size: 11px;
  }
  
  .item-actions {
    gap: 6px;
    margin-left: 8px;
  }
  
  .copy-btn {
    width: 24px;
    height: 24px;
  }
  
  .copy-icon {
    width: 14px;
    height: 14px;
  }
  
  .badge {
    padding: 2px 6px;
    font-size: 11px;
  }
}

/* 加载状态 */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  gap: 16px;
  color: var(--text-mute);
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--outline);
  border-top: 2px solid var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 数据统计 */
.stats {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 0;
  color: var(--text-mute);
  font-size: 14px;
  margin-bottom: 16px;
}

/* 工具提示 */
.tooltip {
  position: relative;
  cursor: default;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1000;
}

.tooltip:hover::after {
  opacity: 1;
}

/* 超长单词处理 - 谷歌风格 */
.text-truncate {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: top;
}

.text-truncate:hover {
  overflow: visible;
  white-space: normal;
  word-break: break-word;
  background: #fff;
  border: 1px solid #e8eaed;
  border-radius: 4px;
  padding: 4px 8px;
  z-index: 1000;
  position: relative;
  max-width: 300px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
} 