:root {
  --night: #140f2e;
  --gold: #ffd36b;
  --gold-2: #f3a93b;
  --red: #e8503a;
  --red-deep: #a92c27;
  --jade: #3fc2a5;
  --paper: #fff6e2;
  --ink: #2a1d2f;
  --muted: #d6c8f0;
  --serif: 'Kaiti SC', 'STKaiti', 'Songti SC', 'Noto Serif CJK SC', serif;
  --round: 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --vh: 1vh;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--night); }
body { margin: 0; overflow-x: hidden; font: 16px/1.6 var(--round); color: var(--paper); background: var(--night); }
h1, h2, h3, h4, p, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }
img { display: block; max-width: 100%; }
button { font: inherit; }

/* ---------- 全局层：粒子 / 转场 / 闪光 / 光标 / HUD ---------- */
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 40; }
#flash { position: fixed; inset: 0; z-index: 45; pointer-events: none; background: radial-gradient(circle at 50% 50%, rgba(255,226,150,.95), rgba(255,200,90,.35) 35%, transparent 70%); opacity: 0; }
.hud { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.hud-bar { position: absolute; top: 0; left: 0; right: 0; height: 3px; background: rgba(255, 255, 255, .08); }
.hud-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--red)); box-shadow: 0 0 12px var(--gold); }
.hud-chapter { position: absolute; left: 22px; bottom: 18px; display: flex; align-items: baseline; gap: 10px; mix-blend-mode: difference; color: #fff; }
.hud-chapter b { font: 900 30px/1 var(--round); }
.hud-chapter span { font: 700 14px var(--serif); letter-spacing: 4px; }

/* ---------- 场景骨架：容器很高，舞台吸顶 ---------- */
.scene { position: relative; }
.stage { position: sticky; top: 0; height: calc(var(--vh) * 100); overflow: hidden; background: var(--bg); }
.scene.light .stage { color: var(--ink); }
.kicker { display: inline-block; margin-bottom: 8px; padding: 3px 14px; border-radius: 999px; font-size: clamp(12px, 1.3vw, 15px); font-weight: 700; color: var(--gold); background: rgba(0, 0, 0, .22); }
.scene-head { position: absolute; top: 8vh; left: 0; right: 0; z-index: 5; text-align: center; padding: 0 20px; }
.scene-head h2 { font: 900 clamp(40px, 6.6vw, 92px)/1.1 var(--serif); letter-spacing: .08em; text-shadow: 0 6px 0 rgba(0, 0, 0, .18); }
.scene-head p { margin-top: 10px; font-size: clamp(14px, 1.5vw, 18px); opacity: .85; }

/* ---------- 01 推开阁门 ---------- */
#gate .stage { perspective: 1600px; }
.zoom { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 20px 22vh; will-change: transform; }
.moon {
  position: absolute; top: 9vh; right: 12vw; width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff9e0, #ffe39a 60%, #f6c35b); box-shadow: 0 0 80px 26px rgba(255, 214, 120, .35);
}
.lanterns { position: absolute; inset: 0 0 auto; display: flex; justify-content: space-between; padding: 0 6vw; }
.lanterns span {
  position: relative; width: 46px; height: 58px; margin-top: 40px; border-radius: 45%;
  background: radial-gradient(circle at 50% 40%, #ff9a6b, var(--red) 55%, var(--red-deep)); box-shadow: 0 0 34px 8px rgba(255, 110, 70, .45);
  transform-origin: 50% -40px; animation: swing 3.2s ease-in-out infinite;
}
.lanterns span::before { content: ''; position: absolute; left: 50%; top: -40px; width: 2px; height: 40px; background: #e7b75c; }
.lanterns span::after { content: ''; position: absolute; left: 50%; bottom: -16px; width: 8px; height: 16px; margin-left: -4px; background: var(--gold); border-radius: 0 0 4px 4px; }
.lanterns span:nth-child(2) { margin-top: 90px; animation-delay: -.8s; }
.lanterns span:nth-child(3) { margin-top: 70px; animation-delay: -1.6s; }
.lanterns span:nth-child(4) { animation-delay: -2.4s; }
.beam {
  position: absolute; left: 50%; top: 50%; width: 90vw; height: 140vh; transform: translate(-50%, -50%); opacity: 0; pointer-events: none;
  background: radial-gradient(ellipse 30% 50% at 50% 50%, rgba(255, 236, 170, .95), rgba(255, 190, 90, .35) 45%, transparent 70%);
}
.gate-copy { position: relative; z-index: 2; }
.gate-copy::before { content: ''; position: absolute; inset: -6% -14% -10%; z-index: -1; background: radial-gradient(ellipse at 50% 55%, rgba(12, 8, 36, .78), rgba(12, 8, 36, .45) 50%, transparent 72%); }
.eyebrow { color: var(--gold); letter-spacing: 6px; font-size: clamp(12px, 1.4vw, 16px); }
.title { margin: 10px 0 12px; font: 900 clamp(60px, 13.5vw, 190px)/1 var(--serif); letter-spacing: .06em; white-space: nowrap; }
.title .ch {
  display: inline-block; will-change: transform, opacity, filter;
  background: linear-gradient(100deg, #ffb347 0%, #fff1b8 35%, #ffd36b 50%, #fff1b8 65%, #ffb347 100%);
  background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 0 var(--red-deep)); animation: shimmer 4s linear infinite;
}
.intro { max-width: 38em; margin: 0 auto; color: var(--muted); font-size: clamp(14px, 1.4vw, 17px); }
.phases { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 22px; flex-wrap: wrap; }
.phase { display: flex; flex-direction: column; align-items: center; padding: 10px 22px 8px; border-radius: 22px; background: linear-gradient(180deg, #fff6e2, #ffe1a6); color: var(--ink); box-shadow: 0 6px 0 var(--gold-2), 0 12px 26px rgba(0, 0, 0, .3); }
.phase b { font: 800 clamp(18px, 2vw, 26px)/1.2 var(--serif); color: var(--red-deep); }
.phase span { font-size: 14px; font-weight: 700; }
.phase-arrow { font-style: normal; font-size: 22px; color: var(--gold); }
.countdown { margin-top: 14px; color: var(--gold); font-weight: 700; }
.lineup { position: absolute; left: 0; right: 0; bottom: 3vh; display: flex; justify-content: center; align-items: flex-end; gap: clamp(0px, 1vw, 14px); z-index: 2; }
.slot { will-change: transform, opacity; }
.slot img { width: clamp(64px, 13vw, 170px); animation: bob 2.4s ease-in-out infinite; filter: drop-shadow(0 10px 0 rgba(0, 0, 0, .25)); cursor: pointer; }
.slot.mid img { width: clamp(90px, 17vw, 220px); }
.door {
  position: absolute; top: 0; bottom: 0; width: 50.5%; z-index: 10; will-change: transform;
  background:
    radial-gradient(circle at 50% 50%, #ffe08a 0 5px, #b37a1c 6px 7px, transparent 8px) 0 0 / 9vh 9vh,
    linear-gradient(90deg, rgba(0, 0, 0, .25), transparent 12%, transparent 88%, rgba(0, 0, 0, .25)),
    linear-gradient(180deg, #b32a20, #861a14);
  box-shadow: inset 0 0 0 1.4vh #6d140f, inset 0 0 0 1.8vh #d9a23a, inset 0 0 60px rgba(0, 0, 0, .5);
}
.door.left { left: 0; transform-origin: left center; }
.door.right { right: 0; transform-origin: right center; }
.ring { position: absolute; top: 50%; width: 9vh; height: 9vh; margin-top: -4.5vh; border-radius: 50%; border: 1.1vh solid #f2c14e; box-shadow: 0 0 0 .5vh #8a5a12, inset 0 0 0 .5vh #8a5a12, 0 6px 14px rgba(0, 0, 0, .5); }
.door.left .ring { right: 3vh; }
.door.right .ring { left: 3vh; }
.hint { position: absolute; left: 0; right: 0; bottom: 7vh; z-index: 12; pointer-events: none; text-align: center; font: 800 clamp(16px, 2vw, 22px) var(--serif); letter-spacing: 6px; color: #ffe9b8; text-shadow: 0 2px 10px rgba(0, 0, 0, .6); }
.hint i { display: block; font-style: normal; animation: bob 1.4s ease-in-out infinite; }

/* ---------- 02 时间线 ---------- */
.track { position: absolute; left: 0; top: 52%; z-index: 2; display: flex; align-items: center; gap: 6vw; transform: translateY(-50%); will-change: transform; }
.tl-item { flex: none; width: min(520px, 78vw); display: flex; flex-direction: column; align-items: center; text-align: center; will-change: transform, opacity; }
.tl-when { font: 900 clamp(44px, 6.4vw, 96px)/1 var(--serif); color: transparent; -webkit-text-stroke: 2px rgba(255, 255, 255, .85); white-space: nowrap; }
.tl-item.now .tl-when, .tl-item.on .tl-when { color: #fff; -webkit-text-stroke: 0; text-shadow: 0 8px 0 rgba(0, 0, 0, .2); }
.tl-card { position: relative; margin-top: 20px; width: 100%; display: flex; gap: 16px; align-items: center; padding: 18px 20px; text-align: left; border-radius: 26px; background: var(--paper); color: var(--ink); box-shadow: 0 8px 0 #e7c48a, 0 20px 40px rgba(0, 0, 0, .3); }
.tl-card img { width: 96px; flex: none; margin: -40px 0 -14px; }
.tl-item.upcoming:not(.on) .tl-card img { filter: brightness(.2); }
.tl-item.on .tl-card img { animation: hop .7s cubic-bezier(.2, 1.6, .4, 1); }
.tl-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; background: #8f7aa8; }
.now .tl-badge { background: var(--red); }
.done .tl-badge { background: var(--jade); }
.tl-card h3 { margin: 6px 0 2px; font: 800 22px/1.3 var(--serif); }
.tl-card p { font-size: 14px; color: #6b5562; }
.road { position: absolute; left: 0; right: 0; bottom: 12vh; height: 10px; z-index: 1; background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .25) 0 24px, transparent 24px 40px); }
.road i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--red)); box-shadow: 0 0 18px var(--gold); }
.runner { position: absolute; left: 50%; bottom: calc(12vh + 2px); z-index: 3; width: clamp(70px, 9vw, 120px); transform: translateX(-50%); animation: run .42s ease-in-out infinite; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .25)); }

/* ---------- 03 底池共建 ---------- */
.pool-steps { position: absolute; left: 6vw; top: 50%; z-index: 4; transform: translateY(-30%); display: grid; gap: 18px; }
.pool-steps li { display: flex; align-items: center; gap: 14px; font: 800 clamp(18px, 2.2vw, 28px) var(--serif); opacity: .35; transform: translateX(-10px); transition: opacity .35s, transform .35s cubic-bezier(.2, 1.6, .4, 1); }
.pool-steps li b { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; font: 900 18px var(--round); color: #d9442f; background: #fff3dc; }
.pool-steps li.on { opacity: 1; transform: none; }
.pool-center { position: absolute; left: 50%; bottom: 9vh; z-index: 3; width: 420px; height: 68vh; transform: translateX(-50%); transform-origin: 0 100%; }
.rain { position: absolute; inset: 0; }
.coin {
  display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%;
  font: 900 13px/1 var(--round); color: #7a3d12; background: radial-gradient(circle at 35% 30%, #fff4c2, var(--gold) 45%, var(--gold-2));
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .4), inset 0 -4px 0 rgba(160, 80, 20, .35), 0 0 20px rgba(255, 200, 90, .55);
}
.rcoin { position: absolute; left: 50%; top: 0; width: 58px; height: 58px; margin-left: -29px; will-change: transform, opacity; }
.coin.fun { font-size: 34px; color: #fff; background: radial-gradient(circle at 35% 30%, #c9fff0, var(--jade) 50%, #1f8b74); box-shadow: inset 0 0 0 7px rgba(255, 255, 255, .3), 0 0 50px rgba(63, 194, 165, .9); }
.fun-pop { position: absolute; left: 50%; bottom: 150px; width: 140px; height: 140px; margin-left: -70px; z-index: 4; opacity: 0; will-change: transform, opacity; }
.pool-hero { position: absolute; left: calc(100% + 10px); bottom: 0; z-index: 4; width: 200px; opacity: 0; will-change: transform, opacity; }
.pool-hero img { width: 100%; animation: bob 2s ease-in-out infinite; }
.say { position: absolute; bottom: 100%; left: 10%; padding: 8px 14px; border-radius: 16px; white-space: nowrap; font-weight: 800; color: var(--ink); background: #fff; }
.say::after { content: ''; position: absolute; left: 30%; top: 100%; border: 7px solid transparent; border-top-color: #fff; }

/* ---------- 04 盟主令合成 ---------- */
.forge-a, .forge-b { position: absolute; inset: 0; will-change: opacity; }
.forge-b { opacity: 0; }
.furnace { position: absolute; left: 50%; top: 56%; width: 320px; height: 320px; transform: translate(-50%, -50%); transform-origin: 0 0; }
.drop { position: absolute; left: 50%; top: 50%; width: 0; height: 0; z-index: 3; }
.ftab { position: absolute; left: -24px; top: -30px; width: 48px; will-change: transform, opacity; }
.gauge { --g: 0; --gc: #ffd36b; position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--gc) calc(var(--g) * 1%), rgba(255, 255, 255, .12) 0); box-shadow: 0 0 60px rgba(255, 211, 107, .25); }
.gauge-in { width: 250px; height: 250px; border-radius: 50%; display: grid; place-content: center; text-align: center; background: radial-gradient(circle at 50% 35%, #1f6b53, #0a3528); box-shadow: inset 0 -10px 30px rgba(0, 0, 0, .4); }
.gauge-in span { font-size: 14px; opacity: .75; }
.gauge-in b { font: 900 96px/1 var(--round); font-variant-numeric: tabular-nums; }
.gauge-in em { font-style: normal; font: 800 18px var(--serif); color: var(--gold); }
.gauge.pop { animation: gpop .45s cubic-bezier(.2, 1.6, .4, 1); }
.recipe-list { position: absolute; right: 7vw; top: 56%; z-index: 4; transform: translateY(-50%); display: grid; gap: 14px; }
.recipe-list li { position: relative; display: flex; align-items: center; gap: 16px; padding: 12px 20px; border-radius: 20px; background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .12); opacity: .5; transition: opacity .3s, background .3s, transform .3s; }
.recipe-list li b { font: 900 28px var(--serif); min-width: 76px; }
.recipe-list li span { font: 900 34px var(--round); color: var(--gold); }
.recipe-list li i { font-style: normal; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: rgba(232, 80, 58, .35); }
.recipe-list li.sure i { background: rgba(63, 194, 165, .55); }
.recipe-list li.hit { opacity: 1; background: rgba(255, 211, 107, .18); box-shadow: inset 0 0 0 3px var(--gold); transform: scale(1.06); }
.recipe-list li.hit::after { content: '达成'; position: absolute; right: -14px; top: -12px; padding: 2px 10px; border: 3px solid var(--red); border-radius: 8px; font: 900 14px var(--serif); color: var(--red); background: #fff6e2; transform: rotate(12deg); animation: stamp .4s cubic-bezier(.3, 1.6, .5, 1) both; }
.forge-warn { position: absolute; left: 0; right: 0; bottom: 7vh; z-index: 4; text-align: center; font-weight: 800; color: #ffd9cf; text-shadow: 0 2px 8px rgba(0, 0, 0, .9); }
.rays { position: absolute; left: 50%; top: 52%; width: 160vmax; height: 160vmax; margin: -80vmax 0 0 -80vmax; opacity: 0; border-radius: 50%; background: repeating-conic-gradient(rgba(255, 246, 200, .35) 0 5deg, transparent 5deg 15deg); -webkit-mask: radial-gradient(circle, #000 10%, transparent 60%); mask: radial-gradient(circle, #000 10%, transparent 60%); will-change: transform, opacity; }
.merge { position: absolute; left: 50%; top: 52%; width: 0; height: 0; }
.mtab { position: absolute; left: -36px; top: -46px; width: 72px; will-change: transform, opacity; }
.gold-token { position: absolute; left: 50%; top: 52%; width: 180px; margin: -130px 0 0 -90px; z-index: 3; opacity: 0; will-change: transform, opacity; }
.gold-bob { animation: bob 2.4s ease-in-out infinite; }
.gold-token .jade { filter: drop-shadow(0 0 30px rgba(255, 220, 120, .95)); }
.sure-badge { position: absolute; left: 50%; top: 78%; z-index: 4; transform: translateX(-50%); white-space: nowrap; padding: 10px 26px; border-radius: 999px; font: 900 clamp(18px, 2.4vw, 28px) var(--serif); color: #fff; background: var(--jade); box-shadow: 0 6px 0 #22806c, 0 0 40px rgba(63, 194, 165, .6); opacity: 0; }
.tier-row { position: absolute; left: 0; right: 0; bottom: 4vh; display: flex; justify-content: center; align-items: center; gap: 10px; opacity: 0; }
.tier-row li { display: flex; align-items: center; gap: 10px; padding: 8px 16px 8px 10px; border-radius: 18px; background: rgba(0, 0, 0, .25); text-align: left; }
.tier-row li .tk { width: 30px; flex: none; }
.tier-txt b { display: block; font-size: 14px; }
.tier-txt small { display: block; font-size: 12px; opacity: .8; }
.variants { display: flex; gap: 2px; margin-top: 3px; }
.variants i { width: 11px; }
.tier-row .arr { padding: 0; background: none; color: var(--gold); }

/* ---------- 05 邀请关系 ---------- */
.invite { position: absolute; left: 50%; top: 55%; z-index: 3; transform: translate(-50%, -50%); transform-origin: 0 0; display: flex; align-items: center; gap: 30px; }
.inv-card { position: relative; width: 340px; min-height: 400px; padding: 22px 20px; border-radius: 28px; text-align: center; background: var(--paper); color: var(--ink); box-shadow: 0 8px 0 #e7c48a, 0 22px 40px rgba(120, 40, 70, .25); will-change: transform, opacity; }
.inv-old { background: #efe6de; }
.inv-label { display: inline-block; padding: 2px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; color: #fff; background: #8f7aa8; }
.inv-new .inv-label { background: var(--jade); }
.inv-card h3 { margin-top: 10px; font: 800 24px var(--serif); }
.pair { display: flex; align-items: center; justify-content: center; margin-top: 46px; filter: grayscale(.9) opacity(.7); }
.pair img { width: 118px; }
.pair .link { width: 54px; height: 6px; border-radius: 6px; background: repeating-linear-gradient(90deg, #8a6a55 0 10px, transparent 10px 16px); }
.inv-desc { margin-top: 30px; font-size: 15px; color: #6b5562; }
.stamp { position: absolute; left: 50%; top: 46%; padding: 6px 22px; border: 6px solid var(--red); border-radius: 14px; white-space: nowrap; font: 900 46px/1.1 var(--serif); letter-spacing: 6px; color: var(--red); background: rgba(255, 246, 226, .65); opacity: 0; will-change: transform, opacity; }
.inv-arrow { font-size: 40px; color: var(--red-deep); will-change: transform, opacity; }
.tree { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 14px; }
.tree-row { position: relative; display: flex; justify-content: center; will-change: transform, opacity; }
.tree-row.root { margin-bottom: 6px; }
.tree-row + .tree-row::before { content: ''; position: absolute; top: -14px; left: 50%; width: 4px; height: 14px; margin-left: -2px; border-radius: 4px; background: var(--gold-2); }
.node { position: relative; width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: #ffe9b8; box-shadow: inset 0 0 0 3px var(--gold-2); }
.node img { width: 54px; margin-top: -8px; }
.lv .node img { filter: brightness(.2); }
.node.me { width: 72px; height: 72px; background: #c9f3e7; box-shadow: inset 0 0 0 3px var(--jade); }
.node.me img { width: 64px; }
.node.me span { position: absolute; bottom: -8px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 700; color: #fff; background: var(--jade); }
.q { position: absolute; right: -6px; top: -6px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font: 900 14px var(--round); font-style: normal; color: #fff; background: var(--red); animation: bob 1.4s ease-in-out infinite; }
.lv-tag { position: absolute; right: calc(50% + 44px); top: 50%; transform: translateY(-50%); font-size: 13px; color: #8a6a55; white-space: nowrap; }
.ceiling { position: relative; width: 82%; height: 22px; }
.ceiling i { position: absolute; left: 0; top: 0; height: 0; width: 100%; border-top: 3px dashed var(--red); transform-origin: left; }
.ceiling span { position: absolute; left: 0; right: 0; top: 4px; font-size: 13px; font-weight: 800; color: var(--red); }
.tree-row.over .node { background: #e6dcd3; box-shadow: inset 0 0 0 3px #c9b9ad; }
.tree-row.over { opacity: .5; }
.cross { font-style: normal; font-size: 26px; font-weight: 900; color: var(--red); }
.invite-note { position: absolute; left: 0; right: 0; bottom: 5vh; z-index: 3; padding: 0 20px; text-align: center; font: 800 clamp(15px, 1.6vw, 19px) var(--serif); color: var(--red-deep); }

/* ---------- 06/07 普通段落 ---------- */
.plain { position: relative; z-index: 1; padding: 16vh 20px 12vh; text-align: center; background: var(--night); }
.mega { font: 900 clamp(48px, 9vw, 130px)/1.05 var(--serif); letter-spacing: .06em; background: linear-gradient(180deg, #fff1c4, var(--gold) 60%, var(--gold-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.plain-sub { margin-top: 14px; color: var(--muted); }
.js .reveal { opacity: 0; transform: translateY(40px) scale(.96); transition: opacity .8s ease, transform .8s cubic-bezier(.2, 1.4, .4, 1); }
.reveal.in { opacity: 1; transform: none; }
.wall { max-width: 1100px; margin: 50px auto 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 18px; perspective: 900px; }
.wall li { position: relative; }
.wall button {
  width: 100%; padding: 10px 6px 8px; border: 0; border-radius: 22px; color: var(--paper);
  background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .1);
  transform-style: preserve-3d; transition: transform .15s ease-out, background .2s;
}
.wall button:hover { background: rgba(255, 211, 107, .18); }
.wall button:focus-visible { background: rgba(255, 211, 107, .18); outline: 3px solid var(--gold); outline-offset: 3px; }
.wall button.jump { animation: jump .5s cubic-bezier(.2, 1.6, .4, 1); }
.wall img { width: 100%; aspect-ratio: 1; object-fit: contain; transform: translateZ(30px); }
.wall .name { display: block; margin-top: 2px; font: 700 15px var(--serif); }
.wall .no { position: absolute; top: 8px; left: 12px; font-size: 11px; color: var(--gold); }
.bubble { position: absolute; left: 50%; bottom: 100%; z-index: 5; padding: 6px 12px; border-radius: 14px; white-space: nowrap; background: #fff; color: var(--ink); font-size: 14px; font-weight: 700; transform: translate(-50%, 6px) scale(.6); opacity: 0; transition: .25s cubic-bezier(.2, 1.6, .4, 1); pointer-events: none; }
.bubble::after { content: ''; position: absolute; left: 50%; top: 100%; margin-left: -6px; border: 6px solid transparent; border-top-color: #fff; }
.bubble.show { transform: translate(-50%, -4px) scale(1); opacity: 1; }
.cta { padding-bottom: 6vh; }
.btn { margin-top: 36px; padding: 20px 60px; border: 0; border-radius: 999px; font: 800 24px/1 var(--serif); letter-spacing: 6px; color: #fff; background: linear-gradient(180deg, #ff7b5c, var(--red)); box-shadow: 0 7px 0 var(--red-deep), 0 0 50px rgba(255, 100, 70, .55); animation: breathe 2.2s ease-in-out infinite; }
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--red-deep); animation: none; }
.btn:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.btn.done { background: linear-gradient(180deg, #6fe0c4, var(--jade)); box-shadow: 0 7px 0 #22806c; animation: none; }
/* DeBox 拜帖卡：和时间线卡片同一套 Q 版纸卡语言 */
.contact { position: relative; display: flex; align-items: center; gap: 22px; width: min(590px, calc(100vw - 40px)); margin: 56px auto 0; padding: 22px 24px; text-align: left; border-radius: 28px; background: linear-gradient(180deg, #fff6e2, #ffe1a6); color: var(--ink); box-shadow: 0 8px 0 var(--gold-2), 0 22px 46px rgba(0, 0, 0, .4); }
.contact-k { position: absolute; top: -16px; left: 22px; padding: 7px 16px; border-radius: 999px; font: 800 15px/1 var(--serif); letter-spacing: 2px; color: #fff; background: var(--red); box-shadow: 0 4px 0 var(--red-deep); transform: rotate(-4deg); }
.contact-peek { position: absolute; right: 14px; bottom: calc(100% - 26px); width: 92px; pointer-events: none; }
.contact-peek img { display: block; width: 100%; animation: bob 2.4s ease-in-out infinite; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .18)); }
.contact-peek .say { left: auto; right: 78%; bottom: 62%; font-size: 14px; box-shadow: 0 4px 0 rgba(0, 0, 0, .12); }
.contact-qr { flex: none; padding: 8px; border-radius: 20px; background: #fff; box-shadow: 0 5px 0 #e7c48a; }
.contact-qr img { display: block; width: 132px; height: 132px; border-radius: 12px; }
.contact-info { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1; }
.contact-who { display: flex; align-items: center; gap: 8px; }
.contact-who img { width: 28px; height: 28px; border-radius: 50%; box-shadow: 0 0 0 2px #fff; }
.contact-who b { font: 800 24px/1.2 var(--serif); color: var(--red-deep); }
.contact-who i { font-style: normal; padding: 3px 8px; border-radius: 8px; font-size: 12px; font-weight: 800; color: var(--ink); background: var(--gold); }
.contact-id { padding: 6px 10px; border-radius: 10px; font: 12px/1.45 ui-monospace, Menlo, monospace; color: #6b5562; background: rgba(255, 255, 255, .65); word-break: break-all; user-select: all; }
.contact-copy { align-self: flex-start; margin-top: 2px; padding: 11px 22px; border: 0; border-radius: 999px; font: 800 16px/1 var(--serif); letter-spacing: 2px; color: var(--ink); background: linear-gradient(180deg, #ffe58f, var(--gold)); box-shadow: 0 5px 0 var(--gold-2); cursor: pointer; }
.contact-copy:hover { filter: brightness(1.08); }
.contact-copy:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--gold-2); }
.contact-copy:focus-visible { outline: 3px solid var(--red-deep); outline-offset: 3px; }
.contact-note { font-size: 12px; color: #8a6f5c; }
@media (max-width: 760px) {
  .contact { flex-direction: column; text-align: center; gap: 14px; padding: 30px 18px 20px; }
  .contact-info { align-items: center; width: 100%; }
  .contact-copy { align-self: stretch; }
  .contact-peek { width: 76px; right: 8px; }
}
.foot-contact { display: block; margin-top: 8px; user-select: all; word-break: break-all; }
.foot { padding: 30px 20px 60px; text-align: center; font-size: 13px; color: rgba(255, 255, 255, .4); background: var(--night); }


/* =========================================================
   场景美术（js/scenery.js 生成）
   ========================================================= */
.bg { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.bg > svg { display: block; width: 100%; height: 100%; }

/* 01 夜空 · 凌烟阁 · 宫墙 */
#gate .stage { background: linear-gradient(180deg, #0c0824 0%, #1d1240 50%, #46203f 100%); }
.gate-hall { top: auto; bottom: 13vh; height: 54vh; will-change: transform; transform-origin: 50% 100%; }
.gate-wall { top: auto; height: 15vh; }
.gate-clouds { will-change: transform; }

/* 02 长安西市全景 */
.timeline-bg { overflow: hidden; }
.market { position: absolute; left: 0; bottom: 0; height: 100%; width: auto; max-width: none; will-change: transform; }
.market-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(14, 10, 38, .72) 0%, rgba(14, 10, 38, .3) 28%, transparent 46%, transparent 78%, rgba(14, 10, 38, .3) 100%); }
#timeline .road { background: repeating-linear-gradient(90deg, rgba(110, 70, 30, .35) 0 24px, transparent 24px 40px); }

/* 03 夜色荷花池 · 聚宝盆 */
#pool .stage { background: linear-gradient(180deg, #051522 0%, #0a2c3b 42%, #0b3a47 100%); }
.ripples { animation: drift 7s ease-in-out infinite alternate; }
.koi { animation: swim 30s linear infinite; }
.koi.k2 { animation: swim-l 38s linear infinite; animation-delay: -14s; }
.koi.k3 { animation-duration: 44s; animation-delay: -26s; }
@keyframes drift { from { transform: translateX(-30px); } to { transform: translateX(30px); } }
@keyframes swim { from { transform: translate(-220px, var(--y)); } to { transform: translate(1820px, var(--y)); } }
@keyframes swim-l { from { transform: translate(1820px, var(--y)) scaleX(-1); } to { transform: translate(-220px, var(--y)) scaleX(-1); } }
.big-jar { position: absolute; left: 50%; bottom: 0; width: 300px; height: 250px; transform: translateX(-50%); }
.heap {
  position: absolute; left: 44px; right: 44px; bottom: 130px; height: 118px; z-index: 1; transform: scaleY(.05); transform-origin: 50% 100%;
  border-radius: 50% 50% 10px 10px / 100% 100% 10px 10px;
  background: radial-gradient(circle at 40% 40%, rgba(255, 255, 255, .85) 0 2px, transparent 3px) 0 0 / 20px 16px, radial-gradient(ellipse at 50% 100%, #fff3b0, #f2b845 50%, #c98a1b);
  box-shadow: 0 0 50px rgba(255, 211, 107, .65);
}
.bowl {
  position: absolute; left: 0; right: 0; bottom: 0; height: 140px; z-index: 2; display: grid; place-items: center;
  border-radius: 0 0 150px 150px / 0 0 120px 120px; background: linear-gradient(180deg, #c2402f, #6e1611);
  box-shadow: inset 0 18px 0 -2px #e9b048, inset 0 26px 0 -2px #8a2a1e, inset 0 30px 0 -2px #e9b048, inset 0 -14px 26px rgba(0, 0, 0, .35), 0 0 60px rgba(255, 170, 80, .3);
}
.bowl b { margin-top: 26px; padding: 2px 18px; border-radius: 6px; font: 900 30px/1.3 var(--serif); color: #6e1611; background: #e9b048; box-shadow: 0 3px 0 #8a5410; }
.rim { position: absolute; left: -14px; right: -14px; bottom: 122px; height: 30px; z-index: 3; border-radius: 50%; background: linear-gradient(180deg, #fff0a8, #d99a2a 60%, #8a5410); box-shadow: 0 4px 10px rgba(0, 0, 0, .3); }

/* 04 铸令坊 · 金殿藻井 */
#forge .stage { background: radial-gradient(ellipse at 50% 108%, rgba(255, 120, 40, .45), transparent 52%), linear-gradient(180deg, #0a1412, #16302a); }
.forge-b-bg { opacity: 0; background: radial-gradient(circle at 50% 52%, #b4481c, #5a160d 58%, #2a0906); }
.fret { position: absolute; left: 0; right: 0; height: 28px; opacity: .5; background-repeat: repeat-x; }
.fret.top { top: 14px; }
.fret.bottom { bottom: 14px; }
.embers i { position: absolute; bottom: -10px; border-radius: 50%; background: #ffb35c; box-shadow: 0 0 8px 2px rgba(255, 150, 60, .8); animation: ember linear infinite; }
@keyframes ember { 0% { transform: translate(0, 0); opacity: 0; } 10% { opacity: 1; } 100% { transform: translate(var(--dx), -95vh); opacity: 0; } }
.ding { position: absolute; left: 50%; top: 50%; z-index: -1; width: 150%; transform: translate(-50%, -42%); pointer-events: none; overflow: visible; }
.flames { transform-origin: 50% 100%; transform-box: fill-box; animation: flicker .5s ease-in-out infinite alternate; }
@keyframes flicker { from { transform: scaleY(.88); } to { transform: scaleY(1.1); } }

/* 05 宣纸 · 卷轴 · 远山 · 红梅 */
.rod { position: absolute; left: 0; right: 0; z-index: 4; height: 20px; background: linear-gradient(180deg, #6a3f26, #2e1a10 60%, #5a3420); box-shadow: 0 4px 10px rgba(60, 30, 10, .35); }
.rod.top { top: 0; }
.rod.bottom { bottom: 0; }
.rod::before, .rod::after { content: ''; position: absolute; top: -4px; width: 22px; height: 28px; border-radius: 6px; background: linear-gradient(180deg, #ffe08a, #b97a1c); }
.rod::before { left: -2px; }
.rod::after { right: -2px; }
.seal { position: absolute; right: 3vw; bottom: 7vh; z-index: 2; width: 58px; height: 58px; display: grid; place-items: center; text-align: center; border-radius: 6px; font: 900 15px/1.15 var(--serif); color: #fff3d6; background: #b8322a; opacity: .85; transform: rotate(-6deg); }

/* 06 凌烟阁内堂 · 画像卷轴 */
#heroes {
  overflow: hidden;
  background:
    repeating-linear-gradient(0deg, rgba(217, 162, 58, .06) 0 2px, transparent 2px 56px),
    repeating-linear-gradient(90deg, rgba(217, 162, 58, .06) 0 2px, transparent 2px 56px),
    radial-gradient(ellipse at 50% 0%, #4a1c12, #1f0c08 70%);
}
.plain > :not(.bg) { position: relative; z-index: 2; }
.pillar { position: absolute; top: 0; bottom: 0; width: clamp(18px, 3.2vw, 48px); background: repeating-linear-gradient(180deg, transparent 0 260px, #d9a23a 260px 274px), linear-gradient(90deg, #5e1410, #c2402f 45%, #e0604a 55%, #7a1a14); box-shadow: 0 0 30px rgba(0, 0, 0, .55); }
.pillar.left { left: 3vw; }
.pillar.right { right: 3vw; }
.plaque { display: inline-block; padding: 12px 44px; border: 6px solid #d9a23a; border-radius: 6px; outline: 3px solid #7a4a12; background: linear-gradient(180deg, #2a1810, #140a06); box-shadow: 0 14px 30px rgba(0, 0, 0, .5), inset 0 0 0 3px #5a3418; }
.plaque .mega { font-size: clamp(38px, 7vw, 96px); }
#heroes .wall { row-gap: 40px; }
#heroes .wall li::before { content: ''; position: absolute; top: -18px; left: 50%; width: 34px; height: 20px; margin-left: -17px; border: 2px solid #d9a23a; border-bottom: 0; border-radius: 17px 17px 0 0; }
#heroes .wall button { padding: 18px 8px 16px; border-radius: 4px; color: var(--ink); background: linear-gradient(180deg, #f6ead0, #ead7ad); box-shadow: 0 12px 22px rgba(0, 0, 0, .45); }
#heroes .wall button::before, #heroes .wall button::after { content: ''; position: absolute; left: -6px; right: -6px; height: 10px; border-radius: 5px; background: linear-gradient(180deg, #6a3f26, #2e1a10); }
#heroes .wall button::before { top: -5px; }
#heroes .wall button::after { bottom: -5px; }
#heroes .wall button:hover, #heroes .wall button:focus-visible { background: linear-gradient(180deg, #fff3da, #f1dfb8); }
#heroes .wall .name { color: var(--ink); }
#heroes .wall .no { color: var(--red-deep); font-weight: 800; }

/* 07 孔明灯 */
#cta { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; background: linear-gradient(180deg, #120d2a, #2b1a4a 55%, #5a2a48); }
.sky-lantern { position: absolute; bottom: -70px; width: 40px; height: 52px; border-radius: 45% 45% 22% 22%; background: radial-gradient(circle at 50% 72%, #fff3b0, #ffb347 45%, #d9502f 92%); box-shadow: 0 0 36px 12px rgba(255, 170, 80, .55), 0 0 90px 30px rgba(255, 140, 60, .18); opacity: 0; animation: lantern-rise linear infinite; }
.sky-lantern.launched { bottom: 26%; animation-iteration-count: 1; }
@keyframes lantern-rise { 0% { transform: translate(0, 0) scale(var(--s)); opacity: 0; } 8% { opacity: .95; } 50% { transform: translate(var(--sway), -60vh) scale(var(--s)); } 100% { transform: translate(0, -125vh) scale(calc(var(--s) * .6)); opacity: 0; } }
.skyline { position: absolute; left: 0; right: 0; bottom: 0; height: 18vh; }
.skyline svg { display: block; width: 100%; height: 100%; }
.foot { background: #0b0820; }

/* 盟主令 SVG */
.jade { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .3)); }

/* 屏幕震动 */
#app.shake .stage, #app.shake .cta { animation: shake .45s; }

/* ---------- 关键帧 ---------- */
@keyframes shimmer { to { background-position: -250% 0; } }
@keyframes swing { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes bob { 50% { transform: translateY(-8px); } }
@keyframes run { 0%, 100% { transform: translateX(-50%) translateY(0) rotate(-4deg); } 50% { transform: translateX(-50%) translateY(-12px) rotate(4deg); } }
@keyframes hop { 40% { transform: translateY(-26px) scale(1.1); } }
@keyframes gpop { 40% { transform: scale(1.12); } }
@keyframes stamp { from { transform: rotate(12deg) scale(3); opacity: 0; } }
@keyframes shake { 20% { transform: translate(-4px, 2px); } 45% { transform: translate(3px, -2px); } 70% { transform: translate(-1px, 1px); } }
@keyframes jump { 40% { transform: translateY(-22px) scale(1.08, .94); } 70% { transform: translateY(0) scale(.94, 1.06); } }
@keyframes breathe { 50% { box-shadow: 0 7px 0 var(--red-deep), 0 0 80px rgba(255, 120, 80, .85); } }

/* ---------- 平板 ---------- */
@media (min-width: 761px) and (max-width: 1100px) {
  .pool-hero { left: auto; right: -40px; bottom: 270px; width: 150px; }
}

/* 平板竖屏：熔炉两侧放不下，配方表挪到熔炉下方 */
@media (min-width: 761px) and (max-width: 1100px) and (min-aspect-ratio: 1/1.05) { .furnace { left: 36%; } .recipe-list { right: 4vw; } }
@media (min-width: 761px) and (max-width: 1100px) and (max-aspect-ratio: 1/1.05) {
  .furnace { top: 46%; }
  .recipe-list { left: 0; right: 0; top: auto; bottom: 13vh; transform: none; display: flex; justify-content: center; gap: 12px; }
  .recipe-list li { flex-direction: column; gap: 4px; padding: 10px 22px; }
}

/* ---------- 手机 ---------- */
@media (max-width: 760px) {
  .lanterns span:nth-child(n+3) { display: none; }
  .moon { width: 64px; height: 64px; top: 5vh; right: auto; left: 50%; margin-left: -32px; }
  .zoom { padding-bottom: 20vh; }
  .slot img { width: 17vw; }
  .slot.mid img { width: 25vw; }
  .hud-chapter { left: 14px; bottom: 12px; }
  .pillar { display: none; }
  .gate-hall { bottom: 12vh; height: 46vh; }
  .hud-chapter b { font-size: 22px; }
  .pool-steps { left: 0; right: 0; top: 23vh; transform: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 14px; }
  .pool-steps li { font-size: 15px; gap: 6px; }
  .pool-steps li b { width: 26px; height: 26px; font-size: 13px; }
  .pool-center { width: 300px; height: 58vh; bottom: 8vh; }
  .pool-hero { left: auto; right: -10px; width: 110px; bottom: 210px; }
  .pool-hero .say { left: auto; right: 30%; font-size: 13px; }
  .pool-hero .say::after { left: auto; right: 20%; }
  .furnace { top: 48%; width: 240px; height: 240px; }
  .gauge-in { width: 186px; height: 186px; }
  .gauge-in b { font-size: 68px; }
  .recipe-list { left: 0; right: 0; top: auto; bottom: 12vh; transform: none; display: flex; justify-content: center; gap: 8px; }
  .recipe-list li { flex-direction: column; gap: 2px; padding: 8px 10px; }
  .recipe-list li b { font-size: 18px; min-width: 0; }
  .recipe-list li span { font-size: 22px; }
  .forge-warn { bottom: 5vh; font-size: 13px; padding: 0 16px; }
  .scene-head h2 { font-size: clamp(28px, 8.6vw, 40px); }
  .tier-row { flex-wrap: nowrap; align-items: stretch; gap: 6px; padding: 0 8px; bottom: 2.5vh; }
  .tier-row .arr { display: none; }
  .tier-row li { flex: 1; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px; text-align: center; }
  .tier-row li .tk { width: 22px; }
  .tier-txt b { font-size: 12px; }
  .tier-txt small { font-size: 10.5px; line-height: 1.35; }
  .variants { flex-wrap: wrap; justify-content: center; }
  .variants i { width: 8px; }
  .sure-badge { top: 70%; }
  .invite { flex-direction: column; gap: 6px; top: 58%; }
  .inv-card { min-height: 0; }
  .inv-arrow { transform: rotate(90deg); }
}
/* 很矮的屏幕（手机横屏）：标题区收紧，熔炉和配方表左右分开 */
@media (max-height: 520px) {
  .scene-head { top: 3vh; }
  .scene-head h2 { font-size: 26px; }
  .scene-head p, .kicker { display: none; }
  .furnace { left: 34%; top: 58%; }
  .recipe-list { left: auto; right: 4vw; top: 58%; bottom: auto; transform: translateY(-50%); display: grid; gap: 6px; }
  .recipe-list li { flex-direction: row; padding: 4px 12px; }
  .forge-warn { bottom: 3vh; font-size: 12px; }
  .tier-row, .hud-chapter { display: none; }
  .sure-badge { top: 82%; font-size: 15px; padding: 6px 16px; }
  .pool-steps { top: 18vh; }
  .invite-note { bottom: 2vh; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
