:root {
  color-scheme: dark;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #eef4f6;
  background: #080b10;
  letter-spacing: 0;
  --bg: #080b10;
  --surface: #10151c;
  --surface-strong: #161d25;
  --line: #26313b;
  --muted: #8d9aa4;
  --cyan: #65dff2;
  --cyan-strong: #25bdd8;
  --green: #64d59a;
  --amber: #e6b969;
  --danger: #ef7979;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .42; }
[hidden] { display: none !important; }

.shell { width: min(100%, 780px); min-height: 100vh; margin: 0 auto; background: var(--bg); }
.login-panel { min-height: 100vh; padding: max(72px, 11vh) 26px 48px; display: flex; flex-direction: column; justify-content: center; }
.login-brand { position: relative; width: 58px; height: 58px; display: grid; place-items: center; margin-bottom: 28px; border: 1px solid #367987; background: #0e252c; border-radius: 8px; color: var(--cyan); }
.login-brand strong { position: relative; z-index: 1; font-size: 20px; }
.brand-pulse { position: absolute; inset: 9px; border: 1px solid #2d6d79; border-radius: 50%; }
.login-panel h1 { max-width: 520px; margin: 8px 0 12px; font-size: clamp(30px, 7vw, 44px); line-height: 1.15; }
.login-tagline { max-width: 520px; margin: 0 0 8px; color: #dce7ea; font-size: 18px; letter-spacing: 0; }
.login-copy { max-width: 520px; margin: 0; color: var(--muted); line-height: 1.7; }
.stack { display: grid; gap: 16px; max-width: 520px; margin-top: 34px; }
.login-footnote { display: flex; align-items: center; gap: 8px; margin-top: 24px; color: #74818b; font-size: 12px; }
.status-light { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(100,213,154,.1); }

label { display: grid; gap: 8px; color: #a8b4bc; font-size: 13px; font-weight: 650; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 12px 13px; background: #0c1117; color: #f2f7f8; outline: none; }
input::placeholder, textarea::placeholder { color: #5f6c76; }
input:focus, textarea:focus, select:focus { border-color: var(--cyan-strong); box-shadow: 0 0 0 3px rgba(37,189,216,.13); }
textarea { resize: vertical; min-height: 150px; line-height: 1.7; }

.primary, .secondary, .danger, .icon-button, .file-button { min-height: 44px; border: 1px solid transparent; border-radius: 6px; padding: 10px 16px; font-weight: 760; }
.primary { background: var(--cyan); color: #071015; }
.primary:hover { background: #8ceafa; }
.secondary { border-color: #35424d; background: #18212a; color: #d9e3e8; }
.danger { background: #9c4146; color: white; }
.danger.outline { border-color: #61373b; background: transparent; color: #f39a9e; }
.compact { min-height: 36px; padding: 7px 12px; font-size: 13px; }
.full { width: 100%; }
.error { min-height: 23px; color: #ff8f8f; }
.eyebrow { margin: 0; color: #76858f; font-size: 11px; font-weight: 850; letter-spacing: 0; text-transform: uppercase; }
.eyebrow.accent { color: var(--cyan); }

.app-view { min-height: 100vh; padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 68px; padding: 12px 18px; border-bottom: 1px solid #202a33; background: rgba(8,11,16,.96); backdrop-filter: blur(12px); }
.brand-lockup, .header-actions { display: flex; align-items: center; gap: 10px; }
.brand-mini { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid #2f6975; border-radius: 6px; background: #0d2228; color: var(--cyan); font-weight: 850; font-size: 12px; }
.topbar h1 { margin: 2px 0 0; font-size: 16px; }
.connection-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border: 1px solid #244538; border-radius: 4px; color: #99d8b7; background: #0d1a16; font-size: 11px; }
.connection-chip i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.connection-chip.offline { border-color: #5d3438; color: #efa3a7; background: #211214; }
.connection-chip.offline i { background: var(--danger); }
.pocket-chip { max-width: 150px; overflow: hidden; color: #9ecbd2; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.icon-button { min-height: 34px; padding: 6px 9px; border-color: #303b45; background: transparent; color: #9eabb4; font-size: 12px; }
.theme-toggle { width: 36px; min-width: 36px; padding: 0; font-size: 17px; }

.view-panel { padding: 18px; }
.brand-scene { min-height: 172px; display: grid; grid-template-columns: minmax(0, 1fr) 180px; align-items: center; gap: 18px; margin: 4px 0 20px; padding: 20px; overflow: hidden; border: 1px solid #28505a; border-radius: 8px; background: #10272d; color: #f5fbfc; }
.brand-scene-copy p { margin: 0 0 8px; color: #65dff2; font-size: 12px; font-weight: 850; }
.brand-scene-copy strong { display: block; color: #fff; font-size: 25px; line-height: 1.25; }
.brand-scene-copy span { display: block; margin-top: 12px; color: #a8c3c9; font-size: 10px; line-height: 1.5; }
.studio-visual { position: relative; height: 126px; }
.studio-phone { position: absolute; right: 5px; bottom: 4px; width: 70px; height: 116px; padding: 15px 8px 8px; border: 3px solid #b9d3d8; border-radius: 8px; background: #0b1519; }
.studio-phone::before { position: absolute; top: 6px; left: 50%; width: 18px; height: 3px; transform: translateX(-50%); border-radius: 2px; background: #78939a; content: ""; }
.studio-phone i { display: block; width: 76%; height: 7px; margin: 9px 0 0 auto; border-radius: 4px 4px 1px 4px; background: #24bdd8; }
.studio-phone i:nth-child(2) { width: 54%; background: #ef7979; }
.studio-phone i:nth-child(3) { width: 86%; background: #64d59a; }
.studio-mic { position: absolute; left: 28px; top: 8px; width: 44px; height: 72px; border: 3px solid #c9dce0; border-radius: 22px; background: #172f36; }
.studio-mic::before { position: absolute; left: 50%; bottom: -25px; width: 3px; height: 25px; transform: translateX(-50%); background: #c9dce0; content: ""; }
.studio-mic::after { position: absolute; left: 50%; bottom: -29px; width: 38px; height: 3px; transform: translateX(-50%); background: #c9dce0; content: ""; }
.studio-mic span { position: absolute; inset: 12px 7px; border-top: 2px solid #5c7d85; border-bottom: 2px solid #5c7d85; }
.studio-wave { position: absolute; left: 0; bottom: 10px; display: flex; align-items: center; gap: 5px; height: 34px; }
.studio-wave i { width: 4px; height: 12px; border-radius: 2px; background: #65dff2; }
.studio-wave i:nth-child(2), .studio-wave i:nth-child(4) { height: 27px; }
.studio-wave i:nth-child(3) { height: 34px; background: #ef7979; }
.pocket-heading { align-items: flex-end; padding: 16px 0 18px; border-bottom: 1px solid var(--line); }
.pocket-heading h2 { margin: 5px 0 6px; font-size: 27px; }
.pocket-heading p:last-child { max-width: 520px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.active-pocket-summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 16px 0; padding: 15px; border-left: 3px solid var(--cyan-strong); background: #0d171d; }
.active-pocket-summary span { display: block; color: #798892; font-size: 10px; }
.active-pocket-summary strong { display: block; margin-top: 4px; font-size: 17px; }
.active-pocket-summary p { margin: 5px 0 0; color: #8b9aa3; font-size: 11px; line-height: 1.5; }
.pocket-editor { margin: 18px 0; padding: 16px; border: 1px solid #2b3b46; background: #0d141b; }
.pocket-editor .section-heading { margin-bottom: 14px; }
.pocket-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.pocket-editor textarea { min-height: 82px; }
.pocket-switches { display: flex; flex-wrap: wrap; gap: 9px 16px; margin: 12px 0; padding: 11px; border: 1px solid var(--line); background: #0a1016; }
.pocket-list-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 22px 0 10px; }
.pocket-list-heading strong { font-size: 16px; }
.pocket-list-heading span { margin-left: 8px; color: var(--muted); font-size: 11px; }
.pocket-list-heading p { max-width: 390px; margin: 0; color: #78868f; font-size: 10px; line-height: 1.55; text-align: right; }
.pocket-list { border-top: 1px solid var(--line); }
.pocket-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.pocket-row.running { border-left: 3px solid var(--green); padding-left: 12px; }
.pocket-row h3 { margin: 0; color: #eef5f7; font-size: 16px; }
.pocket-row-meta { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 7px; color: #84929b; font-size: 10px; }
.pocket-row-issue { margin: 7px 0 0; color: #d2a86c; font-size: 11px; line-height: 1.45; }
.pocket-status { display: inline-flex; align-items: center; gap: 5px; color: var(--green); }
.pocket-status::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.pocket-status.draft { color: var(--amber); }
.pocket-row-actions { display: flex; align-items: center; gap: 6px; }
.pocket-menu-button { min-width: 38px; padding-inline: 10px; }
.hero-band { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 22px 0 24px; border-bottom: 1px solid var(--line); }
.hero-band h2 { max-width: 520px; margin: 7px 0 8px; font-size: clamp(23px, 5vw, 32px); line-height: 1.25; }
.hero-band p:last-child { max-width: 560px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }

.metric-strip { display: grid; grid-template-columns: repeat(3, 1fr); margin: 18px 0; border: 1px solid var(--line); background: var(--surface); }
.metric-strip div { min-width: 0; padding: 14px; border-right: 1px solid var(--line); }
.metric-strip div:last-child { border: 0; }
.metric-strip span { display: block; color: var(--muted); font-size: 11px; }
.metric-strip strong { display: block; margin-top: 5px; color: #f1f7f8; font-size: 22px; }

.workflow { display: flex; align-items: center; justify-content: center; padding: 14px 2px 24px; }
.workflow > i { flex: 1; height: 1px; max-width: 90px; background: #2a3640; }
.workflow-step { display: grid; justify-items: center; gap: 6px; color: #697781; font-size: 11px; }
.workflow-step b { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid #33414b; border-radius: 50%; background: #111820; }
.workflow-step.active { color: var(--cyan); }
.workflow-step.active b { border-color: var(--cyan-strong); background: #0c252b; }

.workspace-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border: 1px solid var(--line); border-radius: 7px; background: #0b1016; }
.tab { min-height: 40px; border: 0; border-radius: 5px; background: transparent; color: #7e8c96; font-weight: 750; }
.tab.active { background: #1a252e; color: var(--cyan); }
.tab-panel { padding: 26px 0 8px; }
.section-heading, .live-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.section-heading h2, .live-heading h2 { margin: 4px 0 0; font-size: 21px; }

.template-bar { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 10px; padding: 14px; border: 1px solid #263540; background: #0d141b; }
.script-mode-row { display: flex; align-items: center; gap: 10px; margin: 10px 0; padding: 9px 11px; border: 1px solid var(--line); background: #0d141a; }
.script-mode-row .helper-text { margin: 0; }
.extension-tools, .voice-setup { display: grid; gap: 12px; margin: 14px 0 20px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.extension-controls { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: end; gap: 10px; }
.extension-tools textarea { min-height: 110px; }
.voice-setup > div:first-child p { margin: 5px 0 0; color: #74818b; font-size: 11px; line-height: 1.55; }
.voice-fields { display: grid; gap: 10px; }
.voice-profile-list { display: grid; gap: 8px; }
.voice-profile-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px; border: 1px solid #27323c; background: var(--surface); color: #aebac1; font-size: 12px; overflow-wrap: anywhere; }
.voice-center { display: grid; gap: 16px; margin: 18px 0 22px; padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.current-voice { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px; border: 1px solid #31505a; background: #0d1b21; }
.current-voice h3 { margin: 4px 0 12px; font-size: 14px; color: #a8b5bc; }
.current-voice strong { display: block; color: #f4fafb; font-size: 19px; }
.current-voice span { display: block; margin-top: 5px; color: #7f8e97; font-size: 11px; }
.voice-parameters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.voice-parameters label { position: relative; }
.voice-parameters input[type="range"] { height: 43px; padding: 0; accent-color: var(--cyan-strong); }
.voice-parameters output { position: absolute; right: 3px; top: 0; color: var(--cyan); font-size: 11px; }
#voicePreviewText { min-height: 70px; }
#voicePreviewPlayer { width: 100%; height: 42px; }
.voice-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border: 1px solid var(--line); background: #0b1016; }
.voice-tab { min-height: 42px; border: 0; border-radius: 4px; background: transparent; color: #7f8c95; font-weight: 750; }
.voice-tab.active { background: #1a252e; color: var(--cyan); }
.voice-panel { min-height: 160px; }
.voice-filters { display: grid; grid-template-columns: minmax(0, 1fr) 130px auto; align-items: end; gap: 8px; margin-bottom: 12px; }
.check-filter { min-height: 43px; display: flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--line); background: #0c1117; }
.check-filter input { width: 17px; height: 17px; accent-color: var(--cyan-strong); }
.voice-card-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.voice-card { min-width: 0; display: grid; gap: 10px; padding: 14px; border: 1px solid #27343e; background: var(--surface); }
.voice-card.current { border-color: var(--cyan-strong); box-shadow: inset 3px 0 0 var(--cyan-strong); }
.voice-card.playing { border-color: #4aa56f; }
.voice-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.voice-card h4 { margin: 0; font-size: 15px; }
.voice-card p { margin: 0; color: #7f8d96; font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.voice-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.voice-tags span { padding: 3px 6px; border: 1px solid #34434d; color: #9eabb3; font-size: 10px; }
.voice-card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.voice-favorite { width: 34px; min-height: 30px; padding: 0; border: 0; background: transparent; color: #6f7c85; font-size: 20px; }
.voice-favorite.active { color: var(--amber); }
.voice-create-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.voice-create-actions .file-button { justify-content: center; min-height: 44px; }
.voice-recorder, .clone-form { display: grid; gap: 10px; margin: 12px 0; padding: 14px; border: 1px solid #33404a; background: #0d141a; }
.voice-recorder p, .clone-form p { margin: 0; color: #7f8d96; font-size: 11px; line-height: 1.55; }
.record-meter { height: 10px; overflow: hidden; background: #222c34; }
.record-meter i { display: block; width: 0; height: 100%; background: var(--green); transition: width .08s linear; }
.record-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.helper-text { margin: 8px 0 18px; color: #6f7d87; font-size: 11px; line-height: 1.5; }
.button-row { display: grid; grid-template-columns: minmax(150px, .8fr) minmax(0, 1.2fr); gap: 10px; margin-top: 14px; }
.segment-list, .asset-list { display: grid; gap: 9px; margin-top: 18px; }
.segment, .asset { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 13px; border: 1px solid #27323c; background: var(--surface); }
.segment > small { width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid #36444e; border-radius: 50%; color: var(--cyan); }
.segment p, .asset p { margin: 0; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.segment small, .asset small { color: #73818b; }
.empty-state { padding: 24px 16px; border: 1px dashed #2b3741; color: #75838d; text-align: center; font-size: 13px; }
.real-badge { padding: 5px 8px; border: 1px solid #285644; border-radius: 4px; background: #0d2119; color: #78d7a6; font-size: 11px; font-weight: 800; }
.settings-grid { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(100px, .6fr) minmax(150px, .8fr) minmax(220px, 1.6fr); gap: 12px; margin-bottom: 14px; }
.output-route { display: grid; gap: 10px; margin-bottom: 14px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.output-route-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.output-route-heading strong { font-size: 13px; }
.output-route-heading span { max-width: 60%; overflow: hidden; color: #7f8d96; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.output-route-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; }
.audio-mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.mode-option { display: flex; align-items: flex-start; gap: 9px; min-height: 62px; padding: 12px; border: 1px solid #2a3943; background: #0d141a; cursor: pointer; }
.mode-option:has(input:checked) { border-color: var(--cyan-strong); background: #0d2228; }
.mode-option input { width: 17px; height: 17px; margin-top: 2px; accent-color: var(--cyan-strong); }
.mode-option span { display: grid; gap: 5px; }
.mode-option strong { color: #e2edf0; font-size: 12px; }
.mode-option small { color: #7d8b94; font-size: 10px; line-height: 1.45; }
.audio-mode-explanation { padding: 10px 12px; border-left: 3px solid var(--amber); background: #1c1810; color: #d7c39e; font-size: 11px; line-height: 1.55; }
.audio-mode-explanation.ready { border-left-color: var(--green); background: #0d1c16; color: #a8d8bb; }
.monitor-route-controls { margin-top: 10px; }
.monitor-toggle { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 43px; border: 1px solid var(--line); background: #0c1117; }
.monitor-toggle input { width: 17px; height: 17px; accent-color: var(--cyan-strong); }
.volume-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.volume-controls label { position: relative; }
.volume-controls input[type="range"] { height: 40px; padding: 0; accent-color: var(--cyan-strong); }
.volume-controls output { position: absolute; right: 4px; top: 0; color: var(--cyan); font-size: 11px; }
.audio-route-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.audio-route-actions button { min-height: 40px; }
.import-box { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; padding: 14px; border: 1px dashed #35434e; background: #0d1319; }
.import-box p { margin: 5px 0 0; color: #74818b; font-size: 11px; }
.file-button { display: inline-flex; align-items: center; min-height: 36px; white-space: nowrap; border-color: #35434e; background: #18212a; color: #d9e3e8; font-size: 12px; }
.file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.library-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 22px; color: #84919a; font-size: 12px; }
.text-button { border: 0; background: transparent; color: var(--cyan); padding: 6px; font-size: 12px; }
.asset input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--cyan-strong); }

.danmaku-console { padding: 8px 0 26px; border-bottom: 1px solid var(--line); }
.danmaku-status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid #285644; border-radius: 4px; background: #0d2119; color: #78d7a6; font-size: 11px; }
.danmaku-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.danmaku-status.offline { border-color: #50383b; background: #1c1113; color: #c99195; }
.danmaku-status.offline i { background: #b85d63; }
.danmaku-status.connecting { border-color: #62512d; background: #1d180e; color: #d9b96e; }
.danmaku-status.connecting i { background: var(--amber); }
.danmaku-actions { display: grid; grid-template-columns: 1fr auto; gap: 9px; margin-top: 10px; }
.danmaku-automation { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 12px; padding: 9px 11px; border: 1px solid var(--line); background: #0d141a; }
.danmaku-automation .helper-text { margin: 0 0 0 auto; }
.live-settings { margin-top: 12px; border: 1px solid var(--line); background: #0d141a; }
.live-settings summary { padding: 11px 12px; color: #c8d6dc; cursor: pointer; font-size: 12px; font-weight: 750; }
.live-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 0 12px 12px; }
.live-settings-grid textarea { min-height: 86px; }
.live-settings-actions { display: flex; align-items: center; gap: 10px; padding: 0 12px 12px; }
.live-settings-actions .helper-text { margin: 0; }
.reply-monitor { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; margin-top: 12px; padding: 12px; border: 1px solid #2a3943; background: #0d141a; }
.reply-monitor > div { min-width: 0; }
.reply-monitor span { display: block; color: #76858e; font-size: 10px; }
.reply-monitor strong { display: block; margin-top: 4px; color: #bfe6eb; font-size: 15px; }
.reply-monitor p { margin: 4px 0 0; color: #d6e0e4; font-size: 11px; line-height: 1.45; overflow-wrap: anywhere; }
.playback-diagnostics { margin-top: 9px; border: 1px solid var(--line); background: #0b1116; }
.playback-diagnostics summary { padding: 9px 11px; color: #82919a; cursor: pointer; font-size: 11px; }
.playback-diagnostics pre { max-height: 220px; margin: 0; padding: 10px 11px; overflow: auto; color: #9fb0b8; font: 10px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre-wrap; }
.live-frame { margin-top: 14px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.live-frame-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.live-frame-heading strong { color: #d9e2e6; font-size: 13px; }
.live-frame img { display: block; width: 100%; max-height: 360px; margin-top: 10px; object-fit: contain; background: #080c10; }
.live-frame img[hidden] { display: none; }
.manual-danmaku { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; margin-top: 14px; }
.danmaku-stream-heading { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; color: #84919a; font-size: 12px; }
.danmaku-events { display: grid; gap: 7px; max-height: 310px; margin-top: 8px; overflow-y: auto; overscroll-behavior: contain; }
.danmaku-event { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 11px 12px; border-left: 2px solid #2f7482; background: #0e151c; }
.danmaku-event.status-event { border-left-color: #75633b; }
.danmaku-event.ai-reply-event { border-left-color: #468b62; background: #0d1914; }
.danmaku-reply-button { margin-top: 6px; }
.danmaku-event time { color: #65737d; font-size: 10px; }
.danmaku-event strong { display: block; margin-bottom: 3px; color: var(--cyan); font-size: 12px; }
.danmaku-event p { margin: 0; color: #d9e2e6; font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.danmaku-event.status-event p { color: #c9b889; }
.live-console { padding-top: 26px; }
.switch-label { display: flex; align-items: center; gap: 8px; }
.switch-label input { width: 36px; height: 20px; accent-color: var(--cyan-strong); }
.now-playing { display: grid; gap: 16px; padding: 20px; border: 1px solid #2b3a45; background: #0d141b; }
.playing-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.state-dot { width: fit-content; padding: 5px 8px; border: 1px solid #285667; border-radius: 4px; background: #0b222a; color: var(--cyan); font-size: 11px; }
.queue-count { color: #7f8d96; font-size: 11px; }
.waveform { height: 54px; display: flex; align-items: center; justify-content: center; gap: 7px; overflow: hidden; }
.waveform i { width: 4px; height: 18px; background: #2a6571; border-radius: 2px; }
.waveform i:nth-child(2), .waveform i:nth-child(7) { height: 34px; }
.waveform i:nth-child(3), .waveform i:nth-child(6) { height: 48px; background: var(--cyan-strong); }
.waveform i:nth-child(4), .waveform i:nth-child(5) { height: 26px; background: #69d7e9; }
.now-playing strong { text-align: center; font-size: 15px; }
.now-playing audio { width: 100%; }
.transport { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.queue-link { width: 100%; margin: 10px 0 22px; border: 0; background: transparent; color: var(--cyan); padding: 8px; }
.notice { padding: 15px; border-left: 3px solid var(--amber); background: #1c1810; color: #d7c39e; }
.notice p { margin: 6px 0 0; font-size: 12px; line-height: 1.65; }

.profile-hero { display: flex; align-items: center; gap: 14px; padding: 14px 0 24px; border-bottom: 1px solid var(--line); }
.profile-avatar { width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid #326e7a; border-radius: 8px; background: #0d2228; color: var(--cyan); font-weight: 850; }
.profile-hero h2 { margin: 4px 0 5px; font-size: 20px; }
.profile-hero #licenseStatus { color: var(--green); font-size: 12px; }
.profile-hero #licenseStatus.license-bad { color: var(--danger); }
.info-list { margin: 18px 0; border: 1px solid var(--line); }
.info-list div { display: grid; grid-template-columns: 100px minmax(0, 1fr); gap: 14px; padding: 14px; border-bottom: 1px solid var(--line); }
.info-list div:last-child { border: 0; }
.info-list span { color: #7d8a94; font-size: 12px; }
.info-list strong { overflow: hidden; color: #dfe7ea; font-size: 12px; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.acceptance-list { margin: 20px 0; }
.acceptance-list h3 { margin: 0 0 6px; font-size: 16px; }
.acceptance-list > p { margin: 0 0 15px; color: #7f8d96; font-size: 12px; }
.acceptance-list ol { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.acceptance-list li { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid #26313b; background: var(--surface); font-size: 13px; }
.acceptance-list li span { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid #3a4a55; border-radius: 50%; color: var(--cyan); font-size: 10px; }

.bottom-nav { position: fixed; z-index: 30; left: 50%; bottom: 0; width: min(100%, 780px); min-height: calc(64px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(4, 1fr); padding: 5px 8px env(safe-area-inset-bottom); transform: translateX(-50%); border-top: 1px solid #26313b; background: rgba(8,11,16,.97); backdrop-filter: blur(14px); }
.nav-button { min-height: 54px; display: grid; place-items: center; align-content: center; gap: 2px; border: 0; background: transparent; color: #6d7a84; font-size: 11px; }
.nav-button.active { color: var(--cyan); }
.nav-glyph { font-size: 18px; line-height: 1; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: calc(78px + env(safe-area-inset-bottom)); max-width: calc(100% - 40px); padding: 10px 14px; transform: translateX(-50%) translateY(18px); border: 1px solid #34434d; border-radius: 6px; background: #182129; color: white; opacity: 0; pointer-events: none; transition: .18s ease; font-size: 13px; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 520px) {
  .view-panel { padding: 15px; }
  .hero-band { display: block; }
  .hero-band .primary { margin-top: 16px; }
  .metric-strip div { padding: 12px 10px; }
  .metric-strip strong { font-size: 19px; }
  .button-row, .transport { grid-template-columns: 1fr 1fr; }
  .settings-grid { grid-template-columns: 1fr; }
  .voice-parameters { grid-template-columns: 1fr 1fr; }
  .voice-filters { grid-template-columns: 1fr 1fr; }
  .voice-filters .check-filter { grid-column: 1 / -1; }
  .voice-card-grid { grid-template-columns: 1fr; }
  .output-route-controls { grid-template-columns: 1fr; }
  .audio-mode-grid, .volume-controls, .audio-route-actions { grid-template-columns: 1fr; }
  .live-settings-grid, .reply-monitor { grid-template-columns: 1fr; }
  .segment, .asset { grid-template-columns: auto minmax(0, 1fr); }
  .segment button, .asset button { grid-column: 2; }
  .import-box { align-items: flex-start; flex-direction: column; }
  .library-toolbar { align-items: flex-start; }
  .connection-chip { display: none; }
  .manual-danmaku { grid-template-columns: 1fr; }
  .pocket-form-grid { grid-template-columns: 1fr; }
  .pocket-list-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .pocket-list-heading p { text-align: left; }
  .pocket-row { grid-template-columns: 1fr; }
  .pocket-row-actions { justify-content: flex-start; }
  .pocket-chip { display: none; }
  .brand-scene { grid-template-columns: minmax(0, 1fr) 128px; min-height: 154px; padding: 16px; }
  .studio-visual { transform: scale(.82); transform-origin: right center; }
  .brand-scene-copy strong { font-size: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

html[data-theme="light"] {
  color-scheme: light;
  color: #162328;
  background: #f4f7f8;
  --bg: #f4f7f8;
  --surface: #ffffff;
  --surface-strong: #edf2f4;
  --line: #d5dee2;
  --muted: #66767e;
  --cyan: #087f92;
  --cyan-strong: #078ba0;
  --green: #188758;
  --amber: #9a6808;
  --danger: #c3464f;
}
html[data-theme="light"] body,
html[data-theme="light"] .shell { background: var(--bg); color: #162328; }
html[data-theme="light"] :where(h1, h2, h3, h4, strong) { color: #122126; }
html[data-theme="light"] .brand-scene :where(strong) { color: #fff; }
html[data-theme="light"] .login-tagline { color: #33454c; }
html[data-theme="light"] label { color: #4f6068; }
html[data-theme="light"] input,
html[data-theme="light"] textarea,
html[data-theme="light"] select { border-color: var(--line); background: #fff; color: #142329; }
html[data-theme="light"] input::placeholder,
html[data-theme="light"] textarea::placeholder { color: #8b989f; }
html[data-theme="light"] .topbar { border-color: var(--line); background: rgba(255,255,255,.96); }
html[data-theme="light"] .bottom-nav { border-color: var(--line); background: rgba(255,255,255,.97); }
html[data-theme="light"] .brand-mini,
html[data-theme="light"] .login-brand { border-color: #7bc6d1; background: #e8f7f9; color: #086f80; }
html[data-theme="light"] .primary { background: #078ba0; color: #fff; }
html[data-theme="light"] .primary:hover { background: #06798b; }
html[data-theme="light"] .secondary,
html[data-theme="light"] .icon-button,
html[data-theme="light"] .file-button { border-color: #cbd6da; background: #fff; color: #26383f; }
html[data-theme="light"] .danger { background: #c3464f; color: #fff; }
html[data-theme="light"] .danger.outline { border-color: #dda8ad; background: #fff; color: #a72e38; }
html[data-theme="light"] .connection-chip { border-color: #addac4; background: #effaf4; color: #176b49; }
html[data-theme="light"] .connection-chip.offline { border-color: #e1b2b6; background: #fff2f3; color: #a4343c; }
html[data-theme="light"] .pocket-chip { color: #326c76; }
html[data-theme="light"] .active-pocket-summary { background: #eaf6f8; }
html[data-theme="light"] .active-pocket-summary span,
html[data-theme="light"] .active-pocket-summary p,
html[data-theme="light"] .pocket-row-meta,
html[data-theme="light"] .helper-text { color: #667880; }
html[data-theme="light"] .pocket-editor,
html[data-theme="light"] .pocket-switches,
html[data-theme="light"] .template-bar,
html[data-theme="light"] .script-mode-row,
html[data-theme="light"] .workspace-tabs,
html[data-theme="light"] .voice-tabs,
html[data-theme="light"] .voice-recorder,
html[data-theme="light"] .clone-form,
html[data-theme="light"] .danmaku-automation,
html[data-theme="light"] .live-settings,
html[data-theme="light"] .reply-monitor,
html[data-theme="light"] .playback-diagnostics,
html[data-theme="light"] .now-playing { border-color: var(--line); background: #fff; }
html[data-theme="light"] .tab.active,
html[data-theme="light"] .voice-tab.active { background: #e5f3f5; color: #087b8d; }
html[data-theme="light"] .tab,
html[data-theme="light"] .voice-tab,
html[data-theme="light"] .nav-button { color: #6d7c83; }
html[data-theme="light"] .tab.active,
html[data-theme="light"] .voice-tab.active,
html[data-theme="light"] .nav-button.active { color: #087f92; }
html[data-theme="light"] .current-voice { border-color: #9ccbd2; background: #edf8f9; }
html[data-theme="light"] .current-voice h3,
html[data-theme="light"] .current-voice span,
html[data-theme="light"] .voice-card p { color: #60727a; }
html[data-theme="light"] .current-voice strong,
html[data-theme="light"] .pocket-row h3 { color: #132329; }
html[data-theme="light"] .voice-card,
html[data-theme="light"] .segment,
html[data-theme="light"] .asset,
html[data-theme="light"] .acceptance-list li { border-color: var(--line); background: #fff; color: #21343b; }
html[data-theme="light"] .mode-option,
html[data-theme="light"] .audio-mode-explanation,
html[data-theme="light"] .output-route,
html[data-theme="light"] .info-list { border-color: var(--line); background: #fff; }
html[data-theme="light"] .danmaku-event { border-left-color: #16869b; background: #fff; }
html[data-theme="light"] .danmaku-event.ai-reply-event { border-left-color: #2d9865; background: #f0faf5; }
html[data-theme="light"] .danmaku-event p,
html[data-theme="light"] .now-playing strong { color: #1b2d33; }
html[data-theme="light"] .playback-diagnostics pre { color: #4c6068; }
html[data-theme="light"] .notice { background: #fff8e9; color: #765413; }
html[data-theme="light"] .toast { border-color: #c6d2d6; background: #17272d; color: #fff; }
.voice-library-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 12px 0; }
.voice-library-actions h3, .voice-library-actions p { margin: 0 0 6px; }
.voice-library-actions > button { flex-shrink: 0; }
.clone-form details { border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.clone-form summary { cursor: pointer; margin-bottom: 8px; font-size: 13px; }
@media (max-width: 440px) { .voice-library-actions { align-items: stretch; flex-direction: column; } }
html[data-theme="light"] .real-badge,
html[data-theme="light"] .danmaku-status { border-color: #a8d7bf; background: #eff9f3; color: #176d49; }
html[data-theme="light"] .danmaku-status.offline { border-color: #deb1b5; background: #fff2f3; color: #a53840; }
html[data-theme="light"] .danmaku-status.connecting { border-color: #dec98e; background: #fff9e8; color: #806117; }
