:root {
  color-scheme: light;
  --page: #ffffff;
  --ink: #21232d;
  --muted: #747b89;
  --line: #e7eaf0;
  --accent: #4f56db;
  --accent-hover: #4148c6;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--page);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
main { width: min(100%, 760px); margin: 0 auto; padding: 58px 28px 40px; }
header { margin-bottom: 30px; }
h1, h2, p { margin: 0; }
h1 { font-size: 30px; font-weight: 650; letter-spacing: -.7px; line-height: 1.35; }
h2 { font-size: 17px; font-weight: 600; line-height: 1.5; }
.intro { margin-top: 9px; color: var(--muted); font-size: 15px; }
button, input, textarea { font: inherit; }
button { min-height: 44px; border-radius: 9px; padding: 9px 18px; font-size: 15px; font-weight: 550; cursor: pointer; border: 1px solid transparent; }
button:disabled { cursor: default; opacity: .48; }
button:not(:disabled):active { transform: translateY(1px); }
.primary { color: #fff; background: var(--accent); }
.primary:not(:disabled):hover { background: var(--accent-hover); }
.secondary { color: var(--ink); border-color: var(--line); background: #fff; padding: 7px 13px; }
.secondary:hover { background: var(--page); }
.quiet { padding: 4px 0; color: var(--accent); background: transparent; text-align: left; }
button:focus-visible, a:focus-visible, summary:focus-visible, .transcript:focus-visible { outline: 3px solid #86aafa; outline-offset: 3px; }
label { display: block; font-weight: 550; font-size: 15px; margin-bottom: 10px; }
textarea, input { border: 1px solid #cbd3dc; background: white; color: var(--ink); border-radius: 10px; }
textarea { display: block; width: 100%; padding: 16px; min-height: 156px; resize: vertical; line-height: 1.7; }
textarea::placeholder, input::placeholder { color: #88929d; }
textarea:focus, input:focus { outline: 3px solid #dce7ff; border-color: var(--accent); }
.submit-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 14px; }
.hint { color: var(--muted); font-size: 13px; }
.review-toggle { display: flex; align-items: center; gap: 9px; margin: 16px 0 3px; font-size: 14px; cursor: pointer; }
.review-toggle input { width: 17px; height: 17px; margin: 0; accent-color: var(--accent); }
.review-hint { font-size: 12px; color: var(--muted); line-height: 1.7; }
.error { color: #b53333; font-size: 14px; margin-top: 10px; overflow-wrap: anywhere; }
.error:empty { display: none; }
.service-state { color: var(--muted); font-size: 14px; margin-bottom: 16px; min-height: 22px; }
.service-state[data-state="ready"] { display: none; }
.service-state[data-state="unavailable"] { color: #a05221; }
#prepare-again, #reconnect-service { margin-top: -8px; margin-bottom: 16px; }
.queue-panel { padding: 12px 15px; margin-bottom: 22px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 14px; overflow-wrap: anywhere; }
.queue-capacity { margin-top: 3px; color: var(--muted); font-size: 12px; }
.queue-panel[data-full="true"] { border-color: #e2c9a4; background: #fffaf2; }
.access-panel { border-left: 3px solid var(--accent); padding: 0 0 0 18px; margin-bottom: 30px; }
.access-panel p { font-size: 14px; color: var(--muted); margin: 5px 0 12px; }
.access-row { display: flex; gap: 10px; }
.access-row input { flex: 1; min-width: 0; padding: 10px 12px; }
.access-panel .error { color: #b53333; }
.activity { width: 14px; height: 14px; flex: 0 0 14px; border: 2px solid #cfdcf5; border-top-color: var(--accent); border-radius: 50%; animation: turn 1s linear infinite; }
.activity[data-active="false"] { animation: none; border: 0; background: #778391; width: 7px; height: 7px; flex-basis: 7px; margin: 0 3px; }
.elapsed { color: var(--muted); font-size: 13px; margin-left: auto; font-variant-numeric: tabular-nums; }
.job-message { margin-top: 8px; color: var(--muted); font-size: 14px; }
.job-message:empty { display: none; }
.batch-panel { margin-top: 30px; }
.batch-panel > h2 { margin-bottom: 14px; font-size: 18px; }
.batch-stats { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.batch-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; margin-bottom: 10px; }
.select-all { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; }
.select-all input, .job-select input { accent-color: var(--accent); width: 18px; height: 18px; margin: 0; }
.job-row { display: grid; grid-template-columns: 30px minmax(0, 1fr); border-top: 1px solid var(--line); }
.job-select { padding-top: 20px; margin: 0; cursor: pointer; }
.job-select input:disabled { opacity: .35; cursor: default; }
.job-card { min-width: 0; }
.job-summary { cursor: pointer; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 19px 0; list-style: none; }
.job-summary::-webkit-details-marker { display: none; }
.job-summary::after { content: '+'; color: var(--muted); width: 14px; text-align: center; }
.job-card[open] > .job-summary::after { content: '−'; }
.job-label { font-size: 15px; font-weight: 550; }
.job-content { padding: 0 0 24px; }
.job-content .job-message { margin: 0 0 12px; }
.job-content .result-actions { margin-top: 14px; flex-wrap: wrap; }
.copy-field { position: fixed; left: -9999px; top: 0; }
.progress-area { flex-basis: 100%; width: 100%; display: flex; flex-direction: column; gap: 3px; margin-top: 2px; order: 2; }
.stage-progress { width: 100%; height: 7px; display: block; accent-color: var(--accent); }
.progress-label { font-size: 12px; color: var(--muted); text-align: right; }
.stage-list { display: flex; flex-wrap: wrap; gap: 7px 14px; list-style: none; padding: 0; margin: 0 0 16px; color: #939ca6; font-size: 12px; }
.stage-list .done { color: #546575; }
.stage-list .current { color: var(--accent); font-weight: 600; }
.review-report { border-top: 1px solid var(--line); margin-top: 21px; padding-top: 16px; }
.review-report h3 { font-size: 15px; margin: 0 0 5px; }
.review-note { font-size: 13px; color: var(--muted); margin-top: 8px; overflow-wrap: anywhere; }
.review-item { margin-top: 13px; font-size: 14px; }
.review-item summary { cursor: pointer; color: #8c5820; padding: 5px 0; }
.review-item p { margin-top: 7px; overflow-wrap: anywhere; }
.result-actions { display: flex; gap: 8px; }
.video-title { font-size: 15px; font-weight: 550; line-height: 1.6; overflow-wrap: anywhere; }
.result-meta { color: var(--muted); font-size: 13px; margin-top: 5px; }
.transcript { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 22px; margin-top: 16px; line-height: 1.9; font-size: 17px; white-space: pre-wrap; overflow-wrap: anywhere; }
.text-editor { margin-top: 16px; }
.text-editor label { margin-bottom: 6px; }
.text-editor textarea { min-height: 230px; font-size: 16px; }
.text-editor .hint { margin: 8px 0; max-width: none; }
.generated-original summary { color: var(--muted); }
.warnings { padding-left: 21px; color: #95601f; font-size: 14px; margin: 16px 0 0; }
.warnings li + li { margin-top: 7px; }
.source-link { display: inline-block; color: var(--accent); font-size: 14px; margin-top: 14px; text-underline-offset: 3px; }
.action-message { color: var(--muted); font-size: 14px; margin-top: 8px; }
dialog { width: min(400px, calc(100% - 40px)); border: 1px solid var(--line); border-radius: 14px; padding: 24px; color: var(--ink); background: #fff; }
dialog::backdrop { background: rgb(20 28 40 / .35); }
dialog p { color: var(--muted); font-size: 14px; margin: 8px 0 16px; }
dialog input { width: 100%; padding: 10px 12px; }
dialog .error { color: #b53333; margin-bottom: 0; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.duplicate-actions { flex-wrap: wrap; }
#copy-dialog { width: min(660px, calc(100% - 40px)); }
#copy-text { min-height: 220px; max-height: 50vh; }
footer { margin-top: 30px; color: var(--muted); font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip: rect(0, 0, 0, 0); overflow: hidden; white-space: nowrap; border: 0; }
@keyframes turn { to { transform: rotate(360deg); } }
@media (max-width: 520px) {
  main { padding: 30px 20px 28px; }
  header { margin-bottom: 26px; }
  h1 { font-size: 27px; }
  .intro { font-size: 14px; }
  textarea { padding: 13px; min-height: 164px; }
  .submit-row { gap: 10px; }
  .hint { font-size: 12px; }
  .submit-row .hint { max-width: 170px; }
  #extract-button { white-space: nowrap; }
  .result-actions { gap: 6px; }
  .result-actions button { padding: 7px 11px; font-size: 14px; }
  .batch-tools .result-actions { flex-basis: 100%; flex-wrap: wrap; }
  .batch-panel > .hint { max-width: none; }
  .transcript { padding: 17px; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .activity { animation: none; }
  button:not(:disabled):active { transform: none; }
}
