:root {
  --bg: #f4f6fa;
  --surface: #ffffff;
  --surface-soft: #f8f9fc;
  --ink: #172231;
  --muted: #718096;
  --line: #e4e9f0;
  --blue: #3267e3;
  --blue-dark: #2453c5;
  --blue-pale: #edf3ff;
  --green: #21936f;
  --orange: #c97b31;
  --shadow: 0 14px 40px rgba(31, 46, 73, .08);
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Segoe UI", "Microsoft YaHei", sans-serif; font-size: 14px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.app-shell { display: flex; min-height: 100vh; }
/* 关键：显式 display:flex 会覆盖 hidden 属性，必须显式声明 hidden 时隐藏，否则登录前主界面仍被渲染/可见 */
.app-shell[hidden] { display: none; }
.sidebar { width: 244px; flex: 0 0 244px; min-height: 100vh; padding: 28px 18px 22px; display: flex; flex-direction: column; background: #1c2a3a; color: #e6edf7; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; background: #4c78e9; border-radius: 10px; font-size: 12px; font-weight: 800; letter-spacing: .5px; }
.brand-copy { margin: -35px 0 0 52px; display: flex; flex-direction: column; gap: 3px; }
.brand-copy strong { font-size: 15px; letter-spacing: .2px; }.brand-copy span { color: #90a0b6; font-size: 11px; }
.nav-list { display: grid; gap: 7px; margin-top: 70px; }.nav-item { display: flex; align-items: center; gap: 12px; height: 44px; padding: 0 13px; border: 0; border-radius: 7px; color: #9eacc0; background: transparent; text-align: left; }.nav-item:hover, .nav-item.active { background: rgba(255,255,255,.1); color: #fff; }.nav-item.active { box-shadow: inset 3px 0 0 #7d9bf2; }.nav-icon { width: 18px; color: #9bb6ff; font-size: 21px; line-height: 1; text-align: center; }
.sidebar-bottom { margin-top: auto; }.storage-meter { padding: 16px 13px; border-top: 1px solid rgba(255,255,255,.1); }.storage-line { display: flex; justify-content: space-between; font-size: 11px; color: #b9c6d6; }.storage-line strong { color: #e9eff8; font-weight: 600; }.meter { height: 4px; margin: 11px 0 8px; overflow: hidden; border-radius: 4px; background: #34465c; }.meter i { display: block; width: 39%; height: 100%; background: #7695f2; border-radius: 4px; }.storage-meter small { color: #8292a8; font-size: 10px; }.mode-pill { display: inline-flex; align-items: center; gap: 7px; margin: 3px 13px 0; padding: 6px 9px; color: #a9bad1; background: rgba(255,255,255,.06); border-radius: 4px; font-size: 11px; }.mode-pill i { width: 6px; height: 6px; border-radius: 50%; background: #e3a35a; }
.main-content { width: calc(100% - 244px); max-width: 1500px; margin: 0 auto; min-width: 0; padding: 34px 56px 70px; }.topbar { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 38px; }.eyebrow, .card-kicker { margin: 0 0 9px; color: #8b98a9; font-size: 10px; font-weight: 700; letter-spacing: 1.4px; }.topbar h1 { margin: 0; font-size: 28px; letter-spacing: -.3px; }.topbar-actions { display: flex; align-items: center; gap: 15px; }.date-chip { color: var(--muted); font-size: 12px; }.icon-button { width: 34px; height: 34px; border: 1px solid var(--line); color: #657489; background: var(--surface); border-radius: 7px; }.avatar { width: 34px; height: 34px; display: grid; place-items: center; color: #fff; background: #d17d5e; border-radius: 50%; font-size: 11px; font-weight: 700; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 42px; align-items: start; }.form-column { min-width: 0; max-width: 780px; }.section-block { padding: 0 0 30px; margin-bottom: 29px; border-bottom: 1px solid var(--line); }.section-heading, .label-row, .summary-title-row, .view-heading { display: flex; align-items: center; justify-content: space-between; }.section-heading { margin-bottom: 23px; }.section-heading > div { display: flex; align-items: center; gap: 12px; }.section-index { color: var(--blue); font-size: 11px; font-weight: 800; letter-spacing: .7px; }.section-heading h2, .view-heading h2 { margin: 0; font-size: 17px; letter-spacing: -.1px; }.required-note, .label-row span, .required-note { color: #9aa6b5; font-size: 11px; }.field-group { margin-bottom: 17px; }.field-group label { display: block; margin-bottom: 8px; color: #465466; font-size: 12px; font-weight: 600; }.field-group em { color: #dd734b; font-style: normal; }.label-row label { margin-bottom: 8px; }.field-group textarea, .field-group select { width: 100%; outline: none; border: 1px solid #dce3ec; border-radius: 6px; color: var(--ink); background: var(--surface); transition: border .2s, box-shadow .2s; }.field-group textarea { min-height: 78px; padding: 12px 13px; resize: vertical; line-height: 1.7; }.field-group select { height: 40px; padding: 0 12px; appearance: auto; }.field-group textarea:focus, .field-group select:focus { border-color: #7d9bf2; box-shadow: 0 0 0 3px rgba(50,103,227,.1); }.section-help { margin: -8px 0 19px 23px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.text-button { display: inline-flex; gap: 5px; align-items: center; padding: 7px 0; border: 0; color: var(--blue); background: transparent; font-size: 12px; font-weight: 600; }.text-button:hover { color: var(--blue-dark); }.group-card { padding: 16px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }.dropzone:hover, .dropzone.dragging { border-color: var(--blue); background: var(--blue-pale); }.upload-button { padding: 7px 10px; border: 1px solid #cbd7ea; border-radius: 5px; color: var(--blue); background: #fff; font-size: 11px; font-weight: 600; }.upload-button:hover { background: var(--blue-pale); }.file-input { display: none; }
.settings-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }.settings-grid .field-group { margin: 0; }.form-footer { display: flex; align-items: center; justify-content: flex-end; gap: 13px; }.primary-button, .secondary-button { height: 42px; padding: 0 17px; border-radius: 6px; font-weight: 600; }.primary-button { border: 1px solid var(--blue); color: #fff; background: var(--blue); box-shadow: 0 5px 13px rgba(50,103,227,.2); }.primary-button:hover { background: var(--blue-dark); }.secondary-button { border: 1px solid #d6deea; color: #5c6a7c; background: #fff; }.secondary-button:hover { border-color: #aebdd3; background: #fafbfe; }.button-icon { margin-right: 8px; font-size: 10px; }.small-button { height: 36px; font-size: 12px; }
.summary-column { min-width: 0; }.sticky-card { position: sticky; top: 28px; }.summary-card { padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }.summary-title-row { margin-bottom: 22px; }.summary-title-row h2 { margin: 0; font-size: 16px; }.status-dot { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-size: 10px; }.status-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--green); }.batch-count { display: flex; align-items: baseline; gap: 8px; padding-bottom: 21px; border-bottom: 1px solid var(--line); }.batch-count strong { color: var(--blue); font-size: 42px; line-height: 1; }.batch-count span { color: var(--muted); font-size: 12px; }.summary-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 18px 0; }.summary-stats div { display: flex; flex-direction: column; gap: 5px; }.summary-stats span, .output-path > span { color: var(--muted); font-size: 10px; }.summary-stats strong { font-size: 14px; }.estimate-box { display: flex; flex-direction: column; gap: 5px; padding: 14px; border-radius: 6px; background: #f4f7ff; }.estimate-box span { color: #637391; font-size: 11px; }.estimate-box strong { color: var(--blue); font-size: 22px; }.estimate-box small { color: #8a98af; font-size: 10px; line-height: 1.5; }.output-path { display: flex; flex-direction: column; gap: 6px; padding-top: 18px; }.output-path code { display: block; padding: 8px 9px; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; color: #5e6e82; background: #fafbfd; font-family: Consolas, monospace; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }.tip-card { display: flex; gap: 10px; margin-top: 14px; padding: 14px; border-left: 3px solid #d8a059; background: #fffaf3; }.tip-icon { flex: 0 0 17px; width: 17px; height: 17px; display: grid; place-items: center; border: 1px solid #d8a059; border-radius: 50%; color: #b8772f; font-size: 10px; }.tip-card strong { color: #785528; font-size: 11px; }.tip-card p { margin: 5px 0 0; color: #98754c; font-size: 10px; line-height: 1.6; }
.view { display: none; }.view.active { display: block; }.view-heading { max-width: 1080px; margin-bottom: 25px; }.view-heading h2 { font-size: 25px; }.history-list { max-width: 1080px; }.history-item { display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 17px 19px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }.history-item .batch-id { color: var(--muted); font-family: Consolas, monospace; font-size: 11px; }.history-topic { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-weight: 600; line-height: 1.55; word-break: break-all; }.history-status { color: var(--green); font-size: 11px; font-weight: 600; }.history-status.running { color: var(--blue); }.history-status.failed { color: #c25a52; }.empty-history { padding: 70px 20px; border: 1px dashed var(--line); color: #8794a6; background: rgba(255,255,255,.4); text-align: center; }.template-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 15px; max-width: 1080px; }.template-card { min-height: 180px; padding: 19px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }.template-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }.template-title-row h3 { margin: 0; font-size: 15px; }.template-owner { flex: none; font-size: 10px; color: #8a94a6; background: #f2f5fa; padding: 2px 8px; border-radius: 999px; }.template-prompt-text { min-height: 40px; max-height: 96px; overflow: hidden; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; white-space: pre-wrap; word-break: break-all; }.template-card .template-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 17px; color: #9aa6b5; font-size: 10px; }.template-card button { border: 0; color: var(--blue); background: transparent; font-size: 11px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 5; padding: 12px 16px; border: 1px solid #cfe0d9; border-radius: 6px; color: #216d56; background: #effaf5; box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); pointer-events: none; transition: .25s; font-size: 12px; }.toast.show { opacity: 1; transform: translateY(0); }

/* 素材库中心 */
.view-help { max-width: 1080px; margin: -12px 0 20px; color: #8a94a6; font-size: 12px; line-height: 1.6; }
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 15px; max-width: 1080px; }
/* 素材库页：移动端固定 2 列（2x2 卡片），桌面保持自适应多列 */
@media (max-width: 480px) {
  .asset-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .asset-card { padding: 8px; }
  .asset-info { padding: 8px 2px 2px; }
  .asset-actions button { font-size: 11px; }
}
.asset-card { min-height: 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.asset-thumb { position: relative; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 9px; background: #f0f3f9; }
.asset-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.asset-ph { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; color: #a0a9b8; font-size: 11px; background: #f0f3f9; }
/* 素材卡片信息行：绝对定位叠在图片底部 + 渐变遮罩（图上叠文字，like 短视频卡片） */
.asset-info { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 26px 10px 8px; background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.55) 55%, rgba(0,0,0,.78) 100%); }
.asset-row { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.asset-actions { display: inline-flex; gap: 8px; align-items: center; }
.asset-actions button { border: 0; background: transparent; color: #fff; font-size: 12px; font-weight: 600; cursor: pointer; padding: 4px 6px; border-radius: 6px; white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.asset-actions button:hover { background: rgba(255,255,255,.18); }
/* 素材库公共/私有分组与角标已移除（改为顶部「公共/个人」分段切换） */

@media (max-width: 1240px) { body:not(.user-mode) .main-content { padding: 30px 32px 60px; } body:not(.user-mode) .workspace-grid { grid-template-columns: 1fr; gap: 30px; } body:not(.user-mode) .summary-column { order: -1; } body:not(.user-mode) .sticky-card { position: static; } body:not(.user-mode) .summary-card { max-width: 780px; } body:not(.user-mode) .tip-card { display: none; } }
@media (max-width: 700px) { .app-shell { display: block; }.sidebar { width: 100%; min-height: auto; padding: 16px; }.brand-copy { margin-top: -35px; }.nav-list { display: flex; gap: 4px; margin-top: 55px; overflow-x: auto; }.nav-item { flex: 0 0 auto; height: 38px; padding: 0 10px; }.nav-item.active { box-shadow: inset 0 -3px 0 #7d9bf2; }.sidebar-bottom { display: none; }.main-content { width: 100%; padding: 25px 18px 45px; }.topbar { margin-bottom: 27px; }.topbar h1 { font-size: 23px; }.date-chip { display: none; }.topbar-actions { gap: 8px; }.workspace-grid { gap: 22px; }.section-block { padding-bottom: 23px; margin-bottom: 23px; }.settings-grid { grid-template-columns: repeat(2, 1fr); }.section-help { margin-left: 0; }.history-item { gap: 8px; }.form-footer { justify-content: stretch; }.form-footer button { flex: 1; }.summary-card { padding: 18px; } }

.number-input { display: flex; align-items: center; height: 40px; overflow: hidden; border: 1px solid #dce3ec; border-radius: 6px; background: #fff; }
.number-input:focus-within { border-color: #7d9bf2; box-shadow: 0 0 0 3px rgba(50,103,227,.1); }
.number-input input { width: 100%; min-width: 0; height: 100%; padding: 0 12px; border: 0; outline: 0; color: var(--ink); background: transparent; }
.number-input span { padding-right: 12px; color: var(--muted); font-size: 11px; }
.number-input.compact { width: 104px; height: 34px; }.number-input.compact input { padding: 0 9px; }
.setting-readonly { display: flex; align-items: center; height: 40px; padding: 0 12px; border: 1px solid #e4e9f0; border-radius: 6px; color: #7d8999; background: #f8f9fc; font-size: 11px; }.group-prompt-label { display: flex; align-items: baseline; gap: 7px; margin-top: 13px; color: #59687a; font-size: 11px; font-weight: 600; }.group-prompt-label span { color: #9aa6b5; font-weight: 400; }
.view-actions { display: flex; align-items: center; gap: 10px; }.history-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }.history-item .history-status { flex: 0 0 auto; }.batch-id-wrap { display: inline-flex; align-items: baseline; gap: 10px; min-width: 0; }.batch-date { color: #8b98a9; font-size: 11px; white-space: nowrap; }.his-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 4px; }.his-metric { min-width: 0; }.his-metric-label { display: flex; align-items: center; gap: 5px; font-size: 12px; color: #8291a8; margin: 0; }.his-metric-label em { font-style: normal; }.his-metric-value { display: block; font-size: 14px; font-weight: 600; color: var(--ink); margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }.his-metric.cost .his-metric-value { color: #1f7a5c; }.his-error { font-size: 12px; color: #c25a52; line-height: 1.5; margin: 0; padding: 8px 10px; background: rgba(194, 90, 82, .07); border-left: 2px solid #c25a52; border-radius: 6px; }.history-bottom { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 2px; }.history-action { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; text-align: left; }.start-task { padding: 7px 10px; border: 1px solid #c6d6f7; border-radius: 5px; color: var(--blue); background: var(--blue-pale); font-size: 11px; font-weight: 600; }.start-task:hover { background: #dfe9ff; }.completed-mark, .progress-mark { color: #9aa6b5; font-size: 11px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 20px; background: rgba(21, 31, 45, .42); }.modal-backdrop[hidden] { display: none; }.settings-modal { width: min(560px, 100%); padding: 24px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: 0 24px 70px rgba(25, 39, 64, .25); }.modal-heading { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 23px; }.modal-heading h2 { margin: 0; font-size: 20px; }.close-button { width: 30px; height: 30px; border: 0; color: #7d8999; background: transparent; font-size: 22px; }.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }.modal-grid .field-group { margin: 0; }.modal-grid input, .modal-grid select { width: 100%; height: 40px; padding: 0 11px; border: 1px solid #dce3ec; border-radius: 6px; outline: 0; color: var(--ink); background: #fff; }.modal-grid input:focus, .modal-grid select:focus { border-color: #7d9bf2; box-shadow: 0 0 0 3px rgba(50,103,227,.1); }.full-field { grid-column: 1 / -1; }.modal-note { margin: 17px 0 0; color: #8b98a9; font-size: 11px; line-height: 1.6; }.modal-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 20px; }.key-status { color: var(--muted); font-size: 11px; }
.modal-subtitle { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }.link-button { margin-left: 10px; padding: 0; border: 0; color: var(--blue); background: transparent; font-size: 11px; }.link-button:hover { color: var(--blue-dark); }
.field-hint { display: block; margin-top: 6px; color: #8b98a9; font-size: 10px; line-height: 1.5; }
.settings-modal { max-height: calc(100vh - 40px); overflow-y: auto; }
.model-capability { padding: 4px 7px; border: 1px solid #cbd9f4; border-radius: 4px; color: var(--blue); background: #f3f7ff; font-size: 10px; font-weight: 600; }
.group-image-urls { width: 100%; min-height: 72px; margin-top: 7px; padding: 10px; border: 1px solid #e3e8ef; border-radius: 5px; outline: 0; color: #556477; background: #fbfcfe; line-height: 1.55; resize: vertical; }.group-image-urls:focus { border-color: #9bb2ea; box-shadow: 0 0 0 3px rgba(50,103,227,.08); }
.service-summary { display: grid; gap: 8px; padding: 13px; border: 1px solid #dfe6f2; border-radius: 6px; background: #f8faff; }.service-summary div { display: flex; align-items: center; justify-content: space-between; gap: 15px; }.service-summary span { color: #8090a5; font-size: 10px; }.service-summary strong { overflow-wrap: anywhere; color: #46566c; font-family: Consolas, monospace; font-size: 10px; text-align: right; }
.prompt-actions { display: flex; align-items: center; gap: 7px; }.ai-action:disabled, .link-button:disabled { cursor: wait; opacity: .6; }
@media (max-width: 700px) { .group-options { align-items: flex-start; flex-direction: column; gap: 10px; }.view-actions { gap: 5px; }.view-actions .secondary-button { padding: 0 9px; font-size: 10px; }.modal-grid { grid-template-columns: 1fr; }.full-field { grid-column: auto; } }
@media (max-width: 700px) { .label-row { align-items: flex-start; gap: 8px; }.prompt-actions { flex-wrap: wrap; justify-content: flex-end; }.prompt-actions #prompt-count { width: 100%; text-align: right; }.ai-result-footer { align-items: flex-start; flex-direction: column; }.ai-apply-button { width: 100%; } }

.group-urls { width: 100%; min-height: 56px; margin-top: 7px; padding: 10px; border: 1px solid #e3e8ef; border-radius: 5px; outline: 0; color: #556477; background: #fbfcfe; line-height: 1.55; resize: vertical; }.group-urls:focus { border-color: #9bb2ea; box-shadow: 0 0 0 3px rgba(50,103,227,.08); }
.media-dot { flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; display: inline-block; align-self: center; }
.media-dot.video { background: #7c5ce0; box-shadow: 0 0 0 3px rgba(124,92,224,.14); }
.media-dot.audio { background: #d8874a; box-shadow: 0 0 0 3px rgba(216,135,74,.14); }
.group-prompt-label + .group-urls, .group-prompt-label + .group-image-urls { margin-bottom: 4px; }
.media-upload-row { display: flex; align-items: center; gap: 10px; margin: 7px 0 2px; padding: 8px 11px; border: 1px dashed #cfd9e8; border-radius: 5px; background: #fafcff; }
.media-upload-row span { flex: 1; color: #738094; font-size: 11px; }
.media-upload-row .upload-button { margin: 0; }
/* 已上传视频/音频的可视化列表 */
.media-empty { color: #a0a9b8; font-size: 11px; padding: 4px 2px; }
.media-item { display: flex; align-items: center; gap: 8px; padding: 7px 9px; margin: 4px 0; border: 1px solid #e4ebf5; border-radius: 6px; background: #fbfcff; }
.media-ico { flex: 0 0 auto; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; border-radius: 5px; color: #fff; background: #5b8cff; font-size: 9px; }
.media-item[data-kind="audio"] .media-ico { background: #9a7bf0; }
.media-name { flex: 1; min-width: 0; color: #46536a; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-size { flex: 0 0 auto; color: #8b98a9; font-size: 10px; }
.media-del { flex: 0 0 auto; width: 18px; height: 18px; border: 0; border-radius: 50%; color: #e06060; background: #fdeaea; font-size: 12px; line-height: 1; cursor: pointer; }
.media-del:hover { background: #fbd4d4; }
.user-mode .media-empty { color: #5F6F8A; }
.user-mode .media-item { background: #0F1C33; border-color: #1E3555; }
.user-mode .media-ico { background: #3B82F6; }
.user-mode .media-item[data-kind="audio"] .media-ico { background: #8B5CF6; }
.user-mode .media-name { color: #C6D4EA; }
.user-mode .media-size { color: #5F6F8A; }
.user-mode .media-del { color: #E06060; background: rgba(224,96,96,.15); }
.user-mode .media-del:hover { background: rgba(224,96,96,.28); }
.advanced { display: none; }
.advanced.show { display: block; }
.advanced.show.group-top { display: flex; }
.advanced.show.group-options { display: flex; }
.advanced.show.group-prompt-label { display: flex; }
.section-tools { display: flex; align-items: center; gap: 12px; }
#toggle-advanced { padding: 5px 9px; border: 1px solid #d6deea; border-radius: 5px; color: #5c6a7c; background: #fff; font-size: 11px; }
#toggle-advanced:hover { border-color: #aebdd3; background: #fafbfe; }
#toggle-advanced.open { color: var(--blue); border-color: #c6d6f7; background: var(--blue-pale); }
.media-file { display: none; }
.prompt-row { display: flex; align-items: flex-start; gap: 9px; margin-bottom: 10px; }
.prompt-index { flex: 0 0 24px; width: 24px; height: 24px; display: grid; place-items: center; margin-top: 7px; border-radius: 50%; color: var(--blue); background: var(--blue-pale); font-size: 11px; font-weight: 700; }
/* 提示词行：.prompt-input-wrap 承载 textarea + 高亮装饰层；排版属性与 textarea 共享保证两层逐像素对齐 */
.prompt-input-wrap { position: relative; width: 100%; min-width: 0; }
.prompt-row textarea, .prompt-input-wrap .prompt-hl { padding: 10px 12px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; overflow-wrap: break-word; }
.prompt-row textarea { flex: 1; min-width: 0; min-height: 68px; margin: 0; border: 1px solid #dce3ec; border-radius: 6px; outline: 0; color: var(--ink); background: var(--surface); resize: vertical; }
.prompt-row textarea:focus { border-color: #7d9bf2; box-shadow: 0 0 0 3px rgba(50,103,227,.1); }
/* @图N 高亮装饰层：盖在 textarea 上方，文字透明只显示引用色块；pointer-events:none 保证点击/选中都在 textarea */
.prompt-input-wrap .prompt-hl { position: absolute; top: 0; left: 0; width: 100%; height: 100%; margin: 0; overflow: hidden; border: 1px solid transparent; color: transparent; pointer-events: none; z-index: 1; }
.prompt-hl .hl-ref { background: rgba(50, 103, 227, .12); border-bottom: 1px solid rgba(50, 103, 227, .5); border-radius: 3px; padding: 0 1px; }
.remove-prompt-row { flex: 0 0 28px; width: 28px; height: 28px; margin-top: 2px; border: 0; color: #9aa6b5; background: transparent; font-size: 19px; line-height: 1; }
.remove-prompt-row:hover { color: #c45d55; }
#add-prompt-row { margin-top: 2px; }
.mat-toggle { display: flex; align-items: center; gap: 7px; width: 100%; margin: 10px 0 4px; padding: 9px 12px; border: 1px dashed #cfd9e8; border-radius: 6px; color: #5c6a7c; background: #f8faff; font-size: 12px; font-weight: 600; text-align: left; cursor: pointer; }
.mat-toggle:hover { border-color: #9fb7ee; background: #eef4ff; }
.mat-toggle-icon { color: var(--blue); font-size: 13px; line-height: 1; }
.mat-toggle em { margin-left: auto; color: #8b98a9; font-size: 10px; font-weight: 400; font-style: normal; }
.mat-body { display: none; }
.mat-body.open { display: block; }
.mat-body.open .media-upload-row { margin-top: 4px; }
.mat-body textarea:last-child { margin-bottom: 4px; }
@media (max-width: 700px) {
  .prompt-row { flex-wrap: wrap; gap: 7px; }
  .prompt-index { margin-top: 0; }
  .prompt-row textarea { flex: 1 1 calc(100% - 46px); }
  .remove-prompt-row { margin-top: 0; }
  .media-upload-row { flex-wrap: wrap; gap: 7px; }
  .media-upload-row span { flex: 1 1 100%; }
  .media-upload-row .upload-button { flex: 0 0 auto; }
}

/* ===== 手机端适配（≤767px） ===== */
@media (max-width: 767px) {
  .sidebar { padding: 13px 12px 10px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 8px; }
  .brand-copy { margin: -34px 0 0 46px; }
  .brand-copy strong { font-size: 14px; }
  .nav-list { margin-top: 48px; }
  .nav-item { height: 42px; padding: 0 12px; gap: 7px; font-size: 13px; }
  .nav-icon { font-size: 19px; }
  .main-content { padding: 20px 14px 52px; }
  .topbar { margin-bottom: 22px; }
  .topbar h1 { font-size: 21px; }
  .avatar { width: 32px; height: 32px; font-size: 10px; }
  .icon-button { width: 38px; height: 38px; font-size: 16px; }
  .workspace-grid { gap: 22px; }
  .section-block { padding-bottom: 22px; margin-bottom: 22px; }
  .section-heading { flex-wrap: wrap; gap: 8px; }
  .section-heading h2 { font-size: 16px; }
  .section-tools { gap: 8px; }
  .section-help { margin-left: 0; line-height: 1.7; }
  .field-group textarea, .field-group select, .field-group input, .prompt-row textarea, .prompt-input-wrap .prompt-hl { font-size: 16px; }
  .field-group textarea { min-height: 84px; }
  .field-group select { height: 46px; }
  .settings-grid { gap: 10px; }
  .form-footer { gap: 10px; }
  .form-footer button { flex: 1; height: 48px; font-size: 14px; }
  .primary-button, .secondary-button { height: 46px; }
  .text-button { padding: 9px 0; font-size: 13px; }
  #toggle-advanced { padding: 8px 11px; font-size: 12px; }
  .group-card { padding: 13px 11px; }
  .upload-button { height: 42px; padding: 0 14px; font-size: 12px; }
  .mat-toggle { padding: 12px 12px; font-size: 13px; }
  .media-upload-row { flex-wrap: wrap; gap: 8px; }
  .media-upload-row span { flex: 1 1 100%; }
  .media-upload-row .upload-button { height: 42px; }
  .group-prompt-label { font-size: 12px; }
  .group-image-urls, .group-urls { min-height: 64px; font-size: 14px; }
  .prompt-index { width: 26px; height: 26px; margin-top: 8px; font-size: 12px; }
  .prompt-row textarea { min-height: 82px; }
  .prompt-row textarea, .prompt-input-wrap .prompt-hl { padding: 11px 12px; }
  .remove-prompt-row { width: 34px; height: 34px; font-size: 22px; }
  .number-input { height: 44px; }
  .number-input.compact { height: 40px; }
  .summary-card { padding: 17px 14px; }
  .batch-count strong { font-size: 36px; }
  .summary-stats strong { font-size: 15px; }
  .output-path code { font-size: 11px; }
  .history-item { padding: 14px 12px; gap: 8px 14px; }
  .history-topic { font-size: 14px; }
  .start-task { height: 40px; padding: 0 13px; font-size: 12px; }
  .modal-backdrop { padding: 0; }
  .settings-modal { width: 100%; max-width: none; max-height: 100vh; height: 100vh; border-radius: 0; padding: 22px 16px; }
  .modal-heading h2 { font-size: 18px; }
  .modal-grid input { height: 46px; font-size: 16px; }
  .modal-footer { align-items: flex-start; flex-direction: column; gap: 14px; }
  .modal-footer button { width: 100%; height: 46px; }
  .modal-note { font-size: 12px; }
  .template-card { min-height: 148px; padding: 16px 14px; }
  .template-card h3 { font-size: 14px; }
  .template-card button { font-size: 12px; }
  .toast { left: 14px; right: 14px; bottom: 14px; text-align: center; font-size: 13px; }
  .view-actions { gap: 8px; }
  .view-actions .secondary-button { height: 40px; padding: 0 12px; font-size: 11px; }
}


/* ===== 全局保护 & 触控优化 ===== */
html, body { overflow-x: hidden; }
body { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }

/* ===== 平板适配（768–1240px，含小桌面） ===== */
@media (min-width: 768px) and (max-width: 1240px) {
  .sidebar { width: 200px; flex: 0 0 200px; padding: 24px 14px 18px; }
  .main-content { width: calc(100% - 200px); }
  .brand-copy { margin: -35px 0 0 48px; }
  .main-content { padding: 30px 24px 60px; }
  .topbar h1 { font-size: 24px; }
  .settings-grid { grid-template-columns: repeat(2, 1fr); }
  .form-footer { gap: 12px; }
  .section-help { margin-left: 14px; }
  .template-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
}

/* ===== 手机端补漏（≤767px） ===== */
@media (max-width: 767px) {
  .close-button { width: 38px; height: 38px; font-size: 24px; }
  .ai-apply-button { height: 38px; }
  .link-button { font-size: 12px; padding: 6px 0; }
  .history-topic { min-width: 0; }
  .summary-stats { gap: 4px; }
  .template-grid { grid-template-columns: 1fr; }
  .modal-subtitle { font-size: 12px; }
  .service-summary strong { font-size: 11px; }
  .settings-grid { gap: 8px; }
  .preview-item { width: 64px; height: 64px; }
}

/* ===== iOS 安全区 ===== */
@supports (padding: max(0px)) {
  .main-content { padding-bottom: max(52px, env(safe-area-inset-bottom)); }
  .modal-backdrop { padding-top: env(safe-area-inset-top); }
  .modal-backdrop { padding-bottom: env(safe-area-inset-bottom); }
}

/* ===== 用户版精简：隐藏开发/调试元素（仅 user.html 生效） ===== */
.user-mode .mode-pill, .user-mode .date-chip, .user-mode .avatar, .user-mode .eyebrow, .user-mode .storage-meter, .user-mode .tip-card, .user-mode .card-kicker, .user-mode .service-summary, .user-mode .modal-subtitle, .user-mode .estimate-box { display: none; }
.sidebar-bottom { margin-top: 12px; }
.mode-switch { display: block; margin: 10px 13px 0; color: #8292a8; font-size: 11px; text-decoration: none; }
.mode-switch:hover { color: #b9c6d6; }
.user-advanced-toggle { justify-content: flex-end; margin-top: 4px; }

/* ===== 手机端字号放大（≤767px） ===== */
@media (max-width: 767px) {
  body { font-size: 15px; }
  .field-group label { font-size: 14px; }
  .group-prompt-label { font-size: 13px; }
  .group-prompt-label span { font-size: 12px; }
  .section-help { font-size: 13px; }
  .required-note, .label-row span { font-size: 12px; }
  .media-upload-row span { font-size: 13px; }
  .mat-toggle { font-size: 14px; }
  .mat-toggle em { font-size: 11px; }
  .summary-stats span, .output-path > span { font-size: 12px; }
  .estimate-box small { font-size: 11px; }
  .history-status, .batch-id { font-size: 12px; }
  .template-card p { font-size: 13px; }
  .modal-note { font-size: 13px; }
  .key-status { font-size: 12px; }
  .field-hint { font-size: 12px; }
  .service-summary span, .service-summary strong { font-size: 11px; }
  .prompt-actions #prompt-count { font-size: 12px; }
  .model-capability { font-size: 11px; }
}

/* ===== 用户版 UI（Mobile-first：<1024px 单列窄栏 + 底部提交栏；≥1024px 桌面双栏） ===== */
.user-mode .main-content { width: 100%; max-width: 620px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.user-mode .workspace-grid { grid-template-columns: 1fr; gap: 18px; }
.user-mode .form-footer { display: none; }
.user-mode .summary-column { display: none; }
.user-mode .desktop-start-all { display: none; }
.user-mode .user-bottom-bar { display: flex; align-items: center; gap: 14px; padding: 12px 16px; }
.user-mode .user-bottom-bar .primary-button { flex: 1; height: 52px; border-radius: 12px; border: 0; font-size: 15px; }
.user-mode .section-index { display: none; }
.user-mode .section-help { margin-left: 0; }
/* 用户版不提供高级设置：隐藏「更多选项」按钮及补充说明/数量输入框；生成条数显示在底部提交栏 */
.user-mode .user-advanced-toggle { display: none; }
.user-mode .advanced { display: none !important; }
.user-mode .bottom-hint { color: #8b98a9; font-size: 12px; flex: 0 0 auto; }
/* 深蓝黑主题覆盖：替代原浅色残留块（270-287），避免浅色/白底穿透 */
.user-mode .prompt-row textarea:focus { background: #0D1728; border-color: #3B82F6; }
.user-mode .group-card { border: 0; border-radius: 12px; padding: 12px 10px; background: #0D1728; }
.user-mode .history-item.cover-item { display: flex; flex-direction: column; gap: 8px; cursor: pointer; border: 1px solid #1e2e4a; border-radius: 12px; background: #101A2D; overflow: visible; padding: 0; box-shadow: none; }
.user-mode .history-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.user-mode .history-status { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; background: rgba(59,130,246,.1); color: #2DD4BF; text-align: center; flex: 0 0 auto; }
.stepper { display: flex; align-items: center; height: 46px; border: 1px solid #283B5D; border-radius: 10px; background: #0D1728; overflow: hidden; }
.stepper button { width: 46px; height: 100%; border: 0; background: transparent; color: #3B82F6; font-size: 18px; line-height: 1; }
.stepper button:active { background: rgba(59,130,246,.12); }
.stepper-value { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; }
.stepper-value input { width: 52px; border: 0; outline: 0; text-align: center; font-size: 16px; background: transparent; }
.stepper-value span { color: #8291A8; font-size: 13px; }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 9px 13px; border: 1px solid #283B5D; border-radius: 10px; background: transparent; color: #8291A8; font-size: 13px; }
.chip.active { background: rgba(59,130,246,.1); border-color: #3B82F6; color: #3B82F6; font-weight: 500; }
.user-settings { grid-template-columns: 1fr 1fr; gap: 14px; }
@media (min-width: 768px) and (max-width: 1023px) {
  .user-mode .user-bottom-bar { margin: 4px auto 0; max-width: 620px; border: 1px solid #1C2B47; border-radius: 14px; }
}
@media (max-width: 767px) {
  .user-mode .user-bottom-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; padding-bottom: max(12px, env(safe-area-inset-bottom)); box-shadow: 0 -6px 20px rgba(31, 46, 73, .08); }
  .user-mode .main-content { padding-bottom: 96px; }
  .user-settings { grid-template-columns: 1fr; }
}

/* ===== 用户版 桌面端（≥1024px）：双栏布局，充分利用宽屏 ===== */
@media (min-width: 1024px) {
  .user-mode .main-content { max-width: 1280px; padding: 34px 48px 70px; }
  .user-mode .workspace-grid { grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
  .user-mode .form-column { max-width: none; }
  /* 右侧任务预览卡 */
  .user-mode .summary-column { display: block; }
  .user-mode .summary-card { padding: 22px; }
  .user-mode .summary-title-row h2 { color: #F1F5F9; font-size: 16px; }
  .user-mode .summary-title-row .status-dot { color: #2DD4BF; font-size: 10px; }
  .user-mode .summary-title-row .status-dot::before { background: #2DD4BF; }
  .user-mode .batch-count { padding-bottom: 18px; border-bottom-color: #1E2E4A; }
  .user-mode .batch-count strong { color: #3B82F6; font-size: 40px; }
  .user-mode .batch-count span { color: #8291A8; }
  .user-mode .summary-stats { padding: 16px 0; }
  .user-mode .summary-stats div { gap: 4px; }
  .user-mode .summary-stats span { color: #8291A8; }
  .user-mode .summary-stats strong { color: #F1F5F9; font-size: 15px; }
  .user-mode .estimate-box { background: rgba(59,130,246,.08); border: 1px solid rgba(90,130,200,.25); border-radius: 12px; }
  .user-mode .estimate-box span { color: #8291A8; }
  .user-mode .estimate-box strong { color: #3B82F6; font-size: 18px; }
  .user-mode .estimate-box small { color: #7A87A1; }
  /* 表单底部操作区恢复，底部提交栏让位于桌面布局 */
  .user-mode .form-footer { display: flex; justify-content: flex-end; gap: 13px; margin-top: 26px; }
  .user-mode .form-footer .primary-button, .user-mode .form-footer .secondary-button { height: 46px; padding: 0 22px; font-size: 14px; border-radius: 12px; }
  .user-mode .user-bottom-bar { display: none; }
  /* 历史页：桌面端顶部批量操作（卡片双列在文件后部断点统一处理）
     必须带 align-items:center —— button 被改造成 flex 容器后会失去原生垂直居中，
     缺这行会让单行文字贴顶（实测上 1px / 下 19px）。 */
  .user-mode .desktop-start-all { display: inline-flex; align-items: center; }
  /* 素材库 / 模板库：桌面端自适应多列铺满 */
  .user-mode .asset-grid, .user-mode .template-grid { max-width: none; }
  .user-mode .view-heading, .user-mode .view-help { max-width: none; }
  /* 登录卡片：桌面端适当放大 */
  .user-mode .login-card { max-width: 430px; padding: 64px 42px 32px; }
  .user-mode .login-card h1 { font-size: 26px; }
  .user-mode .login-sub { font-size: 14px; }
}

/* 任务下载 */
.history-status.interrupted { background: #fff7e6; color: #b8860b; }

/* 登录 / 密码门 */
.login-screen, .admin-gate { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #f5f7fb 0%, #e8edf7 100%); padding: 20px; }
/* 关键：显式 display:flex 会覆盖 hidden 属性，必须显式声明 hidden 时隐藏，否则登录成功/密码验证通过后遮罩仍盖在界面上 */
.login-screen[hidden], .admin-gate[hidden] { display: none; }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 20px; padding: 36px 32px 28px; box-shadow: 0 12px 40px rgba(15, 35, 90, .12); text-align: center; }
.login-brand { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 14px; background: linear-gradient(135deg, #3267e3, #7b5cff); color: #fff; font-size: 20px; font-weight: 800; display: flex; align-items: center; justify-content: center; letter-spacing: 1px; }
.login-card h1 { font-size: 22px; color: #16233f; margin: 0 0 4px; }
.login-sub { font-size: 13px; color: #8a94a6; margin: 0 0 24px; }
.login-card .field-group { text-align: left; margin-bottom: 14px; }
.login-card .field-group label { display: block; font-size: 12px; color: #6b7688; font-weight: 600; margin-bottom: 6px; }
.login-card .field-group input { width: 100%; height: 42px; border: 1px solid #e4e9f0; border-radius: 10px; padding: 0 14px; font-size: 14px; outline: none; box-sizing: border-box; background: #fafbfd; transition: border-color .15s; }
.login-card .field-group input:focus { border-color: #3267e3; background: #fff; }
.login-button { width: 100%; height: 44px; margin-top: 8px; font-size: 15px; }
.login-tip { font-size: 12px; color: #a0a9b8; margin: 14px 0 0; }
.remember-row { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12px; color: #6b7688; cursor: pointer; user-select: none; }
.remember-row input { width: 16px; height: 16px; accent-color: #3267e3; margin: 0; cursor: pointer; }
.app-version { font-size: 11px; color: #b0b9c8; margin: 16px 0 0; text-align: center; }
.user-mode .login-screen, .admin-mode .admin-gate { display: flex; }

/* 表单错误提示（登录/密码门内联红字） */
.form-error { color: #d94b4b; font-size: 13px; margin: 10px 0 0; text-align: left; background: #fff5f5; border: 1px solid #ffd9d9; border-radius: 8px; padding: 8px 12px; }

/* 会话栏 */
.session-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.session-user { font-size: 12px; color: #8a94a6; font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-bar .text-button { font-size: 12px; }

/* 用户管理 */
.danger-text { border: 0; background: transparent; color: #d94b4b; font-size: 12px; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.danger-text:hover { background: #fff0f0; }
.history-owner { font-size: 11px; color: #3267e3; background: #eaf0ff; padding: 2px 8px; border-radius: 999px; font-weight: 600; align-self: flex-start; }
.template-actions { display: inline-flex; gap: 8px; align-items: center; }
.template-actions button { border: 0; background: transparent; color: #3267e3; font-size: 12px; font-weight: 600; cursor: pointer; padding: 4px 6px; border-radius: 6px; }
.template-actions button:hover { background: #f2f6ff; }

/* @图N 引用面板 */
.mention-panel { position: fixed; z-index: 999; width: 264px; max-height: 264px; overflow-y: auto; background: #fff; border: 1px solid #e4e9f0; border-radius: 12px; box-shadow: 0 8px 28px rgba(15, 35, 90, .14); padding: 6px; }
.mention-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; text-align: left; }
.mention-item:hover { background: #f2f6ff; }
/* 键盘 ↑↓ 高亮选中项（置于 hover 之后，高亮优先于悬停色） */
.mention-item.active { background: #e3ecff; }
.mention-item.active strong { color: #1f4fd8; }
.mention-item img { width: 38px; height: 38px; object-fit: cover; border-radius: 6px; background: #f0f3f9; flex: none; }
.mention-item span { display: flex; flex-direction: column; min-width: 0; }
.mention-item strong { font-size: 12px; color: #3267e3; }
.mention-item em { font-size: 11px; color: #8a94a6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-style: normal; }
.mention-help { margin: 8px 0 0; font-size: 12px; color: #8a94a6; }
.mention-help code { background: #f0f3f9; color: #3267e3; padding: 1px 5px; border-radius: 4px; font-size: 11px; }
/* 无参考图片时 @ 面板的引导占位 */
.mention-empty { padding: 14px 12px; text-align: center; font-size: 12px; line-height: 1.7; color: #8a94a6; }
.mention-empty b { color: #3267e3; font-weight: 600; }

/* =========================================================
   RWD FIX — 全端响应式完善（桌面 / 平板 / 手机 / 超小屏）
   ========================================================= */

/* 1) 内容区：超宽屏居中、防内部溢出 */
.app-shell { min-width: 0; }

/* 2) 平板（768–1024）：触控目标放大 + 防 iOS 聚焦缩放 */
@media (min-width: 768px) and (max-width: 1024px) {
  .icon-button, .avatar { width: 40px; height: 40px; }
  .primary-button, .secondary-button, .form-footer button { height: 46px; font-size: 13px; }
  .field-group select, .number-input, .modal-grid input, .modal-grid select { height: 44px; }
  .field-group textarea, .prompt-row textarea, .prompt-input-wrap .prompt-hl, .group-urls, .group-image-urls { font-size: 16px; }
  .start-task { height: 40px; padding: 0 13px; }
  .nav-item { height: 46px; }
  .remove-group { width: 32px; height: 32px; }
  .toast { bottom: 30px; }
}

/* 3) 手机（≤767）：防横向溢出 / 防遮挡 / 触控补漏 */
@media (max-width: 767px) {
  .nav-list { scrollbar-width: none; -ms-overflow-style: none; }
  .nav-list::-webkit-scrollbar { display: none; }
  .view-heading { flex-wrap: wrap; gap: 10px; }
  .view-actions { flex-wrap: wrap; justify-content: flex-end; }
  .view-actions .secondary-button { flex: 1 1 auto; }
  .topbar h1 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .service-summary div { flex-direction: column; align-items: flex-start; gap: 3px; }
  .service-summary strong { text-align: left; }
  .modal-footer > div { width: 100%; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
  .remove-group { width: 34px; height: 34px; }
  .empty-history { padding: 56px 16px; }
  .modal-heading { gap: 12px; }
  .user-mode .user-bottom-bar { gap: 10px; }
}

/* 4) 超小屏（≤420px）：单列表单、防挤压 */
@media (max-width: 420px) {
  .settings-grid { grid-template-columns: 1fr; }
  .summary-stats { grid-template-columns: 1fr 1fr; }
  .section-tools .required-note { display: none; }
  .topbar h1 { font-size: 19px; }
  .modal-heading h2 { font-size: 17px; }
  .user-mode .section-block { padding: 14px 12px 16px; }
  .dropzone-icon { width: 30px; height: 30px; font-size: 19px; }
  .user-mode .user-bottom-bar .primary-button { font-size: 14px; }
}

/* =========================================================
   微信内置浏览器（X5/Chromium 内核）横向滑动修复
   微信 WebView 常忽略 body 级 overflow-x，且输入框/文本域
   在网格容器中的默认 min-width 会把页面撑宽
   ========================================================= */
html { overflow-x: hidden; }
#app-shell, .main-content, .workspace-grid, .form-column, .summary-column, .view { min-width: 0; max-width: 100%; }
textarea, input, select { max-width: 100%; box-sizing: border-box; }
.prompt-row textarea, .mat-image-urls, .mat-video-urls, .mat-audio-urls, #notes { width: 100%; min-width: 0; }
.chip-group { flex-wrap: wrap; }
.history-list, .template-grid, .view-heading { min-width: 0; max-width: 100%; }
.asset-grid, .view-help { min-width: 0; max-width: 100%; }
.user-bottom-bar { max-width: 100vw; }
@media (max-width: 700px) {
  .workspace-grid, .group-card, .settings-grid, .history-item, .template-card { min-width: 0; max-width: 100%; }
  .template-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   iOS 微信/Safari 横向滑动终极修复
   iOS 内核常忽略 html/body 的 overflow-x:hidden，
   clip 彻底禁止横向滚动（iOS 15.4+），并限制滚动容器本身
   ========================================================= */
html, body { overflow-x: clip; }
html, body { max-width: 100%; }
#app-shell { overflow-x: hidden; }
.view, .workspace-grid, .form-column, .main-content, .group-card { overflow-x: hidden; }

/* =========================================================
   USER MODE · 深蓝黑高级 AI 工具风（手机端）
   背景 #07101F · 卡片 #101A2D · 输入框 #0D1728
   主蓝 #3B82F6 · 蓝紫 #706BEA · 文字 #F1F5F9 / #8291A8
   ========================================================= */
.user-mode { --bg: #07101F; --surface: #101A2D; --surface-soft: #0D1728; --ink: #F1F5F9; --muted: #8291A8; --line: #283B5D; --blue: #3B82F6; --blue-dark: #2563EB; --blue-pale: rgba(59,130,246,.12); --green: #2DD4BF; --orange: #F5A524; --shadow: 0 10px 30px rgba(0,0,0,.22); }
.user-mode body, .user-mode .main-content, .user-mode .app-shell { background: #07101F; }

/* 登录页：深蓝黑 + 极淡蓝紫柔光（无网格、无扫描线） */
.user-mode .login-screen, .user-mode .admin-gate { background: radial-gradient(900px 500px at 50% -20%, rgba(59,130,246,.08), transparent 60%), #07101F; }
.user-mode .login-screen::before, .user-mode .admin-gate::before { display: none; }
/* ===== 登录卡（用户版）：单一来源，背景/毛玻璃见下方 @supports 渐进增强 ===== */
.user-mode .login-card { border: 1px solid #283B5D; border-radius: 22px; box-shadow: 0 18px 50px rgba(0,0,0,.35); padding: 60px 32px 28px; position: relative; z-index: 1; background: #101A2D; }
.user-mode .login-card::before, .user-mode .login-card::after { display: none; }
/* 登录页顶部 AI 动画（Rander）：品牌动态视觉。素材 520×520 光球只居中占约 17%。
   用负 margin 把整个动画往上提，让底部电路触角离开标题（不动卡片布局）。 */
.user-mode .login-ai { width: 52px; height: 52px; margin: -30px auto 20px; }
.user-mode .login-ai svg { width: 100% !important; height: 100% !important; transform: scale(1.7) !important; transform-origin: center; }
.user-mode .login-card h1 { color: #F1F5F9; }
/* 登录页独立粒子背景：与登录后 fx-bg 同风格（深蓝+光晕+上升粒子+底部光弧），但分布更疏、光点更大，视觉有差别。
   用 absolute 以 login-screen(fixed) 为参照铺满全屏；登录卡 z-index:1 在其上方，粒子从卡片背后透出 */
.user-mode .login-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.user-mode .lb-glow { position: absolute; border-radius: 50%; filter: blur(46px); opacity: .55; animation: lbDrift 18s ease-in-out infinite alternate; }
.user-mode .lb-glow.lg1 { width: 240px; height: 240px; left: -90px; top: 30%; background: radial-gradient(circle, rgba(59,130,246,.75), transparent 66%); }
.user-mode .lb-glow.lg2 { width: 190px; height: 190px; right: -70px; top: 6%; background: radial-gradient(circle, rgba(112,107,234,.6), transparent 66%); animation-delay: -6s; animation-name: lbDrift2; }
@keyframes lbDrift { from { transform: translate(0,0) scale(1); } to { transform: translate(46px,34px) scale(1.12); } }
@keyframes lbDrift2 { from { transform: translate(0,0) scale(1); } to { transform: translate(-38px,30px) scale(.94); } }
.user-mode .lb-arc { position: absolute; left: -30%; right: -30%; bottom: -70px; height: 200px; border-radius: 50% 50% 0 0; background: radial-gradient(ellipse at 50% 100%, rgba(59,130,246,.5), rgba(45,212,191,.2) 55%, transparent 80%); filter: blur(22px); animation: lbAur 11s ease-in-out infinite alternate; }
@keyframes lbAur { from { transform: translateX(-3%) scaleX(1); } to { transform: translateX(3%) scaleX(1.08); } }
.user-mode .lb-p { position: absolute; bottom: -10px; border-radius: 50%; opacity: 0; animation: lbUp var(--d, 8s) linear infinite; animation-delay: var(--dl, 0s); }
.user-mode .lb-p.p1 { width: 3px; height: 3px; background: #7FB0F8; box-shadow: 0 0 6px rgba(127,176,248,.9); }
.user-mode .lb-p.p2 { width: 4px; height: 4px; background: #93C5FD; box-shadow: 0 0 8px rgba(147,197,253,.95); }
.user-mode .lb-p.p3 { width: 5px; height: 5px; background: #2DD4BF; box-shadow: 0 0 10px rgba(45,212,191,.9); }
.user-mode .lb-p.p4 { width: 7px; height: 7px; background: #BFD9FF; box-shadow: 0 0 14px rgba(191,217,255,.85); filter: blur(1px); }
@keyframes lbUp { 0% { transform: translate(0,0); opacity: 0; } 10% { opacity: 1; } 80% { opacity: 1; } 100% { transform: translate(var(--dx, 22px), -110vh); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .user-mode .lb-glow, .user-mode .lb-arc, .user-mode .lb-p { animation: none; opacity: .4; }
}
.user-mode .login-sub { color: #8291A8; }
.user-mode .login-card .field-group label { color: #C7D6F0; font-weight: 600; }
/* 登录页输入框左侧图标：图标绝对定位左侧，input 左内边距让位 */
.user-mode .login-card .input-icon { position: relative; }
.user-mode .login-card .input-icon svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: #55637D; pointer-events: none; transition: color .15s; }
.user-mode .login-card .input-icon:focus-within svg { color: #7FB0F8; }
.user-mode .login-card .input-icon input { padding-left: 40px; }
.user-mode .login-card .field-group input { background: #0D1728; border-color: #283B5D; color: #F1F5F9; border-radius: 12px; }
.user-mode .login-card .field-group input:focus { border-color: #3B82F6; background: #0D1728; }
.user-mode .login-card .field-group input::placeholder { color: #55637D; }
.user-mode .login-button { background: linear-gradient(135deg, #3B82F6, #706BEA); color: #fff; border-radius: 14px; height: 48px; box-shadow: 0 6px 20px rgba(59,130,246,.25); }
.user-mode .form-error { background: rgba(224,96,96,.1); border-color: rgba(224,96,96,.35); color: #F09090; }
.user-mode .remember-row { color: #8291A8; }

/* 侧边栏（移动端隐藏，桌面端也统一深色） */
.user-mode .sidebar { background: #0A1322; border-right: 1px solid #1C2B47; }
.user-mode .brand-mark { background: linear-gradient(135deg, #3B82F6, #706BEA); color: #fff; border-radius: 12px; }
.user-mode .brand-copy strong { color: #F1F5F9; }
.user-mode .brand-copy span { color: #7A87A1; }
.user-mode .nav-item { color: #8291A8; }
.user-mode .nav-item.active { color: #3B82F6; background: rgba(59,130,246,.1); box-shadow: inset 2px 0 0 #3B82F6; }
.user-mode .mode-pill { background: rgba(59,130,246,.1); color: #3B82F6; }
.user-mode .session-user { color: #8291A8; }
.user-mode .mode-switch { color: #3B82F6; }
.user-mode .storage-meter small { color: #7A87A1; }
.user-mode .storage-line span { color: #7A87A1; }
.user-mode .storage-line strong { color: #F1F5F9; }
.user-mode .meter i { background: #3B82F6; }

/* 顶栏 */
.user-mode .topbar { padding-left: 2px; }
.user-mode .topbar h1 { color: #F1F5F9; font-size: 26px; font-weight: 600; }
.user-mode .topbar-sub { color: #8291A8; font-size: 13px; margin-top: 4px; white-space: nowrap; }
.user-mode .date-chip { background: #101A2D; border-color: #283B5D; color: #8291A8; }
.user-mode .icon-button { background: #101A2D; border-color: #283B5D; color: #8291A8; }
.user-mode .avatar { background: linear-gradient(135deg, #3B82F6, #706BEA); color: #fff; }
.user-mode .eyebrow { color: #3B82F6; }

/* 卡片统一：描边 #283B5D · 圆角 20-22px · 无厚重阴影（背景由下方「玻璃拟态」小节统一接管） */
.user-mode .section-block { border-bottom: 1px solid transparent; border: 1px solid #283B5D; border-radius: 20px; }
.user-mode .group-card, .user-mode .history-item, .user-mode .template-card, .user-mode .asset-card, .user-mode .summary-card, .user-mode .settings-modal { border: 1px solid #283B5D; border-radius: 20px; box-shadow: none; }
.user-mode .settings-modal { background: #101A2D; }
.user-mode .section-index { color: #3B82F6; font-family: Consolas, monospace; font-size: 13px; font-weight: 600; }
.user-mode .section-heading h2, .user-mode .view-heading h2, .user-mode .view-heading h2 { color: #F1F5F9; font-weight: 600; }
.user-mode .required-note, .user-mode .section-help, .user-mode .field-group label, .user-mode .group-prompt-label, .user-mode .label-row span, .user-mode .label-row label { color: #8291A8; }
.user-mode .model-capability { color: #3B82F6; background: rgba(59,130,246,.08); border-color: #283B5D; }

/* 输入框 */
.user-mode input, .user-mode textarea, .user-mode select { background: #0D1728; border-color: #283B5D; color: #F1F5F9; border-radius: 12px; }
.user-mode input:focus, .user-mode textarea:focus, .user-mode select:focus { border-color: #3B82F6; background: #0D1728; box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.user-mode input::placeholder, .user-mode textarea::placeholder { color: #55637D; }
.user-mode .number-input { background: #0D1728; border-color: #283B5D; border-radius: 12px; }
.user-mode .number-input input { background: transparent; }
.user-mode .stepper { border: 1px solid #283B5D; border-radius: 12px; background: #0D1728; }
.user-mode .stepper button { background: transparent; border: 0; color: #3B82F6; font-size: 18px; }
.user-mode .stepper-value input { background: transparent; }
.user-mode .setting-readonly { color: #7A87A1; }
.user-mode .prompt-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.user-mode .prompt-body textarea { width: 100%; }
.user-mode .prompt-row-tools { display: flex; justify-content: flex-end; }
.user-mode .row-template-select:focus { border-color: #3B82F6; box-shadow: 0 0 0 3px rgba(59,130,246,.12); }
.user-mode select option { background: #0D1728; color: #F1F5F9; }

/* 按钮 */
.user-mode .primary-button { background: linear-gradient(135deg, #3B82F6, #706BEA); color: #fff; border-radius: 14px; box-shadow: 0 6px 18px rgba(59,130,246,.22); }
.user-mode .secondary-button { background: #101A2D; border: 1px solid #3D5A8F; color: #3B82F6; border-radius: 12px; }
.user-mode .text-button { color: #3B82F6; }
.user-mode .upload-button { background: rgba(59,130,246,.08); border: 1px solid #3D5A8F; color: #3B82F6; border-radius: 10px; }
.user-mode .start-task { background: rgba(59,130,246,.08); border: 1px solid #3D5A8F; color: #3B82F6; border-radius: 10px; padding: 8px 14px; font-size: 13px; display: inline-flex; align-items: center; flex: 0 0 auto; white-space: nowrap; }

/* 底部提交大按钮 */
.user-mode .user-bottom-bar { background: rgba(10, 19, 34, .96); border-top: 1px solid #1C2B47; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
.user-mode .bottom-hint { color: #8291A8; }
.user-mode .user-bottom-bar .primary-button { height: 56px; border-radius: 16px; font-size: 16px; font-weight: 600; }

/* AI 动画（Sparkles 星光循环）常驻右上角：正方形容器等比缩放不挤压不变形；装饰性元素不拦截点击。
   尺寸断点：桌面 104px / 平板 84px / 手机 72px（topbar 同步让位，不遮挡操作按钮） */
.ai-rander { position: fixed; top: 10px; right: 10px; z-index: 15; width: var(--rander-size, 84px); height: var(--rander-size, 84px); pointer-events: none; opacity: .92; }
.ai-rander svg { width: 100%; height: 100%; }
@media (min-width: 1024px) { .ai-rander { --rander-size: 104px; } .user-mode .topbar { padding-right: 120px; } }
@media (min-width: 768px) and (max-width: 1023px) { .ai-rander { --rander-size: 84px; } .user-mode .topbar { padding-right: 100px; } }
@media (max-width: 767px) { .ai-rander { --rander-size: 72px; } .user-mode .topbar { padding-right: 88px; } }

/* 导航切换左右滑动动画：切到右侧导航 → 旧视图向左滑出、新视图从右滑入；切回左侧反向。
   纯 transform/opacity 驱动，不触发重排，低端机流畅；240ms 干脆不拖沓 */
.view.slide-out-left, .view.slide-out-right { position: absolute; inset: 0; z-index: 1; animation-duration: .24s; animation-timing-function: ease; animation-fill-mode: both; }
.view.slide-out-left { animation-name: viewOutLeft; }
.view.slide-out-right { animation-name: viewOutRight; }
.view.slide-in-right { animation: viewInRight .24s ease both; }
.view.slide-in-left { animation: viewInLeft .24s ease both; }
@keyframes viewInRight { from { transform: translateX(36px); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes viewInLeft { from { transform: translateX(-36px); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes viewOutLeft { to { transform: translateX(-36px); opacity: 0; } }
@keyframes viewOutRight { to { transform: translateX(36px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .view.slide-out-left, .view.slide-out-right, .view.slide-in-right, .view.slide-in-left { animation: none; }
}

/* 「开始全部任务」底栏：与提交制作同款固定底栏；左边两行统计（任务数/视频数）+ 右侧主按钮 */
.user-mode .start-all-bar { display: none; }
.user-mode .user-bottom-bar.history-mode .bottom-hint,
.user-mode .user-bottom-bar.history-mode #save-bottom { display: none; }
.user-mode .user-bottom-bar.history-mode .start-all-bar {
  display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0;
}
.user-mode .start-all-stats { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.user-mode .sa-line { font-size: 12px; color: #8291A8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-mode .sa-line em { font-style: normal; color: #3B82F6; font-weight: 700; font-size: 15px; }
.user-mode .user-bottom-bar.history-mode .primary-button { flex: 0 0 auto; max-width: 170px; }

/* chip：选中仅蓝色描边 + 淡蓝背景，不高亮 */
.user-mode .chip { border: 1px solid #283B5D; color: #8291A8; background: transparent; border-radius: 999px; padding: 7px 14px; font-size: 12px; }
.user-mode .dropzone .upload-button { margin-top: 4px; }
.user-mode .media-upload-row { color: #8291A8; background: #0D1728; border-color: #283B5D; border-radius: 12px; }

/* 历史任务 */
.user-mode .history-topic { color: #F1F5F9; }
.user-mode .history-owner { background: rgba(112,107,234,.14); color: #A5A1F5; align-self: flex-start; border-radius: 999px; padding: 3px 10px; font-size: 12px; width: fit-content; }
.user-mode .progress-mark { color: #3B82F6; }
.user-mode .danger-text { color: #E06060; border: 1px solid rgba(224,96,96,.35); background: rgba(224,96,96,.08); border-radius: 10px; padding: 8px 14px; font-size: 13px; display: inline-flex; align-items: center; flex: 0 0 auto; }

/* 素材库中心（深蓝黑）：信息行叠加在图片底部，卡片本身即图片（无独立内边距） */
/* 素材库顶部工具条：不再显示大标题，只留「添加素材」/「显示隐藏」按钮，右对齐紧凑排版 */
.asset-view-heading .asset-toolbar { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.user-mode .asset-view-heading { margin-bottom: 14px; }
.admin-mode .asset-view-heading { margin-bottom: 18px; }
/* 素材库「公共/个人」分段切换器。基座 = 管理端浅色（深色旧值已删，用户端深色走 .user-mode） */
.asset-seg { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border: 1px solid #dde5f0; border-radius: 10px; background: #fff; box-shadow: 0 2px 10px rgba(23,34,49,.06); }
.asset-seg .seg-item { position: relative; min-width: 64px; height: 32px; padding: 0 16px; border: 0; border-radius: 8px; background: transparent; color: #718096; font-size: 13px; font-weight: 600; cursor: pointer; transition: color .18s ease, background .18s ease, box-shadow .18s ease; }
.asset-seg .seg-item:hover { color: #3267e3; background: #f0f5ff; }
.asset-seg .seg-item.active { background: linear-gradient(135deg, #3267e3, #2b57c8); color: #fff; box-shadow: 0 2px 8px rgba(50,103,227,.3); }
/* 用户端（深色驾驶舱）素材库分段切换器 */
.user-mode .asset-seg { background: #0D1728; border-color: #283B5D; box-shadow: none; }
.user-mode .asset-seg .seg-item { color: #8291A8; }
.user-mode .asset-seg .seg-item:hover { color: #C6D4EA; background: rgba(59,130,246,.1); }
.user-mode .asset-seg .seg-item.active { background: linear-gradient(135deg, #3B82F6, #706BEA); color: #fff; box-shadow: 0 2px 8px rgba(59,130,246,.35); }
/* 管理端「素材库显示/隐藏」开关按钮（浅色） */
.toggle-button { height: 34px; padding: 0 14px; border: 1px solid #c8d6ec; border-radius: 8px; background: #f4f8ff; color: #3267e3; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .18s ease, border-color .18s ease, color .18s ease; }
.toggle-button:hover { background: #e8f0ff; border-color: #3267e3; }
.toggle-button.off { background: #fff5f5; border-color: #f3c1c1; color: #d94b4b; }
.toggle-button.off:hover { background: #ffecec; border-color: #d94b4b; }
.user-mode .asset-card { border: 1px solid #283B5D; border-radius: 16px; padding: 0; overflow: hidden; background: transparent; }
.user-mode .asset-thumb { background: #0D1728; border: none; border-radius: 0; }
.user-mode .asset-ph { color: #55637D; background: #0D1728; }
.user-mode .asset-actions button { color: #EAF1FF; }
.user-mode .asset-actions button:hover { background: rgba(255,255,255,.16); }
.user-mode .asset-actions .danger-text { color: #FFB3BD; border: 1px solid rgba(224,96,96,.4); background: rgba(224,96,96,.18); border-radius: 8px; padding: 5px 11px; font-size: 12px; display: inline-flex; align-items: center; }
/* 手机端素材库：卡片=图片（单一圆角框，无框套框）。asset-card 作唯一圆角容器+裁切，
   内部图片铺满、信息行叠加底部；不再有"图片外的第二层卡片边框/内边距"。 */
@media (max-width: 700px) {
  .user-mode .asset-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .user-mode .asset-card { border: 0; border-radius: 14px; padding: 0; background: transparent; box-shadow: none; overflow: hidden; }
  .user-mode .asset-thumb { border: none; border-radius: 0; }
}

/* 状态胶囊（低饱和） */
.user-mode .history-status { color: #2DD4BF; }
.user-mode .history-status.running { gap: 8px; }

/* 生成中：百分比进度条 */
.history-progress { margin: 10px 0 4px; width: 100%; height: 6px; border-radius: 999px; background: #1B2A47; overflow: hidden; }
.history-progress-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #3B82F6, #60A5FA); box-shadow: 0 0 8px rgba(59,130,246,.55); transition: width .6s ease; position: relative; }
.history-progress-fill::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); animation: progressSheen 1.4s linear infinite; }
@keyframes progressSheen { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.history-progress-tip { font-size: 11px; color: #7A87A1; margin: 2px 0 0; }

/* 三段式分区布局 */
.user-mode .history-topic { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.6; font-size: 15px; color: #F1F5F9; width: 100%; }
.user-mode .history-bottom { display: flex; align-items: center; justify-content: flex-start; gap: 10px; padding-top: 12px; border-top: 1px solid #1E2E4A; flex-wrap: wrap; }
.user-mode .history-action { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; text-align: left; }
.user-mode .history-action .danger-text, .user-mode .history-item > .danger-text { margin-left: auto; }
.user-mode .completed-mark, .user-mode .progress-mark { font-size: 13px; margin-right: 4px; }

/* 任务卡片：规格指标格（模型/条数/时长/画质或成本） */
.user-mode .his-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin-top: 12px; width: 100%; }
.user-mode .his-metric { background: #0D1728; border: 1px solid #1E2E4A; border-radius: 10px; padding: 7px 10px; min-width: 0; }
.user-mode .his-metric-value { display: block; font-size: 13px; font-weight: 500; color: #F1F5F9; margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 失败原因条 */
.user-mode .his-error { font-size: 12px; color: #F5A524; line-height: 1.5; margin: 10px 0 0; padding: 8px 10px; background: rgba(232,167,92,.08); border-left: 2px solid #F5A524; border-radius: 6px; width: 100%; box-sizing: border-box; }

/* 顶栏日期 */
.user-mode .batch-id-wrap { display: inline-flex; align-items: baseline; gap: 10px; min-width: 0; }
.user-mode .batch-date { color: #7A87A1; font-family: var(--font-sans); font-size: 11px; font-weight: 400; letter-spacing: .2px; white-space: nowrap; }
.user-mode .template-owner { background: rgba(112,107,234,.14); color: #A5A1F5; }

/* 弹窗与面板 */
.user-mode .modal-backdrop { background: rgba(4, 9, 18, .7); }
.user-mode .modal-heading h2 { color: #F1F5F9; }
.user-mode .modal-subtitle { color: #8291A8; }
.user-mode .modal-note { color: #7A87A1; }
.user-mode .service-summary { background: #0D1728; border-color: #283B5D; }
.user-mode .service-summary span { color: #8291A8; }
.user-mode .service-summary strong { color: #3B82F6; }
.user-mode .field-hint { color: #7A87A1; }
.user-mode .close-button { color: #8291A8; }
.user-mode .mention-panel { background: #101A2D; border: 1px solid #283B5D; border-radius: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.4); }
.user-mode .mention-item strong { color: #3B82F6; }
.user-mode .mention-item:hover { background: rgba(59,130,246,.07); }
.user-mode .mention-item.active { background: rgba(59,130,246,.18); }
.user-mode .mention-item.active strong { color: #60A5FA; }
.user-mode .mention-item em { color: #7A87A1; }
.user-mode .mention-empty { color: #7A87A1; }
.user-mode .mention-empty b { color: #3B82F6; }

/* 提示 / 其他 */
.user-mode .toast { background: #101A2D; border: 1px solid #3D5A8F; color: #F1F5F9; box-shadow: 0 10px 30px rgba(0,0,0,.4); border-radius: 12px; }
.user-mode .empty-history { color: #7A87A1; border-color: #283B5D; background: rgba(16,26,45,.4); }
.user-mode .tip-card { background: rgba(232,167,92,.05); border-left-color: #F5A524; }
.user-mode .tip-card strong { color: #F5A524; }
.user-mode .tip-card p { color: #A08C63; }
.user-mode .tip-icon { border-color: #F5A524; color: #F5A524; }
.user-mode .estimate-box { background: rgba(59,130,246,.05); }
.user-mode .estimate-box span { color: #8291A8; }
.user-mode .estimate-box strong { color: #3B82F6; }
.user-mode .status-dot { color: #2DD4BF; }
.user-mode .status-dot::before { background: #2DD4BF; }
.user-mode .key-status { color: #8291A8; }
.user-mode .link-button { color: #3B82F6; }

/* 模板选择浮层 */
.template-picker { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1200; background: #101A2D; border: 1px solid #283B5D; border-radius: 20px 20px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); max-height: 60vh; overflow-y: auto; box-shadow: 0 -12px 40px rgba(0,0,0,.4); }
.template-picker[hidden] { display: none; }
.template-picker-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.template-picker-head strong { color: #F1F5F9; font-size: 15px; }
.template-picker-close { background: transparent; border: 0; color: #8291A8; font-size: 20px; padding: 4px 8px; }
.template-picker-item { display: flex; flex-direction: column; gap: 4px; width: 100%; text-align: left; background: #0D1728; border: 1px solid #283B5D; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer; }
.template-picker-item:active { border-color: #3B82F6; }
.template-picker-item strong { color: #F1F5F9; font-size: 13px; }
.template-picker-item span { color: #8291A8; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 模板时长标记：卡片页脚与浮层条目共用「Ns」胶囊样式 */
.template-duration { display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 999px; background: #eef3ff; color: #3267e3; font-size: 10px; }
.user-mode .template-duration { background: rgba(59, 130, 246, .16); color: #85B7EB; }
.template-picker-duration { margin-left: 6px; padding: 1px 6px; border-radius: 999px; background: rgba(59, 130, 246, .18); color: #85B7EB; font-size: 10px; font-style: normal; }
.user-mode .full-width-field { grid-column: 1 / -1; }

/* 新建页「素材库」选择浮层：底部弹起的抽屉（Bottom Sheet）
   结构：全屏容器(遮罩+抽屉) → 抽屉内 标题栏固定 + 图片网格唯一可滚区
   动画：transform/opacity（GPU 友好，不触发重排），管理端浅色 */
.asset-picker { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: flex-end; background: rgba(23, 34, 49, .42); opacity: 0; transition: opacity .24s ease; }
.asset-picker[hidden] { display: none; }
/* 全屏遮罩：点击收起 */
.asset-picker-mask { position: absolute; inset: 0; cursor: pointer; }
/* 底部抽屉：占屏约 2/3，内部图片区滚动，上下滑入动画 */
.asset-picker-sheet {
  position: relative;
  width: 100%;
  height: 66vh;
  max-height: 66vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -10px 30px rgba(23, 34, 49, .12);
  transform: translateY(100%);
  transition: transform .26s cubic-bezier(.22, 1, .36, 1);
}
/* 打开态：遮罩淡入、抽屉滑入到位 */
.asset-picker:not(.opening):not(.closing) { opacity: 1; }
.asset-picker:not(.opening):not(.closing) .asset-picker-sheet { transform: translateY(0); }
/* 初始态（.opening，刚打开）：遮罩透明、抽屉在下方，用于触发过渡动画 */
.asset-picker.opening { opacity: 0; }
.asset-picker.opening .asset-picker-sheet { transform: translateY(100%); }
/* 关闭态：反向 */
.asset-picker.closing { opacity: 0; }
.asset-picker.closing .asset-picker-sheet { transform: translateY(100%); }
/* 标题栏：固定，不随图片滚动 */
.asset-picker-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid #eef2f8;
}
.asset-picker-head strong { color: #172231; font-size: 15px; font-weight: 700; }
.asset-picker-close { background: transparent; border: 0; color: #8a94a6; font-size: 20px; padding: 4px 8px; cursor: pointer; }
.asset-picker-close:hover { color: #45566c; }
/* 分类切换条：固定，不随图片滚动（复用 .asset-seg 视觉，仅补外层间距） */
.asset-picker-filter { flex: 0 0 auto; padding: 12px 18px 0; }
/* 图片网格：唯一可滚动区；auto-fill 自适应列数，minmax 保证大方块，减轻小图堆叠 */
.asset-picker-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px 18px calc(20px + env(safe-area-inset-bottom)); }
.asset-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  grid-auto-rows: min-content;
  gap: 12px;
}
/* 图片项：固定正方形（padding-bottom 撑高，避免 aspect-ratio 在 flex/grid 下失效） */
.asset-picker-item {
  position: relative;
  width: 100%;
  padding: 0;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e9eef6;
  background: #fbfcfe;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease;
}
.asset-picker-item::before { content: ""; display: block; padding-bottom: 100%; } /* 撑出正方形 */
.asset-picker-item img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.asset-picker-item:hover { border-color: #7d9bf2; transform: scale(.98); }
.asset-picker-item:active { border-color: #3267e3; }
.asset-picker-empty { color: #8a94a6; font-size: 12px; text-align: center; padding: 24px 12px; }
@media (max-width: 1024px) {
  .asset-picker-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}
@media (max-width: 480px) {
  .asset-picker-grid { grid-template-columns: repeat(2, 1fr); }
  .asset-picker-body { padding-left: 14px; padding-right: 14px; }
  .asset-picker-filter { padding-left: 14px; padding-right: 14px; }
}
/* 用户版：素材库浮层保留深色驾驶舱风格 */
.user-mode .asset-picker { background: rgba(7, 16, 31, .55); }
.user-mode .asset-picker-sheet { background: #101A2D; border: 1px solid #283B5D; box-shadow: 0 -10px 30px rgba(0, 0, 0, .3); }
.user-mode .asset-picker-head { border-bottom-color: #283B5D; }
.user-mode .asset-picker-head strong { color: #F1F5F9; }
.user-mode .asset-picker-close { color: #8291A8; }
.user-mode .asset-picker-item { border-color: #283B5D; background: #0D1728; }
.user-mode .asset-picker-item:hover { border-color: #3B82F6; }
.user-mode .asset-picker-item:active { border-color: #3B82F6; }
.user-mode .asset-picker-empty { color: #8291A8; }
/* 「素材库」加图按钮：与「加图」完全同款——同尺寸/同图标字号/同配色，保持视觉平衡 */
.ref-lib { position: relative; width: 58px; height: 58px; border-radius: 10px; border: 1.5px dashed #3D5A8F; background: rgba(59,130,246,.05); color: #3B82F6; font-size: 19px; cursor: pointer; flex: 0 0 auto; transition: background .2s, border .2s; }
.ref-lib:hover { background: rgba(59,130,246,.13); border-color: #3B82F6; }
.ref-lib span { position: absolute; bottom: 5px; left: 0; right: 0; text-align: center; font-size: 9px; opacity: .85; }
/* 空状态（无参考图）：素材库按钮切换为横条形态，与「上传参考图」等宽并排，保持平衡 */
.user-mode .ref-gallery.empty .ref-lib {
  width: auto; height: auto; min-height: 56px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 14px; font-size: 17px; color: #7FB0F8;
}
.user-mode .ref-gallery.empty .ref-lib span {
  position: static; font-size: 12px; font-weight: 500; opacity: 1; color: #F1F5F9;
}

/* =========================================================
   手机端精致化：紧凑 Tab / 压缩标题区 / 精简提示词卡 / 缩小小操作栏
   ========================================================= */
.user-mode .topbar { margin-bottom: 12px; }
.user-mode .topbar h1 { font-size: 22px; margin: 0; }
.user-mode .topbar-sub { margin-top: 2px; }

/* 移动端紧凑 Tab（替代大导航） */
@media (max-width: 700px) {
  .user-mode .sidebar { display: none; }
  .user-mode .mobile-tabs { display: flex; gap: 4px; margin-bottom: 14px; }
  .user-mode .mobile-tab { flex: 1; background: transparent; border: 0; color: #8291A8; font-size: 13px; padding: 8px 0; border-bottom: 2px solid transparent; border-radius: 0; }
  .user-mode .mobile-tab.active { color: #F1F5F9; border-bottom-color: #3B82F6; font-weight: 500; }
  .user-mode .main-content { padding-top: 18px; }
}
/* 桌面端隐藏移动端 Tab（桌面用侧边栏）；移动端由上方 @media (max-width:700px) 控制 display:flex */
@media (min-width: 701px) {
  .user-mode .mobile-tabs { display: none; }
}

/* 提示词卡精简 */
.user-mode .intro-block .section-heading { margin-bottom: 10px; }
.user-mode .prompt-tools { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
.user-mode .prompt-tools .text-button { font-size: 13px; }
.user-mode .tool-button { flex: 1; justify-content: center; height: 44px; padding: 0 12px; border: 1px solid #3D5A8F; border-radius: 12px; background: #0D1728; color: #F1F5F9; font-weight: 500; }
.user-mode .tool-button:hover { border-color: #3B82F6; background: #16233C; color: #F1F5F9; }
.user-mode .tool-button:active { background: #101A2D; }
.user-mode .tool-button .tool-icon { color: #3B82F6; font-size: 16px; font-weight: 600; line-height: 1; }
.user-mode .intro-block .field-group { margin-bottom: 0; }
.user-mode .section-block { padding-bottom: 20px; margin-bottom: 16px; }

/* 底部操作栏：紧凑，避免遮挡 */
.user-mode .user-bottom-bar { padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); align-items: center; }
.user-mode .user-bottom-bar .primary-button { height: 46px; border-radius: 14px; font-size: 15px; flex: 1; max-width: 220px; }
.user-mode .bottom-hint { flex: 1; }
.user-mode .history-item, .user-mode .template-card { border-radius: 18px; }
.user-mode .view-heading { margin-bottom: 16px; }
.user-mode .view-heading h2 { font-size: 20px; }

/* 表单白底终极修复：下拉选项列表 + 浏览器自动填充 */
.user-mode select option { background: #0D1728; color: #F1F5F9; }
.user-mode input:-webkit-autofill, .user-mode textarea:-webkit-autofill, .user-mode select:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 1000px #0D1728 inset !important;
  -webkit-text-fill-color: #F1F5F9 !important;
  caret-color: #F1F5F9;
  transition: background-color 9999s ease-in-out 0s;
}
.user-mode input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 1000px #0D1728 inset !important; }

/* ===== 参考素材·缩略图画廊（去掉大上传框，参考图可删除）===== */
.user-mode .ref-gallery { display: flex; flex-wrap: wrap; gap: 10px; }
.user-mode .ref-gallery.empty { gap: 10px; }
.user-mode .ref-gallery.empty .ref-empty,
.user-mode .ref-gallery.empty .ref-lib { flex: 1; min-width: 0; }
.user-mode .ref-tile { position: relative; width: 58px; height: 58px; overflow: visible; border-radius: 10px; background: #16233C; border: 1px solid #283B5D; flex: 0 0 auto; }
.user-mode .ref-tile img { width: 100%; height: 100%; object-fit: cover; border-radius: 9px; display: block; background: #16233C; }
.user-mode .ref-tile .ref-idx { position: absolute; left: 3px; bottom: 3px; font-size: 10px; color: #fff; background: rgba(7,14,28,.74); padding: 1px 5px; border-radius: 5px; pointer-events: none; }
.user-mode .ref-del { position: absolute; top: -7px; right: -7px; width: 19px; height: 19px; border-radius: 50%; background: #E5484D; color: #fff; border: 1.5px solid #0F1A2E; font-size: 13px; line-height: 16px; text-align: center; cursor: pointer; padding: 0; }
.user-mode .ref-del:hover { background: #FF6B6B; }
.user-mode .ref-add { position: relative; width: 58px; height: 58px; border-radius: 10px; border: 1.5px dashed #3D5A8F; background: rgba(59,130,246,.05); color: #3B82F6; font-size: 19px; cursor: pointer; flex: 0 0 auto; transition: background .2s, border .2s; }
.user-mode .ref-add:hover { background: rgba(59,130,246,.13); border-color: #3B82F6; }
.user-mode .ref-add span { position: absolute; bottom: 5px; left: 0; right: 0; text-align: center; font-size: 9px; opacity: .85; }
.user-mode .ref-full { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 10px; color: #8291A8; border: 1px dashed #283B5D; font-size: 10px; background: rgba(8,18,34,.4); text-align: center; flex: 0 0 auto; }
.user-mode .ref-empty { display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: 10px; width: auto; max-width: 100%; min-height: 54px; border: 1.5px dashed #3D5A8F; border-radius: 10px; background: rgba(59,130,246,.05); color: #8291A8; cursor: pointer; padding: 9px 14px; transition: background .2s, border .2s; }
.user-mode .ref-empty:hover { background: rgba(59,130,246,.11); border-color: #3B82F6; }
.user-mode .ref-empty-ic { width: 32px; height: 32px; border-radius: 9px; background: rgba(59,130,246,.13); color: #3B82F6; display: grid; place-items: center; font-size: 18px; flex: 0 0 auto; }
.user-mode .ref-empty-txt { font-size: 12px; font-weight: 500; color: #F1F5F9; line-height: 1.4; }
.user-mode .ref-empty-txt em { font-style: normal; font-size: 11px; color: #8291A8; font-weight: 400; margin-left: 7px; }
.user-mode .ref-gallery.dragging { outline: 1.5px dashed #3B82F6; outline-offset: 4px; border-radius: 12px; }

/* =========================================================
   「我的任务」深蓝黑高级科技风（仅用户版/移动端）
   主色 #3B82F6 · 成功 #2DD4BF · 危险 #FB5A72
   文字 #F1F5F9 / #8291A8 · 背景 #07101F → #0B1628
   ========================================================= */

/* 全局背景渐变 + 文字色 */
body.user-mode {
  background: linear-gradient(180deg, #07101F 0%, #0B1628 100%);
  background-attachment: fixed;
  color: #F1F5F9;
}
.user-mode .main-content { background: transparent; }

/* 顶部：我的任务 / 管理你的生成记录与下载 */
.user-mode .topbar h1 { color: #F1F5F9; }
.user-mode .topbar-sub { color: #8291A8; }

/* Tab：蓝色短下划线 */
@media (max-width: 700px) {
  .user-mode .mobile-tab { position: relative; border-bottom: 0; padding: 9px 0 10px; color: #8291A8; }
  .user-mode .mobile-tab::after { content: ''; position: absolute; left: 50%; bottom: 0; width: 0; height: 2px; border-radius: 2px; background: #3B82F6; transform: translateX(-50%); transition: width .2s ease; }
  .user-mode .mobile-tab.active { color: #F1F5F9; font-weight: 600; }
  .user-mode .mobile-tab.active::after { width: 22px; }
  .user-mode .main-content { padding: 18px 16px 96px; }
}

/* 任务卡片（新版封面卡样式见 styles.css 20260907 段） */


/* 空状态 */
.user-mode .empty-history { border-radius: 20px; border: 1px dashed rgba(59, 130, 246, .25); background: rgba(16, 26, 45, .35); color: #8291A8; }

/* =========================================================
   新建视频页：高级 AI 生成工具风（图标分区 / 大输入区 / 去文字噪音）
   ========================================================= */

/* 分区标题：图标 + 标题，去掉旧圆点 */
.user-mode .section-heading h2::before { display: none; }
.user-mode .section-heading h2 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: #F1F5F9; margin: 0; }
.user-mode .sec-ico { width: 18px; height: 18px; flex: 0 0 auto; color: #3B82F6; }
.user-mode .section-heading { margin-bottom: 12px; }
.user-mode .section-block { padding: 18px 16px 20px; margin-bottom: 14px; border-radius: 20px; }

/* 提示词：大输入区 + 圆形序号 */
.user-mode .prompt-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.user-mode .prompt-body { flex: 1; min-width: 0; }
.user-mode .prompt-index {
  width: 24px; height: 24px; flex: 0 0 auto; margin-top: 16px;
  border-radius: 50%; background: rgba(59, 130, 246, .14);
  border: 1px solid rgba(59, 130, 246, .32); color: #7FB0F8;
  font-size: 12px; font-weight: 600; display: grid; place-items: center; line-height: 1;
}
.user-mode .prompt-row textarea, .user-mode .prompt-input-wrap .prompt-hl {
  padding: 14px 16px; font-size: 14.5px; line-height: 1.75;
  white-space: pre-wrap; word-break: break-word; overflow-wrap: break-word;
}
.user-mode .prompt-row textarea {
  min-height: 170px; border-radius: 16px;
  background: #0A1526; border: 1px solid #1E3555; color: #F1F5F9;
}
.user-mode .prompt-row textarea:focus { border-color: #3B82F6; background: #0A1526; box-shadow: 0 0 0 3px rgba(59, 130, 246, .14); }
.user-mode .prompt-row textarea::placeholder { color: #55637D; }
.user-mode .prompt-hl .hl-ref { background: rgba(59, 130, 246, .18); border-bottom-color: rgba(96, 165, 250, .6); }
.user-mode .prompt-row-tools { margin-top: 8px; }
.user-mode .row-template-select { height: 34px; padding: 0 12px; border-radius: 10px; background: #0F1C33; border: 1px solid #1E3555; color: #8CA3C8; font-size: 12px; }
.user-mode .remove-prompt-row { margin-top: 16px; }

/* 提示词工具按钮：紧凑双按钮 */
.user-mode .prompt-tools { display: flex; gap: 10px; margin-top: 2px; }
.user-mode .prompt-tools .tool-button { height: 40px; border-radius: 12px; background: #0F1C33; border: 1px solid #1E3555; color: #C6D4EA; font-size: 13px; font-weight: 500; }
.user-mode .prompt-tools .tool-button:hover { border-color: #3B82F6; background: #16263F; color: #F1F5F9; }
.user-mode .prompt-tools .tool-icon { color: #3B82F6; font-size: 15px; }

/* 素材卡 */
.user-mode .group-card { background: #0A1526; border: 1px solid #1E3555; border-radius: 16px; padding: 16px; }
.user-mode .ref-empty { min-height: 56px; border-color: #24406B; background: rgba(59, 130, 246, .05); }
.user-mode .ref-empty:hover { background: rgba(59, 130, 246, .1); border-color: #3B82F6; }
.user-mode .ref-empty-ic { width: 38px; height: 38px; border-radius: 12px; background: rgba(59, 130, 246, .12); color: #3B82F6; font-size: 19px; }
.user-mode .ref-empty-txt { font-size: 13px; }
.user-mode .ref-empty-txt em { display: none; }
.user-mode .mat-toggle {
  margin-top: 12px; border-radius: 12px; background: #0F1C33; border: 1px solid #1E3555;
  color: #C6D4EA; font-size: 12.5px; padding: 11px 12px; width: 100%;
}
.user-mode .mat-toggle:hover { border-color: #3B82F6; background: #16263F; }
.user-mode .mat-toggle em { color: #5F6F8A; font-size: 11px; }
.user-mode .mat-toggle-icon { color: #3B82F6; font-size: 14px; }
.user-mode .media-upload-row { border-radius: 12px; background: #0F1C33; border-color: #1E3555; }
.user-mode .mention-help { color: #5F6F8A; font-size: 11.5px; margin: 10px 2px 0; }
.user-mode .mention-help code { background: rgba(59, 130, 246, .12); color: #7FB0F8; padding: 1px 6px; border-radius: 6px; }

/* 画面设置：紧凑 chips */
.user-mode .user-settings { gap: 12px; }
.user-mode .settings-block .field-group { margin-bottom: 0; }
.user-mode .settings-block .field-group label { font-size: 11px; letter-spacing: .4px; color: #8291A8; font-weight: 500; }
.user-mode .stepper { height: 44px; border-radius: 12px; background: #0A1526; border-color: #1E3555; }
.user-mode .chip-group { gap: 8px; }
.user-mode .chip { padding: 8px 14px; font-size: 12.5px; border-radius: 999px; }

/* 提示词行：模板选择占满整行 */
.user-mode .prompt-row-tools { margin-top: 8px; }
.user-mode .row-template-select {
  width: 100%; max-width: none; height: 36px; padding: 0 12px;
  font-size: 12px; border-radius: 10px; background: #0F1C33;
  border: 1px solid #1E3555; color: #8CA3C8; cursor: pointer;
}

/* 参考视频/音频折叠按钮：说明文字独立一行，不挤压主文字 */
.user-mode .mat-toggle { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 8px; }
.user-mode .mat-toggle em { order: 3; width: 100%; padding-left: 22px; font-size: 11px; line-height: 1.5; }

/* 粒子流背景：全屏发光粒子上升 + 底部光弧 + 氛围光晕（仅用户端；纯 transform/opacity 动画，GPU 合成，抗内容遮挡） */
.user-mode .fx-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.user-mode .pt-glow { position: absolute; border-radius: 50%; filter: blur(40px); opacity: .5; }
.user-mode .pt-glow.g1 { width: 190px; height: 190px; left: -70px; top: 38%; background: radial-gradient(circle, rgba(59, 130, 246, .8), transparent 66%); animation: ptDrift 17s ease-in-out infinite alternate; }
.user-mode .pt-glow.g2 { width: 150px; height: 150px; right: -50px; top: 8%; background: radial-gradient(circle, rgba(112, 107, 234, .6), transparent 66%); animation: ptDrift2 22s ease-in-out infinite alternate; }
@keyframes ptDrift { from { transform: translate(0, 0) scale(1); } to { transform: translate(40px, 30px) scale(1.12); } }
@keyframes ptDrift2 { from { transform: translate(0, 0) scale(1); } to { transform: translate(-34px, 26px) scale(.94); } }
.user-mode .pt-aur { position: absolute; left: -30%; right: -30%; bottom: -60px; height: 170px; border-radius: 50% 50% 0 0; background: radial-gradient(ellipse at 50% 100%, rgba(59, 130, 246, .45), rgba(45, 212, 191, .18) 55%, transparent 78%); filter: blur(20px); animation: ptAur 10s ease-in-out infinite alternate; }
@keyframes ptAur { from { transform: translateX(-3%) scaleX(1); } to { transform: translateX(3%) scaleX(1.08); } }
.user-mode .pt-p { position: absolute; bottom: -8px; border-radius: 50%; opacity: 0; animation: ptUp var(--d, 8s) linear infinite; animation-delay: var(--dl, 0s); }
.user-mode .pt-p.s1 { width: 2px; height: 2px; background: #7FB0F8; box-shadow: 0 0 5px rgba(127, 176, 248, .9); }
.user-mode .pt-p.s2 { width: 3px; height: 3px; background: #93C5FD; box-shadow: 0 0 7px rgba(147, 197, 253, .95); }
.user-mode .pt-p.s3 { width: 4px; height: 4px; background: #2DD4BF; box-shadow: 0 0 9px rgba(45, 212, 191, .9); }
.user-mode .pt-p.s4 { width: 6px; height: 6px; background: #BFD9FF; box-shadow: 0 0 12px rgba(191, 217, 255, .85); filter: blur(1px); }
@keyframes ptUp { 0% { transform: translate(0, 0); opacity: 0; } 10% { opacity: 1; } 80% { opacity: 1; } 100% { transform: translate(var(--dx, 20px), -110vh); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .user-mode .pt-glow, .user-mode .pt-aur, .user-mode .pt-p, .user-mode .pt-orb { animation: none; opacity: .4; }
}
/* 背景装饰光点（纯视觉，GPU 合成，保留） */
.user-mode .pt-orb { position: absolute; border-radius: 50%; background: radial-gradient(circle, rgba(191, 217, 255, .95), rgba(78, 155, 255, .45) 45%, transparent 72%); filter: blur(2px); animation: ptOrb 5s ease-in-out infinite alternate; }
.user-mode .pt-orb.o1 { width: 46px; height: 46px; left: 30%; top: 47%; }
.user-mode .pt-orb.o2 { width: 34px; height: 34px; right: 24%; top: 60%; animation-delay: -1.7s; }
.user-mode .pt-orb.o3 { width: 26px; height: 26px; left: 16%; top: 68%; animation-delay: -3.2s; }
@keyframes ptOrb { from { transform: scale(.9); opacity: .55; } to { transform: scale(1.15); opacity: .95; } }
/* 实底卡片（玻璃拟态已移除）：内容卡片不透明深色底，粒子不透出，可读性稳定 */
.user-mode .section-block, .user-mode .group-card, .user-mode .history-item, .user-mode .template-card, .user-mode .asset-card, .user-mode .summary-card { background: #101A2D; }
.user-mode .main-content, .user-mode .sidebar { position: relative; z-index: 1; }
.user-mode .login-screen { position: fixed; }

/* =========================================================
   按钮体系规范（用户端）：Primary / Secondary / Ghost / Select
   统一圆角 12、过渡、Hover 变亮、Active 按下压暗 + 微缩放
   原则：主次分明，禁止全页面同一种蓝色描边
   ========================================================= */
.user-mode button { -webkit-tap-highlight-color: transparent; }
.user-mode .primary-button, .user-mode .secondary-button, .user-mode .tool-button,
.user-mode .start-task, .user-mode .upload-button,
.user-mode .mat-toggle, .user-mode .danger-text, .user-mode .chip {
  transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease, transform .08s ease;
}
.user-mode button:active { transform: scale(.97); }
.user-mode .stepper button:active { transform: none; }
.user-mode .ref-del:active, .user-mode .remove-prompt-row:active { transform: scale(.92); }

/* Primary：蓝色渐变 + 顶部内高光 + 轻阴影（底部提交 / 开始全部任务 / 登录） */
.user-mode .primary-button {
  height: 46px; padding: 0 22px; border-radius: 14px; font-size: 14px; font-weight: 600;
  border: 1px solid rgba(122, 176, 255, .38); color: #FFFFFF;
  background: linear-gradient(180deg, #4E9BFF 0%, #3B82F6 48%, #2563EB 100%);
  box-shadow: 0 6px 18px rgba(37, 99, 235, .34), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.user-mode .primary-button:hover {
  background: linear-gradient(180deg, #61A9FF 0%, #4B8EFC 48%, #2E6EF2 100%);
  box-shadow: 0 8px 24px rgba(37, 99, 235, .44), inset 0 1px 0 rgba(255, 255, 255, .34);
}
.user-mode .primary-button:active {
  background: linear-gradient(180deg, #3B82F6 0%, #2E6EF2 52%, #1E50C8 100%);
  box-shadow: inset 0 2px 7px rgba(12, 34, 92, .4);
}
.user-mode .user-bottom-bar .primary-button { height: 48px; border-radius: 16px; font-size: 15px; }
.user-mode .small-button { height: 36px; padding: 0 16px; font-size: 12.5px; border-radius: 12px; }

/* Secondary：深蓝半透明底 + 低对比蓝灰边框（卡片操作 / 上传 / 工具类） */
.user-mode .secondary-button, .user-mode .start-task, .user-mode .upload-button, .user-mode .tool-button {
  height: 36px; padding: 0 14px; border-radius: 12px; font-size: 12.5px; font-weight: 500;
  border: 1px solid rgba(102, 126, 164, .38); color: #B9C8DF;
  background: rgba(28, 47, 80, .42);
}
.user-mode .secondary-button:hover, .user-mode .start-task:hover, .user-mode .upload-button:hover, .user-mode .tool-button:hover {
  border-color: rgba(128, 158, 205, .55); color: #E4EDFB;
  background: rgba(40, 64, 106, .55);
}
.user-mode .secondary-button:active, .user-mode .start-task:active, .user-mode .upload-button:active, .user-mode .tool-button:active {
  background: rgba(22, 38, 66, .62);
}

/* Ghost：无完整边框，hover 才浮现底色（文字按钮 / 复制链接 / 折叠开关 / 行删除） */
.user-mode .text-button, .user-mode .mat-toggle,
.user-mode .remove-prompt-row, .user-mode .remove-group, .user-mode .close-button {
  height: 32px; padding: 0 10px; border-radius: 10px; font-size: 12px; font-weight: 500;
  border: 0; background: transparent; color: #7FB0F8;
}
.user-mode .text-button:hover:hover, .user-mode .mat-toggle:hover,
.user-mode .remove-prompt-row:hover, .user-mode .remove-group:hover, .user-mode .close-button:hover {
  background: rgba(59, 130, 246, .1); color: #A5C9FF;
}
.user-mode .text-button:active:active, .user-mode .mat-toggle:active,
.user-mode .remove-prompt-row:active, .user-mode .remove-group:active, .user-mode .close-button:active {
  background: rgba(59, 130, 246, .18);
}
.user-mode .mat-toggle { width: 100%; height: auto; padding: 11px 12px; justify-content: flex-start; font-size: 12.5px; color: #C6D4EA; }
.user-mode .mat-toggle .mat-toggle-icon { color: #3B82F6; font-size: 14px; }
.user-mode .mat-toggle em { order: 3; width: 100%; padding-left: 22px; font-size: 11px; color: #5F6F8A; line-height: 1.5; }

/* Select：参数选项，未选中深色底，选中蓝色渐变填充（画面比例 / 分辨率） */
.user-mode .chip {
  height: 36px; padding: 0 16px; border-radius: 999px; font-size: 12.5px;
  border: 1px solid rgba(102, 126, 164, .3); color: #8CA3C8;
  background: rgba(21, 35, 60, .6);
}
.user-mode .chip:hover { border-color: rgba(128, 158, 205, .5); color: #C6D4EA; background: rgba(28, 47, 80, .6); }
.user-mode .chip.active {
  border-color: transparent; color: #FFFFFF; font-weight: 600;
  background: linear-gradient(180deg, #4E9BFF 0%, #3B82F6 50%, #2563EB 100%);
  box-shadow: 0 4px 14px rgba(37, 99, 235, .34), inset 0 1px 0 rgba(255, 255, 255, .26);
}
.user-mode .chip.active:hover { background: linear-gradient(180deg, #61A9FF 0%, #4B8EFC 50%, #2E6EF2 100%); }

/* 危险操作：独立红色系（删除），保持低饱和红弱底 */
.user-mode .danger-text {
  height: 32px; padding: 0 12px; border-radius: 10px; font-size: 12px; font-weight: 500;
  border: 1px solid rgba(251, 90, 114, .28); color: #FB5A72;
  background: rgba(251, 90, 114, .07);
}
.user-mode .danger-text:hover { border-color: rgba(251, 90, 114, .48); background: rgba(251, 90, 114, .15); }
.user-mode .danger-text:active { background: rgba(251, 90, 114, .22); }

/* 上传占位：保持虚线语义，配色统一 */
.user-mode .ref-empty { border-style: dashed; border-color: rgba(102, 126, 164, .45); }
.user-mode .ref-empty:hover { border-color: rgba(59, 130, 246, .7); background: rgba(59, 130, 246, .08); }
.user-mode .ref-add { border-style: dashed; border-color: rgba(102, 126, 164, .45); }
.user-mode .ref-add:hover { border-color: rgba(59, 130, 246, .7); background: rgba(59, 130, 246, .1); }

/* 修正：提示词工具按钮（高特异性旧规则）与素材库删除按钮统一到新规范 */
.user-mode .prompt-tools .tool-button {
  height: 36px; border-radius: 12px; font-size: 12.5px;
  border: 1px solid rgba(102, 126, 164, .38); color: #B9C8DF;
  background: rgba(28, 47, 80, .42);
}
.user-mode .prompt-tools .tool-button:hover { border-color: rgba(128, 158, 205, .55); color: #E4EDFB; background: rgba(40, 64, 106, .55); }
.user-mode .asset-actions .danger-text {
  height: 32px; padding: 0 12px; border-radius: 10px; font-size: 12px;
  border: 1px solid rgba(251, 90, 114, .28); color: #FB5A72;
  background: rgba(251, 90, 114, .07);
}
.user-mode .asset-actions .danger-text:hover { border-color: rgba(251, 90, 114, .48); background: rgba(251, 90, 114, .15); }

/* 参考图缩略图加载失败兜底 */
.user-mode .ref-tile.img-fail img { display: none; }
.user-mode .ref-tile.img-fail { display: grid; place-items: center; color: #5F6F8A; font-size: 11px; }
.user-mode .ref-tile.img-fail::after { content: '加载失败'; }

/* 提示词行：× 移入模板选择行右侧，textarea 全宽不再被挤压 */
.user-mode .prompt-row-tools { display: flex; align-items: center; gap: 8px; }
.user-mode .row-template-select { flex: 1; min-width: 0; }
.user-mode .remove-prompt-row {
  flex: 0 0 32px; width: 32px; height: 32px; padding: 0;
  display: grid; place-items: center; font-size: 17px; line-height: 1;
  color: #5F6F8A; border-radius: 10px; background: transparent;
}
.user-mode .remove-prompt-row:hover { background: rgba(251, 90, 114, .12); color: #FB5A72; }

/* 提示词行（用户端）：序号 + 模板 + 删除 集中在输入框上方一行 */
.user-mode .prompt-row { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.user-mode .prompt-head { display: flex; align-items: center; gap: 8px; }
.user-mode .prompt-head .prompt-index { margin-top: 0; width: 22px; height: 22px; font-size: 11.5px; flex: 0 0 22px; }
.user-mode .prompt-head .row-template-select { flex: 1; min-width: 0; height: 34px; }
.user-mode .prompt-head .remove-prompt-row { flex: 0 0 32px; width: 32px; height: 32px; }
.user-mode .prompt-input-wrap { width: 100%; }

/* 提示词行删除：× 改为文字按钮，居右 */
.user-mode .prompt-head .remove-prompt-row {
  flex: 0 0 auto; width: auto; height: 32px; padding: 0 12px;
  font-size: 12px; font-weight: 500; display: inline-flex; align-items: center;
}

/* 提示词行：模板下拉真正占满剩余宽度，删除按钮强制贴右 + 危险色规范 */
.user-mode .prompt-head .row-template-select { flex: 1 1 0%; min-width: 0; width: auto; height: 34px; }
.user-mode .prompt-head .remove-prompt-row {
  margin-left: auto; flex: 0 0 auto; height: 32px; padding: 0 12px;
  border: 1px solid rgba(251, 90, 114, .28); border-radius: 10px;
  background: rgba(251, 90, 114, .07); color: #FB5A72;
  font-size: 12px; font-weight: 500; display: inline-flex; align-items: center;
}
.user-mode .prompt-head .remove-prompt-row:hover {
  background: rgba(251, 90, 114, .15); border-color: rgba(251, 90, 114, .48);
}
.user-mode .prompt-head .remove-prompt-row:active { background: rgba(251, 90, 114, .22); }

/* 修复：prompt-row 基础样式 align-items:flex-start 导致工具行收缩，强制铺满 */
.user-mode .prompt-row { align-items: stretch; }
.user-mode .prompt-head { width: 100%; }

/* 修复：删除按钮残留 margin-top 导致与模板下拉不对齐 */
.user-mode .prompt-head .remove-prompt-row { margin-top: 0; }

/* ===== 模板预览弹窗（点击模板卡「查看」打开） ===== */
.template-view-body { display: flex; flex-direction: column; gap: 14px; }
.template-view-meta { margin: 0; font-size: 12px; color: #8291A8; }
.template-view-prompt { padding: 14px 16px; border: 1px solid rgba(90,130,200,.3); border-radius: 12px; background: #101A2D; color: #E4EDFB; font-size: 13.5px; line-height: 1.8; white-space: pre-wrap; word-break: break-word; max-height: 40vh; overflow-y: auto; }
.user-mode .template-view-prompt { background: #101A2D; border-color: rgba(90,130,200,.3); color: #E4EDFB; }
@media (max-width: 700px) {
  .template-view-body { max-height: 60vh; overflow-y: auto; }
  .template-view-prompt { max-height: none; }
}

/* =========================================================
   我的 · 个人中心（user.html 顶部导航第 5 项）
   视觉与全站统一：深蓝玻璃拟态卡片 + 蓝色渐变 + SVG 图标
   ========================================================= */
.user-mode .profile-wrap { max-width: 560px; margin: 0 auto; padding: 4px 2px 24px; display: flex; flex-direction: column; gap: 14px; }
.user-mode .profile-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.user-mode .profile-head-left { display: flex; flex-direction: column; gap: 3px; }
.user-mode .profile-title { font-size: 24px; font-weight: 700; color: #F1F5F9; margin: 0; letter-spacing: .5px; }
.user-mode .profile-sub { font-size: 12px; color: #8291A8; margin: 0; }
.user-mode .profile-avatar-badge { font-size: 26px; filter: drop-shadow(0 0 8px rgba(167,139,250,.5)); animation: profileTwinkle 3s ease-in-out infinite; }
@keyframes profileTwinkle { 0%,100% { transform: scale(1) rotate(0deg); opacity: .9; } 50% { transform: scale(1.12) rotate(8deg); opacity: 1; } }

/* 用户信息卡 */
.user-mode .profile-user-card { position: relative; display: flex; align-items: center; gap: 14px; padding: 18px 16px; border-radius: 18px; border: 1px solid rgba(90,130,200,.3); background: #101A2D; overflow: hidden; }
.user-mode .profile-avatar { width: 56px; height: 56px; flex: 0 0 56px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #3B82F6, #706BEA); box-shadow: 0 6px 18px rgba(78,155,255,.4); }
.user-mode .profile-user-info { flex: 1; min-width: 0; }
.user-mode .profile-user-row { display: flex; align-items: center; gap: 9px; }
.user-mode .profile-user-row strong { font-size: 19px; font-weight: 700; color: #F1F5F9; letter-spacing: .3px; }
.user-mode .profile-tag { font-size: 11px; font-weight: 500; color: #7FB0F8; background: rgba(78,155,255,.12); border: 1px solid rgba(78,155,255,.3); border-radius: 999px; padding: 2px 9px; }
.user-mode .profile-welcome { font-size: 12.5px; color: #8291A8; margin: 7px 0 0; }
.user-mode .profile-user-exit { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; padding: 8px 12px; border-radius: 10px; font-size: 12.5px; color: #8291A8; background: rgba(28,47,80,.42); border: 1px solid rgba(102,126,164,.38); cursor: pointer; transition: color .18s, background .18s, border-color .18s, transform .08s; }
.user-mode .profile-user-exit:hover { color: #E4EDFB; background: rgba(40,64,106,.55); border-color: rgba(128,158,205,.55); }
.user-mode .profile-user-exit:active { transform: scale(.97); }
.user-mode .profile-user-exit svg { width: 14px; height: 14px; }

/* 手机端适配：窄屏下用户卡信息一行放不下「手机号+标签+退出」，把退出改为绝对定位右上角，
   头像+信息区居左一行，永不挤压溢出 */
@media (max-width: 520px) {
  .user-mode .profile-user-card { padding: 14px 12px; }
  .user-mode .profile-avatar { width: 44px; height: 44px; flex: 0 0 44px; font-size: 16px; }
  .user-mode .profile-user-info { flex: 1 1 0%; min-width: 0; }
  .user-mode .profile-user-row { gap: 6px; row-gap: 4px; flex-wrap: wrap; }
  .user-mode .profile-user-row strong { font-size: 15px; letter-spacing: 0; }
  .user-mode .profile-tag { font-size: 10px; padding: 1px 7px; }
  .user-mode .profile-welcome { font-size: 11px; margin-top: 5px; }
  .user-mode .profile-user-exit { position: absolute; top: 8px; right: 8px; padding: 6px 9px; font-size: 10.5px; gap: 4px; }
  .user-mode .profile-user-exit svg { width: 11px; height: 11px; }
}

/* 算力卡 */
.user-mode .profile-quota-card { border-radius: 18px; border: 1px solid rgba(90,130,200,.3); background: #101A2D; padding: 18px 16px; }
.user-mode .quota-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.user-mode .quota-head-title { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; color: #F1F5F9; }
.user-mode .quota-ico { width: 17px; height: 17px; color: #7FB0F8; }
.user-mode .quota-info { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: #8291A8; cursor: default; }
.user-mode .quota-info svg { opacity: .8; }
.user-mode .quota-body { display: flex; flex-direction: column; gap: 14px; }
.user-mode .quota-stats { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.user-mode .quota-stat { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.user-mode .quota-stat:nth-child(2) { margin-left: 20px; }
.user-mode .quota-label { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #8291A8; margin: 0; }
.user-mode .quota-label svg { opacity: .7; }
.user-mode .quota-value { font-size: 32px; font-weight: 800; color: #F1F5F9; margin: 0; line-height: 1; letter-spacing: .5px; }
.user-mode .quota-value-today { font-size: 22px; font-weight: 600; color: #C7D6F0; }
.user-mode .quota-total { font-size: 12px; color: #8291A8; margin: 0; }
.user-mode .quota-gauge { margin-left: auto; }
.user-mode .gauge-ring { width: 86px; height: 86px; border-radius: 50%; background: conic-gradient(#3B82F6 calc(var(--gauge, 86) * 1%), rgba(40,62,98,.4) 0); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; position: relative; }
.user-mode .gauge-ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #0E1728; }
.user-mode .gauge-ring span, .user-mode .gauge-ring em { position: relative; z-index: 1; }
.user-mode .gauge-ring span { font-size: 17px; font-weight: 700; color: #F1F5F9; line-height: 1; }
.user-mode .gauge-ring em { font-style: normal; font-size: 10px; color: #8291A8; line-height: 1; margin-top: 3px; }
.user-mode .quota-bar { width: 100%; height: 8px; border-radius: 6px; background: rgba(40,62,98,.4); overflow: hidden; }
.user-mode .quota-bar i { display: block; height: 100%; width: 86%; border-radius: 6px; background: linear-gradient(90deg, #3B82F6, #7FB0F8); box-shadow: 0 0 10px rgba(78,155,255,.5); }
.user-mode .quota-actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.user-mode .quota-get { flex: 1; }
.user-mode .quota-recharge { display: inline-flex; align-items: center; gap: 5px; }

/* 三宫格 */
.user-mode .profile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.user-mode .profile-entry { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 8px 15px; border-radius: 16px; border: 1px solid rgba(90,130,200,.3); background: #101A2D; text-decoration: none; cursor: pointer; transition: background .18s, border-color .18s, transform .08s; }
.user-mode .profile-entry:hover { background: rgba(40,64,106,.55); border-color: rgba(128,158,205,.55); }
.user-mode .profile-entry:active { transform: scale(.98); }
.user-mode .entry-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(78,155,255,.14); border: 1px solid rgba(78,155,255,.28); color: #7FB0F8; }
.user-mode .entry-ico svg { width: 22px; height: 22px; }
.user-mode .entry-name { font-size: 13px; font-weight: 500; color: #E4EDFB; }
.user-mode .entry-arrow { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); color: #8291A8; font-size: 14px; line-height: 1; }

/* 账号与安全行 */
.user-mode .profile-row { display: flex; align-items: center; gap: 12px; padding: 16px 16px; border-radius: 16px; border: 1px solid rgba(90,130,200,.3); background: #101A2D; text-decoration: none; cursor: pointer; transition: background .18s, border-color .18s, transform .08s; }
.user-mode .profile-row:hover { background: rgba(40,64,106,.55); border-color: rgba(128,158,205,.55); }
.user-mode .profile-row:active { transform: scale(.98); }
.user-mode .row-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: rgba(78,155,255,.14); border: 1px solid rgba(78,155,255,.28); color: #7FB0F8; }
.user-mode .row-ico svg { width: 18px; height: 18px; }
.user-mode .row-label { flex: 1; font-size: 14px; font-weight: 500; color: #E4EDFB; }
.user-mode .row-arrow { color: #8291A8; font-size: 16px; }

/* 退出登录 */
.user-mode .profile-logout { width: 100%; padding: 15px 0; border-radius: 16px; border: 1px solid rgba(251,90,114,.3); background: rgba(251,90,114,.07); color: #FB5A72; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .18s, border-color .18s, transform .08s; }
.user-mode .profile-logout:hover { background: rgba(251,90,114,.14); border-color: rgba(251,90,114,.48); }
.user-mode .profile-logout:active { transform: scale(.98); }

/* 我的 页面响应式：平板加宽（桌面 ≥1024px 由桌面断点控制），算力值缩放 */
@media (min-width: 768px) and (max-width: 1023px) {
  .user-mode .profile-wrap { max-width: 640px; }
}
@media (min-width: 768px) {
  .user-mode .quota-value { font-size: 38px; }
  .user-mode .quota-value-today { font-size: 26px; }
  .user-mode .gauge-ring { width: 100px; height: 100px; }
}
/* ===== 用户版任务清单：自适应列数（auto-fill，按屏宽自动排多列，非硬编码断点） ===== */
@media (min-width: 1024px) {
  .user-mode #history-list { max-width: 1240px; margin: 0 auto; }
  .user-mode .history-group-body { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
}
@media (min-width: 1024px) {
  .user-mode .profile-wrap { max-width: 820px; padding: 8px 4px 40px; }
  .user-mode .profile-grid { gap: 14px; }
}
/* ===== 用户版移动端：任务卡片一行2列（4:5 满铺大封面 + 信息叠加，参考抖音草稿箱满屏观感） ===== */
@media (max-width: 1023px) {
  .user-mode .history-group-body { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .user-mode #history-list { padding: 0 12px; }
}
@media (max-width: 700px) {
  .user-mode .history-group-body { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .user-mode #history-list { padding: 0 8px; }
  .user-mode .cover-card { aspect-ratio: 4 / 5; border-radius: 12px; }
  .user-mode .cover-meta { font-size: 10px; }
  .user-mode .cover-state { font-size: 9px; }
  .user-mode .cover-status { font-size: 9px; padding: 2px 6px; }
  .user-mode .cover-more { padding: 4px 5px; }
}

/* ===== 「AI 优化」提示词按钮 ===== */
.opt-prompt-row {
  flex: 0 0 auto;
  height: 28px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: linear-gradient(135deg, #6D5DF6, #8B5CF6);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, opacity .2s ease;
}
.opt-prompt-row:hover { box-shadow: 0 3px 10px rgba(109, 93, 246, .4); }
.opt-prompt-row:active { transform: scale(.95); }
.opt-prompt-row:disabled, .opt-prompt-row.loading { opacity: .65; cursor: not-allowed; filter: saturate(.6); }

/* 管理端（index.html 深色主界面）：按钮靠近输入框右侧工具区 */
.admin-mode .prompt-row-tools { display: flex; align-items: center; gap: 10px; }
.admin-mode .prompt-row-tools .opt-prompt-row { margin-right: 2px; }

/* 用户版（user.html）：按钮放提示词框上方头部行，与序号/模板/删除并排 */
.user-mode .opt-prompt-row {
  height: 32px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 12.5px;
  background: linear-gradient(135deg, #7C6CF8, #9B6CF8);
  box-shadow: 0 2px 8px rgba(124, 108, 248, .35);
}
.user-mode .prompt-head .opt-prompt-row { flex: 0 0 auto; }
.user-mode .prompt-row-tools .opt-prompt-row { flex: 0 0 auto; }
@media (max-width: 480px) {
  .user-mode .opt-prompt-row { height: 30px; padding: 0 11px; font-size: 12px; }
}

/* ===== 管理端提示词行（index.html）：对齐用户端「头部工具行 + 全宽输入框」布局 ===== */
/* .prompt-row 纵向排列：序号/工具提到头部行，输入框下方全宽 */
.admin-mode .prompt-row { display: flex; flex-direction: column; gap: 8px; }
/* 头部行：序号 + AI优化 + 模板下拉 + 删除 并排 */
.admin-mode .prompt-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}
.admin-mode .prompt-head .prompt-index { margin-top: 0; flex: 0 0 24px; }
.admin-mode .prompt-head .opt-prompt-row { flex: 0 0 auto; }
/* 模板下拉：撑满剩余空间，白色浅色样式（圆角对齐用户端 Pill） */
.admin-mode .prompt-head .row-template-select {
  flex: 1 1 0%;
  min-width: 0;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #dce3ec;
  border-radius: 10px;
  background: #fbfcfe;
  color: #46566c;
  font-size: 12px;
  outline: none;
}
.admin-mode .prompt-head .row-template-select:focus { border-color: #7d9bf2; box-shadow: 0 0 0 3px rgba(50,103,227,.1); }
/* 删除按钮：头部行右侧 */
.admin-mode .prompt-head .remove-prompt-row { flex: 0 0 28px; width: 28px; height: 28px; margin-top: 0; }
/* 输入框全宽（覆盖原先 .prompt-row 的 flex 布局） */
.admin-mode .prompt-row .prompt-input-wrap { width: 100%; }

/* ===== 算力流水弹层（ledger modal） ===== */
.ledger-tip { margin: -10px 0 14px; color: #8a94a6; font-size: 11px; }
.ledger-body { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; padding-right: 2px; }
.ledger-item { display: grid; grid-template-columns: 1fr auto; gap: 2px 14px; padding: 11px 14px; border: 1px solid #eef1f6; border-radius: 10px; background: #fafbfd; }
.ledger-main { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.ledger-type { font-size: 12px; font-weight: 700; white-space: nowrap; }
.ledger-type.in { color: #e0562f; } .ledger-type.out { color: #6d7c90; }
.ledger-memo { font-size: 12px; color: #8a94a6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger-right { display: flex; flex-direction: column; align-items: flex-end; gap: 1px; }
.ledger-amount { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ledger-amount.in { color: #e0562f; } .ledger-amount.out { color: #6d7c90; }
.ledger-balance { font-size: 11px; color: #8a94a6; font-variant-numeric: tabular-nums; }
.ledger-time { grid-column: 1 / -1; font-size: 11px; color: #a6b0bf; }
.ledger-loading, .ledger-empty { color: #8a94a6; text-align: center; font-size: 12px; padding: 22px 0; }
.user-mode .ledger-item { border-color: #22344f; background: #0c1526; }
.user-mode .ledger-type.out, .user-mode .ledger-amount.out { color: #8fa0b8; }
.user-mode .ledger-memo, .user-mode .ledger-balance, .user-mode .ledger-time { color: #5d6f8c; }
.user-mode .ledger-loading, .user-mode .ledger-empty { color: #5d6f8c; }

/* 算力耗尽提醒 */
.quota-exhausted { border-color: rgba(224, 86, 47, .55) !important; }
.quota-exhausted .quota-value { color: #e0562f; }

/* ===== 管理端用户表格（数据视图：区别于用户端卡片流） ===== */
.user-table { width: 100%; max-width: 1080px; border-collapse: collapse; background: #fff; border: 1px solid #e8edf4; border-radius: 12px; overflow: hidden; font-size: 13px; }
.user-table thead th { background: #f4f7fb; color: #5b6b81; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-align: left; padding: 10px 14px; border-bottom: 1px solid #e4eaf2; white-space: nowrap; }
.user-table tbody td { padding: 11px 14px; border-bottom: 1px solid #f0f3f8; color: #2a3648; vertical-align: middle; }
.user-table tbody tr:last-child td { border-bottom: 0; }
.user-table tbody tr:hover { background: #f8fafd; }
.user-table td.num, .user-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.user-table td.strong { font-weight: 700; color: #16233f; }
.user-table td.phone { font-family: Consolas, monospace; font-size: 13px; font-weight: 600; }
.user-table td.date { color: #8a94a6; font-size: 12px; white-space: nowrap; }
.user-table td.ops { white-space: nowrap; text-align: right; }
.user-table .role-badge { display: inline-block; font-size: 11px; padding: 2px 9px; border-radius: 999px; background: #eef2f8; color: #5b6b81; font-weight: 600; }
.user-table .role-badge.admin { background: #fff3e8; color: #d9682f; }
.user-table .grant-btn { border: 1px solid #d7e2f8; background: #eef4ff; color: #3267e3; border-radius: 7px; padding: 5px 11px; font-size: 12px; font-weight: 600; cursor: pointer; margin-right: 6px; transition: all .15s; }
.user-table .grant-btn:hover { background: #3267e3; color: #fff; border-color: #3267e3; }
.user-table .mini-btn { border: 1px solid #e4e9f0; background: #fff; color: #5b6b81; border-radius: 7px; padding: 5px 10px; font-size: 12px; cursor: pointer; margin-right: 6px; transition: all .15s; }
.user-table .mini-btn:hover { border-color: #b9c6d8; color: #16233f; }
.user-table .mini-btn.danger { color: #d94b4b; border-color: #ffd9d9; background: #fff8f8; }
.user-table .mini-btn.danger:hover { background: #ffecec; border-color: #ffb3b3; }
@media (max-width: 900px) {
  #user-list { overflow-x: auto; }
  .user-table { min-width: 760px; }
}

/* ===== 管理端：全站运营统计（用户管理页顶部） ===== */
.admin-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.admin-stat-card { background: #fff; border: 1px solid #eef1f6; border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.admin-stat-card span { font-size: 12px; color: #8a94a6; }
.admin-stat-card strong { font-size: 24px; line-height: 1.2; font-variant-numeric: tabular-nums; color: var(--ink); }
.admin-stat-card small { font-size: 11px; color: #a6b0bf; }
.admin-stats-note { font-size: 12px; color: #8a94a6; padding: 0 2px 14px; }
@media (max-width: 640px) { .admin-stats { grid-template-columns: repeat(2, 1fr); } }

/* ===== 管理端：用户管理工具栏（搜索 / 筛选 / 计数） ===== */
.user-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.user-search { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #e4e9f0; border-radius: 10px; padding: 0 12px; height: 38px; width: 260px; box-sizing: border-box; }
.user-search svg { width: 15px; height: 15px; color: #8a94a6; flex-shrink: 0; }
.user-search input { border: 0; outline: 0; background: transparent; font-size: 13px; color: #2a3648; width: 100%; }
.user-search:focus-within { border-color: #3267e3; }
.user-filter { display: flex; gap: 6px; }
.filter-chip { border: 1px solid #e4e9f0; background: #fff; color: #5b6b81; border-radius: 999px; padding: 7px 14px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s; }
.filter-chip:hover { border-color: #b9c6d8; color: #16233f; }
.filter-chip.active { background: #3267e3; border-color: #3267e3; color: #fff; }
.user-count { margin-left: auto; font-size: 12px; color: #8a94a6; }
@media (max-width: 640px) { .user-search { width: 100%; } .user-count { margin-left: 0; } }

/* ===== 管理端：用户表格排序态 / 分页 ===== */
.user-table th { cursor: pointer; user-select: none; }
.user-table th.sorted { color: #3267e3; }
.user-pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; }
.pager-btn { border: 1px solid #e4e9f0; background: #fff; color: #5b6b81; border-radius: 8px; padding: 6px 14px; font-size: 12px; cursor: pointer; transition: all .15s; }
.pager-btn:hover:not(:disabled) { border-color: #3267e3; color: #3267e3; }
.pager-btn:disabled { opacity: .45; cursor: not-allowed; }
.pager-info { font-size: 12px; color: #8a94a6; }

/* ===== 管理端：用户操作模态框 ===== */
.modal-sm { max-width: 440px; }
.confirm-body { font-size: 14px; color: #2a3648; line-height: 1.7; padding: 4px 24px 14px; }
.confirm-body strong { color: #d94b4b; }
.primary-button.danger { background: #d94b4b; border-color: #d94b4b; }
.primary-button.danger:hover { background: #c63e3e; border-color: #c63e3e; }

/* ===== 管理端任务清单表格（数据视图，区别于用户端卡片流） ===== */
.tasks-table { width: 100%; max-width: 1180px; border-collapse: collapse; background: #fff; border: 1px solid #e8edf4; border-radius: 12px; overflow: hidden; font-size: 13px; }
.tasks-table thead th { background: #f4f7fb; color: #5b6b81; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-align: left; padding: 10px 14px; border-bottom: 1px solid #e4eaf2; white-space: nowrap; }
.tasks-table tbody td { padding: 10px 14px; border-bottom: 1px solid #f0f3f8; color: #2a3648; vertical-align: top; }
.tasks-table tbody tr:last-child td { border-bottom: 0; }
.tasks-table tbody tr:hover { background: #f8fafd; }
.tasks-table td.num, .tasks-table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tasks-table td.strong { font-weight: 700; color: #16233f; }
.tasks-table td.ops { text-align: right; }
.tasks-table td.bid .bid-code { display: inline-block; font-family: 'Segoe UI', Consolas, monospace; font-size: 12px; font-weight: 700; letter-spacing: .02em; color: #2453c5; background: #e8f0ff; border: 1px solid #d3e2fb; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.tasks-table td.bid .bid-date { display: block; font-size: 11px; color: #a0aab8; margin-top: 2px; white-space: nowrap; }
.tasks-table td.user { white-space: nowrap; color: #47566b; font-weight: 500; }
.tasks-table td.wide .t-topic { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: #16233f; }
.tasks-table td.wide .t-params { font-size: 11px; color: #8a94a6; margin-top: 3px; }
/* 批内提示词查看入口（v20260907：管理表格行内小链接，弹层列出全部提示词） */
.tasks-table .t-prompts-link { display: inline-flex; align-items: center; gap: 4px; margin: 5px 8px 0 0; padding: 1px 0; border: 0; background: transparent; color: #3267e3; font-size: 11px; font-weight: 600; cursor: pointer; }
.tasks-table .t-prompts-link::before { content: '▸'; font-size: 9px; opacity: .8; }
.tasks-table .t-prompts-link:hover { color: #2453c5; text-decoration: underline; }
.tasks-table .t-error { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; color: #d94b4b; margin-top: 3px; }
.t-status { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.t-status.draft { background: #f0f3f8; color: #5b6b81; }
.t-status.running { background: #eaf1ff; color: #3267e3; }
.t-status.interrupted { background: #fff4e0; color: #c07c1a; }
.t-status.failed { background: #ffecec; color: #d94b4b; }
.t-status.completed { background: #e9f7ef; color: #1d9e5f; }
.t-progress { width: 96px; height: 3px; background: #e8edf4; border-radius: 3px; margin-top: 5px; overflow: hidden; }
.t-progress i { display: block; height: 100%; background: #3267e3; border-radius: 3px; transition: width .8s linear; }
.tasks-table .t-acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.tbtn { border: 1px solid #e4e9f0; background: #fff; color: #47566b; border-radius: 7px; padding: 4px 10px; font-size: 12px; cursor: pointer; transition: all .15s; white-space: nowrap; }
.tbtn:hover { border-color: #b9c6d8; color: #16233f; }
.tbtn.primary { border-color: #d7e2f8; background: #eef4ff; color: #3267e3; font-weight: 600; }
.tbtn.primary:hover { background: #3267e3; color: #fff; border-color: #3267e3; }
.tbtn.danger { color: #d94b4b; border-color: #ffd9d9; background: #fff8f8; }
.tbtn.danger:hover { background: #ffecec; border-color: #ffb3b3; }
.t-downloads { display: flex; gap: 5px; justify-content: flex-start; flex-wrap: wrap; margin-top: 7px; max-width: 560px; }
.t-dl-chip { display: inline-flex; align-items: center; gap: 3px; border: 1px solid #e4e9f0; background: #f7f9fc; border-radius: 6px; padding: 2px 3px 2px 6px; font-size: 11px; }
.t-dl-chip a { display: inline-flex; align-items: center; gap: 4px; color: #3267e3; text-decoration: none; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-dl-chip a i { font-style: normal; font-family: Consolas, monospace; font-size: 10px; color: #8a94a6; flex: 0 0 auto; }
.t-dl-chip a svg { width: 12px; height: 12px; flex: 0 0 auto; }
.t-dl-chip a em { font-style: normal; overflow: hidden; text-overflow: ellipsis; }
.t-dl-chip a:hover { text-decoration: underline; }
.t-dl-chip button { display: grid; place-items: center; width: 20px; height: 20px; border: 0; background: transparent; color: #8a94a6; cursor: pointer; border-radius: 4px; }
.t-dl-chip button svg { width: 12px; height: 12px; }
.t-dl-chip button:hover { background: #e8edf4; color: #16233f; }
@media (max-width: 1000px) {
  #history-list { overflow-x: auto; }
  .tasks-table { min-width: 940px; }
}

/* ===== 任务清单分组（唯一生效版本；容器宽度跟随父级，不设自身宽度） =====
   组 = 网格：默认单列（<1024 手机/平板）；桌面列数由上方 1024/1200 断点规则定义 */
.history-group { display: grid; grid-template-columns: 1fr; gap: 10px; }
.history-group + .history-group { margin-top: 22px; }
.history-group-label + .history-item { margin-top: 0; }

/* ===== 分组标题栏按钮化 + 可折叠 + 已完成排序（v20260904-r6：删旧重写，动画版） ===== */
.history-group-label { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer; margin: 0 0 6px; padding: 0; font: inherit; color: #47566b; }
.history-group-label::before { content: ''; flex: 0 0 auto; width: 3px; height: 14px; border-radius: 2px; background: #7d9bf2; }
.history-group-label .group-caret { flex: 0 0 auto; display: inline-flex; width: 16px; height: 16px; align-items: center; justify-content: center; color: #8a94a6; margin-left: 2px; overflow: hidden; }
.history-group-label .group-caret .caret-svg { width: 14px !important; height: 14px !important; max-width: 14px; max-height: 14px; display: block; transition: transform .2s ease; }
.history-group-label[aria-expanded="true"] .group-caret .caret-svg { transform: rotate(0); }
.history-group-label[aria-expanded="false"] .group-caret .caret-svg { transform: rotate(-90deg); } /* 折叠=向右箭头 */
.history-group-label .group-title { font-size: 13px; font-weight: 700; }
.history-group-label em { font-style: normal; font-size: 11px; font-weight: 600; color: #8a94a6; background: #eef2f8; padding: 1px 8px; border-radius: 999px; }
/* 排序按钮：内嵌标题栏右侧小胶囊，不占整行 */
.history-group-label .group-sort { display: inline-flex; align-items: center; gap: 3px; margin-left: 10px; flex: 0 0 auto; border: 1px solid #dfe7f2; background: #fff; color: #5c6a7c; font-size: 11px; font-weight: 600; line-height: 1; padding: 4px 9px; border-radius: 999px; cursor: pointer; transition: all .18s ease; }
.history-group-label .group-sort:hover { border-color: #7d9bf2; background: #eef4ff; color: #3267e3; }
.history-group-label .group-sort:active { transform: scale(.96); }
/* 分组折叠：max-height + opacity 平滑过渡（JS 切 .collapsed）；内部 grid 多列（卡片是 grid item，auto-fill 自适应列数） */
.history-group-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; max-height: 10000px; opacity: 1; overflow: visible; transition: max-height .35s ease, opacity .25s ease; }
.history-group-body.collapsed { max-height: 0; opacity: 0; overflow: hidden; }
.user-mode .history-group-label { color: #F1F5F9; }
.user-mode .history-group-label::before { background: #3B82F6; }
.user-mode .history-group-label .group-caret, .user-mode .history-group-label .group-caret svg { flex: 0 0 auto; width: 16px; height: 16px; color: #5F6F8A; }
.user-mode .history-group-label .group-caret .caret-svg { width: 14px !important; height: 14px !important; max-width: 14px; max-height: 14px; display: block; }
.user-mode .history-group-label em { color: #8291A8; background: rgba(59,130,246,.12); }
.user-mode .history-group-label .group-sort { background: #16233B; border-color: #283B5D; color: #8FBAFF; }
.user-mode .history-group-label .group-sort:hover { background: #1A2B49; border-color: #3B82F6; color: #fff; }

/* ===== 单张卡片主体可折叠（v20260904-r6） ===== */
/* ===== 3:4 封面网格卡片（v20260904-r9，替换旧卡片流样式） ===== */
.history-item { position: relative; align-self: start; }
.history-item.cover-item { display: flex; flex-direction: column; gap: 8px; cursor: pointer; border: 1px solid #1e2e4a; border-radius: 12px; background: #101A2D; overflow: visible; padding: 0; box-shadow: none; transition: transform .12s ease, border-color .18s ease; }
.history-item.cover-item:hover { border-color: #3B82F6; }
.history-item.cover-item:active { transform: scale(.97); }
.cover-card { position: relative; width: 100%; aspect-ratio: 3 / 4; overflow: hidden; background: #0D1728; border-radius: 11px; }
.cover-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-status { position: absolute; top: 8px; left: 8px; z-index: 2; display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; background: rgba(13,23,40,.82); color: #2DD4BF; white-space: nowrap; }
.cover-status.failed { color: #FB5A72; }
.cover-status.interrupted { color: #F5A524; }

/* ===== 生成中：封面中央百分比 + 装饰转圈（v20260907，替代底部进度条 + 左上角胶囊） ===== */
.cover-gen {
  position: absolute; top: 50%; left: 50%; z-index: 5;
  width: clamp(104px, 46%, 148px); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  container-type: inline-size;
  display: grid; place-items: center;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(6,15,29,.58) 30%, rgba(6,15,29,0) 74%);
}
/* 呼吸光晕（外圈柔光脉动） */
.cover-gen::before {
  content: ''; position: absolute; inset: -6%;
  border-radius: 50%;
  box-shadow: 0 0 20px 3px rgba(56,189,248,.20), inset 0 0 18px rgba(56,189,248,.10);
  animation: cgHalo 2.4s ease-in-out infinite;
}
/* 进度主环：conic 渐变随 --gen 角度推进（青→蓝），带辉光；环厚由中心 .cg-core 覆盖而成 */
.cg-ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from -90deg,
    rgba(34,211,238,.05) 0deg,
    #22D3EE calc(var(--gen, 0deg) * .55),
    #3B82F6 var(--gen, 0deg),
    rgba(96,165,250,.10) var(--gen, 0deg) 360deg);
  filter: drop-shadow(0 0 5px rgba(59,130,246,.55));
}
/* 扫光彗尾：沿环带不停流转的亮弧（主装饰动画），中心被 .cg-core 覆盖故只露环带 */
.cg-sweep {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from -14deg,
    transparent 0deg 280deg,
    rgba(165,218,255,0) 298deg,
    rgba(165,218,255,.50) 324deg,
    #DFF4FF 340deg,
    rgba(223,244,255,0) 350deg 360deg);
  animation: cgSpin 1.5s linear infinite;
}
/* 中心圆底：承接百分比数字，形成环厚 */
.cg-core {
  position: absolute; inset: 11px; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 30%, #1C3559 0%, #0D1A2E 66%, #0A1424 100%);
  box-shadow: inset 0 0 12px rgba(2,8,18,.6), 0 0 0 1px rgba(125,211,252,.10);
}
/* 中央大号百分比（白→冰蓝渐变字 + 辉光） */
.cg-pct {
  display: inline-flex; align-items: baseline; justify-content: center;
  font-size: 22px;
  font-size: clamp(19px, 21cqw, 27px);
  font-weight: 700; letter-spacing: -.5px; line-height: 1;
  font-family: 'DIN Alternate', 'Bahnschrift', 'Segoe UI', system-ui, sans-serif;
  background: linear-gradient(180deg, #FFFFFF 14%, #B4D9FF 56%, #5FB2FF 100%);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 7px rgba(96,165,250,.35));
}
.cg-pct em {
  font-style: normal; font-weight: 600; font-size: .5em;
  -webkit-text-fill-color: #86BCF5; color: #86BCF5; margin-left: 1px;
}
/* 底部小字：AI 生成中 + 呼吸点 */
.cg-label {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 5px; font-size: 9px; letter-spacing: .14em;
  color: #8FC3FF; opacity: .92; white-space: nowrap;
}
.cg-dots { display: inline-flex; gap: 2px; margin-left: 3px; }
.cg-dots s { width: 3px; height: 3px; border-radius: 50%; background: #4FC3F7; animation: cgDot 1.2s ease-in-out infinite; }
.cg-dots s:nth-child(2) { animation-delay: .18s; }
.cg-dots s:nth-child(3) { animation-delay: .36s; }
@keyframes cgSpin { to { transform: rotate(360deg); } }
@keyframes cgHalo { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }
@keyframes cgDot { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-1px); } }
.cover-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 46px; height: 46px; border-radius: 50%; background: rgba(13,23,40,.55); display: flex; align-items: center; justify-content: center; }
.cover-play-tri { width: 0; height: 0; border-left: 14px solid #fff; border-top: 8px solid transparent; border-bottom: 8px solid transparent; margin-left: 3px; }
.cover-info { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 10px 10px; }
.cover-meta { font-size: 12px; color: #8291A8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cover-state { flex: 0 0 auto; font-size: 11px; color: #8FBAFF; }
/* 满铺大封面：信息叠加在封面底部（标题 + 状态），半透明渐隐包边，参考抖音草稿箱 */
.cover-overlay {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 22px 10px 9px;
  background: linear-gradient(180deg, rgba(11,21,38,0) 0%, rgba(11,21,38,.82) 62%, rgba(11,21,38,.95) 100%);
}
.cover-overlay .cover-meta { color: #E7EEF7; font-weight: 500; }
.cover-overlay .cover-state { color: #8FBAFF; }

/* ===== 封面卡片 ⋯ 折叠菜单（删除收进这里，避免占用主操作位） ===== */
.cover-more { position: absolute; right: 8px; top: 8px; z-index: 3; display: flex; align-items: center; gap: 3px; padding: 5px 7px; border-radius: 8px; background: rgba(13,23,40,.82); color: #C6D4EA; cursor: pointer; transition: background .18s ease; }
.cover-more:hover { background: rgba(13,23,40,.95); color: #fff; }
.cover-more .more-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.cover-more-menu { position: absolute; right: 8px; top: 36px; z-index: 4; min-width: 108px; padding: 4px; border-radius: 10px; background: #16233B; border: 1px solid #2A3B5E; box-shadow: 0 8px 24px rgba(0,0,0,.4); opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .15s ease, transform .15s ease, visibility .15s ease; }
.cover-more-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.cmm-item { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; color: #C6D4EA; font-size: 12px; cursor: pointer; white-space: nowrap; }
.cmm-item:hover { background: rgba(59,130,246,.14); color: #fff; }
.cmm-item.danger { color: #E06060; }
.cmm-item.danger:hover { background: rgba(224,96,96,.14); color: #FB5A72; }

/* ===== 封面卡片底部主动作条（无需点开详情即可再次制作/开始/恢复） ===== */
.cover-actions { display: flex; align-items: stretch; padding: 0 10px 10px; }
.cover-main-btn { flex: 1; height: 34px; border: 0; border-radius: 9px; background: #3267e3; color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .18s ease, transform .1s ease; }
.cover-main-btn:hover { background: #3B82F6; }
.cover-main-btn:active { transform: scale(.98); }
.cover-main-btn.gen { background: rgba(59,130,246,.14); color: #8FBAFF; cursor: default; }
.history-group-label + .history-item { margin-top: 0; }

/* 管理端表格组标题 */
.admin-group-label { max-width: 1180px; margin-bottom: 8px; }
.admin-group-label + .tasks-table { margin-bottom: 22px; }

/* 批内逐条出片提示（生成中已有可下载产物） */
.history-out-tip { font-size: 11px; color: #2DD4BF; margin: 2px 0 0; }
.user-mode .history-out-tip { color: #2DD4BF; }

/* styles.css v20260903-r4：任务列表布局终版（旧散点规则已全部清除，无覆盖式写法） */

/* ===== 下载区（v1.11 数量自适应，旧 v1.10 块整体删除） =====
   列数由 JS 按条数给出 c1/c2/c3；条目 = 序号 + 名称 + 弹性空隙 + [下载][复制]贴右
   · 手机(<1024)：c1 每条整行（名称上限放宽到 70%）；c2 两列（名称 ≤50% 省略）
   · 电脑(≥1024)：c1 整行 / c2 一行两条 / c3 三列（名称随列宽省略）
   · 行尾独苗 .dl-span 横跨整行，名称同步放宽 */
.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; padding-top: 10px; margin-top: 2px; border-top: 1px solid rgba(59, 130, 246, .16); }
.dl-chip { display: flex; align-items: center; gap: 5px; min-width: 0; padding: 7px 6px 7px 10px; border-radius: 9px; background: #0d1728; border: 1px solid #1e2e4a; }
.dl-chip.dl-span { grid-column: 1 / -1; }
.dl-no { flex: 0 0 auto; font-family: Consolas, monospace; font-size: 10px; color: #8291a8; }
.dl-name { flex: 1 1 auto; min-width: 0; max-width: 50%; margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #c7d3e4; font-size: 11.5px; }
.dl-grid.c1 .dl-name, .dl-chip.dl-span .dl-name { max-width: 70%; font-size: 12px; } /* 整行条目：名称给足 */
.dl-go, .dl-cp { flex: 0 0 auto; width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 7px; background: transparent; color: #3b82f6; cursor: pointer; text-decoration: none; }
.dl-go svg, .dl-cp svg { width: 15px; height: 15px; }
.dl-cp { color: #8291a8; }
.dl-chip .dl-go:active, .dl-chip .dl-cp:active { background: rgba(59, 130, 246, .16); }
@media (hover: hover) {
  .dl-chip .dl-go:hover, .dl-chip .dl-cp:hover { background: rgba(59, 130, 246, .12); }
}
@media (min-width: 1024px) {
  .dl-chip { padding: 5px 4px 5px 8px; }
  .dl-name, .dl-grid.c1 .dl-name { max-width: none; font-size: 11px; }
  .dl-go, .dl-cp { width: 22px; height: 22px; }
  .dl-go svg, .dl-cp svg { width: 14px; height: 14px; }
}

/* =========================================================
   管理端（admin-mode）工作台浅色精美化
   说明：管理端各视图共用的区块/标题/控件/卡片，统一浅色卡、
   大圆角、蓝渐变序号徽标、大输入区。用 .admin-mode 前缀做端差分
   （与 .user-mode 前缀同构），先删被覆盖的旧 .admin-mode 专属样式再写新。
   ========================================================= */
/* 管理端区块：白卡片 + 大圆角 + 柔和阴影 */
.admin-mode .section-block {
  padding: 22px 24px 26px;
  margin-bottom: 18px;
  border: 1px solid #e9eef6;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 2px 16px rgba(23, 34, 49, .04);
}
/* 区块头：底部分隔线 + 序号徽标 + 加粗标题 */
.admin-mode .section-heading {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eef2f8;
}
.admin-mode .section-heading > div { gap: 11px; }
.admin-mode .section-index {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #3267e3, #5b8cff);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .5px;
  box-shadow: 0 4px 10px rgba(50, 103, 227, .28);
}
.admin-mode .section-heading h2 {
  font-size: 18px;
  font-weight: 700;
  color: #172231;
  letter-spacing: 0;
}
.admin-mode .section-heading .required-note,
.admin-mode .section-heading .section-tools span {
  font-size: 11px;
  color: #8a94a6;
}
/* 分组标签加深 */
.admin-mode .field-group label {
  margin-bottom: 8px;
  color: #3a4a61;
  font-size: 13px;
  font-weight: 600;
}
.admin-mode .label-row label,
.admin-mode .label-row em { font-size: 13px; color: #2f3f56; }
/* 控件：大圆角、浅底 */
.admin-mode .field-group input,
.admin-mode .field-group select,
.admin-mode .field-group textarea,
.admin-mode .prompt-row textarea,
.admin-mode .number-input,
.admin-mode .setting-readonly {
  border-radius: 12px;
  background: #fbfcfe;
}
.admin-mode .field-group textarea { min-height: 90px; }
.admin-mode .prompt-row textarea {
  min-height: 120px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.7;
}
/* @图N 高亮装饰层同步输入框内边距，保证两层逐像素对齐 */
.admin-mode .prompt-row .prompt-hl { padding: 14px 16px; }
/* 帮助文案：左侧蓝条 + 浅蓝底 */
.admin-mode .section-help {
  margin: -2px 0 18px 0;
  padding: 9px 13px;
  border-left: 3px solid #c6d6f7;
  border-radius: 0 8px 8px 0;
  color: #6b7a90;
  background: #f6f9ff;
  font-size: 12px;
  line-height: 1.7;
}
/* 「输出设置」控件区 */
.admin-mode .settings-grid { gap: 14px; }
.admin-mode .settings-grid .field-group label { font-size: 12px; color: #5b6b81; }
.admin-mode .setting-readonly { color: #7d8999; background: #f4f6fb; }
/* 底部操作区：按钮大圆角 + 主按钮渐变 */
.admin-mode .form-footer button { border-radius: 10px; }
.admin-mode .primary-button {
  border-color: #3267e3;
  background: linear-gradient(135deg, #3267e3, #2b57c8);
  box-shadow: 0 6px 16px rgba(50, 103, 227, .24);
}
.admin-mode .primary-button:hover { background: linear-gradient(135deg, #2b57c8, #2453c5); }
/* 右侧批次预览卡：圆角加大、阴影柔和 */
.admin-mode .summary-card { border-radius: 16px; box-shadow: 0 6px 24px rgba(23, 34, 49, .06); }
.admin-mode .tip-card { border-radius: 12px; }

/* ===== 管理端参考素材·图片上传画廊（浅色版，对齐用户端设计）===== */
/* 此前 .ref-gallery/.ref-empty/.ref-add/.ref-tile 只有 .user-mode 深色定义，管理端缺失，此处补齐 */
.admin-mode .ref-gallery { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; }
/* 空状态：本地上传 + 素材库 两枚横条并排同款 */
.admin-mode .ref-gallery.empty .ref-empty,
.admin-mode .ref-gallery.empty .ref-lib { flex: 1; min-width: 0; }
.admin-mode .ref-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 9px 14px;
  border: 1.5px dashed #b9c9e8;
  border-radius: 12px;
  background: #f6f9ff;
  color: #5b6b81;
  cursor: pointer;
  transition: background .2s, border .2s;
}
.admin-mode .ref-empty:hover { background: #edf3ff; border-color: #7d9bf2; }
.admin-mode .ref-empty-ic {
  width: 32px; height: 32px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: #e9f0ff;
  color: #3267e3;
  font-size: 18px;
  flex: 0 0 auto;
}
.admin-mode .ref-empty-txt { font-size: 12px; font-weight: 500; color: #3a4a61; line-height: 1.4; }
/* 素材库按钮 + 加图按钮：同款虚线方形 */
.admin-mode .ref-lib,
.admin-mode .ref-add {
  position: relative;
  width: 58px; height: 58px;
  border-radius: 12px;
  border: 1.5px dashed #b9c9e8;
  background: #f6f9ff;
  color: #3267e3;
  font-size: 19px;
  cursor: pointer;
  flex: 0 0 auto;
  transition: background .2s, border .2s;
}
.admin-mode .ref-lib:hover,
.admin-mode .ref-add:hover { background: #edf3ff; border-color: #7d9bf2; }
.admin-mode .ref-lib span,
.admin-mode .ref-add span {
  position: absolute;
  bottom: 5px; left: 0; right: 0;
  text-align: center;
  font-size: 9px;
  opacity: .85;
}
/* 空状态下的素材库按钮切为横条（与上传按钮同款） */
.admin-mode .ref-gallery.empty .ref-lib {
  width: auto; height: auto;
  min-height: 54px;
  display: inline-flex;
  align-items: center; justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  font-size: 17px;
}
.admin-mode .ref-gallery.empty .ref-lib span {
  position: static;
  font-size: 12px; font-weight: 500; opacity: 1; color: #3a4a61;
}
/* 已有缩略图 tile */
.admin-mode .ref-tile {
  position: relative;
  width: 58px; height: 58px;
  overflow: visible;
  border-radius: 12px;
  background: #fbfcfe;
  border: 1px solid #e9eef6;
  flex: 0 0 auto;
}
.admin-mode .ref-tile img { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; display: block; background: #fbfcfe; }
.admin-mode .ref-tile .ref-idx {
  position: absolute;
  left: 3px; bottom: 3px;
  font-size: 10px;
  color: #fff;
  background: rgba(23, 34, 49, .74);
  padding: 1px 5px;
  border-radius: 5px;
  pointer-events: none;
}
.admin-mode .ref-tile .ref-del {
  position: absolute;
  top: -6px; right: -6px;
  width: 20px; height: 20px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: #e0562f;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.admin-mode .ref-full {
  display: grid;
  place-items: center;
  width: 58px; height: 58px;
  border-radius: 12px;
  color: #8a94a6;
  border: 1px dashed #c9d4e8;
  font-size: 10px;
  background: #fafbfd;
  text-align: center;
  flex: 0 0 auto;
}
.admin-mode .ref-tile.img-fail img { display: none; }
.admin-mode .ref-tile.img-fail { display: grid; place-items: center; color: #8a94a6; font-size: 11px; }
.admin-mode .ref-tile.img-fail::after { content: '加载失败'; }
.admin-mode .ref-gallery.dragging { outline: 1.5px dashed #7d9bf2; outline-offset: 4px; border-radius: 12px; }

/* ===== 小屏手机（≤700px）历史卡片体验优化（v20260904-r7） ===== */
@media (max-width: 700px) {
  /* 分组标题：紧凑，排序按钮靠右 */
  .history-group-label { gap: 6px; }
  .history-group-label .group-sort { margin-left: 6px; padding: 3px 7px; font-size: 10px; }
  /* 卡片头部两行布局：第一行 批次号+状态徽章，第二行 日期+进度，避免重叠 */
  .history-item .history-head { flex-wrap: wrap; gap: 6px 10px; }
  .history-item .history-top { flex-wrap: wrap; gap: 6px; }
  /* 批次号不强制换行破坏（保留可断）、时间 chip 与状态徽章分开排 */
  .history-item .batch-id-wrap { flex-wrap: wrap; }
  .history-item .batch-id { font-size: 12px; letter-spacing: .2px; }
  .history-item .batch-date { font-size: 11px; padding: 2px 7px; }
  /* 状态徽章独立成胶囊，与日期不叠 */
  .history-item .history-status { flex: 0 0 auto; white-space: nowrap; }
  .history-item .card-caret { flex: 0 0 auto; margin-left: auto; }
  /* 卡片内边距收窄，信息更紧凑 */
  .user-mode .history-item { padding: 12px 13px; gap: 6px; }
  /* 指标格：auto-fit 已自适应，小屏收紧间距 */
  .user-mode .his-metrics { gap: 6px; }
  /* 下载 chip 更紧凑 */
  .dl-chip { padding: 6px 5px 6px 9px; }
}
/* 深色端历史卡片：状态徽章统一胶囊底色（小屏更清晰） */
.user-mode .history-status { padding: 4px 10px; border-radius: 999px; background: rgba(59,130,246,.12); }
.user-mode .history-status.failed { background: rgba(251,90,114,.14); }
.user-mode .history-status.interrupted { background: rgba(245,158,11,.12); }
.user-mode .history-status.completed { background: rgba(45,212,191,.12); }

/* ===== 任务预览详情浮层（v20260904-r9，点封面弹出；进出场动画） ===== */
/* 弹层打开时锁定背景滚动，防止滑动穿透到任务列表（微信里尤其明显；html+body 双锁更稳） */
.no-scroll, body.no-scroll, html.no-scroll { overflow: hidden; }
.task-preview { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.task-preview-mask { position: absolute; inset: 0; background: rgba(5,10,20,.72); backdrop-filter: blur(3px); opacity: 0; transition: opacity .22s ease; }
.task-preview-card { position: relative; z-index: 2; width: min(420px, 92vw); max-height: 90vh; overflow-y: auto; background: #101A2D; border: 1px solid #283B5D; border-radius: 18px; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,.5); opacity: 0; transform: translateY(22px) scale(.97); transition: opacity .22s ease, transform .22s cubic-bezier(.2,.8,.3,1); }
.task-preview.show .task-preview-mask { opacity: 1; }
.task-preview.show .task-preview-card { opacity: 1; transform: none; }
.task-preview.closing .task-preview-mask { opacity: 0; }
.task-preview.closing .task-preview-card { opacity: 0; transform: translateY(16px) scale(.98); }
.task-preview-x { position: absolute; top: 12px; right: 12px; z-index: 4; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(13,23,40,.7); color: #9FB3D0; font-size: 20px; line-height: 1; cursor: pointer; }
.task-preview-x:hover { background: rgba(59,130,246,.3); color: #fff; }
.task-preview-cover { position: relative; width: 100%; aspect-ratio: 3 / 4; background: #0D1728; }
.task-preview-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.task-preview-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #5F6F8A; font-size: 13px; }
/* 内嵌预览播放器：默认铺满但隐藏（覆盖封面），playing 时显示；用 CSS class 而非 hidden 属性，规避微信 X5 对 hidden 切换不加载的 bug */
.task-preview-video { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; background: #000; object-fit: contain; opacity: 0; pointer-events: none; }
.task-preview-video.playing { opacity: 1; pointer-events: auto; }
/* 自定义极简控制层：盖在视频上，点=播放/暂停；flash 时中央短暂显示大图标后自动收起（替代微信原生常驻控制条） */
.pp-tap { position: absolute; inset: 0; z-index: 3; cursor: pointer; pointer-events: none; }
.pp-tap.active { pointer-events: auto; }
.pp-tap .pp-big-icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 74px; height: 74px; border-radius: 50%; background: rgba(13,23,40,.72); display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .18s ease; }
.pp-tap .pp-big-icon::before { content: ''; width: 0; height: 0; border-left: 20px solid #fff; border-top: 12px solid transparent; border-bottom: 12px solid transparent; margin-left: 4px; }
.pp-tap .pp-big-icon.paused::before { width: 18px; height: 20px; border: 0; border-left: 6px solid #fff; border-right: 6px solid #fff; margin-left: 0; }
.pp-tap.flash .pp-big-icon { opacity: 1; }
.task-preview-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 3; width: 62px; height: 62px; border: 0; border-radius: 50%; background: rgba(13,23,40,.6); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .18s ease, transform .12s ease; }
.task-preview-play:hover { background: rgba(13,23,40,.8); }
.task-preview-play:active { transform: translate(-50%,-50%) scale(.9); }
.task-preview-play .pp-icon { width: 0; height: 0; border-left: 18px solid #fff; border-top: 10px solid transparent; border-bottom: 10px solid transparent; margin-left: 4px; }
.task-preview-play .pp-spinner { position: absolute; top: 50%; left: 50%; margin: -13px 0 0 -13px; width: 26px; height: 26px; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff; border-radius: 50%; opacity: 0; animation: ppSpin .8s linear infinite; }
.task-preview-play.loading .pp-icon { opacity: 0; }
.task-preview-play.loading .pp-spinner { opacity: 1; }
.task-preview-play.hidden { opacity: 0; pointer-events: none; transition: opacity .3s ease; }
@keyframes ppSpin { to { transform: rotate(360deg); } }
.task-preview-status { position: absolute; top: 12px; left: 12px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 600; background: rgba(13,23,40,.82); color: #2DD4BF; }
.task-preview-status.failed { color: #FB5A72; }
.task-preview-status.running { color: #3B82F6; }
.task-preview-status.interrupted { color: #F5A524; }
.task-preview-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(13,23,40,.6); }
.task-preview-progress i { display: block; height: 100%; background: #3B82F6; }
.task-preview-info { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid rgba(59,130,246,.12); font-size: 13px; color: #8291A8; flex-wrap: wrap; }
.task-preview-date { color: #C6D4EA; }
.task-preview-actions { display: flex; gap: 10px; padding: 14px 16px; }
.tpreview-btn { flex: 1; height: 42px; border: 1px solid #3D5A8F; border-radius: 10px; background: rgba(59,130,246,.08); color: #8FBAFF; font-size: 14px; font-weight: 600; cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .1s ease; }
.tpreview-btn:hover { background: rgba(59,130,246,.16); border-color: #3B82F6; }
.tpreview-btn:active { transform: scale(.97); }
.tpreview-btn.primary { background: #3267e3; border-color: #3267e3; color: #fff; }
.tpreview-btn.primary:hover { background: #3B82F6; }
.tpreview-btn.danger { color: #E06060; border-color: rgba(224,96,96,.35); background: rgba(224,96,96,.08); }
.tpreview-btn.danger:hover { background: rgba(224,96,96,.16); border-color: rgba(224,96,96,.5); }
.tpreview-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===== 预览浮层 ⋯ 折叠菜单（删除收进这里） ===== */
.tpreview-more { position: relative; flex: 0 0 auto; display: flex; align-items: center; gap: 3px; width: 40px; height: 42px; justify-content: center; border: 1px solid #3D5A8F; border-radius: 10px; background: rgba(59,130,246,.08); color: #8FBAFF; cursor: pointer; transition: background .18s ease, border-color .18s ease; }
.tpreview-more:hover { background: rgba(59,130,246,.16); border-color: #3B82F6; }
.tpreview-more > i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.tpreview-more-menu { position: absolute; right: 0; bottom: 48px; min-width: 96px; padding: 4px; border-radius: 10px; background: #16233B; border: 1px solid #2A3B5E; box-shadow: 0 8px 24px rgba(0,0,0,.4); opacity: 0; visibility: hidden; transform: translateY(6px); transition: opacity .15s ease, transform .15s ease, visibility .15s ease; }
.tpreview-more-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.tmm-item { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 7px; background: transparent; font-size: 12px; cursor: pointer; white-space: nowrap; }
.tmm-item.danger { color: #E06060; }
.tmm-item.danger:hover { background: rgba(224,96,96,.14); color: #FB5A72; }

/* ===== 生成页常驻模型档位切换器（管理端 topbar + 用户端画面设置）===== */
/* 模型族切换器（顶栏胶囊）。基座 = 管理端浅色（先删深色旧值改写；用户端深色在下方 .user-mode 覆盖） */
.model-switcher { display: inline-flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid #dde5f0; border-radius: 11px; background: #fff; box-shadow: 0 2px 10px rgba(23,34,49,.07); }
.model-switcher .ms-chip { position: relative; min-width: 62px; height: 32px; padding: 0 13px; border: 0; border-radius: 8px; background: transparent; color: #718096; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: color .18s ease, background .18s ease, box-shadow .18s ease; }
.model-switcher .ms-chip:hover { color: #3267e3; background: #f0f5ff; }
.model-switcher .ms-chip.active { background: linear-gradient(135deg, #3267e3, #2b57c8); color: #fff; box-shadow: 0 2px 8px rgba(50,103,227,.3); }
/* 用户端（深色驾驶舱）：通栏全宽 + 深色容器 */
.user-mode .model-switcher { width: 100%; justify-content: space-between; background: #0D1728; border-color: #283B5D; box-shadow: none; }
.user-mode .model-switcher .ms-chip { flex: 1; color: #8291A8; }
.user-mode .model-switcher .ms-chip:hover { color: #C6D4EA; background: rgba(59,130,246,.1); }
.user-mode .model-switcher .ms-chip.active { background: linear-gradient(135deg, #61A9FF, #4B8EFC 50%, #2E6EF2); color: #fff; box-shadow: 0 2px 8px rgba(59,130,246,.35); }
/* 窄屏 topbar 收起竖排切换器（压缩空间） */
@media (max-width: 900px) {
  .model-switcher { font-size: 12px; }
  .model-switcher .ms-chip { min-width: 48px; padding: 0 8px; font-size: 12px; }
}

/* ===== 侧边栏「模型管理」视图（两级联动：模型族 + SD 子档）v20260907 浅色统一 ===== */
.model-manage-body { max-width: 860px; }
.model-manage-list { display: flex; flex-direction: column; gap: 22px; }
/* 第一级：模型族卡片（浅色卡，与工作台一致） */
.mg-fams { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.mg-fam { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border: 1px solid #e4eaf2; border-radius: 14px; background: #fff; color: #718096; text-align: left; cursor: pointer; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; box-shadow: 0 2px 10px rgba(23,34,49,.05); }
.mg-fam:hover { border-color: #9db8ea; box-shadow: 0 6px 18px rgba(23,34,49,.09); transform: translateY(-2px); }
.mg-fam.active { border-color: #3267e3; background: #f4f8ff; box-shadow: inset 3px 0 0 #3267e3, 0 6px 18px rgba(50,103,227,.1); color: #2453c5; }
.mg-fam-name { font-size: 15px; font-weight: 700; color: inherit; }
.mg-fam-desc { font-size: 12px; color: #8a94a6; }
.mg-fam-check { margin-top: 6px; font-size: 12px; font-weight: 600; color: #3267e3; }
/* 第二级：SD 子档 */
.mg-tiers { padding-top: 4px; }
.mg-tiers.hidden { display: none; }
.mg-tier-title { margin-bottom: 10px; font-size: 14px; font-weight: 700; color: #3a4a61; }
.mg-tier-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.mg-tier { position: relative; display: flex; flex-direction: column; gap: 5px; padding: 15px 18px; border: 1px solid #e4eaf2; border-radius: 12px; background: #fff; color: #718096; text-align: left; cursor: pointer; transition: border-color .18s ease, box-shadow .18s ease; box-shadow: 0 1px 6px rgba(23,34,49,.04); }
.mg-tier:hover { border-color: #9db8ea; box-shadow: 0 4px 14px rgba(23,34,49,.08); }
.mg-tier.active { border-color: #3267e3; background: #f4f8ff; color: #2453c5; box-shadow: inset 3px 0 0 #3267e3; }
.mg-tier-name { font-size: 14px; font-weight: 700; color: inherit; }
.mg-tier-res { font-size: 12px; color: #8a94a6; }
.mg-tier-check { margin-top: 4px; font-size: 12px; font-weight: 600; color: #3267e3; }
.mg-note { margin-top: 8px; padding: 12px 14px; border: 1px dashed #cfd9ea; border-radius: 10px; font-size: 12px; color: #8a94a6; line-height: 1.6; background: #fafbfd; }

/* ===== 算力费率面板（v20260907：模型管理页底部，浅色卡片表） ===== */
.mg-pricing { margin-top: 26px; border: 1px solid #e4eaf2; border-radius: 16px; background: #fff; box-shadow: 0 2px 10px rgba(23,34,49,.05); overflow: hidden; }
.mg-pricing-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 20px; border-bottom: 1px solid #eef2f8; }
.mg-pricing-title h3 { margin: 0 0 3px; font-size: 15px; font-weight: 700; color: #172231; }
.mg-pricing-title span { font-size: 11px; color: #8a94a6; line-height: 1.6; }
.mg-pricing-loading { padding: 26px 20px; text-align: center; font-size: 12px; color: #8a94a6; }
.rate-scroll { overflow-x: auto; }
.rate-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rate-table thead th { background: #f8fafd; color: #5b6b81; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-align: left; padding: 9px 20px; border-bottom: 1px solid #e4eaf2; white-space: nowrap; }
.rate-table tbody td { padding: 8px 20px; border-bottom: 1px solid #f0f3f8; color: #3a4a61; vertical-align: middle; }
.rate-table tbody tr:last-child td { border-bottom: 0; }
.rate-table tbody tr:hover { background: #fafcff; }
.rt-model { font-weight: 600; color: #172231; white-space: nowrap; }
.rt-res { font-family: Consolas, monospace; font-size: 12px; color: #3267e3; background: #edf3ff; padding: 1px 8px; border-radius: 999px; }
.rt-input { width: 92px; height: 32px; padding: 0 10px; border: 1px solid #dce3ec; border-radius: 8px; outline: 0; color: #172231; background: #fff; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; transition: border .2s, box-shadow .2s; }
.rt-input:focus { border-color: #3267e3; box-shadow: 0 0 0 3px rgba(50,103,227,.12); }
.rt-hint em { font-style: normal; font-size: 11px; color: #a0aab8; }
.rate-default-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 20px; background: #f8fafd; border-top: 1px solid #eef2f8; font-size: 12px; color: #5b6b81; }
.rate-default-row input { width: 92px; height: 30px; padding: 0 10px; border: 1px solid #dce3ec; border-radius: 8px; outline: 0; color: #172231; background: #fff; font-size: 13px; font-weight: 600; }
.rate-default-row input:focus { border-color: #3267e3; box-shadow: 0 0 0 3px rgba(50,103,227,.12); }
.rate-default-row em { font-style: normal; font-size: 11px; color: #8a94a6; }

/* ===== 批次提示词查看弹层（v20260907：管理表格「查看提示词」） ===== */
.bp-card { width: min(640px, 100%); }
.bp-list { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow-y: auto; padding-right: 2px; }
.bp-item { display: flex; gap: 11px; padding: 11px 13px; border: 1px solid #e4eaf2; border-radius: 10px; background: #fafbfd; }
.bp-no { flex: 0 0 auto; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: #edf3ff; color: #3267e3; font-family: Consolas, monospace; font-size: 11px; font-weight: 700; }
.bp-body { min-width: 0; }
.bp-body p { margin: 0 0 5px; font-size: 13px; line-height: 1.7; color: #2a3648; white-space: pre-wrap; word-break: break-word; }
.bp-body em { font-style: normal; font-size: 11px; color: #8a94a6; }
.bp-empty { color: #a0aab8; }
.bp-empty-note { padding: 26px; text-align: center; color: #8a94a6; font-size: 12px; }
.bp-notes { margin-top: 12px; padding: 10px 13px; border-left: 3px solid #d8a059; background: #fffaf3; color: #8a6a3a; font-size: 12px; line-height: 1.7; border-radius: 0 8px 8px 0; }
.bp-mats { margin-top: 10px; font-size: 12px; color: #8a94a6; }

/* ===== 用户端任务卡片底部操作（开始生成 / 再次制作 / 下载视频）===== */
.cover-actions { display: flex; gap: 8px; padding: 0 2px; }
.cover-action { flex: 1; min-height: 34px; padding: 0 10px; border: 1px solid #283B5D; border-radius: 9px; background: transparent; color: #8291A8; font-size: 12.5px; font-weight: 600; cursor: pointer; transition: color .18s ease, background .18s ease, border-color .18s ease; white-space: nowrap; }
.cover-action:hover { border-color: rgba(128,158,205,.5); color: #C6D4EA; background: rgba(28,47,80,.5); }
.cover-action.primary { border-color: #3B82F6; background: rgba(59,130,246,.12); color: #EAF1FF; }
.cover-action.primary:hover { background: rgba(59,130,246,.2); border-color: #3B82F6; }
.cover-action:disabled { opacity: .5; cursor: not-allowed; }





/* =========================================================
/* ===== 生成记录弹层列表（v20260907 补漏：此前 records-* 无任何样式） ===== */
.records-tip { margin: -10px 0 14px; font-size: 12px; color: #8291A8; }
.records-body { display: flex; flex-direction: column; gap: 8px; max-height: 48vh; overflow-y: auto; padding-right: 2px; }
.records-item { display: block; width: 100%; padding: 11px 13px; border: 1px solid #1e2e4a; border-radius: 12px; background: #0E1B2E; cursor: pointer; text-align: left; transition: border-color .15s ease, background .15s ease; }
.records-item:hover { border-color: #3B82F6; background: #122441; }
.records-main { display: flex; align-items: center; gap: 9px; min-width: 0; }
.records-status { flex: 0 0 auto; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.records-status.draft { background: rgba(130,145,168,.12); color: #9FB0C8; }
.records-status.running { background: rgba(59,130,246,.14); color: #6FB1FF; }
.records-status.interrupted { background: rgba(245,158,11,.13); color: #F5A524; }
.records-status.failed { background: rgba(251,90,114,.12); color: #FB5A72; }
.records-status.completed { background: rgba(45,212,191,.12); color: #2DD4BF; }
.records-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; color: #E7EEF7; }
.records-meta { margin-top: 5px; font-size: 11px; color: #8291A8; }
.records-empty { padding: 30px 12px; text-align: center; font-size: 12px; color: #8291A8; }
.records-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; }
.recs-page-btn { height: 28px; padding: 0 12px; border: 1px solid #283B5D; border-radius: 8px; background: #0E1B2E; color: #C6D4EA; font-size: 12px; cursor: pointer; transition: all .15s; }
.recs-page-btn:hover:not(:disabled) { border-color: #3B82F6; color: #fff; }
.recs-page-btn:disabled { opacity: .45; cursor: not-allowed; }
.recs-page-info { font-size: 11px; color: #8291A8; font-variant-numeric: tabular-nums; }
/* 预览浮层信息徽章（v20260907 补漏：条数 / 时长 chip） */
.task-preview-num, .task-preview-dur { padding: 1px 8px; border-radius: 999px; background: rgba(59,130,246,.1); color: #8FBAFF; font-size: 11px; font-weight: 600; white-space: nowrap; }

/* =========================================================
   任务清单（管理端浅色）：状态筛选分段 + 批次卡片流
   ========================================================= */
/* —— 状态分段（全部 + 4 状态；样式同视图切换胶囊） —— */
.tv-switch { display: inline-flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid #dde5f0; border-radius: 10px; background: #fff; box-shadow: 0 2px 8px rgba(23,34,49,.06); }
.tv-seg { height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: #718096; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: all .15s; }
.tv-seg:hover { color: #3267e3; background: #f0f5ff; }
.tv-seg.active { background: linear-gradient(135deg, #3267e3, #2b57c8); color: #fff; box-shadow: 0 2px 7px rgba(50,103,227,.28); }

/* —— 卡片流（批次卡） —— */
.tc-list { display: flex; flex-direction: column; gap: 14px; max-width: 1180px; }
.tc-card { border: 1px solid #e4eaf2; border-radius: 14px; background: #fff; box-shadow: 0 2px 10px rgba(23,34,49,.05); overflow: hidden; transition: border-color .15s ease, box-shadow .15s ease; }
.tc-card:hover { border-color: #b9cdf2; box-shadow: 0 6px 18px rgba(23,34,49,.09); }
.tc-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 11px 16px; border-bottom: 1px solid #eef2f8; background: #fbfcfe; }
.tc-id { font-family: 'Segoe UI', Consolas, monospace; font-size: 13px; font-weight: 700; color: #2453c5; background: #e8f0ff; border: 1px solid #d3e2fb; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.tc-time { font-size: 11.5px; color: #8a94a6; white-space: nowrap; }
.tc-user { font-size: 12px; color: #47566b; font-weight: 600; white-space: nowrap; }
.tc-model { font-size: 11px; color: #8a94a6; background: #f2f5fa; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.tc-grow { flex: 1; }
.tc-acts { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.tc-body { padding: 8px 16px 12px; }
.pr-row { display: flex; gap: 11px; padding: 8px 0; border-bottom: 1px dashed #eef2f8; align-items: flex-start; }
.pr-row:last-child { border-bottom: 0; }
.pr-idx { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: #edf3ff; color: #3267e3; font-family: Consolas, monospace; font-size: 11px; font-weight: 700; }
.pr-main { flex: 1; min-width: 0; }
.pr-text { font-size: 12.5px; color: #2f3f56; line-height: 1.6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pr-qty { font-size: 11px; color: #a0aab8; margin-top: 1px; }
.pr-empty { color: #a0aab8; }
.tc-vids { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tch { display: inline-flex; align-items: center; gap: 6px; height: 24px; max-width: 100%; padding: 0 4px 0 8px; border: 1px solid #e4eaf2; border-radius: 999px; background: #fff; font-size: 11px; color: #5b6b81; }
.tch i { font-style: normal; font-family: Consolas, monospace; font-size: 10px; color: #a0aab8; flex: none; }
.tch a { color: #2f3f56; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.tch a:hover { color: #3267e3; text-decoration: underline; }
.tch button { display: grid; place-items: center; width: 18px; height: 18px; border: 0; border-radius: 5px; background: transparent; color: #8a94a6; cursor: pointer; flex: none; }
.tch button:hover { background: #eef2f8; color: #3267e3; }
.tch button svg { width: 12px; height: 12px; }
.tch-done { border-color: #cfe9dc; background: #f4fbf7; }
.tch-done a { color: #177a4c; }
.tch-run { border-color: #cddcf8; background: #f3f7ff; color: #2453c5; }
.tch-wait { color: #8a94a6; background: #fafbfd; }
.tch-fail { border-color: #f5cdcd; background: #fff5f5; color: #b94242; }
.tc-more { margin: 8px 0 2px 35px; border: 0; background: none; padding: 0; color: #3267e3; font-size: 12px; font-weight: 600; cursor: pointer; }
.tc-more:hover { text-decoration: underline; }
.tc-err { margin: 8px 16px 0; padding: 7px 11px; border-left: 3px solid #d94b4b; background: #fff5f5; color: #b94242; font-size: 11.5px; border-radius: 0 8px 8px 0; }
.bar { display: inline-block; width: 76px; height: 4px; border-radius: 4px; background: #e8edf4; overflow: hidden; vertical-align: middle; margin-left: 8px; }
.bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #3267e3, #5b8cff); }

/* —— 提示词详情弹层：产出下载区 —— */
.bp-dls { margin-top: 12px; }
.bp-dls-t { display: block; margin-bottom: 7px; font-size: 11px; font-weight: 700; color: #5b6b81; }
.bp-dl-list { display: flex; flex-wrap: wrap; gap: 6px; }
.bp-dls .t-dl-chip { background: #f4f8ff; }

/* 看板列：桌面 4 列，窄屏自动降列 */

/* —— 状态筛选行（全部 + 4 状态） —— */
.flt-row { display: flex; align-items: center; gap: 12px; max-width: 1180px; margin: -10px 0 14px; }
.flt-count { font-size: 12px; color: #8a94a6; font-variant-numeric: tabular-nums; }

/* —— 卡片提示词 = 可点击链接 —— */
.pr-link { cursor: pointer; }
.pr-link:hover { color: #2453c5; text-decoration: underline; }
.tc-list .pr-text.pr-link { color: #2f5cb8; }

/* —— 提示词浮层行操作 —— */
.bp-ops { display: inline-flex; gap: 6px; margin-left: 10px; vertical-align: middle; }
.bp-ops button { border: 1px solid #d3e2fb; background: #f4f8ff; color: #3267e3; border-radius: 6px; padding: 2px 9px; font-size: 11px; font-weight: 600; cursor: pointer; transition: all .15s; }
.bp-ops button:hover { background: #3267e3; color: #fff; border-color: #3267e3; }
.bp-item.flash { border-color: #3267e3; box-shadow: 0 0 0 3px rgba(50,103,227,.18); transition: box-shadow .2s ease, border-color .2s ease; }
.bp-item .bp-body p { display: block; }
@media (max-width: 620px) {
  .bp-ops { margin: 6px 0 0; display: flex; }
}

/* ===== 任务卡无封面：状态形象（v20260907，四态图 + 轻动效） =====
   有真实封面直接展示；无封面时 cover-photo 承接封面区，图片 pc/mobile 两档由 <picture> 切。 */
.cover-photo { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; overflow: hidden; }
/* 形象定位：静态态（未开始 / 失败 / 已完成无封面）垂直居中。
   生成中态例外 —— 卡片中心已被进度环 .cover-gen 占用，形象贴底避免与其重叠（见 .sp-running）。 */
.cover-photo picture { display: block; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.cover-photo .sp-art { display: block; width: 100%; filter: drop-shadow(0 8px 18px rgba(0,0,0,.35)); }
.cover-photo.sp-pending  { background: linear-gradient(165deg, #221a40 0%, #332a63 55%, #241a44 100%); }
.cover-photo.sp-pending picture { width: 54%; }
.cover-photo.sp-running  { background: linear-gradient(165deg, #182040 0%, #2a3a68 55%, #1a2446 100%); }
.cover-photo.sp-running picture { top: auto; bottom: 2%; transform: translateX(-50%); width: 42%; }
.cover-photo.sp-failed   { background: linear-gradient(165deg, #361c30 0%, #4a2340 60%, #2e1628 100%); }
.cover-photo.sp-failed picture { width: 52%; }
.cover-photo.sp-cover    { background: linear-gradient(165deg, #121a2c 0%, #22304e 60%, #141d33 100%); }
.cover-photo.sp-cover picture { width: 56%; }
/* 轻动效：漂浮/轻摇/呼吸（克制，尊重减弱动态设置） */
.sp-pending .sp-art { animation: artFloat 3.8s ease-in-out infinite, artBreathe 5s ease-in-out infinite; }
.sp-running .sp-art { animation: artFloat 2.7s ease-in-out infinite, artSway 3.6s ease-in-out .3s infinite; }
.sp-failed .sp-art { animation: artBreathe 3s ease-in-out infinite, artFloatSoft 4.6s ease-in-out infinite; }
.sp-cover .sp-art { animation: artFloat 5.2s ease-in-out infinite, artBreathe 6s ease-in-out infinite; }
@keyframes artFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes artFloatSoft { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes artSway { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(2.4deg); } }
@keyframes artBreathe { 0%, 100% { opacity: 1; } 50% { opacity: .8; } }
@media (prefers-reduced-motion: reduce) { .cover-photo .sp-art { animation: none; } }
