/* ═══ 统一顶部栏（Header + 导航合并） ═══ */
.header {
  background: #ffffff;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 1px 8px rgba(0,0,0,.04);
  position: sticky;
  top: 0;
  z-index: 200;
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 标题 Logo 渐变文字 */
.header h1 {
  font-size: 22px;
  font-weight: 800;
  background: var(--bg-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.5px;
}
.header h1 span {
  font-size: 13px;
  opacity: 0.8;
  font-weight: 500;
  -webkit-text-fill-color: var(--text-muted);
  display: inline-block;
  margin-left: 10px;
}

/* 顶部导航链接 */
.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.header-nav a {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}
.header-nav a:hover {
  background: #f1f5f9;
  color: var(--primary-color);
}
[data-theme="dark"] .header-nav a:hover {
  background: #1e293b;
}
@media (max-width: 768px) {
  .header-nav {
    display: flex;
    gap: 2px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .header-nav::-webkit-scrollbar { display: none; }
  .header-nav a {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
    flex-shrink: 0;
  }
}

/* 全局导航栏 — 嵌入在 header 底部 */
.global-nav {
  background: transparent;
  border-bottom: none;
  box-shadow: none;
  position: static;
  z-index: auto;
  border-top: 1px solid #f1f5f9;
}
.global-nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 24px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.global-nav-inner::-webkit-scrollbar { display: none; }
.gn-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: all .2s ease;
  background: transparent;
  border: 1px solid transparent;
}
.gn-item:hover {
  background: linear-gradient(135deg, rgba(37,99,235,0.06) 0%, rgba(79,70,229,0.06) 100%);
  color: var(--primary-color);
  border-color: rgba(37,99,235,0.1);
}
.gn-item:first-child { /* 工具排行高亮 */
  color: var(--primary-color);
  font-weight: 600;
  background: linear-gradient(135deg, rgba(37,99,235,0.08) 0%, rgba(79,70,229,0.08) 100%);
}
@media (max-width: 768px) {
  .header-inner { padding: 10px 16px; }
  .global-nav-inner { padding: 6px 14px; gap: 0; }
  .gn-item { padding: 5px 11px; font-size: 12px; border-radius: 16px; }
}

:root {
  /* 基础主色调: 渐变绿色系 (与中文站 aitoollab.cn 一致) */
  --primary-color: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary-color: #4f46e5;
  --accent-color: #3b82f6;
  --bg-gradient: linear-gradient(135deg, #1d4ed8 0%, #4f46e5 100%);
  --text-gradient: linear-gradient(135deg, #1d4ed8 0%, #4f46e5 100%);
  
  /* 文本颜色 */
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #f8fafc;
  
  /* 背景与表面层 */
  --body-bg: #f1f5f9;
  --surface-bg: #ffffff;
  
  /* 毛玻璃拟态 (Glassmorphism) */
  --glass-bg: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.3);
  --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);

  /* 阴影效果层级 */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.09);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.12);
  --shadow-hover: 0 20px 40px rgba(0, 166, 79, 0.18);
  
  /* 圆角大小 */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;

  /* 过渡动画时长 */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 暗色模式 */
[data-theme="dark"] {
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --text-light: #f8fafc;
  --body-bg: #0f172a;
  --surface-bg: #1e293b;
  --glass-bg: rgba(30, 41, 59, 0.4);
  --glass-border: rgba(59, 130, 246, 0.2);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-hover: 0 20px 40px rgba(0, 166, 79, 0.25);
}
[data-theme="dark"] .header {
  background: rgba(15, 23, 42, 0.92);
  border-bottom-color: #1e293b;
  backdrop-filter: blur(12px);
}
[data-theme="dark"] .header h1 span {
  -webkit-text-fill-color: #94a3b8;
}
[data-theme="dark"] footer {
  border-top-color: #1e293b;
}
[data-theme="dark"] .tool-card {
  border-color: rgba(148, 163, 184, 0.08);
}
[data-theme="dark"] .tool-meta-row {
  border-top-color: #1e293b;
}
[data-theme="dark"] .tool-card:hover .tag {
  background: rgba(0, 166, 79, 0.15);
}
[data-theme="dark"] .article-card {
  background: var(--surface-bg);
}
[data-theme="dark"] .sidebar-widget {
  border-color: #1e293b;
}
[data-theme="dark"] .sidebar-widget h4 {
  border-bottom-color: #1e293b;
}
[data-theme="dark"] .sidebar-widget li {
  border-bottom-color: #1e293b;
}
[data-theme="dark"] .quick-stats {
  background: var(--surface-bg);
}

/* 暗色模式切换按钮 */
.dark-toggle-fab {
  position: fixed;
  right: 24px;
  bottom: 90px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface-bg);
  color: var(--text-main);
  border: 1px solid #e2e8f0;
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: 99;
  transition: var(--transition);
}
.dark-toggle-fab:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}
[data-theme="dark"] .dark-toggle-fab {
  background: #334155;
  border-color: #475569;
}
@media (max-width: 768px) {
  .dark-toggle-fab {
    right: 14px;
    bottom: 72px;
    width: 40px;
    height: 40px;
  }
}

/* 全局重置 — 防止横向溢出 */
html {
  width: 100%;
  overflow-x: clip;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

body {
  width: 100%;
  overflow-x: clip;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background-color: var(--body-bg);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }
@media (max-width: 768px) {
  .tool-card { word-break: break-word; overflow-wrap: anywhere; }
  .tool-info p { overflow-wrap: anywhere; word-break: break-word; }
  .hero { max-width: 100vw; overflow-x: clip; }
}

/* 隐藏滚动条增强现代感 (可选) */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--body-bg);
}
::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: var(--radius-pill);
}

/* 搜索框：集成在 Hero 内（Western style）*/
.hero-search {
  display: flex;
  max-width: 560px;
  margin: 24px auto 0;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-pill);
  overflow: hidden;
  backdrop-filter: blur(8px);
  transition: var(--transition);
}
.hero-search:focus-within {
  background: rgba(255,255,255,0.28);
  border-color: rgba(255,255,255,0.4);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.hero-search input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 14px 24px;
  color: #fff;
  font-size: 16px;
  outline: none;
  min-width: 0;
}
.hero-search input::placeholder { color: rgba(255,255,255,0.65); }
.hero-search button {
  border: none;
  background: rgba(255,255,255,0.2);
  color: #fff;
  padding: 14px 22px;
  cursor: pointer;
  font-size: 18px;
  transition: var(--transition);
  flex-shrink: 0;
}
.hero-search button:hover { background: rgba(255,255,255,0.35); }

/* 分类快捷导航 */
.hero-categories {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 24px;
  position: relative;
  z-index: 1;
}
.hero-categories a {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-pill);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  backdrop-filter: blur(4px);
}
.hero-categories a:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .hero-search { margin: 16px 16px 0; }
  .hero-search input { padding: 12px 16px; font-size: 14px; }
  .hero-categories { gap: 6px; margin-top: 16px; }
  .hero-categories a { padding: 5px 12px; font-size: 12px; }
}

/* 社交证明（Western pattern — 品牌logo墙） */
.social-proof {
  text-align: center;
  padding: 20px 16px;
  font-size: 13px;
  color: var(--text-muted);
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.sp-brand {
  font-weight: 700;
  color: var(--text-main);
  font-size: 13px;
  padding: 2px 8px;
  background: #f1f5f9;
  border-radius: 4px;
}
[data-theme="dark"] .sp-brand {
  background: #1e293b;
}

/* Featured Tool 高亮卡片 */
.featured-tool {
  max-width: 680px;
  margin: 24px auto 32px;
  padding: 20px;
  background: var(--surface-bg);
  border: 1px solid var(--primary-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(37, 99, 235, 0.1);
  transition: var(--transition);
}
.featured-tool:hover {
  box-shadow: 0 8px 30px rgba(37, 99, 235, 0.18);
  transform: translateY(-2px);
}
.ft-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary-color);
  background: rgba(37, 99, 235, 0.08);
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 12px;
}
.ft-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}
[data-theme="dark"] .featured-tool {
  background: var(--surface-bg);
}
[data-theme="dark"] .ft-badge {
  background: rgba(59, 130, 246, 0.15);
}

/* 英雄区 (Hero) — 西方风格：搜索即行动号召 */
.hero {
  background: var(--bg-gradient);
  padding: 100px 24px 80px;
  text-align: center;
  color: var(--text-light);
  position: relative;
}
/* 英雄区：背景装饰光晕 */
.hero::before {
  content: '';
  position: absolute;
  top: -50%; left: -10%;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -30%; right: -5%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero h2 {
  font-size: 44px;
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: -1px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.hero p {
  font-size: 18px;
  opacity: 0.95;
  max-width: 640px;
  margin: 0 auto 20px;
  line-height: 1.7;
  font-weight: 400;
}

/* 快捷工具胶囊栏 */
.hero .stats {
  display: flex;
  justify-content: center;
  gap: 50px;
  margin-top: 40px;
}
.hero .stat {
  text-align: center;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 16px 30px;
  border-radius: var(--radius-md);
  box-shadow: var(--glass-shadow);
  transition: var(--transition);
}
.hero .stat:hover {
  transform: translateY(-5px);
  background: rgba(255,255,255,0.25);
}
.hero .stat .num {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 4px;
}
.hero .stat .label {
  font-size: 14px;
  opacity: 0.9;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* 主容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* 面包屑导航 */
.breadcrumb {
  max-width: 1200px;
  margin: -20px auto 20px;
  padding: 0 24px;
  font-size: 14px;
  color: var(--text-muted);
}
.breadcrumb a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}
.breadcrumb a:hover {
  text-decoration: underline;
}

/* 分类筛选面板 */
.categories {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.cat-btn {
  padding: 10px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--surface-bg);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.cat-btn:hover {
  color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.cat-btn.active {
  background: var(--bg-gradient);
  color: #fff;
  box-shadow: var(--shadow-md);
  transform: scale(1.05); /* 激活时细微放大 */
}

/* 邮件订阅区 */
.newsletter {
  background: var(--surface-bg);
  border-radius: var(--radius-lg);
  padding: 50px 40px;
  text-align: center;
  color: var(--text-main);
  margin-bottom: 50px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid #f1f5f9;
}
/* 增加 newsletter 内的一点背景装缀 */
.newsletter::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: var(--bg-gradient);
}
.newsletter h3 {
  font-size: 26px;
  margin-bottom: 12px;
  font-weight: 800;
  background: var(--bg-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.newsletter p {
  color: var(--text-muted);
  margin-bottom: 25px;
  font-size: 16px;
}
.newsletter .email-form {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 480px;
}
.newsletter input {
  flex: 1;
  padding: 16px 20px;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  font-size: 15px;
  transition: var(--transition);
  outline: none;
}
.newsletter input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}
.newsletter button {
  padding: 16px 32px;
  background: var(--bg-gradient);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Pagination */
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 40px 12px;
}
.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  background: var(--surface-bg);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}
.page-link:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-2px);
}
@media (max-width: 768px) {
  .pagination { gap: 5px; margin: 32px 8px; }
  .page-link { min-width: 36px; height: 36px; font-size: 13px; padding: 0 9px; }
}
.page-link.active {
  background: var(--bg-gradient);  color: #fff;
  border-color: transparent;
}

.newsletter button:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* 布局结构 */
.main-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  align-items: start;
}
@media (max-width: 992px) {
  .main-layout { grid-template-columns: 1fr; }
}

/* Section 基础样式 */
.section { margin-bottom: 50px; }
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 25px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 12px;
}
.section h3 {
  font-size: 22px;
  color: var(--text-main);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section h3 span {
  font-size: 12px;
  background: #ffe4e6;
  color: #e11d48;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  vertical-align: middle;
  letter-spacing: 1px;
}
.section a {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  transition: var(--transition);
}
.section a:hover {
  color: var(--secondary-color);
  transform: translateX(3px);
}

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

/* 工具网格：响应式3列布局 */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 900px) {
  .tool-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .tool-grid { grid-template-columns: 1fr; }
}

/* 工具卡片 */
.tool-card {
  background: var(--surface-bg);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.04);
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}
.tool-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(0, 166, 79, 0.25);
}

.tool-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 14px;
  flex-shrink: 0;
}
.tool-info { flex: 1; display: flex; flex-direction: column; }
.tool-info h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tool-info h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 6px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tool-info p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}
.tool-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
  font-size: 13px;
  color: var(--text-muted);
  gap: 8px;
  flex-wrap: wrap;
}
.tool-meta-row span {
  min-width: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}
@media (max-width: 768px) {
  .tool-meta-row { font-size: 12px; }
}

/* 标签系统 */
.tool-card .tag {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  color: var(--text-muted);
  font-weight: 500;
  transition: var(--transition);
}
.tool-card:hover .tag {
  background: #dbeafe;
  color: var(--primary-color);
}
.tool-card .tag.hot {
  background: #fef2f2;
  color: #ef4444;
}
.tool-card .tag.free {
  background: #eff6ff;
  color: #16a34a;
}
.badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  vertical-align: middle;
}

/* 侧边栏 (Sidebar) 优化 */
.main-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}
.main-content { min-width: 0; }
.home-sidebar { position: sticky; top: 80px; }
.sidebar-widget {
  background: var(--surface-bg);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.04);
}
.sidebar-widget h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 14px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid #f1f5f9;
}
.sidebar-widget ol a:hover {
  color: var(--primary-color) !important;
}

@media (max-width: 900px) {
  .main-layout { grid-template-columns: 1fr; }
  .home-sidebar { position: static; }
}
.sidebar-card {
  background: var(--surface-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.03);
}
.sidebar-card h4 {
  font-size: 18px;
  margin-bottom: 20px;
  color: var(--text-main);
  font-weight: 700;
  padding-bottom: 12px;
  border-bottom: 2px solid #f1f5f9;
}
/* 当 h4 在 sidebar-card-header 内时，由 header 承担分割线，h4 本身不加 */
.sidebar-card-header h4 {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}
.sidebar-card ul { list-style: none; }
.sidebar-card li {
  padding: 12px 0;
  border-bottom: 1px solid #f8fafc;
  font-size: 14px;
}
.sidebar-card li:last-child { border-bottom: none; }
.sidebar-card li a {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  display: flex;
  align-items: center;
}
.sidebar-card li a::before {
  content: '→';
  color: var(--text-muted);
  margin-right: 8px;
  font-size: 12px;
  opacity: 0;
  transform: translateX(-10px);
  transition: var(--transition);
}
.sidebar-card li a:hover {
  color: var(--primary-color);
  padding-left: 5px;
}
.sidebar-card li a:hover::before {
  opacity: 1;
  transform: translateX(0);
  color: var(--primary-color);
}

/* 内部动态加载文章列表的特有样式覆盖 */
.sidebar-card #articleList li {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-card #articleList li .date {
  font-size: 12px;
  color: #94a3b8;
}
.sidebar-card #articleList li .title {
  color: var(--text-main);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  transition: var(--transition);
}
.sidebar-card #articleList li .title:hover {
  color: var(--primary-color);
}

/* 特殊角标 */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-new { background: #10b981; color: #fff; }
.badge-hot { background: #ef4444; color: #fff; }
.badge-pick { background: #f59e0b; color: #fff; }

/* 页脚区域 */
.footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 50px 24px;
  text-align: center;
  margin-top: 60px;
  border-top: 4px solid var(--primary-color);
}
.footer a {
  color: #cbd5e1;
  text-decoration: none;
  transition: var(--transition);
}
.footer a:hover {
  color: #fff;
}
.footer-links {
  margin-top: 25px;
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
}
.footer-links a {
  font-size: 14px;
  font-weight: 500;
}

/* ========== 工具详情页 & 文章页样式 ========== */

/* 文章容器 */
.article-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 20px 24px 60px;
}

/* 工具头部 */
.tool-header {
  background: var(--surface-bg);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(0,0,0,0.03);
}
.tool-header-top {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin-bottom: 24px;
}
.tool-icon-lg {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  flex-shrink: 0;
  box-shadow: inset 0 -2px 5px rgba(0,0,0,0.05);
}
.tool-header-info {
  flex: 1;
}
.tool-header-info h2 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.tool-header-info .subtitle {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
}
.rating-bar {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
}

/* 工具元信息 */
.tool-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  padding: 20px 0;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 20px;
}
.tool-meta-item {
  font-size: 14px;
  color: var(--text-muted);
}
.tool-meta-item strong {
  color: var(--text-main);
}

/* 操作按钮 */
.action-bar {
  display: flex;
  gap: 12px;
}
.action-btn {
  display: inline-flex;
  align-items: center;
  padding: 14px 32px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}
.action-btn-primary {
  background: var(--bg-gradient);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.action-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: #fff;
}

/* 功能网格 */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}
.feature-item {
  background: var(--surface-bg);
  padding: 16px;
  border-radius: var(--radius-md);
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.03);
  transition: var(--transition);
}
.feature-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: var(--primary-color);
}

/* 文章正文 */
.article-body {
  background: var(--surface-bg);
  border-radius: var(--radius-lg);
  padding: 40px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.03);
  line-height: 1.8;
  font-size: 16px;
  color: var(--text-main);
}
.article-body h1 {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 16px;
  line-height: 1.3;
}
.article-body h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-main);
  margin: 32px 0 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e2e8f0;
}
.article-body h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin: 24px 0 12px;
}
.article-body p {
  margin-bottom: 16px;
  color: #334155;
}
.article-body ul, .article-body ol {
  padding-left: 24px;
  margin-bottom: 16px;
}
.article-body li {
  margin-bottom: 8px;
  color: #334155;
  line-height: 1.7;
}
.article-body strong {
  color: var(--text-main);
  font-weight: 600;
}
.article-body code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
  color: #e11d48;
}
.article-body pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 20px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.6;
}
.article-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}
.article-body blockquote {
  border-left: 4px solid var(--primary-color);
  padding: 12px 20px;
  margin: 16px 0;
  background: #f8fafc;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: #475569;
  font-style: italic;
}

/* 表格样式 */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}
.article-body table th {
  background: var(--bg-gradient);
  color: #fff;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
}
.article-body table th:first-child {
  border-radius: var(--radius-sm) 0 0 0;
}
.article-body table th:last-child {
  border-radius: 0 var(--radius-sm) 0 0;
}
.article-body table td {
  padding: 12px 16px;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
}
.article-body table tr:hover td {
  background: #f8fafc;
}
.article-body table tr:last-child td:first-child {
  border-radius: 0 0 0 var(--radius-sm);
}
.article-body table tr:last-child td:last-child {
  border-radius: 0 0 var(--radius-sm) 0;
}

/* 优缺点 */
.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 32px;
}
@media (max-width: 640px) {
  .pros-cons { grid-template-columns: 1fr; }
}
.pros-cons .pros,
.pros-cons .cons {
  background: var(--surface-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.03);
}
.pros-cons h4 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}
.pros-cons ul {
  list-style: none;
  padding: 0;
}
.pros-cons li {
  padding: 8px 0;
  border-bottom: 1px dashed #e2e8f0;
  font-size: 14px;
  color: #334155;
}
.pros-cons li:last-child {
  border-bottom: none;
}

/* 工具信息图 */
.tool-infographic {
  margin: 32px 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(0,0,0,0.06);
}
.tool-infographic img {
  width: 100%;
  height: auto;
  display: block;
}
.tool-infographic figcaption {
  padding: 12px 20px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
  background: var(--surface-bg);
  border-top: 1px solid rgba(0,0,0,0.04);
}

/* 相关推荐 */
.related-tools {
  margin-bottom: 32px;
}
.related-tools h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-main);
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}
.related-card {
  background: var(--surface-bg);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.03);
  transition: var(--transition);
}
.related-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(79, 70, 229, 0.2);
}

/* 工具页头部响应式 */
@media (max-width: 640px) {
  .tool-header-top {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .tool-header-info h2 {
    justify-content: center;
  }
  .article-body {
    padding: 24px 16px;
  }
  .tool-header {
    padding: 20px;
  }
}

/* ========== 文章列表页 ========== */
.articles-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 40px;
}

.article-card {
  background: var(--surface-bg, #fff);
  border-radius: 12px;
  padding: 24px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.article-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.article-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 8px 0;
  line-height: 1.5;
}

.article-card h3 a {
  color: var(--text-main, #1e293b);
  text-decoration: none;
}

.article-card h3 a:hover {
  color: var(--primary-color, #2563eb);
}

.article-meta {
  display: flex;
  gap: 12px;
  font-size: 13px;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 10px;
}

.article-card .summary {
  font-size: 14px;
  color: var(--text-secondary, #475569);
  line-height: 1.7;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========== 分页控件 ========== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px 0 16px;
}

.pagination a {
  display: inline-flex;
  align-items: center;
  padding: 10px 20px;
  background: var(--primary-color, #2563eb);
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.15s ease;
}

.pagination a:hover {
  background: #5a67d8;
  transform: translateY(-1px);
}

.pagination .page-info {
  font-size: 14px;
  color: var(--text-muted, #94a3b8);
  min-width: 60px;
  text-align: center;
}

@media (max-width: 480px) {
  .article-card {
    padding: 16px;
  }
  .pagination {
    gap: 6px;
    flex-wrap: wrap;
  }
  .pagination a {
    padding: 8px 12px;
    font-size: 13px;
    min-width: 36px;
    height: 36px;
  }
}

/* ========== Back-to-top ========== */
#backToTop {
  position: fixed;
  right: 24px;
  bottom: 30px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-gradient);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease, box-shadow 0.2s ease;
  z-index: 999;
  pointer-events: none;
}
#backToTop.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#backToTop:hover {
  box-shadow: 0 6px 24px rgba(79, 70, 229, 0.5);
  transform: translateY(-2px);
}
#backToTop svg {
  width: 20px;
  height: 20px;
}
@media (max-width: 768px) {
  #backToTop {
    right: 14px;
    bottom: 24px;
    width: 40px;
    height: 40px;
  }
  #backToTop svg {
    width: 18px;
    height: 18px;
  }
}

/* ========================================
   GEO Styles — TL;DR, Key Stats, Author Block, Trust
   ======================================== */

/* TL;DR box (tool & article pages) */
.tldr-box {
  background: linear-gradient(135deg, #fff8e6, #ffefb8);
  border-left: 4px solid #f5a623;
  padding: 16px 20px;
  margin-bottom: 24px;
  border-radius: 0 8px 8px 0;
  font-size: 14.5px;
  line-height: 1.7;
}
.tldr-box strong {
  color: #c77d00;
  font-size: 15px;
}
.tldr-box p {
  color: #555;
  margin: 8px 0 0 0;
}

/* Key Statistics (tool pages) */
.key-stats {
  margin-bottom: 24px;
}
.key-stats h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
}
.ks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.ks-item {
  background: var(--surface-bg);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--radius-sm);
  padding: 14px 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.ks-val {
  display: block;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-color);
  margin-bottom: 4px;
}
.ks-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Author trust block (tool pages) */
.author-block {
  margin: 32px 0;
}
.author-block-inner {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid var(--primary-color);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 20px 24px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.author-avatar {
  font-size: 28px;
  width: 48px;
  height: 48px;
  background: var(--bg-gradient);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.author-body {
  flex: 1;
}
.author-label {
  margin: 0 0 6px 0;
  font-size: 14px;
  color: var(--text-main);
}
.author-text {
  font-size: 13.5px;
  color: #475569;
  line-height: 1.7;
  margin: 0 0 8px 0;
}
.author-text a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}
.author-meta {
  font-size: 12px;
  color: #94a3b8;
  margin: 0;
}
.author-meta a {
  color: var(--primary-color);
  text-decoration: none;
}

/* Quick Stats strip (homepage) */
.quick-stats {
  max-width: 900px;
  margin: 0 auto 32px;
  padding: 20px 16px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.qs-item {
  text-align: center;
  background: var(--surface-bg);
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  box-shadow: var(--shadow-sm);
}
.qs-num {
  display: block;
  font-size: 26px;
  font-weight: 800;
  background: var(--bg-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}
.qs-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Trust section (homepage) */
.trust-section {
  max-width: 1100px;
  margin: 0 auto 40px;
  padding: 0 20px;
}
.trust-section h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 16px;
  text-align: center;
}
.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}
.trust-card {
  background: var(--surface-bg);
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}
.trust-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.trust-icon {
  font-size: 24px;
  margin-bottom: 10px;
}
.trust-card h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 8px 0;
}
.trust-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

/* Responsive for Quick Stats & Trust */
@media (max-width: 640px) {
  .quick-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .trust-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== 最新文章标题行 ========== */
.sidebar-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f1f5f9;
}
.sidebar-card-header h4 {
  font-size: 18px;
  color: var(--text-main);
  margin: 0;
  padding: 0;
  border: none;
}
.sidebar-more-link {
  font-size: 14px;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 2px;
}
.sidebar-more-link:hover {
  color: var(--secondary-color);
  text-decoration: underline;
}

/* ========================================
   Live Dashboard Styles (Phase 5b)
   ======================================== */

/* Live Navigation Tabs */
.live-nav {
  background: var(--primary-color);
  border-bottom: 2px solid rgba(255,255,255,0.1);
  padding: 0;
  position: sticky;
  top: 60px;
  z-index: 90;
}
.live-nav .container {
  display: flex;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.live-nav .container::-webkit-scrollbar {
  display: none;
}
.live-nav a {
  display: block;
  padding: 14px 20px;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
}
.live-nav a:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}
.live-nav a.active {
  color: #fff;
  border-bottom-color: #fbbf24;
  background: rgba(255,255,255,0.12);
}

/* Live Section */
.live-section {
  background: var(--surface-bg);
  border-radius: var(--radius-md);
  padding: 28px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.04);
}
.live-section.fullwidth {
  padding: 28px 20px;
}
.live-section h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}
.live-section .desc {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 20px;
}

/* Live Stats Grid */
.live-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--surface-bg);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.04);
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.stat-card.stat-primary {
  background: var(--bg-gradient);
  color: #fff;
  border: none;
}
.stat-card.stat-primary .stat-label {
  color: rgba(255,255,255,0.85);
}
.stat-number {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}
.stat-card.stat-primary .stat-number {
  color: #fff;
}
.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Last Update */
.last-update {
  display: inline-block;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--body-bg);
  padding: 6px 14px;
  border-radius: 20px;
  margin-top: 8px;
}

/* Methodology Note */
.methodology-note {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-size: 13px;
  color: #92400e;
  margin-top: 12px;
  line-height: 1.6;
}

/* Price Distribution Bar */
.price-dist-bar {
  display: flex;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.08);
}
.price-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 12px;
  gap: 6px;
  min-width: 100px;
}
.price-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 12px;
  color: #fff;
}
.price-badge.free { background: #10b981; }
.price-badge.freemium { background: #f59e0b; }
.price-badge.paid { background: #ef4444; }
.price-count {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

/* Trend Preview List (Dashboard) */
.trend-preview-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.trend-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--body-bg);
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.trend-cat-icon { font-size: 18px; }
.trend-cat-name { font-weight: 600; color: var(--text-main); flex: 1; }
.trend-cat-val { font-weight: 700; color: var(--text-main); min-width: 40px; text-align: right; }

/* Table Responsive */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
}

/* Live Matrix Table */
.live-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.live-matrix-table thead {
  background: var(--body-bg);
}
.live-matrix-table th {
  padding: 12px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--text-main);
  font-size: 13px;
  white-space: nowrap;
  border-bottom: 2px solid var(--primary-color);
}
.live-matrix-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-main);
  vertical-align: middle;
}
.live-matrix-table tbody tr:hover {
  background: #f8fafc;
}
.live-matrix-table .num {
  text-align: center;
  font-weight: 600;
  white-space: nowrap;
}
.live-matrix-table .tool-link-cell {
  white-space: nowrap;
}
.badge-cell, .level-cell {
  text-align: center;
}
.badge-yes { color: #10b981; font-weight: 700; }
.badge-no { color: #ef4444; font-weight: 700; }
.star-level { color: #f59e0b; letter-spacing: 1px; }

/* Button variants */
.btn.btn-sm {
  display: inline-block;
  padding: 8px 18px;
  font-size: 13px;
  background: var(--primary-color);
  color: #fff;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
}
.btn.btn-sm:hover {
  background: var(--secondary-color);
  color: #fff;
}
.btn.btn-xs {
  display: inline-block;
  padding: 4px 12px;
  font-size: 12px;
  background: var(--primary-color);
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s;
}
.btn.btn-xs:hover {
  background: var(--secondary-color);
  color: #fff;
}

/* Battle Preview Grid (Dashboard) */
.battle-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.battle-preview-card {
  background: var(--body-bg);
  border-radius: var(--radius-sm);
  padding: 20px;
  border-left: 4px solid var(--primary-color);
}
.battle-preview-card h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}
.battle-preview-card .verdict-sm {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Trend Cards Grid (Trend Tracker) */
.trend-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.trend-card {
  background: var(--body-bg);
  border-radius: var(--radius-sm);
  padding: 16px;
  border-left: 4px solid #94a3b8;
  transition: transform 0.2s;
}
.trend-card:hover {
  transform: translateY(-2px);
}
.trend-card.trend-hot { border-left-color: #ef4444; }
.trend-card.trend-up { border-left-color: #10b981; }
.trend-card.trend-stable { border-left-color: #f59e0b; }

.trend-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.trend-ct-icon { font-size: 16px; }
.trend-ct-name { font-weight: 600; font-size: 14px; color: var(--text-main); flex: 1; }
.trend-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #f1f5f9;
  color: var(--text-muted);
  font-weight: 600;
}
.trend-card.trend-hot .trend-tag { background: #fef2f2; color: #ef4444; }
.trend-card.trend-up .trend-tag { background: #ecfdf5; color: #10b981; }
.trend-card.trend-stable .trend-tag { background: #fffbeb; color: #f59e0b; }

.trend-body {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}
.trend-big-num {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
}
.trend-pct {
  font-size: 14px;
  font-weight: 700;
}
.trend-tool-count {
  font-size: 12px;
  color: var(--text-muted);
}

.spark-line {
  margin-top: 8px;
}
.spark-line svg {
  display: block;
  width: 100%;
  height: 40px;
}

/* Heatmap (Market Heatmap) */
.heatmap-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.heat-row {
  display: grid;
  grid-template-columns: 180px 1fr 120px;
  gap: 12px;
  align-items: stretch;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}
.heat-row:last-child {
  border-bottom: none;
}
.heat-category {
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-content: center;
}
.heat-cat-icon { font-size: 20px; }
.heat-cat-name { font-size: 14px; font-weight: 700; color: var(--text-main); }
.heat-cat-meta { font-size: 12px; color: var(--text-muted); }

.heat-prices {
  display: flex;
  gap: 8px;
}
.heat-cell {
  flex: 1;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  border: 1px solid;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: transform 0.15s;
}
.heat-cell:hover {
  transform: scale(1.02);
}
.heat-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
}
.heat-count {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
}
.heat-tools {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.heat-rec {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.heat-feature {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* Battle (Head to Head) */
.battle-container {
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.battle-card {
  background: var(--surface-bg);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.04);
}
.battle-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  text-align: center;
  margin-bottom: 20px;
}

.battle-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 24px;
}
.team-a, .team-b {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.team-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}
.score {
  font-size: 40px;
  font-weight: 900;
  color: var(--primary-color);
}
.vs-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: var(--bg-gradient);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

/* Battle Dimension Table */
.battle-dim-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-bottom: 20px;
}
.battle-dim-table thead {
  background: var(--body-bg);
}
.battle-dim-table th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-main);
  border-bottom: 2px solid var(--primary-color);
}
.battle-dim-table th:nth-child(2) { text-align: center; }
.battle-dim-table th:nth-child(3) { text-align: center; }
.battle-dim-table td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-main);
}
.battle-dim-table .dim-name {
  font-weight: 600;
  white-space: nowrap;
}
.battle-dim-table .dim-val-a,
.battle-dim-table .dim-val-b {
  text-align: center;
  font-size: 13px;
}

/* Battle Verdict */
.battle-verdict {
  background: linear-gradient(135deg, #eff6ff, #f0f9ff);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-size: 14px;
  color: #1e40af;
  line-height: 1.7;
}
.battle-verdict strong {
  color: #1e3a8a;
}

/* ========================================
   Live Dashboard — Mobile Responsive
   ======================================== */
@media (max-width: 768px) {
  .live-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .stat-number { font-size: 22px; }
  .stat-label { font-size: 12px; }
  .live-section { padding: 18px 14px; }
  .trend-cards-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .battle-preview-grid { grid-template-columns: 1fr; }
  .battle-card { padding: 18px 14px; }
  .battle-title { font-size: 17px; }
  .score { font-size: 32px; }
  .battle-dim-table { font-size: 12px; }
  .battle-dim-table th, .battle-dim-table td { padding: 8px 6px; }

  .heat-row {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px 0;
    background: var(--body-bg);
    border-radius: var(--radius-sm);
    padding: 12px;
  }
  .heat-category {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  .heat-rec {
    flex-direction: row;
    justify-content: flex-end;
  }

  .live-nav a {
    padding: 12px 14px;
    font-size: 13px;
  }
}
@media (max-width: 480px) {
  .live-stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .trend-cards-grid { grid-template-columns: 1fr; }
  .price-dist-bar { flex-direction: column; }
  .price-item { padding: 14px; }
  .battle-vs { gap: 12px; }
  .score { font-size: 28px; }
  .vs-badge { width: 38px; height: 38px; font-size: 12px; }
}

/* ===========================================
   综合移动端适配（< 768px）
   =========================================== */
@media (max-width: 768px) {
  /* Header: 收紧间距 */
  .header-inner {
    padding: 10px 16px;
  }
  .header h1 {
    font-size: 17px;
    gap: 4px;
  }
  .header h1 span {
    font-size: 11px;
    margin-left: 4px;
  }
  .header h1 br { display: none; }

  /* Hero: 大幅压缩 */
  .hero {
    padding: 56px 16px 40px;
  }
  .hero h2 {
    font-size: 26px;
    line-height: 1.25;
    margin-bottom: 12px;
  }
  .hero p {
    font-size: 14px;
    line-height: 1.55;
    margin-bottom: 0;
  }
  .hero-categories {
    gap: 6px;
    margin-top: 16px;
  }
  .hero-categories a {
    padding: 5px 12px;
    font-size: 12px;
  }
  .hero-search {
    margin: 18px 8px 0;
  }
  .hero-search input {
    padding: 12px 16px;
    font-size: 14px;
  }

  /* 缩短 hero ::before/::after 装饰 */
  .hero::before { width: 250px; height: 250px; }
  .hero::after { width: 200px; height: 200px; }

  /* Quick Stats: 2x2 网格 */
  .quick-stats {
    padding: 12px;
    gap: 8px;
    margin: 0 auto 24px;
  }
  .qs-item {
    padding: 12px 8px;
  }
  .qs-num { font-size: 22px; }
  .qs-label { font-size: 10px; letter-spacing: 0; }

  /* Trust section: 单列 */
  .trust-section {
    padding: 0 16px;
    margin-bottom: 28px;
  }
  .trust-section h3 { font-size: 18px; }
  .trust-card { padding: 16px; }
  .trust-card h4 { font-size: 14px; }
  .trust-card p { font-size: 12px; }

  /* Social proof */
  .social-proof {
    padding: 16px 12px;
    font-size: 12px;
    gap: 5px;
  }
  .sp-brand { font-size: 12px; padding: 2px 6px; }

  /* Main layout */
  .main-layout {
    grid-template-columns: 1fr;
    padding: 0 16px;
    gap: 20px;
  }
  .home-sidebar { position: static; }

  /* 工具卡片：小屏适配 */
  .tool-card { padding: 16px; }
  .tool-icon { width: 44px; height: 44px; font-size: 22px; }
  .tool-info h3 { font-size: 15px; }
  .tool-info p { font-size: 12px; -webkit-line-clamp: 2; }

  /* 侧边栏 widget */
  .sidebar-widget { padding: 16px; }
  .sidebar-widget h4 { font-size: 14px; }
  .sidebar-widget li { font-size: 12px; padding: 6px 0; }

  /* Dark mode FAB */
  .dark-toggle-fab {
    right: 14px;
    bottom: 72px;
    width: 40px;
    height: 40px;
    font-size: 16px;
  }

  /* 文章列表 */
  .article-card { padding: 14px; }
  .article-card h3 { font-size: 15px; }
  .article-meta { font-size: 11px; flex-wrap: wrap; gap: 6px; }

  /* Footer */
  .footer {
    padding: 24px 16px;
    font-size: 12px;
    text-align: center;
  }

  /* 通用标题缩放 */
  h2 { font-size: 22px !important; }
  .qs-item, .trust-card, .article-card,
  .sidebar-widget, .tool-card { border-radius: 10px; }
}

@media (max-width: 480px) {
  .hero h2 { font-size: 22px; }
  .hero p { font-size: 13px; }
  .hero-categories a { font-size: 11px; padding: 4px 10px; }
  .qs-num { font-size: 18px; }
  .quick-stats { padding: 10px 8px; }
  .trust-card p, .tool-info p { font-size: 11px; }
  .sp-brand { font-size: 11px; }
  .article-card h3 { font-size: 14px; }
  .sidebar-widget li { font-size: 11px; }
}


/* ===== Voice read-aloud (TTS)（胶囊塞进第一个P段落开头，与朗读起点对齐） ===== */
.tts-bar{display:inline-flex;gap:6px;margin:0 8px;vertical-align:middle;font-weight:normal;}
.tts-btn{display:inline-flex;align-items:center;gap:4px;padding:4px 12px;border:1px solid #4f46e5;background:#4f46e5;color:#fff;font-size:13px;font-weight:600;border-radius:14px;cursor:pointer;transition:all .15s;font-family:inherit;vertical-align:middle;line-height:1.4;}
.tts-btn:hover{background:#4338ca;border-color:#4338ca;}
.tts-btn.tts-stop{background:#fff;color:#dc2626;border-color:#f0c2b8;}
.tts-btn.tts-stop:hover{background:#fff5f3;}
.tts-active{background:#fff7d6 !important;box-shadow:0 0 0 2px #ffe08a !important;transition:background .15s;border-radius:4px;}
