:root {
  --bg: #08080a;
  --panel: rgba(22, 22, 26, 0.82);
  --line: rgba(255, 255, 255, 0.08);
  --text: #f5f5f7;
  --muted: #9a9aa2;
  --accent: #e8c88a;
  --blue: #2997ff;
  --radius: 16px;
  font-family: -apple-system, "SF Pro Text", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }

/* 顶栏 */
.top { height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; border-bottom: 1px solid var(--line); background: linear-gradient(#111114, #0b0b0d); }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 26px; height: 26px; color: #f5f5f7; }
.brand h1 { margin: 0; font-size: 18px; font-weight: 600; letter-spacing: 0.5px; }
.brand p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.modes { display: flex; gap: 8px; }
.modes button { background: rgba(255,255,255,0.06); border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-size: 13px; transition: .2s; }
.modes button.on { background: var(--text); color: #000; }
.modes button.ghost { width: 36px; padding: 8px 0; }

.layout { display: grid; grid-template-columns: 220px 1fr 400px; height: calc(100% - 64px); }

/* 时间轴 */
.timeline { overflow-y: auto; padding: 14px 10px 30px; border-right: 1px solid var(--line); background: #0c0c0e; }
.timeline::-webkit-scrollbar, .info::-webkit-scrollbar { width: 6px; }
.timeline::-webkit-scrollbar-thumb, .info::-webkit-scrollbar-thumb { background: #2a2a2e; border-radius: 3px; }
.tl-year { font-size: 11px; color: var(--muted); margin: 14px 10px 6px; letter-spacing: 1px; display: flex; align-items: center; gap: 8px; }
.tl-year::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.tl-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 10px; transition: background .15s; }
.tl-item:hover { background: rgba(255,255,255,0.05); }
.tl-item.on { background: rgba(255,255,255,0.1); }
.tl-item .sil { width: 16px; height: 28px; border-radius: 4px; flex: none; position: relative; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.2); }
.tl-item .sil::after { content: ''; position: absolute; inset: 3px 2px; border-radius: 2px; background: #000; }
.tl-item .nm { font-size: 13px; }
.tl-item .sub { font-size: 11px; color: var(--muted); }

/* 舞台 */
.stage { position: relative; overflow: hidden; background: radial-gradient(ellipse at 50% 38%, #26262c 0%, #121215 45%, #070708 100%); }
.stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.stage-glow { position: absolute; left: 50%; top: -20%; width: 70%; height: 90%; transform: translateX(-50%); background: radial-gradient(ellipse at 50% 0%, rgba(255,245,220,0.10), transparent 65%); pointer-events: none; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 14px; pointer-events: none; transition: opacity .6s; }
.toast { position: absolute; top: 16px; left: 50%; transform: translate(-50%, -10px); background: rgba(30,30,34,0.9); border: 1px solid var(--line); padding: 9px 16px; border-radius: 999px; font-size: 13px; opacity: 0; transition: .3s; pointer-events: none; white-space: nowrap; backdrop-filter: blur(10px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.tip { position: absolute; pointer-events: none; background: rgba(0,0,0,0.8); padding: 4px 9px; border-radius: 6px; font-size: 12px; opacity: 0; transition: opacity .15s; white-space: nowrap; }
.tip.show { opacity: 1; }

.views { position: absolute; top: 16px; right: 16px; display: flex; flex-direction: column; gap: 6px; }
.views button, .lineup-bar button { background: rgba(30,30,34,0.75); border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; font-size: 12px; backdrop-filter: blur(8px); transition: .2s; }
.views button:hover, .lineup-bar button:hover { background: rgba(60,60,66,0.85); }
.views button.on { border-color: var(--accent); color: var(--accent); }

.controls { position: absolute; left: 50%; bottom: 18px; width: max-content; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; background: rgba(24,24,28,0.82); border: 1px solid var(--line); border-radius: 20px; padding: 10px 14px; backdrop-filter: blur(14px); max-width: calc(100% - 24px); }
.state { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); min-width: 92px; }
.state i { width: 8px; height: 8px; border-radius: 50%; background: #555; box-shadow: 0 0 0 3px rgba(85,85,85,0.25); transition: .3s; }
.state i.on { background: #30d158; box-shadow: 0 0 0 3px rgba(48,209,88,0.25), 0 0 10px #30d158; }
.btns { display: flex; gap: 6px; flex-wrap: wrap; }
.btns button { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 54px; background: rgba(255,255,255,0.06); border: 1px solid var(--line); border-radius: 12px; padding: 6px 8px; font-size: 11px; transition: .15s; user-select: none; }
.btns button b { font-size: 16px; line-height: 18px; font-weight: 500; }
.btns button:hover { background: rgba(255,255,255,0.12); }
.btns button:active, .btns button.down { transform: scale(0.94); background: rgba(255,255,255,0.18); }
.btns button[hidden] { display: none; }

.labels { position: absolute; inset: 0; pointer-events: none; }
.lbl { position: absolute; transform: translate(-50%, -100%); text-align: center; font-size: 12px; white-space: nowrap; padding-bottom: 8px; transition: color .2s; }
.lbl b { display: block; font-weight: 600; font-size: 13px; }
.lbl span { color: var(--muted); font-size: 11px; }
.lbl.hover b { color: var(--accent); }
.lineup-bar { position: absolute; left: 50%; bottom: 18px; width: max-content; transform: translateX(-50%); display: none; align-items: center; gap: 14px; background: rgba(24,24,28,0.82); border: 1px solid var(--line); border-radius: 16px; padding: 10px 16px; font-size: 12px; color: var(--muted); backdrop-filter: blur(14px); white-space: nowrap; }
.lineup-bar input { width: 240px; accent-color: var(--accent); }
body.lineup .lineup-bar { display: flex; }
body.lineup .controls, body.lineup .views { display: none; }

/* 信息面板 */
.info { overflow-y: auto; border-left: 1px solid var(--line); background: #0c0c0e; padding: 26px 26px 60px; }
.info.fade { animation: fade .45s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.i-year { font-size: 12px; letter-spacing: 3px; color: var(--accent); }
.info h2 { font-size: 34px; margin: 6px 0 4px; font-weight: 700; letter-spacing: -0.5px; }
.tagline { color: #d0d0d6; font-size: 15px; margin: 0 0 18px; }
.colors { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 6px; }
.sw { width: 26px; height: 26px; border-radius: 50%; border: 0; padding: 0; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25), 0 0 0 2px transparent; transition: .2s; }
.sw.on { box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25), 0 0 0 2px #0c0c0e, 0 0 0 4px var(--text); }
.cname { font-size: 12px; color: var(--muted); margin-bottom: 20px; min-height: 16px; }
.intro p { line-height: 1.85; font-size: 14px; color: #d8d8de; margin: 0 0 12px; }
.hl { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 18px 0 24px; list-style: none; }
.hl li { font-size: 12px; padding: 6px 11px; border-radius: 999px; background: rgba(232,200,138,0.1); color: var(--accent); border: 1px solid rgba(232,200,138,0.25); }
.sec { font-size: 12px; letter-spacing: 2px; color: var(--muted); margin: 26px 0 10px; }
.specs { width: 100%; border-collapse: collapse; font-size: 13px; }
.specs td { padding: 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.specs td:first-child { color: var(--muted); width: 88px; white-space: nowrap; }
.sizecmp { background: rgba(255,255,255,0.03); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.sizecmp svg { width: 100%; height: auto; display: block; }
.sizecmp p { margin: 8px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
.nav2 { display: flex; justify-content: space-between; margin-top: 26px; gap: 10px; }
.nav2 button { flex: 1; background: rgba(255,255,255,0.05); border: 1px solid var(--line); border-radius: 12px; padding: 10px; font-size: 13px; text-align: left; }
.nav2 button:last-child { text-align: right; }
.nav2 button small { display: block; color: var(--muted); font-size: 11px; }
.nav2 button:disabled { opacity: .3; cursor: default; }
.src { font-size: 11px; color: #6a6a72; margin-top: 22px; line-height: 1.7; }

/* 帮助 */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: grid; place-items: center; z-index: 10; backdrop-filter: blur(6px); padding: 16px; }
.modal[hidden] { display: none; }
.card { background: #18181c; border: 1px solid var(--line); border-radius: 20px; max-width: 560px; padding: 24px 26px; }
.card h3 { margin: 0 0 12px; }
.card li { font-size: 14px; line-height: 1.8; color: #d8d8de; margin-bottom: 4px; }
.card .note { font-size: 12px; color: var(--muted); }
.card button { background: var(--text); color: #000; border: 0; border-radius: 999px; padding: 9px 22px; margin-top: 6px; }

@media (max-width: 1180px) {
  .layout { grid-template-columns: 180px 1fr 330px; }
}
@media (max-width: 860px) {
  html, body { overflow: auto; }
  .top { padding: 0 16px; }
  .brand p { display: none; }
  .modes button { padding: 7px 11px; font-size: 12px; }
  .layout { display: flex; flex-direction: column; height: auto; }
  .timeline { order: 1; display: flex; overflow-x: auto; overflow-y: hidden; border: 0; border-bottom: 1px solid var(--line); padding: 8px; gap: 4px; }
  .tl-year { display: none; }
  .tl-item { flex: none; width: auto; }
  .stage { order: 2; height: 72vh; min-height: 460px; }
  .info { order: 3; border: 0; padding: 22px 16px 60px; overflow: visible; }
  .brand h1 { font-size: 15px; white-space: nowrap; }
  .modes { gap: 5px; }
  .modes button { white-space: nowrap; }
  .modes .long { display: none; }
  .controls { width: auto; left: 10px; right: 10px; transform: none; gap: 8px; bottom: 10px; padding: 7px 8px; }
  .state { min-width: 0; flex-direction: column; gap: 3px; font-size: 10px; text-align: center; width: 52px; flex: none; }
  .btns { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .btns button { flex: none; white-space: nowrap; }
  .btns button { min-width: 46px; padding: 5px 6px; }
  .views { flex-direction: row; flex-wrap: wrap; left: 16px; right: 16px; top: 10px; justify-content: flex-end; }
  .views button { padding: 5px 8px; }
  .lineup-bar { flex-wrap: wrap; width: auto !important; justify-content: center; white-space: normal; width: calc(100% - 32px); }
  .lineup-bar input { width: 100%; }
}
