/* 外包平台：全部页面共用一份样式。颜色取自维塔传媒品牌（深蓝字、青到蓝的渐变按钮）。
   页面的内容安全策略不许内联样式，样式都写在这里，脚本只切换 class 与 hidden。 */
:root {
  --ink: #17153c;
  --ink-2: #4a4867;
  --muted: #5a5873;
  --bg: #f4f6f9;
  --card: #ffffff;
  --line: #e3e8f0;
  --line-soft: #eef1f5;
  --line-input: #d5dce6;
  --line-button: #c9d3e1;
  --fill-soft: #eef1f5;
  --fill-head: #f8fafc;
  --accent: #2a67ad;
  --accent-fill: #e6eef8;
  --accent-fill-soft: #f6f9ff;
  --link: #1f5fa8;
  --danger: #b42318;
  --danger-input: #d92d20;
  --danger-line: #f3c7c1;
  --danger-fill: #fff6f5;
  --brand-gradient: linear-gradient(90deg, #11706f, #2a67ad);
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: var(--link); }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.app { min-height: 100vh; display: flex; flex-direction: column; }

/* ── 顶栏 ── */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1376px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 32px); display: flex; flex-wrap: wrap; align-items: stretch; gap: 0 28px; }
.brand { display: flex; align-items: center; gap: 14px; min-height: 64px; }
.brand-logo { height: 30px; width: auto; display: block; }
.brand-sep { width: 1px; height: 22px; background: var(--line-input); }
.brand-name { font-size: 16px; font-weight: 600; letter-spacing: 0.04em; white-space: nowrap; }
.mainnav { display: flex; flex-wrap: wrap; gap: 4px; }
.mainnav a { display: flex; align-items: center; min-height: 64px; padding: 0 14px; border-bottom: 2px solid transparent; color: var(--ink-2); font-size: 15px; font-weight: 500; text-decoration: none; }
.mainnav a:hover { color: var(--ink); }
.mainnav a[aria-current="page"] { border-bottom-color: var(--accent); color: var(--ink); font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; min-height: 64px; font-size: 14px; }
.quota { display: flex; align-items: baseline; gap: 6px; color: var(--muted); }
.quota strong { font-size: 17px; font-weight: 600; color: var(--ink); }
.quota.is-out strong { color: var(--danger); }
.topbar-sep { width: 1px; height: 18px; background: #dfe6ef; }
.me { display: flex; align-items: center; gap: 8px; }
.avatar { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 50%; background: var(--accent-fill); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.avatar.is-large { width: 32px; height: 32px; font-size: 14px; }
.btn-logout { height: 36px; padding: 0 14px; border: 1px solid var(--line-input); border-radius: 8px; background: var(--card); color: var(--ink-2); font-size: 14px; cursor: pointer; }
.btn-logout:hover { border-color: var(--line-button); color: var(--ink); }

/* ── 页面主体与卡片 ── */
.page { flex: 1 1 auto; width: 100%; max-width: 1376px; margin: 0 auto; padding: clamp(16px, 3vw, 32px); display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.page.is-stretch { align-items: stretch; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.card-title-row { padding: 20px 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 10px; border-bottom: 1px solid var(--line-soft); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-head .count { margin-right: auto; }
.section-title { margin: 0; font-size: 16px; font-weight: 600; }
.count { font-size: 13px; color: var(--muted); }
.msg-error { margin: 0; font-size: 14px; color: var(--danger); }

/* ── 表单控件 ── */
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field > label { font-size: 14px; font-weight: 600; }
.input, .select, .textarea { width: 100%; border: 1px solid var(--line-input); border-radius: 10px; background: var(--card); color: var(--ink); font-size: 15px; }
.input { height: 46px; padding: 0 14px; }
.textarea { padding: 12px 14px; line-height: 1.7; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(42, 103, 173, 0.15); }
.input.is-invalid, .textarea.is-invalid { border-color: var(--danger-input); }
.input.is-invalid:focus, .textarea.is-invalid:focus { box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.15); }
.select-wrap { position: relative; }
.select { height: 46px; padding: 0 40px 0 14px; appearance: none; -webkit-appearance: none; font-weight: 500; cursor: pointer; }
.select:disabled, .input:disabled { background: var(--fill-head); color: var(--muted); cursor: default; }
.select-chevron { position: absolute; right: 14px; top: 14px; pointer-events: none; }
.counter { align-self: flex-end; font-size: 12px; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 30px; padding: 0 10px; display: flex; align-items: center; gap: 6px; border: 1px solid var(--line-input); border-radius: 999px; background: var(--card); color: var(--ink); font-size: 13px; font-weight: 500; cursor: pointer; }
.chip .tag-default, .chip .tag-off { font-size: 10px; padding: 3px 5px; }
.chip:hover { border-color: var(--line-button); }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-fill); }
.tag-default { font-size: 11px; font-weight: 600; line-height: 1; padding: 4px 7px; border-radius: 999px; background: var(--fill-soft); color: var(--ink-2); }
.chip[aria-pressed="true"] .tag-default, .tag-default.is-solid { background: var(--accent); color: #ffffff; }

.segmented { display: flex; gap: 4px; padding: 4px; background: var(--fill-soft); border-radius: 12px; }
.segmented button { flex: 1 1 0; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font-size: 14px; font-weight: 500; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(23, 21, 60, 0.12), 0 0 0 1px rgba(23, 21, 60, 0.06); }

/* ── 按钮 ── */
.btn-primary { height: 46px; padding: 0 20px; border: 0; border-radius: 10px; background: var(--brand-gradient); color: #ffffff; font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn-primary.is-medium { height: 44px; }
.btn-primary.is-large { height: 48px; border-radius: 12px; font-size: 16px; }
.btn-primary:disabled { background: var(--line); color: var(--ink-2); cursor: default; }
.btn-secondary { height: 44px; padding: 0 18px; border: 1px solid var(--line-input); border-radius: 10px; background: var(--card); color: var(--ink-2); font-size: 15px; cursor: pointer; }
.btn-outline { height: 44px; padding: 0 14px; border: 1px solid var(--line-button); border-radius: 10px; background: var(--card); color: var(--ink); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn-outline-sm { height: 36px; padding: 0 12px; display: flex; align-items: center; gap: 6px; border: 1px solid var(--line-button); border-radius: 8px; background: var(--card); color: var(--ink); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn-danger-outline { height: 46px; padding: 0 16px; border: 1px solid var(--danger-line); border-radius: 10px; background: var(--card); color: var(--danger); font-size: 15px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn-text { height: 44px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font-size: 14px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.btn-text:hover { background: var(--fill-soft); }
.btn-text.is-link { color: var(--link); }
.btn-text.is-danger { color: var(--danger); }
.btn-text.is-danger:hover { background: var(--danger-fill); }
.btn-text:disabled, .btn-text:disabled:hover { background: transparent; color: var(--line-button); }
.btn-outline:hover, .btn-outline-sm:hover, .btn-secondary:hover { border-color: var(--accent); }
.btn-outline:disabled, .btn-outline:disabled:hover, .btn-outline-sm:disabled, .btn-outline-sm:disabled:hover { border-color: var(--line); color: var(--line-button); }
button:disabled { cursor: default; }

/* ── 登录页 ── */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.login-card { width: 100%; max-width: 400px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 40px 36px 36px; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 16px 40px rgba(23, 21, 60, 0.06); display: flex; flex-direction: column; gap: 28px; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.login-logo { height: 40px; width: auto; display: block; }
.login-brand h1 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: 0.06em; }
.login-form { display: flex; flex-direction: column; gap: 18px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 52px; }
.eye-btn { position: absolute; right: 1px; top: 1px; width: 44px; height: 44px; border: 0; border-radius: 0 9px 9px 0; background: transparent; color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.field-error { font-size: 13px; color: var(--danger); }
.btn-login { margin-top: 6px; height: 50px; border: 0; border-radius: 12px; background: var(--brand-gradient); color: #ffffff; font-size: 16px; font-weight: 600; letter-spacing: 0.12em; cursor: pointer; box-shadow: 0 8px 20px rgba(42, 103, 173, 0.22); }
.btn-login:disabled { opacity: 0.7; cursor: default; }

/* ── 生图页 ── */
/* 左边的表单排得紧：1080p 的屏幕上不滚动页面就看得到全部预设与生图按钮。
   频道、按钮的预设种类、剧名、比例各占一行（.form-row），名称在左、控件在右；
   下拉框的预设种类并排在一行（.select-row）；输入框比别的页矮 */
.gen-form { flex: 1 1 520px; max-width: 520px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.form-row { display: grid; grid-template-columns: 60px minmax(0, 1fr); column-gap: 8px; align-items: center; }
.form-row > :first-child { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
/* 预设种类的一行：预设多了会折成几行，种类名称与第一行对齐 */
.form-row.is-chips { align-items: start; }
.form-row.is-chips > :first-child { padding-top: 5px; line-height: 20px; }
.gen-form .input, .gen-form .select { height: 38px; font-size: 14px; }
.gen-form .select-chevron { top: 10px; }
/* 各个预设种类：各行直接按表单的间距排，一个种类都没有时不占位置 */
.preset-rows { display: contents; }
/* 下拉框的种类：挨着的几个并排，占满表单的宽度，名称在下拉框上面。
   一行排四个时格子窄，长的名称显示不全；屏幕够高（比 1080p 高）就两个一行，能显示全 */
.select-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
@media (min-height: 1000px) { .select-row { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }
.select-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.select-cell > label { font-size: 12px; font-weight: 600; line-height: 16px; overflow-wrap: anywhere; }
.gen-form .select-cell .select { height: 30px; padding: 0 22px 0 8px; font-size: 13px; text-overflow: ellipsis; }
.gen-form .select-cell .select-chevron { right: 4px; top: 6px; }
/* 自己填的输入框：按钮的种类里排在按钮后面，与按钮一样高；下拉框的种类里在下拉框下面 */
.gen-form .custom-input { flex: 1 1 140px; width: auto; min-width: 140px; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px; }
.gen-form .select-cell .custom-input { flex: none; width: 100%; min-width: 0; padding: 0 10px; border-radius: 10px; }
/* 剧名栏：一行一个剧名。只有一行时与输入框一样高，填了几行占几行；名称与第一行对齐 */
.form-row.is-top { align-items: start; }
.form-row.is-top > :first-child { padding-top: 9px; line-height: 20px; }
.title-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.gen-form .title-box { display: block; height: auto; padding: 8px 14px; line-height: 20px; resize: none; overflow-x: hidden; }
/* 填了好几个剧名时的个数与上限：在「剧名」两个字下面，不另占一行 */
.title-name .counter { font-weight: 400; }
.counter.is-over { color: var(--danger); }
.gen-prompt { flex: 1 1 auto; gap: 6px; }
.gen-prompt .textarea { flex: 1 1 auto; min-height: 60px; padding: 8px 12px; font-size: 13px; line-height: 1.6; }
.field-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.field-head > label { font-size: 14px; font-weight: 600; }
.field-tools, .plot-box .btn-text { margin-right: -10px; }
/* 一行放不下时整组换到标题下面：左边也让出按钮的内边距，按钮上的字与标题左对齐 */
.field-tools { display: flex; flex-wrap: wrap; gap: 2px; margin-left: -10px; }
.field-head .btn-text { height: 32px; margin: -6px 0; }
.plot-box { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 10px; background: var(--fill-head); }
.plot-text { margin: 0; font-size: 14px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }
.plot-text.is-muted { color: var(--muted); }
.plot-text.is-danger { color: var(--danger); }
.save-preset { display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--accent); border-radius: 12px; background: #fbfcfe; }
.btn-gen { height: 46px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; border-radius: 12px; background: var(--brand-gradient); color: #ffffff; box-shadow: 0 8px 20px rgba(42, 103, 173, 0.25); font-size: 16px; font-weight: 600; letter-spacing: 0.08em; cursor: pointer; }
.btn-gen:disabled { background: var(--line); color: var(--ink-2); box-shadow: none; cursor: default; }
/* 生图按钮与视频标题按钮并排在一行：生图占满剩下的宽度 */
.gen-actions { display: flex; gap: 10px; }
.gen-actions .btn-gen { flex: 1 1 auto; }
.gen-actions .btn-outline { height: 46px; padding: 0 16px; border-radius: 12px; font-size: 15px; }
.gen-result { flex: 999 1 560px; min-width: 0; padding: 28px; display: flex; flex-direction: column; gap: 20px; }
.result-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-height: 44px; }
.result-title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.result-name { font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.result-meta { font-size: 13px; color: var(--muted); }
.btn-download { margin-left: auto; height: 44px; padding: 0 16px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-button); border-radius: 10px; background: var(--card); color: var(--ink); font-size: 15px; font-weight: 500; cursor: pointer; }
.btn-download:hover { border-color: var(--accent); }
.stage { flex: 1 1 auto; min-height: 560px; padding: 24px; background: var(--bg); border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.frame { position: relative; max-width: 100%; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; text-align: center; }
.frame.ratio-16x9 { width: 860px; aspect-ratio: 16 / 9; }
.frame.ratio-9x16 { width: 350px; aspect-ratio: 9 / 16; }
.frame.ratio-1x1 { width: 560px; aspect-ratio: 1 / 1; }
.frame.is-empty { background: var(--fill-head); border: 1.5px dashed var(--line-button); }
.frame.is-loading { background: var(--fill-soft); border: 1px solid var(--line); }
.frame.is-error { background: var(--danger-fill); border: 1px solid var(--danger-line); }
.frame.is-done { padding: 0; background: #e9edf3; box-shadow: 0 12px 32px rgba(23, 21, 60, 0.12); }
.frame-image { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.frame-state { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.frame-timer { font-size: 15px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.error-title { font-size: 16px; font-weight: 600; color: var(--danger); }
.error-reason { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
/* 一次生成好几张：一格一格的小图，在结果区里滚动，卡片不跟着变高 */
.stage.is-batch { height: 0; align-items: flex-start; overflow-y: auto; }
.batch-grid { width: 100%; display: grid; gap: 16px; }
.batch-grid.ratio-16x9 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.batch-grid.ratio-9x16 { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.batch-grid.ratio-1x1 { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.batch-card { border: 1px solid var(--line); border-radius: 12px; background: var(--card); overflow: hidden; display: flex; flex-direction: column; }
.batch-thumb { position: relative; padding: 12px; background: var(--fill-soft); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; }
.ratio-16x9 > .batch-card > .batch-thumb { aspect-ratio: 16 / 9; }
.ratio-9x16 > .batch-card > .batch-thumb { aspect-ratio: 9 / 16; }
.ratio-1x1 > .batch-card > .batch-thumb { aspect-ratio: 1 / 1; }
.batch-thumb.is-done { background: #e9edf3; }
.batch-thumb.is-failed { background: var(--danger-fill); }
.batch-body { min-height: 44px; padding: 6px 4px 6px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.batch-title { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.batch-body .btn-text { height: 32px; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 3s; } }
/* 视频标题的弹出框（生图页、试生成页）：上面填剧名、选语种，下面一条一条列出来，每条后面是复制与印到封面 */
.modal { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--ink); box-shadow: 0 24px 64px rgba(23, 21, 60, 0.24); overflow-y: auto; }
.modal[open] { display: flex; flex-direction: column; gap: 12px; }
.modal::backdrop { background: rgba(23, 21, 60, 0.36); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head .btn-text { width: 36px; height: 36px; margin-right: -8px; padding: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.modal .input, .modal .select { height: 38px; font-size: 14px; }
.modal .select-chevron { top: 10px; }
.modal-row { display: flex; gap: 10px; }
.modal-row .select-wrap { flex: 1 1 auto; }
.modal-row .btn-primary { height: 38px; }
.video-titles { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.video-title { padding: 10px 0; display: flex; align-items: center; gap: 12px; border-top: 1px solid var(--line-soft); }
.video-title-no { flex: none; width: 16px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.video-title-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.video-title-line { margin: 0; font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.video-title-zh { margin: 0; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.video-title-actions { flex: none; display: flex; gap: 6px; }

/* ── 运营 · 频道与预设 ── */
.side-card { flex: 1 1 260px; max-width: 320px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.side-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: calc(100vh - 220px); min-height: 160px; overflow-y: auto; }
.side-item { width: 100%; min-height: 52px; padding: 8px 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 0; border-radius: 10px; background: transparent; color: var(--ink); text-align: left; cursor: pointer; }
.side-item:hover { background: var(--fill-head); }
.side-item[aria-pressed="true"] { background: var(--accent-fill); }
.side-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.side-item-name { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.side-item-sub { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.side-item[aria-pressed="true"] .side-item-name { font-weight: 600; }
.side-item-count { font-size: 13px; color: var(--muted); white-space: nowrap; }
.detail-card { flex: 999 1 560px; min-width: 0; padding: 28px; display: flex; flex-direction: column; gap: 20px; }
.name-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; }
.name-row .field { flex: 1 1 260px; }
.name-row .btn-outline { height: 46px; }
.channel-owner .select-wrap { max-width: 260px; }
/* 设置页 · 种类的显示方式与出现条件：名称在左、值在右，各占一行；出现条件能选的预设列在下面 */
.category-options { display: flex; flex-direction: column; gap: 12px; }
.option-row { min-height: 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.option-name { font-size: 14px; font-weight: 600; }
.option-value { font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.option-row .btn-text { height: 32px; }
.preset-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
/* 频道用哪些预设：每个种类一块，预设排成一行行的勾选框 */
.category-list { display: flex; flex-direction: column; gap: 20px; }
.category { display: flex; flex-direction: column; gap: 10px; }
.category-name { margin: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.channel-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.channel-preset { min-height: 40px; padding: 0 4px 0 12px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; }
.channel-preset.is-on { border-color: var(--accent); background: var(--accent-fill-soft); }
.channel-preset-check { min-height: 38px; padding-right: 8px; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; cursor: pointer; }
.channel-preset-check input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.channel-preset-check input:disabled { cursor: default; }
.channel-preset .btn-text { height: 32px; }
/* 一项的最后是「默认」「已隐藏」时，右边留出与按钮一样的空 */
.channel-preset > span:last-child { margin-right: 8px; }
.preset-list { display: flex; flex-direction: column; gap: 12px; }
.preset-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; display: flex; flex-direction: column; gap: 8px; }
.preset-top { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.preset-owner { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.preset-name { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.preset-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 2px; }
.preset-prompt { font-size: 14px; line-height: 1.7; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.preset-edit { border: 1px solid var(--accent); border-radius: 12px; padding: 20px; background: #fbfcfe; box-shadow: 0 0 0 3px rgba(42, 103, 173, 0.10); display: flex; flex-direction: column; gap: 16px; }
.preset-edit .textarea { min-height: 120px; }
.edit-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* ── 运营 · 外包账号与运营名单：网格行 ── */
.list-card { flex: 999 1 640px; min-width: 0; overflow: hidden; }
.list-card.is-narrow { flex: 1 1 auto; max-width: 880px; }
.table-scroll { overflow-x: auto; }
.table-scroll > .table { min-width: 640px; }
.grid-row { display: grid; gap: 12px; align-items: center; padding: 10px 24px; }
.grid-head { padding-top: 12px; padding-bottom: 12px; background: var(--fill-head); color: var(--muted); font-size: 13px; font-weight: 500; }
.cols-outsource { grid-template-columns: 130px 110px minmax(0, 1fr) 90px 130px 110px; }
.table-scroll > .table.is-wide { min-width: 860px; }
.cols-operators { grid-template-columns: minmax(0, 1fr) 160px 80px 120px 80px; }
.grid-list { list-style: none; margin: 0; padding: 0; }
.grid-list > li { border-top: 1px solid var(--line-soft); }
.grid-list > li.is-selected { background: var(--accent-fill-soft); }
.cell-user { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.cell-end { display: flex; justify-content: flex-end; }
.cell-muted { font-size: 13px; color: var(--muted); }
.cell-date { font-size: 14px; color: var(--ink-2); }
.cell-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mini-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mini-chip { font-size: 13px; line-height: 1; padding: 6px 10px; border-radius: 999px; background: var(--fill-soft); color: var(--ink); }
.assign-card { flex: 1 1 300px; max-width: 360px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.assign-head { display: flex; flex-direction: column; gap: 4px; }
.assign-user { font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.check-list { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
.check-item { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-size: 15px; cursor: pointer; }
.check-item.is-on { border-color: var(--accent); background: var(--accent-fill-soft); }
.check-item input { width: 18px; height: 18px; margin: 0; flex: 0 0 auto; accent-color: var(--accent); }
.check-item-owner { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }
.operator-add { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.operator-add > label { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.operator-add .select-wrap { width: 200px; }
.operator-add .select { height: 44px; padding: 0 38px 0 12px; }
.operator-add .select-chevron { right: 12px; top: 13px; }
.btn-add { height: 44px; padding: 0 18px; }

/* ── 运营 · 外包账号：负责人、已停用、新密码 ── */
.push-right { margin-left: auto; }
.cell-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.cell-user.is-off { color: var(--muted); }
.cell-owner { font-size: 14px; overflow-wrap: anywhere; }
.tag-off { font-size: 12px; line-height: 1; padding: 4px 8px; border-radius: 999px; background: var(--fill-soft); color: var(--ink-2); }
.button-row { display: flex; gap: 10px; }
.grow { flex: 1 1 0; }
.panel-section { padding-top: 16px; border-top: 1px solid var(--line-soft); }
.btn-outline.is-panel, .btn-danger-outline.is-panel { height: 44px; font-size: 15px; }
.btn-secondary.is-large { height: 48px; border-radius: 12px; }
.pw-box { background: var(--accent-fill-soft); border: 1px solid #c9d8ee; border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.pw-part { display: flex; flex-direction: column; gap: 4px; }
.pw-label { font-size: 13px; color: var(--muted); }
.pw-user { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.pw-row { display: flex; align-items: center; gap: 10px; }
.pw-value { flex: 1 1 auto; min-width: 0; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 18px; font-weight: 600; letter-spacing: 0.04em; overflow-wrap: anywhere; user-select: all; }
.detail-field { display: flex; flex-direction: column; gap: 6px; }
.detail-label { font-size: 13px; color: var(--muted); }
.detail-value { font-size: 15px; font-weight: 500; overflow-wrap: anywhere; }
.detail-value.is-muted { color: var(--muted); font-weight: 400; }

/* ── 运营 · 生图记录 ── */
.title-with-count { display: flex; align-items: baseline; gap: 10px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.filter-label { font-size: 14px; font-weight: 500; color: var(--ink-2); }
.select-wrap.is-compact { width: 160px; }
.select-wrap.is-compact .select { height: 40px; padding: 0 36px 0 12px; font-size: 14px; }
.select-wrap.is-compact .select-chevron { right: 12px; top: 12px; }
.segmented.is-compact { border-radius: 10px; }
.segmented.is-compact button { flex: 0 0 auto; height: 32px; padding: 0 12px; border-radius: 7px; font-size: 14px; }
.record-grid { padding: 24px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.record-card { padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); text-align: left; cursor: pointer; overflow: hidden; display: flex; flex-direction: column; }
.record-card:hover { border-color: var(--line-button); }
.record-card[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(42, 103, 173, 0.15); }
.record-thumb { position: relative; height: 200px; background: #e9edf3; display: flex; align-items: center; justify-content: center; }
.record-img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.ratio-badge { position: absolute; top: 8px; left: 8px; font-size: 12px; line-height: 1; padding: 4px 7px; border-radius: 6px; background: #ffffff; color: var(--ink); }
.record-failed { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--danger); font-size: 14px; font-weight: 600; }
.record-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.record-title { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.record-who { font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.record-meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.record-detail { flex: 1 1 340px; max-width: 420px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.detail-frame { position: relative; max-width: 100%; align-self: center; border-radius: 12px; overflow: hidden; background: #e9edf3; display: flex; align-items: center; justify-content: center; }
.detail-frame.ratio-16x9 { width: 100%; aspect-ratio: 16 / 9; }
.detail-frame.ratio-9x16 { width: 220px; aspect-ratio: 9 / 16; }
.detail-frame.ratio-1x1 { width: 280px; aspect-ratio: 1 / 1; }
.detail-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.detail-title-wrap { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.detail-title { font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.detail-when { font-size: 13px; color: var(--muted); }
a.btn-download { text-decoration: none; }
.detail-list { margin: 0; display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px 12px; font-size: 14px; }
.detail-list dt { color: var(--muted); }
.detail-list dd { margin: 0; overflow-wrap: anywhere; }
.detail-list dd.is-danger { color: var(--danger); }
.detail-prompt-wrap { display: flex; flex-direction: column; gap: 6px; }
.detail-prompt { margin: 0; font-size: 14px; line-height: 1.7; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ── 管理员 · 操作记录 ── */
.cols-actions { grid-template-columns: 160px 110px 110px minmax(0, 1fr) minmax(0, 1.4fr) 64px; }
.cell-clip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cols-actions .btn-text { height: 32px; }
.list-more { padding: 16px 24px; display: flex; justify-content: center; border-top: 1px solid var(--line-soft); }

/* ── 管理员 · Key（公司入口）── */
.cols-keys { grid-template-columns: 130px 150px minmax(0, 1fr) 230px 72px; align-items: start; }
.cols-keys > .cell-user, .cols-keys > .cell-date, .cols-keys > .cell-muted { padding-top: 9px; }
.cols-keys .input, .cols-keys .btn-primary { height: 40px; font-size: 14px; }
.key-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.key-field .field-error { margin: 0; }

/* ── 窄屏（手机）──
   卡片占满整行，生图结果区缩小留白；表格在卡片里横向滚动 */
@media (max-width: 720px) {
  .gen-form, .side-card, .assign-card, .record-detail { max-width: none; }
  .record-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); padding: 16px; }
  .gen-form, .gen-result, .detail-card { padding: 20px; }
  .stage { min-height: 0; padding: 12px; }
  .stage.is-batch { height: auto; overflow-y: visible; }
  .operator-add { margin-left: 0; }
}
