/* ==================== 主题切换 ==================== */

/* 浅色主题变量 - 精心设计的配色方案 */
.light-theme {
  /* 主色调 - 优雅的蓝色 */
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-light: #dbeafe;
  
  /* 状态色 */
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --info: #06b6d4;
  --info-light: #cffafe;
  
  /* 文字颜色 */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  /* 背景颜色 - 柔和渐变 */
  --bg-primary: #ffffff;
  --bg-secondary: #f1f5f9;
  --bg-tertiary: #e2e8f0;
  --bg-hover: #f8fafc;
  
  /* 边框和阴影 */
  --border: rgba(15, 23, 42, 0.08);
  --border-light: rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.1);
  
  /* 毛玻璃效果 */
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(15, 23, 42, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  
  /* 卡片背景 */
  --card-bg: #ffffff;
  --card-hover: #fafbfc;
}

/* 深色主题变量（默认） */
.dark-theme {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --border: rgba(255, 255, 255, 0.1);
  --shadow: rgba(0, 0, 0, 0.3);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.1);
}

/* 浅色主题背景 - 优雅的渐变 */
.light-theme body {
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #f0fdf4 100%);
  background-attachment: fixed;
}

/* 浅色主题装饰元素 */
.light-theme body::before {
  content: '';
  position: fixed;
  top: -50%;
  right: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle at 30% 50%,
    rgba(59, 130, 246, 0.05) 0%,
    transparent 50%
  );
  pointer-events: none;
  z-index: -1;
}

/* 浅色主题卡片样式优化 */
.light-theme .card,
.light-theme [class*="section"],
.light-theme [class*="container"] {
  background: var(--card-bg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
}

.light-theme .card:hover {
  background: var(--card-hover);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

/* 浅色主题按钮优化 */
.light-theme button,
.light-theme .btn {
  box-shadow: var(--shadow-sm);
}

.light-theme button:hover,
.light-theme .btn:hover {
  box-shadow: var(--shadow);
}

/* 浅色主题输入框优化 */
.light-theme input,
.light-theme textarea,
.light-theme select {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.light-theme input:focus,
.light-theme textarea:focus,
.light-theme select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

/* 浅色主题标题渐变 */
.light-theme h1,
.light-theme .tool-title,
.light-theme [class*="title"] {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 50%, #1d4ed8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 主题切换按钮 */
.theme-toggle-btn {
  position: fixed;
  bottom: 40px;
  left: 40px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 2px solid var(--glass-border);
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 8px 32px var(--shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle-btn:hover {
  transform: translateY(-4px) scale(1.1);
  box-shadow: 0 12px 48px var(--shadow);
  border-color: var(--primary);
}

.theme-toggle-btn:active {
  transform: translateY(-2px) scale(1.05);
}

/* ==================== 搜索历史 ==================== */

.history-section {
  margin-top: 20px;
  padding: 16px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
}

.history-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.history-clear {
  font-size: 0.85rem;
  color: var(--danger);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}

.history-clear:hover {
  background: rgba(239, 68, 68, 0.1);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-item {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary);
  transform: translateX(4px);
}

.history-keyword {
  font-size: 0.9rem;
  color: var(--text-primary);
}

.history-meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.history-count {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.history-remove {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  font-size: 0.9rem;
  transition: all 0.2s;
}

.history-remove:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: scale(1.1);
}

.history-empty {
  text-align: center;
  padding: 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ==================== 场景评分 ==================== */

.rating-container {
  margin-top: 24px;
  padding: 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  text-align: center;
}

.rating-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.rating-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 12px;
}

.rating-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rating-btn-positive {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  border: 2px solid rgba(16, 185, 129, 0.3);
}

.rating-btn-positive:hover {
  background: rgba(16, 185, 129, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.3);
}

.rating-btn-negative {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 2px solid rgba(239, 68, 68, 0.3);
}

.rating-btn-negative:hover {
  background: rgba(239, 68, 68, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(239, 68, 68, 0.3);
}

.rating-stats {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.rating-thanks {
  padding: 24px;
  text-align: center;
}

.rating-thanks-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.rating-thanks-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

/* ==================== 话术收藏 ==================== */

.favorite-btn,
.copy-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.favorite-btn {
  background: rgba(251, 191, 36, 0.1);
  color: var(--warning);
  border: 2px solid rgba(251, 191, 36, 0.3);
}

.favorite-btn:hover {
  background: rgba(251, 191, 36, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(251, 191, 36, 0.3);
}

.copy-btn {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
  border: 2px solid rgba(59, 130, 246, 0.3);
}

.copy-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.3);
}

.favorites-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.favorite-item {
  padding: 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  transition: all 0.3s;
}

.favorite-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.favorite-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.favorite-type {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
}

.favorite-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.favorite-content {
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
  line-height: 1.6;
  margin-bottom: 12px;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.favorite-actions {
  display: flex;
  gap: 8px;
}

.favorite-action-btn {
  flex: 1;
  padding: 8px 16px;
  border: none;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.favorite-action-btn.copy {
  background: rgba(59, 130, 246, 0.1);
  color: var(--primary);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.favorite-action-btn.copy:hover {
  background: rgba(59, 130, 246, 0.2);
}

.favorite-action-btn.delete {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.favorite-action-btn.delete:hover {
  background: rgba(239, 68, 68, 0.2);
}

.favorites-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.favorites-empty .empty-icon {
  font-size: 4rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.favorites-empty .empty-text {
  font-size: 1.1rem;
}

/* ==================== 响应式 ==================== */

@media (max-width: 768px) {
  .theme-toggle-btn {
    bottom: 20px;
    left: 20px;
    width: 48px;
    height: 48px;
    font-size: 1.3rem;
  }

  .rating-buttons {
    flex-direction: column;
  }

  .rating-btn {
    width: 100%;
    justify-content: center;
  }

  .favorite-actions {
    flex-direction: column;
  }
}
