/* ============ 主题变量（与 hub 对齐时只改这里） ============ */
:root {
  --bg: #070608;
  --bg-soft: #0b0a0e;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-border: rgba(232, 179, 57, 0.18);
  --gold: #e8b339;
  --gold-light: #ffd98a;
  --gold-deep: #b07e2a;
  --text: #f3eee2;
  --text-dim: #b8ad97;
  --text-faint: #6d6350;
  --green: #4ade80;
  --red: #f87171;
  --blue: #7fb8e8;
  --radius: 16px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* ============ 浅色暖白主题（跟随 hub 晨曦金/白天主题） ============ */
body[data-theme="light"] {
  --bg: #fdf8ee;
  --bg-soft: #faf2e0;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-border: rgba(180, 130, 40, 0.18);
  --gold: #d97706;
  --gold-light: #f59e0b;
  --gold-deep: #b45309;
  --text: #3a2e18;
  --text-dim: #7c6a45;
  --text-faint: #a8946b;
  --green: #059669;
  --red: #e11d48;
  --blue: #2563eb;
  --shadow: 0 18px 46px -20px rgba(120, 80, 10, 0.35);
}

/* ============ 显式曜石黑金主题（与 :root 默认一致，便于程序化切换） ============ */
body[data-theme="blackgold"] {
  --bg: #070608;
  --bg-soft: #0b0a0e;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-border: rgba(232, 179, 57, 0.18);
  --gold: #e8b339;
  --gold-light: #ffd98a;
  --gold-deep: #b07e2a;
  --text: #f3eee2;
  --text-dim: #b8ad97;
  --text-faint: #6d6350;
  --green: #4ade80;
  --red: #f87171;
  --blue: #7fb8e8;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* ============ 深空科技蓝主题 ============ */
body[data-theme="midnight"] {
  --bg: #05070f;
  --bg-soft: #080c18;
  --panel: rgba(127, 184, 232, 0.05);
  --panel-border: rgba(127, 184, 232, 0.2);
  --gold: #5ea8e8;
  --gold-light: #9fd0ff;
  --gold-deep: #2f6db0;
  --text: #e8f0fb;
  --text-dim: #9fb2c8;
  --text-faint: #5a6b80;
  --green: #34d399;
  --red: #fb7185;
  --blue: #7fb8e8;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}
body[data-theme="midnight"] .orb1 { background: rgba(94, 168, 232, 0.16); }
body[data-theme="midnight"] .orb2 { background: rgba(47, 109, 176, 0.18); }
body[data-theme="midnight"] .orb3 { background: rgba(30, 60, 120, 0.14); }

/* ---- 浅色主题：组件硬编码覆盖（深色底/白字 → 暖白底/深字） ---- */
body[data-theme="light"] .bg-orb { opacity: .55; }
body[data-theme="light"] .topbar {
  background: rgba(250, 244, 232, 0.82);
  border-bottom-color: rgba(180, 130, 40, 0.16);
}
body[data-theme="light"] .brand-mark { text-shadow: none; }
body[data-theme="light"] input,
body[data-theme="light"] textarea {
  background: rgba(255, 255, 255, 0.85);
  border-color: rgba(180, 130, 40, 0.22); color: var(--text);
}
body[data-theme="light"] .seg { background: rgba(218, 200, 160, 0.35); }
body[data-theme="light"] .seg-btn.active { color: var(--gold-deep); }
body[data-theme="light"] .history-item { background: rgba(255, 255, 255, 0.7); }
body[data-theme="light"] .history-item:hover { background: rgba(232, 179, 57, 0.12); }
body[data-theme="light"] .history-item.active { background: rgba(232, 179, 57, 0.18); }
body[data-theme="light"] .art-preview { background: rgba(255, 255, 255, 0.6); }
body[data-theme="light"] .art-preview iframe { background: #fdf8ee; }
body[data-theme="light"] .adv-toggle { background: rgba(255, 255, 255, 0.72); }
body[data-theme="light"] .opt-cell { background: rgba(255, 255, 255, 0.72); }
body[data-theme="light"] .voice-row select { background: rgba(255, 255, 255, 0.85); }
body[data-theme="light"] .modal-mask { background: rgba(90, 66, 24, 0.4); }
body[data-theme="light"] .modal {
  background: linear-gradient(160deg, #ffffff, #faf2e0);
}
body[data-theme="light"] .prompt-select { background-color: rgba(255, 255, 255, 0.85); }
body[data-theme="light"] .prompt-select option { background: #fff; color: var(--text); }
body[data-theme="light"] .prompt-select optgroup { background: #faf2e0; color: var(--gold-deep); }
body[data-theme="light"] .custom-toggle { background: rgba(255, 255, 255, 0.72); }
body[data-theme="light"] .avatar-card { background: rgba(255, 255, 255, 0.7); }
body[data-theme="light"] .cost-duration input { background: rgba(255, 255, 255, 0.85); }
body[data-theme="light"] .cost-box { background: rgba(255, 255, 255, 0.72); }
body[data-theme="light"] .filter-chip { background: rgba(255, 255, 255, 0.72); }
body[data-theme="light"] .avatar-fold { background: rgba(255, 255, 255, 0.6); }
body[data-theme="light"] .avatar-modal-mask { background: rgba(90, 66, 24, 0.5); }
body[data-theme="light"] .avatar-modal { background: linear-gradient(160deg, #ffffff, #fdf6e6); }
body[data-theme="light"] .batch-progress { background: rgba(255, 255, 255, 0.72); }
body[data-theme="light"] .bp-row { background: rgba(255, 253, 247, 0.9); }
body[data-theme="light"] .toast {
  background: rgba(255, 252, 244, 0.97); color: var(--text);
  border-color: var(--gold);
}
body[data-theme="light"] .node-icon { background: rgba(232, 179, 57, 0.14); }
body[data-theme="light"] .node-bar { background: rgba(180, 130, 40, 0.18); }
body[data-theme="light"] .cap-row { border-bottom-color: rgba(180, 130, 40, 0.12); }
body[data-theme="light"] .cap-state.idle { background: rgba(180, 130, 40, 0.12); }
body[data-theme="light"] .roi-setting input { background: rgba(255, 255, 255, 0.85); }
body[data-theme="light"] .human-alert { color: #b91c1c; }
body[data-theme="light"] .human-alert.ok { color: #047857; }
body[data-theme="light"] .st-done .bp-status { color: #047857; }
body[data-theme="light"] .st-fail .bp-status { color: #be123c; }
body[data-theme="light"] .pdf-placeholder {
  background: linear-gradient(135deg, rgba(232, 179, 57, 0.14), rgba(255, 255, 255, 0.4));
}
body[data-theme="light"] .pdf-placeholder:hover {
  background: linear-gradient(135deg, rgba(232, 179, 57, 0.24), rgba(255, 255, 255, 0.6));
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: "Noto Sans CJK SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

/* ============ 背景光晕 ============ */
.bg-orb {
  position: fixed; border-radius: 50%; filter: blur(90px);
  z-index: 0; pointer-events: none;
}
.orb1 { width: 480px; height: 480px; background: rgba(232, 179, 57, 0.14);
        top: -180px; right: 8%; }
.orb2 { width: 420px; height: 420px; background: rgba(138, 109, 31, 0.16);
        bottom: -160px; left: -100px; }
.orb3 { width: 360px; height: 360px; background: rgba(90, 70, 20, 0.12);
        top: 40%; left: 45%; }

/* ============ 金属文字 ============ */
.gold-text {
  background: linear-gradient(120deg, var(--gold-light) 0%, var(--gold) 45%,
              var(--gold-deep) 70%, var(--gold-light) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ============ 顶部导航 ============ */
.topbar {
  position: relative; z-index: 2;
  height: 72px; padding: 0 28px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(232, 179, 57, 0.12);
  background: rgba(7, 6, 8, 0.6);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  font-size: 26px; color: var(--gold);
  text-shadow: 0 0 20px rgba(232, 179, 57, 0.6);
}
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: 1px; }
.brand-sub { font-size: 10px; letter-spacing: 4px; color: var(--text-faint); margin-top: 2px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.mode-pill {
  font-size: 12px; padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--panel-border); color: var(--text-dim);
  background: var(--panel);
}
.version { font-size: 12px; color: var(--text-faint); letter-spacing: 1px; }

/* ============ 应用根：补齐高度链，使内部双栏可独立滚动 ============ */
#appRoot {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ============ 布局 ============ */
.layout {
  position: relative; z-index: 1;
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
}

/* ============ 侧栏 ============ */
.sidebar {
  width: 360px; flex: 0 0 360px;
  padding: 22px; overflow-y: auto;
  min-height: 0;
  border-right: 1px solid rgba(232, 179, 57, 0.1);
}
.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 20px; margin-bottom: 18px;
  backdrop-filter: blur(10px);
}
.panel-title {
  font-size: 14px; font-weight: 700; letter-spacing: 1px;
  color: var(--gold-light); margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.panel-title::before {
  content: ""; width: 4px; height: 14px; border-radius: 2px;
  background: linear-gradient(var(--gold-light), var(--gold-deep));
}

.field { display: block; margin-bottom: 16px; }
.field > span {
  display: block; font-size: 12px; color: var(--text-dim);
  margin-bottom: 8px; letter-spacing: 1px;
}
input, textarea {
  width: 100%; background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(232, 179, 57, 0.15);
  border-radius: 10px; padding: 11px 13px;
  color: var(--text); font-size: 13px; font-family: inherit;
  outline: none; transition: border-color .2s, box-shadow .2s;
}
input:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232, 179, 57, 0.12);
}
textarea { resize: vertical; line-height: 1.7; }

/* 分段选择 */
.seg { display: flex; gap: 6px; background: rgba(0, 0, 0, 0.3);
       border-radius: 10px; padding: 4px; }
.seg-btn {
  flex: 1; padding: 9px 4px; border: none; border-radius: 8px;
  background: transparent; color: var(--text-dim);
  font-size: 12px; font-family: inherit; cursor: pointer;
  transition: all .2s;
}
.seg-btn.active {
  background: linear-gradient(135deg, rgba(232, 179, 57, 0.25), rgba(232, 179, 57, 0.1));
  color: var(--gold-light); font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(232, 179, 57, 0.35);
}

/* 金色按钮 */
.btn-gold {
  width: 100%; padding: 14px; border: none; border-radius: 12px;
  background: linear-gradient(135deg, var(--gold-light), var(--gold) 50%, var(--gold-deep));
  color: #1a1505; font-size: 14px; font-weight: 800; font-family: inherit;
  cursor: pointer; letter-spacing: 1px;
  box-shadow: 0 8px 24px rgba(232, 179, 57, 0.3);
  transition: transform .15s, box-shadow .2s;
}
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 12px 30px rgba(232, 179, 57, 0.45); }
.btn-gold:active { transform: translateY(0); }
.btn-gold:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* 历史列表 */
.history { display: flex; flex-direction: column; gap: 8px; }
.history-item {
  padding: 12px 14px; border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid transparent;
  cursor: pointer; transition: all .2s;
}
.history-item:hover { border-color: var(--panel-border); background: rgba(232, 179, 57, 0.06); }
.history-item.active { border-color: var(--gold); background: rgba(232, 179, 57, 0.1); }
.history-item .h-name { font-size: 13px; font-weight: 600; margin-bottom: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-item .h-meta { display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-faint); }
.empty-hint { font-size: 12px; color: var(--text-faint); text-align: center; padding: 14px 0; }

/* 迷你状态点 */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.completed { background: var(--green); box-shadow: 0 0 8px var(--green); }
.dot.running { background: var(--gold); box-shadow: 0 0 8px var(--gold); animation: pulse 1s infinite; }
.dot.failed { background: var(--red); box-shadow: 0 0 8px var(--red); }
.dot.created { background: var(--text-faint); }

/* ============ 主区域 ============ */
.main { flex: 1; padding: 28px; overflow-y: auto; min-height: 0; }

/* 欢迎页 */
.welcome {
  height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center;
}
.welcome-mark { font-size: 56px; color: var(--gold);
  text-shadow: 0 0 40px rgba(232, 179, 57, 0.5); margin-bottom: 24px; }
.welcome h1 { font-size: 34px; font-weight: 900; margin-bottom: 16px; }
.welcome p { color: var(--text-dim); font-size: 15px; margin-bottom: 34px; }
.feature-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.feature-chip {
  padding: 10px 20px; border-radius: 999px; font-size: 13px;
  border: 1px solid var(--panel-border); background: var(--panel);
  color: var(--gold-light);
}

/* 详情头 */
.detail-head { display: flex; justify-content: space-between;
  align-items: flex-start; margin-bottom: 26px; }
.detail-head h2 { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.detail-meta { display: flex; gap: 14px; font-size: 12px; color: var(--text-dim); }
.status-badge {
  padding: 8px 18px; border-radius: 999px; font-size: 13px; font-weight: 700;
}
.status-badge.completed { background: rgba(74, 222, 128, 0.12); color: var(--green);
  border: 1px solid rgba(74, 222, 128, 0.3); }
.status-badge.running { background: rgba(232, 179, 57, 0.12); color: var(--gold-light);
  border: 1px solid rgba(232, 179, 57, 0.3); }
.status-badge.failed { background: rgba(248, 113, 113, 0.12); color: var(--red);
  border: 1px solid rgba(248, 113, 113, 0.3); }
.status-badge.created { background: var(--panel); color: var(--text-dim);
  border: 1px solid var(--panel-border); }

/* 流水线节点 */
.pipeline {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 14px; margin-bottom: 30px;
}
.node {
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 14px; padding: 16px 18px;
  display: flex; align-items: center; gap: 13px;
  transition: border-color .2s;
}
.node.running { border-color: var(--gold); box-shadow: 0 0 24px rgba(232, 179, 57, 0.15); }
.node.failed { border-color: rgba(248, 113, 113, 0.5); }
.node.success { border-color: rgba(74, 222, 128, 0.3); }
.node-icon {
  width: 38px; height: 38px; border-radius: 10px; flex: 0 0 38px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; background: rgba(255, 255, 255, 0.05);
}
.node.success .node-icon { background: rgba(74, 222, 128, 0.15); }
.node.running .node-icon { background: rgba(232, 179, 57, 0.18); }
.node.failed .node-icon { background: rgba(248, 113, 113, 0.15); }
.node-body { flex: 1; min-width: 0; }
.node-label { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.node-msg { font-size: 11px; color: var(--text-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.node-bar { height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.07);
  margin-top: 7px; overflow: hidden; }
.node-bar-fill { height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, var(--gold-light), var(--gold));
  transition: width .4s; }
.spinner {
  width: 15px; height: 15px; border: 2px solid rgba(232, 179, 57, 0.25);
  border-top-color: var(--gold); border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* 产物区 */
.artifacts-title { font-size: 15px; font-weight: 700; margin-bottom: 16px;
  color: var(--gold-light); display: flex; align-items: center; gap: 8px; }
.artifacts-title::before { content: ""; width: 4px; height: 15px; border-radius: 2px;
  background: linear-gradient(var(--gold-light), var(--gold-deep)); }
.art-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.art-card {
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 14px; overflow: hidden;
}
.art-card.wide { grid-column: span 2; }
.art-preview { background: rgba(0, 0, 0, 0.35); }
.art-preview img { width: 100%; display: block; }
.art-preview video { width: 100%; display: block; }
.art-preview iframe { width: 100%; height: 420px; border: none; background: #111; }
.art-preview audio { width: 100%; padding: 16px; }
.pdf-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; min-height: 240px; text-decoration: none;
  background: linear-gradient(135deg, rgba(232, 179, 57, 0.1), rgba(255, 255, 255, 0.02));
  transition: background .2s;
}
.pdf-placeholder:hover { background: linear-gradient(135deg, rgba(232, 179, 57, 0.2), rgba(255, 255, 255, 0.04)); }
.pdf-icon {
  width: 72px; height: 88px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 20px; color: #1a1505;
  background: linear-gradient(135deg, var(--gold-light), var(--gold-deep));
  box-shadow: 0 10px 26px rgba(232, 179, 57, 0.35);
}
.pdf-hint { font-size: 13px; color: var(--gold-light); letter-spacing: 1px; }
.art-preview .pre-block {
  max-height: 320px; overflow: auto; padding: 16px;
  font-size: 12px; line-height: 1.8; color: var(--text-dim);
  white-space: pre-wrap; font-family: inherit;
}
.art-info { padding: 13px 16px; display: flex;
  justify-content: space-between; align-items: center; gap: 10px; }
.art-name { font-size: 13px; font-weight: 600; }
.art-type { font-size: 10px; color: var(--text-faint); }
.art-link {
  font-size: 12px; padding: 6px 14px; border-radius: 8px; text-decoration: none;
  border: 1px solid var(--panel-border); color: var(--gold-light);
  transition: background .2s; white-space: nowrap;
}
.art-link:hover { background: rgba(232, 179, 57, 0.12); }

/* Toast */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: rgba(11, 10, 14, 0.95); border: 1px solid var(--gold);
  padding: 13px 26px; border-radius: 12px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: all .3s; z-index: 100;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 动画 */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(232, 179, 57, 0.25); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(232, 179, 57, 0.45); }

/* ============ 幽灵按钮 ============ */
.ghost-btn {
  font-size: 12px; padding: 7px 16px; border-radius: 999px;
  border: 1px solid var(--panel-border); color: var(--gold-light);
  background: var(--panel); font-family: inherit; cursor: pointer;
  transition: all .2s;
}
.ghost-btn:hover { background: rgba(232, 179, 57, 0.15); }

/* ============ 三段选择 ============ */
.seg3 .seg-btn { font-size: 11px; padding: 9px 2px; }

/* ============ 高级设置折叠 ============ */
.adv-toggle {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; border-radius: 10px; margin-bottom: 4px;
  background: rgba(0, 0, 0, 0.25); border: 1px solid var(--panel-border);
  font-size: 12px; color: var(--gold-light); cursor: pointer;
}
.adv-chevron { transition: transform .25s; color: var(--gold); }
.adv-body {
  max-height: 0; overflow: hidden; transition: max-height .35s ease;
}
.adv-body.open { max-height: 1400px; padding-top: 10px; }

/* ============ 选项网格 ============ */
.opt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
#bgmGrid { grid-template-columns: 1fr 1fr; }
.opt-cell {
  padding: 10px 8px; border-radius: 10px; text-align: left;
  background: rgba(0, 0, 0, 0.28); border: 1px solid rgba(232, 179, 57, 0.12);
  color: var(--text-dim); font-family: inherit; cursor: pointer;
  transition: all .18s;
}
.opt-cell .opt-name { font-size: 12px; font-weight: 700; }
.opt-cell .opt-desc { font-size: 10px; color: var(--text-faint); margin-top: 3px; }
.opt-cell.active {
  background: linear-gradient(135deg, rgba(232, 179, 57, 0.22), rgba(232, 179, 57, 0.08));
  border-color: var(--gold); color: var(--gold-light);
  box-shadow: inset 0 0 0 1px rgba(232, 179, 57, 0.3);
}

/* ============ 开关 ============ */
.switch-row { display: flex; gap: 16px; }
.switch { display: flex; align-items: center; gap: 7px; font-size: 12px;
  color: var(--text-dim); cursor: pointer; }
.switch input { width: 16px; height: 16px; accent-color: var(--gold); }

/* 滑块 */
.range { padding: 0; background: transparent; border: none; accent-color: var(--gold); }
.field > span em { color: var(--gold); font-style: normal; font-weight: 700; }

/* ============ 音色选择 ============ */
.voice-pickers { display: flex; flex-direction: column; gap: 8px; }
.voice-row { display: flex; align-items: center; gap: 10px; }
.voice-label { flex: 0 0 52px; font-size: 11px; color: var(--text-dim); }
.voice-row select {
  flex: 1; padding: 8px 10px; border-radius: 8px; font-size: 12px;
  background: rgba(0, 0, 0, 0.35); border: 1px solid rgba(232, 179, 57, 0.15);
  color: var(--text); font-family: inherit; outline: none;
}

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
}
.modal-mask[hidden] { display: none; }
.modal {
  width: 560px; max-width: 92vw; max-height: 86vh; overflow: hidden;
  background: linear-gradient(160deg, #151219, #0b0a0e);
  border: 1px solid var(--panel-border); border-radius: 18px;
  box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.modal-head { display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; border-bottom: 1px solid rgba(232, 179, 57, 0.12); }
.modal-head h3 { font-size: 16px; color: var(--gold-light); }
.modal-close { background: none; border: none; color: var(--text-faint);
  font-size: 16px; cursor: pointer; }
.modal-body { padding: 18px 24px; overflow-y: auto; }
.modal-foot { padding: 14px 24px; font-size: 11px; color: var(--text-faint);
  border-top: 1px solid rgba(232, 179, 57, 0.1); line-height: 1.6; }
.cap-group { font-size: 12px; font-weight: 700; color: var(--gold);
  margin: 14px 0 8px; letter-spacing: 1px; }
.cap-group:first-child { margin-top: 0; }
.cap-row { display: flex; align-items: center; gap: 12px; padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.cap-name { flex: 1; font-size: 13px; }
.cap-state { font-size: 11px; font-weight: 700; padding: 4px 10px;
  border-radius: 999px; }
.cap-state.ready { color: var(--green); background: rgba(74, 222, 128, 0.1); }
.cap-state.idle { color: var(--text-faint); background: rgba(255, 255, 255, 0.05); }
.cap-extra { font-size: 10px; color: var(--text-faint); }

/* 纯音频双人模式 */
[hidden] { display: none !important; }   /* 防止 .field 等 display 覆盖 hidden */
.field-hint { font-size: 11px; color: var(--text-faint); margin-top: 7px; line-height: 1.5; }
.field-hint em { color: var(--gold); font-style: normal; font-weight: 700; }
.audio-only .field { margin-bottom: 15px; }
.audio-only .range { width: 100%; margin-top: 8px; }

/* ============ 编剧指令模板选择 ============ */
.prompt-select-wrap { position: relative; }
.prompt-select {
  width: 100%; padding: 11px 34px 11px 13px; border-radius: 10px;
  background-color: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(232, 179, 57, 0.18);
  color: var(--gold-light); font-size: 13px; font-family: inherit;
  outline: none; cursor: pointer; appearance: none;
  transition: border-color .2s, box-shadow .2s;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' stroke='%23d4af37' stroke-width='1.6' fill='none' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 13px center;
}
.prompt-select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232, 179, 57, 0.12);
}
.prompt-select option { background: #151219; color: var(--text); }
.prompt-select optgroup { background: #0b0a0e; color: var(--gold); font-weight: 700; }
.custom-toggle {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  margin-top: 9px; padding: 10px 13px; border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--panel-border);
  color: var(--text-dim); font-size: 12px; font-family: inherit;
  cursor: pointer; transition: all .2s;
}
.custom-toggle:hover { color: var(--gold-light); border-color: var(--gold); }
.custom-prompt { margin-top: 9px; }
#promptField.is-muted { opacity: .55; }
#promptField.is-muted .prompt-select,
#promptField.is-muted .custom-toggle { pointer-events: none; }

/* ============ 数字人形象 ============ */
.avatar-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-bottom: 10px;
}
.avatar-card {
  position: relative; padding: 0; border-radius: 12px; overflow: hidden;
  background: rgba(0, 0, 0, 0.3); cursor: pointer;
  border: 1.5px solid rgba(232, 179, 57, 0.15);
  transition: all .2s;
}
.avatar-card img {
  width: 100%; aspect-ratio: 3 / 4; object-fit: cover; display: block;
}
.avatar-card .avatar-name {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 16px 8px 7px; font-size: 11px; font-weight: 700;
  color: var(--text);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
}
.avatar-card .avatar-tag {
  position: absolute; top: 6px; left: 6px; font-size: 9px;
  padding: 2px 6px; border-radius: 6px;
  background: rgba(232, 179, 57, 0.85); color: #1a1505; font-weight: 800;
}
.avatar-card.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(232, 179, 57, 0.4), 0 8px 22px rgba(232, 179, 57, 0.25);
}
.custom-count-seg { margin-bottom: 10px; }
.custom-count-seg .seg-btn { flex: 1; padding: 8px; font-size: 11px; }
.avatar-upload-btn {
  width: 100%; padding: 11px; border-radius: 10px;
  border: 1px dashed rgba(232, 179, 57, 0.4);
  background: rgba(232, 179, 57, 0.05); color: var(--gold-light);
  font-size: 12px; font-family: inherit; cursor: pointer; transition: all .2s;
}
.avatar-upload-btn:hover { background: rgba(232, 179, 57, 0.12); border-color: var(--gold); }

/* 数字人就绪/告警提示 */
.human-alert {
  margin-top: 4px; padding: 10px 12px; border-radius: 10px;
  font-size: 11px; line-height: 1.6;
  border: 1px solid rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.08); color: #f3b4b4;
}
.human-alert.ok {
  border-color: rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.08); color: #a7f3c5;
}
.human-alert:empty { display: none; }

/* ============ 模型档位与成本预估 ============ */
.cost-panel {
  padding: 12px; border-radius: 12px;
  background: rgba(232, 179, 57, 0.05);
  border: 1px solid var(--panel-border);
}
.cost-duration {
  display: flex; align-items: center; gap: 8px; margin: 10px 0 4px;
  font-size: 12px; color: var(--text-dim);
}
.cost-duration input {
  width: 72px; padding: 6px 8px; border-radius: 8px;
  background: rgba(0, 0, 0, 0.3); border: 1px solid var(--panel-border);
  color: var(--gold-light); font-family: inherit; font-size: 13px;
}
.cost-duration em { color: var(--text-dim); font-style: normal; }
.cost-box {
  margin-top: 8px; padding: 10px; border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(232, 179, 57, 0.12);
}
.cost-tier-desc { font-size: 11px; color: var(--gold-light); margin-bottom: 8px; }
.cost-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 6px; font-size: 11px;
}
.cr-label { color: var(--text-dim); flex: 0 0 64px; }
.cr-model { flex: 1; color: var(--text); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.cr-cost { color: var(--gold-light); font-weight: 700; }
.cr-unit { font-size: 9px; color: var(--text-faint); margin: 2px 0 6px 64px; }
.cost-total {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 8px; padding-top: 10px;
  border-top: 1px solid rgba(232, 179, 57, 0.18);
  font-size: 12px; color: var(--text-dim);
}
.cost-total b { color: var(--gold-light); font-weight: 800; }
.cost-total-price b { font-size: 15px; }
.cost-foot { font-size: 9px; color: var(--text-faint); margin-top: 8px; line-height: 1.5; }

/* 形象分组与双人标签 */
.avatar-group-title {
  grid-column: 1 / -1; font-size: 11px; font-weight: 700;
  color: var(--gold); margin: 6px 0 2px; letter-spacing: 1px;
}
.avatar-card .avatar-desc {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 22px 8px 5px; font-size: 9px; color: var(--text-dim);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
}
.avatar-card .duo-tag {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #1a1505;
}

/* 形象筛选器 */
.avatar-filters {
  display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px;
}
.filter-row { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip {
  padding: 5px 12px; border-radius: 999px; font-size: 11px;
  font-family: inherit; cursor: pointer; color: var(--text-dim);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--panel-border);
  transition: all .18s;
}
.filter-chip:hover { color: var(--gold-light); border-color: rgba(232, 179, 57, 0.5); }
.filter-chip.active {
  color: #1a1505; font-weight: 800;
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  border-color: transparent;
}
.avatar-empty {
  grid-column: 1 / -1; padding: 22px 10px; text-align: center;
  font-size: 11px; color: var(--text-faint);
  border: 1px dashed var(--panel-border); border-radius: 10px;
}

/* ============ 数字人形象面板（置顶 + 折叠 + 全屏） ============ */
.avatar-panel-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
}
.avatar-panel-head > span { font-size: 13px; font-weight: 700; color: var(--text); }
.avatar-fullscreen-btn {
  padding: 5px 12px; border-radius: 8px; font-size: 11px; font-family: inherit;
  color: var(--gold-light); background: rgba(232, 179, 57, 0.08);
  border: 1px solid rgba(232, 179, 57, 0.35); cursor: pointer; transition: all .18s;
}
.avatar-fullscreen-btn:hover { background: rgba(232, 179, 57, 0.18); border-color: var(--gold); }

/* 当前选中条 */
.avatar-current {
  display: flex; align-items: center; gap: 10px; padding: 8px;
  border-radius: 12px; margin-bottom: 10px;
  background: rgba(232, 179, 57, 0.07); border: 1px solid var(--panel-border);
}
.avatar-current img { width: 46px; height: 46px; border-radius: 9px; object-fit: cover; flex: 0 0 auto; }
.ac-meta { min-width: 0; }
.ac-name { font-size: 12px; font-weight: 800; color: var(--gold-light);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-desc { font-size: 10px; color: var(--text-dim);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 内嵌面板 */
.avatar-panel { display: flex; flex-direction: column; gap: 4px; }
.avatar-pin-title {
  font-size: 11px; font-weight: 700; color: var(--gold);
  letter-spacing: 1px; margin: 8px 0 4px;
}
.avatar-pin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 4px; }

/* 折叠分组 */
.avatar-fold {
  border: 1px solid var(--panel-border); border-radius: 12px; overflow: hidden;
  background: rgba(0, 0, 0, 0.22); margin-top: 6px;
}
.avatar-fold-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; font-size: 12px; font-weight: 700; color: var(--text);
  cursor: pointer; user-select: none; transition: background .18s;
}
.avatar-fold-head:hover { background: rgba(232, 179, 57, 0.08); }
.fold-chev { color: var(--gold); font-size: 12px; }
.avatar-fold-body { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.avatar-fold.open .avatar-fold-body { max-height: 260px; overflow-y: auto; }
.avatar-fold-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 4px 10px 10px; }
.avatar-card .custom-tag {
  background: linear-gradient(135deg, #67e8f9, #22d3ee); color: #06262c;
}

/* 全屏形象选择模态 */
.avatar-modal-mask {
  position: fixed; inset: 0; z-index: 220;
  background: rgba(0, 0, 0, 0.78); backdrop-filter: blur(8px);
  display: flex; align-items: stretch; justify-content: center;
}
.avatar-modal-mask[hidden] { display: none; }
.avatar-modal {
  width: 100%; max-width: 1280px; height: 100%;
  display: flex; flex-direction: column;
  background: linear-gradient(160deg, #100e14, #070608);
  border-left: 1px solid var(--panel-border); border-right: 1px solid var(--panel-border);
}
.avatar-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 28px; border-bottom: 1px solid rgba(232, 179, 57, 0.14);
}
.avatar-modal-head h3 { font-size: 17px; color: var(--gold-light); }
.avatar-modal .avatar-filters { padding: 14px 28px 4px; margin-bottom: 6px; }
.avatar-modal-body { flex: 1; overflow-y: auto; padding: 16px 28px 32px; }
.avatar-grid-full {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px;
}

/* ============ 批量文案与进度 ============ */
.batch-hint { font-size: 11px; color: var(--gold); margin-top: 6px; font-weight: 700; }
.batch-progress {
  margin-top: 14px; padding: 12px; border-radius: 12px;
  background: rgba(0, 0, 0, 0.25); border: 1px solid var(--panel-border);
}
.bp-overview { margin-bottom: 10px; }
.bp-bar { height: 8px; border-radius: 999px; overflow: hidden;
  background: rgba(232, 179, 57, 0.12); }
.bp-bar-fill { height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--gold-deep), var(--gold-light));
  transition: width .4s ease; }
.bp-stat { font-size: 11px; color: var(--text-dim); margin-top: 6px; font-weight: 700; }
.bp-list { display: flex; flex-direction: column; gap: 5px; max-height: 320px; overflow-y: auto; }
.bp-row { display: flex; align-items: center; gap: 7px; padding: 7px 9px;
  border-radius: 9px; font-size: 11px;
  background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(232, 179, 57, 0.1); }
.bp-idx { flex: 0 0 auto; width: 20px; height: 20px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: var(--gold-light);
  background: rgba(232, 179, 57, 0.12); }
.bp-icon { flex: 0 0 auto; }
.bp-name { flex: 0 0 auto; font-weight: 700; color: var(--text); }
.bp-text { flex: 1; min-width: 0; color: var(--text-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-status { flex: 0 0 auto; font-size: 9px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .5px; }
.st-running { border-color: rgba(232, 179, 57, 0.5); background: rgba(232, 179, 57, 0.08); }
.st-done { border-color: rgba(74, 222, 128, 0.4); }
.st-done .bp-status { color: #86efac; }
.st-fail { border-color: rgba(248, 113, 113, 0.45); background: rgba(248, 113, 113, 0.07); }
.st-fail .bp-status { color: #f3b4b4; }
.st-queued { opacity: .6; }
.bp-link { display: inline-flex; align-items: center; gap: 6px;
  margin-top: 11px; padding: 9px 16px; border-radius: 10px;
  font-size: 12px; font-weight: 800; text-decoration: none;
  color: var(--gold-light); background: rgba(232, 179, 57, 0.1);
  border: 1px solid rgba(232, 179, 57, 0.45);
  transition: all .25s ease; }
.bp-link:hover { color: #1a1405;
  background: linear-gradient(135deg, var(--gold-deep), var(--gold-light));
  border-color: var(--gold-light); box-shadow: 0 6px 20px rgba(232, 179, 57, 0.25); }

/* 响应式 */
@media (max-width: 1100px) {
  .sidebar { width: 300px; flex-basis: 300px; }
  .pipeline { grid-template-columns: repeat(2, 1fr); }
}

/* ============ 用量看板 ============ */
.dashboard { max-width: 1080px; margin: 0 auto; }
.dashboard-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.dashboard-head h2 { font-size: 24px; font-weight: 800; }
.roi-setting { display: flex; align-items: center; gap: 12px; background: var(--panel);
  border: 1px solid var(--panel-border); border-radius: 12px; padding: 14px 18px; margin-bottom: 22px; flex-wrap: wrap; }
.roi-setting label { font-size: 13px; color: var(--text-dim); }
.roi-setting input { width: 110px; background: rgba(0,0,0,.35); border: 1px solid var(--panel-border);
  border-radius: 8px; color: var(--gold-light); padding: 8px 10px; font-size: 15px; font-weight: 700; }
.roi-hint { font-size: 12px; color: var(--text-faint); }
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 28px; }
.kpi-card { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 14px; padding: 20px; }
.kpi-value { font-size: 28px; font-weight: 900; margin-bottom: 8px; }
.kpi-label { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.kpi-sub { font-size: 12px; color: var(--text-faint); }
.dash-section { margin-bottom: 28px; }
.dash-section h3 { font-size: 16px; font-weight: 800; margin-bottom: 16px; }
.chart { display: flex; align-items: flex-end; gap: 24px; height: 240px; padding: 20px;
  background: var(--panel); border: 1px solid var(--panel-border); border-radius: 14px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 8px; }
.bar-val { font-size: 12px; color: var(--gold-light); font-weight: 700; }
.bar { width: 60%; min-height: 4px; border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, var(--gold-light), var(--gold-deep));
  box-shadow: 0 0 18px rgba(232, 179, 57,.35); transition: height .5s ease; }
.bar-label { font-size: 12px; color: var(--text-dim); }
.month-table { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 14px; overflow: hidden; }
.mt-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1.4fr 1fr; padding: 14px 20px;
  font-size: 13px; border-top: 1px solid rgba(255,255,255,.05); align-items: center; }
.mt-head { background: rgba(232, 179, 57,.08); font-weight: 800; color: var(--text-dim); border-top: none; }
@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .mt-row { grid-template-columns: 1fr 1fr; gap: 6px; }
}

/* 口型替换复选框 */
.retalk-check {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; margin: 4px 0 14px;
  border: 1px solid rgba(232, 179, 57, .25);
  border-radius: 12px; background: rgba(232, 179, 57, .05);
  cursor: pointer;
}
.retalk-check input {
  width: 18px; height: 18px; accent-color: #e8b339; cursor: pointer; flex: none;
}
.retalk-check span { font-size: 13px; color: var(--text-dim); line-height: 1.4; }

/* OSS 配置集管理 */
.op-loading, .op-err { font-size:12.5px; color:var(--text-dim); padding:8px 0; }
.op-err { color:#e1476b; }
.op-toolbar { display:flex; gap:10px; margin-bottom:12px; flex-wrap:wrap; }
.op-list { display:flex; flex-direction:column; gap:10px; }
.op-card { border:1px solid rgba(255,255,255,.1); border-radius:12px; padding:12px 14px; background:rgba(255,255,255,.02); }
.op-card.active { border-color:rgba(232,179,57,.55); background:rgba(232,179,57,.07); }
.op-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.op-name { font-size:13.5px; font-weight:700; color:#f3e9d2; }
.op-badge { font-size:10.5px; font-weight:800; color:#1a1408; background:#e8b339; padding:2px 10px; border-radius:999px; }
.op-fields { display:grid; grid-template-columns:1fr 1fr; gap:6px 14px; margin-bottom:10px; }
.op-fields > div { display:flex; flex-direction:column; gap:2px; min-width:0; }
.op-fields label { font-size:10.5px; color:var(--text-dim); }
.op-fields span { font-size:11.5px; color:#d8cdb4; word-break:break-all; font-family:var(--font-mono,monospace); }
.op-actions { display:flex; gap:8px; flex-wrap:wrap; }
.op-btn { font-size:12px; font-weight:700; padding:7px 13px; border-radius:9px; border:1px solid rgba(255,255,255,.16); background:rgba(255,255,255,.04); color:#e6dcc2; cursor:pointer; transition:all .15s; }
.op-btn:hover { border-color:rgba(232,179,57,.6); color:#f3e9d2; }
.op-btn.primary { background:linear-gradient(135deg,#e8b339,#d99a2b); border-color:transparent; color:#1a1408; }
.op-btn.danger { color:#f08aa3; border-color:rgba(225,71,107,.4); }
.op-btn.danger:hover { background:rgba(225,71,107,.12); }
.op-form { display:flex; flex-direction:column; gap:5px; }
.op-form-title { font-size:13.5px; font-weight:800; color:#f3e9d2; margin-bottom:6px; }
.op-form label { font-size:11px; color:var(--text-dim); margin-top:4px; }
.op-form input { background:rgba(0,0,0,.25); border:1px solid rgba(255,255,255,.14); border-radius:9px; padding:9px 11px; color:#f0e7d2; font-size:12.5px; }
.op-form input:focus { outline:none; border-color:rgba(232,179,57,.6); }
.op-form .op-actions { margin-top:10px; }

/* ============ 定时发布排期 ============ */
.schedule { max-width:1080px; margin:0 auto; }
.schedule .head-actions { display:flex; gap:10px; align-items:center; }
.btn-gold.small { padding:9px 16px; font-size:13px; }
.schedule-tip { color:var(--text-dim); font-size:13px; margin:14px 0 18px;
  padding:11px 15px; border:1px solid var(--panel-border); border-radius:12px;
  background:var(--panel); }
.plan-list { display:grid; grid-template-columns:repeat(auto-fill,minmax(320px,1fr)); gap:16px; }
.plan-card { position:relative; border:1px solid var(--panel-border); border-radius:16px;
  padding:16px 18px; background:var(--panel); backdrop-filter:blur(8px);
  transition:transform .2s ease, border-color .2s ease; overflow:hidden; }
.plan-card::before { content:""; position:absolute; left:0; top:0; bottom:0; width:3px;
  background:var(--gold-deep); }
.plan-card:hover { transform:translateY(-3px); border-color:rgba(232,179,57,.45); }
.plan-card.pl-due { border-color:rgba(232,179,57,.7);
  background:linear-gradient(160deg,rgba(232,179,57,.14),var(--panel));
  box-shadow:0 0 26px rgba(232,179,57,.18); }
.plan-card.pl-due::before { background:linear-gradient(var(--gold-light),var(--gold)); }
.plan-card.pl-done::before { background:#3fbf7f; }
.plan-card.pl-cancelled { opacity:.55; }
.plan-card.pl-cancelled::before { background:var(--text-faint); }
.plan-card.pl-failed::before { background:#e1476b; }
.plan-card-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:9px; }
.plan-platform { font-size:12px; font-weight:800; color:var(--gold); letter-spacing:.5px; }
.plan-status-badge { font-size:11.5px; color:var(--text-dim); }
.pl-due .plan-status-badge { color:var(--gold-light); font-weight:800; }
.plan-title { font-size:15.5px; font-weight:800; color:var(--text); margin-bottom:6px; }
.plan-time { font-size:12.5px; color:var(--text-dim); margin-bottom:8px; }
.plan-desc { font-size:12.5px; color:var(--text-dim); line-height:1.6; margin-bottom:8px; }
.plan-tags { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px; }
.plan-tag { font-size:11px; color:var(--gold); background:rgba(232,179,57,.12);
  border:1px solid rgba(232,179,57,.25); border-radius:20px; padding:2px 9px; }
.plan-note { font-size:11.5px; color:var(--gold-light); margin-bottom:8px; }
.plan-video { margin-bottom:10px; }
.plan-video a { font-size:12.5px; color:var(--gold); }
.plan-actions { display:flex; flex-wrap:wrap; gap:8px; }
.plan-btn { font-size:12.5px; font-weight:700; padding:8px 14px; border-radius:10px;
  border:1px solid var(--panel-border); background:transparent; color:var(--text);
  cursor:pointer; text-decoration:none; display:inline-flex; align-items:center; }
.plan-btn:hover { border-color:rgba(232,179,57,.6); }
.plan-btn.primary { background:linear-gradient(135deg,#e8b339,#d99a2b);
  border-color:transparent; color:#1a1408; }
.plan-btn.ghost { color:var(--text-dim); }
.plan-form { display:flex; flex-direction:column; gap:13px; }
.plan-form .field { display:flex; flex-direction:column; gap:6px; }
.plan-form .field > span { font-size:12px; color:var(--text-dim); font-weight:700; }
.plan-form input, .plan-form textarea, .plan-form select { background:rgba(0,0,0,.25);
  border:1px solid rgba(255,255,255,.14); border-radius:10px; padding:10px 12px;
  color:#f0e7d2; font-size:13px; font-family:inherit; }
.plan-form input:focus, .plan-form textarea:focus, .plan-form select:focus {
  outline:none; border-color:rgba(232,179,57,.6); }
body[data-theme="light"] .plan-form input,
body[data-theme="light"] .plan-form textarea,
body[data-theme="light"] .plan-form select { background:#fff; color:var(--text); }
body[data-theme="light"] .plan-card.pl-due {
  background:linear-gradient(160deg,rgba(217,119,6,.12),var(--panel)); }

/* ==================== 登录视图 ==================== */
.login-view {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.login-card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 20px; padding: 40px 36px 28px;
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  text-align: center;
}
.login-mark {
  font-size: 40px; color: var(--gold);
  text-shadow: 0 0 30px rgba(232,179,57,.45); margin-bottom: 10px;
}
.login-title { font-size: 24px; margin-bottom: 4px; }
.login-sub {
  font-size: 11px; letter-spacing: 3px; color: var(--text-faint); margin-bottom: 26px;
}
.login-input {
  width: 100%; padding: 13px 16px; margin-bottom: 14px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--panel-border); border-radius: 12px;
  color: var(--text); font-size: 14px; outline: none;
}
.login-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232,179,57,.15); }
.login-input::placeholder { color: var(--text-faint); }
.login-btn { width: 100%; margin-top: 4px; }
.login-error { min-height: 18px; color: var(--red); font-size: 13px; margin: 6px 0 2px; }
.login-foot {
  display: flex; justify-content: space-between; margin-top: 18px;
  font-size: 11px; color: var(--text-faint);
}
body[data-theme="light"] .login-input { background: rgba(255,255,255,.85); }

/* ==================== 用户菜单 ==================== */
.user-menu { position: relative; }
.user-menu-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 999px; padding: 5px 12px 5px 5px;
  color: var(--text); cursor: pointer; font-size: 13px;
}
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: #1a1408; font-weight: 700; font-size: 13px;
}
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  width: 260px; background: var(--bg-soft);
  border: 1px solid var(--panel-border); border-radius: 14px;
  box-shadow: var(--shadow); padding: 14px; z-index: 40;
}
.ud-info { font-size: 12px; color: var(--text-dim); padding-bottom: 10px; border-bottom: 1px solid var(--panel-border); margin-bottom: 10px; }
.ud-theme { margin-bottom: 10px; }
.ud-theme > span { font-size: 12px; color: var(--text-dim); display:block; margin-bottom:6px; }
.ud-theme .seg { display: flex; gap: 4px; }
.ud-theme .seg-btn { flex: 1; padding: 7px 4px; font-size: 12px; }
.ud-item {
  width: 100%; text-align: left; background: none; border: 0;
  color: var(--text); padding: 9px 6px; cursor: pointer; font-size: 13px; border-radius: 8px;
}
.ud-item:hover { background: var(--panel); }
.ud-item.danger { color: var(--red); }

/* ==================== 模型引擎选择 ==================== */
.engine-grid { display: flex; flex-direction: column; gap: 8px; }
.engine-card {
  text-align: left; padding: 12px 14px;
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 12px; cursor: pointer; color: var(--text);
  transition: border-color .15s, transform .15s;
}
.engine-card:hover { border-color: var(--gold); transform: translateY(-1px); }
.engine-card.active { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.ec-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ec-name { font-size: 14px; font-weight: 600; }
.ec-badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(232,179,57,.16); color: var(--gold); }
.ec-price { font-size: 12px; color: var(--text-dim); margin-left: auto; }
.ec-feat { font-size: 12px; color: var(--text-dim); margin-top: 5px; }
.engine-tip { color: var(--gold); }

/* ==================== 管理后台弹窗 ==================== */
.admin-modal { width: min(880px, 96vw); max-height: 90vh; display: flex; flex-direction: column; }
.admin-tabs { display: flex; gap: 4px; padding: 0 18px; border-bottom: 1px solid var(--panel-border); flex-wrap: wrap; }
.admin-tab {
  background: none; border: 0; color: var(--text-dim);
  padding: 12px 14px; cursor: pointer; font-size: 13px;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.admin-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.admin-body { overflow-y: auto; padding: 20px 22px; }
.admin-pane .field { margin-bottom: 16px; }
.admin-pane label > span { display:block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.admin-input, .admin-pane select, .admin-pane textarea {
  width: 100%; padding: 10px 12px; background: rgba(255,255,255,.05);
  border: 1px solid var(--panel-border); border-radius: 10px; color: var(--text); font-size: 13px;
}
body[data-theme="light"] .admin-input,
body[data-theme="light"] .admin-pane select,
body[data-theme="light"] .admin-pane textarea { background: rgba(255,255,255,.85); }
/* 下拉展开项：深色主题用深色底，避免白字白底；浅色主题用白底 */
.admin-pane select option { background: #151219; color: #f2ede2; }
.admin-pane select optgroup { background: #0b0a0e; color: var(--gold); font-weight: 700; }
body[data-theme="light"] .admin-pane select option { background: #ffffff; color: #2a2418; }
body[data-theme="light"] .admin-pane select optgroup { background: #faf2e0; color: var(--gold-deep); }
.plan-form select option { background: #151219; color: #f2ede2; }
body[data-theme="light"] .plan-form select option { background: #ffffff; color: #2a2418; }
.admin-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.admin-table th, .admin-table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--panel-border); }
.admin-table th { color: var(--text-dim); font-weight: 500; }
.mini-btn {
  padding: 6px 12px; border-radius: 8px; font-size: 12px;
  border: 1px solid var(--panel-border); background: var(--panel); color: var(--text); cursor: pointer;
}
.mini-btn.gold { border-color: var(--gold); color: var(--gold); }
.mini-btn.red { color: var(--red); border-color: rgba(248,113,113,.4); }
.switch-inline { display:inline-flex; align-items:center; gap:6px; font-size:12px; color:var(--text-dim); }
.provider-form-card { border: 1px solid var(--panel-border); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.pf-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:12px; }
.pf-title { font-size: 14px; font-weight:600; }
.pf-secret-state { font-size: 12px; color: var(--green); }
.site-flag { font-size:11px; color:var(--text-faint); }

/* Seedance 版本选择 */
#seedanceVariantBox { margin-top: 10px; }
.sv-label { font-size: 12px; color: var(--text-dim); margin-bottom: 6px; }
#seedanceVariantSeg { display: flex; gap: 4px; }
#seedanceVariantSeg .seg-btn { flex: 1; padding: 8px 4px; font-size: 12px; white-space: nowrap; }

/* ============ 品牌 Logo 上传 / 预览 / 自适应 ============ */
.brand-logo-row { display: flex; gap: 14px; align-items: center; }
.brand-logo-preview {
  width: 88px; height: 88px; flex: 0 0 88px; border-radius: 12px;
  border: 1px solid var(--panel-border); background: rgba(255,255,255,.04);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.brand-logo-preview img {
  max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain;
}
.blp-empty { font-size: 11px; color: var(--text-faint); }
.brand-logo-actions { display: flex; flex-direction: column; gap: 8px; flex: 1; }
/* 顶栏 / 登录页 Logo：按高度自适应，宽图自动收窄，不变形 */
.brand .brand-logo-img { height: 40px; width: auto; max-width: 170px; object-fit: contain; }
.login-card .brand-logo-img { height: 64px; width: auto; max-width: 240px; object-fit: contain; margin-bottom: 6px; }
body[data-theme="light"] .brand-logo-preview { background: rgba(255,255,255,.7); }

/* ============ 平台内容总览 ============ */
.ov-kpi { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.ov-kpi-card {
  flex: 1 1 150px; border: 1px solid var(--panel-border); border-radius: 14px;
  background: var(--panel); padding: 18px; text-align: center;
}
.ov-kpi-card em {
  display: block; font-style: normal; font-size: 30px; font-weight: 800;
  color: var(--gold); margin-bottom: 4px;
}
.ov-kpi-card span { font-size: 12px; color: var(--text-dim); }
.ov-tenant-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(260px,1fr)); gap: 14px; }
.ov-tenant-card {
  border: 1px solid var(--panel-border); border-radius: 14px; padding: 16px;
  background: var(--panel);
}
.ovt-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.ovt-head b { font-size: 14px; }
.ovt-status { font-size: 11px; padding: 3px 9px; border-radius: 999px; }
.ovt-status.active { color: var(--green); background: rgba(52,211,153,.14); }
.ovt-status.disabled { color: var(--red); background: rgba(248,113,113,.14); }
.ovt-id { font-size: 11px; color: var(--text-faint); margin-bottom: 10px; }
.ovt-stats { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--text-dim); }
.ovt-stats .ok { color: var(--green); }
.ovt-stats .run { color: var(--gold); }
.ovt-stats .fail { color: var(--red); }
.ov-user-table { overflow-x: auto; }
/* 历史项归属标签 */
.h-owner { font-size: 11px; color: var(--gold); margin: 2px 0 4px; }
body[data-theme="light"] .ov-kpi-card,
body[data-theme="light"] .ov-tenant-card { background: rgba(255,255,255,.75); }

/* ============ 钱包 / 充值 / 付费 ============ */
.wallet-view { display: flex; flex-direction: column; gap: 18px; }

.wallet-balance-card {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  padding: 28px 30px; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(232,179,57,.18), rgba(232,179,57,.04) 60%, rgba(255,255,255,.02));
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow);
}
.wbc-label { color: var(--text-dim); font-size: 13px; letter-spacing: 1px; }
.wbc-balance {
  font-size: 46px; font-weight: 800; line-height: 1.15; margin-top: 6px;
  background: linear-gradient(120deg, var(--gold-light), var(--gold), var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.wbc-balance.negative { background: none; -webkit-text-fill-color: var(--red); color: var(--red); }
.wbc-stats { display: flex; gap: 36px; }
.wbc-stats div { display: flex; flex-direction: column; gap: 4px; }
.wbc-stats span { color: var(--text-dim); font-size: 12px; }
.wbc-stats b { color: var(--text); font-size: 20px; font-weight: 700; }

.recharge-quick { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.recharge-quick button {
  padding: 10px 20px; border-radius: 10px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--panel-border);
  color: var(--text); font-size: 14px; transition: all .18s;
}
.recharge-quick button:hover { border-color: var(--gold); color: var(--gold); transform: translateY(-1px); }

.recharge-row { display: flex; gap: 12px; max-width: 460px; }
.recharge-row input {
  flex: 1; padding: 12px 14px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--panel-border); color: var(--text);
  font-size: 15px; outline: none;
}
.recharge-row input:focus { border-color: var(--gold); }

.wallet-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.wa-card {
  padding: 16px; border-radius: 14px; background: var(--panel);
  border: 1px solid var(--panel-border); display: flex; flex-direction: column; gap: 10px;
}
.wa-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wa-head b { color: var(--text); font-size: 15px; }
.wa-bal { color: var(--gold); font-size: 13px; font-weight: 700; }
.wa-row { display: flex; gap: 8px; }
.wa-row input {
  flex: 1; min-width: 0; padding: 9px 11px; border-radius: 9px;
  background: var(--bg-soft); border: 1px solid var(--panel-border); color: var(--text);
  font-size: 13px; outline: none;
}
.wa-row input:focus { border-color: var(--gold); }

.txn-tag {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.txn-recharge { color: var(--green); background: rgba(74,222,128,.12); }
.txn-consume { color: var(--red); background: rgba(248,113,113,.12); }
.txn-refund { color: var(--green); background: rgba(74,222,128,.12); }
.txn-adjust { color: var(--blue); background: rgba(127,184,232,.14); }
.txn-amount.up { color: var(--green); font-weight: 700; }
.txn-amount.down { color: var(--red); font-weight: 700; }

.wallet-txn-table .admin-table { width: 100%; border-collapse: collapse; }
.wallet-txn-table th, .wallet-txn-table td {
  padding: 11px 12px; text-align: left; font-size: 13px;
  border-bottom: 1px solid var(--panel-border); color: var(--text);
}
.wallet-txn-table th { color: var(--text-dim); font-weight: 600; font-size: 12px; }

body[data-theme="light"] .wallet-balance-card,
body[data-theme="light"] .wa-card { background: rgba(255,255,255,.78); }
body[data-theme="light"] .txn-recharge,
body[data-theme="light"] .txn-refund { background: rgba(5,150,105,.1); }
body[data-theme="light"] .txn-consume { background: rgba(225,29,72,.1); }
body[data-theme="light"] .txn-adjust { background: rgba(37,99,235,.1); }

/* ==================== AI 出图工作台 ==================== */
.image-studio { max-width: 1180px; margin: 0 auto; }

/* 当前模型信息条 */
.img-current-bar {
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px; flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(232,179,57,.14), rgba(232,179,57,.04));
  border: 1px solid var(--panel-border); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 18px;
}
.icb-current { display: flex; align-items: center; gap: 10px; }
.icb-label {
  font-size: 11px; color: var(--gold); letter-spacing: 1px;
  border: 1px solid var(--panel-border); padding: 3px 9px; border-radius: 999px;
}
.icb-current b { font-size: 17px; }
.icb-vendor { font-size: 12px; color: var(--text-dim); }
.icb-meta { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--text-dim); flex-wrap: wrap; }
.icb-meta b { color: var(--gold-light); }
.icb-ok { color: var(--green); font-size: 12px; }
.icb-warn { color: var(--red); font-size: 12px; }
.img-set-default {
  background: none; border: 1px solid var(--gold); color: var(--gold);
  padding: 6px 14px; border-radius: 999px; cursor: pointer; font-size: 12px;
  transition: background .15s, color .15s;
}
.img-set-default:hover { background: var(--gold); color: #1a1407; }

/* 厂商筛选 */
.img-filter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.img-filter-chip {
  background: var(--panel); border: 1px solid var(--panel-border);
  color: var(--text-dim); padding: 7px 15px; border-radius: 999px;
  cursor: pointer; font-size: 13px; transition: all .15s;
}
.img-filter-chip:hover { border-color: var(--gold); color: var(--text); }
.img-filter-chip.active { background: var(--gold); border-color: var(--gold); color: #1a1407; font-weight: 700; }

/* 模型卡片网格 */
.img-model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px; margin-bottom: 24px;
}
.img-model-card {
  position: relative; text-align: left; padding: 14px;
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 14px; cursor: pointer; color: var(--text);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.img-model-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.img-model-card.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold) inset, 0 10px 30px rgba(232,179,57,.18);
}
.imc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.imc-name { font-size: 14px; font-weight: 700; line-height: 1.3; }
.imc-vendor { font-size: 11px; color: var(--text-dim); white-space: nowrap; }
.imc-price { display: flex; align-items: baseline; gap: 4px; margin: 10px 0 8px; }
.imc-price b { font-size: 22px; color: var(--gold-light); font-weight: 800; }
.imc-price span { font-size: 11px; color: var(--text-dim); }
.imc-price em { font-size: 11px; color: var(--text-faint); margin-left: auto; font-style: normal; }
.imc-tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 8px; }
.imc-tags span {
  font-size: 10px; padding: 2px 7px; border-radius: 6px;
  background: rgba(127,184,232,.13); color: var(--blue);
}
.imc-badge { font-size: 11px; color: var(--text-dim); line-height: 1.4; }
.imc-default-flag {
  position: absolute; top: -8px; right: 10px;
  font-size: 10px; padding: 2px 9px; border-radius: 999px;
  background: var(--gold); color: #1a1407; font-weight: 700;
}

/* 出图表单 */
.img-gen-form {
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 24px;
}
.img-gen-label { font-size: 13px; font-weight: 700; display: block; margin-bottom: 9px; }
.img-gen-form textarea {
  width: 100%; resize: vertical; background: rgba(0,0,0,.25);
  border: 1px solid var(--panel-border); border-radius: 10px;
  padding: 12px 14px; color: var(--text); font-size: 13px; line-height: 1.6;
}
body[data-theme="light"] .img-gen-form textarea { background: rgba(255,255,255,.85); }
.img-ratio-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin: 14px 0; }
.img-ratio-label { font-size: 12px; color: var(--text-dim); margin-right: 4px; }
.img-ratio-btn {
  background: none; border: 1px solid var(--panel-border); color: var(--text-dim);
  padding: 5px 12px; border-radius: 8px; cursor: pointer; font-size: 12px;
}
.img-ratio-btn.active { border-color: var(--gold); color: var(--gold); background: rgba(232,179,57,.1); }
.img-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.img-fee-hint { font-size: 12px; color: var(--gold); }

/* 出图结果 */
.img-loading, .img-error { padding: 26px; text-align: center; color: var(--text-dim); font-size: 14px; }
.img-error { color: var(--red); }
.img-result-card {
  display: flex; gap: 18px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: var(--radius); padding: 16px;
}
.img-result-card img {
  width: min(340px, 100%); border-radius: 12px;
  border: 1px solid var(--panel-border); object-fit: contain;
}
.ir-info { font-size: 13px; display: flex; flex-direction: column; gap: 8px; }
.ir-size { color: var(--text-dim); font-size: 12px; }
.ir-cost { font-size: 14px; }
.ir-cost b { color: var(--gold-light); font-size: 17px; }
.ir-open { color: var(--gold); font-size: 13px; text-decoration: none; }

/* 出图历史 */
.img-history { display: flex; flex-direction: column; gap: 8px; }
.img-history-row {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel); border: 1px solid var(--panel-border);
  border-radius: 12px; padding: 8px 12px;
}
.img-history-row img { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; }
.ih-main { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.ih-main b { font-size: 13px; }
.ih-main span { font-size: 11px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ih-cost { font-size: 13px; color: var(--gold-light); font-weight: 700; white-space: nowrap; }

body[data-theme="light"] .img-model-card,
body[data-theme="light"] .img-history-row,
body[data-theme="light"] .img-result-card { background: rgba(255,255,255,.78); }

/* ============ 一稿裂变 ============ */
.fission-actions { display: flex; gap: 10px; margin: 10px 0; }
.fission-actions .ghost-btn, .fission-actions .btn-gold { flex: 1; }
.fission-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.fi-card {
  border: 1px solid var(--panel-border); border-radius: 12px;
  background: var(--panel); padding: 10px 12px;
}
.fi-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 6px; }
.fi-idx { color: var(--gold); font-weight: 700; font-size: 13px; }
.fi-tag {
  font-size: 11px; padding: 2px 7px; border-radius: 999px;
  border: 1px solid var(--panel-border); color: var(--gold-light);
  background: rgba(232, 179, 57, 0.08); white-space: nowrap;
}
.fi-tag.dim { color: var(--text-dim); background: transparent; }
.fi-chars { margin-left: auto; font-size: 11px; color: var(--text-faint); }
.fi-title { font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.fi-text {
  width: 100%; box-sizing: border-box; resize: vertical;
  background: rgba(0, 0, 0, 0.22); border: 1px solid var(--panel-border);
  border-radius: 8px; color: var(--text); font-size: 13px; line-height: 1.65;
  padding: 8px 10px; font-family: inherit;
}
[data-theme="light"] .fi-text { background: rgba(255, 255, 255, 0.9); color: var(--text); }

/* ============ 自动生成排期 ============ */
.autogen-block {
  margin-top: 26px; padding-top: 18px;
  border-top: 1px dashed var(--panel-border);
}
.autogen-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.autogen-head-actions { display: flex; align-items: center; gap: 8px; }
.autogen-head h3 { margin: 0; font-size: 15px; color: var(--gold-light); }
.autogen-form {
  border: 1px solid var(--panel-border); border-radius: 12px;
  background: var(--panel); padding: 14px; margin: 12px 0;
}
.autogen-row { display: flex; flex-wrap: wrap; gap: 10px; }
.autogen-row .field { flex: 1 1 140px; margin-bottom: 0; }
.autogen-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.ag-card {
  border: 1px solid var(--panel-border); border-radius: 12px;
  background: var(--panel); padding: 12px 14px;
}
.ag-card.on { border-color: rgba(232, 179, 57, 0.45); }
.ag-card.off { opacity: 0.72; }
.ag-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ag-name { font-weight: 700; font-size: 14px; color: var(--text); }
.ag-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--panel-border); color: var(--text-dim);
}
.ag-badge.on {
  color: #0d1a12; background: linear-gradient(135deg, var(--gold-light), var(--gold));
  border-color: transparent; font-weight: 700;
}
.ag-meta { font-size: 12px; color: var(--text-dim); margin-top: 6px; }
.ag-source {
  font-size: 12px; color: var(--text-faint); margin-top: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ag-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* 出片方式 5 项：网格 3+2，避免侧栏挤成竖排小字 */
#batchModeSeg {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
#batchModeSeg .seg-btn { white-space: nowrap; padding: 8px 2px; }
@media (max-width: 520px) {
  #batchModeSeg { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 本人照片精修：原图/精修双格 */
.portrait-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0;
}
.portrait-cell {
  display: flex; flex-direction: column; gap: 6px; padding: 8px;
  border-radius: 12px; background: rgba(232, 179, 57, 0.05);
  border: 1px solid var(--panel-border);
}
.portrait-label {
  font-size: 10px; font-weight: 700; color: var(--text-dim);
  letter-spacing: 1px;
}
.portrait-cell img {
  width: 100%; aspect-ratio: 9/16; max-height: 280px; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--panel-border);
}
.portrait-cell .ghost-btn { padding: 8px; font-size: 11px; }

/* ============ 手机 / 平板自适应（≤900px 单列 + 底部主操作条） ============ */
@media (max-width: 900px) {
  html, body { overflow-x: hidden; }
  .bg-orb { max-width: 100vw; }

  /* 顶栏：两行，按钮横向可滑 */
  .topbar {
    height: auto; padding: 10px 14px 8px;
    flex-wrap: wrap; gap: 8px;
    position: sticky; top: 0; z-index: 30;
  }
  .brand { gap: 10px; }
  .brand-mark { font-size: 20px; }
  .brand-name { font-size: 15px; letter-spacing: .5px; }
  .brand-sub { display: none; }
  .topbar-right {
    width: 100%; gap: 8px; overflow-x: auto; flex-wrap: nowrap;
    padding: 2px 0 6px; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .topbar-right::-webkit-scrollbar { display: none; }
  .topbar-right .ghost-btn {
    flex: 0 0 auto; white-space: nowrap;
    font-size: 12px; padding: 9px 13px; min-height: 38px;
  }
  .mode-pill, .version { flex: 0 0 auto; }

  /* 双栏改单列：表单在上、结果在下 */
  .layout { flex-direction: column; min-height: auto; }
  .sidebar {
    width: 100%; flex: 0 0 auto; padding: 12px;
    border-right: none; border-bottom: 1px solid var(--panel-border);
    overflow: visible;
  }
  .main { padding: 12px 12px 96px; overflow: visible; }
  .panel { padding: 14px; margin-bottom: 12px; border-radius: 14px; }

  /* 所有两栏网格收成一栏，避免手机上挤成细条 */
  .opt-grid, .avatar-pin-grid, .avatar-fold-grid, .portrait-grid,
  .op-fields, .art-grid, .plan-list, .ov-tenant-grid,
  .wallet-admin-grid, .kpi-grid {
    grid-template-columns: 1fr !important;
  }
  .pipeline { grid-template-columns: repeat(2, 1fr); }
  .mt-row { grid-template-columns: 1fr 1fr !important; }
  #batchModeSeg { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

  /* 触控友好：输入 16px 防 iOS 自动放大，按钮 ≥44px */
  input, textarea, select, .login-input { font-size: 16px !important; }
  .btn-gold, .ghost-btn, .plan-btn, .seg-btn { min-height: 44px; }
  .seg-btn { font-size: 13px; }
  .kit-select, .compliance-select, .prompt-select { font-size: 16px !important; }

  /* 预览/画布类区域不撑破屏幕 */
  .art-preview, .art-preview iframe, .preview-frame { max-width: 100%; }
  .portrait-cell img { max-height: 220px; }
  .toast-stack, .toast { left: 12px; right: 12px; width: auto; }

  /* 弹层全屏化 */
  .modal-card, .dialog-card { width: 94vw !important; max-width: 94vw;
    max-height: 88vh; overflow: auto; }

  /* iPhone 刘海/安全区 */
  .main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .mobile-cta { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
}

/* 底部主操作条：仅手机显示，点它等同点当前模式的主按钮 */
.mobile-cta {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding: 10px 12px; gap: 10px;
  background: linear-gradient(180deg, rgba(7,6,8,0) 0%, rgba(7,6,8,.82) 26%, rgba(7,6,8,.96) 100%);
  backdrop-filter: blur(12px);
}
body[data-theme="light"] .mobile-cta {
  background: linear-gradient(180deg, rgba(253,248,238,0) 0%, rgba(253,248,238,.9) 26%, rgba(253,248,238,.98) 100%);
}
@media (max-width: 900px) {
  .mobile-cta { display: flex; align-items: center; }
}
.mobile-cta .mobile-cta-info {
  flex: 1 1 auto; min-width: 0; font-size: 11px; color: var(--text-faint);
  line-height: 1.35;
}
.mobile-cta .mobile-cta-info b { display: block; color: var(--text-dim); font-size: 12px; }
.mobile-cta .btn-gold { flex: 0 0 auto; min-width: 168px; }

/* ============ 平台账号绑定（阶段三） ============ */
.account-block, .autogen-block { margin: 18px 0 26px; }
.acct-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px; margin-bottom: 14px;
}
.acct-card {
  border: 1px solid var(--panel-border); border-radius: 14px;
  background: var(--panel); padding: 14px 16px;
}
.acct-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.acct-plat { font-size: 13px; font-weight: 800; color: var(--gold-light); }
.acct-name { font-size: 14px; font-weight: 700; margin-bottom: 2px; }
.acct-meta { font-size: 11.5px; color: var(--text-faint); line-height: 1.5; }
.acct-badge {
  font-size: 10.5px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--panel-border); color: var(--text-dim);
}
.acct-badge.verified { color: #4ade80; border-color: rgba(74, 222, 128, .45); }
.acct-badge.unverified { color: #ffd98a; border-color: rgba(232, 179, 57, .45); }
.acct-badge.manual_only { color: var(--text-dim); }
.acct-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.acct-actions .plan-btn { font-size: 11.5px; padding: 6px 10px; }
.acct-empty {
  grid-column: 1 / -1; padding: 18px; text-align: center;
  color: var(--text-faint); font-size: 12.5px;
  border: 1px dashed var(--panel-border); border-radius: 14px;
}
.acct-form {
  border: 1px solid var(--panel-border); border-radius: 14px;
  padding: 14px 16px; background: var(--panel);
}

@media (max-width: 520px) {
  /* 窄屏只留全宽主按钮，避免说明文字被挤成竖排 */
  .mobile-cta .mobile-cta-info { display: none; }
  .mobile-cta .btn-gold { flex: 1 1 auto; min-width: 0; width: 100%; }
}

/* 发布页标题行按钮：不被 flex 拉伸成整行 */
.autogen-head .btn-gold.small,
.autogen-head .ghost-btn {
  flex: 0 0 auto; width: auto; white-space: nowrap;
}

/* ============ 画面布局选择器 ============ */
.layout-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.layout-chip {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 10px 6px; border-radius: 12px; cursor: pointer;
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(212, 175, 55, 0.25);
  transition: all 0.18s ease;
}
.layout-chip:hover { border-color: rgba(212, 175, 55, 0.6); transform: translateY(-1px); }
.layout-chip.active {
  border-color: var(--gold, #d4af37);
  background: linear-gradient(160deg, rgba(212, 175, 55, 0.18), rgba(212, 175, 55, 0.05));
  box-shadow: 0 6px 18px rgba(212, 175, 55, 0.18);
}
.layout-chip.is-rec .layout-lb { color: #f0d678; }
.layout-pv {
  position: relative; width: 46px; height: 72px; border-radius: 8px;
  background: rgba(10, 10, 14, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.layout-pv i {
  position: absolute; border-radius: 4px;
  background: linear-gradient(150deg, #d4af37, #8a6d1f);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}
.layout-pv i:first-child {
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.layout-lb { font-size: 12px; color: #e8e8ea; line-height: 1.25; text-align: center; }

.pip-person-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.pip-person-row > span { flex: 0 0 52px; font-size: 13px; color: #c9c9cf; }
.pip-person-row select { flex: 1; }

.switch-row {
  display: flex; align-items: center; gap: 9px; margin-bottom: 8px;
  font-size: 14px; color: #d8d8dd; cursor: pointer;
}
.switch-row input { width: 18px; height: 18px; accent-color: #d4af37; }

.slide-thumbs {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px;
}
.slide-thumb {
  border-radius: 10px; overflow: hidden; text-align: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.2);
}
.slide-thumb img { width: 100%; aspect-ratio: 9/16; object-fit: cover; display: block; }
.slide-thumb div { font-size: 11px; padding: 4px 0; color: #c9c9cf; }

@media (max-width: 520px) {
  .layout-grid { grid-template-columns: repeat(2, 1fr); }
  .slide-thumbs { grid-template-columns: repeat(3, 1fr); }
}
