:root {
  --bg: #f6f2eb;
  --bg-glow: radial-gradient(920px 420px at 14% -8%, rgba(196, 152, 102, 0.14), transparent 64%),
             radial-gradient(760px 380px at 90% 4%, rgba(166, 117, 70, 0.09), transparent 60%);
  --surface: #fffdfa;
  --surface-soft: #f3eee5;
  --surface-hover: #ebe4d8;
  --border: rgba(132, 106, 76, 0.15);
  --border-strong: rgba(132, 106, 76, 0.28);
  --text: #191613;
  --text-muted: #6f6559;
  --accent: #a47142;
  --accent-hover: #8a5b32;
  --accent-soft: rgba(164, 113, 66, 0.11);
  --ink-btn: #1c1916;
  --ink-btn-hover: #2f2924;
  --ink-btn-text: #fdfaf5;
  --gold-grad: linear-gradient(135deg, #ba8856 0%, #98663a 55%, #7e502a 100%);
  --shadow: 0 12px 34px rgba(45, 34, 22, 0.055), 0 1px 2px rgba(45, 34, 22, 0.03);
  --radius: 20px;
  --stage-bg: #141210;
}

[data-theme="dark"] {
  --bg: #0e0d0c;
  --bg-glow: radial-gradient(880px 400px at 15% -10%, rgba(212, 165, 116, 0.12), transparent 62%),
             radial-gradient(720px 360px at 88% 6%, rgba(176, 125, 79, 0.08), transparent 58%);
  --surface: #161412;
  --surface-soft: #1f1c19;
  --surface-hover: #282420;
  --border: rgba(214, 175, 130, 0.14);
  --border-strong: rgba(214, 175, 130, 0.28);
  --text: #f5f0e8;
  --text-muted: #a39889;
  --accent: #d4a370;
  --accent-hover: #e1b586;
  --accent-soft: rgba(212, 163, 112, 0.14);
  --ink-btn: #d4a370;
  --ink-btn-hover: #e2b687;
  --ink-btn-text: #171310;
  --gold-grad: linear-gradient(135deg, #ddb07f 0%, #b98552 55%, #9a693d 100%);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
  --stage-bg: #080706;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg);
  background-image: var(--bg-glow);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

.hidden { display: none !important; }

/* 顶部栏：高定画廊通透玻璃 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 13px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { display: flex; align-items: center; gap: 14px; }

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--gold-grad);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 6px 16px rgba(164, 113, 66, 0.28);
}

.brand-mark svg { width: 22px; height: 22px; }
.brand-logo-img {
  width: 50px;
  height: 50px;
  border-radius: 0;
  object-fit: contain;
  flex-shrink: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  filter: drop-shadow(0 5px 12px rgba(142, 96, 50, 0.28));
}
.brand-logo-img.lg {
  width: 92px;
  height: 92px;
  border-radius: 0;
  margin-bottom: 14px;
  background: transparent;
  border: none;
  box-shadow: none;
  filter: drop-shadow(0 10px 24px rgba(142, 96, 50, 0.34));
}
.brand-title-row {
  display: flex;
  align-items: baseline;
  gap: 9px;
}
.brand-title {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text);
}
.brand-en {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--accent);
  text-transform: uppercase;
  padding-left: 9px;
  border-left: 1px solid var(--border-strong);
}
.brand-sub { margin: 2px 0 0; font-size: 12px; color: var(--text-muted); letter-spacing: 0.02em; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.16s ease;
}
.icon-btn:hover { background: var(--surface-soft); border-color: var(--border-strong); }
.icon-btn svg { width: 15px; height: 15px; color: var(--accent); }

/* 主工作台 */
.workspace {
  max-width: 1280px;
  margin: 0 auto;
  padding: 26px 26px 56px;
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(330px, 0.78fr);
  gap: 26px;
  align-items: start;
}

.editor-col { display: flex; flex-direction: column; gap: 22px; }
.preview-sticky { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 20px; }

/* 高定画廊卡片 */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 25px 26px;
  box-shadow: var(--shadow);
}

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

.card-head.compact { align-items: center; margin-bottom: 12px; }
.head-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.step-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.card-title { margin: 0; font-size: 17.5px; font-weight: 700; letter-spacing: 0.01em; }
.card-title.sm { font-size: 15px; }

.muted-pill {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface-soft);
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

/* 拖拽与上传 */
.drop-zone {
  border: 1.5px dashed var(--border-strong);
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 22px 18px;
  text-align: center;
  transition: border-color 0.18s, background 0.18s;
}
.drop-zone.drag-over { border-color: var(--accent); background: var(--accent-soft); }
.drop-zone.paste-target-active { border-color: color-mix(in srgb, var(--accent) 55%, var(--border-strong)); }
.drop-zone:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.drop-zone-icon {
  width: 38px; height: 38px; border-radius: 11px; background: var(--surface); color: var(--accent);
  display: inline-grid; place-items: center; margin-bottom: 9px; border: 1px solid var(--border);
}
.drop-zone-icon svg { width: 19px; height: 19px; }
.drop-title { margin: 0; font-size: 14.5px; font-weight: 600; }
.drop-hint { margin: 4px 0 15px; font-size: 12.5px; color: var(--text-muted); }
.source-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 11px; padding: 10px 16px; font-size: 13.5px; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform 0.12s, background 0.16s, border-color 0.16s, opacity 0.16s;
  font-family: inherit;
}
.btn:active:not(:disabled) { transform: scale(0.985); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--ink-btn); color: var(--ink-btn-text); }
.btn-primary:hover:not(:disabled) { background: var(--ink-btn-hover); transform: translateY(-1px); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { background: var(--surface-hover); border-color: var(--accent); }
.btn-soft { background: var(--accent-soft); color: var(--accent); border-color: rgba(164, 113, 66, 0.16); }
.btn-soft:hover:not(:disabled) { background: color-mix(in srgb, var(--accent-soft) 165%, transparent); }
.btn-xs { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }

.text-btn { background: none; border: none; color: var(--text-muted); font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 4px 6px; }
.text-btn:hover { color: var(--accent); }

/* 上传实时进度条 */
.upload-progress-box {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
}
.upload-bar {
  margin-top: 8px;
  height: 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--border-strong) 70%, transparent);
  overflow: hidden;
}
.upload-bar-fill {
  height: 100%;
  background: var(--gold-grad);
  border-radius: 999px;
  transition: width 0.2s ease;
}

/* 顶部极简素材条 */
.clip-strip {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.clip-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px 7px 7px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  max-width: 100%;
}

.clip-pill-thumb {
  width: 38px;
  height: 48px;
  border-radius: 7px;
  object-fit: cover;
  background: #14161a;
  flex-shrink: 0;
}
.clip-pill-thumb.land { width: 56px; height: 38px; }

.clip-pill-info { min-width: 0; }
.clip-pill-name {
  font-size: 13px;
  font-weight: 600;
  max-width: 190px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.clip-pill-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 2px; font-size: 11.5px; color: var(--text-muted); }

.brief-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.mt-md { margin-top: 12px; }
.tiny-label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }

.analyze-cta-bar {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.btn-analyze {
  padding: 11px 22px;
  font-size: 14px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(28, 25, 22, 0.16);
}

/* 口播试听预览条 */
.voice-preview-bar {
  margin-bottom: 14px;
  padding: 13px 15px;
  border-radius: 14px;
  background: var(--surface-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--border));
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.voice-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.voice-preview-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  margin-right: 8px;
}
.voice-select-row { display: flex; align-items: center; gap: 8px; }
.voice-select-row select { flex: 1; min-width: 0; }
.voice-select-row button { white-space: nowrap; flex-shrink: 0; padding: 9px 11px; }
.voice-preview-audio {
  width: 100%;
  height: 38px;
  outline: none;
}

/* 第 2 步：对口字幕初稿清单 */
.facts-banner {
  margin-bottom: 14px;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 26%, transparent);
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.55;
}

.draft-empty {
  padding: 22px 16px;
  border-radius: 13px;
  background: var(--surface-soft);
  border: 1px dashed var(--border-strong);
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.65;
}

.draft-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.draft-row {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 12px;
  border-radius: 13px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  align-items: center;
}

.draft-thumb-box {
  position: relative;
  width: 74px;
  aspect-ratio: 3 / 4;
  border-radius: 9px;
  overflow: hidden;
  background: #14161a;
}
.draft-thumb-box.land { aspect-ratio: 16 / 10; }
.draft-thumb-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.draft-time-badge {
  position: absolute; left: 4px; right: 4px; bottom: 4px;
  text-align: center; font-size: 10px; font-weight: 700; color: #fff;
  background: rgba(15, 16, 20, 0.78); border-radius: 5px; padding: 1px 3px;
}

.draft-content { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.draft-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.draft-scene-select {
  width: auto !important;
  padding: 4px 9px !important;
  font-size: 12px !important;
  font-weight: 600;
  border-radius: 8px !important;
  background: var(--surface) !important;
}
.draft-caption-input {
  padding: 8px 11px !important;
  font-size: 13.5px !important;
  border-radius: 9px !important;
  background: var(--surface) !important;
}

/* 分镜素材列表（横向高信息密度卡片） */
.clip-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.clip-list.empty { display: block; }
.empty-clips-hint { font-size: 12.5px; color: var(--text-muted); text-align: center; padding: 10px 0 4px; }

.clip-item {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-soft);
  padding: 12px;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.clip-thumb-wrap {
  position: relative;
  width: 112px;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  background: #14161a;
  overflow: hidden;
  border: 1px solid var(--border);
}
.clip-thumb-wrap.is-landscape {
  aspect-ratio: 16 / 10;
}

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

.clip-order {
  position: absolute; top: 6px; left: 6px; width: 21px; height: 21px;
  border-radius: 999px; background: rgba(15, 16, 20, 0.82); color: #fff;
  font-size: 11px; font-weight: 700; display: grid; place-items: center;
}

.clip-dur {
  position: absolute; right: 6px; bottom: 6px; padding: 2px 6px;
  border-radius: 6px; background: rgba(15, 16, 20, 0.8); color: #fff;
  font-size: 10.5px; font-weight: 600;
}

.clip-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.clip-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.clip-title-group {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex-wrap: wrap;
}

.clip-name {
  font-size: 13.5px;
  font-weight: 700;
  max-width: 240px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.orient-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.orient-pill.portrait { color: #059669; border-color: rgba(5, 150, 105, 0.3); }
.orient-pill.landscape { color: #2563eb; border-color: rgba(37, 99, 235, 0.3); }

.source-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.clip-ops { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

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

.clip-scene-select {
  padding: 7px 10px !important;
  font-size: 12.5px !important;
  border-radius: 9px !important;
  background: var(--surface) !important;
}

.clip-caption-input {
  padding: 7px 11px !important;
  font-size: 13px !important;
  border-radius: 9px !important;
  background: var(--surface) !important;
}

.mini-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}
.mini-btn:hover:not(:disabled) { background: var(--surface-hover); }
.mini-btn.accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: var(--accent-soft); }
.mini-btn.danger:hover { color: #dc2626; border-color: rgba(220, 38, 38, 0.35); }

.card-footer-row {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.footer-right-ops { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 开关 */
.switch-row { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-slider {
  width: 36px; height: 21px; border-radius: 999px; background: var(--border-strong);
  position: relative; flex-shrink: 0; transition: background 0.18s;
}
.switch-slider::after {
  content: ""; position: absolute; top: 2.5px; left: 2.5px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; transition: transform 0.18s; box-shadow: 0 1px 3px rgba(0,0,0,0.22);
}
.switch-row input:checked + .switch-slider { background: var(--accent); }
.switch-row input:checked + .switch-slider::after { transform: translateX(15px); }
.switch-text { font-size: 13px; color: var(--text-muted); }
.switch-text.strong { color: var(--text); font-weight: 600; }

/* 表单 */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid.voice-wide { grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr); }
.sub-children { transition: opacity 0.18s ease; }
.sub-children.disabled-group { opacity: 0.42; pointer-events: none; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--text-muted); }
.label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tiny-meta { font-size: 12px; color: var(--text-muted); }

input[type="text"], select, textarea {
  width: 100%; border: 1px solid var(--border-strong); background: var(--surface-soft);
  color: var(--text); border-radius: 11px; padding: 10px 13px; font-size: 13.5px;
  font-family: inherit; outline: none; transition: border-color 0.16s, background 0.16s;
}
input[type="text"]:focus, select:focus, textarea:focus { border-color: var(--accent); background: var(--surface); }
textarea { resize: vertical; min-height: 84px; line-height: 1.6; }
input[type="range"] { width: 100%; accent-color: var(--accent); margin-top: 6px; }

/* 参考截图区 */
.ref-box {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 13px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}
.ref-box-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ref-ops { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.ref-paste-zone {
  margin-top: 10px;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1.5px dashed var(--border-strong);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 12.5px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s, color 0.16s, box-shadow 0.16s;
}
.ref-paste-zone:hover,
.ref-paste-zone.drag-over,
.ref-paste-zone.paste-target-active,
.ref-paste-zone:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}
.dirty-pill {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 9px;
  border-radius: 999px;
}
.regen-box {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 13px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}
.regen-head { margin-bottom: 8px; }
.regen-row { display: flex; align-items: center; gap: 8px; }
.regen-row input { flex: 1; background: var(--surface); padding: 9px 12px; font-size: 13px; }
.regen-btn { white-space: nowrap; padding: 9px 14px; }
.media-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
}
.media-badge.img { color: #7c3aed; border-color: rgba(124, 58, 237, 0.32); }
.clip-pill-ops { display: flex; align-items: center; gap: 4px; margin-left: 2px; }
.img-dur-select,
.clip-mode-select,
.clip-trans-select {
  width: auto !important;
  max-width: 128px;
  padding: 2px 6px !important;
  font-size: 11px !important;
  font-weight: 600;
  border-radius: 7px !important;
  background: var(--surface) !important;
  border: 1px solid var(--border-strong) !important;
  color: var(--text) !important;
  cursor: pointer;
}
.clip-mode-select.auto-cut,
.clip-trans-select.custom-set {
  border-color: rgba(164, 113, 66, 0.55) !important;
  color: var(--accent) !important;
  background: var(--accent-soft) !important;
}
.pack-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 13px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}
.pack-bar-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.pack-bar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.chip.my-tpl {
  border-color: rgba(164, 113, 66, 0.45);
  color: var(--accent);
}
.chip.my-tpl.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.template-save-btn {
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.16s ease;
}
.template-save-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.template-clear-btn {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
}
.template-clear-btn:hover {
  color: var(--danger, #dc2626);
  background: rgba(220, 38, 38, 0.08);
}
.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text);
  white-space: nowrap;
}
.preview-ver-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  margin-bottom: 10px;
  border-radius: 11px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}
.ver-tab {
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.16s ease;
}
.ver-tab.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.result-actions.has-clean #btnCopyScript {
  grid-column: 1 / -1;
}
@media (max-width: 640px) {
  .regen-row { flex-direction: column; align-items: stretch; }
}
.ref-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text); }
.ref-gallery {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.ref-img-card {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 9px;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  cursor: pointer;
}
.ref-img-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-doc-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  font-size: 12.5px;
  font-weight: 500;
  max-width: 240px;
}
.ref-doc-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ref-doc-del {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
.ref-doc-del:hover { color: #dc2626; }

.ref-img-del {
  position: absolute; top: 3px; right: 3px; width: 18px; height: 18px;
  border-radius: 50%; border: none; background: rgba(0,0,0,0.68); color: #fff;
  font-size: 11px; cursor: pointer; line-height: 18px; padding: 0;
}

.segmented { display: inline-flex; background: var(--surface-soft); padding: 3px; border-radius: 11px; border: 1px solid var(--border); }
.seg-btn { border: none; background: transparent; color: var(--text-muted); font-size: 12.5px; font-weight: 600; padding: 6px 13px; border-radius: 8px; cursor: pointer; font-family: inherit; }
.seg-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 2px 6px rgba(0,0,0,0.08); }

.script-toolbar { margin: 14px 0 12px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.chip-group { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  font-size: 12px; font-weight: 600; padding: 5px 11px; border-radius: 999px;
  cursor: pointer; font-family: inherit; transition: all 0.14s;
}
.chip.active { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }

.sub-panel { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.audio-upload-box {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 15px; border-radius: 13px; background: var(--surface-soft); border: 1px solid var(--border);
}
.audio-title { margin: 0; font-size: 14px; font-weight: 600; }
.audio-sub { margin: 3px 0 0; font-size: 12px; color: var(--text-muted); }

/* 第3步选项 */
.options-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.option-block {
  padding: 15px; border-radius: 14px; background: var(--surface-soft);
  border: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px;
}
.option-heading { font-size: 13.5px; font-weight: 700; color: var(--text); }
.mt-sm { margin-top: 2px; }
.toggle-stack { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }

.sticker-bar {
  margin-top: 4px; padding-top: 10px; border-top: 1px dashed var(--border-strong);
  display: flex; flex-direction: column; gap: 8px;
}
.sticker-info { display: flex; align-items: center; gap: 8px; }
.sticker-thumb { width: 30px; height: 30px; border-radius: 6px; object-fit: contain; background: var(--surface); border: 1px solid var(--border); }
.sticker-ops { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.mini-select { width: auto !important; padding: 5px 9px !important; font-size: 12px !important; border-radius: 8px !important; }
.custom-bgm-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

/* 右侧预览 */
.preview-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.phone-stage {
  position: relative; width: 100%; max-width: 295px; margin: 0 auto; aspect-ratio: 9 / 16;
  border-radius: 24px; background: var(--stage-bg); overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, var(--border-strong));
  box-shadow: 0 18px 42px rgba(24, 18, 12, 0.16);
  display: flex; align-items: center; justify-content: center;
  transition: aspect-ratio 0.25s ease, max-width 0.25s ease;
}
.phone-stage.landscape-stage {
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
}

.stage-empty, .stage-loading { padding: 26px 20px; text-align: center; color: #e8e2d9; }
.stage-ring {
  width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 999px;
  background: rgba(212, 163, 112, 0.12); border: 1px solid rgba(212, 163, 112, 0.32);
  display: grid; place-items: center; color: #dfb182;
}
.stage-ring svg { width: 22px; height: 22px; }
.stage-title { margin: 0; font-size: 14px; font-weight: 600; color: #f7f3ec; }
.stage-desc { margin: 6px 0 0; font-size: 12px; color: #a89f93; line-height: 1.55; }
.progress-pct { font-size: 28px; font-weight: 700; color: #dfb182; }
.progress-bar { width: 185px; height: 6px; margin: 12px auto 0; border-radius: 999px; background: rgba(255,255,255,0.14); overflow: hidden; }
.progress-fill { height: 100%; background: var(--gold-grad); border-radius: 999px; transition: width 0.3s ease; }
.result-video { width: 100%; height: 100%; object-fit: contain; background: #000; }

.primary-cta-wrap { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.btn-render {
  width: 100%; padding: 13.5px 18px; font-size: 15px; border-radius: 13px;
  background: var(--gold-grad); color: #fffdf9; letter-spacing: 0.02em;
  box-shadow: 0 10px 26px rgba(154, 105, 61, 0.28);
}
.btn-render:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 历史记录 */
.history-list { display: flex; flex-direction: column; gap: 10px; max-height: 290px; overflow-y: auto; }
.empty-history { font-size: 12.5px; color: var(--text-muted); text-align: center; padding: 16px 8px; }
.history-item {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center;
  gap: 11px; padding: 8px; border-radius: 12px; background: var(--surface-soft);
  border: 1px solid var(--border); cursor: pointer;
}
.history-item:hover { border-color: var(--accent); }
.history-cover { width: 44px; height: 60px; border-radius: 8px; object-fit: cover; background: #14161a; }
.history-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-meta { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.history-ops { display: flex; gap: 5px; }

/* 弹窗 */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(10, 12, 16, 0.56);
  backdrop-filter: blur(6px); display: grid; place-items: center; padding: 16px;
}
.modal-sheet {
  width: min(720px, 100%); max-height: min(82vh, 680px); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 20px; display: flex;
  flex-direction: column; overflow: hidden; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
}
.modal-head { padding: 18px 20px 14px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-title { margin: 0; font-size: 16.5px; font-weight: 700; }
.modal-sub { margin: 3px 0 0; font-size: 12.5px; color: var(--text-muted); }
.icon-close { border: 1px solid var(--border); background: var(--surface-soft); color: var(--text); width: 32px; height: 32px; border-radius: 999px; cursor: pointer; }
.modal-quick { padding: 12px 20px 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.quick-folder-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-pill { border: 1px solid var(--border); background: var(--surface-soft); color: var(--text); font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; cursor: pointer; }
.quick-pill:hover { border-color: var(--accent); color: var(--accent); }
.path-bar { padding: 12px 20px; display: flex; gap: 8px; border-bottom: 1px solid var(--border); }
.path-bar input { padding: 7px 11px; font-size: 13px; }
.local-browser-body { flex: 1; overflow-y: auto; padding: 12px 20px; display: flex; flex-direction: column; gap: 6px; min-height: 240px; }
.browser-loading, .browser-empty { text-align: center; color: var(--text-muted); font-size: 13px; padding: 40px 12px; }
.browser-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 11px; border: 1px solid transparent; background: var(--surface-soft); cursor: pointer; }
.browser-row:hover { border-color: var(--border-strong); background: var(--surface-hover); }
.browser-row.selected { border-color: var(--accent); background: var(--accent-soft); }
.browser-row-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.browser-row-name { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.browser-row-meta { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-foot-left { display: flex; align-items: center; gap: 10px; }

.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 90;
  background: #18181b; color: #fff; padding: 11px 18px; border-radius: 14px;
  font-size: 13.5px; font-weight: 500; box-shadow: 0 12px 30px rgba(0,0,0,0.25);
  max-width: min(520px, calc(100vw - 32px)); text-align: center;
  max-height: 110px; overflow: hidden; text-overflow: ellipsis;
}
[data-theme="dark"] .toast { background: #f4f4f5; color: #18181b; }

.admin-entry-btn {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.admin-entry-btn:hover {
  background: color-mix(in srgb, var(--accent-soft) 160%, transparent);
  border-color: var(--accent);
}
.mini-scope-switch {
  display: inline-flex;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 2px;
  gap: 2px;
}
.scope-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  padding: 3px 8px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
}
.scope-btn.active {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.history-title-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.history-title-line .history-title {
  min-width: 0;
  flex: 1;
}
.owner-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}
.admin-modal-sheet {
  width: min(780px, 100%);
  max-height: min(84vh, 740px);
}
.admin-tabs-bar {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.admin-pane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 14px 20px 18px;
  gap: 12px;
  overflow: hidden;
}
.admin-create-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.admin-create-form input {
  padding: 9px 12px;
  font-size: 13.5px;
}
.admin-create-form button {
  padding: 10px 16px;
  white-space: nowrap;
}
.admin-list {
  flex: 1;
  min-height: 220px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding-right: 2px;
}
.admin-account-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 13px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}
.admin-account-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.admin-account-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-account-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
}
.role-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
}
.role-pill.primary,
.role-pill.admin {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
  color: var(--accent);
}
.admin-account-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
}
.online-status.on { color: #059669; font-weight: 600; }
[data-theme="dark"] .online-status.on { color: #34d399; }
.online-status.off { color: var(--text-muted); }
.admin-account-ops {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.admin-works-filter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.mobile-only-text,
.advanced-toggle-btn,
.mobile-dock {
  display: none;
}

@media (max-width: 920px) {
  html, body {
    background-attachment: scroll;
    -webkit-tap-highlight-color: transparent;
  }
  .topbar-inner { padding: 10px 14px; gap: 8px; }
  .brand { gap: 9px; min-width: 0; }
  .brand-sub, .brand-en { display: none; }
  .brand-logo-img { width: 38px; height: 38px; }
  .brand-title { font-size: 18px; white-space: nowrap; }
  .topbar-actions { gap: 6px !important; flex-shrink: 0; }
  .icon-btn { padding: 6px 10px; font-size: 12px; gap: 4px; white-space: nowrap; }
  .user-badge {
    max-width: 92px;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 5px 8px;
    font-size: 11.5px;
  }

  .desktop-only-text,
  .desktop-only-btn,
  .desktop-only-hint { display: none !important; }
  .mobile-only-text { display: block; }

  .workspace {
    grid-template-columns: 1fr;
    padding: 14px 12px calc(98px + env(safe-area-inset-bottom));
    gap: 14px;
  }
  .editor-col { gap: 14px; }
  .preview-sticky { position: static; gap: 14px; }
  .card { padding: 16px 14px; border-radius: 16px; }
  .card-head { margin-bottom: 13px; gap: 8px; flex-wrap: wrap; }
  .card-title { font-size: 16.5px; }
  .segmented { flex-shrink: 0; }
  .seg-btn { white-space: nowrap; padding: 6px 11px; font-size: 12.5px; }

  /* 防止 iPhone 点击输入框或下拉框时页面自动放大 */
  input[type="text"],
  input[type="password"],
  select,
  textarea {
    font-size: 16px;
    padding: 11px 12px;
  }
  #draftScriptBox { font-size: 16px !important; line-height: 1.68 !important; }

  .drop-zone { padding: 18px 14px; }
  .drop-hint { font-size: 12px; margin-bottom: 13px; }
  .form-grid, .form-grid.voice-wide, .options-grid { grid-template-columns: 1fr; gap: 12px; }
  .source-actions { display: grid; grid-template-columns: 1fr; gap: 9px; }
  .source-actions .btn { width: 100%; padding: 12px 14px; font-size: 14.5px; }

  /* 手机端已选素材卡片：清晰两行布局，绝不挤乱溢出 */
  .clip-strip { gap: 10px; }
  .clip-pill {
    width: 100%;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 10px;
    padding: 10px;
  }
  .clip-pill-thumb { grid-column: 1; grid-row: 1; }
  .clip-pill-info { display: contents; }
  .clip-pill-name {
    grid-column: 2;
    grid-row: 1;
    max-width: none;
    font-size: 14px;
    min-width: 0;
  }
  .clip-pill-ops {
    grid-column: 3;
    grid-row: 1;
    margin-left: 0;
    gap: 5px;
    flex-shrink: 0;
  }
  .clip-pill-meta {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 2px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
    gap: 7px;
  }
  .img-dur-select,
  .clip-mode-select,
  .clip-trans-select {
    max-width: none;
    font-size: 13.5px !important;
    padding: 5px 8px !important;
    min-height: 32px;
  }

  /* 触控热区加大 */
  .mini-btn { padding: 6px 10px; font-size: 12.5px; min-height: 32px; }
  .chip { padding: 7px 12px; font-size: 13px; }
  .btn-xs { padding: 8px 12px; font-size: 13px; }
  .ref-img-card { width: 82px; height: 82px; }
  .ref-img-del { width: 26px; height: 26px; line-height: 26px; font-size: 14px; top: 4px; right: 4px; }
  .ref-doc-chip { max-width: 100%; padding: 7px 11px; }
  .ref-doc-del { padding: 4px 6px; font-size: 16px; }

  .analyze-cta-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .btn-analyze { width: 100%; padding: 13px 16px; font-size: 15px; }

  .voice-preview-head { flex-direction: column; align-items: stretch; gap: 8px; }
  .voice-preview-head > div:last-child { width: 100%; }
  .voice-preview-head #btnRefreshVoice { flex: 1; }
  .voice-select-row button { padding: 11px 13px; }
  .audio-upload-box { flex-direction: column; align-items: stretch; gap: 10px; }
  .audio-upload-box .btn { width: 100%; }

  /* 第 3 步手机端默认折叠详细精修 */
  .pack-bar { flex-direction: column; align-items: stretch; padding: 12px; gap: 10px; }
  .pack-bar-actions { justify-content: flex-end; }
  .template-save-btn { padding: 7px 13px; font-size: 12.5px; }
  .advanced-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 11px 14px;
    border-radius: 12px;
    border: 1px dashed var(--border-strong);
    background: var(--surface-soft);
    color: var(--text);
    font-size: 13.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.16s, border-color 0.16s;
  }
  .advanced-toggle-btn:active { background: var(--surface-hover); }
  .advanced-toggle-arrow { color: var(--accent); font-size: 14px; }
  .options-grid { margin-top: 12px; }
  .options-grid.mobile-collapsed { display: none; }
  .sticker-ops { flex-direction: column; align-items: stretch; }
  .mini-select { width: 100% !important; padding: 9px 11px !important; font-size: 15px !important; }

  /* 预览区与历史记录手机端舒适排布 */
  .phone-stage { max-width: 300px; }
  .result-actions { gap: 8px; }
  .result-actions .btn { padding: 11px 10px; font-size: 13.5px; }

  .history-list { max-height: 360px; }
  .history-item {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 8px 11px;
    padding: 10px;
  }
  .history-title { font-size: 14px; }
  .history-meta { font-size: 12px; }
  .history-ops {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding-top: 8px;
    border-top: 1px dashed var(--border);
  }
  .history-ops .mini-btn {
    flex: 1 1 auto;
    text-align: center;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .history-ops .mini-btn.danger { flex: 0 0 auto; padding: 6px 12px; }

  /* 目录浏览弹窗改为手机底部抽屉式大窗 */
  .modal-backdrop { align-items: end; padding: 0; }
  .modal-sheet {
    width: 100%;
    max-height: 86dvh;
    border-radius: 22px 22px 0 0;
    border-bottom: none;
  }
  .modal-head { padding: 16px 16px 12px; }
  .modal-quick { padding: 10px 16px 0; }
  .path-bar { flex-wrap: wrap; padding: 10px 16px; }
  .path-bar input { order: -1; flex-basis: 100%; }
  .local-browser-body { padding: 10px 16px; }
  .browser-row { padding: 12px; }
  .modal-foot {
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
    flex-wrap: wrap;
  }

  /* 管理后台手机端适配 */
  .admin-tabs-bar { padding: 10px 14px; }
  .admin-pane { padding: 12px 14px calc(16px + env(safe-area-inset-bottom)); }
  .admin-create-form { grid-template-columns: 1fr; }
  .admin-create-form button { width: 100%; padding: 11px 14px; font-size: 14.5px; }
  .admin-account-card { flex-direction: column; align-items: stretch; gap: 10px; padding: 12px; }
  .admin-account-ops { padding-top: 8px; border-top: 1px dashed var(--border); }
  .admin-account-ops .mini-btn { flex: 1 1 auto; text-align: center; }
  .admin-account-ops .mini-btn.danger { flex: 0 0 auto; }

  /* 手机端底部常驻快捷栏 */
  .mobile-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 26px rgba(24, 18, 12, 0.08);
  }
  [data-theme="dark"] .mobile-dock {
    box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.45);
  }
  .mobile-dock-nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 3px;
    flex-shrink: 0;
  }
  .dock-tab {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    padding: 8px 10px;
    border-radius: 9px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
  }
  .dock-tab.active {
    background: var(--surface);
    color: var(--accent);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  }
  .mobile-dock-cta {
    flex: 1;
    width: auto;
    padding: 11px 14px;
    font-size: 14.5px;
    border-radius: 12px;
    white-space: nowrap;
    box-shadow: 0 6px 18px rgba(154, 105, 61, 0.25);
  }

  /* 轻提示条避让底部快捷栏 */
  .toast {
    bottom: calc(82px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 24px);
    font-size: 13px;
  }

  .clip-item { grid-template-columns: 84px minmax(0, 1fr); gap: 10px; }
  .clip-thumb-wrap { width: 84px; }
  .clip-scene-row { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  #themeLabel { display: none; }
  .user-badge { max-width: 82px; }
}
