/* ============================================
   Lab2109 Dark Theme — 统一深色主题 CSS
   适用页面：主页(index.html) / 分页(page/*.html)
            / 工具导航(tools/index.html) / 文章详情(articles/*.html)
   ============================================ */

/* ── Reset & Base ─────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ── Design Tokens ────────────────────────── */
:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-card: #1c2333;
  --bg-hover: #252d3f;
  --bg-elevated: #1a2332;

  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;

  --border-color: #30363d;
  --border-light: #21262d;
  --border-hover: #58a6ff;

  --accent-blue: #58a6ff;
  --accent-green: #3fb950;
  --accent-orange: #d29922;
  --accent-red: #f85149;
  --accent-purple: #bc8cff;

  --header-bg: linear-gradient(135deg, #0d1117 0%, #161b22 50%, #1c2333 100%);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.3);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.4);

  --container-width: 960px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC",
               "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Cascadia Code", monospace;

  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
}

/* ── Base Body ────────────────────────────── */
body {
  font-family: var(--font-sans);
  line-height: 1.8;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent-blue); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: #79c0ff; }

/* ── Layout Container ─────────────────────── */
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 24px; }

/* ── Header (共用：主页/分页/tools/文章) ──── */
header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  padding: 24px 0;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
header h1 {
  font-size: 1.5em;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
header h1 a { color: var(--text-primary); text-decoration: none; }
header h1 a:hover { color: var(--accent-blue); }
.tagline { font-size: 0.85em; color: var(--text-secondary); }
.tagline a { color: var(--accent-blue); text-decoration: none; opacity: 0.85; }
.tagline a:hover { opacity: 1; text-decoration: underline; }

/* ── 主页文章列表 (index.html / page/*.html) ── */
section.articles { padding: 32px 0; }
section.articles h2 {
  font-size: 1.15em;
  font-weight: 600;
  color: var(--accent-blue);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 20px;
  width: 100%;
}

/* 文章卡片网格 */
#article-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.article-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all var(--transition-base);
  cursor: default;
}
.article-item:hover {
  border-color: var(--accent-blue);
  background: var(--bg-elevated);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.article-item h3 {
  font-size: 1em;
  font-weight: 500;
  line-height: 1.5;
  flex: 1;
}
.article-item h3 a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
.article-item h3 a:hover { color: var(--accent-blue); }
.article-item .meta {
  color: var(--text-muted);
  font-size: 0.8em;
  margin-top: 0;
}

/* ── 分页导航 (index.html / page/*.html) ──── */
.pagination {
  text-align: center;
  padding: 32px 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}
.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85em;
  font-weight: 500;
  transition: all var(--transition-fast);
}
.page-link {
  color: var(--text-secondary);
  background: var(--bg-card);
  text-decoration: none;
  border: 1px solid var(--border-color);
}
.page-link:hover {
  background: var(--bg-hover);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  transform: translateY(-1px);
}
.page-current {
  background: var(--accent-blue);
  color: #fff;
  border: 1px solid var(--accent-blue);
  font-weight: 600;
}

/* ── 文章详情页 (<article>) ────────────────── */
article { padding: 32px 0; }
article h1 {
  font-size: 1.6em;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.35;
}
article .meta {
  color: var(--text-muted);
  font-size: 0.85em;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
article .meta time { color: var(--text-muted); }
article .meta .category {
  display: inline-block;
  background: rgba(88,166,255,0.12);
  padding: 2px 12px;
  border-radius: var(--radius-full);
  font-size: 0.85em;
  color: var(--accent-blue);
  font-weight: 500;
}

/* ── 文章正文内容区 ────────────────────────── */
.content {
  font-size: 0.95em;
  line-height: 1.9;
  color: var(--text-secondary);
}
.content h2 {
  font-size: 1.25em;
  font-weight: 600;
  color: var(--text-primary);
  margin: 32px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}
.content h3 {
  font-size: 1.05em;
  font-weight: 600;
  color: var(--text-primary);
  margin: 24px 0 10px;
}
.content p { margin-bottom: 18px; color: var(--text-secondary); }
.content ul,
.content ol { margin: 8px 0 18px 1.8em; }
.content li { margin-bottom: 6px; }
.content strong { color: var(--text-primary); }
.content a { color: var(--accent-blue); }
.content a:hover { text-decoration: underline; }
.content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-secondary);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  color: var(--accent-orange);
}
.content blockquote {
  border-left: 3px solid var(--accent-blue);
  padding: 12px 20px;
  margin: 16px 0;
  background: var(--bg-secondary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-secondary);
}

/* ── 广告位 (文章页) ───────────────────────── */
.ad-placeholder {
  text-align: center;
  padding: 24px;
  margin: 32px 0;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-color);
}
.ad-placeholder p { color: var(--text-muted); font-size: 13px; }

/* ── Tools 导航页 ──────────────────────────── */
.hero-tools {
  text-align: center;
  padding: 28px 0 12px;
}
.hero-tools h1 {
  font-size: 1.6em;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.hero-tools p {
  color: var(--text-secondary);
  font-size: 0.9em;
}

.stats-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 20px 0 32px;
  flex-wrap: wrap;
}
.stat-item {
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  padding: 8px 18px;
  font-size: 0.85em;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  transition: border-color var(--transition-fast);
}
.stat-item:hover { border-color: var(--accent-blue); }
.stat-item strong { color: var(--accent-blue); font-size: 1.1em; }

/* Tools 分类标题 */
.tools-page { padding: 0 0 40px; }
.tools-section { margin-bottom: 32px; }
.tools-section h2 {
  font-size: 1em;
  font-weight: 600;
  padding: 6px 18px;
  margin-bottom: 16px;
  display: inline-block;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-color);
}
.tools-section[data-cat="AI写作"] h2 {
  background: rgba(88,166,255,0.12);
  color: var(--accent-blue);
  border-color: rgba(88,166,255,0.3);
}
.tools-section[data-cat="AI绘图"] h2 {
  background: rgba(248,81,73,0.12);
  color: var(--accent-red);
  border-color: rgba(248,81,73,0.3);
}
.tools-section[data-cat="AI编程"] h2 {
  background: rgba(63,185,80,0.12);
  color: var(--accent-green);
  border-color: rgba(63,185,80,0.3);
}
.tools-section[data-cat="AI视频音乐"] h2 {
  background: rgba(210,153,34,0.12);
  color: var(--accent-orange);
  border-color: rgba(210,153,34,0.3);
}
.tools-section[data-cat="AI效率"] h2 {
  background: rgba(188,140,255,0.12);
  color: var(--accent-purple);
  border-color: rgba(188,140,255,0.3);
}

/* Tools 卡片网格 */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.tool-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all var(--transition-base);
  cursor: default;
}
.tool-card:hover {
  border-color: var(--accent-blue);
  background: var(--bg-elevated);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.tool-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.tool-card h3 {
  font-size: 1em;
  font-weight: 600;
  flex: 1;
  line-height: 1.4;
}
.tool-card h3 a {
  color: var(--text-primary);
  text-decoration: none;
}
.tool-card h3 a:hover { color: var(--accent-blue); }
.tool-card .rating-badge {
  font-size: 0.8em;
  font-weight: 600;
  color: var(--accent-orange);
  flex-shrink: 0;
  background: rgba(210,153,34,0.1);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}
.tool-card .tool-desc {
  font-size: 0.82em;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── 工具详情页 (Tools 内页 /tool/xxx.html) ── */
.tool-review { padding: 24px 0; }
.tool-review h1 {
  font-size: 1.6em;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.tool-review .meta {
  color: var(--text-muted);
  font-size: 0.85em;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.tool-review .meta time { color: var(--text-muted); }
.tool-review .meta .category {
  display: inline-block;
  background: rgba(88,166,255,0.12);
  padding: 2px 12px;
  border-radius: var(--radius-full);
  font-size: 0.85em;
  color: var(--accent-blue);
  font-weight: 500;
}

/* Breadcrumb 面包屑 */
.breadcrumb {
  font-size: 0.85em;
  color: var(--text-muted);
  margin-bottom: 20px;
  padding: 8px 0;
}
.breadcrumb a { color: var(--accent-blue); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: var(--text-secondary); }

/* Tool Header — 工具头部信息卡片 */
.tool-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.tool-info { flex: 1; min-width: 200px; }
.tool-desc { color: var(--text-secondary); font-size: 0.95em; margin-bottom: 16px; line-height: 1.7; }
.tool-buttons { margin-top: 14px; }

/* 主按钮 */
.btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent-blue), #3b82f6);
  color: #fff !important;
  padding: 10px 28px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9em;
  transition: all var(--transition-fast);
  box-shadow: 0 2px 8px rgba(88,166,255,0.25);
}
.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(88,166,255,0.35);
}

/* 工具评分网格 */
.tool-ratings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 24px;
  min-width: 170px;
}
.rating-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 0.85em;
  border-bottom: 1px solid var(--border-light);
}
.rating-item:last-child,
.rating-item:nth-last-child(2) { border-bottom: none; }
.rating-item span:first-child { color: var(--text-secondary); }
.rating-item span:last-child { font-weight: 700; color: var(--accent-blue); }

/* CTA 推广栏 */
.cta-box {
  background: linear-gradient(135deg, rgba(88,166,255,0.08), rgba(88,166,255,0.03));
  border: 1px solid rgba(88,166,255,0.2);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 36px 0;
  text-align: center;
}
.cta-box h3 { color: var(--text-primary); font-size: 1.1em; margin-bottom: 8px; }
.cta-box p { color: var(--text-secondary); margin-bottom: 16px; font-size: 0.9em; }

/* FAQ 区块 */
.faq-section { margin: 36px 0; }
.faq-section h2 {
  font-size: 1.15em;
  font-weight: 600;
  color: var(--accent-blue);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.faq-item {
  border-bottom: 1px solid var(--border-light);
  padding: 14px 0;
  transition: padding-left var(--transition-fast);
}
.faq-item:hover { padding-left: 6px; }
.faq-item h3 {
  font-size: 0.95em;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.faq-item p {
  font-size: 0.9em;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── Footer 页脚 (所有页面共用) ───────────── */
footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  text-align: center;
  padding: 28px 0;
  font-size: 0.85em;
  margin-top: 40px;
}
footer p { margin-bottom: 4px; }
footer a {
  color: var(--text-muted);
  font-size: 12px;
  transition: color var(--transition-fast);
}
footer a:hover { color: var(--accent-blue); }

/* ── 响应式 ────────────────────────────────── */
@media (max-width: 768px) {
  .container { padding: 0 16px; }
  header { padding: 18px 0; }
  header h1 { font-size: 1.3em; }
  article h1 { font-size: 1.3em; }
  .tool-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tool-header { flex-direction: column; }
  .tool-ratings { grid-template-columns: 1fr 1fr; width: 100%; }
  .article-item { padding: 14px 12px; }
  .hero-tools h1 { font-size: 1.3em; }
}
@media (max-width: 480px) {
  .tool-grid { grid-template-columns: 1fr; }
  .stats-bar { gap: 8px; }
  .stat-item { padding: 6px 12px; font-size: 0.8em; }
}
