:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-soft: #f9fbff;
  --text: #111b35;
  --muted: #7e8798;
  --line: #dde3ed;
  --blue-line: #cddaff;
  --blue-soft: #f1f5ff;
  --accent: #c74280;
  --accent-strong: #a92d68;
  --accent-soft: #fbe8f1;
  --blue: #597dff;
  --red: #c84152;
  --shadow: 0 10px 28px rgba(31, 41, 55, .08);
  --sans: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--sans);
  background:
    radial-gradient(circle at 12% 0%, rgba(251, 114, 153, .08), transparent 30%),
    radial-gradient(circle at 92% 12%, rgba(89, 125, 255, .08), transparent 32%),
    var(--bg);
}
body > header {
  max-width: 1180px;
  margin: 38px auto 30px;
  padding: 34px 36px;
  display: grid;
  grid-template-columns: 1.45fr .9fr;
  gap: 38px;
  align-items: center;
  border: 1px solid rgba(251, 114, 153, .34);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(251, 114, 153, .11), rgba(89, 125, 255, .08));
}
.eyebrow { margin: 0; color: var(--accent-strong); letter-spacing: .13em; font-size: 12px; font-weight: 800; }
h1 { max-width: 760px; margin: 12px 0 14px; font-size: clamp(38px, 5vw, 62px); line-height: 1.08; letter-spacing: -.035em; }
.lead { max-width: 690px; margin: 0; color: #626d80; line-height: 1.75; }
.project-meta { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 9px 18px; font-size: 12px; }
.project-meta a { text-decoration: none; }
.creator-credit { color: var(--accent-strong); font-weight: 800; }
.project-links { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 14px; }
.project-links a { color: #526078; border-bottom: 1px solid rgba(82, 96, 120, .3); line-height: 1.65; }
.project-links a:hover, .project-links a:focus-visible, .creator-credit:hover, .creator-credit:focus-visible { color: var(--accent); border-color: currentColor; }
.status-card {
  padding: 20px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(89, 125, 255, .2);
  border-radius: 15px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 8px 22px rgba(31, 41, 55, .06);
}
.status-card .doctor-action { grid-column: 2; }
.status-card small { display: block; margin-top: 5px; color: var(--muted); line-height: 1.5; }
.doctor-action { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.doctor-action small { margin: 0; }
.doctor-action[data-result]::after { content: attr(data-result); display: block; flex-basis: 100%; color: #4f5d73; font-size: 12px; line-height: 1.5; }
.workload { grid-column: 2; width: 100%; padding: 10px 12px; border: 1px solid rgba(216, 88, 150, .24); border-radius: 9px; color: var(--accent-strong); background: var(--accent-soft); font: 750 13px var(--sans); text-align: left; cursor: pointer; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #a3abba; box-shadow: 0 0 0 5px rgba(163, 171, 186, .16); }
.dot.ok { background: #34b878; box-shadow: 0 0 0 5px rgba(52, 184, 120, .14); }
.dot.bad { background: #e05d6f; box-shadow: 0 0 0 5px rgba(224, 93, 111, .12); }
nav {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: 8px;
  border-block: 1px solid rgba(89, 125, 255, .18);
  background: rgba(244, 247, 251, .9);
  backdrop-filter: blur(18px);
}
.tab { padding: 17px 30px; border: 0; border-bottom: 3px solid transparent; color: #566176; background: transparent; font: 650 15px var(--sans); cursor: pointer; }
.tab:hover { color: var(--accent-strong); }
.tab.active { color: var(--accent); border-color: var(--accent); }
main { max-width: 1060px; margin: 0 auto; padding: 54px 28px 140px; }
.panel { display: none; }
.panel.active { display: block; }
.section-title { display: flex; justify-content: space-between; gap: 36px; align-items: end; margin-bottom: 26px; }
.section-title > div { display: flex; gap: 16px; align-items: center; }
.section-title span { min-width: 38px; padding: 7px 9px; border-radius: 9px; color: var(--accent); background: var(--accent-soft); font-size: 14px; font-weight: 800; text-align: center; }
h2 { margin: 0; font-size: 31px; line-height: 1.2; letter-spacing: -.02em; }
.section-title p { max-width: 400px; margin: 0; color: var(--muted); line-height: 1.6; }
.grid-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; padding: 28px; border: 1px solid var(--line); border-radius: 17px; background: var(--panel); box-shadow: var(--shadow); }
.wide { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 8px; color: #37435a; font-size: 13px; font-weight: 650; }
textarea, input, select { width: 100%; padding: 13px 14px; border: 1px solid #d9e0ea; border-radius: 9px; outline: 0; color: var(--text); background: #fbfcff; font: 14px/1.55 var(--sans); transition: border-color .16s ease, box-shadow .16s ease, background .16s ease; }
textarea::placeholder, input::placeholder { color: #a2adbf; }
textarea:focus, input:focus, select:focus { border-color: rgba(216, 88, 150, .7); background: #fff; box-shadow: 0 0 0 3px rgba(216, 88, 150, .1); }
textarea { resize: vertical; }
.primary, .ghost, .danger { padding: 13px 20px; border-radius: 9px; font: 750 14px var(--sans); cursor: pointer; transition: transform .14s ease, box-shadow .14s ease, background .14s ease; }
.primary:hover, .ghost:hover, .danger:hover { transform: translateY(-1px); }
.primary { border: 1px solid var(--accent-strong); color: #fff; background: linear-gradient(135deg, #c94a84, var(--accent-strong)); box-shadow: 0 7px 18px rgba(169, 45, 104, .2); }
.primary:hover { background: linear-gradient(135deg, #bd3d78, #96265d); }
.primary:disabled { color: #9aa3b1; border-color: #e2e6ec; background: #edf0f4; box-shadow: none; cursor: not-allowed; transform: none; }
.ghost { border: 1px solid #e0e5ed; color: var(--text); background: #fff; box-shadow: 0 4px 12px rgba(31, 41, 55, .07); }
.ghost:hover { color: var(--accent-strong); border-color: rgba(216, 88, 150, .3); }
.danger { border: 1px solid rgba(200, 65, 82, .18); color: var(--red); background: #fff1f3; }
.danger:disabled { color: #9aa3b1; border-color: #e2e6ec; background: #edf0f4; cursor: not-allowed; transform: none; }
.compact { padding: 9px 12px; font-size: 12px; white-space: nowrap; }
.primary:focus-visible, .ghost:focus-visible, .danger:focus-visible, .tab:focus-visible, .workload:focus-visible { outline: 3px solid rgba(89, 125, 255, .28); outline-offset: 2px; }
.full { width: 100%; margin-top: 14px; }
.advanced { padding: 15px 17px; border: 1px solid rgba(89, 125, 255, .2); border-radius: 12px; background: var(--blue-soft); }
.advanced summary { color: #3156c8; font-weight: 700; cursor: pointer; }
.advanced-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }
.check { flex-direction: row; align-items: center; }
.check input { width: auto; accent-color: var(--accent); }
.workbench { margin-top: 28px; padding: 25px; border: 1px solid rgba(251, 114, 153, .28); border-radius: 17px; background: var(--panel); box-shadow: var(--shadow); }
.workbench-head, .toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.workbench h3 { margin: 0 0 16px; font-size: 23px; }
.badge { padding: 6px 10px; border-radius: 8px; color: var(--accent-strong); background: var(--accent-soft); font-size: 12px; font-weight: 750; }
.toolbar { justify-content: flex-end; margin-top: 16px; }
.toolbar .check { margin-right: auto; }
.toolbar label { min-width: 180px; }
.upload-box { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 54px 20px; border: 1px dashed rgba(89, 125, 255, .55); border-radius: 16px; color: #34415a; background: linear-gradient(120deg, rgba(89, 125, 255, .07), rgba(251, 114, 153, .06)), #fff; text-align: center; box-shadow: 0 7px 22px rgba(31, 41, 55, .05); }
.upload-box input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload-box span { color: var(--muted); font-size: 13px; }
.creation-options { margin-top: 22px; display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 16px; align-items: start; }
.choice-card { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-soft); }
.choice-card.accent-card { border-color: rgba(216, 88, 150, .3); background: linear-gradient(145deg, rgba(251, 232, 241, .62), #fff 52%); }
.choice-step { color: var(--accent-strong); font-size: 11px; font-weight: 800; letter-spacing: .05em; }
.choice-card h4 { margin: 7px 0 6px; font-size: 19px; }
.choice-card p { min-height: 42px; margin: 0 0 14px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.mini-upload { position: relative; padding: 16px; gap: 4px; border: 1px dashed rgba(89, 125, 255, .5); border-radius: 10px; background: rgba(255,255,255,.8); text-align: center; cursor: pointer; }
.mini-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.mini-upload span { color: var(--muted); font-size: 11px; font-weight: 400; }
.upload-preview { margin: 12px 0 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.85); }
.upload-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.upload-preview-head button { padding: 6px 12px; font-size: 12px; }
.upload-preview audio { display: block; width: 100%; min-width: 0; margin-top: 10px; }
.upload-preview p { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.upload-box b, .mini-upload b { overflow-wrap: anywhere; }
.voice-settings { margin-top: 12px; }
.voice-settings .advanced-grid { grid-template-columns: repeat(2, 1fr); }
.results { display: grid; gap: 14px; margin-top: 28px; }
.result-card, .history-card { padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 7px 20px rgba(31, 41, 55, .05); }
.result-card header, .history-card header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0; margin: 0; border: 0; background: none; }
.result-card audio, .history-card audio { width: 100%; margin-top: 14px; }
.meta { color: var(--muted); font-size: 12px; line-height: 1.6; }
.history-list { display: grid; gap: 12px; }
.history-card { display: grid; grid-template-columns: 1fr auto; gap: 8px 20px; }
.history-card audio { grid-column: 1 / -1; }
.history-card .toolbar, .history-card .job-log { grid-column: 1 / -1; }
.failure-card p { margin: 9px 0 0; color: #4e596c; line-height: 1.65; }
.failure-actions { justify-content: flex-start; }
.job-log { max-height: 320px; overflow: auto; margin: 10px 0 0; padding: 14px; border: 1px solid #e1e6ee; border-radius: 9px; color: #273248; background: #f7f9fc; font: 11px/1.55 Consolas, "SFMono-Regular", monospace; white-space: pre-wrap; word-break: break-word; }
.status-complete { color: #21885a; }
.status-failed, .status-cancelled { color: var(--red); }
.task-center { margin: 0 0 42px; overflow: hidden; border: 1px solid rgba(89, 125, 255, .2); border-radius: 16px; background: var(--panel); box-shadow: 0 8px 24px rgba(31, 41, 55, .06); }
.model-settings { margin: 0 0 42px; border: 1px solid rgba(89, 125, 255, .18); border-radius: 14px; background: rgba(255, 255, 255, .8); box-shadow: 0 6px 18px rgba(31, 41, 55, .045); }
.model-settings > summary { padding: 15px 18px; display: flex; align-items: center; justify-content: space-between; gap: 18px; cursor: pointer; list-style: none; }
.model-settings > summary::-webkit-details-marker { display: none; }
.model-settings > summary span:first-child { min-width: 0; display: grid; gap: 4px; }
.model-settings > summary b { font-size: 14px; }
.model-settings > summary small { overflow: hidden; color: var(--muted); font-size: 11px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.settings-action { color: var(--accent-strong); font-size: 11px; font-weight: 800; white-space: nowrap; }
.model-settings[open] .settings-action::after { content: " · 收起"; }
.model-settings-body { padding: 20px; display: grid; grid-template-columns: minmax(0, .9fr) minmax(360px, 1.1fr); gap: 24px; border-top: 1px solid var(--line); }
.model-settings-copy h3 { margin: 0 0 8px; font-size: 19px; }
.model-settings-copy p { margin: 0 0 8px; color: #687489; font-size: 12px; line-height: 1.65; }
.model-settings-copy a { color: var(--accent-strong); font-size: 12px; font-weight: 750; }
.model-settings-copy code { padding: 1px 4px; border-radius: 4px; color: #33415b; background: var(--blue-soft); }
.model-settings-form { display: flex; flex-direction: column; justify-content: center; gap: 11px; }
.model-settings-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.model-settings-actions .primary, .model-settings-actions .ghost { padding: 10px 13px; font-size: 12px; }
.task-center-head { position: static; display: flex; justify-content: space-between; align-items: center; padding: 17px 22px; margin: 0; border: 0; border-bottom: 1px solid var(--line); background: linear-gradient(120deg, rgba(216, 88, 150, .055), rgba(89, 125, 255, .045)); }
.task-center-label { display: block; margin-bottom: 3px; color: var(--accent-strong); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.task-center-head h2 { margin: 0; font-size: 19px; line-height: 1.25; }
.task-center-body { padding: 20px 22px; }
.task-group { margin: 0; }
.task-group + .task-group { margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }
.task-group-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 9px; }
.task-group-title b { font-size: 13px; }
.task-group-title span { color: var(--muted); font-size: 11px; }
.running-job { padding: 0; }
.task-card-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.task-card-head > div { display: grid; gap: 4px; }
.task-type { color: var(--accent-strong); font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.task-card-head b { font-size: 20px; }
.task-hint, .task-summary { margin: 9px 0 0; color: #5e6a7e; font-size: 12px; line-height: 1.55; }
.task-summary { overflow: hidden; color: #39465c; text-overflow: ellipsis; white-space: nowrap; }
.task-steps { margin: 15px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 7px; list-style: none; }
.task-steps li { min-height: 34px; padding: 7px 8px; display: flex; align-items: center; justify-content: center; border: 1px solid #e1e6ee; border-radius: 8px; color: #98a1b0; background: #fbfcff; font-size: 10px; line-height: 1.25; text-align: center; }
.task-steps li.done { color: #287b5a; border-color: rgba(52, 184, 120, .26); background: rgba(52, 184, 120, .08); }
.task-steps li.current { color: var(--accent-strong); border-color: rgba(216, 88, 150, .34); background: var(--accent-soft); font-weight: 800; }
.task-meta { margin-top: 11px; display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 10px; }
.queue-list { max-height: 280px; overflow: auto; margin: 0; padding: 0; display: grid; gap: 7px; list-style: none; }
.queue-job { padding: 10px 12px; display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-soft); }
.queue-position { display: grid; gap: 3px; padding-right: 10px; border-right: 1px solid var(--line); }
.queue-position b { color: var(--accent-strong); font-size: 12px; }
.queue-position span, .queue-copy small { color: var(--muted); font-size: 10px; }
.queue-copy { min-width: 0; }
.queue-copy b { font-size: 13px; }
.queue-copy p { overflow: hidden; margin: 4px 0; color: #59667a; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }
.panel > .results:empty { display: none; }
.panel > .results:not(:empty) { margin-bottom: 24px; scroll-margin-top: 90px; }
.audio-download { display: inline-flex; align-items: center; text-decoration: none; }
footer { padding: 30px; border-top: 1px solid #e0e5ed; color: #8a94a5; text-align: center; font-size: 12px; }
@media (max-width: 760px) {
  body > header { grid-template-columns: 1fr; margin: 18px; padding: 26px 22px; }
  .project-meta { align-items: flex-start; flex-direction: column; }
  .section-title { display: block; }
  .section-title p { margin-top: 12px; }
  .grid-form { grid-template-columns: 1fr; padding: 18px; }
  .wide { grid-column: auto; }
  .advanced-grid { grid-template-columns: 1fr; }
  .creation-options { grid-template-columns: 1fr; }
  .voice-settings .advanced-grid { grid-template-columns: 1fr; }
  .tab { padding: 15px 16px; }
  .toolbar { flex-wrap: wrap; }
  .history-card { grid-template-columns: 1fr; }
  .doctor-action { align-items: stretch; flex-direction: column; }
  .task-center { margin-bottom: 30px; }
  .model-settings { margin-bottom: 30px; }
  .model-settings-body { grid-template-columns: 1fr; padding: 17px; }
  .model-settings-actions > button { width: 100%; }
  .task-center-head { align-items: flex-start; padding: 15px 16px; }
  .task-center-body { padding: 17px 16px; }
  .queue-job { grid-template-columns: 62px minmax(0, 1fr); }
  .queue-job .danger { grid-column: 1 / -1; width: 100%; }
  .task-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1 { font-size: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
