/* Dark aurora background (Profico-like glow) + glass UI */
/* =============================================
   Relume Figma Kit v3-7 风格全面重构
   保持功能、数据结构、信息位置、层级完全不变
   只修改视觉呈现（圆角、大色块、描边、字体、阴影）
   ============================================= */

:root {
  --bg: #07070d;
  --surface: rgba(12, 12, 20, 0.82);
  --surface-2: rgba(18, 18, 28, 0.94);
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #e8e8ef;
  --text-secondary: #c4c4d0;
  --text-muted: #9a9aa8;
  --primary: #f0f0f5;
  --primary-fg: #0a0a12;
  --accent: #a78bff;
  --accent-2: #6366f1;
  --accent-text: #ffffff;
  --gradient: linear-gradient(135deg, #6366f1 0%, #a78bff 48%, #c084fc 100%);
  --gradient-soft: linear-gradient(135deg, rgba(99, 102, 241, 0.22), rgba(167, 139, 250, 0.16));
  --danger: #f87171;
  --shadow: 0 20px 25px -5px rgb(0 0 0 / 0.3),
            0 8px 10px -6px rgb(0 0 0 / 0.15),
            inset 0 1px 0 rgba(255,255,255,0.08);
  --radius: 24px;
  --radius-lg: 32px;
  --font: "PingFang SC", "苹方", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --image-aspect: 16 / 9;
  --image-fit: contain;
  --cell-align: center;
  --font-scale: 13px;
  --input-bg: rgba(255, 255, 255, 0.05);
  --hover: rgba(255, 255, 255, 0.11);
  --selected: rgba(99, 102, 241, 0.25);
  --selected-border: rgba(167, 139, 250, 0.5);
  --glass: rgba(18, 18, 28, 0.78);
  --bg-wash: 0.35;
  --table-wrap-bg: rgba(247, 248, 252, 0.04);
  --table-head-bg: rgba(248, 249, 252, 0.16);
  --table-cell-bg: rgba(252, 252, 255, 0.06);
  --table-cell-hover: rgba(255, 255, 255, 0.12);
  --table-border: rgba(255, 255, 255, 0.07);
  --chrome-top: rgba(12, 10, 22, 0.88);
  --chrome-top-2: rgba(8, 8, 14, 0.62);
  --aurora: radial-gradient(ellipse 120% 60% at 50% -10%, rgba(167, 139, 250, 0.38) 0%, transparent 58%),
            radial-gradient(ellipse 60% 48% at 75% -5%, rgba(129, 140, 248, 0.24) 0%, transparent 50%),
            radial-gradient(ellipse 78% 58% at 95% 8%, rgba(99, 102, 241, 0.52) 0%, transparent 52%),
            radial-gradient(ellipse 62% 50% at 5% 18%, rgba(167, 139, 250, 0.3) 0%, transparent 55%),
            linear-gradient(180deg, #160c24 0%, #0a0814 40%, #06050c 75%, #04040a 100%);
}

/* 全局基础 */
* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: #05050a;
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
}

body { background-image: var(--aurora); background-attachment: fixed; background-size: cover; }

#app { min-height: 100%; display: flex; flex-direction: column; background: transparent; }

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: #05050a;
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background-image: var(--aurora);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
}

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

button {
  cursor: pointer;
}

#app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: transparent;
}

/* Top bar — frosted glass over aurora */
.topbar {
  height: 56px;
  background: linear-gradient(180deg, var(--chrome-top), var(--chrome-top-2));
  backdrop-filter: blur(18px) saturate(1.35);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.topbar-left,
.topbar-right,
.toolbar-left,
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.brand {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--gradient);
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  letter-spacing: -0.02em;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 8px 20px rgba(59, 130, 246, 0.25);
}

.project-title {
  border: none;
  outline: none;
  background: transparent;
  font-size: 15px;
  font-weight: 600;
  min-width: 80px;
  max-width: 240px;
  padding: 6px 8px;
  border-radius: 8px;
}

.project-title:hover,
.project-title:focus {
  background: var(--surface-2);
}

.file-badge {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-badge.saved {
  color: #86efac;
  background: rgba(22, 163, 74, 0.16);
  border-color: rgba(134, 239, 172, 0.28);
}

.file-badge.dirty {
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.14);
  border-color: rgba(167, 139, 250, 0.3);
}

.steps {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  white-space: nowrap;
}

.step {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  padding: 7px 12px;
  line-height: 1;
  transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.step:hover {
  border-color: var(--border);
  background: var(--hover);
  color: var(--text);
}

.step:focus-visible {
  outline: 2px solid rgba(139, 92, 246, 0.72);
  outline-offset: 2px;
}

.step.active {
  color: var(--text);
  font-weight: 600;
  position: relative;
  border-color: var(--selected-border);
  background: var(--gradient-soft);
}

.step.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -8px;
  height: 2px;
  background: var(--gradient);
  border-radius: 2px;
}

.step.muted {
  opacity: 0.55;
}

.step-sep {
  color: var(--text-muted);
  opacity: 0.65;
}

/* Buttons — shadcn-like primary white + gradient accent CTA */
.btn {
  border: 1px solid transparent;
  background: var(--surface);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}

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

.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}

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

.btn.outline {
  border-color: var(--border);
  background: transparent;
  color: var(--text);
}

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

.btn.danger-outline {
  border-color: rgba(248, 113, 113, 0.4);
  color: var(--danger);
  background: rgba(248, 113, 113, 0.08);
}

.btn.primary {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
  font-weight: 600;
}

.btn.primary:hover {
  background: #e4e4e7;
  border-color: #e4e4e7;
}

.btn.accent {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.22);
}

.btn.accent:hover {
  filter: brightness(1.06);
  border-color: transparent;
}

/* 仅工具栏「+ 新建 + ▾」组合拼接；其它 accent 保持完整圆角 */
.btn.accent.split {
  padding-left: 8px;
  padding-right: 10px;
  margin-left: -10px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: none;
}

#btnAddShot.btn.accent {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  padding-right: 12px;
}

.btn.lg {
  padding: 10px 18px;
  font-size: 14px;
}

.icon-btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: grid;
  place-items: center;
}

.icon-btn:hover {
  background: var(--hover);
}

.link-btn {
  border: none;
  background: none;
  color: #a78bfa;
  font-size: 12px;
  padding: 0;
}

.link-btn:hover {
  color: #c4b5fd;
}

/* Toolbar */
.toolbar {
  background: linear-gradient(180deg, var(--chrome-top), var(--chrome-top-2));
  backdrop-filter: blur(14px) saturate(1.25);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 56px;
  z-index: 20;
}

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

.shot-count {
  color: var(--text-muted);
  font-size: 13px;
  margin-left: 4px;
}

.dirty-dot {
  color: #a78bfa;
  font-size: 12px;
}

/* Menus */
.menu-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: rgba(12, 12, 20, 0.92);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 6px;
  z-index: 50;
}

.dropdown button {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.dropdown button:hover {
  background: var(--hover);
}

.dropdown.panel {
  min-width: 280px;
  max-width: min(360px, calc(100vw - 24px));
  padding: 12px;
  max-height: min(70vh, 560px);
  overflow: auto;
}

.unified-export-menu { width: min(340px, calc(100vw - 24px)); max-height: calc(100vh - 90px); overflow-y: auto; }
.unified-export-menu button:disabled { opacity: .4; cursor: not-allowed; }

.column-panel {
  max-height: 420px;
  overflow: auto;
}

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

.panel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 13px;
}

.panel-row-stack {
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}

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

/* 深 / 浅 小拨杆：紫渐变底 + 圆点上显示当前模式字 */
.theme-switch {
  --ts-h: 22px;
  --ts-w: 44px;
  --ts-pad: 2px;
  --ts-knob: 18px;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  vertical-align: middle;
}

.theme-switch-track {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: var(--ts-w);
  height: var(--ts-h);
  border-radius: 999px;
  /* 与「+ 新建」同一套蓝→紫渐变，无黑底 */
  background: var(--gradient);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.22);
  overflow: hidden;
}

.theme-switch-knob {
  position: absolute;
  top: 50%;
  left: var(--ts-pad);
  width: var(--ts-knob);
  height: var(--ts-knob);
  border-radius: 50%;
  background: #fff;
  color: #18181b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  transform: translate3d(0, -50%, 0);
  transition: transform 0.18s ease, color 0.15s ease, background 0.15s ease;
  z-index: 3;
  pointer-events: none;
  display: grid;
  place-items: center;
}

.theme-switch-knob-text {
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

/* 深色：圆点在左，字=深 */
.theme-switch.is-dark .theme-switch-knob,
.theme-switch:not(.is-light) .theme-switch-knob {
  transform: translate3d(0, -50%, 0);
  background: #0f0f14;
  color: #fafafa;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* 浅色：圆点在右，字=浅 */
.theme-switch.is-light .theme-switch-knob {
  transform: translate3d(calc(var(--ts-w) - var(--ts-knob) - var(--ts-pad) * 2), -50%, 0);
  background: #fff;
  color: #18181b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.theme-switch:hover .theme-switch-track {
  filter: brightness(1.06);
}

.theme-switch:focus-visible {
  outline: 2px solid rgba(139, 92, 246, 0.65);
  outline-offset: 2px;
  border-radius: 999px;
}

.toolbar-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

/* 浅色模式：强制可读对比（避免白字压白底） */
body.theme-light,
body.theme-light #app {
  color: #121218;
}

body.theme-light {
  background: #ffffff;
  background-image: none;
  color-scheme: light;
}

body.theme-dark {
  color-scheme: dark;
}

body.theme-light .shot-table,
body.theme-light .shot-table tbody,
body.theme-light .shot-table tbody td,
body.theme-light .cell-input,
body.theme-light .cell-textarea,
body.theme-light .page-title,
body.theme-light .project-title,
body.theme-light .panel-row,
body.theme-light .dropdown,
body.theme-light .dropdown.panel,
body.theme-light .statusbar {
  color: #121218;
}

body.theme-light .shot-table thead th,
body.theme-light .shot-count,
body.theme-light .text-secondary {
  color: #3f3f4a;
}

body.theme-light .cell-input,
body.theme-light .cell-textarea {
  caret-color: #121218;
}

body.theme-light .cell-input::placeholder,
body.theme-light .cell-textarea::placeholder {
  color: #8a8a98;
}

body.theme-light .btn.outline,
body.theme-light .btn.ghost,
body.theme-light .icon-btn,
body.theme-light .back-btn {
  color: #1a1a22;
  border-color: #cfd2db;
  background: #ffffff;
}

body.theme-light .btn.ghost {
  background: transparent;
  border-color: transparent;
  color: #3f3f4a;
}

body.theme-light .btn.ghost:hover,
body.theme-light .btn.outline:hover,
body.theme-light .icon-btn:hover {
  background: #e8eaf0;
  color: #121218;
}

body.theme-light .link-btn {
  color: #5b4bd6;
}

body.theme-light .dropdown {
  background: #ffffff;
  border-color: #d5d8e0;
  color: #121218;
}

body.theme-light .dropdown button {
  color: #121218;
}

body.theme-light .dropdown button:hover {
  background: #eef0f6;
}

body.theme-light .file-badge {
  color: #3f3f4a;
  background: #eef0f6;
  border-color: #d5d8e0;
}

body.theme-light .step {
  color: #3f3f4a;
}

body.theme-light .step:hover {
  border-color: #d5d8e0;
  background: #f7f8fb;
  color: #121218;
}

body.theme-light .step.active {
  border-color: rgba(99, 102, 241, 0.32);
  background: linear-gradient(135deg, rgba(61, 139, 253, 0.1), rgba(155, 109, 255, 0.1));
  color: #121218;
}

/* 深色模式：表格与输入保证浅字 */
body.theme-dark .shot-table,
body.theme-dark .shot-table tbody,
body.theme-dark .shot-table tbody td,
body.theme-dark .cell-input,
body.theme-dark .cell-textarea {
  color: #f4f4f8;
}

body.theme-dark .cell-input,
body.theme-dark .cell-textarea {
  caret-color: #f4f4f8;
}

.panel-row select,
.font-family-custom {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  background: var(--input-bg);
  color: var(--text);
  min-width: 120px;
}

.toggle-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.toggle-inline input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}

.font-family-select,
.font-family-custom {
  width: 100%;
  min-width: 0;
}

.font-family-custom {
  font-size: 13px;
}

.font-family-select option {
  font-size: 13px;
}

.column-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 6px;
  border-radius: 8px;
  font-size: 13px;
}

.column-item:hover {
  background: var(--hover);
}

.column-item.is-hidden .col-name {
  color: var(--text-muted);
}

.column-item .col-name {
  flex: 1;
  text-align: left;
}

.col-name-editor {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
  text-align: left;
}

.col-default-name {
  font-size: 10px;
  line-height: 1.2;
  color: var(--text-muted);
}

.col-name-input {
  width: 100%;
  min-width: 0;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 7px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
}

.col-name-reset {
  width: auto !important;
  flex: 0 0 auto;
  padding: 5px 7px !important;
  color: var(--text-secondary);
  font-size: 11px !important;
}

.col-name-reset:disabled {
  visibility: hidden;
}

.col-status {
  flex: 0 0 36px;
  font-size: 10px;
  color: var(--text-muted);
  text-align: right;
}

.column-item .eye {
  width: 30px;
  height: 30px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  display: inline-grid;
  place-items: center;
  padding: 0;
  flex-shrink: 0;
}

.column-item .eye:hover {
  background: rgba(139, 92, 246, 0.14);
  border-color: rgba(167, 139, 250, 0.35);
}

.column-item .eye.off {
  color: var(--text-muted);
  opacity: 0.7;
}

.column-item .eye.off:hover {
  background: var(--hover);
  border-color: var(--border);
}

.column-item .eye svg {
  width: 16px;
  height: 16px;
  display: block;
}

.column-item .grip {
  color: var(--text-muted);
  cursor: grab;
  user-select: none;
  width: 18px;
  text-align: center;
}

.column-hint {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Table — driven by --bg-wash (0 transparent / 1 solid white) */
.table-wrap {
  flex: 1;
  overflow: auto;
  padding: 0 0 48px;
  position: relative;
  background: var(--table-wrap-bg);
}

.shot-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
  font-size: var(--font-scale);
  color: var(--cell-text);
}

.shot-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--table-head-bg);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  color: var(--text-secondary);
  font-weight: 600;
  text-align: center;
  padding: 12px 14px 12px 10px;
  border-bottom: 1px solid var(--table-border);
  border-right: 1px dashed var(--table-border);
  white-space: nowrap;
  overflow: visible;
}

.shot-table thead th .th-label {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  pointer-events: none;
}

.col-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 12;
  user-select: none;
  touch-action: none;
}

.col-resizer::after {
  content: "";
  position: absolute;
  top: 20%;
  bottom: 20%;
  left: 3px;
  width: 2px;
  border-radius: 2px;
  background: transparent;
  transition: background 0.12s ease;
}

.shot-table thead th:hover .col-resizer::after,
.col-resizer:hover::after,
body.col-resizing .col-resizer.active::after {
  background: #8b93a3;
}

body.col-resizing {
  cursor: col-resize !important;
  user-select: none !important;
}

body.col-resizing iframe,
body.col-resizing img,
body.col-resizing textarea,
body.col-resizing input {
  pointer-events: none;
}

.shot-table tbody td {
  border-bottom: 1px solid var(--table-border);
  border-right: 1px dashed var(--table-border);
  vertical-align: middle;
  padding: 10px;
  background: var(--table-cell-bg);
  color: var(--cell-text);
  text-align: var(--cell-align);
  overflow: hidden;
}

.shot-table tbody tr:nth-child(even) td {
  background: var(--table-cell-alt);
}

.shot-table tbody tr:hover td {
  background: var(--table-cell-hover);
}

.shot-table tbody tr.selected td {
  background: var(--selected);
}

.shot-table tbody tr.dragging {
  opacity: 0.55;
}

.shot-table tbody tr.sortable-ghost {
  opacity: 0.35;
}

.shot-table tbody tr.sortable-chosen td {
  background: rgba(155, 109, 255, 0.16);
}

/* Soften pure white/black extremes in table body text */
.shot-table tbody {
  color: var(--cell-text);
}

/* Light mode tweaks when bg wash is high */
body.theme-light .btn.ghost {
  color: var(--text-secondary);
}

body.theme-light .btn.primary {
  background: #18181b;
  color: #fafafa;
  border-color: #18181b;
}

body.theme-light .btn.primary:hover {
  background: #27272a;
  border-color: #27272a;
}

body.theme-light .project-title {
  color: var(--text);
}

body.theme-light .splash-brand {
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  color: var(--text);
}

body.theme-light .image-box img {
  background: #e8e8ec;
}

body.theme-light .toast {
  background: #18181b;
  color: #fafafa;
}

body.theme-light .statusbar {
  color: var(--text-muted);
}

.col-sort {
  width: 56px;
  min-width: 56px;
}

.col-check {
  width: 40px;
  min-width: 40px;
}

.col-actions {
  width: 88px;
  min-width: 72px;
}

.drag-handle {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: inline-grid;
  place-items: center;
  color: var(--text-secondary);
  cursor: grab;
  user-select: none;
}

.drag-handle:active {
  cursor: grabbing;
}

.cell-input,
.cell-textarea {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  padding: 8px;
  resize: vertical;
  outline: none;
  text-align: var(--cell-align);
  color: var(--cell-text);
  caret-color: var(--text);
}

.cell-input::placeholder,
.cell-textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.cell-input:hover,
.cell-textarea:hover,
.cell-input:focus,
.cell-textarea:focus {
  border-color: var(--border-strong);
  background: var(--input-bg);
  color: var(--cell-text);
}

.cell-textarea {
  min-height: 42px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.cell-textarea.auto-grow {
  height: auto;
  overflow: hidden;
  resize: none;
}

.cell-input.shot-no[readonly] {
  cursor: default;
  color: var(--cell-text);
  font-weight: 600;
}

/* 景别列：景别 + 角度 + 运镜 三框 */
.shot-pack {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  min-width: 0;
}

.combo-field {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  overflow: hidden;
}

.combo-field:hover,
.combo-field:focus-within {
  border-color: var(--border-strong);
  background: var(--input-bg);
}

.combo-field .combo-input {
  flex: 1;
  min-width: 0;
  width: auto;
  border: none !important;
  background: transparent !important;
  border-radius: 0;
  padding: 7px 6px 7px 8px;
}

.combo-pick {
  flex-shrink: 0;
  width: 24px;
  height: 28px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  padding: 0;
  opacity: 0.7;
}

.combo-pick:hover {
  opacity: 1;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.combo-pick-menu {
  position: fixed;
  z-index: 400;
  min-width: 128px;
  max-height: min(50vh, 280px);
  overflow: auto;
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(16, 16, 24, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.combo-pick-title {
  padding: 6px 10px 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.combo-pick-item {
  display: block;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
}

.combo-pick-item:hover {
  background: rgba(139, 92, 246, 0.18);
}

body.theme-light .combo-pick-menu {
  background: rgba(255, 255, 255, 0.98);
  border-color: #d5d8e0;
  color: #121218;
}

body.theme-light .combo-pick-item {
  color: #121218;
}

body.theme-light .combo-pick-item:hover {
  background: #eef0f6;
}

.row-check {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.image-cell {
  display: flex;
  justify-content: center;
}

.image-box {
  width: 100%;
  max-width: 100%;
  aspect-ratio: var(--image-aspect);
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035));
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: 0.15s ease;
}

.image-box:hover {
  border-color: rgba(180, 140, 255, 0.45);
  background: linear-gradient(160deg, rgba(140, 100, 255, 0.14), rgba(40, 100, 255, 0.07));
  box-shadow: inset 0 0 0 1px rgba(155, 109, 255, 0.12);
}

.image-box:focus {
  outline: none;
}

.image-box.is-paste-target,
.image-box:focus-visible {
  border-color: rgba(139, 92, 246, 0.85);
  box-shadow:
    0 0 0 2px rgba(139, 92, 246, 0.35),
    inset 0 0 0 1px rgba(167, 139, 250, 0.25);
}

.image-box.has-image {
  border-style: solid;
  border-color: var(--border);
}

.image-box.has-image.is-paste-target {
  border-color: rgba(139, 92, 246, 0.85);
}

.image-box img {
  width: 100%;
  height: 100%;
  object-fit: var(--image-fit);
  display: block;
  background: #111;
}

.image-box .plus {
  font-size: 22px;
  color: var(--text-muted);
  line-height: 1;
}

.image-add-more {
  position: absolute;
  left: 50%;
  top: 50%;
  right: auto;
  bottom: auto;
  transform: translate(-50%, -50%);
  z-index: 3;
  display: none;
  width: max-content;
  max-width: calc(100% - 24px);
  padding: 6px 12px;
  border: 1px dashed rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(8, 8, 14, 0.78);
  color: #e5e7eb;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
}

.image-box:hover .image-add-more,
.image-box.is-paste-target .image-add-more,
.image-box.has-alts .image-add-more {
  display: block;
}

.image-alt-strip {
  position: absolute;
  left: 6px;
  right: 6px;
  top: 6px;
  z-index: 2;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  pointer-events: auto;
}

.image-alt-thumb {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 6px;
  overflow: hidden;
  background: #111;
  cursor: pointer;
}

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

.image-actions {
  position: absolute;
  inset: auto 6px 6px auto;
  display: none;
  gap: 4px;
}

.image-actions-bar {
  inset: auto 4px 4px 4px;
  justify-content: center;
  flex-wrap: wrap;
  display: none;
}

.image-box:hover .image-actions,
.image-box:hover .image-actions-bar,
.image-box.has-image:hover .image-actions {
  display: flex;
}

.image-actions-bar button {
  min-width: 28px;
  height: 26px;
  padding: 0 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(8, 8, 14, 0.78);
  color: #f5f5f7;
  font-size: 12px;
  cursor: pointer;
  backdrop-filter: blur(8px);
  white-space: nowrap;
}

.image-actions-bar button:hover {
  background: rgba(139, 92, 246, 0.45);
}

.image-actions-bar button:disabled {
  opacity: 0.35;
  cursor: default;
}

body.theme-light .image-actions-bar button {
  background: rgba(255, 255, 255, 0.92);
  color: #121218;
  border-color: #d5d8e0;
}

.image-actions button {
  border: none;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11px;
}

.frame-lib-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  gap: 12px;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}
.frame-lib-main:has(#frameLibPlayer[hidden]) {
  grid-template-columns: minmax(0, 1fr);
}
.frame-lib-player {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.frame-lib-player-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  background: rgba(8, 8, 14, 0.78);
}
.frame-lib-player[hidden] {
  display: none !important;
}
.frame-lib-player video {
  width: 100%;
  background: #000;
  border-radius: 10px;
  max-height: 42vh;
}
.clip-timeline {
  position: relative;
  height: 36px;
  margin: 2px 0 4px;
  cursor: ew-resize;
  user-select: none;
}
.clip-tl-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 16px;
  height: 8px;
  border-radius: 99px;
  background: rgba(255,255,255,0.12);
}
.clip-tl-range {
  position: absolute;
  top: 0;
  height: 100%;
  background: rgba(180, 140, 255, 0.55);
  border-radius: 99px;
}
.clip-tl-in,
.clip-tl-out,
.clip-tl-play {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 16px;
  line-height: 36px;
  font-weight: 700;
  color: #e8e4ff;
  pointer-events: auto;
  cursor: pointer;
}
.clip-tl-in { color: #9ee7a8; }
.clip-tl-out { color: #f0b4a8; }
.clip-tl-play {
  top: 12px;
  width: 2px;
  height: 16px;
  background: #fff;
  pointer-events: none;
}
.clip-tl-hover {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  pointer-events: none;
}
.clip-tl-hover-in { color: #9ee7a8; }
.clip-tl-hover-out { color: #f0b4a8; }
@media (max-width: 820px) {
  .frame-lib-main {
    grid-template-columns: 1fr;
  }
}

.clip-modal {
  width: min(860px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
}
.clip-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.clip-modal video {
  width: 100%;
  max-height: 52vh;
  background: #000;
  border-radius: 10px;
}
.clip-times {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 13px;
}
.clip-times input {
  width: 88px;
  margin-left: 6px;
}
.clip-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.clip-hint {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}
.clip-modal input[type="range"] {
  width: 100%;
}

/* 本地截图库面板 */
.frame-lib-modal {
  width: min(1180px, calc(100vw - 24px));
  max-height: min(86vh, 820px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, rgba(18, 16, 32, 0.96), rgba(10, 10, 18, 0.94));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 14px;
  position: relative;
  z-index: 1;
  color: var(--text);
}

body.theme-light .frame-lib-modal {
  background: #fff;
  color: #121218;
  border-color: #d5d8e0;
}

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

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

.frame-lib-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.frame-lib-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}

.frame-lib-filters input {
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 13px;
}

.frame-lib-filters input[type="search"] {
  min-width: 200px;
  flex: 1;
}

.frame-lib-hint {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.frame-lib-hints {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0 0 8px;
}

.frame-lib-hint-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.frame-lib-hint-row > span {
  font-size: 11px;
  color: var(--text-muted);
  min-width: 32px;
}

.frame-lib-chip {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  cursor: pointer;
}

.frame-lib-chip:hover {
  border-color: rgba(180, 140, 255, 0.55);
  background: rgba(139, 92, 246, 0.22);
}

/* 瀑布流：左右 5 列对齐，上下高度随原图比例，不强制横排对齐 */
.frame-lib-scroll {
  min-height: 0;
  height: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.frame-lib-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 8px 6px 14px;
  align-content: start;
}

@media (max-width: 900px) {
  .frame-lib-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .frame-lib-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.frame-lib-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 0;
  overflow: visible;
  cursor: pointer;
  text-align: left;
  color: inherit;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  position: relative;
  box-sizing: border-box;
  vertical-align: top;
  transform: none;
}

.frame-lib-card:hover {
  border-color: rgba(180, 140, 255, 0.45);
  background: rgba(255, 255, 255, 0.06);
}

.frame-lib-hide {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 4;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 999px;
  background: rgba(8, 8, 14, 0.78);
  color: #fff;
  font-size: 14px;
  line-height: 22px;
  text-align: center;
  cursor: pointer;
  display: none;
}

.frame-lib-card:hover .frame-lib-hide,
.frame-lib-hide:focus {
  display: inline-block;
}

.frame-lib-use {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 4;
  height: 22px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(8, 8, 14, 0.82);
  color: #e8eee3;
  font-size: 11px;
  font-weight: 700;
  line-height: 22px;
  cursor: pointer;
  display: none;
}

.frame-lib-card:hover .frame-lib-use,
.frame-lib-use:focus {
  display: inline-block;
}

.frame-lib-use:hover {
  background: rgba(139, 92, 246, 0.9);
}

.frame-lib-hide:hover {
  background: #b42318;
}

.frame-lib-sentinel,
.frame-lib-end,
.frame-lib-empty {
  grid-column: 1 / -1;
  width: 100%;
  padding: 10px 4px 18px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
}

/* 高度随原图：不设固定高，图片 width:100% + height:auto */
.frame-lib-thumb {
  width: 100%;
  display: block;
  background: #0a0a10;
  overflow: hidden;
  line-height: 0;
}

.frame-lib-card img {
  width: 100%;
  height: auto;
  max-width: 100%;
  display: block;
  object-fit: contain;
  background: transparent;
  vertical-align: top;
}

body.theme-light .frame-lib-thumb {
  background: #eef0f4;
}

.frame-lib-card span {
  display: block;
  padding: 6px 8px 0;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.35;
}

.frame-lib-card .frame-lib-hits {
  color: var(--text-secondary);
  font-weight: 600;
  max-height: 2.7em;
  overflow: hidden;
  padding-bottom: 2px;
}

.frame-lib-card .frame-lib-meta {
  padding: 2px 8px 8px;
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.9;
  max-height: 2.6em;
  overflow: hidden;
}

.frame-lib-empty {
  column-span: all;
}

.frame-lib-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 48px 12px;
  font-size: 13px;
  line-height: 1.6;
}

.frame-lib-empty code {
  font-family: var(--mono);
  font-size: 12px;
}

.row-actions {
  display: flex;
  gap: 4px;
  justify-content: center;
}

.row-actions button {
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.row-actions button:hover {
  color: var(--text);
  background: var(--hover);
}

.row-actions button.danger:hover {
  color: var(--danger);
  border-color: rgba(255, 107, 122, 0.45);
}

/* Empty / splash */
.empty-state {
  position: absolute;
  inset: 80px 0 auto;
  text-align: center;
  color: var(--text-secondary);
}

.empty-state .hint {
  color: var(--text-muted);
  font-size: 13px;
}

.back-btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.back-btn:hover {
  background: var(--hover);
}

.splash {
  position: fixed;
  inset: 0;
  background-image: var(--aurora);
  background-color: #05050a;
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 24px;
  overflow: auto;
}

.splash[hidden] {
  display: none !important;
}

.home-shell {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 1.05fr);
  gap: 18px;
  align-items: stretch;
}

.home-hero,
.activity-panel {
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.home-hero {
  padding: 32px 28px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.splash-brand {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0.01em;
  background: linear-gradient(90deg, #fff 0%, #e4e4e7 40%, #c4b5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.splash-desc {
  color: var(--text-secondary);
  margin: 10px 0 18px;
  line-height: 1.55;
}

.app-version {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  vertical-align: middle;
}

body.theme-light .app-version {
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(15, 23, 42, 0.1);
  color: #64748b;
}

.status-meta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.statusbar .app-version {
  margin-left: 0;
  opacity: 0.92;
}

.home-primary {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 16px;
}

.home-primary-btn {
  min-width: min(100%, 240px);
  justify-content: center;
}

.home-primary-meta {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  max-width: 36em;
}

.splash-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}

.home-session {
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--gradient-soft);
  border: 1px solid rgba(139, 92, 246, 0.28);
  font-size: 13px;
  color: var(--text);
}

.home-session .session-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.splash-note {
  margin: 16px 0 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}

.splash-note code,
.statusbar code,
.report-body code {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 4px;
}

.activity-panel {
  padding: 16px 16px 12px;
  display: flex;
  flex-direction: column;
  min-height: 420px;
  max-height: min(78vh, 640px);
  overflow: hidden;
}

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

.activity-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
}

.activity-list {
  flex: 1;
  min-height: 0;
  max-height: 500px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 8px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(180, 140, 255, 0.45) rgba(255, 255, 255, 0.05);
}

/* 自定义滚动条样式 */
.activity-list::-webkit-scrollbar {
  width: 8px;
}

.activity-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

.activity-list::-webkit-scrollbar-thumb {
  background: rgba(180, 140, 255, 0.3);
  border-radius: 4px;
  transition: background 0.2s;
}

.activity-list::-webkit-scrollbar-thumb:hover {
  background: rgba(180, 140, 255, 0.5);
}

.activity-empty {
  color: var(--text-muted);
  font-size: 13px;
  padding: 24px 8px;
  text-align: center;
  line-height: 1.6;
}

.activity-item.project-card {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  border-radius: 14px;
  padding: 0;
  text-align: left;
  width: 100%;
  color: inherit;
  display: flex;
  align-items: stretch;
  overflow: hidden;
}

.activity-item.project-card:hover {
  border-color: rgba(180, 140, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
}

/* 实体文件仍在 */
.activity-item.project-card.is-solid {
  border-color: rgba(134, 239, 172, 0.22);
  background: rgba(22, 163, 74, 0.06);
}

/* 未知（无句柄/待授权）：半实 */
.activity-item.project-card.is-unknown {
  opacity: 0.78;
}

/* 已不在原位：虚化 */
.activity-item.project-card.is-ghost {
  opacity: 0.45;
  filter: grayscale(0.35);
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.02);
}

.activity-item.project-card.is-ghost .name {
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.25);
}

.activity-item.project-card.is-ghost:hover {
  opacity: 0.55;
  border-color: rgba(252, 165, 165, 0.35);
}

body.theme-light .activity-item.project-card.is-solid {
  border-color: rgba(22, 163, 74, 0.28);
  background: rgba(22, 163, 74, 0.06);
}

body.theme-light .activity-item.project-card.is-ghost {
  opacity: 0.42;
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(0, 0, 0, 0.02);
}

.project-card-main {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  padding: 12px 12px 12px 14px;
  cursor: pointer;
}

.project-card-main:hover {
  background: rgba(255, 255, 255, 0.03);
}

.project-card-main:focus-visible {
  outline: 2px solid rgba(139, 92, 246, 0.55);
  outline-offset: -2px;
}

/* 尾端细竖条：补充操作，弱化危险项 */
.project-card-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 28px;
  flex-shrink: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.12);
  padding: 6px 0;
}

.rail-btn {
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  opacity: 0.55;
  display: grid;
  place-items: center;
}

.rail-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.rail-btn.rail-remove {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.rail-btn.rail-remove:hover {
  color: #fca5a5;
  background: rgba(248, 113, 113, 0.12);
}

body.theme-light .project-card-rail {
  background: rgba(0, 0, 0, 0.03);
  border-left-color: rgba(0, 0, 0, 0.06);
}

.activity-item .warn-line {
  color: #fca5a5;
}

.activity-item .row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.activity-item .name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
  font-size: 13px;
  line-height: 1.35;
}

.activity-item .meta {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.45;
}

.activity-item .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text-secondary);
}

.tag.open { color: #86efac; background: rgba(22, 163, 74, 0.16); border-color: rgba(134, 239, 172, 0.28); }
.tag.save { color: #93c5fd; background: rgba(59, 130, 246, 0.14); border-color: rgba(147, 197, 253, 0.28); }
.tag.import { color: #c4b5fd; background: rgba(139, 92, 246, 0.14); border-color: rgba(196, 181, 253, 0.28); }
.tag.warn { color: #fca5a5; background: rgba(248, 113, 113, 0.12); border-color: rgba(252, 165, 165, 0.28); }
.tag.ok { color: #86efac; background: rgba(22, 163, 74, 0.16); border-color: rgba(134, 239, 172, 0.28); }

/* 旧 item-actions 已弃用：危险操作收进右侧细竖条 */

.report-modal {
  width: min(560px, calc(100vw - 32px));
  background: linear-gradient(160deg, rgba(18, 16, 32, 0.92), rgba(10, 10, 18, 0.88));
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 18px 18px 14px;
  position: relative;
  z-index: 1;
  color: var(--text);
}

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

.report-body {
  max-height: min(55vh, 420px);
  overflow: auto;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
}

.report-body h4 {
  margin: 12px 0 6px;
  font-size: 13px;
}

.report-body h4:first-child {
  margin-top: 0;
}

.report-body ul {
  margin: 0;
  padding-left: 18px;
}

.report-body li {
  margin: 4px 0;
}

.report-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

@media (max-width: 860px) {
  .home-shell {
    grid-template-columns: 1fr;
  }

  .activity-panel {
    min-height: 280px;
    max-height: none;
  }
}

/* Status / toast / modal */
.statusbar {
  position: sticky;
  bottom: 0;
  background: linear-gradient(0deg, var(--chrome-top), var(--chrome-top-2));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
  z-index: 15;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: #fafafa;
  color: #09090b;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 200;
  box-shadow: var(--shadow);
  font-weight: 600;
}

.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 50% 0%, rgba(120, 80, 220, 0.22), transparent 60%),
    rgba(4, 4, 10, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.modal-body {
  position: relative;
  z-index: 1;
}

.image-preview {
  max-width: min(94vw, 1180px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 14px 12px;
  border-radius: 18px;
  background: rgba(10, 10, 16, 0.94);
  box-shadow: var(--shadow);
}

.image-preview-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-width: min(92vw, 960px);
  min-height: 280px;
  max-height: calc(92vh - 88px);
}

.image-crop-viewport {
  position: relative;
  width: min(92vw, 960px);
  max-height: calc(92vh - 88px);
  aspect-ratio: var(--preview-aspect, 16 / 9);
  overflow: hidden;
  border-radius: 12px;
  background: #05060b;
  cursor: grab;
  touch-action: none;
}

.image-crop-viewport:active {
  cursor: grabbing;
}

.image-crop-viewport img {
  position: absolute;
  max-width: none;
  max-height: none;
  border-radius: 0;
  display: block;
  background: #000;
  user-select: none;
  pointer-events: none;
}

.image-crop-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, transparent 33.33%, rgba(255, 255, 255, 0.22) 33.33%, rgba(255, 255, 255, 0.22) calc(33.33% + 1px), transparent calc(33.33% + 1px), transparent 66.66%, rgba(255, 255, 255, 0.22) 66.66%, rgba(255, 255, 255, 0.22) calc(66.66% + 1px), transparent calc(66.66% + 1px)),
    linear-gradient(to bottom, transparent 33.33%, rgba(255, 255, 255, 0.22) 33.33%, rgba(255, 255, 255, 0.22) calc(33.33% + 1px), transparent calc(33.33% + 1px), transparent 66.66%, rgba(255, 255, 255, 0.22) 66.66%, rgba(255, 255, 255, 0.22) calc(66.66% + 1px), transparent calc(66.66% + 1px));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55);
}

.image-preview-stage video {
  width: min(92vw, 960px);
  max-height: calc(92vh - 88px);
  border-radius: 12px;
  background: #000;
  display: block;
}

.image-preview-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  position: relative;
  padding-right: 36px;
}

.image-preview-zoom {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 12px;
}

.image-preview-zoom input[type="range"] {
  width: 120px;
}

.image-preview-hint {
  color: var(--text-muted);
  font-size: 12px;
  margin-left: auto;
}

.image-preview .modal-close {
  position: absolute;
  top: auto;
  right: 0;
  bottom: auto;
}

.modal-close {
  position: absolute;
  top: -12px;
  right: -12px;
}

/* Font scale helpers */
body.font-sm {
  --font-scale: 12px;
}

body.font-md {
  --font-scale: 13px;
}

body.font-lg {
  --font-scale: 15px;
}

/* Sortable fallback visual */
.sortable-drag {
  cursor: grabbing !important;
}

@media (max-width: 960px) {
  .steps {
    display: none;
  }

  .topbar,
  .toolbar {
    flex-wrap: wrap;
    height: auto;
    position: static;
  }
}

/* ========== 故事板视图 ========== */
[hidden] {
  display: none !important;
}

.storyboard-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  background:
    radial-gradient(circle at 13% 0%, rgba(249, 165, 72, 0.13), transparent 23%),
    radial-gradient(circle at 90% 8%, rgba(105, 78, 255, 0.11), transparent 28%),
    #080913;
}

/* 浅色故事板：工作区与控件统一白底深字，画面卡片仍保持媒体黑底。 */
body.theme-light .storyboard-view {
  background: #ffffff;
  color: #121218;
}

body.theme-light .storyboard-toolbar {
  background: rgba(255, 255, 255, 0.97);
  border-bottom-color: #d5d8e0;
}

body.theme-light .storyboard-heading .page-title {
  color: #121218;
}

body.theme-light .storyboard-heading .shot-count,
body.theme-light .storyboard-cols-label,
body.theme-light .storyboard-size-label,
body.theme-light .storyboard-info-switch {
  color: #3f3f4a;
}

body.theme-light .storyboard-view-switch {
  border-color: #d5d8e0;
  background: #ffffff;
}

body.theme-light .storyboard-view-switch button {
  color: #3f3f4a;
}

body.theme-light .storyboard-view-switch button:hover {
  background: #f7f8fb;
  color: #121218;
}

body.theme-light .storyboard-view-switch button.active {
  background: var(--gradient);
  color: #ffffff;
}

body.theme-light .storyboard-cols-label select {
  border-color: #cfd2db;
  background: #ffffff;
  color: #121218;
}

body.theme-light .size-slider {
  background: #d5d8e0;
}

body.theme-light .size-value {
  color: #5c5c6a;
}

body.theme-light .storyboard-info-switch .switch-track {
  background: #d5d8e0;
}

body.theme-light .storyboard-info-switch .switch-track span {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
}

body.theme-light .storyboard-fields-menu summary,
body.theme-light .storyboard-play-btn {
  border-color: #cfd2db;
  background: #ffffff;
  color: #3f3f4a;
}

body.theme-light .storyboard-fields-menu summary:hover,
body.theme-light .storyboard-fields-menu[open] summary,
body.theme-light .storyboard-play-btn:hover {
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(99, 102, 241, 0.08);
  color: #121218;
}

body.theme-light .storyboard-fields-panel {
  border-color: #d5d8e0;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(28, 32, 48, 0.16);
}

body.theme-light .storyboard-fields-panel strong,
body.theme-light .storyboard-fields-panel > label:not(.storyboard-cols-label) {
  color: #121218;
}

body.theme-light .storyboard-stage {
  background: #ffffff;
}

.storyboard-toolbar {
  min-height: 66px;
  background: rgba(10, 10, 20, 0.9);
  backdrop-filter: blur(14px) saturate(1.25);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  position: relative;
  z-index: 20;
}

.storyboard-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex: 0 0 auto;
}

.storyboard-heading .page-title {
  color: #f7f7fb;
  font-size: 20px;
  line-height: 1;
}

.storyboard-heading .shot-count {
  color: #8b8d9b;
}

.storyboard-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  justify-content: flex-end;
  min-width: 0;
}

.storyboard-view-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.storyboard-view-switch button {
  height: 32px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #a8a9b4;
  font: 500 12px/1 var(--font-family, "PingFang SC", sans-serif);
  cursor: pointer;
  transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.storyboard-view-switch button:hover {
  color: #fff;
}

.storyboard-view-switch button.active {
  color: #fff;
  background: linear-gradient(135deg, #5478ff, #a953ed);
  box-shadow: 0 4px 13px rgba(107, 83, 255, 0.3);
}

.storyboard-cols-label {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  font-size: 12px;
  color: #c7c8d0;
}

.storyboard-cols-label select {
  padding: 4px 8px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: #171824;
  color: #f4f4f7;
  font-size: 12px;
}

.storyboard-stage {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px 18px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  scrollbar-gutter: stable;
}

.storyboard-stage[data-mode="overview"] {
  overflow: hidden;
  align-items: center;
}

.storyboard-board {
  display: grid;
  gap: var(--sb-gap, 6px);
  grid-template-columns: repeat(auto-fill, var(--sb-card-size, 180px));
  justify-content: start;
  align-content: start;
  width: fit-content;
  max-width: none;
  margin: 0;
  transition: opacity 120ms ease;
}

.storyboard-board[data-cols="4"] { grid-template-columns: repeat(4, var(--sb-card-size, 180px)); }
.storyboard-board[data-cols="5"] { grid-template-columns: repeat(5, var(--sb-card-size, 180px)); }
.storyboard-board[data-cols="6"] { grid-template-columns: repeat(6, var(--sb-card-size, 180px)); }
.storyboard-board[data-cols="8"] { grid-template-columns: repeat(8, var(--sb-card-size, 180px)); }

/* 连续看片按当前画面宽度自动填充；超过可用宽度即换到下一行。 */
.storyboard-board[data-mode="sequence"] {
  width: 100%;
  grid-template-columns: repeat(auto-fill, var(--sb-card-size, 180px));
}

.storyboard-size-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #9b9ca9;
  white-space: nowrap;
}

.size-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 104px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  outline: none;
  cursor: pointer;
}

.size-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5979ff, #a958eb);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(88, 82, 255, 0.45);
}

.size-slider::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #8b5cf6;
  cursor: pointer;
  border: none;
}

.size-slider:disabled {
  opacity: 0.45;
  cursor: default;
}

.size-value {
  font-size: 11px;
  color: #727482;
  min-width: 34px;
}

.storyboard-info-switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #b8b9c3;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.storyboard-info-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.storyboard-info-switch .switch-track {
  width: 34px;
  height: 20px;
  padding: 2px;
  border-radius: 999px;
  background: #303140;
  transition: background 160ms ease;
}

.storyboard-info-switch .switch-track span {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #d7d7df;
  transition: transform 160ms ease, background 160ms ease;
}

.storyboard-info-switch input:checked + .switch-track {
  background: linear-gradient(135deg, #5277ff, #ad55ec);
}

.storyboard-info-switch input:checked + .switch-track span {
  transform: translateX(14px);
  background: #fff;
}

.storyboard-fields-menu {
  position: relative;
}

.storyboard-fields-menu summary {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  color: #b4b5bf;
  cursor: pointer;
  list-style: none;
}

.storyboard-fields-menu summary::-webkit-details-marker {
  display: none;
}

.storyboard-fields-menu summary:hover,
.storyboard-fields-menu[open] summary {
  color: #fff;
  border-color: rgba(139, 92, 246, 0.65);
  background: rgba(139, 92, 246, 0.13);
}

.storyboard-fields-menu summary svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.storyboard-fields-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  width: 180px;
  padding: 12px;
  display: grid;
  gap: 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(17, 18, 29, 0.98);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.storyboard-fields-panel strong {
  color: #f5f5f7;
  font-size: 12px;
}

.storyboard-fields-panel > label:not(.storyboard-cols-label) {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #c7c8d0;
  font-size: 12px;
}

.storyboard-play-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: transparent;
  color: #d7d8df;
  cursor: pointer;
}

.storyboard-play-btn:hover {
  border-color: rgba(139, 92, 246, 0.7);
  color: #fff;
  background: rgba(139, 92, 246, 0.13);
}

.storyboard-play-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sb-card {
  appearance: none;
  position: relative;
  width: var(--sb-card-size, 180px);
  aspect-ratio: var(--image-aspect, 16 / 9);
  min-width: 0;
  padding: 0;
  background: #080808;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 5px;
  overflow: hidden;
  cursor: pointer;
  display: block;
  color: #fff;
  font-family: inherit;
  text-align: left;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.sb-card:hover {
  z-index: 3;
  border-color: rgba(138, 115, 255, 0.9);
  box-shadow: 0 7px 22px rgba(0, 0, 0, 0.44), 0 0 0 1px rgba(111, 98, 255, 0.25);
  transform: translateY(-1px);
}

.sb-card:focus-visible {
  z-index: 4;
  outline: 2px solid #8d6dff;
  outline-offset: 2px;
}

.sb-card:not(:last-child)::after {
  content: "";
  position: absolute;
  z-index: 5;
  right: -5px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-top: 1px solid rgba(202, 197, 255, 0.7);
  border-right: 1px solid rgba(202, 197, 255, 0.7);
  transform: translateY(-50%) rotate(45deg);
  filter: drop-shadow(0 0 2px #080913);
}

.sb-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #0a0a0a;
  display: block;
  overflow: hidden;
}

.sb-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.sb-card-ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-size: clamp(10px, 1vw, 13px);
  font-weight: 600;
  background: linear-gradient(135deg, #11131c, #0b0c12);
}

.sb-card-no {
  position: absolute;
  z-index: 2;
  top: 6px;
  left: 6px;
  min-width: 26px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 5px;
  background: rgba(7, 7, 10, 0.72);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  color: #fff;
  font-size: clamp(9px, 0.85vw, 12px);
  font-weight: 650;
  line-height: 1;
}

.sb-card-info {
  position: absolute;
  z-index: 2;
  inset: auto 0 0;
  min-height: 40px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  padding: 20px 8px 7px;
  background: linear-gradient(180deg, transparent, rgba(3, 4, 8, 0.78));
  pointer-events: none;
}

.sb-card-meta {
  color: #f2f2f6;
  font-size: clamp(8px, 0.72vw, 11px);
  font-weight: 550;
  line-height: 1.25;
  text-shadow: 0 1px 3px #000;
  white-space: nowrap;
}

.sb-card-text {
  color: rgba(245, 245, 249, 0.88);
  font-size: clamp(8px, 0.7vw, 10px);
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-shadow: 0 1px 3px #000;
}

.sb-card-text.label {
  color: rgba(255, 255, 255, 0.75);
}

.sb-card .hidden,
.storyboard-board[data-info="off"] .sb-card-info,
.storyboard-board[data-info="off"] .sb-card-no {
  display: none;
}

.storyboard-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.storyboard-status {
  min-height: 34px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(9, 10, 19, 0.92);
  color: #858795;
  font-size: 11px;
}

.storyboard-status span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.storyboard-status b {
  color: #a6a8b4;
  font-weight: 500;
}

.storyboard-status i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #70c98d;
  box-shadow: 0 0 8px rgba(112, 201, 141, 0.35);
}

.storyboard-status-spacer {
  flex: 1;
}

@media (max-width: 1180px) {
  .storyboard-toolbar {
    align-items: flex-start;
  }

  .storyboard-tools {
    flex-wrap: wrap;
  }

  .storyboard-size-label {
    display: none;
  }
}

@media (max-width: 760px) {
  .storyboard-toolbar {
    padding: 9px 12px;
    gap: 10px;
    flex-direction: column;
  }

  .storyboard-tools {
    width: 100%;
    justify-content: flex-start;
  }

  .storyboard-tools > .btn {
    padding-inline: 10px;
  }

  .storyboard-view-switch {
    order: -2;
  }

  .storyboard-stage {
    padding: 8px;
  }

  .storyboard-status {
    padding: 0 10px;
    gap: 12px;
    overflow-x: auto;
  }

  .storyboard-status-spacer {
    display: none !important;
  }
}

/* 放在故事板组件定义之后，确保浅色主题覆盖所有固定深色外观。 */
body.theme-light .storyboard-view,
body.theme-light .storyboard-stage {
  background: #ffffff;
  color: #121218;
}

body.theme-light .storyboard-toolbar {
  background: rgba(255, 255, 255, 0.97);
  border-bottom-color: #d5d8e0;
}

body.theme-light .storyboard-heading .page-title {
  color: #121218;
}

body.theme-light .storyboard-heading .shot-count,
body.theme-light .storyboard-cols-label,
body.theme-light .storyboard-size-label,
body.theme-light .storyboard-info-switch {
  color: #3f3f4a;
}

body.theme-light .storyboard-view-switch {
  border-color: #d5d8e0;
  background: #ffffff;
}

body.theme-light .storyboard-view-switch button {
  color: #3f3f4a;
}

body.theme-light .storyboard-view-switch button:hover {
  background: #f7f8fb;
  color: #121218;
}

body.theme-light .storyboard-view-switch button.active {
  background: var(--gradient);
  color: #ffffff;
}

body.theme-light .storyboard-cols-label select {
  border-color: #cfd2db;
  background: #ffffff;
  color: #121218;
}

body.theme-light .size-slider {
  background: #d5d8e0;
}

body.theme-light .size-value {
  color: #5c5c6a;
}

body.theme-light .storyboard-info-switch .switch-track {
  background: #d5d8e0;
}

body.theme-light .storyboard-info-switch .switch-track span {
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
}

body.theme-light .storyboard-fields-menu summary,
body.theme-light .storyboard-play-btn {
  border-color: #cfd2db;
  background: #ffffff;
  color: #3f3f4a;
}

body.theme-light .storyboard-fields-menu summary:hover,
body.theme-light .storyboard-fields-menu[open] summary,
body.theme-light .storyboard-play-btn:hover {
  border-color: rgba(99, 102, 241, 0.55);
  background: rgba(99, 102, 241, 0.08);
  color: #121218;
}

body.theme-light .storyboard-fields-panel {
  border-color: #d5d8e0;
  background: #ffffff;
  box-shadow: 0 18px 50px rgba(28, 32, 48, 0.16);
}

body.theme-light .storyboard-fields-panel strong,
body.theme-light .storyboard-fields-panel > label:not(.storyboard-cols-label) {
  color: #121218;
}

body.theme-light .storyboard-status {
  border-top-color: #d5d8e0;
  background: #ffffff;
  color: #5c5c6a;
}

body.theme-light .storyboard-status b {
  color: #3f3f4a;
}
