/* ══════════════════════════════════════════════════════════════
   个人后台（视频沙盒）样式
   浅色为默认（用户偏好）；[data-theme="dark"] 切换深色，对齐截图观感。
   ══════════════════════════════════════════════════════════════ */
:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --panel-2: #fafbfd;
  --border: #e3e8ef;
  --border-2: #d3dae5;
  --text: #1a2231;
  --text-2: #55617a;
  --text-3: #8b95a8;
  --brand: #2f6bff;
  --brand-weak: #eaf0ff;
  --brand-text: #1d4ed8;
  --green: #12a150;
  --green-weak: #e7f7ee;
  --amber: #c47f0a;
  --amber-weak: #fdf4e3;
  --red: #dc3d3d;
  --red-weak: #fdecec;
  --purple: #7c4dff;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}
[data-theme="dark"] {
  --bg: #0f1319;
  --panel: #161c24;
  --panel-2: #1b222c;
  --border: #262e3a;
  --border-2: #333d4d;
  --text: #e6ebf3;
  --text-2: #9aa6b8;
  --text-3: #6c7889;
  --brand: #4d86ff;
  --brand-weak: #17233c;
  --brand-text: #8fb4ff;
  --green: #2fbf71;
  --green-weak: #12291e;
  --amber: #e0a63a;
  --amber-weak: #2a2313;
  --red: #f0616b;
  --red-weak: #2c1619;
  --shadow: 0 1px 3px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 14px/1.55 -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.mono { font-family: var(--mono); }
.wrap { max-width: 1560px; margin: 0 auto; padding: 16px 20px 56px; }

/* ── 顶栏 ───────────────────────────────────────────── */
.topbar {
  display: flex; align-items: flex-start; gap: 20px; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 18px; margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.brand { display: flex; gap: 12px; align-items: center; }
.logo {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  background: linear-gradient(135deg, var(--brand), var(--purple));
  color: #fff; display: grid; place-items: center; font-size: 20px; font-weight: 700;
}
.brand h1 { font-size: 17px; margin: 0; letter-spacing: .2px; }
.brand .sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.account { margin-left: auto; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.account .row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; flex-wrap: wrap; justify-content: flex-end; }
.lbl { color: var(--text-3); }
.val { color: var(--text); font-weight: 500; }
.balance { font-size: 17px; font-weight: 700; color: var(--green); font-variant-numeric: tabular-nums; }

/* ── 通用控件 ───────────────────────────────────────── */
button, .btn {
  font: inherit; font-size: 12.5px; cursor: pointer;
  border: 1px solid var(--border-2); background: var(--panel); color: var(--text);
  border-radius: var(--radius-sm); padding: 5px 11px; transition: .12s;
}
button:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
button.primary:hover:not(:disabled) { filter: brightness(1.08); color: #fff; }
button.green { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
button.green:hover:not(:disabled) { filter: brightness(1.08); color: #fff; }
button.sm { padding: 4px 9px; font-size: 12px; }
button.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
button.ghost:hover { background: var(--panel-2); border-color: var(--border); }
button.danger:hover { border-color: var(--red); color: var(--red); }

input, select, textarea {
  font: inherit; font-size: 13px; color: var(--text); background: var(--panel);
  border: 1px solid var(--border-2); border-radius: var(--radius-sm);
  padding: 6px 9px; outline: none; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-weak); }
textarea { resize: vertical; font-family: inherit; line-height: 1.6; }
label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }

.badge {
  display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 20px;
  background: var(--brand-weak); color: var(--brand-text); border: 1px solid transparent;
  line-height: 1.7; white-space: nowrap;
}
.badge.gray { background: var(--panel-2); color: var(--text-3); border-color: var(--border); }
.badge.green { background: var(--green-weak); color: var(--green); }
.badge.amber { background: var(--amber-weak); color: var(--amber); }
.badge.red { background: var(--red-weak); color: var(--red); }
.hint { font-size: 11.5px; color: var(--text-3); }
.notice { font-size: 12px; color: var(--text-2); background: var(--panel-2); padding: 7px 10px; border-radius: var(--radius-sm); }

/* ── 配置条 ─────────────────────────────────────────── */
.cfgbar {
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 16px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.cfg-item { display: flex; flex-direction: column; gap: 3px; min-width: 220px; flex: 1; }
.cfg-item label { font-size: 11px; letter-spacing: .3px; color: var(--text-3); font-weight: 600; }

/* ── 标签页 ─────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.tab {
  border: none; background: none; border-radius: 0; padding: 9px 14px;
  color: var(--text-2); font-size: 13.5px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--brand); border-color: transparent; }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* ── 卡片 ───────────────────────────────────────────── */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.card-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 15px; border-bottom: 1px solid var(--border);
}
.card-hd h3 { margin: 0; font-size: 13.5px; }
.card-bd { padding: 14px 15px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 1180px) { .grid2 { grid-template-columns: 1fr; } }

/* ── 表单字段 ───────────────────────────────────────── */
.field { margin-bottom: 14px; }
/* 字段名 label 独占一行。
   ⚠️ 必须排除 .switch —— 开关本身也是 <label> 且常常是 .field 的直接子元素，
   若不排除，`.field > label`（0-1-1）会盖掉 `.switch`（0-1-0）的 display:flex，
   导致开关轨道与文字重叠（"生成音频"那一项的排版问题就是这么来的）。 */
.field > label:not(.switch) { display: block; margin-bottom: 6px; }
.field .desc { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* 分段按钮组 */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 5px 12px; border-radius: 7px; border: 1px solid var(--border-2);
  background: var(--panel); color: var(--text-2); font-size: 12.5px; cursor: pointer;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.chip.disabled { opacity: .4; cursor: not-allowed; pointer-events: none; }

/* 开关 */
.switch { display: flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track { width: 40px; height: 22px; border-radius: 22px; background: var(--border-2); position: relative; transition: .18s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .18s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--brand); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch span { font-size: 13px; }

/* 场景模式卡片 */
.scene-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.scene {
  border: 1.5px solid var(--border-2); border-radius: var(--radius-sm); padding: 9px 11px;
  cursor: pointer; background: var(--panel); transition: .12s;
}
.scene:hover { border-color: var(--brand); }
.scene.active { border-color: var(--brand); background: var(--brand-weak); }
.scene .nm { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.scene .pm { font-size: 10.5px; color: var(--text-3); font-family: var(--mono); margin-top: 2px; }

/* content[] 素材条目 */
.mat-list { display: flex; flex-direction: column; gap: 7px; }
.mat-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 9px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel-2);
}
/* 被提示词 @ 到的素材：换底色 + 左侧色条，和「只是挂着」的素材区分开 */
.mat-item.mentioned {
  background: #eef4ff; border-color: #b9cdf7;
  box-shadow: inset 3px 0 0 var(--brand);
}
.mat-item.mentioned .nm { font-weight: 600; }

.mat-item img, .mat-item video { width: 40px; height: 40px; object-fit: cover; border-radius: 5px; flex: none; background: var(--border); }
.mat-item .ph { width: 40px; height: 40px; border-radius: 5px; flex: none; background: var(--border); display: grid; place-items: center; font-size: 16px; }
.mat-item .nm { font-size: 12.5px; font-family: var(--mono); word-break: break-all; }
.mat-item .mt { font-size: 11px; color: var(--text-3); margin-top: 2px; display: flex; gap: 5px; align-items: center; flex-wrap: wrap; }

/* ── 右栏 ───────────────────────────────────────────── */
.code {
  font-family: var(--mono); font-size: 12px; line-height: 1.6;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 13px; margin: 0; overflow: auto; max-height: 340px;
  white-space: pre; color: var(--text);
}
[data-theme="dark"] .code { background: #0d1117; }
.code .k { color: var(--purple); }
.code .s { color: var(--green); }
.code .n { color: var(--amber); }

.pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.pill {
  font-size: 11px; font-family: var(--mono); padding: 2px 8px; border-radius: 20px;
  background: var(--brand-weak); color: var(--brand-text); border: 1px solid var(--border);
}
.pill.sub { background: var(--panel-2); color: var(--text-3); }

/* 任务生命周期 */
.life { display: flex; align-items: stretch; gap: 0; }
.life .node { flex: 1; text-align: center; padding: 8px 4px; position: relative; }
.life .node .dot {
  width: 24px; height: 24px; border-radius: 50%; margin: 0 auto 5px;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  background: var(--panel-2); color: var(--text-3); border: 1.5px solid var(--border-2);
}
.life .node .nm { font-size: 11.5px; color: var(--text-2); font-weight: 600; }
.life .node .ds { font-size: 10px; color: var(--text-3); font-family: var(--mono); }
.life .node.done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.life .node.done .nm { color: var(--green); }
.life .node.active .dot { background: var(--brand); border-color: var(--brand); color: #fff; animation: pulse 1.1s infinite; }
.life .node.active .nm { color: var(--brand); }
.life .node.fail .dot { background: var(--red); border-color: var(--red); color: #fff; }
.life .node:not(:last-child)::after {
  content: ""; position: absolute; top: 19px; right: -2px; width: 4px; height: 2px; background: var(--border-2);
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .5; } }

/* 底部输出页签 */
.outtabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); padding: 0 15px; }
.outtab { border: none; background: none; border-radius: 0; padding: 7px 11px; color: var(--text-2); font-size: 12.5px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.outtab.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.outbody { padding: 12px 15px; }
.outbody pre { margin: 0; }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { color: var(--text-3); font-weight: 600; font-size: 11.5px; background: var(--panel-2); white-space: nowrap; }
tbody tr:hover { background: var(--panel-2); }
td.num { font-variant-numeric: tabular-nums; text-align: right; font-family: var(--mono); }

/* 素材卡片网格 */
.matgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.matcard { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.matcard .thumb { height: 118px; background: var(--panel-2); display: grid; place-items: center; overflow: hidden; position: relative; }
.matcard .thumb img, .matcard .thumb video { width: 100%; height: 100%; object-fit: cover; }
.matcard .thumb .ph { font-size: 30px; color: var(--text-3); }
/* 类型徽标放右上角：左上角让给多选框，否则徽标会被盖掉只剩半截字 */
.matcard .thumb .kbadge { position: absolute; top: 6px; right: 6px; left: auto;
  white-space: nowrap; }
.matcard .bd { padding: 8px 10px; }
.matcard .fn { font-size: 12px; font-family: var(--mono); word-break: break-all; line-height: 1.35; }
.matcard .mt { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.matcard .ops { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; }

/* 文件夹条 */
.folders { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.folder {
  display: flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 20px;
  border: 1px solid var(--border-2); background: var(--panel); font-size: 12.5px; cursor: pointer;
}
.folder:hover { border-color: var(--brand); }
.folder.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.folder.active .cnt { color: rgba(255,255,255,.85); }
.folder .cnt { font-size: 11px; color: var(--text-3); }

/* 拖拽上传 */
.drop {
  border: 2px dashed var(--border-2); border-radius: var(--radius); padding: 22px;
  text-align: center; color: var(--text-3); font-size: 13px; background: var(--panel-2); transition: .15s;
}
.drop.over { border-color: var(--brand); background: var(--brand-weak); color: var(--brand); }

/* 统计卡 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 15px; box-shadow: var(--shadow); }
.stat .k { font-size: 11.5px; color: var(--text-3); }
.stat .v { font-size: 21px; font-weight: 700; margin-top: 3px; font-variant-numeric: tabular-nums; }
.stat .v.green { color: var(--green); }
.stat .v.amber { color: var(--amber); }

/* 提示条 */
.alert { padding: 9px 12px; border-radius: var(--radius-sm); font-size: 12.5px; margin-bottom: 10px; }
.alert.info { background: var(--brand-weak); color: var(--brand-text); }
.alert.warn { background: var(--amber-weak); color: var(--amber); }
.alert.err { background: var(--red-weak); color: var(--red); }
.alert.ok { background: var(--green-weak); color: var(--green); }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(15,19,25,.45); display: none; place-items: center; z-index: 50; padding: 20px; }
.modal.show { display: grid; }
.modal .box { background: var(--panel); border-radius: 12px; max-width: 520px; width: 100%; max-height: 86vh; overflow: auto; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.modal .hd { padding: 14px 18px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal .hd h3 { margin: 0; font-size: 15px; }
.modal .bd { padding: 16px 18px; }
.modal .ft { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

/* 空状态 / 加载 */
.empty { text-align: center; padding: 40px 20px; color: var(--text-3); font-size: 13px; }
.empty .big { font-size: 34px; margin-bottom: 8px; opacity: .45; }
.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid var(--border-2); border-top-color: var(--brand); border-radius: 50%; animation: rot .7s linear infinite; vertical-align: -2px; }
@keyframes rot { to { transform: rotate(360deg); } }

/* 分页 */
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 10px 15px; font-size: 12.5px; color: var(--text-2); }

/* 工具条 */
.toolbar { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.toolbar .grow { flex: 1; min-width: 150px; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ── 合规提示（提交/重置按钮下方）──────────────────────────────── */
.legal-note {
  margin-top: 12px; padding: 9px 12px;
  border: 1px solid var(--border); border-left: 3px solid var(--brand);
  border-radius: 7px; background: var(--brand-weak);
  font-size: 11.8px; line-height: 1.75; color: var(--text-2);
}
.legal-note b { color: var(--text); }


/* ══ 素材库：左目录树 + 右主区 ══════════════════════════════════════ */
.mat-layout { display: grid; grid-template-columns: 258px minmax(0, 1fr); gap: 14px; align-items: start; }
.mat-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 12px; }
@media (max-width: 1100px) { .mat-layout { grid-template-columns: 1fr; } .mat-side { position: static; } }

/* 目录树 */
.dir-tree { padding: 7px; max-height: 340px; overflow: auto; }
.dir-node {
  display: flex; align-items: center; gap: 7px; padding: 7px 9px;
  border-radius: 7px; cursor: pointer; font-size: 13px; color: var(--text-2);
}
.dir-node:hover { background: var(--panel-2); }
.dir-node.active { background: var(--brand-weak); color: var(--brand); font-weight: 600; }
.dir-node .ic { font-size: 14px; }
.dir-node .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dir-node .ct {
  font-size: 11px; color: var(--text-3); background: var(--panel-2);
  border-radius: 9px; padding: 1px 7px; font-variant-numeric: tabular-nums;
}
.dir-node.active .ct { background: #fff; color: var(--brand); }

/* 素材要求面板 */
.req-hd { cursor: pointer; user-select: none; }
.req-warn {
  background: var(--amber-weak, rgba(245,158,11,.10));
  border: 1px solid rgba(245,158,11,.28); border-radius: 7px;
  padding: 7px 10px; font-size: 12px; line-height: 1.7; color: var(--text-2); margin-bottom: 10px;
}
.req-warn b { color: var(--text); }
.req-table { width: 100%; border-collapse: collapse; font-size: 11.8px; }
.req-table th, .req-table td {
  text-align: left; padding: 6px 7px; border-bottom: 1px solid var(--border);
  vertical-align: top; color: var(--text-2); line-height: 1.6;
}
.req-table th { color: var(--text-3); font-weight: 600; font-size: 11px; }
.req-table td:first-child { color: var(--text); font-weight: 600; white-space: nowrap; }

/* 面包屑 */
.crumb { font-size: 13px; color: var(--text-2); }
.crumb b { color: var(--text); }
.crumb .sep { color: var(--text-3); margin: 0 5px; }

/* 分类页签 */
.tabs2 { display: flex; gap: 4px; flex-wrap: wrap; }
.t2 {
  padding: 6px 13px; border-radius: 7px 7px 0 0; font-size: 13px; cursor: pointer;
  color: var(--text-2); border-bottom: 2px solid transparent;
}
.t2:hover { color: var(--text); background: var(--panel-2); }
.t2.active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* 统计条 */
.mat-stats {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  padding: 8px 0 12px; font-size: 12.5px; color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.mat-stats b { color: var(--text); }

/* 素材卡片：多选 + 元数据 */
.matcard { position: relative; }
.matcard .pick {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  width: 19px; height: 19px; cursor: pointer; accent-color: var(--brand);
}
.matcard.sel { outline: 2px solid var(--brand); outline-offset: -2px; border-radius: 10px; }
.matcard .meta {
  display: flex; gap: 8px; flex-wrap: wrap;
  font-size: 11px; color: var(--text-3); margin-top: 5px;
  font-variant-numeric: tabular-nums;
}
.matcard .meta span { white-space: nowrap; }
.matcard .tags { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.matcard .ops { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.matcard .ops button, .matcard .ops a { flex: 1; min-width: 52px; text-align: center; }

/* 结果卡片里「已退 ¥x」的注记：弱化但不隐藏 —— 客户要知道钱回来了 */
.refunded{color:var(--text);opacity:.55;font-size:12px;margin-left:4px}


/* ══════════════════════════════════════════════════════════════════
   极简请求构造器：一个大输入框 + 底部一排参数控件
   （替换原来的两栏「请求构造器 / 请求体预览 / 生命周期 / 幂等 / 日志」）
   ══════════════════════════════════════════════════════════════════ */
.composer { max-width: 980px; }
.cp-box {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  padding: 12px 14px 10px;
  transition: border-color .15s, box-shadow .15s;
}
.cp-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent); }

.cp-input {
  width: 100%; border: 0; outline: 0; resize: vertical;
  background: transparent; color: var(--text);
  font-size: 15px; line-height: 1.65; min-height: 132px;
  font-family: inherit; padding: 4px 2px;
}
.cp-input::placeholder { color: var(--text-3); }

.cp-under { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cp-tools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.iconbtn {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--border);
  background: transparent; color: var(--text-2); font-size: 17px; line-height: 1;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.iconbtn:hover { border-color: var(--brand); color: var(--brand); }

/* 底部参数条 —— 与输入框用一条细分隔线隔开 */
.cp-bar {
  display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap;
  border-top: 1px solid var(--border); margin-top: 10px; padding-top: 10px;
}
.cp-ctl { display: flex; align-items: center; gap: 7px; min-width: 0; }
.cp-lb { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.cp-bar select { width: auto; min-width: 168px; max-width: 260px; height: 30px; padding: 0 8px; font-size: 13px; }
.cp-bar .chips { display: flex; gap: 4px; flex-wrap: wrap; margin: 0; }
.cp-bar .chips button, .cp-bar .chips .chip { padding: 4px 9px; font-size: 12.5px; }
.cp-num { width: 62px !important; height: 30px; padding: 0 6px; font-size: 13px; }
/* 场景四选一：从 2×2 大卡改成一行紧凑胶囊 */
.cp-bar .scene-grid { display: flex; gap: 4px; grid-template-columns: none; }
.cp-bar .scene-grid > * { padding: 5px 10px; font-size: 12.5px; border-radius: 999px; }
.cp-bar .scene-grid .sc-desc, .cp-bar .scene-grid .sc-key { display: none; }
.cp-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.cp-quote { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }

.cp-notes { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; }
.cp-notes:empty { display: none; }

.cp-status {
  margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--border);
  font-size: 12.5px; color: var(--text-3);
}
#composer-result:not(:empty) { margin-top: 10px; }
#composer-result video { width: 100%; border-radius: 10px; background: #000; }

/* 校验与报价：折叠起来，默认不占地方 */
.cp-checks {
  max-width: 980px; margin-top: 12px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--panel);
}
.cp-checks > summary {
  cursor: pointer; padding: 10px 14px; display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 13.5px; list-style: none;
}
.cp-checks > summary::-webkit-details-marker { display: none; }
.cp-checks > summary .cp-quote { margin-left: auto; }
.cp-checks-bd { padding: 0 14px 14px; }
.cp-checks .legal-note { margin-top: 12px; }


/* 视频生成视图改为单栏（原来 .grid2 会把 composer 挤到左半边） */
/* 与上方卡片同宽（原来限宽 1080 显得比右侧窄一截） */
.cp-page { display: block; max-width: none; }
.cp-page .composer, .cp-page .cp-checks { max-width: none; }
.composer { max-width: none; }

/* 参数条：一条细线之下紧凑排布，尽量两行内收 */
.cp-bar { gap: 6px 12px; }
.cp-bar select { min-width: 150px; max-width: 210px; }
.cp-bar .chips { gap: 3px; }
.cp-bar .chips button, .cp-bar .chips .chip { padding: 3px 8px; font-size: 12px; }
.cp-bar .cp-ctl { gap: 5px; }
.cp-bar .scene-grid > * { padding: 4px 9px; font-size: 12px; }
/* 场景卡片里的英文副标题（text2video | text only）在窄条里没意义，隐藏 */
.cp-bar .scene-grid .sc-sub, .cp-bar .scene-grid small, .cp-bar .scene-grid .desc { display: none; }
/* 「自定义秒数」那截收窄，别把一整行撑爆 */
.cp-bar .cp-num { width: 52px !important; }


/* ── @ 自动补全面板 ─────────────────────────────────────────────── */
.cp-box { position: relative; }          /* 补全面板以此为定位参照 */
.mention-pop {
  position: absolute; z-index: 60; min-width: 210px; max-width: 380px;
  max-height: 232px; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.14);
  padding: 4px; font-size: 13px;
}
.mention-pop .mi {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 8px; border-radius: 7px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mention-pop .mi.on, .mention-pop .mi:hover { background: var(--brand-weak); }
.mention-pop .mi .k {
  flex: none; width: 18px; height: 18px; border-radius: 4px; font-size: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel-2); color: var(--text-2);
}
.mention-pop .mi .n { overflow: hidden; text-overflow: ellipsis; font-family: var(--mono); }
.mention-pop .tip { padding: 6px 8px; color: var(--text-3); font-size: 12px; }

/* ── 失败任务：徽标可点开、原因就地展开 ───────────────────────── */
.kbadge.kwhy { cursor: pointer; border: 0; font: inherit; }
.kbadge.kwhy:hover { filter: brightness(1.08); text-decoration: underline; }
.kbadge.kwhy.on { outline: 2px solid rgba(220, 38, 38, .35); }
.fail-why {
  margin: 8px 0 0; padding: 8px 10px; border-radius: 6px;
  background: #fff5f5; border-left: 3px solid #e53e3e;
  color: #7a1f1f; font-size: 12.5px; line-height: 1.6;
  word-break: break-word; white-space: pre-wrap;
}
.fail-why b { color: #b91c1c; }

.fail-why .fw-t { font-weight: 600; color: #b91c1c; font-size: 13px; margin-bottom: 3px; }
.fail-why .fw-h { color: #7a1f1f; font-size: 12.5px; }
.fail-why details { margin-top: 6px; }
.fail-why summary {
  cursor: pointer; font-size: 12px; color: #6b7280; user-select: none;
  list-style: none;
}
.fail-why summary::-webkit-details-marker { display: none; }
.fail-why summary::before { content: "▸ "; }
.fail-why details[open] summary::before { content: "▾ "; }
.fail-why .fw-r {
  margin-top: 5px; padding: 6px 8px; background: #fff; border: 1px solid #f3d6d6;
  border-radius: 4px; font-family: Consolas, "Courier New", monospace;
  font-size: 11.5px; color: #6b4b4b; white-space: pre-wrap; word-break: break-all;
  max-height: 160px; overflow: auto;
}
