:root {
  --bg: #efebe5;
  --ink: #1d1a17;
  --ink-2: #5d5650;
  --ink-3: #9a928a;
  --line: rgba(29, 26, 23, 0.12);
  --panel: rgba(255, 253, 250, 0.72);
  --accent: #ff8a1f;
  --red: #c92d3c;
  --blue: #3f5fc0;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--sans); overflow: hidden; }
#viewport { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 45%, #faf8f5 0%, #efebe5 55%, #e6e0d8 100%); }
#stage { position: absolute; left: 0; top: 0; width: 1600px; height: 900px; transform-origin: 0 0; user-select: none; }
#gl { position: absolute; inset: 0; width: 1600px; height: 900px; display: block; cursor: grab; }
#gl:active { cursor: grabbing; }
#leaders { position: absolute; inset: 0; pointer-events: none; }
#labels { position: absolute; inset: 0; pointer-events: none; }
.label { position: absolute; font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; transform: translate(-50%, -50%);
  background: rgba(255, 253, 250, 0.86); padding: 3px 8px; border-radius: 4px; border: 1px solid var(--line); transition: opacity .3s; }
.label small { font-weight: 400; color: var(--ink-2); margin-left: 4px; font-family: var(--mono); font-size: 12px; }

section { position: absolute; }
#left { left: 36px; top: 30px; width: 364px; bottom: 30px; display: flex; flex-direction: column; pointer-events: none; }
#left > * { pointer-events: auto; }
.kicker { font-family: var(--mono); font-size: 11px; letter-spacing: .16em; color: var(--ink-3); }
h1 { margin: 6px 0 0; font-size: 34px; font-weight: 700; letter-spacing: .02em; }
.hero-num { margin-top: 12px; font-family: var(--mono); font-size: 84px; line-height: .95; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.hero-num small { font-size: 18px; margin-left: 8px; color: var(--ink-2); letter-spacing: 0; font-weight: 500; }
.hero-label { font-size: 14px; color: var(--ink-2); margin-top: 4px; }
.stats { margin-top: 18px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; }
.stat { border-top: 1px solid var(--line); padding-top: 6px; }
.stat .k { font-size: 12px; color: var(--ink-2); }
.stat .v { font-family: var(--mono); font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 2px; }
.stat .v small { font-size: 12px; font-weight: 400; color: var(--ink-2); margin-left: 3px; }
.stat.live .k::after { content: "实时"; margin-left: 6px; font-size: 10px; color: var(--accent); border: 1px solid currentColor; border-radius: 3px; padding: 0 3px; }

.phase-block { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--ink); }
.phase-name { font-size: 26px; font-weight: 700; }
.phase-note { font-size: 14px; color: var(--ink-2); margin: 4px 0 10px; min-height: 20px; }
#phaseBar { width: 364px; height: 34px; display: block; }

.break { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.preset-note { font-size: 13px; color: var(--ink-2); line-height: 1.5; margin-top: 8px; min-height: 40px; }
.slider { display: grid; grid-template-columns: 52px 1fr 64px; align-items: center; gap: 10px; margin-top: 8px; font-size: 13px; color: var(--ink-2); }
.slider b { font-family: var(--mono); font-weight: 600; color: var(--ink); text-align: right; font-size: 13px; }
input[type=range] { -webkit-appearance: none; appearance: none; height: 3px; background: var(--ink); border-radius: 2px; outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); cursor: pointer; }

#right { right: 36px; top: 30px; width: 388px; display: flex; flex-direction: column; gap: 12px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 0 4px; backdrop-filter: blur(6px); }
.panel-title { font-size: 13px; font-weight: 700; padding: 0 12px 4px; }
.panel-title span { font-weight: 400; color: var(--ink-3); margin-left: 6px; font-size: 12px; }
.panel canvas { display: block; width: 388px; }

#bottom { left: 420px; right: 440px; bottom: 26px; display: flex; flex-wrap: wrap; gap: 10px 18px; justify-content: center; }
.group-label { font-size: 11px; color: var(--ink-3); letter-spacing: .1em; margin-bottom: 5px; }
.btns { display: flex; flex-wrap: wrap; gap: 4px; }
button { font-family: var(--sans); font-size: 13px; color: var(--ink); background: rgba(255, 253, 250, 0.8); border: 1px solid var(--line);
  border-radius: 5px; padding: 6px 10px; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
button:hover { border-color: var(--ink-3); }
button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
button.pressed { transform: scale(0.94); }

#tourTag { position: absolute; left: 50%; top: 26px; transform: translateX(-50%); font-size: 12px; color: var(--ink-2); background: rgba(255,253,250,.8);
  border: 1px solid var(--line); border-radius: 20px; padding: 4px 12px; transition: opacity .4s; }
#cursor { position: absolute; left: 0; top: 0; pointer-events: none; transition: opacity .4s; z-index: 20; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
#cursor.click::after { content: ""; position: absolute; left: -10px; top: -10px; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--accent); animation: ripple .5s ease-out forwards; }
@keyframes ripple { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }
.hidden { opacity: 0 !important; }
#credit { position: absolute; left: 420px; right: 440px; bottom: 6px; text-align: center; font-size: 10px; color: var(--ink-3); }
#loading { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 14px; color: var(--ink-2); }
.versions { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; font-size: 12px; }
.versions a { color: var(--ink-3); text-decoration: none; border-bottom: 1px solid transparent; }
.versions a:hover { color: var(--ink); }
.versions a.on { color: var(--ink); border-bottom-color: var(--accent); }
