/* ============ 知乎官网 zhihu-sa.com.cn 全局样式 ============ */
:root {
  --blue: #0084ff;
  --blue-dark: #0066cc;
  --ink: #1a1a2e;
  --text: #333;
  --muted: #6b7280;
  --bg: #f7f8fc;
  --card: #ffffff;
  --line: #eef0f5;
  --grad-primary: linear-gradient(135deg, #0084ff 0%, #00c6ff 100%);
  --grad-hero: linear-gradient(135deg, #0f4c81 0%, #0084ff 45%, #7b2ff7 100%);
  --grad-warm: linear-gradient(135deg, #ff6a00 0%, #ee0979 100%);
  --shadow: 0 8px 30px rgba(15, 76, 129, 0.10);
  --radius: 16px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  font-size: 16px;
}

a { color: var(--blue); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--blue-dark); }

img { max-width: 100%; height: auto; display: block; }

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 22px; color: var(--ink); }
.brand .logo-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--grad-primary);
  display: grid; place-items: center; color: #fff; font-size: 20px;
  box-shadow: 0 4px 12px rgba(0,132,255,.35);
}
.nav-links { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.nav-links a {
  padding: 8px 14px; border-radius: 999px; color: var(--text);
  font-size: 14.5px; font-weight: 500;
}
.nav-links a:hover { background: #eaf4ff; color: var(--blue); }
.nav-links a.active { background: var(--grad-primary); color: #fff; }

/* ---------- Hero 主视觉 ---------- */
.hero {
  background: var(--grad-hero);
  color: #fff; padding: 72px 0 66px; text-align: center; position: relative; overflow: hidden;
}
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%;
  background: rgba(255,255,255,.08);
}
.hero::before { width: 340px; height: 340px; top: -120px; left: -80px; }
.hero::after { width: 260px; height: 260px; bottom: -100px; right: -60px; }
.hero .container { position: relative; z-index: 2; }
.hero h1 { font-size: 44px; font-weight: 800; letter-spacing: 1px; margin-bottom: 16px; }
.hero p.sub { font-size: 19px; opacity: .95; max-width: 720px; margin: 0 auto 28px; }
.hero-badges { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 30px; }
.hero-badges span {
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.25);
  padding: 7px 16px; border-radius: 999px; font-size: 14px;
}
.btn {
  display: inline-block; padding: 13px 30px; border-radius: 999px;
  font-weight: 600; font-size: 16px; cursor: pointer; text-align: center;
}
.btn-primary { background: #fff; color: var(--blue-dark); box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.btn-primary:hover { transform: translateY(-2px); color: var(--blue-dark); }
.btn-outline { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.7); margin-left: 12px; }
.btn-outline:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ---------- 数据指标 ---------- */
.stats {
  background: var(--card); margin: -36px auto 0; position: relative; z-index: 5;
  max-width: 1080px; border-radius: var(--radius); box-shadow: var(--shadow);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 26px 20px;
}
.stat { text-align: center; }
.stat .num { font-size: 30px; font-weight: 800; background: var(--grad-primary); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat .label { color: var(--muted); font-size: 13.5px; margin-top: 2px; }

/* ---------- 通用章节 ---------- */
.section { padding: 56px 0 24px; }
.section-head { text-align: center; margin-bottom: 34px; }
.section-head .tag {
  display: inline-block; font-size: 13px; font-weight: 600; color: var(--blue);
  background: #eaf4ff; padding: 4px 14px; border-radius: 999px; margin-bottom: 10px;
}
.section-head h2 { font-size: 32px; font-weight: 800; color: var(--ink); }
.section-head p { color: var(--muted); margin-top: 8px; max-width: 640px; margin-left: auto; margin-right: auto; }

/* ---------- 分类卡片 ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.cat-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px 24px; border-top: 5px solid var(--c, var(--blue));
  transition: transform .25s ease, box-shadow .25s ease;
}
.cat-card:hover { transform: translateY(-6px); box-shadow: 0 16px 40px rgba(15,76,129,.16); }
.cat-card .icon { font-size: 40px; margin-bottom: 12px; }
.cat-card h3 { font-size: 21px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.cat-card h3 a { color: inherit; }
.cat-card p { color: var(--muted); font-size: 14.5px; margin-bottom: 14px; }
.cat-card .more { font-weight: 600; font-size: 14px; color: var(--c, var(--blue)); }

.c-tech { --c: #2563eb; }
.c-edu { --c: #059669; }
.c-life { --c: #f59e0b; }
.c-biz { --c: #7c3aed; }
.c-health { --c: #ef4444; }
.c-culture { --c: #d97706; }

/* ---------- 面包屑 ---------- */
.breadcrumb {
  background: var(--card); border-bottom: 1px solid var(--line);
  padding: 14px 0; font-size: 14px;
}
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.breadcrumb li { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.breadcrumb li a { color: var(--blue); }
.breadcrumb li::after { content: "›"; color: #cbd5e1; }
.breadcrumb li:last-child::after { content: ""; }
.breadcrumb li:last-child { color: var(--text); }

/* ---------- 问答内容 ---------- */
.qa-item {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 28px 30px; margin-bottom: 26px;
}
.qa-item .q-title {
  font-size: 22px; font-weight: 700; color: var(--ink); margin-bottom: 6px;
  display: flex; gap: 10px; align-items: flex-start;
}
.qa-item .q-title .q-icon { color: var(--c, var(--blue)); font-size: 26px; line-height: 1.2; }
.qa-item .q-meta { color: var(--muted); font-size: 13.5px; margin-bottom: 16px; display: flex; gap: 18px; flex-wrap: wrap; }
.answer { background: #f8faff; border-radius: 12px; padding: 20px 22px; border-left: 4px solid var(--c, var(--blue)); }
.answer p.lead { margin-bottom: 14px; color: #374151; }
.steps { list-style: none; counter-reset: step; }
.steps li {
  counter-increment: step; position: relative; padding-left: 46px; margin-bottom: 14px;
  color: #374151;
}
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 1px;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--c, var(--blue)); color: #fff; font-weight: 700;
  display: grid; place-items: center; font-size: 14px;
}
.steps li strong { color: var(--ink); }

/* ---------- 新闻卡片 ---------- */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.news-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; display: flex; flex-direction: column;
}
.news-card .thumb { height: 170px; background: var(--grad-primary); overflow: hidden; }
.news-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.news-card .body { padding: 20px 22px; display: flex; flex-direction: column; flex: 1; }
.news-card h3 { font-size: 18px; font-weight: 700; color: var(--ink); margin-bottom: 8px; line-height: 1.5; }
.news-card h3 a { color: inherit; }
.news-card p { color: var(--muted); font-size: 14px; flex: 1; }
.news-card .meta { font-size: 12.5px; color: #9ca3af; margin-top: 12px; display: flex; gap: 12px; }

/* ---------- 文章页 ---------- */
.article-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 30px; align-items: start; }
.article-body {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 36px 40px;
}
.article-body h1 { font-size: 30px; font-weight: 800; color: var(--ink); line-height: 1.4; margin-bottom: 14px; }
.article-meta { color: var(--muted); font-size: 14px; display: flex; gap: 18px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 20px; }
.article-body h2 { font-size: 21px; font-weight: 700; color: var(--ink); margin: 26px 0 10px; }
.article-body p { margin-bottom: 16px; color: #374151; }
.article-body figure { margin: 22px 0; }
.article-body figcaption { text-align: center; color: var(--muted); font-size: 13px; margin-top: 8px; }

.sidebar .widget {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; margin-bottom: 20px;
}
.sidebar .widget h3 { font-size: 17px; font-weight: 700; color: var(--ink); margin-bottom: 14px; }
.sidebar .widget ul { list-style: none; }
.sidebar .widget ul li { padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14.5px; }
.sidebar .widget ul li:last-child { border-bottom: none; }

/* ---------- 评论数徽章 ---------- */
.comment-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff3e0; color: #e65100; font-size: 13px; font-weight: 600;
  padding: 4px 12px; border-radius: 999px;
}

/* ---------- 特性区 ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.feature {
  background: var(--card); border-radius: var(--radius); padding: 26px;
  box-shadow: var(--shadow); text-align: center;
}
.feature .f-icon { font-size: 38px; margin-bottom: 12px; }
.feature h3 { font-size: 18px; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 14px; }

/* ---------- CTA ---------- */
.cta {
  background: var(--grad-warm); color: #fff; text-align: center;
  border-radius: var(--radius); padding: 48px 30px; margin: 20px 0 40px;
}
.cta h2 { font-size: 28px; font-weight: 800; margin-bottom: 12px; }
.cta p { opacity: .95; margin-bottom: 24px; }
.cta .btn { background: #fff; color: #ee0979; }

/* ---------- 页脚 ---------- */
.site-footer { background: #10121f; color: #cbd5e1; margin-top: 40px; padding: 48px 0 28px; }
.site-footer .container { }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 30px; margin-bottom: 30px; }
.footer-grid h4 { color: #fff; font-size: 15px; margin-bottom: 14px; }
.footer-grid ul { list-style: none; }
.footer-grid ul li { margin-bottom: 8px; font-size: 14px; }
.footer-grid ul li a { color: #94a3b8; }
.footer-grid ul li a:hover { color: #fff; }
.footer-brand p { font-size: 14px; color: #94a3b8; margin-top: 10px; max-width: 320px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08); padding-top: 22px;
  font-size: 13px; color: #64748b; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.footer-bottom a { color: #94a3b8; }

/* ---------- 站点地图页 ---------- */
.sitemap-box { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 30px 34px; margin-bottom: 24px; }
.sitemap-box h2 { font-size: 22px; font-weight: 700; color: var(--ink); margin-bottom: 16px; }
.sitemap-box ul { list-style: none; columns: 2; column-gap: 40px; }
.sitemap-box ul li { padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 15px; break-inside: avoid; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .cat-grid, .news-grid, .features, .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .article-wrap { grid-template-columns: 1fr; }
  .hero h1 { font-size: 32px; }
}
@media (max-width: 600px) {
  .cat-grid, .news-grid, .features, .footer-grid, .stats { grid-template-columns: 1fr; }
  .nav-links a { padding: 6px 10px; font-size: 13px; }
  .article-body { padding: 24px 20px; }
  .sitemap-box ul { columns: 1; }
}
