/* =============================================================
 *  自媒体工作台样式（与主站同页，命名统一 wb- 前缀）
 * ============================================================= */

.wb-switch {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
}
.wb-switch button {
  border: 0;
  background: transparent;
  color: var(--fg-dim);
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.wb-switch button.active {
  background: var(--accent);
  color: #0b0d12;
  font-weight: 600;
}

.wb-view {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: auto;
}
.wb-view.hidden { display: none; }

.wb-nav {
  display: flex;
  gap: 4px;
  padding: 12px 18px 0;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.wb-tab {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--fg-dim);
  font-size: 14px;
  padding: 9px 14px;
  cursor: pointer;
}
.wb-tab:hover { color: var(--fg); }
.wb-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }

.wb-body { padding: 18px; }

.wb-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.wb-head h2 { margin: 0 0 4px; font-size: 18px; }
.wb-head p { margin: 0; font-size: 12px; }
.wb-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.wb-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.wb-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.wb-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.wb-card .v { font-size: 24px; font-weight: 700; }
.wb-card .k { font-size: 12px; color: var(--fg-dim); margin-top: 2px; }
.wb-card .muted { font-size: 11px; margin-top: 4px; }

.wb-grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.wb-panel {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}
.wb-panel h3 { margin: 0 0 10px; font-size: 14px; }
.wb-kv {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr;
  gap: 6px 10px;
  font-size: 13px;
  align-items: baseline;
}
.wb-kv span { color: var(--fg-dim); }
.wb-kv b { text-align: right; }

.wb-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12px; }
.wb-bar-row .k { width: 64px; color: var(--fg-dim); }
.wb-bar-row .n { width: 28px; text-align: right; }
.wb-bar { flex: 1; height: 8px; border-radius: 5px; background: rgba(255,255,255,.06); overflow: hidden; }
.wb-bar i { display: block; height: 100%; background: var(--accent); }

.wb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  cursor: pointer;
}
.wb-row:last-child { border-bottom: 0; }
.wb-row .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.wb-filter { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.wb-filter .input { min-width: 140px; width: auto; flex: 0 1 200px; }
.wb-filter .input.wide { flex: 0 1 320px; }

.wb-topics, .wb-publishes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.wb-topic, .wb-pub {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
}
.wb-topic .r1, .wb-pub .r1 { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.wb-topic .title, .wb-pub .title { font-weight: 600; font-size: 14px; flex: 1; min-width: 0; }
.wb-topic .r2, .wb-pub .r2 { display: flex; gap: 10px; font-size: 12px; flex-wrap: wrap; }
.wb-topic .hook { margin: 8px 0; font-size: 13px; color: var(--fg); opacity: .9; }
.wb-pub .cover { margin: 8px 0; font-size: 13px; }
.wb-topic .r3, .wb-pub .r3 { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.wb-topic .r4, .wb-pub .r4 { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }

.wb-split { display: grid; grid-template-columns: 280px 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .wb-split { grid-template-columns: 1fr; } }
.wb-list {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  max-height: 70vh;
  overflow: auto;
}
.wb-list-item {
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 2px;
}
.wb-list-item:hover { background: rgba(255,255,255,.05); }
.wb-list-item.active { background: rgba(93,168,255,.14); }
.wb-list-item .t { font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.wb-list-item .muted { font-size: 11px; }

.wb-detail {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.wb-detail .input.big { font-size: 16px; font-weight: 600; }
.script-area { min-height: 320px; font-family: inherit; line-height: 1.7; }

.wb-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.wb-shot {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.wb-shot .sh-head { display: flex; align-items: center; gap: 8px; }
.wb-shot .sh-head .no { font-weight: 700; color: var(--accent); }
.wb-shot .sh-head .dur { font-size: 12px; color: var(--fg-dim); }
.wb-shot .sh-assets { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.sh-asset { position: relative; width: 54px; height: 54px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); }
.sh-asset img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sh-asset .glyph { display: flex; align-items: center; justify-content: center; height: 100%; }
.sh-asset .x {
  position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 10px; cursor: pointer; line-height: 1;
}
.wb-shot .sh-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.tiny-input { max-width: 90px; }

.wb-form { display: flex; flex-direction: column; gap: 10px; }
.wb-form .f { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--fg-dim); }
.wb-form .f .input { color: var(--fg); }
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.wb-foot { display: flex; gap: 8px; margin-top: 14px; }

.wb-ai-out { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.wb-ai-item {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.wb-ai-item .t { font-size: 13px; }
.wb-pre {
  margin: 0;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.7;
  font-family: inherit;
  max-height: 320px;
  overflow: auto;
  width: 100%;
}

.wb-picker { display: flex; flex-direction: column; gap: 10px; }
.wb-asset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  max-height: 52vh;
  overflow: auto;
  padding-right: 4px;
}
.wb-asset-grid .cell {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.wb-asset-grid .thumb {
  height: 88px; border-radius: 8px; overflow: hidden;
  background: rgba(255,255,255,.04); display: flex; align-items: center; justify-content: center;
}
.wb-asset-grid .thumb img { width: 100%; height: 100%; object-fit: cover; }
.wb-asset-grid .name { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.wb-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.wb-table th, .wb-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.wb-table th { color: var(--fg-dim); font-weight: 500; font-size: 12px; }

.wb-empty, .wb-loading, .wb-error {
  padding: 34px;
  text-align: center;
  color: var(--fg-dim);
  font-size: 13px;
  border: 1px dashed var(--line);
  border-radius: 12px;
}
.wb-error { color: #ff8a8a; border-color: #633; }

.wb-ai-settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; align-items: start; }

/* ---------- 本地工作站跳转条 ---------- */
.wb-wbbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}
.wb-wbbar .txt { font-size: 13px; color: var(--fg); }
.wb-wbbar .txt strong { color: var(--fg); }
.wb-wbbar .muted { color: var(--fg-dim); }
.wb-wbbar a.btn { text-decoration: none; white-space: nowrap; }

/* ---------- 规范与术语 ---------- */
.wb-term {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.wb-term:last-child { border-bottom: none; }
.wb-term .t { font-weight: 600; color: var(--fg); }
.wb-term .s { font-size: 13px; color: var(--ok); }
.wb-rule {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.6;
  color: var(--fg);
}
.wb-rule:last-child { border-bottom: none; }
.wb-rule .no {
  flex: 0 0 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--bg-3);
  color: var(--fg-dim);
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* ---- 视频生成 / 定时任务（wb2.js） ---- */
.wb-sub { margin: 22px 0 8px; font-size: 14px; color: var(--fg); }
.wb-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.wb-card-head strong { flex: 1; min-width: 0; }
.wb-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--fg-dim); white-space: nowrap;
}
.wb-badge.succeeded { color: var(--ok); border-color: var(--ok); }
.wb-badge.failed { color: var(--danger); border-color: var(--danger); }
.wb-badge.running, .wb-badge.queued { color: var(--accent); border-color: var(--accent); }
.wb-field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--fg-dim); }
.wb-field-label { font-size: 12px; }
.wb-field .input { color: var(--fg); }
.wb-field small { font-size: 11px; }
.wb-params { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px dashed var(--line); border-radius: var(--radius); }
.wb-video-cfg { display: flex; flex-direction: column; gap: 10px; }
/* 厂商配置卡片：每个厂商独占一行，字段用自适应多列排布 */
.wb-cfgs {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}
.wb-cfgs > * { min-width: 0; }
.wb-video-cfg { min-width: 0; overflow: hidden; }
.wb-video-cfg .wb-grid2 {
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
}
.wb-grid2 > *, .wb-cards > * { min-width: 0; }
.wb-job { display: flex; flex-direction: column; gap: 6px; }
.wb-job-prompt { font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.wb-job-video { width: 100%; max-height: 320px; border-radius: var(--radius); background: #000; }
.wb-job-thumb { width: 120px; border-radius: var(--radius); border: 1px solid var(--line); }
.wb-err { color: #ff8a8a; font-size: 12px; white-space: pre-wrap; word-break: break-word; }
.wb-card.wb-sched { cursor: default; }
.wb-card.wb-sched:hover { transform: none; border-color: var(--line); }

/* 长文本（规则、术语、溯源片）不得撑破容器：允许收缩 + 任意位置换行 */
.wb-rule > span:not(.no) { min-width: 0; overflow-wrap: anywhere; }
.wb-term .t, .wb-term .s, .wb-term .muted { overflow-wrap: anywhere; }
.wb-panel > *, .wb-card > *, .wb-split > * { min-width: 0; }
/* --------------------- 模型配置体检横幅 --------------------- */
.wb-ai-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  margin-bottom: 14px;
  border-radius: var(--d-r);
  border: 1px solid var(--d-border);
  background: var(--d-surface-2);
  font-size: 13px;
  line-height: 1.55;
}
.wb-ai-banner.ok { border-color: rgba(47, 191, 113, .45); background: rgba(47, 191, 113, .09); color: var(--d-ok); }
.wb-ai-banner.warn { border-color: rgba(224, 163, 58, .45); background: rgba(224, 163, 58, .09); color: var(--d-warn); }
.wb-ai-banner.err { border-color: rgba(240, 87, 90, .45); background: rgba(240, 87, 90, .09); color: var(--d-danger); }
.wb-ai-banner > span { flex: 1 1 320px; min-width: 0; }
.wb-ai-banner > .btn { flex: 0 0 auto; }