@font-face { font-family: "Fraunces"; src: url("/assets/fraunces-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/assets/fraunces-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("/assets/fraunces-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --paper: #f3f7ee;
  --paper-deep: #e2ecd9;
  --paper-light: #fbfdf8;
  --ink: #17332a;
  --ink-2: #4a6257;
  --ink-3: #87998f;
  --line: rgba(23, 51, 42, 0.16);
  --cinnabar: #1f8a55;
  --amber: #eda72f;
  --glow: #ffd98a;
  --night: #12332a;
  --night-2: #1d4a3d;
  --morning: #f6f9f1;
  --deep: #0b241e;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "Source Han Serif SC", "SimSun", serif;
  --sans: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", system-ui, sans-serif;
  --num: "Fraunces", "Noto Serif SC", "Songti SC", serif;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

* { box-sizing: border-box; }
#now, #lamps { scroll-margin-top: 72px; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.75;
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
h1, h2, h3, p, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; }
a, button, summary, [role="button"] { -webkit-tap-highlight-color: transparent; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--cinnabar); outline-offset: 3px; border-radius: inherit; }
.hero :focus-visible, .tower :focus-visible, .lamps :focus-visible, .top.dark :focus-visible, .dock :focus-visible { outline-color: #d7ff8f; }
button { font: inherit; color: inherit; cursor: pointer; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums lining-nums; }
.wrap { width: min(1120px, 100% - 40px); margin-inline: auto; }
[hidden] { display: none !important; }

/* 页头：标志、菜单、按钮各自独立，没有把它们圈在一起的框，也没有线。
   压在深色段落上时自己变成浅色字（.dark）；往下读的时候让开（.away），往回滑再出现 */
:root { --header-top: 18px; --header-row: 46px; }
.top { position: fixed; inset: 0 0 auto 0; z-index: 62; isolation: isolate; padding: var(--header-top) clamp(18px, 4vw, 56px) 0; pointer-events: none; transition: transform 0.5s var(--ease), opacity 0.4s ease; }
.top.away:not(.sheet-open) { transform: translateY(-120%); opacity: 0; }
.bar { min-height: var(--header-row); max-width: 1280px; margin-inline: auto; display: flex; align-items: center; gap: clamp(10px, 1.6vw, 18px); color: var(--ink); transition: color 0.6s; }
.bar > * { pointer-events: auto; }
.top.dark:not(.sheet-open) .bar { color: #f1ffe0; }
.top .brand { transition: color .22s ease; }
.top .brand[data-fold-tone="paper"] { color: var(--ink); }
.top.dark .brand[data-fold-tone="cover"] { color: #f1ffe0; }
.top.sheet-open .nav { visibility: hidden; }
.bar-actions { flex: none; display: grid; margin-left: auto; }
.nav + .bar-actions { margin-left: 0; }
.bar-actions > .bar-cta {
  grid-area: 1 / 1;
  display: grid;
  place-items: center;
  height: var(--header-row);
  box-sizing: border-box;
  border: 0;
  white-space: nowrap;
}
.bar-actions > .bar-cta:not([hidden]) { animation: header-action-in 0.26s ease both; }
@keyframes header-action-in { from { opacity: .35; } to { opacity: 1; } }

.brand { display: inline-flex; align-items: center; text-decoration: none; color: inherit; }
.brand-text { display: grid; gap: 3px; }
.brand-text small { font-family: var(--serif); font-size: 10px; line-height: 1; letter-spacing: 0.28em; opacity: 0.75; padding-left: 1px; }
/* 字标随页头切换浅色与深色。 */
.wordmark {
  display: block;
  aspect-ratio: 754 / 326;
  height: 25px;
  background: currentColor;
  -webkit-mask: url("/assets/zanguang-wordmark.svg") left center / contain no-repeat;
  mask: url("/assets/zanguang-wordmark.svg") left center / contain no-repeat;
}
.mark { width: 30px; height: auto; display: block; }
.nav, .dock { position: relative; display: flex; font-family: var(--serif); }
.nav { margin-left: auto; gap: 2px; padding: 4px; border-radius: 999px; font-size: 15px; background: rgba(251, 253, 248, 0.92); box-shadow: 0 10px 26px -18px rgba(23, 51, 42, 0.5); transition: background 0.6s, box-shadow 0.6s; }
.top.dark .nav { background: rgba(5, 44, 31, 0.5); box-shadow: none; }
.nav a, .dock a { position: relative; z-index: 1; padding: 8px 17px; border-radius: 999px; text-decoration: none; color: inherit; opacity: 0.72; letter-spacing: 0.08em; transition: opacity 0.3s; }
.nav a:hover, .nav a.on, .dock a.on { opacity: 1; }
.nav-ink { position: absolute; top: 4px; bottom: 4px; left: 0; width: var(--w, 0px); transform: translateX(var(--x, 0px)); border-radius: 999px; background: currentColor; opacity: 0.12; transition: transform 0.55s var(--ease), width 0.55s var(--ease); }
.bar-cta { flex: none; padding: 11px 20px; border-radius: 999px; background: var(--cinnabar); color: #fff; font-family: var(--serif); font-weight: 600; font-size: 14px; letter-spacing: 0.1em; text-decoration: none; transition: background 0.6s, color 0.6s, transform 0.25s var(--ease); }
.bar-cta:hover { transform: translateY(-1px); }
.top.dark:not(.sheet-open) .bar-cta,
.top.dark .bar-actions[data-fold-tone="cover"] .bar-cta { background: #d7ff8f; color: #0b4a31; }
.top .bar-actions[data-fold-tone="paper"] .bar-cta { background: var(--cinnabar); color: #fff; }
/* 手机上的导航在底部，拇指够得着；滑过首屏才出现 */
.dock { display: none; }
.brand-name { font-family: var(--serif); font-weight: 900; font-size: 20px; letter-spacing: 0.18em; }
.foot-brand .wordmark { height: 25px; }

/* 首屏：整块画面是实时渲染的，字很少，只负责说一句话。
   背景是流动的绿雾（.hero-bg），前景是在几种「希望」之间流动的光点（.hero-gl） */
.hero { touch-action: pan-y; cursor: grab; -webkit-user-select: none; user-select: none; position: relative; isolation: isolate; min-height: clamp(680px, 100svh, 1080px); display: flex; align-items: center; padding: 120px clamp(24px, 7vw, 120px) 120px; overflow: hidden; color: #f1ffe0; background: radial-gradient(ellipse 60% 70% at 72% 52%, #2f9c68, #073a2c 75%); }
.hero-bg, .hero-gl { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-bg { z-index: -3; }
.hero-gl { z-index: -2; }
/* 字后面压暗一点，保证读得清 */
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(90deg, rgba(3, 38, 28, 0.62) 0%, rgba(3, 38, 28, 0.3) 34%, rgba(3, 38, 28, 0) 58%); }
.hero-copy { width: min(100%, 780px); will-change: transform, opacity; }
.hero-edge { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: clamp(36px, 6vw, 90px); display: block; fill: var(--paper); }

.eyebrow { font-family: var(--serif); font-size: 14px; letter-spacing: 0.34em; color: #b9e8c3; }
.hero-line {
  position: relative;
  display: grid;
  align-items: center;
  width: min(100%, 580px, 52vw);
  aspect-ratio: 1440 / 527;
  margin-top: 22px;
  font: 900 clamp(29px, 3.7vw, 54px)/1.32 var(--serif);
  letter-spacing: 0.03em;
  text-shadow: 0 2px 28px rgba(2, 30, 21, 0.55);
}
.lettering > img {
  display: block;
  width: 100%;
  height: auto;
}
.hero-line img { filter: drop-shadow(0 2px 10px rgba(2, 30, 21, .38)); }
.lettering[data-lettered] > .lettering-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.hero-line em { font-style: normal; color: #d7ff8f; }
.hero-hope { margin-top: clamp(22px, 3.6vh, 40px); font-family: var(--serif); font-size: clamp(14px, 1.2vw, 17px); letter-spacing: 0.08em; color: #b9e8c3; }
.hero-hope b { display: inline-block; font-weight: 600; color: #d7ff8f; transition: opacity 0.4s ease, transform 0.4s ease; }
.hero-hope b.out { opacity: 0; transform: translateY(8px); }

/* 此刻：金额从首屏挪到了这里。首屏只管美，数字留给愿意往下看的人 */
.now { padding-block: clamp(40px, 6vw, 80px) 0 !important; display: grid; grid-template-columns: 1fr minmax(260px, 400px); gap: clamp(20px, 5vw, 72px); align-items: end; }
.tally-title { font: 600 clamp(24px, 4vw, 36px)/1.35 var(--serif); color: var(--ink); }
.tally-label { font-family: var(--serif); font-size: 15px; letter-spacing: 0.14em; color: var(--ink-2); }
.amount { display: flex; align-items: baseline; gap: 0.12em; font-family: var(--num); font-weight: 400; font-size: clamp(58px, 8.5vw, 116px); line-height: 1.05; letter-spacing: -0.02em; margin-top: 4px; color: var(--ink); }
.yuan { font-size: 0.42em; color: var(--cinnabar); transform: translateY(-0.5em); }
.roll { display: inline-flex; font-variant-numeric: tabular-nums lining-nums; }
.roll .col { display: inline-block; height: 1.05em; overflow: hidden; }
.roll .strip { display: flex; flex-direction: column; transition: transform 2.4s var(--ease); transition-delay: calc(var(--i) * 70ms); }
.roll .strip span { height: 1.05em; line-height: 1.05; text-align: center; }
.roll .sep { opacity: 0.5; }
.roll .cents { font-size: 0.5em; color: var(--ink-2); }
.tally-meta { margin-top: 12px; font-size: 15px; color: var(--ink-2); }
.tally-meta span.seg { white-space: nowrap; }
.tally-meta b { font-family: var(--num); font-weight: 600; font-size: 1.12em; color: var(--ink); }
.dot { display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); margin: 0 10px; vertical-align: middle; }
.next { padding-bottom: 6px; }
.next-line { position: relative; height: 2px; background: var(--line); border-radius: 2px; }
.next-fill { position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); background: linear-gradient(90deg, var(--ink), var(--cinnabar)); border-radius: 2px; transition: width 2.4s var(--ease) 0.6s; }
.next-glow { position: absolute; top: 50%; left: var(--p, 0%); width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; background: #55c97c; box-shadow: 0 0 0 4px rgba(85, 201, 124, 0.22); transition: left 2.4s var(--ease) 0.6s; }
.next-text { margin-top: 14px; font-family: var(--serif); font-size: 15px; color: var(--ink-2); }
.next-text b { font-family: var(--num); font-weight: 600; color: var(--ink); }

.rise { opacity: 0; transform: translateY(16px); animation: rise 1.2s var(--ease) forwards; animation-delay: calc(var(--d) * 200ms + 300ms); }
@keyframes rise { to { opacity: 1; transform: none; } }
.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.9s var(--ease), transform 0.9s var(--ease); transition-delay: var(--rd, 0ms); }
.reveal.in { opacity: 1; transform: none; }


/* 小节标题 */
section.wrap, .lamps { padding-block: clamp(60px, 7.5vw, 100px); }
.lamps { position: relative; background: linear-gradient(var(--deep), var(--night) 320px); padding-bottom: clamp(90px, 12vw, 170px) !important; }
.sec-head { display: grid; grid-template-columns: 1fr; align-items: start; max-width: 720px; margin-bottom: clamp(36px, 6vw, 64px); }
.sec-head h2 { font-family: var(--serif); font-weight: 900; font-size: clamp(24px, 3.2vw, 37px); letter-spacing: 0.05em; line-height: 1.3; }
.lettering { position: relative; }
.section-lettering {
  display: grid;
  width: min(100%, var(--lettering-width, 192px));
  min-height: var(--lettering-height, 46px);
  align-content: center;
}
.tally-title { --lettering-width: clamp(118px, 13vw, 151px); --lettering-height: 36px; }
.tower .section-lettering, .lamps .section-lettering { --lettering-width: clamp(150px, 19vw, 194px); }
.rule .section-lettering { --lettering-width: clamp(185px, 25vw, 250px); }
.pledge .section-lettering { --lettering-width: clamp(220px, 27vw, 275px); }
.ledger-title.section-lettering { --lettering-width: clamp(122px, 16vw, 160px); --lettering-height: 38px; }
.doors .section-lettering { --lettering-width: clamp(150px, 20vw, 196px); --lettering-height: 36px; }
.lettered-head .sec-lead { max-width: 30em; }
.sec-lead { margin-top: 12px; color: var(--ink-2); font-size: clamp(16px, 1.6vw, 18px); line-height: 1.9; }

/* 算法 */
.rule-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.rule-steps li { display: grid; grid-template-columns: auto 1fr; gap: 20px; padding: 24px 0; border-top: 1px solid var(--line); }
.rule-steps li:last-child { border-bottom: 1px solid var(--line); }
.step-no { font-family: var(--num); font-style: italic; font-size: 38px; line-height: 1; color: var(--amber); width: 34px; }
.rule-steps h3 { font-family: var(--serif); font-weight: 600; font-size: 20px; }
.rule-steps p { color: var(--ink-2); margin-top: 4px; }

.receipt {
  position: relative; background: var(--paper-light); padding: 34px 30px 30px; transform: rotate(1.4deg);
  box-shadow: 0 1px 0 rgba(23, 51, 42, 0.06), 0 24px 48px -22px rgba(26, 78, 52, 0.45);
  --tooth: 10px;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--tooth) 51% repeat-x, conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / var(--tooth) 51% repeat-x;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / var(--tooth) 51% repeat-x, conic-gradient(from 135deg at top, #0000, #000 1deg 89deg, #0000 90deg) top / var(--tooth) 51% repeat-x;
}
.receipt-title { text-align: center; font-family: var(--serif); letter-spacing: 0.6em; text-indent: 0.6em; color: var(--ink-3); font-size: 13px; margin-bottom: 18px; }
.receipt-dash { border-top: 1.5px dashed var(--line); margin: 18px 0 6px; }
.pile ul { display: grid; }
.pile li { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 9px 0; font-family: var(--serif); color: var(--ink-2); opacity: 0; transform: translateY(10px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.pile.in li { opacity: 1; transform: none; }
.pile.in li:nth-child(2) { transition-delay: 0.18s; } .pile.in li:nth-child(3) { transition-delay: 0.36s; }
.pile.in .pile-big li:nth-child(1) { transition-delay: 0.7s; } .pile.in .pile-big li:nth-child(2) { transition-delay: 1s; } .pile.in .pile-big li:nth-child(3) { transition-delay: 1.3s; }
.pile li i { font-style: normal; font-family: var(--num); color: var(--ink-3); margin-left: 6px; }
.pile li b { font-weight: 400; color: var(--ink); font-size: 20px; white-space: nowrap; }
/* 越往下数字越大：一分一分，是这样变成一盏灯的 */
.pile li.s1 b { font-size: 26px; }
.pile li.s2 b { font-size: clamp(32px, 4vw, 40px); font-weight: 600; color: var(--cinnabar); line-height: 1.2; }
.pile li.s3 { color: var(--ink); border-top: 1.5px solid var(--ink); margin-top: 8px; padding-top: 14px; }
.pile li.s3 b { font-size: clamp(32px, 4vw, 40px); font-weight: 600; line-height: 1.2; }
.pile.empty .receipt-dash { display: none; }

.morning { background: var(--morning); }

/* 聚沙成塔 */
.tower { margin-top: clamp(40px, 6vw, 80px); background: var(--deep); color: #eef5ea; padding-bottom: clamp(48px, 6vw, 80px); }
.tower-stage { position: relative; height: clamp(600px, 88svh, 860px); overflow: hidden; }
.tower-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; }
/* 夜色是一幅手绘的月夜湖面。动画按镜头算出水面线的位置，再把画摆到正好对齐的地方 */
.tower-stage { background: var(--deep); }
.tower-sky { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.tower-sky .paint { position: absolute; max-width: none; height: auto; opacity: 0; transition: opacity 1.6s ease; -webkit-mask-image: linear-gradient(transparent, #000 14%, #000 84%, transparent); mask-image: linear-gradient(transparent, #000 14%, #000 84%, transparent); }
.tower-sky .paint.set { opacity: 1; }
.tower-stage::after { content: ""; position: absolute; inset: auto 0 0 0; height: 120px; background: linear-gradient(rgba(11, 36, 30, 0), var(--deep)); pointer-events: none; }
.tower-ui { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; justify-content: space-between; padding-block: clamp(56px, 7vw, 96px) 28px; pointer-events: none; }
.tower-ui .sec-head { margin-bottom: 0; max-width: 460px; }
.tower .sec-lead { color: #a9c0b4; }
.tower-hud { max-width: 420px; }
.tower-date { font-family: var(--serif); letter-spacing: 0.14em; color: #a9c0b4; font-size: 15px; }
.tower-amount { font-size: clamp(40px, 5.5vw, 66px); line-height: 1.15; color: var(--glow); text-shadow: 0 0 40px rgba(255, 201, 96, 0.35); }
.tower-counter { position: relative; display: inline-block; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.tower-counter::before { content: attr(data-width); visibility: hidden; }
.tower-counter > span { position: absolute; inset: 0; }
.tower-sub { display: flex; align-items: baseline; gap: .4em; color: #a9c0b4; font-size: 14px; }
.tower-sub .tower-counter { text-align: right; }
.tower-left { font-family: var(--serif); font-size: 15px; color: var(--glow); margin-top: 8px; opacity: 0; transition: opacity 1.6s ease 0.6s; }
.tower-stage.done .tower-left { opacity: 1; }
.tower-mark { position: absolute; z-index: 1; transform: translateY(-50%); padding-left: 44px; font-family: var(--serif); font-size: 14px; letter-spacing: 0.08em; white-space: nowrap; color: #8fb0a1; opacity: 0; transition: color 0.8s, text-shadow 0.8s, opacity 1.2s; pointer-events: none; }
.tower-mark::before { content: ""; position: absolute; left: 0; top: 50%; width: 34px; height: 1px; background: currentColor; }
.tower-mark.on { color: var(--glow); text-shadow: 0 0 18px rgba(255, 201, 96, 0.7); opacity: 1; }
.tower-stage.done .tower-mark { opacity: 1; }
.tower-stage.flat { height: auto; }
.tower-stage.flat canvas, .tower-stage.flat .tower-marks, .tower-stage.flat .tower-sky, .tower-stage.flat::after { display: none; }
.tower-stage.flat .tower-ui { gap: 32px; }
.tower .facts { margin-top: 8px; border-top-color: rgba(238, 245, 234, 0.5); }
.tower .fact + .fact { border-left-color: rgba(238, 245, 234, 0.16); }
.tower .fact-k { color: #a9c0b4; }
.tower .fact-n { color: #7f978b; }

.facts { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: clamp(32px, 5vw, 56px); border-top: 1px solid var(--ink); }
.fact { padding: 22px 20px 0 0; }
.fact + .fact { padding-left: 20px; border-left: 1px solid var(--line); }
.fact-k { font-family: var(--serif); font-size: 14px; color: var(--ink-2); letter-spacing: 0.08em; }
.fact-v { font-family: var(--num); font-size: clamp(23px, 2.7vw, 32px); line-height: 1.3; margin-top: 6px; }
.fact-n { font-size: 13.5px; color: var(--ink-3); margin-top: 4px; line-height: 1.6; }

/* 点灯 */
.lamps { background: var(--night); color: #eef5ea; position: relative; overflow: hidden; }
.lamps::before { content: ""; position: absolute; inset: 0; background: radial-gradient(50% 60% at 12% 62%, rgba(255, 201, 96, 0.09), transparent 70%), radial-gradient(1px 1px at 12% 30%, #fff8 50%, transparent 51%), radial-gradient(1px 1px at 72% 18%, #fff7 50%, transparent 51%), radial-gradient(1.5px 1.5px at 88% 62%, #fff6 50%, transparent 51%), radial-gradient(1px 1px at 44% 78%, #fff5 50%, transparent 51%), radial-gradient(1px 1px at 60% 44%, #fff5 50%, transparent 51%); pointer-events: none; }
.lamps .wrap { position: relative; }
.lamps .sec-lead { color: #a9c0b4; }
.lamp-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0; position: relative; }
.lamp { position: relative; padding: 0 28px 8px 0; }
.lamp-rail { position: relative; height: 96px; }
.lamp-rail::before { content: ""; position: absolute; left: 0; right: 0; top: 46px; height: 1px; background: rgba(238, 245, 234, 0.22); }
.lamp.lit .lamp-rail::before { background: linear-gradient(90deg, var(--glow), rgba(255, 217, 138, 0.5)); }
.lamp.now .lamp-rail::after { content: ""; position: absolute; left: 0; top: 46px; height: 1px; width: var(--p); background: var(--glow); box-shadow: 0 0 10px var(--glow); transition: width 2s var(--ease) 0.3s; }
.lamp:not(.in).now .lamp-rail::after { width: 0; }
.lantern { position: absolute; left: -14px; top: -4px; width: 76px; height: auto; z-index: 1; transition: filter 1.6s ease 0.4s, opacity 1.6s ease 0.4s; filter: grayscale(1) brightness(0.5); opacity: 0.5; }
.lamp.now .lantern { filter: grayscale(0.55) brightness(0.72); opacity: 0.85; }
.lamp.ready.in .lantern { filter: none; opacity: 1; }
.lamp.lit.in .lantern { filter: none; opacity: 1; animation: sway 7s ease-in-out 2s infinite; transform-origin: 50% 0; }
@keyframes sway { 0%, 100% { transform: rotate(-2.2deg); } 50% { transform: rotate(2.2deg) translateY(2px); } }
.lamp-target { font-family: var(--num); font-size: clamp(29px, 3.3vw, 38px); line-height: 1.2; margin-top: 10px; }
.lamp-target small { font-size: 0.45em; color: #a9c0b4; margin-right: 4px; }
.lamp-title { font-family: var(--serif); font-weight: 600; font-size: 19px; letter-spacing: 0.1em; margin-top: 2px; }
.lamp-state { display: inline-block; margin-top: 12px; font-size: 13px; padding: 2px 10px; border-radius: 999px; border: 1px solid rgba(238, 245, 234, 0.3); color: #a9c0b4; }
.lamp.lit .lamp-state { background: var(--glow); color: var(--ink); border-color: transparent; }
.lamp.ready .lamp-state, .lamp.now .lamp-state { color: var(--glow); border-color: var(--glow); }
.lamp-text { margin-top: 12px; color: #bfd1c7; font-size: 15px; line-height: 1.8; max-width: 30em; }
.lamp-text b { color: #eef5ea; font-family: var(--num); font-weight: 600; }
.lamp-proof { margin-top: 12px; background: none; border: 0; padding: 0; color: var(--glow); font-size: 14px; text-decoration: underline; text-underline-offset: 4px; }

/* 账本 */
.balance { display: flex; flex-wrap: wrap; align-items: end; gap: 12px clamp(16px, 3vw, 36px); margin-bottom: 36px; }
.balance-v { font-size: clamp(26px, 3.6vw, 40px); line-height: 1.25; }
.balance-v.strong { color: var(--cinnabar); font-weight: 600; }

.table-wrap { background: var(--paper-light); padding: clamp(8px, 2vw, 20px) clamp(14px, 3vw, 32px) 8px; box-shadow: 0 30px 60px -36px rgba(26, 78, 52, 0.5); background-image: linear-gradient(90deg, transparent 0, transparent calc(100% - 1px), rgba(31, 138, 85, 0.25) 100%); background-size: clamp(14px, 3vw, 32px) 100%; background-repeat: no-repeat; }
.book { width: 100%; border-collapse: collapse; font-size: 15px; }
.book th { font-family: var(--serif); font-weight: 600; font-size: 13px; letter-spacing: 0.14em; color: var(--ink-2); text-align: left; padding: 14px 10px 12px; border-bottom: 1.5px solid var(--ink); }
.book td { padding: 11px 10px; border-bottom: 1px solid rgba(23, 51, 42, 0.1); font-family: var(--num); font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.book .r { text-align: right; }
.book td.give { color: var(--cinnabar); font-weight: 600; }
.book td .wk { font-family: var(--sans); font-size: 12px; color: var(--ink-3); margin-left: 8px; }
.book tr.out td { background: rgba(255, 201, 96, 0.22); font-family: var(--serif); white-space: normal; }
.book tr.out b { font-family: var(--num); color: var(--cinnabar); }
.book tr.fix td { color: var(--ink-2); font-family: var(--serif); white-space: normal; }
.book tbody tr { transition: background 0.2s; }
.book tbody tr:not(.out):hover { background: rgba(23, 51, 42, 0.04); }
.more { display: block; width: 100%; background: none; border: 0; padding: 16px; font-family: var(--serif); letter-spacing: 0.2em; color: var(--ink-2); }
.more:hover { color: var(--cinnabar); }

.verify { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(24px, 5vw, 64px); margin-top: clamp(40px, 6vw, 72px); padding-top: 32px; border-top: 1px solid var(--ink); align-items: start; }
.verify h3 { font-family: var(--serif); font-weight: 900; font-size: 24px; letter-spacing: 0.06em; }
.verify-copy p { color: var(--ink-2); margin-top: 10px; }
.verify-head { font-size: 13.5px; }
.verify-head code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12.5px; background: rgba(23, 51, 42, 0.07); padding: 2px 8px; border-radius: 4px; word-break: break-all; color: var(--ink); }
.verify-act { display: flex; flex-wrap: wrap; gap: 12px; align-content: start; }
.btn { background: var(--ink); color: var(--paper-light); border: 1.5px solid var(--ink); padding: 12px 22px; border-radius: 999px; font-family: var(--serif); font-weight: 600; letter-spacing: 0.1em; transition: transform 0.25s var(--ease), background 0.25s, color 0.25s; }
.btn:hover { transform: translateY(-2px); background: var(--cinnabar); border-color: var(--cinnabar); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--paper-light); border-color: var(--ink); }
.btn:disabled { opacity: 0.5; transform: none; cursor: default; }
.verify-bar { flex-basis: 100%; height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.verify-bar span { display: block; height: 100%; width: var(--p, 0%); background: var(--amber); transition: width 0.15s linear; }
.verify-result { flex-basis: 100%; font-family: var(--serif); font-size: 15px; min-height: 1.75em; }
.verify-result.ok { color: #1f7a4d; }
.verify-result.bad { color: var(--cinnabar); }

.book-go { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 28px; }
.book-go .btn { text-decoration: none; }
.book-go p { color: var(--ink-3); font-size: 14px; }

/* 首页最后的两个入口：细节放到二级页面里，首页不再拉得很长 */
.doors { position: relative; background: var(--paper); padding: clamp(70px, 9vw, 120px) 0 clamp(60px, 8vw, 110px); }
.doors-edge { position: absolute; left: 0; right: 0; top: -1px; width: 100%; height: clamp(36px, 6vw, 90px); display: block; fill: var(--night); }
.doors-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(16px, 2.6vw, 32px); }
.door { position: relative; display: grid; gap: 12px; align-content: start; padding: clamp(26px, 3.4vw, 44px); border-radius: 26px; background: var(--paper-light); color: var(--ink); text-decoration: none; box-shadow: 0 0 0 1px rgba(23, 51, 42, 0.07), 0 26px 50px -34px rgba(26, 78, 52, 0.5); transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), opacity 0.9s var(--ease); }
.door:hover { transform: translateY(-5px); box-shadow: 0 0 0 1px rgba(31, 138, 85, 0.3), 0 34px 60px -32px rgba(26, 78, 52, 0.6); }
.door-t { font-family: var(--serif); font-weight: 900; font-size: clamp(21px, 2.25vw, 27px); letter-spacing: 0.06em; line-height: 1.4; }
.door-d { color: var(--ink-2); font-size: 15.5px; line-height: 1.8; }
.door-go { justify-self: start; margin-top: 8px; padding: 10px 20px; border-radius: 999px; background: var(--cinnabar); color: #fff; font-family: var(--serif); font-weight: 600; font-size: 14.5px; letter-spacing: 0.1em; }
.door-go::after { content: "→"; margin-left: 8px; display: inline-block; transition: transform 0.4s var(--ease); }
.door:hover .door-go::after { transform: translateX(5px); }

/* 二级页面：轻轻淡入盖在首页上，没有「顶上来」的动作。关掉时淡出，首页原地不动 */
.page { position: fixed; inset: 0; padding-top: calc(var(--header-top) + var(--header-row)); scroll-padding-top: calc(var(--header-top) + var(--header-row) + 16px); z-index: 60; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; background: var(--morning); opacity: 0; visibility: hidden; transition: opacity 0.38s ease, visibility 0s 0.38s; }
.page.open { opacity: 1; visibility: visible; transition: opacity 0.45s ease, visibility 0s; }
.page.instant { transition: none; }
body.page-open { overflow: hidden; }
body.page-open .dock { transform: translate(-50%, 160%); }
/* 页面里的内容在淡入的同时依次浮上来一点 */
.page > section { padding-top: clamp(24px, 4vw, 52px); }
.page > section > * { opacity: 0; transform: translateY(14px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.page.open > section > * { opacity: 1; transform: none; transition-delay: calc(0.12s + var(--n, 0) * 0.08s); }
.page > section > :nth-child(2) { --n: 1; } .page > section > :nth-child(3) { --n: 2; } .page > section > :nth-child(4) { --n: 3; }
.page.instant > section > * { transition: none; }
.page .pile li { opacity: 1; transform: none; }
.page .pledge { padding-bottom: clamp(60px, 8vw, 100px); }

/* 承诺 */
.pledge { padding-top: 0 !important; }
.pledge h2 { font-family: var(--serif); font-weight: 900; font-size: clamp(22px, 3vw, 30px); letter-spacing: 0.08em; margin-bottom: 28px; }
.pledge-list { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--ink); }
.pledge-list li { padding: 24px 22px 0 0; }
.pledge-list li + li { padding-left: 22px; border-left: 1px solid var(--line); }
.pledge-list h3 { font-family: var(--serif); font-weight: 900; font-size: 20px; letter-spacing: 0.14em; color: var(--cinnabar); }
.pledge-list p { margin-top: 8px; color: var(--ink-2); font-size: 15px; }

.foot { background: #e6eedf; padding: 48px 0 calc(48px + env(safe-area-inset-bottom)); }
.foot-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.foot-line { color: var(--ink-2); }
.foot-small { margin-top: 14px; font-size: 13px; color: var(--ink-3); }

.proof { border: 0; padding: 16px; background: var(--paper-light); border-radius: 8px; max-width: min(92vw, 720px); text-align: center; }
.proof::backdrop { background: rgba(18, 51, 42, 0.7); }
.proof img { max-width: 100%; max-height: 72vh; display: block; margin: 0 auto 14px; }

@media (max-width: 860px) {
  /* 手机：一句话在上半屏，光在下半屏，互不遮挡 */
  .hero { min-height: max(100svh, 640px); align-items: flex-start; padding: 112px 24px 96px; }
  .hero::before { background: linear-gradient(180deg, rgba(3, 38, 28, 0.66) 0%, rgba(3, 38, 28, 0.34) 30%, rgba(3, 38, 28, 0) 52%); }
  .eyebrow { font-size: 12px; }
  .hero-line { width: min(94%, 405px); font-size: clamp(23px, 6.8vw, 33px); margin-top: 16px; }
  .hero-hope { font-size: 15px; margin-top: 18px; }
  .now { grid-template-columns: 1fr; gap: 26px; }
  .doors-grid { grid-template-columns: 1fr; }
  .tower-stage { height: 760px; }
  .amount { font-size: clamp(52px, 15vw, 72px); }
  .tally-meta { font-size: 14px; }
  .dot { margin: 0 7px; }
  :root { --header-top: 14px; --header-row: 42px; }
  .nav + .bar-actions { margin-left: auto; }
  .wordmark { height: 23px; }
  .nav { display: none; }
  .bar-cta { padding: 10px 17px; font-size: 13px; }
  .dock { display: flex; position: fixed; z-index: 40; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); padding: 5px; border-radius: 999px; color: #f4faf2; background: rgba(8, 50, 35, 0.96); box-shadow: 0 0 0 1px rgba(244, 250, 242, 0.14), 0 16px 34px -14px rgba(4, 30, 20, 0.6); font-size: 14.5px; transform: translate(-50%, 160%); transition: transform 0.6s var(--ease); }
  .dock.show { transform: translate(-50%, 0); }
  .dock a { padding: 9px 17px; white-space: nowrap; }
  .dock .nav-ink { top: 5px; bottom: 5px; opacity: 0.18; }
  .foot { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .rule-grid, .verify { grid-template-columns: 1fr; }
  .receipt { transform: rotate(0.8deg); margin-inline: 4px; }
  .facts, .pledge-list { grid-template-columns: 1fr 1fr; }
  .fact:nth-child(3), .pledge-list li:nth-child(3) { padding-left: 0; border-left: 0; }
  .fact:nth-child(n + 3), .pledge-list li:nth-child(n + 3) { margin-top: 22px; border-top: 1px solid var(--line); }
  .lamp-list { grid-template-columns: 1fr; }
  .lamp { padding: 0 0 36px 68px; }
  .lamp-rail { position: absolute; left: 0; top: 0; bottom: 0; width: 48px; height: auto; }
  .lamp-rail::before { left: 24px; right: auto; top: 0; bottom: 0; width: 1px; height: auto; }
  .lamp.now .lamp-rail::after { left: 24px; top: 0; width: 1px; height: var(--p); transition-property: height; }
  .lamp:not(.in).now .lamp-rail::after { width: 1px; height: 0; }
  .lamp:last-child .lamp-rail::before { bottom: auto; height: 48px; }
  .lantern { left: -14px; top: -6px; }
  .lamp-target { margin-top: 0; }
  .tower-mark { left: 20px !important; padding-left: 0; padding-bottom: 6px; font-size: 12.5px; transform: translateY(-100%); border-bottom: 1px solid currentColor; padding-right: 28px; }
  .tower-mark::before { display: none; }
  .tower .fact:nth-child(n + 3) { border-top-color: rgba(238, 245, 234, 0.16); }
  .book { font-size: 14px; }
  .book th, .book td { padding-inline: 6px; }
  .book td .wk { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0ms !important; }
  .motes { display: none; }
}

/* 账本的纸页与左侧装订边 */
.brand { gap: 8px; }
.brand-emblem {
  width: 33px;
  aspect-ratio: 1;
  flex: none;
  background: currentColor;
  -webkit-mask: url("/assets/zanguang-emblem.png") center / contain no-repeat;
  mask: url("/assets/zanguang-emblem.png") center / contain no-repeat;
}
a[href="/ledger"]:active { transform: scale(.975); }
#page-ledger {
  --ledger-paper: #f7f8ee;
  background: linear-gradient(90deg, #254b351f, #254b3508 8px, transparent 19px), var(--ledger-paper);
  opacity: 1;
  visibility: hidden;
  transition: none;
}
#page-ledger.open, #page-ledger.turning { visibility: visible; }
#page-ledger.turning:not(.open) { pointer-events: none; }
#page-ledger > .ledger > * {
  opacity: 1;
  transform: none;
  transition: none;
}
#page-ledger .ledger {
  width: min(900px, 100% - 48px);
}
#page-ledger .ledger { padding: clamp(20px, 4vw, 46px) 0 64px; }
.page-fold { position: fixed; z-index: 61; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.ledger-title {
  font: 750 clamp(24px, 3.4vw, 34px)/1.22 var(--serif);
  letter-spacing: .06em;
  margin-bottom: clamp(12px, 2.5vw, 22px);
  outline: none;
}
.ledger-status { margin: 14px 0; color: var(--ink-2); }
.ledger-status .btn { margin-top: 12px; }
.ledger .balance {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(5px, 2vw, 20px);
  align-items: start;
  margin-bottom: 26px;
  padding: clamp(12px, 3vw, 22px) 0;
  border-block: 1px solid var(--line);
}
.ledger .balance > div + div { padding-left: clamp(5px, 2vw, 20px); border-left: 1px solid var(--line); }
.ledger .balance .fact-k { white-space: nowrap; letter-spacing: 0; }
.ledger .balance-v { font-size: clamp(17px, 4.25vw, 31px); overflow-wrap: anywhere; }
.ledger .table-wrap { background: none; padding: 0; box-shadow: none; overflow-x: auto; }
.ledger .table-wrap h3 { font: 900 clamp(19px, 3vw, 25px)/1.35 var(--serif); margin-bottom: 3px; }
.ledger .book th { letter-spacing: .025em; }
.ledger .book th:first-child, .ledger .book td:first-child { padding-left: 0; }
.ledger .book th:last-child, .ledger .book td:last-child { padding-right: 0; }
.ledger .more { border-bottom: 1px solid var(--line); }

@media (max-width: 500px) {
  .brand-emblem { width: 30px; }
  #page-ledger .ledger { width: calc(100% - 38px); }
  .ledger .balance .fact-k { font-size: 12px; }
  .ledger .balance-v { font-size: clamp(16px, 4.7vw, 21px); }
  .ledger .book td, .ledger .book th { padding-inline: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  a[href="/ledger"]:active { transform: none; }
}
