:root {
  --bg-0: #05070c;
  --bg-1: #0b101a;
  --glass: rgba(18, 22, 32, 0.55);
  --glass-strong: rgba(12, 16, 26, 0.72);
  --stroke: rgba(255, 255, 255, 0.1);
  --stroke-strong: rgba(255, 255, 255, 0.18);
  --text: #e8edf7;
  --muted: #8b95a8;
  --accent: #3ee0c4;
  --accent-2: #5aa7ff;
  --danger: #ff6b7a;
  --ok: #4ade80;
  --shadow: 0 16px 48px rgba(0, 0, 0, 0.42);
  --radius: 14px;
  --font-ui: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-display: "DIN Alternate", "Avenir Next", "PingFang SC", "Helvetica Neue", sans-serif;
  --fs: 12.5px;
  --fs-xs: 10px;
  --fs-sm: 11px;
  --fs-md: 12.5px;
  --fs-lg: 14px;
  --fs-xl: 18px;
  --fs-title: 22px;
  --space: 12px;
  --asset-aspect-ratio: 9 / 16;
  --cand-grid-min: 72px;
  --ref-grid-min: 72px;
  --ref-grid-min-sm: 56px;
  --seg-edit-slot-w: 112px;
}

* { box-sizing: border-box; }

/* 全站隐藏原生滚动条观感，统一成细轨样式（含 hover） */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
*::-webkit-scrollbar-track {
  background: transparent;
}
*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 99px;
  border: 1px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(62, 224, 196, 0.45);
}
*::-webkit-scrollbar-corner {
  background: transparent;
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden; /* 页面禁止滚动条 */
  font-family: var(--font-ui);
  font-size: var(--fs);
  line-height: 1.45;
  color: var(--text);
  background: var(--bg-0);
}

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

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(1200px 700px at 10% -10%, rgba(58, 120, 255, 0.18), transparent 55%),
    radial-gradient(900px 600px at 90% 10%, rgba(46, 220, 180, 0.12), transparent 50%),
    linear-gradient(160deg, #05070c, #0a0f18 45%, #070b12);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  animation: float 12s ease-in-out infinite;
}
.orb-a { width: 340px; height: 340px; left: -80px; top: 20%; background: #1d4ed8; }
.orb-b { width: 280px; height: 280px; right: 5%; top: 8%; background: #0f766e; animation-delay: -4s; }
.orb-c { width: 220px; height: 220px; right: 25%; bottom: -40px; background: #334155; animation-delay: -7s; }

.grid-noise {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at center, black 30%, transparent 80%);
  opacity: 0.35;
}

@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-24px) scale(1.05); }
}

.app-shell {
  position: relative;
  z-index: 1;
  height: 100vh;
  display: grid;
  grid-template-columns: 268px 1fr;
  gap: 12px;
  padding: 12px;
}

.glass {
  background: var(--glass);
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
}

.side-rail {
  display: flex;
  flex-direction: column;
  padding: 16px 14px;
  min-height: 0;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  padding: 0 6px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background:
    conic-gradient(from 210deg, var(--accent), var(--accent-2), #1e293b, var(--accent));
  box-shadow: 0 0 18px rgba(62, 224, 196, 0.3);
  animation: spinSlow 10s linear infinite;
}

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

.brand-name {
  font-family: var(--font-display);
  letter-spacing: 0.16em;
  font-size: 13px;
  font-weight: 700;
}

.brand-sub {
  color: var(--muted);
  font-size: 11px;
  margin-top: 1px;
}

.step-nav {
  display: flex;
  flex-direction: column;
  gap: 7px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.step {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 10px 12px;
  border-radius: 11px;
  cursor: pointer;
  display: flex;
  gap: 11px;
  align-items: center;
  transition: 0.2s ease;
  font-size: 12.5px;
}

.step span {
  font-family: var(--font-display);
  font-size: 11px;
  opacity: 0.7;
}

.step:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.step.active {
  color: var(--text);
  border-color: rgba(62, 224, 196, 0.35);
  background: linear-gradient(135deg, rgba(62,224,196,0.12), rgba(90,167,255,0.08));
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.rail-footer {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.account-rail {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.account-card {
  padding: 10px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background:
    linear-gradient(160deg, rgba(62, 224, 196, 0.08), transparent 55%),
    rgba(0, 0, 0, 0.32);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.account-card.is-logged {
  border-color: rgba(62, 224, 196, 0.28);
}
.account-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.account-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 650;
  color: #041018;
  background: linear-gradient(135deg, rgba(62,224,196,0.95), rgba(90,167,255,0.88));
}
.account-card-meta {
  min-width: 0;
  flex: 1;
}
.account-name {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-sub {
  margin-top: 2px;
  font-size: var(--fs-xs);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.account-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}
.account-badge.accent {
  color: var(--accent);
  border-color: rgba(62, 224, 196, 0.35);
  background: rgba(62, 224, 196, 0.1);
}
.account-badge.is-member {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.12);
}
.account-login-btn,
.account-home-btn {
  width: 100%;
}
.account-pill {
  font-size: var(--fs-xs);
  color: var(--text);
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,0.28);
  line-height: 1.35;
  word-break: break-all;
}
.storage-modal {
  width: min(420px, 92vw);
  padding: 18px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auth-tabs {
  display: flex;
  gap: 8px;
}
.auth-hint {
  margin: 0;
  font-size: var(--fs-xs);
  line-height: 1.45;
}
.storage-modal .field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--fs-sm);
}

/* —— 独立登录页 —— */
body.auth-page {
  overflow: auto;
}
.auth-shell {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 16px 32px;
}
.auth-back {
  position: absolute;
  top: 20px;
  left: 20px;
  color: var(--muted);
  text-decoration: none;
  font-size: var(--fs-sm);
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.auth-back:hover {
  color: var(--text);
  border-color: var(--stroke);
  background: rgba(255, 255, 255, 0.04);
}
.auth-card {
  width: min(420px, 100%);
  padding: 28px 24px 22px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: authCardIn 0.45s ease both;
}
.admin-login-card {
  border-color: rgba(251, 191, 36, 0.28);
  background:
    radial-gradient(320px 120px at 10% -20%, rgba(251, 191, 36, 0.12), transparent 55%),
    rgba(18, 22, 32, 0.55);
}
@keyframes authCardIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.auth-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.auth-title {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 650;
  letter-spacing: 0.02em;
}
.auth-lead {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-form .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: var(--fs-sm);
  color: var(--muted);
}
.auth-form .field[hidden] {
  display: none !important;
}
.auth-form .field input {
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-form .field input:focus {
  border-color: rgba(62, 224, 196, 0.55);
  box-shadow: 0 0 0 3px rgba(62, 224, 196, 0.12);
}
.auth-submit {
  width: 100%;
  margin-top: 4px;
  padding: 12px 16px;
}
.auth-error {
  margin: 0;
  color: #fecaca;
  font-size: var(--fs-sm);
  line-height: 1.4;
}
.auth-foot {
  margin: 2px 0 0;
  text-align: center;
  font-size: var(--fs-sm);
}
.link-btn {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  margin: 0;
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.link-btn:hover {
  color: #6ff0d6;
}
@media (max-width: 520px) {
  .auth-shell { padding-top: 64px; }
  .auth-card { padding: 22px 18px 18px; }
}
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 8, 16, 0.62);
  padding: 16px;
}
.modal-overlay[hidden] {
  display: none !important;
}
.modal-card .modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.modal-card .modal-head h3 {
  margin: 0;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
.storage-list {
  max-height: min(58vh, 520px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.storage-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(0,0,0,0.22);
}
.storage-name {
  font-size: var(--fs-sm);
  margin-bottom: 2px;
  word-break: break-all;
}
.orch-opt.is-disabled,
.orch-opt:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.status-pill {
  font-size: var(--fs-xs);
  color: var(--muted);
  padding: 6px 8px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,0.25);
  text-align: center;
}
.status-pill.warn {
  color: #fbbf24;
  border-color: rgba(251,191,36,0.4);
  background: rgba(251,191,36,0.08);
  border-radius: 12px;
  line-height: 1.4;
}
.status-pill[hidden] { display: none !important; }
.status-pill.is-running {
  color: var(--accent);
  border-color: rgba(62,224,196,0.35);
}
.status-pill.can-reopen {
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(62,224,196,0.25);
}
.status-pill.can-reopen:hover {
  background: rgba(62,224,196,0.12);
}

.progress-reopen-btn {
  position: fixed;
  right: 20px;
  bottom: 88px;
  z-index: 90;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(62,224,196,0.55);
  background: rgba(12, 16, 26, 0.95);
  color: var(--accent);
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}
.progress-reopen-btn:hover {
  background: rgba(62, 224, 196, 0.18);
}
.progress-reopen-btn[hidden] {
  display: none !important;
}

.book-fab {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 70;
  writing-mode: vertical-rl;
  appearance: none;
  border: 1px solid rgba(62,224,196,0.4);
  border-right: 0;
  background: rgba(12, 18, 32, 0.94);
  color: var(--accent);
  letter-spacing: 0.18em;
  padding: 14px 8px;
  border-radius: 12px 0 0 12px;
  cursor: pointer;
  font-size: 11px;
  box-shadow: -8px 8px 28px rgba(0,0,0,0.35);
  transition: transform 0.25s ease, background 0.2s ease, border-color 0.2s ease;
}
.book-fab--chars {
  top: calc(50% + 118px);
  border-color: rgba(90,167,255,0.45);
  color: #9ec5ff;
}
.book-fab--scenes {
  top: calc(50% + 236px);
  border-color: rgba(251,191,36,0.45);
  color: #fcd34d;
}
.book-fab:hover {
  background: rgba(20, 30, 48, 0.98);
  border-color: var(--accent);
  transform: translateY(-50%) translateX(-3px);
}
.book-fab--chars:hover {
  border-color: #9ec5ff;
}
.book-fab--scenes:hover {
  border-color: #fcd34d;
}
.book-drawer {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
}
.book-drawer[hidden] {
  display: block !important;
  visibility: hidden;
}
.book-drawer:not([hidden]) {
  pointer-events: auto;
  visibility: visible;
}
.book-drawer-mask {
  position: absolute;
  inset: 0;
  background: rgba(4, 8, 16, 0.55);
  opacity: 0;
  transition: opacity 0.28s ease;
}
.book-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(340px, 90vw);
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 14px 12px 14px;
  border-left: 1px solid var(--stroke);
  transform: translateX(104%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: -18px 0 48px rgba(0,0,0,0.4);
}
.book-drawer.is-open .book-drawer-mask {
  opacity: 1;
}
.book-drawer.is-open .book-drawer-panel {
  transform: translateX(0);
}
.book-drawer-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
  flex-shrink: 0;
}
.book-drawer-head h3 {
  margin: 0 0 4px;
  font-size: var(--fs-lg);
}
.book-drawer-head .muted {
  margin: 0;
  font-size: var(--fs-xs);
  line-height: 1.4;
}
.book-drawer-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.book-drawer .book-shelf-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 角色/场景库大全：同右侧滑出，略宽以容纳卡片 */
.lib-catalog-drawer {
  z-index: 121;
}
.lib-catalog-drawer .lib-catalog-panel {
  width: 80vw;
  max-width: 80vw;
}
.lib-catalog-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
}
.lib-catalog-drawer .char-catalog {
  flex: 1;
  min-height: 0;
}
.lib-catalog-drawer .cc-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.lib-catalog-drawer .cc-stat {
  padding: 8px 6px;
}
.lib-catalog-drawer .cc-stat b {
  font-size: 16px;
}
.lib-catalog-drawer .cc-grid {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}
@media (min-width: 560px) {
  .lib-catalog-drawer .cc-stats {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.progress-ring.is-clickable {
  cursor: pointer;
}
.progress-ring.is-clickable:hover {
  filter: brightness(1.08);
}

.main-stage {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 14px 16px;
  background: var(--glass-strong);
}

.stage-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 12px;
  flex-shrink: 0;
  flex-wrap: nowrap;
  min-width: 0;
}

.stage-heading {
  min-width: 0;
  flex: 1 1 auto;
}

.stage-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.stage-header h1 {
  margin: 0;
  font-size: var(--fs-title);
  font-weight: 500;
  letter-spacing: 0.02em;
  flex: 0 0 auto;
  white-space: nowrap;
}

.stage-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1 1 auto;
}

.status-chip {
  appearance: none;
  margin: 0;
  font: inherit;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.28);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-chip.warn {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.1);
}
.status-chip.job {
  cursor: pointer;
  color: var(--text);
  border-color: rgba(62, 224, 196, 0.28);
  background: rgba(62, 224, 196, 0.08);
}
.status-chip.job:hover {
  border-color: rgba(62, 224, 196, 0.5);
  background: rgba(62, 224, 196, 0.14);
}
.status-chip.job.is-running {
  color: var(--accent);
  border-color: rgba(62, 224, 196, 0.45);
}
.status-chip.job.can-reopen {
  box-shadow: 0 0 0 1px rgba(62, 224, 196, 0.25);
}
.status-chip[hidden] {
  display: none !important;
}

.stage-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: var(--fs-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.context-bar {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  justify-content: flex-end;
  max-width: none;
}

.context-pill {
  appearance: none;
  -webkit-appearance: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  box-sizing: border-box;
  flex: 0 1 180px;
  width: 180px;
  min-width: 132px;
  max-width: 220px;
  min-height: 52px;
  padding: 7px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.context-pill:hover {
  border-color: rgba(62, 224, 196, 0.45);
  background: rgba(62, 224, 196, 0.08);
}
.context-pill.accent {
  border-color: rgba(62, 224, 196, 0.35);
  background: rgba(62, 224, 196, 0.1);
  flex: 0 1 200px;
  width: 200px;
  min-width: 148px;
  max-width: 240px;
}
.context-pill.accent:hover {
  border-color: rgba(62, 224, 196, 0.65);
  background: rgba(62, 224, 196, 0.16);
}
.context-pill.empty {
  opacity: 0.72;
  border-style: dashed;
  flex: 0 0 132px;
  width: 132px;
  min-width: 132px;
  max-width: 132px;
}
.context-pill.accent.empty {
  flex: 0 0 148px;
  width: 148px;
  min-width: 148px;
  max-width: 148px;
}
.ctx-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.2;
  white-space: nowrap;
}
.context-pill.accent .ctx-label {
  color: rgba(62, 224, 196, 0.9);
}
.ctx-value {
  font-size: var(--fs-sm);
  font-weight: 600;
  line-height: 1.3;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ctx-meta {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.2;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ctx-meta:empty {
  display: none;
}

.progress-ring {
  position: relative;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
}
.progress-ring svg { width: 42px; height: 42px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: rgba(255,255,255,0.08); stroke-width: 3; }
.ring-fg { fill: none; stroke: url(#); stroke: var(--accent); stroke-width: 3; stroke-linecap: round; transition: stroke-dasharray 0.5s ease; }
.progress-ring span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 9px;
  font-family: var(--font-display);
}

.project-chip {
  display: none;
}

.stage-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.panel {
  display: none;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  animation: fadeUp 0.35s ease;
}
.panel.active { display: flex; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.split {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 12px;
  min-height: 0;
  flex: 1;
}

.panel-block {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  padding: 12px;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.scroll-pane {
  overflow-y: auto;
  overflow-x: hidden;
}

.field-label {
  font-size: var(--fs-xs);
  color: var(--muted);
  margin: 0 0 6px;
}

.field {
  width: 100%;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,0.28);
  border-radius: 10px;
  padding: 8px 10px;
  outline: none;
  margin-bottom: 10px;
  transition: 0.2s ease;
  color: var(--text);
  font-size: var(--fs-md);
}
/* 全局去掉数字框上下箭头 */
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
select.field {
  appearance: none;
  cursor: pointer;
}
.field:focus {
  border-color: rgba(62, 224, 196, 0.45);
  box-shadow: 0 0 0 3px rgba(62, 224, 196, 0.12);
}

/* 视频通道自定义下拉 */
.channel-select {
  position: relative;
  width: 100%;
  margin: 0;
}
.channel-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--stroke);
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(62, 224, 196, 0.06), rgba(90, 167, 255, 0.04)),
    rgba(0, 0, 0, 0.32);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  text-align: left;
  font: inherit;
  min-height: 42px;
}
.channel-select-trigger:hover {
  border-color: rgba(62, 224, 196, 0.35);
  background:
    linear-gradient(145deg, rgba(62, 224, 196, 0.1), rgba(90, 167, 255, 0.06)),
    rgba(0, 0, 0, 0.36);
}
.channel-select.is-open .channel-select-trigger {
  border-color: rgba(62, 224, 196, 0.5);
  box-shadow: 0 0 0 3px rgba(62, 224, 196, 0.12);
}
.channel-select-mark {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #041018;
  background: linear-gradient(135deg, rgba(62, 224, 196, 0.95), rgba(90, 167, 255, 0.88));
  box-shadow: 0 4px 12px rgba(62, 224, 196, 0.2);
}
.channel-select-mark.is-toapis {
  background: linear-gradient(135deg, rgba(90, 167, 255, 0.95), rgba(62, 224, 196, 0.75));
}
.channel-select-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.channel-select-title {
  font-size: var(--fs-md);
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.channel-select-sub {
  font-size: var(--fs-xs);
  color: var(--muted);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.channel-select-chevron {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: transform 0.2s ease, color 0.18s ease;
}
.channel-select.is-open .channel-select-chevron {
  transform: rotate(180deg);
  color: var(--accent);
}
.channel-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(62, 224, 196, 0.22);
  background: linear-gradient(180deg, rgba(16, 22, 34, 0.96), rgba(10, 14, 22, 0.98));
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  display: none;
  max-height: 240px;
  overflow-y: auto;
  animation: channelMenuIn 0.16s ease;
}
.channel-select.is-open .channel-select-menu {
  display: grid;
  gap: 4px;
}
.channel-select-menu.is-ported {
  display: grid;
  gap: 4px;
  /* 挂到 body 后仍保持原菜单视觉，并贴在触发器正下方 */
  z-index: 4000;
}
@keyframes channelMenuIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.channel-select-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.channel-select-option:hover {
  background: rgba(62, 224, 196, 0.08);
  border-color: rgba(255, 255, 255, 0.06);
}
.channel-select-option.is-active {
  background: linear-gradient(135deg, rgba(62, 224, 196, 0.14), rgba(90, 167, 255, 0.08));
  border-color: rgba(62, 224, 196, 0.35);
}
.channel-select-option .channel-select-mark {
  width: 24px;
  height: 24px;
  font-size: 9px;
  border-radius: 7px;
}
.channel-select-check {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--accent);
  opacity: 0;
}
.channel-select-option.is-active .channel-select-check {
  opacity: 1;
}
.channel-select.compact {
  margin: 0 0 10px;
}
.channel-select.compact .channel-select-trigger {
  min-height: 38px;
  padding: 6px 10px;
}
.channel-select.compact .channel-select-mark {
  width: 24px;
  height: 24px;
  font-size: 9px;
}
.settings-row .channel-select {
  margin: 0;
}
.field.area {
  flex: 1;
  min-height: 140px;
  resize: none;
}

.dropzone {
  border: 1px dashed rgba(255,255,255,0.2);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: 0.2s ease;
  font-size: var(--fs-sm);
}
.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(62, 224, 196, 0.08);
}
.drop-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 10px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(62,224,196,0.4), rgba(90,167,255,0.35));
}
.linkish {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.hint-card h3 { margin: 0 0 8px; font-weight: 500; font-size: var(--fs-lg); }
.flow-list {
  margin: 0;
  padding-left: 16px;
  color: var(--text);
  line-height: 1.65;
  font-size: var(--fs-sm);
}
.muted { color: var(--muted); font-size: var(--fs-sm); }

.panel-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  flex-shrink: 0;
}

.primary-btn, .ghost-btn {
  border-radius: 10px;
  padding: 7px 12px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: 0.2s ease;
  font-size: var(--fs-sm);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.primary-btn[hidden],
.ghost-btn[hidden] {
  display: none !important;
}
.primary-btn {
  background: linear-gradient(135deg, rgba(62,224,196,0.95), rgba(90,167,255,0.9));
  color: #041018;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(62, 224, 196, 0.22);
}
.primary-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.primary-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.primary-btn.full { width: 100%; margin-top: 12px; }
.ghost-btn {
  background: rgba(255,255,255,0.04);
  border-color: var(--stroke);
  color: var(--text);
}
.ghost-btn:hover { background: rgba(255,255,255,0.08); }
.ghost-btn.danger-outline {
  border-color: rgba(255,107,122,0.45);
  color: var(--danger);
}
.primary-btn.danger-outline {
  background: linear-gradient(135deg, rgba(255,107,122,0.95), rgba(220,80,100,0.88));
  color: #fff;
  box-shadow: 0 8px 24px rgba(255,107,122,0.22);
}

.style-hint {
  margin: 0 0 8px;
  font-size: var(--fs-xs);
  flex-shrink: 0;
}

/* 步骤二：左参数 / 右风格，左右等高 */
.step2-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(340px, 1.2fr);
  gap: 16px;
  flex: 1;
  min-height: 0;
  align-items: stretch;
  height: 100%;
}
.step2-left,
.step2-right {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 2px;
}
.step2-right-head {
  flex-shrink: 0;
}
.step2-right-head .gen-block-title {
  margin-bottom: 4px;
}
.step2-right-head .style-hint {
  margin: 0;
}
.step2-style-ref {
  flex-shrink: 0;
}
.step2-style-ref .style-upload-card {
  min-height: 0;
}
.step2-style-ref .style-upload-preview {
  min-height: 110px;
}
.panel[data-panel="2"] .gen-config {
  margin-bottom: 0;
  max-height: none;
  overflow: visible;
  flex-shrink: 0;
}
.panel[data-panel="2"] .style-grid {
  flex: 1 1 auto;
  min-height: 160px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 2px 2px 8px 0;
}
.panel[data-panel="2"] .genre-block {
  margin: 0;
  flex-shrink: 0;
}
.panel[data-panel="2"] .step2-actions {
  flex-shrink: 0;
  margin-top: auto;
  padding-top: 4px;
  justify-content: flex-end;
  gap: 10px;
}

.style-ref-box {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(255,255,255,0.035), rgba(0,0,0,0.22));
  flex-shrink: 0;
}
.style-ref-box.in-modal {
  margin: 0;
}
.style-ref-box.in-modal .style-ref-preview img {
  max-height: 160px;
}
.style-ref-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.style-ref-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}
.style-ref-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
}
.style-ref-preview img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: #05070c;
}
.style-ref-meta {
  min-width: 0;
  font-size: 12px;
  line-height: 1.45;
}
.style-ref-meta .src {
  color: var(--muted);
  font-size: 11px;
}

/* 风格步骤：嵌在比例卡片右侧的上传框 */
.style-upload-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px;
  border-radius: 12px;
  border: 1px dashed rgba(62, 224, 196, 0.28);
  background:
    radial-gradient(120px 80px at 30% 0%, rgba(62, 224, 196, 0.1), transparent 70%),
    rgba(0, 0, 0, 0.28);
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.style-upload-card:hover,
.style-upload-card:focus-visible {
  border-color: rgba(62, 224, 196, 0.5);
  box-shadow: 0 0 0 3px rgba(62, 224, 196, 0.1);
}
.style-upload-card.is-dragover {
  border-style: solid;
  border-color: rgba(62, 224, 196, 0.65);
  background:
    radial-gradient(140px 90px at 40% 20%, rgba(62, 224, 196, 0.16), transparent 70%),
    rgba(62, 224, 196, 0.08);
}
.style-upload-preview {
  flex: 1;
  min-height: 132px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(5, 7, 12, 0.55);
}
.style-upload-preview.has-image {
  display: block;
  position: relative;
}
.style-upload-preview img {
  width: 100%;
  height: 132px;
  object-fit: cover;
  border: 0;
  border-radius: 10px;
}
.style-upload-preview .style-ref-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 8px 7px;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.72));
  color: #e8edf7;
  font-size: 11px;
}
.style-upload-preview .style-ref-meta .src {
  color: rgba(232, 237, 247, 0.72);
}
.style-upload-empty {
  text-align: center;
  padding: 10px 8px;
  pointer-events: none;
}
.style-upload-icon {
  width: 36px;
  height: 36px;
  margin: 0 auto 8px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(62, 224, 196, 0.35), rgba(90, 167, 255, 0.28));
  position: relative;
}
.style-upload-icon::before,
.style-upload-icon::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: #041018;
  border-radius: 2px;
}
.style-upload-icon::before {
  width: 14px;
  height: 2px;
  transform: translate(-50%, -50%);
}
.style-upload-icon::after {
  width: 2px;
  height: 14px;
  transform: translate(-50%, -50%);
}
.style-upload-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.style-upload-hint {
  margin-top: 4px;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.35;
}
.style-upload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
}
.style-upload-actions .mini-btn {
  padding: 3px 8px;
  font-size: 10px;
}

@media (max-width: 980px) {
  .gen-block-split {
    grid-template-columns: 1fr;
  }
  .style-upload-preview,
  .style-upload-preview img {
    min-height: 110px;
    height: 110px;
  }
}

.style-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  padding: 2px 6px 18px 0;
  align-content: start;
}

.style-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 12px;
  background: rgba(0,0,0,0.25);
  cursor: pointer;
  transition: 0.2s ease;
  box-sizing: border-box;
}
.style-card:hover { border-color: var(--stroke-strong); transform: translateY(-1px); }
.style-card.active {
  border-color: rgba(62,224,196,0.5);
  background: linear-gradient(160deg, rgba(62,224,196,0.12), rgba(90,167,255,0.08));
}
.style-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
}
.style-card h4 {
  margin: 0;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.01em;
  line-height: 1.35;
}
.style-tag {
  flex-shrink: 0;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(62,224,196,0.28);
  color: var(--accent);
  background: rgba(62,224,196,0.08);
  margin-top: 1px;
}
.style-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gen-config {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  flex-shrink: 0;
  max-height: 34vh;
  overflow-y: auto;
  padding-right: 2px;
}
.gen-block {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(145deg, rgba(255,255,255,0.04), rgba(0,0,0,0.22));
}
.gen-block-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(168px, 210px);
  gap: 14px;
  align-items: stretch;
}
.gen-block-main {
  min-width: 0;
}
.gen-block-side {
  min-width: 0;
  display: flex;
}
.gen-block-title {
  font-size: var(--fs-sm);
  margin: 0 0 8px;
  font-weight: 600;
}
.gen-row {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.gen-row:last-child { margin-bottom: 0; }
.gen-row > label {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  line-height: 1.35;
  padding-top: 0;
}
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  border: 1px solid var(--stroke);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: var(--fs-xs);
  cursor: pointer;
  transition: 0.15s ease;
}
.chip:hover { border-color: var(--stroke-strong); }
.chip.active {
  border-color: rgba(62,224,196,0.5);
  color: var(--accent);
  background: rgba(62,224,196,0.12);
}
.genre-block {
  margin: 12px 0 4px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(145deg, rgba(255,255,255,0.03), rgba(0,0,0,0.18));
}
.genre-block .chip-group {
  margin-bottom: 10px;
}
.genre-custom-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.genre-custom-row .field {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 8px 10px;
  font-size: 13px;
}
.genre-custom-row .mini-btn {
  flex-shrink: 0;
}
.video-gen-block {
  margin: 0;
  padding: 0;
  max-height: none;
  overflow: visible;
}
.video-gen-block .video-model-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}
.final-param-grid {
  display: grid;
  gap: 8px;
}
.final-param-grid .gen-row {
  margin-bottom: 0;
  grid-template-columns: 64px 1fr;
  align-items: center;
}
.final-param-grid .gen-row > label {
  padding-top: 0;
}
.frame-link-tip {
  margin: 4px 0 0;
  font-size: 11px;
  line-height: 1.4;
}

.final-preview {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}
.final-rail-stack {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 12px 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.final-summary-row {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: stretch;
  min-width: 0;
}
.final-summary-row > .final-summary-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.final-summary-card .ghost-btn.full {
  width: 100%;
  margin-top: auto;
  padding-top: 8px;
  font-size: 12px;
}
.final-summary-card .final-section-head {
  flex-wrap: wrap;
  gap: 6px;
}
.final-summary-card .final-section-head h3 {
  font-size: 12px;
}
.final-summary-card .final-ratio-pill {
  font-size: 10px;
  padding: 3px 6px;
}
.final-summary-card .rail-summary-lines > div {
  grid-template-columns: 2.6em minmax(0, 1fr);
  gap: 6px;
}
.final-summary-card .rs-v {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: normal;
}
.final-summary-card .final-prog-msg {
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.final-rail-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.final-section {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(255,255,255,0.035), rgba(0,0,0,0.2));
  padding: 10px 12px 12px;
  flex: 0 0 auto;
}
.final-section-segs {
  /* 占满剩余高度，芯片区内部滚动 */
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 10px;
}
.final-section-segs .seg-pick-panel {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.final-section-segs .seg-pick-head {
  margin-bottom: 8px;
  flex-shrink: 0;
}
.final-section-segs .seg-pick-chips {
  flex: 1 1 auto;
  min-height: calc(44px * 2 + 5px);
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  align-content: start;
  align-items: start;
}
.final-section-output {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 200px;
}
.final-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.final-section-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
}
.final-ratio-pill {
  font-size: 11px;
  color: var(--muted);
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(62,224,196,0.28);
  background: rgba(62,224,196,0.08);
  white-space: nowrap;
}
.final-ratio-pill b {
  color: var(--accent);
  font-weight: 600;
}
.final-script-fold {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  background: rgba(0,0,0,0.18);
  padding: 0 12px;
}
.final-script-fold > summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 0;
  font-size: 12px;
  color: var(--muted);
  user-select: none;
}
.final-script-fold > summary::-webkit-details-marker { display: none; }
.final-script-fold > summary::before {
  content: "▸ ";
  color: var(--accent);
}
.final-script-fold[open] > summary::before { content: "▾ "; }
.final-script-fold .script-pre {
  margin: 0;
  white-space: pre-wrap;
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: #c9d3e4;
}
.final-rail-foot {
  flex-shrink: 0;
  padding: 8px 12px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(8,12,20,0.2), rgba(8,12,20,0.55));
}
.final-rail-tip {
  margin: 0 0 6px;
  font-size: 11px;
  line-height: 1.35;
}
.render-credit-est {
  margin: 0 0 8px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid rgba(62,224,196,0.22);
  background: rgba(62,224,196,0.08);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}
.render-credit-est .credit-detail {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
}
.final-rail-foot .primary-btn.full {
  margin-top: 0;
}

.rail-summary-text {
  margin: 0 0 2px;
}
.rail-summary-lines {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  line-height: 1.4;
}
.rail-summary-lines > div {
  display: grid;
  grid-template-columns: 3em minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
}
.rs-k {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  word-break: keep-all;
}
.rs-v {
  min-width: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}
.final-box {
  flex: 1 1 auto;
  min-height: 160px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 12px;
  overflow-y: auto;
  background: rgba(0,0,0,0.22);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.final-box.final-box-summary {
  flex: 0 0 auto;
  min-height: 0;
  border: none;
  border-radius: 0;
  padding: 0;
  overflow: visible;
  background: transparent;
  gap: 6px;
}
.final-detail-modal .fout-list {
  max-height: min(62vh, 640px);
  overflow-y: auto;
  padding-right: 2px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.final-detail-modal .fout-summary {
  margin-bottom: 8px;
}
.final-detail-modal .fout-card {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 10px;
  height: 100%;
  min-width: 0;
}
.final-detail-modal .fout-episode {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
}
.final-detail-modal .fout-episode-body {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}
.final-detail-modal .fout-clip-body {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}
.final-detail-modal .fout-card-actions-row {
  flex-direction: row;
  flex-wrap: wrap;
}
.final-detail-modal .fout-title {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* 播放区：宽度拉满卡片，高度按画面比例自适应 */
.final-detail-modal .fout-clip .fout-preview {
  width: 100%;
  max-width: none;
  max-height: none;
  height: auto;
  aspect-ratio: var(--asset-aspect-ratio, 9 / 16);
  margin: 0;
}
.fout-preview {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  aspect-ratio: var(--asset-aspect-ratio, 9 / 16);
  border-radius: 10px;
  overflow: hidden;
  background:
    linear-gradient(160deg, rgba(255,255,255,0.05), rgba(0,0,0,0.45));
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25);
}
.fout-preview video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #05070c;
}
.fout-preview.is-empty,
.fout-preview.is-mock {
  display: grid;
  place-items: center;
  padding: 8px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}
.fout-preview.is-mock a,
.fout-preview.is-empty a {
  color: var(--accent);
  text-decoration: none;
}
.fout-preview.is-mock a:hover,
.fout-preview.is-empty a:hover {
  text-decoration: underline;
}
@media (max-width: 640px) {
  .final-detail-modal .fout-list {
    grid-template-columns: 1fr;
  }
  .final-detail-modal .fout-episode-body {
    flex-direction: column;
    align-items: stretch;
  }
}
.final-prog-msg {
  margin: 6px 0 0;
  font-size: 11px;
  line-height: 1.4;
}
.fout-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}
.fout-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
  margin-top: 2px;
}
.fout-upload-tip {
  margin: -4px 0 0;
  font-size: 11px;
  line-height: 1.4;
}
.fout-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.fout-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  padding: 12px 12px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  background: linear-gradient(160deg, rgba(255,255,255,0.04), rgba(0,0,0,0.28));
}
.fout-card.fout-episode.is-ready {
  border-color: rgba(62,224,196,0.32);
  background: linear-gradient(160deg, rgba(62,224,196,0.1), rgba(0,0,0,0.28));
}
.fout-card-main {
  min-width: 0;
  flex: 1;
}
.fout-kicker {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 3px;
}
.fout-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fout-desc {
  font-size: 11px;
  margin-top: 3px;
  line-height: 1.4;
}
.fout-card-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}
.fout-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  min-width: 84px;
  box-sizing: border-box;
}
.fout-btn:hover:not(:disabled) {
  border-color: rgba(255,255,255,0.28);
  background: rgba(255,255,255,0.08);
}
.fout-btn.primary {
  border-color: rgba(62,224,196,0.4);
  color: var(--accent);
  background: rgba(62,224,196,0.12);
}
.fout-btn.primary:hover:not(:disabled) {
  background: rgba(62,224,196,0.2);
}
.fout-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.fout-empty {
  padding: 14px 12px;
  border: 1px dashed rgba(255,255,255,0.12);
  border-radius: 12px;
  font-size: 12px;
  text-align: center;
}
.final-prog-msg {
  margin: 0;
  font-size: 12px;
}
.primary-btn.sm,
.ghost-btn.sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 9px;
}
.sub-style-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.sub-style-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.sub-style-item .field {
  width: 72px;
  margin: 0;
  padding: 5px 8px;
  font-size: 12px;
}
.sub-cue-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.sub-cue-toolbar-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.sub-cue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 42vh;
  overflow-y: auto;
}
.sub-cue-row {
  display: grid;
  grid-template-columns: 72px 12px 72px 1fr 32px;
  gap: 6px;
  align-items: center;
}
.sub-cue-row .field {
  margin: 0;
  padding: 6px 8px;
  font-size: 12px;
}
.sub-sep {
  text-align: center;
  color: var(--muted);
}
.video-model-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.video-model-card {
  position: relative;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 7px 8px 7px;
  background:
    linear-gradient(165deg, rgba(255,255,255,0.05), rgba(0,0,0,0.28));
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  text-align: left;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: inherit;
  font: inherit;
  overflow: hidden;
}
.video-model-card:hover {
  border-color: rgba(255,255,255,0.22);
  transform: translateY(-1px);
}
.video-model-card.active {
  border-color: rgba(62,224,196,0.55);
  background:
    linear-gradient(165deg, rgba(62,224,196,0.16), rgba(90,167,255,0.08));
  box-shadow: inset 0 0 0 1px rgba(62,224,196,0.12);
}
.video-model-card.active::after {
  content: "已选";
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 9px;
  font-weight: 600;
  color: var(--accent);
  padding: 0 5px;
  border-radius: 999px;
  border: 1px solid rgba(62,224,196,0.35);
  background: rgba(0,0,0,0.35);
  line-height: 1.5;
}
.video-model-card.is-locked,
.video-model-card:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  filter: grayscale(0.35);
}
.video-model-card.is-locked:hover {
  border-color: rgba(255,255,255,0.1);
  transform: none;
}
.video-model-card.is-locked .vm-price {
  color: #c9a227;
}
.video-model-card .vm-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding-right: 36px; /* 给「已选」徽章留空 */
  min-width: 0;
}
.video-model-card .vm-title {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--text);
  line-height: 1.2;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.video-model-card .vm-price {
  display: block;
  box-sizing: border-box;
  max-width: 100%;
  font-size: 10px;
  font-weight: 600;
  color: #fbbf24;
  background: rgba(251,191,36,0.1);
  border: 1px solid rgba(251,191,36,0.28);
  border-radius: 8px;
  padding: 2px 6px;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.video-model-card.active .vm-price {
  color: var(--accent);
  background: rgba(62,224,196,0.12);
  border-color: rgba(62,224,196,0.35);
}
.video-model-card .vm-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}
.vm-tag {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 5px;
  border: 1px solid rgba(90,167,255,0.28);
  color: #9ec5ff;
  background: rgba(90,167,255,0.08);
  line-height: 1.3;
}
.vm-tag.cap {
  border-color: rgba(74,222,128,0.35);
  color: var(--ok);
  background: rgba(74,222,128,0.08);
}
.video-model-card .vm-desc {
  margin: 0;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.script-layout, .final-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  flex: 1;
  min-height: 0;
}

.section-title {
  font-size: var(--fs-xs);
  color: var(--muted);
  letter-spacing: 0.04em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.script-pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.7;
  color: #d5ddea;
}
.chapter-source-modal {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}
.chapter-source-meta {
  font-size: 12px;
}
.chapter-source-pre {
  max-height: min(62vh, 560px);
  overflow: auto;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.28);
  font-size: 13px;
  line-height: 1.75;
}

.storyboard-list, .video-list, .asset-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ref-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--ref-grid-min, 88px), 1fr));
  gap: 8px;
  max-width: 100%;
}
.ref-thumb-grid.sm {
  grid-template-columns: repeat(auto-fill, minmax(var(--ref-grid-min-sm, 64px), 1fr));
  gap: 6px;
}
.ref-thumb {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  background: #111;
  aspect-ratio: var(--asset-aspect-ratio, 9 / 16);
}
.ref-thumb.scene {
  aspect-ratio: var(--asset-aspect-ratio, 9 / 16);
}
.ref-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  background: #1a2230;
}
.ref-thumb .img-fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  font-size: 10px;
  color: #fff;
  background: #1f2937;
  pointer-events: none;
}
.ref-thumb .img-fallback.is-on { display: grid; }
.ref-placeholder {
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 48px;
  font-size: 11px;
  color: var(--muted);
  background: rgba(255,255,255,0.04);
}
.ref-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 4px 6px;
  font-size: 10px;
  color: #fff;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ref-thumb.empty {
  aspect-ratio: var(--asset-aspect-ratio, 9 / 16);
}

.board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
  flex-shrink: 0;
}
.board-sel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.seg-sel-btn {
  appearance: none;
  margin: 0;
  padding: 4px 10px;
  min-height: 26px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  color: var(--text);
  font-size: 11px;
  font-weight: 560;
  letter-spacing: 0.02em;
  line-height: 1.2;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 1px 0 rgba(0, 0, 0, 0.18);
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease, transform 0.12s ease;
}
.seg-sel-btn:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.04));
  color: #fff;
}
.seg-sel-btn:active {
  transform: translateY(1px);
}
.board-sel-hint {
  margin: 0 0 10px;
  font-size: 11px;
  flex-shrink: 0;
}
.seg-card, .asset-card {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 10px;
  background: rgba(0,0,0,0.22);
}
.seg-card {
  position: relative;
}
.seg-card.seg-picked {
  border-color: rgba(62,224,196,0.45);
  box-shadow: inset 0 0 0 1px rgba(62,224,196,0.12);
}
.seg-pick-panel {
  margin: 0 0 10px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  background: rgba(0,0,0,0.28);
}
.seg-pick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.seg-pick-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}
.seg-pick-chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 5px;
  max-height: 168px;
  overflow-y: auto;
  overscroll-behavior: contain;
  align-content: start;
  align-items: start;
}
.seg-pick-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 1px;
  height: 44px;
  padding: 5px 7px;
  border: 1px solid var(--stroke);
  border-radius: 8px;
  background: rgba(255,255,255,0.04);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
  transition: 0.12s ease;
}
.seg-pick-chip:hover {
  border-color: var(--stroke-strong);
}
.seg-pick-chip.active {
  border-color: rgba(62,224,196,0.55);
  background: linear-gradient(160deg, rgba(62,224,196,0.16), rgba(90,167,255,0.08));
}
.seg-pick-chip .spc-idx {
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
}
.seg-pick-chip .spc-st {
  font-size: 9px;
  color: var(--muted);
  line-height: 1.2;
}
.seg-card .idx {
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--accent);
  margin-bottom: 4px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  line-height: 1.45;
}
.seg-link-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 500;
  border: 1px solid var(--stroke);
  color: var(--muted);
}
.seg-link-badge.on {
  color: var(--accent);
  border-color: rgba(62,224,196,0.4);
  background: rgba(62,224,196,0.1);
}
.seg-link-badge.off {
  color: var(--muted);
  border-color: rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
}
.seg-manual-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  color: #f0c674;
  border: 1px solid rgba(240,198,116,0.35);
  background: rgba(240,198,116,0.1);
}
.seg-manual-badge.shots {
  color: #9ecbff;
  border-color: rgba(158,203,255,0.35);
  background: rgba(158,203,255,0.1);
}
.seg-edit-btn {
  margin-left: auto;
}
.seg-edit .section-title {
  font-size: 12px;
  margin: 12px 0 6px;
  letter-spacing: 0.02em;
}
.seg-edit-hint {
  margin: 0 0 8px;
  font-size: 12px;
}
.seg-edit-current-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 4px;
}
.seg-edit-slot {
  width: var(--seg-edit-slot-w, 112px);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.28);
}
.seg-edit-slot-thumb {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: var(--asset-aspect-ratio, 9 / 16);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,0.04);
  cursor: zoom-in;
}
.seg-edit-slot-thumb.scene {
  aspect-ratio: var(--asset-aspect-ratio, 9 / 16);
}
.seg-edit-slot-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.seg-edit-slot-thumb.empty {
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--muted);
  cursor: default;
}
.seg-edit-slot-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 6px 5px 5px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.78));
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 2;
}
.seg-edit-slot:hover .seg-edit-slot-overlay,
.seg-edit-slot:focus-within .seg-edit-slot-overlay {
  opacity: 1;
}
@media (hover: none) {
  .seg-edit-slot-overlay { opacity: 1; }
}
.seg-edit-slot-overlay .mini-btn {
  padding: 3px 0;
  font-size: 11px;
  width: 100%;
  backdrop-filter: blur(4px);
  background: rgba(18, 22, 32, 0.82);
}
.seg-edit-slot-name {
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  line-height: 1.25;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.seg-edit-add-ref {
  width: var(--seg-edit-slot-w, 112px);
  aspect-ratio: var(--asset-aspect-ratio, 9 / 16);
  min-height: 0;
  border-radius: 10px;
  border: 1px dashed rgba(255,255,255,0.22);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 10px;
  line-height: 1.4;
  box-sizing: border-box;
}
.seg-edit-add-ref:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(62,224,196,0.06);
}
.seg-edit-shots {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.seg-edit-shot {
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.22);
}
.seg-edit-shot-top {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 6px;
  align-items: center;
  margin-bottom: 6px;
}
.seg-edit-shot-top .se-shot-no {
  width: 100%;
  padding: 5px 6px;
  text-align: center;
  font-size: 12px;
}
.seg-edit-shot-top .se-camera {
  padding: 5px 8px;
  font-size: 12px;
}
.seg-edit-shot .se-action {
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 6px;
  resize: vertical;
  min-height: 38px;
}
.seg-edit-shot-line {
  display: grid;
  grid-template-columns: minmax(132px, 168px) 1fr;
  gap: 6px;
  align-items: center;
}
.seg-edit-shot-line .field {
  padding: 5px 8px;
  font-size: 12px;
}
.seg-edit-shot-line .speaker-select-wrap {
  grid-column: 1;
  min-width: 0;
}
.seg-edit-shot-line .se-dialogue,
.seg-edit-shot-line .se-inner {
  grid-column: 2;
}
.seg-edit-shot-line .se-expression {
  grid-column: 1 / -1;
}
.speaker-select-wrap {
  width: 100%;
  position: relative;
  z-index: 1;
}
.speaker-select.channel-select {
  position: relative;
}
.speaker-select.channel-select.compact .channel-select-trigger {
  min-height: 34px;
  padding: 4px 8px;
  gap: 8px;
  border-radius: 9px;
}
.speaker-select.channel-select.compact .channel-select-mark {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  font-size: 11px;
}
.speaker-select .channel-select-mark.is-mute {
  background: linear-gradient(135deg, rgba(140, 150, 170, 0.85), rgba(90, 100, 120, 0.9));
  color: #0b1018;
}
.speaker-select .channel-select-mark.is-vo {
  background: linear-gradient(135deg, rgba(196, 181, 253, 0.95), rgba(90, 167, 255, 0.85));
  color: #0b1018;
}
.speaker-select .channel-select-mark.is-char {
  background: linear-gradient(135deg, rgba(62, 224, 196, 0.95), rgba(90, 167, 255, 0.88));
}
.speaker-select.channel-select.compact .channel-select-sub {
  display: none;
}
.speaker-select.channel-select.compact .channel-select-title {
  font-size: 12px;
}
.speaker-select .channel-select-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  bottom: auto;
  z-index: 80;
  max-height: 220px;
  min-width: 100%;
  width: auto;
}
.speaker-select.is-open {
  z-index: 90;
}
/* 下拉已挂到 body，弹窗保持可滚动 */
.shot-line .inner-dlg {
  color: #c4b5fd;
  margin-top: 2px;
}
/* 通用开关（视频参数 / 片段编辑等） */
.ui-switch,
.seg-edit-switch,
.frame-link-toggle {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.1);
  background:
    linear-gradient(145deg, rgba(255,255,255,0.05), rgba(0,0,0,0.28));
  cursor: pointer;
  user-select: none;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.ui-switch:hover,
.seg-edit-switch:hover,
.frame-link-toggle:hover {
  border-color: rgba(62,224,196,0.28);
}
.ui-switch:has(input:checked),
.seg-edit-switch:has(input:checked),
.frame-link-toggle:has(input:checked) {
  border-color: rgba(62,224,196,0.42);
  background:
    linear-gradient(145deg, rgba(62,224,196,0.12), rgba(0,0,0,0.22));
  box-shadow: inset 0 0 0 1px rgba(62,224,196,0.08);
}
.ui-switch.is-disabled,
.ui-switch:has(input:disabled) {
  opacity: 0.48;
  cursor: not-allowed;
  pointer-events: none;
}
.ui-switch input,
.seg-edit-switch input,
.frame-link-toggle input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.ui-switch-ui,
.seg-edit-switch-ui,
.frame-link-toggle .ui-switch-ui {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  flex-shrink: 0;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.35);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.ui-switch-knob,
.seg-edit-switch-knob,
.frame-link-toggle .ui-switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(180deg, #f4f7fb, #c8d0dc);
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
  transition: transform 0.2s ease, background 0.2s ease;
}
.ui-switch:has(input:checked) .ui-switch-ui,
.seg-edit-switch:has(input:checked) .seg-edit-switch-ui,
.frame-link-toggle:has(input:checked) .ui-switch-ui {
  background: linear-gradient(135deg, rgba(62,224,196,0.85), rgba(90,167,255,0.75));
  border-color: rgba(62,224,196,0.55);
  box-shadow:
    inset 0 1px 2px rgba(255,255,255,0.25),
    0 0 12px rgba(62,224,196,0.25);
}
.ui-switch:has(input:checked) .ui-switch-knob,
.seg-edit-switch:has(input:checked) .seg-edit-switch-knob,
.frame-link-toggle:has(input:checked) .ui-switch-knob {
  transform: translateX(18px);
  background: linear-gradient(180deg, #ffffff, #e8fffa);
}
.ui-switch:focus-within,
.seg-edit-switch:focus-within,
.frame-link-toggle:focus-within {
  outline: none;
  box-shadow: 0 0 0 3px rgba(62,224,196,0.16);
}
.ui-switch-copy,
.seg-edit-switch-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.ui-switch-title,
.seg-edit-switch-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
}
.ui-switch-title em,
.seg-edit-switch-title em {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-style: normal;
  font-size: 10px;
  font-weight: 600;
  color: #0b1a16;
  background: linear-gradient(135deg, #3ee0c4, #7aefd8);
  vertical-align: 1px;
}
.ui-switch-desc,
.seg-edit-switch-desc {
  font-size: 11px;
  line-height: 1.4;
  color: var(--muted);
}
.settings-block .ui-switch {
  margin-top: 4px;
}
.seg-edit-prompt {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  min-height: 120px;
}

/* 片段编辑 · 替换形象浮层（盖住确认弹窗） */
.seg-ref-picker {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: grid;
  place-items: center;
  padding: 20px;
}
.seg-ref-picker[hidden] {
  display: none !important;
}
.seg-ref-picker-mask {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
}
.seg-ref-picker-panel {
  position: relative;
  z-index: 1;
  width: min(720px, 94vw);
  max-height: min(78vh, 640px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.12);
  background: linear-gradient(165deg, rgba(22,28,40,0.98), rgba(10,14,22,0.98));
  box-shadow: 0 28px 80px rgba(0,0,0,0.55);
  overflow: hidden;
}
.seg-ref-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.seg-ref-picker-head h3 {
  margin: 0;
  font-size: 15px;
}
.seg-ref-picker-hint {
  margin: 0;
  padding: 8px 14px 0;
  font-size: 12px;
}
.seg-ref-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--seg-edit-slot-w, 112px), 1fr));
  gap: 10px;
  padding: 12px 14px 16px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.seg-ref-pick-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.03);
  cursor: pointer;
  text-align: left;
  color: inherit;
}
.seg-ref-pick-item:hover {
  border-color: rgba(62,224,196,0.45);
  background: rgba(62,224,196,0.08);
}
.seg-ref-pick-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.seg-ref-pick-item.is-current {
  border-color: rgba(62,224,196,0.55);
  box-shadow: inset 0 0 0 1px rgba(62,224,196,0.25);
}
.seg-ref-pick-thumb {
  width: 100%;
  aspect-ratio: var(--asset-aspect-ratio, 9 / 16);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0,0,0,0.25);
}
.seg-ref-pick-thumb.scene {
  aspect-ratio: var(--asset-aspect-ratio, 9 / 16);
}
.seg-ref-pick-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.seg-ref-pick-thumb.empty {
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--muted);
}
.seg-ref-pick-name {
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  line-height: 1.25;
}
.seg-edge-frames {
  display: flex;
  gap: 8px;
  margin: 0 0 10px;
}
.seg-frame-thumb {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0,0,0,0.28);
  color: var(--muted);
  cursor: zoom-in;
  font: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.seg-frame-thumb:hover {
  border-color: rgba(62,224,196,0.45);
  transform: translateY(-1px);
}
.seg-frame-thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: #0a0e16;
}
.seg-frame-thumb span {
  font-size: 10px;
  padding: 0 8px 6px;
}
.seg-frame-thumb.empty {
  cursor: default;
  min-height: 64px;
  align-items: center;
  justify-content: center;
  opacity: 0.55;
}
.seg-frame-thumb.empty:hover {
  border-color: rgba(255,255,255,0.12);
  transform: none;
}
.seg-card p {
  margin: 0;
  font-size: var(--fs-sm);
  color: #c9d3e4;
  line-height: 1.55;
}
.shot-block {
  margin-top: 4px;
  font-size: var(--fs-sm);
  line-height: 1.55;
  color: #c9d3e4;
}
.shot-line {
  margin: 0 0 8px;
  padding-left: 2px;
}
.shot-line .dlg, .dlg {
  color: #9ae6c5;
  margin-top: 2px;
}
details summary {
  cursor: pointer;
  color: var(--muted);
}
.seg-prompt-fold {
  margin-top: 10px;
}
.seg-rescue-fold {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255,255,255,0.08);
}
.seg-rescue-fold > summary {
  font-size: 12px;
  user-select: none;
}
.seg-rescue-tip {
  margin: 6px 0 8px;
  font-size: 11px;
  line-height: 1.4;
}
.seg-rescue-fold .seg-actions {
  margin-top: 0;
}

.asset-card h4 { margin: 0 0 4px; font-weight: 500; font-size: var(--fs-md); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.asset-card h4 .asset-del-char { margin-left: auto; font-size: 11px; padding: 2px 8px; }
.asset-section-title {
  margin: 12px 0 6px !important;
  font-size: 12px !important;
  color: var(--muted);
}
.char-desc {
  white-space: pre-wrap;
  line-height: 1.5;
  font-size: var(--fs-sm);
  color: #c9d3e4;
}
.asset-action-row .voice-save-btn {
  /* 复用 accent 按钮外观，去掉独立大按钮样式干扰 */
  margin: 0;
  min-height: auto;
  box-shadow:
    0 0 0 1px rgba(62, 224, 196, 0.1),
    0 4px 16px rgba(62, 224, 196, 0.14);
}
.asset-action-row .voice-save-btn::before {
  display: none;
}
.voice-edit {
  margin: 8px 0 4px;
  display: grid;
  gap: 8px;
}
.voice-edit .voice-input {
  width: 100%;
  resize: vertical;
  min-height: 52px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.28);
  color: var(--text);
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.45;
  font-family: inherit;
}
.voice-edit .voice-input:focus {
  outline: none;
  border-color: rgba(62,224,196,0.45);
}
.voice-save-btn {
  position: relative;
  justify-self: start;
  isolation: isolate;
  appearance: none;
  cursor: pointer;
  min-width: 112px;
  height: 36px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1.5px solid rgba(62, 224, 196, 0.72);
  background:
    linear-gradient(135deg, rgba(62, 224, 196, 0.12), rgba(90, 167, 255, 0.1));
  color: #9ee9d8;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(62, 224, 196, 0.18);
  transition:
    border-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.22s ease,
    transform 0.18s ease,
    background 0.22s ease;
  overflow: hidden;
}
.voice-save-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    120deg,
    rgba(62, 224, 196, 0) 0%,
    rgba(62, 224, 196, 0.18) 35%,
    rgba(90, 167, 255, 0.22) 65%,
    rgba(90, 167, 255, 0) 100%
  );
  opacity: 0.55;
  transform: translateX(-18%);
  transition: opacity 0.22s ease, transform 0.28s ease;
  z-index: -1;
}
.voice-save-btn__label {
  position: relative;
  z-index: 1;
}
.voice-save-btn:hover {
  border-color: rgba(126, 240, 220, 0.95);
  color: #e8fffa;
  transform: translateY(-1px);
  background:
    linear-gradient(135deg, rgba(62, 224, 196, 0.28), rgba(90, 167, 255, 0.22));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.1),
    0 0 0 1px rgba(62, 224, 196, 0.35),
    0 8px 22px rgba(62, 224, 196, 0.18);
}
.voice-save-btn:hover::before {
  opacity: 1;
  transform: translateX(12%);
}
.voice-save-btn:active {
  transform: translateY(0);
  filter: brightness(0.96);
}
.voice-save-btn:disabled {
  cursor: wait;
  opacity: 0.85;
}
.voice-save-btn.is-saving {
  border-color: rgba(90, 167, 255, 0.7);
  color: #cfe8ff;
}
.voice-save-btn.is-saved {
  border-color: rgba(74, 222, 128, 0.85);
  color: #bbf7d0;
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.18), rgba(62, 224, 196, 0.14));
}
.prompt-copy-row,
.asset-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0 8px;
  padding: 8px;
  border-radius: 10px;
  border: 1px dashed rgba(62, 224, 196, 0.28);
  background: rgba(62, 224, 196, 0.06);
}
.asset-action-row .copy-prompt-btn,
.asset-action-row .accent-btn {
  white-space: nowrap;
  flex: 0 0 auto;
}
.copy-prompt-btn,
.accent-btn {
  appearance: none;
  border: 1px solid rgba(62, 224, 196, 0.55);
  background: linear-gradient(135deg, rgba(62, 224, 196, 0.28), rgba(56, 189, 248, 0.16));
  color: #7ff0dc;
  border-radius: 9px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow:
    0 0 0 1px rgba(62, 224, 196, 0.1),
    0 4px 16px rgba(62, 224, 196, 0.14);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.copy-prompt-btn:hover,
.accent-btn:hover {
  border-color: rgba(62, 224, 196, 0.85);
  color: #b8fff0;
  box-shadow:
    0 0 0 1px rgba(62, 224, 196, 0.22),
    0 6px 18px rgba(62, 224, 196, 0.22);
  transform: translateY(-1px);
}
.copy-prompt-btn:active,
.accent-btn:active {
  transform: translateY(0);
}
.copy-prompt-btn--turnaround,
.accent-btn--alt {
  border-color: rgba(125, 211, 252, 0.55);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.24), rgba(62, 224, 196, 0.14));
  color: #7dd3fc;
}
.copy-prompt-btn--turnaround:hover,
.accent-btn--alt:hover {
  border-color: rgba(125, 211, 252, 0.9);
  color: #bae6fd;
}
.accent-btn--ai {
  border-color: rgba(52, 211, 153, 0.55);
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.26), rgba(62, 224, 196, 0.14));
  color: #6ee7b7;
}
.accent-btn--ai:hover {
  border-color: rgba(52, 211, 153, 0.9);
  color: #a7f3d0;
}
.redefine-current {
  max-height: 140px;
  overflow: auto;
  padding: 10px 12px;
  margin: 0 0 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,0.28);
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
}
.redefine-notes {
  min-height: 110px;
  resize: vertical;
}
.recent-books {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow: auto;
}
.recent-book {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,0.22);
  color: inherit;
  transition: 0.15s ease;
  align-items: start;
}
.recent-book:hover,
.recent-book.is-active {
  border-color: rgba(62,224,196,0.45);
  background: rgba(62,224,196,0.08);
}
.recent-book .rb-main {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 0;
  cursor: pointer;
  min-width: 0;
}
.recent-book .rb-title {
  display: block;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-book .rb-meta {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  color: var(--muted);
  line-height: 1.35;
}
.recent-book .rb-del {
  appearance: none;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,0.25);
  color: var(--muted);
  border-radius: 8px;
  font-size: 11px;
  padding: 4px 6px;
  cursor: pointer;
}
.recent-book .rb-del:hover {
  color: #fecaca;
  border-color: rgba(248,113,113,0.5);
}


.cand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--cand-grid-min, 72px), 1fr));
  gap: 6px;
  max-width: 420px;
  margin-top: 8px;
}

.cand {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1.5px solid transparent;
  aspect-ratio: var(--asset-aspect-ratio, 9 / 16);
  background: #111;
  transition: 0.15s ease;
  width: 100%;
  max-width: none;
}
.cand-wide,
.turnaround-grid .cand {
  aspect-ratio: var(--asset-aspect-ratio, 9 / 16);
  max-width: none;
}
.turnaround-grid {
  grid-template-columns: repeat(auto-fill, minmax(var(--cand-grid-min, 72px), 1fr));
  max-width: 420px;
}
.cand img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #1a2230;
  cursor: zoom-in;
}
.cand .img-fallback {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  padding: 4px;
  text-align: center;
  font-size: 10px;
  color: #fff;
  background: linear-gradient(160deg, #1f2937, #0f766e);
  pointer-events: none;
}
.cand .img-fallback.is-on {
  display: grid;
}
.cand:hover {
  border-color: rgba(255, 255, 255, 0.22);
}
.cand.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(62,224,196,0.25);
}
.cand .badge {
  position: absolute;
  left: 4px;
  top: 4px;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  border: 1px solid var(--stroke);
  pointer-events: none;
  z-index: 1;
}
.cand-pick {
  position: absolute;
  right: 4px;
  bottom: 4px;
  z-index: 2;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(62,224,196,0.45);
  background: rgba(0, 0, 0, 0.72);
  color: var(--accent);
  cursor: pointer;
  opacity: 0.88;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.cand:hover .cand-pick,
.cand.selected .cand-pick {
  opacity: 1;
}
.cand-pick:hover {
  background: rgba(62, 224, 196, 0.22);
}
.cand-del {
  position: absolute;
  right: 4px;
  top: 4px;
  z-index: 2;
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid rgba(255, 107, 122, 0.45);
  background: rgba(0, 0, 0, 0.72);
  color: var(--danger);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.9;
}
.cand-del:hover {
  background: rgba(255, 107, 122, 0.25);
}

/* 图片放大预览 */
.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: grid;
  place-items: center;
  padding: 28px 16px 48px;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  cursor: zoom-out;
}
.img-lightbox[hidden] {
  display: none !important;
}
.img-lightbox img {
  max-width: min(960px, 94vw);
  max-height: min(86vh, 860px);
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  cursor: default;
  background: #0a1018;
}
.img-lightbox-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(20, 24, 34, 0.85);
  color: var(--text);
  font-size: var(--fs-xl);
  line-height: 1;
  cursor: pointer;
}
.img-lightbox-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.img-lightbox-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  pointer-events: none;
}

.toast-stack {
  position: fixed;
  right: 20px;
  top: 20px;
  bottom: auto;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  min-width: 220px;
  max-width: 360px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(12,16,24,0.94);
  border: 1px solid var(--stroke-strong);
  backdrop-filter: blur(12px);
  animation: fadeUp 0.25s ease;
  font-size: var(--fs-sm);
  pointer-events: none;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}
.toast.err { border-color: rgba(255,107,122,0.45); color: #fecaca; }
.toast.ok { border-color: rgba(74,222,128,0.55); color: #bbf7d0; }

.mini-btn.copied {
  border-color: rgba(74, 222, 128, 0.55) !important;
  color: #86efac !important;
}
.copy-prompt-btn.copied,
.accent-btn.copied {
  border-color: rgba(74, 222, 128, 0.7) !important;
  color: #bbf7d0 !important;
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.28), rgba(62, 224, 196, 0.16)) !important;
}

/* —— 磨砂玻璃弹窗 —— */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 24px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.32s ease, visibility 0.32s ease;
}
.modal-root.open {
  pointer-events: auto;
  opacity: 1;
  visibility: visible;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(62,224,196,0.08), transparent 45%),
    radial-gradient(ellipse at 70% 80%, rgba(90,167,255,0.1), transparent 50%),
    rgba(0,0,0,0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.32s ease;
}
.modal-root.open .modal-backdrop { opacity: 1; }

.glass-modal {
  position: relative;
  width: min(560px, 100%);
  max-height: min(86vh, 720px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.12);
  background:
    linear-gradient(160deg, rgba(28,34,48,0.92) 0%, rgba(8,10,16,0.94) 55%, rgba(12,18,28,0.96) 100%);
  box-shadow:
    0 0 0 1px rgba(62,224,196,0.08) inset,
    0 24px 60px rgba(0,0,0,0.55),
    0 0 80px rgba(90,167,255,0.08);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  transform: translateY(18px) scale(0.96);
  opacity: 0;
  transition:
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.32s ease;
}
.modal-root.open .glass-modal {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.modal-root.closing .glass-modal {
  transform: translateY(12px) scale(0.97);
  opacity: 0;
  transition-duration: 0.22s;
}
.modal-root.closing .modal-backdrop {
  opacity: 0;
  transition-duration: 0.22s;
}
.modal-root.wide .glass-modal { width: min(760px, 100%); }
.modal-root.wide .glass-modal .modal-body {
  max-height: min(68vh, 560px);
}
.modal-root.render-confirm-wide .glass-modal {
  width: min(920px, 96vw);
  max-height: min(92vh, 900px);
}
.modal-root.render-confirm-wide .glass-modal .modal-body {
  max-height: min(72vh, 700px);
}
.modal-root.wide:has(.prompt-confirm) .glass-modal {
  width: min(880px, 96vw);
}
.modal-root.wide:has(.prompt-confirm) .glass-modal .modal-body {
  max-height: min(74vh, 720px);
}
.prompt-confirm-intro {
  margin-bottom: 12px;
}
.prompt-preview-wrap {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.prompt-preview-heading {
  margin: 0 0 8px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
}
.prompt-preview-note {
  margin: 0 0 10px;
  font-size: var(--fs-xs, 12px);
  line-height: 1.45;
}
.prompt-preview-loading {
  margin: 0;
  font-size: var(--fs-sm);
}
.prompt-preview-loading.err {
  color: #f07178;
}
.prompt-preview-block {
  margin: 0 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  overflow: hidden;
}
.prompt-preview-block summary {
  cursor: pointer;
  padding: 8px 12px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
  list-style: none;
  user-select: none;
}
.prompt-preview-block summary::-webkit-details-marker {
  display: none;
}
.prompt-preview-block summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 6px;
  opacity: 0.7;
  transition: transform 0.15s ease;
}
.prompt-preview-block[open] summary::before {
  transform: rotate(90deg);
}
.prompt-preview-pre {
  margin: 0;
  padding: 0 12px 12px;
  max-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.render-confirm-meta {
  margin: 0 0 6px;
  font-size: var(--fs-sm);
  color: var(--text);
}
.render-confirm-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}
.render-confirm-seg {
  padding: 12px 12px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(160deg, rgba(255,255,255,0.04), rgba(0,0,0,0.22));
}
.render-confirm-seg-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 8px;
}
.render-confirm-seg-idx {
  font-weight: 700;
  color: var(--accent);
  font-size: var(--fs-sm);
}
.render-confirm-seg-title {
  font-weight: 600;
  color: var(--text);
}
.render-confirm-label {
  margin: 10px 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.render-confirm-shots {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.render-confirm-shot .dlg {
  margin-top: 2px;
  color: var(--accent);
  opacity: 0.92;
}
.render-confirm-prompt {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.06);
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  max-height: 220px;
  overflow: auto;
  color: var(--text);
}
.render-confirm-refs {
  margin-bottom: 2px;
}

/* 角色库大全 */
.char-catalog { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.cc-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.cc-stat {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 10px 8px;
  background: rgba(0,0,0,0.22);
  text-align: center;
}
.cc-stat b {
  display: block;
  font-size: 18px;
  font-weight: 650;
  color: var(--accent);
  line-height: 1.1;
}
.cc-stat span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}
.cc-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.cc-search { flex: 1 1 220px; min-width: 0; margin: 0; }
.cc-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.cc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.cc-chip {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.cc-chip span {
  color: var(--muted);
  font-size: 11px;
}
.cc-chip.is-on {
  border-color: rgba(62,224,196,0.5);
  background: rgba(62,224,196,0.12);
  color: var(--accent);
}
.cc-body { display: flex; flex-direction: column; gap: 16px; }
.cc-novel {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px;
  background: rgba(8,12,20,0.45);
}
.cc-novel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.cc-novel-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}
.cc-novel-head .muted { margin: 4px 0 0; font-size: 12px; }
.cc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.cc-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 8px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 8px;
  background: rgba(0,0,0,0.22);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.cc-card:hover {
  border-color: rgba(62,224,196,0.4);
  background: rgba(62,224,196,0.06);
}
.cc-thumb {
  position: relative;
  width: 64px;
  height: 86px;
  border-radius: 8px;
  overflow: hidden;
  background: #121820;
  display: grid;
  place-items: center;
}
.cc-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cc-thumb.is-empty span {
  font-size: 10px;
  color: var(--muted);
  writing-mode: horizontal-tb;
}
.cc-lock {
  position: absolute;
  left: 4px;
  bottom: 4px;
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(0,0,0,0.65);
  color: #fda4af;
}
.cc-lock.on { color: #7ff0dc; }
.cc-info { min-width: 0; }
.cc-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cc-meta, .cc-foot {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cc-desc {
  margin-top: 4px;
  font-size: 11px;
  color: rgba(232,237,247,0.78);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}
.cc-empty-novel { margin: 4px 0; font-size: 12px; }
.cc-thumb--scene {
  width: 86px;
  height: 64px;
}
.cc-card--scene {
  grid-template-columns: 86px 1fr;
}
@media (max-width: 720px) {
  .cc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cc-grid { grid-template-columns: 1fr; }
  .book-fab--chars { top: calc(50% + 100px); padding: 10px 6px; }
  .book-fab--scenes { top: calc(50% + 200px); padding: 10px 6px; }
}
.modal-root.wide:has(.batch-auto-config) .glass-modal {
  max-height: min(90vh, 740px);
  overflow-x: hidden;
  overflow-y: auto;
}
.modal-root.wide:has(.batch-auto-config) .glass-modal .modal-body {
  max-height: none;
  overflow-x: hidden;
  overflow-y: visible;
}

.modal-glow {
  position: absolute;
  inset: -40% -20% auto;
  height: 55%;
  background: linear-gradient(120deg, rgba(62,224,196,0.18), rgba(90,167,255,0.12), transparent 70%);
  pointer-events: none;
  filter: blur(8px);
}
.modal-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.modal-head h2 {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #e8f7ff, #9ee9d8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  color: var(--muted);
  font-size: var(--fs-lg);
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.modal-close:hover {
  color: var(--text);
  border-color: rgba(255,107,122,0.35);
  background: rgba(255,107,122,0.1);
}
.modal-body {
  position: relative;
  padding: 12px 14px;
  overflow-y: auto;
  flex: 1;
  font-size: var(--fs-md);
  line-height: 1.55;
  color: var(--text);
}
.modal-body .muted { color: var(--muted); font-size: var(--fs-sm); }
.modal-foot {
  position: relative;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px 18px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.25));
}

.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.settings-block {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(145deg, rgba(255,255,255,0.04), rgba(0,0,0,0.25));
}
.settings-block h3 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}
.tag-live, .tag-mock {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid;
}
.tag-live { color: var(--ok); border-color: rgba(74,222,128,0.35); }
.tag-mock { color: #fbbf24; border-color: rgba(251,191,36,0.35); }
.settings-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.settings-row:last-child { margin-bottom: 0; }
.settings-row label {
  font-size: 12px;
  color: var(--muted);
}
.settings-row .field {
  margin: 0;
  font-size: 13px;
}
.key-input-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.key-input-wrap .field { min-width: 0; }

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  font-size: 13px;
  color: var(--muted);
}
.check-row input { accent-color: var(--accent); }

.prompt-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.prompt-fields .field-label { margin-top: 0; }

.loading-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  background:
    radial-gradient(ellipse at 40% 30%, rgba(62,224,196,0.06), transparent 40%),
    rgba(0,0,0,0.55);
  display: grid;
  place-items: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 20px;
}
.loading-mask[hidden] {
  display: none !important;
}
.loading-mask.docked {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  place-items: end;
  justify-content: end;
  pointer-events: none;
  padding: 20px;
}
.loading-mask.docked .progress-panel {
  pointer-events: auto;
  width: min(380px, calc(100vw - 40px));
  box-shadow: 0 16px 48px rgba(0,0,0,0.55);
}
.progress-panel {
  position: relative;
  width: min(620px, 100%);
  padding: 22px 22px 16px;
  overflow: hidden;
  animation: modalPop 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.progress-minimize {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: var(--fs-lg);
  line-height: 1;
  cursor: pointer;
}
.progress-minimize:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.progress-ok-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 18px;
  font-weight: 700;
  color: #04140f;
  background: linear-gradient(135deg, var(--accent), #7dffa8);
  box-shadow: 0 0 0 4px rgba(62, 224, 196, 0.18);
}
.progress-panel.is-success .loader-spin,
.progress-panel.is-error .loader-spin {
  display: none;
}
.progress-panel.is-success .progress-minimize,
.progress-panel.is-error .progress-minimize {
  display: none;
}
.progress-panel.is-success .progress-bar-fill {
  background: linear-gradient(90deg, var(--accent), #7dffa8);
}
.progress-panel.is-error .progress-ok-icon {
  background: linear-gradient(135deg, #ff8a9a, #ff6b7a);
  color: #2a0610;
  box-shadow: 0 0 0 4px rgba(255, 107, 122, 0.18);
}
.progress-panel.is-error .progress-bar-fill {
  background: linear-gradient(90deg, #ff8a9a, var(--danger));
}
.progress-result-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
  gap: 8px;
}
.progress-result-actions[hidden] {
  display: none !important;
}
.progress-result-actions .primary-btn {
  min-width: 108px;
}
.progress-run-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}
.progress-run-actions[hidden] {
  display: none !important;
}
.ghost-btn.danger-btn {
  border-color: rgba(255, 107, 122, 0.45);
  color: #fecaca;
}
.ghost-btn.danger-btn:hover {
  border-color: rgba(255, 107, 122, 0.7);
  color: #fff;
  background: rgba(255, 80, 100, 0.12);
}
/* 进度卡复用 glass-modal 外观，但不走 API 弹窗的 open 态，需强制可见 */
.progress-panel.glass-modal {
  opacity: 1;
  transform: none;
  width: min(620px, calc(100vw - 40px));
  max-height: none;
  display: block;
}
.progress-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.progress-head h3 {
  margin: 0 0 4px;
  font-size: var(--fs-lg);
  font-weight: 600;
  background: linear-gradient(90deg, #e8f7ff, #9ee9d8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.progress-head .muted { margin: 0; font-size: 12px; }
.loader-spin {
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  border-top-color: var(--accent);
  animation: spinSlow 0.8s linear infinite;
}
.loader-spin.sm {
  width: 28px;
  height: 28px;
  margin: 0;
  flex-shrink: 0;
}
.progress-bar-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.progress-bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px rgba(62,224,196,0.35);
  transition: width 0.35s ease-out;
}

.progress-pct {
  font-size: 12px;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  min-width: 36px;
  text-align: right;
}
.progress-stage {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 500;
}
.progress-detail {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.5;
  min-height: 1.5em;
}
.progress-wait-hint {
  margin: 0 0 14px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(251, 191, 36, 0.28);
  background: rgba(251, 191, 36, 0.08);
  color: #fbbf24;
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
  animation: wait-hint-pulse 2.4s ease-in-out infinite;
}
.progress-wait-hint[hidden] {
  display: none;
}
@keyframes wait-hint-pulse {
  0%, 100% { opacity: 0.82; }
  50% { opacity: 1; }
}
.progress-panel.is-success .progress-wait-hint,
.progress-panel.is-error .progress-wait-hint {
  display: none;
}
.progress-steps {
  list-style: none;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.25);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
}
.progress-steps li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}
@media (max-width: 520px) {
  .progress-steps {
    grid-template-columns: 1fr;
  }
}
.progress-steps li .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  flex-shrink: 0;
}
.progress-steps li.done { color: var(--ok); }
.progress-steps li.done .dot { background: var(--ok); }
.progress-steps li.active {
  color: var(--text);
}
.progress-steps li.active .dot {
  background: var(--accent);
  box-shadow: 0 0 8px rgba(62,224,196,0.5);
}
.progress-log {
  margin: 0 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.32);
  overflow: hidden;
}
.progress-log[hidden] {
  display: none;
}
.progress-log-head {
  padding: 8px 12px 4px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.progress-log-list {
  list-style: none;
  margin: 0;
  padding: 4px 10px 10px;
  max-height: min(42vh, 320px);
  overflow-y: auto;
  display: grid;
  gap: 5px;
  scroll-behavior: smooth;
}
.progress-log-list li {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 8px;
  align-items: start;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}
.progress-log-list li.is-latest {
  color: var(--text);
}
.progress-log-list li.is-new {
  animation: log-in 0.28s ease;
}
.progress-log-list li .log-at {
  font-variant-numeric: tabular-nums;
  opacity: 0.7;
  flex-shrink: 0;
}
.progress-log-list li .log-stage {
  display: inline-block;
  margin-right: 6px;
  padding: 0 5px;
  border-radius: 4px;
  font-size: 10px;
  line-height: 1.6;
  color: var(--accent);
  background: rgba(62, 224, 196, 0.12);
  vertical-align: middle;
}
.progress-log-list li .log-text {
  word-break: break-word;
}
.progress-log-list li.is-latest .log-text::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  margin-bottom: 1px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(62,224,196,0.55);
  vertical-align: middle;
}
@keyframes log-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.progress-panel.is-success .progress-log,
.progress-panel.is-error .progress-log {
  display: none;
}
.progress-tip {
  margin: 0;
  font-size: 11px;
  text-align: center;
}

@keyframes modalPop {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chapter-mode-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.chapter-toolbar-right {
  margin-left: auto;
}
.orch-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--stroke-strong);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}
.orch-opt {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: 0.2s ease;
}
.orch-opt:hover { color: var(--text); }
.orch-opt.active {
  color: #0b1c1a;
  background: linear-gradient(135deg, #3ee0c4, #5aa7ff);
  box-shadow: 0 6px 18px rgba(62, 224, 196, 0.25);
}
.orch-help-btn { font-size: 12px; }
.orch-help {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: min(60vh, 480px);
  overflow: auto;
}
.orch-help h4 {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--accent);
}
.orch-help p, .orch-help li {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
}
.orch-help ol {
  margin: 0;
  padding-left: 1.2em;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.batch-auto-config {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-x: hidden;
  overflow-y: visible;
  padding-bottom: 4px;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.batch-auto-config > p {
  margin: 0 0 4px;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.batch-auto-config .field-label {
  margin-top: 8px;
  margin-bottom: 4px;
}
.batch-auto-config .check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 13px;
}
.option-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
}
.option-group.is-stacked {
  flex-direction: column;
}
.option-group.is-compact {
  flex-wrap: wrap;
  gap: 6px;
}
@media (min-width: 520px) {
  .option-group.is-compact {
    /* flex-wrap: nowrap; */
  }
}
.option-group.is-compact .option-chip {
  padding: 5px 10px;
  border-radius: 8px;
  align-items: center;
  flex: 1 1 0;
  justify-content: center;
  text-align: center;
}
.option-group.is-compact .option-chip-body {
  align-items: center;
}
.option-group.is-compact .option-chip-label {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.option-chip {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: 0.15s ease;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  font: inherit;
  color: inherit;
  text-align: left;
  -webkit-appearance: none;
  appearance: none;
}
.admin-api-page .settings-row > label {
  font-size: 12px;
  color: var(--muted);
}
.admin-api-page .option-chip {
  color: var(--text);
}
.admin-api-page .option-chip.is-active .option-chip-label {
  color: var(--accent);
}
.option-group:not(.is-stacked) .option-chip {
  flex: 0 1 auto;
}
.option-group.is-stacked .option-chip {
  width: 100%;
}
.option-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.option-chip-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.option-chip-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.option-chip-hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.option-chip:hover:not(.is-disabled) {
  border-color: rgba(62, 224, 196, 0.4);
}
.option-chip.is-active {
  border-color: rgba(62, 224, 196, 0.55);
  background: rgba(62, 224, 196, 0.12);
  box-shadow: 0 0 0 1px rgba(62, 224, 196, 0.12);
}
.option-chip.is-active .option-chip-label {
  color: var(--accent);
}
.option-chip.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.25);
}
.ba-section-title {
  margin: 12px 0 2px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-transform: none;
}
.ba-test-row {
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.ba-test-segs {
  width: 52px;
  margin: 0 4px;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
}
.ba-test-hint {
  margin: 4px 0 0;
  font-size: 12px;
}
.table-wrap {
  overflow: auto;
  max-height: min(52vh, 480px);
  margin-top: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
}
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.data-table th,
.data-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
}
.data-table th {
  position: sticky;
  top: 0;
  background: rgba(20, 20, 24, 0.96);
  font-weight: 600;
  white-space: nowrap;
}
.data-table a,
.render-history a {
  color: #7ff0dc;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(127, 240, 220, 0.45);
}
.data-table a:hover,
.render-history a:hover {
  color: #b8fff0;
  border-bottom-color: rgba(184, 255, 240, 0.85);
}
.full-auto-summary p {
  margin: 0 0 8px;
}
.full-auto-log-fold {
  margin-top: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.25);
}
.full-auto-log-fold summary {
  cursor: pointer;
  font-size: 13px;
  margin-bottom: 6px;
}
.full-auto-log-snapshot {
  max-height: min(36vh, 280px);
  padding: 0 !important;
}
.ba-credit-rate {
  margin: 8px 0 4px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(251, 191, 36, 0.28);
  background: rgba(251, 191, 36, 0.08);
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  max-width: 100%;
  box-sizing: border-box;
}
.ba-credit-rate b {
  color: #fbbf24;
  font-size: 15px;
  font-weight: 700;
}
.settings-row-block {
  flex-direction: column;
  align-items: stretch !important;
}
.settings-row-block > label {
  margin-bottom: 6px;
}
.settings-channel-hint {
  margin: -2px 0 8px 96px;
  font-size: 11px;
  line-height: 1.35;
}
#videoProviderBar,
#imageProviderBar {
  margin-bottom: 8px;
  max-width: 100%;
}
.chapter-item.has-check {
  grid-template-columns: 28px 48px 1fr auto;
}
.chapter-check {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.chapter-check input {
  width: 16px;
  height: 16px;
  accent-color: #3ee0c4;
}
.warn-btn {
  background: linear-gradient(135deg, rgba(255, 180, 90, 0.9), rgba(255, 120, 80, 0.85));
  color: #1a1208;
  border: 0;
}

.chapter-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar-actions[hidden],
#chapterBatchActions[hidden] {
  display: none !important;
}

.chapter-list {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chapter-item {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,0.22);
  cursor: pointer;
  transition: 0.2s ease;
}
.chapter-item:hover { border-color: var(--stroke-strong); }
.chapter-item.active {
  border-color: rgba(62,224,196,0.45);
  background: linear-gradient(135deg, rgba(62,224,196,0.1), rgba(90,167,255,0.06));
}
.chapter-item .num {
  font-family: var(--font-display);
  font-size: 12px;
  color: var(--accent);
}
.chapter-item .title { font-size: var(--fs-md); }
.chapter-item .meta { color: var(--muted); font-size: var(--fs-xs); margin-top: 2px; }
.chapter-item .actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; max-width: 340px; }
.chapter-gen-actions .mini-btn { white-space: nowrap; }
.chapter-gen-actions .archive-btn {
  color: var(--accent);
  border-color: rgba(62, 224, 196, 0.35);
}
.chapter-archive-hint {
  margin: 0 0 10px;
  font-size: 12px;
}
.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(52vh, 420px);
  overflow: auto;
}
.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,0.2);
}
.history-item-actions {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
  align-items: center;
}

.badge-status {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  font-size: 9px;
  vertical-align: middle;
}
.badge-status.completed,
.badge-status.done { color: var(--ok); border-color: rgba(74,222,128,0.35); }
.badge-status.failed,
.badge-status.paused,
.badge-status.moderation { color: #fbbf24; border-color: rgba(251,191,36,0.35); }
.badge-status.rendering,
.badge-status.scripting,
.badge-status.queued,
.badge-status.running,
.badge-status.auto_running { color: var(--accent-2); border-color: rgba(90,167,255,0.35); }
.badge-status.pending,
.badge-status.ready_render,
.badge-status.draft,
.badge-status.styled { color: var(--muted); border-color: rgba(255,255,255,0.18); }
.badge-status.skipped,
.badge-status.cancelled,
.badge-status.canceled { color: #94a3b8; border-color: rgba(148,163,184,0.35); }

.mod-info {
  line-height: 1.7;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,0.2);
}

.seg-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.mini-btn {
  appearance: none;
  border: 1px solid var(--stroke);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: var(--fs-xs);
  cursor: pointer;
}
.mini-btn.warn { border-color: rgba(251,191,36,0.4); color: #fbbf24; }
.mini-btn.danger { border-color: rgba(255,107,122,0.4); color: var(--danger); }

.version-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}
.version-chip {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  color: var(--muted);
}
.version-chip.active { color: var(--accent); border-color: rgba(62,224,196,0.45); }

@media (max-width: 1100px) {
  .app-shell { grid-template-columns: 248px 1fr; }
  .step2-layout {
    grid-template-columns: 1fr;
  }
  .panel[data-panel="2"] .style-grid,
  .style-grid { grid-template-columns: repeat(3, 1fr); }
  .cand-grid { grid-template-columns: repeat(auto-fill, minmax(var(--cand-grid-min, 64px), 1fr)); }
  .split, .script-layout, .final-layout { grid-template-columns: 1fr; }
  .video-model-list,
  .video-gen-block .video-model-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .stage-header {
    flex-direction: column;
    align-items: stretch;
  }
  .header-meta {
    justify-content: flex-start;
    width: 100%;
  }
  .context-bar {
    flex: 1 1 auto;
    min-width: 0;
    max-width: none;
    justify-content: flex-start;
  }
  .context-pill,
  .context-pill.accent,
  .context-pill.empty,
  .context-pill.accent.empty {
    flex: 1 1 0;
    width: auto;
    min-width: 0;
    max-width: none;
  }
}

@media (max-width: 820px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .side-rail {
    max-height: 160px;
  }
  .step-nav {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .step { white-space: nowrap; }
  .style-grid { grid-template-columns: repeat(2, 1fr); }
  .context-bar {
    flex-direction: column;
  }
}

/* —— 用户首页（整页无滚动条，仅列表区内滚） —— */
body.home-page {
  overflow: hidden;
  height: 100%;
}
.home-layout {
  position: relative;
  z-index: 1;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 14px;
  gap: 12px;
  overflow: hidden;
}
.home-top {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px 18px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
}
.home-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.home-top-tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.home-top-tags li {
  position: relative;
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(160deg, rgba(62, 224, 196, 0.12), rgba(90, 167, 255, 0.06)),
    rgba(255, 255, 255, 0.03);
  color: rgba(232, 236, 245, 0.92);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.04em;
  white-space: nowrap;
  animation: homeTagIn 0.45s ease both;
}
.home-top-tags li:nth-child(2) { animation-delay: 0.05s; }
.home-top-tags li:nth-child(3) { animation-delay: 0.1s; }
.home-top-tags li:nth-child(4) { animation-delay: 0.15s; }
.home-top-tags li:nth-child(5) { animation-delay: 0.2s; }
.home-top-tags li:nth-child(odd) {
  border-color: rgba(62, 224, 196, 0.28);
  color: var(--accent);
}
.home-top-tags li:nth-child(even) {
  border-color: rgba(90, 167, 255, 0.28);
  color: #9ec8ff;
}
@keyframes homeTagIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.home-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.home-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
}
.home-aside {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 2px;
}
.home-hero {
  flex: 0 0 auto;
  padding: 16px 16px 14px;
  border-radius: 16px;
  border: 1px solid rgba(62, 224, 196, 0.22);
  animation: authCardIn 0.4s ease both;
  background:
    radial-gradient(320px 120px at 8% -40%, rgba(62, 224, 196, 0.22), transparent 62%),
    radial-gradient(240px 100px at 100% 0%, rgba(90, 167, 255, 0.14), transparent 58%),
    linear-gradient(165deg, rgba(28, 30, 42, 0.72), rgba(12, 14, 20, 0.55));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.home-kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.home-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(28px, 4vw, 38px);
  letter-spacing: 0.1em;
  line-height: 1;
}
.home-tagline {
  margin: 10px 0 0;
  color: var(--text);
  font-size: clamp(15px, 1.8vw, 18px);
  font-weight: 650;
  letter-spacing: 0.02em;
  line-height: 1.35;
}
.home-desc {
  margin: 8px 0 0;
  color: rgba(232, 236, 245, 0.78);
  font-size: var(--fs-sm);
  line-height: 1.55;
}
.home-pitch {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.home-pitch li {
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(62, 224, 196, 0.28);
  background: rgba(62, 224, 196, 0.08);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.home-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.home-desc-note {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.4;
}

/* 未登录产品介绍弹层 · AI 科技风 */
.intro-overlay {
  z-index: 1300;
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(62, 224, 196, 0.12), transparent 55%),
    rgba(2, 6, 14, 0.82);
  backdrop-filter: blur(10px);
  animation: introOverlayIn 0.35s ease both;
}
@keyframes introOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.intro-modal {
  position: relative;
  width: min(640px, 94vw);
  max-height: min(90vh, 760px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
  border-radius: 18px;
  border: 1px solid rgba(62, 224, 196, 0.35);
  box-shadow:
    0 0 0 1px rgba(90, 167, 255, 0.08) inset,
    0 24px 60px rgba(0, 0, 0, 0.55);
  background:
    linear-gradient(165deg, rgba(16, 22, 34, 0.96), rgba(8, 10, 18, 0.97));
  animation: introModalIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes introModalIn {
  from { opacity: 0; transform: translateY(18px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
.intro-fx {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
}
.intro-fx-grid {
  position: absolute;
  inset: -20%;
  background-image:
    linear-gradient(rgba(62, 224, 196, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(62, 224, 196, 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(ellipse 70% 55% at 50% 20%, #000 20%, transparent 72%);
  animation: introGridDrift 18s linear infinite;
}
@keyframes introGridDrift {
  from { transform: translateY(0); }
  to { transform: translateY(28px); }
}
.intro-fx-scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 28%;
  top: -30%;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(62, 224, 196, 0.08),
    rgba(90, 167, 255, 0.06),
    transparent
  );
  animation: introScan 4.5s ease-in-out infinite;
}
@keyframes introScan {
  0% { top: -30%; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { top: 95%; opacity: 0; }
}
.intro-fx-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(62, 224, 196, 0.22);
}
.intro-fx-ring-a {
  width: 220px;
  height: 220px;
  top: -70px;
  right: -50px;
  animation: introSpin 22s linear infinite;
  box-shadow: 0 0 40px rgba(62, 224, 196, 0.08);
}
.intro-fx-ring-b {
  width: 140px;
  height: 140px;
  top: -20px;
  right: -10px;
  border-color: rgba(90, 167, 255, 0.28);
  border-style: dashed;
  animation: introSpin 14s linear infinite reverse;
}
@keyframes introSpin {
  to { transform: rotate(360deg); }
}
.intro-fx-orb {
  position: absolute;
  width: 180px;
  height: 180px;
  top: -40px;
  left: -40px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(62, 224, 196, 0.22), transparent 68%);
  animation: introOrbPulse 3.2s ease-in-out infinite;
}
@keyframes introOrbPulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.08); }
}
.intro-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.35);
  color: rgba(232, 236, 245, 0.85);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.intro-close:hover {
  border-color: rgba(62, 224, 196, 0.45);
  color: var(--accent);
  background: rgba(62, 224, 196, 0.1);
}
.intro-body {
  position: relative;
  z-index: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 22px 22px 18px;
}
.intro-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(62, 224, 196, 0.35);
  background: rgba(62, 224, 196, 0.08);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  animation: introFadeUp 0.45s ease 0.05s both;
}
.intro-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(62, 224, 196, 0.55);
  animation: introDotPulse 1.6s ease-out infinite;
}
@keyframes introDotPulse {
  0% { box-shadow: 0 0 0 0 rgba(62, 224, 196, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(62, 224, 196, 0); }
  100% { box-shadow: 0 0 0 0 rgba(62, 224, 196, 0); }
}
.intro-kicker {
  margin: 0;
  color: rgba(158, 200, 255, 0.85);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.18em;
  animation: introFadeUp 0.45s ease 0.1s both;
}
.intro-brand {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: clamp(40px, 7vw, 56px);
  letter-spacing: 0.18em;
  line-height: 0.95;
  background: linear-gradient(105deg, #fff 10%, var(--accent) 48%, var(--accent-2) 88%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: introFadeUp 0.5s ease 0.14s both;
}
.intro-lead {
  margin: 12px 0 0;
  font-size: clamp(16px, 2.2vw, 19px);
  font-weight: 650;
  letter-spacing: 0.03em;
  line-height: 1.35;
  color: rgba(232, 236, 245, 0.95);
  animation: introFadeUp 0.45s ease 0.18s both;
}
.intro-copy {
  margin: 10px 0 0;
  color: rgba(232, 236, 245, 0.72);
  font-size: var(--fs-sm);
  line-height: 1.6;
  max-width: 48em;
  animation: introFadeUp 0.45s ease 0.22s both;
}
.intro-pipeline {
  display: flex;
  align-items: center;
  gap: 0;
  margin: 18px 0 0;
  padding: 12px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.28);
  animation: introFadeUp 0.45s ease 0.26s both;
}
.intro-pipe-node {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 48px;
}
.intro-pipe-node em {
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.intro-pipe-node span {
  font-size: 12px;
  font-weight: 650;
  color: rgba(232, 236, 245, 0.9);
}
.intro-pipe-line {
  flex: 1 1 auto;
  height: 2px;
  margin: 0 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(62, 224, 196, 0.15), rgba(62, 224, 196, 0.7), rgba(90, 167, 255, 0.55), rgba(90, 167, 255, 0.15));
  position: relative;
  overflow: hidden;
}
.intro-pipe-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), transparent);
  transform: translateX(-100%);
  animation: introPipeFlow 2.2s ease-in-out infinite;
}
.intro-pipe-line:nth-of-type(2)::after { animation-delay: 0.2s; }
.intro-pipe-line:nth-of-type(4)::after { animation-delay: 0.4s; }
.intro-pipe-line:nth-of-type(6)::after { animation-delay: 0.6s; }
@keyframes introPipeFlow {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.intro-features {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.intro-features li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 11px 11px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(145deg, rgba(62, 224, 196, 0.07), transparent 55%),
    rgba(255, 255, 255, 0.025);
  animation: introFadeUp 0.45s ease both;
}
.intro-features li:nth-child(1) { animation-delay: 0.3s; }
.intro-features li:nth-child(2) { animation-delay: 0.36s; }
.intro-features li:nth-child(3) { animation-delay: 0.42s; }
.intro-features li:nth-child(4) { animation-delay: 0.48s; }
.intro-feat-idx {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent-2);
  opacity: 0.9;
  padding-top: 1px;
}
.intro-features strong {
  display: block;
  color: rgba(232, 236, 245, 0.95);
  font-size: 13px;
  font-weight: 650;
}
.intro-features span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.intro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  animation: introFadeUp 0.45s ease 0.52s both;
}
.intro-cta-primary {
  min-width: 128px;
  justify-content: center;
  box-shadow: 0 0 24px rgba(62, 224, 196, 0.22);
}
.intro-cta-ghost {
  border-color: rgba(90, 167, 255, 0.35);
  color: #9ec8ff;
}
.intro-note {
  margin: 12px 0 0;
  font-size: 11px;
  line-height: 1.4;
  animation: introFadeUp 0.45s ease 0.56s both;
}
@keyframes introFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 560px) {
  .intro-features {
    grid-template-columns: 1fr;
  }
  .intro-pipeline {
    padding: 10px 6px;
  }
  .intro-pipe-node {
    min-width: 40px;
  }
  .intro-body {
    padding: 18px 14px 14px;
  }
}

/* 左侧账号资产卡 */
.home-account {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background:
    linear-gradient(165deg, rgba(62, 224, 196, 0.07), transparent 42%),
    rgba(18, 22, 32, 0.5);
}
.home-account.is-guest {
  background: rgba(18, 22, 32, 0.45);
}
.home-account-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.home-account-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #041018;
  background: linear-gradient(145deg, #7ef0d8, #5aa7ff);
  box-shadow: 0 8px 18px rgba(62, 224, 196, 0.22);
}
.home-account-avatar.is-member {
  background: linear-gradient(145deg, #fbbf24, #f59e0b 55%, #34d399);
  box-shadow: 0 8px 18px rgba(251, 191, 36, 0.22);
}
.home-account-meta {
  min-width: 0;
  flex: 1;
}
.home-account-name {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-account-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-account-pill {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}
.home-account-pill.is-vip {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.12);
}
.home-account-credits {
  position: relative;
  overflow: hidden;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(62, 224, 196, 0.28);
  background:
    radial-gradient(180px 60px at 90% 0%, rgba(62, 224, 196, 0.18), transparent 70%),
    rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
}
.home-account-credits[hidden] {
  display: none !important;
}
.home-account-credits-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.home-account-credits-label span {
  font-size: 11px;
  color: var(--muted);
}
.home-account-credits-label em {
  font-style: normal;
  font-size: 10px;
  color: rgba(62, 224, 196, 0.85);
}
.home-account-credits strong {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0.02em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.home-account-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.home-account-grid[hidden] {
  display: none !important;
}
.home-account-cell {
  min-width: 0;
  padding: 8px 9px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.26);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.home-account-cell span {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.home-account-cell strong {
  font-size: 13px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.home-hint {
  margin: 0;
  font-size: var(--fs-xs);
  line-height: 1.4;
  flex: 0 0 auto;
}
.home-aside-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: wrap;
}
.home-aside-actions .ghost-btn {
  flex: 1;
  padding: 7px 8px;
  font-size: 11px;
  min-width: calc(50% - 4px);
}
.invite-modal {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.invite-lead {
  margin: 0;
  font-size: 12px;
}
.invite-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.invite-stat {
  padding: 10px 8px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.invite-stat span {
  font-size: 10px;
  color: var(--muted);
}
.invite-stat strong {
  font-size: 18px;
  color: var(--accent);
  line-height: 1.1;
}
.invite-stat em {
  font-style: normal;
  font-size: 10px;
  color: var(--muted);
}
.invite-copy-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.invite-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.invite-field-label {
  font-size: 12px;
  color: var(--muted);
}
.invite-copy-row .field {
  margin-bottom: 0;
  min-width: 0;
}
.invite-copy-row .ghost-btn,
.invite-copy-row .primary-btn {
  height: 100%;
  min-height: 38px;
  white-space: nowrap;
  flex-shrink: 0;
}
.invite-records-title {
  margin: 4px 0 0;
  font-size: 13px;
}
.invite-table-wrap {
  max-height: 220px;
}
@media (max-width: 640px) {
  .invite-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.home-side-cards {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: stretch;
}
.home-side-cards:has(#homePricePanel[hidden]) {
  grid-template-columns: 1fr;
}
.home-mini {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.home-mini h3 {
  margin: 0 0 6px;
  font-size: var(--fs-sm);
}
.home-mini .muted,
.support-box {
  font-size: var(--fs-xs);
  line-height: 1.4;
}
.support-box p {
  margin: 0 0 4px;
}
.home-price[hidden] {
  display: none !important;
}
.home-price-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.home-price-chips .chip {
  max-width: 100%;
}
.home-main {
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 14px 14px 12px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  overflow: hidden;
}
.home-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
  flex: 0 0 auto;
}
.home-section-head h2 {
  margin: 0;
  font-size: var(--fs-lg);
}
.home-section-head .muted {
  margin: 4px 0 0;
  font-size: var(--fs-xs);
}
.home-book-list {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 2px;
}
.home-book-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.24);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
  flex: 0 0 auto;
}
.home-book-item:hover {
  border-color: rgba(62, 224, 196, 0.45);
  background: rgba(62, 224, 196, 0.06);
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.chip {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  font-size: 10px;
  color: var(--muted);
}
.home-modal {
  width: min(560px, 94vw);
  max-height: none;
  overflow: hidden;
  padding: 16px;
}
.home-modal.is-recharge-offer {
  width: min(520px, 94vw);
  padding: 12px 14px 12px;
}
.home-modal.is-invite-offer {
  width: min(640px, 94vw);
}
.home-modal.is-member-offer {
  width: min(980px, 96vw);
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.home-modal.is-member-offer .modal-head {
  padding: 14px 16px 10px;
  flex: 0 0 auto;
}
.home-modal.is-recharge-offer .modal-head {
  padding: 0 0 8px;
  flex: 0 0 auto;
}
.home-modal.is-member-offer #homeModalBody,
.home-modal.is-recharge-offer #homeModalBody,
.home-modal.is-recharge-offer #adminModalBody {
  overflow: visible;
  max-height: none;
  padding: 0;
  padding-top: 15px;
}
.member-offer {
  padding: 0 16px 14px;
}
.member-layout {
  display: grid;
  grid-template-columns: 1.05fr 1.2fr;
  gap: 12px;
  align-items: stretch;
}
.member-hero {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background:
    radial-gradient(420px 140px at 20% -20%, rgba(251, 191, 36, 0.22), transparent 60%),
    radial-gradient(360px 120px at 90% 0%, rgba(62, 224, 196, 0.14), transparent 55%),
    linear-gradient(160deg, rgba(28, 22, 10, 0.92), rgba(8, 10, 16, 0.95));
  padding: 16px 14px 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
}
.member-glow {
  position: absolute;
  inset: -40% -20% auto;
  height: 120%;
  background: radial-gradient(circle, rgba(251, 191, 36, 0.18), transparent 55%);
  pointer-events: none;
  animation: memberGlow 4.5s ease-in-out infinite alternate;
}
@keyframes memberGlow {
  from { transform: translateY(0) scale(1); opacity: 0.7; }
  to { transform: translateY(8px) scale(1.05); opacity: 1; }
}
.member-badge {
  display: inline-flex;
  align-self: center;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.12);
  color: #fbbf24;
  font-size: 10px;
  letter-spacing: 0.12em;
  font-weight: 650;
}
.member-title {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.04em;
}
.member-lead {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.member-price-row {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  margin-top: 10px;
}
.member-currency {
  font-size: 16px;
  color: #fbbf24;
  margin-bottom: 6px;
}
.member-price {
  font-size: 42px;
  line-height: 0.9;
  color: #fde68a;
  font-family: var(--font-display);
}
.member-unit {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
}
.member-price-sub {
  margin-top: 6px;
  color: rgba(253, 230, 138, 0.75);
  font-size: 11px;
}
.member-current {
  margin-top: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(62, 224, 196, 0.1);
  border: 1px solid rgba(62, 224, 196, 0.28);
  color: var(--text);
  font-size: 11px;
}
.member-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.member-save-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.member-save-grid-side {
  margin-top: 10px;
}
.member-save-item {
  padding: 8px 8px;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.member-save-item strong {
  font-size: 14px;
  color: var(--accent);
}
.member-save-item em {
  font-style: normal;
  font-size: 10px;
  color: var(--muted);
}
.member-compare {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.22);
}
.member-compare-head,
.member-compare-row {
  display: grid;
  grid-template-columns: 1.15fr 0.9fr 0.9fr;
  gap: 6px;
  padding: 6px 10px;
  font-size: 11px;
}
.member-compare-head {
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 10px;
}
.member-compare-row + .member-compare-row {
  border-top: 1px solid var(--stroke);
}
.member-compare .vip {
  color: #fbbf24;
  font-weight: 600;
}
.member-perks {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.member-perks li {
  padding: 7px 8px;
  border-radius: 10px;
  border: 1px solid rgba(62, 224, 196, 0.18);
  background: rgba(62, 224, 196, 0.06);
  font-size: 11px;
  line-height: 1.35;
  color: var(--text);
}
.member-perks b {
  color: var(--accent);
  margin-right: 4px;
}
.member-note {
  margin: 0;
  font-size: 10px;
  line-height: 1.4;
}
.member-cta {
  width: 100%;
  margin-top: auto;
  padding: 12px 14px;
  font-size: 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fbbf24, #f59e0b 45%, #34d399);
  color: #1a1205;
  box-shadow: 0 10px 24px rgba(251, 191, 36, 0.28);
}
.member-cta:hover {
  filter: brightness(1.05);
}
@media (max-width: 860px) {
  .member-layout {
    grid-template-columns: 1fr;
  }
  .home-modal.is-member-offer {
    width: min(96vw, 920px);
    max-height: 92vh;
    overflow: auto;
  }
  .home-modal.is-recharge-offer {
    width: min(94vw, 520px);
  }
}
.recharge-offer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.recharge-hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
}
.recharge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.recharge-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.recharge-card {
  appearance: none;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  border-radius: 12px;
  padding: 8px 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  text-align: left;
}
.recharge-card:hover {
  border-color: rgba(62, 224, 196, 0.4);
  background: rgba(62, 224, 196, 0.06);
}
.recharge-card.is-active {
  border-color: rgba(62, 224, 196, 0.55);
  background: linear-gradient(160deg, rgba(62, 224, 196, 0.14), rgba(0, 0, 0, 0.2));
  box-shadow: 0 0 0 1px rgba(62, 224, 196, 0.18);
}
.recharge-card.is-hot .recharge-points strong {
  color: var(--accent);
}
.recharge-points {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin-top: 0;
}
.recharge-points strong {
  font-size: 22px;
  line-height: 1;
  color: var(--accent);
}
.recharge-points span {
  font-size: 11px;
  color: var(--muted);
}
.recharge-price-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 1px;
}
.recharge-price-line b {
  font-size: 14px;
  font-weight: 650;
}
.recharge-price-line s {
  font-size: 10px;
  color: var(--muted);
  text-decoration: line-through;
}
.recharge-unit {
  margin-top: 0;
  font-style: normal;
  font-size: 10px;
  color: var(--muted);
}
.recharge-card.is-active .recharge-unit {
  color: rgba(62, 224, 196, 0.9);
}
.recharge-tag {
  font-size: 10px;
  color: var(--muted);
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: rgba(255, 255, 255, 0.04);
}
.recharge-card.is-hot .recharge-tag {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.12);
}
.recharge-custom {
  margin-top: 0;
}
.recharge-custom .field {
  gap: 4px;
}
.recharge-custom .field span {
  font-size: 11px;
}
.recharge-custom .field input {
  padding: 8px 10px;
  font-size: 13px;
}
.recharge-custom[hidden] {
  display: none !important;
}
.recharge-calc {
  margin: 0;
  font-size: var(--fs-xs);
}
.recharge-calc[hidden] {
  display: none !important;
}
.recharge-foot {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.recharge-summary {
  margin: 0;
  padding: 8px 12px;
  min-height: 0;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.28);
  font-size: 12px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}
.recharge-cta {
  appearance: none;
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 0;
  padding: 10px 14px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  color: #041018;
  background: linear-gradient(135deg, #3ee0c4 0%, #2bc4d8 48%, #5aa7ff 100%);
  box-shadow:
    0 10px 22px rgba(62, 224, 196, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}
.recharge-cta:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(62, 224, 196, 0.34);
}
.recharge-cta:active {
  transform: translateY(0);
  filter: brightness(0.98);
}
.recharge-cta-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 16, 24, 0.18);
  color: #041018;
  font-size: 12px;
  font-weight: 700;
}
.home-modal .auth-form .field input {
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.home-modal .auth-form .field input:focus {
  border-color: rgba(62, 224, 196, 0.55);
  box-shadow: 0 0 0 3px rgba(62, 224, 196, 0.12);
}
@media (max-width: 860px) {
  .recharge-grid,
  .recharge-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.home-mini.is-disabled,
.home-panel.is-disabled {
  opacity: 0.72;
}
@media (max-width: 1100px) {
  .home-top-tags li:nth-child(n + 4) {
    display: none;
  }
}
@media (max-width: 900px) {
  .home-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 42%) minmax(0, 1fr);
  }
  .home-aside {
    overflow-y: auto;
  }
  .home-side-cards {
    display: none;
  }
  .home-top {
    grid-template-columns: 1fr auto;
  }
  .home-top-tags {
    display: none;
  }
}
@media (max-width: 640px) {
  .home-layout { padding: 10px; gap: 8px; }
  .home-top { padding: 10px 12px; }
  .home-account-credits strong { font-size: 24px; }
}

/* —— 管理后台 —— */
html.admin-html,
html:has(body.admin-page),
body.admin-page {
  overflow: hidden !important;
  height: 100% !important;
  width: 100% !important;
  overscroll-behavior: none;
  position: relative;
}
.admin-shell {
  /* 绝对锁死视口：不用 grid/百分比，避免主区回流把侧栏压扁 */
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  z-index: 1;
  display: block !important;
  width: auto !important;
  height: auto !important;
  overflow: hidden !important;
  overflow-anchor: none;
  transform: none !important;
}
.admin-rail {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  bottom: 0 !important;
  width: 220px !important;
  max-width: 220px !important;
  min-width: 220px !important;
  height: auto !important;
  max-height: none !important;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px 14px;
  border-right: 1px solid var(--stroke);
  overflow: hidden !important;
  box-sizing: border-box;
  /* 禁用 backdrop-filter：Safari/Chrome 在滚动回流时会把侧栏画「塌」 */
  border-radius: 0 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(10, 14, 22, 0.96) !important;
  transform: none !important;
}
.admin-rail > .home-brand {
  flex: 0 0 auto;
}
.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overflow-anchor: none;
}
.admin-nav-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  flex: 0 0 auto;
}
.admin-nav-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}
.admin-nav-btn.is-active {
  color: var(--text);
  border-color: var(--stroke);
  background: rgba(62, 224, 196, 0.1);
}
.admin-rail-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 auto;
}
.admin-main {
  position: absolute !important;
  top: 0 !important;
  left: 220px !important;
  right: 0 !important;
  bottom: 0 !important;
  width: auto !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: auto !important;
  overflow-anchor: none;
  padding: 22px 22px 40px;
  display: block;
  transform: none !important;
  box-sizing: border-box;
}
/* 积分页用 class 控制，避免 :has 残留影响其它视图 */
.admin-main.is-credits {
  overflow: hidden !important;
  display: flex;
  flex-direction: column;
  padding-bottom: 16px;
}
/* 模型表：禁止纵向嵌套滚动（父子双滚动是坍塌主因） */
#modelsTable.admin-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  max-height: none;
}
.admin-title {
  margin: 0 0 16px;
  font-size: 22px;
}
.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.stat-card {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stat-card strong {
  font-size: 24px;
}
.admin-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.admin-toolbar .admin-title { margin: 0; }
.admin-toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: nowrap;
}
.admin-form-fields.auth-form .field,
.admin-form.auth-form .field {
  margin: 0;
}
.admin-search-input {
  appearance: none;
  box-sizing: border-box;
  height: 36px;
  width: 220px;
  max-width: 46vw;
  margin: 0;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  border-radius: 10px;
  padding: 0 12px;
  outline: none;
  font-size: var(--fs-sm);
  line-height: 1;
}
.admin-search-input::placeholder {
  color: var(--muted);
}
.admin-search-input:focus {
  border-color: rgba(62, 224, 196, 0.55);
  box-shadow: 0 0 0 3px rgba(62, 224, 196, 0.12);
}
.admin-toolbar-actions > .ghost-btn {
  height: 36px;
  padding: 0 14px;
  box-sizing: border-box;
  flex-shrink: 0;
}
.admin-form-fields.auth-form .field input,
.admin-form.auth-form .field input,
.admin-modal .auth-form .field input {
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 14px;
  outline: none;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}
.admin-form-fields.auth-form .field input:focus,
.admin-form.auth-form .field input:focus,
.admin-modal .auth-form .field input:focus {
  border-color: rgba(62, 224, 196, 0.55);
  box-shadow: 0 0 0 3px rgba(62, 224, 196, 0.12);
}
.admin-inline-input {
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 10px;
  outline: none;
  width: 100%;
  max-width: 160px;
}
.admin-inline-input:focus {
  border-color: rgba(62, 224, 196, 0.55);
  box-shadow: 0 0 0 3px rgba(62, 224, 196, 0.12);
}
.admin-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  max-width: 100%;
  overflow-anchor: none;
}
/* 用户详情弹窗内的子表仍需要内部滚动 */
.admin-modal .admin-table-wrap,
.admin-modal .user-detail-panel.admin-table-wrap {
  overflow: auto;
  max-height: min(42vh, 360px);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
}
.admin-table th,
.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--stroke);
  text-align: left;
  vertical-align: top;
}
.admin-table th {
  background: rgba(0,0,0,0.28);
  color: var(--muted);
  white-space: nowrap;
}
.admin-table td.clip {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: help;
}
.admin-table td.log-detail {
  max-width: 520px;
  white-space: normal;
  word-break: break-word;
  line-height: 1.45;
  overflow: visible;
  text-overflow: unset;
}
.admin-form {
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-form h3 {
  margin: 0 0 4px;
}
.admin-form .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-form .check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}
.admin-form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.admin-plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 12px 0 16px;
}
.admin-plan-card {
  margin-bottom: 0;
  min-width: 0;
}
.admin-plan-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.admin-plan-card-head h3 {
  margin: 0;
}
@media (max-width: 900px) {
  .admin-plan-grid {
    grid-template-columns: 1fr;
  }
}

/* 积分充值：紧凑一屏 */
.admin-credits-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}
.admin-credits-page .admin-toolbar {
  margin-bottom: 0;
  flex-shrink: 0;
}
.admin-credits-page .admin-title {
  font-size: 18px;
}
.admin-credit-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
  overflow: hidden;
}
.admin-credit-card {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-credit-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.admin-credit-card-head strong {
  font-size: 13px;
  font-weight: 600;
}
.admin-credit-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
}
.admin-credit-fields .field {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.admin-credit-fields .field > span,
.admin-credit-custom .field > span {
  font-size: 11px;
  color: var(--muted);
}
.admin-credit-card input,
.admin-credit-custom input {
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  border-radius: 8px;
  padding: 7px 9px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
  font-size: 13px;
}
.admin-credit-card input:focus,
.admin-credit-custom input:focus {
  border-color: rgba(62, 224, 196, 0.55);
  box-shadow: 0 0 0 2px rgba(62, 224, 196, 0.12);
}
.admin-credit-switch.ui-switch {
  margin: 0;
  padding: 8px 10px;
  gap: 10px;
}
.admin-credit-switch .ui-switch-title {
  font-size: 12px;
}
.admin-credit-switch .ui-switch-desc {
  font-size: 10px;
}
.admin-credit-switch .ui-switch-ui {
  width: 36px;
  height: 20px;
}
.admin-credit-switch .ui-switch-knob {
  width: 14px;
  height: 14px;
}
.admin-credit-switch:has(input:checked) .ui-switch-knob {
  transform: translateX(16px);
}
.admin-model-switch.ui-switch {
  display: inline-flex;
  grid-template-columns: none;
  margin: 0;
  padding: 4px;
  gap: 0;
  width: fit-content;
  min-width: 0;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.admin-model-switch.ui-switch:hover,
.admin-model-switch.ui-switch:has(input:checked) {
  border: 0;
  background: transparent;
  box-shadow: none;
}
.admin-model-switch .ui-switch-ui {
  width: 36px;
  height: 20px;
}
.admin-model-switch .ui-switch-knob {
  width: 14px;
  height: 14px;
}
.admin-model-switch:has(input:checked) .ui-switch-knob {
  transform: translateX(16px);
}
.admin-table td:has(.admin-model-switch) {
  text-align: center;
  vertical-align: middle;
}
.admin-models-table td.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--muted, #8b919a);
}
.admin-models-table tr.is-disabled {
  opacity: 0.72;
}
.admin-llm-prices {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 140px;
}
.admin-models-table {
  table-layout: auto;
}
.admin-models-table tbody tr {
  height: auto;
}
.admin-quality-prices {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 168px;
}
.admin-quality-hint {
  font-size: 11px;
  line-height: 1.2;
}
.admin-quality-row {
  display: grid;
  grid-template-columns: 42px 52px 52px;
  gap: 4px;
  align-items: center;
  font-size: 12px;
  margin: 0;
}
.admin-quality-row span {
  color: var(--muted, #888);
  text-transform: lowercase;
}
.admin-quality-row .admin-inline-input {
  width: 52px !important;
  padding: 2px 4px;
}
.admin-credit-custom {
  flex-shrink: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-credit-custom h3 {
  margin: 0;
  font-size: 13px;
}
.admin-credit-custom-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.admin-credit-custom-fields .field {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.admin-flag-switch.ui-switch {
  margin: 0;
  padding: 10px 12px;
}
@media (max-width: 900px) {
  .admin-credit-grid {
    grid-template-columns: 1fr;
    overflow: auto;
  }
  .admin-main.is-credits {
    overflow: auto;
  }
}
.admin-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 4px 2px 8px;
}
.admin-pager-meta {
  font-size: 12px;
}
.admin-pager-btns {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.admin-page-btn {
  appearance: none;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  border-radius: 10px;
  padding: 7px 12px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.admin-page-btn:hover:not(:disabled) {
  border-color: rgba(62, 224, 196, 0.45);
  background: rgba(62, 224, 196, 0.08);
}
.admin-page-btn.is-active {
  color: #041018;
  border-color: transparent;
  background: linear-gradient(135deg, #3ee0c4, #5aa7ff);
  font-weight: 650;
}
.admin-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.admin-page-ellipsis {
  color: var(--muted);
  padding: 0 2px;
}
.admin-modal .option-group {
  margin-top: 2px;
}
.admin-pre {
  max-height: 180px;
  overflow: auto;
  background: rgba(0,0,0,0.35);
  border-radius: 10px;
  padding: 10px;
  font-size: 11px;
}
.admin-modal {
  width: min(720px, 96vw);
  /* 后台弹窗禁用毛玻璃，避免开/关弹窗时背后布局被画塌 */
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(12, 16, 26, 0.96) !important;
  max-height: calc(100vh - 48px);
  overflow: auto;
  overflow-anchor: none;
  transform: none !important;
}
body.admin-page .modal-overlay {
  overflow: auto;
  overscroll-behavior: contain;
  align-items: flex-start;
  padding: 24px 16px;
  overflow-anchor: none;
}
body.admin-page .modal-overlay .modal-card.glass {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: rgba(12, 16, 26, 0.96) !important;
  margin: auto;
}
.admin-api-lead {
  margin: 0 0 14px;
  max-width: 920px;
}
.admin-api-warn {
  color: #fbbf24;
  display: inline-block;
  margin-left: 6px;
}
.admin-api-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}
@media (max-width: 820px) {
  .admin-api-status-grid {
    grid-template-columns: 1fr;
  }
}
.admin-api-status-card {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(145deg, rgba(255,255,255,0.04), rgba(0,0,0,0.22));
}
.admin-api-status-card h3 {
  margin: 0 0 8px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-api-status-card p {
  margin: 4px 0;
  font-size: 12px;
  color: var(--muted);
  word-break: break-all;
}
.admin-api-page {
  max-width: 820px;
  gap: 16px;
}
.admin-api-block {
  padding: 16px 16px 14px !important;
}
.admin-api-block .settings-row .field,
.admin-api-block .key-input-wrap .field {
  width: 100%;
  background: rgba(0,0,0,0.28);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  color: inherit;
  padding: 9px 12px;
}
.admin-api-switch.ui-switch {
  margin-top: 10px;
  width: 100%;
}
.admin-api-page-actions {
  display: flex;
  justify-content: flex-start;
  gap: 10px;
  margin: 16px 0 28px;
  max-width: 820px;
}
.admin-modal.is-recharge-offer {
  width: min(520px, 94vw);
  padding: 12px 14px 12px;
}
.admin-modal.is-user-detail {
  width: min(860px, 96vw);
  max-height: min(86vh, 920px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.admin-modal.is-user-detail .modal-head {
  flex: 0 0 auto;
}
.admin-modal.is-user-detail #adminModalBody {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.user-detail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  height: 100%;
}
.user-detail-summary {
  flex: 0 0 auto;
}
.user-detail-summary p {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}
.user-detail-summary strong {
  color: var(--text);
  font-weight: 700;
}
.user-detail-tabs {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--stroke);
  padding-bottom: 2px;
}
.user-detail-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.user-detail-tab em {
  font-style: normal;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  color: var(--muted);
}
.user-detail-tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
.user-detail-tab.is-active {
  color: var(--text);
  background: rgba(62, 224, 196, 0.1);
  box-shadow: inset 0 -2px 0 #3ee0c4;
}
.user-detail-tab.is-active em {
  border-color: rgba(62, 224, 196, 0.45);
  color: #3ee0c4;
}
.user-detail-panels {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}
.user-detail-panel {
  max-height: min(48vh, 420px);
  overflow: auto;
}
.user-detail-panel[hidden] {
  display: none !important;
}
.ledger-delta.is-plus {
  color: #3ee0c4;
  font-weight: 600;
}
.ledger-delta.is-minus {
  color: #f87171;
  font-weight: 600;
}
.admin-confirm-overlay {
  z-index: 1200;
}
.admin-confirm-card {
  width: min(420px, 92vw);
  padding: 16px;
}
.admin-confirm-msg {
  margin: 4px 0 18px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}
.admin-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.admin-confirm-danger {
  background: linear-gradient(135deg, #dc2626, #b91c1c) !important;
  color: #fff !important;
  border: none !important;
}
.admin-confirm-danger:hover {
  filter: brightness(1.06);
}
.recharge-remark-field {
  margin: 10px 0 0;
}
.recharge-remark-field > span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.recharge-remark-field input {
  width: 100%;
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: rgba(0, 0, 0, 0.28);
  color: var(--text);
  padding: 10px 12px;
}
.ghost-btn.sm,
.primary-btn.sm {
  padding: 6px 10px;
  font-size: 11px;
}
@media (max-width: 900px) {
  .admin-rail {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: auto !important;
    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: 42vh;
    border-right: 0;
    border-bottom: 1px solid var(--stroke);
  }
  .admin-main {
    left: 0 !important;
    top: 42vh !important;
  }
  .admin-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* —— 列表空状态 —— */
.list-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 8px;
  padding: 36px 24px 40px;
  min-height: 200px;
  box-sizing: border-box;
}
.list-empty-visual {
  position: relative;
  width: 72px;
  height: 72px;
  margin-bottom: 6px;
  border-radius: 18px;
  border: 1px solid rgba(62, 224, 196, 0.22);
  background:
    radial-gradient(circle at 30% 25%, rgba(62, 224, 196, 0.18), transparent 55%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.35));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.list-empty-visual::before,
.list-empty-visual::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  box-sizing: border-box;
}
.list-empty-visual::before {
  width: 28px;
  height: 34px;
  border-radius: 4px;
  border: 2px solid rgba(62, 224, 196, 0.55);
  background: rgba(4, 16, 24, 0.35);
}
.list-empty-visual::after {
  width: 14px;
  height: 2px;
  top: 58%;
  background: rgba(62, 224, 196, 0.45);
  box-shadow: 0 -6px 0 rgba(62, 224, 196, 0.28), 0 6px 0 rgba(62, 224, 196, 0.2);
}
.list-empty[data-icon="storage"] .list-empty-visual::before {
  width: 34px;
  height: 22px;
  border-radius: 3px 3px 5px 5px;
  border: 2px solid rgba(62, 224, 196, 0.55);
  background: rgba(4, 16, 24, 0.35);
  transform: translate(-50%, -40%);
}
.list-empty[data-icon="storage"] .list-empty-visual::after {
  width: 18px;
  height: 10px;
  border-radius: 3px 3px 0 0;
  border: 2px solid rgba(62, 224, 196, 0.4);
  border-bottom: 0;
  background: transparent;
  box-shadow: none;
  transform: translate(-50%, -120%);
}
.list-empty[data-icon="order"] .list-empty-visual::before {
  width: 30px;
  height: 32px;
  border-radius: 5px;
  border: 2px solid rgba(62, 224, 196, 0.55);
}
.list-empty[data-icon="order"] .list-empty-visual::after {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(62, 224, 196, 0.5);
  background: transparent;
  box-shadow: none;
  transform: translate(-20%, 20%);
}
.list-empty[data-icon="users"] .list-empty-visual::before,
.list-empty[data-icon="invite"] .list-empty-visual::before {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(62, 224, 196, 0.55);
  transform: translate(-50%, -70%);
}
.list-empty[data-icon="users"] .list-empty-visual::after,
.list-empty[data-icon="invite"] .list-empty-visual::after {
  width: 28px;
  height: 14px;
  border-radius: 14px 14px 6px 6px;
  border: 2px solid rgba(62, 224, 196, 0.45);
  background: transparent;
  box-shadow: none;
  transform: translate(-50%, 35%);
}
.list-empty[data-icon="logs"] .list-empty-visual::before {
  width: 30px;
  height: 28px;
  border-radius: 4px;
  border: 2px solid rgba(62, 224, 196, 0.55);
}
.list-empty[data-icon="logs"] .list-empty-visual::after {
  width: 16px;
  height: 2px;
  background: rgba(62, 224, 196, 0.5);
  box-shadow: 0 -7px 0 rgba(62, 224, 196, 0.35), 0 7px 0 rgba(62, 224, 196, 0.25);
}
.list-empty[data-icon="models"] .list-empty-visual::before {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  border: 2px solid rgba(62, 224, 196, 0.55);
  transform: translate(-50%, -50%) rotate(45deg);
}
.list-empty[data-icon="models"] .list-empty-visual::after {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(62, 224, 196, 0.55);
  box-shadow: none;
}
.list-empty[data-icon="books"] .list-empty-visual::before {
  width: 32px;
  height: 26px;
  border-radius: 3px;
  border: 2px solid rgba(62, 224, 196, 0.55);
  transform: translate(-50%, -45%);
}
.list-empty[data-icon="books"] .list-empty-visual::after {
  width: 2px;
  height: 22px;
  background: rgba(62, 224, 196, 0.45);
  box-shadow: none;
  transform: translate(-50%, -45%);
}
.list-empty-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}
.list-empty-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 280px;
}
.list-empty-actions {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.admin-table td.list-empty-cell {
  padding: 0;
  border-bottom: none;
  background: transparent;
}
.admin-table .list-empty {
  min-height: 170px;
}
#bookList .list-empty {
  min-height: 160px;
  padding: 28px 16px;
}
.invite-table-wrap .list-empty {
  min-height: 140px;
  padding: 24px 12px;
}
.storage-modal .list-empty {
  min-height: 160px;
}
