@import url('https://fonts.googleapis.com/css2?family=Abril+Fatface&family=Merriweather:wght@300;400;700&display=swap');

/* ===== 变量 ===== */
:root {
  --paper: #fdfbf7;
  --paper-alt: #f5f5f5;
  --ink: #1a1a1a;
  --ink-mid: #3a3a3a;
  --ink-light: #6a6a6a;
  --border: #d0cec9;
  --border-dark: #a09e99;
  --accent: #1a1a1a;
  --radius: 10px;
  --max-w: 1100px;
  --prose-max: 720px;
  --font-head: 'Abril Fatface', Georgia, serif;
  --font-body: 'Merriweather', 'Georgia', serif;
  --shadow-card: 2px 4px 12px rgba(26,26,26,0.10);
}

/* ===== 基础重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 17px; scroll-behavior: auto; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.75;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23noise)' opacity='0.035'/%3E%3C/svg%3E");
}
a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--ink-mid); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { padding-left: 1.5em; }
p { margin-bottom: 1em; }
h1, h2, h3, h4, h5 {
  font-family: var(--font-head);
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 0.5em;
}
h1 { font-size: 2.4rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.05rem; }
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0 1.25rem;
}

/* ===== 点阵纹理辅助 ===== */
.hero-texture {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, var(--border-dark) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.13;
  z-index: 0;
}

/* ===== 外层包裹 ===== */
.site-wrap { display: flex; flex-direction: column; min-height: 100vh; }

/* ===== 顶部导航 ===== */
.site-header {
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.25rem;
  height: 60px;
  gap: 1rem;
}
.brand { flex-shrink: 0; }
.brand-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-family: var(--font-head);
  font-size: 1.15rem;
  color: var(--ink);
}
.brand-logo { width: 32px; height: 32px; object-fit: contain; }
.brand-name { white-space: nowrap; letter-spacing: 0.02em; }
.header-nav { display: flex; gap: 0; }
.header-nav a {
  display: flex;
  align-items: center;
  height: 60px;
  padding: 0 0.85rem;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.03em;
  white-space: nowrap;
  border-left: 1px solid var(--border);
  transition: none;
}
.header-nav a:hover { background: var(--paper-alt); }
.header-nav--right a:last-child { border-right: 1px solid var(--border); }

/* 搜索栏 */
.search-bar-wrap {
  background: var(--paper-alt);
  border-bottom: 1px solid var(--border);
  padding: 0.45rem 1.25rem;
}
.search-form {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.search-form input[type="search"] {
  flex: 1;
  padding: 0.5rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  border: 1px solid var(--border-dark);
  background: var(--paper);
  color: var(--ink);
  border-radius: 4px;
  outline: none;
  min-height: 40px;
}
.search-form input[type="search"]:focus { border-color: var(--ink); }
.search-form button {
  padding: 0.5rem 1.2rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  cursor: pointer;
  border-radius: 4px;
  min-height: 40px;
  transition: none;
}
.search-form button:hover { background: var(--ink-mid); border-color: var(--ink-mid); }

/* ===== 粘性二级锚点条 ===== */
.sticky-anchors {
  background: var(--paper);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 106px;
  z-index: 90;
}
.sticky-anchors nav {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0 1.25rem;
}
.sticky-anchors nav a {
  display: inline-flex;
  align-items: center;
  padding: 0.55rem 1rem;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.03em;
  border-right: 1px solid var(--border);
  min-height: 40px;
  transition: none;
}
.sticky-anchors nav a:first-child { border-left: none; }
.sticky-anchors nav a:hover { background: var(--paper-alt); }

/* ===== Hero（首页） ===== */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  border-bottom: 2px solid var(--ink);
  overflow: hidden;
  background: var(--paper);
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: center;
  padding: 3rem 1.25rem;
}
.hero-text {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  justify-content: center;
  align-items: flex-start;
}
.hero-text h1 {
  font-size: 2.8rem;
  line-height: 1.1;
}
.hero-desc {
  font-size: 1rem;
  color: var(--ink-mid);
  margin-bottom: 0;
  max-width: 480px;
}
.hero-media { display: flex; align-items: center; justify-content: center; }
.hero-media img { border: 1px solid var(--border-dark); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.hero-media--placeholder {
  width: 100%;
  min-height: 320px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--paper-alt);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== 频道/关于/Banner ===== */
.channel-hero, .about-banner {
  position: relative;
  border-bottom: 1px solid var(--border-dark);
  overflow: hidden;
  background: var(--paper-alt);
  padding: 3rem 1.25rem;
}
.channel-hero-inner, .about-banner-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max-w);
  margin: 0 auto;
}
.channel-hero h1, .about-banner h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.channel-hero p, .about-banner p { color: var(--ink-mid); max-width: 600px; }

/* ===== 主内容布局（侧边栏左侧） ===== */
.content-layout {
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2rem;
  padding: 2rem 1.25rem;
  flex: 1;
  align-items: start;
}
.content-layout--narrow { max-width: 900px; }

/* ===== 侧边栏 ===== */
.sidebar {
  position: sticky;
  top: 150px;
  background: var(--paper-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1rem;
}
.sidebar-title {
  font-family: var(--font-head);
  font-size: 1rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}
.sidebar-title--mt { margin-top: 1.5rem; }
.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.sidebar nav a {
  display: block;
  padding: 0.45rem 0.5rem;
  font-size: 0.88rem;
  font-weight: 400;
  text-decoration: none;
  border-radius: 4px;
  color: var(--ink-mid);
  border-left: 2px solid transparent;
  transition: none;
}
.sidebar nav a:hover {
  background: var(--paper);
  border-left-color: var(--ink);
  color: var(--ink);
}

/* ===== 正文 div/section ===== */
.main-content { min-width: 0; }
.main-content > div { display: flex; flex-direction: column; gap: 2.5rem; }
.main-content > div > section { display: block; }

/* 正文区块 */
.prose-section {
  background: var(--paper);
  font-size: 1rem;
  line-height: 1.85;
}
.prose-section h2,
.prose-section h3 { margin-top: 1.75rem; }
.prose-section img {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 1rem 0;
}
.prose-section--policy { font-size: 0.95rem; }

/* 面包屑 */
.breadcrumb {
  font-size: 0.84rem;
  color: var(--ink-light);
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  margin-bottom: 0.75rem;
}
.breadcrumb a { color: var(--ink-light); }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb span[aria-hidden] { color: var(--border-dark); }

/* 文章元信息 */
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.84rem;
  color: var(--ink-light);
  margin-bottom: 0.5rem;
}
.article-header-section h1 { margin-bottom: 0.4rem; }

/* 隐私更新日期 */
.policy-updated {
  font-size: 0.88rem;
  color: var(--ink-light);
  margin-bottom: 0.5rem;
}

/* ===== 卡片（首页频道区 + 栏目子页列表） ===== */
.channels-section,
.child-list {
  background: var(--paper);
}
.channels-section h2,
.child-list h2 { margin-bottom: 0.25rem; }

/* section > div×n 子页列表 */
.child-list > div,
.channels-section > div {
  background: var(--paper-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-card);
  margin-bottom: 1.25rem;
  transition: none;
}
.child-list > div:hover,
.channels-section > div:hover {
  border-color: var(--border-dark);
  box-shadow: 3px 6px 18px rgba(26,26,26,0.13);
}
.child-list > div h3,
.channels-section > div h3 {
  margin-bottom: 0.2rem;
  font-size: 1.1rem;
}
.child-list > div h3 a,
.channels-section > div h3 a {
  text-decoration: none;
  color: var(--ink);
}
.child-list > div h3 a:hover,
.channels-section > div h3 a:hover { text-decoration: underline; }
.card-date {
  display: block;
  font-size: 0.82rem;
  color: var(--ink-light);
  margin-bottom: 0.4rem;
}
.card-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  border-bottom: 1px solid var(--border-dark);
  padding-bottom: 1px;
}
.card-link:hover { border-bottom-color: var(--ink); }

/* ===== 按钮 ===== */
.btn-primary, .btn-secondary {
  display: inline-block;
  padding: 0.65rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 4px;
  text-decoration: none;
  transition: none;
  min-height: 44px;
  line-height: 1.3;
  cursor: pointer;
}
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--ink);
}
.btn-primary:hover { background: var(--ink-mid); border-color: var(--ink-mid); color: var(--paper); }
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
  margin-left: 0.75rem;
}
.btn-secondary:hover { background: var(--ink); color: var(--paper); }

/* ===== 关于/CTA区块 ===== */
.about-intro-section,
.about-cta-section,
.privacy-header-section,
.privacy-nav-section {
  background: var(--paper);
}
.about-cta-section { padding-top: 0.5rem; }
.about-cta-section p { margin-bottom: 1rem; }

/* ===== 页脚 ===== */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding: 2rem 1.25rem 1.5rem;
  border-top: 2px solid var(--ink);
  margin-top: auto;
}
.footer-brand {
  font-family: var(--font-head);
  font-size: 1.05rem;
  color: var(--paper);
  margin-bottom: 0.5rem;
  max-width: var(--max-w);
}
.footer-copy {
  display: block;
  font-size: 0.82rem;
  color: #b0aea9;
  max-width: var(--max-w);
}
.footer-copy a { color: #c8c5be; }
.footer-copy a:hover { color: var(--paper); }

/* ===== 导航标签契约：footer 内 nav > dl > dt/dd > a ===== */
/* （此 CSS 无需额外规则，结构由 JS 模板生成；下方 app.js 动态注入 dl nav 至 footer） */

/* ===== 动效：Stagger List + Hover Micro-interaction ===== */
@media (prefers-reduced-motion: no-preference) {
  .child-list > div,
  .channels-section > div {
    opacity: 0;
    transform: translateY(12px);
    animation: fadeUp 0.32s ease forwards;
  }
  .child-list > div:nth-child(1), .channels-section > div:nth-child(1) { animation-delay: 0.04s; }
  .child-list > div:nth-child(2), .channels-section > div:nth-child(2) { animation-delay: 0.10s; }
  .child-list > div:nth-child(3), .channels-section > div:nth-child(3) { animation-delay: 0.16s; }
  .child-list > div:nth-child(4), .channels-section > div:nth-child(4) { animation-delay: 0.22s; }
  .child-list > div:nth-child(5), .channels-section > div:nth-child(5) { animation-delay: 0.28s; }
  .child-list > div:nth-child(6), .channels-section > div:nth-child(6) { animation-delay: 0.34s; }
  .sidebar nav a { transition: background 0.12s, border-color 0.12s, color 0.12s; }
  .card-link { transition: border-color 0.12s; }
  .btn-primary, .btn-secondary { transition: background 0.12s, color 0.12s; }
  @keyframes fadeUp {
    to { opacity: 1; transform: none; }
  }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ===== 响应式 ===== */
@media (max-width: 860px) {
  .content-layout {
    grid-template-columns: 1fr;
    padding: 1.25rem 1rem;
  }
  .sidebar {
    position: static;
    order: -1;
  }
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 2rem 1rem;
  }
  .hero-media { display: none; }
  .hero { min-height: auto; }
  .hero-text h1 { font-size: 2rem; }
}

@media (max-width: 640px) {
  html { font-size: 16px; }
  .header-inner { height: 52px; padding: 0 0.75rem; gap: 0.5rem; }
  .header-nav a { padding: 0 0.55rem; font-size: 0.78rem; height: 52px; }
  .brand-name { font-size: 0.95rem; }
  .sticky-anchors { top: 98px; }
  .sticky-anchors nav a { padding: 0.5rem 0.7rem; font-size: 0.78rem; }
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.3rem; }
  .channel-hero, .about-banner { padding: 1.75rem 1rem; }
  .content-layout { padding: 1rem 0.85rem; gap: 1.25rem; }
  .child-list > div,
  .channels-section > div { padding: 1rem 1rem; }
  .btn-secondary { margin-left: 0; margin-top: 0.5rem; }
  .about-cta-section .btn-primary,
  .about-cta-section .btn-secondary { display: block; width: 100%; text-align: center; margin-left: 0; margin-bottom: 0.5rem; }
}

@media (max-width: 400px) {
  .header-nav--left .header-nav a:nth-child(n+2),
  .header-nav--right .header-nav a:nth-child(n+2) { display: none; }
}
