/* Finite Scroll / 刷到为止 — shared styles
   Palette comes from the riso zine direction: paper, sheet, ink + blue / pink / yellow / red plates. */
@font-face { font-family: "FS Display"; src: url("fonts/fs-display-900.woff2") format("woff2"); font-weight: 900; font-display: swap; }
@font-face { font-family: "FS Pop"; src: url("fonts/Poppins-800.woff") format("woff"); font-weight: 800; font-display: swap; }
@font-face { font-family: "FS Pop"; src: url("fonts/Poppins-600.woff") format("woff"); font-weight: 600; font-display: swap; }

:root {
  --paper: #E8E8E2; --sheet: #F5F4EE; --ink: #1E2A6E; --blue: #0078BF; --pink: #FF48B0;
  --yel: #FFE800; --red: #F15060; --red-text: #C2263A;
  --tint-pink: #FBE3EF; --tint-blue: #DCEBF5; --tint-yel: #FFF7B8;
  --body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
  --display: "FS Pop", "FS Display", var(--body);
  --pop: "FS Pop", var(--body);
  --gutter: clamp(16px, 4vw, 48px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 18px; line-height: 1.75; overflow-x: hidden; }
img, svg, canvas { max-width: 100%; }
a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--blue); }
button { font-family: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 4px solid var(--pink); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 900; line-height: 1.15; margin: 0; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }

/* language: one page, two versions */
html[data-lang="zh"] .en, html[data-lang="en"] .zh { display: none !important; }
html[data-lang="en"] body { line-height: 1.6; }

.grain { background-image: radial-gradient(rgba(30,42,110,.10) .8px, transparent 1px), radial-gradient(rgba(30,42,110,.07) .7px, transparent .9px); background-size: 5px 5px, 7px 7px; background-position: 0 0, 2px 3px; }
.ht-pink { background-image: radial-gradient(var(--pink) 1.6px, transparent 1.9px); background-size: 9px 9px; }
.ht-blue { background-image: radial-gradient(var(--blue) 1.5px, transparent 1.8px); background-size: 8px 8px; }
.ht-yel { background-image: radial-gradient(#E0C800 1.8px, transparent 2.1px); background-size: 9px 9px; }
.wrap { max-width: 1440px; margin: 0 auto; padding-inline: var(--gutter); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--ink); color: var(--yel); padding: 10px 16px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* header */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding-block: 18px; }
.logo { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.logo b { font-family: var(--display); font-weight: 900; font-size: 24px; letter-spacing: -.02em; }
.logo i { font-family: var(--pop); font-style: normal; font-weight: 800; font-size: 13px; letter-spacing: .12em; }
.top nav { display: flex; flex-wrap: wrap; gap: 4px 24px; font-weight: 700; font-size: 16px; }
.top nav a { text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.top nav a[aria-current="page"] { box-shadow: inset 0 -4px 0 var(--pink); }
.lang { display: flex; border: 3px solid var(--ink); border-radius: 999px; overflow: hidden; }
.lang button { min-width: 50px; min-height: 44px; border: 0; background: transparent; font: 800 15px var(--pop); }
.lang button[aria-pressed="true"] { background: var(--ink); color: var(--yel); }
@media (max-width: 720px) { .top nav { order: 3; flex-basis: 100%; font-size: 15px; gap: 0 16px; } }

/* shared bits */
.src { display: inline-block; padding: 0 9px; border-radius: 999px; border: 2px solid currentColor; font: 700 12px/1.8 var(--body); vertical-align: middle; white-space: nowrap; text-decoration: none; opacity: .8; }
.src::after { content: " ↗"; }
.src:hover { opacity: 1; }
.src:hover { background: var(--ink); color: var(--yel); border-color: var(--ink); }
.offset { color: var(--blue); text-shadow: .05em .04em 0 rgba(255,72,176,.85); }
.pill-btn { min-height: 52px; padding: 0 24px; border-radius: 999px; border: 3px solid var(--ink); background: var(--sheet); font-weight: 900; font-size: 18px; display: inline-flex; align-items: center; gap: 10px; text-decoration: none; transition: transform .12s ease; }
.pill-btn:active { transform: scale(.95); }
.pill-btn.solid, .pill-btn[aria-pressed="true"] { background: var(--ink); color: var(--yel); }
.pill-btn.ghost { background: transparent; }
.text-btn { min-height: 44px; border: 0; background: none; font-weight: 700; font-size: 16px; text-decoration: underline; text-underline-offset: 3px; padding: 0 8px; }
.note { font-size: 14px; line-height: 1.7; }
.lede { font-size: clamp(18px, 1.5vw, 21px); max-width: 42em; }
.rule-list { list-style: none; border-top: 4px solid var(--ink); }
.rule-list > li { border-bottom: 4px solid var(--ink); padding: 22px 0; }
.section { padding-block: clamp(48px, 7vw, 96px); }
.section > h2, .h2 { font-size: clamp(28px, 3.2vw, 44px); letter-spacing: -.02em; margin-bottom: 28px; }
.chapter-nav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; padding-block: 40px 56px; }
.badge { padding: 8px 18px; border-radius: 999px; background: var(--ink); color: var(--yel); font-weight: 700; font-size: 15px; white-space: nowrap; }

/* quiz */
.quiz { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.quiz-item { padding: 24px; background: var(--sheet); border: 4px solid var(--ink); border-radius: 6px; }
.quiz-item:nth-child(odd) { transform: rotate(-.4deg); }
.quiz-item:nth-child(even) { transform: rotate(.5deg); }
.quiz-item h3 { font-family: var(--body); font-weight: 700; font-size: 18px; line-height: 1.6; margin-bottom: 14px; }
.quiz-opts { display: grid; gap: 10px; }
.quiz-opts button { min-height: 48px; text-align: left; padding: 8px 16px; border-radius: 10px; border: 3px solid var(--ink); background: var(--sheet); font-weight: 700; font-size: 16px; line-height: 1.5; }
.quiz-opts button[aria-pressed="true"] { background: var(--ink); color: var(--yel); }
.quiz-fb { margin-top: 14px; font-size: 16px; line-height: 1.7; min-height: 1.7em; }
.quiz-fb strong { color: var(--red-text); }
.quiz-fb.best strong { color: var(--blue); }

/* footer */
.foot { border-top: 4px solid var(--ink); padding-block: 28px 56px; display: flex; flex-wrap: wrap; gap: 8px 32px; font-size: 15px; }
.foot b { font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
  .top nav, .lang, .foot, .no-print { display: none !important; }
  body { background: #fff; }
}

/* stamps collected + toast */
.top nav a.got::after { content: "✓"; margin-left: 6px; font: 800 13px var(--pop); width: 20px; height: 20px; border-radius: 50%; background: var(--red); color: var(--sheet); display: inline-grid; place-items: center; transform: rotate(-8deg); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%) rotate(-2deg); z-index: 50; padding: 14px 24px; background: var(--red); color: var(--ink); border: 4px solid var(--ink); border-radius: 10px; font-family: var(--display); font-weight: 900; font-size: 20px; pointer-events: none; opacity: 0; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { animation: toast 3.2s ease forwards; }
@keyframes toast { 0% { transform: translate(-50%, 140%) rotate(-2deg) scale(1.6); opacity: 0 } 8% { transform: translate(-50%, 0) rotate(-2deg) scale(1); opacity: 1 } 85% { transform: translate(-50%, 0) rotate(-2deg); opacity: 1 } 100% { transform: translate(-50%, 140%) rotate(-2deg); opacity: 0 } }
.handoff { margin-top: 8px; padding: clamp(24px, 4vw, 44px); background: var(--ink); color: var(--sheet); border-radius: 8px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 40px; }
.handoff p { font-family: var(--display); font-weight: 900; font-size: clamp(22px, 2.6vw, 34px); line-height: 1.35; max-width: 22em; }
.handoff .pill-btn { background: var(--yel); color: var(--ink); border-color: var(--yel); }
.hook { font-family: var(--display); font-weight: 900; font-size: clamp(18px, 1.8vw, 24px); margin-top: 18px; }

/* "今晚的你": one evening runs through the whole site */
.night { display: flex; align-items: center; gap: 0; padding-block: 4px 18px; font-weight: 700; font-size: 14px; overflow-x: auto; }
.night a { display: flex; align-items: center; gap: 8px; text-decoration: none; white-space: nowrap; min-height: 44px; opacity: .6; }
.night a b { font: 800 15px var(--pop); padding: 3px 10px; border-radius: 999px; border: 2.5px solid currentColor; }
.night a[aria-current="step"] { opacity: 1; }
.night a[aria-current="step"] b { background: var(--ink); color: var(--yel); border-color: var(--ink); }
.night a.past { opacity: .85; }
.night i { flex: 1 1 24px; min-width: 18px; max-width: 90px; height: 0; border-top: 3px dashed currentColor; margin: 0 10px; opacity: .45; }
.night .moon { flex: none; width: 22px; height: 22px; border-radius: 50%; box-shadow: inset -7px -3px 0 0 currentColor; margin-right: 12px; transform: rotate(-20deg); }
.ch2 .night { color: var(--ink); padding-top: 18px; }
.scene { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 22px; margin-top: 22px; }
.scene .clock { font: 800 clamp(44px, 6vw, 84px)/1 var(--pop); letter-spacing: -.02em; }
.scene p { flex: 1 1 320px; font-family: var(--display); font-weight: 900; font-size: clamp(19px, 2vw, 26px); line-height: 1.45; max-width: 26em; }
.handoff .clock { display: block; font: 800 clamp(30px, 3.4vw, 44px)/1.1 var(--pop); color: var(--yel); margin-bottom: 6px; }
.night .lbl { font-family: var(--display); font-weight: 900; font-size: 15px; margin-right: 12px; white-space: nowrap; }
.night a em { font-style: normal; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--pink); color: var(--ink); }

/* sound toggle, share-card dialog */
.snd { width: 46px; height: 46px; border-radius: 50%; border: 3px solid currentColor; background: transparent; color: inherit; display: grid; place-items: center; padding: 0; margin-left: auto; }
.snd svg { width: 24px; height: 24px; }
.snd[aria-pressed="true"] { background: var(--yel); color: var(--ink); border-color: var(--ink); }
.top .lang { margin-left: 0; }
.cardbox { border: 4px solid var(--ink); border-radius: 12px; padding: 18px; background: var(--sheet); color: var(--ink); max-width: min(92vw, 460px); max-height: 92vh; overflow: auto; }
.cardbox::backdrop { background: rgba(14,21,64,.7); }
.cardbox img { display: block; width: 100%; height: auto; border: 3px solid var(--ink); border-radius: 6px; }
.cardbox .note { margin: 12px 0; }
.cardbox .row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* audience switch: 中学生 / 大学生 */
html[data-aud="hs"] .uni, html[data-aud="uni"] .hs { display: none !important; }
.aud { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; white-space: nowrap; }
.aud .seg { display: inline-flex; border: 2.5px solid currentColor; border-radius: 999px; overflow: hidden; }
.aud button { min-height: 40px; padding: 0 14px; border: 0; background: transparent; color: inherit; font: 700 14px var(--body); }
.aud button[aria-pressed="true"] { background: var(--ink); color: var(--yel); }
.night .aud { margin-left: auto; padding-left: 16px; }
.sheet-text .aud { margin-top: 20px; }
