/* ============ 字幕工坊 · Design tokens ============ */
:root {
  --bg: #0a0a0d;
  --bg-2: #111116;
  --surface: rgba(255, 255, 255, 0.055);
  --surface-2: rgba(255, 255, 255, 0.085);
  --surface-3: rgba(255, 255, 255, 0.13);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #f5f5f7;
  --muted: #9b9ba7;
  --dim: #66666f;
  --accent: #d6ff3f;          /* 电光青柠 */
  --accent-ink: #0a0a0d;
  --violet: #8b6cff;
  --pink: #ff5fa2;
  --danger: #ff5b5b;
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius: 14px;
  --radius-sm: 10px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --font: "Geist Variable", -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --display: "Instrument Serif", "Noto Serif SC", serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --topbar-h: 60px;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  font-feature-settings: "ss01", "cv11";
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
[hidden] { display: none !important; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.88em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; }

/* ---------- 背景：极光 + 颗粒 ---------- */
.aurora { position: fixed; inset: -20vmax; z-index: -2; filter: blur(80px) saturate(140%); opacity: 0.55; pointer-events: none; }
.aurora i { position: absolute; border-radius: 50%; mix-blend-mode: screen; animation: drift 22s var(--ease) infinite alternate; }
.aurora i:nth-child(1) { width: 55vmax; height: 55vmax; left: 5%; top: -5%; background: radial-gradient(circle, #5b3cff 0%, transparent 65%); }
.aurora i:nth-child(2) { width: 45vmax; height: 45vmax; right: 0; top: 20%; background: radial-gradient(circle, #ff4f9a 0%, transparent 65%); animation-duration: 28s; animation-delay: -6s; }
.aurora i:nth-child(3) { width: 40vmax; height: 40vmax; left: 30%; bottom: -5%; background: radial-gradient(circle, #b8ff2e 0%, transparent 60%); opacity: 0.55; animation-duration: 32s; animation-delay: -12s; }
body:not([data-view="home"]) .aurora { opacity: 0.28; }
@keyframes drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(6vmax, -4vmax, 0) scale(1.12); }
  100% { transform: translate3d(-5vmax, 5vmax, 0) scale(0.95); }
}
.grain {
  position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: 0.07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- 玻璃 ---------- */
.glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
}

/* ---------- 图标 ---------- */
.i { width: 1.15em; height: 1.15em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 按钮 ---------- */
.btn {
  --h: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 20px; border-radius: 999px; font-weight: 600; letter-spacing: -0.01em;
  transition: transform 0.25s var(--spring), background 0.2s, box-shadow 0.3s, opacity 0.2s;
  white-space: nowrap; text-decoration: none; user-select: none;
}
.btn:active { transform: scale(0.96); }
.btn-primary {
  background: var(--accent); color: var(--accent-ink);
  box-shadow: 0 0 0 1px rgba(214, 255, 63, 0.5), 0 10px 30px -8px rgba(214, 255, 63, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.btn-primary:hover { box-shadow: 0 0 0 1px rgba(214, 255, 63, 0.7), 0 14px 40px -8px rgba(214, 255, 63, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.6); }
.btn-ghost { background: var(--surface-2); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-sm { --h: 36px; padding: 0 14px; font-size: 14px; }
.btn-xs { --h: 30px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn-lg { --h: 54px; padding: 0 26px; font-size: 16px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none;
  transition: background 0.2s, transform 0.25s var(--spring);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(0.9); }
.icon-btn .i { width: 20px; height: 20px; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: calc(var(--topbar-h) + var(--safe-t)); padding: var(--safe-t) 16px 0;
  display: flex; align-items: center; gap: 12px;
}
body:not([data-view="home"]) .topbar {
  background: rgba(10, 10, 13, 0.6);
  backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.02em; font-size: 16px; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); display: grid; align-content: end; justify-items: center; gap: 3px; padding-bottom: 6px; box-shadow: 0 6px 20px -6px rgba(214, 255, 63, 0.7); }
.brand-mark i { display: block; height: 3.5px; border-radius: 2px; background: var(--accent-ink); }
.brand-mark i:first-child { width: 17px; }
.brand-mark i:last-child { width: 11px; }
.topbar-file { flex: 1; min-width: 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.asr-pill { display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); }
.asr-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); }
.asr-pill.ok .dot { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.asr-pill.demo .dot { background: #ffb547; box-shadow: 0 0 10px #ffb547; }
.only-editor { display: none; }
body[data-view="editor"] .only-editor { display: none; }
body[data-view="editor"] .asr-pill { display: none; }

/* ---------- 视图切换 ---------- */
.view { display: none; }
body[data-view="home"] .view-home,
body[data-view="processing"] .view-processing,
body[data-view="editor"] .view-editor { display: block; animation: viewIn 0.6s var(--ease) backwards; }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px) scale(0.99); filter: blur(6px); } }

/* ---------- 首页 ---------- */
.view-home { padding: 24px 20px calc(40px + var(--safe-b)); max-width: 1080px; margin: 0 auto; }
.hero { padding: 6vh 0 28px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 20px; padding: 6px 12px 6px 8px; font-size: 13px; color: var(--text); border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.eyebrow .spark { color: var(--accent); display: inline-flex; }
.hero h1 { margin: 0; font-size: clamp(46px, 12vw, 104px); line-height: 0.98; letter-spacing: -0.045em; font-weight: 800; }
.hero .nw { white-space: nowrap; }
.hero h1 em { font-family: var(--display); font-style: italic; font-weight: 400; letter-spacing: -0.02em; background: linear-gradient(100deg, var(--accent) 10%, #7cffc4 50%, var(--violet) 95%); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: 0.08em; }
.lede { margin: 22px 0 0; max-width: 34em; color: var(--muted); font-size: clamp(15px, 3.8vw, 18px); line-height: 1.65; }

.drop {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 280px; padding: 36px 24px; margin-top: 8px; border-radius: var(--radius-xl); cursor: pointer; text-align: center; isolation: isolate;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  transition: transform 0.4s var(--spring), border-color 0.3s;
}
.drop-ring { position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; z-index: -1; opacity: 0.8;
  background: conic-gradient(from var(--ang, 0deg), transparent 0 55%, var(--accent) 70%, var(--violet) 82%, transparent 95%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 6s linear infinite; }
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes spin { to { --ang: 360deg; } }
.drop:hover { transform: translateY(-2px); }
.drop.over { transform: scale(1.015); border-color: var(--accent); }
.drop.over .drop-ring { opacity: 1; animation-duration: 1.5s; }
.drop-icon { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 6px; }
.drop-icon .i { width: 28px; height: 28px; color: var(--accent); }
.drop-title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.drop-sub { color: var(--muted); font-size: 13px; }
.drop-btn { margin-top: 14px; }

.features { list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.features li { padding: 16px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 2px; }
.features b { font-family: var(--display); font-style: italic; font-weight: 400; font-size: 22px; color: var(--accent); line-height: 1; margin-bottom: 8px; }
.features span { font-weight: 650; }
.features small { color: var(--muted); font-size: 12.5px; }

/* ---------- 处理中 ---------- */
.view-processing { padding: 20px 16px calc(24px + var(--safe-b)); }
.proc-card { max-width: 440px; margin: 4vh auto 0; padding: 28px 24px; border-radius: var(--radius-xl); text-align: center; position: relative; overflow: hidden; }
.proc-thumb { position: absolute; inset: 0; z-index: -1; opacity: 0.35; }
.proc-thumb video { width: 100%; height: 100%; object-fit: cover; filter: blur(30px) saturate(1.4); transform: scale(1.2); }
.proc-card h2 { margin: 18px 0 18px; font-size: 22px; letter-spacing: -0.02em; }
.ring { --p: 0; position: relative; width: 132px; height: 132px; margin: 8px auto 0; }
.ring-lg { width: 150px; height: 150px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; }
.ring-bg { stroke: rgba(255, 255, 255, 0.08); }
.ring-fg { stroke: var(--accent); stroke-linecap: round; stroke-dasharray: calc(var(--p) * 1) 100; transition: stroke-dasharray 0.4s var(--ease); filter: drop-shadow(0 0 8px rgba(214, 255, 63, 0.6)); }
.ring-num { position: absolute; inset: 0; display: grid; place-items: center; font-size: 30px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.steps { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 8px; text-align: left; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: rgba(0, 0, 0, 0.25); color: var(--dim); font-weight: 550; transition: color 0.3s, background 0.3s; }
.steps li::before { content: ""; width: 20px; height: 20px; border-radius: 50%; border: 2px solid currentColor; flex: none; box-sizing: border-box; }
.steps li.active { color: var(--text); background: rgba(255, 255, 255, 0.08); }
.steps li.active::before { border-color: var(--accent); border-right-color: transparent; animation: rot 0.8s linear infinite; }
.steps li.done { color: var(--muted); }
.steps li.done::before { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230a0a0d' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center/12px no-repeat; border-color: var(--accent); }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- 编辑器 ---------- */
.view-editor { padding: 0 0 calc(96px + var(--safe-b)); }
.stage {
  position: sticky; top: calc(var(--topbar-h) + var(--safe-t)); z-index: 20;
  padding: 10px 12px 12px; background: var(--bg);
  box-shadow: 0 18px 24px -6px var(--bg);
}
.player {
  position: relative; margin: 0 auto; border-radius: var(--radius-lg); overflow: hidden; background: #000;
  display: grid; place-items: center; width: 100%; height: 100%;
  box-shadow: 0 0 0 1px var(--line), 0 30px 80px -30px rgba(0, 0, 0, 0.9);
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.player-box { height: min(46vh, 520px); display: flex; align-items: center; justify-content: center; transition: height 0.35s var(--ease); }
body.compact .player-box { height: min(30vh, 320px); }
body.compact .transport { margin-top: 8px; }
.player video { width: 100%; height: 100%; object-fit: contain; display: block; }
.overlay { position: absolute; left: 0; top: 0; pointer-events: none; }
.guide { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed rgba(214, 255, 63, 0.9); opacity: 0; transition: opacity 0.2s; pointer-events: none; }
.guide span { position: absolute; right: 10px; top: -26px; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.guide.snap { border-top-style: solid; }
.player.dragging .guide { opacity: 1; }
.player.hover-sub { cursor: grab; }
.player.dragging { cursor: grabbing; }
.big-play {
  position: absolute; width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.16); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.25); color: #fff; transition: opacity 0.3s, transform 0.35s var(--spring);
}
.big-play .i { width: 28px; height: 28px; fill: currentColor; stroke: none; margin-left: 3px; }
.player.playing .big-play { opacity: 0; transform: scale(0.7); pointer-events: none; }

.transport { display: flex; align-items: center; gap: 8px; margin: 10px auto 0; padding: 4px 14px 4px 4px; border-radius: 999px; max-width: 100%; }
.transport .icon-btn .i { fill: currentColor; stroke: none; }
.time { font-size: 12px; font-variant-numeric: tabular-nums; min-width: 34px; text-align: center; }
.time.dim { color: var(--muted); }
.scrub { position: relative; flex: 1; height: 30px; cursor: pointer; touch-action: none; }
.scrub::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); }
.scrub-cues { position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; }
.scrub-cues i { position: absolute; top: 0; height: 100%; background: rgba(139, 108, 255, 0.75); border-radius: 2px; }
.scrub-fill { position: absolute; left: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 4px; background: var(--accent); width: 0; }
.scrub-knob { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); left: 0; transition: transform 0.2s var(--spring); }
.scrub:active .scrub-knob { transform: scale(1.35); }

/* 面板 */
.panel { margin: 4px 12px 0; border-radius: var(--radius-xl); padding: 6px; }
.tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: rgba(0, 0, 0, 0.3); border-radius: 999px; }
.tab { position: relative; z-index: 1; height: 40px; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 7px; font-weight: 600; color: var(--muted); transition: color 0.25s; }
.tab.active { color: var(--accent-ink); }
.tab .count { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.12); font-variant-numeric: tabular-nums; }
.tab.active .count { background: rgba(0, 0, 0, 0.15); }
.tab-indicator { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: var(--accent); transition: transform 0.45s var(--spring); box-shadow: 0 6px 20px -6px rgba(214, 255, 63, 0.6); }
.tabs[data-active="cues"] .tab-indicator { transform: translateX(100%); }
.tab-body { display: none; padding: 14px 10px 10px; }
.tab-body.active { display: block; animation: fadeUp 0.4s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } }

/* 样式控件 */
.group { padding: 4px 0 18px; }
.group + .group { border-top: 1px solid var(--line); padding-top: 18px; }
.group-title { display: flex; align-items: center; justify-content: space-between; margin: 0 0 12px; font-size: 12px; font-weight: 650; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
.presets { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -10px; padding: 2px 10px 6px; scrollbar-width: none; }
.presets::-webkit-scrollbar { display: none; }
.preset { flex: none; width: 118px; scroll-snap-align: start; border-radius: var(--radius); overflow: hidden; border: 1.5px solid transparent; background: var(--surface); transition: border-color 0.2s, transform 0.3s var(--spring); text-align: left; }
.preset:active { transform: scale(0.95); }
.preset.active { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(214, 255, 63, 0.18); }
.preset canvas { display: block; width: 100%; height: 70px; background: linear-gradient(135deg, #3a3f4f, #1b1d26 60%, #26303a); }
.preset span { display: block; padding: 7px 10px; font-size: 12.5px; font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 38px; padding: 0 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 15px; transition: all 0.2s; }
.chip:hover { background: var(--surface-2); }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }

.row { display: grid; grid-template-columns: 64px 1fr auto; align-items: center; gap: 12px; min-height: 44px; }
.row + .row { margin-top: 4px; }
.row > label { font-size: 14px; color: var(--muted); }
.row output { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); min-width: 38px; text-align: right; }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 32px; background: transparent; margin: 0; --v: 50%; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--accent) var(--v), rgba(255, 255, 255, 0.12) var(--v)); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--accent) var(--v), rgba(255, 255, 255, 0.12) var(--v)); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45), 0 0 0 4px rgba(214, 255, 63, 0); transition: box-shadow 0.2s, transform 0.2s var(--spring); }
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45), 0 0 0 6px rgba(214, 255, 63, 0.25); }
input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border: 0; border-radius: 50%; background: #fff; }

.swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.swatch { width: 32px; height: 32px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.15); position: relative; transition: transform 0.25s var(--spring); }
.swatch:active { transform: scale(0.88); }
.swatch.active { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); border-color: transparent; }
.swatch.custom { background: conic-gradient(#ff4d4d, #ffd84d, #66ff66, #4dd2ff, #7a4dff, #ff4dd8, #ff4d4d); overflow: hidden; }
.swatch.custom input { position: absolute; inset: -6px; opacity: 0; cursor: pointer; width: 150%; height: 150%; }
.swatch.none { background: linear-gradient(135deg, transparent 45%, var(--danger) 45% 55%, transparent 55%), var(--surface-2); }

.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 3px; background: rgba(0, 0, 0, 0.3); border-radius: 12px; width: 100%; }
.seg button { height: 34px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--muted); transition: all 0.2s; display: flex; align-items: center; justify-content: center; gap: 6px; }
.seg button.active { background: var(--surface-3); color: var(--text); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); }
.sub-label { font-size: 13px; color: var(--muted); margin: 14px 0 8px; }

/* 字幕列表 */
.cue-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 10px; font-size: 13.5px; color: var(--muted); }
.cue-tools .btn { margin-left: auto; }
.field-inline { display: flex; align-items: center; gap: 8px; }
.stepper { display: inline-flex; align-items: center; background: var(--surface-2); border-radius: 10px; border: 1px solid var(--line); }
.stepper button { width: 30px; height: 30px; font-size: 18px; color: var(--text); }
.stepper output { min-width: 24px; text-align: center; color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; }
.switch-inline { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.switch-inline input { display: none; }
.switch { width: 36px; height: 22px; border-radius: 999px; background: rgba(255, 255, 255, 0.16); position: relative; transition: background 0.25s; }
.switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.3s var(--spring); }
.switch-inline input:checked + .switch { background: var(--accent); }
.switch-inline input:checked + .switch::after { transform: translateX(14px); background: var(--accent-ink); }

.demo-note { display: flex; gap: 10px; padding: 12px 14px; margin-bottom: 10px; border-radius: var(--radius); background: rgba(255, 181, 71, 0.1); border: 1px solid rgba(255, 181, 71, 0.3); color: #ffd497; font-size: 13px; }
.demo-note p { margin: 0; }
.demo-note .i { margin-top: 2px; }

.cue-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cue {
  position: relative; display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; padding: 10px 10px 10px 14px; border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03); border: 1px solid transparent; transition: background 0.25s, border-color 0.25s;
}
.cue::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: transparent; transition: background 0.25s; }
.cue.active { background: rgba(214, 255, 63, 0.07); border-color: rgba(214, 255, 63, 0.25); }
.cue.active::before { background: var(--accent); }
.cue-time { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.cue-time button { padding: 3px 8px; border-radius: 7px; background: var(--surface); font-variant-numeric: tabular-nums; transition: background 0.2s; }
.cue-time button:hover { background: var(--surface-3); color: var(--text); }
.cue-time .arrow { opacity: 0.5; }
.cue-text { grid-column: 1 / -1; width: 100%; resize: none; border: 0; background: transparent; padding: 2px 0; font-size: 16px; line-height: 1.5; outline: none; field-sizing: content; min-height: 1.5em; overflow: hidden; }
.cue-text:focus { color: #fff; }
.cue-actions { display: flex; gap: 2px; grid-row: 1; grid-column: 2; opacity: 0.55; transition: opacity 0.2s; }
.cue:hover .cue-actions, .cue.active .cue-actions, .cue:focus-within .cue-actions { opacity: 1; }
.cue-actions button { width: 30px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); }
.cue-actions button:hover { background: var(--surface-2); color: var(--text); }
.cue-actions button.del:hover { color: var(--danger); }
.cue-actions .i { width: 16px; height: 16px; }
.cue-empty { padding: 30px 10px; text-align: center; color: var(--muted); }

/* 悬浮导出 */
.fab-wrap { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; padding: 14px 16px calc(14px + var(--safe-b)); display: flex; justify-content: center; pointer-events: none; background: linear-gradient(0deg, rgba(10, 10, 13, 0.95) 30%, rgba(10, 10, 13, 0)); }
.fab { pointer-events: auto; width: 100%; max-width: 440px; }

/* ---------- 导出面板 ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade 0.3s both; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto;
  padding: 10px 20px calc(24px + var(--safe-b)); border-radius: var(--radius-xl) var(--radius-xl) 0 0; text-align: center;
  background: linear-gradient(180deg, rgba(34, 34, 42, 0.92), rgba(18, 18, 24, 0.96));
  animation: sheetUp 0.5s var(--spring) both;
}
@keyframes sheetUp { from { transform: translateY(100%); } }
.sheet-grip { width: 40px; height: 5px; border-radius: 5px; background: rgba(255, 255, 255, 0.2); margin: 0 auto 16px; }
.sheet h3 { margin: 18px 0 6px; font-size: 20px; letter-spacing: -0.02em; display: flex; align-items: center; justify-content: center; gap: 8px; }
.sheet .ok { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.sheet .ok .i { width: 16px; height: 16px; stroke-width: 3; }
.sheet-close { position: absolute; top: 10px; right: 10px; }
.sheet-exporting { padding: 16px 0 10px; }
.muted { color: var(--muted); margin: 4px 0 0; }
.small { font-size: 12.5px; }
.result-video { border-radius: var(--radius-lg); overflow: hidden; background: #000; margin: 8px auto 0; max-width: 100%; }
.result-video video { display: block; width: 100%; max-height: 52vh; }
.sheet-actions { display: flex; gap: 10px; justify-content: center; margin: 18px 0 8px; flex-wrap: wrap; }
.sheet-actions .btn { flex: 1; max-width: 260px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; top: calc(var(--topbar-h) + var(--safe-t) + 12px); z-index: 60; transform: translate(-50%, -20px); opacity: 0; pointer-events: none;
  padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 550; max-width: calc(100vw - 32px);
  background: rgba(30, 30, 38, 0.92); border: 1px solid var(--line-2); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.6); transition: opacity 0.3s, transform 0.45s var(--spring);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { border-color: rgba(255, 91, 91, 0.5); color: #ffb3b3; }

/* ============ 桌面端 ============ */
@media (min-width: 600px) {
  .features { grid-template-columns: repeat(4, 1fr); }
  .view-home { padding-left: 32px; padding-right: 32px; }
}

@media (min-width: 960px) {
  :root { --topbar-h: 68px; }
  .topbar { padding-left: 24px; padding-right: 24px; }
  body[data-view="editor"] .only-editor { display: inline-flex; }
  .hero { padding: 9vh 0 40px; display: grid; grid-template-columns: 1.3fr 1fr; align-items: end; gap: 40px; }
  .hero .eyebrow { grid-column: 1 / -1; justify-self: start; margin-bottom: 0; }
  .lede { margin: 0 0 12px; }
  .hero h1 { font-size: clamp(56px, 6.6vw, 104px); }
  .drop { min-height: 320px; }

  .view-editor {
    display: none; padding: 20px 24px 24px; height: calc(100vh - var(--topbar-h));
    grid-template-columns: minmax(0, 1fr) 420px; gap: 20px; max-width: 1560px; margin: 0 auto;
  }
  body[data-view="editor"] .view-editor { display: grid; }
  .stage { position: static; padding: 0; background: none; display: flex; flex-direction: column; min-height: 0; }
  .player-box, body.compact .player-box { height: auto; flex: 1; min-height: 0; }
  .player { border-radius: var(--radius-xl); }
  .transport { width: min(100%, 720px); }
  .panel { margin: 0; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
  .tab-body { overflow-y: auto; flex: 1; padding: 16px 14px 14px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
  .fab-wrap { display: none; }
  .presets { display: grid; grid-template-columns: repeat(3, 1fr); overflow: visible; margin: 0; padding: 0; }
  .preset { width: auto; }
  .preset canvas { height: 64px; }
  .sheet { left: 50%; right: auto; bottom: 50%; width: min(560px, calc(100vw - 48px)); border-radius: var(--radius-xl); transform: translate(-50%, 50%); animation: pop 0.45s var(--spring) both; padding-bottom: 24px; }
  .sheet-grip { visibility: hidden; }
  @keyframes pop { from { opacity: 0; transform: translate(-50%, 50%) scale(0.92); } to { opacity: 1; transform: translate(-50%, 50%) scale(1); } }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
