/* 和巴菲特一起做决定 —— 明亮、通透的玻璃卡片 UI，叠加在 3D 场景之上 */
:root {
  --ink: #1b2a41;
  --ink-2: #3b4d66;
  --muted: #6a7a90;
  --line: rgba(27, 42, 65, .10);
  --glass: rgba(255, 255, 255, .80);
  --glass-strong: rgba(255, 255, 255, .92);
  --gold: #f2a91c;
  --gold-2: #ffd36b;
  --gold-3: #fff3cf;
  --coral: #ff7a59;
  --teal: #19a7a0;
  --sky: #4aa8ff;
  --navy: #23395d;
  --good: #1fa971;
  --mid: #e6a017;
  --bad: #8a97a8;
  --shadow: 0 24px 70px rgba(35, 57, 93, .20), 0 4px 14px rgba(35, 57, 93, .08);
  --radius: 22px;
  --panel-w: min(470px, 38vw);
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", "Songti SC", serif;
  --num: "Avenir Next", "Helvetica Neue", "DIN Alternate", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; overflow: hidden; color: var(--ink); font-family: var(--sans);
  background: linear-gradient(180deg, #8fd0ff 0%, #c9ecff 45%, #ffe8cc 100%);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
#stage { position: fixed; inset: 0; z-index: 0; }
#stage canvas { display: block; width: 100%; height: 100%; }
#vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 40%, rgba(255,255,255,0) 60%, rgba(255, 214, 170, .28) 100%);
}

/* ---------- 2D 兜底背景（无 WebGL） ---------- */
#fallback-bg { position: fixed; inset: 0; z-index: 0; display: none; overflow: hidden; }
body.no-webgl #fallback-bg { display: block; }
.fb-sun { position: absolute; width: 46vmax; height: 46vmax; left: 52%; top: -12vmax; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,246,210,1) 0%, rgba(255,214,140,.7) 30%, rgba(255,214,140,0) 70%); }
.fb-cloud { position: absolute; height: 18vmin; border-radius: 999px; background: #fff; opacity: .9; filter: blur(2px);
  box-shadow: 8vmin -6vmin 0 2vmin #fff, 18vmin 0 0 0 #fff; animation: drift 40s linear infinite; }
.fb-cloud.c1 { width: 30vmin; top: 62%; left: -20%; }
.fb-cloud.c2 { width: 22vmin; top: 74%; left: 30%; animation-duration: 55s; }
.fb-cloud.c3 { width: 26vmin; top: 56%; left: 70%; animation-duration: 65s; }
@keyframes drift { from { transform: translateX(-10vw); } to { transform: translateX(110vw); } }

/* ---------- 加载 ---------- */
#loader { position: fixed; inset: 0; z-index: 50; display: grid; place-content: center; justify-items: center; gap: 14px;
  background: linear-gradient(180deg, #a9dcff, #fff1dc); transition: opacity .8s ease, visibility .8s; color: var(--ink-2); }
#loader p { margin: 0; letter-spacing: .1em; font-size: 14px; }
.loader-ring { width: 54px; height: 54px; border-radius: 50%; border: 4px solid rgba(255,255,255,.6); border-top-color: var(--gold);
  animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
body:not(.state-loading) #loader { opacity: 0; visibility: hidden; }

/* ---------- HUD ---------- */
#hud { position: fixed; z-index: 20; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 16px;
  padding: max(14px, env(safe-area-inset-top)) clamp(14px, 2.4vw, 32px) 10px; pointer-events: none;
  opacity: 0; transform: translateY(-10px); transition: opacity .6s, transform .6s; }
body.state-play #hud, body.state-ending #hud { opacity: 1; transform: none; }
#hud > * { pointer-events: auto; }
.hud-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .04em; color: var(--navy);
  background: var(--glass); padding: 8px 14px 8px 10px; border-radius: 999px; box-shadow: 0 6px 20px rgba(35,57,93,.12);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4); font-size: 14px; }
.hud-mark { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6d6, #ffc94a 45%, #f29f05); box-shadow: 0 0 12px rgba(255, 190, 60, .8); }
#progress { list-style: none; display: flex; gap: 6px; margin: 0 auto; padding: 8px 12px; border-radius: 999px; background: var(--glass);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 6px 20px rgba(35,57,93,.10); }
#progress li { width: 30px; height: 26px; border-radius: 9px; display: grid; place-items: center; font: 600 10px/1 var(--num);
  color: var(--muted); background: rgba(27,42,65,.06); transition: all .4s; }
#progress li.cur { background: var(--navy); color: #fff; transform: translateY(-1px) scale(1.08); box-shadow: 0 4px 12px rgba(35,57,93,.35); }
#progress li.m100 { background: linear-gradient(135deg, #ffe08a, #f2a91c); color: #5a3a00; }
#progress li.m50 { background: #ffe9b8; color: #7a5600; }
#progress li.m0 { background: #e3e9f1; color: #6a7a90; }
.hud-right { display: flex; align-items: center; gap: 10px; }
#hud-score { display: flex; align-items: center; gap: 8px; background: var(--glass); padding: 6px 14px 6px 8px; border-radius: 999px;
  box-shadow: 0 6px 20px rgba(35,57,93,.12); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
#hud-score svg { width: 34px; height: 34px; transform: rotate(-90deg); }
#hud-score .ring-bg { fill: none; stroke: rgba(27,42,65,.10); stroke-width: 4; }
#hud-score .ring-fg { fill: none; stroke: var(--gold); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 97.4; stroke-dashoffset: 97.4; transition: stroke-dashoffset .9s cubic-bezier(.2,.8,.2,1); }
#hud-score small { display: block; font-size: 10px; color: var(--muted); letter-spacing: .1em; }
#hud-score b { font: 700 18px/1.05 var(--num); color: var(--navy); }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; color: var(--navy);
  background: var(--glass); box-shadow: 0 6px 20px rgba(35,57,93,.12); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.icon-btn svg { width: 20px; height: 20px; fill: currentColor; }
.icon-btn .ico-off { display: none; }
body.muted .icon-btn .ico-on { display: none; }
body.muted .icon-btn .ico-off { display: block; }

/* ---------- 通用按钮 ---------- */
.btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; cursor: pointer;
  padding: 15px 30px; border-radius: 999px; font-weight: 700; font-size: 17px; letter-spacing: .08em; color: #4a2c00;
  background: linear-gradient(135deg, #ffe08a 0%, #ffc23d 45%, #f29f05 100%);
  box-shadow: 0 12px 30px rgba(242, 159, 5, .45), inset 0 1px 0 rgba(255,255,255,.7);
  transition: transform .2s, box-shadow .2s, filter .2s; }
.btn-primary svg { width: 20px; height: 20px; }
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(242, 159, 5, .55), inset 0 1px 0 rgba(255,255,255,.7); }
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { filter: grayscale(.6) opacity(.6); cursor: progress; }
.btn-primary.wide { width: 100%; margin-top: 18px; }
.btn-ghost { display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(35,57,93,.18); background: rgba(255,255,255,.6);
  color: var(--navy); padding: 10px 18px; border-radius: 999px; cursor: pointer; font-weight: 600; transition: background .2s, transform .2s; }
.btn-ghost:hover:not(:disabled) { background: #fff; transform: translateY(-1px); }
.btn-ghost:disabled { opacity: .45; cursor: default; }
.btn-ghost svg { width: 18px; height: 18px; }
:focus-visible { outline: 3px solid rgba(74, 168, 255, .8); outline-offset: 3px; }

/* ---------- 开场 ---------- */
.screen { position: fixed; inset: 0; z-index: 10; display: none; }
body.state-intro #intro { display: flex; }
#intro { align-items: center; padding: 0 clamp(18px, 7vw, 120px); }
.intro-card { max-width: 640px; animation: rise 1.1s cubic-bezier(.2,.8,.2,1) both; }
.eyebrow { margin: 0 0 10px; font-size: 13px; letter-spacing: .32em; color: #8a5a00; font-weight: 700; }
#intro h1 { margin: 0; font-weight: 900; line-height: 1.04; font-size: clamp(44px, 7.2vw, 104px); letter-spacing: .02em;
  color: var(--navy); text-shadow: 0 6px 30px rgba(255,255,255,.65); }
#intro h1 span { display: block; }
#intro h1 span:last-child { background: linear-gradient(100deg, #f29f05 0%, #ff7a59 55%, #e8577e 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 22px rgba(255, 160, 80, .35)); }
.lead { font-size: clamp(16px, 1.45vw, 21px); line-height: 1.75; color: var(--ink-2); max-width: 560px; margin: 22px 0 26px;
  text-shadow: 0 1px 12px rgba(255,255,255,.9); }
.intro-points { list-style: none; display: flex; gap: 12px; padding: 0; margin: 0 0 30px; flex-wrap: wrap; }
.intro-points li { background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: 16px; padding: 12px 18px;
  box-shadow: 0 8px 24px rgba(35,57,93,.10); display: flex; align-items: baseline; gap: 8px; }
.intro-points b { font: 800 28px/1 var(--num); color: var(--gold); }
.intro-points span { font-size: 14px; color: var(--ink-2); }
.fine { margin: 16px 0 0; font-size: 12.5px; color: var(--muted); letter-spacing: .04em; }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }

/* ---------- 年份转场 ---------- */
#yearcard { position: fixed; inset: 0; z-index: 15; display: grid; place-content: center; text-align: center; pointer-events: none; opacity: 0; }
#yearcard.show { animation: yc 2.1s cubic-bezier(.2,.8,.2,1) both; }
.yc-year { font: 900 clamp(90px, 16vw, 230px)/1 var(--num); letter-spacing: .02em;
  background: linear-gradient(180deg, #ffffff 10%, #ffe7a3 55%, #f5a623 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 10px 40px rgba(242, 159, 5, .45)); }
.yc-title { margin-top: 6px; font-size: clamp(18px, 2.2vw, 30px); font-weight: 800; color: var(--navy); letter-spacing: .3em; text-shadow: 0 2px 18px rgba(255,255,255,.95); }
@keyframes yc { 0% { opacity: 0; transform: scale(1.18); letter-spacing: .3em; } 18% { opacity: 1; transform: scale(1); } 72% { opacity: 1; transform: scale(.98); } 100% { opacity: 0; transform: scale(.92); } }

/* ---------- 题目面板 ---------- */
.panel { position: fixed; z-index: 12; top: 84px; right: clamp(12px, 2vw, 30px); bottom: 22px; width: var(--panel-w);
  background: var(--glass); border: 1px solid rgba(255,255,255,.85); border-radius: var(--radius); box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(1.5); -webkit-backdrop-filter: blur(22px) saturate(1.5);
  transform: translateX(calc(100% + 40px)); opacity: 0; transition: transform .75s cubic-bezier(.2,.8,.2,1), opacity .5s; display: flex; }
.panel.show { transform: none; opacity: 1; }
.panel-scroll { overflow-y: auto; padding: 26px 26px 28px; width: 100%; scroll-behavior: smooth; overscroll-behavior: contain; }
.panel-scroll::-webkit-scrollbar { width: 6px; }
.panel-scroll::-webkit-scrollbar-thumb { background: rgba(35,57,93,.18); border-radius: 6px; }
.q-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.q-year { font: 900 64px/0.9 var(--num); letter-spacing: -.01em; background: linear-gradient(180deg, #ffcc4d, #f08c00); -webkit-background-clip: text; background-clip: text; color: transparent; }
.q-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; padding-bottom: 6px; }
.q-no { font: 700 12px/1 var(--num); color: var(--muted); letter-spacing: .2em; }
.q-dim { font-size: 12px; font-weight: 700; color: var(--teal); background: rgba(25,167,160,.12); padding: 5px 10px; border-radius: 999px; }
.q-title { margin: 14px 0 4px; font-size: 25px; line-height: 1.3; color: var(--navy); font-weight: 800; }
.q-place { margin: 0 0 12px; font-size: 13px; color: var(--muted); letter-spacing: .06em; }
.q-situation { font-size: 15.5px; line-height: 1.85; color: var(--ink-2); margin: 0 0 14px; }
.q-ask { font-size: 16.5px; font-weight: 800; color: var(--ink); margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.q-ask::before { content: ""; width: 6px; height: 20px; border-radius: 3px; background: linear-gradient(180deg, var(--gold-2), var(--coral)); }
.options { display: grid; gap: 10px; }
.opt { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; text-align: left; width: 100%;
  padding: 14px 14px 14px 12px; border-radius: 16px; border: 1.5px solid rgba(35,57,93,.10); background: rgba(255,255,255,.72);
  cursor: pointer; transition: transform .22s, box-shadow .22s, border-color .22s, background .22s, opacity .3s; font-size: 15px; line-height: 1.6; }
.opt:hover:not(:disabled) { transform: translateY(-2px); border-color: rgba(242, 169, 28, .65); box-shadow: 0 10px 26px rgba(242,169,28,.20); background: #fff; }
.opt .k { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font: 800 15px/1 var(--num); color: var(--navy);
  background: linear-gradient(180deg, #f3f6fb, #e4ebf5); box-shadow: inset 0 -2px 0 rgba(35,57,93,.08); }
.opt .t { padding-top: 5px; color: var(--ink); }
.opt .fb { grid-column: 2; display: none; font-size: 13px; line-height: 1.65; color: var(--muted); margin-top: 2px; }
.opt .tag { position: absolute; top: -10px; right: 12px; font-size: 11.5px; font-weight: 800; padding: 4px 10px; border-radius: 999px; display: none; letter-spacing: .06em; }
.opt:disabled { cursor: default; }
.options.locked .opt:not(.picked) { opacity: .55; }
.opt.picked { border-color: var(--navy); background: #fff; box-shadow: 0 10px 26px rgba(35,57,93,.18); }
.opt.picked .k { background: var(--navy); color: #fff; }
.opt.picked.suspense { animation: pulse 0.7s ease-in-out infinite alternate; }
@keyframes pulse { from { box-shadow: 0 0 0 0 rgba(35,57,93,.25); } to { box-shadow: 0 0 0 10px rgba(35,57,93,0); } }
.options.revealed .opt { opacity: 1; }
.options.revealed .opt .fb { display: block; }
.opt.buffett { border-color: #f2a91c; background: linear-gradient(135deg, #fff9e6, #fff2cc); box-shadow: 0 12px 30px rgba(242,169,28,.28); }
.opt.buffett .k { background: linear-gradient(135deg, #ffe08a, #f29f05); color: #4a2c00; }
.opt.buffett .tag.tb { display: inline-block; background: linear-gradient(135deg, #ffe08a, #f29f05); color: #4a2c00; box-shadow: 0 4px 12px rgba(242,159,5,.4); }
.opt.picked .tag.ty { display: inline-block; background: var(--navy); color: #fff; }
.opt.picked.buffett .tag.ty { right: 98px; }
.opt.stamp { animation: stamp .55s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes stamp { from { transform: scale(.96); } 60% { transform: scale(1.025); } to { transform: none; } }
.q-tools { margin-top: 14px; }
.btn-ghost em { font-style: normal; font: 700 12px/1 var(--num); background: rgba(35,57,93,.08); padding: 3px 7px; border-radius: 999px; }
.hint-text { margin: 10px 0 0; padding: 12px 14px; border-radius: 14px; background: #fff7df; color: #7a5600; font-size: 14px; line-height: 1.7; border: 1px dashed rgba(242,169,28,.6); }

/* ---------- 揭晓 ---------- */
.reveal { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 16px; animation: rise .7s cubic-bezier(.2,.8,.2,1) both; }
.reveal h3 { margin: 18px 0 8px; font-size: 14px; letter-spacing: .18em; color: var(--muted); font-weight: 800; }
.verdict { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; }
.verdict.v100 { background: linear-gradient(135deg, #fff4cc, #ffe39a); color: #5a3a00; }
.verdict.v50 { background: #fff1d6; color: #7a5600; }
.verdict.v0 { background: #eef2f7; color: #3b4d66; }
.verdict .pts { font: 900 30px/1 var(--num); min-width: 74px; }
.verdict .vt b { display: block; font-size: 16px; }
.verdict .vt span { font-size: 13px; opacity: .85; }
.why, .after { font-size: 15px; line-height: 1.85; color: var(--ink-2); margin: 0; }
.quotes { display: grid; gap: 12px; margin-top: 16px; }
.quote { position: relative; padding: 16px 18px 14px 20px; border-radius: 16px; background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(246, 250, 255, .9));
  border: 1px solid rgba(35,57,93,.08); box-shadow: 0 8px 22px rgba(35,57,93,.08); }
.quote::before { content: "“"; position: absolute; left: 10px; top: -6px; font: 700 54px/1 var(--serif); color: rgba(242,169,28,.55); }
.quote .en { font-family: var(--serif); font-style: italic; font-size: 16px; line-height: 1.65; color: var(--navy); margin: 6px 0 8px; }
.quote .zh { font-size: 14px; line-height: 1.75; color: var(--ink-2); margin: 0; }
.quote .src { margin: 8px 0 0; font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.quote .src b { color: #b36b00; }

/* ---------- 结算 ---------- */
body.state-ending #ending { display: block; }
#ending { overflow-y: auto; padding: 96px clamp(14px, 4vw, 60px) 40px; }
.end-wrap { max-width: 1240px; margin: 0 auto; animation: rise 1s cubic-bezier(.2,.8,.2,1) both; }
.end-hero { display: grid; grid-template-columns: 260px 1fr; gap: 34px; align-items: center; background: var(--glass); border-radius: 28px; padding: 28px 34px;
  box-shadow: var(--shadow); backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4); border: 1px solid rgba(255,255,255,.85); }
.gauge { position: relative; width: 240px; height: 240px; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.g-bg { fill: none; stroke: rgba(35,57,93,.08); stroke-width: 16; }
.g-fg { fill: none; stroke: url(#gg); stroke-width: 16; stroke-linecap: round; stroke-dasharray: 540.35; stroke-dashoffset: 540.35; transition: stroke-dashoffset 2.2s cubic-bezier(.2,.8,.2,1); }
.g-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.g-center b { font: 900 72px/1 var(--num); color: var(--navy); }
.g-center span { font-size: 14px; color: var(--muted); letter-spacing: .1em; }
.end-text h2 { margin: 4px 0 10px; font-size: clamp(30px, 3.4vw, 48px); font-weight: 900; color: var(--navy);
  background: linear-gradient(100deg, #f29f05, #ff7a59 60%, #e8577e); -webkit-background-clip: text; background-clip: text; color: transparent; }
.end-text p { font-size: 16px; line-height: 1.8; color: var(--ink-2); margin: 0; }
.end-actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }
.end-grid { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 18px; margin-top: 18px; }
.end-box { background: var(--glass); border-radius: 24px; padding: 22px 22px 18px; box-shadow: var(--shadow); border: 1px solid rgba(255,255,255,.85);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); }
.end-box h3 { margin: 0 0 12px; font-size: 16px; color: var(--navy); letter-spacing: .08em; }
.end-box h3 small { font-weight: 600; color: var(--muted); font-size: 12px; letter-spacing: 0; }
#radar { width: 100%; height: auto; display: block; }
.dim-list { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 6px; }
.dim-list li { display: grid; grid-template-columns: 1fr auto; font-size: 13.5px; color: var(--ink-2); }
.dim-list b { font-family: var(--num); color: var(--navy); }
.recap { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.recap li { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; padding: 9px 12px; border-radius: 13px; background: rgba(255,255,255,.7); font-size: 13.5px; }
.recap .ry { font: 800 15px/1 var(--num); color: #c47a00; }
.recap .rt { color: var(--ink); line-height: 1.4; }
.recap .rt small { display: block; color: var(--muted); font-size: 12px; }
.recap .rp { font: 800 14px/1 var(--num); padding: 6px 9px; border-radius: 999px; }
.recap .rp.p100 { background: linear-gradient(135deg, #ffe08a, #f2a91c); color: #4a2c00; }
.recap .rp.p50 { background: #ffeec7; color: #7a5600; }
.recap .rp.p0 { background: #e9eef5; color: #6a7a90; }
.ledger .ledger-lead { margin: 0 0 12px; font-size: 13.5px; line-height: 1.7; color: var(--ink-2); }
#ledger { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
#ledger li { padding: 11px 14px; border-radius: 14px; background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(240,247,255,.85)); display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 10px; }
#ledger .lk { font-size: 13px; color: var(--ink-2); }
#ledger .lv { font: 800 18px/1.1 var(--num); color: var(--navy); text-align: right; }
#ledger .ld { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted); }
.ledger-note { font-size: 11.5px; line-height: 1.6; color: var(--muted); margin: 12px 0 0; }
.end-foot { text-align: center; font-size: 12.5px; color: var(--ink-2); margin: 22px auto 0; max-width: 900px; line-height: 1.7;
  background: rgba(255,255,255,.55); padding: 10px 16px; border-radius: 14px; }

#toast { position: fixed; z-index: 60; left: 50%; bottom: 28px; transform: translate(-50%, 30px); opacity: 0; background: rgba(27,42,65,.92); color: #fff;
  padding: 10px 18px; border-radius: 999px; font-size: 14px; transition: all .4s; pointer-events: none; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.noscript { position: fixed; inset: 0; display: grid; place-content: center; font-size: 18px; background: #fff; z-index: 100; }

/* ---------- 平板与手机 ---------- */
@media (max-width: 1100px) {
  .end-grid { grid-template-columns: 1fr 1fr; }
  .end-box.ledger { grid-column: 1 / -1; }
}
@media (max-width: 820px), (pointer: coarse) and (max-width: 1024px) {
  :root { --radius: 22px; }
  .hud-title { display: none; }
  .hud-brand { padding: 8px; }
  #hud { gap: 8px; padding-left: 10px; padding-right: 10px; }
  #progress { gap: 3px; padding: 6px 8px; flex: 1 1 auto; min-width: 0; justify-content: center; }
  #progress li { flex: 0 1 14px; min-width: 6px; height: 14px; border-radius: 4px; font-size: 0; }
  #hud-score { padding: 4px 10px 4px 6px; }
  #hud-score svg { width: 28px; height: 28px; }
  #hud-score b { font-size: 15px; }
  .icon-btn { width: 38px; height: 38px; }
  .panel { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; height: 60vh; height: 60dvh; transform: translateY(calc(100% + 30px)); border-radius: 22px 22px 18px 18px; }
  .panel::before { content: ""; position: absolute; top: 8px; left: 50%; width: 44px; height: 5px; margin-left: -22px; border-radius: 3px; background: rgba(35,57,93,.18); }
  .panel-scroll { padding: 22px 16px 20px; }
  .q-year { font-size: 46px; }
  .q-title { font-size: 21px; }
  .q-situation { font-size: 14.5px; line-height: 1.75; }
  .opt { font-size: 14.5px; padding: 12px 12px 12px 10px; }
  #intro { align-items: flex-end; padding: 0 18px calc(26px + env(safe-area-inset-bottom)); }
  .intro-card { background: rgba(255,255,255,.62); padding: 20px 18px; border-radius: 24px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--shadow); }
  .lead { margin: 14px 0 16px; }
  .intro-points { margin-bottom: 18px; gap: 8px; }
  .intro-points li { padding: 9px 12px; }
  .intro-points b { font-size: 22px; }
  .btn-primary { width: 100%; }
  #ending { padding: 76px 10px 24px; }
  .end-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 22px 18px; }
  .end-actions { justify-content: center; }
  .gauge { width: 190px; height: 190px; }
  .g-center b { font-size: 56px; }
  .end-grid { grid-template-columns: 1fr; }
}
@media (max-width: 430px) {
  .hud-brand { display: none; }
  #hud-score small { display: none; }
}
/* 横屏手机：面板放右侧，避免底部抽屉挤占画面 */
@media (pointer: coarse) and (orientation: landscape) and (max-height: 540px) {
  #hud { padding-top: 8px; }
  .panel { top: 58px; bottom: 8px; left: auto; right: 8px; width: min(430px, 50vw); height: auto; transform: translateX(calc(100% + 30px)); border-radius: 20px; }
  .panel::before { display: none; }
  .panel.show { transform: none; }
  #intro { align-items: center; padding: 0 20px; }
  .intro-card { max-width: 56vw; padding: 14px 18px; }
  #intro h1 { font-size: 34px; }
  .lead { font-size: 14px; margin: 8px 0 10px; }
  .intro-points { display: none; }
  .btn-primary { width: auto; padding: 11px 24px; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
