/* ============================================================
   舞阵通 · 黑匣子舞台调度台 设计系统
   ============================================================ */

/* ---------- 1. 设计令牌 ----------
   尺寸/字体/圆角为全局常量；颜色全部走语义变量，由 [data-theme] 覆盖
   ------------------------------------------------------------------ */
:root {
  --r-xs: 3px;
  --r-sm: 5px;
  --r-md: 7px;
  --r-lg: 11px;
  --r-xl: 16px;

  --font-display: "Bahnschrift Condensed", "Bahnschrift SemiCondensed", "DIN Alternate", "Arial Narrow",
    "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Mono", "SFMono-Regular", Consolas, Menlo, monospace;

  --topbar-h: 52px;
  --timeline-h: 194px;
  --rail-l: 274px;
  --rail-r: 296px;

  /* 画布浮层（HUD / 参考视频标签）：始终贴在深色舞台上，因此配色不随主题变化 */
  --hud-text: #E9EBF1;
  --hud-text-2: #A7AEBD;
  --hud-text-3: #717A8A;
  --hud-amber: #FFB43A;
  --hud-cyan: #4FD8E8;
  --hud-danger: #FF9AAC;
}

/* ---------- 1.1 主题：黑匣子舞台（默认，深色） ---------- */
:root,
[data-theme="stage"] {
  color-scheme: dark;

  --ink-900: #0B0C0F;
  --ink-880: #0E1014;
  --ink-850: #101218;
  --ink-800: #12141A;
  --ink-750: #161920;
  --ink-700: #1A1D25;
  --ink-600: #20242D;
  --ink-500: #2A2E38;

  --line: #262A34;
  --line-soft: #1D2129;
  --line-strong: #343945;

  --text: #E9EBF1;
  --text-2: #A7AEBD;
  --text-3: #717A8A;
  --text-4: #4C5462;

  --amber: #FFB43A;
  --amber-2: #FF8A3D;
  --amber-dim: rgba(255, 180, 58, .14);
  --amber-line: rgba(255, 180, 58, .38);
  --amber-soft: #FFD79A;
  --amber-edge: #1A1408;
  --on-amber: #23160A;

  --cyan: #4FD8E8;
  --cyan-dim: rgba(79, 216, 232, .13);
  --cyan-line: rgba(79, 216, 232, .32);
  --danger: #FF3B5C;
  --danger-dim: rgba(255, 59, 92, .13);
  --danger-line: rgba(255, 59, 92, .42);
  --danger-text: #FF7C93;
  --danger-text-2: #FF9AAC;
  --ok: #A3E635;
  --warn-text: #FFCB77;

  --wash-1: rgba(255, 255, 255, .024);
  --wash-3: rgba(255, 255, 255, .12);
  --wash-4: rgba(255, 255, 255, .22);

  --shadow-1: 0 1px 0 rgba(255, 255, 255, .04) inset;
  --shadow-2: 0 8px 24px -12px rgba(0, 0, 0, .9);
  --shadow-3: 0 28px 70px -24px rgba(0, 0, 0, .95);
  --glow-amber: 0 0 0 1px var(--amber-line), 0 0 22px -4px rgba(255, 180, 58, .45);

  /* 弹窗带一点透明度（配合 .modal 上的 backdrop-filter）：下方的舞台仍然透出来，
     手机上开弹窗时不会再是一块完全遮死的黑板 */
  --modal-bg: linear-gradient(180deg, rgba(21, 24, 31, .92), rgba(16, 18, 24, .88));
  --foot-bg: rgba(0, 0, 0, .18);
  --float-bg: rgba(20, 22, 29, .98);
  --hud-bg: rgba(18, 20, 26, .84);
  --scroll-thumb: #272B35;
  --scroll-thumb-hover: #3A404D;
  --noise-opacity: .05;

  --stage-bg:
    radial-gradient(120% 90% at 50% -30%, rgba(255, 180, 58, .10), transparent 62%),
    radial-gradient(90% 70% at 50% 130%, rgba(79, 216, 232, .05), transparent 60%),
    linear-gradient(180deg, #090A0D, #0D0F14);
  --preview-bg: #08090C;
  --thumb-bg: #0C0E12;
  --hero-glow-1: rgba(255, 180, 58, .22);
  --hero-glow-2: rgba(79, 216, 232, .12);
}

/* ---------- 1.2 主题：排练厅白昼（亮色） ---------- */
[data-theme="daylight"] {
  color-scheme: light;

  --ink-900: #F1F3F7;
  --ink-880: #FFFFFF;
  --ink-850: #F7F8FB;
  --ink-800: #FFFFFF;
  --ink-750: #F3F5F9;
  --ink-700: #FFFFFF;
  --ink-600: #E9ECF2;
  --ink-500: #DCE1E9;

  --line: #DCE0E8;
  --line-soft: #E8EBF1;
  --line-strong: #BFC6D2;

  --text: #1A1E26;
  --text-2: #4B5462;
  --text-3: #6D7686;
  --text-4: #99A1AF;

  --amber: #A65A00;
  --amber-2: #8A4600;
  --amber-dim: rgba(166, 90, 0, .10);
  --amber-line: rgba(166, 90, 0, .40);
  --amber-soft: #F0C289;
  --amber-edge: #8A4600;
  --on-amber: #FFFFFF;

  --cyan: #0A7387;
  --cyan-dim: rgba(10, 115, 135, .10);
  --cyan-line: rgba(10, 115, 135, .32);
  --danger: #D2274A;
  --danger-dim: rgba(210, 39, 74, .10);
  --danger-line: rgba(210, 39, 74, .38);
  --danger-text: #C01B3D;
  --danger-text-2: #A81636;
  --ok: #4F8C00;
  --warn-text: #96610A;

  --wash-1: rgba(20, 26, 38, .035);
  --wash-3: rgba(20, 26, 38, .12);
  --wash-4: rgba(20, 26, 38, .2);

  --shadow-1: 0 1px 0 rgba(255, 255, 255, .9) inset;
  --shadow-2: 0 10px 26px -14px rgba(18, 24, 38, .28);
  --shadow-3: 0 28px 64px -26px rgba(18, 24, 38, .34);
  --glow-amber: 0 0 0 1px var(--amber-line), 0 6px 18px -8px rgba(166, 90, 0, .5);

  --modal-bg: linear-gradient(180deg, rgba(255, 255, 255, .93), rgba(246, 248, 251, .89));
  --foot-bg: rgba(20, 26, 38, .03);
  --float-bg: rgba(255, 255, 255, .985);
  --hud-bg: rgba(18, 20, 26, .84);
  --scroll-thumb: #C6CCD8;
  --scroll-thumb-hover: #AAB2C0;
  --noise-opacity: .022;

  --stage-bg:
    radial-gradient(120% 90% at 50% -30%, rgba(166, 90, 0, .10), transparent 62%),
    radial-gradient(90% 70% at 50% 130%, rgba(10, 115, 135, .06), transparent 60%),
    linear-gradient(180deg, #E9ECF1, #DFE3EA);
  --preview-bg: #E4E8EE;
  --thumb-bg: #0C0E12;
  --hero-glow-1: rgba(166, 90, 0, .16);
  --hero-glow-2: rgba(10, 115, 135, .10);
}

/* ---------- 1.3 主题：霓虹夜场（高对比） ---------- */
[data-theme="neon"] {
  color-scheme: dark;

  --ink-900: #06060F;
  --ink-880: #0A0A18;
  --ink-850: #0C0C1C;
  --ink-800: #111124;
  --ink-750: #16162F;
  --ink-700: #1B1B3A;
  --ink-600: #242450;
  --ink-500: #303066;

  --line: #262654;
  --line-soft: #1B1B3C;
  --line-strong: #3B3B84;

  --text: #F3F1FF;
  --text-2: #B6B2DE;
  --text-3: #827EAC;
  --text-4: #5A5680;

  --amber: #35F0DC;
  --amber-2: #22A8F0;
  --amber-dim: rgba(53, 240, 220, .14);
  --amber-line: rgba(53, 240, 220, .45);
  --amber-soft: #8FFBEF;
  --amber-edge: #7CF5E9;
  --on-amber: #04211F;

  --cyan: #FF5CE1;
  --cyan-dim: rgba(255, 92, 225, .14);
  --cyan-line: rgba(255, 92, 225, .34);
  --danger: #FF4D6D;
  --danger-dim: rgba(255, 77, 109, .14);
  --danger-line: rgba(255, 77, 109, .44);
  --danger-text: #FF7C97;
  --danger-text-2: #FF9BB2;
  --ok: #7CFFB2;
  --warn-text: #FFD166;

  --wash-1: rgba(255, 255, 255, .03);
  --wash-3: rgba(255, 255, 255, .14);
  --wash-4: rgba(255, 255, 255, .24);

  --shadow-1: 0 1px 0 rgba(255, 255, 255, .05) inset;
  --shadow-2: 0 8px 26px -12px rgba(0, 0, 0, .95);
  --shadow-3: 0 28px 74px -24px rgba(0, 0, 0, 1);
  --glow-amber: 0 0 0 1px var(--amber-line), 0 0 26px -4px rgba(53, 240, 220, .55);

  --modal-bg: linear-gradient(180deg, rgba(21, 21, 46, .92), rgba(12, 12, 28, .89));
  --foot-bg: rgba(0, 0, 0, .28);
  --float-bg: rgba(16, 16, 38, .985);
  --hud-bg: rgba(10, 10, 26, .86);
  --scroll-thumb: #2A2A5A;
  --scroll-thumb-hover: #3E3E82;
  --noise-opacity: .07;

  --stage-bg:
    radial-gradient(120% 90% at 50% -30%, rgba(53, 240, 220, .12), transparent 62%),
    radial-gradient(90% 70% at 50% 130%, rgba(255, 92, 225, .08), transparent 60%),
    linear-gradient(180deg, #05050C, #0A0A18);
  --preview-bg: #04040A;
  --thumb-bg: #08081A;
  --hero-glow-1: rgba(53, 240, 220, .20);
  --hero-glow-2: rgba(255, 92, 225, .16);
}

/* ---------- 2. 基础重置 ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ink-900);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}
/* 全局噪点质感 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  opacity: var(--noise-opacity);
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
p { margin: 0; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--amber); text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
canvas { display: block; }
/* 内联图标默认尺寸：避免无尺寸 SVG 撑破布局，各组件可覆盖 */
svg { width: 1.05em; height: 1.05em; flex: none; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 9px; border: 2px solid var(--ink-800); }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }
:focus-visible { outline: 1px solid var(--amber); outline-offset: 1px; }
::selection { background: var(--amber-line); }

.app-root { height: 100%; position: relative; z-index: 1; }

/* ---------- 3. 文字与工具类 ---------- */
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.disp { font-family: var(--font-display); letter-spacing: .02em; }
.t2 { color: var(--text-2); }
.t3 { color: var(--text-3); }
.t4 { color: var(--text-4); }
.amber { color: var(--amber); }
.cyan { color: var(--cyan); }
.danger { color: var(--danger); }
.row { display: flex; align-items: center; }
.row-between { display: flex; align-items: center; justify-content: space-between; }
.gap4 { gap: 4px; } .gap6 { gap: 6px; } .gap8 { gap: 8px; } .gap12 { gap: 12px; }
.grow { flex: 1; min-width: 0; }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.label-xs {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-4);
}
.divider { height: 1px; background: var(--line-soft); }

/* ---------- 4. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border-radius: var(--r-sm);
  background: var(--ink-700);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12px;
  white-space: nowrap;
  transition: background .14s, color .14s, border-color .14s, transform .06s, box-shadow .14s;
}
.btn:hover { background: var(--ink-600); color: var(--text); border-color: var(--line-strong); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .38; pointer-events: none; }
.btn svg { width: 14px; height: 14px; flex: none; }
.btn-icon { width: 30px; padding: 0; }
.btn-icon svg { width: 15px; height: 15px; }
.btn-primary {
  background: linear-gradient(180deg, var(--amber), var(--amber-2));
  border-color: var(--amber-line);
  color: var(--on-amber);
  font-weight: 600;
  box-shadow: 0 6px 18px -8px var(--amber-2), var(--shadow-1);
}
.btn-primary:hover { background: linear-gradient(180deg, var(--amber), var(--amber-2)); color: var(--on-amber); border-color: var(--amber); filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--ink-700); border-color: var(--line); }
.btn-outline { background: transparent; border-color: var(--line-strong); }
.btn-danger { border-color: var(--danger-line); color: var(--danger-text); background: var(--danger-dim); }
.btn-danger:hover { background: var(--danger-dim); color: var(--danger-text-2); border-color: var(--danger); filter: brightness(1.1); }
.btn-lg { height: 38px; padding: 0 18px; font-size: 13px; border-radius: var(--r-md); }
.btn-sm { height: 25px; padding: 0 8px; font-size: 11px; border-radius: var(--r-xs); }
.btn-block { width: 100%; }
.btn-active { background: var(--amber-dim); border-color: var(--amber-line); color: var(--amber); }
.btn-ghost.btn-active:hover { background: var(--amber-dim); }

/* ---------- 5. 表单控件 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { display: flex; align-items: center; justify-content: space-between; }
.field-hint { font-size: 11px; color: var(--text-4); }
.input, .select, .textarea {
  height: 32px;
  padding: 0 10px;
  background: var(--ink-880);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  width: 100%;
  transition: border-color .14s, box-shadow .14s;
}
.textarea { height: auto; padding: 8px 10px; resize: vertical; min-height: 62px; line-height: 1.6; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--amber-line); box-shadow: 0 0 0 3px var(--amber-dim); }
.select { appearance: none; padding-right: 26px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23717A8A' stroke-width='1.4' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; }
.input-sm { height: 26px; padding: 0 7px; font-size: 12px; }
.input-num { width: 62px; text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 20px; background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: var(--ink-500); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px; margin-top: -5px;
  border-radius: 50%; background: var(--amber); border: 2px solid var(--amber-edge);
  box-shadow: 0 0 12px -1px var(--amber);
}
input[type="range"]::-moz-range-track { height: 3px; border-radius: 3px; background: var(--ink-500); }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border: 2px solid var(--amber-edge); border-radius: 50%; background: var(--amber); }

.switch { position: relative; width: 34px; height: 18px; border-radius: 10px; background: var(--ink-500); border: 1px solid var(--line); transition: background .16s; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--text-3); transition: transform .16s, background .16s; }
.switch.on { background: var(--amber-dim); border-color: var(--amber-line); }
.switch.on::after { transform: translateX(16px); background: var(--amber); }

.seg { display: inline-flex; background: var(--ink-880); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 2px; gap: 2px; }
.seg button {
  height: 22px; padding: 0 9px; border-radius: var(--r-xs); font-size: 11px; color: var(--text-3);
  font-family: var(--font-mono); transition: background .14s, color .14s;
}
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--ink-600); color: var(--amber); box-shadow: var(--shadow-1); }

.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 21px; padding: 0 8px;
  border-radius: 999px; background: var(--ink-700); border: 1px solid var(--line);
  font-size: 11px; color: var(--text-2); font-family: var(--font-mono);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
/* 可点击的 chip：时间轴上显示 / 收起「听感重音」这一层 */
.chip-btn { cursor: pointer; transition: border-color .14s, background .14s, color .14s; }
.chip-btn:hover { border-color: var(--line-strong); color: var(--text); }
.chip-btn.on { border-color: rgba(232, 121, 249, .55); background: rgba(232, 121, 249, .12); color: #E879F9; }
/* 伴奏轨的开关用青色，和它画在时间轴上的颜色一致 */
.chip-btn.on-teal { border-color: rgba(45, 212, 191, .55); background: rgba(45, 212, 191, .12); color: #2DD4BF; }

/* ---------- 6. 顶部工具条 ---------- */
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 12px;
  background: linear-gradient(180deg, var(--ink-850), var(--ink-800));
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 20;
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--amber-line), transparent);
}
.brand { display: flex; align-items: center; gap: 8px; user-select: none; }
.brand-mark { width: 22px; height: 22px; flex: none; color: var(--amber); display: inline-flex; }
.brand-mark svg { width: 100%; height: 100%; filter: drop-shadow(0 0 8px var(--amber-line)); }
.brand-name { font-family: var(--font-display); font-size: 17px; letter-spacing: .1em; color: var(--text); }
.brand-sub { font-family: var(--font-display); font-size: 9px; letter-spacing: .22em; color: var(--text-4); text-transform: uppercase; }
.proj-title {
  font-family: var(--font-display); font-size: 16px; letter-spacing: .04em;
  padding: 3px 8px; border-radius: var(--r-xs); border: 1px solid transparent; cursor: text;
  max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.proj-title:hover { border-color: var(--line); background: var(--ink-880); }
.save-state { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-4); font-family: var(--font-mono); }
.save-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--text-4); }
.save-dot.dirty { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.save-dot.saved { background: var(--ok); }
.rail-toggle { display: none; }

/* ---------- 7. 工作台布局 ---------- */
.workbench {
  height: calc(100% - var(--topbar-h));
  display: grid;
  grid-template-columns: var(--rail-l) 1fr var(--rail-r);
  grid-template-rows: 1fr var(--timeline-h);
  grid-template-areas: "left stage right" "timeline timeline timeline";
}
.rail {
  background: var(--ink-850);
  display: flex; flex-direction: column; min-height: 0;
  overflow: hidden;
}
.rail-left { grid-area: left; border-right: 1px solid var(--line); }
.rail-right { grid-area: right; border-left: 1px solid var(--line); }
.rail-head {
  height: 36px; flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 0 10px 0 12px; border-bottom: 1px solid var(--line-soft);
}
.rail-body { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 10px; min-height: 0; }
.rail-section { margin-bottom: 14px; }
.rail-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.stage-area { grid-area: stage; position: relative; min-width: 0; min-height: 0; }

/* ---------- 8. 舞台视口 ---------- */
.stage-viewport {
  position: absolute; inset: 0; overflow: hidden;
  background: var(--stage-bg);
}
.stage-viewport.is-dragging { cursor: grabbing; }
.stage-host { position: absolute; inset: 0; }
.stage-hud { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
.stage-hud > * { pointer-events: auto; }
.hud-corner { position: absolute; width: 20px; height: 20px; border: 1px solid var(--amber-line); pointer-events: none; }
.hud-tl { top: 10px; left: 10px; border-right: 0; border-bottom: 0; }
.hud-tr { top: 10px; right: 10px; border-left: 0; border-bottom: 0; }
.hud-bl { bottom: 10px; left: 10px; border-right: 0; border-top: 0; }
.hud-br { bottom: 10px; right: 10px; border-left: 0; border-top: 0; }
.hud-pill {
  position: absolute; display: flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px; border-radius: 999px;
  background: var(--hud-bg); backdrop-filter: blur(10px);
  border: 1px solid var(--line); font-size: 11px; color: var(--hud-text-2);
  font-family: var(--font-mono);
}
.hud-top-left { top: 12px; left: 16px; }
.hud-bottom-left { bottom: 14px; left: 16px; }
.hud-bottom-right { bottom: 14px; right: 16px; padding: 0 6px; gap: 2px; }
.hud-zoom { font-family: var(--font-mono); min-width: 46px; text-align: center; color: var(--hud-text-2); }
.hud-pill .legend-item, .hud-pill .legend-item.t4 { color: var(--hud-text-3); }
.collide-banner {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px;
  border-radius: 999px; background: rgba(48, 8, 18, .9); border: 1px solid rgba(255, 122, 148, .45);
  color: var(--hud-danger); font-size: 11px; backdrop-filter: blur(8px);
  animation: pulse-danger 1.6s ease-in-out infinite;
}
/* 提示与图例竖排在左下角：提示压在图例数据行上的问题不再出现 */
.hud-stack { position: absolute; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; max-width: 60%; pointer-events: none; }
.hud-stack > * { pointer-events: auto; }
.hud-stack .hud-pill { position: static; }
.stage-tip {
  font-size: 11px; color: var(--hud-text-3); background: var(--hud-bg);
  border: 1px solid var(--line-soft); border-radius: 999px; padding: 4px 12px;
  backdrop-filter: blur(8px); max-width: 100%; pointer-events: none;
}

/* ---------- 9. 左栏：分组与人员 ---------- */
.group-row {
  display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 7px;
  border-radius: var(--r-sm); border: 1px solid transparent; cursor: pointer;
  transition: background .14s, border-color .14s;
}
.group-row:hover { background: var(--ink-750); }
.group-row.on { background: var(--ink-700); border-color: var(--line-strong); }
.group-swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; box-shadow: 0 0 10px -2px currentColor; }
.group-name { flex: 1; font-size: 12px; color: var(--text-2); }
.group-count { font-family: var(--font-mono); font-size: 10px; color: var(--text-4); }
.group-acts { display: flex; gap: 3px; }
/* 分组操作按钮常显：带底色与描边，保证浅色/深色主题下都看得清 */
.group-acts .mini-btn { background: var(--ink-600); border: 1px solid var(--line-strong); color: var(--text-2); }
.group-acts .mini-btn:hover { background: var(--ink-500); border-color: var(--amber-line); color: var(--amber); }
.group-acts .mini-btn[data-gact="del"]:hover { background: var(--danger-dim); border-color: var(--danger-line); color: var(--danger-text); }
.mini-btn { width: 20px; height: 20px; border-radius: var(--r-xs); display: grid; place-items: center; color: var(--text-4); }
.mini-btn:hover { background: var(--ink-600); color: var(--text); }
.mini-btn svg { width: 12px; height: 12px; }

.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 6px; }
.pcard {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 4px 6px; border-radius: var(--r-md);
  background: var(--ink-800); border: 1px solid var(--line-soft);
  cursor: pointer; transition: border-color .14s, background .14s, transform .1s;
}
.pcard:hover { border-color: var(--line-strong); background: var(--ink-750); }
.pcard.on { border-color: var(--amber); background: var(--amber-dim); box-shadow: 0 0 0 1px var(--amber-line), 0 0 18px -8px var(--amber); }
.pcard-num {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 12px; font-weight: 600;
  /* 底色是分组色（8 种高饱和亮色），因此文字固定用深色，三套主题下都清晰 */
  color: #1A1408;
}
.pcard-name { font-size: 10px; color: var(--text-3); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-collide { position: absolute; top: 5px; right: 5px; width: 6px; height: 6px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 8px var(--danger); }
.pcard-del { position: absolute; top: 3px; left: 3px; opacity: 0; }
.pcard:hover .pcard-del { opacity: 1; }
.add-tile {
  border: 1px dashed var(--line-strong); border-radius: var(--r-md); background: transparent;
  color: var(--text-4); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; min-height: 62px; font-size: 10px; transition: color .14s, border-color .14s, background .14s;
}
.add-tile:hover { color: var(--amber); border-color: var(--amber-line); background: var(--amber-dim); }
.add-tile svg { width: 14px; height: 14px; }

/* ---------- 10. 右栏：预设与属性 ---------- */
.preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.preset-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  height: 62px; border-radius: var(--r-md); background: var(--ink-800);
  border: 1px solid var(--line-soft); color: var(--text-3); font-size: 11px;
  transition: border-color .14s, color .14s, background .14s, transform .1s;
}
.preset-btn:hover { border-color: var(--amber-line); color: var(--amber); background: var(--amber-dim); transform: translateY(-1px); }
.preset-btn svg { width: 26px; height: 20px; }
.preset-btn.on { border-color: var(--amber); color: var(--amber); background: var(--amber-dim); }

/* 对齐与变换：带文字的小按钮，图标各自区分 */
.tf-note { margin: 8px 0 4px; font-size: 10px; color: var(--text-4); }
.tf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.tf-btn { height: 44px; gap: 2px; font-size: 10px; }
.tf-btn svg { width: 18px; height: 15px; }

/* 走位路径：直线 / 左弧 / 右弧 / S 形 */
.path-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.path-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  height: 42px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--ink-850); color: var(--text-3); font-size: 10px;
}
.path-btn:hover { border-color: var(--line-strong); color: var(--text); }
.path-btn.on { border-color: var(--amber); background: var(--amber-dim); color: var(--amber); }
.path-btn svg { width: 22px; height: 15px; }

/* 可换行的分段选择：节拍检测里的长文案按钮（「每 16 拍（两个八拍 = 4 小节）」等） */
.seg.seg-wrap { flex-wrap: wrap; }
.seg.seg-wrap button {
  flex: 1 1 auto; min-width: 104px;
  height: auto; min-height: 28px; padding: 5px 10px;
  font-size: 12px; line-height: 1.35; white-space: normal;
}
/* 节拍检测结果概览：宽版弹窗里固定 4 格，窄屏自动折行 */
.stat-grid.beat-grid { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); }

.param-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 30px; }
.param-row > .param-label { font-size: 12px; color: var(--text-3); }
.param-row > .param-ctl { display: flex; align-items: center; gap: 6px; }

.insp-empty {
  border: 1px dashed var(--line); border-radius: var(--r-md); padding: 16px 12px;
  text-align: center; color: var(--text-4); font-size: 11px; line-height: 1.7;
}
.kv { display: flex; align-items: center; justify-content: space-between; height: 26px; font-size: 12px; }
.kv > span:first-child { color: var(--text-3); }
.kv > span:last-child { font-family: var(--font-mono); color: var(--text-2); }

/* ---------- 11. 底部时间轴 ---------- */
.timeline {
  grid-area: timeline; position: relative; z-index: 15;
  background: linear-gradient(180deg, var(--ink-850), var(--ink-880));
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: 226px 1fr; grid-template-rows: minmax(0, 100%);
  min-height: 0; overflow: hidden;
}
.tl-left { border-right: 1px solid var(--line-soft); padding: 10px; display: flex; flex-direction: column; gap: 7px; min-width: 0; overflow-y: auto; overflow-x: hidden; }
/* 左栏内容偶尔会超出一行（信息胶囊换行），允许滚动，别把胶囊悄悄裁掉 */
.tl-left::-webkit-scrollbar { width: 6px; }
.tl-left::-webkit-scrollbar-track { background: transparent; }
.tl-left::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 999px; }
.tl-transport { display: flex; align-items: center; gap: 6px; }
.btn-play {
  width: 42px; height: 42px; border-radius: 50%; padding: 0;
  background: linear-gradient(180deg, var(--amber), var(--amber-2)); color: #23160A;
  border: 1px solid var(--amber-line);
  box-shadow: 0 8px 22px -10px var(--amber-2), var(--shadow-1);
  display: grid; place-items: center;
}
.btn-play:hover { background: linear-gradient(180deg, var(--amber), var(--amber-2)); filter: brightness(1.08); }
.btn-play svg { width: 18px; height: 18px; }
.tl-clock { display: flex; align-items: baseline; gap: 5px; font-family: var(--font-mono); }
.tl-clock .now { font-size: 21px; color: var(--amber); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.tl-clock .tot { font-size: 12px; color: var(--text-4); }
/* 左栏加了时间轴缩放后要更紧凑：时间码与倍速挤在一行，避免「/ 2:00」折行把行高撑到 46px */
.tl-left .tl-clock { white-space: nowrap; }
.tl-left .tl-clock .now { font-size: 19px; }
.tl-left .seg button { padding: 0 6px; }
/* 常驻提示：缩放标签后面跟一行小字，用户不用试才知道 Ctrl + 滚轮 能缩放 */
.tl-zoom-hint { margin-left: 5px; font-size: 10px; letter-spacing: 0; color: var(--text-3); }
.tl-meta { display: flex; flex-wrap: wrap; gap: 4px; }
/* 左栏高度紧张：信息胶囊压小一点，保证排成一行而不是换行后被挤出可视区 */
.tl-meta .chip { height: 18px; padding: 0 6px; font-size: 10px; gap: 4px; }
.tl-right { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; padding: 10px 12px 12px 12px; gap: 6px; overflow-x: auto; overflow-y: hidden; }
/* 时间轴放大后横向滚动：滚动条压扁一点，别抢轨道高度 */
.tl-right::-webkit-scrollbar { height: 8px; }
.tl-right::-webkit-scrollbar-track { background: transparent; }
.tl-right::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 999px; }
.tl-right::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }
.tl-ruler { position: relative; height: 16px; flex: none; font-family: var(--font-mono); }
.tl-tick { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line-soft); }
.tl-tick span { position: absolute; top: 1px; left: 4px; font-size: 9px; color: var(--text-4); }
.tl-wave {
  position: relative; flex: 1; min-height: 46px; border-radius: var(--r-sm); overflow: hidden;
  background: linear-gradient(180deg, var(--ink-880), var(--ink-850));
  border: 1px solid var(--line-soft);
}
.tl-wave canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* 人声 / 伴奏双轨的小标签：位置由 JS 跟着可视区左边缘摆，不挡柱子 */
.tl-stem-tag {
  position: absolute; z-index: 2; pointer-events: none; white-space: nowrap;
  padding: 0 5px; border-radius: 999px; font-size: 9px; line-height: 14px;
  background: rgba(8, 10, 14, .62); border: 1px solid var(--line-soft);
}
.tl-wave-empty {
  position: absolute; inset: 0; display: grid; place-items: center; gap: 8px;
  color: var(--text-4); font-size: 11px; text-align: center; padding: 8px;
}
.tl-lane { position: relative; height: 22px; flex: none; }
.tl-lane-markers { border-top: 1px solid var(--line-soft); padding-top: 2px; }
.tl-lane-kf { height: 26px; border-top: 1px solid var(--line-soft); }
.tl-lane-bg { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 39px, var(--wash-1) 39px 40px); pointer-events: none; }

.marker-node {
  position: absolute; top: 2px; height: 17px; transform: translateX(-1px);
  display: flex; align-items: center; padding: 0 7px; gap: 4px;
  border-radius: 0 3px 3px 0; font-size: 10px; white-space: nowrap; cursor: grab;
  border-left: 2px solid var(--mk, var(--cyan));
  background: var(--cyan-dim);
  color: var(--text-2); max-width: 130px; overflow: hidden;
  transition: box-shadow .14s, filter .14s;
}
.marker-node:hover { filter: brightness(1.25); box-shadow: 0 0 0 1px var(--wash-3); z-index: 4; }
.marker-node.on { box-shadow: 0 0 0 1px var(--mk, var(--cyan)); z-index: 5; }
.marker-node .mk-name { overflow: hidden; text-overflow: ellipsis; }

.kf-node {
  position: absolute; top: 5px; width: 16px; height: 16px; transform: translateX(-8px) rotate(45deg);
  background: var(--ink-600); border: 1px solid var(--line-strong); border-radius: 2px; cursor: grab;
  transition: background .14s, border-color .14s, box-shadow .14s, transform .12s;
}
.kf-node:hover { border-color: var(--amber-line); background: var(--ink-500); }
.kf-node.on { background: linear-gradient(180deg, var(--amber), var(--amber-2)); border-color: var(--amber-soft); box-shadow: 0 0 14px -2px var(--amber); }
.kf-node.drag { transform: translateX(-8px) rotate(45deg) scale(1.16); }
.kf-card {
  position: absolute; bottom: 30px; width: 172px; transform: translateX(-50%);
  background: var(--float-bg); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  box-shadow: var(--shadow-3); overflow: hidden; pointer-events: none; z-index: 30;
  backdrop-filter: blur(8px);
}
.kf-card-head { padding: 5px 8px; border-bottom: 1px solid var(--line-soft); display: flex; justify-content: space-between; align-items: center; }
.kf-card-head .t { font-size: 11px; color: var(--text); font-family: var(--font-mono); }
.kf-card canvas { width: 100%; height: auto; }
.tl-playhead {
  position: absolute; top: 0; bottom: 0; width: 1px; background: var(--amber);
  box-shadow: 0 0 12px var(--amber); pointer-events: none; z-index: 10;
}
/* 悬停游标：显示鼠标所在位置的准确时间，方便把播放头对到想要的时间点 */
.tl-cursor {
  position: absolute; top: 0; bottom: 0; width: 1px; margin-left: -0.5px;
  background: rgba(255, 255, 255, .26); pointer-events: none; display: none; z-index: 9;
}
.tl-cursor-tip {
  position: absolute; top: -1px; left: 0; padding: 1px 5px; border-radius: 3px;
  font-family: var(--font-mono); font-size: 9px; line-height: 14px; white-space: nowrap;
  background: rgba(14, 16, 20, .94); border: 1px solid var(--line-soft); color: var(--text-2);
}
.tl-playhead::before {
  content: ""; position: absolute; top: 0; left: -4px; width: 9px; height: 7px;
  background: var(--amber); clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.tl-scroll { overflow-x: hidden; }

/* ---------- 12. 项目列表页 ---------- */
.page-list { height: 100%; overflow-y: auto; background: var(--ink-900); }
.hero {
  position: relative; padding: 58px 48px 34px; overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: ""; position: absolute; inset: -40% -20% auto -20%; height: 150%;
  background:
    radial-gradient(46% 60% at 22% 8%, var(--hero-glow-1), transparent 70%),
    radial-gradient(38% 50% at 82% 0%, var(--hero-glow-2), transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(var(--wash-1) 1px, transparent 1px), linear-gradient(90deg, var(--wash-1) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: linear-gradient(180deg, #000 20%, transparent 92%);
}
.hero-inner { position: relative; z-index: 2; max-width: 1240px; margin: 0 auto; }
.hero-title {
  font-family: var(--font-display); font-size: 74px; line-height: .92; letter-spacing: .06em;
  color: var(--text); margin-bottom: 12px; text-shadow: 0 24px 60px var(--hero-glow-1);
}
.hero-title em { font-style: normal; color: transparent; -webkit-text-stroke: 1.4px var(--amber); }
.hero-sub { font-size: 14px; color: var(--text-2); max-width: 640px; line-height: 1.75; }
.hero-actions { display: flex; align-items: center; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 26px; margin-top: 26px; flex-wrap: wrap; }
.hero-stat .n { font-family: var(--font-display); font-size: 26px; color: var(--text); letter-spacing: .04em; }
.hero-stat .l { font-size: 11px; color: var(--text-4); letter-spacing: .08em; }

.section-wrap { max-width: 1240px; margin: 0 auto; padding: 26px 48px 60px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 14px; }
.proj-card {
  position: relative; background: linear-gradient(180deg, var(--ink-800), var(--ink-850));
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  transition: transform .16s, border-color .16s, box-shadow .16s;
  animation: rise .42s cubic-bezier(.2,.7,.3,1) both;
}
.proj-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-2); }
.proj-card-main { padding: 14px 14px 12px; cursor: pointer; display: block; width: 100%; text-align: left; }
.proj-thumb {
  aspect-ratio: 16 / 9; border-radius: var(--r-sm); overflow: hidden; margin-bottom: 12px;
  background: var(--thumb-bg); border: 1px solid var(--line-soft); position: relative;
}
.proj-thumb canvas { width: 100%; height: 100%; }
.proj-thumb::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 30px rgba(0,0,0,.55); pointer-events: none; }
.proj-name { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 8px; }
.proj-facts { display: flex; flex-wrap: wrap; gap: 5px; }
.proj-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-top: 1px solid var(--line-soft); background: var(--foot-bg);
}
.proj-acts { display: flex; gap: 2px; }
.empty-state {
  border: 1px dashed var(--line-strong); border-radius: var(--r-lg); padding: 54px 24px;
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
  background: radial-gradient(70% 120% at 50% 0%, var(--amber-dim), transparent 70%);
}
.empty-state h3 { font-family: var(--font-display); font-size: 21px; letter-spacing: .05em; color: var(--text-2); }
.empty-state p { color: var(--text-4); font-size: 12px; max-width: 420px; line-height: 1.8; }
.empty-state > svg { width: 34px; height: 34px; color: var(--amber); opacity: .75; }
.note-box svg { width: 13px; height: 13px; vertical-align: -2px; }
.storage-note svg { width: 13px; height: 13px; }
.collide-banner svg { width: 13px; height: 13px; }
.tl-wave-empty svg { width: 20px; height: 20px; margin: 0 auto 4px; color: var(--text-4); }
.hud-pill svg { width: 13px; height: 13px; }

.list-foot {
  max-width: 1240px; margin: 0 auto; padding: 0 48px 48px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: var(--text-4); font-size: 11px;
}
.storage-note {
  display: flex; align-items: center; gap: 8px; padding: 7px 11px; border-radius: var(--r-sm);
  background: var(--ink-850); border: 1px solid var(--line-soft); font-family: var(--font-mono);
}
.storage-note.warn { border-color: var(--amber-line); color: var(--warn-text); background: var(--amber-dim); }

/* ---------- 13. 弹窗 / 菜单 / 提示 ---------- */
.overlay-layer { position: fixed; inset: 0; z-index: 1000; }
.modal-mask {
  position: fixed; inset: 0; background: rgba(6, 7, 10, .72); backdrop-filter: blur(5px);
  display: grid; place-items: center; padding: 24px; z-index: 1000;
  animation: fade .18s ease both;
}
.modal {
  width: 100%; max-width: 460px; max-height: 88vh; overflow: hidden;
  background: var(--modal-bg);
  border: 1px solid var(--line-strong); border-radius: var(--r-xl);
  box-shadow: var(--shadow-3); display: flex; flex-direction: column;
  /* 半透明的弹窗把身后的舞台糊掉一层即可看清内容，不再完全遮挡 */
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  animation: pop .22s cubic-bezier(.2,.8,.3,1) both;
}
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 880px; }
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 16px 18px 12px; border-bottom: 1px solid var(--line-soft);
}
.modal-title { font-family: var(--font-display); font-size: 18px; letter-spacing: .05em; color: var(--text); }
.modal-desc { font-size: 12px; color: var(--text-4); margin-top: 3px; }
.modal-body { padding: 16px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 12px 18px; border-top: 1px solid var(--line-soft); background: var(--foot-bg);
}
.modal-foot .grow { flex: 1; }

.menu {
  position: fixed; z-index: 1100; min-width: 176px; padding: 5px;
  background: var(--float-bg); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  box-shadow: var(--shadow-3); backdrop-filter: blur(12px);
  /* 菜单项可能很多（比如一次列出全部变化点），超出屏幕就自己滚 */
  max-height: min(60vh, 420px); overflow-y: auto; overscroll-behavior: contain;
  animation: pop .14s ease both;
}
.menu-item {
  display: flex; align-items: center; gap: 9px; width: 100%; height: 30px; padding: 0 9px;
  border-radius: var(--r-sm); color: var(--text-2); font-size: 12px; text-align: left;
}
.menu-item:hover { background: var(--ink-600); color: var(--text); }
.menu-item svg { width: 14px; height: 14px; color: var(--text-4); }
.menu-item:hover svg { color: var(--amber); }
.menu-item.danger { color: var(--danger-text); }
.menu-item.danger:hover { background: var(--danger-dim); }
.menu-item.danger:hover svg { color: var(--danger-text); }
.menu-sep { height: 1px; background: var(--line-soft); margin: 4px 6px; }
/* 颜色菜单：真实色块 + 当前色勾选 */
.menu-sw { width: 15px; height: 15px; border-radius: 4px; flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28), 0 0 10px -3px currentColor; color: inherit; }
.menu-item:hover .menu-sw { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5), 0 0 12px -2px currentColor; }
.menu-check { margin-left: auto; display: grid; place-items: center; color: var(--amber); }
.menu-check svg { width: 12px; height: 12px; color: var(--amber); }
/* 带说明的菜单项：一句话讲清这个操作会做什么 */
.menu-text { min-width: 0; }
.menu-item.has-hint { height: auto; min-height: 30px; padding: 6px 9px; align-items: flex-start; }
.menu-item.has-hint > svg, .menu-item.has-hint > .menu-sw { margin-top: 2px; flex: none; }
.menu-hint { display: block; margin-top: 3px; max-width: 220px; font-size: 10px; line-height: 1.45; color: var(--text-3); }
.menu-label { padding: 6px 9px 3px; font-size: 10px; letter-spacing: .12em; color: var(--text-4); font-family: var(--font-display); text-transform: uppercase; }

/* 操作历史小窗：标题栏可拖动；当前步骤高亮，被撤销掉的步骤变灰，点任意一条可跳过去 */
.hist-pop {
  position: fixed; z-index: 1100; width: 288px; padding: 8px;
  background: var(--float-bg); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  box-shadow: var(--shadow-3); backdrop-filter: blur(12px);
  animation: pop .14s ease both;
}
.hist-head { display: flex; align-items: center; gap: 6px; padding: 2px 4px 6px; cursor: move; user-select: none; }
.hist-head .label-xs { flex: 1; }
.hist-hint { font-size: 10px; color: var(--text-4); }
.hist-list { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.hist-row {
  display: flex; align-items: flex-start; gap: 8px; width: 100%;
  padding: 5px 8px; border-radius: var(--r-sm); color: var(--text-2); font-size: 12px; text-align: left;
}
.hist-row:hover { background: var(--ink-600); color: var(--text); }
.hist-row.current { background: rgba(255, 180, 58, .14); color: var(--amber); }
.hist-row.undone { color: var(--text-4); }
.hist-row.undone .hist-step { color: var(--text-4); }
.hist-step { flex: none; width: 18px; padding-top: 1px; font-family: var(--font-mono); font-size: 10px; color: var(--text-4); text-align: right; }
.hist-body { min-width: 0; display: flex; flex-direction: column; }
.hist-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-meta { margin-top: 1px; font-size: 10px; font-family: var(--font-mono); color: var(--text-4); }
.hist-row.current .hist-meta { color: rgba(255, 180, 58, .72); }
.hist-foot { margin-top: 6px; padding: 5px 4px 1px; border-top: 1px solid var(--line-soft); font-size: 10px; color: var(--text-4); }

.toast-root { position: fixed; right: 18px; bottom: 18px; z-index: 1200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  display: flex; align-items: center; gap: 9px; max-width: 380px;
  padding: 10px 13px; border-radius: var(--r-md);
  background: var(--float-bg); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-3); font-size: 12px; color: var(--text-2);
  animation: slideIn .22s cubic-bezier(.2,.8,.3,1) both; backdrop-filter: blur(10px);
}
.toast.out { animation: slideOut .2s ease both; }
.toast .bar { width: 3px; align-self: stretch; border-radius: 3px; background: var(--amber); flex: none; }
.toast.ok .bar { background: var(--ok); }
.toast.err .bar { background: var(--danger); }
.toast.info .bar { background: var(--cyan); }

/* ---------- 14. 预览模式 ---------- */
.preview-overlay {
  position: fixed; inset: 0; z-index: 800; background: var(--preview-bg);
  display: flex; flex-direction: column; animation: fade .2s ease both;
}
.preview-top {
  height: 46px; flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, var(--float-bg), transparent);
  position: relative; z-index: 4;
}
.preview-stage { position: relative; flex: 1; min-height: 0; }
.preview-bar {
  position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: var(--float-bg); border: 1px solid var(--line-strong);
  border-radius: 999px; backdrop-filter: blur(14px); box-shadow: var(--shadow-3); z-index: 6;
}
.preview-progress { width: 320px; height: 3px; border-radius: 3px; background: var(--ink-500); position: relative; cursor: pointer; }
.preview-progress .fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--amber), var(--amber-2)); border-radius: 3px; }
.preview-progress .knob { position: absolute; top: 50%; width: 11px; height: 11px; border-radius: 50%; background: var(--amber); transform: translate(-50%, -50%); box-shadow: 0 0 12px var(--amber); }

/* ---------- 15. 分享预览页 ---------- */
.page-share { height: 100%; display: flex; flex-direction: column; background: var(--ink-900); }
.share-top {
  height: 50px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 14px;
  border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--ink-850), var(--ink-880));
}
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 8px; border-radius: 999px;
  font-size: 10px; letter-spacing: .08em; font-family: var(--font-display); text-transform: uppercase;
  background: var(--cyan-dim); border: 1px solid var(--cyan-line); color: var(--cyan);
}
.share-stage { position: relative; flex: 1; min-height: 0; }
.share-bottom {
  flex: none; padding: 10px 14px 14px; border-top: 1px solid var(--line);
  background: var(--ink-850); display: flex; flex-direction: column; gap: 10px;
}
.share-kfs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.share-kf {
  flex: none; width: 118px; border-radius: var(--r-md); overflow: hidden;
  border: 1px solid var(--line); background: var(--ink-800); cursor: pointer;
  transition: border-color .14s, transform .14s;
}
.share-kf:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.share-kf.on { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber-line); }
.share-kf canvas { width: 100%; height: 66px; }
.share-kf .cap { display: flex; justify-content: space-between; padding: 4px 7px; font-size: 10px; font-family: var(--font-mono); color: var(--text-3); }
.share-play { display: flex; align-items: center; gap: 12px; }
/* 分享页播放按钮：加大命中区域（圆形按钮的圆角会裁剪点击判定，太小很难点中） */
.share-play-btn { width: 48px; height: 48px; flex: none; }
.share-play-btn svg { width: 20px; height: 20px; }
.share-track { position: relative; flex: 1; height: 26px; border-radius: 999px; background: var(--ink-880); border: 1px solid var(--line); overflow: hidden; cursor: pointer; }
.share-track .fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--amber-line), var(--amber-dim)); }
.share-track .marks { position: absolute; inset: 0; }
.share-track .mark { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--wash-4); }
.share-track .kf { position: absolute; top: 50%; width: 7px; height: 7px; transform: translate(-50%, -50%) rotate(45deg); background: var(--text-3); border-radius: 1px; }
.share-track .kf.on { background: var(--amber); box-shadow: 0 0 9px var(--amber); }

/* ---------- 16. 头像/图例/其他 ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 6px; }
.legend-item { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-3); }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; }
.preview-card-list { display: flex; flex-direction: column; gap: 10px; }
.pv-item {
  display: flex; gap: 12px; padding: 10px; border: 1px solid var(--line-soft);
  border-radius: var(--r-md); background: var(--ink-850); align-items: center;
}
.pv-item canvas { border-radius: var(--r-sm); border: 1px solid var(--line-soft); background: var(--thumb-bg); }
.pv-item .meta { flex: 1; min-width: 0; }
.pv-item .meta .n { font-size: 12px; color: var(--text); }
.pv-item .meta .d { font-size: 11px; color: var(--text-4); font-family: var(--font-mono); margin-top: 3px; line-height: 1.6; }
/* 导出选项：窄屏自动折成两列 / 一列，不再靠空 div 撑间距 */
.opt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 2px 20px; }
/* 弹窗底部那一排次要操作按钮 */
.act-list { display: flex; flex-wrap: wrap; gap: 8px; }
.link-box {
  display: flex; gap: 8px; align-items: center; padding: 8px; border-radius: var(--r-sm);
  background: var(--ink-880); border: 1px solid var(--line);
}
.link-box input { flex: 1; background: transparent; border: none; color: var(--text-2); font-family: var(--font-mono); font-size: 11px; }
.link-box input:focus { outline: none; }
.note-box {
  padding: 9px 11px; border-radius: var(--r-sm); border: 1px solid var(--line-soft);
  background: var(--cyan-dim); color: var(--text-3); font-size: 11px; line-height: 1.7;
}
.note-box.warn { background: var(--amber-dim); border-color: var(--amber-line); color: var(--warn-text); }
.mobile-guard { display: none; flex: none; }
.mobile-guard svg { width: 14px; height: 14px; }

/* ---------- 17. 动画 ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes slideOut { to { opacity: 0; transform: translateX(16px); } }
@keyframes pulse-danger { 0%,100% { box-shadow: 0 0 0 0 rgba(255,59,92,.28); } 50% { box-shadow: 0 0 0 7px rgba(255,59,92,0); } }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin .9s linear infinite; }
.rise-1 { animation: rise .5s cubic-bezier(.2,.7,.3,1) both; }
.rise-2 { animation: rise .5s cubic-bezier(.2,.7,.3,1) .07s both; }
.rise-3 { animation: rise .5s cubic-bezier(.2,.7,.3,1) .14s both; }
.rise-4 { animation: rise .5s cubic-bezier(.2,.7,.3,1) .21s both; }

/* ---------- 18. P1：参考视频 / 模板库 / 扫码分发 / 道具与 3D ---------- */
.video-layer {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
}
.ref-video {
  position: absolute; left: 50%; top: 50%; max-width: 96%; max-height: 96%;
  transform-origin: center center; border-radius: 6px; pointer-events: none;
}
.video-tag {
  position: absolute; top: 12px; right: 16px; display: flex; align-items: center;
  height: 24px; padding: 0 10px; border-radius: 999px;
  background: var(--hud-bg); border: 1px solid var(--line);
  font-size: 10px; font-family: var(--font-mono); color: var(--hud-text-3);
  backdrop-filter: blur(8px);
}

.badge-focus {
  background: var(--amber-dim); border-color: var(--amber-line); color: var(--amber);
  text-transform: none; letter-spacing: 0;
}

.legend-ring { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--text-3); flex: none; }

.prop-swatches { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.prop-sw {
  width: 20px; height: 20px; border-radius: 50%; background: var(--c);
  border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .35);
  transition: transform .12s, border-color .12s;
}
.prop-sw:hover { transform: scale(1.12); }
.prop-sw.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--wash-4); }

.tpl-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 10px; max-height: 56vh; overflow-y: auto; padding-right: 4px;
}
.tpl-card {
  display: flex; flex-direction: column; gap: 9px; padding: 10px;
  border: 1px solid var(--line-soft); border-radius: var(--r-md); background: var(--ink-850);
  transition: border-color .14s;
}
.tpl-card:hover { border-color: var(--line-strong); }
.tpl-thumb { border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line-soft); background: var(--thumb-bg); }
.tpl-thumb canvas { display: block; width: 100%; height: auto; }
.tpl-info { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.tpl-name { font-size: 13px; color: var(--text); }
.tpl-desc { font-size: 11px; color: var(--text-4); line-height: 1.6; }
.tpl-steps { display: flex; flex-wrap: wrap; gap: 4px; }
.tpl-meta { font-size: 10px; font-family: var(--font-mono); color: var(--text-4); }
.tpl-card > .btn { align-self: flex-end; }

.dist-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.dist-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 44vh; overflow-y: auto; padding-right: 4px;
  overscroll-behavior: contain;
}
.dist-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 9px;
  border: 1px solid var(--line-soft); border-radius: var(--r-sm); background: var(--ink-850);
}
.dist-qr { width: 128px; height: 128px; flex: none; border-radius: 4px; background: #FFFFFF; }
.dist-info { flex: 1; min-width: 0; }
.dist-name { font-size: 12px; color: var(--text-2); }
.dist-meta { font-size: 11px; font-family: var(--font-mono); color: var(--text-4); margin-top: 3px; }

/* ---------- 19. 新手引导 ---------- */
.tour-root { position: fixed; inset: 0; z-index: 1500; }
.tour-spot {
  position: fixed; border-radius: var(--r-md);
  box-shadow: 0 0 0 9999px rgba(4, 5, 9, .58), 0 0 0 1px var(--amber), 0 0 26px -2px var(--amber);
  transition: left .34s cubic-bezier(.2, .75, .3, 1), top .34s cubic-bezier(.2, .75, .3, 1),
    width .34s cubic-bezier(.2, .75, .3, 1), height .34s cubic-bezier(.2, .75, .3, 1), opacity .2s;
  pointer-events: none;
  animation: tourPulse 2.1s ease-in-out infinite;
}
.tour-spot.is-hidden { opacity: 0; }
@keyframes tourPulse {
  0%, 100% { box-shadow: 0 0 0 9999px rgba(4, 5, 9, .58), 0 0 0 1px var(--amber), 0 0 20px -2px var(--amber); }
  50% { box-shadow: 0 0 0 9999px rgba(4, 5, 9, .58), 0 0 0 1px var(--amber), 0 0 42px 1px var(--amber); }
}
.tour-card {
  position: fixed; width: 300px; padding: 14px;
  background: var(--modal-bg); border: 1px solid var(--line-strong);
  border-radius: var(--r-lg); box-shadow: var(--shadow-3);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  transition: left .34s cubic-bezier(.2, .75, .3, 1), top .34s cubic-bezier(.2, .75, .3, 1);
}
.tour-card.in { animation: tourIn .28s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes tourIn { from { opacity: 0; transform: translateY(9px) scale(.98); } to { opacity: 1; transform: none; } }
.tour-card::after {
  content: ""; position: absolute; width: 10px; height: 10px;
  background: var(--ink-800); border: 1px solid var(--line-strong); transform: rotate(45deg);
}
.tour-card[data-side="bottom"]::after { top: -6px; left: calc(var(--ax, 50%) - 5px); border-right: 0; border-bottom: 0; }
.tour-card[data-side="top"]::after { bottom: -6px; left: calc(var(--ax, 50%) - 5px); border-left: 0; border-top: 0; }
.tour-card[data-side="left"]::after { right: -6px; top: calc(var(--ay, 20px) - 5px); border-left: 0; border-bottom: 0; }
.tour-card[data-side="right"]::after { left: -6px; top: calc(var(--ay, 20px) - 5px); border-right: 0; border-top: 0; }
.tour-card[data-side="center"]::after { display: none; }
.tour-badge {
  display: inline-flex; align-items: center; gap: 6px; height: 20px; padding: 0 9px;
  border-radius: 999px; background: var(--amber-dim); border: 1px solid var(--amber-line);
  color: var(--amber); font-size: 10px; font-family: var(--font-display); letter-spacing: .09em;
}
.tour-badge svg { width: 12px; height: 12px; }
.tour-title { font-family: var(--font-display); font-size: 17px; letter-spacing: .04em; color: var(--text); margin: 9px 0 6px; }
.tour-desc { font-size: 12px; color: var(--text-2); line-height: 1.85; }
.tour-desc b { color: var(--amber); font-weight: 600; }
.tour-foot {
  display: flex; align-items: center; gap: 8px; margin-top: 13px; padding-top: 11px;
  border-top: 1px solid var(--line-soft);
}
.tour-skip { font-size: 11px; color: var(--text-4); }
.tour-skip:hover { color: var(--text-2); }
.tour-dots { display: flex; gap: 4px; }
.tour-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--ink-500); }
.tour-dot.done { background: var(--amber-line); }
.tour-dot.on { background: var(--amber); box-shadow: 0 0 8px var(--amber); }

/* ---------- 20. 帮助中心：外观 / 快捷键 / 引导 ---------- */
.help-pane { min-height: 250px; }
.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.theme-card {
  display: flex; flex-direction: column; gap: 9px; padding: 10px; text-align: left;
  border: 1px solid var(--line-soft); border-radius: var(--r-md); background: var(--ink-850);
  transition: border-color .14s, transform .14s, box-shadow .14s;
}
.theme-card:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.theme-card.on { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber-line); }
.theme-thumb {
  position: relative; display: block; height: 64px; border-radius: var(--r-sm);
  background: var(--t-bg); border: 1px solid rgba(128, 132, 142, .3); overflow: hidden;
}
.theme-thumb b { position: absolute; display: block; }
.tt-top { left: 0; right: 0; top: 0; height: 10px; background: var(--t-panel); }
.tt-rail { left: 0; top: 10px; bottom: 0; width: 24%; background: var(--t-panel); }
.tt-stage { left: 24%; right: 0; top: 10px; bottom: 0; background: var(--t-bg); }
.tt-dot {
  left: 34%; top: 24px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--t-accent); box-shadow: 0 0 12px var(--t-accent);
}
.theme-meta { display: flex; flex-direction: column; gap: 4px; }
.theme-name { font-size: 12px; color: var(--text); }
.theme-desc { font-size: 10px; color: var(--text-4); line-height: 1.6; }
/* 卡片上始终占着位置，只切换可见性：
   选中态变化不会让卡片变高变矮，弹窗也就不会跟着跳、网格不会重排 */
.theme-flag {
  display: inline-flex; align-items: center; gap: 4px; font-size: 10px; color: var(--amber);
  visibility: hidden;
}
.theme-card.on .theme-flag { visibility: visible; }
.theme-flag svg { width: 12px; height: 12px; }
.keys-group { margin-bottom: 14px; }
.keys-group:last-child { margin-bottom: 0; }
.keys-title {
  font-family: var(--font-display); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-4); margin-bottom: 7px;
}
.keys-row {
  display: grid; grid-template-columns: 136px 1fr; align-items: center; gap: 10px;
  min-height: 26px; font-size: 12px; color: var(--text-2);
}
.keys-row kbd {
  padding: 3px 7px; border-radius: var(--r-xs); background: var(--ink-880);
  border: 1px solid var(--line); color: var(--text);
  font-family: var(--font-mono); font-size: 11px; text-align: center;
}
.hero-tools { position: absolute; top: 18px; right: 20px; z-index: 3; display: flex; gap: 8px; }

/* ---------- 21. 走位体检 / 时间轴吸附 / 预览补全 ---------- */
.insp-concl {
  display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; margin-bottom: 10px;
  border-radius: var(--r-md); border: 1px solid var(--line-soft); background: var(--ink-850);
}
.insp-concl .insp-ic { flex: none; width: 18px; height: 18px; color: var(--warn-text); }
.insp-concl .insp-ic svg { width: 18px; height: 18px; display: block; }
.insp-concl.ok { background: var(--cyan-dim); border-color: var(--cyan-line); }
.insp-concl.ok .insp-ic { color: var(--cyan); }
.insp-concl-t { font-size: 13px; color: var(--text); }
.insp-concl-d { font-size: 11px; color: var(--text-4); margin-top: 3px; font-family: var(--font-mono); }
.insp-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.insp-loading {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 34px 0;
  color: var(--text-3); font-size: 12px;
}
.insp-loading .spin { display: inline-flex; color: var(--amber); }
.insp-loading .spin svg { width: 16px; height: 16px; }
.insp-list { display: flex; flex-direction: column; gap: 6px; max-height: 42vh; overflow-y: auto; padding-right: 4px; }
.insp-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border: 1px solid var(--line-soft); border-radius: var(--r-sm); background: var(--ink-850);
  transition: border-color .14s, background .14s;
}
.insp-item:hover { border-color: var(--line-strong); background: var(--ink-800); }
.insp-bar { width: 3px; align-self: stretch; border-radius: 3px; flex: none; background: var(--text-4); }
.insp-main { flex: 1; min-width: 0; }
.insp-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--text); }
.insp-detail { font-size: 11px; color: var(--text-4); font-family: var(--font-mono); line-height: 1.7; margin-top: 3px; }
.insp-kind { font-size: 10px; color: var(--text-4); font-family: var(--font-mono); }
.insp-lv {
  display: inline-flex; align-items: center; height: 18px; padding: 0 7px; border-radius: 999px; flex: none;
  font-size: 10px; letter-spacing: .08em; font-family: var(--font-display);
}
.insp-lv.high { background: var(--danger-dim); border: 1px solid var(--danger-line); color: var(--danger-text); }
.insp-lv.mid { background: var(--amber-dim); border: 1px solid var(--amber-line); color: var(--warn-text); }
.insp-lv.low { background: var(--cyan-dim); border: 1px solid var(--cyan-line); color: var(--cyan); }

/* 拖动变化点 / 段落标记时的吸附提示 */
.kf-snap {
  position: absolute; bottom: 30px; transform: translateX(-50%); z-index: 32;
  display: flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px;
  border-radius: 999px; background: var(--amber-dim); border: 1px solid var(--amber-line);
  color: var(--amber); font-size: 10px; font-family: var(--font-mono); white-space: nowrap;
  pointer-events: none;
}
.kf-snap svg { width: 11px; height: 11px; }

/* 预览模式：段落分段与逐帧微调 */
.preview-progress .mk { position: absolute; top: -2px; bottom: -2px; width: 1px; background: var(--wash-4); }
.preview-progress .mk.on { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.preview-seg { font-size: 10px; }

/* ---------- 22. 响应式 ---------- */
@media (max-width: 1440px) {
  :root { --rail-l: 248px; --rail-r: 268px; }
}
@media (max-width: 1200px) {
  :root { --rail-l: 226px; --rail-r: 244px; --timeline-h: 192px; }
  .hero { padding: 44px 28px 26px; }
  .hero-title { font-size: 56px; }
  .section-wrap, .list-foot { padding-left: 28px; padding-right: 28px; }
}
@media (max-width: 1000px) {
  .workbench { grid-template-columns: 1fr; grid-template-areas: "stage" "timeline"; position: relative; }
  .rail { display: none; }
  .workbench.rail-open-left .rail-left {
    display: flex; position: absolute; top: 0; bottom: var(--timeline-h); left: 0;
    width: 262px; z-index: 40; box-shadow: var(--shadow-3);
  }
  .workbench.rail-open-right .rail-right {
    display: flex; position: absolute; top: 0; bottom: var(--timeline-h); right: 0;
    width: 284px; z-index: 40; box-shadow: var(--shadow-3);
  }
  .rail-toggle { display: inline-flex !important; }
  /* 顶栏：手机上按钮多，不再硬挤成一排出横条，改成可横向滑动的图标条 */
  .topbar { gap: 6px; padding: 0 8px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .topbar::-webkit-scrollbar { display: none; }
  .topbar > * { flex: none; }
  .topbar .brand, .topbar .topbar-sep { display: none; }
  .topbar .btn-label { display: none; }
  .topbar .btn { padding: 0 9px; }
  .topbar .btn-icon { padding: 0; }
  .topbar .proj-title { max-width: 150px; font-size: 14px; }
  .topbar .save-state { gap: 0; }
  .topbar .save-state span:not(.save-dot) { display: none; }
  .topbar .member-badge { padding: 0 10px; font-size: 11px; }
  /* 舞台左下角的提示 / 图例上移，给右下角的视图开关条让位（窄屏上两者会叠在一起） */
  .hud-bottom-left { bottom: 50px; }
  .hud-stack { max-width: calc(100% - 32px); }
  /* 触屏上没有滚轮与中键，提示文案换成手势说明 */
  .stage-tip { line-height: 1.5; border-radius: var(--r-md); }
  .hero-title { font-size: 44px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
}
@media (max-width: 700px) {
  body { font-size: 13px; }
  .hero { padding: 34px 18px 22px; }
  .hero-title { font-size: 34px; }
  .hero-sub { font-size: 12px; }
  .section-wrap, .list-foot { padding-left: 18px; padding-right: 18px; }
  .cards { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr; }
  .tl-left { display: none; }
  .modal { max-width: 100%; }
  .preview-progress { width: 180px; }
  .mobile-guard {
    display: flex; align-items: center; gap: 8px; padding: 7px 12px;
    background: var(--cyan-dim); border-bottom: 1px solid var(--cyan-line);
    color: var(--cyan); font-size: 11px;
  }
  .tour-card { width: auto; left: 12px !important; right: 12px; }
  .tour-card::after { display: none; }
  /* 外观主题卡：单列时改成「左预览 + 右文字」，预览固定 108×64 才不会被拉成细长条 */
  .theme-grid { grid-template-columns: 1fr; }
  .theme-card { position: relative; flex-direction: row; align-items: center; gap: 10px; }
  .theme-thumb { flex: none; width: 108px; height: 64px; }
  .theme-meta { flex: 1; min-width: 0; }
  .theme-name { padding-right: 46px; }
  .theme-flag { position: absolute; top: 9px; right: 10px; }
  .keys-row { grid-template-columns: 118px 1fr; }
  .hero-tools { top: 14px; right: 14px; }
  /* 手机上进一步精简顶栏：视频与帮助放到列表页 / 我的账号里 */
  .topbar [data-act="video"], .topbar [data-act="help"] { display: none; }
  .topbar .proj-title { max-width: 104px; }
}

/* ---------- 23. 保持/变化区间 · 舞者形象 · 团队预设 · 视频导出 ---------- */
/* 时间轴：绿 = 保持队形，红 = 队形变化（跟着音乐用 F 打点后一眼看出哪段在动） */
.tl-lane-hold { height: 16px; border-top: 1px solid var(--line-soft); padding-top: 2px; }
.hold-seg {
  position: absolute; top: 2px; height: 12px; border-radius: 3px; overflow: hidden;
  display: flex; align-items: center; padding: 0 5px;
  font-size: 9px; white-space: nowrap;
}
.hold-seg span { overflow: hidden; text-overflow: ellipsis; }
.hold-seg.hold { background: rgba(163, 230, 53, .16); color: #A3E635; border-left: 2px solid #A3E635; }
.hold-seg.move { background: rgba(255, 107, 138, .18); color: #FF6B8A; border-left: 2px solid #FF6B8A; }
.hold-seg.prep { background: rgba(255, 255, 255, .05); color: var(--text-4); border-left: 2px solid var(--line-strong); }

/* 舞者形象选择 */
.avatar-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.avatar-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 4px 2px 3px; border-radius: var(--r-sm); border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .02); color: var(--text-3); font-size: 9px;
}
.avatar-btn:hover { border-color: var(--line-strong); color: var(--text); }
.avatar-btn.on { border-color: var(--amber); background: var(--amber-dim); color: var(--amber); }
.avatar-btn canvas { width: 34px; height: 34px; display: block; }

/* 内置团队 */
.team-row {
  display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left;
  padding: 9px 11px; border-radius: var(--r-md); border: 1px solid var(--line);
  background: rgba(255, 255, 255, .02); color: var(--text-2);
}
.team-row:hover { border-color: var(--amber-line); background: var(--amber-dim); color: var(--text); }
.team-top { display: flex; align-items: baseline; gap: 8px; }
.team-name { font-weight: 600; font-size: 13px; color: var(--text); }
.team-count { font-family: var(--font-mono); font-size: 10px; color: var(--amber); }
.team-desc { font-size: 11px; color: var(--text-3); }
.team-dots { display: flex; gap: 3px; margin-top: 2px; }
.team-dots i { width: 10px; height: 10px; border-radius: 3px; display: block; }

/* 视频导出 */
.video-stage {
  position: relative; display: grid; place-items: center; padding: 8px;
  border-radius: var(--r-md); border: 1px solid var(--line); background: #0B0C0F;
}
.video-stage canvas { display: block; max-width: 100%; border-radius: var(--r-sm); }
.video-bar { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.video-bar .fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--amber), var(--amber-2)); }

/* 触屏：拖动时间轴 / 拖动舞者时不要顺手把页面滚走 */
.stage-host, .tl-right, .tl-lane, .tl-ruler, .tl-wave { touch-action: none; }

/* 手机上的 F 打点按钮（跟着音乐按一下 = 打一个变化点） */
.mobile-f { display: none; }
@media (max-width: 1000px) {
  .mobile-f {
    display: grid; place-items: center; position: absolute; right: 14px;
    /* 抬高一点，别压住画布右下角那一排视图开关 */
    bottom: calc(var(--timeline-h) + 76px);
    width: 60px; height: 60px; border-radius: 50%; z-index: 45;
    background: linear-gradient(180deg, var(--amber), var(--amber-2)); color: #23160A;
    font-family: var(--font-display); font-size: 22px; font-weight: 700;
    border: 1px solid var(--amber-line);
    box-shadow: 0 10px 24px -10px var(--amber-2), var(--shadow-2);
    touch-action: none; user-select: none;
  }
  .mobile-f:active { transform: scale(.94); }
}

/* 移动端简化编辑：左栏改成横向控制条，时间轴与画布都能用手指操作 */
@media (max-width: 700px) {
  :root { --timeline-h: 204px; }
  .timeline { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .tl-left {
    display: flex; flex-direction: row; align-items: center; gap: 10px;
    padding: 7px 10px; overflow-x: auto; overflow-y: hidden;
    border-right: none; border-bottom: 1px solid var(--line-soft);
  }
  .tl-left .tl-zoomrow, .tl-left .tl-meta { display: none; }
  .tl-left .tl-transport, .tl-left > .row, .tl-left > .row-between { flex: none; }
  .tl-left .btn-play { width: 34px; height: 34px; }
  .tl-left .tl-clock .now { font-size: 15px; }
  .tl-lane-hold { height: 14px; }
  .hold-seg { font-size: 8px; }
  .avatar-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- 24. 账号 / 会员 / 后台管理 ---------- */

/* 右上角会员标识：免费用户要显眼（暖色 + 呼吸光点），会员是低调的身份牌 */
.member-badge {
  display: inline-flex; align-items: center; gap: 6px; position: relative;
  height: 28px; padding: 0 12px; border-radius: 999px; flex: none;
  font-size: 12px; font-family: var(--font-display); letter-spacing: .04em; white-space: nowrap;
  border: 1px solid var(--line-strong); background: var(--ink-800); color: var(--text-2);
  transition: transform .14s, box-shadow .14s, border-color .14s, background .14s;
}
.member-badge svg { width: 14px; height: 14px; flex: none; }
.member-badge:hover { transform: translateY(-1px); }

/* 免费版：暖色实心，右上角一个跳动的小点，提示"点我看看" */
.member-badge.is-free {
  border-color: transparent; color: var(--on-amber);
  background: linear-gradient(135deg, var(--amber), var(--amber-2));
  box-shadow: 0 6px 18px -10px var(--amber-2);
}
.member-badge.is-free:hover { box-shadow: 0 8px 22px -8px var(--amber-2); }
.member-badge.is-free::after {
  content: ''; position: absolute; top: -3px; right: -3px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--danger); border: 1px solid var(--ink-900);
  animation: badge-pulse 1.8s ease-in-out infinite;
}
@keyframes badge-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: .65; }
}

/* 会员：青色描边，显得"已解锁" */
.member-badge.is-member {
  border-color: var(--cyan-line); background: var(--cyan-dim); color: var(--cyan);
}
.member-badge.is-guest { color: var(--text-3); }

/* 试用受限时把「导出 / 分享」标成待解锁：虚线框 + 右上角一个亮点 */
.btn-locked { position: relative; opacity: .58; border-style: dashed; }
.btn-locked:hover { opacity: 1; }
.btn-locked::after {
  content: ''; position: absolute; top: 1px; right: 1px; width: 5px; height: 5px;
  border-radius: 50%; background: var(--amber); box-shadow: 0 0 6px var(--amber);
}

/* 账号卡片（我的账号 / 后台用户面板共用） */
.acct-card {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--ink-850);
}
.acct-avatar {
  width: 42px; height: 42px; flex: none; display: grid; place-items: center;
  border-radius: 50%; background: linear-gradient(160deg, var(--amber), var(--amber-2));
  color: var(--on-amber); font-family: var(--font-display); font-size: 19px; font-weight: 700;
}
.acct-main { flex: 1; min-width: 0; }
.acct-name { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--text); }
.acct-sub { font-size: 11px; color: var(--text-3); margin-top: 4px; line-height: 1.6; }
.acct-sub b { color: var(--amber); }

.plan-pill {
  flex: none; display: inline-flex; align-items: center; height: 20px; padding: 0 9px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--ink-800);
  color: var(--text-4); font-size: 10px; font-family: var(--font-mono); white-space: nowrap;
}
.plan-pill.on { border-color: var(--amber-line); background: var(--amber-dim); color: var(--amber); }

/* 价格表：月 / 年 / 永久（可点选） */
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.price-card {
  position: relative; display: flex; flex-direction: column; align-items: center;
  padding: 14px 10px 12px; text-align: center; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--ink-850);
  transition: border-color .14s, background .14s, transform .14s;
}
.price-card:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.price-card.hot { border-color: var(--amber-line); }
.price-card.on {
  border-color: var(--amber); background: var(--amber-dim);
  box-shadow: 0 0 0 1px var(--amber-line), 0 8px 22px -14px var(--amber-2);
}
.price-radio {
  position: absolute; top: 8px; right: 8px; width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center; border: 1px solid var(--line-strong);
  background: var(--ink-800); color: transparent;
}
.price-radio svg { width: 10px; height: 10px; }
.price-card.on .price-radio { background: var(--amber); border-color: var(--amber); color: var(--on-amber); }
.price-name { font-size: 12px; color: var(--text-2); }
.price-num {
  margin: 7px 0 2px; font-family: var(--font-display); font-size: 27px; line-height: 1;
  color: var(--text); letter-spacing: .02em;
}
.price-card.on .price-num { color: var(--amber); }
.price-unit { font-size: 10px; color: var(--text-4); font-family: var(--font-mono); }
.price-note { font-size: 10px; color: var(--text-4); line-height: 1.5; margin-top: 7px; }
.price-tag {
  position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  height: 16px; padding: 0 8px; border-radius: 999px; display: inline-flex; align-items: center;
  background: var(--amber); color: var(--on-amber); font-size: 9px; font-weight: 600; white-space: nowrap;
}
.plan-picker { display: block; }
.plan-cta { width: 100%; margin-top: 12px; }

/* ---------- 后台：左侧导航 + 右侧内容 ---------- */
.page-admin {
  height: 100%; display: grid; grid-template-columns: 212px minmax(0, 1fr);
  background: var(--ink-900);
}
.admin-side {
  display: flex; flex-direction: column; min-height: 0;
  border-right: 1px solid var(--line); background: var(--ink-880);
}
.admin-side-brand {
  display: flex; align-items: center; gap: 8px; height: var(--topbar-h); padding: 0 16px;
  border-bottom: 1px solid var(--line-soft); flex: none;
}
.admin-side-name { font-family: var(--font-display); font-size: 15px; letter-spacing: .08em; color: var(--text); }
.admin-side-name em { color: var(--amber); font-style: normal; }
.admin-side-tag {
  font-size: 9px; letter-spacing: .14em; color: var(--text-4);
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 6px;
}
.admin-nav { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; }
.admin-nav button {
  display: flex; align-items: center; gap: 9px; width: 100%; height: 34px; padding: 0 10px;
  border: 1px solid transparent; border-radius: var(--r-sm); background: none;
  color: var(--text-3); font-size: 12.5px; text-align: left;
}
.admin-nav button svg { width: 15px; height: 15px; flex: none; }
.admin-nav button:hover { background: var(--wash-1); color: var(--text); }
.admin-nav button.on {
  background: var(--amber-dim); border-color: var(--amber-line); color: var(--amber); font-weight: 600;
}
.admin-side-foot {
  flex: none; padding: 12px; border-top: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 8px;
}
.admin-side-who { display: flex; align-items: center; gap: 8px; font-size: 11px; line-height: 1.5; }
.admin-side-who b { display: block; color: var(--text); font-size: 12px; }
.admin-side-who i { color: var(--text-4); font-style: normal; }
.admin-side-foot .btn { justify-content: center; }

.admin-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.admin-main-head {
  flex: none; display: flex; align-items: center; gap: 12px;
  padding: 16px 22px 14px; border-bottom: 1px solid var(--line); background: var(--ink-880);
}
.admin-main-head h1 { margin: 0; font-family: var(--font-display); font-size: 21px; color: var(--text); }
.admin-main-head p { margin: 3px 0 0; font-size: 11.5px; color: var(--text-4); }
.admin-live {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 10px;
  border-radius: 999px; border: 1px solid var(--cyan-line); background: var(--cyan-dim);
  color: var(--cyan); font-size: 10px; font-family: var(--font-mono);
}
.admin-live svg { width: 11px; height: 11px; }
.admin-body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 22px 48px; }
.admin-center { text-align: center; padding: 90px 20px; color: var(--text-2); font-size: 13px; }
.admin-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.admin-search {
  display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--ink-850); color: var(--text-4);
}
.admin-search svg { width: 13px; height: 13px; }
.admin-search .input { border: none; background: none; height: 28px; padding: 0; width: 210px; }
.admin-search .input:focus { outline: none; }
.admin-search:focus-within { border-color: var(--amber-line); }
.admin-list { min-height: 120px; }
.admin-block {
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--ink-850);
}
.admin-block-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.admin-block-head b { display: block; font-size: 13px; color: var(--text); }
.admin-block-head span { font-size: 11px; color: var(--text-4); }
.admin-block-ic {
  width: 28px; height: 28px; flex: none; display: grid; place-items: center; margin-top: 1px;
  border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--ink-800); color: var(--amber);
}
.admin-block-ic svg { width: 14px; height: 14px; }
.admin-block-head .label-xs { flex: 1; }
.admin-h3 {
  margin: 24px 0 10px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-3); font-weight: 600;
}
.admin-err {
  display: flex; align-items: center; gap: 8px; padding: 13px 15px;
  border: 1px solid var(--danger-line); border-radius: var(--r-md);
  background: var(--danger-dim); color: var(--danger-text); font-size: 12px;
}
.admin-err svg { width: 14px; height: 14px; flex: none; }
.admin-loading {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 46px 0;
  color: var(--text-3); font-size: 12px;
}
.admin-loading .spin { display: inline-flex; color: var(--amber); animation: badge-pulse 1.4s ease-in-out infinite; }
.admin-loading .spin svg { width: 15px; height: 15px; }
.admin-pager { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; padding: 14px 0 4px; }
.admin-pager button {
  min-width: 28px; height: 26px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--ink-850); color: var(--text-3); font-size: 11px; font-family: var(--font-mono);
}
.admin-pager button:hover { border-color: var(--line-strong); color: var(--text); }
.admin-pager button.on { background: var(--amber-dim); border-color: var(--amber-line); color: var(--amber); }
.admin-settings { display: flex; flex-direction: column; gap: 14px; max-width: 720px; }
.admin-savebar {
  position: sticky; bottom: 0; display: flex; align-items: center; gap: 8px;
  margin: 4px -4px -8px; padding: 12px 4px;
  background: linear-gradient(180deg, transparent, var(--ink-900) 40%);
}

/* 概览数字 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 10px; }
.stat-card {
  position: relative; padding: 14px 15px 13px; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--ink-850);
}
.stat-card .stat-ic {
  position: absolute; top: 12px; right: 12px; width: 22px; height: 22px;
  display: grid; place-items: center; color: var(--text-4);
}
.stat-card .stat-ic svg { width: 15px; height: 15px; }
.stat-card .n { font-family: var(--font-display); font-size: 30px; line-height: 1.05; color: var(--text); }
.stat-card .l { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.stat-card .s { font-size: 10px; color: var(--text-4); margin-top: 2px; }
.stat-card.ok { border-color: var(--cyan-line); background: var(--cyan-dim); }
.stat-card.ok .n, .stat-card.ok .stat-ic { color: var(--cyan); }
.stat-card.warn { border-color: var(--danger-line); background: var(--danger-dim); }
.stat-card.warn .n, .stat-card.warn .stat-ic { color: var(--danger-text); }

/* 会员转化进度 */
.admin-rate { margin-top: 14px; }
.admin-bar-track {
  height: 8px; border-radius: 999px; background: var(--ink-700); overflow: hidden;
}
.admin-bar-track i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--amber), var(--amber-2));
}

/* 用户 / 项目列表里的小件 */
.a-avatar {
  width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: var(--ink-700); border: 1px solid var(--line-strong);
  font-family: var(--font-display); font-size: 13px; color: var(--amber);
}
.a-user { display: flex; align-items: center; gap: 9px; }
.a-user b { display: block; font-size: 12.5px; color: var(--text); font-weight: 600; }
.a-user i { font-style: normal; font-size: 10.5px; color: var(--text-4); font-family: var(--font-mono); }
.a-dot { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; }
.a-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--text-4); }
.a-dot.on { color: var(--ok); }
.a-dot.on::before { background: var(--ok); }
.a-dot.off { color: var(--danger-text); }
.a-dot.off::before { background: var(--danger); }
.a-name { display: block; font-size: 12.5px; color: var(--text); }
.a-id { display: block; font-style: normal; font-size: 10px; color: var(--text-4); font-family: var(--font-mono); }
.a-empty { text-align: center; color: var(--text-4); padding: 26px 12px !important; }
.a-empty svg { width: 12px; height: 12px; vertical-align: -2px; margin-right: 4px; }
.a-empty-box {
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 46px 20px;
  border: 1px dashed var(--line-strong); border-radius: var(--r-md); color: var(--text-4);
}
.a-empty-box svg { width: 18px; height: 18px; }
.a-empty-box b { color: var(--text-2); font-size: 13px; }
.a-empty-box span { font-size: 11.5px; }

/* 数据表 */
.table-wrap {
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--ink-850); overflow-x: auto;
}
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th {
  text-align: left; padding: 9px 12px; font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-4); font-weight: 600; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.data-table td { padding: 9px 12px; color: var(--text-2); border-bottom: 1px solid var(--line-soft); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--wash-1); color: var(--text); }
.data-table td .btn { height: 24px; padding: 0 9px; font-size: 11px; }

@media (max-width: 1000px) {
  .page-admin { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .admin-side {
    flex-direction: row; align-items: center; gap: 4px; padding-right: 8px;
    border-right: none; border-bottom: 1px solid var(--line); overflow: hidden;
  }
  .admin-side-brand { height: auto; padding: 8px 10px; border-bottom: none; flex: none; }
  .admin-side-tag { display: none; }
  .admin-nav {
    flex: 1 1 auto; min-width: 0; flex-direction: row; gap: 2px; padding: 8px 2px;
    overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  }
  .admin-nav::-webkit-scrollbar { display: none; }
  .admin-nav button { width: auto; height: 30px; flex: none; white-space: nowrap; }
  .admin-side-foot { flex: none; flex-direction: row; gap: 4px; padding: 8px 0 8px 4px; border-top: none; }
  .admin-side-foot .btn-label { display: none; }
  .admin-side-foot .btn { width: 30px; padding: 0; }
  .admin-side-who { display: none; }
}
@media (max-width: 700px) {
  .price-grid { grid-template-columns: 1fr; }
  .admin-body { padding: 14px 12px 40px; }
  .admin-main-head { padding: 12px 14px; }
  .acct-card { flex-wrap: wrap; }
  .member-badge { padding: 0 10px; font-size: 11px; }
}

/* ---------- 26. 会员开通页 ---------- */
.page-upgrade {
  height: 100%; overflow-y: auto;
  background:
    radial-gradient(760px 380px at 78% -8%, var(--amber-dim), transparent 70%),
    radial-gradient(620px 320px at 4% 4%, var(--cyan-dim), transparent 72%),
    var(--ink-900);
}
.up-top {
  display: flex; align-items: center; gap: 10px; height: var(--topbar-h); padding: 0 18px;
  border-bottom: 1px solid var(--line); background: var(--ink-880);
  position: sticky; top: 0; z-index: 10;
}
.up-brand {
  font-family: var(--font-display); font-size: 15px; letter-spacing: .06em; color: var(--text-2);
  /* 窄屏上宁可截断也不要折行：折成两三行会撑破顶栏高度，看起来像被下面内容盖住了 */
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.up-brand em { color: var(--amber); font-style: normal; }
.up-body { max-width: 940px; margin: 0 auto; padding: 30px 22px 60px; display: flex; flex-direction: column; gap: 26px; }
.up-hero { text-align: center; }
.up-title {
  margin: 0; font-family: var(--font-display); font-size: 32px; line-height: 1.3;
  color: var(--text); letter-spacing: .01em;
}
.up-sub { margin: 12px auto 0; max-width: 34em; font-size: 13px; line-height: 1.9; color: var(--text-3); }
.up-status { margin-top: 16px; }
.up-banner {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; text-align: left;
  border: 1px solid var(--amber-line); border-radius: 999px; background: var(--amber-dim);
  color: var(--warn-text); font-size: 12px; max-width: 100%;
}
.up-banner svg { width: 14px; height: 14px; flex: none; }
.up-banner b { color: var(--amber); }
.up-banner.ok { border-color: var(--cyan-line); background: var(--cyan-dim); color: var(--cyan); }
.up-h2 {
  margin: 0 0 12px; font-size: 11px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-3); font-weight: 600;
}
.up-plans { padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--ink-880); }
.up-plans .price-card { background: var(--ink-850); }
.up-pay-note {
  display: flex; align-items: flex-start; gap: 6px; margin-top: 12px;
  font-size: 11px; color: var(--text-4); line-height: 1.7;
}
.up-pay-note svg { width: 13px; height: 13px; flex: none; margin-top: 2px; }
.up-benefit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 8px; }
.up-benefit {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 13px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--ink-850);
  font-size: 12px; color: var(--text-2); line-height: 1.6;
}
.up-benefit-ic {
  width: 26px; height: 26px; flex: none; display: grid; place-items: center;
  border-radius: var(--r-sm); background: var(--amber-dim); color: var(--amber);
}
.up-benefit-ic svg { width: 14px; height: 14px; }
.up-free {
  display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; padding: 11px 13px;
  border: 1px dashed var(--line-strong); border-radius: var(--r-md);
  font-size: 12px; color: var(--text-3); line-height: 1.7;
}
.up-free svg { width: 13px; height: 13px; flex: none; margin-top: 3px; color: var(--ok); }
.up-q {
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--ink-850);
  padding: 12px 14px; margin-bottom: 8px;
}
.up-q summary { cursor: pointer; font-size: 12.5px; color: var(--text); list-style: none; }
.up-q summary::-webkit-details-marker { display: none; }
.up-q summary::before { content: '＋'; color: var(--amber); margin-right: 8px; font-family: var(--font-mono); }
.up-q[open] summary::before { content: '－'; }
.up-q p { margin: 9px 0 0 20px; font-size: 12px; line-height: 1.85; color: var(--text-3); }
.up-foot { padding-top: 6px; }

@media (max-width: 700px) {
  .up-title { font-size: 24px; }
  .up-body { padding: 22px 14px 48px; gap: 20px; }
  .up-plans { padding: 14px; }
  .up-banner { border-radius: var(--r-md); align-items: flex-start; }
  /* 手机顶栏：只留「返回 + 舞阵通 · 会员中心 + 我的账号」，
     会员状态下面正文里已经说了，顶栏再挤一个胶囊会把站名压成两三行 */
  .up-top { gap: 8px; padding: 0 12px; }
  .up-top .brand-mark, .up-top .plan-pill { display: none; }
  .up-brand { flex: 1 1 auto; font-size: 13px; }
}

/* ---------- 25. 独立登录 / 注册页 ---------- */
.page-login {
  min-height: 100%; height: 100%; overflow-y: auto;
  background:
    radial-gradient(900px 420px at 12% -6%, var(--amber-dim), transparent 70%),
    radial-gradient(700px 380px at 96% 8%, var(--cyan-dim), transparent 72%),
    var(--ink-900);
}
.login-inner {
  min-height: 100%; max-width: 1080px; margin: 0 auto; padding: 44px 28px;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr);
  gap: 46px; align-items: center;
}

/* 左：品牌与卖点 */
.login-brand { min-width: 0; }
.login-logo { display: flex; align-items: center; gap: 9px; }
.login-logo .brand-mark { width: 26px; height: 26px; }
.login-logo-name {
  font-family: var(--font-display); font-size: 21px; letter-spacing: .1em; color: var(--text);
}
.login-logo-name em { color: var(--amber); font-style: normal; }
.login-logo-tag {
  font-size: 10px; letter-spacing: .16em; color: var(--text-4);
  border-left: 1px solid var(--line-strong); padding-left: 9px;
}
.login-h1 {
  margin: 24px 0 14px; font-family: var(--font-display); font-size: 40px; line-height: 1.24;
  letter-spacing: .01em; color: var(--text); font-weight: 600;
}
.login-h1 em { color: var(--amber); font-style: normal; }
.login-sub { font-size: 13px; line-height: 1.85; color: var(--text-3); max-width: 30em; }
.login-points { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.login-point { display: flex; align-items: flex-start; gap: 10px; }
.login-point-ic {
  width: 26px; height: 26px; flex: none; display: grid; place-items: center; margin-top: 1px;
  border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--ink-850); color: var(--amber);
}
.login-point-ic svg { width: 14px; height: 14px; }
.login-point-tx { min-width: 0; font-size: 12px; line-height: 1.6; }
.login-point-tx b { display: block; color: var(--text); font-weight: 600; }
.login-point-tx i { color: var(--text-4); font-style: normal; }

/* 右：表单卡片 */
.login-card {
  padding: 26px 24px 22px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--ink-880); box-shadow: var(--shadow-3);
}
.login-head { margin-bottom: 16px; }
.login-title { margin: 0; font-family: var(--font-display); font-size: 24px; color: var(--text); }
.login-desc { margin: 6px 0 0; font-size: 12px; color: var(--text-4); }
.login-card [data-role="notice"]:not(:empty),
.login-card [data-role="form"] { margin-bottom: 14px; }
.login-submit { width: 100%; height: 42px; margin-top: 2px; font-size: 14px; }
.login-foot { margin-top: 14px; font-size: 11px; line-height: 1.8; color: var(--text-4); }
.login-foot b { color: var(--text-2); }
.link-btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 0; border: none; background: none;
  color: var(--amber); font-size: 11px; text-decoration: underline; text-underline-offset: 3px;
}
.link-btn svg { width: 11px; height: 11px; }

@media (max-width: 900px) {
  .login-inner { grid-template-columns: 1fr; gap: 26px; padding: 30px 18px 44px; align-items: start; }
  .login-h1 { font-size: 27px; margin: 18px 0 10px; }
  .login-points { display: none; }
  .login-card { padding: 20px 16px 18px; }
}

/* ---------- 27. 手机上的弹窗与触屏细节 ---------- */
/* 变化点切换器：时间轴上的菱形在手机上太细，用这排「‹ 3/8 ›」逐个切（切换即选中） */
.kf-step { display: none; }
.kf-step-btn {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  height: 34px; min-width: 92px; max-width: 124px; padding: 0 9px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--ink-850); text-align: left;
}
.kf-step-btn:hover { border-color: var(--line-strong); }
.kf-step-no { font-family: var(--font-mono); font-size: 10px; color: var(--amber); }
.kf-step-name {
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11px; color: var(--text-2);
}

@media (max-width: 1000px) {
  .kf-step { display: flex; align-items: center; gap: 2px; flex: none; }
  /* 舞台右下角那排视图开关在手机上太密，按钮放大到点得准，整体仍放得下 */
  .hud-bottom-right { padding: 0 5px; gap: 0; }
  .hud-bottom-right .mini-btn { width: 26px; height: 26px; }
  .hud-bottom-right .hud-zoom { min-width: 40px; }
}

/* 导出 / 分发的卡片：窄屏（含平板竖屏）把预览图、说明、按钮竖着排，别挤成一团 */
@media (max-width: 860px) {
  .pv-item { flex-direction: column; align-items: stretch; gap: 9px; }
  .pv-item canvas { width: 100%; max-width: 220px; height: auto; }
  .pv-item > .btn { width: 100%; }
  .act-list { flex-direction: column; }
  .act-list > .btn { width: 100%; justify-content: flex-start; }
  .dist-head { align-items: stretch; }
  .dist-row { flex-wrap: wrap; }
  .dist-qr { width: 72px; height: 72px; }
  .dist-info { flex: 1 1 60%; }
  .dist-row > .btn:not(.btn-icon) { flex: 1 1 auto; }
  .dist-row > .btn-icon { flex: none; width: 34px; }
  .dist-list { max-height: 48vh; }
}

@media (max-width: 700px) {
  /* 手机：弹窗留白收紧、可用高度加大；遮罩浅一点，身后的舞台不再被彻底遮死 */
  .modal-mask { padding: 10px; background: rgba(6, 7, 10, .6); backdrop-filter: blur(3px); }
  .modal { max-height: 92vh; border-radius: var(--r-lg); }
  .modal-head { padding: 13px 14px 10px; }
  .modal-body { padding: 13px 14px; gap: 12px; }
  .modal-foot { padding: 10px 14px; }
  .modal-foot .btn { height: 34px; }
}

/* 触屏设备：手指够不着的地方都放大一点；输入框字号 ≥16px，iOS 才不会自动放大页面 */
@media (pointer: coarse) {
  .kf-node::after { content: ''; position: absolute; inset: -6px; }
  .mini-btn { width: 26px; height: 26px; }
  .seg button { height: 28px; padding: 0 11px; }
  .modal-body .input, .modal-body .select, .modal-body .textarea { font-size: 16px; }
}

/* ---------- 28. 手机访问（电脑端扫码） ---------- */
/* 列表页左下角常驻的小卡：电脑上一直看得到「手机扫码」这个入口 */
.mob-card {
  position: fixed; left: 20px; bottom: 20px; z-index: 60;
  display: flex; align-items: center; gap: 11px; padding: 10px 11px;
  background: var(--modal-bg); border: 1px solid var(--line-strong); border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  backdrop-filter: blur(14px) saturate(1.15); -webkit-backdrop-filter: blur(14px) saturate(1.15);
  animation: rise .5s cubic-bezier(.2,.7,.3,1) both;
}
.mob-card-qr { width: 92px; height: 92px; flex: none; border-radius: var(--r-sm); background: #FFFFFF; }
.mob-card-tx { display: flex; flex-direction: column; gap: 5px; }
.mob-card-t { font-family: var(--font-display); font-size: 13px; letter-spacing: .04em; color: var(--text); }
.mob-card-s { font-size: 10px; color: var(--text-4); }
/* 桌面端：页脚那一行给左下角的小卡让位，别压住存储提示 */
@media (min-width: 1001px) {
  html.mob-card-on .list-foot { padding-left: 292px; }
}
@media (max-width: 1000px) {
  /* 自己就是手机，不需要「扫码用手机」 */
  .mob-card { display: none; }
  .topbar [data-act="mobile"] { display: none; }
  .hero-tools [data-act="mobile"] { display: none; }
}

.mob-open-qr { display: flex; flex-direction: column; align-items: center; gap: 9px; }
.mob-open-qr canvas {
  padding: 9px; border-radius: var(--r-md);
  background: #FFFFFF; box-shadow: 0 0 0 1px rgba(128, 132, 142, .35);
}
.mob-open-hint { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-4); }
.mob-open-hint svg { width: 13px; height: 13px; }
