/* ============================================================
   国内 AI 应用全景导航 — 全局样式 v2
   新增：Favicon 图标 / 介绍页 / 推荐位 / 收藏按钮
   ============================================================ */

/* ---- CSS 变量 ---- */
:root {
  --bg-primary: #f5f7fa;
  --bg-card: #ffffff;
  --color-primary: #3b82f6;
  --color-primary-dark: #2563eb;
  --color-accent: #8b5cf6;
  --color-success: #10b981;
  --color-fav: #f59e0b;
  --text-heading: #1a1a2e;
  --text-body: #64748b;
  --text-muted: #94a3b8;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;

  /* 表面/覆盖层颜色 */
  --color-on-primary: #ffffff;
  --color-icon-bg: #f0f0f0;
  --color-highlight: #fef08a;
  --color-fav-bg: #fffbeb;
  --color-review-bg: #fafafa;
  --color-review-border: #e5e7eb;
  --color-review-heading: #374151;
  --color-review-text: #6b7280;
  --color-review-meta: #9ca3af;
  --color-star-gold: #f59e0b;
  --color-star-gray: #d1d5db;
  --shadow-focus-ring: 0 0 0 3px rgba(59, 130, 246, 0.15);
  --shadow-modal-bg: rgba(0, 0, 0, 0.5);
}

/* ---- 暗色模式 ---- */
[data-theme="dark"] {
  --bg-primary: #111827;
  --bg-card: #1f2937;
  --color-primary: #f59e0b;
  --color-primary-dark: #d97706;
  --color-accent: #f59e0b;
  --color-fav: #f59e0b;
  --text-heading: #f3f4f6;
  --text-body: #d1d5db;
  --text-muted: #9ca3af;
  --border-color: #374151;
  --color-on-primary: #111827;
  --color-icon-bg: #374151;
  --color-highlight: rgba(245, 158, 11, 0.25);
  --color-fav-bg: rgba(245, 158, 11, 0.15);
  --color-review-bg: #252540;
  --color-review-border: #374151;
  --color-review-heading: #e5e7eb;
  --color-review-text: #d1d5db;
  --color-review-meta: #9ca3af;
  --color-star-gold: #f59e0b;
  --color-star-gray: #4b5563;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
  --shadow-focus-ring: 0 0 0 3px rgba(245, 158, 11, 0.25);
  --shadow-modal-bg: rgba(0, 0, 0, 0.7);
}

/* ---- Reset ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-body);
  line-height: 1.6;
  min-height: 100vh;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }

/* ---- 顶部导航 ---- */
.header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 24px;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-heading);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s;
}

.logo:hover { opacity: 0.8; }

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-on-primary);
  font-size: 18px;
  font-weight: 800;
}

/* ---- 搜索栏 ---- */
.search-wrapper {
  position: relative;
  flex: 1;
  max-width: 480px;
}

.search-input {
  width: 100%;
  height: 42px;
  padding: 0 16px 0 44px;
  border: 2px solid var(--border-color);
  border-radius: 24px;
  font-size: 15px;
  background: var(--bg-primary);
  color: var(--text-heading);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-focus-ring);
}

.search-input::placeholder { color: var(--text-muted); }

.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 16px;
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1;
  padding: 4px;
  display: none;
  border-radius: 50%;
  transition: background 0.15s;
}

.search-clear:hover { background: var(--border-color); }
.search-clear.visible { display: flex; }

/* ---- 主题切换按钮 ---- */
.theme-toggle {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background: var(--bg-card);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
  line-height: 1;
}

.theme-toggle:hover {
  background: var(--bg-primary);
  border-color: var(--color-primary);
}

/* ---- 分享按钮 ---- */
.share-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background: var(--bg-card);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
  line-height: 1;
  color: var(--text-body);
}

.share-btn:hover {
  background: var(--bg-primary);
  border-color: var(--color-primary);
}

/* ---- 分享下拉面板 ---- */
.share-dropdown {
  position: absolute;
  top: 56px;
  right: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  min-width: 160px;
  z-index: 1000;
  display: none;
}

.share-dropdown.show {
  display: block;
  animation: shareFadeIn 0.15s ease-out;
}

@keyframes shareFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.share-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: none;
  font-size: 14px;
  color: var(--text-body);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.share-option:hover {
  background: var(--bg-primary);
}

/* ---- 板块标签切换 ---- */
.tabs-bar {
  max-width: 1320px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  background: var(--bg-primary);
  position: sticky;
  top: 60px;
  z-index: 99;
  border-bottom: 1px solid var(--border-color);
}

.tab-btn {
  padding: 8px 20px;
  border-radius: 20px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-body);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.2s;
}

.tab-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.tab-btn.active {
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-color: var(--color-primary);
}

.tab-count {
  font-size: 12px;
  margin-left: 4px;
  opacity: 0.75;
}

.about-link {
  margin-left: auto;
  text-decoration: none;
  border-color: transparent;
  background: transparent;
  color: var(--text-muted);
}
.about-link:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ---- 排序 & 评分筛选栏 ---- */
.filter-bar {
  max-width: 1320px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 112px;
  z-index: 98;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.filter-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 4px;
  white-space: nowrap;
}

.filter-btn {
  padding: 5px 14px;
  border-radius: 14px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.filter-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.filter-btn.active {
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-color: var(--color-primary);
}

/* ---- 主内容区 ---- */
.main-content {
  max-width: 1320px;
  margin: 0 auto;
  padding: 24px;
}

/* ---- 统计条 ---- */
.stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.stats-info {
  font-size: 14px;
  color: var(--text-muted);
}

.stats-info strong {
  color: var(--color-primary);
  font-weight: 600;
}

/* ---- 分类区域 ---- */
.category-section { margin-bottom: 32px; }

.category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-color);
}

.category-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-heading);
}

.category-count {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-primary);
  padding: 2px 10px;
  border-radius: 12px;
}

/* ---- 工具卡片网格 ---- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
}

.tool-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tool-card-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tool-card-cat {
  font-size: 12px;
  color: var(--text-muted);
}

/* ---- 工具图标（Favicon） ---- */
.tool-avatar {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.tool-icon-img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: contain;
  background: var(--color-icon-bg);
  display: block;
}

.tool-icon-fallback {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-on-primary);
  font-weight: 700;
  font-size: 20px;
  flex-shrink: 0;
}

.tool-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-heading);
  line-height: 1.3;
}

.tool-desc {
  font-size: 13px;
  color: var(--text-body);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tool-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.tool-tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg-primary);
  color: var(--text-muted);
  white-space: nowrap;
}

/* ---- 卡片星级 & tagline ---- */
.tool-stars {
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--color-star-gold);
  line-height: 1;
}

.tool-stars-empty {
  color: var(--color-star-gray);
}

.tool-card-stars {
  margin-top: 2px;
}

.tool-card-tagline {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 2px;
}

/* ---- 无结果 ---- */
.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.no-results-icon { font-size: 48px; margin-bottom: 12px; }

.no-results h3 {
  font-size: 18px;
  color: var(--text-heading);
  margin-bottom: 6px;
}

.no-results p { font-size: 14px; }

/* ---- 搜索高亮 ---- */
.search-highlight {
  background: var(--color-highlight);
  border-radius: 2px;
  padding: 0 2px;
}

/* =========================================
   介绍页（Detail Page）
   ========================================= */

.detail-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 0 60px;
}

/* 头部 */
.detail-header {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 32px;
}

.detail-icon-wrap {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-icon-wrap .tool-icon-img {
  width: 80px;
  height: 80px;
  border-radius: 16px;
}

.detail-icon-wrap .tool-icon-fallback {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  font-size: 36px;
}

.detail-title-group { flex: 1; min-width: 0; }

.detail-name {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-heading);
  margin-bottom: 6px;
}

.detail-tagline {
  font-size: 15px;
  color: var(--text-body);
  margin-bottom: 12px;
  line-height: 1.5;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.detail-cat-badge {
  display: inline-block;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 12px;
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: 500;
}

/* 操作按钮 */
.detail-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.detail-btn {
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-heading);
  font-size: 15px;
  font-weight: 600;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.detail-btn:hover {
  background: var(--bg-primary);
  border-color: var(--color-primary);
}

.detail-btn.primary {
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-color: var(--color-primary);
}

.detail-btn.primary:hover {
  background: var(--color-primary-dark);
}

.detail-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 收藏按钮 */
.detail-btn:not(.primary) { }
.detail-btn.fav-active {
  background: var(--color-fav-bg);
  border-color: var(--color-fav);
  color: var(--color-fav);
}

/* 介绍区块 */
.detail-section {
  margin-bottom: 32px;
}

.detail-section h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
}

.detail-section p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-body);
}

.detail-features {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
}

.detail-features li {
  position: relative;
  padding: 10px 14px 10px 28px;
  font-size: 14px;
  color: var(--text-body);
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  line-height: 1.5;
}

.detail-features li::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 16px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
}

/* 推荐卡片 */
.recs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.rec-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  text-align: center;
}

.rec-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-accent);
}

.rec-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.rec-icon .tool-icon-img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: contain;
}

.rec-icon .tool-icon-fallback {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  font-size: 20px;
}

.rec-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 6px;
}

.rec-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =========================================
   模态框（保留兼容）
   ========================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--shadow-modal-bg);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s ease;
}

@keyframes slideUp {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ---- 响应式：手机端 < 768px ---- */
@media (max-width: 768px) {

  /* === 基础字体 === */
  body { font-size: 14px; }

  /* === 导航栏 === */
  .header { padding: 0 12px; }
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 0;
    gap: 8px;
  }

  .logo { font-size: 16px; gap: 6px; }
  .logo-icon { width: 28px; height: 28px; font-size: 14px; border-radius: 6px; }

  .search-wrapper {
    max-width: 100%;
    order: 3;
    flex-basis: 100%;
  }

  .search-input { height: 38px; font-size: 14px; padding: 0 12px 0 38px; }
  .search-icon { left: 12px; font-size: 14px; }

  /* === 主题切换按钮移动端 === */
  .theme-toggle { width: 36px; height: 36px; font-size: 16px; }

  /* === 板块标签栏（横向滑动） === */
  .tabs-bar {
    padding: 10px 12px;
    top: 50px;
    gap: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .tab-btn { padding: 6px 14px; font-size: 13px; border-radius: 16px; }
  .tab-count { font-size: 11px; }

  /* === 排序 & 评分筛选栏移动端 === */
  .filter-bar {
    padding: 8px 12px;
    gap: 12px;
    top: 86px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
  }

  .filter-group { gap: 4px; flex-shrink: 0; }
  .filter-label { font-size: 12px; }
  .filter-btn { padding: 4px 10px; font-size: 12px; border-radius: 12px; }

  /* === 主内容区 === */
  .main-content { padding: 12px; }

  /* === 统计条 === */
  .stats-bar { margin-bottom: 14px; }
  .stats-info { font-size: 13px; }

  /* === 分类区域 === */
  .category-section { margin-bottom: 24px; }
  .category-header { margin-bottom: 10px; padding-bottom: 8px; }
  .category-title { font-size: 16px; }
  .category-count { font-size: 12px; padding: 2px 8px; }

  /* === 工具卡片：2 列网格 === */
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .tool-card {
    padding: 12px;
    gap: 8px;
    border-radius: var(--radius-sm);
  }

  .tool-card:hover { transform: none; }

  .tool-card-header { gap: 8px; }

  .tool-avatar,
  .tool-icon-img,
  .tool-icon-fallback {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }
  .tool-icon-fallback { font-size: 16px; }

  .tool-name { font-size: 14px; }
  .tool-desc { font-size: 12px; -webkit-line-clamp: 2; }
  .tool-tag { font-size: 10px; padding: 2px 6px; }
  .tool-card-cat { font-size: 11px; }
  .tool-stars { font-size: 13px; }
  .tool-card-tagline { font-size: 11px; }

  /* === 详情页（首页内嵌 & 独立页共用） === */
  .detail-page {
    padding: 20px 12px 40px;
    max-width: 100%;
  }

  .detail-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    margin-bottom: 24px;
  }

  .detail-icon-wrap {
    width: 60px;
    height: 60px;
  }

  .detail-icon-wrap .tool-icon-img,
  .detail-icon-wrap .tool-icon-fallback {
    width: 60px;
    height: 60px;
    border-radius: 14px;
  }
  .detail-icon-wrap .tool-icon-fallback { font-size: 28px; }

  .detail-name,
  .detail-info h1 {
    font-size: 20px;
    margin-bottom: 4px;
  }

  .detail-tagline { font-size: 14px; }
  .detail-tags { justify-content: center; }
  .detail-cat-badge,
  .tag { font-size: 11px; padding: 3px 10px; }

  .detail-actions {
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
  }

  .detail-btn {
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 6px;
  }

  .detail-section { margin-bottom: 24px; }
  .detail-section h2 { font-size: 16px; margin-bottom: 10px; padding-bottom: 8px; }
  .detail-section p { font-size: 14px; line-height: 1.7; }

  .detail-features {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .detail-features li {
    font-size: 13px;
    padding: 8px 12px 8px 24px;
  }

  .detail-features li::before {
    left: 10px;
    top: 13px;
    width: 5px;
    height: 5px;
  }

  /* 推荐卡片：2 列 */
  .recs-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .rec-card { padding: 14px; }
  .rec-card:hover { transform: none; }
  .rec-name { font-size: 14px; }
  .rec-desc { font-size: 11px; }

  /* === 真人测评移动端 === */
  .review-card { padding: 16px; border-radius: 10px; }
  .review-item { margin-bottom: 12px; }
  .review-item h3 { font-size: 14px; }
  .review-item p { font-size: 13px; line-height: 1.6; }
  .review-stars { font-size: 18px; letter-spacing: 2px; }
  .review-rating-summary { font-size: 12px; }

  /* === 独立详情页顶部导航 === */
  .top-bar { padding: 0 12px; height: 50px; }
  .top-bar-left { font-size: 13px; gap: 4px; }

  /* === 页脚 === */
  .footer { padding: 20px 12px; font-size: 12px; margin-top: 24px; }
  .site-footer { padding: 20px 12px; font-size: 12px; margin-top: 24px; }

  /* === 无结果 === */
  .no-results { padding: 40px 12px; }
  .no-results-icon { font-size: 36px; }
  .no-results h3 { font-size: 16px; }
  .no-results p { font-size: 13px; }

  /* === 模态框 === */
  .modal { max-width: 95%; border-radius: var(--radius-md); }
  .modal-overlay { padding: 12px; }
}

/* ---- 超小屏 < 400px：卡片退为单列 ---- */
@media (max-width: 400px) {
  .tools-grid { grid-template-columns: 1fr; }
  .recs-grid { grid-template-columns: 1fr; }
}

/* ---- Footer ---- */
.footer {
  text-align: center;
  padding: 32px 24px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 2px solid var(--border-color);
  margin-top: 40px;
}

/* ========================================
   独立详情页样式（tools/*.html 使用）
   ======================================== */

/* 顶部导航（面包屑 + Logo） */
.top-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-body);
}

.back-link {
  color: var(--color-primary);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--color-primary-dark);
}

.breadcrumb {
  color: var(--text-muted);
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--color-primary);
}

/* 详情页主容器 */
.detail-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px 60px;
}

/* 工具头部（独立页版） */
.detail-header {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 32px;
}

.detail-icon-wrap {
  flex-shrink: 0;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-icon-wrap .tool-icon-img {
  width: 80px;
  height: 80px;
  border-radius: 16px;
}

.detail-icon-wrap .tool-icon-fallback {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  font-size: 36px;
}

.detail-info {
  flex: 1;
  min-width: 0;
}

.detail-info h1 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-heading);
  margin: 0 0 6px 0;
  line-height: 1.3;
}

.detail-tagline {
  font-size: 15px;
  color: var(--text-body);
  margin-bottom: 12px;
  line-height: 1.5;
}

/* 标签 */
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tag {
  display: inline-block;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 12px;
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: 500;
}

/* 操作按钮（独立页版） */
.detail-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.detail-btn {
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-heading);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.detail-btn:hover {
  background: var(--bg-primary);
  border-color: var(--color-primary);
}

.detail-btn-primary {
  background: var(--color-primary);
  color: var(--color-on-primary);
  border-color: var(--color-primary);
}

.detail-btn-primary:hover {
  background: var(--color-primary-dark);
}

.detail-btn.fav-active {
  background: var(--color-fav-bg);
  border-color: var(--color-fav);
  color: var(--color-fav);
}

/* 介绍区块 */
.detail-section {
  margin-bottom: 32px;
}

.detail-section h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border-color);
}

.detail-section p {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-body);
}

.detail-features {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
}

.detail-features li {
  position: relative;
  padding: 10px 14px 10px 28px;
  font-size: 14px;
  color: var(--text-body);
  background: var(--bg-primary);
  border-radius: var(--radius-sm);
  line-height: 1.5;
}

.detail-features li::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 16px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
}

/* 推荐卡片 */
.recs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.rec-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  text-align: center;
}

.rec-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-accent);
}

.rec-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.rec-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 6px;
}

.rec-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 真人测评卡片 */
.review-card {
  background: var(--color-review-bg);
  border: 1px solid var(--color-review-border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}

.review-item { margin-bottom: 16px; }
.review-item:last-child { margin-bottom: 0; }

.review-item h3 {
  font-size: 15px;
  color: var(--color-review-heading);
  margin: 0 0 6px 0;
}

.review-item p {
  margin: 0;
  color: var(--color-review-text);
  line-height: 1.7;
  font-size: 14px;
}

.review-stars {
  margin: 0;
  font-size: 20px;
  letter-spacing: 3px;
}

.review-rating-summary {
  margin: 4px 0 0 0;
  color: var(--color-review-meta);
  font-size: 13px;
}

/* 页脚（独立页版） */
.site-footer {
  text-align: center;
  padding: 32px 24px;
  color: var(--text-muted);
  font-size: 13px;
  border-top: 2px solid var(--border-color);
  margin-top: 40px;
}

.site-footer a {
  color: var(--color-primary);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* 响应式 */
@media (max-width: 768px) {
  .detail-features { grid-template-columns: 1fr; }
  .recs-grid { grid-template-columns: 1fr; }
  .detail-page { padding: 24px 16px 40px; }
  .detail-header { flex-direction: column; align-items: center; text-align: center; }
  .detail-info h1 { font-size: 24px; }
  .detail-tags { justify-content: center; }
  .detail-actions { justify-content: center; }
}

/* ============================================================
   对比面板模态框（详情页）
   ============================================================ */
.compare-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--shadow-modal-bg, rgba(0,0,0,0.5));
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.compare-modal-overlay.show {
    display: flex;
}

.compare-modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.compare-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 12px;
}

.compare-modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-heading);
    margin: 0;
}

.compare-modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-primary);
    color: var(--text-muted);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.compare-modal-close:hover {
    background: var(--border-color);
}

.compare-modal-search {
    padding: 0 24px 12px;
}

.compare-modal-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-body);
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}

.compare-modal-input:focus {
    border-color: var(--color-primary);
}

.compare-modal-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px 16px;
}

.compare-modal-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
    border: 1px solid transparent;
}

.compare-modal-item:hover {
    background: var(--bg-primary);
}

.compare-modal-item.selected {
    border-color: var(--color-primary);
    background: var(--bg-primary);
}

.compare-modal-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.compare-modal-item input[type="checkbox"] {
    flex-shrink: 0;
    accent-color: var(--color-primary);
}

.compare-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

.compare-modal-hint {
    font-size: 14px;
    color: var(--text-muted);
}

.compare-modal-hint strong {
    color: var(--color-primary);
    font-size: 16px;
}

/* ============================================================
   对比页样式（compare.html）
   ============================================================ */
.compare-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 24px 60px;
}

.compare-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-heading);
    margin-bottom: 8px;
}

.compare-subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 32px;
}

.compare-selector {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.compare-slot {
    flex: 1;
    min-width: 200px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
}

.compare-slot:hover {
    border-color: var(--color-primary);
    background: var(--bg-primary);
}

.compare-slot.filled {
    border-style: solid;
    border-color: var(--color-primary);
    background: var(--bg-card);
    cursor: default;
}

.slot-placeholder {
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
}

.slot-tool-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.slot-tool-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-heading);
    text-align: center;
}

.slot-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: var(--border-color);
    color: var(--text-muted);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.slot-remove:hover {
    background: #ef4444;
    color: #fff;
}

.compare-search-wrap {
    position: relative;
    width: 100%;
}

.compare-search {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-body);
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}

.compare-search:focus {
    border-color: var(--color-primary);
}

.compare-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    max-height: 240px;
    overflow-y: auto;
    z-index: 100;
    display: none;
}

.compare-dropdown.show {
    display: block;
}

.compare-dropdown-item {
    padding: 10px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s;
    font-size: 14px;
    color: var(--text-body);
}

.compare-dropdown-item:hover {
    background: var(--bg-primary);
}

.compare-dropdown-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    object-fit: contain;
    background: var(--color-icon-bg);
}

.compare-dropdown-name {
    font-weight: 600;
    color: var(--text-heading);
}

.compare-dropdown-cat {
    font-size: 12px;
    color: var(--text-muted);
}

/* 对比表格 */
.compare-table-wrap {
    overflow-x: auto;
    margin-bottom: 32px;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.compare-table th,
.compare-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
}

.compare-table th {
    background: var(--bg-primary);
    font-weight: 700;
    color: var(--text-heading);
    font-size: 14px;
    position: sticky;
    top: 0;
}

.compare-table td {
    font-size: 14px;
    color: var(--text-body);
    line-height: 1.6;
}

.compare-table tr:last-child td {
    border-bottom: none;
}

.compare-table tr:hover td {
    background: var(--bg-primary);
}

.compare-tool-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.compare-tool-header .tool-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-heading);
    text-align: center;
}

.compare-tool-header .tool-visit-btn {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 6px;
    background: var(--color-primary);
    color: var(--color-on-primary);
    text-decoration: none;
    transition: background 0.2s;
}

.compare-tool-header .tool-visit-btn:hover {
    background: var(--color-primary-dark);
}

.compare-stars {
    font-size: 16px;
    letter-spacing: 2px;
}

.compare-tag {
    display: inline-block;
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 10px;
    background: var(--color-primary);
    color: var(--color-on-primary);
    margin: 2px 4px 2px 0;
}

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

.compare-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

/* 暗色模式补充 */
[data-theme="dark"] .compare-slot {
    border-color: var(--border-color);
}

[data-theme="dark"] .compare-dropdown {
    background: var(--bg-card);
    border-color: var(--border-color);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .compare-selector {
        flex-direction: column;
    }
    .compare-slot {
        min-width: unset;
    }
    .compare-title {
        font-size: 22px;
    }
    .compare-table {
        min-width: 600px;
    }
    .compare-modal {
        max-width: 100%;
        max-height: 90vh;
    }
}
