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

/* ============================================================
   CSS 自定义属性
   ============================================================ */
:root {
  --c-white: #ffffff;
  --c-surface: #f5f5f5;
  --c-dark: #1f1f1f;
  --c-dark-2: #2a2a2a;
  --c-dark-3: #333333;
  --c-border: #3a3a3a;
  --c-border-light: #e0e0e0;
  --c-text-on-dark: rgba(255,255,255,0.9);
  --c-text-muted-dark: rgba(255,255,255,0.5);
  --c-text-on-light: #1f1f1f;
  --c-text-muted-light: #666666;
  --c-accent: #ffffff;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.6);
  --shadow-xl: 0 16px 48px rgba(0,0,0,0.7);

  --radius: 4px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;

  --header-h: 60px;
  --max-w: 1140px;
  --prose-w: 720px;
}

/* ============================================================
   重置 & 基础
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background: var(--c-dark);
}

body {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--c-text-on-dark);
  background: var(--c-dark);
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; height: auto; }
ul, ol { list-style: none; }
p { margin-bottom: 1em; }
p:last-child { margin-bottom: 0; }

/* ============================================================
   层叠深度系统（Dimensional Layering）
   ============================================================ */
.layer-1 { position: relative; z-index: 1; }
.layer-2 { position: relative; z-index: 2; }
.layer-3 { position: relative; z-index: 3; }
.layer-4 { position: relative; z-index: 4; }

/* ============================================================
   站点根容器
   ============================================================ */
.site-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--c-dark);
}

/* ============================================================
   顶部导航
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  height: var(--header-h);
  background: var(--c-dark);
  border-bottom: 1px solid var(--c-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 100;
}

.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.brand {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--c-white);
  white-space: nowrap;
  flex-shrink: 0;
  padding: 10px 0;
  text-decoration: none;
}
.brand:hover { text-decoration: none; opacity: 0.8; }

.site-header nav {
  flex: 1;
  overflow: hidden;
}

.site-header nav ol {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.site-header nav ol::-webkit-scrollbar { display: none; }

.site-header nav ol li a {
  display: block;
  padding: 10px 12px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--c-text-muted-dark);
  border-radius: var(--radius);
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
  min-height: 40px;
  display: flex;
  align-items: center;
}
.site-header nav ol li a:hover,
.site-header nav ol li a[aria-current="page"] {
  color: var(--c-white);
  background: rgba(255,255,255,0.08);
  text-decoration: none;
}

.header-contact {
  flex-shrink: 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--c-white);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 10px 16px;
  min-height: 40px;
  display: flex;
  align-items: center;
  transition: background 0.2s, border-color 0.2s;
}
.header-contact:hover {
  background: rgba(255,255,255,0.1);
  border-color: var(--c-white);
  text-decoration: none;
}

/* ============================================================
   Hero（首页专用）
   ============================================================ */
.hero {
  min-height: 70vh;
  background: var(--c-dark);
  border-bottom: 1px solid var(--c-border);
  display: flex;
  align-items: flex-end;
  padding-bottom: 64px;
  overflow: hidden;
}

.hero-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 80px 24px 0;
  width: 100%;
  text-align: right;
}

.hero-eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-text-muted-dark);
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(2.5rem, 7vw, 6rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--c-white);
  margin-bottom: 24px;
  word-break: break-all;
}

.hero-desc {
  font-size: 1rem;
  font-weight: 400;
  color: var(--c-text-muted-dark);
  max-width: 540px;
  margin-left: auto;
  margin-bottom: 36px;
  line-height: 1.7;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  padding: 14px 32px;
  background: var(--c-white);
  color: var(--c-dark);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius);
  letter-spacing: 0.02em;
  transition: opacity 0.2s, transform 0.2s;
  min-height: 48px;
}
.hero-cta:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  text-decoration: none;
}

/* ============================================================
   页面 Banner（内页通用）
   ============================================================ */
.page-banner,
.article-banner {
  background: var(--c-dark);
  border-bottom: 1px solid var(--c-border);
  padding: 48px 0 40px;
}

.banner-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.page-title {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--c-white);
  margin-bottom: 16px;
  text-align: right;
}

.page-intro {
  font-size: 1rem;
  color: var(--c-text-muted-dark);
  text-align: right;
  max-width: 600px;
  margin-left: auto;
  margin-bottom: 0;
}

.page-dates {
  margin-top: 16px;
  text-align: right;
  display: flex;
  gap: 16px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.pub-date,
.mod-date {
  font-size: 0.8rem;
  color: var(--c-text-muted-dark);
  font-weight: 400;
  letter-spacing: 0.02em;
}

/* ============================================================
   面包屑
   ============================================================ */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--c-text-muted-dark);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--c-text-muted-dark);
  transition: color 0.2s;
}
.breadcrumb a:hover { color: var(--c-white); text-decoration: none; }
.breadcrumb span { color: var(--c-text-muted-dark); }

/* ============================================================
   主体布局
   ============================================================ */
main {
  flex: 1;
  padding: 48px 0;
}

.wrap {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* 带侧边栏的布局 */
.layout-with-aside {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: start;
}

/* ============================================================
   侧边栏（左侧）
   ============================================================ */
.sidebar {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-block {
  background: var(--c-dark-2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.sidebar-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--c-white);
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}

.sidebar-links li {
  border-bottom: 1px solid var(--c-border);
}
.sidebar-links li:last-child { border-bottom: none; }

.sidebar-links a {
  display: block;
  padding: 9px 0;
  font-size: 0.85rem;
  color: var(--c-text-muted-dark);
  transition: color 0.2s, padding-left 0.2s;
  min-height: 40px;
  display: flex;
  align-items: center;
}
.sidebar-links a:hover {
  color: var(--c-white);
  padding-left: 6px;
  text-decoration: none;
}

/* ============================================================
   主栏容器
   ============================================================ */
.main-col { min-width: 0; }
.main-col .wrap { padding: 0; }

/* ============================================================
   section eyebrow 装饰（small + h2 同级）
   ============================================================ */
.section-header {
  margin-bottom: 32px;
}

.eyebrow {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-text-muted-dark);
  margin-bottom: 8px;
}

.section-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--c-white);
  letter-spacing: -0.01em;
}

/* ============================================================
   Prose（正文排版）
   ============================================================ */
.layer-2 .prose,
.article-body .prose,
.topic-content .prose,
.about-body .prose,
.privacy-body .prose,
.data-body .prose,
.home-content .prose {
  color: var(--c-text-on-dark);
  line-height: 1.8;
  font-size: 1rem;
  max-width: var(--prose-w);
}

.prose h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--c-white);
  margin: 2em 0 0.75em;
  letter-spacing: -0.01em;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--c-border);
}
.prose h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--c-white);
  margin: 1.6em 0 0.6em;
}
.prose h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--c-white);
  margin: 1.4em 0 0.5em;
}
.prose p { margin-bottom: 1.1em; color: rgba(255,255,255,0.82); }
.prose a { color: var(--c-white); border-bottom: 1px solid var(--c-border); transition: border-color 0.2s; }
.prose a:hover { border-color: var(--c-white); text-decoration: none; }
.prose ul, .prose ol { margin: 0.8em 0 1.2em 1.4em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: 0.4em; color: rgba(255,255,255,0.82); }
.prose strong { font-weight: 600; color: var(--c-white); }
.prose em { font-style: italic; }
.prose blockquote {
  border-left: 3px solid var(--c-border);
  padding: 12px 20px;
  margin: 1.5em 0;
  background: var(--c-dark-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: rgba(255,255,255,0.7);
  font-style: italic;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.9rem;
}
.prose th, .prose td {
  padding: 10px 14px;
  border: 1px solid var(--c-border);
  text-align: left;
}
.prose th {
  background: var(--c-dark-2);
  font-weight: 600;
  color: var(--c-white);
}
.prose td { color: rgba(255,255,255,0.8); }
.prose code {
  background: var(--c-dark-3);
  padding: 2px 6px;
  border-radius: 2px;
  font-size: 0.875em;
  font-family: 'Courier New', monospace;
  color: var(--c-surface);
}
.prose pre {
  background: var(--c-dark-2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  overflow-x: auto;
  margin: 1.5em 0;
}
.prose pre code { background: none; padding: 0; }
.prose img {
  border-radius: var(--radius);
  margin: 1.5em 0;
  border: 1px solid var(--c-border);
}
.prose time { font-weight: 500; color: rgba(255,255,255,0.6); font-size: 0.9em; }

/* ============================================================
   内容卡片（层叠卡片）
   ============================================================ */
.article-body,
.topic-content,
.about-body,
.privacy-body,
.data-body,
.default-body,
.home-content {
  background: var(--c-dark-2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 40px 48px;
  box-shadow: var(--shadow-md);
  transform: translateZ(0);
  transition: box-shadow 0.3s;
}
.article-body:hover,
.topic-content:hover {
  box-shadow: var(--shadow-lg);
}

/* ============================================================
   首页内容区
   ============================================================ */
.home-content-section {
  margin-bottom: 64px;
}

/* ============================================================
   首页：专题格子
   ============================================================ */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  margin-bottom: 64px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.topic-card {
  background: var(--c-dark-2);
  transition: background 0.2s, transform 0.2s;
}
.topic-card:hover {
  background: var(--c-dark-3);
  transform: translateZ(4px);
}

.topic-link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 32px 28px;
  text-decoration: none;
  min-height: 160px;
}
.topic-link:hover { text-decoration: none; }

.topic-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-text-muted-dark);
}

.topic-link strong {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--c-white);
  line-height: 1.3;
}

.topic-desc {
  font-size: 0.85rem;
  color: var(--c-text-muted-dark);
  line-height: 1.5;
}

/* ============================================================
   首页：卡片列表
   ============================================================ */
.cards-section {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}

.card {
  background: var(--c-dark-2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  transition: box-shadow 0.25s, transform 0.25s;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px) translateZ(0);
}

.card-inner {
  padding: 24px 28px;
}

.card-meta {
  font-size: 0.75rem;
  color: var(--c-text-muted-dark);
  margin-bottom: 10px;
  font-weight: 500;
}

.card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--c-white);
  margin-bottom: 10px;
  line-height: 1.4;
}
.card h3 a { color: inherit; }
.card h3 a:hover { text-decoration: underline; }

.card-desc {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.6;
  margin-bottom: 16px;
}

.card-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-white);
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--c-border);
  transition: border-color 0.2s;
  padding-bottom: 2px;
}
.card-link:hover { border-color: var(--c-white); text-decoration: none; }

/* ============================================================
   子页面列表（栏目页）
   ============================================================ */
.sub-pages-area {
  margin-top: 48px;
}

.sub-cards {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.sub-card {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  background: var(--c-dark-2);
  border-bottom: 1px solid var(--c-border);
  padding: 24px 28px;
  transition: background 0.2s;
  transform: translateZ(0);
}
.sub-card:last-child { border-bottom: none; }
.sub-card:hover { background: var(--c-dark-3); }

.sub-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--c-text-muted-dark);
  letter-spacing: 0.06em;
  min-width: 28px;
  padding-top: 3px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.sub-body { flex: 1; min-width: 0; }

.sub-meta {
  font-size: 0.75rem;
  color: var(--c-text-muted-dark);
  margin-bottom: 6px;
}

.sub-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--c-white);
  margin-bottom: 6px;
  line-height: 1.4;
}
.sub-card h3 a { color: inherit; }
.sub-card h3 a:hover { text-decoration: underline; }
.sub-card p {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.6;
  margin-bottom: 12px;
}

.read-more {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--c-white);
  letter-spacing: 0.04em;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--c-border);
  transition: border-color 0.2s;
  display: inline-block;
}
.read-more:hover { border-color: var(--c-white); text-decoration: none; }

/* ============================================================
   文章页专属
   ============================================================ */
.article-hero-wrap {
  margin-bottom: 32px;
}
.article-hero-img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--c-border);
}

.article-footer-nav {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--c-border);
}

.back-link {
  font-size: 0.875rem;
  color: var(--c-text-muted-dark);
  transition: color 0.2s;
}
.back-link:hover { color: var(--c-white); text-decoration: none; }

/* ============================================================
   页脚
   ============================================================ */
.site-footer {
  background: var(--c-dark);
  border-top: 1px solid var(--c-border);
  margin-top: auto;
}

.footer-cta-block {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--c-border);
}

.footer-cta-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--c-white);
  line-height: 1.4;
}

.footer-cta-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 14px 28px;
  background: var(--c-white);
  color: var(--c-dark);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius);
  letter-spacing: 0.02em;
  transition: opacity 0.2s;
  min-height: 48px;
}
.footer-cta-btn:hover { opacity: 0.85; text-decoration: none; }

.footer-bar {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-bar nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-bar nav a {
  font-size: 0.8rem;
  color: var(--c-text-muted-dark);
  transition: color 0.2s;
  padding: 4px 0;
  min-height: 40px;
  display: flex;
  align-items: center;
}
.footer-bar nav a:hover { color: var(--c-white); text-decoration: none; }

.footer-copy {
  font-size: 0.78rem;
  color: var(--c-text-muted-dark);
  flex-shrink: 0;
}

/* ============================================================
   Scroll Reveal 动效
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .card,
  .sub-card,
  .topic-card,
  .sidebar-block {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.45s ease, transform 0.45s ease, box-shadow 0.25s;
  }
  .card.is-visible,
  .sub-card.is-visible,
  .topic-card.is-visible,
  .sidebar-block.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  /* Stagger */
  .card:nth-child(1), .sub-card:nth-child(1), .topic-card:nth-child(1) { transition-delay: 0ms; }
  .card:nth-child(2), .sub-card:nth-child(2), .topic-card:nth-child(2) { transition-delay: 60ms; }
  .card:nth-child(3), .sub-card:nth-child(3), .topic-card:nth-child(3) { transition-delay: 120ms; }
  .card:nth-child(4), .sub-card:nth-child(4), .topic-card:nth-child(4) { transition-delay: 180ms; }
  .card:nth-child(5), .sub-card:nth-child(5) { transition-delay: 240ms; }
  .card:nth-child(6), .sub-card:nth-child(6) { transition-delay: 300ms; }
}

@media (prefers-reduced-motion: reduce) {
  .card,
  .sub-card,
  .topic-card,
  .sidebar-block {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ============================================================
   响应式 — 平板
   ============================================================ */
@media (max-width: 900px) {
  .layout-with-aside {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .sidebar {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 32px;
  }
  .sidebar-block {
    margin-bottom: 0;
  }
  .topics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .cards-section {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   响应式 — 手机
   ============================================================ */
@media (max-width: 640px) {
  :root { --header-h: 56px; }

  .header-inner {
    padding: 0 16px;
    gap: 12px;
  }
  .brand {
    font-size: 0.78rem;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .header-contact {
    display: none;
  }

  .hero {
    min-height: 70vh;
    padding-bottom: 48px;
  }
  .hero-inner {
    padding: 48px 16px 0;
  }
  .hero-title {
    font-size: 2.2rem;
  }
  .hero-desc {
    font-size: 0.9rem;
  }

  .page-banner,
  .article-banner {
    padding: 32px 0 28px;
  }
  .banner-inner {
    padding: 0 16px;
  }
  .page-title {
    font-size: 1.6rem;
    text-align: left;
  }
  .page-intro {
    text-align: left;
    margin-left: 0;
  }
  .page-dates {
    justify-content: flex-start;
  }

  main { padding: 32px 0; }
  .wrap { padding: 0 16px; }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .article-body,
  .topic-content,
  .about-body,
  .privacy-body,
  .data-body,
  .default-body,
  .home-content {
    padding: 24px 20px;
  }

  .topics-grid {
    grid-template-columns: 1fr;
  }
  .topic-link {
    min-height: auto;
    padding: 24px 20px;
  }

  .footer-cta-block {
    flex-direction: column;
    align-items: flex-start;
    padding: 32px 16px;
    gap: 16px;
  }
  .footer-cta-text {
    font-size: 1rem;
  }
  .footer-bar {
    padding: 14px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .footer-bar nav {
    gap: 12px;
  }

  .sub-card {
    padding: 18px 16px;
    gap: 14px;
  }
  .section-header h2 {
    font-size: 1.3rem;
  }
}
