:root {
  color-scheme: dark;
  --ink: #f2f0fa;
  --muted: #a4a2b8;
  --panel: #171721;
  --line: #ffffff14;
  --gold: #e9c482;
  --mint: #99d8be;
  --violet: #a99aec;
  --danger: #f1a1ac;
  --radius: 18px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: radial-gradient(ellipse at 50% 0, #30234645 0, transparent 55rem), #0c0d12;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; border: 0; }
button, select, input, textarea { transition: border-color .16s, background-color .16s, box-shadow .16s, color .16s; }
button:disabled { opacity: .4; cursor: not-allowed; }
button:focus-visible, summary:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
a { color: #c4b7f7; text-underline-offset: 3px; }
h1, h2, h3, p { margin-top: 0; }
label { display: block; margin: 0 0 9px; color: #ddd9ea; font-size: .82rem; font-weight: 600; }
input[type=text], input[type=search], textarea, select {
  width: 100%; min-width: 0; color: var(--ink); border: 1px solid #ffffff18; border-radius: 9px;
  background: #101117; padding: 11px 12px; outline: none; font-size: .84rem;
}
input::placeholder, textarea::placeholder { color: #77758c; }
input[type=text]:focus, input[type=search]:focus, textarea:focus, select:focus { border-color: #ac98eaa6; box-shadow: 0 0 0 3px #ac98ea10; }
input[type=range] { display: block; width: 100%; margin: 9px 0; accent-color: var(--gold); cursor: pointer; }
input[type=color] { width: 100%; height: 38px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: #101117; cursor: pointer; }
input[type=file] { max-width: 100%; color: var(--muted); font-size: .78rem; }
input[type=file]::file-selector-button { padding: 10px 12px; margin-right: 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #2a2734; cursor: pointer; }
textarea { min-height: 90px; resize: vertical; line-height: 1.75; }
code { padding: 1px 4px; border-radius: 3px; background: #ffffff08; font-size: .9em; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.skip-link { position: fixed; left: 18px; top: -80px; z-index: 100; padding: 12px 18px; color: #16121c; background: var(--gold); border-radius: 8px; }
.skip-link:focus { top: 12px; }
.app { width: min(1440px, calc(100% - 64px)); margin: 0 auto; padding: 28px 0 18px; }
.app-header { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 26px; }
.brand { display: flex; align-items: center; gap: 13px; }
.mark { position: relative; width: 43px; height: 49px; display: grid; place-items: center; border: 1px solid #e9c4826b; border-radius: 9px; background: linear-gradient(145deg, #46304f, #201b2b); color: var(--gold); font-size: 23px; box-shadow: 4px 3px 0 #a99aec15; }
.mark span { transform: translateX(1px); }
.brand-kicker, .preview-kicker { margin: 0 0 5px; color: var(--gold); font-size: 9px; font-weight: 700; letter-spacing: .19em; }
h1 { margin: 0; font-size: 20px; font-weight: 680; letter-spacing: .035em; }
.mobile-preview-link { display: none; }
.header-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .78rem; }
.online-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--mint); }
.project-toolbar { display: grid; grid-template-columns: minmax(170px, 1fr) auto; gap: 12px 20px; align-items: center; padding: 17px 20px 13px; border: 1px solid var(--line); border-radius: var(--radius); background: #1a1823b3; margin-bottom: 20px; }
.project-title { display: flex; align-items: center; gap: 13px; min-width: 0; }
.project-title label { flex: 0 0 auto; margin: 0; color: var(--muted); font-size: .75rem; }
.project-title input { max-width: 420px; padding: 8px 0; border-color: transparent; background: transparent; font-size: .95rem; font-weight: 600; }
.project-title input:focus { padding-left: 8px; }
.project-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.project-actions .button { min-height: 36px; padding: 0 13px; font-size: .77rem; }
.project-status { grid-column: 1 / -1; margin: 0; min-height: 16px; color: var(--muted); font-size: .71rem; line-height: 1.4; }
.history-actions { display: flex; gap: 1px; margin-right: 6px; padding-right: 13px; border-right: 1px solid var(--line); }
.history-actions button { min-height: 34px; padding: 0 7px; border-radius: 6px; background: transparent; color: var(--muted); font-size: .76rem; }
.history-actions button span { font-size: 18px; }
.history-actions button:not(:disabled):hover { color: var(--ink); background: #ffffff08; }
.project-more { position: relative; }
.project-more summary { min-height: 36px; display: flex; align-items: center; gap: 7px; padding: 0 9px; list-style: none; color: var(--muted); cursor: pointer; font-size: .76rem; }
summary::-webkit-details-marker { display: none; }
.project-more-menu { position: absolute; z-index: 10; right: 0; top: 44px; width: 175px; padding: 6px; border: 1px solid #ffffff24; border-radius: 12px; background: #24212d; box-shadow: 0 16px 50px #0008; }
.project-more-menu button { display: block; width: 100%; min-height: 39px; padding: 9px 10px; border-radius: 7px; background: transparent; color: #d5d1df; text-align: left; font-size: .78rem; }
.project-more-menu button:hover { background: #ffffff09; }
.project-more-menu .clear-project { color: var(--danger); border-top: 1px solid var(--line); border-radius: 0 0 7px 7px; }
.layout { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(350px, .88fr); gap: 22px; align-items: start; }
.editor { display: grid; gap: 14px; min-width: 0; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(135deg, #1b1924, #15151d); box-shadow: 0 8px 30px #00000012; }
.edit-section > summary { display: flex; align-items: center; gap: 13px; min-height: 80px; padding: 20px; list-style: none; cursor: pointer; }
.section-index { display: grid; place-items: center; flex: 0 0 32px; height: 32px; border-radius: 9px; background: #a99aec12; border: 1px solid #a99aec20; color: #b9a9ed; font-size: 11px; font-variant-numeric: tabular-nums; }
.section-heading { display: grid; gap: 5px; }
.section-heading strong { font-size: .94rem; font-weight: 650; }
.section-heading small { color: var(--muted); font-size: .73rem; }
.section-chevron { margin-left: auto; color: #8a849c; font-size: 18px; transition: transform .2s; }
.section-count { margin-left: auto; padding: 4px 8px; border-radius: 5px; color: #c7bbdf; background: #ffffff05; font-size: .7rem; white-space: nowrap; }
.section-count + .section-chevron { margin-left: 0; }
.edit-section[open] > summary .section-chevron { transform: rotate(180deg); }
.edit-section[open] > summary { border-bottom: 1px solid var(--line); }
.section-body { padding: 22px 20px; }
.field { margin-bottom: 22px; }
.field:last-child { margin-bottom: 0; }
.field-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.field-heading label { margin: 0; }
.label-note { color: var(--muted); font-size: .7rem; font-weight: 400; }
label .label-note { margin-left: 7px; }
.small, .hint, .scene-note { color: var(--muted); font-size: .74rem; line-height: 1.65; }
.hint { margin: 9px 0 0; }
.card-count { color: var(--gold); font-size: .74rem; }
.card-source-grid { display: grid; grid-template-columns: .95fr 1.05fr; gap: 12px; }
.upload { position: relative; display: grid; align-content: center; justify-items: center; gap: 6px; min-height: 133px; margin: 0; padding: 16px 12px; border: 1px dashed #bca6db45; border-radius: 12px; background: #b69ee807; cursor: pointer; text-align: center; }
.upload:hover, .upload.drag, .upload:focus-within { border-color: #d5bbf2; background: #b69ee811; }
.upload-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; color: #c6b5ee; background: #c6b5ee12; font-size: 19px; font-weight: 400; }
.upload strong { color: #e5ddef; font-size: .8rem; font-weight: 600; }
.upload .small { font-size: .68rem; font-weight: 400; }
.card-source { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #0d0e1433; }
.card-source-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; font-size: .76rem; color: #d9d3e7; }
.card-source-head span:last-child { color: #817b92; font-size: .65rem; }
.card-query-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 6px; }
.card-query-row input { font-size: .75rem; padding: 9px 10px; }
.card-query-button, .card-add-button { min-height: 35px; padding: 0 11px; border: 1px solid #a99aec35; border-radius: 7px; color: #d0bff5; background: #a99aec18; font-size: .75rem; font-weight: 600; }
.card-query-button:hover, .card-add-button:hover { background: #a99aec2b; }
.card-query-status { margin: 8px 0 0; color: var(--muted); font-size: .68rem; line-height: 1.5; overflow-wrap: anywhere; }
.card-query-status.error { color: var(--danger); }
.card-query-result { display: grid; grid-template-columns: 46px minmax(0,1fr); gap: 9px; align-items: center; padding-top: 10px; margin-top: 10px; border-top: 1px solid var(--line); }
.card-query-result img { width: 46px; height: 65px; border-radius: 5px; object-fit: contain; }
.card-query-copy { min-width: 0; }
.card-query-name { overflow: hidden; color: var(--gold); font-size: .76rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.card-query-meta { margin: 4px 0 6px; color: var(--muted); font-size: .65rem; line-height: 1.4; }
.card-add-button { width: 100%; min-height: 27px; font-size: .68rem; }
.scene-note { margin: -2px 0 12px; }
.scene-editor { display: grid; gap: 12px; }
.scene-row { display: grid; gap: 13px; min-width: 0; padding: 14px; border: 1px solid #ffffff12; border-radius: 12px; background: #10111780; transition: border-color .2s, background-color .2s; }
.scene-row.active, .scene-row.selected, .scene-row[aria-selected=true] { border-color: #b9a2f085; background: #a99aec08; box-shadow: inset 3px 0 #a99aec; }
.scene-row.drag-over { border-color: var(--gold); background: #e9c4820a; }
.scene-main { display: grid; grid-template-columns: 62px minmax(0,1fr) 25px; gap: 11px; align-items: start; }
.scene-copy { display: grid; gap: 7px; min-width: 0; }
.scene-name-row { display: grid; grid-template-columns: minmax(0,1fr) 28px; gap: 6px; }
.scene-thumb { display: grid; place-items: center; width: 62px; height: 86px; overflow: hidden; border-radius: 6px; border: 1px solid #ffffff13; color: #77718c; background: #171522; font-size: .67rem; text-align: center; cursor: grab; }
.scene-thumb:active { cursor: grabbing; }
.scene-thumb.dragging { opacity: .4; }
.scene-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.scene-row input, .scene-row select { min-width: 0; font-size: .78rem; }
.scene-copy [data-card-name] { padding: 6px 8px; color: #dfc694; background: transparent; border-color: transparent; font-size: .8rem; font-weight: 600; }
.scene-copy [data-card-name]:focus { border-color: #a99aec70; }
.scene-copy textarea, .scene-copy [data-caption] { width: 100%; min-height: 78px; padding: 9px 10px; line-height: 1.7; font-size: .8rem; border-radius: 7px; }
.scene-copy input[data-caption] { min-height: 38px; }
.card-detect { min-height: 28px; padding: 0; border: 1px solid #a99aec20; border-radius: 7px; color: #bcaee1; background: #a99aec0b; font-size: 1rem; }
.scan-status, .narration-status { margin: 0; color: #8e87a0; font-size: .66rem; line-height: 1.45; overflow-wrap: anywhere; }
.scan-status.found, .narration-status.generated { color: #88bea4; }
.scan-status.error, .narration-status.error { color: var(--danger); }
.scene-remove { width: 25px; height: 25px; padding: 0; border-radius: 6px; color: #82798f; background: transparent; font-size: 19px; }
.scene-remove:hover { color: #ffbdc5; background: #e58d9c16; }
.scene-controls { display: grid; grid-template-columns: 1fr 1.35fr 1fr; gap: 12px; padding-top: 12px; border-top: 1px solid #ffffff09; }
.scene-controls label { color: #9e96ad; font-size: .68rem; margin-bottom: 7px; }
.scene-controls .range-label { gap: 6px; }
.scene-controls b { color: #cbb583; font-size: .66rem; white-space: nowrap; }
.scene-controls input[type=range] { margin: 12px 0 0; }
.scene-controls select { min-height: 32px; padding: 6px 7px; font-size: .7rem; }
.scene-voice { min-width: 0; }
.scene-voice-actions { display: flex; gap: 5px; }
.scene-voice-actions button { flex: 1; min-height: 32px; padding: 0 6px; border: 1px solid #a99aec25; border-radius: 6px; color: #beb1d9; background: #a99aec11; font-size: .66rem; font-weight: 600; white-space: nowrap; }
.scene-voice-actions button:first-child { color: #d5c4f0; background: #a99aec25; }
.scene-voice-status { min-height: 13px; margin: 5px 0 0; color: var(--muted); font-size: .64rem; line-height: 1.4; }
.scene-voice-status.ready { color: #88bea4; }
.scene-voice-status.error { color: var(--danger); }
.scene-row [data-scene-select] { min-height: 29px; padding: 5px 8px; border-radius: 6px; background: #a99aec16; color: #c4b5e9; font-size: .68rem; }
.scene-row [data-ai-mode] { width: auto; max-width: 100%; min-height: 30px; padding: 5px 7px; font-size: .69rem; }
.scene-row [data-ai-rewrite], .scene-row [data-ai-accept], .scene-row [data-ai-dismiss] { min-height: 30px; padding: 5px 9px; border: 1px solid #a99aec29; border-radius: 6px; color: #cabbeb; background: #a99aec13; font-size: .69rem; }
.ai-actions, .ai-rewrite-actions, .scene-ai-actions, .rewrite-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ai-suggestion { padding: 12px; border: 1px solid #c6b1eb36; border-radius: 9px; background: #a99aec0d; color: #d6cce8; font-size: .79rem; line-height: 1.8; overflow-wrap: anywhere; }
.ai-suggestion p { margin: 0 0 9px; white-space: pre-wrap; }
.ai-suggestion [data-ai-accept] { background: #a99aec30; color: #ede2ff; }
.ai-suggestion [data-ai-dismiss] { background: transparent; }
.settings { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.settings .field { margin: 0; }
.timing-settings { padding: 16px; border: 1px solid #ffffff0b; border-radius: 10px; background: #ffffff02; }
.range-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.range-label label { margin: 0; }
.range-label b, .tts-controls b { color: var(--gold); font-size: .75rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.template-panel { margin-bottom: 22px; padding: 16px; border: 1px solid #e9c48224; border-radius: 12px; background: #e9c48205; }
.template-panel .field { margin-bottom: 0; }
.inline-actions { display: flex; align-items: center; gap: 7px; margin-top: 12px; }
.inline-actions input, .inline-actions select { flex: 1; min-width: 0; }
.inline-actions button { flex: 0 0 auto; min-height: 37px; padding: 0 10px; border: 1px solid #ffffff14; border-radius: 8px; color: #d6cbe6; background: #ffffff07; font-size: .72rem; white-space: nowrap; }
.inline-actions button:hover { background: #ffffff0f; }
.inline-actions .quiet-danger { color: #b99aa7; background: transparent; border-color: transparent; }
.inline-actions .quiet-danger:hover { color: var(--danger); }
.look-settings { margin-bottom: 13px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 56px; margin: 0; padding: 13px 0; cursor: pointer; }
.switch-row strong { display: block; color: #d9d2e4; font-size: .79rem; font-weight: 500; }
.switch-row small { display: block; margin-top: 5px; color: #918b9e; font-size: .69rem; line-height: 1.5; font-weight: 400; }
.switch-row input[type=checkbox] { appearance: none; -webkit-appearance: none; flex: 0 0 35px; width: 35px; height: 20px; position: relative; margin: 0; border: 1px solid #ffffff1b; border-radius: 20px; background: #302c39; cursor: pointer; }
.switch-row input[type=checkbox]::before { content: ''; position: absolute; width: 12px; height: 12px; border-radius: 50%; background: #b7aebf; top: 3px; left: 3px; transition: transform .16s; }
.switch-row input[type=checkbox]:checked { background: #9c84c6; border-color: #aa92d0; }
.switch-row input[type=checkbox]:checked::before { transform: translateX(15px); background: #fcf7ff; }
.text-fields { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.overlay-fields, .text-style-editor { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
.overlay-fields label, .text-style-editor label { font-size: .73rem; color: #b1a8c0; }
.overlay-fields input, .text-style-editor select { font-size: .77rem; }
.overlay-fields .hint, .text-style-editor .style-wide { grid-column: 1 / -1; }
.text-style-editor { margin-top: 16px; padding-top: 16px; border-top: 1px solid #ffffff0a; }
.overlay-default-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.overlay-default-actions button { min-height: 33px; padding: 0 10px; border: 1px solid #ffffff13; border-radius: 7px; color: #b9adc9; background: #ffffff05; font-size: .7rem; }
.overlay-default-status { flex-basis: 100%; margin: 0; color: var(--muted); font-size: .69rem; }
.tts-panel { padding: 16px; border: 1px solid #a99aec29; border-radius: 12px; background: #a99aec07; }
.tts-provider select { width: auto; min-width: 8em; }
.tts-controls { display: grid; grid-template-columns: 1.25fr 1fr; align-items: center; gap: 16px; margin-top: 16px; }
.tts-controls label { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; color: #b3a7c6; font-size: .72rem; }
.tts-controls select, .batch-controls select { font-size: .75rem; }
.batch-controls { display: flex; gap: 8px; margin-top: 14px; }
.batch-controls select { min-width: 0; }
.tts-generate { flex: 0 0 auto; min-height: 37px; padding: 0 14px; border-radius: 8px; color: #e2d6f8; background: #8565ac55; border: 1px solid #b7a0e13b; font-size: .76rem; font-weight: 600; }
.tts-generate:hover { background: #8565ac77; }
.tts-status { margin: 9px 0 0; color: var(--muted); font-size: .7rem; line-height: 1.5; }
.tts-status.ready { color: var(--mint); }
.tts-status.error { color: var(--danger); }
.manual-audio { margin: 18px 0 22px; border-bottom: 1px solid var(--line); padding-bottom: 17px; }
.manual-audio > summary { display: flex; justify-content: space-between; list-style: none; color: #bdb3cc; font-size: .78rem; cursor: pointer; }
.manual-audio > summary::after { content: '+'; margin-left: 12px; color: #81758e; }
.manual-audio[open] > summary::after { content: '−'; }
.manual-audio > summary .label-note { margin-left: auto; }
.manual-audio > div { padding-top: 16px; }
.manual-audio label { font-size: .73rem; }
.music-search-row { display: flex; gap: 7px; }
.music-search-row input { flex: 1; min-width: 0; }
.music-search-row button, .music-file-button { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; min-height: 38px; padding: 0 11px; border: 1px solid #ffffff16; border-radius: 8px; color: #c8bdcf; background: #ffffff05; font-size: .73rem; font-weight: 500; }
.music-search-row button:hover, .music-file-button:hover { background: #ffffff0b; }
.music-library-actions { display: flex; align-items: center; gap: 12px; margin-top: 11px; }
.music-file-button { position: relative; margin: 0; cursor: pointer; }
.music-file-button:focus-within { outline: 2px solid var(--gold); outline-offset: 3px; }
.music-file-name { min-width: 0; color: #aaa0b6; font-size: .72rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.music-saved { margin-top: 18px; }
.music-saved label { margin-bottom: 7px; font-size: .72rem; color: #aaa0b6; }
.music-saved .inline-actions { margin-top: 0; }
.music-saved select { font-size: .73rem; }
.pixabay-note { margin: 10px 0 0; color: #83798f; font-size: .66rem; line-height: 1.7; }
.pixabay-note a { color: #b4a5ca; }
.music-trimmer { margin-top: 17px; padding: 14px; border: 1px solid #ffffff0e; border-radius: 10px; background: #0d0d1540; }
.music-trimmer > label { font-size: .75rem; }
.music-trimmer audio { width: 100%; height: 35px; margin: 4px 0 15px; opacity: .85; }
.trim-range label { display: flex; justify-content: space-between; color: #a99cb9; font-size: .72rem; }
.trim-range b { color: var(--gold); font-weight: 500; }
.music-clip-info, .music-error { margin: 8px 0 0; color: var(--muted); font-size: .7rem; line-height: 1.5; }
.music-error { color: var(--danger); }
.trim-preview { width: 100%; min-height: 33px; margin-top: 10px; border: 1px solid #ffffff14; border-radius: 7px; color: #beb0d1; background: #ffffff05; font-size: .72rem; }
.volume-field { margin-top: 20px; }
.audio-enhancements { margin-top: 15px; padding-top: 5px; border-top: 1px solid var(--line); }
.audio-enhancements .switch-row + .switch-row { border-top: 1px solid #ffffff07; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 9px; font-size: .8rem; font-weight: 600; }
.primary { color: #322716; background: linear-gradient(115deg, #edce91, #d7b16e); border: 1px solid #efd6a559; box-shadow: 0 5px 14px #d6ae6b10; }
.primary:hover:not(:disabled) { background: linear-gradient(115deg, #f3daaa, #e4bf7c); box-shadow: 0 5px 20px #d6ae6b20; }
.secondary { color: #cfc3df; background: #a99aec12; border: 1px solid #b7a0d52b; }
.secondary:hover:not(:disabled) { color: #ece2f7; background: #a99aec20; }
.subtle { color: #c6bed2; background: #ffffff05; border: 1px solid #ffffff12; }
.subtle:hover:not(:disabled) { background: #ffffff0c; }
.preview { position: sticky; top: 18px; max-height: calc(100dvh - 36px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #51415d transparent; padding: 18px; min-width: 0; background: linear-gradient(150deg,#1d1a25,#14151c 65%); }
.preview-tabs { display: flex; gap: 5px; padding: 4px; border: 1px solid #ffffff0a; border-radius: 10px; background: #0a0b104d; margin-bottom: 18px; }
.preview-tabs button { flex: 1; min-height: 34px; padding: 0 10px; border-radius: 7px; color: #8e869e; background: transparent; font-size: .76rem; font-weight: 600; }
.preview-tabs button[aria-selected=true] { color: #e4c791; background: #e9c4820c; border: 1px solid #e9c48227; }
.preview-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 3px 14px; }
.preview-top h2 { margin: 0; font-size: .93rem; font-weight: 600; }
.preview-kicker { font-size: 8px; color: #8b7c9c; letter-spacing: .15em; margin-bottom: 4px; }
.status { max-width: 65%; text-align: right; color: var(--muted); font-size: .7rem; line-height: 1.5; }
.status.ready { color: #94c6af; }
.preview-stage { position: relative; display: grid; justify-items: center; padding: 12px 16px 27px; border: 1px solid #ffffff08; border-radius: 12px; background: radial-gradient(ellipse at 50% 30%, #38304250, transparent 75%), #0c0c12; overflow: hidden; }
.preview-stage::before { content: ''; position: absolute; inset: 0; opacity: .17; background-image: radial-gradient(#a199b04d .6px,transparent .6px); background-size: 10px 10px; pointer-events: none; }
.canvas-wrap { position: relative; overflow: hidden; width: min(100%, 300px, calc((100dvh - 350px) * .5625)); min-width: 150px; aspect-ratio: 9/16; margin: 0 auto; background: #101019; border: 1px solid #ffffff17; border-radius: 5px; box-shadow: 0 10px 35px #0009; }
canvas { display: block; width: 100%; height: 100%; }
.stage-spec { position: absolute; bottom: 8px; color: #6e657e; font-size: 8px; letter-spacing: .14em; font-variant-numeric: tabular-nums; }
.transport { display: flex; align-items: center; gap: 7px; margin-top: 13px; }
.play-button { min-height: 35px; padding: 0 12px; flex: 1; font-size: .72rem; }
.play-button span { font-size: 15px; }
.transport-button { min-height: 35px; padding: 0 8px; color: #a499b4; background: transparent; border-radius: 6px; font-size: .67rem; white-space: nowrap; }
.transport-button:hover { color: #d7c9e7; background: #ffffff06; }
.seek-row { display: flex; align-items: center; gap: 12px; margin-top: 5px; }
.seek-row input { min-width: 0; flex: 1; height: 20px; }
.seek-row output { flex: 0 0 auto; min-width: 72px; text-align: right; color: #a799b8; font-size: .68rem; font-variant-numeric: tabular-nums; }
.timeline { margin-top: 6px; }
.timeline-title { display: flex; justify-content: space-between; gap: 12px; color: #93879f; font-size: .66rem; margin-bottom: 8px; }
.timeline-title span:last-child { color: #6f647c; font-size: .64rem; }
.bar { display: flex; align-items: stretch; gap: 5px; max-width: 100%; min-height: 28px; overflow-x: auto; padding: 0 0 3px; scrollbar-width: thin; scrollbar-color: #6f597e #17151f; }
.bar span, .bar .scene-segment { flex: 1; min-width: 42px; padding: 6px 7px; border: 1px solid #a99aec1a; border-radius: 5px; color: #9d8db1; background: #a99aec0e; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; font-size: .63rem; text-align: center; }
.bar .scene-segment:hover { background: #a99aec20; }
.bar span.active, .bar .scene-segment.active, .bar .scene-segment[aria-current=true] { color: #e3c792; background: #e9c48214; border-color: #e9c48259; box-shadow: inset 0 -2px #e9c48280; }
.preview-note { margin: 7px 0 0; color: #8e809b; font-size: .65rem; line-height: 1.6; }
.export-panel { margin-top: 13px; padding-top: 13px; border-top: 1px solid var(--line); }
.export-heading { display: flex; align-items: center; gap: 12px; }
.export-heading label { flex: 0 0 auto; margin: 0; color: #9d90aa; font-size: .7rem; }
.export-heading select { min-width: 0; min-height: 32px; padding: 6px 9px; font-size: .7rem; background: transparent; border-color: #ffffff0d; }
.actions { display: grid; grid-template-columns: 1fr 1.3fr; gap: 8px; margin-top: 10px; }
.actions .button { min-height: 39px; font-size: .76rem; }
.cancel-button { display: block; width: 100%; min-height: 26px; margin-top: 6px; padding: 4px 8px; color: #a38c9d; background: transparent; font-size: .66rem; }
.cancel-button:hover:not(:disabled) { color: var(--danger); }
.output { display: none; margin-top: 10px; text-align: center; }
.output a { display: flex; justify-content: center; gap: 7px; width: 100%; padding: 12px 14px; color: #b6ead2; border: 1px solid #99d8be4d; border-radius: 8px; background: #99d8be14; font-size: .8rem; font-weight: 600; text-decoration: none; }
.cover-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 18px; }
.cover-fields .wide { grid-column: 1 / -1; }
.cover-fields label { color: #aea0bb; font-size: .73rem; margin-bottom: 6px; }
.cover-fields input, .cover-fields select { font-size: .76rem; padding: 9px 10px; }
.cover-actions { display: grid; margin-top: 16px; }
.cover-help, .cover-status { margin: 9px 0 0; color: #8d809b; font-size: .68rem; line-height: 1.6; }
.cover-status.ready { color: var(--mint); }
.cover-status.error { color: var(--danger); }
.app-footer { display: flex; justify-content: space-between; gap: 16px; padding: 24px 3px 0; color: #615b6c; font-size: .67rem; }
.studio-dialog { width: min(720px,calc(100vw - 32px)); max-height: min(82dvh,900px); padding: 26px; border: 1px solid #b09cb537; border-radius: 20px; color: var(--ink); background: #1a1722; box-shadow: 0 35px 120px #000b; }
.studio-dialog::backdrop { background: #08070ec9; backdrop-filter: blur(8px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 21px; }
.dialog-heading h2 { margin: 0; font-size: 1.2rem; font-weight: 600; }
.dialog-heading p:not(.brand-kicker) { margin: 9px 0 0; color: var(--muted); font-size: .78rem; line-height: 1.6; }
.icon-button { flex: 0 0 32px; height: 32px; border: 1px solid #ffffff13; border-radius: 8px; color: #b9a9c9; background: #ffffff05; font-size: 21px; }
.icon-button:hover { color: #f5e7ff; background: #ffffff0d; }
.project-list { display: grid; gap: 11px; }
.project-item { display: grid; grid-template-columns: 60px minmax(0,1fr) auto; gap: 14px; align-items: center; padding: 13px; border: 1px solid #ffffff13; border-radius: 12px; background: #0d0c134d; }
.project-thumb { display: grid; place-items: center; width: 60px; height: 84px; border: 1px solid #ffffff12; border-radius: 6px; background: #2b2338; color: #a99aec; overflow: hidden; }
.project-thumb img, img.project-thumb { width: 60px; height: 84px; object-fit: cover; }
.project-info { min-width: 0; }
.project-info h3, .project-info strong { display: block; overflow: hidden; margin: 0 0 6px; color: #e5d6eb; font-size: .88rem; text-overflow: ellipsis; white-space: nowrap; }
.project-info p, .project-info small { display: block; margin: 0; color: #93849e; font-size: .7rem; line-height: 1.7; }
.project-item-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 230px; }
.project-item-actions button { min-height: 33px; padding: 0 10px; border: 1px solid #a99aec26; border-radius: 7px; color: #c8b5df; background: #a99aec0d; font-size: .72rem; }
.project-item-actions button:first-child { background: #a99aec26; }
.project-item-actions .danger, .project-item-actions [data-project-delete] { color: var(--danger); border-color: #f1a1ac25; background: transparent; }
.library-empty { margin: 0; padding: 35px 24px; border: 1px dashed #a99aec30; border-radius: 12px; color: #a291b4; text-align: center; font-size: .83rem; line-height: 1.8; }
.dialog-footnote { margin: 18px 0 0; color: #897a95; font-size: .7rem; line-height: 1.7; }
.preflight-issues { display: grid; gap: 9px; }
.preflight-item { padding: 13px 15px; border: 1px solid #e9c48233; border-radius: 10px; background: #e9c48208; color: #d9c5a4; font-size: .8rem; line-height: 1.65; }
.preflight-item.error { border-color: #f1a1ac33; color: #e6adb6; background: #f1a1ac06; }
.preflight-item.ready, .preflight-item.success { border-color: #99d8be33; color: #b5dec9; background: #99d8be08; }
.preflight-item strong { display: block; margin-bottom: 2px; font-size: .78rem; }
.preflight-item button { padding: 3px 0; color: #e9c482; background: transparent; text-decoration: underline; text-underline-offset: 3px; font-size: .73rem; }
.preflight-fixes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.preflight-fixes .button { font-size: .74rem; }
.dialog-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 18px; margin-top: 19px; border-top: 1px solid var(--line); }
.dialog-footer .hint { margin: 0; }
.dialog-footer .button { flex: 0 0 auto; }
@media (min-width: 1550px) { .app { padding-top: 34px; } .layout { gap: 26px; } .section-body { padding: 24px; } .edit-section > summary { padding: 22px 24px; } }
@media (max-height: 700px) and (min-width: 961px) { .preview { position: static; max-height: none; overflow: visible; } .canvas-wrap { width: 230px; } }
@media (max-width: 1150px) { .app { width: calc(100% - 40px); } .project-toolbar { grid-template-columns: 1fr; } .project-actions { justify-content: flex-start; } .project-status { grid-column: auto; } .layout { grid-template-columns: minmax(0,1.1fr) minmax(330px,.9fr); gap: 16px; } .card-source-grid { grid-template-columns: 1fr; } .upload { min-height: 107px; } .scene-controls { grid-template-columns: 1fr 1fr; } .scene-controls > :last-child { grid-column: 1 / -1; } .scene-main { grid-template-columns: 51px minmax(0,1fr) 23px; gap: 8px; } .scene-thumb { width: 51px; height: 72px; } .transport { flex-wrap: wrap; gap: 3px; } .play-button { flex-basis: 100%; } .transport-button { flex: 1; } }
@media (max-width: 960px) { .app { max-width: 760px; } .layout { grid-template-columns: 1fr; } .preview { position: static; max-height: none; overflow: visible; } .card-source-grid { grid-template-columns: 1fr 1fr; } .scene-controls { grid-template-columns: 1fr 1.35fr 1fr; } .scene-controls > :last-child { grid-column: auto; } .scene-main { grid-template-columns: 62px minmax(0,1fr) 25px; gap: 11px; } .scene-thumb { width: 62px; height: 86px; } .canvas-wrap { width: min(100%,300px); } .transport { flex-wrap: nowrap; gap: 8px; } .play-button { flex-basis: auto; } .transport-button { flex: 0 0 auto; } .preview-stage { padding: 18px 16px 29px; } .preview { padding: 20px; } }
@media (max-width: 600px) {
  .app { width: calc(100% - 24px); padding-top: 20px; }
  .app-header { margin-bottom: 19px; }
  .brand { gap: 10px; }
  .mark { width: 35px; height: 41px; font-size: 20px; }
  h1 { font-size: 17px; }
  .brand-kicker { font-size: 8px; }
  .header-note { display: none; }
  .mobile-preview-link { display: block; color: #c6b3df; font-size: .7rem; white-space: nowrap; text-decoration: none; }
  .project-toolbar { padding: 14px; gap: 10px; margin-bottom: 14px; }
  .project-title { gap: 9px; }
  .project-title input { font-size: .85rem; }
  .project-actions { gap: 6px; }
  .project-actions .button { min-height: 38px; padding: 0 10px; font-size: .72rem; }
  .history-actions { margin-right: auto; padding-right: 8px; }
  .history-actions button { font-size: 0; padding: 0 6px; min-width: 30px; }
  .history-actions button span { font-size: 21px; }
  .project-more summary { min-height: 38px; padding: 0 6px; font-size: .7rem; }
  .edit-section > summary { padding: 17px 15px; min-height: 73px; gap: 10px; }
  .section-body { padding: 18px 15px; }
  .section-heading strong { font-size: .88rem; }
  .section-heading small { font-size: .67rem; }
  .section-count { font-size: .63rem; }
  .section-index { flex-basis: 29px; height: 29px; }
  .card-source-grid { grid-template-columns: 1fr; }
  .upload { min-height: 115px; }
  .scene-row { padding: 11px; }
  .scene-main { grid-template-columns: 44px minmax(0,1fr) 22px; gap: 8px; }
  .scene-thumb { width: 44px; height: 62px; }
  .scene-controls { grid-template-columns: 1fr 1.3fr; gap: 11px; }
  .scene-controls > :last-child { grid-column: 1 / -1; }
  .scene-voice-actions button { min-height: 35px; }
  .scene-copy [data-card-name] { font-size: .73rem; }
  .scene-copy textarea { font-size: .76rem; }
  .settings, .tts-controls { gap: 12px; }
  .template-panel, .tts-panel { padding: 13px; }
  .inline-actions { flex-wrap: wrap; gap: 6px; }
  .inline-actions input, .inline-actions select { flex-basis: 100%; }
  .inline-actions button { flex: 1; }
  .music-search-row { flex-wrap: wrap; }
  .music-search-row input { flex-basis: 100%; }
  .music-search-row button { width: 100%; }
  .batch-controls { flex-wrap: wrap; }
  .batch-controls select, .tts-generate { width: 100%; min-height: 39px; }
  .preview { padding: 16px; }
  .preview-stage { padding-top: 14px; }
  .canvas-wrap { width: min(100%,270px); }
  .transport { gap: 3px; }
  .play-button { font-size: .7rem; padding: 0 9px; }
  .transport-button { padding: 0 6px; font-size: .63rem; }
  .project-item { grid-template-columns: 48px minmax(0,1fr); gap: 10px; }
  .project-thumb, .project-thumb img, img.project-thumb { width: 48px; height: 68px; }
  .project-item-actions { grid-column: 1 / -1; max-width: none; justify-content: flex-end; }
  .studio-dialog { padding: 20px; border-radius: 16px; }
  .dialog-footer { align-items: stretch; flex-direction: column; }
  .preflight-fixes { flex-direction: column; }
  .app-footer { padding: 19px 3px 0; font-size: .59rem; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; } }
