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

*, *::before, *::after { box-sizing: border-box; }

:root {
  --ink: #000000;
  --paper: #ffffff;
  --soft: #f4f4f4;
  --rail-w: 264px;
  --bar-h: 52px;
  --r: 28px;
  --sep: 46px;
  --sans: "Baloo 2", "Comic Neue", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

body {
  margin: 0;
  padding: var(--bar-h) 0 0 var(--rail-w);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.72;
  letter-spacing: 0.01em;
}

img { max-width: 100%; }

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 2px;
}

/* 顶部细条 */
.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 18px;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  z-index: 60;
}

.topbar__brand {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.topbar__jump {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
}

.topbar__jump:hover {
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

/* 左侧固定竖栏 */
.rail {
  position: fixed;
  top: var(--bar-h);
  bottom: 0;
  left: 0;
  width: var(--rail-w);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px 16px 28px;
  background: var(--paper);
  border-right: 2px solid var(--ink);
  overflow-y: auto;
  z-index: 50;
}

.rail__head { padding-bottom: 6px; }

.rail__mark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.rail__logo { display: block; max-height: 40px; width: auto; }

.rail__brand {
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.rail__groups {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rail__group {
  border: 2px solid var(--ink);
  border-radius: var(--r);
  background: var(--paper);
  overflow: hidden;
}

.rail__group summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.rail__group summary::-webkit-details-marker { display: none; }

.rail__group summary::after {
  content: "＋";
  font-size: 0.9rem;
  line-height: 1;
}

.rail__group[open] summary::after { content: "－"; }

.rail__group[open] summary { border-bottom: 2px solid var(--ink); }

.rail__list {
  list-style: none;
  margin: 0;
  padding: 6px;
}

.rail__list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.95rem;
  line-height: 1.35;
}

.rail__list a:hover {
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

/* 首页首屏 */
.hero {
  min-height: calc(100vh - var(--bar-h));
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: center;
  gap: 24px;
  padding: clamp(28px, 5vw, 60px) clamp(20px, 4vw, 56px);
  border-bottom: 2px solid var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(var(--ink) 1px, transparent 1.2px);
  background-size: 20px 20px;
}

.hero__text {
  grid-column: 1 / 7;
  grid-row: 1;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: var(--r);
  padding: clamp(22px, 3vw, 42px);
}

.hero h1 {
  margin: 0 0 0.4em;
  font-size: clamp(2.4rem, 6.4vw, 5rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 700;
  overflow-wrap: break-word;
}

.hero__lead {
  margin: 0 0 26px;
  max-width: 32ch;
  font-size: clamp(1rem, 1.5vw, 1.14rem);
  line-height: 1.7;
}

.hero__jump {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 28px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  letter-spacing: 0.1em;
}

.hero__jump:hover {
  background: var(--paper);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink);
  text-decoration: none;
}

.hero__media {
  grid-column: 8 / 13;
  grid-row: 1;
  margin: 0;
  aspect-ratio: 4 / 5;
  border: 3px solid var(--ink);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--paper);
}

.hero__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 正文区：左目录 + 右正文 */
.spread {
  display: grid;
  grid-template-columns: minmax(0, 208px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(24px, 4vw, 56px);
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 64px) clamp(20px, 4vw, 56px);
}

.ledger {
  position: sticky;
  top: calc(var(--bar-h) + 20px);
  border: 3px solid var(--ink);
  border-radius: var(--r);
  padding: 20px;
  background: var(--paper);
}

.ledger__kick {
  display: block;
  margin-bottom: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.ledger__title {
  margin: 0 0 14px;
  font-size: 1.5rem;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.ledger__list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: led;
}

.ledger__list li {
  counter-increment: led;
  border-top: 2px solid var(--ink);
}

.ledger__list a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 44px;
  padding: 10px 2px;
  font-size: 0.95rem;
  line-height: 1.35;
}

.ledger__list a::before {
  content: counter(led, decimal-leading-zero);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.ledger__list a:hover { text-decoration: underline; }

.ledger__list a[aria-current="true"] {
  background: var(--ink);
  color: var(--paper);
  padding-left: 8px;
  padding-right: 8px;
  text-decoration: none;
}

/* 正文条目 */
.entry {
  min-width: 0;
  max-width: 72ch;
}

.entry > article {
  margin-top: var(--sep);
  padding-top: var(--sep);
  border-top: 3px solid var(--ink);
  scroll-margin-top: calc(var(--bar-h) + 28px);
}

.entry > article:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.entry h2 {
  margin: 0 0 0.5em;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  line-height: 1.18;
  letter-spacing: -0.025em;
  font-weight: 700;
  overflow-wrap: break-word;
}

.entry h3 {
  margin: 1.6em 0 0.4em;
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  line-height: 1.3;
  font-weight: 700;
}

.entry p {
  margin: 0 0 1.05em;
  max-width: 64ch;
}

.entry strong { font-weight: 700; }

.entry a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.entry ul,
.entry ol {
  margin: 0 0 1.1em;
  padding-left: 1.4em;
}

.entry li { margin-bottom: 0.5em; }

.entry blockquote {
  margin: 1.6em 0;
  padding: 18px 22px;
  border-left: 6px solid var(--ink);
  border-radius: 0 var(--r) var(--r) 0;
  background: var(--soft);
  font-size: 1.05rem;
}

.entry blockquote p:last-child { margin-bottom: 0; }

.entry figure {
  margin: 1.6em 0;
  border: 3px solid var(--ink);
  border-radius: var(--r);
  overflow: hidden;
  background: var(--paper);
}

.entry figure img {
  display: block;
  width: 100%;
  height: auto;
}

.entry figcaption {
  padding: 10px 16px;
  border-top: 2px solid var(--ink);
  font-size: 0.9rem;
}

.entry table {
  display: block;
  width: 100%;
  margin: 1.4em 0;
  border-collapse: collapse;
  overflow-x: auto;
  font-size: 0.95rem;
}

.entry th,
.entry td {
  border: 2px solid var(--ink);
  padding: 10px 12px;
  text-align: left;
}

.entry > article:first-child > p:first-of-type::first-letter {
  float: left;
  padding: 0.06em 0.12em 0 0;
  font-size: 3.6em;
  line-height: 0.78;
  font-weight: 700;
}

/* 页脚 */
.foot {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 26px 22px;
  border-top: 3px solid var(--ink);
}

.foot p { margin: 0; }

.foot__brand {
  font-weight: 700;
  letter-spacing: 0.08em;
}

.foot__copy { text-align: center; }

.foot__copy small { font-size: 0.9rem; }

.foot__top { text-align: right; }

.foot__top a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-size: 0.9rem;
}

.foot__top a:hover {
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
}

/* 滚动显现 */
@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .hero__text,
    .hero__media,
    .ledger {
      animation: rise 0.8s both;
      animation-timeline: view();
      animation-range: entry 0% cover 38%;
    }
    .entry > article {
      animation: rise 0.7s both;
      animation-timeline: view();
      animation-range: entry 0% entry 45%;
    }
  }
}

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

/* 中等屏幕 */
@media (max-width: 1024px) {
  :root { --rail-w: 232px; }
  .hero__text { grid-column: 1 / 7; }
  .hero__media { grid-column: 7 / 13; }
}

/* 移动端 */
@media (max-width: 900px) {
  :root { --rail-w: 0px; }

  body { padding-left: 0; }

  .rail {
    position: static;
    width: auto;
    padding: 14px 16px 18px;
    border-right: 0;
    border-bottom: 3px solid var(--ink);
    gap: 12px;
  }

  .rail__brand { font-size: 1.5rem; }

  .rail__groups { flex-direction: row; flex-wrap: wrap; }

  .rail__group { flex: 1 1 150px; }

  .hero {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    padding: 24px 16px 34px;
    gap: 18px;
  }

  .hero__text {
    grid-column: 1;
    grid-row: 1;
    padding: 22px 18px;
  }

  .hero__media {
    grid-column: 1;
    grid-row: 2;
    aspect-ratio: 16 / 11;
  }

  .spread {
    grid-template-columns: minmax(0, 1fr);
    padding: 30px 16px;
    gap: 28px;
  }

  .ledger { position: static; }

  .foot {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
    padding: 24px 16px;
  }

  .foot__top { text-align: center; }
}

@media (max-width: 640px) {
  .hero h1 { font-size: clamp(2rem, 9.5vw, 2.9rem); }
  .hero__lead { max-width: none; }
  .topbar__brand { letter-spacing: 0.14em; }
}

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