/* 介面樣式：前半段沿用舊版編輯器（參考資料/影片工具包/editor_ui/style.css），後半段是網站新增的部分 */
/* ── Root Variables ────────────────────────────────────────────── */
:root {
  --bg:          #0d1117;
  --surface:     #161b22;
  --surface2:    #21262d;
  --surface3:    #2d333b;
  --border:      #30363d;
  --border2:     #3d444d;
  --text:        #e6edf3;
  --text-muted:  #8b949e;
  --text-dim:    #656d76;
  --accent:      #58a6ff;
  --accent-bg:   #1f4168;
  --green:       #3fb950;
  --green-bg:    #1a3a22;
  --amber:       #d29922;
  --amber-bg:    #3a2a0a;
  --red:         #f85149;
  --red-bg:      #3a1616;
  --luban:       #a78bfa;
  --luban-bg:    #2d1e4e;
  --haixing:     #34d399;
  --haixing-bg:  #1a3a2a;
  --haijing:     #fb923c;
  --haijing-bg:  #3a2016;
  --radius:      8px;
  --radius-lg:   12px;
  --shadow:      0 4px 16px rgba(0,0,0,0.4);
  --transition:  0.18s ease;
}

/* ── Reset ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: 'Noto Sans TC', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Scrollbar ─────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }

/* ── Top Bar ───────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px;
  background: rgba(13,17,23,0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  gap: 12px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.logo { font-size: 22px; }
.topbar-title h1 { font-size: 16px; font-weight: 700; line-height: 1.2; }
.topbar-subtitle { font-size: 11px; color: var(--text-muted); font-family: 'JetBrains Mono', monospace; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.stats-pill {
  background: var(--surface2); border: 1px solid var(--border);
  padding: 4px 12px; border-radius: 99px;
  font-size: 12px; color: var(--text-muted);
}

/* ── Buttons ───────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 16px; border-radius: var(--radius);
  border: 1px solid transparent; cursor: pointer;
  font-family: inherit; font-size: 13px; font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-save {
  background: var(--surface2); border-color: var(--border2);
  color: var(--text);
}
.btn-save:hover { background: var(--surface3); border-color: var(--accent); color: var(--accent); }
.btn-generate {
  background: linear-gradient(135deg, #238636, #2ea043);
  color: #fff; border-color: #2ea043;
}
.btn-generate:hover { background: linear-gradient(135deg, #2ea043, #3fb950); }
.btn-sm {
  padding: 4px 10px; font-size: 12px; border-radius: 6px;
}
.btn-icon {
  padding: 5px 8px; font-size: 14px;
  background: transparent; border-color: var(--border);
  color: var(--text-muted);
  border-radius: 6px;
}
.btn-icon:hover { background: var(--surface3); color: var(--text); }
.btn-danger { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-primary { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }
.btn-primary:hover { background: var(--accent); color: #fff; }
.btn-green { background: var(--green-bg); border-color: var(--green); color: var(--green); }
.btn-green:hover { background: var(--green); color: #fff; }
.btn-done {
  background: linear-gradient(135deg, #1a6b4a, #2ea06a);
  color: #fff; border-color: #2ea06a;
  font-weight: 700;
  box-shadow: 0 0 12px rgba(46,160,106,0.35);
}
.btn-done:hover { background: linear-gradient(135deg, #2ea06a, #3fb98a); box-shadow: 0 0 18px rgba(46,160,106,0.55); }
.batch-badge {
  background: var(--surface2); border: 1px solid var(--accent);
  color: var(--accent); padding: 4px 12px; border-radius: 99px;
  font-size: 12px; font-weight: 600; align-items: center; gap: 4px;
}

/* ── Filter Bar ─────────────────────────────────────────────────── */
.filter-bar {
  position: sticky; top: 53px; z-index: 90;
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 20px;
  background: rgba(22,27,34,0.95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  gap: 12px;
}
.filter-tabs { display: flex; gap: 4px; }
.filter-tab {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 14px; border-radius: 99px; border: 1px solid transparent;
  background: transparent; color: var(--text-muted);
  cursor: pointer; font-size: 12px; font-weight: 500; font-family: inherit;
  transition: var(--transition);
}
.filter-tab:hover { background: var(--surface2); color: var(--text); }
.filter-tab.active { background: var(--surface3); border-color: var(--border2); color: var(--text); }
.char-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.char-luban   { background: var(--luban); }
.char-haixing { background: var(--haixing); }
.char-haijing { background: var(--haijing); }
.search-wrap {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 5px 12px;
  color: var(--text-muted);
}
.search-input {
  background: transparent; border: none; outline: none;
  color: var(--text); font-family: inherit; font-size: 13px;
  width: 200px;
}

/* ── Main Content ────────────────────────────────────────────────── */
.main-content {
  max-width: 1100px; margin: 0 auto;
  padding: 20px 20px 100px;
  display: flex; flex-direction: column; gap: 16px;
}

/* ── Loading State ───────────────────────────────────────────────── */
.loading-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 300px; gap: 16px;
  color: var(--text-muted);
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Slide Group ─────────────────────────────────────────────────── */
.slide-group { display: flex; flex-direction: column; gap: 12px; }
.slide-group-header {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0 2px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text-dim);
}
.slide-group-header::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ── Entry Card ──────────────────────────────────────────────────── */
.entry-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition);
}
.entry-card:hover { border-color: var(--border2); }
.entry-card.hidden { display: none; }

.entry-header {
  display: flex; align-items: flex-start;
  padding: 12px 16px 10px;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.char-badge {
  padding: 3px 10px; border-radius: 99px;
  font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
  white-space: nowrap; flex-shrink: 0;
}
.badge-luban   { background: var(--luban-bg);   color: var(--luban);   border: 1px solid var(--luban); }
.badge-haixing { background: var(--haixing-bg); color: var(--haixing); border: 1px solid var(--haixing); }
.badge-haijing { background: var(--haijing-bg); color: var(--haijing); border: 1px solid var(--haijing); }

.entry-meta {
  flex: 1; min-width: 0;
}
.entry-original-text {
  font-size: 13px; color: var(--text-muted); line-height: 1.5;
  margin-bottom: 4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.entry-source-info {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.entry-source-audio-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px; color: var(--text-dim);
  max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.audio-mini-player {
  display: flex; align-items: center; gap: 6px;
}
.play-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--accent-bg); color: var(--accent);
  transition: var(--transition); flex-shrink: 0;
  font-size: 11px;
}
.play-btn:hover { background: var(--accent); color: #fff; }
.play-btn.playing { background: var(--amber-bg); color: var(--amber); }
.play-btn.playing:hover { background: var(--amber); color: #fff; }

/* ── Segments List ───────────────────────────────────────────────── */
.entry-body { padding: 12px 16px; display: flex; flex-direction: column; gap: 8px; }

.segment-row {
  display: flex; align-items: center;
  gap: 8px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 8px 10px;
  transition: border-color var(--transition);
  position: relative;
}
.segment-row:hover { border-color: var(--border2); }
.segment-row.dragging { opacity: 0.5; }
.segment-row.seg-too-long {
  border-color: var(--red) !important;
  background: rgba(248,81,73,0.07);
}
.segment-row.seg-too-long .seg-text-input { color: var(--red); }

.seg-index {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: var(--text-dim);
  min-width: 20px; text-align: right;
  flex-shrink: 0;
}
.seg-play-btn { flex-shrink: 0; }
.seg-text-wrap { flex: 1; min-width: 0; }
.seg-text-input {
  width: 100%; background: transparent; border: none; outline: none;
  font-family: 'Noto Sans TC', sans-serif; font-size: 14px;
  color: var(--text); line-height: 1.5;
  padding: 2px 4px; border-radius: 4px;
  transition: background var(--transition);
}
.seg-text-input:focus { background: var(--surface3); }
.seg-duration {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: var(--text-dim); flex-shrink: 0;
  min-width: 36px; text-align: right;
}
.seg-charcount {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; color: var(--text-dim); flex-shrink: 0;
  min-width: 44px; text-align: right;
  background: var(--surface3); border-radius: 4px;
  padding: 1px 5px;
}
.seg-charcount.over { color: var(--red); background: var(--red-bg); }
.seg-actions { display: flex; gap: 4px; flex-shrink: 0; }
.btn-seg-del { padding: 3px 6px; font-size: 12px; }
.btn-seg-merge { padding: 3px 6px; font-size: 12px; }

/* Drag handle */
.drag-handle {
  cursor: grab; color: var(--text-dim); font-size: 14px;
  flex-shrink: 0; padding: 0 2px;
  user-select: none;
}
.drag-handle:active { cursor: grabbing; }

/* ── Waveform Timeline ───────────────────────────────────────────── */
.cut-timeline-wrap {
  padding: 10px 14px 12px;
  background: var(--surface3);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.cut-timeline-label {
  font-size: 11px; color: var(--text-dim); margin-bottom: 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}

/* Outer wrapper: waveform + draggable markers overlaid */
.waveform-outer {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0a0f14;
  border: 1px solid var(--border);
  cursor: crosshair;
  user-select: none;
}
/* WaveSurfer renders a canvas inside here */
.waveform-outer canvas { display: block; }

/* Segment colour bar rendered BELOW the waveform */
.waveform-segs-bar {
  display: flex;
  height: 10px;
  width: 100%;
}
.waveform-seg-block {
  height: 100%;
  border-right: 1px solid rgba(0,0,0,0.4);
  transition: filter 0.15s;
  cursor: default;
}

/* Cut marker — vertical line overlaid on waveform */
.cut-marker {
  position: absolute;
  top: 0;
  /* stop above the coloured bar; bar is 10px so bottom = 10px */
  bottom: 10px;
  width: 2px;
  background: var(--accent);
  cursor: ew-resize;
  z-index: 20;
  transform: translateX(-50%);
  border-radius: 1px;
  box-shadow: 0 0 6px rgba(88,166,255,0.8);
}
.cut-marker::before {
  content: '✂';
  position: absolute; top: 4px; left: 50%;
  transform: translateX(-50%);
  font-size: 12px; color: var(--accent);
  text-shadow: 0 1px 3px #000;
  pointer-events: none;
  white-space: nowrap;
}
.cut-marker:hover {
  background: #ffffff;
  box-shadow: 0 0 10px rgba(255,255,255,0.9);
}
.cut-marker:hover::before { color: #fff; }

/* Silence candidate markers (grey, shown after 偵測靜音) */
.silence-candidate {
  position: absolute;
  top: 0; bottom: 10px;
  width: 2px;
  background: rgba(139,148,158,0.5);
  cursor: pointer; z-index: 15;
  transform: translateX(-50%);
  border-radius: 1px;
  transition: background 0.15s, box-shadow 0.15s;
}
.silence-candidate::before {
  content: '+';
  position: absolute; top: 4px; left: 50%;
  transform: translateX(-50%);
  font-size: 14px; font-weight: 700;
  color: rgba(139,148,158,0.8);
  text-shadow: 0 1px 3px #000;
  pointer-events: none;
}
.silence-candidate:hover {
  background: var(--green);
  box-shadow: 0 0 8px rgba(63,185,80,0.7);
}
.silence-candidate:hover::before { color: var(--green); }

/* Snap row below waveform */
.cut-actions-row {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-top: 8px; align-items: center;
}
.cut-btn-snap {
  padding: 3px 9px; font-size: 11px; color: var(--text-muted);
  border-radius: 4px; border: 1px solid var(--border);
  background: transparent; cursor: pointer; font-family: inherit;
  transition: var(--transition);
}
.cut-btn-snap:hover { background: var(--surface2); color: var(--accent); border-color: var(--accent); }

/* ── Add Segment / Actions ───────────────────────────────────────── */
.entry-footer {
  padding: 8px 16px 12px;
  display: flex; gap: 8px; align-items: center;
  border-top: 1px solid var(--border);
}
.entry-footer-note { font-size: 11px; color: var(--text-dim); flex: 1; }

/* ── Toast ───────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--surface3); border: 1px solid var(--border2);
  color: var(--text); padding: 10px 20px; border-radius: 99px;
  font-size: 13px; box-shadow: var(--shadow);
  opacity: 0; transition: all 0.25s ease; pointer-events: none;
  z-index: 999; white-space: nowrap;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error   { border-color: var(--red);   color: var(--red); }

/* ── Modal ───────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; backdrop-filter: blur(4px);
}
.modal {
  background: var(--surface); border: 1px solid var(--border2);
  border-radius: var(--radius-lg); padding: 24px;
  width: 640px; max-width: 95vw;
  box-shadow: var(--shadow);
}
.modal h3 { font-size: 16px; margin-bottom: 16px; }
.modal-log {
  background: var(--surface3); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  white-space: pre-wrap; min-height: 120px; max-height: 300px;
  overflow-y: auto; color: var(--text-muted); margin-bottom: 16px;
}

/* ── Segment drag-over indicator ─────────────────────────────────── */
.drop-zone {
  height: 4px; border-radius: 2px; background: transparent;
  transition: background var(--transition), height var(--transition);
  margin: 2px 0;
}
.drop-zone.active { height: 28px; background: var(--accent-bg); border: 1px dashed var(--accent); border-radius: var(--radius); }

/* ══════════════════════════════════════════════════════════════════
   以下為網站新增
   ══════════════════════════════════════════════════════════════════ */
:root {
  --naqi:    #38bdf8;  --naqi-bg: #10324a;
  --nayi:    #f472b6;  --nayi-bg: #4a1835;
}
.char-naqi { background: var(--naqi); }
.char-nayi { background: var(--nayi); }
.char-other { background: var(--text-dim); }
.badge-naqi  { background: var(--naqi-bg); color: var(--naqi); border: 1px solid var(--naqi); }
.badge-nayi  { background: var(--nayi-bg); color: var(--nayi); border: 1px solid var(--nayi); }
.badge-other { background: var(--surface3); color: var(--text-muted); border: 1px solid var(--border2); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); font-size: 12px; }
.mono { font-family: 'JetBrains Mono', monospace; }
.right { text-align: right; }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.topbar a.btn { text-decoration: none; }
.topbar .user-email { font-size: 12px; color: var(--text-muted); }
.inline-form { display: inline; }

/* ── 一般頁面 ── */
.page { max-width: 1000px; margin: 0 auto; padding: 24px 20px 100px; display: flex; flex-direction: column; gap: 18px; }
.page h1 { font-size: 20px; }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 18px 20px;
}
.card h2 { font-size: 15px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card h2 .step {
  display: inline-flex; width: 22px; height: 22px; border-radius: 50%;
  align-items: center; justify-content: center; font-size: 12px;
  background: var(--accent-bg); color: var(--accent);
}
.card.disabled { opacity: 0.55; }
.balance-pill { background: var(--green-bg); border: 1px solid var(--green); color: var(--green);
  padding: 4px 12px; border-radius: 99px; font-size: 12px; font-weight: 600; }
.balance-pill.zero { background: var(--red-bg); border-color: var(--red); color: var(--red); }

input[type=text], input[type=email], input[type=number], textarea, select {
  background: var(--surface2); border: 1px solid var(--border2); color: var(--text);
  border-radius: var(--radius); padding: 7px 10px; font-family: inherit; font-size: 13px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }

table.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 500; color: var(--text-muted); font-size: 12px;
  padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr.inactive td { opacity: 0.5; }

.status { padding: 2px 9px; border-radius: 99px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.st-new        { background: var(--surface3); color: var(--text-muted); }
.st-processing { background: var(--amber-bg); color: var(--amber); }
.st-ready      { background: var(--accent-bg); color: var(--accent); }
.st-error      { background: var(--red-bg); color: var(--red); }
.st-done       { background: var(--green-bg); color: var(--green); }

.empty { text-align: center; padding: 40px 0; color: var(--text-muted); }

/* ── 登入 ── */
.center-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 380px; max-width: 100%; text-align: center; display: flex; flex-direction: column; gap: 16px; }
.login-card .logo { font-size: 40px; }
.btn-google { justify-content: center; background: #fff; color: #1f1f1f; border-color: #dadce0; font-weight: 600; padding: 10px 16px; }
.btn-google:hover { background: #f1f3f4; }
.notice { background: var(--amber-bg); border: 1px solid var(--amber); color: var(--amber);
  border-radius: var(--radius); padding: 10px 14px; font-size: 13px; text-align: left; }
.notice.error { background: var(--red-bg); border-color: var(--red); color: var(--red); }
.notice.info { background: var(--accent-bg); border-color: var(--accent); color: var(--accent); }

/* ── 上傳 ── */
.upload-zone {
  border: 2px dashed var(--border2); border-radius: var(--radius-lg);
  padding: 26px; text-align: center; color: var(--text-muted);
  transition: var(--transition); cursor: pointer;
}
.upload-zone.drag { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); }
.upload-zone strong { color: var(--text); font-size: 15px; display: block; margin-bottom: 4px; }
.file-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-top: 14px; }
.file-group { background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.file-group h3 { font-size: 13px; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.file-group ul { list-style: none; font-size: 12px; max-height: 180px; overflow-y: auto; }
.file-group li { display: flex; align-items: center; gap: 6px; padding: 2px 0; color: var(--text-muted); }
.file-group li .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-group .x { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 12px; }
.file-group .x:hover { color: var(--red); }
.file-group.missing { border-color: var(--amber); }
.progress { height: 8px; background: var(--surface3); border-radius: 99px; overflow: hidden; }
.progress .bar { height: 100%; width: 0; background: var(--accent); transition: width 0.3s ease; }
.progress.indeterminate .bar { width: 30%; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }
.upload-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; font-size: 12px; }
.upload-item { display: grid; grid-template-columns: 1fr 160px 70px; gap: 10px; align-items: center; }
.upload-item .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-muted); }
.warn-list { list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 12px; max-height: 260px; overflow-y: auto; }
.warn-list li { padding: 6px 10px; background: var(--amber-bg); color: var(--amber); border-radius: 6px; }
.job-box { display: flex; flex-direction: column; gap: 8px; }
.job-log { background: var(--surface3); border-radius: var(--radius); padding: 8px 12px; font-size: 11px;
  font-family: 'JetBrains Mono', monospace; color: var(--text-dim); white-space: pre-wrap; max-height: 160px; overflow-y: auto; }

/* ── 編輯器新增 ── */
.audio-select { max-width: 360px; font-size: 12px; padding: 3px 6px; }
.score-pill { font-size: 10px; padding: 1px 6px; border-radius: 99px; background: var(--surface3); color: var(--text-dim); }
.score-pill.low { background: var(--amber-bg); color: var(--amber); }
.silence-region {
  position: absolute; top: 0; bottom: 10px; z-index: 10;
  background: rgba(63,185,80,0.13); border-left: 1px dashed rgba(63,185,80,0.5);
  border-right: 1px dashed rgba(63,185,80,0.5); cursor: copy;
}
.silence-region:hover { background: rgba(63,185,80,0.28); }
.save-state { font-size: 11px; color: var(--text-dim); min-width: 90px; text-align: right; }
.save-state.dirty { color: var(--amber); }
.save-state.error { color: var(--red); }
.entry-warn { font-size: 11px; color: var(--amber); }
.banner { max-width: 1100px; margin: 12px auto 0; padding: 0 20px; }
.playhead { position: absolute; top: 0; bottom: 10px; width: 1px; background: #fff; z-index: 25; pointer-events: none; }
/* 切點的可拖曳範圍加寬到 14px（畫出來的線還是 2px，舊版只有 2px 很難抓） */
.cut-marker { width: 14px; background: transparent !important; box-shadow: none !important; }
.cut-marker::after { content: ''; position: absolute; top: 0; bottom: 0; left: 6px; width: 2px; border-radius: 1px;
  background: var(--accent); box-shadow: 0 0 6px rgba(88,166,255,0.8); pointer-events: none; }
.cut-marker:hover::after { background: #fff; box-shadow: 0 0 10px rgba(255,255,255,0.9); }
/* 首頁的收費方式 */
.rules { list-style: none; display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: var(--text-muted); }
.rules li { padding-left: 16px; position: relative; line-height: 1.6; }
.rules li::before { content: '•'; position: absolute; left: 2px; color: var(--accent); }
.rules li.promo::before { content: ''; }
.rules li.promo { padding-left: 0; color: var(--amber); }
.rules strong { color: var(--text); }
/* 窄螢幕：上方列可以換行，餘額不要被擠成直排 */
.balance-pill, .stats-pill, .topbar .btn { white-space: nowrap; }
.topbar { flex-wrap: wrap; }
.topbar-right { flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 640px) {
  .topbar { padding: 8px 12px; }
  .topbar-subtitle { display: none; }
  .topbar-right { gap: 6px; }
  .page { padding: 16px 12px 80px; }
  .card { padding: 14px; }
}
