:root {
  --bg: #0a0d14;
  --bg-soft: #0f131c;
  --surface: #141926;
  --surface-2: #1a2032;
  --surface-3: #212840;
  --border: #262e44;
  --border-soft: #1e2536;
  --text: #e8ecf6;
  --text-dim: #a3adc4;
  --text-mute: #6b7690;
  --primary: #6d7cff;
  --primary-2: #9b6bff;
  --primary-soft: rgba(109, 124, 255, 0.13);
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.13);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.13);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.13);
  --radius-lg: 16px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.85);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SFMono-Regular", ui-monospace, "JetBrains Mono", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(1100px 620px at 8% -12%, rgba(109, 124, 255, 0.16), transparent 62%),
    radial-gradient(940px 560px at 96% 4%, rgba(155, 107, 255, 0.13), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 20px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #2b3348;
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: #3a4460;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ------------------------------- 头部 ------------------------------- */

.header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 22px;
  background: rgba(10, 13, 20, 0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-logo {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  box-shadow: 0 8px 20px -8px rgba(109, 124, 255, 0.9);
  flex: none;
}
.brand-logo svg {
  width: 18px;
  height: 18px;
}

.brand-text h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 650;
  letter-spacing: 0.2px;
}
.brand-text p {
  margin: 0;
  font-size: 16.5px;
  color: var(--text-mute);
}

.header-spacer {
  flex: 1;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ------------------------------- 布局 ------------------------------- */

.layout {
  display: grid;
  /* 右栏跟随视口变宽（420 起步、最高 720），剩下的全给左栏，不再留两侧空白 */
  grid-template-columns: minmax(0, 1fr) clamp(420px, 24vw, 720px);
  gap: 18px;
  align-items: start;
  max-width: 2800px;
  margin: 0 auto;
  padding: 18px 22px 40px;
}

/*
 * 非「生成」类页面（模型广场、资产库、消费记录、灵感、API 接入、教程…）：
 * 右栏的预览与任务列表收起来，左栏独占整宽 —— 那些页面用不到预览，
 * 留着它只会把正文挤窄。切回「创作台 / 渠道视频」时自动还原。
 */
.layout.no-right {
  grid-template-columns: minmax(0, 1fr);
}
.layout.no-right .col-right {
  display: none;
}

.col-left,
.col-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.col-right {
  position: sticky;
  top: 76px;
}

/* 顶栏菜单切换（首页 / 创作台 / 广场 / 消费记录…） */
.kind-switch {
  display: flex;
  gap: 6px;
  padding: 5px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.kind-switch button {
  flex: 1;
  padding: 11px 16px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 18.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.kind-switch button:hover {
  color: var(--text);
  background: var(--surface-2);
}

.kind-switch button.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: 0 10px 26px -14px rgba(109, 124, 255, 1);
}

.panel-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

/* 任务卡片里的图片缩略图 */
.task-thumbs {
  display: flex;
  gap: 6px;
  margin: 8px 0 4px;
  flex-wrap: wrap;
}

.task-thumbs img {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

/*
 * 图片预览区：不固定 16:9，按内容自适应并可滚动。
 *
 * 关键在 flex: 1 1 auto —— 这里本来就是个滚动容器，压缩它不会丢信息，
 * 所以让它去承担纵向压缩。之前它是 flex-shrink: 0（不肯让位），
 * 结果全部压缩量都落在 .preview-info 上，把参数文字挤成了一条缝。
 */
.preview-stage.is-image {
  aspect-ratio: auto;
  flex: 1 1 auto;
  min-height: 140px;
  /* 由 44vh 逐级收窄到 34vh，把空间让给下方参数与任务列表 */
  max-height: 34vh;
  overflow-y: auto;
  display: block;
}

/* 图片结果网格 */
.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  padding: 12px 16px;
}

.image-grid figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.image-grid img {
  width: 100%;
  /*
   * 竖版长图在较窄的右栏里会被按 100% 宽度拉到很高（9:16 时约等于宽度的 1.78 倍），
   * 单张就能占满整个预览区并触发压缩。限制显示高度，避免一张图把布局挤垮。
   */
  max-height: 60vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: zoom-in;
  display: block;
}

.image-grid figcaption {
  font-size: 14.5px;
  color: var(--text-mute);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 说明行里的「转资产」：外观对齐旁边的「下载」链接，别做成一个按钮块 */
.image-grid figcaption button {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 14.5px;
  color: var(--primary);
  cursor: pointer;
}
.image-grid figcaption button:hover {
  text-decoration: underline;
}
.image-grid figcaption button:disabled {
  color: var(--text-mute);
  cursor: default;
  text-decoration: none;
}

/* ------------------------------- 资产库 ------------------------------- */

.asset-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.asset-toolbar .input {
  flex: 1;
  min-width: 200px;
}

.asset-count {
  font-size: 16.5px;
  color: var(--text-mute);
  white-space: nowrap;
}

/*
 * 剧集栏：当前剧集下拉 + 新建。
 * 放在工具栏**上面** —— 它是"现在看哪一集"的总开关，筛选（搜索/类型/标签）都在它之下。
 */
.asset-seriesbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
}
.asset-seriesbar .series-label {
  font-size: 16.5px;
  color: var(--text-dim);
  white-space: nowrap;
}
.asset-seriesbar .select {
  width: auto;
  min-width: 180px;
  max-width: 340px;
  font-size: 17px;
  padding: 7px 10px;
}

/* 选择弹窗工具栏里的剧集下拉 */
.series-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 16.5px;
  color: var(--text-dim);
  white-space: nowrap;
}
.series-pick .select {
  width: auto;
  min-width: 170px;
  font-size: 17px;
  padding: 7px 10px;
}

.asset-tagbar,
.asset-typebar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.asset-tagbar:empty,
.asset-typebar:empty {
  display: none;
}

/* 类型筛选按钮上的数量 */
.pill-count {
  margin-left: 5px;
  font-family: var(--mono);
  font-size: 14px;
  opacity: 0.75;
}

.tab-pill {
  padding: 5px 12px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 15.5px;
  cursor: pointer;
  transition: all 0.15s;
}
.tab-pill:hover {
  color: var(--text);
  border-color: #3a4460;
}
.tab-pill.active {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  gap: 12px;
}

/* 空状态 / 提示块要横跨整行，否则会被塞进第一格 */
.asset-grid > .empty,
.asset-grid > .notice {
  grid-column: 1 / -1;
}

/*
 * 选择器里的网格：卡片更小、列数更多，滚动条只属于网格本身
 * （搜索栏留在网格外面，滚动时不会跟着跑）
 */
.asset-grid-pick {
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 10px;
  max-height: 58vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 6px;
  scrollbar-width: thin;
}
.asset-grid-pick::-webkit-scrollbar {
  width: 9px;
}
.asset-grid-pick::-webkit-scrollbar-thumb {
  background: #39415c;
  border-radius: 99px;
}
.asset-grid-pick::-webkit-scrollbar-track {
  background: transparent;
}

.asset-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.asset-card:hover {
  border-color: #3a4460;
  transform: translateY(-1px);
}
.asset-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary);
}
/* 选中后整卡强提示：缩略图压暗 + 主题色描边，一眼可辨 */
.asset-card.selected img,
.asset-card.selected .asset-thumb {
  filter: brightness(0.72);
}
.asset-card.selected::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: color-mix(in srgb, var(--primary) 14%, transparent);
  pointer-events: none;
}

/*
 * 类型角标。
 * 图片占绝大多数，没必要每条都标 —— 只把视频/音频标出来，减少视觉噪音。
 */
.asset-type {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 99px;
  background: rgba(10, 13, 20, 0.78);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
  pointer-events: none;
}
.asset-type svg {
  width: 12px;
  height: 12px;
}
.asset-type-image {
  display: none;
}
.asset-type-video {
  color: #8ab4ff;
}
.asset-type-audio {
  color: var(--success);
}

/* 缩略图区：图片与视频统一按 1:1 裁切；音频另一套（见下） */
.asset-card img,
.asset-card .asset-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: var(--surface-2);
}

/*
 * 音频缩略图：卡片里直接给一个可试听的播放器。
 * 音频没有画面可看，光显示一个图标等于没法确认内容对不对。
 */
.asset-thumb-audio {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px;
  aspect-ratio: 1 / 1;
  background: linear-gradient(160deg, rgba(109, 124, 255, 0.16), rgba(15, 19, 28, 0.92));
  color: var(--primary);
}
.asset-thumb-audio svg {
  width: 34px;
  height: 34px;
  opacity: 0.85;
}
.asset-thumb-audio audio {
  width: 100%;
  max-width: 100%;
  height: 34px;
}

.asset-check {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 3;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(10, 13, 20, 0.6);
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  transition: transform 0.12s, background 0.12s;
}
.asset-card:hover .asset-check {
  transform: scale(1.1);
}
.asset-card.selected .asset-check {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: #fff;
  transform: scale(1.12);
}

/* 右下角「查看大图」按钮：缩略图点击已改为勾选，预览走这里 */
.asset-preview-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 3;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(10, 13, 20, 0.68);
  border: 1px solid var(--border);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
}
.asset-card:hover .asset-preview-btn {
  opacity: 1;
}
.asset-preview-btn:hover {
  background: var(--primary);
  border-color: transparent;
}
.asset-preview-btn svg {
  width: 16px;
  height: 16px;
}

.asset-body {
  padding: 8px 10px 4px;
}

.asset-name {
  font-size: 16px;
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-meta {
  font-size: 14.5px;
  color: var(--text-mute);
  margin-top: 2px;
}

.asset-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.asset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 6px 10px 10px;
}

.asset-actions button {
  /* 四个按钮（复制链接 / 改名 / 标签 / 删除）在窄卡片里会自动折行，别把字挤扁 */
  flex: 1 1 62px;
  white-space: nowrap;
  padding: 5px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 14.5px;
  cursor: pointer;
}
.asset-actions button:hover {
  color: var(--text);
  border-color: #414c69;
}
.asset-actions button.danger:hover {
  color: var(--danger);
  border-color: var(--danger);
}


/* ------------------------------- 卡片 ------------------------------- */

.card {
  background: linear-gradient(180deg, rgba(26, 32, 50, 0.72), rgba(20, 25, 38, 0.86));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-soft);
}

.card-head h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.card-head .step {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 16px;
  font-weight: 700;
  flex: none;
}

.card-head .head-hint {
  margin-left: auto;
  font-size: 16.5px;
  color: var(--text-mute);
}

/*
 * 「已选择模型」那一行（视频 / 图片两张卡的 `#modelHint` / `#imgModelHint`）。
 * 2026-10-17 用户定：**不加粗、不改文字颜色**（仍是 --text-mute），只让它更显眼一点 ——
 * 靠浅一档的底 + 细边框 + 稍大字号 + 一点字距，不动配色也不动字重。
 */
.card-head .head-hint.head-hint-active {
  color: var(--text-mute);
  font-size: 17.5px;
  letter-spacing: 0.2px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
}

.card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ------------------------------- 表单 ------------------------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 550;
  color: var(--text-dim);
}

.label .req {
  color: var(--danger);
  font-size: 16px;
}

/* 提示词标题行：左边是标题，右边挂「重置」按钮 */
.label-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.label-row .label {
  flex: 1;
  min-width: 0;
}

.label .tip-badge {
  margin-left: auto;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-mute);
}

/*
 * 2026-10-18 用户要求：充值的地方标注「无手续费」。
 * 跟在「支付宝支付 · x–y 元」那个 tip-badge 后面，用绿色小胶囊，
 * 比正文略小、但一眼能看到（.label 是 flex，前一个 badge 用 margin-left:auto 推右，
 * 这里必须把 auto 覆盖成固定间距，否则两个 badge 会被拉开）。
 */
.label .tip-badge-free {
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 99px;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--success);
  background: var(--success-soft);
  white-space: nowrap;
}

/*
 * 2026-10-18 管理员手动充值：输入框要看得出「填的是钱，不是算力」。
 * 金色 ¥ 前缀 + 「元」后缀，下面再实时给一行「= ⚡500 到账」。
 * 第一个徽标占掉 margin-left:auto，紧跟的「1 元 = 10 算力」用 6px 固定间距。
 */
.label .tip-badge-money {
  margin-left: auto;
  padding: 1px 8px;
  border-radius: 99px;
  font-size: 13.5px;
  font-weight: 650;
  color: #e8b463;
  background: rgba(232, 180, 99, 0.14);
  white-space: nowrap;
}
.label .tip-badge-money + .tip-badge {
  margin-left: 6px;
}

.money-input {
  position: relative;
  display: block;
  min-width: 0;
}
.money-input .input {
  padding-left: 30px;
  padding-right: 34px;
  font-variant-numeric: tabular-nums;
}
.money-input-prefix,
.money-input-suffix {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  line-height: 1;
}
.money-input-prefix {
  left: 11px;
  font-size: 17px;
  font-weight: 700;
  color: #e8b463;
}
.money-input-suffix {
  right: 11px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-mute);
}

.wallet-convert {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text-mute);
  white-space: nowrap;
}
.wallet-convert.ok {
  color: var(--success);
}

/* 流水里的充值行：算力后面补一个人民币括号，方便与管理员填的金额对上 */
.ledger-yuan {
  color: var(--text-mute);
  font-size: 14.5px;
  font-weight: 500;
}

.input,
.textarea,
.select {
  width: 100%;
  padding: 9px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 18.5px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-mute);
}

.textarea {
  resize: vertical;
  min-height: 104px;
  line-height: 1.65;
}

/*
 * 提示词输入框。
 * 这里的稿子通常一两千字（实测 1262–1850 字），默认那点高度只够看三四行，
 * 写着写着就不知道上面是什么了。所以默认就给足高度，还能继续往下拖，
 * 拖过的高度会记在浏览器里。
 */
.textarea-prompt {
  min-height: 460px;
  max-height: 80vh;
}

/* --------------------- 提示词参考引用高亮（promptHighlight.js） --------------------- */

/* 定位容器：textarea 在文档流里撑开高度，镜像层 absolute 贴合 */
.prompt-wrap {
  position: relative;
}

/*
 * 镜像层：垫在输入框底下。
 * 字体/行高/内边距由 JS 从 textarea 抄过来，保证一个字都不错位。
 * 文字由镜像层负责显示（输入框本体文字透明），命中的引用词在这里染成黄色 ——
 * 所以镜像层的字必须和输入框一个字都不差，否则会出现重影。
 */
.prompt-hl {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  overflow-wrap: break-word;
  color: var(--text);
  pointer-events: none;
}
.prompt-hl mark {
  /* 文字高亮（黄字），不用背景色。切忌加粗：字重不同会导致宽度不一致而错位 */
  background: none;
  color: #ffd54a;
  padding: 0;
  border-radius: 0;
}
/* 输入框浮到镜像层上面：文字透明（真文字由镜像层显示），光标保持原色 */
.prompt-wrap .textarea {
  position: relative;
  z-index: 1;
  background: transparent;
  color: transparent;
  caret-color: var(--text);
  /*
   * 必须是块级：textarea 默认是 inline-block，行盒底部会留一条基线空隙（约 9px），
   * 而镜像层用的是 inset:0 —— 它会把这条空隙也算进去，于是比输入框高出一截，
   * 多出来的部分露在输入框边框下方（文字与底色一起"浮"在外面），
   * 且属于布局残留，清空内容也消不掉。改成 block 后两层高度严格一致。
   */
  display: block;
}
.prompt-wrap .textarea::placeholder {
  color: var(--text-mute);
}
/* 中文输入法组词过程中：镜像层暂时隐身、输入框恢复原色，否则组词文字会看不见 */
.prompt-wrap.composing .textarea {
  color: var(--text);
}
.prompt-wrap.composing .prompt-hl {
  visibility: hidden;
}

/* --------------------- 登录门：动态验证码 --------------------- */

.captcha-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}
.captcha-row .input {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  letter-spacing: 3px;
  text-transform: uppercase;
}
/* 验证码图：服务端生成的 SVG，点一下换新的 */
.captcha-img {
  width: 128px;
  height: 44px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 14.5px;
  color: var(--text-mute);
  user-select: none;
}
.captcha-img svg {
  display: block;
}

/* --------------------- 滑块拼图验证 --------------------- */

.slide-captcha {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 320px;
}
.sc-img {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  line-height: 0;
}
.sc-img svg {
  display: block;
}
.sc-loading {
  width: 300px;
  height: 150px;
  display: grid;
  place-items: center;
  color: var(--text-mute);
  font-size: 16px;
  line-height: 1.5;
}
.sc-piece {
  position: absolute;
  cursor: grab;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.55));
}
.sc-track {
  position: relative;
  height: 40px;
  border-radius: 99px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  overflow: hidden;
}
.sc-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: rgba(109, 124, 255, 0.25);
}
.sc-handle {
  position: absolute;
  left: 0;
  top: 0;
  width: 52px;
  height: 100%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-radius: 99px;
  color: #fff;
  font-size: 22px;
  cursor: grab;
  user-select: none;
  touch-action: none;
}
.sc-handle:active {
  cursor: grabbing;
}
.sc-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-mute);
  font-size: 15.5px;
  pointer-events: none;
  padding-left: 52px;
}
/* 验证通过：轨道与滑块转绿，锁定拖动 */
.sc-track.ok {
  border-color: var(--success);
}
.sc-track.ok .sc-fill {
  background: rgba(60, 160, 100, 0.22);
  width: 100% !important;
}
.sc-track.ok .sc-handle {
  background: var(--success);
  cursor: default;
}
.sc-track.ok .sc-hint {
  color: var(--success);
}

/* --------------------- 登录门：紧凑排版 --------------------- */

/*
 * 注册要填的字段多（邮箱、邮箱验证码、密码 ×2、滑块），
 * 按全站默认的字号与间距会把弹窗顶到 88vh 之外，逼出滚动条。
 * 这里只压登录门这一个弹窗（.gate-modal），别处的表单不受影响。
 */
.modal.gate-modal .modal-head {
  padding: 10px 16px;
}
.modal.gate-modal .modal-head h3 {
  font-size: 18px;
}
.modal.gate-modal .modal-body {
  padding: 12px 16px;
  gap: 8px;
}
.modal.gate-modal .field {
  gap: 5px;
}
.modal.gate-modal .label {
  gap: 6px;
  font-size: 15px;
  line-height: 1.25;
}
.modal.gate-modal .label .tip-badge {
  font-size: 13px;
}
.modal.gate-modal .input {
  padding: 7px 10px;
  font-size: 15.5px;
}
.modal.gate-modal .segmented {
  padding: 3px;
}
.modal.gate-modal .segmented button {
  min-width: 0;
  padding: 6px 10px;
  font-size: 15px;
}
.modal.gate-modal .field-foot {
  min-height: 0;
  font-size: 13.5px;
}
/* 没有提示时不占位、不吃 field 的间距 */
.modal.gate-modal #gateUserHint:empty {
  display: none;
}
.modal.gate-modal .slide-captcha {
  gap: 7px;
}
.modal.gate-modal .btn-sm {
  padding: 6px 10px;
  font-size: 14.5px;
}
.modal.gate-modal .modal-foot {
  padding: 10px 16px;
}
.modal.gate-modal .modal-foot .btn {
  padding: 8px 20px;
  font-size: 15.5px;
}

/* --------------------- 消费记录列表 --------------------- */

/*
 * 消费记录页：上面一行页签（消费流水 / 调用记录），下面只显示其中一个列表。
 * 这里固定单列 —— 别跟着 .panel-stack 的宽屏两列走，否则页签会只占半栏、
 * 另一张表被塞到右边。
 */
#spendPanel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
#recordTabs {
  max-width: 360px;
}

/* 创作台页签：视频生成 / 图片生成，压在左栏面板之上，别拉满整宽 */
#createTabs {
  max-width: 420px;
}

/* 顶部汇总：消费 / 退回 / 充值 三个合计数 */
.spend-summary {
  display: flex;
  gap: 22px;
  font-size: 16.5px;
  color: var(--text-mute);
  margin-bottom: 10px;
}
.spend-summary b {
  font-size: 19px;
  font-weight: 650;
  margin-left: 4px;
}
.spend-summary b.out {
  color: var(--danger);
}
.spend-summary b.in {
  color: var(--success);
}

/* 管理员追溯条：填平台任务 ID 查上游渠道与上游任务号（2026-10-19） */
.trace-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.trace-bar .input {
  flex: 1 1 auto;
  min-width: 240px;
}
.trace-result {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 16.5px;
}
.trace-result dl {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 6px 12px;
  margin: 0;
}
.trace-result dt {
  color: var(--text-mute);
}
.trace-result dd {
  margin: 0;
  word-break: break-all;
}
/* 追溯里的上游任务号是按钮（点击复制）：长号允许折行，别把卡片撑破 */
.trace-result .call-id {
  white-space: normal;
  word-break: break-all;
  text-align: left;
  line-height: 1.5;
}
.trace-record {
  margin-bottom: 12px;
}
.trace-record-title {
  font-size: 16px;
  color: var(--text-mute);
  margin-bottom: 6px;
}

.spend-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16.5px;
}
.spend-table th {
  text-align: left;
  font-weight: 500;
  color: var(--text-mute);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.spend-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}

.spend-time {
  white-space: nowrap;
  color: var(--text-mute);
  font-family: var(--mono);
  font-size: 15.5px;
}

/* 类型徽章 */
.spend-tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 15px;
  white-space: nowrap;
}
.spend-tag-out {
  background: var(--danger-soft, rgba(220, 80, 80, 0.15));
  color: var(--danger);
}
.spend-tag-in {
  background: var(--success-soft, rgba(60, 160, 100, 0.15));
  color: var(--success);
}

/* 说明列：原因 + 明细 + 关联任务 */
.spend-desc {
  min-width: 260px;
  line-height: 1.7;
}
.spend-user {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 8px;
  border-radius: 6px;
  background: var(--bg-soft);
  color: var(--text-mute);
  font-size: 15px;
}
.spend-detail {
  color: var(--text-mute);
}

/*
 * 调用记录「耗时」列（2026-10-19 用户要求）：单列、精确到 0.1 秒。
 * 低于 500 秒绿色、500 秒及以上红色；等宽数字，避免每行长度不一跳动。
 */
.call-dur {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 15.5px;
}
.call-dur-fast {
  color: var(--success);
}
.call-dur-slow {
  color: var(--danger);
}
.spend-task {
  display: inline-block;
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 14.5px;
  color: var(--text-mute);
}

.spend-amount {
  text-align: right;
  white-space: nowrap;
  font-family: var(--mono);
  font-weight: 600;
}
.spend-amount.in {
  color: var(--success);
}
.spend-amount.out {
  color: var(--text-dim);
}
.spend-balance {
  text-align: right;
  white-space: nowrap;
  color: var(--text-mute);
  font-family: var(--mono);
}

/* 底部分页 */
.spend-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 12px;
}

/* --------------------- 在线充值额度页 --------------------- */

/* 快捷档位：一排金额按钮，点中高亮 */
.tier-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.tier-btn {
  min-width: 64px;
  justify-content: center;
}
.tier-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 650;
}

/* --------------------- 调用记录（复用 spend-* 表格样式） --------------------- */

/* 提示词列：默认截断，完整内容悬停看 title */
.call-prompt {
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/*
 * 管理员视角：服务端给的是完整提示词（普通用户侧仍是截断后的 120 字，不挂这个类）。
 * 默认仍单行，点一下整段展开、再点收起；展开后按段落换行、自动断长串。
 */
.call-prompt-full {
  cursor: pointer;
}
.call-prompt-full.expanded {
  white-space: pre-wrap;
  word-break: break-word;
  text-overflow: clip;
  max-width: 520px;
  line-height: 1.55;
}
.call-error {
  color: var(--danger);
  font-size: 15px;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/*
 * 调用记录的「任务 ID」：等宽小字 + 可点击复制（2026-10-19）。
 * 做成按钮是为了可点、可聚焦；外观按正文文字处理，别在表格里跳出来抢视线。
 */
.call-id {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 14.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s;
}
.call-id:hover {
  color: var(--primary);
  text-decoration: underline;
}
/* 任务 ID 下面那行「上游 xxx」（仅管理员可见，2026-10-19） */
.call-id-sub {
  display: block;
  margin-top: 2px;
  color: var(--text-mute);
  font-size: 13px;
}

/* 状态徽章 */
.call-tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 15px;
  white-space: nowrap;
}
.call-ok {
  background: var(--success-soft, rgba(60, 160, 100, 0.15));
  color: var(--success);
}
.call-fail {
  background: var(--danger-soft, rgba(220, 80, 80, 0.15));
  color: var(--danger);
}
.call-run {
  background: var(--primary-soft);
  color: var(--primary);
}
.call-wait {
  background: var(--bg-soft);
  color: var(--text-mute);
}

/* --------------------- 教程（使用教程 / 隐私政策 / 服务条款） --------------------- */

.help-sec {
  margin-top: 14px;
  max-width: 880px;
  line-height: 1.8;
}
.help-sec h3 {
  font-size: 20px;
  font-weight: 650;
  margin: 22px 0 8px;
  color: var(--text);
}
.help-sec h3:first-child {
  margin-top: 0;
}
.help-sec h4 {
  font-size: 18.5px;
  font-weight: 650;
  margin: 18px 0 6px;
  color: var(--text);
}
.help-sec p,
.help-sec li {
  font-size: 17px;
  color: var(--text-dim, var(--text));
  margin: 4px 0;
}
.help-sec ul,
.help-sec ol {
  padding-left: 26px;
  margin: 6px 0;
}
.help-sec li::marker {
  color: var(--text-mute);
}
.help-sec b {
  color: var(--text);
}
.help-updated {
  font-size: 15.5px;
  color: var(--text-mute);
  margin-bottom: 12px;
}
/* 教程底部的联系方式（切换页签也一直显示） */
.help-contact {
  max-width: 880px;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
  font-size: 17px;
  color: var(--text-mute);
}

/* 教程页签：三个按钮等宽排一行（容器放宽，抵消 .segmented 的 min-width 换行） */
#helpTabs {
  max-width: 560px;
}
#helpTabs button {
  flex: 1 1 0;
  min-width: 0;
}

/* --------------------- 系统公告 --------------------- */

/* 顶部横幅：所有页面可见，点 ✕ 关闭后同一条不再出现 */
/* 横幅已移出 .layout（首页也要看得到），宽度与主内容的左右留白对齐：2800 - 2*22 */
body > #announceBanner {
  width: min(2756px, calc(100% - 44px));
  margin: 18px auto 0;
}

#announceBanner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid rgba(109, 124, 255, 0.45);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(109, 124, 255, 0.14), rgba(155, 107, 255, 0.08));
  margin-bottom: 4px;
}
#announceBanner .ann-icon {
  color: var(--primary);
  flex: none;
  margin-top: 2px;
}
#announceBanner .ann-body {
  flex: 1;
  min-width: 0;
  line-height: 1.65;
}
#announceBanner .ann-body b {
  display: block;
  font-size: 17.5px;
}
#announceBanner .ann-content {
  font-size: 16px;
  color: var(--text-dim, var(--text));
  white-space: pre-wrap;
  word-break: break-word;
}
#announceBanner .ann-more {
  flex: none;
  align-self: center;
  background: none;
  border: none;
  color: var(--primary);
  font-size: 16px;
  cursor: pointer;
  white-space: nowrap;
}
#announceBanner .ann-more:hover {
  text-decoration: underline;
}
#announceBanner .ann-close {
  flex: none;
  background: none;
  border: none;
  color: var(--text-mute);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}
#announceBanner .ann-close:hover {
  color: var(--text);
}

/* 公告面板列表 */
.ann-item {
  border-bottom: 1px solid var(--border-soft);
  padding: 12px 4px;
}
.ann-item-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ann-item-head b {
  font-size: 18px;
}
.ann-meta {
  color: var(--text-mute);
  font-size: 15px;
  flex: 1;
}
.ann-item-content {
  margin-top: 6px;
  font-size: 16.5px;
  color: var(--text-dim, var(--text));
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.7;
}

.input[type="number"] {
  font-family: var(--mono);
}

.field-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16.5px;
  color: var(--text-mute);
  min-height: 16px;
}
.field-foot .grow {
  flex: 1;
}
.field-foot .err {
  color: var(--danger);
}
/* 提示本身就是错误容器时（登录门邮箱格式提示）同样走危险色 */
.field-foot.err {
  color: var(--danger);
}

/* 模型卡片
 *
 * 2026-10-18：在售型号涨到 11 张（按秒 8 张 + 按条 3 张），原来的 238px 列宽 + 42px
 * 描述最小高让「选择模型」这一块占掉大半屏。这里按「每行多放几张、行高压一半」收紧。
 * 2026-10-20 用户要求「可以大点，一行 5 张」：从 6 张收到 5 张，字号与内边距一并放大。
 *   · 固定**一行 5 张**（窄屏自动降到 3 / 2 张，免得挤爆）；
 *   · 内边距 11/13，名称 16.5px，描述 13.5px/1.45、最多两行截断（卡高不被长描述撑开）；
 *   · chip 只在这块里缩小（.model-card .chip），别的地方的 .chip 保持原大小。
 */

.model-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
}

/* 窄屏放不下 5 张：先降到 3 张，再降到 2 张（图片页共用同一套） */
@media (max-width: 1024px) {
  .model-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .model-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.model-card {
  position: relative;
  text-align: left;
  padding: 11px 13px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.model-card:hover {
  border-color: #38425f;
  transform: translateY(-1px);
}

.model-card.active {
  border-color: var(--primary);
  background: linear-gradient(180deg, rgba(109, 124, 255, 0.16), rgba(109, 124, 255, 0.05));
  box-shadow: 0 0 0 1px var(--primary) inset;
}

.model-card .m-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  font-size: 16.5px;
  font-weight: 620;
  line-height: 1.4;
}

.model-card .m-tag {
  padding: 1px 6px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
}

/* 描述最多两行：长描述截断并给省略号，不把整行卡片顶高 */
.model-card .m-desc {
  margin-top: 4px;
  font-size: 13.5px;
  color: var(--text-mute);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.model-card .m-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

/* chip 是全局类（用户列表 / 任务卡也在用），只在这块里缩小 */
.model-card .chip {
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 12.5px;
}

.chip {
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--text-dim);
  font-size: 15px;
  font-family: var(--mono);
  letter-spacing: 0.2px;
}

/* 分段控件 */

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.segmented button {
  flex: 1 1 auto;
  min-width: 138px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.segmented button:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.segmented button.active {
  background: linear-gradient(135deg, rgba(109, 124, 255, 0.9), rgba(155, 107, 255, 0.85));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 16px -10px rgba(109, 124, 255, 1);
}

.segmented button:disabled {
  opacity: 0.34;
  cursor: not-allowed;
}

/* 开关 */

.switch-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.switch-row .sw-text {
  flex: 1;
  min-width: 0;
}
.switch-row .sw-text b {
  display: block;
  font-size: 18px;
  font-weight: 550;
}
.switch-row .sw-text span {
  font-size: 16px;
  color: var(--text-mute);
}

.switch {
  position: relative;
  width: 38px;
  height: 21px;
  border-radius: 99px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  cursor: pointer;
  flex: none;
  transition: background 0.18s;
}

.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #7d879e;
  transition: transform 0.18s, background 0.18s;
}

.switch.on {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: transparent;
}
.switch.on::after {
  transform: translateX(17px);
  background: #fff;
}
.switch.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* 滑块 */

.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 10px;
  border-radius: 99px;
  /* --p 由 JS 按当前值写入：已选区间高亮、剩余区间灰底，一眼看出拖到哪了 */
  background: linear-gradient(
    to right,
    var(--primary) 0%,
    var(--primary) var(--p, 0%),
    var(--surface-3) var(--p, 0%),
    var(--surface-3) 100%
  );
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border: 3px solid #fff;
  cursor: grab;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
  transition: box-shadow 0.15s;
}
input[type="range"]::-webkit-slider-thumb:active {
  cursor: grabbing;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.45), 0 0 0 7px rgba(109, 124, 255, 0.22);
}

/* Firefox */
input[type="range"]::-moz-range-progress {
  background: var(--primary);
  height: 10px;
  border-radius: 99px;
}
input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border: 3px solid #fff;
  cursor: grab;
}

input[type="number"].num-box {
  width: 98px;
  flex: none;
  text-align: center;
}

/* ------------------------------- 按钮 ------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: 18.5px;
  font-weight: 550;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: #3a4460;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 26px -14px rgba(109, 124, 255, 1);
}

.btn-primary:hover:not(:disabled) {
  filter: brightness(1.1);
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}

.btn-ghost {
  background: transparent;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 17px;
}

/* 提示词卡片右下角的「清空提示词」：次要操作，弱化成描边小胶囊 */
.prompt-clear {
  padding: 1px 10px;
  border-radius: 99px;
  background: transparent;
  color: var(--text-mute);
  font-size: 15.5px;
  line-height: 1.7;
}

.prompt-clear:hover:not(:disabled) {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-soft);
}

.btn-icon {
  padding: 7px;
  border-radius: var(--radius-sm);
}

.btn-danger:hover:not(:disabled) {
  border-color: var(--danger);
  color: var(--danger);
  background: var(--danger-soft);
}

.btn-block {
  width: 100%;
  padding: 12px 15px;
  font-size: 20px;
}

/* ------------------------------- 素材槽 ------------------------------- */

.material {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: rgba(15, 19, 28, 0.55);
  padding: 12px;
}

.material-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
}

.material-head .mh-title {
  font-size: 18px;
  font-weight: 600;
}

.material-head .mh-count {
  padding: 1px 7px;
  border-radius: 99px;
  background: var(--surface-3);
  color: var(--text-dim);
  font-size: 15px;
  font-family: var(--mono);
}

/* 槽位下方的一行硬限制（参考视频 / 参考音频的时长合计上限） */
.mh-note {
  font-size: 15px;
  color: var(--text-mute);
  line-height: 1.6;
  margin: -3px 0 9px;
}
.mh-note b {
  color: var(--text-dim);
}

.material-head .mh-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
}

.material-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.material-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}

.material-item .idx {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 15px;
  font-weight: 700;
  font-family: var(--mono);
  flex: none;
}

.material-item .thumb {
  width: 56px;
  height: 44px;
  border-radius: 5px;
  object-fit: cover;
  background: var(--surface-3);
  flex: none;
}

.material-item .url {
  flex: 1;
  min-width: 0;
  font-size: 16.5px;
  font-family: var(--mono);
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-item .url.muted {
  font-family: var(--font);
  color: var(--text-mute);
  font-style: italic;
}

.material-item .rm {
  flex: none;
  padding: 3px 7px;
  border: none;
  background: transparent;
  color: var(--text-mute);
  cursor: pointer;
  border-radius: 5px;
  font-size: 21px;
  line-height: 1;
}
.material-item .rm:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

/* ----------------------------------------------------------------------
 * 参考素材：横向网格（与「渠道视频」的参考图区同一套排版）
 * 方块缩略图 + 左下角编号徽标 + 右上角操作按钮；名称/地址走悬停提示
 * -------------------------------------------------------------------- */

.material-list.material-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
}

/* 空态文案（还没有添加参考图）占满一行，别被挤成一个格子 */
.material-grid > span {
  grid-column: 1 / -1;
}

.material-grid .material-item {
  position: relative;
  display: block;
  padding: 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}

.material-grid .material-item .thumb {
  width: 100%;
  height: 100%;
  border-radius: 0;
  display: block;
}

/* 非图片素材（音频 / 视频 / 认不出的地址）在缩略图里放图标：同样要锁尺寸，别撑满整格 */
.material-item .thumb svg {
  width: 20px;
  height: 20px;
}

.material-grid .material-item .idx {
  position: absolute;
  left: 6px;
  bottom: 5px;
  width: auto;
  height: auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font: 600 12px/1.5 var(--mono);
}

.material-grid .material-item .ops {
  position: absolute;
  right: 5px;
  top: 5px;
  display: flex;
  gap: 4px;
}

.material-grid .material-item .ops .rm {
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 13px;
  line-height: 22px;
  text-align: center;
}

.material-grid .material-item .ops .rm:hover:not(:disabled) {
  background: var(--primary);
  color: #fff;
}

.material-grid .material-item .ops .rm[data-act='remove']:hover {
  background: var(--danger);
}

.material-grid .material-item .ops .rm:disabled {
  opacity: 0.35;
  cursor: default;
}

.material-drop {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-mute);
  font-size: 16.5px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}
.material-drop:hover {
  border-color: var(--primary);
  color: var(--text-dim);
  background: var(--primary-soft);
}
.material-drop.disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
/* 图标必须锁死尺寸：SVG 本身没写 width/height，不锁会被 flex 撑成整块区域那么大 */
.material-drop-icon {
  display: flex;
  flex: none;
  color: var(--primary);
}
.material-drop-icon svg {
  width: 22px;
  height: 22px;
}
.material-drop-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.material-drop-text b {
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
}
.material-drop-text > span {
  font-size: 16px;
}
.material-drop input {
  display: none;
}

.upload-progress {
  height: 3px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
  margin-top: 7px;
}
.upload-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  transition: width 0.2s;
}

/* ------------------------------- 提示条 ------------------------------- */

.notice {
  display: flex;
  gap: 9px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 17px;
  line-height: 1.6;
  border: 1px solid transparent;
}
.notice svg {
  width: 15px;
  height: 15px;
  flex: none;
  margin-top: 2px;
}
.notice-info {
  background: var(--primary-soft);
  border-color: rgba(109, 124, 255, 0.28);
  color: #c3caff;
}
.notice-warn {
  background: var(--warn-soft);
  border-color: rgba(251, 191, 36, 0.28);
  color: #f4d18a;
}
.notice-danger {
  background: var(--danger-soft);
  border-color: rgba(248, 113, 113, 0.3);
  color: #f8b4b4;
}
.notice-success {
  background: var(--success-soft);
  border-color: rgba(52, 211, 153, 0.28);
  color: #9be8c9;
}
.notice b {
  font-weight: 650;
}

/* ------------------------------- 提交区 ------------------------------- */

.submit-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid var(--border-soft);
  background: rgba(10, 13, 20, 0.5);
  flex-wrap: wrap;
}

.cost-est {
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 16.5px;
  color: var(--text-mute);
}
.cost-est b {
  font-size: 20px;
  color: var(--text);
  font-family: var(--mono);
}

.submit-bar .grow {
  flex: 1;
}

/* ------------------------------- 任务面板 ------------------------------- */

.tasks-card {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 96px);
  /* 关键：flex 子项默认 min-height:auto，不加这行列表会被内容撑破，
     超出的部分又被 .card 的 overflow:hidden 裁掉，表现成「滚不动」 */
  min-height: 0;
}

.preview {
  border-bottom: 1px solid var(--border-soft);
  background: #05070c;
  position: relative;
  display: flex;
  flex-direction: column;
  /*
   * 不允许被压缩（原为 flex: 0 1 auto）。
   *
   * 里面的预览区有 min-height 下限，一旦这个容器被压得比它还小，
   * 子项就无法继续收缩，只能向外溢出到下方工具栏上（实测确实会叠上去）。
   * 高度不足的部分交给下方的任务列表承担 —— 它本来就能滚动。
   */
  flex: 0 0 auto;
  min-height: 0;
}

.preview-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  /* 预览最高占视口 32%，保证下方消息区在任何屏高下都有空间 */
  max-height: 32vh;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  background:
    radial-gradient(520px 260px at 50% 0%, rgba(109, 124, 255, 0.12), transparent 70%),
    #05070c;
  overflow: hidden;
}

.preview-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

.preview-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-mute);
  font-size: 17px;
  text-align: center;
  padding: 18px;
}
.preview-placeholder svg {
  width: 34px;
  height: 34px;
  opacity: 0.5;
}

/*
 * 说明：预览区下方原先还有一块 .preview-info（任务 ID / 模型 / 规格 / 操作按钮）。
 * 它长期占掉两三百像素、持续挤压预览与清单，现已改为任务卡片上的「详情」按钮 + 弹窗。
 * 弹窗内部复用下面这几个 .preview-* 样式，所以它们仍然保留。
 */

.preview-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.preview-title .pid {
  font-family: var(--mono);
  font-size: 16px;
  color: var(--text-mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.preview-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.preview-prompt {
  font-size: 17px;
  color: var(--text-dim);
  line-height: 1.6;
  max-height: 108px;
  overflow: auto;
  padding: 8px 10px;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-soft);
}

/* 任务列表 */

.tasks-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-soft);
  flex-wrap: wrap;
}

.tab-pills {
  display: flex;
  gap: 4px;
}

.tab-pills button {
  padding: 5px 10px;
  border: 1px solid transparent;
  border-radius: 99px;
  background: transparent;
  color: var(--text-mute);
  font-family: inherit;
  font-size: 17px;
  cursor: pointer;
  transition: all 0.15s;
}
.tab-pills button:hover {
  color: var(--text);
  background: var(--surface-2);
}
.tab-pills button.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.tab-pills button .n {
  margin-left: 5px;
  font-family: var(--mono);
  font-size: 15px;
  opacity: 0.8;
}

.tasks-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 任务卡片不允许被压缩，否则会挤扁而不是产生滚动条 */
.tasks-list > * {
  flex: 0 0 auto;
}

.task-item {
  position: relative;
  padding: 11px 12px;
  background: rgba(20, 25, 38, 0.75);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.task-item:hover {
  border-color: #333d59;
  background: rgba(26, 32, 50, 0.9);
}

.task-item.active {
  border-color: var(--primary);
  background: rgba(109, 124, 255, 0.08);
}

.task-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.task-model {
  font-size: 18px;
  font-weight: 620;
  font-family: var(--mono);
}

.task-time {
  margin-left: auto;
  font-size: 16px;
  color: var(--text-mute);
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 16px;
  font-weight: 600;
  flex: none;
}
.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.badge-queued {
  background: var(--surface-3);
  color: var(--text-dim);
}
.badge-in_progress {
  background: var(--primary-soft);
  color: var(--primary);
}
.badge-in_progress::before {
  animation: pulse 1.4s ease-in-out infinite;
}
.badge-completed {
  background: var(--success-soft);
  color: var(--success);
}
.badge-failed {
  background: var(--danger-soft);
  color: var(--danger);
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.4;
    transform: scale(0.7);
  }
}

.task-prompt {
  font-size: 17px;
  color: var(--text-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 8px;
  line-height: 1.55;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.progress {
  height: 4px;
  border-radius: 99px;
  background: var(--surface-3);
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  transition: width 0.4s ease;
}

.progress.indeterminate i {
  width: 38% !important;
  animation: slide 1.5s ease-in-out infinite;
}

@keyframes slide {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(320%);
  }
}

/* 任务卡片底部：第一行时间与占用，第二行操作按钮（窄卡片上按钮还会自动折行） */
.task-foot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  font-size: 16px;
  color: var(--text-mute);
}

.task-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  /* 时间与占用靠右侧，和下面一排按钮错开 */
  justify-content: flex-end;
}

.task-actions {
  display: flex;
  flex-wrap: wrap;
  /* 按钮从左往右依次排 */
  justify-content: flex-start;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.15s;
}
.task-item:hover .task-actions {
  opacity: 1;
}

.task-actions button,
.task-actions a {
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-dim);
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
  /* 下载是个 <a>，要压掉全局的链接样式，跟旁边的按钮长得一致 */
  text-decoration: none;
  line-height: 1.45;
}
.task-actions button:hover,
.task-actions a:hover {
  color: var(--text);
  border-color: #414c69;
  text-decoration: none;
}
.task-actions button.danger:hover {
  color: var(--danger);
  border-color: var(--danger);
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 42px 20px;
  color: var(--text-mute);
  font-size: 18px;
  text-align: center;
}
.empty svg {
  width: 38px;
  height: 38px;
  opacity: 0.4;
}

/* ------------------------------- 弹窗 ------------------------------- */

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 6, 11, 0.72);
  backdrop-filter: blur(4px);
  animation: fade 0.15s ease;
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal {
  width: 100%;
  max-width: 690px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 70px -30px #000;
  animation: pop 0.18s ease;
  overflow: hidden;
}

.modal.wide {
  max-width: 880px;
}

/* 多列网格类弹窗（资产选择器）：更宽才能一次看到更多素材 */
.modal.xwide {
  max-width: 1080px;
}

@keyframes pop {
  from {
    transform: translateY(10px) scale(0.98);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border-soft);
}

.modal-head h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 620;
}

.modal-head .close {
  margin-left: auto;
  padding: 4px 9px;
  border: none;
  background: transparent;
  color: var(--text-mute);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
}
.modal-head .close:hover {
  background: var(--surface-2);
  color: var(--text);
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.modal-foot {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 18px;
  border-top: 1px solid var(--border-soft);
}
.modal-foot .grow {
  flex: 1;
}

.kv {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 6px 12px;
  font-size: 17px;
}
.kv dt {
  color: var(--text-mute);
}
.kv dd {
  margin: 0;
  word-break: break-all;
}

code.inline {
  font-family: var(--mono);
  font-size: 16.5px;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  color: var(--text-dim);
}

/* ------------------------------- Toast ------------------------------- */

.toast-wrap {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-width: 500px;
}

.toast {
  display: flex;
  gap: 9px;
  padding: 11px 13px;
  border-radius: var(--radius);
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: 0 18px 40px -20px #000;
  font-size: 18px;
  line-height: 1.55;
  animation: slideIn 0.2s ease;
}
.toast svg {
  width: 15px;
  height: 15px;
  flex: none;
  margin-top: 2px;
}
.toast span {
  white-space: pre-line;
}
.toast-success {
  border-color: rgba(52, 211, 153, 0.45);
}
.toast-success svg {
  color: var(--success);
}
.toast-error {
  border-color: rgba(248, 113, 113, 0.45);
}
.toast-error svg {
  color: var(--danger);
}
.toast-warn {
  border-color: rgba(251, 191, 36, 0.45);
}
.toast-warn svg {
  color: var(--warn);
}
.toast-info svg {
  color: var(--primary);
}
.toast b {
  display: block;
  margin-bottom: 2px;
}

@keyframes slideIn {
  from {
    transform: translateX(16px);
    opacity: 0;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

/* ------------------------------- 杂项 ------------------------------- */

.spinner {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex: none;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}
.status-dot.ok {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}
.status-dot.off {
  background: var(--danger);
  box-shadow: 0 0 8px var(--danger);
}
.status-dot.warn {
  background: var(--warn);
  box-shadow: 0 0 8px var(--warn);
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: rgba(20, 25, 38, 0.7);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 17px;
  cursor: pointer;
  transition: all 0.15s;
}
.pill-btn:hover {
  color: var(--text);
  border-color: #3a4460;
}

/*
 * 顶栏用户名后面的「9折VIP」小标签（2026-10-19 专属折扣）。
 * 暖黄底与「已充值」同一套色，比绿色状态点更收得住，不抢视线。
 */
.pill-vip {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 13px;
  font-weight: 600;
  vertical-align: 1px;
  white-space: nowrap;
}

.hidden {
  display: none !important;
}

.mono {
  font-family: var(--mono);
}

/* ------------------------------- 响应式 ------------------------------- */

/*
 * 宽屏：左侧表单卡片排成两列。
 * 单列时输入框会被拉到 900px 以上，既难看也难填，所以有空间就分栏。
 * 注意必须放在 .panel-stack 基准规则之后 —— 媒体查询不增加优先级，靠顺序取胜。
 */
/*
 * 面板改两列的下限。
 *
 * 原来是 1680px，但在那个宽度下左栏只有 1198px，两张卡各占 592px ——
 * 提示词卡被压到一行 30 个全角字（1850 字的稿子要 68 行），
 * 而模型卡比它高出一大截，旁边还白留 592×366 的空地。
 * 实测下来要每个卡片有 ~800px 才划算，对应的视口就是 2100px。
 */
@media (min-width: 2100px) {
  .panel-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
  /* 输出参数 + 提交栏横跨整行，提交按钮保持在底部通栏位置 */
  .panel-stack > :nth-child(3) {
    grid-column: 1 / -1;
  }
}

/* 单列页面模式下（≤1420），表单占满整宽，同样需要分栏 */
@media (min-width: 1120px) and (max-width: 1420px) {
  .panel-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
  .panel-stack > :nth-child(3) {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1420px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .col-right {
    position: static;
  }
  .tasks-card {
    max-height: none;
  }
  /* 单列时卡片不再受视口高度约束，预览可以放大一些 */
  .preview-stage {
    max-height: 38vh;
  }
  .tasks-list {
    max-height: 580px;
  }
}

@media (max-width: 640px) {
  .header {
    padding: 10px 14px;
    gap: 10px;
  }
  .brand-text p {
    display: none;
  }
  .layout {
    padding: 14px 12px 30px;
    gap: 12px;
  }
  .field-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .card-body {
    padding: 14px;
  }
  .submit-bar {
    padding: 12px 14px;
  }
  .toast-wrap {
    left: 12px;
    right: 12px;
    max-width: none;
  }
}

/* ==================================================================== *
 * 短剧画布
 * ==================================================================== */

.drama-main {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 2800px;
  margin: 0 auto;
  padding: 18px 22px 40px;
}

.drama-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(26, 32, 50, 0.72), rgba(20, 25, 38, 0.86));
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.drama-bar-left,
.drama-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.drama-bar-left {
  min-width: 0;
}

.drama-bar-left h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 620;
}

.drama-bar-left .head-hint {
  font-size: 16.5px;
  color: var(--text-mute);
}

/* 头部模式切换放在标题旁，不再占满宽度 */
.header .kind-switch {
  flex: none;
}
.header .kind-switch button {
  flex: none;
  padding: 7px 13px;
  font-size: 17px;
}

.drama-project-select {
  width: auto;
  min-width: 190px;
  max-width: 320px;
  padding: 7px 10px;
  font-size: 17.5px;
}

.drama-cols {
  display: grid;
  grid-template-columns: clamp(290px, 20vw, 380px) minmax(0, 1fr) clamp(330px, 23vw, 440px);
  gap: 14px;
  align-items: start;
}

.drama-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.drama-section:empty {
  display: none;
}

/* 画布里的标题徽标要放得下中文字 */
.drama-main .card-head .step {
  width: auto;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  font-size: 15px;
}

.drama-main .card-body {
  gap: 13px;
}

/* ---------- 概况 ---------- */

.drama-synopsis {
  font-size: 17.5px;
  color: var(--text-dim);
  line-height: 1.65;
}

.drama-stat-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.drama-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 5px 11px;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 16px;
  color: var(--text-mute);
}
.drama-stat b {
  font-size: 19px;
  font-family: var(--mono);
  color: var(--text);
}
.drama-stat.ok b {
  color: var(--success);
}
.drama-stat.run b {
  color: var(--primary);
}
.drama-stat.bad b {
  color: var(--danger);
}

.drama-hint {
  font-size: 16.5px;
  color: var(--text-mute);
  line-height: 1.65;
}

.drama-warn-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  color: var(--warn);
}
.drama-warn-inline svg {
  width: 14px;
  height: 14px;
  flex: none;
}

/* ---------- 角色 ---------- */

.drama-char {
  padding: 11px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: rgba(15, 19, 28, 0.6);
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.drama-char-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.drama-char-head b {
  font-size: 18.5px;
  font-weight: 620;
}
.drama-char-head .grow {
  flex: 1;
}

.drama-char-desc {
  font-size: 16.5px;
  color: var(--text-dim);
  line-height: 1.6;
}

.drama-anchors {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.drama-anchors img {
  width: 56px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: zoom-in;
}
.drama-anchor-more {
  font-size: 15.5px;
  color: var(--text-mute);
}

/* 小号操作按钮：分镜卡片上按钮多，用统一的紧凑样式避免挤压标题 */
.drama-mini {
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 15.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.drama-mini:hover:not(:disabled) {
  color: var(--text);
  border-color: #414c69;
}
.drama-mini:disabled {
  opacity: 0.34;
  cursor: not-allowed;
}
.drama-mini.danger:hover:not(:disabled) {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-soft);
}

/* ---------- 分镜表 ---------- */

.drama-shots {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.drama-shot {
  display: flex;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: rgba(20, 25, 38, 0.7);
  transition: border-color 0.15s, background 0.15s;
}
.drama-shot:hover {
  border-color: #333d59;
}
.drama-shot.active {
  border-color: var(--primary);
  background: rgba(109, 124, 255, 0.08);
}

.drama-shot-no {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary);
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
}

.drama-shot-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.drama-shot-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.drama-shot-head .grow {
  flex: 1;
}

.drama-shot-title {
  font-size: 18.5px;
  font-weight: 620;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 340px;
}

.drama-shot-btns {
  display: flex;
  gap: 4px;
  flex: none;
}

.drama-shot-scene,
.drama-shot-dialogue {
  font-size: 16.5px;
  color: var(--text-dim);
  line-height: 1.6;
}
.drama-shot-dialogue {
  color: #c3caff;
}

.drama-shot-prompt {
  font-size: 17px;
  color: var(--text-dim);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.drama-shot-prompt.muted {
  color: var(--text-mute);
  font-style: italic;
}

.drama-shot-error {
  font-size: 16px;
  color: var(--danger);
  line-height: 1.6;
  padding: 7px 9px;
  background: var(--danger-soft);
  border-radius: var(--radius-sm);
}

.drama-shot-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15.5px;
  color: var(--text-mute);
}
.drama-shot-foot .grow {
  flex: 1;
}

.chip-role {
  background: var(--primary-soft);
  color: var(--primary);
  font-family: var(--font);
}

/* ---------- 预览 ---------- */

.drama-preview-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: 30vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(520px 260px at 50% 0%, rgba(109, 124, 255, 0.12), transparent 70%),
    #05070c;
  overflow: hidden;
}
.drama-preview-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

.drama-preview-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

/* ---------- 时间轴 ---------- */

.drama-timeline {
  display: flex;
  gap: 4px;
  min-height: 58px;
}

.drama-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft);
  color: var(--text-mute);
  font-family: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.12s, border-color 0.15s;
}
.drama-block:hover {
  transform: translateY(-2px);
}

.drama-block .db-no {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
}
.drama-block .db-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drama-block .db-time {
  font-family: var(--mono);
  font-size: 14px;
  opacity: 0.75;
}

.drama-block.st-idle,
.drama-block.st-queued {
  border-color: var(--border);
}
.drama-block.st-in_progress {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
}
.drama-block.st-completed {
  border-color: rgba(52, 211, 153, 0.5);
  background: var(--success-soft);
  color: var(--success);
}
.drama-block.st-failed {
  border-color: rgba(248, 113, 113, 0.5);
  background: var(--danger-soft);
  color: var(--danger);
}
.drama-block.active {
  box-shadow: 0 0 0 2px var(--primary);
}

.drama-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 15.5px;
  color: var(--text-mute);
}
.drama-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.lg {
  width: 9px;
  height: 9px;
  border-radius: 3px;
  display: inline-block;
}
.lg-idle {
  background: var(--surface-3);
}
.lg-run {
  background: var(--primary);
}
.lg-done {
  background: var(--success);
}
.lg-fail {
  background: var(--danger);
}

.drama-export-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ---------- 导出记录 ---------- */

.drama-export-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 11px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: rgba(15, 19, 28, 0.6);
}

.drama-export-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}
.drama-export-head .grow {
  flex: 1;
}
.drama-export-head b {
  font-size: 16.5px;
}

.drama-file {
  font-size: 14.5px;
  color: var(--text-mute);
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: rtl;
  text-align: right;
}

.drama-export-note {
  font-size: 16px;
  color: var(--text-mute);
}

.drama-export-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ---------- 预览提示词弹窗 ---------- */

.drama-pre {
  margin: 0;
  padding: 11px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 34vh;
  overflow: auto;
  color: var(--text-dim);
}

/* 参考素材列表：短剧画布与任务详情弹窗共用 */
.drama-reflist,
.ref-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 30vh;
  overflow: auto;
}
.drama-reflist li,
.ref-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  font-size: 16px;
}
/* 任务详情里每项是「标签 + 一行地址」，两行内容按顶部对齐更整齐 */
.ref-list li {
  align-items: flex-start;
}
.ref-list li > span:last-child {
  min-width: 0;
}
.ref-list b {
  font-weight: 600;
}
.ref-list .mono {
  font-size: 15px;
  word-break: break-all;
  white-space: normal;
  color: var(--text-mute);
}
.drama-reflist .idx,
.ref-list .idx {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  flex: none;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
}
.drama-reflist .idx.warn,
.ref-list .idx.warn {
  background: var(--warn-soft);
  color: var(--warn);
}
.drama-reflist .mono {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

/* ---------- 角色勾选 ---------- */

.drama-char-picks {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.drama-char-pick {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--bg-soft);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 17px;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s;
}
.drama-char-pick:hover {
  border-color: #414c69;
  color: var(--text);
}
.drama-char-pick.on {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

/* 勾选标记：未选中时不占位，选中才出现，状态一眼可辨 */
.drama-char-pick .cc-mark {
  display: none;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}
.drama-char-pick.on .cc-mark {
  display: inline;
}

.drama-char-pick em {
  font-style: normal;
  font-size: 14.5px;
  color: var(--warn);
}

/* ---------- 管理短剧 ---------- */

.drama-manage-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  max-height: 56vh;
  overflow-y: auto;
  padding-right: 4px;
}

.drama-manage-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: rgba(15, 19, 28, 0.6);
}
.drama-manage-item.current {
  border-color: var(--primary);
  background: rgba(109, 124, 255, 0.08);
}

.dmg-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.dmg-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.dmg-title b {
  font-size: 18.5px;
  font-weight: 620;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dmg-chips {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.dmg-meta {
  font-size: 16px;
  color: var(--text-mute);
}

.dmg-actions {
  display: flex;
  gap: 5px;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* 孤立成片：所属短剧已删除，但仍占磁盘，需要留一个清理入口 */
.drama-orphans {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.drama-orphans-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--warn);
  font-size: 17px;
}
.drama-orphans-head svg {
  width: 16px;
  height: 16px;
  flex: none;
}
.drama-orphans-head .grow {
  flex: 1;
}

.drama-orphans .drama-manage-list {
  max-height: 32vh;
}

/* 「删除短剧」弹窗里的成片统计要显眼，用户是靠它决定勾不勾选的 */
.drama-manage-item .dmg-meta.mono {
  font-family: var(--mono);
  font-size: 15px;
}

/* ---------- 响应式 ---------- */

@media (max-width: 1420px) {
  .drama-cols {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  /* 概况与角色挪到右侧栏下方，分镜表占满左侧 */
  .drama-col:first-child {
    order: 2;
  }
  .drama-col-wide {
    order: 1;
    grid-column: 1 / 2;
  }
  .drama-col:last-child {
    order: 3;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }
}

/*
 * 窗口较矮的双栏布局：预览区收窄一些。
 *
 * 预览区固定为「不压缩」（见 .preview），高度不足的部分全由任务列表承担，
 * 矮窗口下列表会被挤到几乎点不动。这里把预览的胃口收一收，让两边都能用。
 */
@media (min-width: 1421px) and (max-height: 820px) {
  .preview-stage.is-image {
    max-height: 26vh;
  }
}

@media (max-width: 980px) {
  .drama-cols {
    grid-template-columns: minmax(0, 1fr);
  }
  .drama-col-wide,
  .drama-col:last-child {
    grid-column: 1;
  }
  .drama-col:last-child {
    display: flex;
  }
  .drama-main {
    padding: 14px 12px 30px;
  }
  .drama-shot-btns {
    flex-wrap: wrap;
  }
}

/* ======================= 提示词里的 @ 引用 ======================= */

/* 弹窗形态：屏幕居中 + 遮罩，选资产看得清、点得准 */
.mention-mask {
  position: fixed;
  inset: 0;
  z-index: 59;
  background: rgba(6, 9, 16, 0.62);
  backdrop-filter: blur(2px);
}
.mention-mask.hidden {
  display: none;
}

.mention-pop {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  /*
   * 弹窗尽量大、只看得到更多素材：卡片尺寸不变（见 .mention-list 的 minmax(152px)），
   * 靠"窗口更大 + 顶部页签只看一类"来提升一屏的可见数量。
   */
  width: min(1500px, 96vw);
  max-height: 92vh;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 70px -30px #000;
  overflow: hidden;
  animation: pop 0.16s ease;
}
.mention-pop.hidden {
  display: none;
}

.mention-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 13px 16px 11px;
  border-bottom: 1px solid var(--border-soft);
}
.mention-head b {
  font-size: 18px;
  font-weight: 620;
}
.mention-head span {
  font-size: 14.5px;
  color: var(--text-mute);
}

/* 剧集下拉：@ 选择器默认只列当前剧集的素材，换一集就地挑别的剧集的 */
.mention-series {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px 0;
}
.mention-series label {
  font-size: 15.5px;
  color: var(--text-dim);
  white-space: nowrap;
}
.mention-series .select {
  width: auto;
  min-width: 170px;
  max-width: 280px;
  font-size: 16.5px;
  padding: 6px 10px;
}
.mention-series span {
  font-size: 14px;
  color: var(--text-mute);
}

/* 顶部类型页签：图片 / 视频 / 音频 一键切，避免在一屏里混选 */
.mention-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 16px 2px;
}
.mention-tab {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 14px;
  font-size: 15px;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.mention-tab:hover {
  background: var(--surface-3);
  color: var(--text);
}
.mention-tab.active {
  color: var(--text);
  background: var(--primary-soft);
  border-color: var(--primary);
}
.mention-tab span {
  font-size: 13px;
  color: var(--text-mute);
}

/* 多列网格：一屏能扫到二十几个素材，缩略图够大，能一眼认准 */
.mention-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
  gap: 8px;
  flex: 1 1 auto;
  max-height: min(62vh, 620px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
  scrollbar-width: thin;
}
.mention-list::-webkit-scrollbar {
  width: 9px;
}
.mention-list::-webkit-scrollbar-thumb {
  background: #39415c;
  border-radius: 99px;
}
.mention-list::-webkit-scrollbar-track {
  background: transparent;
}
.mention-list > .mention-empty {
  grid-column: 1 / -1;
}

/*
 * 类型分组的小标题：整行铺开、滚动时吸顶。
 * 图片和音频混在一屏里最容易点错，分组标题让人一眼知道正在选哪一类。
 */
.mention-list > .mention-group {
  grid-column: 1 / -1;
  position: sticky;
  top: -12px; /* 抵消 .mention-list 的 12px 内边距，吸顶时贴住列表上沿 */
  z-index: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 2px 5px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-soft);
  font-size: 15px;
  font-weight: 620;
  color: var(--text-dim);
}
.mention-list > .mention-group span {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-mute);
}

.mention-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  width: 100%;
  padding: 7px 7px 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 16.5px;
  text-align: left;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.mention-item:hover {
  background: var(--surface-2);
}
.mention-item.active {
  background: var(--primary-soft);
  border-color: var(--primary);
}

.mi-thumb {
  flex: none;
  width: 100%;
  height: 96px;
  border-radius: 7px;
  object-fit: cover;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
}
/* 音频 / 视频没有可直接显示的缩略图，用一个类型图标占位 */
.mi-thumb-icon {
  display: grid;
  place-items: center;
  width: 100%;
  height: 96px;
  border-radius: 7px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  color: var(--text-mute);
}
.mi-thumb-icon svg {
  width: 28px;
  height: 28px;
}

.mi-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.mi-body b {
  font-weight: 600;
  font-size: 15.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mi-body span {
  font-size: 13.5px;
  color: var(--text-mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mention-empty {
  padding: 14px 12px;
  color: var(--text-mute);
  font-size: 16px;
  text-align: center;
}

.mention-foot {
  display: flex;
  gap: 12px;
  padding: 6px 10px;
  border-top: 1px solid var(--border-soft);
  color: var(--text-mute);
  font-size: 14.5px;
}

/* ------------------------------- 模型广场 ------------------------------- */

.plaza-layout {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.plaza-side {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 92px;
}

.plaza-nav {
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 17.5px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}
.plaza-nav:hover {
  color: var(--text);
  border-color: #3a4460;
}
.plaza-nav.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 26px -16px rgba(109, 124, 255, 1);
}

.plaza-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.plaza-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 16px 18px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(26, 32, 50, 0.72), rgba(20, 25, 38, 0.86));
}

.plaza-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.plaza-card-head h3 {
  margin: 0;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: 0.2px;
}
.plaza-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
}
.plaza-icon svg {
  width: 17px;
  height: 17px;
}
.plaza-badge {
  margin-left: auto;
  flex: none;
  padding: 3px 9px;
  border-radius: 7px;
  border: 1px solid rgba(52, 211, 153, 0.28);
  background: var(--success-soft);
  color: var(--success);
  font-size: 15px;
  font-weight: 600;
}
/* 折扣标签紧跟在模型标签后，共用"推到右侧"的布局 */
.plaza-badge + .plaza-badge {
  margin-left: 0;
}
.plaza-badge-sale {
  border-color: rgba(251, 191, 36, 0.4);
  background: var(--warn-soft);
  color: var(--warn);
}
.plaza-desc {
  margin: 0;
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--text-mute);
}

.plaza-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.plaza-tag {
  padding: 3px 9px;
  border-radius: 7px;
  border: 1px solid rgba(109, 124, 255, 0.22);
  background: var(--primary-soft);
  color: #c3caff;
  font-size: 15px;
}

.plaza-hr {
  height: 1px;
  margin: 2px 0;
  background: var(--border-soft);
}
.plaza-unit {
  font-size: 16px;
  color: var(--text-mute);
}

.plaza-box {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-soft);
}
.plaza-box-head {
  margin-bottom: 6px;
  font-size: 16px;
  color: var(--text-dim);
}
.plaza-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
  font-size: 16.5px;
  color: var(--text-mute);
}
/* 价格区：右侧可能是「基础价（划掉）+ 最终价」两个数 */
.plaza-price {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}
.plaza-line b {
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 650;
  color: var(--text);
}
.plaza-price s {
  color: var(--text-mute);
  font-family: var(--mono);
  font-size: 15.5px;
  text-decoration: line-through;
  opacity: 0.85;
}
/* 2026-10-17 取消会员制：原 .plaza-line-vip / .plaza-vip-tag 两条样式已删除 */
.plaza-empty {
  font-size: 16px;
  color: var(--text-mute);
}
.plaza-foot {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--text-mute);
}

@media (max-width: 1420px) {
  .plaza-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .plaza-side {
    position: static;
    flex-direction: row;
  }
  .plaza-nav {
    flex: 1;
    text-align: center;
  }
}

@media (max-width: 900px) {
  .plaza-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* -------------------------------- 首页 -------------------------------- */

.home {
  display: flex;
  flex-direction: column;
  gap: 26px;
  width: min(1560px, 100%);
  margin: 0 auto;
  padding: 22px 22px 60px;
}
.home.hidden {
  display: none;
}

/* 大幅海报轮播 */
.home-hero {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.home-slides {
  position: relative;
  min-height: clamp(320px, 33vw, 460px);
}

.home-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: clamp(26px, 5vw, 74px);
  opacity: 0;
  transition: opacity 0.65s ease;
  background:
    radial-gradient(920px 460px at 12% 6%, rgba(109, 124, 255, 0.42), transparent 62%),
    radial-gradient(760px 420px at 92% 96%, rgba(155, 107, 255, 0.3), transparent 62%),
    linear-gradient(118deg, var(--s1, #141a33), var(--s2, #3b2a6b));
}
.home-slide.is-active {
  opacity: 1;
}

/* 换成真海报：加 has-img 类并给 --img 一个图片地址，只压一层暗罩保证文字可读 */
.home-slide.has-img {
  background-image: linear-gradient(90deg, rgba(6, 9, 16, 0.78), rgba(6, 9, 16, 0.35)), var(--img);
  background-size: cover;
  background-position: center;
}

.home-slide-in {
  position: relative;
  z-index: 1;
  max-width: 76%;
}

.home-kicker {
  display: inline-block;
  margin-bottom: 16px;
  padding: 5px 14px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 99px;
  background: rgba(10, 13, 20, 0.4);
  color: #dfe4ff;
  font-size: 17px;
  letter-spacing: 0.4px;
}

.home-slide h2 {
  margin: 0 0 14px;
  font-size: clamp(42px, 6vw, 92px);
  font-weight: 800;
  line-height: 1.06;
  letter-spacing: -1.5px;
  background: linear-gradient(180deg, #fff, #c9d1ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.home-slide p {
  margin: 0;
  max-width: 46ch;
  color: rgba(232, 236, 246, 0.8);
  font-size: clamp(17px, 1.6vw, 22px);
}

.home-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-top: -23px;
  padding: 0 0 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(10, 13, 20, 0.5);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s;
}
.home-arrow:hover {
  background: rgba(109, 124, 255, 0.85);
  border-color: transparent;
}
.home-prev {
  left: 16px;
}
.home-next {
  right: 16px;
}

.home-dots {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 2;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
}
.home-dots button {
  width: 9px;
  height: 9px;
  padding: 0;
  border: none;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.34);
  cursor: pointer;
  transition: all 0.2s;
}
.home-dots button.is-active {
  width: 28px;
  background: #fff;
}

/* 站名与一句话定位 */
.home-lead {
  text-align: center;
  padding: 4px 10px 2px;
}
.home-lead h2 {
  margin: 0 0 10px;
  font-size: clamp(30px, 3.4vw, 46px);
  font-weight: 800;
  letter-spacing: -0.6px;
}
.home-lead p {
  margin: 0 auto;
  max-width: 60ch;
  color: var(--text-dim);
  font-size: clamp(18px, 1.7vw, 24px);
}

.home-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
}
.home-start {
  padding: 15px 44px;
  border: none;
  font-size: 22px;
  font-weight: 650;
  border-radius: 14px;
  box-shadow: 0 16px 40px -18px rgba(109, 124, 255, 1);
  transition: transform 0.15s, box-shadow 0.15s;
}
.home-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 46px -18px rgba(109, 124, 255, 1);
}
.home-charge {
  color: var(--text-mute);
  font-size: 17px;
}

/* 三张小卡：点进去就是对应的工作台 */
.home-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.home-card {
  position: relative;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(26, 32, 50, 0.72), rgba(20, 25, 38, 0.86));
  cursor: pointer;
  transition: all 0.15s;
}
.home-card:hover {
  border-color: rgba(109, 124, 255, 0.5);
  transform: translateY(-2px);
}
.home-card h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 650;
}
.home-card p {
  margin: 0;
  color: var(--text-mute);
  font-size: 16.5px;
  line-height: 1.55;
}
.home-card-go {
  display: inline-block;
  margin-top: 12px;
  color: #c3caff;
  font-size: 16px;
}

/* 管理入口：海报右上角，仅管理员可见（JS 控制） */
.home-admin-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
}

/* 「管理首页」弹窗里的轮播行 */
.home-slide-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--bg-soft);
  margin-bottom: 8px;
}
.home-slide-thumb {
  display: grid;
  place-items: center;
  width: 96px;
  height: 60px;
  border-radius: 8px;
  border: 1px dashed var(--border);
  background: var(--surface-3) center / cover no-repeat;
  color: var(--text-mute);
  font-size: 14px;
}
.home-slide-fields {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.home-slide-ops {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

@media (max-width: 1100px) {
  .home-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .home {
    padding: 14px 14px 40px;
  }
  .home-slide-in {
    max-width: 100%;
  }
  .home-slide h2 {
    letter-spacing: -0.5px;
  }
  .home-arrow {
    display: none;
  }
  .home-cards {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ======================================================================
 * 渠道视频：参考图上载区（渠道最多 9 张，缩略图按顺序编号）
 * ====================================================================== */

.ch-ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.ch-ref-grid:empty {
  display: none;
}

.ch-ref-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  overflow: hidden;
}

.ch-ref-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ch-ref-item.uploading img {
  opacity: 0.5;
}

.ch-ref-no {
  position: absolute;
  left: 6px;
  bottom: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font: 600 12px/1.5 var(--mono);
}

.ch-ref-del {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 15px;
  line-height: 22px;
  cursor: pointer;
}

.ch-ref-del:hover {
  background: var(--danger);
}

.field.dragging {
  outline: 2px dashed var(--primary);
  outline-offset: -6px;
}

/* 弹窗里的「选择本地文件」区域：也接受拖拽，拖拽悬停时高亮 */
.material-drop.dragging {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

/* 批量上传进度条（贴在素材列表底部，render() 重写后会自动重新挂上） */
.material-upload-status {
  margin-top: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 16.5px;
  color: var(--text-dim);
}
.material-upload-status .upload-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.material-upload-status .upload-progress {
  margin-top: 6px;
}

/* 渠道规格是只读的：别让它看起来像能改 */
input.input[readonly] {
  color: var(--text-dim);
  cursor: default;
}

/* ============================== 灵感库（作品墙） ============================== */

/*
 * 灵感墙用**多列瀑布流**（column-width 自适应列数）而不是等宽网格。
 *
 * 为什么不用 grid：横屏 16:9 与竖屏 9:16 混在一起时，等高网格要么把竖屏裁成横条、
 * 要么留出大片空白。多列瀑布流按卡片真实高度往下堆，竖横混排也紧凑无空洞 ——
 * 这正是作者想要的「动态调整」。窗口变窄时列数自动减少。
 */
.inspire-grid {
  column-width: 268px;
  column-gap: 14px;
}

.inspire-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.02);
  /* 瀑布流三件套：不允许被拆到两列、逐块往下堆、块间留白由 margin 给 */
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  margin: 0 0 14px;
}
/* 被管理员关闭展示的：留个浅淡的样子，方便在「含已关闭」视图里辨认 */
.inspire-card.is-hidden {
  opacity: 0.55;
}

.inspire-media {
  position: relative;
  background: #05070d;
  cursor: pointer;
}
/* 视频：先按 16:9 占位，元数据到齐后由 JS 换成素材真实比例 */
.inspire-media.is-video {
  aspect-ratio: 16 / 9;
}
.inspire-media.is-video video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* 图片：容器不锁比例，图自己撑多高就多高；长图给个上限，免得拉成一条 */
.inspire-media.is-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 72vh;
  object-fit: cover;
}

.inspire-count {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 13.5px;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
}

/* 卡片矮一点，一屏能多放几张：间距压到 4px，字号各降一级 */
.inspire-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px 10px;
}

.inspire-title {
  font-size: 15.5px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.inspire-sub {
  font-size: 13.5px;
  color: var(--text-mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inspire-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
/* 卡片里的按钮再收一号，免得底部那排比标题还抢眼 */
.inspire-actions .btn {
  padding: 2px 8px;
  font-size: 14px;
}

.inspire-like {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-mute);
  font-size: 14.5px;
  cursor: pointer;
}
.inspire-like:hover {
  border-color: var(--danger);
  color: var(--danger);
}
.inspire-like.active {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-soft);
}

/* 视频卡片右上角的全屏入口：小、半透明，不抢画面 */
.inspire-full {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 1px 8px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 13.5px;
  line-height: 1.7;
  cursor: pointer;
  opacity: 0.72;
}
.inspire-full:hover {
  opacity: 1;
}

/* 图片作品的大图查看：多图可翻，可切浏览器全屏 */
.inspire-viewer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.inspire-viewer img {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: 10px;
  background: #05070d;
}
.inspire-viewer-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.inspire-tag {
  padding: 1px 8px;
  border-radius: 6px;
  font-size: 13.5px;
  border: 1px solid var(--primary);
  color: var(--primary);
}
.inspire-tag.is-off {
  border-color: var(--text-mute);
  color: var(--text-mute);
}

/* ==================================================================== *
 * 每日上线领算力（2026-10-17）：到账弹窗
 * 礼物盒轻微浮动 + 金额弹出 + 三颗星点闪烁，克制的小动效，不做满屏彩带。
 * ==================================================================== */
.daily-bonus {
  position: relative;
  text-align: center;
  padding: 8px 6px 4px;
  overflow: hidden;
}

/* 顶部一圈主色光晕，用 radial-gradient 画，别上图片资源 */
.db-halo {
  position: absolute;
  top: -120px;
  left: 50%;
  width: 320px;
  height: 260px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(109, 124, 255, 0.28), transparent 72%);
  pointer-events: none;
  animation: db-halo-pulse 4s ease-in-out infinite;
}

.db-gift {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: var(--primary);
  background: linear-gradient(160deg, rgba(109, 124, 255, 0.22), rgba(155, 107, 255, 0.1));
  border: 1px solid rgba(109, 124, 255, 0.4);
  box-shadow: 0 10px 26px -14px rgba(109, 124, 255, 0.95);
  animation: db-gift-float 3.2s ease-in-out infinite;
}
.db-gift svg {
  width: 34px;
  height: 34px;
}

.db-amount {
  position: relative;
  font-size: 42px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -1px;
  color: var(--text);
  animation: db-amount-pop 0.55s cubic-bezier(0.22, 0.9, 0.3, 1.4) both;
}
.db-sign {
  font-size: 26px;
  margin-right: 3px;
  color: var(--primary);
}
.db-unit {
  margin-left: 7px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-dim);
  letter-spacing: 0;
}

.db-title {
  margin-top: 10px;
  font-size: 17.5px;
  font-weight: 650;
  color: var(--text);
}
.db-sub {
  margin-top: 6px;
  font-size: 15px;
  color: var(--text-mute);
}
.db-balance {
  margin-top: 14px;
  font-size: 15px;
  color: var(--text-mute);
}
.db-balance b {
  color: var(--primary);
  font-weight: 650;
}

/* 三颗小星点：位置写死，节奏错开，看起来才不像机械闪烁 */
.db-spark {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0;
  pointer-events: none;
  animation: db-spark-twinkle 2.6s ease-in-out infinite;
}
.db-spark-1 {
  top: 26px;
  left: 26%;
}
.db-spark-2 {
  top: 12px;
  right: 24%;
  width: 4px;
  height: 4px;
  animation-delay: 0.7s;
}
.db-spark-3 {
  top: 68px;
  right: 16%;
  width: 3px;
  height: 3px;
  animation-delay: 1.4s;
}

@keyframes db-gift-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}
@keyframes db-amount-pop {
  0% {
    transform: scale(0.72);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes db-spark-twinkle {
  0%,
  100% {
    opacity: 0;
    transform: scale(0.6);
  }
  45% {
    opacity: 0.95;
    transform: scale(1.15);
  }
}
@keyframes db-halo-pulse {
  0%,
  100% {
    opacity: 0.75;
  }
  50% {
    opacity: 1;
  }
}

/* 动效敏感的用户（系统设置里开了「减少动态效果」）就静止显示 */
@media (prefers-reduced-motion: reduce) {
  .db-halo,
  .db-gift,
  .db-amount,
  .db-spark {
    animation: none;
  }
  .db-spark {
    opacity: 0.55;
  }
}
