/* 首页 */
.page { max-width: 72rem; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem); overflow-x: clip; }

/* ---------- 开篇 ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: var(--space-l);
  align-items: center;
  padding: var(--space-xl) 0 var(--space-l);
}
.kicker {
  font: 600 var(--step--1)/1 var(--sans); letter-spacing: 0.2em; color: var(--accent);
  margin-bottom: var(--space-m);
}
.hero h1 { font-size: var(--step-4); line-height: 1.12; letter-spacing: 0.02em; }
.hero h1 .en { font-style: italic; font-weight: 500; letter-spacing: -0.01em; }
.hero .lede { margin-top: var(--space-m); max-width: 30rem; font-size: var(--step-1); line-height: 1.7; color: var(--ink-soft); }
.hero .actions { margin-top: var(--space-l); display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-s) var(--space-m); }

/* 标题里的荧光笔：加载时从左到右划过 */
.sweep {
  background: linear-gradient(transparent 60%, var(--marker) 60%, var(--marker) 94%, transparent 94%) no-repeat 0 0 / 0% 100%;
  animation: sweep 900ms 450ms var(--ease-out) forwards;
  padding: 0 0.06em;
}
@keyframes sweep { to { background-size: 100% 100%; } }

.hero-preview { position: relative; justify-self: center; width: min(100%, 27rem); }
.hero-preview .page-scrap {
  position: absolute; inset: 1.4rem -0.8rem -1.4rem 1.4rem;
  background: repeating-linear-gradient(var(--paper-deep) 0 1.9rem, var(--rule-soft) 1.9rem calc(1.9rem + 1px));
  border: 1px solid var(--rule); border-radius: 4px; transform: rotate(2.2deg);
}
.hero-preview [data-preview] { position: relative; transform: rotate(-1.4deg); filter: drop-shadow(0 18px 28px rgb(27 46 38 / 0.16)); }
.hero-preview figcaption {
  position: relative; margin-top: 2.2rem; font: italic 400 var(--step-0)/1.5 var(--serif-en); color: var(--muted); text-align: right;
}

/* 入场：分层淡入 */
.rise { opacity: 0; transform: translateY(14px); animation: rise 700ms var(--ease-out) forwards; }
.rise:nth-child(2) { animation-delay: 90ms; }
.rise:nth-child(3) { animation-delay: 180ms; }
.rise:nth-child(4) { animation-delay: 270ms; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- 书签按钮 ---------- */
.bookmarklet {
  position: relative; display: inline-flex; align-items: center; gap: 0.55rem;
  font: 600 var(--step--1)/1 var(--sans); color: var(--paper); background: var(--ink);
  padding: 0.75rem 1.25rem 0.75rem 1.05rem; border-radius: 6px; text-decoration: none; cursor: grab;
}
.bookmarklet::before {
  content: ""; width: 0.62rem; height: 0.95rem; background: var(--marker-strong);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 72%, 0 100%);
}
.bookmarklet:hover { background: #10211a; }
.bookmarklet:active { cursor: grabbing; }

/* ---------- 章节标题 ---------- */
.section { padding-top: var(--space-xl); }
.section-head { display: grid; grid-template-columns: var(--margin-col) minmax(0, 1fr); gap: var(--space-l); align-items: baseline; margin-bottom: var(--space-l); }
.section-head .folio { font: italic 400 var(--step-2)/1 var(--serif-en); color: var(--accent); }
.section-head h2 { font-size: var(--step-3); }
.section-head p { margin-top: 0.6rem; color: var(--ink-soft); max-width: 34rem; }

/* ---------- 试读：书页 + 页边批注 ---------- */
.folio-page {
  position: relative;
  background: color-mix(in srgb, var(--paper) 55%, #fff);
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: var(--space-l) clamp(1.2rem, 5vw, 4rem);
  box-shadow: 0 1px 0 var(--paper-edge), 0 2px 0 var(--paper), 0 3px 0 var(--rule-soft);
}
.essay-title { font: italic 500 var(--step-3)/1.1 var(--serif-en); letter-spacing: -0.01em; margin-bottom: 0.3rem; }
.essay-byline { font: 600 var(--step--1)/1 var(--sans); letter-spacing: 0.16em; color: var(--muted); text-transform: uppercase; margin-bottom: var(--space-l); }
.essay-row { display: grid; grid-template-columns: minmax(0, var(--measure)) minmax(0, var(--margin-col)); gap: var(--space-l); align-items: start; }
.essay-row + .essay-row { margin-top: 1.3rem; }
.essay-row > p { font: 400 clamp(1.12rem, 1.02rem + 0.45vw, 1.32rem)/1.78 var(--serif-en); color: var(--ink); hanging-punctuation: first; }
.essay-row:first-of-type > p::first-letter {
  float: left; font: 500 3.9em/0.82 var(--serif-en); margin: 0.07em 0.1em 0 -0.03em; color: var(--accent);
}
.note {
  position: relative; font-size: var(--step--1); line-height: 1.6; color: var(--ink-soft);
  padding-left: 1rem; border-left: 1px solid var(--rule); margin-top: 0.35rem;
}
.note b { display: block; font: italic 500 1.35rem/1 var(--serif-en); color: var(--accent); margin-bottom: 0.35rem; }
.note .star { color: var(--star); }
.note small { display: block; margin-top: 0.35rem; color: var(--muted); }

/* ---------- 三件小事 ---------- */
.ledger { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--ink); }
.ledger li {
  display: grid; grid-template-columns: var(--margin-col) minmax(0, 22rem) minmax(0, 1fr); gap: var(--space-l);
  padding: var(--space-m) 0; border-bottom: 1px solid var(--rule); align-items: baseline;
}
.ledger .numeral { font: italic 300 var(--step-4)/0.9 var(--serif-en); color: var(--accent); }
.ledger h3 { font-size: var(--step-2); }
.ledger p { color: var(--ink-soft); max-width: 30rem; }
.ledger .sample { display: block; margin-top: 0.5rem; font: italic 400 var(--step-1)/1.5 var(--serif-en); color: var(--ink); }

/* ---------- 带去任何网页 ---------- */
.anywhere { display: grid; grid-template-columns: var(--margin-col) minmax(0, 1fr); gap: var(--space-l); }
.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-m); max-width: 40rem; }
.steps li { counter-increment: step; display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: 0.6rem; }
.steps li::before { content: counter(step); font: italic 500 var(--step-2)/1 var(--serif-en); color: var(--accent); }
.steps strong { display: block; font-weight: 600; margin-bottom: 0.2rem; }
.steps p { color: var(--ink-soft); }
kbd {
  font: 600 0.85em/1 var(--sans); padding: 0.15em 0.45em; border-radius: 4px;
  border: 1px solid var(--rule); border-bottom-width: 2px; background: var(--paper);
}
.fine { margin-top: var(--space-m); font-size: var(--step--1); color: var(--muted); max-width: 40rem; }

/* ---------- 生词本预览：横线本 ---------- */
.notebook { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 20rem); gap: var(--space-l); align-items: center; }
.notebook-sample {
  position: relative; margin: 0; padding: 1.2rem 1.4rem 1.2rem 3.4rem; list-style: none;
  background:
    linear-gradient(90deg, transparent 2.5rem, color-mix(in srgb, var(--danger) 30%, transparent) 2.5rem calc(2.5rem + 1px), transparent calc(2.5rem + 1px)),
    repeating-linear-gradient(color-mix(in srgb, var(--paper) 40%, #fff) 0 2.4rem, var(--rule) 2.4rem calc(2.4rem + 1px));
  border: 1px solid var(--rule); border-radius: 3px;
}
.notebook-sample li { min-height: 4.8rem; padding-top: 0.55rem; }
.notebook-sample .word { font: 500 var(--step-1)/1.2 var(--serif-en); }
.notebook-sample .word .star { color: var(--star); font-family: var(--sans); font-size: 0.8em; margin-left: 0.35rem; }
.notebook-sample .gloss { color: var(--ink-soft); font-size: var(--step--1); line-height: 2.4rem; }
.notebook-sample .gloss i { font-family: var(--serif-en); }
.notebook aside h2 { font-size: var(--step-3); margin-bottom: 0.8rem; }
.notebook aside p { color: var(--ink-soft); margin-bottom: var(--space-m); }

/* ---------- 窄屏：批注回到正文之间 ---------- */
@media (max-width: 58rem) {
  .hero { grid-template-columns: minmax(0, 1fr); padding-top: var(--space-l); }
  .hero-preview { margin-top: var(--space-s); }
  .section-head, .anywhere, .notebook { grid-template-columns: minmax(0, 1fr); gap: var(--space-s); }
  .essay-row { grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
  .essay-row .note { order: -1; margin-top: 0; }
  .ledger li { grid-template-columns: 3.6rem minmax(0, 1fr); gap: 0.4rem 1rem; }
  .ledger li p { grid-column: 2; }
  .ledger .numeral { font-size: var(--step-3); grid-row: span 2; }
}
