:root {
  color-scheme: light;
  --paper:#f8f7f4; --card:#fffefa; --ink:#20201e; --muted:#66645e;
  --line:#e5e1d9; --accent:#b54531; --red:#ee795b; --dark:#202522;
  font: 14px/1.55 "Segoe UI","Microsoft YaHei",sans-serif;
  color:var(--ink); background:var(--paper);
}
* {box-sizing:border-box}
body {margin:0; min-height:100vh}
[hidden] {display:none!important}
a {color:var(--accent); text-decoration:none}
a:hover {text-decoration:underline}
button,input,select,textarea {font:inherit}
button,.button {
  display:inline-flex; align-items:center; justify-content:center; gap:.35rem;
  background:var(--card); border:1px solid var(--line); color:var(--ink);
  padding:.62rem .9rem; border-radius:8px; cursor:pointer; text-decoration:none;
}
button:hover,.button:hover {border-color:#aeaa9f; text-decoration:none}
button:disabled {opacity:.5; cursor:wait}
.primary {background:var(--accent); color:white; border-color:var(--accent); font-weight:650}
.primary:hover {background:#963723; border-color:#963723}
.large {width:100%; min-height:3.2rem; font-size:1.08rem}
.text-btn {border:0; background:none; color:var(--accent); padding:.25rem .45rem}
.rail {
  display:flex; flex-direction:column; position:fixed; inset:0 auto 0 0; width:218px;
  color:#f3f0e9; background:var(--dark); padding:29px 17px 22px;
}
.brand {display:flex; gap:10px; align-items:center; color:white; font-size:1.2rem; white-space:nowrap; padding:0 4px}
.brand b {font-weight:400; color:#d3bcb0}
.brand-mark {display:grid; place-items:center; color:#241c19; background:#f9977b; width:35px; height:35px; border-radius:10px; font:700 31px/1 Georgia}
.rail nav {display:grid; gap:5px; margin-top:39px}
.rail nav a {display:flex; align-items:center; gap:12px; padding:11px 12px; border-radius:8px; white-space:nowrap; color:#dbddd4}
.rail nav a span {width:20px; text-align:center; color:#bfc5b7; font-size:1.13rem}
.rail nav .selected {background:#f5ddcb; color:#2f2620; font-weight:650}
.rail nav .selected span {color:var(--accent)}
.rail nav a:hover {text-decoration:none; outline:1px solid #9b9c90}
.rail nav b {margin-left:auto; border-radius:12px; background:#a84430; color:white; padding:0 6px; font-size:.8rem}
.rail-foot {margin-top:auto; display:grid; gap:8px; padding:12px}
.rail-foot a {color:#b8bfb3; font-size:.86rem}
.rail-foot button {justify-content:flex-start; background:none; padding:0; border:0; color:#b8bfb3; font-size:.86rem}
.rail-foot button:hover {text-decoration:underline}
.queue-section-title {margin:0 0 9px}
.queue-actions {justify-content:flex-end; flex-shrink:0}
.job-badges {display:flex; flex-wrap:wrap; align-items:center; gap:8px}
.job-runtime {font-size:.86rem; color:var(--muted); white-space:nowrap; font-variant-numeric:tabular-nums}
.queue-position {white-space:nowrap; color:var(--accent); font-variant-numeric:tabular-nums; font-size:.86rem; font-weight:650}
#char-count.over-limit {color:var(--accent); font-weight:650}
.other-queue {margin-top:20px}
.job-summary {display:flex; justify-content:space-between; align-items:center; gap:12px; padding:12px 18px}
.job-summary h3 {font-size:.98rem}
.studio-login {min-height:100vh; display:grid; place-items:center; padding:16px}
.studio-login form {width:min(100%,380px); padding:25px}
.studio-login h1 {font-size:1.55rem; margin:0 0 3px}
#login-error {color:var(--accent)}
main {margin-left:218px; min-width:0}
.top {
  display:flex; justify-content:space-between; align-items:center; gap:10px;
  padding:0 32px; min-height:65px; border-bottom:1px solid var(--line); color:var(--muted); background:var(--card);
}
.top strong {color:var(--ink)}
.sep {padding:0 7px; color:#96938a}
.queue-pill {color:#415248; border:1px solid var(--line); border-radius:24px; padding:5px 11px; display:flex; align-items:center; gap:7px; font-size:.86rem}
.queue-pill i {height:7px; width:7px; border-radius:100%; background:#628b73}
.queue-pill:has(.busy) i {background:#b54531}
.content {padding:28px 32px 45px; max-width:1510px; margin:0 auto}
.hero {
  position:relative; overflow:hidden; background:#242926; color:#fcf3e9;
  min-height:222px; padding:25px 32px; margin-bottom:20px; border-radius:15px;
  display:flex; align-items:center; justify-content:space-between;
}
.hero>div:first-child {position:relative; z-index:1}
.eyebrow {letter-spacing:.18em; font-size:.76rem; color:#e4b8a6; font-weight:650}
.hero h2 {font-size:clamp(2.1rem,4vw,3.25rem); line-height:1.16; letter-spacing:-.06em; margin:.5rem 0}
.hero h2 span {color:#f58d70}
.hero p {margin:.75rem 0 0; color:#d2cdc4}
.hero-wave {
  display:flex; align-items:center; gap:clamp(3px,.55vw,9px); justify-content:center; width:56%; height:205px; position:absolute; right:0;
  background:radial-gradient(ellipse,#b4594b30,transparent 73%);
}
.hero-wave i {display:block; width:4px; min-width:2px; border-radius:9px; background:linear-gradient(#ffbda4,#ef7b5d,#f8aa86); opacity:.84}
.editor-grid,.clone-grid {display:grid; grid-template-columns:minmax(0,1.65fr) minmax(290px,1fr); gap:18px; align-items:start}
.clone-grid {grid-template-columns:1fr 1fr}
.card {background:var(--card); border:1px solid var(--line); border-radius:12px; min-width:0}
.card-head {display:flex; justify-content:space-between; align-items:center; gap:10px; margin-bottom:14px}
.card-head a {font-size:.86rem}
h3 {font-size:1.1rem; margin:0}
.padded,.script-card,.config {padding:19px}
.script-card textarea {width:100%; min-height:233px; resize:vertical; font-size:1.09rem; padding:15px; line-height:1.8}
input:not([type=checkbox],[type=range],[type=file]),select,textarea {
  width:100%; max-width:100%; padding:.63rem .7rem; border:1px solid #d8d3c9;
  border-radius:8px; background:#fffefa; color:var(--ink);
}
input:focus,select:focus,textarea:focus,button:focus-visible,a:focus-visible {outline:2px solid #a94734; outline-offset:2px}
label {display:grid; gap:6px; font-weight:550}
label:has(input[type=range]) {grid-template-columns:1fr auto}
label:has(input[type=range]) input {grid-column:1/-1; width:100%; accent-color:var(--accent)}
output {color:var(--accent); font-variant-numeric:tabular-nums}
.config {display:grid; gap:13px}
.config .card-head {margin-bottom:0}
audio {display:block; width:100%; min-width:0; height:38px}
.wave-player {width:100%; min-width:0; padding:9px; border-radius:9px; background:#252c2a; color:#e2e9e4}
.wave-player:has(>audio[hidden]) {display:none}
.inline>.wave-player {width:min(100%,410px)}
.wave-player audio {margin:0!important}
.wave-track {position:relative; height:50px; border-radius:4px}
.wave-track:focus-within {outline:2px solid #ff9879; outline-offset:2px}
.wave-track canvas {display:block; width:100%; height:100%; opacity:0}
.wave-track.ready canvas {opacity:1}
.wave-track input[type=range] {position:absolute; inset:0; width:100%; height:100%; padding:0; margin:0; opacity:0; cursor:pointer}
.wave-track input:disabled {cursor:default}
.wave-message {position:absolute; inset:0; display:grid; place-items:center; color:#d5ded8; font-size:.78rem; pointer-events:none}
.wave-time {display:flex; justify-content:space-between; margin:2px 2px 6px; color:#d3ddd6; font-size:.75rem; font-variant-numeric:tabular-nums}
.editor-foot,.result-zone {display:flex; justify-content:space-between; gap:8px; color:var(--muted); font-size:.86rem}
.editor-foot {margin-top:7px}
.result-zone {flex-direction:column; justify-content:start; margin-top:13px; padding-top:12px; border-top:1px solid var(--line)}
.result-zone:empty {display:none}
details {border-top:1px solid var(--line); padding:9px 0 0}
details summary {cursor:pointer; color:var(--muted)}
details label {margin-top:9px}
.check {display:flex; align-items:center; gap:7px; font-weight:400}
.check input {accent-color:var(--accent); width:16px; height:16px}
.heading {display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:20px}
.heading h2 {font-size:2rem; margin:0; letter-spacing:-.04em}
.heading p {margin:5px 0 0; color:var(--muted)}
.inline,.tools,.form-footer,.pagination {display:flex; flex-wrap:wrap; align-items:center; gap:9px}
.form-footer {justify-content:flex-end; padding-top:16px}
.pagination {justify-content:center; margin:16px 0}
.small {font-size:.86rem}
.muted {color:var(--muted)}
.batch-head,.split {display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px}
.split {grid-template-columns:1fr 1fr}
.batch-label {margin:17px 0 0}
.batch-label small {font-size:.8rem; color:var(--muted); margin-left:5px}
#batch-instruction {margin-top:13px}
.batch-row {display:grid; grid-template-columns:24px minmax(0,1fr) minmax(120px,190px) auto; gap:10px; align-items:start; border-top:1px solid var(--line); padding:12px 0}
.batch-row>span {padding-top:8px; color:var(--muted)}
.upload {border:1px dashed #bcb1a0; border-radius:10px; padding:23px; margin:13px 0; cursor:pointer; text-align:center; background:#fcf7ed; overflow-wrap:anywhere}
.upload span {color:var(--accent); font-size:1.7rem; line-height:1}
.upload.drop-active {border-color:var(--accent); background:#f8e4d9; box-shadow:0 0 0 2px #b5453140}
.prepare-progress {display:grid; gap:6px; margin-top:14px; color:var(--muted); font-size:.86rem}
.upload small {font-weight:400; color:var(--muted)}
#source-audio,#clone .wave-player:has(>#source-audio),#prepare-form {margin-top:12px}
#prepare-form button {margin-top:10px}
.tools {margin-bottom:15px}
.tools input {max-width:365px!important}
.tools select {max-width:205px}
.voice-grid {display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:13px}
.voice-card {display:grid; gap:12px}
.voice-card h3 {overflow-wrap:anywhere}
.voice-icon {width:34px; height:34px; display:grid; place-items:center; border-radius:8px; background:#f4dbcf; color:var(--accent); font-weight:700}
.voice-card p {margin:0; overflow-wrap:anywhere}
.stack {display:grid; gap:10px}
.record {display:grid; gap:9px}
.record p {margin:0; white-space:pre-wrap; overflow-wrap:anywhere}
.record audio {max-width:410px}
.job-info {display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px}
.job-item {padding:10px 0; border-top:1px solid var(--line); overflow-wrap:anywhere}
.job-item p {margin:5px 0}
.job-item audio {max-width:375px}
.progress {width:100%; height:7px; accent-color:var(--accent)}
.status {border-radius:6px; padding:3px 8px; background:#f3ece1; color:#71513c; font-size:.84rem}
.status.done {background:#e6eee1; color:#3f633a}
.status.failed {background:#f7e5df; color:#963b2e}
.empty {padding:25px; color:var(--muted); background:var(--card); border:1px dashed var(--line); border-radius:10px; grid-column:1/-1}
#notice {position:sticky; top:8px; z-index:3; padding:11px 14px; background:#e9efe4; color:#294b32; margin-bottom:12px; border-radius:8px; overflow-wrap:anywhere}
#notice.error {background:#f8e5df; color:#872e22}
.sr-only {position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0}
@media(max-width:1050px) {
  .rail {width:185px} main {margin-left:185px} .top,.content {padding-left:20px; padding-right:20px}
  .editor-grid {grid-template-columns:minmax(0,1fr) minmax(245px,.85fr)}
  .voice-grid {grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:760px) {
  .rail {position:static; width:100%; padding:13px 14px 9px}
  .rail nav {display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); margin:12px 0 4px; gap:4px; padding:2px}
  .rail nav a {padding:7px 6px; gap:4px; font-size:.87rem}
  .rail nav a span {width:auto}
  .rail-foot {display:flex; flex-wrap:wrap; gap:12px; margin:0; padding:6px 4px 2px}
  main {margin-left:0}
  .top,.content {padding-left:13px; padding-right:13px}
  .top {min-height:48px}
  .content {padding-top:13px}
  .hero {padding:21px; min-height:177px}
  .hero h2 {font-size:2rem}
  .hero p {max-width:220px; font-size:.86rem}
  .hero-wave {height:130px; width:63%; opacity:.45; right:-4%}
  .editor-grid,.clone-grid,.voice-grid {grid-template-columns:1fr}
  .batch-head {grid-template-columns:1fr}
  .batch-row {grid-template-columns:19px minmax(0,1fr) auto}
  .batch-row select {grid-column:2/-1; grid-row:2}
  .heading {align-items:flex-start}
  #jobs>.heading {flex-wrap:wrap}
  .heading h2 {font-size:1.62rem}
  .heading p {font-size:.86rem}
}
