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

/* ============================
   设计令牌
   ============================ */
:root {
  --mint:      #5cc6b0;
  --mint-dim:  #3fa890;
  --mint-pale: #5cc6b020;
  --sand:      #d4c4a8;
  --sand-dim:  #b8a88a;
  --ink:       #172623;
  --ink-mid:   #1f3530;
  --ink-lite:  #2a4540;
  --text-main: #e8dfd0;
  --text-mute: #a09882;
  --border:    #2e4a44;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 18px;
  --radius-xl: 28px;
  --font:      'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
  --sidebar-w: 220px;
  --ease-out:  cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.28);
  --shadow-md: 0 6px 24px rgba(0,0,0,0.36);
}

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

html {
  font-size: 16px;
  line-height: 1.6;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background-color: var(--ink);
  color: var(--text-main);
  min-height: 100vh;
  overflow-x: hidden;
}

/* grain texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }

/* ============================
   页面骨架
   ============================ */
.page-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ============================
   左侧固定导航
   ============================ */
.sidebar-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--ink-mid);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0;
  z-index: 100;
  overflow-y: auto;
  padding-bottom: 24px;
}

.sidebar-brand {
  padding: 28px 20px 20px;
  border-bottom: 1px solid var(--border);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--mint);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  transition: opacity 0.2s;
  min-height: 44px;
  padding: 4px 0;
}
.brand-link:hover { opacity: 0.8; }

.brand-logo-img { width: 32px; height: 32px; border-radius: var(--radius-sm); }
.brand-name { line-height: 1.2; }

/* nav > ol > li > a  (抽签结构) */
.nav-list {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  counter-reset: nav-counter;
}

.nav-list li {
  counter-increment: nav-counter;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  min-height: 44px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-mute);
  transition: background 0.18s var(--ease-out), color 0.18s;
  position: relative;
}

.nav-link::before {
  content: counter(nav-counter, decimal-leading-zero);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--mint-dim);
  opacity: 0.7;
  width: 20px;
  flex-shrink: 0;
  letter-spacing: 0.05em;
}

.nav-link:hover,
.nav-link:focus-visible {
  background: var(--mint-pale);
  color: var(--mint);
}

.sidebar-cta {
  padding: 16px 16px 8px;
}

.cta-btn {
  display: block;
  text-align: center;
  padding: 12px 16px;
  min-height: 44px;
  background: var(--mint);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: var(--radius-md);
  letter-spacing: 0.04em;
  transition: background 0.2s var(--ease-out), transform 0.15s;
}
.cta-btn:hover { background: var(--mint-dim); transform: translateY(-1px); }

/* ============================
   主内容区
   ============================ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ============================
   Hero 区块
   ============================ */
.hero-section {
  min-height: 70vh;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "aside collage"
    "text  collage";
  gap: 0 40px;
  padding: 60px 48px 48px;
  background: linear-gradient(135deg, var(--ink-mid) 0%, var(--ink) 60%);
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -60px;
  right: 0;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, #5cc6b018 0%, transparent 70%);
  pointer-events: none;
}

.hero-aside {
  grid-area: aside;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 24px;
  align-self: end;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  background: var(--sand);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 40px;
  letter-spacing: 0.06em;
  width: fit-content;
}

.hero-tag {
  font-size: 0.8rem;
  color: var(--mint);
  font-weight: 500;
  letter-spacing: 0.08em;
}

.hero-text {
  grid-area: text;
  display: flex;
  flex-direction: column;
  gap: 20px;
  justify-content: flex-start;
  padding-top: 8px;
}

.hero-h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.hero-desc {
  font-size: 1rem;
  color: var(--text-mute);
  line-height: 1.7;
  max-width: 420px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 13px 28px;
  min-height: 44px;
  background: var(--mint);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  letter-spacing: 0.04em;
  transition: background 0.2s var(--ease-out), transform 0.15s;
}
.btn-primary:hover { background: var(--mint-dim); transform: translateY(-2px); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 13px 28px;
  min-height: 44px;
  border: 1.5px solid var(--border);
  color: var(--sand);
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: var(--radius-md);
  transition: border-color 0.2s, color 0.2s, transform 0.15s;
}
.btn-secondary:hover { border-color: var(--mint); color: var(--mint); transform: translateY(-2px); }

/* Hero 双图错位拼贴 */
.hero-collage {
  grid-area: collage;
  position: relative;
  align-self: stretch;
}

.collage-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 360px;
}

.collage-slot {
  position: absolute;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.collage-slot--a {
  width: 72%;
  height: 75%;
  top: 0;
  right: 0;
  border: 1px solid var(--border);
  transition: transform 0.6s var(--ease-out);
}

.collage-slot--b {
  width: 60%;
  height: 60%;
  bottom: 0;
  left: 0;
  border: 1px solid var(--sand-dim);
  transition: transform 0.6s var(--ease-out);
  z-index: 2;
}

.collage-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.collage-placeholder {
  background: linear-gradient(135deg, var(--ink-lite) 0%, var(--ink-mid) 100%);
}

.collage-caption {
  position: absolute;
  bottom: -20px;
  right: 0;
  font-size: 0.7rem;
  color: var(--text-mute);
  letter-spacing: 0.06em;
}

/* 英雄区视差感 */
@media (hover: hover) {
  .page-shell:has(.hero-section) .collage-slot--a:hover { transform: translateY(-4px) rotate(-1deg); }
  .page-shell:has(.hero-section) .collage-slot--b:hover { transform: translateY(-4px) rotate(1deg); }
}

/* ============================
   内容主区（main > section > aside + content）
   ============================ */
.content-section {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 0 40px;
  padding: 56px 48px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

/* aside 在内容左侧 (抽签结构) */
.content-aside {
  align-self: start;
  position: sticky;
  top: 24px;
}

.aside-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--mint);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.aside-toc {
  display: flex;
  flex-direction: column;
  gap: 6px;
  counter-reset: toc-c;
}

.aside-toc li { counter-increment: toc-c; }

.aside-toc a {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-mute);
  line-height: 1.4;
  padding: 4px 0;
  transition: color 0.18s;
}

.aside-toc a::before {
  content: counter(toc-c, decimal-leading-zero);
  font-size: 0.65rem;
  color: var(--mint-dim);
  flex-shrink: 0;
  margin-top: 1px;
}

.aside-toc a:hover { color: var(--mint); }

/* ============================
   正文区
   ============================ */
.content-body {
  min-width: 0;
}

.content-body h1 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.content-body h2 {
  font-size: clamp(1.2rem, 2.5vw, 1.6rem);
  font-weight: 600;
  line-height: 1.3;
  margin: 40px 0 10px;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.content-body h2:first-child { margin-top: 0; }

.content-body h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 28px 0 8px;
  color: var(--sand);
}

.content-body p,
.content-body li {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-main);
  margin-bottom: 14px;
}

.content-body ul,
.content-body ol {
  padding-left: 1.4em;
  margin-bottom: 16px;
}

.content-body ul { list-style: disc; }
.content-body ol { list-style: decimal; }

.content-body a {
  color: var(--mint);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s;
}
.content-body a:hover { color: var(--mint-dim); }

.content-body strong { color: var(--sand); font-weight: 600; }

.content-body blockquote {
  border-left: 3px solid var(--mint);
  padding: 12px 20px;
  margin: 24px 0;
  background: var(--mint-pale);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--text-mute);
}

.content-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: 0.9rem;
}

.content-body th,
.content-body td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}

.content-body th {
  background: var(--ink-lite);
  color: var(--mint);
  font-weight: 600;
}

/* ============================
   h2 + p.subtitle 装饰 (抽签结构)
   ============================ */
.subtitle,
p.subtitle,
p.subhead,
p.desc,
p.lead {
  font-size: 0.95rem;
  color: var(--text-mute);
  line-height: 1.7;
  margin-top: -6px;
  margin-bottom: 20px;
  font-weight: 400;
}

.hero-text .subtitle { font-size: 0.9rem; color: var(--sand-dim); }

/* 正文内section样式 */
.content-body section {
  padding: 36px 0;
  border-top: 1px solid var(--border);
}

.content-body section:first-child { border-top: none; padding-top: 0; }

.content-body section h2 {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ============================
   卡片样式（描边无阴影 圆角10px）
   ============================ */
.card {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  background: transparent;
  transition: border-color 0.2s var(--ease-out);
}

.card:hover { border-color: var(--mint); }

/* ============================
   页脚（单行 logo + nav + copyright）
   ============================ */
.site-footer {
  margin-left: 0;
  background: var(--ink-mid);
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 48px;
  flex-wrap: wrap;
}

.footer-brand a {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--mint);
  letter-spacing: 0.04em;
  transition: opacity 0.2s;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
}
.footer-brand a:hover { opacity: 0.75; }

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

.footer-nav a {
  font-size: 0.8rem;
  color: var(--text-mute);
  padding: 8px 10px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-sm);
  transition: color 0.18s, background 0.18s;
}

.footer-nav a:hover { color: var(--mint); background: var(--mint-pale); }

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-mute);
  white-space: nowrap;
}

/* ============================
   scroll-margin-top 给区块
   ============================ */
section[id] {
  scroll-margin-top: 24px;
}

/* ============================
   Scroll Reveal 动效
   ============================ */
.reveal-section {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
}

.reveal-section.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* stagger 子项 */
.nav-list li {
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}

.nav-list.is-loaded li:nth-child(1) { opacity:1; transform:none; transition-delay:0.05s; }
.nav-list.is-loaded li:nth-child(2) { opacity:1; transform:none; transition-delay:0.10s; }
.nav-list.is-loaded li:nth-child(3) { opacity:1; transform:none; transition-delay:0.15s; }
.nav-list.is-loaded li:nth-child(4) { opacity:1; transform:none; transition-delay:0.20s; }
.nav-list.is-loaded li:nth-child(5) { opacity:1; transform:none; transition-delay:0.25s; }
.nav-list.is-loaded li:nth-child(6) { opacity:1; transform:none; transition-delay:0.30s; }
.nav-list.is-loaded li:nth-child(7) { opacity:1; transform:none; transition-delay:0.35s; }

@media (prefers-reduced-motion: reduce) {
  .reveal-section,
  .nav-list li {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  html { scroll-behavior: auto; }
}

/* ============================
   响应式
   ============================ */
@media (max-width: 960px) {
  :root { --sidebar-w: 180px; }

  .hero-section {
    grid-template-columns: 1fr;
    grid-template-areas:
      "aside"
      "text"
      "collage";
    padding: 40px 28px 32px;
    min-height: auto;
    gap: 24px 0;
  }

  .hero-collage {
    min-height: 240px;
    height: 240px;
  }

  .collage-wrap { min-height: 240px; }

  .content-section {
    grid-template-columns: 1fr;
    padding: 40px 28px;
    gap: 28px 0;
  }

  .content-aside {
    position: static;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .aside-toc {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }

  .footer-inner { padding: 16px 28px; }
}

@media (max-width: 680px) {
  :root { --sidebar-w: 0px; }

  .sidebar-nav {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    border-right: none;
    border-top: 1px solid var(--border);
    padding: 0 8px;
    overflow-x: auto;
    overflow-y: hidden;
    z-index: 200;
  }

  .sidebar-brand {
    border-bottom: none;
    border-right: 1px solid var(--border);
    padding: 8px 12px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .brand-link {
    min-height: 48px;
    padding: 4px 0;
  }

  .brand-name { display: none; }

  .brand-logo-img {
    width: 28px;
    height: 28px;
  }

  .nav-list {
    flex-direction: row;
    padding: 4px 4px;
    gap: 0;
    flex: 1;
    overflow-x: auto;
  }

  .nav-list li { opacity: 1 !important; transform: none !important; }

  .nav-link {
    white-space: nowrap;
    font-size: 0.75rem;
    padding: 10px 8px;
    min-height: 48px;
  }

  .nav-link::before { display: none; }

  .sidebar-cta { padding: 6px 8px; flex-shrink: 0; }

  .cta-btn {
    white-space: nowrap;
    padding: 10px 12px;
    font-size: 0.8rem;
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .main-content {
    margin-left: 0;
    padding-bottom: 72px;
  }

  .hero-section { padding: 28px 20px 24px; }
  .hero-h1 { font-size: 1.75rem; }

  .content-section { padding: 32px 20px; }

  .footer-inner {
    padding: 14px 20px;
    gap: 10px;
  }

  .footer-nav { display: none; }

  .site-footer { margin-bottom: 64px; }
}

@media (max-width: 400px) {
  .hero-actions { flex-direction: column; }
  .btn-primary, .btn-secondary { width: 100%; justify-content: center; }
}

button[aria-expanded]{min-width:44px;min-height:44px}
