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

:root {
  --paper: #fdfbf7;
  --paper2: #f5f5f5;
  --ink: #1a1a1a;
  --line: #e0e0e0;
  --muted: #5c5852;
  --bar: 56px;
  --r: 4px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Comic Neue', Georgia, 'Songti SC', 'Noto Serif SC', serif;
  font-size: 17px;
  line-height: 1.75;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  opacity: 0.42;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='140' height='140' filter='url(%23n)' opacity='0.28'/></svg>");
  background-size: 140px 140px;
}

h1, h2, h3, h4, .mark-word, .footmark, .jump, .contact {
  font-family: 'Baloo 2', 'Comic Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

a { color: var(--ink); text-decoration: none; }
a:hover { background: var(--ink); color: var(--paper); }
img { max-width: 100%; height: auto; display: block; border-radius: var(--r); }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--bar);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r);
  background: var(--ink);
  color: var(--paper);
  flex: none;
}
.mark:hover { background: var(--ink); color: var(--paper); opacity: 0.85; }
.mark-img { width: 22px; height: 22px; border-radius: 2px; }
.mark-dot {
  width: 12px;
  height: 12px;
  background: var(--paper);
  border-radius: 50%;
  display: block;
}

.mark-word {
  margin: 0;
  font-size: 17px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.contact {
  flex: none;
  padding: 10px 16px;
  border-radius: var(--r);
  background: var(--paper2);
  font-size: 16px;
  line-height: 1.2;
}

/* ---------- 锚点条 ---------- */
.tape {
  position: sticky;
  top: var(--bar);
  z-index: 25;
  background: var(--paper2);
  border-bottom: 1px solid var(--line);
}
.tape-in {
  display: flex;
  gap: 8px;
  padding: 6px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tape-in::-webkit-scrollbar { display: none; }
.tape a {
  flex: none;
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  font-size: 15px;
  border-radius: var(--r);
  background: var(--paper);
  white-space: nowrap;
}
.tape a.is-on { background: var(--ink); color: var(--paper); }

/* ---------- 主框架 ---------- */
.shell {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
}

/* ---------- 左侧栏 ---------- */
.rail {
  position: sticky;
  top: calc(var(--bar) + 54px);
  padding: 26px 0 40px;
  border-right: 1px solid var(--line);
  padding-right: 20px;
}

.rail-h {
  margin: 0;
  font-size: 22px;
}

.subtitle {
  margin: 4px 0 14px;
  font-size: 15px;
  color: var(--muted);
  font-style: italic;
  line-height: 1.5;
}

.rail-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.rail-list li + li { margin-top: 2px; }
.rail-list a {
  display: block;
  padding: 11px 10px;
  font-size: 16px;
  line-height: 1.4;
  border-radius: var(--r);
  border-left: 3px solid transparent;
}
.rail-list a:hover,
.rail-list a.is-on {
  background: var(--ink);
  color: var(--paper);
  border-left-color: var(--ink);
}

.rail-top {
  display: inline-block;
  margin-top: 18px;
  padding: 10px 12px;
  font-size: 15px;
  border-radius: var(--r);
  background: var(--paper2);
}

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

article { padding: 0 0 60px; }

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  grid-template-areas: "media copy";
  gap: 32px;
  align-items: center;
  min-height: calc(100svh - var(--bar) - 56px);
  padding: 40px 0 48px;
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  grid-area: copy;
  text-align: center;
  min-width: 0;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 15px;
  letter-spacing: 0.22em;
  color: var(--muted);
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2rem, 5.2vw, 3.4rem);
  line-height: 1.18;
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
}

.lede {
  margin: 16px auto 22px;
  max-width: 32ch;
  font-size: 17px;
  color: var(--muted);
}

.jump {
  display: inline-block;
  padding: 12px 26px;
  border-radius: var(--r);
  background: var(--ink);
  color: var(--paper);
  font-size: 16px;
}
.jump:hover { background: #000; color: var(--paper); }

.hero-media {
  grid-area: media;
  position: relative;
  min-width: 0;
}
.hero-img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--r);
  background: var(--paper2);
}
.hero-plate {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: var(--r);
  background: var(--paper2);
  border: 1px solid var(--line);
}

.badge {
  position: absolute;
  left: -10px;
  bottom: 18px;
  padding: 7px 14px;
  background: var(--ink);
  color: var(--paper);
  border-radius: var(--r);
  font-size: 14px;
  letter-spacing: 0.06em;
  transform: rotate(-2deg);
}

/* 内容区通用排版 */
article > section[id] {
  scroll-margin-top: calc(var(--bar) + 62px);
  padding-top: 44px;
  margin-top: 44px;
  border-top: 1px dashed var(--line);
}

.body h2 {
  margin: 0 0 4px;
  font-size: clamp(1.4rem, 3.2vw, 2rem);
  overflow-wrap: break-word;
}

.body h2 + .subtitle,
.body h2 + p:not([class]) {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 15px;
  font-style: italic;
}

.body h3 {
  margin: 30px 0 10px;
  font-size: 1.16rem;
}

.body p { margin: 0 0 16px; max-width: 66ch; }
.body ul, .body ol { margin: 0 0 18px; padding-left: 1.25em; max-width: 66ch; }
.body li { margin-bottom: 8px; }
.body li::marker { color: var(--muted); }

.body blockquote {
  margin: 22px 0;
  padding: 4px 0 4px 16px;
  border-left: 4px solid var(--ink);
  color: var(--muted);
  font-style: italic;
}

.body figure { margin: 22px 0; }
.body figcaption { font-size: 14px; color: var(--muted); margin-top: 8px; }

.body code {
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 0.92em;
  background: var(--paper2);
  padding: 1px 5px;
  border-radius: 3px;
}

.body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 16px;
}
.body th, .body td {
  border: 1px solid var(--line);
  padding: 9px 12px;
  text-align: left;
}
.body th { background: var(--paper2); }

.body hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }

/* ---------- 页脚 ---------- */
.foot {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  background: var(--paper2);
  padding: 40px 16px 22px;
}

.footmark {
  margin: 0 auto 28px;
  max-width: 1160px;
  font-size: clamp(2.2rem, 11vw, 6rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
}

.footgrid {
  max-width: 1160px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.footgrid dl { margin: 0; }
.footgrid dt {
  font-family: 'Baloo 2', sans-serif;
  font-size: 15px;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: 8px;
}
.footgrid dd {
  margin: 0;
}
.footgrid dd a {
  display: inline-block;
  padding: 9px 0;
  font-size: 16px;
  line-height: 1.4;
}
.footgrid dd a:hover { background: transparent; text-decoration: underline; color: var(--ink); }

.copy {
  max-width: 1160px;
  margin: 26px auto 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--muted);
}

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  :root { --bar: 52px; }

  .shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 0 14px;
  }

  .rail {
    position: sticky;
    top: var(--bar);
    z-index: 22;
    background: var(--paper);
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px 0 8px;
  }
  .rail-h { font-size: 17px; }
  .subtitle { margin: 0 0 8px; font-size: 14px; }

  .rail-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 3px;
  }
  .rail-list::-webkit-scrollbar { display: none; }
  .rail-list li + li { margin-top: 0; }
  .rail-list a {
    white-space: nowrap;
    border-left: 0;
    border: 1px solid var(--line);
    padding: 10px 12px;
    min-height: 40px;
    display: flex;
    align-items: center;
    font-size: 15px;
  }
  .rail-top { margin-top: 8px; font-size: 14px; padding: 8px 12px; }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "copy" "media";
    min-height: 0;
    gap: 22px;
    padding: 28px 0 34px;
  }
  .hero h1 { font-size: clamp(1.8rem, 8vw, 2.4rem); }
  .lede { margin-left: auto; margin-right: auto; }
  .hero-img, .hero-plate { aspect-ratio: 5 / 4; }
  .badge { left: 10px; bottom: 10px; transform: none; }

  div > article[id] {
    scroll-margin-top: calc(var(--bar) + 116px);
    padding-top: 30px;
    margin-top: 30px;
  }

  .foot { padding: 30px 14px 18px; }
  .footgrid { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .footgrid dl { padding-bottom: 10px; }
  .footgrid dd a { padding: 11px 0; min-height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
  .hero-media { transform: none !important; }
}

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