*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --bg: #f6f9fc;
  --surface: #ffffff;
  --surface-soft: #fafbfc;
  --text: #0a2540;
  --text-2: #425466;
  --text-dim: #8898aa;
  --border: #e6ebf1;
  --border-strong: #cfd7df;
  --accent: #4f46e5;
  --accent-2: #7c3aed;
  --accent-soft: #eef2ff;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --admin: #ea580c;
  --radius: 8px;
  --side-w: 240px;
  --top-h: 64px;
  --shadow-sm: 0 2px 4px rgba(50, 50, 93, .05), 0 1px 2px rgba(0, 0, 0, .03);
  --shadow: 0 4px 6px -1px rgba(50, 50, 93, .07), 0 2px 4px -1px rgba(0, 0, 0, .04);
  --grad: linear-gradient(135deg, var(--accent), var(--accent-2));
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .72), rgba(255, 255, 255, 0) 220px),
    var(--bg);
  font-size: 14px;
  line-height: 1.65;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(79, 70, 229, .34);
  outline-offset: 2px;
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--top-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  box-shadow: 0 1px 3px rgba(50, 50, 93, .04);
}

.topbar-logo,
.topbar-right,
.login-brand {
  display: flex;
  align-items: center;
}

.topbar-logo {
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.logo-mark,
.login-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: var(--grad);
  box-shadow: 0 8px 18px rgba(79, 70, 229, .22);
}

.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
}

.version-tag {
  color: var(--text-dim);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
}

.app-version {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: rgba(79, 70, 229, .22);
}

.topbar-right {
  gap: 14px;
}

.topbar-user {
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
}

.sidebar {
  position: fixed;
  z-index: 90;
  left: 0;
  top: var(--top-h);
  bottom: 0;
  width: var(--side-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: 8px 0 24px rgba(50, 50, 93, .035);
  overflow: hidden;
}

.sidebar-inner {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 14px;
  scrollbar-width: thin;
}

.sb-group {
  margin-bottom: 22px;
}

.sb-group-title {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 14px;
  color: var(--text);
  font-weight: 700;
}

.sb-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 800;
}

.sb-group.active .sb-group-title {
  color: var(--accent);
}

.sb-group-admin .sb-group-title {
  color: var(--admin);
}

.sb-group-admin .sb-icon {
  color: var(--admin);
  background: #fff7ed;
}

.sb-item {
  position: relative;
  display: block;
  margin: 2px 0;
  padding: 9px 14px 9px 41px;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .12s, color .12s;
}

.sb-item:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.sb-item.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
}

.sb-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 18px;
  border-radius: 0 3px 3px 0;
  transform: translateY(-50%);
  background: var(--grad);
}

.sb-group-admin .sb-item.active {
  background: #fff7ed;
  color: #c2410c;
}

.sb-group-admin .sb-item.active::before {
  background: linear-gradient(135deg, #f97316, #ea580c);
}

.sb-divider {
  height: 1px;
  margin: 18px 14px;
  background: var(--border);
}

.page-container {
  margin-left: var(--side-w);
  margin-top: var(--top-h);
  padding: 36px 44px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 22px;
}

.page-head h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: 0;
}

.page-head p {
  margin: 7px 0 0;
  color: var(--text-dim);
}

.page-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-height: 36px;
}

.content-stack {
  display: grid;
  gap: 22px;
}

.panel {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad);
  opacity: .82;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.panel-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.panel-desc {
  margin: 4px 0 0;
  color: var(--text-dim);
  font-size: 13px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 16px;
}

.metric-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}

.metric-card:hover {
  transform: translateY(-2px);
  border-color: #d8def0;
  box-shadow: var(--shadow);
}

.metric-label {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
}

.metric-value {
  margin-top: 8px;
  color: var(--text);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
}

.metric-foot {
  margin-top: 8px;
  color: var(--text-2);
  font-size: 12px;
}

.status-list {
  display: grid;
  gap: 10px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 10px 12px;
}

.status-row strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px;
  gap: 12px;
  margin-bottom: 18px;
}

.voice-filter {
  grid-template-columns: minmax(240px, 1fr) 150px 150px 150px;
}

.form-panel {
  max-width: 1040px;
}

.create-text-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.create-process-note {
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  background: #eff6ff;
  color: #24547c;
  padding: 12px 14px;
  line-height: 1.6;
}

.voice-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
  max-width: 820px;
}

.model-config-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}

.binding-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px;
}

.binding-card {
  display: grid;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.binding-card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.binding-card p {
  margin: 5px 0 0;
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.6;
}

.binding-meta {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 8px 12px;
  color: var(--text-2);
  font-size: 12.5px;
}

.binding-meta strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.voice-mode-card {
  display: grid;
  gap: 6px;
  min-height: 88px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text-2);
  cursor: pointer;
  padding: 16px 18px;
  text-align: left;
  box-shadow: var(--shadow-sm);
  transition: background .15s, border-color .15s, box-shadow .15s, transform .15s, color .15s;
}

.voice-mode-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.voice-mode-card.active {
  border-color: rgba(79, 70, 229, .52);
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .08), var(--shadow-sm);
}

.voice-mode-card strong {
  font-size: 16px;
  font-weight: 800;
}

.voice-mode-card span {
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.55;
}

.voice-mode-card.active span {
  color: var(--text-2);
}

.voice-create-panel {
  margin-top: 0;
}

.audio-form-panel {
  max-width: 1080px;
}

.audio-create-card {
  padding: 28px;
}

.audio-create-card textarea {
  min-height: 240px;
}

.audio-settings-grid {
  display: grid;
  grid-template-columns: minmax(220px, .9fr) minmax(300px, 1.3fr) minmax(190px, .7fr);
  gap: 16px;
  align-items: start;
}

.audio-submit-row {
  max-width: 320px;
  margin-top: 4px;
}

.audio-remark-field input,
.audio-settings-grid select,
.audio-settings-grid .stepper input,
.voice-preview-btn {
  min-height: 42px;
}

.form-hint {
  margin-top: 7px;
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.7;
}

.task-submit-status {
  margin-top: 12px;
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  background: #fff7ed;
  color: #9a3412;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.6;
  padding: 11px 13px;
}

.rewrite-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 4px 0 20px;
}

.level-card {
  display: grid;
  gap: 5px;
  min-height: 112px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  padding: 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s, transform .15s, background .15s;
}

.level-card:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow);
}

.level-card.selected {
  border-color: rgba(79, 70, 229, .45);
  background: var(--accent-soft);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .08), var(--shadow-sm);
}

.level-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.lv-title {
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}

.lv-desc {
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.65;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  margin-bottom: 7px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.form-row-three {
  grid-template-columns: minmax(180px, 1fr) 130px 180px;
}

.audio-control-row {
  grid-template-columns: minmax(320px, 1fr) minmax(220px, 320px);
}

.voice-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.voice-preview-btn {
  min-width: 64px;
  min-height: 40px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}

.admin-form-grid-compact {
  grid-template-columns: minmax(260px, 1fr) 140px 160px;
  align-items: end;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, .1), var(--shadow-sm);
}

textarea {
  min-height: 190px;
  resize: vertical;
  line-height: 1.75;
}

.table-input,
table select,
table textarea {
  min-width: 0;
  box-shadow: none;
}

.compact-textarea {
  min-height: 88px;
  font-size: 12.5px;
  line-height: 1.6;
}

.prompt-groups-board {
  margin-top: 22px;
}

.prompt-group {
  margin-bottom: 28px;
}

.prompt-group-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  color: #374151;
  font-size: 15px;
  font-weight: 700;
}

.prompt-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  border-bottom: 1px solid #e5e7eb;
}

.prompt-tab {
  margin-bottom: -1px;
  padding: 8px 16px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.prompt-tab:hover {
  color: #111827;
}

.prompt-tab.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
  font-weight: 800;
}

.editor-area {
  display: block;
}

.prompt-textarea {
  width: 100%;
  min-height: 420px;
  padding: 16px;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  background: #fafbfc;
  box-sizing: border-box;
  font-family: "JetBrains Mono", "SF Mono", Monaco, Consolas, "Microsoft YaHei", monospace;
  font-size: 13.5px;
  line-height: 1.7;
  resize: vertical;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
}

.meta {
  margin-left: auto;
  color: #6b7280;
  font-size: 13px;
}

.prompt-create-field textarea {
  min-height: 220px;
}

.prompt-summary {
  max-width: 460px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.65;
}

.check-line {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
}

.check-line input {
  width: auto;
  box-shadow: none;
}

.check-line-compact {
  min-height: auto;
}

.char-counter {
  margin-top: 7px;
  color: var(--text-dim);
  font-size: 12.5px;
  text-align: right;
}

.char-counter.warning {
  color: var(--warning);
}

.char-counter.error {
  color: var(--danger);
}

.stepper {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
}

.stepper input {
  text-align: center;
}

.stepper-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text);
  cursor: pointer;
  font-weight: 900;
  box-shadow: var(--shadow-sm);
}

.stepper-btn:hover {
  border-color: var(--border-strong);
  background: var(--surface);
}

.stack-mini {
  display: grid;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 16px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s, background .15s;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  background: var(--surface-soft);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.btn-primary {
  color: #fff;
  border-color: transparent;
  background: var(--grad);
  box-shadow: 0 4px 6px -1px rgba(79, 70, 229, .25), 0 2px 4px -1px rgba(124, 58, 237, .1);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #4338ca, #6d28d9);
}

.btn-secondary {
  color: var(--text-2);
}

.btn-danger {
  color: #991b1b;
  border-color: #fecaca;
  background: #fff;
}

.btn-sm {
  min-height: 30px;
  padding: 5px 12px;
  font-size: 12.5px;
  box-shadow: none;
}

.btn-text {
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 0;
  text-decoration: none;
  white-space: nowrap;
}

.btn-text:hover {
  text-decoration: underline;
}

.text-muted {
  color: var(--text-dim);
}

.text-sm {
  font-size: 12px;
}

.btn-block {
  width: 100%;
  min-height: 44px;
}

.table-wrap {
  width: 100%;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  table-layout: fixed;
}

th {
  background: var(--bg);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 800;
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 13px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

tbody tr:nth-child(even) td {
  background: #fafbfc;
}

tbody tr:hover td {
  background: var(--accent-soft);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.col-preview {
  max-width: 380px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.action-inline-status {
  align-self: center;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 7px 10px;
  white-space: nowrap;
}

.action-inline-status.success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #15803d;
}

.action-inline-status.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr) 120px minmax(140px, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 4px 0 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.result-panel {
  overflow: visible;
}

.review-workbench-panel {
  display: grid;
  gap: 10px;
  padding-top: 22px;
}

.result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.compact-result-head {
  align-items: center;
  margin-bottom: 0;
}

.result-action-status {
  margin: 12px 0 0;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 12px;
}

.result-action-status.success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.result-action-status.error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.result-title-cluster {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.result-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-width: 0;
}

.result-title-row .panel-title {
  margin: 0;
  font-size: 19px;
  line-height: 1.25;
}

.result-status-chips {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 800;
}

.result-quick-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
}

.task-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.task-meta-grid > div {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 12px;
}

.task-meta-grid span {
  display: block;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
}

.task-meta-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 700;
}

.view-tabs {
  display: inline-flex;
  gap: 4px;
  margin: 18px 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 4px;
}

.tab-btn {
  min-height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  padding: 6px 14px;
  box-shadow: none;
}

.tab-btn.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.dialog-lines {
  display: grid;
  gap: 10px;
}

.dialog-line {
  max-width: 880px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 13px 14px;
  box-shadow: var(--shadow-sm);
}

.dialog-line.speaker-a {
  margin-right: auto;
  border-left: 3px solid #0ea5e9;
}

.dialog-line.speaker-b {
  margin-left: auto;
  border-left: 3px solid #10b981;
}

.dialog-meta {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 800;
}

.dialog-text {
  margin-top: 5px;
  color: var(--text);
  line-height: 1.8;
  white-space: pre-wrap;
}

.line-edit-grid {
  display: grid;
  grid-template-columns: minmax(120px, 160px) minmax(150px, 190px);
  gap: 8px;
  margin-top: 10px;
}

.dialog-line textarea,
.task-table textarea {
  width: 100%;
  min-height: 64px;
  resize: vertical;
}

.line-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.line-invalid {
  border-color: #ef4444 !important;
  background: #fff7f7 !important;
}

.review-density-tabs {
  border-color: #c7d2fe;
  background: #eef2ff;
}

.review-density-tabs .tab-btn {
  min-width: 76px;
}

.result-compact-notices {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 6px;
}

.result-compact-notices > div {
  min-width: 0;
}

.result-compact-notices .notice {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  margin: 0;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
}

.result-compact-notices .notice ul {
  margin-top: 4px;
}

.result-ark-note {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: var(--text-dim);
}

.quality-issue-notice {
  border-color: #fbbf24 !important;
  background: #fffbeb !important;
  color: #92400e !important;
  gap: 8px;
}

.quality-jump-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.quality-jump-btn {
  min-height: 24px;
  border: 1px solid #f59e0b;
  border-radius: 999px;
  background: #ffffff;
  color: #b45309;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.quality-jump-btn:hover {
  background: #fef3c7;
}

.correction-review-workspace {
  display: grid;
  gap: 10px;
}

.audience-profile-box {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 14px;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8fbff;
  padding: 14px;
}

.audience-profile-compact {
  grid-template-columns: minmax(96px, 132px) 1fr;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
}

.audience-profile-compact span {
  display: none;
}

.audience-profile-compact textarea {
  min-height: 34px;
  height: 36px;
  line-height: 1.45;
  padding-top: 7px;
  padding-bottom: 7px;
}

.audience-profile-compact p {
  min-height: 0;
}

.audience-profile-box strong,
.review-panel-head h3 {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
}

.audience-profile-box span,
.review-panel-head span {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
}

.audience-profile-box textarea {
  min-height: 56px;
  resize: vertical;
}

.audience-profile-box p {
  margin: 0;
  color: var(--text);
  line-height: 1.7;
}

.review-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 800;
}

.review-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.legend-dot.audience {
  background: #0ea5e9;
}

.legend-dot.mentor {
  background: #7c3aed;
}

.correction-review-layout {
  display: grid;
  grid-template-columns: minmax(280px, .78fr) minmax(440px, 1.32fr);
  gap: 12px;
  align-items: start;
}

.drawer-review-layout {
  grid-template-columns: minmax(280px, .74fr) minmax(420px, 1fr) minmax(280px, 340px);
}

.raw-review-panel,
.production-review-panel,
.structured-review-panel,
.current-line-drawer {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.raw-review-panel {
  position: sticky;
  top: 82px;
  max-height: calc(100vh - 120px);
  overflow: hidden;
}

.four-panel-review-layout {
  grid-template-columns:
    minmax(250px, .82fr)
    minmax(300px, .96fr)
    minmax(420px, 1.32fr)
    minmax(270px, 320px);
}

.review-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  padding: 13px 14px;
}

.structured-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 12px;
}

.structured-head-actions .view-tabs {
  margin: 0;
}

.raw-blob {
  max-height: calc(100vh - 178px);
  overflow: auto;
  padding: 14px;
  color: var(--text);
  font-size: 14px;
  line-height: 2;
  white-space: pre-wrap;
}

.production-review-panel {
  position: sticky;
  top: 82px;
  max-height: calc(100vh - 120px);
  overflow: hidden;
}

.production-blob {
  max-height: calc(100vh - 280px);
  overflow: auto;
  padding: 14px;
  color: var(--text);
  font-size: 14px;
  line-height: 2;
  white-space: pre-wrap;
}

.diff-add {
  background: #dcfce7;
  color: #047857;
  border-radius: 4px;
  padding: 1px 2px;
  font-weight: 800;
}

.diff-del {
  background: #fee2e2;
  color: #b91c1c;
  border-radius: 4px;
  padding: 1px 2px;
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.raw-piece {
  border-radius: 6px;
  padding: 2px 1px;
  transition: background .16s ease, box-shadow .16s ease;
}

.raw-piece.active {
  background: #fff7c2;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, .24);
}

.structured-review-panel {
  min-width: 0;
  overflow: hidden;
}

.current-line-drawer {
  position: sticky;
  top: 82px;
  overflow: hidden;
}

.current-editor-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.current-line-issues {
  display: grid;
  gap: 7px;
  border: 1px solid #fbbf24;
  border-radius: 8px;
  background: #fffbeb;
  padding: 10px 12px;
  color: #92400e;
  font-size: 12px;
  line-height: 1.6;
}

.current-line-issues strong {
  color: #b45309;
}

.current-line-issues p {
  margin: 0;
}

.current-line-issues span {
  display: inline-flex;
  margin-right: 6px;
  border-radius: 999px;
  background: #fed7aa;
  color: #9a3412;
  padding: 1px 7px;
  font-weight: 900;
}

.current-editor-body label {
  display: grid;
  gap: 6px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 900;
}

.current-editor-body select,
.current-editor-body textarea {
  width: 100%;
}

.fixed-field {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text-2);
  font-weight: 800;
}

.current-editor-body textarea {
  min-height: 112px;
  resize: vertical;
}

.current-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.current-editor-actions.muted-actions {
  padding-top: 4px;
  border-top: 1px dashed var(--border);
}

.current-editor-actions .line-actions {
  margin-top: 0;
}

.adaptive-chat-lines {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.review-line {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.review-line.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, .14);
}

.review-line.line-quality-warning {
  border-color: #fbbf24;
}

.quality-corner {
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-top: 22px solid #f59e0b;
  border-left: 22px solid transparent;
  color: transparent;
}

.quality-corner::after {
  content: "!";
  position: absolute;
  top: -22px;
  right: 3px;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.adaptive-line {
  width: fit-content;
  min-width: min(360px, 100%);
  max-width: min(760px, 92%);
  padding: 12px;
}

.adaptive-line.speaker-a {
  justify-self: start;
  border-left: 4px solid #0ea5e9;
  background: #f7fcff;
}

.adaptive-line.speaker-b {
  justify-self: end;
  border-left: 4px solid #7c3aed;
  background: #fbf8ff;
}

.review-line-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.review-line-meta {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 8px;
}

.line-no,
.role-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 9px;
  background: #eef2ff;
  color: var(--accent);
}

.review-line-text {
  color: var(--text);
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.quality-legend {
  color: #b45309;
}

.line-quality-detail {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.line-quality-item {
  display: grid;
  gap: 3px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  background: #fffbeb;
  padding: 8px 10px;
  color: #92400e;
  font-size: 12px;
  line-height: 1.55;
}

.line-quality-item strong {
  color: #b45309;
}

.correction-review-workspace.view-mode .audience-profile-box {
  grid-template-columns: minmax(160px, 230px) 1fr;
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
}

.correction-review-workspace.view-mode .adaptive-chat-lines {
  background: #fbfdff;
}

.correction-review-workspace.view-mode .adaptive-line {
  padding: 13px 14px;
}

.correction-review-workspace.view-mode .review-line-meta {
  gap: 6px;
  margin-bottom: 7px;
}

.correction-review-workspace.view-mode .review-line-text {
  font-size: 15px;
  line-height: 1.85;
}

.correction-review-workspace.edit-mode .review-line {
  cursor: default;
}

.review-control-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.review-control-row select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
}

.review-control-row .fixed-field {
  width: 100%;
}

.review-line textarea {
  width: 100%;
  min-height: 64px;
  resize: vertical;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 800;
}

.badge-draft,
.badge-not_published {
  color: #475569;
  background: #f1f5f9;
}

.badge-processing,
.badge-pending,
.badge-queued {
  color: #92400e;
  background: #fef3c7;
}

.badge-reviewing,
.badge-published,
.badge-available,
.badge-completed,
.badge-ok,
.badge-active,
.badge-https {
  color: #065f46;
  background: #d1fae5;
}

.badge-failed,
.badge-deleted,
.badge-voided,
.badge-error,
.badge-inactive {
  color: #991b1b;
  background: #fee2e2;
}

.badge-synced,
.badge-enabled,
.badge-admin {
  color: #3730a3;
  background: #e0e7ff;
}

.badge-warning,
.badge-unknown,
.badge-http {
  color: #92400e;
  background: #fef3c7;
}

.notice {
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  background: #fffbeb;
  color: #92400e;
  padding: 12px 14px;
  font-size: 13px;
}

.notice-ok {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.notice-danger {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.audio-create-grid {
  grid-template-columns: minmax(420px, 1.08fr) minmax(360px, .92fr);
}

.audio-result {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 14px;
}

.audio-result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-2);
}

.audio-result audio,
.audio-inline-slot audio {
  width: 100%;
  max-width: 520px;
}

.audio-inline-slot {
  margin-top: 8px;
}

.audio-filter {
  grid-template-columns: minmax(320px, 1fr) 180px;
}

.audio-success-card {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  border: 1px solid #c7d2fe;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #eef2ff, #f8fafc);
  padding: 16px;
}

.success-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--success);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
}

.success-body {
  display: grid;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.success-body span {
  color: var(--text-2);
  font-size: 13px;
}

.audio-table-wrap table {
  min-width: 1040px;
}

.audio-table-wrap .task-table th:first-child,
.audio-table-wrap .task-table td:first-child {
  width: 44px;
  padding-left: 12px;
  padding-right: 8px;
}

.audio-table-wrap .task-table th:nth-child(2),
.audio-table-wrap .task-table td:nth-child(2) {
  width: 170px;
}

.audio-table-wrap .task-table th:nth-child(3),
.audio-table-wrap .task-table td:nth-child(3) {
  width: 230px;
}

.audio-table-wrap .task-table th:nth-child(4),
.audio-table-wrap .task-table td:nth-child(4) {
  width: 210px;
}

.audio-table-wrap .task-table th:nth-child(5),
.audio-table-wrap .task-table td:nth-child(5) {
  width: 78px;
}

.audio-table-wrap .task-table th:nth-child(6),
.audio-table-wrap .task-table td:nth-child(6) {
  width: 98px;
}

.audio-table-wrap .task-table th:nth-child(7),
.audio-table-wrap .task-table td:nth-child(7),
.audio-table-wrap .task-table th:nth-child(8),
.audio-table-wrap .task-table td:nth-child(8) {
  width: 150px;
}

.audio-table-wrap .task-table th:nth-child(9),
.audio-table-wrap .task-table td:nth-child(9) {
  width: 260px;
}

.audio-table-wrap .row-actions {
  gap: 6px;
}

.audio-table-wrap .row-actions .btn-sm {
  padding-left: 9px;
  padding-right: 9px;
}

.audio-table-wrap .audio-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  white-space: nowrap;
}

.audio-table-wrap .audio-actions .btn-text {
  line-height: 1.4;
}

.audio-table-wrap .audio-actions .btn-text.playing {
  color: var(--warning);
}

.audio-cd-card {
  max-width: 1600px;
  border-radius: 8px;
  padding: 32px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .1);
}

.audio-cd-title {
  margin: 0 0 24px;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}

.audio-cd-card textarea {
  min-height: 170px;
}

.audio-cd-row {
  display: flex;
  gap: 28px;
  align-items: flex-start;
}

.audio-cd-row .form-group {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
}

.audio-voice-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 7px 10px 7px 12px;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  background: #dbeafe;
  box-shadow: var(--shadow-sm);
}

.audio-voice-current {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.audio-voice-current strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-voice-current span {
  overflow: hidden;
  color: #477399;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-voice-picker .audio-play-sample {
  display: none;
}

.audio-play-sample {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}

.audio-play-sample:hover:not(:disabled) {
  background: #4338ca;
}

.audio-play-sample.playing {
  background: var(--warning);
}

.audio-cd-stepper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.audio-speed-control {
  display: grid;
  gap: 8px;
}

.stepper-value {
  min-width: 56px;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  text-align: center;
}

.audio-speed-range {
  width: 100%;
  height: 22px;
  padding: 0;
  box-shadow: none;
  accent-color: var(--accent);
}

.audio-speed-scale {
  display: flex;
  justify-content: space-between;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1;
}

.audio-voice-modal {
  position: fixed;
  z-index: 220;
  inset: 0;
}

.audio-voice-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .34);
}

.audio-voice-modal-panel {
  position: relative;
  width: min(920px, calc(100vw - 48px));
  max-height: calc(100vh - 72px);
  margin: 36px auto;
  overflow: auto;
  padding: 24px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .2);
}

.audio-voice-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.audio-voice-modal-head h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.audio-voice-modal-head p {
  margin: 0;
  color: var(--text-dim);
}

.audio-voice-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 130px 130px 130px;
  gap: 10px;
  margin-bottom: 14px;
}

.audio-voice-toolbar input,
.audio-voice-toolbar select {
  min-height: 38px;
}

.audio-voice-list {
  display: grid;
  gap: 10px;
}

.audio-voice-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, .8fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}

.audio-voice-row.selected {
  border-color: rgba(79, 70, 229, .5);
  background: var(--accent-soft);
}

.audio-voice-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.audio-voice-main strong,
.audio-voice-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-voice-main span {
  color: var(--text-dim);
  font-size: 12px;
}

.audio-voice-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.audio-voice-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 700;
}

.audio-voice-tags span.ok {
  background: #dcfce7;
  color: #047857;
}

.audio-voice-tags span.muted {
  background: #f1f5f9;
  color: var(--text-dim);
}

.audio-voice-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  white-space: nowrap;
}

.audio-voice-empty {
  padding: 26px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  color: var(--text-dim);
  text-align: center;
}

.edit-dialog-backdrop {
  position: fixed;
  z-index: 230;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, .34);
}

.edit-dialog {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 18px 50px rgba(15, 23, 42, .22);
}

.edit-dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.edit-dialog-head h2 {
  margin: 0 0 4px;
  font-size: 20px;
}

.edit-dialog-head p {
  margin: 0;
  color: var(--text-dim);
}

.edit-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.confirm-dialog {
  width: min(460px, 100%);
}

.confirm-dialog-body {
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  padding: 12px 14px;
}

.confirm-dialog-body strong {
  display: block;
  margin-bottom: 4px;
  color: #7c2d12;
}

.confirm-dialog-body p {
  margin: 0;
  color: #9a3412;
}

.danger-zone {
  margin-top: 22px;
  padding: 14px;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  background: #fff7f7;
}

.danger-zone strong {
  color: #991b1b;
}

.danger-zone p {
  margin: 4px 0 12px;
  color: #7f1d1d;
  font-size: 12.5px;
}

.audio-cd-submit {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.audio-generate-btn {
  width: 200px;
  min-height: 44px;
  font-size: 15px;
  font-weight: 700;
}

.audio-list-card {
  overflow: visible;
}

.audio-cd-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

.audio-cd-filters input,
.audio-cd-filters select {
  width: auto;
  min-width: 150px;
  height: 38px;
}

.audio-cd-filters .search-input {
  min-width: 200px;
}

.audio-batch-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.audio-batch-actions label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-2);
  cursor: pointer;
  font-size: 13px;
}

.audio-batch-actions input,
.audio-cd-table input[type="checkbox"] {
  width: auto;
  box-shadow: none;
}

.audio-table-wrap {
  overflow: auto;
  border: 0;
  box-shadow: none;
}

.audio-cd-table {
  min-width: 1500px;
  table-layout: auto;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 13px;
}

.audio-cd-table th {
  padding: 10px 8px;
  background: #f9fafb;
  color: #6b7280;
  font-weight: 700;
  white-space: nowrap;
}

.audio-cd-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: middle;
}

.audio-cd-table tbody tr:nth-child(even) td {
  background: transparent;
}

.audio-cd-table .audio-task-row {
  cursor: pointer;
}

.audio-cd-table .audio-task-row:hover td {
  background: #f9fafb;
}

.audio-cd-table .text-preview {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-cd-table th:first-child,
.audio-cd-table td:first-child {
  width: 44px;
}

.audio-cd-table th:nth-child(2),
.audio-cd-table td:nth-child(2) {
  width: 130px;
}

.audio-cd-table th:nth-child(3),
.audio-cd-table td:nth-child(3) {
  width: 160px;
}

.audio-cd-table th:nth-child(4),
.audio-cd-table td:nth-child(4) {
  width: 110px;
}

.audio-cd-table th:nth-child(5),
.audio-cd-table td:nth-child(5) {
  width: 150px;
}

.audio-cd-table th:nth-child(6),
.audio-cd-table td:nth-child(6),
.audio-cd-table th:nth-child(7),
.audio-cd-table td:nth-child(7) {
  width: 80px;
}

.audio-cd-table th:nth-child(8),
.audio-cd-table td:nth-child(8) {
  width: 150px;
}

.audio-cd-table th:nth-child(9),
.audio-cd-table td:nth-child(9),
.audio-cd-table th:nth-child(10),
.audio-cd-table td:nth-child(10) {
  width: 78px;
}

.audio-cd-table th:nth-child(11),
.audio-cd-table td:nth-child(11) {
  width: 100px;
}

.audio-cd-table th:nth-child(12),
.audio-cd-table td:nth-child(12) {
  width: 270px;
}

.audio-cd-table .task-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  min-width: 270px;
  white-space: nowrap;
}

.audio-cd-table .btn-text {
  padding: 4px 6px;
}

.countdown {
  color: var(--text-dim);
  font-size: 12px;
  white-space: nowrap;
}

.notice ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.empty-state {
  padding: 28px;
  color: var(--text-dim);
  text-align: center;
}

.detail-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 16px;
  white-space: pre-wrap;
  line-height: 1.8;
}

.script-lines {
  display: grid;
  gap: 8px;
}

.script-line {
  display: grid;
  grid-template-columns: 52px 88px 96px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px 12px;
}

.line-no,
.line-speaker,
.line-scene {
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  max-width: min(420px, calc(100vw - 48px));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 18px 45px rgba(50, 50, 93, .18);
  color: var(--text);
  padding: 12px 14px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .18s, transform .18s;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(246, 249, 252, .94)),
    repeating-linear-gradient(90deg, rgba(230, 235, 241, .42) 0, rgba(230, 235, 241, .42) 1px, transparent 1px, transparent 96px);
}

.login-box {
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 25px 50px -12px rgba(50, 50, 93, .2), 0 10px 20px -8px rgba(0, 0, 0, .08);
  padding: 30px;
}

.login-brand {
  gap: 14px;
  margin-bottom: 24px;
}

.login-mark {
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  font-size: 22px;
  font-weight: 900;
}

.login-brand h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.login-brand p {
  margin: 2px 0 0;
  color: var(--text-dim);
}

.captcha-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) 82px;
  gap: 8px;
  align-items: center;
}

.captcha-question {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 800;
  box-shadow: var(--shadow-sm);
}

.login-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 18px;
  color: var(--text-2);
  font-size: 13px;
}

.login-options label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
}

.login-options input {
  width: auto;
  box-shadow: none;
}

.error-msg {
  min-height: 24px;
  color: #b91c1c;
  font-size: 13px;
}

.hidden {
  display: none !important;
}

@media (max-width: 1280px) {
  .four-panel-review-layout {
    grid-template-columns: 1fr;
  }

  .production-review-panel,
  .raw-review-panel,
  .current-line-drawer {
    position: static;
    max-height: none;
  }

  .production-blob,
  .raw-blob {
    max-height: 320px;
  }
}

@media (max-width: 980px) {
  :root {
    --side-w: 210px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-grid {
    grid-template-columns: 1fr;
  }

  .prompt-flow-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .prompt-flow-items {
    gap: 14px 18px;
  }

  .prompt-editor-textarea {
    min-height: 380px;
  }

  .correction-review-layout,
  .audience-profile-box {
    grid-template-columns: 1fr;
  }

  .raw-review-panel,
  .production-review-panel,
  .current-line-drawer {
    position: static;
    max-height: none;
  }

  .raw-blob,
  .production-blob {
    max-height: 260px;
  }

}

@media (min-width: 521px) and (max-width: 900px) {
  :root {
    --side-w: 168px;
  }

  .topbar {
    padding: 0 18px;
  }

  .topbar-logo {
    gap: 8px;
    min-width: 0;
  }

  .topbar-logo span:nth-child(2) {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-user {
    display: none;
  }

  .sidebar {
    width: var(--side-w);
  }

  .sidebar-inner {
    padding: 16px 8px;
  }

  .sb-group {
    margin-bottom: 16px;
  }

  .sb-group-title {
    gap: 6px;
    padding: 6px 8px;
    font-size: 12.5px;
  }

  .sb-icon {
    width: 17px;
    height: 17px;
    font-size: 11px;
  }

  .sb-item {
    padding: 8px 8px 8px 31px;
    font-size: 12.5px;
  }

  .page-container {
    padding: 24px 18px;
  }

  .page-head,
  .panel-head {
    display: block;
  }

  .page-title {
    font-size: 24px;
  }

  .panel,
  .audio-cd-card {
    padding: 22px 16px;
  }

  .audio-cd-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .audio-voice-picker {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .audio-voice-modal-panel {
    width: min(720px, calc(100vw - 28px));
    margin: 18px auto;
    padding: 18px;
  }

  .audio-voice-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .audio-voice-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .audio-voice-actions {
    justify-content: flex-start;
  }

  .audio-cd-submit {
    justify-content: stretch;
  }

  .audio-generate-btn {
    width: 100%;
  }

  .audio-cd-filters input,
  .audio-cd-filters select,
  .audio-cd-filters .search-input {
    flex: 1 1 180px;
    min-width: min(180px, 100%);
  }

  .audio-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }
}

@media (max-width: 520px) {
  .topbar {
    padding: 0 16px;
  }

  .topbar-logo span:nth-child(2) {
    display: none;
  }

  .topbar-user {
    display: none;
  }

  .sidebar {
    position: fixed;
    left: 0;
    right: 0;
    top: var(--top-h);
    bottom: auto;
    display: block;
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 6px 18px rgba(50, 50, 93, .05);
  }

  .sidebar-inner {
    display: flex;
    gap: 8px;
    height: auto;
    max-height: calc(100vh - var(--top-h));
    overflow-y: auto;
    overflow-x: auto;
    padding: 9px 12px;
  }

  .sb-group {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 4px;
    margin: 0;
  }

  .sb-group-title,
  .sb-divider {
    display: none;
  }

  .sb-item {
    display: inline-flex;
    align-items: center;
    margin: 0;
    min-height: 34px;
    padding: 7px 12px;
    white-space: nowrap;
  }

  .sb-item.active::before {
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 3px;
    width: auto;
    height: 2px;
    border-radius: 999px;
    transform: none;
  }

  .page-container {
    margin-left: 0;
    margin-top: calc(var(--top-h) + 54px);
    padding: 22px 16px;
  }

  .page-head,
  .panel-head {
    display: block;
  }

  .page-actions,
  .panel-head .row-actions {
    justify-content: flex-start;
    margin-top: 12px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .form-row,
  .form-row-three,
  .audio-settings-grid,
  .audio-cd-row,
  .captcha-row,
  .filter-bar,
  .voice-filter,
  .voice-mode-switch,
  .model-config-tabs,
  .binding-card-grid,
  .audio-filter,
  .rewrite-options,
  .task-meta-grid,
  .inline-form,
  .script-line {
    grid-template-columns: 1fr;
  }

  .result-head {
    display: block;
  }

  .result-head .row-actions {
    margin-top: 12px;
  }

  .task-table-wrap {
    overflow: visible;
    border: 0;
    box-shadow: none;
  }

  .task-table {
    display: block;
    min-width: 0;
    background: transparent;
  }

  .task-table thead {
    display: none;
  }

  .task-table tbody,
  .task-table tr,
  .task-table td {
    display: block;
    width: 100%;
  }

  .task-table tr {
    overflow: hidden;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
  }

  .task-table td {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 11px 12px;
    border-bottom: 1px solid #f1f5f9;
  }

  .task-table td::before {
    content: attr(data-label);
    color: var(--text-dim);
    font-size: 12px;
    font-weight: 800;
  }

  .task-table .col-preview {
    max-width: none;
    white-space: normal;
  }

  .task-table .row-actions {
    justify-content: flex-start;
  }

  .audio-table-wrap .audio-actions {
    flex-wrap: wrap;
    white-space: normal;
  }

  .audio-cd-card {
    padding: 22px 16px;
  }

  .audio-cd-row {
    display: grid;
    gap: 16px;
  }

  .audio-voice-toolbar,
  .audio-voice-row {
    grid-template-columns: 1fr;
  }

  .audio-voice-picker {
    grid-template-columns: 1fr;
  }

  .audio-voice-picker #audioOpenVoicePicker {
    width: 100%;
  }

  .audio-voice-modal-panel {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 28px);
    margin: 14px auto;
    padding: 16px;
  }

  .audio-voice-modal-head {
    display: block;
  }

  .audio-voice-modal-head .btn {
    margin-top: 12px;
  }

  .audio-voice-actions {
    justify-content: flex-start;
  }

  .audio-cd-submit {
    justify-content: stretch;
  }

  .audio-generate-btn {
    width: 100%;
  }

  .adaptive-line {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .review-control-row {
    grid-template-columns: 1fr;
  }
}
