/* G4 Studio Design System - Clean Apple/Seedance Aesthetic */
:root {
  --bg-page: #f2f4f8;
  --bg-card: #ffffff;
  --bg-subtle: #f4f6fa;
  --bg-muted: #ebeff6;
  --bg-hover: #e5ebf5;

  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #7c8799;
  --text-faint: #9aa4b2;

  --border-subtle: rgba(15, 23, 42, 0.07);
  --border-strong: rgba(15, 23, 42, 0.13);

  --accent-blue: #1e6bff;
  --accent-blue-hover: #1458e0;
  --accent-indigo: #4f46e5;
  --accent-blue-soft: rgba(30, 107, 255, 0.1);
  --accent-blue-ring: rgba(30, 107, 255, 0.22);

  --green: #16a34a;
  --green-soft: #eaf9ef;
  --amber: #d97706;
  --amber-soft: #fef6e6;
  --red: #e5484d;
  --red-soft: #fdf0f0;
  --purple: #6366f1;
  --cyan: #0891b2;

  --shadow-card: 0 2px 10px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-float: 0 16px 40px rgba(15, 23, 42, 0.14), 0 4px 12px rgba(15, 23, 42, 0.06);
  --shadow-primary: 0 6px 18px rgba(30, 107, 255, 0.28);

  --radius-card: 20px;
  --radius-inner: 14px;
  --radius-pill: 999px;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Inter", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --topbar-h: 56px;
  --dock-h: 64px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  padding-bottom: calc(var(--dock-h) + env(safe-area-inset-bottom) + 18px);
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  touch-action: manipulation;
}

img,
video {
  display: block;
  max-width: 100%;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ==================== 顶部导航栏 ==================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  background: rgba(242, 244, 248, 0.84);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border-subtle);
}

.topbar-inner {
  max-width: 1480px;
  height: 100%;
  margin: 0 auto;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.brand-badge {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-badge svg {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-badge-lg {
  width: 48px;
  height: 48px;
}

.brand-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  white-space: nowrap;
}

.brand-chip {
  display: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-blue);
  background: var(--accent-blue-soft);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.top-view-nav {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border-subtle);
  padding: 3px;
  border-radius: var(--radius-pill);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 11px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--text-secondary);
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.nav-pill svg {
  width: 15px;
  height: 15px;
}

.nav-pill.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.nav-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-blue);
  background: var(--accent-blue-soft);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  min-width: 20px;
  text-align: center;
}

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

.engine-badge {
  display: none;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.icon-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 34px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.icon-pill-btn:hover {
  background: #ffffff;
  color: var(--text-primary);
}

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

.logout-text {
  display: none;
}

/* ==================== 主体双端布局 ==================== */
.studio-shell {
  max-width: 1480px;
  margin: 0 auto;
  padding: 12px 12px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.left-column,
.right-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

/* 手机端按顶部导航在工作台和作品库之间切换 */
@media (max-width: 1023px) {
  .studio-shell {
    padding-bottom: 84px;
  }

  .studio-shell[data-mobile-view="workspace"] .right-column {
    display: none;
  }

  .studio-shell[data-mobile-view="gallery"] .left-column {
    display: none;
  }
}

@media (max-width: 430px) {
  #size-group {
    grid-auto-flow: row;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .seg-btn {
    padding: 5px 6px;
  }
  .seg-btn-main {
    font-size: 12px;
  }
  .seg-btn-sub {
    font-size: 10.5px;
  }
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  padding: 14px;
}

/* ==================== 1. 算力状态与硬件监控卡 ==================== */
.status-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-capsules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.capsule {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  border-radius: 13px;
  background: var(--bg-subtle);
  border: 1px solid transparent;
  min-width: 0;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.capsule-power.is-ready,
.capsule-power.is-online_cold {
  background: var(--green-soft);
  border-color: rgba(22, 163, 74, 0.14);
}

.capsule-power.is-allocating,
.capsule-power.is-warming {
  background: var(--amber-soft);
  border-color: rgba(217, 119, 6, 0.18);
}

.capsule-power.is-offline {
  background: #f1f3f7;
  border-color: rgba(15, 23, 42, 0.05);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #9ca3af;
}

.is-ready .status-dot,
.is-online_cold .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.45);
  animation: pulseGreen 2.2s infinite;
}

.is-allocating .status-dot,
.is-warming .status-dot {
  background: var(--amber);
  box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.45);
  animation: pulseAmber 1.3s infinite;
}

@keyframes pulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0.45); }
  70% { box-shadow: 0 0 0 6px rgba(22, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(22, 163, 74, 0); }
}

@keyframes pulseAmber {
  0% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.48); }
  70% { box-shadow: 0 0 0 6px rgba(217, 119, 6, 0); }
  100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0); }
}

.capsule-cu {
  background: #f8f9fc;
  border-color: rgba(15, 23, 42, 0.05);
}

.cu-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.capsule-text-col {
  min-width: 0;
  flex: 1;
}

.capsule-main-line {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.capsule-sub-line {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
  font-variant-numeric: tabular-nums;
}

/* 预热终端横幅 */
.warmup-banner {
  background: linear-gradient(135deg, #fffaf0 0%, #fef3c7 100%);
  border: 1px solid rgba(217, 119, 6, 0.22);
  border-radius: 13px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.warmup-banner-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.warmup-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #92400e;
  background: rgba(245, 158, 11, 0.22);
  padding: 2px 6px;
  border-radius: 6px;
}

.warmup-title {
  font-size: 12.5px;
  font-weight: 600;
  color: #78350f;
}

.warmup-bar-track {
  height: 4px;
  border-radius: 99px;
  background: rgba(217, 119, 6, 0.16);
  overflow: hidden;
}

.warmup-bar-indeterminate {
  height: 100%;
  width: 40%;
  border-radius: 99px;
  background: linear-gradient(90deg, #f59e0b, #d97706);
  animation: slideProgress 1.5s infinite ease-in-out;
}

@keyframes slideProgress {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(280%); }
}

.warmup-log {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: #7c2d12;
  background: rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  padding: 6px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 四宫格电源按钮行 */
.power-actions-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.action-chip-btn {
  height: 40px;
  border-radius: 12px;
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid rgba(15, 23, 42, 0.04);
  transition: transform 0.12s ease, background-color 0.16s ease, color 0.16s ease;
}

.action-chip-btn:hover:not(:disabled) {
  background: var(--bg-muted);
}

.action-chip-btn:active:not(:disabled) {
  transform: scale(0.97);
}

.action-chip-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.action-chip-btn .btn-svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.action-chip-btn.is-stop {
  background: var(--red-soft);
  color: var(--red);
  border-color: rgba(229, 72, 77, 0.14);
}

.action-chip-btn.is-stop:hover:not(:disabled) {
  background: #fbe4e5;
}

.action-chip-btn.is-boot {
  background: var(--green-soft);
  color: var(--green);
  border-color: rgba(22, 163, 74, 0.15);
}

.action-chip-btn.is-boot:hover:not(:disabled) {
  background: #dcf5e4;
}

.action-chip-btn.is-spinning .refresh-svg {
  animation: spin360 0.7s linear infinite;
}

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

/* 2x2 硬件进度条网格 */
.metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.metric-box {
  background: var(--bg-subtle);
  border-radius: 12px;
  padding: 9px 10px;
  border: 1px solid rgba(15, 23, 42, 0.03);
}

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

.metric-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.metric-ico {
  width: 15px;
  height: 15px;
}

.metric-ico-cpu { color: #0284c7; }
.metric-ico-ram { color: #16a34a; }
.metric-ico-vram { color: #d97706; }
.metric-ico-disk { color: #6366f1; }

.metric-val {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-val small {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
}

.progress-track {
  height: 6px;
  border-radius: 99px;
  background: rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.fill-cpu { background: linear-gradient(90deg, #06b6d4, #0ea5e9); }
.fill-ram { background: linear-gradient(90deg, #22c55e, #10b981); }
.fill-vram { background: linear-gradient(90deg, #16a34a, #f59e0b); }
.fill-disk { background: linear-gradient(90deg, #6366f1, #8b5cf6); }

/* ==================== 2. 多模态创作面板 ==================== */
.composer-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 顶栏 4 模式 Segmented Tabs */
.mode-segmented {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--bg-subtle);
  border-radius: 14px;
  padding: 4px;
  gap: 3px;
}

.mode-tab {
  min-height: 40px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
}

.mode-tab svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.mode-tab.active {
  background: var(--bg-card);
  color: var(--accent-blue);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

/* 子模式胶囊栏 */
.submode-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.submode-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.submode-pill {
  height: 34px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.16s ease;
}

.submode-pill:hover {
  background: var(--bg-muted);
}

.submode-pill.active {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  border-color: rgba(30, 107, 255, 0.24);
}

.submode-hint {
  font-size: 11.5px;
  color: var(--text-muted);
  padding: 0 2px;
}

/* 参数矩阵 */
.params-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.param-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.param-label {
  width: 34px;
  flex-shrink: 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.segmented-group {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: 12px;
  gap: 3px;
}

.seg-btn {
  min-height: 40px;
  padding: 5px 6px;
  border-radius: 9px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-secondary);
  transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
  min-width: 0;
}

.seg-btn-main {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.seg-btn-sub {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.2;
  margin-top: 1px;
  white-space: nowrap;
}

.seg-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.seg-btn.active .seg-btn-sub {
  color: var(--accent-blue);
}

/* 重绘幅度滑块 */
.denoise-control {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-subtle);
  border-radius: 12px;
  padding: 8px 12px;
}

.range-slider {
  flex: 1;
  accent-color: var(--accent-blue);
  height: 5px;
  cursor: pointer;
}

.denoise-value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-blue);
  min-width: 38px;
  text-align: right;
}

/* 控制行：sol-attn & 种子 */
.control-inline-bar {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--bg-subtle);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  transition: all 0.16s ease;
}

.toggle-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.toggle-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: background-color 0.16s ease, box-shadow 0.16s ease;
}

.toggle-chip:has(input:checked) {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  border-color: rgba(30, 107, 255, 0.2);
}

.toggle-chip:has(input:checked) .toggle-chip-dot {
  background: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(30, 107, 255, 0.18);
}

.seed-box {
  display: inline-flex;
  align-items: center;
  height: 36px;
  background: var(--bg-subtle);
  border-radius: 10px;
  padding: 0 6px 0 10px;
  gap: 6px;
}

.seed-tag {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.seed-input {
  width: 72px;
  border: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  outline: none;
  text-align: center;
}

.seed-rnd-btn {
  height: 26px;
  padding: 0 8px;
  border-radius: 7px;
  background: var(--bg-card);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.seed-rnd-btn:hover {
  color: var(--accent-blue);
}

/* ==================== 媒体挂载槽位与缩略图横滑库 ==================== */
.media-mount-section {
  border-top: 1px solid var(--border-subtle);
  padding-top: 11px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.media-header-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.media-header-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.media-header-title svg {
  width: 15px;
  height: 15px;
  color: var(--accent-blue);
}

.media-mount-status {
  font-weight: 500;
  font-size: 12px;
  color: var(--text-muted);
}

.media-kind-badge {
  font-size: 11px;
  color: var(--text-muted);
}

/* 挂载槽位容器 */
.slots-container {
  display: grid;
  gap: 8px;
}

.slots-container.slots-1 {
  grid-template-columns: 1fr;
}

.slots-container.slots-2 {
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
}

.slots-container.slots-multi {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.slot-card {
  position: relative;
  min-height: 70px;
  border-radius: 13px;
  background: var(--bg-subtle);
  border: 1.5px dashed rgba(15, 23, 42, 0.14);
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease;
  min-width: 0;
}

.slot-card.is-target {
  border-color: var(--accent-blue);
  background: rgba(30, 107, 255, 0.05);
}

.slot-card.is-filled {
  border-style: solid;
  border-color: rgba(30, 107, 255, 0.35);
  background: #f8faff;
}

.slot-thumb {
  width: 50px;
  height: 50px;
  border-radius: 9px;
  object-fit: cover;
  background: #e5e7eb;
  flex-shrink: 0;
}

.slot-placeholder-ico {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  background: rgba(15, 23, 42, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
}

.slot-placeholder-ico svg {
  width: 20px;
  height: 20px;
}

.slot-meta {
  min-width: 0;
  flex: 1;
}

.slot-tag {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-sub {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-clear-x {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.55);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slot-clear-x:hover {
  background: var(--red);
}

.swap-frames-btn {
  align-self: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.2s ease;
}

.swap-frames-btn:hover {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  transform: rotate(180deg);
}

.swap-frames-btn svg {
  width: 16px;
  height: 16px;
}

/* 多图 Ref2V 紧凑槽位 */
.slot-card.slot-compact {
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 6px 4px;
  min-height: 78px;
  gap: 4px;
}

.slot-card.slot-compact .slot-thumb {
  width: 44px;
  height: 44px;
}

.slot-card.slot-compact .slot-placeholder-ico {
  width: 34px;
  height: 34px;
}

.slot-card.slot-compact .slot-tag {
  font-size: 10.5px;
  font-family: var(--font-mono);
}

/* 双操作按钮行 */
.media-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border-radius: 12px;
  transition: outline 0.15s ease, background-color 0.15s ease;
}

.media-action-row.is-dragover {
  outline: 2px dashed var(--accent-blue);
  outline-offset: 3px;
  background: var(--accent-blue-soft);
}

.soft-btn {
  min-height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  padding: 0 12px;
  cursor: pointer;
  transition: background-color 0.16s ease, transform 0.12s ease;
}

.soft-btn:active {
  transform: scale(0.98);
}

.soft-btn svg {
  width: 16px;
  height: 16px;
}

.soft-btn-danger-tint {
  background: var(--red-soft);
  color: var(--red);
}

.soft-btn-danger-tint:hover {
  background: #fbe3e4;
}

.soft-btn-neutral {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border: 1px solid rgba(15, 23, 42, 0.05);
}

.soft-btn-neutral:hover {
  background: var(--bg-muted);
}

.upload-progress {
  position: relative;
  height: 26px;
  border-radius: 8px;
  background: var(--bg-subtle);
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 0 10px;
}

.upload-progress-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: rgba(30, 107, 255, 0.16);
  transition: width 0.2s ease;
}

.upload-progress-text {
  position: relative;
  z-index: 1;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-blue);
}

/* 缩略图横滑条 */
.assets-strip-wrap {
  position: relative;
}

.assets-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 3px 2px 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, 0.18) transparent;
}

.assets-strip::-webkit-scrollbar {
  height: 5px;
}

.assets-strip::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.16);
  border-radius: 99px;
}

.asset-thumb-item {
  position: relative;
  width: 72px;
  height: 86px;
  flex-shrink: 0;
  border-radius: 12px;
  overflow: hidden;
  background: #e5e7eb;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.asset-thumb-item:hover {
  transform: translateY(-2px);
}

.asset-thumb-item.is-mounted {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px var(--accent-blue-ring);
}

.asset-thumb-item img,
.asset-thumb-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset-kind-pill {
  position: absolute;
  left: 4px;
  bottom: 4px;
  font-size: 9.5px;
  font-weight: 700;
  color: #fff;
  background: rgba(17, 24, 39, 0.72);
  backdrop-filter: blur(4px);
  padding: 1px 5px;
  border-radius: 6px;
}

.asset-mount-badge {
  position: absolute;
  left: 4px;
  top: 4px;
  font-size: 9.5px;
  font-weight: 700;
  color: #fff;
  background: var(--accent-blue);
  padding: 1px 5px;
  border-radius: 6px;
}

.asset-del-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(17, 24, 39, 0.65);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  line-height: 1;
  opacity: 0.9;
}

.asset-del-btn:hover {
  background: var(--red);
  opacity: 1;
}

.assets-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 12px;
  border-radius: 12px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 12px;
}

.assets-empty svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ==================== 提示词区 & 底部四按钮矩阵 ==================== */
.prompt-section {
  border-top: 1px solid var(--border-subtle);
  padding-top: 11px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

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

.prompt-label {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.enhance-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(30, 107, 255, 0.1), rgba(79, 70, 229, 0.12));
  color: var(--accent-blue);
  font-size: 12px;
  font-weight: 600;
  transition: transform 0.12s ease, background-color 0.16s ease;
}

.enhance-chip:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(30, 107, 255, 0.18), rgba(79, 70, 229, 0.2));
}

.enhance-chip:disabled {
  opacity: 0.6;
  cursor: wait;
}

.enhance-chip svg {
  width: 14px;
  height: 14px;
}

.char-counter {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.ref-token-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.ref-token-chip {
  height: 26px;
  padding: 0 9px;
  border-radius: 8px;
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid rgba(30, 107, 255, 0.18);
}

.ref-token-chip:hover {
  background: rgba(30, 107, 255, 0.18);
}

.prompt-textarea {
  width: 100%;
  min-height: 108px;
  max-height: 260px;
  resize: vertical;
  border-radius: 14px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-subtle);
  padding: 11px 13px;
  font-size: 14px;
  line-height: 1.58;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease;
}

.prompt-textarea:focus {
  background: #ffffff;
  border-color: rgba(30, 107, 255, 0.45);
  box-shadow: 0 0 0 3px rgba(30, 107, 255, 0.12);
}

.prompt-textarea::placeholder {
  color: var(--text-faint);
}

/* 底部四按钮矩阵 */
.composer-footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.footer-btn {
  min-height: 44px;
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  padding: 0 12px;
  transition: transform 0.12s ease, background-color 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.footer-btn:active:not(:disabled) {
  transform: scale(0.98);
}

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

.footer-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.footer-btn-stop {
  background: var(--red-soft);
  color: var(--red);
}

.footer-btn-stop:hover:not(:disabled) {
  background: #fbe1e3;
}

.footer-btn-neutral {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.footer-btn-neutral:hover:not(:disabled) {
  background: var(--bg-muted);
}

.random-dropdown-wrap {
  position: relative;
  display: flex;
}

.footer-btn-inspire {
  flex: 1;
  background: #eef4ff;
  color: var(--accent-blue);
  padding-right: 34px;
}

.footer-btn-inspire:hover:not(:disabled) {
  background: #e1ecff;
}

.caret-svg {
  width: 12px !important;
  height: 12px !important;
  position: absolute;
  right: 11px;
  pointer-events: none;
}

.style-menu-trigger {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 34px;
  border-radius: 0 13px 13px 0;
}

.style-popover {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 30;
  min-width: 215px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  box-shadow: var(--shadow-float);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.style-popover-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  padding: 6px 10px 4px;
}

.style-option {
  text-align: left;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

.style-option:hover {
  background: var(--bg-subtle);
}

.style-option.active {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  font-weight: 700;
}

.footer-btn-submit {
  background: linear-gradient(135deg, var(--accent-blue), #2563eb 55%, var(--accent-indigo));
  color: #ffffff;
  box-shadow: var(--shadow-primary);
}

.footer-btn-submit:hover:not(:disabled) {
  filter: brightness(1.04);
  box-shadow: 0 8px 22px rgba(30, 107, 255, 0.34);
}

/* ==================== 右栏：剧院大屏预览 + 作品库画廊 ==================== */
.stage-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.stage-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
}

.stage-dot.is-live {
  background: var(--accent-blue);
  animation: pulseBlue 1.4s infinite;
}

@keyframes pulseBlue {
  0% { box-shadow: 0 0 0 0 rgba(30, 107, 255, 0.45); }
  70% { box-shadow: 0 0 0 6px rgba(30, 107, 255, 0); }
  100% { box-shadow: 0 0 0 0 rgba(30, 107, 255, 0); }
}

.stage-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.stage-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-blue);
  background: var(--accent-blue-soft);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.active-job-banner {
  background: linear-gradient(135deg, #eff6ff 0%, #eef2ff 100%);
  border: 1px solid rgba(30, 107, 255, 0.18);
  border-radius: 14px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.active-job-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.active-job-info {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.spinner-ring {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.4px solid rgba(30, 107, 255, 0.22);
  border-top-color: var(--accent-blue);
  animation: spin360 0.8s linear infinite;
  flex-shrink: 0;
}

.active-job-stage {
  font-size: 13px;
  font-weight: 700;
  color: #1e3a8a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.active-job-sub {
  font-size: 11.5px;
  color: #4f46e5;
}

.active-job-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.active-timer {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-blue);
  background: rgba(255, 255, 255, 0.85);
  padding: 3px 8px;
  border-radius: 8px;
}

.mini-stop-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}

.active-job-bar {
  height: 5px;
  border-radius: 99px;
  background: rgba(30, 107, 255, 0.14);
  overflow: hidden;
}

.active-job-bar-indeterminate {
  height: 100%;
  width: 38%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-indigo));
  animation: slideProgress 1.4s infinite ease-in-out;
}

.stage-viewport {
  position: relative;
  border-radius: 16px;
  background: #0f172a;
  min-height: 240px;
  max-height: 460px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stage-viewport video,
.stage-viewport img {
  width: 100%;
  max-height: 460px;
  object-fit: contain;
}

.stage-viewport img {
  cursor: zoom-in;
}

.stage-empty {
  background: linear-gradient(145deg, #f7f9fc 0%, #eef2f8 100%);
  width: 100%;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px 20px;
  color: var(--text-muted);
}

.stage-empty-icon {
  width: 52px;
  height: 52px;
  color: var(--accent-blue);
  margin-bottom: 10px;
}

.stage-empty-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.stage-empty-desc {
  margin: 0;
  font-size: 12.5px;
  max-width: 420px;
}

.stage-detail {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stage-prompt-text {
  margin: 0;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.stage-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.meta-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  padding: 3px 8px;
  border-radius: 7px;
  font-variant-numeric: tabular-nums;
}

.meta-tag-accent {
  color: var(--accent-blue);
  background: var(--accent-blue-soft);
}

.stage-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

/* 作品库卡片列表 */
.gallery-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.gallery-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.gallery-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
}

.queue-counters {
  display: flex;
  align-items: center;
  gap: 6px;
}

.q-pill {
  font-size: 11.5px;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  padding: 3px 9px;
  border-radius: var(--radius-pill);
}

.q-pill.q-running {
  color: var(--accent-blue);
  background: var(--accent-blue-soft);
}

.q-pill.q-queued {
  color: var(--amber);
  background: var(--amber-soft);
}

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

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-pill {
  height: 30px;
  padding: 0 11px;
  border-radius: var(--radius-pill);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
}

.filter-pill.active {
  background: var(--text-primary);
  color: #ffffff;
}

.clear-history-pill {
  height: 30px;
  padding: 0 11px;
  border-radius: var(--radius-pill);
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  font-weight: 600;
}

.clear-history-pill:hover {
  background: #fbe1e3;
}

.jobs-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.job-card {
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  background: #fafbfd;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.job-card:hover {
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  border-color: var(--border-strong);
}

.job-card.is-selected {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(30, 107, 255, 0.18);
}

.job-media-box {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #0f172a;
  overflow: hidden;
  cursor: pointer;
}

.job-media-box video,
.job-media-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.job-media-status {
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, #eff4ff, #e8edfb);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px;
  text-align: center;
  gap: 6px;
  color: var(--text-primary);
}

.job-media-status.is-error {
  background: linear-gradient(145deg, #fff1f2, #ffe4e6);
  color: #991b1b;
}

.job-type-corner {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 10.5px;
  font-weight: 700;
  color: #fff;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  pointer-events: none;
}

.job-engine-corner {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: rgba(30, 107, 255, 0.82);
  padding: 3px 7px;
  border-radius: var(--radius-pill);
  pointer-events: none;
}

.job-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.job-prompt {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.48;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.job-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.job-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.job-act-btn {
  height: 30px;
  padding: 0 9px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.job-act-btn:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
}

.job-act-btn.is-primary {
  background: var(--accent-blue-soft);
  border-color: rgba(30, 107, 255, 0.2);
  color: var(--accent-blue);
}

.job-act-btn.is-danger {
  color: var(--red);
}

.job-act-btn.is-danger:hover {
  background: var(--red-soft);
}

.gallery-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.gallery-empty svg {
  width: 44px;
  height: 44px;
  opacity: 0.55;
}

/* ==================== 手机端底部常驻条与抽屉 ==================== */
.mobile-bottom-dock {
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 35;
  height: 54px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.12);
  padding: 0 8px 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dock-summary-btn {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dock-left {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.dock-left svg {
  width: 17px;
  height: 17px;
  color: var(--text-secondary);
}

.dock-counts {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.dock-running-badge {
  color: var(--accent-blue);
  background: var(--accent-blue-soft);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

.dock-queued-badge {
  color: var(--amber);
  background: var(--amber-soft);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

.dock-clear-btn {
  height: 34px;
  padding: 0 11px;
  border-radius: 11px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

/* 抽屉 */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.36);
  backdrop-filter: blur(4px);
}

.queue-drawer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  max-height: 78vh;
  background: var(--bg-card);
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow-float);
  padding: 8px 14px calc(16px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drawer-handle {
  width: 38px;
  height: 4px;
  border-radius: 99px;
  background: #d1d5db;
  margin: 2px auto 2px;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.drawer-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
}

.drawer-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.drawer-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.soft-mini-btn {
  height: 30px;
  padding: 0 10px;
  border-radius: 9px;
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  font-size: 12px;
  font-weight: 600;
}

.drawer-body {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 6px;
}

.drawer-job-item {
  display: flex;
  gap: 10px;
  padding: 9px;
  border-radius: 13px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  align-items: center;
}

.drawer-job-thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background: #0f172a;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-blue);
}

.drawer-job-thumb img,
.drawer-job-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drawer-job-info {
  min-width: 0;
  flex: 1;
}

.drawer-job-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-job-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==================== 模态框 / 登录遮罩 / 灯箱 / Toast ==================== */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(30, 107, 255, 0.16), transparent 52%),
              radial-gradient(circle at bottom left, rgba(79, 70, 229, 0.14), transparent 52%),
              rgba(242, 244, 248, 0.88);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  box-shadow: var(--shadow-float);
  padding: 26px 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.auth-title {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.field-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

.password-wrap {
  position: relative;
}

.text-input,
.select-input {
  width: 100%;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  padding: 0 13px;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.text-input:focus,
.select-input:focus {
  background: #ffffff;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(30, 107, 255, 0.14);
}

.password-input {
  padding-right: 42px;
}

.password-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.icon-btn:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

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

.auth-error {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--red);
  background: var(--red-soft);
  padding: 8px 11px;
  border-radius: 10px;
}

.auth-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.dot-inline {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

/* 通用按钮 */
.btn {
  height: 42px;
  padding: 0 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: filter 0.15s ease, transform 0.12s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn-lg {
  height: 46px;
  font-size: 15px;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
  color: #ffffff;
  box-shadow: var(--shadow-primary);
}

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-primary);
}

.btn-danger {
  background: var(--red);
  color: #ffffff;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-card);
  border-radius: 22px;
  box-shadow: var(--shadow-float);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-card-sm {
  max-width: 400px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

.modal-subtitle {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

.confirm-text {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.setting-group-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.engine-radio-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.engine-option-card {
  position: relative;
  display: block;
  cursor: pointer;
}

.engine-option-card input {
  position: absolute;
  opacity: 0;
}

.engine-option-body {
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-subtle);
  border-radius: 14px;
  padding: 11px 13px;
  transition: all 0.16s ease;
}

.engine-option-card input:checked + .engine-option-body {
  border-color: var(--accent-blue);
  background: #f5f9ff;
  box-shadow: 0 0 0 3px rgba(30, 107, 255, 0.12);
}

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

.engine-option-name {
  font-size: 13.5px;
  font-weight: 700;
}

.engine-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

.engine-tag-fast {
  background: var(--green-soft);
  color: var(--green);
}

.engine-tag-pro {
  background: rgba(79, 70, 229, 0.12);
  color: var(--accent-indigo);
}

.engine-option-desc {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.48;
}

.setting-switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 13px;
  background: var(--bg-subtle);
}

.setting-row-title {
  font-size: 13px;
  font-weight: 700;
}

.setting-row-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.ios-switch {
  position: relative;
  width: 46px;
  height: 27px;
  flex-shrink: 0;
  cursor: pointer;
}

.ios-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ios-slider {
  position: absolute;
  inset: 0;
  border-radius: 99px;
  background: #cbd5e1;
  transition: background-color 0.2s ease;
}

.ios-slider::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.ios-switch input:checked + .ios-slider {
  background: var(--accent-blue);
}

.ios-switch input:checked + .ios-slider::before {
  transform: translateX(19px);
}

/* Lightbox */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(9, 13, 22, 0.92);
  backdrop-filter: blur(8px);
}

.lightbox-close {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close svg {
  width: 22px;
  height: 22px;
}

.lightbox-content {
  position: relative;
  z-index: 1;
  max-width: 92vw;
  max-height: 82vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content img,
.lightbox-content video {
  max-width: 92vw;
  max-height: 82vh;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.lightbox-caption {
  position: relative;
  z-index: 1;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  max-width: 720px;
  text-align: center;
}

/* Toast */
.toast-stack {
  position: fixed;
  top: 66px;
  right: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: calc(100vw - 32px);
  pointer-events: none;
}

.toast-item {
  pointer-events: auto;
  background: rgba(17, 24, 39, 0.92);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(10px);
  animation: toastIn 0.22s ease;
}

.toast-item.is-success {
  background: rgba(21, 128, 61, 0.95);
}

.toast-item.is-error {
  background: rgba(220, 38, 38, 0.95);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ==================== 平板 / 桌面端响应式升级 ==================== */
@media (min-width: 640px) {
  .brand-chip,
  .engine-badge,
  .logout-text {
    display: inline-flex;
  }

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

@media (min-width: 1024px) {
  body {
    padding-bottom: 24px;
  }

  .topbar-inner {
    padding: 0 22px;
  }

  .studio-shell {
    padding: 16px 22px 28px;
    display: grid;
    grid-template-columns: 480px minmax(0, 1fr);
    align-items: start;
    gap: 18px;
  }

  .left-column {
    position: sticky;
    top: calc(var(--topbar-h) + 16px);
  }

  .studio-shell[data-mobile-view="gallery"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .studio-shell[data-mobile-view="gallery"] .left-column {
    display: none;
  }

  .studio-shell[data-mobile-view="gallery"] .jobs-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .mobile-bottom-dock {
    display: none;
  }
}

@media (min-width: 1380px) {
  .studio-shell {
    grid-template-columns: 500px minmax(0, 1fr);
  }

  .studio-shell[data-mobile-view="gallery"] .jobs-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
