@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap');

/* ── 设计令牌 ── */
:root {
  --paper: #fdfbf7;
  --paper-2: #f5f5f5;
  --ink: #1a1a1a;
  --ink-2: #3a3a3a;
  --ink-3: #6a6a6a;
  --border: #d8d4cc;
  --border-light: #e8e4de;
  --accent: #1a1a1a;
  --accent-hover: #3a3a3a;
  --font-body: 'DM Sans', 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'Courier New', Courier, monospace;
  --radius-card: 10px;
  --max-content: 780px;
  --max-wide: 1200px;
  --col-aside: 260px;
  --gap: 2rem;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  /* 纸张噪点纹理 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E");
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: var(--ink-2); }
ul, ol { list-style: none; }
button, input { font-family: var(--font-body); }

/* ── 页面外壳 ── */
.page-wrap { min-height: 100vh; display: flex; flex-direction: column; }

/* ── 顶部导航 ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}

/* 品牌行 */
.header-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 2rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}
.brand-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}
.site-logo-img { width: 32px; height: 32px; object-fit: contain; flex-shrink: 0; }
.brand-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  color: var(--ink);
}
.brand-name:hover { color: var(--ink-2); }
.brand-tagline {
  font-size: 0.78rem;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 搜索框 */
.header-search { flex-shrink: 0; }
.search-form { display: flex; gap: 0; border: 1px solid var(--ink); }
.search-input {
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  border: none;
  background: var(--paper-2);
  color: var(--ink);
  outline: none;
  width: 180px;
  min-height: 40px;
}
.search-input::placeholder { color: var(--ink-3); }
.search-btn {
  padding: 0.4rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--ink);
  color: var(--paper);
  border: none;
  cursor: pointer;
  min-height: 40px;
  letter-spacing: 0.03em;
  transition: none;
}
.search-btn:hover { background: var(--ink-2); }

/* 菜单行 */
.site-nav {
  padding: 0 2rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav p {
  display: flex;
  align-items: stretch;
  gap: 0;
  white-space: nowrap;
}
.site-nav p a {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: var(--ink);
  border-right: 1px solid var(--border-light);
  min-height: 44px;
  transition: none;
}
.site-nav p a:first-child { border-left: none; }
.site-nav p a:hover { background: var(--paper-2); }
.site-nav p a[aria-current="page"] {
  background: var(--ink);
  color: var(--paper);
}

/* ── 主内容区域 ── */
main { flex: 1; }

/* 带侧边栏布局 */
.body-with-aside {
  display: grid;
  grid-template-columns: 1fr var(--col-aside);
  gap: var(--gap) 3rem;
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 2rem;
  align-items: start;
}
.body-main { min-width: 0; }

/* ── Hero 区块（首页）── */
.hero-section {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 2px solid var(--ink);
  overflow: hidden;
}
.hero-bg-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(8rem, 20vw, 22rem);
  font-weight: 700;
  color: transparent;
  -webkit-text-stroke: 1px var(--border);
  letter-spacing: 0.1em;
  user-select: none;
  pointer-events: none;
  line-height: 1;
}
.hero-content {
  position: relative;
  text-align: center;
  padding: 4rem 2rem;
  max-width: 760px;
  z-index: 1;
}
.hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: inline-block;
  padding-bottom: 0.5rem;
}
.hero-h1 {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}
.hero-sub {
  font-size: 1.05rem;
  color: var(--ink-2);
  line-height: 1.7;
  margin-bottom: 2.5rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}
.hero-cta {
  display: inline-block;
  padding: 0.85rem 2.5rem;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  border: 2px solid var(--ink);
  transition: none;
  min-height: 48px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}
.hero-cta:hover {
  background: var(--paper);
  color: var(--ink);
}

/* ── 通用 div 间距 ── */
.content-section {
  padding: 4rem 0;
  border-top: 1px solid var(--border);
}
.content-section:first-child { border-top: none; }

.section-header {
  max-width: var(--max-wide);
  margin: 0 auto 2.5rem;
  padding: 0 2rem;
}
.section-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 0.5rem;
}
.section-header h2 span { display: inline; }

/* ── 话题卡片网格（首页）── */
.topics-section { padding-top: 4rem; padding-bottom: 4rem; }
.topics-grid {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}
.topic-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 1.75rem 1.5rem 1.5rem;
  background: var(--paper);
  position: relative;
  border-bottom: 3px solid var(--ink);
  transition: none;
}
.topic-card:hover {
  background: var(--paper-2);
}
.topic-num {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--ink-3);
  margin-bottom: 0.75rem;
  font-family: var(--font-mono);
}
.topic-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  line-height: 1.4;
}
.topic-card h3 span { display: inline; }
.topic-desc {
  font-size: 0.88rem;
  color: var(--ink-2);
  line-height: 1.6;
  margin-bottom: 1.2rem;
}
.card-link {
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1px;
}
.card-link:hover { color: var(--ink-3); border-color: var(--ink-3); }

/* ── 最近更新（首页）── */
.recent-section { padding-top: 4rem; }
.recent-grid {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}
.recent-item {
  padding: 1.25rem;
  border: 1px solid var(--border);
  border-bottom: 3px solid var(--ink);
  border-radius: var(--radius-card);
  transition: none;
}
.recent-item:hover { background: var(--paper-2); }
.item-date {
  display: block;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--ink-3);
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}
.recent-link {
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  display: block;
  margin-bottom: 0.4rem;
  line-height: 1.4;
}
.recent-link span { display: inline; }
.recent-link:hover { text-decoration: underline; }
.recent-desc {
  font-size: 0.82rem;
  color: var(--ink-2);
  line-height: 1.55;
}

/* ── 正文区（带侧边栏）── */
.body-section { padding-top: 4rem; }
.topics-section .body-with-aside,
.about-body-section .body-with-aside,
.privacy-body-section .body-with-aside,
.article-body-section .body-with-aside,
.topic-body-section .body-with-aside,
.default-body-section .body-with-aside,
.body-section .body-with-aside {
  padding-top: 0;
}

/* ── 话题页 Hero ── */
.topic-hero {
  padding: 3.5rem 0 3rem;
  border-bottom: 2px solid var(--ink);
  background: var(--paper-2);
}
.topic-hero-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  padding: 0 2rem;
}
.topic-hero h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.topic-desc {
  font-size: 1.05rem;
  color: var(--ink-2);
  line-height: 1.7;
  max-width: 660px;
}

/* ── 文章页 Header ── */
.page-header-section,
.article-header-section {
  padding: 3rem 0 2.5rem;
  border-bottom: 2px solid var(--ink);
  background: var(--paper-2);
}
.page-header-section > *,
.article-header-section > * {
  max-width: var(--max-wide);
  margin-left: auto;
  margin-right: auto;
  padding-left: 2rem;
  padding-right: 2rem;
}
.page-header-section h1,
.article-header-section h1 {
  font-size: clamp(1.6rem, 3.5vw, 2.5rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  margin-top: 0.5rem;
}
.page-lead,
.article-lead {
  font-size: 1rem;
  color: var(--ink-2);
  line-height: 1.7;
  max-width: 660px;
}
.article-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}
.meta-item {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--ink-3);
  letter-spacing: 0.06em;
}
.meta-item time { font-family: var(--font-mono); }
.article-hero-wrap {
  max-width: var(--max-wide);
  margin: 1.5rem auto 0;
  padding: 0 2rem;
}
.article-hero-img {
  width: 100%;
  height: 360px;
  object-fit: cover;
  border: 1px solid var(--border);
}
.policy-date {
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--ink-3);
  letter-spacing: 0.06em;
  margin-top: 0.75rem;
}

/* ── 面包屑 ── */
.breadcrumb {
  font-size: 0.8rem;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
}
.breadcrumb a {
  color: var(--ink-3);
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; color: var(--ink); }
.breadcrumb span { color: var(--ink); }

/* ── 侧边栏 ── */
.body-aside {
  position: sticky;
  top: 110px;
  border: 1px solid var(--border);
  border-top: 3px solid var(--ink);
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  padding: 1.5rem;
  background: var(--paper);
}
.body-aside h3 {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.75rem;
  margin-top: 1.25rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.4rem;
}
.body-aside h3:first-child { margin-top: 0; }
.body-aside h3 span { display: inline; }
.aside-links { display: flex; flex-direction: column; gap: 0.1rem; }
.aside-links li a {
  display: block;
  padding: 0.4rem 0.5rem;
  font-size: 0.85rem;
  text-decoration: none;
  border-radius: 4px;
  line-height: 1.5;
  min-height: 36px;
  display: flex;
  align-items: center;
  transition: none;
}
.aside-links li a:hover { background: var(--paper-2); }
.aside-note {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}
.aside-note p {
  font-size: 0.8rem;
  color: var(--ink-3);
  line-height: 1.6;
}

/* ── 正文排版 ── */
.prose {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--ink);
}
.prose h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.prose h2 span { display: inline; }
.prose h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  line-height: 1.3;
}
.prose h3 span { display: inline; }
.prose p { margin-bottom: 1.25rem; }
.prose ul, .prose ol {
  margin: 1rem 0 1.25rem 1.5rem;
}
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: 0.4rem; line-height: 1.7; }
.prose a { color: var(--ink); font-weight: 500; }
.prose a:hover { color: var(--ink-2); }
.prose strong { font-weight: 700; }
.prose em { font-style: italic; }
.prose blockquote {
  border-left: 3px solid var(--ink);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--paper-2);
  color: var(--ink-2);
}
.prose blockquote p { margin-bottom: 0; }
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--paper-2);
  padding: 0.15em 0.4em;
  border: 1px solid var(--border);
}
.prose pre {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  background: var(--paper-2);
  border: 1px solid var(--border);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
}
.prose pre code { background: none; border: none; padding: 0; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9rem;
}
.prose th, .prose td {
  border: 1px solid var(--border);
  padding: 0.6rem 0.9rem;
  text-align: left;
}
.prose th {
  background: var(--paper-2);
  font-weight: 700;
}
.prose tr:nth-child(even) td { background: var(--paper-2); }
.prose img {
  border: 1px solid var(--border);
  border-radius: 4px;
  margin: 1.5rem auto;
}
.article-updated {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--ink-3);
  letter-spacing: 0.06em;
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

/* ── 话题页子页列表 ── */
.children-block { margin-top: 3rem; }
.children-block h2 {
  font-size: 1.4rem;
  font-weight: 700;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}
.children-block h2 span { display: inline; }
.children-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.child-card {
  border: 1px solid var(--border);
  border-left: 4px solid var(--ink);
  border-radius: 0 var(--radius-card) var(--radius-card) 0;
  padding: 1.25rem 1.5rem;
  background: var(--paper);
  transition: none;
}
.child-card:hover { background: var(--paper-2); }
.child-num {
  display: inline-block;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  margin-bottom: 0.4rem;
}
.card-date {
  display: inline-block;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--ink-3);
  letter-spacing: 0.06em;
  margin-left: 1rem;
  margin-bottom: 0.4rem;
}
.child-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  line-height: 1.4;
}
.child-card h3 span { display: inline; }
.child-desc {
  font-size: 0.86rem;
  color: var(--ink-2);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

/* ── 页脚 ── */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  margin-top: auto;
  border-top: 2px solid var(--ink);
}
/* 大 CTA 块 */
.footer-cta {
  border-bottom: 1px solid rgba(253,251,247,0.15);
  padding: 3rem 2rem;
  text-align: center;
}
.footer-cta-text {
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
  color: var(--paper);
  letter-spacing: 0.02em;
}
.footer-cta-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.85rem 2.25rem;
  background: transparent;
  border: 2px solid var(--paper);
  color: var(--paper);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  min-height: 48px;
  transition: none;
}
.footer-cta-btn:hover {
  background: var(--paper);
  color: var(--ink);
}
/* 四栏 */
.footer-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  padding: 2.5rem 2rem;
  max-width: var(--max-wide);
  margin: 0 auto;
}
.footer-col-head {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(253,251,247,0.5);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(253,251,247,0.15);
}
.footer-col p + p { margin-top: 0.1rem; }
.footer-col p a {
  color: rgba(253,251,247,0.75);
  text-decoration: none;
  font-size: 0.88rem;
  display: block;
  padding: 0.3rem 0;
  min-height: 36px;
  display: flex;
  align-items: center;
  transition: none;
}
.footer-col p a:hover { color: var(--paper); }
/* 版权一行 */
.footer-copy {
  text-align: center;
  padding: 1.25rem 2rem;
  border-top: 1px solid rgba(253,251,247,0.1);
  max-width: var(--max-wide);
  margin: 0 auto;
}
.footer-copy small {
  font-size: 0.78rem;
  color: rgba(253,251,247,0.4);
  letter-spacing: 0.05em;
}

/* ── Hover 微动效（非 reduced-motion）── */
@media (prefers-reduced-motion: no-preference) {
  .topic-card,
  .recent-item,
  .child-card {
    transition: background 0.15s, border-color 0.15s;
  }
  .aside-links li a { transition: background 0.12s; }
  .search-btn { transition: background 0.1s; }
  .hero-cta { transition: background 0.1s, color 0.1s; }
  .footer-cta-btn { transition: background 0.1s, color 0.1s; }
  .footer-col p a { transition: color 0.1s; }
  .card-link { transition: color 0.1s, border-color 0.1s; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ── 响应式 ── */
@media (max-width: 1024px) {
  .footer-cols { grid-template-columns: repeat(2, 1fr); }
  .body-with-aside {
    grid-template-columns: 1fr;
  }
  .body-aside {
    position: static;
    border-top: 3px solid var(--ink);
    border-radius: var(--radius-card);
  }
}

@media (max-width: 768px) {
  .header-brand { padding: 0.6rem 1rem; }
  .brand-tagline { display: none; }
  .search-input { width: 120px; }
  .site-nav { padding: 0 1rem; }
  .site-nav p a { padding: 0.6rem 0.75rem; font-size: 0.8rem; }
  .hero-h1 { font-size: 1.8rem; }
  .hero-bg-text { font-size: 6rem; }
  .topics-grid { grid-template-columns: 1fr; }
  .recent-grid { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: repeat(2, 1fr); padding: 2rem 1rem; }
  .footer-cta { padding: 2rem 1rem; }
  .footer-cta-text { font-size: 1rem; }
  .section-header { padding: 0 1rem; }
  .body-with-aside { padding: 0 1rem; }
  .content-section { padding: 2.5rem 0; }
  .topic-hero-inner { padding: 0 1rem; }
  .article-header-section > *, .page-header-section > * { padding-left: 1rem; padding-right: 1rem; }
  .article-hero-wrap { padding: 0 1rem; }
}

@media (max-width: 480px) {
  .header-brand { flex-wrap: wrap; }
  .header-search { width: 100%; order: 3; }
  .search-form { width: 100%; }
  .search-input { flex: 1; width: auto; }
  .brand-name { font-size: 0.9rem; }
  .hero-section { min-height: 100svh; }
  .footer-cols { grid-template-columns: 1fr 1fr; gap: 1.25rem; }
  .footer-copy { padding: 1rem; }
  .topic-hero { padding: 2rem 0 1.5rem; }
  .topic-hero h1 { font-size: 1.5rem; }
  .prose h2 { font-size: 1.2rem; }
}
