:root {
  --bg: #0d0e10;
  --panel: #141619;
  --panel-2: #191c21;
  --panel-3: #20242a;
  --line: #272b32;
  --line-soft: #1e2228;
  --text: #f1f3f6;
  --muted: #929ba8;
  --dim: #6b7380;
  --accent: #ff7a3d;
  --accent-soft: rgba(255, 122, 61, 0.14);
  --teal: #2dd4bf;
  --teal-soft: rgba(45, 212, 191, 0.13);
  --yellow: #f6c453;
  --yellow-soft: rgba(246, 196, 83, 0.13);
  --red: #f87171;
  --red-soft: rgba(248, 113, 113, 0.13);
  --blue: #60a5fa;
  --blue-soft: rgba(96, 165, 250, 0.13);
  --radius: 8px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  letter-spacing: 0;
}

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

button { cursor: pointer; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #31363f; border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #434a56; }

/* 顶栏 */
.topbar {
  height: 58px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 30;
}

.topbar-inner {
  height: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  flex: 0 0 auto;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), #ff9a5c);
  color: #14100c;
  box-shadow: 0 6px 18px rgba(255, 122, 61, 0.25);
}

.brand-mark svg { width: 19px; height: 19px; }

.brand-name {
  font-weight: 800;
  font-size: 17px;
  white-space: nowrap;
}

.project-name {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--panel-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 7px 10px;
  color: var(--muted);
}

.project-name svg { width: 15px; height: 15px; flex: 0 0 auto; }

.project-name input {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 13px;
  color: var(--text);
}

.saved-dot {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--teal);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.saved-dot::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 13px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.12s ease;
}

.btn svg { width: 15px; height: 15px; }

.btn:hover { border-color: #3a414c; background: var(--panel-3); }
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #1b0e06; }
.btn-primary:hover { background: #ff8b56; border-color: #ff8b56; }

.btn-accent { background: var(--teal); border-color: var(--teal); color: #07211d; }
.btn-accent:hover { background: #43e2cf; border-color: #43e2cf; }

.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); background: var(--panel-3); }

.btn-sm { height: 30px; padding: 0 11px; font-size: 12px; }

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  display: grid;
  place-items: center;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.icon-btn svg { width: 15px; height: 15px; }

.icon-btn:hover { color: var(--text); border-color: #3a414c; background: var(--panel-3); }

.text-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 6px;
  border-radius: 6px;
}

.text-btn:hover { color: var(--red); background: var(--red-soft); }

/* 主布局 */
.app-shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr) 344px;
  min-height: calc(100vh - 58px);
  background: var(--bg);
}

.left-rail, .right-rail {
  background: var(--panel);
  min-height: 0;
}

.left-rail { border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.right-rail { border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; padding: 12px; overflow-y: auto; }

.center-col {
  min-width: 0;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  height: calc(100vh - 58px);
}

/* 左侧素材/配方/模板 */
.rail-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line);
  padding: 8px;
  gap: 6px;
}

.rail-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  height: 56px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.rail-tab svg { width: 17px; height: 17px; }

.rail-tab:hover { background: var(--panel-2); color: var(--text); }

.rail-tab.active { background: var(--panel-3); color: var(--text); border-color: var(--line); }

.rail-content { flex: 1 1 auto; overflow-y: auto; padding: 12px; }

.rail-panel { display: none; }
.rail-panel.active { display: block; }

.panel-title {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-desc { font-size: 12px; color: var(--muted); margin-bottom: 12px; line-height: 1.6; }

.dropzone {
  border: 1px dashed #3a414c;
  border-radius: var(--radius);
  padding: 18px 12px;
  text-align: center;
  color: var(--muted);
  background: var(--panel-2);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
  margin-bottom: 12px;
}

.dropzone svg { width: 22px; height: 22px; margin-bottom: 6px; color: var(--accent); }
.dropzone p { font-size: 12px; font-weight: 700; color: var(--text); }
.dropzone span { font-size: 11px; color: var(--dim); }
.dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.dragover { border-color: var(--teal); background: var(--teal-soft); }

.asset-list, .recipe-list, .template-list, .cuts-list { display: flex; flex-direction: column; gap: 8px; }

.asset-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel-2);
  cursor: pointer;
}

.asset-item:hover { border-color: var(--line); background: var(--panel-3); }
.asset-item.active { border-color: rgba(255, 122, 61, 0.55); background: var(--accent-soft); }

.asset-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: var(--panel-3);
  color: var(--accent);
  flex: 0 0 auto;
}

.asset-icon svg { width: 16px; height: 16px; }

.asset-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.asset-body strong { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-body small { font-size: 11px; color: var(--dim); }

.asset-status { color: var(--teal); display: grid; place-items: center; }
.asset-status svg { width: 15px; height: 15px; }
.asset-status.muted { color: var(--dim); }

.analyze-box {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 11px;
  background: var(--panel-2);
}

.analyze-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
}

.analyze-head span { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 700; }
.analyze-head svg { width: 14px; height: 14px; color: var(--teal); }
.analyze-head strong { color: var(--teal); font-size: 12px; }

.progress-track { height: 5px; border-radius: 4px; background: var(--panel-3); overflow: hidden; margin-bottom: 8px; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--teal)); border-radius: 4px; transition: width 0.3s ease; }

.analyze-box p { font-size: 11px; color: var(--muted); line-height: 1.5; }

/* 配方卡片 */
.recipe-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--panel-2);
  overflow: hidden;
}

.recipe-card.active { border-color: rgba(45, 212, 191, 0.55); background: var(--teal-soft); }

.recipe-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 11px 6px;
}

.recipe-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 14px;
  flex: 0 0 auto;
}

.recipe-head strong { font-size: 13px; }
.recipe-head small { display: block; font-size: 11px; color: var(--dim); font-weight: 400; }

.recipe-specs {
  padding: 4px 11px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.recipe-specs span {
  font-size: 11px;
  color: var(--muted);
  background: var(--panel-3);
  border-radius: 5px;
  padding: 3px 6px;
  font-family: var(--mono);
}

.recipe-apply {
  display: block;
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line-soft);
  background: var(--panel-3);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  padding: 8px;
}

.recipe-apply:hover { background: var(--teal); color: #07211d; }

/* 模板卡片 */
.template-card {
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 11px;
  background: var(--panel-2);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.template-card:hover, .template-card.active { border-color: rgba(255, 122, 61, 0.55); background: var(--accent-soft); }

.template-card .tmpl-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.template-card .tmpl-head svg { width: 15px; height: 15px; color: var(--accent); }
.template-card strong { font-size: 12px; }
.template-card p { font-size: 11px; color: var(--muted); line-height: 1.5; }

/* 播放器 */
.player-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  flex: 0 0 auto;
}

.player-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
}

.player-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 800;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-soft);
}

.player-tools {
  display: flex;
  align-items: center;
  gap: 7px;
}

.time-readout {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  padding-left: 6px;
  min-width: 108px;
  text-align: right;
}

.player-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #050607;
  min-height: 220px;
}

.player-stage video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.safe-guide {
  position: absolute;
  inset: 5% 25%;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  pointer-events: none;
}

.safe-guide span {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.55);
  background: rgba(0, 0, 0, 0.45);
  padding: 3px 7px;
  border-radius: 5px;
  letter-spacing: 0;
}

.subtitle-overlay {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  width: min(84%, 640px);
  text-align: center;
  pointer-events: none;
}

.subtitle-overlay span {
  display: inline-block;
  max-width: 100%;
  background: rgba(8, 9, 11, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: clamp(13px, 2vw, 18px);
  font-weight: 700;
  line-height: 1.5;
  padding: 7px 14px;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.empty-mask {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(8, 9, 11, 0.86);
  text-align: center;
  padding: 20px;
  color: var(--muted);
}

.empty-mask svg { width: 34px; height: 34px; color: var(--accent); margin-bottom: 4px; }
.empty-mask strong { color: var(--text); font-size: 15px; }
.empty-mask span { font-size: 12px; max-width: 320px; line-height: 1.6; }

/* 时间线 */
.timeline-wrap { border-top: 1px solid var(--line); padding: 10px 12px 12px; }
.timeline-wrap { border-top: 1px solid var(--line); padding: 10px 12px 12px; overflow: hidden; }

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

.timeline-label { font-size: 12px; font-weight: 800; }

.timeline-meta { display: flex; gap: 10px; font-size: 11px; color: var(--muted); font-family: var(--mono); }
.timeline-meta span:first-child { color: var(--red); }

.timeline {
  position: relative;
  height: 72px;
  background: #0a0b0d;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  overflow: hidden;
  cursor: pointer;
}

.tl-track { position: absolute; top: 0; bottom: 0; left: 0; }

.tl-seg {
  position: absolute;
  top: 10px;
  bottom: 10px;
  border-radius: 5px;
  background: #2a3440;
  border: 1px solid #3a4552;
  overflow: hidden;
}

.tl-seg.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

.tl-seg .tl-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 8px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-cut {
  position: absolute;
  top: 0;
  bottom: 0;
  background: repeating-linear-gradient(135deg, rgba(248, 113, 113, 0.28) 0 5px, rgba(248, 113, 113, 0.12) 5px 10px);
  border-left: 1px solid var(--red);
  border-right: 1px solid var(--red);
  z-index: 3;
  pointer-events: none;
}

.tl-cut::after {
  content: "✕";
  position: absolute;
  top: 4px;
  left: 4px;
  font-size: 9px;
  color: var(--red);
  font-weight: 900;
}

.tl-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--teal);
  z-index: 5;
  pointer-events: none;
}

.tl-playhead::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -4px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 7px solid var(--teal);
}

.timeline-ruler {
  position: relative;
  height: 16px;
  margin-top: 5px;
}

.timeline-ruler span {
  position: absolute;
  top: 0;
  font-size: 9px;
  color: var(--dim);
  font-family: var(--mono);
  transform: translateX(-50%);
}

/* 字幕 */
.transcript-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 260px;
  display: flex;
  flex-direction: column;
}

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

.section-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
}

.section-title svg { width: 15px; height: 15px; color: var(--accent); }
.section-title em { font-style: normal; font-size: 11px; color: var(--muted); font-weight: 600; background: var(--panel-3); padding: 2px 7px; border-radius: 5px; }

.transcript-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.search-box {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 190px;
  height: 32px;
  padding: 0 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--dim);
}

.search-box svg { width: 14px; height: 14px; flex: 0 0 auto; }
.search-box input { flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 12px; color: var(--text); }

.chip-row { display: flex; gap: 6px; flex-wrap: wrap; }

.chip {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  height: 26px;
  padding: 0 9px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 700;
}

.chip:hover { color: var(--text); border-color: #3a414c; }
.chip.active { background: var(--accent); border-color: var(--accent); color: #1b0e06; }

.transcript-list { overflow-y: auto; max-height: 300px; padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }

.transcript-line {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 7px 9px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
}

.transcript-line:hover { background: var(--panel-2); }
.transcript-line.active { background: var(--accent-soft); border-color: rgba(255, 122, 61, 0.4); }

.transcript-line .line-time { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.transcript-line .line-text { font-size: 12.5px; color: var(--text); line-height: 1.55; }

.transcript-line .line-text mark { background: var(--yellow-soft); color: var(--yellow); border-radius: 3px; padding: 0 2px; }

.line-badges { display: flex; gap: 4px; justify-content: flex-end; }

.mini-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.mini-badge.fill { background: var(--yellow-soft); color: var(--yellow); }
.mini-badge.repeat { background: var(--red-soft); color: var(--red); }
.mini-badge.stumble { background: var(--blue-soft); color: var(--blue); }
.mini-badge.error { background: #fda4af; color: #450a0a; }

/* AI 面板 */
.ai-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  flex: 0 0 auto;
}

.ai-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
}

.ai-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}

.ai-stat {
  padding: 11px 8px;
  text-align: center;
  border-right: 1px solid var(--line);
}

.ai-stat:last-child { border-right: 0; }
.ai-stat strong { display: block; font-size: 16px; color: var(--text); font-family: var(--mono); }
.ai-stat span { font-size: 10px; color: var(--muted); }

.issue-list {
  max-height: 320px;
  overflow-y: auto;
  padding: 9px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.issue-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 9px 10px;
}

.issue-card.marked { border-color: rgba(248, 113, 113, 0.65); background: var(--red-soft); }

.issue-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.issue-type {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 5px;
}

.issue-type.fill { background: var(--yellow-soft); color: var(--yellow); }
.issue-type.repeat { background: var(--red-soft); color: var(--red); }
.issue-type.stumble { background: var(--blue-soft); color: var(--blue); }
.issue-type.error { background: rgba(253, 164, 175, 0.16); color: #fda4af; }

.issue-time { font-family: var(--mono); font-size: 10.5px; color: var(--muted); }

.issue-text {
  font-size: 12px;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: 7px;
}

.issue-text s { color: var(--red); text-decoration-thickness: 2px; }

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

.issue-confidence { font-size: 10.5px; color: var(--dim); }

.issue-actions { display: flex; gap: 6px; }

.issue-actions .btn { height: 27px; padding: 0 9px; font-size: 11px; }

/* 粗剪清单 */
.cuts-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  flex: 1 1 auto;
  min-height: 190px;
  display: flex;
  flex-direction: column;
}

.cuts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
}

.cuts-empty {
  padding: 16px 14px;
  text-align: center;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.6;
}

.cuts-empty svg { width: 22px; height: 22px; margin-bottom: 6px; color: var(--dim); }

.cuts-list { padding: 9px; flex: 1 1 auto; overflow-y: auto; max-height: 260px; display: flex; flex-direction: column; gap: 6px; }

.cut-item {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  padding: 7px 9px;
}

.cut-item .cut-idx {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 11px;
  font-weight: 800;
}

.cut-item .cut-body { flex: 1 1 auto; min-width: 0; }
.cut-item .cut-body strong { display: block; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cut-item .cut-body small { font-size: 10.5px; color: var(--muted); font-family: var(--mono); }

.cut-item .icon-btn { width: 26px; height: 26px; }
.cut-item .icon-btn svg { width: 13px; height: 13px; }
.cut-item .icon-btn:hover { color: var(--red); border-color: var(--red); background: var(--red-soft); }

.cuts-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 10px 12px;
}

.cuts-total span { display: block; font-size: 10px; color: var(--muted); }
.cuts-total strong { font-size: 15px; color: var(--red); font-family: var(--mono); }

/* 弹窗 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(5, 6, 8, 0.72);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal {
  width: min(640px, 100%);
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

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

.modal-body { padding: 15px 16px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 11px; color: var(--muted); font-weight: 700; }

.field select {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  color: var(--text);
  padding: 0 10px;
  font-size: 13px;
  outline: 0;
}

.field select:focus { border-color: var(--accent); }

.switch-row { display: flex; gap: 18px; margin-bottom: 14px; flex-wrap: wrap; }

.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); cursor: pointer; }

.switch input { display: none; }

.switch-track {
  width: 34px;
  height: 19px;
  border-radius: 10px;
  background: var(--panel-3);
  border: 1px solid var(--line);
  position: relative;
  transition: background 0.16s ease;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 0.16s ease, background 0.16s ease;
}

.switch input:checked + .switch-track { background: var(--teal); border-color: var(--teal); }
.switch input:checked + .switch-track::after { transform: translateX(15px); background: #07211d; }

.export-summary {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  padding: 12px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}

.export-summary strong { color: var(--text); }
.export-summary .sum-row { display: flex; justify-content: space-between; gap: 12px; }
.export-summary .sum-row + .sum-row { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 6px; }

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(20px);
  background: var(--panel-3);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 12.5px;
  font-weight: 700;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: var(--shadow);
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--teal); color: var(--teal); }

/* 响应式 */
/* 脚本取片 */
.srt-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  padding: 11px;
  margin-bottom: 12px;
}

.srt-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 9px;
}

.srt-box-head span { display: inline-flex; align-items: center; gap: 6px; }
.srt-box-head svg { width: 14px; height: 14px; color: var(--accent); }
.srt-box-head em {
  font-style: normal;
  font-size: 10.5px;
  color: var(--muted);
  background: var(--panel-3);
  padding: 2px 6px;
  border-radius: 5px;
  font-family: var(--mono);
  white-space: nowrap;
}

.srt-drop {
  border: 1px dashed #3a414c;
  border-radius: var(--radius);
  padding: 14px 10px;
  text-align: center;
  color: var(--muted);
  background: var(--panel);
  cursor: pointer;
  margin-bottom: 9px;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.srt-drop svg { width: 18px; height: 18px; color: var(--teal); margin-bottom: 4px; }
.srt-drop p { font-size: 11.5px; font-weight: 700; color: var(--text); }
.srt-drop span { font-size: 10.5px; color: var(--dim); }
.srt-drop:hover, .srt-drop.dragover { border-color: var(--teal); background: var(--teal-soft); }

.srt-box textarea {
  width: 100%;
  min-height: 74px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font-size: 11.5px;
  line-height: 1.6;
  padding: 9px 10px;
  outline: 0;
  font-family: var(--mono);
}

.srt-box textarea:focus { border-color: var(--accent); }
.srt-parse-btn { width: 100%; margin-top: 8px; }

.srt-controls {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: 9px;
}

.field.mini { flex: 0 0 96px; }
.field.mini span { font-size: 10px; }
.field.mini select { height: 32px; font-size: 12px; }

.srt-export { display: flex; gap: 6px; margin-bottom: 10px; }
.srt-export .btn { flex: 1 1 auto; padding: 0 6px; }

.srt-match-list { display: flex; flex-direction: column; gap: 7px; }

.srt-match-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 9px 10px;
}

.srt-match-head { display: flex; align-items: center; gap: 8px; }
.srt-match-idx {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--teal-soft);
  color: var(--teal);
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 800;
  flex: 0 0 auto;
  font-family: var(--mono);
}

.srt-match-times { flex: 1 1 auto; min-width: 0; }
.srt-match-times strong { display: block; font-size: 11px; font-family: var(--mono); white-space: nowrap; }
.srt-match-times small { font-size: 10px; color: var(--dim); font-family: var(--mono); }

.srt-match-actions { display: flex; gap: 5px; }
.srt-match-actions .icon-btn { width: 26px; height: 26px; }
.srt-match-actions .icon-btn svg { width: 13px; height: 13px; }

.srt-match-script { display: flex; flex-wrap: wrap; gap: 4px; margin: 7px 0 5px; }
.srt-match-script span {
  font-size: 10px;
  font-weight: 700;
  color: var(--teal);
  background: var(--teal-soft);
  border-radius: 4px;
  padding: 2px 6px;
}

.srt-match-text { font-size: 11px; color: var(--muted); line-height: 1.55; }

.mini-badge.script { background: var(--teal-soft); color: var(--teal); }

.tl-script {
  position: absolute;
  top: 0;
  bottom: 0;
  background: repeating-linear-gradient(135deg, rgba(45, 212, 191, 0.22) 0 5px, rgba(45, 212, 191, 0.08) 5px 10px);
  border-left: 1px solid var(--teal);
  border-right: 1px solid var(--teal);
  z-index: 2;
  pointer-events: none;
}

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 208px minmax(0, 1fr) 308px; }
  .top-actions .btn span { display: none; }
  .top-actions .btn { width: 34px; padding: 0; }
  .top-actions .btn svg { margin: 0; }
}

@media (max-width: 920px) {
  .app-shell { grid-template-columns: 1fr; min-height: 0; }
  .left-rail { border-right: 0; border-bottom: 1px solid var(--line); }
  .rail-tabs { display: flex; overflow-x: auto; }
  .rail-tabs { min-width: 0; width: 100%; }
  .rail-tab { flex: 0 0 84px; }
  .rail-content { max-height: 260px; overflow-y: auto; }
  .right-rail { border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  .center-col { height: auto; overflow: visible; }
  .issue-list { max-height: none; }
  .cuts-list { max-height: none; }
}

@media (max-width: 620px) {
  .topbar-inner { padding: 0 10px; gap: 10px; }
  .brand-name { display: none; }
  .project-name { max-width: 150px; }
  .project-name { flex: 1 1 auto; width: 100%; min-width: 0; max-width: none; }
  .saved-dot { display: none; }
  .center-col { padding: 10px; gap: 10px; }
  .player-toolbar { flex-direction: column; align-items: stretch; }
  .player-tools { justify-content: space-between; }
  .time-readout { min-width: 0; }
  .player-stage { aspect-ratio: 16 / 10; min-height: 0; }
  .transcript-head { flex-direction: column; align-items: stretch; }
  .transcript-controls { flex-direction: column; align-items: stretch; }
  .search-box { width: 100%; }
  .srt-controls { flex-direction: column; align-items: stretch; }
  .field.mini { flex: 1 1 auto; }
  .transcript-line { grid-template-columns: 58px 1fr; }
  .line-badges { grid-column: 1 / -1; justify-content: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-backdrop { padding: 10px; }
  .modal { max-height: calc(100vh - 20px); }
}
[hidden] { display: none !important; }
