/* =========================================================================
   食声工坊 PRO · Warm Paper & Persimmon Atelier 设计系统（方案 A）
   奶油暖白创作台 · 食欲暖柿橙 · 清晰留白与首屏直达台词
   ========================================================================= */

:root {
  color-scheme: light;
  --bg: #f6f4ef;
  --bg-glow: radial-gradient(ellipse 85% 42% at 50% -10%, rgba(226, 84, 39, 0.055), transparent 68%);
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --surface-hover: #f2efe8;
  --surface-recessed: #f7f5f0;
  --surface-muted: #efece5;

  --hairline: rgba(28, 25, 23, 0.085);
  --hairline-strong: rgba(28, 25, 23, 0.15);

  --ink: #1c1917;
  --ink-soft: #57534e;
  --ink-muted: #78716c;

  --accent: #e25427;
  --accent-hover: #cc451b;
  --accent-bright: #c64119;
  --accent-dim: rgba(226, 84, 39, 0.09);
  --accent-border: rgba(226, 84, 39, 0.30);

  --emerald: #178259;
  --emerald-bright: #0f6a47;
  --emerald-dim: #e8f5ef;
  --emerald-border: #b6e0cc;

  --amber: #d97706;
  --amber-bright: #b45309;
  --amber-dim: #fef5e6;
  --amber-border: #f6d59d;

  --danger: #dc2626;
  --danger-bright: #b91c1c;
  --danger-dim: #fef0f0;
  --danger-border: #f8c6c6;

  --shadow-sm: 0 1px 2px rgba(28, 25, 23, 0.04);
  --shadow-md: 0 2px 10px rgba(28, 25, 23, 0.045), 0 0 0 1px rgba(28, 25, 23, 0.055);
  --shadow-lg: 0 12px 32px rgba(28, 25, 23, 0.09), 0 0 0 1px rgba(28, 25, 23, 0.07);

  --r-xs: 6px;
  --r-sm: 9px;
  --r-md: 12px;
  --r-lg: 16px;

  --font-sans: 'PingFang SC', 'Hiragino Sans GB', 'Inter', -apple-system, BlinkMacSystemFont, 'Microsoft YaHei UI', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  background-image: var(--bg-glow);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

button,
input,
select,
textarea {
  font-family: inherit;
  color: inherit;
}

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

::selection {
  background: rgba(226, 84, 39, 0.18);
  color: var(--ink);
}

/* 自定义柔和滚动条 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(28, 25, 23, 0.16);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(28, 25, 23, 0.28);
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.tiny {
  font-size: 12px;
  color: var(--ink-muted);
}

.spacer {
  flex: 1 1 auto;
}

/* ================= 顶部全局导航栏 ================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 54px;
  padding: 0 24px;
  background: rgba(255, 253, 249, 0.9);
  backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid var(--hairline);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  min-width: 0;
}

.brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  box-shadow: 0 3px 10px rgba(226, 84, 39, 0.22);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.brand-title small {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--accent-bright);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
  padding: 1px 5px;
  border-radius: 5px;
}

.brand-sub {
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 2px;
  white-space: nowrap;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  background: var(--surface-muted);
  border: 1px solid var(--hairline);
  border-radius: 11px;
  flex-shrink: 0;
}

.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.nav-tab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.55);
}

.nav-tab.is-active {
  color: var(--ink);
  font-weight: 600;
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(28, 25, 23, 0.08), 0 0 0 1px rgba(28, 25, 23, 0.04);
}

.nav-tab.is-active svg {
  color: var(--accent);
}

.nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: var(--accent-dim);
  color: var(--accent-bright);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.env-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.env-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  flex-shrink: 0;
}

.env-pill .dot.is-ok {
  background: var(--emerald);
  box-shadow: 0 0 0 3px rgba(23, 130, 89, 0.16);
}

/* ================= 统一按钮系统 ================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

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

.btn-primary {
  background: var(--accent);
  color: #fffdf9;
  box-shadow: 0 2px 8px rgba(226, 84, 39, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(226, 84, 39, 0.30);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--hairline-strong);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-recessed);
  border-color: rgba(28, 25, 23, 0.24);
}

.btn-success {
  background: #177853;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(23, 120, 83, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.btn-success:hover:not(:disabled) {
  background: #126243;
  box-shadow: 0 4px 12px rgba(23, 120, 83, 0.28);
}

.btn-magic-amber {
  background: var(--accent-dim);
  color: var(--accent-bright);
  border-color: var(--accent-border);
}

.btn-magic-amber:hover:not(:disabled) {
  background: rgba(226, 84, 39, 0.15);
  border-color: rgba(226, 84, 39, 0.45);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  color: var(--ink);
  background: rgba(28, 25, 23, 0.055);
}

.btn-sm {
  padding: 6px 11px;
  font-size: 12px;
  border-radius: var(--r-xs);
}

.btn-xs {
  padding: 4px 9px;
  font-size: 12px;
  border-radius: var(--r-xs);
}

.btn-lg {
  padding: 10px 18px;
  font-size: 13.5px;
  border-radius: var(--r-sm);
}

.btn-block {
  width: 100%;
}

.iconbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: var(--r-xs);
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.iconbtn:hover {
  background: var(--surface-recessed);
  border-color: var(--hairline-strong);
  color: var(--ink);
}

.linkbtn {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent-bright);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.link-mini {
  font-size: 12px;
  color: var(--accent-bright);
  font-weight: 500;
  transition: opacity 0.14s ease;
}

.link-mini:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ================= 自定义滑动条（告别浏览器默认样式） ================= */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  border-radius: 99px;
  background: #e3dfd6;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(28, 25, 23, 0.25);
  transition: transform 0.12s ease, background 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.12);
}

input[type="range"].is-auto::-webkit-slider-thumb {
  background: #44403c;
}

/* ================= 上传与分析全局横幅 ================= */
.upload-banner {
  max-width: 1480px;
  margin: 12px auto 0;
  padding: 0 24px;
}

.upload-banner-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--accent-border);
  box-shadow: var(--shadow-md);
}

.spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--accent-dim);
  border-top-color: var(--accent);
  animation: spin 0.75s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.upload-banner-text {
  flex: 1;
  min-width: 0;
}

.upload-banner-text strong {
  display: block;
  font-size: 13.5px;
  color: var(--ink);
}

.upload-banner-text p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--ink-soft);
}

.upload-progress-wrap {
  width: 180px;
  flex-shrink: 0;
}

.upload-progress {
  height: 6px;
  border-radius: 99px;
  background: var(--surface-muted);
  overflow: hidden;
}

.up-bar {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: var(--accent);
  transition: width 0.25s ease;
}

/* ================= 主容器与视图 ================= */
.main-container {
  max-width: 1480px;
  margin: 0 auto;
  padding: 12px 24px 36px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
  animation: viewFade 0.2s ease-out;
}

@keyframes viewFade {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.meta-chip {
  padding: 2px 7px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-soft);
  background: var(--surface-recessed);
  border: 1px solid var(--hairline);
  white-space: nowrap;
}

/* ================= 主工作区双栏网格 ================= */
.editor-grid {
  display: grid;
  grid-template-columns: minmax(330px, 400px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.editor-left {
  position: sticky;
  top: 66px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.editor-right {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

/* 左侧极简单行片名栏 */
.project-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--hairline);
}

.project-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-bar-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

/* ================= 左侧监听监视器（奶油工作室白卡片 + 画框感舞台） ================= */
.monitor-card,
.timeline-card,
.panel {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.panel-lines {
  overflow: visible;
}

.panel-lines .panel-head {
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

.panel-lines .scripts {
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}

.monitor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--hairline);
  background: #fcfbf8;
}

.monitor-mode-group {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 8px;
  background: var(--surface-muted);
}

.mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.mode-pill:hover {
  color: var(--ink);
}

.mode-pill.is-active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(28, 25, 23, 0.1);
}

.mode-pill.is-active svg {
  color: var(--accent);
}

.monitor-shot-indicator {
  font-size: 11.5px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 132px;
}

.stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #eeebe2 0%, #e4dfd4 100%);
  height: clamp(250px, 43vh, 430px);
  padding: 10px;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
}

.stage video {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 10px;
  background: #1c1917;
  box-shadow: 0 12px 30px rgba(28, 25, 23, 0.18), 0 0 0 1px rgba(28, 25, 23, 0.08);
}

.live-subtitle-wrap {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 24px;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.live-subtitle {
  max-width: 92%;
  padding: 6px 13px;
  border-radius: 9px;
  background: rgba(24, 21, 18, 0.80);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fffdf9;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 6px 18px rgba(20, 17, 15, 0.28);
}

.playbtn {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(28, 25, 23, 0.62);
  backdrop-filter: blur(10px);
  color: #fffdf9;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(28, 25, 23, 0.28);
  transition: opacity 0.18s ease, transform 0.15s ease, background 0.15s ease;
}

.playbtn:hover {
  background: var(--accent);
  color: #fffdf9;
  border-color: rgba(255, 255, 255, 0.6);
  transform: scale(1.06);
}

.playbtn.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.stage:hover .playbtn.is-hidden {
  opacity: 0.92;
  pointer-events: auto;
}

.transport {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-top: 1px solid var(--hairline);
  background: #fcfbf8;
}

.btn-transport-play {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--r-xs);
  border: 1px solid var(--accent-border);
  background: var(--accent-dim);
  color: var(--accent-bright);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.btn-transport-play:hover {
  background: rgba(226, 84, 39, 0.16);
}

.btn-transport-play.is-playing {
  background: var(--accent);
  color: #fffdf9;
  border-color: var(--accent);
}

.timecode {
  font-family: var(--font-mono);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  white-space: nowrap;
  flex-shrink: 0;
}

.vol-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--ink-soft);
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}

.vol-control input[type="range"] {
  width: 54px;
}

.vol-control b {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 11px;
  color: var(--ink);
  min-width: 28px;
  text-align: right;
}

/* ================= 镜头时间轴卡片 ================= */
.timeline-card {
  padding: 11px 13px;
}

.timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.tl-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.tl-title strong {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.timeline {
  position: relative;
  height: 82px;
  border-radius: var(--r-sm);
  background: var(--surface-recessed);
  border: 1px solid var(--hairline);
  overflow: hidden;
  user-select: none;
  cursor: pointer;
}

.tl-track-shots {
  position: relative;
  height: 42px;
  border-bottom: 1px solid var(--hairline);
}

.shot-cell {
  position: absolute;
  top: 0;
  bottom: 0;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.75);
  cursor: pointer;
  background: #e9e4d8;
}

.shot-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.92;
  transition: opacity 0.14s ease, transform 0.18s ease;
}

.shot-cell:hover img {
  opacity: 1;
}

.shot-cell span {
  position: absolute;
  left: 2px;
  bottom: 2px;
  padding: 0 4px;
  border-radius: 3px;
  background: rgba(24, 21, 18, 0.74);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.4;
  max-width: calc(100% - 4px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tl-track-lines {
  position: relative;
  height: 24px;
  background: #f4f1ea;
}

.line-block {
  position: absolute;
  top: 3px;
  bottom: 3px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 2px;
  font-size: 9.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.1s ease, border-color 0.14s ease;
}

.line-block.is-active {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px rgba(28, 25, 23, 0.18);
  z-index: 2;
}

.lb-ok {
  background: #e6e2d8;
  color: #292524;
  border-color: rgba(28, 25, 23, 0.1);
}

.lb-synth {
  background: var(--emerald-dim);
  color: var(--emerald-bright);
  border-color: var(--emerald-border);
}

.lb-warn {
  background: var(--amber-dim);
  color: var(--amber-bright);
  border-color: var(--amber-border);
}

.lb-bad {
  background: var(--danger-dim);
  color: var(--danger-bright);
  border-color: var(--danger-border);
}

.wave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 15px;
  width: 100%;
  object-fit: cover;
  opacity: 0.22;
  filter: invert(0.85);
  pointer-events: none;
}

.playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(226, 84, 39, 0.45);
  pointer-events: none;
  z-index: 4;
}

.playhead::before {
  content: '';
  position: absolute;
  top: 0;
  left: -4px;
  width: 10px;
  height: 9px;
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.ruler {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-muted);
}

/* ================= 通用面板头与徽章 ================= */
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--hairline);
  background: #fcfbf8;
}

.panel-title-wrap {
  display: flex;
  align-items: baseline;
  gap: 9px;
  flex-wrap: wrap;
}

.panel-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.panel-head-pills {
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--surface-muted);
  color: var(--ink-soft);
  border: 1px solid var(--hairline);
  white-space: nowrap;
}

.badge-accent {
  background: var(--emerald-dim);
  color: var(--emerald-bright);
  border-color: var(--emerald-border);
}

.adaptive-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--accent-dim);
  color: var(--accent-bright);
  border: 1px solid var(--accent-border);
}

/* ================= 右侧顶部胶囊工具条 + 轻量浮层（方案 2 核心） ================= */
.studio-dock {
  position: relative;
  z-index: 35;
}

.studio-dock-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.studio-pop-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.studio-pop-right {
  margin-left: auto;
}

.dock-pill-group {
  display: inline-flex;
  align-items: center;
  border-radius: var(--r-sm);
  background: var(--surface-recessed);
  border: 1px solid var(--hairline);
}

.dock-pill-group .dock-pill {
  border: none;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  background: transparent;
}

.dock-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 9px;
  border: none;
  border-left: 1px solid var(--hairline);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease;
}

.dock-icon-btn:hover {
  background: var(--surface-hover);
  color: var(--accent-bright);
}

.dock-icon-btn.is-playing {
  background: var(--accent-dim);
  color: var(--accent-bright);
}

.dock-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  border: 1px solid var(--hairline);
  background: var(--surface-recessed);
  font-size: 12.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease;
}

.dock-pill:hover,
.dock-pill.is-open {
  background: var(--surface);
  border-color: var(--accent-border);
}

.dock-pill.is-open {
  box-shadow: 0 0 0 3px rgba(226, 84, 39, 0.08);
}

.dock-k {
  color: var(--ink-muted);
  font-size: 11.5px;
  font-weight: 500;
}

.dock-v {
  color: var(--ink);
  font-weight: 600;
  max-width: 128px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dock-caret {
  color: var(--ink-muted);
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.dock-pill.is-open .dock-caret {
  transform: rotate(180deg);
  color: var(--accent);
}

.dock-pill-status {
  background: var(--surface);
}

.brain-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  flex-shrink: 0;
}

.brain-dot.is-warn {
  background: var(--amber);
}

.brain-dot.is-error {
  background: var(--danger);
}

.dock-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 45;
  width: min(332px, 88vw);
  padding: 13px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dock-popover-wide {
  width: min(440px, 90vw);
}

.dock-popover-right {
  left: auto;
  right: 0;
}

/* 更多菜单弹出层 */
.more-menu-wrap {
  position: relative;
  display: inline-flex;
}

.more-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 45;
  min-width: 146px;
  padding: 5px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--hairline-strong);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.more-menu-item {
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border: none;
  border-radius: var(--r-xs);
  background: transparent;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease;
}

.more-menu-item:hover {
  background: var(--surface-recessed);
  color: var(--accent-bright);
}

.btn.is-active {
  background: var(--accent-dim);
  color: var(--accent-bright);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}

select,
input[type="text"],
input[type="number"],
input[type="password"],
textarea {
  width: 100%;
  background: var(--surface-recessed);
  border: 1px solid var(--hairline-strong);
  border-radius: var(--r-sm);
  padding: 7px 10px;
  font-size: 13px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
}

select option,
select optgroup {
  background: #ffffff;
  color: var(--ink);
}

select:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
textarea:focus {
  background: var(--surface);
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px rgba(226, 84, 39, 0.11);
}

.voice-select-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.voice-select-row select {
  flex: 1;
  min-width: 0;
}

.voice-scene-tip {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-muted);
  white-space: normal;
  word-break: break-word;
}

/* 语速控制卡：轻量暖底无重框 */
.speed-field {
  padding: 8px 11px;
  border-radius: var(--r-sm);
  background: var(--surface-recessed);
  justify-content: space-between;
}

.seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border-radius: 7px;
  background: #e9e5dc;
}

.seg-btn,
.seg-item {
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}

.seg-btn:hover,
.seg-item:hover {
  color: var(--ink);
}

.seg-btn.is-active,
.seg-item.is-active {
  background: var(--surface);
  color: var(--accent-bright);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(28, 25, 23, 0.1);
}

.speed-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.speed-end {
  font-size: 11px;
  color: var(--ink-muted);
}

.speed-row input[type="range"] {
  flex: 1;
}

.speed-val {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  min-width: 42px;
  text-align: right;
}

.speed-hint {
  margin: 0;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 6 大探店语气风格：纯净单名胶囊（详尽说明悬停查看） */
.tone-presets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.tone-chip {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  background: var(--surface-recessed);
  border: 1px solid transparent;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.tone-chip:hover {
  background: var(--surface-hover);
  border-color: var(--hairline);
}

.tone-chip.is-active {
  background: #fff4ef;
  border-color: var(--accent-border);
}

.tone-chip-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tone-chip.is-active .tone-chip-title {
  color: var(--accent-bright);
}

.tone-chip-cat,
.tone-chip-desc {
  display: none;
}

/* 配音大脑体检（仅在点击胶囊时悬浮展开） */
.brain-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brain-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.brain-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}

.brain-title svg {
  color: var(--accent);
}

.brain-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 99px;
  background: var(--surface);
  color: var(--ink-soft);
  border: 1px solid var(--hairline);
}

.brain-pill.is-ok {
  background: var(--emerald-dim);
  color: var(--emerald-bright);
  border-color: var(--emerald-border);
}

.brain-pill.is-warn {
  background: var(--amber-dim);
  color: var(--amber-bright);
  border-color: var(--amber-border);
}

.brain-pill.is-error {
  background: var(--danger-dim);
  color: var(--danger-bright);
  border-color: var(--danger-border);
}

.brain-meter {
  position: relative;
  height: 5px;
  border-radius: 99px;
  background: #e5e1d8;
  overflow: hidden;
  margin-bottom: 5px;
}

.brain-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: 99px;
  background: var(--emerald);
  transition: width 0.25s ease, background 0.2s ease;
}

.brain-meter-fill.is-warn {
  background: var(--amber);
}

.brain-meter-fill.is-error {
  background: var(--danger);
}

.brain-meter-limit {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(28, 25, 23, 0.2);
}

.brain-meter-cap {
  font-size: 11px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.brain-real {
  color: var(--emerald-bright);
  font-weight: 600;
}

.brain-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 92px;
  overflow-y: auto;
}

.brain-item {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  font-size: 11.5px;
  color: var(--ink-soft);
  padding: 6px 8px;
  border-radius: var(--r-xs);
  background: var(--surface);
}

.brain-item.is-warn {
  background: var(--amber-dim);
  color: #92400e;
}

.brain-item.is-error {
  background: var(--danger-dim);
  color: #991b1b;
}

.brain-ico {
  font-size: 12px;
  line-height: 1.3;
  margin-top: 1px;
  width: 14px;
  text-align: center;
  flex-shrink: 0;
  font-weight: 700;
}

.brain-body {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.brain-body p {
  margin: 0;
  line-height: 1.35;
  flex: 1 1 260px;
}

.brain-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  flex-shrink: 0;
}

/* 可折叠高级调节抽屉 */
.adv-drawer {
  border-top: 1px solid var(--hairline);
  padding-top: 8px;
}

.adv-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-muted);
  cursor: pointer;
  list-style: none;
  padding: 1px 0;
  user-select: none;
}

.adv-summary::-webkit-details-marker {
  display: none;
}

.adv-summary:hover {
  color: var(--ink);
}

.adv-caret {
  transition: transform 0.18s ease;
}

.adv-drawer[open] .adv-caret {
  transform: rotate(180deg);
}

.adv-body {
  margin-top: 9px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

/* ================= 右侧面板 2：镜头台词脚本（核心高频编辑区） ================= */
.script-head-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.raw-transcript-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  padding: 8px 14px;
  font-size: 12px;
  border-bottom: 1px solid var(--hairline);
  background: #faf8f4;
  color: var(--ink-soft);
}

.raw-transcript-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.raw-transcript-acts {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.raw-transcript-bar p {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-soft);
  white-space: normal;
  word-break: break-word;
  max-height: 96px;
  overflow-y: auto;
}

.raw-tag {
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 11px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  color: var(--ink-soft);
  flex-shrink: 0;
}

.scripts {
  list-style: none;
  margin: 0;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: clamp(340px, calc(100vh - 230px), 640px);
  overflow-y: auto;
  background: var(--surface);
}

.srow {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--r-md);
  background: var(--surface-recessed);
  border: 1px solid var(--hairline);
  transition: border-color 0.14s ease, background 0.14s ease, box-shadow 0.14s ease;
}

.srow:hover {
  border-color: var(--hairline-strong);
  background: #ffffff;
  box-shadow: var(--shadow-sm);
}

.srow.is-active {
  border-color: var(--accent-border);
  background: #fff9f6;
  box-shadow: inset 3px 0 0 var(--accent);
}

.srow-thumb-box {
  position: relative;
  width: 50px;
  height: 62px;
  border-radius: var(--r-xs);
  overflow: hidden;
  background: #e5e0d5;
  border: 1px solid var(--hairline);
  cursor: pointer;
  flex-shrink: 0;
}

.srow-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.srow-idx-badge {
  position: absolute;
  left: 3px;
  top: 3px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(24, 21, 18, 0.78);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
}

.srow-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.srow-simple-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.srow-top-right {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.mini-inline-ai {
  padding: 2px 7px;
  border-radius: 99px;
  border: 1px solid var(--accent-border);
  background: var(--accent-dim);
  color: var(--accent-bright);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease;
}

.mini-inline-ai:hover:not(:disabled) {
  background: rgba(226, 84, 39, 0.16);
}

.srow-shot-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.srow-shot-dur {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
}

.tag {
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.tag-ok {
  background: var(--surface-muted);
  color: var(--ink-soft);
}

.tag-synth {
  background: var(--emerald-dim);
  color: var(--emerald-bright);
  border: 1px solid var(--emerald-border);
}

.tag-warn {
  background: var(--amber-dim);
  color: var(--amber-bright);
  border: 1px solid var(--amber-border);
}

.tag-bad {
  background: var(--danger-dim);
  color: var(--danger-bright);
  border: 1px solid var(--danger-border);
}

.srow-simple-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid rgba(28, 25, 23, 0.12);
  border-radius: var(--r-xs);
  padding: 5px 9px;
  font-size: 13px;
  line-height: 1.4;
  min-height: 30px;
  color: var(--ink);
  resize: none;
  overflow: hidden;
  display: block;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.srow-simple-input:focus {
  border-color: var(--accent-border);
  box-shadow: 0 0 0 3px rgba(226, 84, 39, 0.10);
}

.srow-meta-editor {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
  padding: 6px 8px;
  border-radius: var(--r-xs);
  background: var(--surface);
  border: 1px dashed var(--hairline-strong);
}

.srow-meta-editor label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--ink-muted);
}

.srow-meta-editor input[type="number"] {
  width: 64px;
  padding: 3px 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
}

.srow-note-input {
  flex: 1 1 120px;
  padding: 3px 8px !important;
  font-size: 12px !important;
}

.srow-edit-toggle {
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid transparent;
  background: var(--surface-muted);
  color: var(--ink-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: background 0.13s ease, color 0.13s ease, border-color 0.13s ease;
}

.srow-edit-toggle:hover,
.srow-edit-toggle.is-open {
  color: var(--accent-bright);
  border-color: var(--accent-border);
  background: var(--accent-dim);
}

.srow-act {
  display: flex;
  align-items: center;
}

.srow-act-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.mini {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 8px;
  border-radius: var(--r-xs);
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.mini:hover {
  background: var(--surface-hover);
  color: var(--ink);
  border-color: var(--hairline-strong);
}

.mini.is-playing {
  background: var(--accent-dim);
  color: var(--accent-bright);
  border-color: var(--accent-border);
}

.mini-ai {
  background: var(--accent-dim);
  color: var(--accent-bright);
  border-color: var(--accent-border);
}

/* ================= 底部一键合成与导出行动条 ================= */
.actionbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 13px 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.synth-progress-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.synth-stat-top {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.synth-stat-top strong {
  font-size: 13.5px;
  color: var(--ink);
}

.cost-inline-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-bright);
  background: var(--accent-dim);
  border: 1px solid var(--accent-border);
}

.actionbar-btns {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-shrink: 0;
}

/* ================= 次级视图共享头部、指标与表格 ================= */
.view-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent-bright);
}

.view-head h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.lede {
  margin: 5px 0 0;
  max-width: 680px;
  font-size: 13px;
  color: var(--ink-soft);
}

.dropzone-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  margin-bottom: 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1.5px dashed var(--hairline-strong);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.16s ease, background 0.16s ease;
}

.dropzone-card:hover,
.dropzone-card.dropzone-hover {
  border-color: var(--accent-border);
  background: #fff9f6;
}

.drop-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 13px;
  background: var(--accent-dim);
  color: var(--accent-bright);
  border: 1px solid var(--accent-border);
  flex-shrink: 0;
}

.drop-content h3 {
  margin: 0 0 3px;
  font-size: 14.5px;
  color: var(--ink);
}

.drop-content p {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 15px 17px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.metric-label {
  font-size: 12px;
  color: var(--ink-soft);
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.2;
}

.metric-value .unit {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-muted);
  margin-left: 3px;
}

.metric-note {
  font-size: 11.5px;
  color: var(--ink-muted);
}

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.table th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-muted);
  padding: 10px 16px;
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
}

.table td {
  padding: 11px 16px;
  border-bottom: 1px solid rgba(28, 25, 23, 0.055);
  color: var(--ink-soft);
  vertical-align: middle;
}

.table tbody tr {
  cursor: pointer;
  transition: background 0.14s ease;
}

.table tbody tr:hover {
  background: var(--surface-recessed);
}

.table tbody tr:last-child td {
  border-bottom: none;
}

.cell-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 600;
}

.task-thumb {
  width: 34px;
  height: 44px;
  border-radius: 5px;
  object-fit: cover;
  border: 1px solid var(--hairline);
  flex-shrink: 0;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
}

.status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-muted);
}

.st-ok i {
  background: var(--emerald);
}

.st-ok {
  color: var(--emerald-bright);
}

.st-warn i {
  background: var(--amber);
}

.st-warn {
  color: var(--amber-bright);
}

/* ================= 视图 3：复刻工坊与音色库 ================= */
.clone-studio-panel {
  margin-bottom: 16px;
}

.clone-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.slot-pool-box {
  padding: 13px 15px;
  border-radius: var(--r-md);
  background: var(--surface-recessed);
}

.slot-pool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.slot-pool-head strong {
  font-size: 13px;
  color: var(--ink);
}

.slot-pool-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.slot-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--hairline);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.slot-card:hover {
  border-color: var(--hairline-strong);
  box-shadow: var(--shadow-sm);
}

.slot-card.is-selected {
  border-color: var(--accent-border);
  background: #fff7f4;
  box-shadow: 0 0 0 1px rgba(226, 84, 39, 0.14);
}

.slot-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.slot-id {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.slot-status {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 99px;
  white-space: nowrap;
  flex-shrink: 0;
}

.slot-status.is-free {
  background: var(--emerald-dim);
  color: var(--emerald-bright);
}

.slot-status.is-used {
  background: var(--accent-dim);
  color: var(--accent-bright);
}

.slot-owner {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.clone-upload-box,
.clone-config-box {
  padding: 15px 17px;
  border-radius: var(--r-md);
  background: var(--surface-recessed);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.clone-upload-box h4,
.clone-config-box h4 {
  margin: 0;
  font-size: 13.5px;
  color: var(--ink);
}

.clone-tip,
.field-hint {
  margin: 0;
  font-size: 12px;
  color: var(--ink-soft);
}

.clone-source-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mic-prompt-card {
  padding: 12px;
  border-radius: var(--r-sm);
  background: var(--danger-dim);
  border: 1px solid var(--danger-border);
}

.mic-prompt-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--danger-bright);
  margin-bottom: 6px;
}

.rec-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
  animation: pulseRec 1.1s ease-in-out infinite;
}

@keyframes pulseRec {
  50% {
    opacity: 0.35;
  }
}

.mic-read-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
}

.clone-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr));
  gap: 10px;
}

.clone-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--surface-recessed);
  border: 1px solid var(--hairline);
}

.clone-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.clone-meta {
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-top: 2px;
}

.voice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 11px;
  padding: 16px;
}

.voice-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 15px;
  border-radius: var(--r-md);
  background: var(--surface-recessed);
  border: 1px solid var(--hairline);
  transition: border-color 0.14s ease, transform 0.14s ease, background 0.14s ease;
}

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

.voice-name {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.voice-desc {
  margin: 0;
  font-size: 12px;
  color: var(--ink-soft);
}

.voice-scene {
  font-size: 11.5px;
  color: var(--ink-muted);
  padding: 5px 8px;
  border-radius: var(--r-xs);
  background: var(--surface);
}

.voice-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* ================= 视图 4：设置与诊断 ================= */
.check-list {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.check-ok,
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-recessed);
  font-size: 12.5px;
  color: var(--ink-soft);
}

.check-ok svg {
  color: var(--emerald-bright);
  flex-shrink: 0;
  margin-top: 2px;
}

.check-id {
  font-weight: 600;
  white-space: nowrap;
}

.check-main {
  flex: 1;
}

.check-text {
  color: var(--ink);
  font-weight: 600;
}

.check-why {
  font-size: 12px;
  color: var(--ink-muted);
  margin-top: 2px;
}

.settings-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.provider {
  padding: 16px 18px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.provider-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.provider-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
}

.provider-note {
  margin: 0;
  font-size: 12px;
  color: var(--ink-soft);
}

.provider-foot {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ================= 模态框与全局 Toast ================= */
.modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(28, 25, 23, 0.42);
  backdrop-filter: blur(6px);
}

.modal-card {
  width: min(540px, 100%);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--hairline);
}

.modal-head h3 {
  margin: 0;
  font-size: 15px;
  color: var(--ink);
}

.modal-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-desc {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--hairline);
  background: var(--surface-recessed);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  transform: translate(-50%, 14px);
  opacity: 0;
  pointer-events: none;
  padding: 10px 18px;
  border-radius: 10px;
  background: rgba(28, 25, 23, 0.92);
  backdrop-filter: blur(12px);
  color: #fffdf9;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 12px 28px rgba(28, 25, 23, 0.22);
  max-width: min(92vw, 560px);
  text-align: center;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-on {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ================= 响应式适配（零遮挡、零横向溢出） ================= */
@media (max-width: 1120px) {
  .env-pill .env-text {
    display: none;
  }

  .env-pill {
    padding: 7px;
  }

  .topbar {
    padding: 0 16px;
    gap: 10px;
  }
}

@media (max-width: 960px) {
  .topbar {
    height: auto;
    min-height: 54px;
    flex-wrap: wrap;
    padding: 8px 14px;
  }

  .topnav {
    order: 3;
    width: 100%;
    justify-content: space-between;
    overflow-x: auto;
  }

  .nav-tab {
    flex: 1;
    justify-content: center;
    padding: 6px 8px;
    font-size: 12.5px;
  }

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

  .editor-left {
    position: static;
  }

  .scripts {
    max-height: none;
  }

  .studio-pop-right {
    margin-left: 0;
  }

  .dock-popover,
  .dock-popover-right,
  .dock-popover-wide {
    left: 0;
    right: auto;
    max-width: calc(100vw - 48px);
  }

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

  .clone-grid,
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .topbar {
    padding: 8px 10px;
    gap: 8px;
  }

  .topnav {
    gap: 2px;
    padding: 2px;
    overflow-x: visible;
  }

  .nav-tab {
    flex: 1 1 auto;
    padding: 6px 4px;
    gap: 3px;
    font-size: 11.5px;
  }

  .nav-tab svg {
    width: 13px;
    height: 13px;
  }

  .nav-count {
    min-width: 15px;
    height: 15px;
    padding: 0 4px;
    font-size: 10px;
  }

  .main-container {
    padding: 12px 12px 36px;
  }

  .transport {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
  }

  .timecode {
    font-size: 10.5px;
  }

  .vol-control {
    gap: 4px;
  }

  .vol-control input[type="range"] {
    width: 48px;
  }

  .studio-dock-bar {
    gap: 6px;
    padding: 6px 8px;
  }

  .dock-pill {
    padding: 5px 8px;
    font-size: 12px;
    gap: 4px;
  }

  .dock-icon-btn {
    padding: 5px 7px;
    font-size: 11.5px;
  }

  .dock-v {
    max-width: 118px;
  }

  .lock-btn-text {
    display: none;
  }

  .actionbar {
    position: sticky;
    bottom: 8px;
    z-index: 25;
  }

  .slot-pool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .slot-card {
    padding: 8px 9px;
  }

  .slot-id {
    font-size: 10px;
  }

  .studio-pop-wrap {
    position: static;
  }

  .studio-dock .dock-popover,
  .studio-dock .dock-popover-right,
  .studio-dock .dock-popover-wide {
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
  }

  .panel-head {
    padding: 9px 11px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .srow {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 8px;
    padding: 7px 9px;
  }

  .srow-thumb-box {
    width: 48px;
    height: 60px;
  }

  .srow-act {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .actionbar-btns {
    width: 100%;
  }

  .actionbar-btns .btn {
    flex: 1;
  }

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

@media (max-width: 720px) {
  .slot-pool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .table-wrap {
    overflow-x: visible;
    padding: 10px;
  }

  .table,
  .table tbody {
    display: block;
    width: 100%;
  }

  .table thead {
    display: none;
  }

  .table tbody {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px 10px;
    padding: 12px;
    border-radius: var(--r-md);
    background: var(--surface-recessed);
    border: 1px solid var(--hairline);
  }

  .table tbody tr td {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 0;
    border-bottom: none;
    font-size: 12px;
    min-width: 0;
  }

  .table tbody tr td[data-label]::before {
    content: attr(data-label);
    font-size: 10.5px;
    color: var(--ink-muted);
  }

  .table tbody tr td:first-child {
    grid-column: 1 / -1;
    margin-bottom: 4px;
  }

  .table tbody tr td:first-child::before {
    display: none;
  }

  .table tbody tr td:last-child {
    grid-column: 1 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    padding-top: 8px;
    margin-top: 2px;
    border-top: 1px solid var(--hairline);
  }

  .cell-title span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ================= 实用组件 ================= */
.monitor-right-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.subtitle-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
}

.subtitle-toggle.is-on {
  color: var(--accent-bright);
  border-color: var(--accent-border);
  background: var(--accent-dim);
}

.media-missing-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--amber-dim);
  border: 1px solid var(--amber-border);
  color: #92400e;
  font-size: 12.5px;
}

.provider-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
}

.provider-status-pill.is-on {
  background: var(--emerald-dim);
  color: var(--emerald-bright);
  border: 1px solid var(--emerald-border);
}

.provider-status-pill.is-off {
  background: var(--surface-muted);
  color: var(--ink-muted);
  border: 1px solid var(--hairline);
}

.provider-masked-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--emerald-bright);
}

.gen-quick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.btn.is-recording {
  background: var(--danger-dim);
  color: var(--danger-bright);
  border-color: var(--danger-border);
  animation: recPulse 1.2s ease-in-out infinite;
}

@keyframes recPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.24); }
  50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}

.public-warn-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 9px 18px;
  background: var(--amber-dim);
  border-bottom: 1px solid var(--amber-border);
  color: #92400e;
  font-size: 12.5px;
  font-weight: 500;
}

.voice-tone-note {
  margin: 6px 0 0;
  padding: 7px 10px;
  border-radius: var(--r-xs);
  background: var(--surface-recessed);
  border: 1px solid var(--hairline);
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.5;
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(246, 244, 239, 0.92);
  backdrop-filter: blur(14px);
}

.auth-card {
  width: min(400px, 100%);
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-lg);
}

.auth-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.auth-head h2 {
  margin: 0;
  font-size: 18px;
  color: var(--ink);
}

.auth-head p {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.auth-err {
  margin: 0;
  padding: 8px 10px;
  border-radius: var(--r-xs);
  background: var(--danger-dim);
  border: 1px solid var(--danger-border);
  color: var(--danger-bright);
  font-size: 12px;
}

.security-panel {
  margin-bottom: 16px;
}

.security-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.security-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.security-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 6px;
}

.settings-lock-card {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-sm);
}

.settings-lock-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-lock-row input {
  width: min(280px, 100%);
}
