/* ════════════════════════════════════════════════════════════
   法辅在线AI视频平台 — 设计系统 v2
   深空暗色 · 玻璃拟态 · 品牌渐变 (紫→蓝) · 微交互
   ════════════════════════════════════════════════════════════ */

:root {
  /* 色板 */
  --bg: #0a0a0c;
  --bg-2: #0f0d10;
  --panel: rgba(255, 255, 255, 0.028);
  --panel-2: rgba(255, 255, 255, 0.045);
  --card: #151012;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #e9ecf3;
  --text-2: #9aa4b5;
  --faint: #5d6677;

  --brand: #f02020;
  --brand-2: #f5c24a;
  --brand-soft: rgba(240, 32, 32, 0.16);
  --grad: linear-gradient(135deg, #f5c24a 0%, #f02020 100%);

  --green: #2fd08e;
  --green-soft: rgba(47, 208, 142, 0.14);
  --red: #f2666e;
  --red-soft: rgba(242, 102, 110, 0.14);
  --amber: #f5b74a;
  --amber-soft: rgba(245, 183, 74, 0.14);
  --cyan: #f5c24a;

  /* 布局与质感 */
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-xl: 24px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 4px 18px rgba(0, 0, 0, 0.3);
  --glow: 0 0 24px rgba(240, 32, 32, 0.35);

  --font: -apple-system, "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "Cascadia Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* 背景光晕 */
body::before, body::after {
  content: "";
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}
body::before {
  width: 640px; height: 640px;
  left: -180px; top: -220px;
  background: radial-gradient(circle, rgba(245, 194, 74, 0.16), transparent 65%);
}
body::after {
  width: 720px; height: 720px;
  right: -240px; bottom: -280px;
  background: radial-gradient(circle, rgba(240, 32, 32, 0.18), transparent 65%);
}

::selection { background: rgba(245, 194, 74, 0.25); }

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.2); }

[hidden] { display: none !important; }

/* ═══════════ 顶栏 ═══════════ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  /* 2026-09-22: 顶栏元素多时「工作流切换 Tab」会被挤成 0 宽并被后面元素盖住
     (桌面宽屏就点不到「数字人口播」) → 允许换行 + 保底 60px 高度 */
  min-height: 60px; height: auto;
  display: flex; align-items: center; gap: 20px;
  flex-wrap: wrap; row-gap: 6px;
  padding: 8px 22px;
  background: rgba(10, 13, 20, 0.72);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-logo {
  width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  box-shadow: 0 4px 16px rgba(240, 32, 32, 0.35);
}
.brand-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text h1 { font-size: 15.5px; font-weight: 700; letter-spacing: 0.4px; }
.brand-sub { font-size: 10.5px; color: var(--faint); letter-spacing: 1.2px; }

/* 工作流切换 (分段控件) */
.wf-tabs {
  flex-shrink: 0; /* 2026-09-22: 不允许被顶栏压扁 */
  display: flex; gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 999px; padding: 4px;
  margin: 0 auto;
}
.wf-tab {
  display: flex; align-items: center; gap: 7px;
  border: none; cursor: pointer;
  background: transparent; color: var(--text-2);
  font-family: var(--font); font-size: 12.5px;
  padding: 6px 14px; border-radius: 999px;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.wf-tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.wf-tab.active {
  background: var(--grad); color: #0b0b0e; font-weight: 700;
  box-shadow: 0 2px 12px rgba(245, 194, 74, 0.3);
}
.wf-tab-id { font-family: var(--mono); font-size: 9.5px; opacity: 0.65; }
.wf-tab-id.none { color: var(--red); }

.topbar-right { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }

/* 徽章 chip */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--text-2);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 11px;
  white-space: nowrap;
}
.chip.ok { color: var(--green); border-color: rgba(47, 208, 142, 0.35); background: var(--green-soft); }
.chip.bad { color: var(--red); border-color: rgba(242, 102, 110, 0.35); background: var(--red-soft); }
.coin-chip {
  cursor: pointer;
  color: #0b0b0e;
  background: var(--grad);
  border: none; font-weight: 700;
  padding: 6px 14px;
  box-shadow: 0 3px 14px rgba(245, 194, 74, 0.3);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.coin-chip:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(240, 32, 32, 0.4); }

/* 按钮 */
button { font-family: var(--font); }
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--grad);
  color: #0b0b0e; border: none; cursor: pointer;
  font-size: 14px; font-weight: 700; letter-spacing: 0.3px;
  padding: 11px 18px; border-radius: var(--r);
  box-shadow: 0 4px 18px rgba(245, 194, 74, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  width: 100%;
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 26px rgba(240, 32, 32, 0.42); filter: brightness(1.05); }
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary .spinner { border-color: rgba(0, 0, 0, 0.3); border-top-color: #0b0b0e; }

.btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12.5px; cursor: pointer;
  padding: 8px 14px; border-radius: var(--r);
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-ghost:hover { color: var(--text); border-color: var(--line-strong); background: rgba(255, 255, 255, 0.07); }
.btn-ghost:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-action {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--grad); color: #0b0b0e;
  border: none; cursor: pointer;
  font-size: 12.5px; font-weight: 700;
  padding: 9px 16px; border-radius: var(--r-sm);
  text-decoration: none;
  transition: filter 0.15s ease, transform 0.15s ease;
}
.btn-action:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-action.ghost { background: var(--panel-2); border: 1px solid var(--line); color: var(--text-2); }
.btn-action.danger {
  background: transparent;
  border: 1px solid rgba(255, 120, 138, 0.45);
  color: #ff8a9a;
}
.btn-action.danger:hover { background: rgba(255, 90, 110, 0.12); }

/* 提示文本 */
.hint { font-size: 12px; color: var(--faint); margin-top: 10px; min-height: 16px; }
.hint.err { color: var(--red); }
.hint.ok { color: var(--green); }
.help { font-size: 11.5px; color: var(--faint); margin-top: 6px; }
.empty-mini { text-align: center; color: var(--faint); font-size: 12.5px; padding: 26px 12px; }
.empty-mini.small { padding: 12px; }

.captcha-img {
  width: 120px; height: 44px;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  background: #1a1416;
  transition: border-color 0.15s ease;
}
.captcha-img:hover { border-color: var(--brand); }
.captcha-img svg { display: block; }

/* ═══════════ 登录/注册 (分屏) ═══════════ */
.auth-screen {
  position: fixed; inset: 0; z-index: 90;
  display: grid; grid-template-columns: 1.1fr 1fr;
  background: var(--bg);
}
.auth-hero {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center;
  padding: 64px;
  background:
    radial-gradient(ellipse at 20% 15%, rgba(240, 32, 32, 0.28), transparent 55%),
    radial-gradient(ellipse at 85% 85%, rgba(79, 140, 255, 0.22), transparent 55%),
    var(--bg-2);
  border-right: 1px solid var(--line);
}
.auth-hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
}
.auth-hero .brand-logo { width: 46px; height: 46px; border-radius: 13px; margin-bottom: 26px; z-index: 1; }
.auth-hero h2 { font-size: 34px; font-weight: 800; letter-spacing: 0.5px; margin-bottom: 10px; z-index: 1; }
.auth-hero h2 em { font-style: normal; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-hero .auth-tagline { color: var(--text-2); font-size: 15px; margin-bottom: 38px; max-width: 420px; z-index: 1; }
.auth-features { display: flex; flex-direction: column; gap: 16px; z-index: 1; }
.auth-feature { display: flex; gap: 13px; align-items: flex-start; }
.auth-feature .af-icon {
  width: 34px; height: 34px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--brand-soft); color: #ff6b6b;
  border: 1px solid rgba(240, 32, 32, 0.3);
}
.auth-feature b { display: block; font-size: 13.5px; margin-bottom: 2px; }
.auth-feature span { font-size: 12px; color: var(--faint); }

.auth-card-wrap { display: flex; align-items: center; justify-content: center; padding: 40px; }
.auth-card {
  width: 100%; max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 38px 34px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}
.auth-brand { display: none; }
.auth-card h2 { font-size: 21px; font-weight: 700; margin-bottom: 4px; }
.auth-sub { font-size: 12.5px; color: var(--faint); margin-bottom: 22px; }
.auth-tabs {
  display: flex; gap: 4px; margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: var(--r); padding: 4px;
}
.auth-tab {
  flex: 1; border: none; cursor: pointer;
  background: transparent; color: var(--text-2);
  font-size: 13px; padding: 8px 0; border-radius: 8px;
  transition: all 0.15s ease;
}
.auth-tab.active { background: var(--grad); color: #fff; font-weight: 600; }

/* ═══════════ 主布局 (双栏工作台) ═══════════ */
.layout {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 432px 1fr;
  gap: 16px;
  padding: 16px 20px 20px;
  height: calc(100vh - 60px);
  height: calc(100dvh - 60px);
  min-height: 0;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-soft);
  display: flex; flex-direction: column;
  min-height: 0;
}
.panel-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 18px 12px;
  flex-shrink: 0;
}
.panel-head h2 { font-size: 14.5px; font-weight: 700; letter-spacing: 0.3px; }
.panel-head-sub { font-size: 10.5px; color: var(--faint); letter-spacing: 1px; margin-left: auto; text-transform: uppercase; }

/* 左: 参数面板 */
.form-panel { overflow-y: auto; }
.form-panel .panel-head { position: sticky; top: 0; background: rgba(13, 17, 25, 0.85); backdrop-filter: blur(10px); z-index: 2; border-radius: var(--r-lg) var(--r-lg) 0 0; }
#genForm { padding: 4px 18px 20px; }

.field { margin-bottom: 15px; }
.field > label {
  display: block;
  font-size: 12px; font-weight: 600; color: var(--text-2);
  margin-bottom: 7px;
}
.field .req { color: var(--red); margin-left: 2px; }

input[type="text"], input[type="password"], input[type="number"], textarea, select {
  width: 100%;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 13px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
input[type="text"]:focus, input[type="password"]:focus, input[type="number"]:focus, textarea:focus, select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(245, 194, 74, 0.14);
  background: rgba(0, 0, 0, 0.45);
}
textarea { resize: vertical; min-height: 88px; line-height: 1.6; }
textarea.prompt-textarea { min-height: 150px; font-size: 12.5px; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239aa4b5' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
  cursor: pointer;
}
select option { background: var(--card); color: var(--text); }

/* 分组分隔线 */
.group-divider {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-2); font-size: 12px; font-weight: 700; letter-spacing: 0.5px;
  margin: 22px 0 14px;
}
.group-divider::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
}
.group-count {
  font-family: var(--mono); font-size: 10.5px;
  background: var(--brand-soft); color: #ff6b6b;
  border-radius: 999px; padding: 2px 8px;
}

/* 上传槽 */
.file-batch-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.file-batch-bar .btn-ghost { flex: 1; padding: 7px 10px; font-size: 11.5px; }
.upload-slot {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  min-height: 92px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--r);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.18s ease;
  overflow: hidden;
}
.upload-slot:hover { border-color: var(--brand); background: rgba(240, 32, 32, 0.06); color: var(--text); box-shadow: 0 0 0 3px rgba(240, 32, 32, 0.12); }
.upload-slot.featured { min-height: 120px; border-style: solid; background: linear-gradient(135deg, rgba(240, 32, 32,0.08), rgba(79,140,255,0.05)); }
.upload-slot.has-file { border-style: solid; border-color: var(--green); background: var(--green-soft); }
.upload-slot .slot-text { font-size: 12px; }
.upload-slot input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-preview { margin-top: 9px; }
.file-preview img { width: 100%; border-radius: var(--r-sm); border: 1px solid var(--line); }
.file-preview audio, .file-preview video { width: 100%; margin-top: 6px; }
.file-remove { margin-top: 8px; padding: 5px 12px; font-size: 11.5px; }
.file-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* 批量生成 */
.batch-toggle { width: 100%; margin-top: 14px; }
.batch-box {
  margin-top: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px;
}

/* AI 优化器 */
.prompt-optimizer {
  margin-top: 10px;
  background: rgba(240, 32, 32, 0.06);
  border: 1px solid rgba(240, 32, 32, 0.22);
  border-radius: var(--r);
  padding: 12px;
}
.po-title { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; color: #f5c24a; margin-bottom: 9px; }
.po-row { display: flex; gap: 8px; }
.po-row select { flex: 1; padding: 8px 10px; font-size: 12px; }
.po-row .btn-primary { width: auto; padding: 8px 14px; font-size: 12.5px; }
.po-progress { display: flex; align-items: center; gap: 9px; margin-top: 10px; font-size: 12px; color: var(--text-2); }
.po-hint { margin-top: 9px; }

/* 提示词预设/自定义切换 */
.prompt-mode-tabs { margin-bottom: 10px; }
.pm-tab-row { display: flex; gap: 0; margin-bottom: 10px; border-bottom: 1px solid var(--border); }
.pm-tab { padding: 7px 16px; font-size: 13px; font-weight: 600; border: none; background: none; color: var(--text-2); cursor: pointer; border-bottom: 2px solid transparent; transition: all .2s; }
.pm-tab:hover { color: var(--text-1); }
.pm-tab.active { color: #e11d1d; border-bottom-color: #e11d1d; }
.pm-preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.pm-preset-card { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r); cursor: pointer; transition: all .2s; background: var(--bg-1); }
.pm-preset-card:hover { border-color: #e11d1d; background: rgba(240, 32, 32, 0.06); }
.pm-preset-card.selected { border-color: #e11d1d; background: rgba(240, 32, 32, 0.1); box-shadow: 0 0 0 1px rgba(240, 32, 32, 0.3); }
.pm-card-icon { font-size: 20px; line-height: 1; flex-shrink: 0; }
.pm-card-body { flex: 1; min-width: 0; }
.pm-card-label { font-size: 13px; font-weight: 600; color: var(--text-1); margin-bottom: 2px; }
.pm-card-desc { font-size: 11px; color: var(--text-3); line-height: 1.4; }

/* 数字人 TTS 区 */
.avatar-tts-zone {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(0, 0, 0, 0.22);
  padding: 0 12px;
}
.avatar-tts-zone summary { cursor: pointer; padding: 10px 0; font-size: 12.5px; color: var(--text-2); font-weight: 600; list-style: none; }
.avatar-tts-zone summary::before { content: "▸ "; color: var(--brand); }
.avatar-tts-zone[open] summary::before { content: "▾ "; }
.avatar-tts-zone[open] { padding-bottom: 12px; }
.avatar-tts-zone textarea, .avatar-tts-zone select { margin-bottom: 8px; }
.avatar-tts-zone .help { margin-bottom: 6px; }
.tts-copywrite-row { display: flex; gap: 8px; margin-bottom: 8px; }
.tts-copywrite-row input { flex: 1; }
.tts-copywrite-row .btn-ghost { flex-shrink: 0; font-size: 11.5px; padding: 8px 11px; }
.tts-speed-row { display: flex; align-items: center; gap: 10px; }
.tts-speed-row input[type="range"] {
  flex: 1; height: 4px; appearance: none; accent-color: var(--cyan);
  background: rgba(255, 255, 255, 0.1); border-radius: 99px; outline: none;
  padding: 0; border: none;
}
.tts-speed-row input[type="range"]::-webkit-slider-thumb {
  appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: var(--cyan); cursor: pointer;
  box-shadow: 0 0 8px rgba(245, 194, 74, 0.6);
}
.tts-speed-row span { font-family: var(--mono); font-size: 12px; color: var(--cyan); font-weight: 700; min-width: 34px; text-align: right; }

/* ═══════════ 右: 工作台 ═══════════ */
.workspace {
  display: flex; flex-direction: column; gap: 16px;
  min-height: 0; min-width: 0;
}
.history { flex: 0 0 auto; max-height: 38%; }
.stage { flex: 1; }

.filter-tabs { display: flex; gap: 6px; padding: 0 18px 12px; flex-wrap: wrap; }
.filter-tab {
  border: 1px solid var(--line); background: transparent; color: var(--text-2);
  cursor: pointer; font-size: 12px;
  padding: 5px 12px; border-radius: 999px;
  transition: all 0.15s ease;
  display: inline-flex; align-items: center; gap: 6px;
}
.filter-tab em { font-style: normal; font-family: var(--mono); font-size: 10.5px; opacity: 0.75; }
.filter-tab:hover { color: var(--text); border-color: var(--line-strong); }
.filter-tab.active { background: var(--brand-soft); border-color: rgba(240, 32, 32, 0.45); color: #ffa3a3; font-weight: 600; }

.history-scroll { overflow-y: auto; padding: 0 18px 16px; display: flex; flex-direction: column; gap: 9px; }

/* 任务卡片 */
.history-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 15px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.history-card:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.06); transform: translateY(-1px); }
.history-card.active { border-color: rgba(240, 32, 32, 0.55); background: linear-gradient(135deg, rgba(240, 32, 32,0.13), rgba(79,140,255,0.07)); box-shadow: 0 0 0 1px rgba(240, 32, 32,0.3), 0 4px 18px rgba(240, 32, 32,0.15); }
.history-card-top { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.hc-time { font-family: var(--mono); font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.hc-id { font-family: var(--mono); font-size: 10px; color: var(--faint); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.hc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hc-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.hc-prompt { font-size: 12.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.hc-cost { font-size: 11px; color: var(--text-2); white-space: nowrap; flex-shrink: 0; }
.hc-cost.waiting { color: var(--amber); }
.hc-bar { width: 110px; height: 5px; background: rgba(255, 255, 255, 0.08); border-radius: 99px; overflow: hidden; flex-shrink: 0; }
.hc-bar-fill { height: 100%; border-radius: 99px; background: var(--grad); transition: width 0.5s ease; }
.hc-bar-fill.queued { background: #64748b; }
.hc-bar-fill.waiting { background: var(--amber); }

/* 状态徽章 */
.status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.6px;
  border-radius: 999px; padding: 3px 10px;
  white-space: nowrap;
}
.status-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge.SUCCESS { color: var(--green); background: var(--green-soft); }
.status-badge.FAILED { color: var(--red); background: var(--red-soft); }
.status-badge.RUNNING { color: #ff6b6b; background: var(--brand-soft); }
.status-badge.RUNNING::before { animation: pulse 1.2s ease infinite; }
.status-badge.QUEUED { color: #94a3b8; background: rgba(148, 163, 184, 0.12); }
.status-badge.WAITING { color: var(--amber); background: var(--amber-soft); }
.status-badge.CANCELLED { color: #9aa0a8; background: rgba(154, 160, 168, 0.12); }
.hc-cancel {
  margin-top: 6px;
  background: transparent;
  border: 1px solid rgba(255, 120, 138, 0.4);
  color: #ff8a9a;
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background 0.15s ease;
  text-decoration: none;
  display: inline-block;
}
.hc-cancel:hover { background: rgba(255, 90, 110, 0.14); }
.hc-cancel:visited { color: #ff8a9a; }

/* ═══════════ 工作台/预览 ═══════════ */
.stage-body { flex: 1; display: flex; flex-direction: column; min-height: 0; padding: 4px 18px 18px; }
.stage-empty {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--faint); gap: 6px; text-align: center; padding: 30px;
}
.stage-empty-icon {
  width: 84px; height: 84px; border-radius: 26px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(240, 32, 32,0.16), rgba(79,140,255,0.1));
  border: 1px solid rgba(240, 32, 32, 0.3);
  margin-bottom: 14px;
  color: #ff6b6b;
}
.stage-empty-title { font-size: 16px; font-weight: 700; color: var(--text-2); }
.stage-empty-sub { font-size: 12.5px; }

.preview {
  display: flex; flex-direction: column; gap: 12px;
  flex: 1; min-height: 0;
}
.preview video, .preview img { max-width: 100%; max-height: 46vh; border-radius: var(--r); border: 1px solid var(--line); background: #000; }
.preview audio { width: 100%; margin-top: 8px; }
.result-actions { display: flex; gap: 10px; padding-top: 4px; }

.progress-wrap {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 36px;
  padding: 20px;
  flex-wrap: wrap;
}
.ring-box { position: relative; width: 168px; height: 168px; flex-shrink: 0; }
.ring-box svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { stroke: rgba(255, 255, 255, 0.07); }
.ring-fg { stroke: var(--brand); stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; filter: drop-shadow(0 0 6px rgba(240, 32, 32, 0.6)); }
.ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.ring-pct { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; }
.ring-pct small { font-size: 14px; color: var(--text-2); font-weight: 600; }
.ring-label { font-size: 11.5px; color: var(--faint); }
.progress-info { min-width: 220px; }
.progress-node { font-size: 14.5px; font-weight: 700; margin-bottom: 6px; }
.progress-node-sub { font-size: 12px; color: var(--faint); margin-bottom: 14px; }
.node-bar { width: 100%; height: 7px; background: rgba(255, 255, 255, 0.08); border-radius: 99px; overflow: hidden; }
.node-bar-fill {
  height: 100%; border-radius: 99px;
  background: var(--grad);
  position: relative;
  transition: width 0.4s ease;
}
.node-bar-fill::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  animation: shimmer 1.6s linear infinite;
}

.fail-panel {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; text-align: center; padding: 24px;
}
.fail-icon {
  width: 64px; height: 64px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  background: var(--red-soft); color: var(--red);
  border: 1px solid rgba(242, 102, 110, 0.3);
}
.fail-msg { font-size: 13px; color: var(--text-2); max-width: 480px; line-height: 1.7; }
.fail-msg small { color: var(--faint); }

/* 时间轴 */
.timeline {
  margin-top: 16px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  flex-shrink: 0;
}
.timeline-head {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}
.timeline-title { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; }
.timeline-stat { margin-left: auto; display: flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: 11.5px; color: var(--text-2); }
.tl-pct { color: #ff6b6b; font-weight: 700; }
.timeline-stream { max-height: 220px; overflow-y: auto; padding: 10px 15px; }
.tl-line { display: flex; align-items: baseline; gap: 10px; padding: 5px 0; font-size: 12px; }
.tl-time { font-family: var(--mono); font-size: 10.5px; color: var(--faint); flex-shrink: 0; }
.tl-dot { flex-shrink: 0; font-size: 9px; color: var(--brand-2); }
.tl-line.executing .tl-dot { color: #ff6b6b; }
.tl-line.done { color: var(--green); }
.tl-line.done .tl-dot { color: var(--green); }
.tl-line.error { color: var(--red); }
.tl-line.error .tl-dot { color: var(--red); }
.tl-line.cached { color: var(--amber); }
.tl-line.cached .tl-dot { color: var(--amber); }
.tl-msg { color: var(--text-2); word-break: break-all; }
.tl-empty { color: var(--faint); font-size: 12px; text-align: center; padding: 14px; }

/* ═══════════ 弹窗体系 ═══════════ */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 6, 10, 0.66);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn 0.18s ease;
  padding: 30px;
}
.modal {
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  max-height: 88dvh;
  display: flex; flex-direction: column;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow);
  animation: slideUp 0.22s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}
.modal-wide { max-width: 880px; }
.modal-sm { max-width: 460px; }
.modal-xs { max-width: 380px; }
.modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.modal-head h2 { font-size: 16px; font-weight: 700; }
.modal-close {
  margin-left: auto;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; color: var(--faint);
  border-radius: 8px; cursor: pointer;
  transition: all 0.15s ease;
}
.modal-close:hover { color: var(--text); background: rgba(255, 255, 255, 0.07); border-color: var(--line); }
.modal-body { padding: 22px; overflow-y: auto; }

/* ═══════════ 会员中心 ═══════════ */
.member-body { display: grid; grid-template-columns: 250px 1fr; gap: 22px; }
.member-side { display: flex; flex-direction: column; gap: 12px; }
.member-card {
  background: linear-gradient(135deg, rgba(240, 32, 32, 0.2), rgba(79, 140, 255, 0.1));
  border: 1px solid rgba(240, 32, 32, 0.35);
  border-radius: var(--r-lg);
  padding: 20px;
  text-align: center;
}
.mc-nick { font-size: 17px; font-weight: 800; }
.mc-name { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.mc-level {
  display: inline-block; margin-top: 12px;
  font-size: 12px; font-weight: 700; color: #ffd166;
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.3);
  border-radius: 999px; padding: 4px 14px;
}
.mc-coins { margin-top: 10px; font-size: 13.5px; color: var(--text); }
.member-nav { display: flex; flex-direction: column; gap: 4px; }
.member-nav-item {
  display: flex; align-items: center; gap: 10px;
  background: transparent; border: none; color: var(--text-2);
  font-size: 13px; cursor: pointer; text-align: left;
  padding: 10px 13px; border-radius: var(--r-sm);
  transition: all 0.15s ease;
}
.member-nav-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.member-nav-item.active { background: var(--brand-soft); color: #ffa3a3; font-weight: 600; }
.member-nav-item.danger { color: var(--red); }
.member-nav-item.danger:hover { background: var(--red-soft); }
.member-content h3 { font-size: 13.5px; margin: 20px 0 10px; }
.member-content h3:first-child { margin-top: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.stat-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px;
  text-align: center;
}
.sc-num { font-size: 20px; font-weight: 800; }
.sc-label { font-size: 11px; color: var(--faint); margin-top: 2px; }
.stat-card.good .sc-num { color: var(--green); }
.stat-card.bad .sc-num { color: var(--red); }
.stat-card.warn .sc-num { color: var(--amber); }
.level-box { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.lb-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 4px 0; }
.lb-row b { color: var(--text); }
.progress-track { height: 7px; background: rgba(255, 255, 255, 0.08); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.progress-track.small { height: 6px; }
.progress-fill { height: 100%; background: var(--grad); border-radius: 99px; transition: width 0.5s ease; }
.tx-list { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.tx-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 9px 12px; font-size: 12px;
}
.tx-note { flex: 1; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-time { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.tx-amt { font-weight: 700; font-family: var(--mono); font-size: 12px; }
.tx-amt.in { color: var(--green); }
.tx-amt.out { color: var(--red); }
.info-line { display: flex; justify-content: space-between; font-size: 12.5px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.info-line:last-child { border-bottom: none; }
.info-line span:last-child { color: var(--text-2); }
.tpl-add { display: flex; flex-direction: column; gap: 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-bottom: 14px; }
.tpl-add .btn-ghost { align-self: flex-start; }
.tpl-list { display: flex; flex-direction: column; gap: 8px; }
.tpl-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 11px 13px;
}
.tpl-name { font-size: 13px; font-weight: 700; flex-shrink: 0; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-preview { flex: 1; font-size: 12px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-actions { display: flex; gap: 6px; }
.tpl-use, .tpl-del {
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text-2);
  cursor: pointer; font-size: 11.5px;
  padding: 5px 11px; border-radius: 7px;
  transition: all 0.15s ease;
}
.tpl-use:hover { color: #ffa3a3; border-color: rgba(240, 32, 32, 0.45); }
.tpl-del:hover { color: var(--red); border-color: rgba(242, 102, 110, 0.45); }
.settings-form { display: flex; flex-direction: column; gap: 4px; }
.settings-form .btn-ghost { align-self: flex-start; margin-top: 10px; }

/* ═══════════ 充值中心 ═══════════ */
.recharge-balance {
  background: linear-gradient(135deg, rgba(240, 32, 32, 0.16), rgba(79, 140, 255, 0.08));
  border: 1px solid rgba(240, 32, 32, 0.32);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  margin-bottom: 20px;
}
.rc-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.rc-balance-box, .rc-price-box { display: flex; flex-direction: column; gap: 2px; }
.rc-bal-num { display: inline-flex; align-items: baseline; } /* 2026-09-22: 余额数字与"条"同行 */
.rc-label { font-size: 11px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.rc-balance-box b { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; }
.rc-balance-box em { font-style: normal; font-size: 12px; color: var(--text-2); margin-left: 3px; }
.rc-price-line { display: inline-flex; align-items: baseline; gap: 6px; }
.rc-price-line s { font-size: 13px; color: var(--faint); text-decoration: line-through; }
.rc-price-line b { font-size: 24px; font-weight: 800; background: linear-gradient(135deg, #ff9a3c, #ff5f6d); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rc-price-line em { font-style: normal; font-size: 12px; color: var(--text-2); }
.rc-discount {
  display: inline-block; background: linear-gradient(135deg, #ff9a3c, #ff5f6d); color: #fff;
  font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 9px; letter-spacing: 0.3px;
}
.rc-foot { font-size: 11px; color: var(--faint); margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,0.06); }
.rc-premium { color: var(--amber, #ffb454); font-weight: 600; }
.pkg-group-title { font-size: 12px; color: var(--text-2); font-weight: 700; margin: 0 0 10px; letter-spacing: 0.4px; }
.pkg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pkg-card {
  position: relative;
  background: var(--panel-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  padding: 16px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.16s ease;
  overflow: hidden;
}
.pkg-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.pkg-card.active {
  border-color: var(--brand);
  background: linear-gradient(135deg, rgba(240, 32, 32, 0.16), rgba(79, 140, 255, 0.08));
  box-shadow: 0 0 0 3px rgba(240, 32, 32, 0.18), 0 6px 20px rgba(240, 32, 32, 0.22);
}
.pk-tag {
  position: absolute; top: 0; right: 0;
  font-size: 10px; font-weight: 700; color: #0b0b0e;
  background: var(--grad);
  border-radius: 0 0 0 10px;
  padding: 3px 9px;
}
.pk-yuan { font-size: 21px; font-weight: 800; }
.pk-yuan small { font-size: 11px; color: var(--faint); font-weight: 500; }
.pk-coins { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }
.pk-gift { font-size: 10.5px; color: var(--faint); margin-top: 6px; }
.pay-methods { display: flex; gap: 10px; margin: 16px 0; }
.pay-method {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--panel-2); border: 1.5px solid var(--line);
  color: var(--text-2);
  font-size: 13px; font-weight: 600; cursor: pointer;
  padding: 12px; border-radius: var(--r);
  transition: all 0.15s ease;
}
.pay-method:hover { border-color: var(--line-strong); }
.pay-method.active { border-color: #f02020; background: rgba(240, 32, 32, 0.12); color: #ffe6e6; }
.recharge-orders { margin-top: 18px; }
.ro-title { font-size: 12.5px; font-weight: 700; margin-bottom: 8px; color: var(--text-2); }
.ro-item {
  display: flex; align-items: center; gap: 10px;
  font-size: 12px; color: var(--text-2);
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 9px 12px; margin-bottom: 6px;
}
.ro-no { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.ro-paid { color: var(--green); font-weight: 700; margin-left: auto; }
.ro-pending { color: var(--amber); font-weight: 700; margin-left: auto; }

/* 支付弹窗 */
.pay-box { text-align: center; }
.pay-amount { font-size: 14px; color: var(--text-2); margin-bottom: 4px; }
.pay-amount b { font-size: 36px; font-weight: 800; color: var(--text); }
.pay-method-name { font-size: 12.5px; color: var(--text-2); margin-bottom: 18px; }
.qr-box {
  width: 250px; height: 250px;
  margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  background: #fff; border-radius: var(--r-lg);
  padding: 10px;
}
.qr-box img { width: 100%; height: 100%; border-radius: 8px; }
.qr-fallback { font-size: 12px; color: #333; }
#payConfirmBtn { width: 100%; }

/* ═══════════ 音频库 ═══════════ */
.audio-lib-upload { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 4px; }
.audio-lib-upload .btn-primary { width: auto; align-self: flex-start; }
.audio-lib-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 11px 13px; margin-bottom: 8px;
}
.audio-lib-info { flex: 1; min-width: 0; }
.audio-lib-name { font-size: 13px; font-weight: 700; }
.audio-lib-meta { font-size: 11px; color: var(--faint); margin-top: 2px; }

/* ═══════════ 文档中心 / 后台 ═══════════ */
.doc-side { flex-shrink: 0; }
.doc-nav { display: flex; flex-direction: column; gap: 4px; }
.doc-nav-item {
  display: flex; align-items: center; gap: 10px;
  background: transparent; border: none; color: var(--text-2);
  font-size: 13px; cursor: pointer; text-align: left;
  padding: 10px 13px; border-radius: var(--r-sm);
  transition: all 0.15s ease;
}
.doc-nav-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.doc-nav-item.active { background: var(--brand-soft); color: #ffa3a3; font-weight: 600; }
.doc-content { flex: 1; min-width: 0; overflow-y: auto; }
.doc-content h3 { font-size: 15px; margin: 18px 0 8px; }
.doc-content h3:first-child { margin-top: 0; }
.doc-content p { font-size: 13px; color: var(--text-2); margin-bottom: 8px; line-height: 1.75; }
.doc-content ol { padding-left: 20px; margin-bottom: 10px; }
.doc-content li { font-size: 13px; color: var(--text-2); margin-bottom: 5px; }
.doc-content b { color: var(--text); }
.doc-content code {
  font-family: var(--mono); font-size: 12px;
  background: rgba(240, 32, 32, 0.12); color: #ffa3a3;
  border-radius: 5px; padding: 1px 6px;
}
.doc-content table { width: 100%; border-collapse: collapse; margin: 10px 0 16px; font-size: 12.5px; }
.doc-content th {
  text-align: left; color: var(--faint); font-weight: 600;
  padding: 8px 10px; border-bottom: 1px solid var(--line);
  font-size: 11.5px; letter-spacing: 0.4px;
}
.doc-content td { padding: 9px 10px; border-bottom: 1px solid var(--line); color: var(--text-2); }
.doc-note {
  background: rgba(79, 140, 255, 0.09);
  border: 1px solid rgba(79, 140, 255, 0.25);
  border-left: 3px solid var(--brand-2);
  border-radius: var(--r-sm);
  font-size: 12.5px; color: var(--text-2);
  padding: 11px 14px; margin: 12px 0;
}
.doc-warn {
  background: var(--amber-soft);
  border: 1px solid rgba(245, 183, 74, 0.3);
  border-left: 3px solid var(--amber);
  border-radius: var(--r-sm);
  font-size: 12.5px; color: var(--text-2);
  padding: 11px 14px; margin: 12px 0;
}

/* 后台表格 */
.ad-table { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.ad-tr { display: flex; align-items: center; gap: 8px; padding: 9px 12px; font-size: 12px; border-bottom: 1px solid var(--line); }
.ad-tr:last-child { border-bottom: none; }
.ad-tr span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ad-tr.ad-th { background: rgba(255, 255, 255, 0.03); color: var(--faint); font-weight: 700; font-size: 11px; letter-spacing: 0.4px; }
.ad-tr:not(.ad-th):hover { background: rgba(255, 255, 255, 0.025); }
.ad-ops { display: flex; gap: 6px; }
.adm-check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.adm-check input { width: auto; }

/* ═══════════ AI 写提示词 ═══════════ */
.prompt-ai .field { margin-bottom: 14px; }
.pai-upload-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.pai-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.pai-item {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 10px;
  display: flex; flex-direction: column; gap: 7px;
}
.pai-thumb { height: 84px; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.3); border-radius: 7px; overflow: hidden; font-size: 26px; }
.pai-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pai-item-name { font-size: 11.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pai-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.pai-person-preview { margin-top: 10px; }
.pai-person-preview .pai-item { max-width: 220px; }
.pai-dir-row { display: flex; gap: 16px; align-items: flex-end; }
.pai-seg-card {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 12px; margin-top: 10px;
}
.pai-seg-head { font-size: 12.5px; font-weight: 700; margin-bottom: 8px; color: var(--text-2); }
.pai-seg-prompt {
  width: 100%; box-sizing: border-box; resize: vertical;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.5;
  background: rgba(0,0,0,0.25); color: var(--text);
}

/* ═══════════ 人物库 ═══════════ */
.char-quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.char-quick-item {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  background: var(--panel-2);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  padding: 7px;
  cursor: pointer;
  transition: all 0.15s ease;
  overflow: hidden;
}
.char-quick-item:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.char-quick-item.active { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 0 0 2px rgba(240, 32, 32, 0.2); }
.char-quick-item img {
  width: 100%; height: 74px; object-fit: cover;
  border-radius: 6px; background: rgba(0, 0, 0, 0.3);
}
.char-quick-item span { font-size: 10.5px; color: var(--text-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.char-quick-manage { font-size: 11px !important; padding: 7px !important; }
.char-lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 10px; }
.char-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
  transition: border-color 0.15s ease;
}
.char-card:hover { border-color: var(--line-strong); }
.char-card.selected { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan); }
.char-card-img, .char-card-name { cursor: pointer; }
.char-card-img { height: 150px; border-radius: 8px; overflow: hidden; background: rgba(0,0,0,0.3); }
.char-card-img img { width: 100%; height: 100%; object-fit: cover; }
.char-card-name { font-size: 12px; font-weight: 600; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.char-card-ops { display: flex; gap: 6px; }
.char-card-ops button { flex: 1; }

/* ───────── 成品库 (视频/语音下载) ───────── */
.finish-tabs { display: flex; gap: 8px; margin: 14px 0 10px; }
.finish-tab {
  padding: 8px 18px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text-2); cursor: pointer;
  font-size: 13px; font-weight: 600; transition: all 0.15s ease;
}
.finish-tab.active {
  border-color: transparent; color: #0a0a0f; font-weight: 700;
  background: var(--grad);
}
.finish-row {
  display: flex; gap: 12px; align-items: center; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--panel-2); margin-bottom: 8px;
}
.finish-row:hover { border-color: var(--line-strong); }
.finish-ico { font-size: 20px; flex-shrink: 0; }
.finish-main { flex: 1; min-width: 0; }
.finish-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finish-meta { font-size: 11.5px; color: var(--text-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.finish-ops { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.finish-ops a {
  font-size: 12px; padding: 6px 12px; border-radius: 8px; text-decoration: none;
  border: 1px solid var(--line-strong); color: var(--text);
  transition: all 0.15s ease; white-space: nowrap;
}
.finish-ops .finish-view:hover { border-color: var(--cyan); color: var(--cyan); }
.finish-ops .finish-dl { border-color: var(--cyan); color: var(--cyan); font-weight: 700; }
.finish-ops .finish-dl:hover { background: rgba(245, 194, 74, 0.12); }
@media (max-width: 640px) {
  .finish-row { flex-wrap: wrap; }
  .finish-ops { width: 100%; justify-content: flex-end; }
}

/* 邀请好友 */
.invite-box {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 12px 14px;
}

/* ═══════════ Toast ═══════════ */
#toastRoot {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  z-index: 200;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: rgba(17, 22, 35, 0.95);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  box-shadow: var(--shadow);
  padding: 11px 20px;
  font-size: 13px;
  animation: toastIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  max-width: 560px;
}
.toast.ok { border-color: rgba(47, 208, 142, 0.45); }
.toast.ok .toast-ico { color: var(--green); }
.toast.err { border-color: rgba(242, 102, 110, 0.45); }
.toast.err .toast-ico { color: var(--red); }
.toast.warn { border-color: rgba(245, 183, 74, 0.45); }
.toast.warn .toast-ico { color: var(--amber); }
.toast.hide { animation: toastOut 0.25s ease forwards; }

/* 数字人生成队列 */
.avatar-queue-box {
  margin-top: 16px;
  background: rgba(240, 32, 32, 0.06);
  border: 1px solid rgba(240, 32, 32, 0.25);
  border-radius: var(--r);
  padding: 14px;
}
.aq-title { font-size: 13px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.aq-count {
  font-family: var(--mono); font-size: 11px;
  background: var(--grad); color: #0b0b0e; font-weight: 700;
  border-radius: 999px; padding: 2px 9px;
}
.aq-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; max-height: 200px; overflow-y: auto; }
.aq-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--r-sm); padding: 8px 10px;
}
.aq-item-info { flex: 1; min-width: 0; }
.aq-item-summary { font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aq-item-time { font-family: var(--mono); font-size: 10px; color: var(--faint); margin-top: 2px; }
.aq-run { margin-top: 8px; }

/* ═══════════ 在线客服悬浮 ═══════════ */
.service-fab {
  position: fixed; right: 26px; bottom: 26px; z-index: 120;
  width: 54px; height: 54px; border-radius: 50%;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--grad); color: #fff;
  box-shadow: 0 8px 28px rgba(240, 32, 32, 0.5);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.service-fab:hover { transform: translateY(-2px) scale(1.05); box-shadow: 0 12px 34px rgba(240, 32, 32, 0.6); }
.service-panel {
  position: fixed; right: 26px; bottom: 92px; z-index: 120;
  width: 300px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: slideUp 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
.service-head {
  padding: 13px 16px;
  font-size: 13.5px; font-weight: 700;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}
.service-head span { font-size: 11px; color: var(--faint); font-weight: 400; }
.service-body { display: flex; gap: 13px; padding: 15px; align-items: flex-start; }
.service-body img { width: 96px; height: 96px; border-radius: 10px; border: 1px solid var(--line); background: #fff; flex-shrink: 0; }
.service-info { flex: 1; min-width: 0; }
.service-info p { font-size: 12.5px; color: var(--text-2); margin-bottom: 7px; word-break: break-all; }
.service-info b { color: var(--text); font-family: var(--mono); }
.service-tips { font-size: 11px !important; color: var(--faint) !important; }
.service-info .btn-primary { padding: 8px 12px; font-size: 12px; }

/* ═══════════ 后台趋势图 ═══════════ */
.adm-chart {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 13px 14px 9px;
  margin-bottom: 12px;
}
.adm-chart-title { font-size: 12.5px; font-weight: 700; margin-bottom: 10px; }
.adm-chart-title em { font-style: normal; font-size: 11px; color: var(--faint); font-weight: 400; margin-left: 6px; }
.adm-chart-bars {
  display: flex; align-items: flex-end; gap: 3px;
  height: 66px;
  overflow-x: auto;
}
.adm-bar-col { display: flex; flex-direction: column; align-items: center; gap: 3px; flex: 1; min-width: 8px; }
.adm-bar { width: 100%; max-width: 12px; border-radius: 3px 3px 0 0; min-height: 2px; transition: height 0.3s ease; }
.adm-bar-col span { font-size: 8px; color: var(--faint); transform: rotate(-45deg); white-space: nowrap; }

/* ═══════════ 手机端底部导航 ═══════════ */
.mobile-nav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: rgba(13, 17, 25, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.mn-item {
  flex: 1;
  background: transparent; border: none;
  color: var(--text-2); font-size: 12px;
  padding: 11px 0;
  cursor: pointer;
  transition: color 0.15s ease;
}
.mn-item.active { color: var(--cyan); font-weight: 700; }

/* ═══════════ 手机端 H5 适配 ═══════════ */
@media (max-width: 1024px) {
  body { overflow: auto; }
  .topbar { height: 48px; padding: 0 10px; gap: 6px; }
  .brand h1 { font-size: 15px; }
  .brand-sub { display: none; }
  .brand-logo img { width: 28px; height: 28px; }
  .wf-tabs { margin: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .wf-tab { padding: 6px 10px; font-size: 12px; white-space: nowrap; }
  .topbar-right { gap: 4px; }
  .topbar-right .btn-ghost { font-size: 0; padding: 7px 8px; }
  .topbar-right .btn-ghost svg { width: 15px; height: 15px; }
  #promptAiBtn, #docBtn, #audioLibBtn, #charLibBtn { display: none; }
  .chip { padding: 4px 7px; font-size: 10px; }
  .layout {
    display: flex; flex-direction: column;
    padding: 8px 8px 88px;
    height: auto; gap: 8px;
  }
  .form-panel {
    overflow: visible; max-height: none;
    padding: 12px; border-radius: 10px;
  }
  .workspace { gap: 8px; }
  .history { max-height: none; }
  .stage { min-height: 340px; padding: 12px; }
  .history-scroll { max-height: none; }
  .history-card { padding: 10px 12px; }
  .hc-cancel { padding: 5px 8px; font-size: 11px; }

  /* 素材网格: 单列, 每张卡片占满宽度 */
  .file-grid { grid-template-columns: 1fr; gap: 8px; }
  .file-cell { padding: 8px; }
  .upload-slot { padding: 12px; }

  /* 人物库快捷网格: 窄屏 3 列挤压, 改自适应 */
  .char-quick-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }

  /* 分组分隔线: 点击折叠/展开 */
  .group-divider {
    cursor: pointer; user-select: none;
    padding: 8px 10px; margin: 10px 0 4px;
    font-size: 12px; border-radius: 6px;
    background: var(--panel-2);
  }
  .group-divider.collapsed + .file-batch-bar,
  .group-divider.collapsed ~ .file-grid { display: none; }

  /* 提示词输入框缩小 */
  textarea { font-size: 14px; padding: 10px; }
  .prompt-textarea { min-height: 80px; font-size: 14px; }

  /* 一键优化区域紧凑 */
  .prompt-optimizer { padding: 8px 10px; }
  .po-row { flex-wrap: wrap; gap: 6px; }
  .po-style { flex: 1; min-width: 100px; }
  .po-btn { width: 100%; margin-top: 4px; }

  /* 复用下拉框紧凑 */
  .prompt-reuse { flex-wrap: wrap; gap: 4px; }
  .prompt-reuse .pr-select { max-width: 100%; flex: 1 1 auto; }
  .prompt-reuse button { padding: 5px 8px; font-size: 11px; }

  /* 生成队列紧凑 */
  .avatar-queue-box { padding: 10px; }
  .aq-item { padding: 8px 10px; }
  .aq-item-info { font-size: 12px; }
  .aq-title { font-size: 14px; }

  /* TTS 区域 */
  .avatar-tts-zone { padding: 8px; }
  .avatar-tts-text { min-height: 60px; font-size: 13px; }
  .tts-title-row { flex-direction: column; gap: 6px; }
  .tts-title-row input { width: 100%; }

  /* 弹窗全屏 */
  .modal-mask { padding: 0; }
  .modal { max-width: 100%; max-height: 100vh; max-height: 100dvh; border-radius: 0; height: 100%; }
  .modal-head { padding: 12px 14px; }
  .modal-head h2 { font-size: 16px; }
  .modal-body { padding: 12px; }

  /* 会员中心 */
  .member-body { grid-template-columns: 1fr; }
  .member-side { flex-direction: row; flex-wrap: wrap; }
  .member-nav { flex-direction: row; overflow-x: auto; }
  .pkg-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

  /* 后台/文档中心弹窗: 横排改上下排, 导航横滑, 宽表格横滚 */
  .split-body { flex-direction: column; min-height: 0; gap: 12px; }
  .split-body .doc-nav { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .split-body .doc-nav-item { white-space: nowrap; flex-shrink: 0; }
  .member-content { overflow-x: hidden; }
  .member-content .ad-table { overflow-x: auto; }
  .member-content .ad-tr { min-width: 620px; }

  /* 客服悬浮 */
  .service-fab { right: 12px; bottom: 70px; width: 40px; height: 40px; }
  .service-panel { right: 12px; bottom: 120px; width: 260px; }

  /* 底部导航 */
  .mobile-nav { display: flex; height: 56px; }
  .mn-item { font-size: 11px; gap: 3px; padding: 6px 0; }

  /* 防 iOS 聚焦缩放: 输入框 ≥ 16px 才不缩放, 但 15px 已够用 */
  input[type="text"], input[type="password"], input[type="number"], select { font-size: 15px; padding: 10px 11px; }
  .btn-primary { padding: 12px 16px; font-size: 14px; }

  /* 隐藏不再需要的桌面元素 */
  #batchToggle, #batchBox { display: none !important; }
  .file-batch-bar { flex-wrap: wrap; gap: 4px; }
  .file-batch-bar button { font-size: 11px; padding: 5px 8px; }

  /* 工作台紧凑 */
  .progress-wrap { padding: 12px; }
  .ring-box svg { width: 120px; height: 120px; }
  .ring-pct { font-size: 24px; }
  .ring-label { font-size: 11px; }
  .timeline { max-height: 180px; }
}

/* ═══════════ 动画 ═══════════ */
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }
@keyframes spin { to { transform: rotate(360deg); } }

.spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}

/* ═══════════ 响应式 ═══════════ */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 360px 1fr; }
  .auth-screen { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
}

/* ───────── 参考生长视频 · 分段编辑器 ───────── */
.long-dir-box { margin-top: 14px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel-2); }
.long-dir-title { font-weight: 700; font-size: 14px; }
.ld-row { display: flex; gap: 10px; align-items: center; margin: 8px 0; }
.ld-person-preview { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--text-2); }
.ld-person-preview img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line-strong); }
.ld-ref-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.ld-ref-item { position: relative; }
.ld-ref-item img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line-strong); }
.ld-ref-item button { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; border: none; background: var(--red); color: #fff; font-size: 11px; line-height: 16px; cursor: pointer; }
.ld-seg-row { margin: 8px 0; }
.ld-seg-head { font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 4px; }
.ld-seg-prompt { width: 100%; font-family: var(--mono); font-size: 11.5px; }

/* ───────── 链式任务卡片 ───────── */
.chain-card { border-left: 3px solid var(--brand); }
.chain-card .hc-id { font-weight: 700; }
.chain-stages { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.chain-stage { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); padding: 2px 0; }
.chain-stage .cs-icon { font-size: 14px; width: 18px; text-align: center; }
.chain-stage .cs-label { flex: 1; }
.chain-stage .cs-status { font-size: 11px; color: var(--faint); }
.chain-stage.success .cs-status { color: var(--green); }
.chain-stage.failed .cs-status { color: var(--red); }
.chain-stage.running .cs-status { color: var(--brand-2); }
.chain-stage.waiting .cs-status, .chain-stage.queued .cs-status { color: var(--amber); }

/* 链式详情区 */
.chain-detail { display: flex; flex-direction: column; gap: 16px; }
.chain-stages-detail { display: flex; flex-direction: column; gap: 12px; }
.chain-stage-row { display: flex; align-items: center; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.cs-ring-mini { position: relative; width: 48px; height: 48px; flex-shrink: 0; }
.cs-ring-icon { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 18px; }
.cs-info { flex: 1; min-width: 0; }
.cs-title { font-weight: 700; font-size: 14px; }
.cs-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-progress-bar { height: 4px; background: var(--bg-2); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.cs-progress-fill { height: 100%; background: #f5c24a; border-radius: 2px; transition: width .5s ease; }

/* 链式时间线阶段标签 */
.tl-item { display: flex; gap: 8px; align-items: flex-start; }
.tl-stage { font-size: 10px; font-weight: 700; color: var(--brand-2); background: var(--brand-soft); padding: 1px 6px; border-radius: 4px; flex-shrink: 0; }
.ld-row select { padding: 7px 10px; border-radius: 8px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }

/* 优化后的提示词展示框 (details 默认折叠, 不挡时间轴) */
.optimized-prompt-box { margin-top: 16px; background: var(--panel-2); border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 14px; }
.optimized-prompt-box[open] { padding-bottom: 14px; }
.optimized-prompt-label { font-size: 13px; font-weight: 600; color: var(--green); cursor: pointer; user-select: none; }
.optimized-prompt-label::-webkit-details-marker { color: var(--text-2); }
.opt-hint { font-size: 11px; font-weight: 400; color: var(--text-2); }
.optimized-prompt-text { width: 100%; min-height: 120px; max-height: 300px; overflow-y: auto; background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-size: 13px; line-height: 1.6; font-family: inherit; resize: vertical; margin-top: 8px; }
.btn-refill { margin-top: 8px; padding: 8px 14px; background: var(--green); color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; }
.btn-refill:hover { filter: brightness(1.1); }
.opt-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.resume-hint { font-size: 12px; color: var(--warn, #f0a020); margin-top: 8px; padding: 8px 12px; background: rgba(240,160,32,0.08); border-radius: 6px; line-height: 1.5; }

/* ═══════════ 2026-08-24 手机端体验修复 ═══════════ */
@media (max-width: 1024px) {
  /* 1) 顶栏改两行: 工作流 Tab (AI智能成片/数字人口播) 独占一行, 不再被挤成细线 */
  .topbar { flex-wrap: wrap; height: auto; row-gap: 6px; padding: 8px 10px; }
  .brand { order: 1; }
  .topbar-right { order: 2; }
  .wf-tabs { order: 3; flex: 1 1 100%; margin: 0; }
  .wf-tab { flex: 1; justify-content: center; min-height: 34px; font-size: 13px; }

  /* 2) 会员中心不溢出: 统计两列, 内容横向不裁切 */
  .modal { width: 100%; max-width: 100vw; }
  .member-content { overflow-x: hidden; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-card { padding: 10px; }

  /* 3) 底部导航 (生成/任务/成品库/我的) 始终固定可见, 4 个按钮均分 */
  .mobile-nav { display: flex; z-index: 95; }
  .mn-item { flex: 1; min-height: 44px; font-size: 12px; }

  /* 4) 内容底部给导航留位 (原 88px 保持) */
  .layout { padding-bottom: 88px; }
}

/* ═══════════ 2026-08-25 手机端: 顶栏瘦身 + 导航常驻 ═══════════ */
@media (max-width: 1024px) {
  /* 去掉调试角标 */
  #verBadge { display: none !important; }

  /* 顶栏: 第1行 品牌+常用按钮, 第2行 工作流Tab(大按钮) */
  .topbar { flex-wrap: wrap; height: auto; row-gap: 8px; padding: 8px 10px; gap: 8px; }
  .brand { order: 1; }
  .topbar-right { order: 2; margin-left: auto; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
  .wf-tabs { order: 3; flex: 1 1 100%; margin: 0; }
  .wf-tab { flex: 1; justify-content: center; min-height: 38px; font-size: 13px; }

  /* 顶栏只保留: 文档中心 / 条数余额 / 管理员; 与底部重复的(我的/成品库)和状态条藏掉 */
  #memberBtn, #finishLibBtn, #keyStatus { display: none !important; }
  .coin-chip { font-size: 12px; padding: 5px 10px; }
  .topbar-right .btn-ghost { font-size: 12px; padding: 5px 8px; }

  /* ── 底部导航: 常驻最顶层, 任何页面(含我的/成品库弹窗)都可见可点 ── */
  .mobile-nav { display: flex; z-index: 300; height: 56px; }
  .mn-item { flex: 1; min-height: 56px; font-size: 12px; }

  /* 弹窗(我的/成品库)给底部导航让位 */
  .modal-mask { padding-bottom: 70px; }
  .modal { max-height: calc(100vh - 84px); max-height: calc(100dvh - 84px); }

  /* 我的中心适配手机 */
  .member-body { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .member-content { overflow-x: hidden; }

  /* 内容底部给导航留位 */
  .layout { padding-bottom: 72px; }
}

/* ═══════════ 2026-08-25 手机端: 工作台 "← 任务列表" 返回按钮 ═══════════ */
.stage-back-btn { display: none; }
@media (max-width: 1024px) {
  .stage-back-btn { display: inline-flex; align-items: center; margin-left: auto; font-size: 12px; padding: 5px 10px; }
}

/* ═══════════ 2026-08-25 固定值参数显示 (分辨率 720P) ═══════════ */
.field-fixed .fixed-val {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 8px;
  background: #fff4f2;
  border: 1px solid #ffd6d0;
  color: #c02222;
  font-weight: 700;
  font-size: 14px;
}


/* ═══════════ 2026-08-25 手机端会员中心布局 ═══════════ */
@media (max-width: 1024px) {
  .modal-mask { background: rgba(8, 8, 16, 0.97); }
  .member-side { display: flex; flex-direction: column; }
  .member-side .member-card { display: none; } /* 内容区已有身份卡片, 去掉重复 */
  .member-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .member-nav-item {
    justify-content: center;
    text-align: center;
    padding: 9px 4px;
    font-size: 12px;
    line-height: 1.3;
    gap: 3px;
  }
}

/* ═══════════ 2026-08-25 公测公告弹窗 ═══════════ */
.announce-mask { position: fixed; inset: 0; z-index: 9999; background: rgba(6, 8, 18, 0.82); display: flex; align-items: center; justify-content: center; padding: 20px; }
.announce-card { width: 100%; max-width: 430px; background: linear-gradient(160deg, #1a1214, #120c0d); border: 1px solid rgba(240, 32, 32, 0.45); border-radius: 18px; padding: 26px 22px 22px; text-align: center; box-shadow: 0 18px 60px rgba(0,0,0,.5); position: relative; }
.announce-x { position: absolute; top: 10px; right: 12px; background: none; border: none; color: var(--text-2); font-size: 18px; cursor: pointer; padding: 4px 8px; }
.announce-badge { display: inline-block; padding: 4px 14px; border-radius: 999px; background: linear-gradient(90deg, #f59e0b, #ef4444); color: #fff; font-weight: 800; font-size: 12px; letter-spacing: 1px; margin-bottom: 14px; }
.announce-title { font-size: 21px; font-weight: 800; margin: 0 0 12px; color: var(--text); }
.announce-item { text-align: left; font-size: 13.5px; line-height: 1.9; color: var(--text); padding: 10px 14px; background: rgba(240, 32, 32, 0.08); border: 1px solid rgba(240, 32, 32, 0.22); border-radius: 10px; margin-bottom: 8px; }
.announce-item b { color: #ffd166; }
/* 2026-08-29: 公告「重点推荐」条 (799 元年卡) */
.announce-item.announce-hot {
  background: linear-gradient(135deg, rgba(255, 95, 109, 0.16), rgba(255, 159, 67, 0.10));
  border-color: rgba(255, 159, 67, 0.45);
  font-weight: 700;
}
.announce-item.announce-hot b { color: #ffcf6b; }
.announce-btn { margin-top: 10px; width: 100%; padding: 12px; border-radius: 10px; border: none; cursor: pointer; background: linear-gradient(90deg, #e11d1d, #f5c24a); color: #fff; font-size: 15px; font-weight: 700; }
.announce-sub { margin-top: 10px; font-size: 11.5px; color: var(--faint); }
@media (max-width: 1024px) {
  .announce-mask { padding: 14px; align-items: flex-start; padding-top: 8vh; }
  .announce-card { max-width: none; padding: 22px 16px 18px; }
  .announce-title { font-size: 18px; }
  .announce-item { font-size: 13px; }
}

/* ═══════ 2026-08-25: 移动端键盘顶起遮挡验证码 — 登录表单区可滚动 ═══════
   auth-screen 是 position:fixed 全屏: 键盘弹起后固定容器里底部的图形验证码被挡住且滚不动。
   修复: 卡片容器 overflow-y:auto (min-height:0 让网格项可滚动) + 卡片 margin:auto
   (内容短时仍垂直居中, 内容长时从顶部开始可滚动, 不会顶部被裁) */
.auth-card-wrap { min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; align-items: flex-start; }
.auth-card { margin: auto 0; }

/* ═══════════ 2026-08-28 窄桌面 1025~1300px: 顶栏按钮过多溢出, 藏状态条+收紧间距 ═══════════ */
@media (min-width: 1025px) and (max-width: 1300px) {
  #keyStatus { display: none !important; }
  .topbar { gap: 12px; padding: 0 14px; }
  .topbar-right { gap: 5px; }
  .topbar-right .btn-ghost { padding: 5px 8px; font-size: 12px; }
}

/* ═══════════ 2026-08-28 小屏 ≤400px (360/390/393 常见机型收紧, 防挤成一团) ═══════════ */
@media (max-width: 400px) {
  .topbar { padding: 6px 8px; row-gap: 6px; gap: 6px; }
  .brand h1 { font-size: 14px; }
  .brand-logo img { width: 24px; height: 24px; }
  .chip { padding: 3px 6px; font-size: 10px; }
  .wf-tab { padding: 5px 8px; font-size: 12px; min-height: 34px; }
  .layout { padding: 6px 6px 84px; gap: 6px; }
  .form-panel { padding: 8px; }
  #genForm { padding: 4px 10px 16px; }
  .stage { min-height: 260px; padding: 8px; }
  .pkg-grid { gap: 8px; }
  .pkg-card { padding: 12px 4px; }
  .rc-price-line b { font-size: 19px; }
  .modal-body { padding: 10px; }
  .stat-grid { gap: 8px; }
  .member-nav-item { font-size: 11px; padding: 8px 2px; }
}

/* ═══════════ 2026-08-29 月卡卡片防遮挡 ═══════════
   充值弹窗固定 460px 宽, 桌面端 3 列挤压月卡到 140px: 右上「会员」角标(absolute)、
   「首月价」角标(原也 absolute 右上 8px)、「⚡并发」标签三者重叠。
   修复: 弹窗内网格按宽度自适应 (460px → 2 列); 首月价改为流式 chip 与并发标签同排
   (flex-wrap 挤不下自动换行); .mc 卡顶部留出 pk-tag 角标高度。 */
.modal-sm .pkg-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.pkg-card.mc { padding-top: 30px; }
.mc-chips { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; align-items: center; }
.mc-chips span { margin-top: 0 !important; }
.mc-first {
  display: inline-block;
  background: linear-gradient(135deg, #ff5f6d, #ff9a3c);
  color: #fff; font-size: 10px; padding: 2px 8px;
  border-radius: 9px; font-weight: 700; white-space: nowrap;
}

/* ═══════════ 2026-08-29 799 元年卡「重点推荐」档 ═══════════
   app.js 给年卡卡片刻 class="pkg-card mc hot" + .mc-hot 角标。
   整行铺满 (grid-column 1/-1) 做成主推 hero 卡; 边框用 padding-box/border-box
   双层背景画出暖色渐变边, 所以 .active 必须同时重写 background,
   否则 .pkg-card.active 会覆盖掉双层背景、透明边框就看不见了。 */
.pkg-card.mc.hot {
  /* 2026-09-22 魏哥: 去掉 grid-column 整行铺满 — 3 档会员卡要等宽对齐, 只留渐变描边 + 🔥 角标 */
  border-color: transparent;
  background:
    linear-gradient(135deg, rgba(255, 159, 67, 0.16), rgba(240, 32, 32, 0.10)) padding-box,
    linear-gradient(135deg, #ffb454, #ff5f6d) border-box;
  box-shadow: 0 4px 18px rgba(255, 95, 109, 0.16);
}
.pkg-card.mc.hot:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(255, 95, 109, 0.24); }
.pkg-card.mc.hot.active {
  border-color: var(--brand);
  background: linear-gradient(135deg, rgba(255, 159, 67, 0.20), rgba(240, 32, 32, 0.16));
  box-shadow: 0 0 0 3px rgba(240, 32, 32, 0.18), 0 6px 20px rgba(255, 95, 109, 0.22);
}
.mc-hot {
  display: inline-block;
  background: linear-gradient(135deg, #ff5f6d, #ff9a3c);
  color: #fff; font-size: 10px; padding: 2px 8px;
  border-radius: 9px; font-weight: 700; white-space: nowrap;
}

/* ═══════════ 2026-08-29 后台/文档中心弹窗防溢出 ═══════════
   原 modal-body 是内联 display:flex 横排 (媒体查询管不住), 手机上侧栏+内容挤爆屏幕点不到。
   改为 class: 桌面仍横排; ≤1024 变上下排, 导航变横滑条; 后台宽表格横向滚动。 */
.split-body { display: flex; gap: 22px; min-height: 380px; }

/* ═══════════ 2026-08-29 批量工作台 (AI 智能成片: 每条 = 一套图 + 一条文案) ═══════════ */
.bm-open { width: 100%; margin-bottom: 8px; }
.bm-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.bm-paste { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; margin-bottom: 12px; }
.bm-paste textarea { width: 100%; resize: vertical; }
.bm-paste-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 8px; }
.bm-paste-hint { font-size: 12px; color: var(--text-2); }
.bm-ov {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--text-2); cursor: pointer; user-select: none;
  padding: 4px 8px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--panel-2);
}
.bm-ov input { width: 15px; height: 15px; margin: 0; accent-color: var(--green); cursor: pointer; }
.bm-list { display: flex; flex-direction: column; gap: 12px; }
.bm-empty { text-align: center; padding: 18px 0; }
.bm-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; }
.bm-card-hd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.bm-card-hd b { font-size: 13px; }
.bm-sum { font-size: 11px; color: var(--faint); }
.bm-sum.warn { color: var(--amber); }
.bm-acts { display: flex; gap: 6px; margin-left: auto; }
.bm-acts button { font-size: 11px; padding: 3px 9px; }
.bm-card.bm-done { opacity: .58; }
.bm-done-tag {
  flex: 0 0 auto; font-size: 10.5px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px;
  background: rgba(47, 208, 142, 0.13);
  color: var(--green); border: 1px solid rgba(47, 208, 142, 0.34);
}
.bm-main {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin: 0 0 10px; padding: 10px 12px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r);
}
.bm-main-lab { font-size: 12.5px; font-weight: 600; color: var(--text); flex: 0 0 auto; }
.bm-main .bm-char { flex: 1 1 160px; }
.bm-main button { font-size: 11.5px; padding: 7px 11px; flex: 0 0 auto; }
.bm-main-prev img {
  width: 34px; height: 34px; object-fit: cover; display: block;
  border-radius: var(--r-sm); border: 1px solid var(--line-strong);
}
.bm-main-hint { flex: 1 1 100%; font-size: 11.5px; line-height: 1.6; color: var(--faint); }
.bm-voice-play { flex: 0 1 200px; min-width: 0; max-width: 200px; height: 31px; }
.bm-draft { background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.32); }
.bm-draft .bm-paste-row { margin-top: 0; }
.bm-draft .bm-paste-hint { flex: 1 1 220px; }
.bm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.bm-char { flex: 1 1 190px; min-width: 0; width: auto; font-size: 12.5px; padding: 7px 30px 7px 9px; }
.bm-bulk { flex: 0 0 auto; font-size: 11.5px; padding: 7px 11px; }
.bm-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 8px; margin-bottom: 8px; }
.bm-slot { position: relative; display: block; cursor: pointer; }
.bm-slot-box {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 70px; overflow: hidden;
  border: 1px dashed var(--line-strong); border-radius: var(--r-sm);
  color: var(--faint); font-size: 18px;
}
.bm-slot:hover .bm-slot-box { border-color: var(--brand); color: var(--text-2); }
.bm-slot.has .bm-slot-box { border-style: solid; border-color: var(--line-strong); }
.bm-slot.locked { cursor: default; }
.bm-slot.locked .bm-slot-box { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(240, 32, 32, 0.18); }
.bm-slot.locked:hover .bm-slot-box { border-color: var(--brand); color: var(--faint); }
.bm-slot-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bm-slot-tag { display: block; margin-top: 2px; text-align: center; font-size: 10px; color: var(--faint); }
.bm-x {
  position: absolute; top: 2px; right: 2px; z-index: 1;
  width: 18px; height: 18px; line-height: 18px; text-align: center;
  border-radius: 50%; background: rgba(8, 8, 16, 0.72); color: #fff;
  font-size: 10px; cursor: pointer;
}
.bm-prompt { width: 100%; font-size: 13px; resize: vertical; }
.bm-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.bm-stat { margin: 0 0 10px; font-size: 12px; line-height: 1.7; color: var(--text-2); }
.bm-stat b { color: var(--text); }
.bm-warn { display: block; margin-top: 2px; color: var(--amber); font-weight: 600; }
@media (max-width: 640px) {
  .bm-acts { margin-left: 0; width: 100%; }
  .bm-char { flex: 1 1 100%; }
  .bm-imgs { grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); }
  .bm-slot-box { height: 60px; }
}

/* ═══════════ 2026-09-01 修 H5 无法注册: 验证码输入框被压成 40px ═══════════
   .captcha-row 横排里验证码图固定 120px 且 flex-shrink:0, 输入框 flex:1 只吃剩下的。
   手机放大字体 (微信「页面字体」/系统字号) 后等效视口只剩 ~320px, 实测输入框宽度
   412px→132px、320px→40px、300px→24px: 用户点不进去也输不了, 只能反复点「获取验证码」,
   永远注册不了。窄屏改为竖排: 输入框独占一行满宽, 图形码排在它上方, 按钮排在下方。 */
@media (max-width: 640px) {
  .auth-card-wrap { padding: 16px 12px; }
  .auth-card { padding: 24px 16px; }
  .captcha-row { flex-wrap: wrap; }
  .captcha-row > input { flex: 1 1 100% !important; min-width: 0; }
  /* 图形码 + 换一张按钮排第一行, 输入框独占第二行 */
  .captcha-row > .captcha-img, .captcha-row > .captcha-refresh { order: -1; }
  .captcha-img { width: min(150px, 100%); height: auto; }
  .captcha-img svg { width: 100%; height: auto; }
  .captcha-refresh { flex: 0 0 auto; min-height: 40px; padding: 6px 12px; }
  .captcha-row > #smsSendBtn { flex: 1 1 auto !important; min-height: 42px; }
}

/* ═══════════ 2026-09-01 批次5: 全站真自适应 (任意机型 × 任意字号都完整展示) ═══════════
   用户要求"不管手机多大、字体调多大都能完整展示"。解法不是继续堆断点 —— 现有 6 个
   max-width:1024 块已经互相覆盖到谁也说不清最终值。真正的做法是把会顶破容器的写法
   改成天生流体:
     1) 弹性子项统一 min-width:0 (flex 默认 min-width:auto, 内容不缩, 这正是输入框被挤没的根因)
     2) "固定 px 侧元素 + flex:1 输入框"这类横排一律 flex-wrap: 宁可换行也不许把对方挤没
     3) 承载用户数据 / 后端可改文案的 nowrap 一律放开
     4) 硬 px 宽度一律 min(原值, 100%); grid 列宽一律 minmax(min(100%,Xpx),1fr)
        —— min(100%,Xpx) 是"任何视口都不溢出且不需要断点"的关键写法
   验收视口按 320px 算 (物理 412px 的手机放大字体后的等效 CSS 宽度)。
   会改变桌面观感的 (网格列数、导航高度、toast 位置、工作流 ID) 只放进 ≤1024:
   字体放大后手机的等效视口必然 <1024, 桌面则完全保持站长熟悉的原样。 */

/* A. 兜底安全网: 媒体和表单控件永不顶破容器, 关键容器与弹性子项允许收缩 */
img, video, svg, canvas, select, textarea, input, iframe { max-width: 100%; }
.layout, .panel, .modal, .modal-body, .form-panel, #genForm, .member-content,
.history-scroll, .field, .history-card, .hc-side, .tpl-item, .audio-lib-upload { min-width: 0; }

/* B. 任务卡片 (每一单的头几分钟必现): 排队中那张有一长串
   "队列第 N 位 · 预计等待 ~X 分钟 · 预计扣费 ~Y 条数" 的 nowrap 文本, 而 .hc-side 原先
   flex-shrink:0 → 窄屏下先吞掉 .hc-main 的宽度 (提示词整行消失), 再把「取消」「网页预览」
   甩到视口外, 用户既看不到进度也撤不了单。放开换行 + 允许收缩后自己折行。 */
.history-card { flex-wrap: wrap; }
.hc-side { flex-shrink: 1; }
.hc-cost, .hc-cost.waiting { white-space: normal; overflow-wrap: anywhere; text-align: right; }
.hc-bar { width: min(110px, 100%); flex-shrink: 1; }
.hc-id { max-width: min(150px, 100%); }

/* C. 同款"固定按钮挤掉输入框"的其他横排 */
.captcha-row > input { min-width: 0; }
.tts-copywrite-row { flex-wrap: wrap; }
.tts-copywrite-row input { flex: 1 1 140px; min-width: 0; }
.audio-lib-upload { flex-wrap: wrap; }
.audio-lib-upload .field { flex: 1 1 240px; min-width: 0; } /* 只有人物库那行有 .field, 音频库竖排不受影响 */
.file-batch-bar .btn-ghost { white-space: normal; overflow-wrap: anywhere; text-align: center; }

/* D. 我的模板: 固定名 + 右侧两按钮 同病, 原先还被 .member-content 的 overflow-x:hidden
   静默裁掉一半, 连"删除"都点不到 */
.tpl-item { flex-wrap: wrap; }
.tpl-name { flex-shrink: 1; min-width: 0; max-width: min(160px, 100%); }
.tpl-actions { flex-wrap: wrap; }

/* E. 横向排布但没有 wrap 的一组 (纯增强, 挤不下才换行) */
.pay-methods, .result-actions, .finish-tabs, .ad-ops, .pm-tab-row { flex-wrap: wrap; }

/* F. 硬 px 宽度 → min(原值, 100%): 支付二维码被裁就完全扫不出来 */
.qr-box { width: min(250px, 100%); }
.ring-box { width: min(168px, 100%); }
.progress-info { min-width: min(220px, 100%); }
.service-panel { width: min(260px, calc(100vw - 24px)); }
.toast { max-width: min(560px, calc(100vw - 24px)); }

/* G. 公告/实名弹窗是 position:fixed 且原先不可滚: 大字号下内容超一屏时,
   底部「提交认证」永久够不到 (实名领 1000 条数这条路就断了) */
.announce-mask { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.announce-card { margin: auto; }

/* H. 触屏输入框字号 16px。原先 ≤1024 里的 15px 注释写着"够用", 但 iOS/微信内置浏览器
   的聚焦放大阈值是 <16px 就整页放大, 15px 必踩: 用户一输字页面就跳到 2 倍大, 只能双指缩回去。
   用 pointer:coarse 判定而不是用宽度 —— 这是设备行为, 与视口宽窄无关。 */
@media (hover: none) and (pointer: coarse) {
  input[type="text"], input[type="password"], input[type="number"],
  input[type="tel"], input[type="email"], input[type="search"], select, textarea {
    font-size: 16px;
  }
  .prompt-textarea, .bm-prompt, .ld-seg-prompt, .optimized-prompt-text, .avatar-tts-text { font-size: 16px; }
}

/* I. ≤1024 才生效的部分: 网格列数与底部导航相关的位置 */
:root { --nav-h: 0px; }
@media (max-width: 1024px) {
  :root { --nav-h: 56px; } /* .mobile-nav 的高度, 原来在 4 个块里被写成 88/72/84 三个值 */

  /* 网格: 固定列数 / 过大的 minmax 下限会让 6 档充值 + 5 档月卡在手机上缩成 1 列长滚动,
     主推卡的"整行"设计也没了。min(100%,Xpx) 保证窄到 240px 也绝不溢出 */
  .pkg-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 112px), 1fr)); }
  .modal-sm .pkg-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 124px), 1fr)); }
  .char-quick-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 96px), 1fr)); }
  .char-lib-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 132px), 1fr)); }
  .pm-preset-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
  .file-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); }
  .stat-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 112px), 1fr)); }
  .member-nav { grid-template-columns: repeat(auto-fit, minmax(min(100%, 84px), 1fr)); }

  /* overflow-x:hidden 会把顶破容器的内容静默切掉 (看不见也滚不到), 这类 bug 已经吃过一次;
     改成 auto, 真有宽内容至少能横滑 */
  .member-content { overflow-x: auto; }

  /* 底部导航让位: 统一由 --nav-h 推导, 不再各处硬写 px */
  .layout { padding-bottom: calc(var(--nav-h) + 24px + env(safe-area-inset-bottom, 0px)); }
  #toastRoot { bottom: calc(20px + var(--nav-h) + env(safe-area-inset-bottom, 0px)); }
  .service-fab { bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom, 0px)); }
  .service-panel { bottom: calc(var(--nav-h) + 112px + env(safe-area-inset-bottom, 0px)); }
  .modal-mask { padding-bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom, 0px)); }

  /* 工作流 ID 是内部信息, 手机上占掉半个 tab 宽度导致名字显示不全 */
  .wf-tab-id { display: none; }
  .wf-tab { white-space: normal; overflow-wrap: anywhere; text-align: center; }

  /* 窄屏放不下"名字 + 预览 + 两个按钮"一行: 预览独占一行, 按钮靠右 */
  .tpl-preview { flex: 1 1 100%; order: 3; }
  .tpl-actions { margin-left: auto; }
  .pm-tab { flex: 1 1 auto; text-align: center; }
}

/* J. 任务列表分页后的「加载更多」 */
.hist-more { display: flex; justify-content: center; padding: 10px 0 2px; }
.hist-more .btn-ghost { font-size: 12.5px; padding: 8px 16px; }


/* ═══════════ 管理后台 v2 (2026-09-01 大气版) ═══════════ */
/* 弹窗更宽、留白更足 */
.split-body { min-height: 480px; padding: 26px 28px !important; gap: 30px !important; }
.doc-side { min-width: 176px; }
.doc-nav { gap: 4px; }
.doc-nav button { padding: 11px 14px; font-size: 13.5px; border-radius: 10px; }
.doc-nav button.on { font-weight: 700; }
#adminModal .modal, #docModal .modal { max-width: 1080px; width: 92vw; }
.modal-head { padding: 20px 26px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 19px; letter-spacing: 0.5px; }

/* 表格: 行距拉开、字号加大、列分工明确 */
.ad-table { border-radius: 14px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.015); }
.ad-tr { padding: 14px 18px; gap: 14px; font-size: 13.5px; line-height: 1.5; }
.ad-tr span { flex: 1; }
.ad-tr.ad-th { padding: 12px 18px; font-size: 11.5px; letter-spacing: 0.8px; background: rgba(255,255,255,.045); }
.ad-tr:not(.ad-th):hover { background: rgba(255,255,255,.035); }

/* 列宽: 关键列给足空间, 数字列不再挤压 */
.ad-tr span:nth-child(1) { flex: 0.5; }              /* ID */
.ad-tr span:nth-child(2) { flex: 1.8; }              /* 用户名 */
.ad-tr span:nth-child(3) { flex: 1.7; }              /* 角色/等级 */
.ad-tr span:nth-child(4) { flex: 1.2; text-align: right; font-variant-numeric: tabular-nums; }  /* 条数 */
.ad-tr span:nth-child(5), .ad-tr span:nth-child(6) { flex: 1; text-align: right; font-variant-numeric: tabular-nums; } /* 任务/消耗 */
.ad-tr span:nth-child(7) { flex: 1; text-align: right; font-variant-numeric: tabular-nums; }  /* 充值 */
.ad-tr span:nth-child(8), .ad-tr span:last-child { flex: 2.1; }  /* 操作列 */

/* 小徽章更透气 */
.chip { line-height: 1.5; }
.ad-tr .chip { margin-right: 5px; }

/* 按钮: 更大更好点 */
.ad-ops { gap: 8px; flex-wrap: nowrap; }
.ad-ops .tpl-use, .ad-ops .tpl-del { padding: 6px 14px !important; font-size: 12.5px !important; border-radius: 8px; }

/* 管理后台里的输入框/下拉框统一加大 */
#adminContent input, #adminContent select, #adminContent textarea {
  font-size: 13.5px; padding: 9px 12px; border-radius: 9px;
}
#adminContent h3 { font-size: 17px; margin: 6px 0 16px; letter-spacing: 0.5px; }
#adminContent .hint { line-height: 1.6; }
#adminContent .ad-note, .doc-note { font-size: 12.5px; line-height: 1.7; }

/* 设置表单: 两列网格不再拥挤 */
#adminContent .field { margin-bottom: 16px; }
#adminContent label { font-size: 12.5px; margin-bottom: 6px; display: inline-block; }
#adminContent .doc-note { margin-bottom: 18px; }

/* 手机端: 后台表格横向滚动, 不再挤压变形 */
@media (max-width: 760px) {
  #adminModal .modal, #docModal .modal { width: 96vw; }
  .ad-table { overflow-x: auto; display: block; white-space: nowrap; }
  .ad-tr { padding: 12px 14px; font-size: 12.5px; }
  .ad-ops .tpl-use, .ad-ops .tpl-del { padding: 5px 10px !important; font-size: 12px !important; }
}

/* ═══════════ 2026-09-17: 管理员后台 = 全屏横屏布局 ═══════════
   背景: 用户反馈后台在手机上"显示不全", 要求做成横屏。
   处理: 后台弹窗整屏铺满 (100dvh); 窄屏时导航变顶部横向滚动条、内容占满整宽;
        触屏设备打开后台时还会尝试自动全屏 + 锁定横屏 (见 app.js enterAdminWide)。
   注意: 上面已有 `.split-body { padding/gap !important }` 的规则, 这里必须同样用 !important 覆盖。 */
#adminModal { padding: 0 !important; align-items: stretch !important; justify-content: stretch !important; }
#adminModal .modal {
  width: 100vw; max-width: none;
  height: 100vh; height: 100dvh; max-height: 100dvh;
  border-radius: 0; border: none;
}
#adminModal .modal-head { padding: 12px 16px; }
#adminModal .modal-body.split-body {
  padding: 14px 18px 18px !important;
  gap: 18px !important;
  flex: 1; min-height: 0;
}
#adminModal .doc-side { min-width: 168px; }
#adminModal .member-content { overflow-x: auto; }
#adminModal .modal-body { overflow-y: auto; }

@media (max-width: 900px) {
  #adminModal .split-body { flex-direction: column; gap: 10px !important; }
  #adminModal .doc-side { min-width: 0; width: 100%; }
  #adminModal .doc-nav {
    flex-direction: row; flex-wrap: nowrap;
    overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
    padding-bottom: 6px; gap: 6px;
  }
  #adminModal .doc-nav-item { flex: 0 0 auto; white-space: nowrap; }
  #adminModal .modal-body.split-body { padding: 10px 12px 14px !important; }
}
/* 手机横过来 (矮屏) 时进一步压缩垂直留白, 让内容显示更多 */
@media (orientation: landscape) and (max-height: 560px) {
  #adminModal .modal-head { padding: 7px 14px; }
  #adminModal .modal-head h2 { font-size: 14px; }
  #adminModal .modal-body.split-body { padding: 8px 12px 10px !important; gap: 10px !important; }
  #adminModal .doc-side { min-width: 150px; }
}

/* ═══════════ 2026-09-17: 顶部栏横向溢出修复 ═══════════
   实测 1280 宽下 document 横向溢出 289px、1440 宽下溢出 381px — 右上角按钮(会员中心/管理员后台/条数)
   被挤出屏幕, 看起来就像"显示不全"。原因: 中间的 .wf-tabs 是 flex 项且无 min-width:0, 无法收缩,
   而 .brand / #fafuDl / .topbar-right 都是 flex-shrink:0, 于是整条 topbar 被撑宽。
   处理: 让工作流切换区可收缩 + 内部横向滚动 (滚动条隐藏), 右侧按钮因此始终留在屏幕内。 */
.wf-tabs {
  min-width: 0;
  flex-shrink: 1;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.wf-tabs::-webkit-scrollbar { display: none; }
/* 窄一点的桌面 (≤1360) 先把外部项目的下载入口收起来, 给站内按钮让位 */
@media (max-width: 1360px) {
  #fafuDl { display: none !important; }
}
