/* ============================================================
   影阁 · MiniMax H3 Studio —— 国风主题
   中国色体系：朱砂 / 鎏金 / 黛蓝 / 宣纸 / 墨褐
   保留全部类名，仅替换视觉层
   ============================================================ */
:root {
  --bg: #f3ecdc;            /* 宣纸底 */
  --surface: #fdfaf1;       /* 熟宣 */
  --surface-2: #f6f0e1;     /* 淡米 */
  --border: #e2d5b9;        /* 淡金 */
  --border-strong: #cdb88e; /* 金褐 */
  --text: #332a1d;          /* 墨褐 */
  --text-2: #6b5c47;        /* 褐灰 */
  --muted: #9c8c6e;         /* 茶 */
  --accent: #a53022;        /* 朱砂 */
  --accent-soft: #f5e4dd;   /* 朱砂淡 */
  --ok: #3e7c59;            /* 青玉 */
  --warn: #c08a2d;          /* 秋葵金 */
  --danger: #b03a2e;        /* 绛红 */
  --gold: #b98f4e;          /* 鎏金 */
  --radius: 10px;
  --shadow: 0 1px 2px rgba(120, 90, 40, .05), 0 8px 24px rgba(120, 90, 40, .08);
}
body.dark {
  --bg: #151b23;            /* 黛蓝 */
  --surface: #1d2631;
  --surface-2: #222d3a;
  --border: #2e3b4a;
  --border-strong: #41516a;
  --text: #eae3d1;          /* 暖白 */
  --text-2: #adb6c1;
  --muted: #7c8798;
  --accent: #d2564a;        /* 朱砂亮 */
  --accent-soft: #3a2724;
  --ok: #5da37f;
  --warn: #d3a557;
  --danger: #e0645a;
  --gold: #c9a86a;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}
/* 传统书法标题字体（楷/宋） */
.brand-title, .tab b, .card-head h3, .modal-head h3,
.sub h4, .btn.primary, .dz-empty b, .modal-head h3,
.logo { font-family: "STKaiti", "KaiTi", "楷体", "Songti SC", "SimSun", serif; }

h3, h4 { margin: 0; font-size: 14px; font-weight: 650; }
h4 { font-size: 13px; color: var(--text-2); }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; font-size: 12px; color: var(--text-2); }
.muted { color: var(--muted); font-size: 12px; }
.hidden { display: none !important; }
.grow { flex: 1; }

/* ---------- 登录门 ---------- */
body.locked > *:not(.login-gate) { display: none !important; }
body.locked .login-gate { display: grid !important; }
.login-gate {
  position: fixed; inset: 0; z-index: 200;
  display: none; place-items: center;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px);
}
.login-card {
  width: min(420px, 92vw);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 36px 32px 28px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center;
}
.login-logo {
  width: 56px; height: 56px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(180deg, #b8402f, #8e261c);
  color: #f8eed8; font-weight: 800; font-size: 24px;
  border: 1px solid #7f231a;
  box-shadow: inset 0 0 0 2px rgba(248, 238, 216, .32), 0 4px 14px rgba(142, 38, 28, .30);
  margin-bottom: 4px;
}
.login-card h2 { margin: 0; font-size: 18px; letter-spacing: 1.5px; }
.login-card form { display: flex; flex-direction: column; gap: 12px; width: 100%; margin-top: 8px; }
.login-card input[type=password] { padding: 11px 14px; font-size: 14px; }
.login-btn { width: 100%; padding: 11px 14px; font-size: 14px; }
.login-err { min-height: 18px; color: var(--danger); font-size: 12.5px; }
.login-tip { font-size: 11px; margin-top: 8px; line-height: 1.6; }
.login-tip code { font-size: 11px; }
body.dark .login-card { background: var(--surface); }

/* ---------- 背景装饰 ---------- */
.bg-deco { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(ellipse 55% 34% at 88% 8%, rgba(185, 143, 78, .12), transparent 62%),
    radial-gradient(ellipse 46% 32% at 6% 92%, rgba(165, 48, 34, .07), transparent 60%),
    radial-gradient(ellipse 30% 22% at 60% 50%, rgba(185, 143, 78, .05), transparent 70%);
}
body.dark .bg-deco {
  background:
    radial-gradient(ellipse 55% 34% at 88% 8%, rgba(201, 168, 106, .07), transparent 62%),
    radial-gradient(ellipse 46% 32% at 6% 92%, rgba(210, 86, 74, .05), transparent 60%);
}
.deco-cloud { position: fixed; pointer-events: none; }
.deco-cloud.tl { top: 88px; right: 28px; width: 168px; color: rgba(185, 143, 78, .42); }
.deco-cloud.br { bottom: 28px; left: 20px; width: 192px; transform: scaleX(-1); color: rgba(165, 48, 34, .22); }
body.dark .deco-cloud.tl { color: rgba(201, 168, 106, .22); }
body.dark .deco-cloud.br { color: rgba(210, 86, 74, .16); }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: 10px 18px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 11px; }
/* 印章 Logo */
.logo {
  width: 38px; height: 38px; border-radius: 8px;
  display: grid; place-items: center;
  background: linear-gradient(180deg, #b8402f, #8e261c);
  color: #f8eed8; font-weight: 800; font-size: 17px; letter-spacing: 1px;
  border: 1px solid #7f231a;
  box-shadow: inset 0 0 0 2px rgba(248, 238, 216, .32), 0 2px 6px rgba(142, 38, 28, .30);
  user-select: none;
}
body.dark .logo { background: linear-gradient(180deg, #c94d3f, #9e2d22); }
.brand-title { font-weight: 700; font-size: 16px; letter-spacing: 1px; }
.brand-sub { font-size: 11px; color: var(--muted); letter-spacing: .5px; }
.top-status { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.top-actions { display: flex; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-2); white-space: nowrap;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.chip.ok .dot { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }
.chip.bad .dot { background: var(--danger); }

/* ---------- 布局 ---------- */
.layout {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 14px;
  padding: 14px 18px 40px;
  align-items: start;
  max-width: 1580px; margin: 0 auto;
}
.col-main, .col-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.col-side { position: sticky; top: 68px; }
@media (max-width: 1180px) {
  .layout { grid-template-columns: 1fr; }
  .col-side { position: static; }
}

/* ---------- 卡片（宣纸质感） ---------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
/* 标题前的朱批书签记号 */
.card-head h3::before {
  content: ""; display: inline-block;
  width: 3px; height: 13px; border-radius: 2px;
  background: linear-gradient(180deg, var(--gold), var(--accent));
  margin-right: 7px; vertical-align: -1px;
}
.card-head .head-actions { margin-left: auto; display: flex; gap: 6px; }
.card-head .muted { margin-left: auto; }
.card-head .head-actions + .muted { margin-left: 0; }
.sub { padding: 12px 0; border-top: 1px dashed var(--border); }
.sub:first-of-type { border-top: 0; padding-top: 4px; }
.sub h4 { margin-bottom: 8px; }

details.adv > summary {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; list-style: none; user-select: none;
}
details.adv > summary::-webkit-details-marker { display: none; }
details.adv > summary::after { content: "▾"; margin-left: auto; color: var(--gold); }
details.adv[open] > summary::after { content: "▴"; }
details.adv > summary .muted { margin-left: auto; }
details.adv > summary::after { margin-left: 8px; }

/* ---------- Tabs（卷轴标签） ---------- */
.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tab {
  border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--radius); padding: 10px 12px; cursor: pointer;
  text-align: left; color: var(--text); transition: .18s;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.tab b { display: block; font-size: 14px; letter-spacing: 2px; }
.tab small { color: var(--muted); font-size: 11px; }
.tab:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.tab.active {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-soft), var(--surface));
  box-shadow: inset 3px 0 0 var(--accent), var(--shadow);
}
.tab.active small { color: var(--accent); }
.tab.disabled { opacity: .45; cursor: not-allowed; transform: none; }

/* ---------- 表单 ---------- */
textarea, input[type=text], input[type=number], select {
  width: 100%; padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 8px;
  color: var(--text); font: inherit; font-size: 13px;
  outline: none; transition: .15s;
}
textarea { resize: vertical; line-height: 1.65; min-height: 90px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=range] { padding: 0; accent-color: var(--accent); }
.row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 8px; }
.row.indent { padding-left: 26px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 92px; }
.field > span { font-size: 11px; color: var(--muted); }
.field.grow { flex: 1; }
.hint-row { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--muted); }
.tip { margin: 8px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.check { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.switch { display: flex; align-items: center; gap: 8px; margin: 8px 0 2px; font-size: 13px; cursor: pointer; }
.switch input { accent-color: var(--accent); width: 15px; height: 15px; }
.tag { font-style: normal; font-size: 10.5px; padding: 1px 7px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); margin-left: auto; }
.tag.on { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, var(--border)); }

/* ---------- 按钮 ---------- */
.btn {
  border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); border-radius: 8px; padding: 8px 14px;
  font: inherit; font-size: 13px; cursor: pointer; transition: .18s;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
/* 主按钮：朱砂印章风 */
.btn.primary {
  background: linear-gradient(180deg, #b8402f, #962a1e);
  border-color: #7f231a; color: #fdf6e8;
  font-weight: 700; letter-spacing: 3px;
  box-shadow: 0 2px 6px rgba(150, 42, 30, .25), inset 0 1px 0 rgba(255, 255, 255, .14);
}
.btn.primary:hover { filter: brightness(1.07); color: #fff; box-shadow: 0 3px 10px rgba(150, 42, 30, .38); }
.btn.primary:disabled { opacity: .55; cursor: not-allowed; filter: none; }
.btn.ghost { background: transparent; }
.btn.tiny { padding: 4px 9px; font-size: 12px; border-radius: 6px; letter-spacing: 0; }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.btn.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

.actionbar {
  position: sticky; bottom: 0; z-index: 10;
  display: flex; gap: 10px; align-items: flex-end;
  padding: 12px 14px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.actionbar .field { min-width: 72px; }
.actionbar .btn { height: 38px; }

/* ---------- 尺寸比例 ---------- */
.ratio-row { display: flex; gap: 6px; flex-wrap: wrap; }
.ratio {
  border: 1px solid var(--border); background: var(--surface-2);
  border-radius: 7px; padding: 5px 10px; font-size: 12px; cursor: pointer; color: var(--text-2);
}
.ratio:hover { border-color: var(--border-strong); }
.ratio.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* ---------- 上传（宣纸虚线框） ---------- */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dropzone {
  position: relative; border: 1.5px dashed var(--border-strong); border-radius: 10px;
  min-height: 132px; display: grid; place-items: center; cursor: pointer;
  background: var(--surface-2); overflow: hidden; transition: .18s;
}
.dropzone:hover, .dropzone.over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface-2));
}
.dz-empty { text-align: center; color: var(--muted); }
.dz-empty b { display: block; font-size: 13px; color: var(--text-2); letter-spacing: 1px; }
.dz-empty small { font-size: 11px; }
.dropzone img { width: 100%; height: 100%; max-height: 190px; object-fit: contain; display: block; }
.dz-clear {
  position: absolute; top: 6px; right: 6px; z-index: 2;
  width: 22px; height: 22px; border-radius: 50%; border: 0;
  background: rgba(60, 40, 20, .6); color: #fff; cursor: pointer; font-size: 12px; line-height: 1;
}
.dz-badge {
  position: absolute; left: 6px; top: 6px; z-index: 2;
  background: rgba(60, 40, 20, .65); color: #fff; font-size: 10px;
  padding: 2px 7px; border-radius: 999px;
}
.ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.ref-grid .dropzone { min-height: 104px; }
.ref-grid .ref-add { grid-column: 1 / -1; justify-self: start; margin-top: 2px; }
.sub-h { margin: 14px 0 6px; font-size: 12.5px; color: var(--text-2); font-weight: 650; }
.sub-h .muted { font-weight: 400; }
.dropzone video { width: 100%; height: 100%; max-height: 190px; object-fit: contain; display: block; }
.dz-audio { font-size: 26px; color: var(--gold); }

/* ---------- 运行（朱砂水墨进度条） ---------- */
.progress { height: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.progress .bar {
  height: 100%; width: 0;
  background: linear-gradient(90deg, #a53022, #c9a86a);
  transition: width .25s;
  box-shadow: 0 0 6px rgba(165, 48, 34, .45);
}
.run-meta { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--text-2); }
.live { margin-top: 10px; }
.live img { width: 100%; border-radius: 8px; border: 1px solid var(--border); }
.result-empty { padding: 26px 10px; text-align: center; color: var(--muted); font-size: 12.5px; background: var(--surface-2); border-radius: 8px; }

/* ---------- 任务失败原因 ---------- */
.job-error {
  margin-bottom: 10px; padding: 10px 12px; border-radius: 8px;
  background: color-mix(in srgb, var(--danger) 8%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--danger) 30%, var(--border));
}
.job-error-title { font-size: 12px; font-weight: 600; color: var(--danger); margin-bottom: 6px; }
.job-error-detail {
  margin: 0; font-size: 11.5px; line-height: 1.6; color: var(--text-2);
  white-space: pre-wrap; word-break: break-word;
  max-height: 170px; overflow: auto;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
#resultBox video { width: 100%; border-radius: 8px; background: #000; display: block; }
.result-actions { display: flex; gap: 8px; margin-top: 8px; }

/* ---------- 历史 ---------- */
.history { display: flex; flex-direction: column; gap: 8px; max-height: 460px; overflow: auto; }
.hitem {
  display: flex; gap: 10px; padding: 8px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--surface-2);
  cursor: pointer; transition: .15s;
}
.hitem:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 30%, var(--surface-2)); }
.hthumb {
  width: 62px; height: 44px; border-radius: 6px; flex: none;
  background: #14181d center/cover no-repeat;
  display: grid; place-items: center; color: #7a6a55; font-size: 10px;
  overflow: hidden;
}
.hthumb video { width: 100%; height: 100%; object-fit: cover; display: block; }
.hdel {
  flex: none; align-self: flex-start; margin-left: 2px;
  border: 0; background: transparent; cursor: pointer;
  color: var(--muted); font-size: 12px; line-height: 1;
  padding: 4px 5px; border-radius: 5px; transition: .15s;
}
.hdel:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.hsc {
  flex: none; align-self: flex-start; margin-left: 2px;
  border: 0; background: transparent; cursor: pointer;
  color: var(--gold, #b98f4e); font-size: 13px; line-height: 1;
  padding: 4px 5px; border-radius: 5px; transition: .15s;
}
.hsc:hover { color: var(--accent, #a53022); background: color-mix(in srgb, var(--gold, #b98f4e) 14%, transparent); }
.hbody { min-width: 0; flex: 1; }
.htitle { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hmeta { font-size: 10.5px; color: var(--muted); display: flex; gap: 8px; margin-top: 3px; flex-wrap: wrap; }
.hmeta .hseed { font-variant-numeric: tabular-nums; color: var(--accent); cursor: help; }
.badge { font-size: 10px; padding: 1px 6px; border-radius: 4px; background: var(--surface); border: 1px solid var(--border); }
.badge.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, var(--border)); }
.badge.err { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.badge.run { color: var(--accent); border-color: var(--accent); }
.herror {
  font-size: 10.5px; color: var(--danger); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(58, 43, 24, .5); display: grid; place-items: center; padding: 20px; }
.modal-box { width: min(760px, 100%); max-height: 86vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: 0 20px 60px rgba(60, 40, 15, .3); }
.modal-head { display: flex; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.modal-head h3 { flex: 1; }
.modal-body { padding: 16px; overflow: auto; }
.tpl-item { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--border); border-radius: 9px; margin-bottom: 8px; background: var(--surface-2); }
.tpl-item .grow b { font-size: 13px; }
.snippet { border: 1px solid var(--border); border-radius: 9px; padding: 10px; margin-bottom: 8px; background: var(--surface-2); cursor: pointer; }
.snippet:hover { border-color: var(--accent); }
.snippet b { font-size: 12.5px; }
.snippet p { margin: 4px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.55; }

.setup-banner {
  position: relative; z-index: 1;
  display: flex; gap: 14px; align-items: center;
  margin: 12px 18px 0; padding: 12px 16px;
  background: color-mix(in srgb, var(--warn) 10%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--border));
  border-radius: var(--radius); font-size: 13px;
}
.setup-banner .btn { margin-left: auto; }

/* ---------- Toast（墨色） ---------- */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
  z-index: 100; padding: 10px 20px; border-radius: 999px;
  background: #3a2f26; color: #f6efe0; font-size: 13px;
  box-shadow: 0 8px 30px rgba(40, 30, 15, .35);
  max-width: 80vw; text-align: center;
}
.toast.err { background: #a53022; }
.toast.ok { background: #3e7c59; }
.toast.warn { background: #a06a10; }

/* ============================================================
   影阁 · 造像（生图板块）补充组件
   ============================================================ */
/* 顶部板块导航（视频 ↔ 生图） */
.nav-btn.active { border-color: var(--accent) !important; color: var(--accent) !important; background: var(--accent-soft); }

/* 风格场景库（横向卷轴） */
.scene-grid { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: thin; }
.scene {
  min-width: 150px; flex: none;
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2); cursor: pointer; text-align: left;
  transition: .15s; position: relative; overflow: hidden;
}
.scene:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.scene.active {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-soft), var(--surface));
  box-shadow: inset 3px 0 0 var(--accent);
}
.scene .sc-ic { font-family: "STKaiti", "KaiTi", "楷体", serif; font-size: 22px; line-height: 1; color: var(--accent); }
.scene .sc-name { font-size: 13px; font-weight: 650; }
.scene .sc-en { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scene .sc-tag {
  align-self: flex-start; font-style: normal; font-size: 9.5px; line-height: 1.7;
  padding: 0 7px; border-radius: 999px; margin-top: 2px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
}
.scene .sc-tag.lora { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }

/* 模型选卡 */
.model-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.mchip {
  flex: 1 1 200px; display: flex; flex-direction: column; gap: 2px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface-2); cursor: pointer; text-align: left; transition: .15s;
}
.mchip:hover { border-color: var(--border-strong); }
.mchip.active {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-soft), var(--surface));
  box-shadow: inset 3px 0 0 var(--accent);
}
.mchip b { font-size: 14px; font-family: "STKaiti", "KaiTi", "楷体", serif; letter-spacing: 1px; }
.mchip small { font-size: 11px; color: var(--muted); line-height: 1.5; }

/* 结果画廊 */
.result-imgs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.result-imgs figure { margin: 0; }
.result-imgs img { width: 100%; border-radius: 8px; border: 1px solid var(--border); display: block; }
.result-imgs figcaption { display: flex; gap: 6px; margin-top: 5px; font-size: 10.5px; }
.result-imgs figcaption .btn { flex: 1; padding: 3px 0; font-size: 10.5px; letter-spacing: 0; }
.result-imgs figcaption .btn.dl { flex: none; width: 30px; }
.img-prev-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.img-prev-row .dropzone { min-height: 210px; }
.img-prev { position: relative; }
.img-prev .dropzone img { max-height: 260px; }

/* ============ 声·配音 工作台 ============ */
.voice-bank { display: grid; gap: 7px; max-height: 232px; overflow: auto; padding-right: 2px; }
.vitem { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; background: var(--surface); transition: border-color .15s, background .15s; }
.vitem:hover { border-color: var(--border-strong); }
.vitem.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface)); }
.vitem .vname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.vitem .vtag { flex: 0 0 auto; font-size: 10.5px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 999px; }
.vitem.sel .vtag { color: var(--accent); border-color: var(--accent); }
.vplay { flex: 0 0 auto; font-size: 12px; }
.vok { color: var(--ok); font-size: 14px; margin-left: 2px; }
.voice-empty { padding: 18px 10px; text-align: center; color: var(--muted); font-size: 12px; background: var(--surface-2); border-radius: 8px; }
.emo-row { display: none; gap: 8px; margin-top: 8px; }
.emo-row.on { display: flex; flex-wrap: wrap; }
.result-audio { display: flex; flex-direction: column; gap: 10px; padding: 4px 2px; }
.result-audio audio { width: 100%; height: 40px; }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.aicon { width: 40px; height: 40px; flex: 0 0 40px; display: grid; place-items: center; font-size: 18px; background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface-2)); border-radius: 8px; }
.hitem .hthumb.audio { display: grid; place-items: center; font-size: 15px; }
.split-hint { font-size: 11px; color: var(--muted); margin-top: 6px; }

/* ============ 配音页补充 ============ */
.vhint { margin-top: 8px; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.audio-line { display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.audio-line audio { width: 100%; height: 40px; }
