/* 白叶编年史页 v3（独立样式；沿用 wl-subpages.css 的像素变量与 WhiteLeaf Pixel 字体）
   三个时代各一种主色：序章 = 琥珀、第二代 = 叶绿、第三代 = 天蓝。
   三种视图：.v-timeline 时间轴 / .v-scroll 长卷 / .v-table 年表。 */
body.wl-sp-chr { margin: 0; background: var(--px-bg); color: var(--px-ink); font-family: var(--font-body); line-height: 1.7; min-height: 100vh; }
body.wl-sp-chr * { box-sizing: border-box; }
body.wl-sp-chr { --era: var(--px-accent); --era-ink: #0b1a12; --hero-a: #07111f; --hero-b: #0f2a2a; --star: #e9f3ff; --cloud: rgba(160, 180, 210, .12); }
html[data-theme="light"] body.wl-sp-chr { --era-ink: #ffffff; --hero-a: #9fd0f0; --hero-b: #e4f1e0; --star: #6b8fb3; --cloud: rgba(255, 255, 255, .92); }
[data-era="prologue"] { --era: var(--px-amber); }
[data-era="gen2"] { --era: var(--px-accent); }
[data-era="gen3"] { --era: var(--px-sky); }

/* ================= 主题切换动效 ================= */
html.vt-theme::view-transition-old(root), html.vt-theme::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html.vt-theme::view-transition-old(root) { z-index: 1; }
html.vt-theme::view-transition-new(root) { z-index: 2; }
html.vt-view::view-transition-old(root) { animation: chrVtOut .22s ease both; }
html.vt-view::view-transition-new(root) { animation: chrVtIn .38s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes chrVtOut { to { opacity: 0; transform: translateY(-8px); } }
@keyframes chrVtIn { from { opacity: 0; transform: translateY(14px); } }
html.chr-theming body.wl-sp-chr, html.chr-theming body.wl-sp-chr * { transition: background-color .5s ease, color .5s ease, border-color .5s ease, opacity .5s ease !important; }

/* ================= 顶栏 + 阅读进度 ================= */
.chr-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 40; pointer-events: none; }
.chr-progress i { display: block; height: 100%; width: 0; background: var(--era); transition: background-color .4s; }
.chr-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 20px; background: color-mix(in srgb, var(--px-surface) 92%, transparent); backdrop-filter: blur(6px); border-bottom: 3px solid var(--px-line); }
.chr-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--px-ink); text-decoration: none; }
.chr-logo { image-rendering: pixelated; filter: drop-shadow(2px 2px 0 var(--px-hard)); }
.chr-brand-t { font-family: var(--font-pixel); font-size: 24px; line-height: 1; }
.chr-top-actions { display: flex; gap: 8px; }
.chr-btn { font: inherit; font-family: var(--font-pixel); font-size: 12px; color: var(--px-ink); background: var(--px-surface-2); border: 2px solid var(--px-line); box-shadow: 3px 3px 0 0 var(--px-hard); padding: 7px 12px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; line-height: 1.2; transition: transform .12s, box-shadow .12s; }
.chr-btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 0 var(--px-hard); border-color: var(--era); }
.chr-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 0 var(--px-hard); }
/* 主题按钮图标：深色显示月牙，浅色显示太阳 */
.chr-theme-ico { position: relative; width: 14px; height: 14px; flex: none; }
.chr-theme-ico::before { content: ""; position: absolute; inset: 1px; background: #f2e6a6; clip-path: polygon(25% 0, 75% 0, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0 75%, 0 25%); }
.chr-theme-ico::after { content: ""; position: absolute; left: 6px; top: -1px; width: 10px; height: 10px; background: var(--px-surface-2); clip-path: polygon(25% 0, 75% 0, 100% 25%, 100% 75%, 75% 100%, 25% 100%, 0 75%, 0 25%); }
html[data-theme="light"] .chr-theme-ico::before { inset: 3px; background: #f2a51b; }
html[data-theme="light"] .chr-theme-ico::after { left: 0; top: 0; width: 14px; height: 14px; clip-path: none; background-color: transparent;
  background-image: linear-gradient(#f2a51b, #f2a51b), linear-gradient(#f2a51b, #f2a51b), linear-gradient(#f2a51b, #f2a51b), linear-gradient(#f2a51b, #f2a51b);
  background-size: 2px 2px, 2px 2px, 2px 2px, 2px 2px; background-position: 6px 0, 6px 12px, 0 6px, 12px 6px; background-repeat: no-repeat; }
.chr-theme.is-spin .chr-theme-ico { animation: chrSpin .65s cubic-bezier(.6, .05, .3, 1); }
@keyframes chrSpin { from { transform: rotate(-180deg) scale(.4); } }

/* ================= 首屏：深色星空月亮，浅色晴空太阳和云 ================= */
.chr-hero { position: relative; overflow: hidden; padding: 64px 20px 60px; background: linear-gradient(180deg, var(--hero-a) 0%, var(--hero-b) 72%, var(--px-bg) 100%); border-bottom: 3px solid var(--px-line); }
.chr-hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 14px; z-index: 3; background: repeating-linear-gradient(90deg, var(--px-amber) 0 24px, var(--px-accent) 24px 48px, var(--px-sky) 48px 72px); opacity: .6; }
.chr-hero-leaf { display: none; }
.chr-hero-in { position: relative; max-width: 920px; margin: 0 auto; z-index: 2; }
.chr-kicker { margin: 0 0 6px; font-family: var(--font-pixel); font-size: 12px; letter-spacing: .25em; color: var(--px-sky); }
html[data-theme="light"] .chr-kicker { color: #1d5f93; }
.chr-title { font-family: var(--font-pixel); font-size: 72px; line-height: 1.05; margin: 0 0 14px; font-weight: 400; color: #f4f8ee; text-shadow: 4px 4px 0 #03080a, 0 0 28px rgba(108, 196, 255, .35); }
html[data-theme="light"] .chr-title { color: #1f2b22; text-shadow: 4px 4px 0 rgba(255, 255, 255, .7); }
.chr-lead { max-width: 560px; margin: 0 0 26px; font-size: 16px; color: #c9d7e3; }
html[data-theme="light"] .chr-lead { color: #2f4a3a; }
.chr-now { display: flex; flex-wrap: wrap; gap: 14px; margin: 0 0 18px; }
.chr-now-cell { display: flex; flex-direction: column; gap: 2px; min-width: 220px; padding: 12px 16px; background: color-mix(in srgb, var(--px-surface) 82%, transparent); border: 3px solid var(--px-line); box-shadow: 5px 5px 0 0 var(--px-hard); }
.chr-now-k { font-size: 12px; color: var(--px-ink-3); letter-spacing: .1em; }
.chr-now-v { font-family: var(--font-pixel); font-weight: 400; font-size: 24px; line-height: 1.25; color: var(--px-sky); }
.chr-now-v.gold { color: var(--px-amber); }
.chr-stats { display: flex; flex-wrap: wrap; gap: 10px; }
.chr-stat { display: flex; align-items: baseline; gap: 6px; padding: 6px 12px; border: 2px dashed color-mix(in srgb, var(--star) 45%, transparent); color: #c9d7e3; font-size: 13px; background: color-mix(in srgb, var(--hero-a) 30%, transparent); }
html[data-theme="light"] .chr-stat { color: #2f4a3a; background: rgba(255, 255, 255, .45); }
.chr-stat b { font-family: var(--font-pixel); font-weight: 400; font-size: 24px; line-height: 1; color: var(--star); font-variant-numeric: tabular-nums; }
html[data-theme="light"] .chr-stat b { color: var(--px-ink); }

.chr-sky, .chr-orb, .chr-clouds, .chr-leaves { position: absolute; inset: 0; pointer-events: none; }
.chr-sky { z-index: 0; transition: opacity .6s; }
html[data-theme="light"] .chr-sky { opacity: 0; }
.chr-sky i { position: absolute; top: 0; left: 0; width: 3px; height: 3px; background: transparent; animation: chrTwinkle 4s steps(2) infinite; }
.chr-sky .s1 { box-shadow: 40px 30px var(--star), 160px 90px var(--star), 310px 40px var(--star), 470px 120px var(--star), 620px 60px var(--star), 780px 150px var(--star), 930px 30px var(--star), 1080px 110px var(--star), 1230px 70px var(--star), 1390px 140px var(--star), 1540px 50px var(--star), 1700px 100px var(--star), 90px 210px var(--star), 560px 250px var(--star), 1010px 230px var(--star), 1460px 260px var(--star); }
.chr-sky .s2 { box-shadow: 100px 60px var(--star), 250px 160px var(--star), 400px 80px var(--star), 700px 20px var(--star), 850px 200px var(--star), 1150px 40px var(--star), 1300px 190px var(--star), 1600px 170px var(--star), 1800px 40px var(--star), 360px 300px var(--star), 1250px 320px var(--star); animation-delay: 1.3s; opacity: .7; }
.chr-sky .s3 { width: 5px; height: 5px; box-shadow: 210px 50px var(--px-amber), 690px 130px var(--px-sky), 1180px 80px var(--px-amber), 1650px 210px var(--px-sky), 480px 220px var(--px-accent); animation-delay: 2.6s; }
@keyframes chrTwinkle { 50% { opacity: .25; } }

/* 月亮 / 太阳：同一位置，按主题升落 */
.chr-orb { z-index: 1; }
.chr-orb i { position: absolute; right: max(6vw, calc(50% - 560px)); top: 46px; width: 84px; height: 84px; transition: transform .8s cubic-bezier(.5, 0, .2, 1), opacity .6s; }
.chr-moon { background: #f3ecc2; box-shadow: inset -12px -10px 0 0 #d9cf98, 0 0 32px rgba(243, 236, 194, .45); clip-path: polygon(25% 0, 75% 0, 75% 6%, 88% 6%, 88% 12%, 94% 12%, 94% 25%, 100% 25%, 100% 75%, 94% 75%, 94% 88%, 88% 88%, 88% 94%, 75% 94%, 75% 100%, 25% 100%, 25% 94%, 12% 94%, 12% 88%, 6% 88%, 6% 75%, 0 75%, 0 25%, 6% 25%, 6% 12%, 12% 12%, 12% 6%, 25% 6%); }
.chr-moon::before, .chr-moon::after { content: ""; position: absolute; background: #d9cf98; }
.chr-moon::before { left: 22%; top: 30%; width: 14%; height: 14%; }
.chr-moon::after { left: 52%; top: 58%; width: 10%; height: 10%; }
.chr-orb .chr-moon { animation: chrBob 6s ease-in-out infinite; }
@keyframes chrBob { 50% { translate: 0 -6px; } }
.chr-sun { background: #ffc94a; box-shadow: inset -10px -10px 0 0 #f2a51b; opacity: 0; transform: translateY(160px); clip-path: polygon(25% 0, 75% 0, 75% 6%, 88% 6%, 88% 12%, 94% 12%, 94% 25%, 100% 25%, 100% 75%, 94% 75%, 94% 88%, 88% 88%, 88% 94%, 75% 94%, 75% 100%, 25% 100%, 25% 94%, 12% 94%, 12% 88%, 6% 88%, 6% 75%, 0 75%, 0 25%, 6% 25%, 6% 12%, 12% 12%, 12% 6%, 25% 6%); }
.chr-sun::after { content: ""; position: absolute; left: 20%; top: 18%; width: 18%; height: 12%; background: #fff3b8; }
html[data-theme="light"] .chr-moon { opacity: 0; transform: translateY(160px); }
html[data-theme="light"] .chr-sun { opacity: 1; transform: none; }
html[data-theme="light"] .chr-orb .chr-sun { animation: chrBob 6s ease-in-out infinite; }
/* 太阳光环（独立一层，避免被 clip-path 裁掉） */
.chr-orb::after { content: ""; position: absolute; right: calc(max(6vw, calc(50% - 560px)) - 26px); top: 20px; width: 136px; height: 136px; opacity: 0; transition: opacity .6s;
  background: radial-gradient(circle, rgba(255, 214, 102, .55) 0 38%, rgba(255, 214, 102, 0) 70%); animation: chrHalo 4s ease-in-out infinite; }
html[data-theme="light"] .chr-orb::after { opacity: 1; }
@keyframes chrHalo { 50% { transform: scale(1.12); } }

/* 像素云 */
.chr-clouds { z-index: 1; transition: opacity .6s; }
.chr-clouds i { position: absolute; left: -160px; width: 96px; height: 24px; background: var(--cloud); animation: chrDrift 60s linear infinite;
  box-shadow: 24px -12px 0 0 var(--cloud), 48px -12px 0 0 var(--cloud), 36px -24px 0 0 var(--cloud); }
.chr-clouds .c1 { top: 120px; animation-delay: -12s; }
.chr-clouds .c2 { top: 60px; animation-duration: 85s; animation-delay: -40s; }
.chr-clouds .c3 { top: 230px; animation-duration: 70s; animation-delay: -55s; }
@keyframes chrDrift { to { transform: translateX(calc(100vw + 320px)); } }
.chr-leaves { z-index: 1; width: 100%; height: 100%; }

/* ================= 正文 ================= */
.chr-wrap { max-width: 960px; margin: 0 auto; padding: 26px 20px 40px; }
.chr-intro { display: grid; gap: 10px; }
.chr-how { border: 2px solid var(--px-line-mid); background: var(--px-surface); padding: 8px 14px; margin: 0; }
.chr-how summary { cursor: pointer; font-family: var(--font-pixel); font-size: 12px; color: var(--px-sky); }
.chr-how ul { margin: 8px 0 4px; padding-left: 20px; color: var(--px-ink-2); font-size: 14px; }
.chr-tip { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 13px; color: var(--px-ink-2); }
.chr-tip-bar { flex: none; width: 36px; height: 14px; background: repeating-linear-gradient(-45deg, #000 0 5px, #1b1b1b 5px 10px); border: 1px solid var(--px-line-mid); }

/* 吸顶条：分期 + 视图切换 */
.chr-bar { position: sticky; top: 55px; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding: 12px 0; margin: 18px 0 4px; background: color-mix(in srgb, var(--px-bg) 94%, transparent); }
.chr-era-nav { display: flex; gap: 8px; overflow-x: auto; min-width: 0; -webkit-overflow-scrolling: touch; padding: 0 4px 4px 0; }
.chr-era-nav a { flex: none; display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-pixel); font-size: 12px; color: var(--px-ink); text-decoration: none; padding: 8px 12px; border: 2px solid var(--px-line); background: var(--px-surface); box-shadow: 3px 3px 0 0 var(--px-hard); white-space: nowrap; transition: transform .12s, background-color .25s, color .25s; }
.chr-era-nav .chr-dot { width: 10px; height: 10px; background: var(--era); border: 2px solid var(--px-line); }
.chr-era-nav em { font-style: normal; font-size: 11px; color: var(--px-ink-3); }
.chr-era-nav a:hover { transform: translate(-1px, -1px); border-color: var(--era); }
.chr-era-nav a.is-on { background: var(--era); color: var(--era-ink); }
.chr-era-nav a.is-on em { color: var(--era-ink); opacity: .75; }
.chr-views { display: flex; border: 2px solid var(--px-line); box-shadow: 3px 3px 0 0 var(--px-hard); background: var(--px-surface); margin-bottom: 4px; }
.chr-view-btn { font: inherit; font-family: var(--font-pixel); font-size: 12px; display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; color: var(--px-ink-2); background: transparent; border: 0; cursor: pointer; transition: background-color .2s, color .2s; }
.chr-view-btn + .chr-view-btn { border-left: 2px solid var(--px-line-mid); }
.chr-view-btn:hover { color: var(--px-ink); background: var(--px-surface-2); }
.chr-view-btn[aria-pressed="true"] { background: var(--px-ink); color: var(--px-bg); }
.chr-view-btn:focus-visible { outline: 3px dashed var(--px-sky); outline-offset: 2px; }
.vi { width: 14px; height: 14px; flex: none; background-repeat: no-repeat; }
.vi-timeline { background-image: linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor);
  background-size: 2px 14px, 6px 2px, 6px 2px, 6px 2px; background-position: 2px 0, 6px 1px, 6px 6px, 6px 11px; }
.vi-scroll { background-image: linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor);
  background-size: 4px 10px, 4px 10px, 4px 10px; background-position: 0 2px, 5px 2px, 10px 2px; }
.vi-table { background-image: linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor), linear-gradient(currentColor, currentColor);
  background-size: 6px 6px, 6px 6px, 6px 6px, 6px 6px; background-position: 0 0, 8px 0, 0 8px, 8px 8px; }

/* ================= 时代横幅 + 时代小动画 ================= */
.chr-era { margin: 30px 0 0; scroll-margin-top: 130px; }
.chr-era-ban { position: relative; overflow: hidden; display: flex; gap: 18px; align-items: flex-start; padding: 22px 170px 20px 22px; min-height: 120px; background: linear-gradient(120deg, color-mix(in srgb, var(--era) 22%, var(--px-surface)) 0%, var(--px-surface) 65%); border: 3px solid var(--px-line); box-shadow: 8px 8px 0 0 var(--px-hard); }
.chr-era-ban::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: var(--era); }
.chr-era-no { position: relative; z-index: 1; flex: none; font-family: var(--font-pixel); font-size: 12px; letter-spacing: .15em; color: var(--era-ink); background: var(--era); padding: 6px 10px; border: 2px solid var(--px-line); box-shadow: 3px 3px 0 0 var(--px-hard); margin-left: 6px; }
.chr-era-bt { position: relative; z-index: 1; min-width: 0; }
.chr-era-h { font-family: var(--font-pixel); font-size: 36px; font-weight: 400; line-height: 1.15; margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.chr-era-h small { font-size: 12px; color: var(--era); border: 2px solid var(--era); padding: 2px 8px; line-height: 1.4; }
.chr-era-r { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 6px 0 0; font-size: 13px; color: var(--px-ink-2); }
.chr-era-r span + span::before { content: "■"; margin-right: 14px; font-size: 8px; vertical-align: 2px; color: var(--era); }
.chr-era-note { margin: 10px 0 0; padding: 8px 12px; font-size: 13px; color: var(--px-ink-2); background: color-mix(in srgb, var(--px-bg) 60%, transparent); border-left: 3px solid var(--era); }

.chr-motif { position: absolute; right: 22px; top: 50%; width: 130px; height: 96px; margin-top: -48px; z-index: 0; }
.chr-motif i { position: absolute; display: block; }
/* 序章「月色真美」：一弯月 + 几颗星 */
.m-prologue i:nth-child(1) { left: 56px; top: 12px; width: 48px; height: 48px; background: var(--px-amber);
  -webkit-mask: radial-gradient(circle at 72% 34%, transparent 0 44%, #000 45%); mask: radial-gradient(circle at 72% 34%, transparent 0 44%, #000 45%);
  border-radius: 50%; filter: drop-shadow(0 0 10px var(--px-amber)); animation: chrRock 5s ease-in-out infinite; }
.m-prologue i:nth-child(n+2) { width: 4px; height: 4px; background: var(--px-ink-2); animation: chrTwinkle 2.4s steps(2) infinite; }
.m-prologue i:nth-child(2) { left: 18px; top: 18px; }
.m-prologue i:nth-child(3) { left: 30px; top: 60px; animation-delay: .6s; }
.m-prologue i:nth-child(4) { left: 112px; top: 74px; animation-delay: 1.2s; }
.m-prologue i:nth-child(5) { left: 8px; top: 84px; animation-delay: 1.8s; }
.m-prologue i:nth-child(6) { left: 118px; top: 6px; width: 6px; height: 6px; background: var(--px-amber); animation-delay: .3s; }
@keyframes chrRock { 50% { transform: rotate(-10deg); } }
/* 第二代：一株树苗，进入视野时长出来 */
.m-gen2 i:nth-child(1) { left: 61px; bottom: 6px; width: 8px; height: 46px; background: #7a5a33; transform-origin: bottom; transform: scaleY(0); }
.m-gen2 i:nth-child(n+2):nth-child(-n+7) { width: 16px; height: 16px; background: var(--px-accent); border: 2px solid color-mix(in srgb, var(--px-line) 60%, transparent); transform: scale(0); }
.m-gen2 i:nth-child(2) { left: 57px; top: 8px; } .m-gen2 i:nth-child(3) { left: 43px; top: 22px; } .m-gen2 i:nth-child(4) { left: 71px; top: 22px; }
.m-gen2 i:nth-child(5) { left: 29px; top: 36px; } .m-gen2 i:nth-child(6) { left: 85px; top: 36px; } .m-gen2 i:nth-child(7) { left: 57px; top: 30px; background: color-mix(in srgb, var(--px-accent) 70%, #fff); }
.m-gen2 i:nth-child(8) { left: 0; bottom: 2px; width: 130px; height: 4px; background: color-mix(in srgb, var(--px-accent) 45%, transparent); }
.m-gen2 i:nth-child(9) { left: 100px; top: 12px; width: 6px; height: 6px; background: var(--px-amber); opacity: 0; }
.is-in .m-gen2 i:nth-child(1) { animation: chrGrow .7s steps(6) forwards; }
.is-in .m-gen2 i:nth-child(n+2):nth-child(-n+7) { animation: chrPop .3s steps(3) forwards, chrSway 3.6s ease-in-out 2.2s infinite; }
.is-in .m-gen2 i:nth-child(3) { animation-delay: .75s, 2.2s; } .is-in .m-gen2 i:nth-child(4) { animation-delay: .85s, 2.3s; }
.is-in .m-gen2 i:nth-child(5) { animation-delay: .95s, 2.4s; } .is-in .m-gen2 i:nth-child(6) { animation-delay: 1.05s, 2.5s; }
.is-in .m-gen2 i:nth-child(2) { animation-delay: 1.15s, 2.6s; } .is-in .m-gen2 i:nth-child(7) { animation-delay: 1.25s, 2.7s; }
.is-in .m-gen2 i:nth-child(9) { animation: chrFall 5s linear 1.8s infinite; }
@keyframes chrGrow { to { transform: scaleY(1); } }
@keyframes chrPop { to { transform: scale(1); } }
@keyframes chrSway { 50% { translate: 2px -1px; } }
@keyframes chrFall { 0% { transform: none; opacity: 1; } 80% { opacity: 1; } 100% { transform: translate(-24px, 78px) rotate(90deg); opacity: 0; } }
/* 第三代「新白叶」：日出 */
.m-gen3 { overflow: hidden; }
.m-gen3 i:nth-child(1) { left: 0; right: 0; bottom: 16px; height: 4px; background: var(--px-sky); z-index: 2; }
.m-gen3 i:nth-child(2) { left: 41px; bottom: -30px; width: 48px; height: 48px; background: #ffc94a; box-shadow: inset -8px -8px 0 0 #f2a51b; z-index: 1;
  clip-path: polygon(30% 0, 70% 0, 70% 8%, 85% 8%, 85% 15%, 92% 15%, 92% 30%, 100% 30%, 100% 70%, 92% 70%, 92% 85%, 85% 85%, 85% 92%, 70% 92%, 70% 100%, 30% 100%, 30% 92%, 15% 92%, 15% 85%, 8% 85%, 8% 70%, 0 70%, 0 30%, 8% 30%, 8% 15%, 15% 15%, 15% 8%, 30% 8%); }
.is-in .m-gen3 i:nth-child(2) { animation: chrRise 1.4s cubic-bezier(.2, .7, .2, 1) forwards; }
@keyframes chrRise { to { bottom: 22px; } }
.m-gen3 i:nth-child(n+3):nth-child(-n+7) { width: 4px; height: 10px; background: #ffc94a; left: 63px; bottom: 76px; transform-origin: 2px 30px; opacity: 0; }
.m-gen3 i:nth-child(3) { rotate: -60deg; } .m-gen3 i:nth-child(4) { rotate: -30deg; } .m-gen3 i:nth-child(5) { rotate: 0deg; }
.m-gen3 i:nth-child(6) { rotate: 30deg; } .m-gen3 i:nth-child(7) { rotate: 60deg; }
.m-gen3 i:nth-child(8) { left: 0; right: 0; bottom: 0; height: 16px; background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--px-sky) 25%, transparent) 0 8px, transparent 8px 16px); }
.is-in .m-gen3 i:nth-child(n+3):nth-child(-n+7) { animation: chrRay 2.4s ease-in-out 1.3s infinite; }
@keyframes chrRay { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }

/* ================= 篇章标题（三视图共用） ================= */
.chr-chap { margin: 26px 0 0; }
.chr-chap-s { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px 0 12px; border-bottom: 2px dashed var(--px-line-mid); }
div.chr-chap-s { cursor: default; border-bottom: 0; padding: 0; }
.chr-chap > summary::-webkit-details-marker { display: none; }
.chr-chap > summary::after { content: "▾"; margin-left: auto; color: var(--era); font-size: 14px; transition: transform .2s; }
.chr-chap:not([open]) > summary::after { transform: rotate(-90deg); }
.chr-chap-no { font-family: var(--font-pixel); font-size: 12px; color: var(--era); border: 2px solid var(--era); padding: 2px 8px; line-height: 1.4; }
.chr-chap-t { font-family: var(--font-pixel); font-size: 24px; line-height: 1.3; }
.chr-chap-r { font-size: 12px; color: var(--px-ink-3); }

/* ================= 事件卡片（三视图共用） ================= */
.chr-ev { position: relative; }
.chr-card { position: relative; height: 100%; padding: 12px 16px 13px; background: var(--px-surface); border: 2px solid var(--px-line-mid); box-shadow: 4px 4px 0 0 var(--px-hard); transition: transform .15s, box-shadow .15s, border-color .15s; }
.chr-ev:hover .chr-card { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 0 var(--px-hard); border-color: var(--era); }
.chr-ev:target .chr-card { border-color: var(--era); box-shadow: 0 0 0 3px color-mix(in srgb, var(--era) 35%, transparent), 6px 6px 0 0 var(--px-hard); }
.chr-ev-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 8px; }
.has-fx .chr-ev-head { padding-right: 38px; }
.chr-chrono { font-family: var(--font-pixel); font-size: 12px; font-weight: 400; color: var(--era-ink); background: var(--era); padding: 3px 8px; line-height: 1.5; border: 2px solid var(--px-line); }
.chr-date { font-size: 13px; color: var(--px-ink-2); font-variant-numeric: tabular-nums; }
.chr-tag { font-size: 12px; padding: 0 6px; border: 1px solid var(--px-line-mid); color: var(--px-ink-2); line-height: 1.7; }
.chr-tag.t-clar { border-color: var(--px-amber); color: var(--px-amber); }
.chr-tag.t-log { border-color: var(--px-sky); color: var(--px-sky); }
.chr-text { margin: 0; font-size: 15px; line-height: 1.85; word-break: break-word; }
.chr-ref { margin: 6px 0 0; font-size: 12px; color: var(--px-ink-3); }

/* 遮盖：只是阅读体验，不是保密 */
.chr-mask { background: repeating-linear-gradient(-45deg, #000 0 6px, #161616 6px 12px); color: transparent; cursor: pointer; -webkit-box-decoration-break: clone; box-decoration-break: clone; outline: 1px solid var(--px-line-mid); transition: background .15s, color .15s; -webkit-tap-highlight-color: transparent; }
.chr-mask:focus-visible { outline: 2px solid var(--era); }
.chr-mask.is-open { background: color-mix(in srgb, var(--era) 12%, transparent); color: inherit; outline-color: var(--era); }
@media (hover: hover) and (pointer: fine) {
  .chr-mask:hover { background: color-mix(in srgb, var(--era) 12%, transparent); color: inherit; outline-color: var(--era); }
}
.chr-help { margin: 10px 0 0; padding: 8px 12px; border: 2px solid var(--px-amber); border-left-width: 6px; background: var(--px-surface-2); color: var(--px-ink); font-size: 14px; }

/* ================= 按记录内容的小动画（右上角 28×28） ================= */
.chr-fx { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; pointer-events: none; }
.chr-fx i { position: absolute; display: block; }
/* 庆典：像素烟花，循环绽放 */
.fx-fire .chr-fx i { left: 12px; top: 12px; width: 4px; height: 4px; background: var(--px-amber); opacity: 0; }
.fx-fire .chr-fx i:nth-child(even) { background: var(--era); }
.fx-fire.is-in .chr-fx i { animation: chrBurst 2.4s steps(6) infinite; }
.fx-fire .chr-fx i:nth-child(1) { --dx: 0px; --dy: -13px; } .fx-fire .chr-fx i:nth-child(2) { --dx: 9px; --dy: -9px; }
.fx-fire .chr-fx i:nth-child(3) { --dx: 13px; --dy: 0px; } .fx-fire .chr-fx i:nth-child(4) { --dx: 9px; --dy: 9px; }
.fx-fire .chr-fx i:nth-child(5) { --dx: 0px; --dy: 13px; } .fx-fire .chr-fx i:nth-child(6) { --dx: -9px; --dy: 9px; }
.fx-fire .chr-fx i:nth-child(7) { --dx: -13px; --dy: 0px; } .fx-fire .chr-fx i:nth-child(8) { --dx: -9px; --dy: -9px; }
@keyframes chrBurst { 0% { opacity: 0; transform: none; } 10% { opacity: 1; } 45% { opacity: 1; transform: translate(var(--dx), var(--dy)); } 60%, 100% { opacity: 0; transform: translate(calc(var(--dx) * 1.2), calc(var(--dy) * 1.2 + 4px)); } }
/* 月色：小月牙 + 星 */
.fx-moon .chr-fx i:nth-child(1) { left: 5px; top: 5px; width: 18px; height: 18px; border-radius: 50%; background: var(--px-amber);
  -webkit-mask: radial-gradient(circle at 72% 34%, transparent 0 42%, #000 43%); mask: radial-gradient(circle at 72% 34%, transparent 0 42%, #000 43%); filter: drop-shadow(0 0 4px var(--px-amber)); }
.fx-moon .chr-fx i:nth-child(2) { left: 22px; top: 2px; width: 3px; height: 3px; background: var(--px-ink-2); }
.fx-moon .chr-fx i:nth-child(3) { left: 21px; top: 21px; width: 3px; height: 3px; background: var(--px-ink-2); animation-delay: 1s !important; }
.fx-moon .chr-fx i:nth-child(n+4) { display: none; }
.fx-moon.is-in .chr-fx i:nth-child(n+2) { animation: chrTwinkle 2s steps(2) infinite; }
.fx-moon.is-in .chr-fx i:nth-child(1) { animation: chrRock 4s ease-in-out infinite; }
/* 筑造：一块方块落地扬尘 */
.fx-block .chr-fx i:nth-child(1) { left: 6px; top: 6px; width: 16px; height: 16px; background: linear-gradient(var(--px-accent) 0 30%, #7a5a33 30%); border: 2px solid var(--px-line); }
.fx-block .chr-fx i:nth-child(2), .fx-block .chr-fx i:nth-child(3) { top: 22px; width: 3px; height: 3px; background: var(--px-ink-3); opacity: 0; }
.fx-block .chr-fx i:nth-child(2) { left: 2px; } .fx-block .chr-fx i:nth-child(3) { left: 23px; }
.fx-block .chr-fx i:nth-child(n+4) { display: none; }
.fx-block.is-in .chr-fx i:nth-child(1) { animation: chrDrop 3.2s cubic-bezier(.5, 0, .9, .5) infinite; }
.fx-block.is-in .chr-fx i:nth-child(2) { animation: chrDustL 3.2s steps(3) infinite; }
.fx-block.is-in .chr-fx i:nth-child(3) { animation: chrDustR 3.2s steps(3) infinite; }
@keyframes chrDrop { 0% { transform: translateY(-18px); opacity: 0; } 8% { opacity: 1; } 22% { transform: none; } 26% { transform: scale(1.1, .85); } 32%, 100% { transform: none; } }
@keyframes chrDustL { 0%, 21% { opacity: 0; } 24% { opacity: 1; transform: none; } 40%, 100% { opacity: 0; transform: translate(-5px, -4px); } }
@keyframes chrDustR { 0%, 21% { opacity: 0; } 24% { opacity: 1; transform: none; } 40%, 100% { opacity: 0; transform: translate(5px, -4px); } }
/* 停服：像 CRT 关机一样收成一条线 */
.fx-off .chr-fx i:nth-child(1) { left: 2px; top: 4px; width: 24px; height: 20px; background: var(--px-sky); border: 2px solid var(--px-line); }
.fx-off .chr-fx i:nth-child(n+2) { display: none; }
.fx-off.is-in .chr-fx i:nth-child(1) { animation: chrCrt 3.6s ease-in infinite; }
@keyframes chrCrt { 0%, 40% { transform: none; opacity: 1; } 55% { transform: scale(1, .08); } 68% { transform: scale(.05, .08); opacity: 1; } 75%, 88% { opacity: 0; transform: scale(.05, .08); } 100% { transform: none; opacity: 1; } }
/* 故障：几块错位闪烁 */
.fx-glitch .chr-fx i { width: 10px; height: 6px; background: var(--px-red); opacity: .8; }
.fx-glitch .chr-fx i:nth-child(1) { left: 2px; top: 4px; } .fx-glitch .chr-fx i:nth-child(2) { left: 14px; top: 10px; background: var(--px-sky); }
.fx-glitch .chr-fx i:nth-child(3) { left: 6px; top: 18px; } .fx-glitch .chr-fx i:nth-child(n+4) { display: none; }
.fx-glitch.is-in .chr-fx i { animation: chrGlitch 1.6s steps(2) infinite; }
@keyframes chrGlitch { 0% { translate: 0 0; } 25% { translate: 3px 0; } 50% { translate: -2px 1px; opacity: .3; } 75% { translate: 1px -1px; } }
/* 首次：旋转闪光星 */
.fx-star .chr-fx i:nth-child(1) { left: 11px; top: 2px; width: 6px; height: 24px; background: var(--px-amber); }
.fx-star .chr-fx i:nth-child(2) { left: 2px; top: 11px; width: 24px; height: 6px; background: var(--px-amber); }
.fx-star .chr-fx i:nth-child(3) { left: 11px; top: 11px; width: 6px; height: 6px; background: #fff; }
.fx-star .chr-fx i:nth-child(n+4) { display: none; }
.fx-star.is-in .chr-fx { animation: chrStar 3s steps(8) infinite; }
@keyframes chrStar { 0% { transform: rotate(0) scale(.6); } 50% { transform: rotate(45deg) scale(1); } 100% { transform: rotate(90deg) scale(.6); } }

/* ================= ① 时间轴 ================= */
.v-timeline .chr-list { position: relative; list-style: none; margin: 0; padding: 6px 0 4px 40px; }
.v-timeline .chr-list::before { content: ""; position: absolute; left: 13px; top: 0; bottom: 0; width: 4px; background: repeating-linear-gradient(180deg, var(--era) 0 8px, transparent 8px 14px); opacity: .55; }
.v-timeline .chr-year { position: relative; margin: 18px 0 4px; font-family: var(--font-pixel); font-size: 24px; line-height: 1; color: var(--era); text-shadow: 2px 2px 0 var(--px-hard); list-style: none; }
.v-timeline .chr-year::before { content: ""; position: absolute; left: -36px; top: 50%; width: 16px; height: 16px; margin-top: -8px; background: var(--px-bg); border: 4px solid var(--era); transform: rotate(45deg); }
.v-timeline .chr-ev { padding: 8px 0; }
.v-timeline .chr-ev::before { content: ""; position: absolute; left: -32px; top: 26px; width: 12px; height: 12px; background: var(--era); border: 2px solid var(--px-line); box-shadow: 2px 2px 0 0 var(--px-hard); z-index: 1; }
.v-timeline .chr-ev.is-masked::before { background: #111; border-color: var(--era); }
.v-timeline .chr-ev::after { content: ""; position: absolute; left: -20px; top: 31px; width: 18px; height: 2px; background: var(--era); opacity: .5; }
.v-timeline .chr-ev.is-in::before { animation: chrNode .5s steps(3); }
@keyframes chrNode { from { transform: scale(0); } }

/* ================= ② 长卷 ================= */
.chr-roll { margin: 26px 0 0; }
.chr-roll-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 10px; border-bottom: 2px dashed var(--px-line-mid); }
.chr-roll-ctl { display: flex; gap: 6px; flex: none; }
.chr-roll-btn { width: 34px; height: 30px; font-size: 11px; color: var(--px-ink); background: var(--px-surface); border: 2px solid var(--px-line); box-shadow: 2px 2px 0 0 var(--px-hard); cursor: pointer; }
.chr-roll-btn:hover:not(:disabled) { background: var(--era); color: var(--era-ink); }
.chr-roll-btn:disabled { opacity: .35; cursor: default; }
.chr-track { list-style: none; margin: 0; display: flex; align-items: stretch; gap: 16px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding: 34px 6px 18px; cursor: grab;
  background: repeating-linear-gradient(90deg, var(--era) 0 10px, transparent 10px 16px) 0 15px / 100% 4px no-repeat local; scrollbar-width: thin; }
.chr-track.is-drag { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.chr-track:focus-visible { outline: 3px dashed var(--px-sky); outline-offset: 2px; }
.v-scroll .chr-ev { flex: 0 0 300px; scroll-snap-align: start; }
.v-scroll .chr-ev::before { content: ""; position: absolute; left: 18px; top: -24px; width: 12px; height: 12px; background: var(--era); border: 2px solid var(--px-line); }
.v-scroll .chr-ev.is-masked::before { background: #111; border-color: var(--era); }
.v-scroll .chr-ev::after { content: ""; position: absolute; left: 23px; top: -12px; width: 2px; height: 12px; background: var(--era); opacity: .6; }
.v-scroll .chr-text { font-size: 14px; }
.chr-year-v { flex: 0 0 auto; list-style: none; display: flex; align-items: center; justify-content: center; position: relative; padding: 0 6px; font-family: var(--font-pixel); font-size: 24px; color: var(--era); writing-mode: vertical-rl; letter-spacing: .1em; border-left: 4px solid var(--era); border-right: 4px solid var(--era); background: color-mix(in srgb, var(--era) 10%, transparent); }
.chr-year-v::before { content: ""; position: absolute; left: 50%; top: -27px; width: 14px; height: 14px; margin-left: -7px; background: var(--px-bg); border: 4px solid var(--era); transform: rotate(45deg); }
.chr-roll-bar { height: 4px; background: var(--px-line-soft); }
.chr-roll-bar i { display: block; height: 100%; width: 8%; background: var(--era); transition: width .15s; }

/* ================= ③ 年表 ================= */
.chr-yb { display: grid; grid-template-columns: 170px 1fr; gap: 20px; margin: 26px 0 0; padding-top: 18px; border-top: 2px dashed var(--px-line-mid); }
.chr-yb-side { position: sticky; top: 130px; align-self: start; display: flex; flex-direction: column; gap: 4px; }
.chr-yb-y { font-family: var(--font-pixel); font-weight: 400; font-size: 48px; line-height: 1; color: var(--era); text-shadow: 3px 3px 0 var(--px-hard); }
.chr-yb-n { font-family: var(--font-pixel); font-size: 12px; color: var(--px-ink); }
.chr-yb-c { font-size: 12px; color: var(--px-ink-3); }
.chr-ygrid { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 14px; }
.v-table .chr-ev { break-inside: avoid; margin: 0 0 14px; display: inline-block; width: 100%; }
.v-table .chr-card { padding: 10px 14px 11px; }
.v-table .chr-text { font-size: 14px; line-height: 1.75; }

/* ================= 结尾 / 回顶 / 页脚 ================= */
.chr-end { display: flex; align-items: center; gap: 14px; margin: 40px 0 0; color: var(--px-sky); font-family: var(--font-pixel); font-size: 12px; letter-spacing: .3em; }
.chr-end::before, .chr-end::after { content: ""; flex: 1; height: 4px; background: repeating-linear-gradient(90deg, var(--px-line-mid) 0 8px, transparent 8px 14px); }
.chr-totop { position: fixed; right: 18px; bottom: 18px; z-index: 25; width: 44px; height: 44px; font-size: 14px; color: var(--era-ink); background: var(--era); border: 3px solid var(--px-line); box-shadow: 4px 4px 0 0 var(--px-hard); cursor: pointer; opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s, transform .2s, background-color .4s; }
.chr-totop.is-show { opacity: 1; transform: none; pointer-events: auto; }
.chr-loading { color: var(--px-ink-2); text-align: center; padding: 40px 0; }
.chr-foot { text-align: center; color: var(--px-ink-3); font-size: 12px; padding: 20px; border-top: 1px solid var(--px-line-soft); }

/* 渐入（仅在 JS 启用且未要求减少动效时） */
.chr-anim .chr-rv { opacity: 0; transform: translateY(16px); transition: opacity .5s ease, transform .5s ease; }
.chr-anim .v-scroll .chr-rv.chr-ev { transform: translateX(24px); }
.chr-anim .chr-rv.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .chr-sky i, .chr-orb i, .chr-orb::after, .chr-clouds i, .chr-motif i, .chr-fx, .chr-fx i { animation: none !important; }
  .m-gen2 i { transform: none !important; } .m-gen3 i:nth-child(2) { bottom: 22px; } .m-gen3 i:nth-child(n+3):nth-child(-n+7) { opacity: .6; }
  .chr-card, .chr-btn, .chr-era-nav a { transition: none; }
}

@media (max-width: 720px) {
  .chr-top { padding: 8px 12px; }
  .chr-brand-t { font-size: 12px; }
  .chr-hero { padding: 40px 16px 44px; }
  .chr-title { font-size: 36px; }
  .chr-lead { font-size: 14px; padding-right: 56px; }
  .chr-orb i { width: 48px; height: 48px; top: 22px; right: 16px; }
  .chr-orb::after { right: 0; top: 4px; width: 84px; height: 84px; }
  .chr-now-cell { min-width: 0; flex: 1 1 140px; padding: 10px 12px; }
  .chr-now-v { font-size: 12px; }
  .chr-stat b { font-size: 12px; }
  .chr-wrap { padding: 20px 14px 32px; }
  .chr-bar { top: 50px; }
  .chr-views { width: 100%; }
  .chr-view-btn { flex: 1; justify-content: center; }
  .chr-era-ban { flex-direction: column; gap: 10px; padding: 16px 14px 14px 20px; }
  .chr-motif { right: 6px; top: 8px; margin-top: 0; transform: scale(.6); transform-origin: top right; opacity: .55; }
  .chr-era-no { margin-left: 0; }
  .chr-era-h { font-size: 24px; }
  .chr-chap-t { font-size: 12px; }
  .chr-card { padding: 10px 12px; }
  .chr-text { font-size: 14px; }
  .v-timeline .chr-list { padding-left: 30px; }
  .v-timeline .chr-list::before { left: 8px; }
  .v-timeline .chr-year { font-size: 12px; }
  .v-timeline .chr-year::before { left: -29px; width: 12px; height: 12px; margin-top: -6px; border-width: 3px; }
  .v-timeline .chr-ev::before { left: -27px; }
  .v-timeline .chr-ev::after { left: -15px; width: 13px; }
  .v-scroll .chr-ev { flex-basis: 78vw; }
  .chr-year-v { font-size: 12px; }
  .chr-yb { grid-template-columns: 1fr; gap: 10px; }
  .chr-yb-side { position: static; flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
  .chr-yb-y { font-size: 36px; }
  .chr-ygrid { columns: 1; }
}
