:root {
  color-scheme: dark;

  --purple: #8b74f8;        /* 图标、徽标底、强调 */
  --purple-2: #9d88fb;
  --purple-deep: #bcaaff;   /* 深底上的强调文字 */
  --purple-soft: rgba(124, 92, 246, 0.18);
  --purple-line: rgba(150, 120, 255, 0.34);

  --ink: 255, 255, 255;      /* 叠加层基色：暗色用白、亮色用深，rgba(var(--ink), x) */
  --bg: #000000;
  --card: #0a0a0b;
  --card-2: #101012;
  --line: rgba(var(--ink), 0.08);
  --line-soft: rgba(var(--ink), 0.06);

  --text: #f1eefb;
  --text-2: #c4bed9;
  --sub: #9791b0;
  --hint: #7b7593;

  --danger: #ff7b72;
  --mint-bg: rgba(72, 160, 120, 0.14);
  --mint-line: rgba(72, 160, 120, 0.3);
  --mint-text: #7fd3ac;

  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.5), 0 12px 32px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 13.5px;
  -webkit-font-smoothing: antialiased;
}

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

button { cursor: pointer; border: none; background: none; }

.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ---------------- sidebar ---------------- */

.sidebar {
  width: 218px;
  flex: 0 0 218px;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 14px 12px 10px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: width 0.18s ease, flex-basis 0.18s ease, padding 0.18s ease;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 8px 18px;
}

.brand-logo {
  width: 27px;
  height: 27px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 27px;
  overflow: hidden;
}

.brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
}

.brand-name {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--text);
  white-space: nowrap;
}

.nav-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 6px;
  padding-left: 10px;
  font-size: 13px;
  color: var(--hint);
}

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

.nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 11px;
  border-radius: 9px;
  color: #5c5c72;
  font-size: 14.5px;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.nav-item svg { width: 18px; height: 18px; flex: 0 0 18px; opacity: 0.85; }

.nav-item:hover { background: rgba(124, 92, 246, 0.13); color: #4a3bb5; }

.nav-item.active {
  background: linear-gradient(100deg, #6a58e8, #8272f2);
  color: #fff;
  box-shadow: 0 4px 12px rgba(106, 88, 232, 0.28);
}

.nav-item.active svg { opacity: 1; }

.nav-text { white-space: nowrap; }

/* 管理后台组：与「个人中心」并列，不再钉在底部 */
.nav-bottom {
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}

.sidebar-foot {
  margin-top: auto;
  padding: 10px 0 2px 12px;
  font-size: 12px;
  color: #c2c2d4;
}

/* 侧边栏底部备案号：法规要求可见且可点击回工信部查询系统 */
.sidebar-foot .beian-link {
  display: block;
  margin-bottom: 3px;
  color: #655f7d;
  line-height: 1.6;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.18s ease;
}

.sidebar-foot .beian-link:hover {
  color: #8b74f8;
  text-decoration: underline;
}

.sidebar-foot .ver {
  display: block;
  color: #4a4560;
  line-height: 1.6;
}

/* ---------------- main ---------------- */

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* SPA 视图：每个模块一个 view，点侧栏瞬间切换显示，无刷新无动画 */
.view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

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

.topbar {
  height: 58px;
  flex: 0 0 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px 0 14px;
  gap: 16px;
}

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

.crumbs-title {
  font-size: 13.5px;
  color: var(--text-2);
}

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6c6c85;
  transition: background 0.15s, color 0.15s;
}

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

.icon-btn.plain:hover { background: #eceaf7; color: var(--purple-deep); }

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

.credit-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-2);
}

.credit-pill svg { width: 15px; height: 15px; color: var(--purple); }

.credit-pill b {
  color: var(--purple-deep);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-2);
  margin-left: 4px;
}

.user-chip svg { width: 14px; height: 14px; color: var(--purple); }

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-2);
  transition: border-color 0.15s, color 0.15s;
}

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

.pill-btn:hover { border-color: var(--purple-line); color: var(--purple-deep); }

.pill-btn.danger { color: var(--danger); }
.pill-btn.danger:hover { border-color: #f3cfcd; background: #fef7f6; }

/* ---------------- card ---------------- */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  margin: 0 22px 18px;
  padding: 22px 26px 18px;
  flex: 0 0 auto;
  min-height: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
}

.card-head { flex: 0 0 auto; }

.card-title {
  display: flex;
  align-items: center;
  gap: 7px;
}

.card-title svg { width: 18px; height: 18px; color: var(--purple); }

.card-title h1 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.card-sub {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--hint);
}

.card-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 41%);
  gap: 26px;
  margin-top: 14px;
  flex: 1;
  min-height: 0;
}

.col-left {
  display: flex;
  flex-direction: column;
  gap: 13px;
  min-width: 0;
  min-height: 0;
  overflow: visible;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.field { min-width: 0; }

.flabel {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: #3d3d55;
  margin-bottom: 7px;
}

/* ---------------- select ---------------- */

.select { position: relative; }

.select-btn {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 13px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-align: left;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.select-btn:hover { border-color: #dcd8ee; }

.select.open .select-btn {
  border-color: var(--purple-line);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.08);
}

.select-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.select-label {
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.select-sub {
  font-size: 11px;
  color: #9d97c9;
}

.select-btn .chev {
  width: 15px;
  height: 15px;
  color: #b4b4c8;
  flex: 0 0 15px;
  transition: transform 0.18s;
}

.select.open .chev { transform: rotate(180deg); }

.select-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: 0 12px 32px rgba(40, 32, 90, 0.13);
  padding: 5px;
  max-height: 268px;
  overflow-y: auto;
  display: none;
}

.select.open .select-menu { display: block; }

.option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
}

.option .opt-sub {
  font-size: 11px;
  color: #a6a0cf;
  white-space: nowrap;
}

.option:hover { background: #f7f5ff; }

.option.selected {
  background: var(--purple-soft);
  color: var(--purple-deep);
  font-weight: 500;
}

.option.selected .opt-sub { color: #8b7fe0; }

/* ---------------- prompt ---------------- */

.prompt-field {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  min-height: 0;
}

.prompt-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.prompt-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line-soft);
  background: #fdfcff;
}

.mini-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 11.5px;
  color: var(--sub);
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}

.mini-btn svg { width: 13px; height: 13px; }

.mini-btn:hover { border-color: var(--purple-line); color: var(--purple-deep); }

.prompt-hint {
  font-size: 11px;
  color: var(--sub);
  margin-left: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#prompt {
  flex: 0 0 auto;
  height: 148px;
  min-height: 148px;
  border: none;
  outline: none;
  resize: none;
  padding: 14px 16px 8px;
  font-size: 13px;
  line-height: 1.95;
  color: #2c2c40;
  background: #fff;
  overflow-y: auto;
}

#prompt::placeholder { color: #b9b9cb; }

.mention-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 16px 2px;
  flex-wrap: wrap;
}

.mention-label {
  font-size: 11.5px;
  color: var(--hint);
}

.mention-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.mention-chip {
  display: inline-flex;
  align-items: center;
  height: 21px;
  padding: 0 7px;
  border-radius: 5px;
  border: 1px solid var(--purple-line);
  background: #f8f6ff;
  color: var(--purple-deep);
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.mention-chip:hover { background: var(--purple-soft); }

.prompt-counter {
  text-align: right;
  padding: 2px 16px 9px;
  font-size: 11px;
  color: var(--sub);
  font-variant-numeric: tabular-nums;
}

/* ---------------- gallery ---------------- */

.col-right {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.gallery-head {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin-bottom: 10px;
}

.gallery-head .flabel { margin-bottom: 0; }

.gallery-sub { font-size: 11.5px; color: var(--hint); }

.gallery-clear {
  margin-left: auto;
  align-self: center;
  font-size: 11.5px;
  line-height: 1;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  align-content: start;
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.thumb, .slot-empty {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  min-width: 0;
}

.thumb {
  border: 1px solid var(--line);
  background: #f4f2fa;
}

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

.thumb-badge {
  position: absolute;
  top: 7px;
  left: 7px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 6px;
  background: var(--purple);
  color: #fff;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.28);
}

.thumb-del {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(20, 16, 32, 0.62);
  color: #f2eeff;
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
  opacity: 0.9;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}

.thumb:hover .thumb-del { opacity: 1; }

.thumb-del:hover { background: rgba(255, 109, 99, 0.9); color: #fff; }

.slot-empty {
  border: 1px dashed #d7d3ee;
  background: #fbfaff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px;
  color: #b7b2d8;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.slot-empty:hover {
  border-color: var(--purple-line);
  color: var(--purple);
  background: #f8f6ff;
}

.slot-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 10px;
  border: 1px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.75;
}

.slot-icon svg { width: 21px; height: 21px; }

.slot-tip { display: none; }

/* 空态：整行一块大虚线区域，带图标与说明文字 */
.gallery.is-empty { grid-template-columns: 1fr; }

.gallery.is-empty .slot-empty {
  grid-column: 1 / -1;
  aspect-ratio: auto;
  min-height: 246px;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  text-align: center;
}

.gallery.is-empty .slot-icon { opacity: 0.9; }

.gallery.is-empty .slot-tip {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.slot-tip-main {
  font-size: 12.5px;
  line-height: 1.6;
  color: #8d87ab;
}

.slot-tip-sub {
  font-size: 11px;
  line-height: 1.6;
  color: #b3aecb;
}

.gallery.dragover .slot-empty {
  border-color: var(--purple);
  background: var(--purple-soft);
}

.gallery-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--hint);
}

.link-danger {
  font-size: 11.5px;
  color: #d9736c;
  padding: 2px 4px;
  border-radius: 5px;
}

.link-danger:hover { background: #fdf1f0; color: var(--danger); }

/* ---------------- footer ---------------- */

.card-foot {
  flex: 0 0 auto;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.name-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.name-counter {
  font-size: 11px;
  color: var(--sub);
  font-variant-numeric: tabular-nums;
}

.text-input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  outline: none;
  font-size: 13px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.text-input::placeholder { color: #bcbccb; }

.text-input:focus {
  border-color: var(--purple-line);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.08);
}

/* 密码框小眼睛（工作台内修改密码弹窗） */
.pwd-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.pwd-wrap .text-input { padding-right: 44px; }

.pwd-eye {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: #b0b0c4;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  transition: color 0.15s, background 0.15s;
}

.pwd-eye:hover { color: var(--purple); background: #f5f2ff; }
.pwd-eye:active { background: #ede7ff; }
.pwd-eye:focus-visible {
  outline: none;
  color: var(--purple);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.16);
}

.pwd-eye svg { width: 18px; height: 18px; display: block; pointer-events: none; }
.pwd-eye .eye-off { display: none; }
.pwd-eye.on { color: var(--purple); }
.pwd-eye.on .eye-on { display: none; }
.pwd-eye.on .eye-off { display: block; }

.helper {
  margin-top: 6px;
  font-size: 11px;
  color: var(--sub);
}

.submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
}

.total {
  font-size: 13px;
  color: var(--text-2);
}

.total b {
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  margin: 0 3px;
  font-variant-numeric: tabular-nums;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 42px;
  padding: 0 22px;
  border-radius: var(--r-md);
  background: linear-gradient(100deg, #6a58e8, #8272f2);
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 6px 16px rgba(106, 88, 232, 0.26);
  transition: transform 0.12s, box-shadow 0.18s, filter 0.18s;
}

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

.btn-primary:hover { filter: brightness(1.04); box-shadow: 0 8px 20px rgba(106, 88, 232, 0.32); }

.btn-primary:active { transform: translateY(1px); }

.btn-primary:disabled {
  background: #d8d5e8;
  box-shadow: none;
  cursor: not-allowed;
  color: #fff;
}

.restore-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  padding: 9px 13px;
  border-radius: var(--r-md);
  background: var(--mint-bg);
  border: 1px solid var(--mint-line);
  font-size: 12px;
  color: var(--mint-text);
}

.restore-bar b { font-weight: 600; }

.restore-bar.hidden { display: none; }

.restore-close {
  color: #8db3a0;
  font-size: 15px;
  line-height: 1;
  padding: 0 2px;
}

.restore-close:hover { color: var(--mint-text); }

/* ---------------- modal ---------------- */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(28, 24, 56, 0.32);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 80;
}

.modal.open { display: flex; }

.modal-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: var(--r-lg);
  padding: 22px 26px 24px;
  box-shadow: 0 20px 50px rgba(30, 22, 70, 0.22);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-head h2 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
}

.modal-close {
  font-size: 20px;
  line-height: 1;
  color: #a0a0b6;
  padding: 0 2px;
}

.modal-close:hover { color: var(--sub); }

.modal-sub {
  margin: 6px 0 18px;
  font-size: 12px;
  color: #9a9ab0;
}

.modal .field { margin-bottom: 14px; }

.form-error {
  min-height: 16px;
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--danger);
}

.modal-submit {
  width: 100%;
  justify-content: center;
}

/* ---------------- toast ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 14px);
  background: #26233a;
  color: #fff;
  font-size: 12.5px;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(20, 16, 50, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s, transform 0.22s;
  z-index: 90;
  max-width: 70vw;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------------- responsive ---------------- */

@media (max-width: 1180px) {
  /* 窄屏改为上下排列，页面整体滚动，避免两栏被卡片高度挤压 */
  .app { height: auto; overflow: visible; }
  .main { overflow: visible; }
  .card { height: auto; overflow: visible; }
  .col-left { overflow: visible; }
  .card-body { grid-template-columns: minmax(0, 1fr); }
  .gallery { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .app { height: auto; overflow: visible; }
  .main { overflow: visible; }
  .card { height: auto; overflow: visible; }
  .col-left { overflow: visible; }
  .sidebar { display: none; }
  .side-toggle { display: none; }
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 14px; gap: 8px; }
  .topbar-right { flex-wrap: wrap; justify-content: flex-end; }
  .card { margin: 0 12px 12px; padding: 18px 16px; }
  .grid-2 { grid-template-columns: 1fr; }
  #prompt { min-height: 220px; }
  .gallery { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------------- 启动遮罩 / 通用 ---------------- */

.hidden { display: none !important; }

.boot {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f6f5fb;
  transition: opacity 0.32s ease;
}

.boot.gone { opacity: 0; pointer-events: none; }

.boot-card { text-align: center; }

.boot-logo {
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  border-radius: 14px;
  background: url("assets/logo-dark.png") center / cover no-repeat;
  animation: bootPulse 1.4s ease-in-out infinite;
}

@keyframes bootPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.92); opacity: 0.72; }
}

.boot-text {
  margin: 0;
  font-size: 13px;
  color: #8a8aa0;
}

/* ================================================================
   深空暗色皮肤（与登录页同一套调性）
   只覆盖颜色与阴影，尺寸 / 布局 / 结构一律不动
   ================================================================ */

body {
  /* 纯黑：不再铺紫色雾光（2026-11-17 与后台统一） */
  background-color: var(--bg);
  background-image: none;
}

/* ---- 侧栏 ---- */

.sidebar {
  background: #000000;
  border-right-color: rgba(var(--ink), 0.07);
}

.brand-name { color: var(--text); }
.brand-logo { box-shadow: 0 6px 18px -8px rgba(124, 92, 246, 0.9); }
.sidebar-foot { color: #655f7d; }

.nav-item { color: #ffffff; font-weight: 600; }
.nav-item .nav-text { color: #ffffff; font-weight: 600; }
.nav-item svg { opacity: 1; }
.nav-item:hover { background: rgba(124, 92, 246, 0.18); color: #ffffff; }
.nav-item:hover svg { opacity: 1; }

.nav-item.active {
  background: linear-gradient(100deg, #7c5cf6, #9a7bfd);
  box-shadow: 0 6px 18px -6px rgba(124, 92, 246, 0.75);
}

/* ---- 顶栏小胶囊 ---- */

.icon-btn { color: #9d97b6; }
.icon-btn.plain:hover { background: rgba(var(--ink), 0.07); color: var(--purple-deep); }

.credit-pill,
.user-chip,
.pill-btn {
  background: rgba(var(--ink), 0.05);
  border-color: rgba(var(--ink), 0.1);
  color: var(--text-2);
}

.credit-pill b { color: var(--purple-deep); }
.pill-btn:hover { border-color: var(--purple-line); color: var(--purple-deep); }
.pill-btn.danger:hover { border-color: rgba(255, 109, 99, 0.42); background: rgba(255, 109, 99, 0.12); }

/* ---- 表单标签 ---- */

.flabel { color: var(--text-2); }

/* ---- 下拉选择 ---- */

.select-btn {
  background: rgba(var(--ink), 0.045);
  border-color: rgba(var(--ink), 0.1);
}

.select-btn:hover { border-color: rgba(var(--ink), 0.2); }

.select.open .select-btn {
  border-color: rgba(150, 120, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(124, 92, 246, 0.16);
}

.select-label { color: var(--text); }
.select-sub { color: var(--sub); }
.select-btn .chev { color: var(--sub); }

.select-menu {
  background: var(--card-2);
  border-color: rgba(var(--ink), 0.1);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.62);
}

.option { color: var(--text-2); }
.option .opt-sub { color: var(--sub); }
.option:hover { background: rgba(var(--ink), 0.06); }
.option.selected { background: rgba(124, 92, 246, 0.2); color: var(--purple-deep); }
.option.selected .opt-sub { color: #ac9ddb; }

/* ---- 提示词区 ---- */

.prompt-box {
  border-color: rgba(var(--ink), 0.1);
  background: rgba(var(--ink), 0.02);
}

.prompt-toolbar {
  background: rgba(var(--ink), 0.04);
  border-bottom-color: var(--line-soft);
}

.mini-btn {
  background: rgba(var(--ink), 0.05);
  border-color: rgba(var(--ink), 0.1);
  color: var(--text-2);
}

.mini-btn:hover { border-color: var(--purple-line); color: var(--purple-deep); }
.prompt-hint { color: var(--hint); }

#prompt {
  background: transparent;
  color: var(--text);
}

#prompt::placeholder { color: var(--hint); }

.mention-chip {
  background: rgba(124, 92, 246, 0.14);
  border-color: rgba(150, 120, 255, 0.3);
  color: var(--purple-deep);
}

.mention-chip:hover { background: rgba(124, 92, 246, 0.24); }
.prompt-counter { color: var(--hint); }

/* ---- 参考图 ---- */

.thumb { background: #1d1930; border-color: var(--line); }

.thumb-del {
  background: rgba(20, 16, 32, 0.62);
  color: #efeaff;
}

.thumb-del:hover { background: rgba(255, 109, 99, 0.85); color: #fff; }

.slot-empty {
  border-color: rgba(var(--ink), 0.14);
  background: rgba(var(--ink), 0.025);
  color: var(--hint);
}

.slot-empty:hover {
  border-color: var(--purple-line);
  background: rgba(124, 92, 246, 0.09);
  color: var(--purple-deep);
}

.slot-tip-main { color: #a49ec0; }
.slot-tip-sub { color: var(--hint); }

.gallery.dragover .slot-empty { background: rgba(124, 92, 246, 0.2); }

/* ---- 侧栏折叠态 ---- */

.side-toggle svg { transition: transform 0.18s ease; }

.app.collapsed .sidebar {
  width: 64px;
  flex-basis: 64px;
  padding: 14px 8px 10px;
}

.app.collapsed .brand {
  justify-content: center;
  padding: 2px 0 16px;
}

.app.collapsed .brand-name { display: none; }

.app.collapsed .nav-label {
  justify-content: center;
  padding-left: 0;
  margin-bottom: 8px;
}

.app.collapsed .nav-label svg { width: 15px; height: 15px; }

.app.collapsed .nav-label .nav-text,
.app.collapsed .nav-item .nav-text { display: none; }

.app.collapsed .nav-item {
  width: 40px;
  height: 40px;
  margin: 0 auto;
  padding: 0;
  justify-content: center;
  border-radius: 11px;
}

.app.collapsed .nav-item svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.app.collapsed .nav-bottom { padding-top: 8px; }

.app.collapsed .sidebar-foot { display: none; }

.app.collapsed #backBtn svg { transform: rotate(180deg); }

.link-danger { color: #ff8a80; }
.link-danger:hover { background: rgba(255, 109, 99, 0.14); color: #ff9d94; }

/* ---- 底部表单 ---- */

.name-counter { color: var(--hint); }

.text-input {
  background: rgba(var(--ink), 0.045);
  border-color: rgba(var(--ink), 0.1);
  color: var(--text);
}

.text-input::placeholder { color: var(--hint); }

.text-input:focus {
  border-color: rgba(150, 120, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(124, 92, 246, 0.16);
}

.text-input:-webkit-autofill,
.text-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--card-2) inset;
}

.pwd-eye { color: var(--sub); }
.pwd-eye:hover { color: var(--purple-deep); background: rgba(124, 92, 246, 0.14); }
.pwd-eye:active { background: rgba(124, 92, 246, 0.22); }
.pwd-eye.on { color: var(--purple-deep); }

.helper { color: var(--hint); }
.total { color: var(--text-2); }
.total b { color: var(--text); }

.btn-primary:disabled {
  background: rgba(var(--ink), 0.12);
  color: var(--sub);
}

.restore-close { color: #7fb79a; }

/* ---- 弹窗 ---- */

.modal { background: rgba(5, 3, 12, 0.66); }

.modal-card {
  background: #191527;
  border: 1px solid rgba(var(--ink), 0.08);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.62);
}

.modal-close { color: var(--sub); }
.modal-close:hover { color: #ffffff; }
.modal-sub { color: var(--sub); }

/* ---- 浮层 ---- */

.toast {
  background: #241f36;
  border: 1px solid rgba(var(--ink), 0.1);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

.boot { background: var(--bg); }
.boot-text { color: var(--sub); }

/* ---- 滚动条（含输入区、图库、表格容器） ---- */

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--ink), 0.16) transparent;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(var(--ink), 0.15); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(var(--ink), 0.26); }
::-webkit-scrollbar-corner { background: transparent; }


/* ---------------- 视频时长滑块（按秒计费模型） ---------------- */

.dur-range {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 52px;
  justify-content: center;
}

.dur-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dur-top input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 5px;
  border-radius: 999px;
  background: rgba(var(--ink), 0.12);
  outline: none;
  cursor: pointer;
}

.dur-top input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--purple);
  border: 2px solid var(--card-2);
  box-shadow: 0 0 0 4px rgba(124, 92, 246, 0.18);
  cursor: pointer;
}

.dur-top input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--purple);
  border: 2px solid var(--card-2);
  cursor: pointer;
}

.dur-box {
  flex: 0 0 auto;
  min-width: 62px;
  padding: 5px 10px;
  border-radius: 9px;
  border: 1px solid rgba(var(--ink), 0.1);
  background: rgba(var(--ink), 0.045);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.dur-scale {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-right: 74px;
  font-size: 11px;
  color: var(--hint);
}

.dur-scale #durCost { color: var(--purple-deep); }

/* ref-drop 内的提示文案需要显式显示（.slot-tip 默认在相册里是隐藏的） */
.ref-drop .slot-tip {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* 参考素材分栏容器：切换时保持高度稳定 */
.ref-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.ref-panel .ref-block { min-height: 316px; }

.ref-panel .ref-block[hidden] { display: none !important; }

.ref-tab:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 1px;
}

/* ---------------- 参考素材标签页 ---------------- */

.ref-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.ref-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--hint);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.ref-tab svg { width: 13px; height: 13px; flex: 0 0 13px; }

.ref-tab:hover { color: var(--text-2); background: rgba(var(--ink), 0.05); }

.ref-tab.active {
  color: var(--purple-deep);
  background: rgba(124, 92, 246, 0.16);
  border-color: rgba(150, 120, 255, 0.28);
  font-weight: 600;
}

.ref-tab[hidden] { display: none !important; }

.ref-extra {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.ref-extra[hidden] { display: none !important; }

.ref-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ref-block[hidden] { display: none !important; }

.ref-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

.ref-block-head .link-danger { font-size: 11.5px; }

.ref-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.ref-tabs[hidden],
.ref-pane[hidden] { display: none !important; }

.ref-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 22px 16px;
  border: 1px dashed rgba(var(--ink), 0.14);
  border-radius: 14px;
  background: rgba(var(--ink), 0.025);
  color: var(--hint);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.ref-drop:hover,
.ref-drop.dragover {
  border-color: var(--purple-line);
  background: rgba(124, 92, 246, 0.1);
  color: var(--purple-deep);
}

.ref-drop .slot-icon svg { width: 28px; height: 28px; }

.ref-drop[hidden] { display: none !important; }

.ref-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  max-height: 148px;
  overflow-y: auto;
}

.ref-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(var(--ink), 0.03);
  min-width: 0;
}

.ref-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px 2px;
  font-size: 11px;
  color: var(--hint);
}

.ref-media-hint {
  margin-top: 6px;
  font-size: 11px;
  color: #f0b23c;
}

.ref-media-hint[hidden] { display: none !important; }

.ref-idx {
  flex: 0 0 18px;
  height: 18px;
  border-radius: 5px;
  background: rgba(124, 92, 246, 0.22);
  color: var(--purple-deep);
  font-size: 10.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.ref-name {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ref-ins {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 5px;
  border: 1px solid rgba(150, 120, 255, 0.3);
  background: rgba(124, 92, 246, 0.14);
  color: var(--purple-deep);
  font-size: 10.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  cursor: pointer;
}

.ref-ins:hover { background: rgba(124, 92, 246, 0.26); }

.ref-del {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 0;
  background: rgba(var(--ink), 0.06);
  color: var(--sub);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

.ref-del:hover { background: rgba(255, 109, 99, 0.85); color: #fff; }

.ref-url {
  margin-top: 8px;
  width: 100%;
  height: 34px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid rgba(var(--ink), 0.1);
  background: rgba(var(--ink), 0.035);
  color: var(--text);
  font-size: 12px;
  outline: none;
}

.ref-url::placeholder { color: var(--hint); }
.ref-url:focus { border-color: rgba(150, 120, 255, 0.7); }

.mention-empty { font-size: 11.5px; color: var(--hint); }

.option .opt-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   视频工作台右栏（严格对标 hi.blackrxai.com/app/studio）
   结构：参考图片标题+大虚线区 → 素材行（可选素材｜参考视频｜参考音频）
        → 参考视频链接 → 参考音频链接
   实测基准（1680 视口）：右栏宽 622、块间距 16、拖拽区高 220、
                        素材行高 30、链接框高 34 / 圆角 8 / 字号 12
   ============================================================ */

.card-body {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 20px;
  margin-top: 16px;
  align-items: start;
}

.col-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  min-height: 0;
  padding-right: 4px;
  overflow: visible;
}

/* ---- 参考图片 ---- */

.ref-image-block { display: flex; flex-direction: column; }

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

.ref-image-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.ref-clear { font-size: 11.5px; line-height: 1; }
.ref-clear[hidden] { display: none !important; }

.col-right .gallery.is-empty { grid-template-columns: 1fr; }

.col-right .gallery.is-empty .slot-empty {
  min-height: 220px;
  aspect-ratio: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 24px;
  border: 2px dashed rgba(var(--ink), 0.14);
  border-radius: 16px;
  background: rgba(var(--ink), 0.025);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.col-right .gallery.is-empty .slot-empty:hover {
  border-color: rgba(var(--ink), 0.28);
  background: rgba(var(--ink), 0.04);
}

.ref-drop-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(124, 92, 246, 0.14);
  color: var(--purple-deep);
}

.ref-drop-icon svg { width: 20px; height: 20px; }

.col-right .gallery.is-empty .slot-tip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-top: 12px;
  text-align: center;
}

/* 已有图片时：空位收成一个小方块「+」，不再显示长文案 */
.col-right .gallery:not(.is-empty) .slot-empty {
  aspect-ratio: 1 / 1;
  min-height: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed rgba(var(--ink), 0.16);
  border-radius: 12px;
  background: rgba(var(--ink), 0.025);
  cursor: pointer;
}

.col-right .gallery:not(.is-empty) .slot-tip { display: none; }
.col-right .gallery:not(.is-empty) .ref-drop-icon {
  width: 32px;
  height: 32px;
  background: transparent;
}
.col-right .gallery:not(.is-empty) .ref-drop-icon svg { width: 20px; height: 20px; }

.col-right .slot-tip-main {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
}

.col-right .slot-tip-sub {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--hint);
}

/* ---- 素材行：可选素材 ｜ 参考视频 ｜ 参考音频 ---- */

.ref-media-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 30px;
}

.ref-media-row[hidden] { display: none !important; }

.ref-media-caption {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.ref-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 1px dashed rgba(var(--ink), 0.16);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--sub);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
  user-select: none;
}

.ref-chip svg { width: 14px; height: 14px; flex: 0 0 14px; }

.ref-chip:hover {
  border-color: rgba(150, 120, 255, 0.6);
  color: var(--purple-deep);
  background: rgba(124, 92, 246, 0.08);
}

.ref-chip[hidden] { display: none !important; }

/* ---- 链接输入框 ---- */

.ref-url {
  width: 100%;
  height: 34px;
  padding: 8px 12px;
  border: 1px solid rgba(var(--ink), 0.1);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  outline: none;
}

.ref-url::placeholder { color: var(--hint); }
.ref-url:focus { border-color: rgba(150, 120, 255, 0.7); }
.ref-url[hidden] { display: none !important; }

.col-right .ref-list { margin-top: 0; }
.col-right .ref-list[hidden] { display: none !important; }

/* ============================================================
   构图比例对齐对标站（实测 1680×963）
   对标：下拉 60 高 / 行间距 12 / 字段组间距 16 / 标题 12px 加粗
        提示词区总高 248 / 卡片正文上边距 16
   ============================================================ */

.select-btn {
  min-height: 60px;
  padding: 9px 14px;
}

.select-label { font-size: 14px; font-weight: 600; }
.select-sub { font-size: 10px; margin-top: 2px; }

.flabel {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.grid-2 { gap: 12px; }

.col-left { gap: 16px; }

.card-body { margin-top: 16px; }

/* 时长滑块区与下拉等高 */
.dur-range { min-height: 60px; gap: 4px; }

.dur-top input[type="range"] { height: 4px; }

.dur-box {
  min-width: 56px;
  padding: 4px 9px;
  font-size: 12px;
}

.dur-scale { padding-right: 68px; font-size: 10.5px; }

/* 提示词区总高对齐 248 */
#prompt {
  height: 180px;
  min-height: 180px;
  font-size: 13px;
  line-height: 1.8;
}

/* 滑块用浏览器原生样式（对标站就是 accent 紫色 + 已选轨道填充） */
.dur-top input[type="range"] {
  -webkit-appearance: auto;
  appearance: auto;
  height: 18px;
  background: transparent;
  accent-color: var(--purple);
  box-shadow: none;
  border-radius: 0;
}

.dur-top input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: auto;
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

/* ============================================================
   下拉菜单选项：对标两行结构（名称 12px 加粗 + 积分 10px）
   选项高 53、菜单内边距 6、圆角 12、最大高 45vh、选中带勾
   ============================================================ */

.select-menu {
  padding: 6px;
  border-radius: 12px;
  z-index: 80;
  max-height: min(calc(53px * 10 + 12px), calc(100vh - 180px));
  overflow-y: auto;
  overscroll-behavior: contain;
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  justify-content: flex-start;
  min-height: 53px;
  box-sizing: border-box;
}

.option .opt-main {
  min-width: 0;
  flex: 1;
  display: block;
}

.option .opt-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 模型下拉里的「新」徽章（品牌紫，白字） */
.option .opt-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 500;
  line-height: 1.5;
  color: #fff;
  background: #8b74f8;
  vertical-align: middle;
}

/* 维护徽章：红色字 */
.option .opt-badge-maint {
  color: #ff6b6b;
  border: 1px solid rgba(255, 107, 107, 0.45);
  background: rgba(255, 107, 107, 0.10);
}

/* 维护中的模型项：置灰不可点 */
.option.is-disabled { opacity: 0.5; cursor: not-allowed; }
.option.is-disabled:hover { background: transparent; }
.option.is-disabled .opt-label,
.option.is-disabled .opt-sub { color: var(--hint); }

.option .opt-sub {
  display: block;
  margin-top: 2px;
  font-size: 10px;
  font-weight: 400;
  color: var(--hint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.option .opt-check {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  color: var(--purple-deep);
  opacity: 0;
  transition: opacity 0.12s;
}

.option.selected {
  background: rgba(124, 92, 246, 0.14);
  color: var(--text);
  font-weight: 400;
}

.option.selected .opt-label { color: var(--purple-deep); }
.option.selected .opt-sub { color: rgba(188, 170, 255, 0.75); }
.option.selected .opt-check { opacity: 1; }

.option:hover { background: rgba(124, 92, 246, 0.12); }

/* 「新建分组」入口：与上方分组选项隔开，品牌紫强调 */
.option.opt-create {
  margin-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0 0 8px 8px;
  min-height: 46px;
}
.option.opt-create .opt-create-label { color: #8b74f8; }
.option.opt-create:hover { background: rgba(139, 116, 248, 0.14); }

/* ---- 顶栏图标：版本更新通知（带红点） + 白底刷新按钮 ---- */

.icon-btn.notify {
  position: relative;
  color: var(--sub);
}

.icon-btn.notify:hover {
  background: rgba(var(--ink), 0.07);
  color: var(--purple-deep);
}

.notify-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff5b52;
  box-shadow: 0 0 0 2px var(--card);
}

/* 主题切换按钮：不占底色，裸图标（与旁边的通知铃铛同一视觉） */
.icon-btn.white {
  background: transparent;
  color: var(--sub);
  box-shadow: none;
}

.icon-btn.white:hover {
  background: rgba(var(--ink), 0.07);
  color: var(--purple-deep);
}

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

/* ============================================================
   【已停用】明亮皮肤（白色界面）

   2026-11-14：界面改为只保留暗夜版本，html 上的 data-theme 被固定为 "dark"，
   下面这一整块 html[data-theme="light"] 规则从此不会命中，属于死代码。
   保留它是为了留个后路 —— 万一哪天要恢复白底，把 html 的 data-theme
   切回 "light" 就能整块复活，不用重写。
   日常改样式请忽略这一段。
   —— 只在 <html data-theme="light"> 时生效；只换配色，不动尺寸与结构
   ============================================================ */

html[data-theme="light"] {
  color-scheme: light;

  --ink: 26, 22, 48;         /* 叠加层基色：白色界面上用深色叠加 */

  --bg: #f3f2f9;
  --card: #ffffff;
  --card-2: #ffffff;
  --line: rgba(26, 22, 48, 0.10);
  --line-soft: rgba(26, 22, 48, 0.06);

  --text: #1d1a2e;
  --text-2: #3f3b55;
  --sub: #5d5877;
  --hint: #7b7690;

  --purple: #7c5cf6;
  --purple-2: #6d4ef0;
  --purple-deep: #5b3fd0;
  --purple-soft: rgba(124, 92, 246, 0.10);
  --purple-line: rgba(124, 92, 246, 0.30);

  --danger: #d2453c;
  --mint-bg: rgba(56, 150, 110, 0.10);
  --mint-line: rgba(56, 150, 110, 0.26);
  --mint-text: #2c8a60;

  --shadow-card: 0 1px 2px rgba(28, 24, 60, 0.05), 0 10px 26px rgba(28, 24, 60, 0.07);
}

/* 白色界面下，阴影与描边别太重 */

html[data-theme="light"] .card,
html[data-theme="light"] .panel {
  box-shadow: var(--shadow-card);
}

html[data-theme="light"] .sidebar {
  background: #ffffff;
  border-right: 1px solid var(--line);
}

html[data-theme="light"] .topbar { background: transparent; }

html[data-theme="light"] .sidebar-foot { color: var(--hint); }

/* 白底按钮在白界面上需要描边，否则看不到边界 */

html[data-theme="light"] .icon-btn.white {
  background: transparent;
  color: var(--sub);
  border: 0;
  box-shadow: none;
}

html[data-theme="light"] .icon-btn.white:hover {
  background: rgba(26, 22, 48, 0.06);
  color: var(--purple-deep);
}

/* 滚动条 */

html[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: rgba(26, 22, 48, 0.16);
}

html[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(26, 22, 48, 0.26);
}

/* 下拉菜单、弹窗在白界面下的投影 */

html[data-theme="light"] .select-menu {
  box-shadow: 0 16px 36px rgba(28, 24, 60, 0.14);
  border: 1px solid var(--line);
}

html[data-theme="light"] .modal-card,
html[data-theme="light"] .dialog {
  box-shadow: 0 20px 50px rgba(28, 24, 60, 0.18);
}

html[data-theme="light"] .modal-mask,
html[data-theme="light"] .mask {
  background: rgba(28, 24, 60, 0.28);
}

/* 顶栏主题按钮图标：暗色显示月亮、亮色显示太阳 */

/* 暗色界面显示太阳（点一下变亮），亮色界面显示月亮（点一下变暗） */
.icon-btn.white .ico-sun { display: block; }
.icon-btn.white .ico-moon { display: none; }
html[data-theme="light"] .icon-btn.white .ico-sun { display: none; }
html[data-theme="light"] .icon-btn.white .ico-moon { display: block; }

/* ---- 亮色下重设几个「浅字配深底」的状态色，否则白底上看不清 ---- */

html[data-theme="light"] .note.info { color: #4a37a3; }
html[data-theme="light"] .note.warn { color: #8a5c10; }
html[data-theme="light"] .note.warn svg { color: #b07b16; }
html[data-theme="light"] .note.ok { color: var(--mint-text); }

html[data-theme="light"] .badge.warn { color: #8a5c10; }
html[data-theme="light"] .badge.fail { color: #b23a30; }
html[data-theme="light"] .badge.ok { color: #26774f; }

html[data-theme="light"] .link-danger { color: #cf3f36; }
html[data-theme="light"] .link-danger:hover { color: #a92f27; background: rgba(210, 69, 60, 0.1); }

/* 侧栏菜单：悬停/选择时给淡紫底色（两个主题各一套，保证文字可读） */
html[data-theme="light"] .nav-item:hover { background: rgba(124, 92, 246, 0.12); color: #4a3bb5; }
html[data-theme="light"] .nav-item:hover svg { opacity: 1; color: #6a58e8; }

html[data-theme="light"] .remark-err { color: #b23a30; }
html[data-theme="light"] .pill-btn.danger { color: #b23a30; }
html[data-theme="light"] .pill-btn.danger:hover { color: #8f2620; }
html[data-theme="light"] .slot-tip-main { color: var(--text-2); }
html[data-theme="light"] .prompt-hint { color: var(--hint); }

/* 输入框占位符在白底上要够深 */
html[data-theme="light"] #prompt::placeholder,
html[data-theme="light"] textarea::placeholder,
html[data-theme="light"] .text-input::placeholder,
html[data-theme="light"] .ref-url::placeholder,
html[data-theme="light"] input::placeholder {
  color: #9d98ae;
  opacity: 1;
}

html[data-theme="light"] .option.selected .opt-sub { color: #6b5bb0; }
html[data-theme="light"] .option.selected { background: rgba(124, 92, 246, 0.10); }
html[data-theme="light"] .option .opt-check { color: var(--purple-deep); }

html[data-theme="light"] #prompt::placeholder,
html[data-theme="light"] textarea::placeholder,
html[data-theme="light"] .text-input::placeholder,
html[data-theme="light"] .ref-url::placeholder,
html[data-theme="light"] input::placeholder { color: #87829b; }

/* ================================================================
   作品墙（视频工作台下方）：生成过的视频以卡片平铺，整页往下滚
   ================================================================ */

.works {
  margin: 0 22px 24px;
  flex: 0 0 auto;
}

.works-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 0 2px 12px;
}

.works-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.works-sub {
  font-size: 12px;
  color: var(--sub);
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  align-items: start;
}

.work-card {
  position: relative;
  border-radius: 12px;
  /* 注意：这里不能 overflow:hidden，否则分组下拉菜单（绝对定位、超出卡片底部）
     会被裁掉。预览图的圆角裁剪交给 .work-thumb 自己。 */
  background: var(--card);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

/* 注意：不要给卡片加 transform（哪怕是 hover 上浮）。transform 会把卡片变成
   position:fixed 后代的 containing block，导致分组下拉菜单定位错乱。
   hover 反馈改用 box-shadow。 */
.work-card:hover {
  border-color: var(--purple-line);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.work-thumb {
  position: relative;
  /* 预览区：竖版视频居中，占位底色用暗色 */
  aspect-ratio: 1 / 1;
  background: #101012;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
}

.work-thumb img,
.work-thumb video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* 静态首帧预览图：抓到帧后盖在 video 上，卡片就是一张真正的图片 */
.vd-poster,
.work-thumb .vd-thumb-video {
  position: absolute;
  inset: 0;
  background: #f7f6fa;
}

.vd-poster {
  z-index: 1;
  opacity: 0;
  transition: opacity 0.2s;
}

.vd-poster.ready { opacity: 1; }

.work-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 6, 16, 0.28);
  opacity: 0;
  transition: opacity 0.15s;
}

.work-card:hover .work-play {
  opacity: 1;
}

.work-play span {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}

.work-play svg {
  width: 16px;
  height: 16px;
  color: #2a2340;
  margin-left: 2px;
}

.work-meta {
  padding: 9px 11px 11px;
}

.work-title {
  font-size: 12.5px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.work-info {
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--sub);
}

.work-state {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 5px;
}

.work-state.done {
  color: #1a9b68;
  background: rgba(26, 155, 104, 0.12);
}

.work-state.run {
  color: #6a4df6;
  background: rgba(106, 77, 246, 0.12);
}

.work-state.fail {
  color: #d23a30;
  background: rgba(210, 58, 48, 0.12);
}

html[data-theme="dark"] .work-state.done { color: #3ddc97; }
html[data-theme="dark"] .work-state.run { color: #9b83f9; }
html[data-theme="dark"] .work-state.fail { color: #ff7b72; }

.works-empty {
  padding: 44px 0 52px;
  text-align: center;
  color: var(--hint);
  font-size: 12.5px;
  border: 1px dashed var(--line);
  border-radius: 12px;
}

/* ---- 作品墙工具栏：分组标签 + 批量操作 ---- */

.works-head {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding-bottom: 14px;
}

.works-title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.wbtn-refresh {
  margin-left: auto;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.wbtn-refresh svg { width: 13px; height: 13px; }

.works-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.works-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.wtab {
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--sub);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.wtab:hover {
  border-color: var(--purple-line);
  color: var(--purple);
}

.wtab.active {
  background: rgba(124, 92, 246, 0.12);
  border-color: transparent;
  color: var(--purple);
  font-weight: 500;
}

.wtab .wtab-n {
  margin-left: 5px;
  opacity: 0.66;
  font-size: 11px;
}

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

.wbtn {
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-2, var(--sub));
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.wbtn:hover {
  border-color: var(--purple-line);
  color: var(--purple);
}

.wbtn.danger:hover {
  border-color: rgba(210, 58, 48, 0.4);
  color: #d23a30;
}

/* ---- 卡片：复选框 + 悬浮操作条 ---- */

.work-card.selected {
  border-color: var(--purple);
  box-shadow: 0 0 0 1px var(--purple);
}

.work-check {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  background: rgba(8, 6, 16, 0.42);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s;
}

.work-card:hover .work-check,
.work-card.selected .work-check {
  opacity: 1;
}

.work-card.selected .work-check {
  background: var(--purple);
  border-color: var(--purple);
}

.work-check svg {
  width: 12px;
  height: 12px;
  color: #fff;
  opacity: 0;
}

.work-card.selected .work-check svg {
  opacity: 1;
}

.work-pin {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 0;
  background: rgba(8, 6, 16, 0.42);
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}

.work-card:hover .work-pin,
.work-card.pinned .work-pin {
  opacity: 1;
}

.work-card.pinned .work-pin {
  background: var(--purple);
  color: #fff;
}

.work-pin svg {
  width: 12px;
  height: 12px;
}

.work-group {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 3;
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(8, 6, 16, 0.56);
  color: #fff;
  backdrop-filter: blur(4px);
}

/* 悬浮操作条 */
.work-ops {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  display: flex;
  gap: 1px;
  padding: 6px;
  background: linear-gradient(to top, rgba(8, 6, 16, 0.82), rgba(8, 6, 16, 0));
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.16s, transform 0.16s;
}

.work-card:hover .work-ops {
  opacity: 1;
  transform: translateY(0);
}

.wop {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 0;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.14s;
}

.wop:hover {
  background: rgba(255, 255, 255, 0.3);
}

.wop svg {
  width: 12px;
  height: 12px;
}

.wop.danger:hover {
  background: rgba(210, 58, 48, 0.78);
}

/* ---- 分组页签：添加 / 删除 / 改名 ---- */

.wtab-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--sub);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.wtab-add:hover {
  border-color: var(--purple-line);
  color: var(--purple);
  border-style: solid;
}

.wtab-add svg {
  width: 12px;
  height: 12px;
}

/* 每个分组页签右上角的删除小叉，只有 hover 时出现 */
.wtab-wrap {
  position: relative;
  display: inline-flex;
}

.wtab-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--sub);
  font-size: 11px;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 3;
}

.wtab-wrap:hover .wtab-del {
  display: flex;
}

.wtab-del:hover {
  background: #d23a30;
  border-color: #d23a30;
  color: #fff;
}

.wtab-wrap .wtab {
  padding-right: 18px;
}

/* ================================================================
   视频生成工作区与分组库：搜索栏 / 分组创作区 / 打包下载 / 底部批量条
   ================================================================ */

.works-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* 搜索框 */
.wsearch {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 240px;
  min-width: 200px;
  height: 32px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  gap: 7px;
}

.wsearch:focus-within {
  border-color: var(--purple-line);
}

.wsearch svg {
  width: 14px;
  height: 14px;
  color: var(--sub);
  flex: 0 0 auto;
}

.wsearch input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12.5px;
  font-family: inherit;
}

.wsearch input::placeholder {
  color: var(--hint);
}

.wsearch input::-webkit-search-cancel-button {
  cursor: pointer;
}

/* 日期范围 */
.wrange {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--sub);
  font-size: 12px;
}

.wrange input[type="date"] {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  width: 116px;
  cursor: pointer;
}

.wrange input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.55;
  cursor: pointer;
}

html[data-theme="dark"] .wrange input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
}

/* 时长筛选 */
.wselect {
  height: 32px;
  padding: 0 28px 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  outline: 0;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6.4 9.6L12 15.2l5.6-5.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 12px;
}

.wselect:focus {
  border-color: var(--purple-line);
}

/* 工具栏第二行：页签左、分组创作区右 */
.works-tools {
  align-items: flex-start;
}

/* 分组创作区：输入名称 + 创建 */
.wnew {
  display: flex;
  align-items: center;
  gap: 0;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  overflow: hidden;
  flex: 0 0 auto;
}

.wnew:focus-within {
  border-color: var(--purple-line);
}

.wnew-input {
  width: 128px;
  height: 100%;
  padding: 0 10px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
}

.wnew-input::placeholder {
  color: var(--hint);
}

.wnew-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 100%;
  padding: 0 10px;
  border: 0;
  border-left: 1px solid var(--line);
  background: rgba(124, 92, 246, 0.1);
  color: var(--purple);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.wnew-btn:hover {
  background: rgba(124, 92, 246, 0.2);
}

.wnew-btn svg {
  width: 11px;
  height: 11px;
}

/* 按分组打包下载 */
.wpack {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 0 12px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 12px;
}

.wpack-label {
  font-size: 12px;
  color: var(--sub);
  flex: 0 0 auto;
}

.wpack-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}

.wpack-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--sub);
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}

.wpack-chip:hover {
  border-color: var(--purple-line);
  color: var(--purple);
}

.wpack-chip.on {
  background: rgba(124, 92, 246, 0.12);
  border-color: transparent;
  color: var(--purple);
}

.wpack-box {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1.4px solid currentColor;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  opacity: 0.75;
}

.wpack-chip.on .wpack-box {
  background: currentColor;
}

.wpack-chip.on .wpack-box svg {
  width: 8px;
  height: 8px;
  color: var(--card);
}

/* 底部批量条 */
.wfoot {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

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

.wfoot-all input {
  width: 13px;
  height: 13px;
  accent-color: var(--purple);
  cursor: pointer;
}

.wfoot-n {
  font-size: 12px;
  color: var(--hint);
}

.wfoot-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .works-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .wsearch {
    flex: 1 1 auto;
  }
  .wrange input[type="date"] {
    flex: 1;
    width: auto;
  }
  .wfoot-actions {
    margin-left: 0;
    width: 100%;
  }
}

/* 生成中的卡片占位：不再空着，直接显示状态和进度 */
.work-skeleton {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(124, 92, 246, 0.1), rgba(124, 92, 246, 0.03));
  color: var(--purple);
  font-size: 12px;
  letter-spacing: 0.02em;
}

.work-skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.18) 50%, transparent 70%);
  animation: sk 1.8s linear infinite;
}

@keyframes sk {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

html[data-theme="dark"] .work-skeleton {
  background: linear-gradient(145deg, rgba(124, 92, 246, 0.16), rgba(124, 92, 246, 0.04));
}

html[data-theme="dark"] .work-skeleton::after {
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.07) 50%, transparent 70%);
}

/* ================================================================
   对标站详情卡片样式（vd-* 前缀）
   ================================================================ */

/* 生成中占位 */
.vd-skeleton {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #6b7080;
  color: #fff;
  gap: 6px;
  padding: 16px;
}

.vd-spin {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: vd-spin 0.8s linear infinite;
}

@keyframes vd-spin {
  to { transform: rotate(360deg); }
}

.vd-skel-label {
  font-size: 13px;
  font-weight: 500;
  margin-top: 4px;
}

.vd-skel-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
}

.vd-progress {
  width: 80%;
  max-width: 160px;
  height: 4px;
  background: rgba(255,255,255,0.25);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}

.vd-progress-bar {
  height: 100%;
  background: #fff;
  border-radius: 2px;
  transition: width 0.3s;
}

.vd-skel-hint {
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  margin-top: 6px;
}

/* 失败占位 */
.vd-skeleton.vd-fail {
  background: #5a5560;
}

.vd-fail-ico {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

.vd-fail-msg {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.78);
  text-align: center;
  max-width: 90%;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 状态标签（右上角）：已生成=绿、失败=红、生成中=深灰 */
.vd-status {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  font-size: 10px;
  line-height: 16px;
  padding: 0 8px;
  border-radius: 5px;
  background: rgba(8, 6, 16, 0.65);
  color: #fff;
  backdrop-filter: blur(4px);
}

.vd-status.done { background: #2fae75; }
.vd-status.fail { background: #e8564b; }

.vd-dl-count {
  font-size: 11px;
  color: var(--hint);
  white-space: nowrap;
}

/* 比例+时长标签（右下角） */
.vd-tags {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  display: flex;
  gap: 4px;
}

.vd-ratio,
.vd-dur {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(8, 6, 16, 0.56);
  color: #fff;
  backdrop-filter: blur(4px);
}

/* 卡片内容区 */
.vd-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 标题行 */
.vd-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.vd-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.vd-rename {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--purple);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.vd-rename:hover {
  background: var(--purple-soft);
}

.vd-rename svg {
  width: 12px;
  height: 12px;
}

/* 文件名 */
.vd-filename {
  font-size: 11px;
  color: var(--sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 模型信息 */
.vd-model {
  font-size: 11px;
  color: var(--hint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 分组选择行 */
.vd-group-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}

.vd-group-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--sub);
  flex-shrink: 0;
}

.vd-group-icon svg {
  width: 14px;
  height: 14px;
}

.vd-group-select {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
  padding-right: 16px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6.4 9.6L12 15.2l5.6-5.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  background-size: 12px;
}

html[data-theme="dark"] .vd-group-select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23aaa' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6.4 9.6L12 15.2l5.6-5.6'/%3E%3C/svg%3E");
}

/* 自绘分组下拉（替代原生 select，展开菜单也是网页风格） */
.vd-dd { position: relative; flex: 1; min-width: 0; }
.vd-dd-btn {
  display: flex; align-items: center; gap: 6px;
  width: 100%; border: none; outline: none;
  background: transparent; color: var(--text);
  font-size: 12px; font-family: inherit; cursor: pointer;
  padding: 0; text-align: left;
}
.vd-dd-val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vd-dd-caret { width: 12px; height: 12px; flex-shrink: 0; color: var(--sub); }
.vd-dd-menu {
  position: absolute; z-index: 9999;
  top: calc(100% + 6px); left: 0;
  width: max-content; min-width: 140px; max-width: 240px;
  max-height: 260px; overflow-y: auto;
  padding: 4px; border-radius: 10px;
  background: #161618; border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  transform-origin: top left;
  animation: vdDdIn 0.12s ease;
}
@keyframes vdDdIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
/* 详情页的分组下拉在底部操作条里，卡片列表用绝对定位贴按钮下方即可；
   详情弹窗自身有 overflow 裁剪 + backdrop-filter，菜单沿用 fixed + JS 坐标定位。 */
.vd-dd-detail .vd-dd-menu {
  position: fixed;
  top: auto; left: auto;
  width: auto; min-width: 140px; max-width: 240px;
}
.vd-dd-item {
  display: block; width: 100%; padding: 7px 10px; border: none; border-radius: 7px;
  background: transparent; color: #ededed; font-size: 12px; font-family: inherit;
  cursor: pointer; text-align: left;
}
.vd-dd-item:hover { background: rgba(124, 92, 246, 0.18); color: #bcaaff; }
.vd-dd-item.on { color: #bcaaff; font-weight: 500; }

/* 详情页里的分组下拉按钮要更紧凑，和「重命名」按钮一行 */
.vd-dd-detail .vd-dd-btn { padding: 4px 8px; border: 1px solid var(--line); border-radius: 7px; }
.vd-dd-detail .vd-dd-btn:hover { border-color: var(--purple-line); color: var(--purple-deep); }

/* 提示词 */
.vd-prompt {
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  margin-top: 2px;
}

/* 底部信息行 */
.vd-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
  margin-top: 2px;
}

.vd-date {
  font-size: 10.5px;
  color: var(--hint);
  white-space: nowrap;
}

.vd-detail-link {
  font-size: 11px;
  color: var(--purple);
  text-decoration: none;
  cursor: pointer;
}

.vd-detail-link:hover {
  text-decoration: underline;
}

.vd-bottom-status {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 5px;
  white-space: nowrap;
}

.vd-bottom-status.done {
  color: #1a9b68;
  background: rgba(26, 155, 104, 0.12);
}

.vd-bottom-status.run {
  color: #6a4df6;
  background: rgba(106, 77, 246, 0.12);
}

.vd-bottom-status.fail {
  color: #d23a30;
  background: rgba(210, 58, 48, 0.12);
}

html[data-theme="dark"] .vd-bottom-status.done { color: #3ddc97; }
html[data-theme="dark"] .vd-bottom-status.run { color: #9b83f9; }
html[data-theme="dark"] .vd-bottom-status.fail { color: #ff7b72; }

/* 底部操作按钮 */
.vd-actions {
  display: flex;
  gap: 1px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  margin-top: 2px;
}

.vd-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.14s;
}

.vd-btn:hover {
  background: var(--purple-soft);
  border-color: var(--purple-line);
  color: var(--purple);
}

.vd-btn.vd-del:hover {
  background: rgba(210, 58, 48, 0.12);
  border-color: rgba(210, 58, 48, 0.4);
  color: #d23a30;
}

.vd-btn svg {
  width: 13px;
  height: 13px;
}

/* 详情弹窗 */
.vd-detail-mask {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(8, 6, 16, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.vd-detail-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.vd-detail-head,
.vd-detail-foot {
  flex: 0 0 auto;
}

.vd-detail-video {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 38vh;
  overflow: hidden;
  flex: 0 1 auto;
}

.vd-detail-video video {
  display: block;
  max-width: 100%;
  max-height: 42vh;
  object-fit: contain;
}

.vd-detail-noplay {
  color: var(--sub);
  font-size: 12px;
  padding: 40px 20px;
  text-align: center;
}

.vd-detail-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px 18px 18px;
  border-top: 1px solid var(--line);
}

.vd-detail-foot select {
  height: 30px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  max-width: 130px;
}

.vd-detail-foot button {
  padding: 6px 12px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.14s;
}

.vd-detail-foot button:hover {
  border-color: var(--purple-line);
  color: var(--purple);
}

.vd-detail-foot button.danger:hover {
  border-color: rgba(210, 58, 48, 0.4);
  color: #d23a30;
}

.vd-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.vd-detail-head h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.vd-detail-close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--sub);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vd-detail-close:hover {
  background: var(--line);
  color: var(--text);
}

.vd-detail-body {
  padding: 12px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.vd-detail-row {
  display: flex;
  gap: 12px;
  font-size: 12px;
  line-height: 1.5;
}

.vd-detail-row label {
  width: 70px;
  flex-shrink: 0;
  color: var(--sub);
  font-weight: 500;
}

.vd-detail-row span {
  flex: 1;
  color: var(--text);
  word-break: break-word;
}

/* ============================================================
   任务详情：对标站的全屏两栏页面（白底纸面，独立于站点深浅主题）
   放在文件末尾覆盖上面的旧弹窗样式
   ============================================================ */
.vd-detail-mask {
  position: fixed;
  inset: 0;
  z-index: 9999;
  padding: 16px;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  background: rgba(10, 8, 18, 0.72);
}

.vd-page {
  --d-purple: #8b74f8;
  --d-text: #f1eefb;
  --d-sub: #8b85a3;
  --d-line: #262038;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0a0a0b;
  color: var(--d-text);
  border: 1px solid #2a2440;
  border-radius: 10px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

.vd-page-head {
  flex: 0 0 auto;
  height: 48px;
  padding: 0 16px 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--d-line);
}

.vd-page-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--d-text);
}

.vd-page-head-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.vd-head-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  background: transparent;
  color: #a49eba;
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}

.vd-head-link:hover { color: var(--d-purple); background: #161618; }
.vd-head-link svg { width: 13px; height: 13px; }

.vd-detail-mask .vd-detail-close {
  width: 26px;
  height: 26px;
  color: #918aa3;
  font-size: 19px;
}
.vd-detail-mask .vd-detail-close:hover { background: #161618; color: var(--d-text); }

.vd-page-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.vd-page-grid {
  display: grid;
  grid-template-columns: minmax(330px, 42%) minmax(220px, 1fr) minmax(180px, 0.85fr);
  min-height: 100%;
}

.vd-col-left,
.vd-col-mid,
.vd-col-right {
  padding: 20px 22px 28px;
  min-width: 0;
}

.vd-col-mid,
.vd-col-right { border-left: 1px solid var(--d-line); }

/* 左栏：3 列参数卡片 */
.vd-param-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.vd-param {
  border: 1px solid var(--d-line);
  border-radius: 8px;
  padding: 8px 10px;
  min-width: 0;
}

.vd-param-k {
  font-size: 10.5px;
  color: var(--d-sub);
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vd-param-v {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 600;
  color: var(--d-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 左栏：提示词 */
.vd-prompt-head {
  margin-top: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: #c4bed9;
}

.vd-prompt-tools { display: flex; align-items: center; gap: 10px; }

.vd-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid #b9a6ff;
  border-radius: 7px;
  background: #0a0a0b;
  color: var(--d-purple);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
}
.vd-copy:hover { background: #161618; }
.vd-copy svg { width: 12px; height: 12px; }

.vd-fold {
  border: none;
  background: transparent;
  color: var(--d-purple);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 2px;
}
.vd-fold:hover { text-decoration: underline; }

.vd-prompt-box {
  margin-top: 10px;
  border: 1px solid var(--d-line);
  border-radius: 8px;
  padding: 12px 14px;
  max-height: 380px;
  overflow-y: auto;
}

.vd-prompt-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.85;
  color: #d6d0e8;
}

.vd-prompt-foot {
  margin-top: 14px;
  font-size: 11px;
  color: var(--d-sub);
}

.vd-prompt-box.folded .vd-prompt-text,
.vd-prompt-box.folded .vd-prompt-foot { display: none; }

/* 右栏：标题 / 参考图 */
.vd-ref-name { font-size: 13px; font-weight: 600; color: var(--d-text); }
.vd-ref-file { margin-top: 4px; font-size: 11px; color: var(--d-sub); }

.vd-sec-title {
  margin-top: 20px;
  margin-bottom: 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: #9d88fb;
}

.vd-refs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: flex-start; }

.vd-refs .vd-ref-empty { grid-column: 1 / -1; }

.vd-ref-item {
  height: 140px;
  border: 1px solid var(--d-line);
  border-radius: 6px;
  background: #101012;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.vd-ref-item img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }

.vd-ref-empty {
  width: 100%;
  min-height: 92px;
  border: 1px dashed #332b4d;
  border-radius: 8px;
  background: #101012;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #9a94ae;
  font-size: 12px;
  text-align: center;
}
.vd-ref-empty span { font-size: 10.5px; color: #7b7593; }

.vd-ref-links {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 8px;
}

.vd-ref-links button {
  border: none;
  background: transparent;
  color: var(--d-purple);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  padding: 3px 2px;
}
.vd-ref-links button:hover { text-decoration: underline; }

/* 右栏：生成的视频 */
.vd-video-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
}

.vd-download-video {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border: 1px solid var(--d-line);
  border-radius: 7px;
  background: #0a0a0b;
  color: #c4bed9;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
}
.vd-download-video:hover { border-color: var(--d-purple); color: var(--d-purple); }
.vd-download-video svg { width: 13px; height: 13px; }

.vd-player {
  background: #000;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  height: auto;
}

.vd-player video {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #000;
}

.vd-detail-noplay {
  color: #4a4160;
  font-size: 12px;
  text-align: center;
  line-height: 1.9;
  padding: 20px;
}
.vd-detail-noplay span { font-size: 11px; color: #948ea8; }

/* 右栏底部：沿用作品卡片的全部管理操作 */
.vd-extra-ops {
  margin-top: 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.vd-extra-ops select,
.vd-extra-ops button {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--d-line);
  border-radius: 7px;
  background: #0a0a0b;
  color: #b3adc9;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
}
.vd-extra-ops button:hover { border-color: var(--d-purple); color: var(--d-purple); }
.vd-extra-ops button.danger:hover { border-color: #ff7b72; color: #ff7b72; }

.vd-page-scroll::-webkit-scrollbar,
.vd-prompt-box::-webkit-scrollbar { width: 7px; }
.vd-page-scroll::-webkit-scrollbar-thumb,
.vd-prompt-box::-webkit-scrollbar-thumb { background: #2a2440; border-radius: 4px; }

@media (max-width: 940px) {
  .vd-page-grid { grid-template-columns: 1fr; }
  .vd-col-mid,
  .vd-col-right { border-left: none; border-top: 1px solid var(--d-line); }
  .vd-param-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================
   明亮界面对标配色：淡紫白底 + 纯白卡片/输入框 + 淡紫描边
   对标实测色：页面 #f7f5ff、顶栏 #fdfcff、卡片 #ffffff、
   输入框 #ffffff、底部条 #fcfbff。放在末尾统一覆盖旧的灰底叠加层。
   只作用于 html[data-theme="light"]，深色界面完全不受影响。
   ============================================================ */
html[data-theme="light"] {
  --bg: #f7f5ff;
  --card: #ffffff;
  --card-2: #ffffff;
  --line: rgba(108, 87, 190, 0.13);
  --line-soft: rgba(108, 87, 190, 0.08);
  --text: #211d33;
  --text-2: #494360;
  --sub: #6f6889;
  --hint: #8e88a5;
  --purple-soft: rgba(124, 92, 246, 0.09);
  --purple-line: rgba(124, 92, 246, 0.28);
  --shadow-card: 0 1px 2px rgba(80, 62, 150, 0.04), 0 8px 24px rgba(80, 62, 150, 0.05);
}

html[data-theme="light"] body { background: #f7f5ff; }

html[data-theme="light"] .topbar {
  background: #fdfcff;
  border-bottom: 1px solid #eeeafb;
}

html[data-theme="light"] .sidebar {
  background: #ffffff;
  border-right-color: #eeeafb;
}

html[data-theme="light"] .card,
html[data-theme="light"] .panel,
html[data-theme="light"] .work-card,
html[data-theme="light"] .modal-card,
html[data-theme="light"] .dialog {
  background: #ffffff;
  border-color: #ece8f8;
}

/* 底部条：对标站是一条极淡的紫白色 */
html[data-theme="light"] .card-foot {
  background: #fcfbff;
  border-top-color: #eeeafb;
}

/* 所有原本「深字叠加一层灰」的控件，改成纯白 + 淡紫描边 */
html[data-theme="light"] .select-btn,
html[data-theme="light"] .text-input,
html[data-theme="light"] .ref-url,
html[data-theme="light"] .prompt-box,
html[data-theme="light"] .wsearch,
html[data-theme="light"] .wselect,
html[data-theme="light"] .wnew-input,
html[data-theme="light"] .wrange,
html[data-theme="light"] .wtab,
html[data-theme="light"] .wbtn,
html[data-theme="light"] .mini-btn,
html[data-theme="light"] .pill-btn,
html[data-theme="light"] .credit-pill,
html[data-theme="light"] .user-chip,
html[data-theme="light"] .option,
html[data-theme="light"] .chip,
html[data-theme="light"] .ref-chip,
html[data-theme="light"] .vd-btn,
html[data-theme="light"] .vd-group-row,
html[data-theme="light"] .wfoot-all,
html[data-theme="light"] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
html[data-theme="light"] textarea,
html[data-theme="light"] select {
  background: #ffffff;
  border-color: #e9e5f7;
}

/* 参考图拖拽区：近白 + 淡紫虚线，和对标一致 */
html[data-theme="light"] .slot-empty,
html[data-theme="light"] .gallery,
html[data-theme="light"] .col-right .gallery.is-empty .slot-empty {
  background: #fdfdff;
  border-color: #e3dff5;
}

html[data-theme="light"] .col-right .gallery.is-empty .slot-empty:hover {
  background: #faf7ff;
  border-color: #c9b8ff;
}

html[data-theme="light"] .prompt-box:focus-within,
html[data-theme="light"] .select-btn:hover,
html[data-theme="light"] .text-input:focus {
  border-color: #c9b8ff;
}

html[data-theme="light"] .pill-btn.danger { color: #cf3f36; }
html[data-theme="light"] .vd-btn.vd-del { color: #d2453c; }

/* ============================================================
   作品墙对标微调：一行 5 列 + 紧凑卡片 + 竖版淡紫预览区
   放在文件末尾统一覆盖，深浅主题都生效（颜色用变量或中性淡紫）
   ============================================================ */
.works-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.work-card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.work-thumb {
  aspect-ratio: 3 / 4;
  background: #101012;
}

.vd-poster,
.work-thumb .vd-thumb-video { background: #101012; }

.vd-body {
  padding: 8px 10px 10px;
  gap: 5px;
  flex: 1 1 auto;
}

.vd-title { font-size: 12px; }
.vd-rename { font-size: 10px; gap: 2px; padding: 2px; }
.vd-rename svg { width: 11px; height: 11px; }
.vd-filename,
.vd-model { font-size: 10px; }
.vd-group-row { padding: 3px 6px; border-radius: 7px; }
.vd-group-select { font-size: 11px; }

.vd-prompt {
  font-size: 10.5px;
  line-height: 1.55;
  min-height: 32px;
  -webkit-line-clamp: 2;
}

.vd-bottom {
  gap: 4px;
  padding-top: 5px;
  margin-top: auto;
}
.vd-date { font-size: 9.5px; }
.vd-detail-link,
.vd-dl-count { font-size: 10px; }

.vd-actions { margin-top: 0; padding-top: 6px; gap: 2px; }
.vd-btn {
  font-size: 10.5px;
  padding: 5px 0;
  gap: 2px;
  white-space: nowrap;
}
.vd-btn svg { width: 11px; height: 11px; }

.vd-ratio,
.vd-dur { font-size: 9px; padding: 2px 5px; }
.vd-status { font-size: 9px; padding: 0 6px; }

/* 失败卡：对标是简洁的深灰块，弱化感叹号与说明文字 */
.vd-fail-ico { width: 26px; height: 26px; font-size: 15px; }
.vd-fail-msg { font-size: 10px; -webkit-line-clamp: 2; }

/* 批量条移到卡片区上方后的外观 */
.wfoot {
  margin: 0 0 12px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}

.wmove-sel {
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--card);
  color: var(--text-2);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

.wfoot-actions .wbtn:disabled,
.wfoot-actions .wmove-sel:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

/* 常显复选框：暗夜界面用半透明深底 + 淡紫描边（原来是白色小方框） */
.work-check {
  opacity: 1;
  background: rgba(12, 10, 22, 0.62);
  border-color: rgba(160, 136, 255, 0.55);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

/* 置顶图钉避开右上角的状态标签，原来两者叠在一起 */
.work-pin { right: 56px; }

/* ============================================================
   分组库整块面板：把标题 / 搜索 / 页签 / 打包 / 批量条 / 卡片
   整体框进一张圆角白卡里（对标 studio 页那一整块）
   ============================================================ */
.works {
  margin: 0 22px 28px;
  padding: 16px 18px 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(60, 45, 120, 0.04), 0 10px 28px rgba(60, 45, 120, 0.06);
}

/* 标题行：主标题 + 刷新一行，副标题单独占下一行 */
.works-head {
  padding: 0 0 14px;
  gap: 0;
}

.works-title-row {
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 0;
  margin-bottom: 12px;
}

.works-ico {
  display: inline-flex;
  align-items: center;
  color: var(--purple);
  flex: 0 0 auto;
}

.works-ico svg { width: 16px; height: 16px; }

.works-title-row h2 {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.works-title-row .works-sub {
  flex: 1 0 100%;
  order: 3;
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.5;
}

.wbtn-refresh {
  order: 2;
  height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
}

/* 搜索行：搜索框吃掉剩余宽度，日期与时长靠右不换行 */
.works-bar {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: center;
}

.works-bar .wsearch {
  flex: 1 1 auto;
  min-width: 0;
  height: 36px;
  border-radius: 10px;
  border-color: var(--line);
}

.works-bar .wsearch input { font-size: 12.5px; }

.works-bar .wrange {
  flex: 0 0 auto;
  height: 36px;
  border-radius: 10px;
}

.works-bar .wselect {
  flex: 0 0 auto;
  height: 36px;
  min-width: 118px;
  border-radius: 10px;
}

/* 页签行 + 打包行拼成面板里的一个内嵌浅框（中间一条细分隔线） */
.works-tools {
  margin-top: 14px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: var(--card);
}

.wpack {
  margin: 0 0 12px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 0 0 12px 12px;
  background: var(--card);
}

/* 分组页签：选中态实心紫，未选中白底描边 */
.works-tabs { gap: 8px; }

.wtab {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 12.5px;
}

.wtab.active {
  background: var(--purple, #7c5cf6);
  border-color: var(--purple, #7c5cf6);
  color: #fff;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(124, 92, 246, 0.28);
}

/* 明亮主题里 `.wtab` 被统一刷成白底，特异性比 `.wtab.active` 高，
   这里补一条同等级选择器，否则选中页签会白底白字看不见 */
html[data-theme="light"] .wtab.active {
  background: #7c5cf6;
  border-color: #7c5cf6;
  color: #fff;
}

.wtab.active .wtab-n { color: rgba(255, 255, 255, 0.82); }

/* 页签内的改名 / 删除图标：默认隐形，hover 或选中时出现 */
.wtab-wrap { position: relative; display: inline-flex; }

.wtab-wrap .wtab { padding-right: 44px; }

.wtab-ico {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--sub);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.15s, color 0.15s;
}

.wtab-ico svg { width: 11px; height: 11px; }
.wtab-ico.edit { right: 24px; }
.wtab-ico.del { right: 5px; }

.wtab-wrap:hover .wtab-ico,
.wtab-wrap.on .wtab-ico { opacity: 1; }

.wtab-ico:hover { background: rgba(124, 92, 246, 0.14); color: var(--purple); }
.wtab-ico.del:hover { background: rgba(210, 58, 48, 0.14); color: #d2453c; }

.wtab-wrap.on .wtab-ico { color: rgba(255, 255, 255, 0.86); }
.wtab-wrap.on .wtab-ico:hover { background: rgba(255, 255, 255, 0.22); color: #fff; }

/* 批量条：浅紫底，比面板再淡一档 */
.wfoot {
  margin: 0 0 14px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(124, 92, 246, 0.045);
}

.wfoot-n { font-size: 12px; color: var(--sub); }

/* 卡片区：交给面板做外框，网格本身去掉虚线框，一行正好 5 个铺满 */
.works-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  border: 0;
  border-radius: 0;
  padding: 0;
  align-items: stretch;
}

/* 预览区：画面铺满整块，占位底色用暗色（不再留淡紫留白） */
.work-thumb {
  aspect-ratio: 3 / 4;
  background: #101012;
}

.work-thumb img,
.work-thumb video,
.vd-poster {
  object-fit: cover;
  object-position: center;
}

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

@media (max-width: 940px) {
  .works { margin: 0 12px 20px; padding: 14px; }
  .works-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .works-bar { flex-wrap: wrap; }
  .works-bar .wsearch { flex: 1 0 100%; }
}

@media (max-width: 700px) {
  .works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================
   交互反馈层：鼠标移上去必须有色块
   ------------------------------------------------------------
   白底皮肤里写了一批 `html[data-theme="light"] .x { background:#fff }`，
   特异性 (0,2,1) 高过原来的 `.x:hover` (0,2,0)，于是 hover 全被吃掉，
   整站按钮移上去没反应。这里用同等级前缀 + :hover 重新写一遍，
   深浅两套都覆盖，颜色统一走淡紫。
   ============================================================ */

/* ---------- 1. 文字/图标类按钮：淡紫底 + 淡紫描边 + 紫字 ---------- */
.user-chip:hover,
.credit-pill:hover,
.wbtn:hover,
.mini-btn:hover,
.pill-btn:hover,
.vd-btn:hover,
.chip:hover,
.ref-chip:hover,
.wpack-chip:hover,
.wfoot-all:hover {
  background: rgba(124, 92, 246, 0.13);
  border-color: rgba(150, 120, 255, 0.55);
  color: var(--purple-deep, #bcaaff);
}

html[data-theme="light"] .user-chip:hover,
html[data-theme="light"] .credit-pill:hover,
html[data-theme="light"] .wbtn:hover,
html[data-theme="light"] .mini-btn:hover,
html[data-theme="light"] .pill-btn:hover,
html[data-theme="light"] .vd-btn:hover,
html[data-theme="light"] .chip:hover,
html[data-theme="light"] .ref-chip:hover,
html[data-theme="light"] .wpack-chip:hover,
html[data-theme="light"] .wfoot-all:hover {
  background: #f3eeff;
  border-color: #c9b8ff;
  color: #5b3fd0;
}

/* 置灰按钮不该有 hover 反馈 */
html[data-theme="light"] .wbtn:disabled:hover,
html[data-theme="light"] .vd-btn:disabled:hover,
.wbtn:disabled:hover {
  background: var(--card);
  border-color: var(--line);
  color: var(--sub);
  cursor: not-allowed;
}

/* 危险操作 hover 仍是红系 */
html[data-theme="light"] .wbtn.danger:hover,
html[data-theme="light"] .pill-btn.danger:hover,
html[data-theme="light"] .vd-btn.vd-del:hover,
html[data-theme="light"] .wop.danger:hover {
  background: #fdf1f0;
  border-color: #f0b5b0;
  color: #b23a30;
}

/* ---------- 2. 下拉选项：对标站是淡紫底 + 紫色描边 ---------- */
.option:hover {
  background: rgba(124, 92, 246, 0.14);
  box-shadow: inset 0 0 0 1px rgba(150, 120, 255, 0.55);
  color: var(--text);
}

.option.selected:hover {
  background: rgba(124, 92, 246, 0.22);
  box-shadow: inset 0 0 0 1px rgba(150, 120, 255, 0.7);
}

html[data-theme="light"] .option:hover {
  background: #f1ebff;
  box-shadow: inset 0 0 0 1px #c9b8ff;
  color: #4a37a3;
}

html[data-theme="light"] .option.selected:hover {
  background: #e9e1ff;
  box-shadow: inset 0 0 0 1px #b7a1ff;
  color: #4a37a3;
}

html[data-theme="light"] .option:hover .opt-sub { color: #7d6ac9; }

/* ---------- 3. 分组页签 ---------- */
html[data-theme="light"] .wtab:not(.active):hover {
  background: #f3eeff;
  border-color: #c9b8ff;
  color: #5b3fd0;
}

.wtab:not(.active):hover {
  background: rgba(124, 92, 246, 0.16);
  border-color: rgba(150, 120, 255, 0.5);
  color: var(--purple-deep, #bcaaff);
}

/* ---------- 4. 输入框 / 下拉框：hover 描边加深 ---------- */
.wsearch:hover,
.wrange:hover,
.wselect:hover,
.wmove-sel:hover,
.wnew:hover,
.text-input:hover,
.ref-url:hover,
.select-btn:hover,
.prompt-box:hover,
.vd-group-row:hover,
.vd-group-select:hover,
.wnew-input:hover {
  border-color: rgba(150, 120, 255, 0.55);
}

html[data-theme="light"] .wsearch:hover,
html[data-theme="light"] .wrange:hover,
html[data-theme="light"] .wselect:hover,
html[data-theme="light"] .wmove-sel:hover,
html[data-theme="light"] .wnew:hover,
html[data-theme="light"] .text-input:hover,
html[data-theme="light"] .ref-url:hover,
html[data-theme="light"] .select-btn:hover,
html[data-theme="light"] .prompt-box:hover,
html[data-theme="light"] .vd-group-row:hover,
html[data-theme="light"] .vd-group-select:hover,
html[data-theme="light"] .wnew-input:hover {
  border-color: #c9b8ff;
  background: #fff;
}

/* ---------- 5. 作品卡片：hover 浮起 + 紫色描边 + 阴影 ---------- */
html[data-theme="light"] .work-card:hover {
  background: #fff;
  border-color: #c9b8ff;
  box-shadow: 0 10px 24px rgba(88, 66, 168, 0.13);
}

.work-card:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

/* ---------- 6. 卡片内的小链接与复选框 ---------- */
html[data-theme="light"] .vd-rename:hover,
html[data-theme="light"] .vd-detail-link:hover {
  background: #f3eeff;
  color: #5b3fd0;
  border-radius: 5px;
}

html[data-theme="light"] .work-check:hover {
  border-color: #9e86ff;
  box-shadow: 0 0 0 2px rgba(124, 92, 246, 0.18);
}

html[data-theme="light"] .work-pin:hover {
  background: #f3eeff;
  color: #5b3fd0;
}

/* ---------- 7. 侧栏 / 顶栏图标已有 hover，这里只补底色分级 ---------- */
html[data-theme="light"] .icon-btn.plain:hover {
  background: #efe9ff;
  color: #5b3fd0;
}

html[data-theme="light"] .nav-item:hover {
  background: #efe9ff;
  color: #4a37b5;
}

/* ---------- 8. 触摸设备不需要 hover 残影 ---------- */
@media (hover: none) {
  .work-card:hover { transform: none; box-shadow: none; }
}

/* 全站输入框兜底：任何页面的 input/textarea/select 悬停都加深描边
   （白底皮肤用 (0,2,1) 把它们的 border-color 定死了，这里加 pseudo 抬到 (0,3,1)） */
html[data-theme="light"] input:hover:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
html[data-theme="light"] textarea:hover,
html[data-theme="light"] select:hover {
  border-color: #c9b8ff;
}

/* 其它页面的页签/按钮（图片工作台、人脸处理、价格表）：同样给淡紫色块 */
.mode-tab:hover,
.face-tab:hover,
.pause-btn:hover,
.upload-zone:hover {
  background: rgba(124, 92, 246, 0.16);
  border-color: rgba(150, 120, 255, 0.5);
  color: var(--purple-deep, #bcaaff);
}

html[data-theme="light"] .mode-tab:hover,
html[data-theme="light"] .face-tab:hover,
html[data-theme="light"] .pause-btn:hover,
html[data-theme="light"] .upload-zone:hover {
  background: #f3eeff;
  border-color: #c9b8ff;
  color: #5b3fd0;
}

/* ============================================================
   卡片底部「日期 / 详情 / 下载 N + 复用/下载/删除」对齐对标
   ------------------------------------------------------------
   拿 2560px 窗口下两站截图逐像素量的（两张卡都约 434~439 宽）：
     项目          对标        改前
     按钮高        33px       26px
     卡片内边距    17px       11px
     按钮间距      7px        2px
     按钮字号      12px       10.5px
     日期字号      11px       9.5px
     描边          #EBE7FF    #E9E5F8
   改成一比一，顺便把「复用」图标换成对标那种回转箭头。
   ============================================================ */

/* 卡片内容左右留白对齐对标（17 → 用 16 兼顾窄屏 5 列） */
.work-card .vd-body {
  padding: 9px 16px 16px;
  gap: 6px;
}

/* 日期行：字号抬到 11，行高对齐 */
.work-card .vd-bottom {
  gap: 6px;
  padding-top: 6px;
  margin-top: auto;
  align-items: center;
}
.work-card .vd-date { font-size: 11px; color: #9AA0AE; }
.work-card .vd-detail-link,
.work-card .vd-dl-count { font-size: 11px; }
.work-card .vd-detail-link { color: #7C5CF6; font-weight: 500; }
.work-card .vd-dl-count { color: #9AA0AE; }

/* 按钮行：33 高、12 号字、7 间距、8 圆角、淡紫描边、白底 */
.work-card .vd-actions {
  gap: 7px;
  padding-top: 10px;
  margin-top: 4px;
  border-top: 1px solid #F0EEF8;
}
.work-card .vd-btn {
  flex: 1 1 0;
  min-width: 0;
  min-height: 33px;
  padding: 0 4px;
  gap: 5px;
  border: 1px solid #EBE7FF;
  border-radius: 8px;
  background: #fff;
  color: #1A2130;
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}
.work-card .vd-btn svg {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
}

/* 删除：图标与文字变红，描边仍是淡紫（对标就是这样） */
.work-card .vd-btn.vd-del { color: #E5484D; }
.work-card .vd-btn.vd-del svg { stroke: #E5484D; }

/* 悬停：白底 → 淡紫底（对标同款手感） */
.work-card .vd-btn:hover {
  background: #F4F1FF;
  border-color: #D6C9FF;
  color: #5B3FD0;
}
.work-card .vd-btn.vd-del:hover {
  background: #FDF2F2;
  border-color: #F5C2C4;
  color: #D03B41;
}

/* 深色主题下不要被上面写死的白底/深字压坏 */
html[data-theme="dark"] .work-card .vd-btn {
  background: transparent;
  border-color: var(--line);
  color: var(--text-2);
}
html[data-theme="dark"] .work-card .vd-btn.vd-del { color: #FF7B72; }
/* 深色主题的悬停：复用/下载/删除都要有反馈（否则会被上面更高优先级的基础态压掉） */
html[data-theme="dark"] .work-card .vd-btn:hover {
  background: var(--purple-soft);
  border-color: var(--purple-line);
  color: var(--purple-deep);
}
html[data-theme="dark"] .work-card .vd-btn.vd-del:hover {
  background: rgba(255, 123, 114, 0.14);
  border-color: rgba(255, 123, 114, 0.42);
  color: #FF7B72;
}
html[data-theme="dark"] .work-card .vd-date,
html[data-theme="dark"] .work-card .vd-dl-count { color: var(--hint); }
html[data-theme="dark"] .work-card .vd-actions { border-top-color: var(--line); }

/* 窄屏（≤1180 四列时卡片变宽没问题；≤940 三列更宽）不用改，
   只在小到两列时把字号收一档避免「复用」两个字被挤断 */
@media (max-width: 700px) {
  .work-card .vd-btn { font-size: 11px; gap: 4px; min-height: 31px; }
  .work-card .vd-body { padding: 9px 12px 13px; }
}

/* 白底皮肤里 `html[data-theme="light"] .vd-btn` 的特异性 (0,3,1) 压过了
   上面 `.work-card .vd-btn` 的 (0,3,0)，描边和删除色没吃到。
   这里用同等前缀重写一遍，确保 1:1 对标（#EBE7FF 描边 / #E5484D 删除红）。 */
html[data-theme="light"] .work-card .vd-btn,
html[data-theme="light"] .work-card .vd-btn.vd-reuse,
html[data-theme="light"] .work-card .vd-btn.vd-download {
  border: 1px solid #EBE7FF;
  background: #fff;
  color: #1A2130;
}

html[data-theme="light"] .work-card .vd-btn.vd-del {
  border-color: #EBE7FF;
  background: #fff;
  color: #E5484D;
}

html[data-theme="light"] .work-card .vd-btn:hover {
  border-color: #D6C9FF;
  background: #F4F1FF;
  color: #5B3FD0;
}

html[data-theme="light"] .work-card .vd-btn.vd-del:hover {
  border-color: #F5C2C4;
  background: #FDF2F2;
  color: #D03B41;
}

/* ============================================================
   任务详情：由「全屏铺满」改为「居中弹窗」
   ------------------------------------------------------------
   用户给的两张图对比：
     原实现 遮罩 padding 16px + 卡片 100% 宽高 → 几乎顶满整个窗口
     目标   弹窗宽约窗口的 80%、高约 82%，四周留白、圆角、居中
   实测目标图（1080×564 窗口）：弹窗 858×460 → 79.4% × 81.6%
   所以取 82vw / 84vh，另设 2000×1140 的像素上限，
   大屏（2560）下不会夸张地铺满，小屏仍按比例收。
   ============================================================ */
.vd-detail-mask {
  align-items: center;
  justify-content: center;
  padding: 20px 24px;
  /* 遮罩不染色，只做羽化：背后页面虚化 + 一层极淡白雾，弹窗才浮得起来 */
  background: rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(7px) saturate(1.06);
  backdrop-filter: blur(7px) saturate(1.06);
}

/* 深色主题：羽化之外再压一层黑，否则白弹窗直接砸在深色页面上太刺眼 */
html[data-theme="dark"] .vd-detail-mask {
  background: rgba(0, 0, 0, 0.42);
  -webkit-backdrop-filter: blur(7px) saturate(0.95);
  backdrop-filter: blur(7px) saturate(0.95);
}

/* 四周再淡出一圈白雾，中间透亮、边缘柔和，弹窗就"浮"在雾面上 */
.vd-detail-mask::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at 50% 46%,
    rgba(255, 255, 255, 0) 34%,
    rgba(255, 255, 255, 0.2) 68%,
    rgba(255, 255, 255, 0.42) 100%
  );
}

html[data-theme="dark"] .vd-detail-mask::before {
  background: radial-gradient(
    ellipse at 50% 46%,
    rgba(0, 0, 0, 0) 36%,
    rgba(0, 0, 0, 0.22) 72%,
    rgba(0, 0, 0, 0.45) 100%
  );
}

/* 弹窗内滚到底不要继续把背后页面带着滚（遮罩透明后这点很明显） */
.vd-page .vd-page-scroll { overscroll-behavior: contain; }

.vd-page {
  width: min(2000px, 80vw);
  height: min(1140px, 82vh);
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  /* 纯黑背景下弹窗只比底色亮一档，靠描边和阴影跟背景分开 */
  background: #101012;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.6), 0 28px 80px rgba(0, 0, 0, 0.7);
}

/* 弹窗变矮后播放器按视口高收一档，避免右栏一进来就要滚很多 */
.vd-page .vd-player {
  width: 100%;
  height: auto;
}

/* 无参考图时占位框保持 92px，不再额外压缩 */

/* 提示词框也跟着收，长提示词在框内自己滚 */
.vd-page .vd-prompt-box { max-height: min(34vh, 340px); }

/* 只有窄到接近手机宽度才把占比放大，否则保持 80% 的比例留白 */
@media (max-width: 760px) {
  .vd-detail-mask { padding: 10px; }
  .vd-page { width: 96vw; height: 92vh; border-radius: 10px; }
}

/* ================= 卡片封面加载态（v20261113y） =================
 * 以前每张卡都直接把 mp4 挂到 <video> 上当封面，云端带宽只有 400KB/s，
 * 5 张卡并发就是几十秒，用户看到的就是一片空白。现在改成排队抓帧，
 * 抓的时候给一个流动的骨架光，比死板的纯色块更像"正在加载"。
 */
.work-thumb .vd-thumb-video { background: transparent; }

.work-card.thumb-loading .work-thumb {
  background: linear-gradient(100deg, #101012 0%, #262038 38%, #161618 62%, #101012 100%);
  background-size: 220% 100%;
  animation: zrThumbFlow 1.7s ease-in-out infinite;
}

@keyframes zrThumbFlow {
  0% { background-position: 140% 0; }
  100% { background-position: -40% 0; }
}

.work-card.thumb-loading .work-thumb .vd-skeleton { display: none; }

/* 加载中的小转圈放在左上角，不挡中间的画面 */
.work-card.thumb-loading .work-thumb::after {
  content: '';
  position: absolute;
  left: 12px;
  top: 12px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(107, 76, 224, 0.25);
  border-top-color: #6b4ce0;
  animation: zrThumbSpin 0.8s linear infinite;
  z-index: 3;
  pointer-events: none;
}

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

@media (prefers-reduced-motion: reduce) {
  .work-card.thumb-loading .work-thumb { animation: none; }
  .work-card.thumb-loading .work-thumb::after { animation: none; }
}

/* ============================================================
   v20261114b · 纯黑底 + 豆包式提示词输入区
   1) 背景由紫黑改为纯黑 #000，面板只留极淡的中性层次
   2) 提示词区重排：左上「+」添加素材、正文、底栏工具 + 右侧模型名与圆形发送
   3) 文字色从紫白改为中性白灰，整体干净不偏色
   ============================================================ */

:root {
  --text: #ededed;
  --text-2: #b9b9b9;
  --sub: #8b8b8b;
  --hint: #6d6d6d;
  --line: rgba(255, 255, 255, 0.07);
  --line-soft: rgba(255, 255, 255, 0.05);
}

html, body { background: #000; }

.app { background: #000; }

.sidebar {
  background: #000;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
}

.topbar { background: transparent; }

.main { background: #000; }

.view, .view.active { background: transparent; }

/* 面板：纯黑之上抬一层极浅的灰，靠描边分界，不再有紫雾 */
.card,
.panel,
#worksSection,
.works {
  background: #0a0a0b;
  border-color: rgba(255, 255, 255, 0.07);
}

.work-card { background: #0a0a0b; }

/* ---------------- 提示词输入区（豆包风格） ---------------- */

.prompt-box {
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  background: #131314;
  padding: 14px 14px 10px;
  gap: 0;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.prompt-box:hover,
.prompt-box:focus-within {
  border-color: rgba(255, 255, 255, 0.14);
  background: #161617;
}

.prompt-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 0;
}

/* 左上角那个「+」：和豆包一样是一块比输入框略亮的圆角方块 */
.prompt-add {
  flex: 0 0 auto;
  width: 40px;
  height: 46px;
  margin-top: 2px;
  border-radius: 10px;
  background: #1f1f21;
  color: #8e8e8e;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.prompt-add svg { width: 18px; height: 18px; }

.prompt-add:hover {
  background: #2a2a2d;
  color: #e6e6e6;
}

.prompt-add:active { transform: scale(0.97); }

#prompt {
  flex: 1 1 auto;
  height: auto;
  /* 这里只是兜底基线，真正生效的是文件后面「提示词区加高」那段，别只改这一处 */
  min-height: 96px;
  max-height: 240px;
  padding: 6px 2px 0;
  font-size: 13.5px;
  line-height: 1.85;
  background: transparent;
  color: #ededed;
}

#prompt::placeholder { color: #6f6f6f; }

.prompt-box .mention-row {
  padding: 6px 2px 0 52px;
}

.prompt-box .mention-chip {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #1c1c1e;
  color: #c9c9c9;
}

.prompt-box .mention-chip:hover { background: #262629; }

/* 底栏：左侧工具、右侧模型名 + 圆形发送 */
.prompt-toolbar {
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 0 2px;
  border-top: none;
  border-bottom: none;
  background: transparent;
}

.prompt-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.prompt-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.prompt-model {
  font-size: 12px;
  color: #d5d5d5;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prompt-send {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #2b2b2e;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.12s ease;
}

.prompt-send svg { width: 17px; height: 17px; }

.prompt-send:hover { background: #3a3a3e; }

.prompt-send:active { transform: scale(0.94); }

/* 底栏里那两个小按钮：把浅底改成中性深灰 */
.prompt-box .mini-btn {
  height: 26px;
  padding: 0 9px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: #1c1c1e;
  color: #a5a5a5;
}

.prompt-box .mini-btn:hover {
  background: #26262a;
  border-color: rgba(255, 255, 255, 0.16);
  color: #ededed;
}

.prompt-box .prompt-hint {
  font-size: 11.5px;
  color: #6f6f6f;
  margin-left: 2px;
}

.prompt-box .prompt-counter {
  padding: 4px 2px 0;
  color: #6b6b6b;
}

/* 窄屏：模型名太长时缩掉，别把发送按钮挤走 */
@media (max-width: 900px) {
  .prompt-model { max-width: 120px; }
  .prompt-box .prompt-hint { display: none; }
}

/* 没有引用素材时整行隐藏，保持输入框像豆包那样干净 */
.prompt-box .mention-row:not(:has(.mention-chip)) { display: none; }

/* 输入框改成纵向弹性：正文吃掉剩余高度，工具栏自然贴底 */
.prompt-box {
  display: flex;
  flex-direction: column;
}

.prompt-main {
  flex: 1 1 auto;
  align-items: stretch;
}

.prompt-add { align-self: flex-start; }

#prompt {
  height: 100%;
  min-height: 92px;
}

/* 图片工作台/人脸处理等复用 .prompt-box 但内部没有 prompt-main 的页面：
   内层 textarea 单独吃一层底色，和外框撞色；统一让它透明，跟外框同底 */
.prompt-box:not(:has(.prompt-main)) {
  padding: 4px 4px 2px;
}

.prompt-box:not(:has(.prompt-main)) textarea {
  flex: 1 1 auto;
  background: transparent;
  border: none;
  outline: none;
  resize: none;
  padding: 12px 12px 4px;
  font-size: 13.5px;
  line-height: 1.85;
  color: #ededed;
}

.prompt-box:not(:has(.prompt-main)) textarea::placeholder { color: #6f6f6f; }

.prompt-box:not(:has(.prompt-main)) .prompt-counter {
  padding: 0 12px 8px;
  color: #6b6b6b;
}

/* ================= 提示词区加高 + @ 引用面板（2026-11-14，2026-11-17 再调） =================
 * 实测基准（两张截图都是 1920×1013，同一尺寸可直接比）：
 *   对标站提示词框 894×332，正文区行距约 22px、可见 13 行
 *   我们旧版     ~955×160，只有对标的一半
 * 2026-11-17：对标改成「rows=7 + min-h-150 + 宽屏 h-full」，
 * 也就是随窗口高度伸缩、把剩余高度吃满（大屏上明显更高）。
 * 所以这里从死高 320 改成 clamp(320, 44vh, 540)：1080 高的屏约 475，808 高的屏约 355，
 * 只比原来高一档，不会把「任务名称 / 提交」顶出屏幕。
 * 内容超出时框内滚动，不撑高页面。
 */

.prompt-box {
  position: relative;
  /* 基线里是 hidden，会把 @ 面板裁掉，这里必须放开 */
  overflow: visible;
}

#prompt {
  min-height: clamp(320px, 44vh, 540px);
  max-height: min(72vh, 760px);
  /* 想再高可以自己往下拖，鼠标停在右下角会出行高调节柄 */
  resize: vertical;
  line-height: 1.72;
}

/* 只有窗口确实很矮（笔记本横屏全屏浏览器）时才收，别让提交按钮跑到屏幕外 */
@media (max-height: 660px) {
  #prompt { min-height: 240px; max-height: min(60vh, 520px); }
}

/* ---------------- @ 引用面板 ---------------- */

.mention-pop {
  position: absolute;
  z-index: 60;
  width: 272px;
  max-height: 258px;
  overflow-y: auto;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #1a1a1c;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.6);
}

.mention-pop[hidden] { display: none; }

.mention-pop::-webkit-scrollbar { width: 8px; }
.mention-pop::-webkit-scrollbar-thumb {
  background: #303033;
  border-radius: 4px;
}

.mp-head {
  padding: 6px 8px 4px;
  font-size: 11px;
  color: #6f6f6f;
}

.mp-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 8px;
  cursor: pointer;
}

.mp-item.active { background: rgba(139, 116, 248, 0.18); }

.mp-thumb {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  overflow: hidden;
  background: #262629;
  color: #8e8e8e;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.mp-thumb svg { width: 16px; height: 16px; }

.mp-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.mp-label {
  font-size: 12.5px;
  color: #ededed;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.mp-name {
  font-size: 11px;
  color: #7d7d7d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-kind {
  flex: 0 0 auto;
  font-size: 10.5px;
  color: #a294f5;
  background: rgba(139, 116, 248, 0.14);
  padding: 2px 6px;
  border-radius: 5px;
}

.mp-empty {
  padding: 12px 10px;
  font-size: 12px;
  line-height: 1.7;
  color: #8b8b8b;
}

/* 底栏的「@ 引用素材」现在可以点，点一下直接弹面板 */
.prompt-box .prompt-hint.is-clickable {
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
}

.prompt-box .prompt-hint.is-clickable:hover {
  color: #c9c9c9;
  background: #222225;
}

/* ==================== 积分充值页 ==================== */

.rc-step .panel-head { margin-bottom: 14px; }

.rc-step-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 19px;
  height: 19px;
  margin-right: 7px;
  border-radius: 50%;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--purple-deep);
  background: var(--purple-soft);
  border: 1px solid var(--purple-line);
  vertical-align: 1px;
}

/* 套餐网格 */
.rc-plans {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.rc-plan {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 12px 14px;
  text-align: left;
  border-radius: var(--r-md);
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.16s, background 0.16s, transform 0.12s;
}
.rc-plan:hover { border-color: var(--purple-line); }
.rc-plan:active { transform: scale(0.985); }

.rc-plan-yuan { font-size: 16px; font-weight: 650; letter-spacing: 0.2px; }
.rc-plan-yuan b { font-size: 19px; }
.rc-plan-credits { font-size: 11.5px; color: var(--sub); }

.rc-plan.is-on { background: var(--purple-soft); border-color: var(--purple); }
.rc-plan.is-on .rc-plan-credits { color: var(--purple-deep); }

/* 自定义金额 */
.rc-calc {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--card-2);
  border: 1px solid var(--line);
}
.rc-calc-label { font-size: 13px; color: var(--sub); }
.rc-calc .rc-input { width: 118px; }
.rc-calc-unit { font-size: 12.5px; color: var(--hint); }
.rc-calc-arrow { font-size: 12.5px; color: var(--hint); margin-left: auto; }
.rc-calc-out {
  font-size: 18px;
  font-weight: 700;
  color: var(--purple-deep);
  font-variant-numeric: tabular-nums;
}

.rc-hint { margin-top: 8px; font-size: 12.5px; color: var(--hint); min-height: 17px; }
.rc-hint.is-warn { color: #e0b055; }

/* 收款码 */
.rc-pay {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 16px;
}

.rc-qr {
  flex: none;
  width: 168px;
  height: 168px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}
.rc-qr img { width: 100%; height: 100%; object-fit: contain; display: block; }
.rc-qr.is-empty { background: var(--card-2); }

.rc-qr-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px;
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: var(--hint);
}
.rc-qr-empty svg { width: 34px; height: 34px; color: #3a3a3d; }

.rc-pay-side { min-width: 0; }
.rc-payee { font-size: 14px; color: var(--text-2); margin-bottom: 8px; }
.rc-payee-label { font-size: 12px; color: var(--hint); margin-right: 6px; }
.rc-pay-note { font-size: 12.5px; line-height: 1.7; color: var(--hint); }

/* 付款方式 */
.rc-methods { display: flex; gap: 10px; }

.rc-method {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--r-md);
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 0.16s, color 0.16s, background 0.16s;
}
.rc-method svg { width: 17px; height: 17px; }
.rc-method.is-on {
  color: var(--purple-deep);
  border-color: var(--purple);
  background: var(--purple-soft);
}

.rc-submit { width: 100%; margin-top: 6px; }

/* 充值记录 */
.rc-recs { display: flex; flex-direction: column; }

.rc-rec {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 2px;
  border-top: 1px solid var(--line-soft);
}
.rc-rec:first-child { border-top: 0; }

.rc-rec-credits {
  flex: none;
  min-width: 84px;
  font-size: 20px;
  font-weight: 700;
  color: var(--mint-text);
  font-variant-numeric: tabular-nums;
}

.rc-rec-main { min-width: 0; }
.rc-rec-title { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--sub); }
.rc-rec-sub { margin-top: 3px; font-size: 12.5px; color: var(--hint); word-break: break-all; }
.rc-rec-time { margin-top: 3px; font-size: 11.5px; color: #5c5c60; }
.rc-rec-reject { margin-top: 5px; font-size: 12px; color: var(--danger); }

.rc-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
  border: 1px solid transparent;
}
.rc-badge.is-pending { color: #e0b055; background: rgba(224, 176, 85, 0.12); border-color: rgba(224, 176, 85, 0.3); }
.rc-badge.is-approved { color: var(--mint-text); background: var(--mint-bg); border-color: var(--mint-line); }
.rc-badge.is-rejected { color: var(--danger); background: rgba(255, 123, 114, 0.1); border-color: rgba(255, 123, 114, 0.28); }

@media (max-width: 640px) {
  .rc-plans { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .rc-pay { flex-direction: column; align-items: stretch; gap: 14px; }
  .rc-qr { width: 100%; max-width: 240px; height: 240px; margin: 0 auto; }
  .rc-calc { gap: 6px; }
  .rc-calc-arrow { margin-left: 0; }
  .rc-calc .rc-input { width: 100px; }
  .rc-rec-credits { min-width: 70px; font-size: 18px; }
}

/* 充值页的两张卡在手机上并排，省一屏纵向空间 */
@media (max-width: 640px) {
  .balance-grid.rc-balance-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .balance-grid.rc-balance-grid .balance-card { padding: 14px 16px; }
  .balance-grid.rc-balance-grid .bc-num { font-size: 26px; }
  .balance-grid.rc-balance-grid .bc-num-sub { font-size: 22px; }
}

/* ============================================================
   窄屏覆盖（2026-11-15 追加）
   上面 1708 行的 .card-body 两栏规则写在 @media(max-width:1180px) 之后，
   同优先级把它盖掉了，导致手机上参数区还是两栏、右栏被压到 190px：
   参考视频/音频的条目名会被挤成 0 宽。这里在文件末尾重新声明，只对窄屏生效。
   ============================================================ */
@media (max-width: 1180px) {
  .card-body { grid-template-columns: minmax(0, 1fr); }
  .ref-name { min-width: 60px; }
}

/* 手机/窄屏：提示词区别占满一屏，够写就行（上面那条 clamp 会盖掉早期的 900px 断点） */
@media (max-width: 760px) {
  #prompt {
    min-height: 200px;
    max-height: none;
    resize: none;
  }
}

/* 两栏默认 align-items:start，右栏不拉伸就贴不到左栏底部 */
.col-right {
  align-self: stretch;
}

/* 两栏默认 align-items:start，右栏不拉伸就贴不到左栏底部 */
.col-right {
  align-self: stretch;
}

/* 方案甲：任务名称 + 共 N 积分 + 生成按钮，放右栏底部，
   与左侧提示词框底栏同高（2026-11-18） */
.col-right .foot-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.col-right .foot-row .flabel {
  margin: 0;
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 12px;
}

.col-right .foot-row .text-input {
  flex: 1 1 120px;
  min-width: 96px;
  height: 36px;
  margin: 0;
  padding: 0 10px;
  font-size: 12.5px;
}

.col-right .foot-row .name-counter {
  flex: 0 0 auto;
  font-size: 11px;
}

.col-right .foot-row .total {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 12px;
}

.col-right .foot-row .total b {
  font-size: 16px;
}

.col-right .foot-row .btn-primary {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 12px;
  font-size: 12.5px;
  white-space: nowrap;
}

/* 窄一点时把「积分」两个字收掉，只留数字，别把输入框挤没 */
@media (max-width: 1320px) {
  .col-right .foot-row .total .unit {
    display: none;
  }
}

/* 手机（<=760）：一行挤不下就自动换行，任务名称在上、积分和按钮在下 */
@media (max-width: 760px) {
  .col-right .foot-row {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .col-right .foot-row .total {
    margin-left: auto;
  }
  .col-right .foot-row .btn-primary {
    height: 38px;
  }
}

/* 手机（<=760）：一行挤不下就自动换行，任务名称在上、积分和按钮在下 */
@media (max-width: 760px) {
  .col-right .foot-row {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .col-right .foot-row .total {
    margin-left: auto;
  }
  .col-right .foot-row .btn-primary {
    height: 38px;
  }
}

/* 单栏布局（<=1180）时这行会占满整行，给输入框更多空间 */
@media (max-width: 1180px) {
  .col-right .foot-row {
    margin-top: 4px;
  }
  .col-right .foot-row .text-input {
    flex: 1 1 auto;
  }
}

/* ---------------- 提示词里的 @ 引用染色（2026-11-18） ----------------
 * textarea 不能给局部文字上色，所以底下垫一层镜像层（#promptHl），
 * textarea 文字透明只留光标，颜色和底色由镜像层显示。
 * 镜像层的字号/行距/内距必须与 #prompt 完全一致，否则高亮块会错行。 */
.prompt-input {
  position: relative;
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
}

.prompt-hl {
  position: absolute;
  inset: 0;
  padding: 6px 2px 0;
  /* 下面这几项必须与 #prompt 逐项一致，差一项光标就会和文字错位 */
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 13.5px;
  line-height: 1.72;
  font-weight: 400;
  letter-spacing: normal;
  word-spacing: normal;
  tab-size: 4;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
  text-indent: 0;
  text-transform: none;
  overflow: hidden;
  pointer-events: none;
  color: #ededed;
  z-index: 0;
}

.prompt-input #prompt {
  position: relative;
  z-index: 1;
  color: transparent;
  caret-color: #ededed;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-weight: 400;
  letter-spacing: normal;
  word-spacing: normal;
  tab-size: 4;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
  text-indent: 0;
  text-transform: none;
}

.prompt-input #prompt::placeholder { color: #6f6f6f; }

.prompt-input #prompt::selection { background: rgba(139, 116, 248, 0.32); }

.prompt-token {
  background: rgba(139, 116, 248, 0.26);
  color: #d3c7ff;
  border-radius: 4px;
  /* 关键：padding / margin 会改变字宽，后面所有字都会往右挤，光标就越来越偏。
     所以用 box-shadow 往外扩出一圈，视觉上有留白、但不占布局。 */
  padding: 0;
  margin: 0;
  box-shadow: 0 0 0 2px rgba(139, 116, 248, 0.26);
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* ---------------- 切换视角（超级管理员代看子账号）横幅 ---------------- */
.impersonate-banner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 8px 16px;
  background: #8b74f8;
  color: #fff;
  font-size: 13px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}
.impersonate-banner .imp-badge {
  background: rgba(0, 0, 0, 0.22);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 600;
}
.impersonate-banner .imp-text { font-weight: 500; }
.impersonate-banner .imp-exit {
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 6px;
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s;
}
.impersonate-banner .imp-exit:hover { background: rgba(255, 255, 255, 0.24); }

/* ================= 图片工作台 @Image 引用染色（2026-11-25） =================
 * 复用视频工作台的镜像层思路：textarea 文字透明只留光标，
 * 底下垫一层 #imgPromptHl 镜像层，把 @image1 包成品牌紫高亮块。
 * 注意：图片工作台 textarea 的 line-height 是 1.85（不是视频工作台的 1.72），
 * 镜像层必须逐项对齐，否则高亮块会错行。 */
#imgPromptHl {
  position: absolute;
  inset: 0;
  padding: 12px 12px 4px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 13.5px;
  line-height: 1.85;
  font-weight: 400;
  letter-spacing: normal;
  word-spacing: normal;
  tab-size: 4;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  word-break: normal;
  text-indent: 0;
  text-transform: none;
  overflow: hidden;
  pointer-events: none;
  color: #ededed;
  z-index: 0;
}

#imgPrompt {
  position: relative;
  z-index: 1;
  color: transparent !important;
  caret-color: #ededed;
}

#imgPrompt::selection { background: rgba(139, 116, 248, 0.32); }
