:root {
  --bg: #000000;
  --panel: #0d0d0d;
  --panel-2: #141414;
  --border: #222222;
  --border-light: #2e2e2e;
  --text: #f5f5f5;
  --muted: #8a8a8a;
  --dim: #555555;
  --accent: #c8ff2e;
  --accent-dim: rgba(200, 255, 46, 0.12);
  --danger: #ff4d4d;
  --radius: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* 全局滚动条：暗夜主题（Firefox / WebKit） */
* { scrollbar-color: #2e2e2e #0a0a0a; scrollbar-width: thin; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: #0a0a0a; }
::-webkit-scrollbar-thumb { background: #2e2e2e; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #424242; }

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(900px 480px at 85% -5%, rgba(200, 255, 46, 0.05), transparent 60%),
    radial-gradient(700px 420px at 5% 12%, rgba(88, 166, 255, 0.04), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

::selection { background: var(--accent); color: #000; }

/* ---------- 布局（自适应限宽，两侧留白） ---------- */
.container {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 clamp(24px, 4vw, 56px);
}

/* 页面占满视口高度，页脚沉底 */
#app { min-height: 100vh; display: flex; flex-direction: column; }
#app > div { flex: 1; min-height: 0; display: flex; flex-direction: column; }
main { flex: 1; }

/* ---------- 导航 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  height: 64px;
  gap: 28px;
  width: 100%;
  padding: 0 clamp(16px, 2.5vw, 40px);
}
.logo {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo-dot {
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 3px;
  box-shadow: 0 0 14px rgba(200, 255, 46, 0.55);
}
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  padding: 7px 14px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--accent); background: var(--accent-dim); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 10px; position: relative; }
.nav-login { font-size: 13.5px; color: var(--muted); padding: 7px 12px; border-radius: 8px; transition: color 0.12s; }
.nav-login:hover { color: var(--text); }
.nav-cta { padding: 8px 18px; font-size: 13px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #000; box-shadow: 0 4px 18px rgba(200, 255, 46, 0.16); }
.btn-primary:hover { background: #d9ff5c; transform: translateY(-1px); box-shadow: 0 6px 26px rgba(200, 255, 46, 0.26); }
.btn-primary:disabled { background: var(--border-light); color: var(--dim); cursor: not-allowed; box-shadow: none; transform: none; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #e64545; transform: translateY(-1px); box-shadow: 0 4px 18px rgba(255, 77, 77, 0.22); }
.btn-danger:disabled { background: var(--border-light); color: var(--dim); cursor: not-allowed; box-shadow: none; transform: none; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-light); }
.btn-ghost:hover { border-color: var(--muted); background: rgba(255, 255, 255, 0.03); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ---------- 首页 ---------- */
.hero { padding: clamp(56px, 8vw, 110px) 0 clamp(48px, 6vw, 80px); }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}
.hero-badge {
  display: inline-block;
  padding: 5px 14px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 26px;
  background: rgba(255, 255, 255, 0.02);
}
.hero-badge b { color: var(--accent); font-weight: 600; }
.hero h1 {
  font-size: clamp(38px, 4.6vw, 60px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.12;
  margin-bottom: 20px;
}
.grad-text {
  background: linear-gradient(92deg, var(--accent), #8cff6e 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  max-width: 520px;
  margin-bottom: 32px;
  color: var(--muted);
  font-size: 16.5px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: clamp(24px, 3.5vw, 44px); margin-top: 42px; }
.hero-stats .stat b { display: block; font-size: 21px; font-weight: 800; letter-spacing: -0.01em; }
.hero-stats .stat span { font-size: 12.5px; color: var(--dim); }

/* Hero 右侧产品视觉 */
.hero-visual { position: relative; }
.hero-visual::before {
  content: "";
  position: absolute;
  inset: -12% -8%;
  background: radial-gradient(closest-side, rgba(200, 255, 46, 0.09), transparent 72%);
  pointer-events: none;
}
.mock-window {
  position: relative;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  background: var(--panel);
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6), 0 0 50px rgba(200, 255, 46, 0.05);
}
.mock-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}
.mock-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--border-light); }
.mock-dot.a { background: #ff5f57; }
.mock-dot.b { background: #febc2e; }
.mock-dot.c { background: #28c840; }
.mock-title { margin-left: 8px; font-size: 11.5px; color: var(--dim); }
.mock-canvas { display: block; width: 100%; aspect-ratio: 16 / 10; }
.mock-prompt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}
.mock-prompt .mp-text {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mock-prompt .mp-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  background: var(--accent);
  color: #000;
  border-radius: 8px;
  padding: 8px 14px;
}

/* 通用区块 */
.section { padding: clamp(52px, 7vw, 84px) 0; border-top: 1px solid var(--border); }
.section-title { font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 10px; }
.section-sub { color: var(--muted); margin-bottom: 40px; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.feature-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-light);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.45);
}
.feature-icon {
  width: 40px; height: 40px;
  border-radius: 9px;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  margin-bottom: 24px;
}
.feature-card h3 { font-size: 16px; margin-bottom: 8px; }
.feature-card p { color: var(--muted); font-size: 14px; }

/* 引擎卡片 */
.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.model-card2 {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  transition: transform 0.18s, border-color 0.18s;
}
.model-card2:hover { transform: translateY(-3px); border-color: var(--accent); }
.mc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.mc-head h3 { font-size: 16px; }
.mc-cost {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: 999px;
  padding: 3px 11px;
}
.model-card2 p { color: var(--muted); font-size: 14px; }

/* 流程 */
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.step-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  background: var(--panel);
  transition: transform 0.18s, border-color 0.18s;
}
.step-card:hover { transform: translateY(-3px); border-color: var(--border-light); }
.step-num {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.12em;
  border: 1px solid var(--accent-dim);
  background: var(--accent-dim);
  border-radius: 999px;
  padding: 3px 12px;
  margin-bottom: 14px;
}
.step-card h3 { font-size: 16px; margin-bottom: 8px; }
.step-card p { color: var(--muted); font-size: 14px; }

/* CTA */
.cta-panel {
  text-align: center;
  padding: clamp(48px, 6vw, 76px) 24px;
  border: 1px solid var(--border-light);
  border-radius: 18px;
  background:
    radial-gradient(600px 300px at 50% 0%, rgba(200, 255, 46, 0.09), transparent 70%),
    var(--panel);
}
.cta-panel h2 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 14px; }
.cta-panel p { color: var(--muted); margin-bottom: 30px; }

/* 页脚 */
.footer { border-top: 1px solid var(--border); padding: 48px 0 30px; }
.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
}
.footer-brand { max-width: 300px; }
.footer-brand p { color: var(--muted); font-size: 13.5px; margin-top: 12px; }
.footer-col h4 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--dim);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.footer-col a { display: block; color: var(--muted); font-size: 13.5px; padding: 4px 0; transition: color 0.12s; }
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  margin-top: 38px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--dim);
  font-size: 12.5px;
}

/* ---------- 工作区 ---------- */
.studio { padding: 32px 0 60px; }
.studio-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 26px; }
.studio-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.studio-head span { color: var(--dim); font-size: 13px; }

.studio-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 900px) { .studio-grid { grid-template-columns: 1fr; } }

.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 40%), var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.panel-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--dim);
  text-transform: uppercase;
  margin-bottom: 14px;
}

.field { margin-bottom: 18px; }
.field label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}
.field label .hint { color: var(--dim); font-weight: 400; }

textarea, .input, select.input {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 11px 13px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  resize: vertical;
  transition: border-color 0.15s;
}
textarea:focus, .input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
textarea { min-height: 96px; }
textarea.short { min-height: 56px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.12s;
}
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 600; }

.model-list { display: flex; flex-direction: column; gap: 8px; }
.model-card {
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 11px 14px;
  cursor: pointer;
  transition: all 0.12s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.model-card:hover { border-color: var(--muted); }
.model-card.active { border-color: var(--accent); background: var(--accent-dim); }
.model-card .m-name { font-size: 14px; font-weight: 600; }
.model-card .m-desc { font-size: 12px; color: var(--muted); }
.model-card .m-cost { font-size: 12px; color: var(--accent); white-space: nowrap; }

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
}

.seed-row { display: flex; gap: 8px; }
.seed-row .input { flex: 1; }

.cost-line {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  padding: 10px 0 14px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.cost-line b { color: var(--accent); }

.gen-error { color: var(--danger); font-size: 13px; margin-bottom: 10px; }

/* 预览区 */
.viewer { margin-bottom: 20px; }
.viewer-frame {
  position: relative;
  background: #050505;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.viewer-frame canvas { display: block; width: 100%; height: 100%; }
.viewer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--dim);
  padding: 70px 20px;
}
.viewer-empty .big { font-size: 38px; }

.progress-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.progress-bar {
  width: 220px;
  height: 4px;
  background: var(--border-light);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  transition: width 0.3s;
}
.progress-text { font-size: 13px; color: var(--muted); }

.viewer-meta { padding: 16px 4px 0; }
.viewer-meta .prompt { font-size: 14px; margin-bottom: 8px; }
.meta-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 9px;
}

.status-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 999px;
}
.status-queued { background: var(--border-light); color: var(--muted); }
.status-processing { background: var(--accent-dim); color: var(--accent); }
.status-done { background: rgba(0, 0, 0, 0.5); color: rgba(200, 255, 46, 0.75); }

/* 历史 */
.history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}
.history-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel-2);
  cursor: pointer;
  transition: border-color 0.15s;
  position: relative;
}
.history-card:hover { border-color: var(--border-light); }
.history-card.selected { border-color: var(--accent); }
.thumb {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  position: relative;
}
.thumb .badge-pos { position: absolute; top: 8px; left: 8px; }
.thumb .del-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px; height: 24px;
  border-radius: 6px;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  display: none;
}
.history-card:hover .del-btn { display: block; }
.thumb .del-btn:hover { color: var(--danger); }
.history-info { padding: 10px 12px; }
.history-info .h-prompt {
  font-size: 12.5px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.history-info .h-sub { font-size: 11.5px; color: var(--dim); margin-top: 2px; }
.empty-history {
  border: 1px dashed var(--border-light);
  border-radius: var(--radius);
  padding: 44px;
  text-align: center;
  color: var(--dim);
  font-size: 14px;
}

/* ---------- API 文档页（左侧页内导航 + 右侧内容） ---------- */
.docs2 {
  display: flex;
  gap: clamp(28px, 3.5vw, 56px);
  padding: 48px 0 90px;
  align-items: flex-start;
}
.docs-side {
  width: 216px;
  flex: none;
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.ds-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--dim);
  text-transform: uppercase;
  margin: 20px 0 8px;
  padding: 0 10px;
}
.ds-label:first-child { margin-top: 0; }
.docs-side button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13.5px;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.12s;
}
.docs-side button:hover { color: var(--text); background: var(--panel-2); }
.ds-method { font-size: 10px; font-weight: 800; letter-spacing: 0.04em; padding: 2px 6px; border-radius: 5px; flex: none; }

.docs-main { flex: 1; min-width: 0; }
.docs-sec { margin-bottom: 60px; scroll-margin-top: 92px; }
.docs-sec h1 { font-size: clamp(26px, 3vw, 32px); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 12px; }
.docs-sec h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin-bottom: 16px; }
.docs-sec .lead { color: var(--muted); margin-bottom: 28px; max-width: 640px; font-size: 15.5px; }
.docs-sec p.desc { color: var(--muted); font-size: 14px; margin-bottom: 16px; }
code {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 13px;
  color: var(--accent);
  font-family: "Cascadia Code", Consolas, monospace;
}

/* 概览卡片 */
.ov-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}
.ov-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.ov-num { font-size: 21px; font-weight: 800; color: var(--accent); letter-spacing: -0.01em; }
.ov-k { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

/* 代码块与复制 */
.code-wrap { position: relative; }
.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  background: var(--panel-2);
  border: 1px solid var(--border-light);
  color: var(--muted);
  font-size: 12px;
  padding: 4px 11px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.12s;
}
.copy-btn:hover { color: var(--text); border-color: var(--muted); }
.code-block {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  font-family: "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
  color: #d4d4d4;
  margin-bottom: 16px;
}
.code-block .cm { color: var(--dim); }
.code-block .kw { color: var(--accent); }

/* 接口卡片 */
.endpoint {
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 14px;
  overflow: hidden;
  background: var(--panel);
  scroll-margin-top: 92px;
  transition: border-color 0.15s;
}
.endpoint:hover { border-color: var(--border-light); }
.endpoint-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  flex-wrap: wrap;
}
.method {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 6px;
}
.method-get, .ds-method.method-get { background: rgba(88, 166, 255, 0.15); color: #58a6ff; }
.method-post, .ds-method.method-post { background: var(--accent-dim); color: var(--accent); }
.method-delete, .ds-method.method-delete { background: rgba(255, 77, 77, 0.12); color: var(--danger); }
.endpoint-path { font-family: Consolas, monospace; font-size: 14px; }
.endpoint-desc { color: var(--muted); font-size: 13px; margin-left: auto; }
.endpoint-body { padding: 16px 20px 20px; border-top: 1px solid var(--border); }

.param-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.param-table th, .param-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.param-table tbody tr { transition: background 0.12s; }
.param-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.param-table th { color: var(--dim); font-weight: 600; font-size: 12px; }
.param-table td:first-child { font-family: Consolas, monospace; color: var(--accent); }
.param-table td { color: var(--muted); }

.key-form { display: flex; gap: 10px; max-width: 480px; margin-bottom: 16px; }
.key-result {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--accent-dim);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 13px 16px;
  font-family: Consolas, monospace;
  font-size: 14px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.key-result .warn { font-size: 12px; color: var(--muted); font-family: inherit; }
.key-list { font-size: 13px; color: var(--muted); }
.key-list li { list-style: none; padding: 8px 0; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; gap: 16px; }
.mono-dim { font-family: Consolas, monospace; color: var(--dim); }

@media (max-width: 900px) {
  .docs2 { flex-direction: column; }
  .docs-side { width: 100%; position: static; max-height: none; display: flex; flex-wrap: wrap; gap: 4px; }
  .docs-side .ds-label { width: 100%; }
  .docs-side button { width: auto; }
}

@media (max-width: 640px) {
  .hero { padding: 48px 0 44px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: 2; }
  .nav-links a { padding: 7px 9px; font-size: 13px; }
  .nav-cta { display: none; }
  .nav-right .account-name { display: none; }
  .footer-grid { flex-direction: column; gap: 24px; }
}

/* ================= 全屏页容器（导航 + 工作区/用户中心） ================= */
/* 使用确定高度（视口 - 导航栏 65px），避免子元素固有尺寸反推撑破页面 */
.fp {
  height: calc(100vh - 65px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ================= 工作台（多栏框架） ================= */
.wb {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

/* ---- 左侧框架：垂直多栏 ---- */
.wb-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
}
.account-name { font-size: 13px; cursor: pointer; }
.account-menu {
  position: absolute;
  top: 42px;
  right: 0;
  width: 180px;
  background: var(--panel-2);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 6px;
  z-index: 60;
}
.account-menu .am-user {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--dim);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.account-menu button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: var(--text);
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
}
.account-menu button:hover { background: var(--panel); }
.account-menu button:disabled { color: var(--dim); cursor: not-allowed; }
.account-menu button:disabled:hover { background: none; }
.account-menu button.danger { color: var(--danger); }
.menu-overlay { position: fixed; inset: 0; z-index: 50; }
.tb-menu-wrap { position: relative; display: inline-flex; }
.file-menu {
  position: absolute;
  top: 36px;
  left: 0;
  min-width: 168px;
  background: var(--panel-2);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 6px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 2px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}
.file-menu button {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border: none;
  background: none;
  color: var(--text);
  font-size: 13px;
  border-radius: 7px;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}
.file-menu button:hover { background: var(--accent-dim); color: var(--accent); }
.file-menu button.danger { color: var(--danger); }
.file-menu button.danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.tb-btn.tb-active { color: var(--accent); }

/* MCP 工具面板（工具栏直调） */
.tools-panel {
  position: absolute;
  top: 40px;
  right: 0;
  width: 470px;
  max-width: calc(100vw - 24px);
  max-height: min(70vh, 580px);
  overflow-y: auto;
  background: var(--panel-2);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 12px;
  z-index: 60;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}
/* MCP 工具产品窗口（LLM 界面规格驱动）——模态全屏承载 */
.tools-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.tools-panel.tools-modal {
  position: relative;
  width: min(1240px, 96vw);
  height: min(740px, 92vh);
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
}
/* 顶部标题栏 */
.tools-topbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--panel);
}
.tools-topbar-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.tools-app-title { font-size: 16px; font-weight: 700; }
.tools-app-subtitle { font-size: 12px; color: var(--text-dim); }
.tools-topbar-actions { flex: none; display: flex; align-items: center; gap: 8px; }
/* 主体：按 layout 布局 */
.tools-main {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}
.tools-body-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
/* 左侧菜单栏 */
.tools-sidebar {
  flex: none;
  width: 232px;
  border-right: 1px solid var(--border-light);
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--panel);
}
.tools-menu-label { font-size: 12px; font-weight: 700; color: var(--text-dim); padding: 2px 8px 4px; }
.tools-menu-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  text-align: left;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: none;
  cursor: pointer;
}
.tools-menu-item:hover { background: var(--panel-2); }
.tools-menu-item.active { background: var(--accent-dim); border-color: var(--accent-dim); }
.tools-menu-item.active .tools-menu-title { color: var(--accent); }
.tools-menu-title { font-size: 13px; font-weight: 600; }
.tools-menu-desc { font-size: 11.5px; color: var(--text-dim); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* 顶部页签布局 */
.layout-tabs .tools-main { flex-direction: column; }
.tools-tabs {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-light);
  background: var(--panel);
}
.tools-tab {
  padding: 7px 16px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: none;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
}
.tools-tab:hover { color: var(--accent); border-color: var(--accent-dim); }
.tools-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
/* 右侧详情区 */
.tools-detail {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 16px 18px;
  background: var(--panel-2);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tools-detail-empty {
  color: var(--text-dim);
  font-size: 13px;
  text-align: center;
  padding: 60px 10px;
}
.tools-detail-head { display: flex; align-items: center; gap: 10px; }
.tools-detail-title { font-size: 16px; font-weight: 700; }
.tools-detail-desc { font-size: 13px; color: var(--text-dim); line-height: 1.6; }
.tools-section-text { font-size: 13px; color: var(--text); line-height: 1.6; }
.tools-section-note {
  font-size: 12.5px;
  color: #92400e;
  background: rgba(146, 64, 14, 0.08);
  border: 1px solid rgba(146, 64, 14, 0.2);
  border-radius: 8px;
  padding: 9px 12px;
  line-height: 1.5;
}
.tools-detail .tools-call { border-top: none; padding: 0; background: transparent; }
.tools-call-actions { margin-top: 4px; display: flex; justify-content: flex-end; }
.tools-update-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: #92400e;
  background: rgba(146, 64, 14, 0.08);
  border: 1px solid rgba(146, 64, 14, 0.2);
  border-radius: 8px;
  padding: 9px 12px;
}

/* 详情区：输入 / 结果 tab */
.tools-detail-tabs {
  flex: none;
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 12px;
}
.tools-detail-tab {
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.tools-detail-tab:hover { color: var(--text); }
.tools-detail-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tools-tab-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}
.tools-detail-body { display: flex; flex-direction: column; gap: 12px; }

/* 底部固定调用栏 */
.tools-bottom {
  flex: none;
  border-top: 1px solid var(--border-light);
  background: var(--panel);
  padding: 10px 14px;
}
.tools-bottom-bar {
  display: flex;
  align-items: center;
  gap: 12px;
}
.tools-bottom-label {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 媒体缩略图：点击全屏 */
.tools-media-thumb {
  position: relative;
  display: block;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  background: var(--panel);
  cursor: zoom-in;
}
.tools-media-thumb:hover { border-color: var(--accent); }
.tools-media-thumb img { display: block; max-width: 180px; max-height: 130px; object-fit: cover; }
.tools-media-zoom {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
}
.tools-media-thumb:hover .tools-media-zoom { opacity: 1; }
.tools-media video { max-width: 280px; border-radius: 8px; border: 1px solid var(--border-light); cursor: pointer; }
.tools-media audio { max-width: 320px; }

/* 媒体全屏预览 */
.media-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}
.media-preview-close {
  position: absolute;
  top: 18px;
  right: 22px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.media-preview-close:hover { background: rgba(255, 255, 255, 0.28); }
.media-preview-img { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 8px; }
.media-preview-video { max-width: 92vw; max-height: 88vh; border-radius: 8px; }

.tools-panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.tools-panel-title { font-weight: 600; font-size: 13px; }
.tools-panel-err { color: var(--danger); font-size: 12px; padding: 8px 0; }
.tools-servers { display: flex; flex-direction: column; gap: 12px; }
.tools-server { border: 1px solid var(--border-light); border-radius: 10px; background: var(--panel); overflow: hidden; }
.tools-server-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--panel-2); border-bottom: 1px solid var(--border-light); }
.tools-server-name { font-weight: 600; font-size: 13px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tools-type-pill { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; flex: none; }
.tools-type-pill.http { color: #db2777; background: rgba(219, 39, 119, 0.1); }
.tools-type-pill.stdio { color: #2563eb; background: rgba(37, 99, 235, 0.1); }
.tools-server-note { font-size: 12px; color: var(--text-dim); padding: 8px 12px; }
.tools-server-note.bad { color: var(--danger); }
.tools-list { display: flex; flex-direction: column; }
.tools-item { border-bottom: 1px solid var(--border-light); }
.tools-item:last-child { border-bottom: none; }
.tools-item-btn { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 8px 12px; background: none; border: none; cursor: pointer; }
.tools-item-btn:hover { background: var(--accent-dim); }
.tools-tool-name { font-size: 13px; font-weight: 600; color: var(--accent); }
.tools-tool-desc { font-size: 12px; color: var(--text-dim); line-height: 1.4; }
.tools-call { padding: 8px 12px 10px; background: var(--panel-2); border-top: 1px dashed var(--border-light); display: flex; flex-direction: column; gap: 8px; }
.tools-call-head { display: flex; align-items: center; gap: 8px; }
.tools-call-title { font-size: 13px; font-weight: 700; }
.tools-ai-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  color: var(--text-dim);
  background: var(--border-light);
  margin-left: auto;
}
.tools-ai-tag.on { color: #7c3aed; background: rgba(124, 58, 237, 0.12); }
.tools-ai-tag.off { color: var(--text-dim); background: var(--border-light); }
.tools-ai-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 12px;
  padding: 6px 0;
}
.tools-ai-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  color: #b45309;
  background: rgba(180, 83, 9, 0.1);
  border: 1px solid rgba(180, 83, 9, 0.25);
  border-radius: 8px;
  padding: 7px 10px;
}
.tools-args { display: flex; flex-direction: column; gap: 10px; }
.tools-arg-group {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  padding: 2px 0;
  border-bottom: 1px solid var(--border-light);
}
.tools-arg { display: flex; flex-direction: column; gap: 3px; }
.tools-arg-label { font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tools-arg-req { color: var(--danger); }
.tools-arg-desc { font-weight: 400; color: var(--text-dim); font-size: 12px; line-height: 1.45; }
.tools-arg-input { font-family: inherit; }
.tools-arg.arg-missing .tools-arg-input,
.tools-arg.arg-missing select.tools-arg-input,
.tools-arg.arg-missing textarea.tools-arg-input { border-color: var(--danger); }
.tools-arg.arg-missing .tools-arg-label { color: var(--danger); }
.tools-arg-missing-hint { font-size: 11px; color: var(--danger); }
.tools-call-err { color: var(--danger); font-size: 12px; }
.tools-call-actions { display: flex; justify-content: flex-end; }
.tools-result-wrap { display: flex; flex-direction: column; gap: 8px; }
.tools-result-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  align-self: flex-start;
  padding: 3px 10px;
  border-radius: 999px;
}
.tools-result-status.ok { color: #059669; background: rgba(5, 150, 105, 0.1); }
.tools-result-status.bad { color: var(--danger); background: rgba(239, 68, 68, 0.1); }
.tools-friendly-err {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
}
.tools-friendly-msg {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
}
.tools-raw summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--text-dim);
  user-select: none;
}
.tools-raw summary:hover { color: var(--accent); }
.tools-media { display: flex; flex-wrap: wrap; gap: 8px; }
.tools-media-thumb { display: block; border-radius: 8px; overflow: hidden; border: 1px solid var(--border-light); background: var(--panel); }
.tools-media-thumb:hover { border-color: var(--accent); }
.tools-media-thumb img { display: block; max-width: 160px; max-height: 120px; object-fit: cover; }
.tools-media video { max-width: 260px; border-radius: 8px; border: 1px solid var(--border-light); }
.tools-result { white-space: pre-wrap; word-break: break-word; font-size: 12px; background: var(--panel); border: 1px solid var(--border-light); border-radius: 8px; padding: 8px; max-height: 180px; overflow: auto; font-family: monospace; line-height: 1.5; }
.tools-result.bad { color: var(--danger); border-color: rgba(239, 68, 68, 0.3); }

/* MCP 服务器配置弹窗 */
/* 全屏：弹窗撑满视口，标题/描述/操作固定，列表区自动填满滚动 */
.modal.mcp-settings-modal {
  width: calc(100vw - 32px);
  height: calc(100vh - 32px);
  max-width: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.mcp-empty {
  color: var(--text-dim);
  font-size: 13px;
  padding: 18px 4px;
  text-align: center;
}
/* 行布局：每台服务器一行，纵向堆叠，填满剩余高度，内容滚动 */
.mcp-server-list {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding-right: 2px;
}
/* 服务器卡片：头部（类型徽章/名称/状态/操作）+ 主体（配置字段） */
.mcp-server-card {
  flex: none;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: var(--panel-2);
  overflow: hidden;
}
.mcp-server-card.disabled { opacity: 0.62; }
.mcp-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-light);
  background: var(--panel);
}
.mcp-type-badge {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 8px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.mcp-type-badge.lt-npx { color: #059669; background: rgba(5, 150, 105, 0.12); }
.mcp-type-badge.lt-uvx { color: #9333ea; background: rgba(147, 51, 234, 0.12); }
.mcp-type-badge.lt-python { color: #2563eb; background: rgba(37, 99, 235, 0.12); }
.mcp-type-badge.lt-exec { color: #ea580c; background: rgba(234, 88, 12, 0.12); }
.mcp-type-badge.lt-docker { color: #0891b2; background: rgba(8, 145, 178, 0.12); }
.mcp-type-badge.lt-http { color: #db2777; background: rgba(219, 39, 119, 0.12); }
.mcp-name-input { flex: 1; min-width: 140px; }
.mcp-state-pill {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.mcp-state-pill.on { color: #059669; background: rgba(5, 150, 105, 0.12); }
.mcp-state-pill.off { color: var(--text-dim); background: var(--border-light); }
.mcp-card-actions {
  margin-left: auto;
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mcp-card-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mcp-field-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.mcp-field-label {
  flex: none;
  width: 92px;
  padding-top: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-align: right;
}
.mcp-field-row > .input,
.mcp-field-row > .mcp-launcher-tabs,
.mcp-field-row > .mcp-token-box { flex: 1; min-width: 0; }
.mcp-env-input { resize: vertical; min-height: 40px; font-family: monospace; }
.mcp-test-result {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 14px 12px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.4;
}
.mcp-test-result.ok { color: #059669; background: rgba(5, 150, 105, 0.08); border: 1px solid rgba(5, 150, 105, 0.25); }
.mcp-test-result.bad { color: var(--danger); background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.25); }
.mcp-row-error {
  margin: 0 14px 12px;
  color: var(--danger);
  font-size: 12px;
}
.mcp-row-error:empty { display: none; }
.mcp-settings-modal .modal-actions { margin-top: auto; padding-top: 20px; }
/* MCP token 认证区 */
.mcp-token-box { border: 1px dashed var(--border-light); border-radius: 8px; padding: 10px; background: var(--panel); }
.mcp-token-head { margin-bottom: 6px; }
.mcp-token-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--border-light);
}
.mcp-token-badge.ok { color: #059669; background: rgba(5, 150, 105, 0.12); }
.mcp-token-extra { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.mcp-install-hint { font-size: 11px; color: var(--text-dim); margin-top: 4px; line-height: 1.4; }
/* 启动器 tab */
.mcp-launcher-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.mcp-ltab {
  padding: 5px 12px;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  background: none;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}
.mcp-ltab:hover { color: var(--accent); border-color: var(--accent-dim); }
.mcp-ltab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
/* 高级配置折叠区 */
.mcp-adv summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--text-dim);
  padding: 4px 0;
  user-select: none;
}
.mcp-adv summary:hover { color: var(--accent); }
.mcp-adv textarea { margin-top: 6px; }

/* ===== 技能（Skills）管理弹窗 ===== */
.modal.skills-settings-modal {
  width: calc(100vw - 32px);
  height: calc(100vh - 32px);
  max-width: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.skills-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  flex: none;
}
.skill-upload-input { display: none; }
.skills-tabs {
  flex: none;
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.skills-tab {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s;
}
.skills-tab:hover { color: var(--text); }
.skills-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.skills-tab-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--border-light);
  color: var(--text-dim);
}
.skills-tab.active .skills-tab-badge { background: var(--accent-dim); color: var(--accent); }
.skills-pane {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}
.skills-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
/* 我的技能：过滤条 */
.skills-filter-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--panel);
  padding: 6px 10px;
}
.skills-filter-icon { color: var(--text-dim); display: inline-flex; }
.skills-filter-input { flex: 1; min-width: 0; background: transparent; border: none; box-shadow: none; }
.skills-filter-input:focus { border: none; box-shadow: none; background: transparent; }
.skills-filter-count { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.skill-row {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel-2);
  padding: 12px 14px;
  transition: border-color 0.15s;
}
.skill-row:hover { border-color: var(--border-light); }
.skill-row-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.skill-row-name { font-weight: 600; font-size: 14px; }
.skill-preset-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
  white-space: nowrap;
  cursor: default;
}
.skill-source-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--panel);
  color: var(--text-dim);
  border: 1px solid var(--border-light);
  white-space: nowrap;
  cursor: default;
}
.skill-source-badge.src-modelscope {
  color: #d946ef;
  border-color: #d946ef;
  background: rgba(217, 70, 239, 0.08);
}
.skill-source-badge.src-url {
  color: #2563eb;
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
}
.skill-source-badge.src-upload {
  color: #059669;
  border-color: #059669;
  background: rgba(5, 150, 105, 0.08);
}
.skill-files-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 10px;
  background: var(--panel);
  color: var(--text-dim);
  border: 1px solid var(--border-light);
  white-space: nowrap;
}
.skill-row-meta { font-size: 11px; color: var(--text-dim); }
.skill-row-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.skill-row-desc { color: var(--text-dim); font-size: 13px; margin-top: 6px; line-height: 1.5; }
.skill-row-body {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-dim);
  background: var(--panel);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: monospace;
  white-space: pre-wrap;
  max-height: 80px;
  overflow: hidden;
}
.skill-editor {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.skill-editor .field { margin-bottom: 0; }
.skill-body-textarea {
  min-height: 220px;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  resize: vertical;
  line-height: 1.5;
}
.modal.skill-edit-modal { width: 640px; max-width: calc(100vw - 40px); }
.skill-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}
.skill-row-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 6px;
}
.skill-row-error:empty { display: none; }
.skill-source-badge.src-skills-sh {
  color: #06b6d4;
  border-color: #06b6d4;
  background: rgba(6, 182, 212, 0.08);
}
.skill-search-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
  flex: none;
}
.skill-search-input { flex: 1; min-width: 0; }
.skill-search-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.skill-search-row {
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px 12px;
}
.skill-search-row .skill-row-head { gap: 8px; }
.skill-search-row .skill-row-desc { margin-top: 4px; font-size: 12px; }
.skill-search-row .skill-row-desc .skill-desc-loading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-dim);
}
.skill-search-row .skill-row-desc .skill-desc-loading .spinner { width: 11px; height: 11px; }
.skill-search-row .skill-row-desc .skill-row-error { margin-top: 0; }

/* 通用开关（启用/停用） */
.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
  flex: none;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: relative;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: var(--border-light);
  transition: background 0.2s;
  flex: none;
}
.switch-slider::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s;
}
.switch input:checked + .switch-slider { background: var(--accent); }
.switch input:checked + .switch-slider::before { transform: translateX(16px); }
.switch-label { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.switch.busy { opacity: 0.6; pointer-events: none; }

/* 停用行弱化 */
.skill-row.disabled { opacity: 0.55; }
.mcp-server-card.disabled { opacity: 0.62; }

/* 技能启用状态徽章 */
.skill-state-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  white-space: nowrap;
}
.skill-state-badge.on { color: #059669; border-color: #059669; background: rgba(5, 150, 105, 0.08); }
.skill-state-badge.off { color: var(--text-dim); background: var(--panel); }

/* 第二栏：工具栏 */
.wb-toolbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  flex-wrap: wrap;
}
.tb-group { display: flex; align-items: center; gap: 8px; }
.tb-divider { width: 1px; height: 22px; background: var(--border-light); flex: none; }
.tb-label { font-size: 12px; color: var(--dim); white-space: nowrap; }
.tb-select {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: 13px;
  padding: 6px 9px;
  outline: none;
  cursor: pointer;
  max-width: 150px;
}
.tb-select:focus { border-color: var(--accent); }
.tb-btn {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: 13px;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
}
.tb-btn:hover { border-color: var(--muted); }
.tb-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.tb-btn:disabled:hover { border-color: var(--border); }
.tb-btn.accent { border-color: var(--accent); color: var(--accent); }
/* 保存按钮：有未保存改动时的强调态 */
.tb-btn.save-dirty {
  position: relative;
  border-color: var(--accent);
  color: var(--accent);
}
.tb-btn.save-dirty::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffb020;
  box-shadow: 0 0 5px rgba(255, 176, 32, 0.9);
}

/* 模型设置下拉菜单 */
.model-menu {
  position: absolute;
  top: 36px;
  left: 0;
  width: 264px;
  background: var(--panel-2);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 14px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}
.mm-field label {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--dim);
  font-weight: 600;
  margin-bottom: 6px;
}
.mm-field .mm-hint { font-weight: 400; }
.mm-field .input { padding: 8px 10px; font-size: 13px; cursor: pointer; }

.wa-pct { font-size: 10px; font-weight: 700; color: var(--accent); }

/* 第三栏：预览区（左操作面板 + 右预览） */.wb-preview {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #050505;
  position: relative;
}
.wb-preview-main {
  flex: 1;
  min-height: 0;
  display: flex;
}
.wb-ops {
  width: 320px;
  flex: none;
  min-height: 0;
  border-right: 1px solid var(--border);
  background: var(--panel);
  display: flex;
}
/* 素材面板（与竖栏同一体：仅宽度与列数不同） */
.ops-assets {
  width: 58px;
  flex: none;
  min-height: 0;
  border-right: 1px solid var(--border);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  transition: width 0.18s ease;
}
.ops-assets.open {
  width: 340px;
  align-items: stretch;
  gap: 0;
  padding: 0;
}
.oa-toggle {
  width: 40px;
  height: 32px;
  flex: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}
.oa-toggle:hover { color: var(--accent); border-color: var(--accent); }
.oa-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.oa-head .oap-title { font-size: 13.5px; font-weight: 700; }
.oa-head .oap-count { font-size: 12px; color: var(--dim); flex: 1; }
.oa-head .oa-head-add { width: 30px; height: 30px; flex: none; border-style: solid; }
.oa-list {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
  scrollbar-color: #2e2e2e transparent;
  scrollbar-width: thin;
}
.oa-list::-webkit-scrollbar { width: 6px; }
.oa-list::-webkit-scrollbar-thumb { background: #2e2e2e; border-radius: 3px; }
.ops-assets.open .oa-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 14px;
  align-content: start;
  align-items: start;
}
.ops-assets .oa-item { width: 40px; height: 40px; flex: none; }
.ops-assets .oa-add { width: 40px; height: 40px; flex: none; }
.ops-assets.open .oa-item,
.ops-assets.open .oa-add { width: 100%; height: auto; aspect-ratio: 1; }
/* 素材命名 */
.oa-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: none; }
.oa-namerow { display: flex; align-items: center; gap: 4px; }
.oa-name {
  flex: 1;
  min-width: 0;
  font-size: 10.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.oa-edit {
  flex: none;
  border: none;
  background: none;
  color: var(--dim);
  cursor: pointer;
  padding: 2px;
  display: none;
  align-items: center;
}
.oa-cell:hover .oa-edit { display: inline-flex; }
.oa-edit:hover { color: var(--accent); }
.oa-name-input {
  width: 100%;
  font-size: 11px;
  font-family: inherit;
  padding: 2px 6px;
  background: var(--panel-2);
  border: 1px solid var(--accent);
  border-radius: 5px;
  color: var(--text);
  outline: none;
}
.oap-empty { padding: 20px 14px; font-size: 12.5px; color: var(--dim); text-align: center; }
/* 生成表单主体 */
.ops-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  overflow-y: auto;
}
/* 展开的素材面板样式已合并进 .ops-assets.open */
.wb-ops .field { margin-bottom: 0; }
.wb-ops textarea { min-height: 110px; }
.ops-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ops-title { font-size: 14px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops-del {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}
.ops-del:hover { color: var(--danger); border-color: var(--danger); background: rgba(255, 77, 77, 0.08); }
.wb-ops .field-grow {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.wb-ops .field-grow textarea {
  flex: 1;
  min-height: 110px;
}
.ops-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.ops-clip-opts { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.ops-opt-group { display: flex; flex-direction: column; gap: 5px; }
.ops-opt-label { font-size: 11.5px; color: var(--dim); font-weight: 600; }
.ops-opt-group .chip-row { flex-wrap: wrap; }
.ops-opt-group .chip { font-size: 11.5px; padding: 3px 9px; }
.ops-actionbar { display: flex; justify-content: flex-end; }

/* 参考图管理 */
.ref-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ref-item {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.ref-item img, .ref-item video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ref-audio {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: var(--accent-dim);
}
.ref-tag {
  position: absolute;
  left: 3px;
  bottom: 3px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.7);
  color: #ddd;
  border-radius: 4px;
  padding: 1px 5px;
  pointer-events: none;
}
.ref-del {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: none;
  background: rgba(0, 0, 0, 0.65);
  color: #ddd;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
}
.ref-item:hover .ref-del { display: flex; }
.ref-del:hover { color: var(--danger); }
.ref-add {
  width: 62px;
  height: 62px;
  border-radius: 8px;
  border: 1px dashed var(--border-light);
  background: none;
  color: var(--dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}
.ref-add:hover { border-color: var(--accent); color: var(--accent); }
.ref-add:disabled { opacity: 0.45; cursor: not-allowed; }
.ref-add:disabled:hover { border-color: var(--border-light); color: var(--dim); }
.ref-item { cursor: pointer; }
.ref-item, .ent-opt:not(.ent-upload), .media-thumb, .mention-item { position: relative; }
/* 素材类型徽章（左上角，按类型上色） */
.type-badge {
  position: absolute;
  top: 3px;
  left: 3px;
  z-index: 2;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.55);
  color: #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.type-badge.type-image { color: #58a6ff; }
.type-badge.type-video { color: #c77dff; }
.type-badge.type-audio { color: #7cffb2; }

/* 素材预览弹窗 */
.ref-preview {
  width: min(720px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
}
.rp-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex: none;
}
.rp-title {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rp-kind {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: 5px;
  padding: 2px 8px;
}
.rp-body {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050505;
  min-height: 120px;
  max-height: 62vh;
  overflow: hidden;
}
.rp-body img { max-width: 100%; max-height: 62vh; display: block; object-fit: contain; }
.rp-body video { max-width: 100%; max-height: 62vh; display: block; }
.rp-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-light);
  flex: none;
}
.rp-audio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 44px 30px;
  color: var(--accent);
}
.rp-audio audio { width: 320px; max-width: 100%; }

/* 提示词富文本编辑器 */
.prompt-field { position: relative; }
.prompt-extract { padding: 3px 10px; font-size: 12px; }
.prompt-expand-row { margin-top: 8px; display: flex; justify-content: space-between; align-items: center; }
.prompt-expand-row .tb-btn { padding: 4px 12px; font-size: 12px; }
.modal.prompt-expansions-modal { max-width: 980px; width: 94vw; }
.pe-list { max-height: 62vh; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.pe-item { border: 1px solid var(--border, #e5e5e5); border-radius: 8px; padding: 14px; background: var(--panel, #fff); transition: border-color .15s, box-shadow .15s; }
.pe-item:hover { border-color: var(--accent, #4f6ef7); box-shadow: 0 0 0 3px var(--accent-dim, rgba(79,110,247,.15)); }
.pe-section { margin-bottom: 10px; }
.pe-section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.pe-label { font-size: 12px; font-weight: 600; color: var(--accent, #4f6ef7); }
.pe-apply { font-size: 12px; padding: 3px 10px; border: 1px solid var(--accent, #4f6ef7); color: var(--accent, #4f6ef7); background: transparent; border-radius: 6px; cursor: pointer; }
.pe-apply:hover { background: var(--accent-dim, rgba(79,110,247,.1)); }
.pe-text { font-size: 13px; color: #eee; white-space: pre-wrap; word-break: break-word; max-height: 140px; overflow-y: auto; background: var(--panel-2, #f7f7f7); border-radius: 6px; padding: 8px 10px; }
.pe-arrow { text-align: center; color: var(--dim, #999); font-size: 14px; margin: 2px 0 10px; }
.pe-ts { text-align: right; font-size: 11px; color: var(--dim, #999); }
.rn-list { max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.rn-item { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border, #e5e5e5); border-radius: 8px; padding: 10px 12px; background: var(--panel, #fff); }
.rn-thumb { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 6px; overflow: hidden; background: var(--panel-2, #f7f7f7); display: flex; align-items: center; justify-content: center; color: var(--dim, #999); }
.rn-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rn-main { flex: 1; min-width: 0; }
.rn-fname { font-size: 12px; color: var(--dim, #999); margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rn-input { width: 100%; }
.rn-progress { display: flex; align-items: center; gap: 8px; }
.rn-bar { flex: 1; height: 6px; background: var(--border-light, #e5e5e5); border-radius: 3px; overflow: hidden; }
.rn-bar i { display: block; height: 100%; background: var(--accent, #4f6ef7); border-radius: 3px; transition: width .2s; }
.rn-pct { flex: 0 0 auto; font-size: 12px; color: var(--dim, #999); }
.rn-error { font-size: 12px; color: var(--danger, #e5484d); }
.rn-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.prompt-editor {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 11px 13px;
  font-size: 14px;
  line-height: 1.6;
  outline: none;
  flex: 1;
  min-height: 110px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  transition: border-color 0.15s;
}
.prompt-editor:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.prompt-editor.analyzing { opacity: 0.55; pointer-events: none; }
.prompt-editor.expanding { opacity: 0.55; pointer-events: none; }
.editor-loading {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.78);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 12.5px;
  color: var(--accent);
  pointer-events: none;
  white-space: nowrap;
}
.spinner {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--accent-dim);
  border-top-color: var(--accent);
  animation: vf-spin 0.8s linear infinite;
}
@keyframes vf-spin { to { transform: rotate(360deg); } }
/* 主按钮内嵌 loading（深色底纹适配 accent 按钮） */
.btn-spin {
  width: 13px;
  height: 13px;
  border-color: rgba(0, 0, 0, 0.25);
  border-top-color: #000;
  flex: none;
}
.prompt-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--dim);
  pointer-events: none;
}
.ref-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 160px;
  white-space: nowrap;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 6px;
  padding: 1px 7px;
  margin: 0 1px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: default;
  user-select: none;
  vertical-align: baseline;
}
.chip-thumb {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  object-fit: cover;
  flex: none;
  display: inline-block;
}
.chip-thumb-audio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(200, 255, 46, 0.2);
}
.chip-thumb-audio svg { width: 11px; height: 11px; }
.chip-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ref-chip-missing { opacity: 0.45; text-decoration: line-through; }

/* MINIMAX H3 技术标识（字段名/分镜/音效引用）高亮 */
.hf-tag {
  display: inline;
  border-radius: 4px;
  padding: 0 4px;
  margin: 0 1px;
  font-weight: 600;
  font-size: 12.5px;
}
.hf-field {
  display: inline-block;
  color: #fff;
  background: #7c3aed;
  padding: 1px 8px;
  border-radius: 6px;
  font-size: 12px;
  letter-spacing: 0.3px;
}
.hf-shot {
  color: #d946ef;
  background: rgba(217, 70, 239, 0.12);
}
.hf-sfx {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
}

/* 标签悬浮预览卡片 */
.chip-preview {
  position: fixed;
  z-index: 300;
  width: 232px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 32%), var(--panel-2);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65), 0 0 44px rgba(200, 255, 46, 0.05);
  animation: cp-in 0.15s ease;
}
@keyframes cp-in { from { opacity: 0; } to { opacity: 1; } }
.cp-media {
  position: relative;
  background: radial-gradient(300px 120px at 50% 0%, rgba(200, 255, 46, 0.07), transparent 70%), #050505;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cp-media img, .cp-media video {
  width: 100%;
  max-height: 150px;
  object-fit: contain;
  display: block;
  border-radius: 8px;
}
.cp-kind-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.65);
  color: var(--accent);
  padding: 2px 9px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  pointer-events: none;
}
.cp-audio {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  color: var(--accent);
}
.cp-audio audio { width: 192px; height: 30px; }
.cp-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}
.cp-name {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cp-edit-btn {
  flex: none;
  border: none;
  background: none;
  color: var(--dim);
  cursor: pointer;
  padding: 3px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  transition: color 0.12s, background 0.12s;
}
.cp-edit-btn:hover { color: var(--accent); background: var(--accent-dim); }

/* 选区悬浮操作菜单 */
.sel-menu {
  position: fixed;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--panel-2);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 4px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
}
.sel-menu .spinner { flex: none; margin: 0 4px; }

/* 上传中的引用标签（标签内显示进度） */
.ref-chip-uploading { gap: 6px; cursor: progress; }
.chip-spin { width: 10px; height: 10px; border-width: 1.5px; flex: none; }
.chip-prog-text { font-size: 11px; font-weight: 700; }
.chip-prog-bar {
  width: 36px;
  height: 3px;
  background: rgba(200, 255, 46, 0.2);
  border-radius: 999px;
  overflow: hidden;
  display: inline-block;
  flex: none;
}
.chip-prog-bar i { display: block; height: 100%; background: var(--accent); transition: width 0.2s; }
.sel-menu button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 12.5px;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s;
}
.sel-menu button:hover { background: var(--accent-dim); color: var(--accent); }
.sel-picker {
  position: fixed;
  z-index: 300;
  width: 264px;
  max-height: 240px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
}
.sel-picker .ent-opt img, .sel-picker .ent-opt video { height: 44px; }
.sel-picker .ent-opt-audio { height: 44px; }

/* @ 引用参考图弹出面板 */
.mention-pop {
  position: absolute;
  width: 244px;
  max-height: 220px;
  overflow-y: auto;
  background: var(--panel-2);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 5px;
  z-index: 60;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.mention-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 7px;
  cursor: pointer;
}
.mention-item.active { background: var(--accent-dim); }
.mention-item img, .mention-item video {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  object-fit: cover;
  flex: none;
}
.mi-audio {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.mention-item .mi-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mention-item .mi-idx {
  flex: none;
  font-size: 11px;
  font-family: Consolas, monospace;
  color: var(--dim);
}
.mention-item.active .mi-idx { color: var(--accent); }
.mention-empty { padding: 12px; text-align: center; color: var(--dim); font-size: 12.5px; }
.ops-file {
  font-size: 13px;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  word-break: break-all;
}
.ops-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--dim);
  font-size: 13px;
  text-align: center;
}
.ops-empty .big { font-size: 30px; }
.wb-preview-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  position: relative;
}
/* 已生成视频历史 */
.video-history-wrap {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 40;
}
.video-history-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
  background: var(--panel-2);
  border: 1px solid var(--border-light);
  cursor: pointer;
}
.video-history-btn:hover { color: var(--accent); border-color: var(--accent-dim); }
.video-history-count {
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--accent);
  color: #000;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* 视频历史窗口（modal） */
.modal.video-history-modal {
  width: 1280px;
  height: 720px;
  max-width: none;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 24px 24px;
}
.vh-modal-title { display: flex; align-items: center; gap: 10px; }
.vh-modal-count {
  min-width: 22px;
  height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #000;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.video-history-empty { color: var(--text-dim); font-size: 13px; padding: 28px 16px; text-align: center; }
.video-history-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding-right: 4px;
  min-height: 0;
}
.video-history-card {
  display: flex;
  gap: 14px;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border-light);
  background: var(--panel-2);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}
.video-history-card:hover { border-color: var(--accent-dim); background: var(--accent-dim); }
.vh-thumb-box {
  position: relative;
  flex: none;
  width: 94px;
  height: 94px;
  border-radius: 8px;
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border-light);
}
.vh-thumb-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vh-thumb-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: var(--text-dim); }
.vh-play-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ent-gen-all-status {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-dim);
  padding: 8px 2px 0;
}
.ent-gen-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ent-gen-status-text.bad { color: var(--danger); }
.ent-gen-pct {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-dim);
  white-space: nowrap;
}
.ent-gen-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--border-light);
  overflow: hidden;
}
.ent-gen-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.2s;
}
.ent-cfg {
  border: 1px dashed var(--border-light);
  border-radius: 8px;
  padding: 8px 10px;
  margin: 2px 0 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--panel);
}
.ent-cfg-label { font-size: 12px; font-weight: 600; color: var(--text-dim); }
.ent-cfg-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
/* 批量生成折叠面板 */
.ent-gen {
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--panel);
  margin-bottom: 10px;
  overflow: hidden;
}
.ent-gen-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
}
.ent-gen-toggle:hover { background: var(--panel-2); }
.ent-gen-caret {
  display: inline-block;
  font-size: 11px;
  color: var(--text-dim);
  transition: transform 0.15s;
}
.ent-gen-caret.open { transform: rotate(90deg); }
.ent-gen-title { color: var(--accent); }
.ent-gen-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--border-light);
  padding: 1px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.ent-gen-body {
  padding: 10px 12px;
  border-top: 1px dashed var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ent-gen-body .ent-cfg { margin: 0; border: none; background: transparent; padding: 0; }
.ent-gen-submit { display: flex; justify-content: flex-end; }
.ent-cfg-item { display: inline-flex; align-items: center; gap: 6px; }
.ent-cfg-k { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.ent-cfg-select { width: 96px; }
.ent-cfg-scope { gap: 10px; }
.ent-cfg-radio { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--text); cursor: pointer; }
.vh-card-body { flex: 1; min-width: 0; height: 94px; display: flex; flex-direction: column; gap: 6px; }
.vh-card-head { flex: none; display: flex; align-items: baseline; gap: 10px; }
.vh-card-name { font-size: 14px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vh-card-time { margin-left: auto; flex: none; font-size: 11.5px; color: var(--text-dim); }
.vh-card-params {
  flex: none;
  font-size: 11.5px;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vh-card-prompt {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.vh-card-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding-left: 6px;
}
/* 视频内容提取窗口 */
.modal.video-extract-modal {
  width: 560px;
  max-width: calc(100vw - 40px);
}
.ve-video {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--panel-2);
  border: 1px solid var(--border-light);
}
.ve-video img { width: 96px; height: 54px; object-fit: cover; border-radius: 6px; background: #000; }
.ve-video-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ve-modes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.ve-mode {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: var(--panel-2);
  font-size: 12.5px;
  cursor: pointer;
  color: var(--text-dim);
}
.ve-mode.on { color: var(--accent); border-color: var(--accent-dim); background: var(--accent-dim); }
.ve-mode input { display: none; }
.ve-time-panel {
  margin-bottom: 14px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  background: #000;
}
.ve-preview { width: 100%; height: 180px; display: block; object-fit: contain; background: #000; }
.ve-time-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--panel-2); }
.ve-slider { flex: 1; accent-color: var(--accent); }
.ve-time-val { flex: none; min-width: 44px; text-align: right; font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.ve-result {
  margin: 12px 0 4px;
  max-height: 220px;
  overflow: auto;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: #000;
}
.ve-result img { width: 100%; display: block; }
.ve-result audio { width: 100%; display: block; margin: 10px 0; }
.ve-url {
  display: block;
  padding: 12px;
  font-family: monospace;
  font-size: 12px;
  color: var(--text-dim);
  word-break: break-all;
}
.wb-frame {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.wb-frame.wide { width: 100%; }
.wb-frame.tall { height: 100%; }
.wb-frame canvas, .wb-frame video { display: block; width: 100%; height: 100%; object-fit: contain; }
.wb-frame .viewer-empty { padding: 40px 30px; }
/* 重新生成中：底层旧视频首帧 + 半透明进度遮罩 */
.preview-abort {
  align-self: center;
  margin-top: 10px;
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.4);
}
.preview-abort:hover { color: #fff; background: var(--danger); border-color: var(--danger); }
.wb-frame .preview-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0.6;
}
.progress-overlay.preview-regen-mask { background: rgba(0, 0, 0, 0.5); }
.regen-hint { font-size: 12px; color: var(--dim); margin-top: -4px; }

/* 第四栏：时间线 */
.wb-timeline {
  flex: none;
  border-top: 1px solid var(--border);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  /* 底部留边：让时间线滚动条不紧贴底边 */
  padding-bottom: 12px;
}
/* 时间线轨道：高度自适应容器 */
.wb-track {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: 14px;
  padding: 12px 16px 6px;
  overflow-x: auto;
  overflow-y: hidden;
  align-items: stretch;
  scrollbar-color: #2e2e2e #0a0a0a;
  scrollbar-width: auto;
}
/* 时间线轨道滚动条：黑灰色，加粗、贴近卡片 */
.wb-track::-webkit-scrollbar { height: 14px; }
.wb-track::-webkit-scrollbar-track { background: #0a0a0a; border-radius: 7px; }
.wb-track::-webkit-scrollbar-thumb {
  background: #2e2e2e;
  border-radius: 7px;
  border: 2px solid #0a0a0a;
}
.wb-track::-webkit-scrollbar-thumb:hover { background: #424242; }
.clip-item { flex: none; width: 216px; display: flex; flex-direction: column; gap: 7px; position: relative; }
.clip-insert {
  position: absolute;
  right: -17px;
  top: 60px;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border-light);
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 6;
  transition: all 0.12s;
}
.clip-item:hover .clip-insert { display: flex; }
.clip-insert:hover { background: var(--accent); border-color: var(--accent); color: #000; }
.clip-item[draggable="true"] { cursor: grab; }
.clip-item.dragging { opacity: 0.35; cursor: grabbing; }
.clip-card {
  position: relative;
  width: 216px;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: var(--panel-2);
  transition: border-color 0.12s;
}
.clip-card:hover { border-color: var(--border-light); }
.clip-card.selected { border-color: var(--accent); }
.clip-card .thumb-fill { position: absolute; inset: 0; }
.clip-card .clip-name-tag {
  position: absolute;
  left: 8px;
  bottom: 8px;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.65);
  padding: 2px 8px;
  border-radius: 5px;
  color: #ddd;
}
.clip-card .badge-pos { position: absolute; top: 8px; left: 8px; }
.clip-card .clip-replace {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: none;
  background: rgba(0, 0, 0, 0.65);
  color: #ddd;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: color 0.12s, background 0.12s;
}
.clip-card:hover .clip-replace { display: flex; }
.clip-card .clip-replace:hover { color: var(--accent); background: rgba(0, 0, 0, 0.85); }
.clip-card .clip-progress {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.55);
  font-size: 12px;
  color: var(--muted);
}
.clip-card .clip-progress .progress-bar { width: 120px; }
.clip-card.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dim);
  font-size: 12.5px;
  border-style: dashed;
}
.clip-card video, .clip-card img { width: 100%; height: 100%; object-fit: cover; }

.add-card {
  flex: none;
  width: 216px;
  align-self: stretch; /* 与 .clip-item 一致，随轨道拉伸，保证高度始终相同 */
  min-height: 121px;  /* 与 clip-card 16:9 高度一致的下限 */
  border: 1px dashed var(--border-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dim);
  transition: border-color 0.12s;
}
.add-card:hover { border-color: var(--muted); }
.add-plus { font-size: 26px; font-weight: 300; transition: opacity 0.12s; }
.add-btns {
  display: none;
  gap: 10px;
}
.add-card:hover .add-plus { display: none; }
.add-card:hover .add-btns { display: flex; }
.add-icon {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  border: 1px solid var(--border-light);
  background: var(--panel-2);
  color: var(--text);
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}
.add-icon:hover { border-color: var(--accent); color: var(--accent); }

/* ---- 登录/注册页 ---- */
.auth-page {
  display: flex;
  justify-content: center;
  padding: 70px 24px 90px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
}
.auth-card h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px; }
.auth-card h2 b { color: var(--accent); }
.auth-sub { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.auth-ok { color: var(--accent); font-size: 13px; margin-bottom: 10px; }
.auth-divider { border-top: 1px solid var(--border); margin: 22px 0 18px; }
.auth-h3 { font-size: 15px; margin-bottom: 14px; }
.auth-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
}
.auth-links a { color: var(--accent); cursor: pointer; }
.auth-links a:hover { text-decoration: underline; }
.auth-code {
  letter-spacing: 10px;
  text-align: center;
  font-size: 20px;
  font-family: Consolas, monospace;
}

/* ---- 用户中心（全屏：左侧导航 + 右侧工作区） ---- */
.ap {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}
.ap-side {
  width: 236px;
  flex: none;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-right: 1px solid var(--border);
}
.ap-side-label {
  flex: none;
  padding: 16px 20px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--dim);
}
.ap-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 10px;
}
.ap-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
  transition: all 0.12s;
}
.ap-nav button:hover { color: var(--text); background: var(--panel-2); }
.ap-nav button.active { color: var(--accent); background: var(--accent-dim); font-weight: 600; }
.ap-side-foot { flex: none; border-top: 1px solid var(--border); padding: 12px; }
.ap-user { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 0 2px; }
.acct-avatar { width: 38px; height: 38px; font-size: 15px; flex: none; cursor: default; }
.acct-user-info { min-width: 0; flex: 1; }
.acct-user-name {
  font-size: 13.5px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.acct-user-email {
  font-size: 11.5px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ap-user .status-badge { flex: none; }
.acct-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.12s;
}
.acct-logout:hover { color: var(--danger); background: rgba(255, 77, 77, 0.08); }

.ap-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ap-topbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
.ap-topbar h1 { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.ap-topbar p { color: var(--muted); font-size: 13px; margin-top: 2px; }
.ap-topbar-links { display: flex; gap: 8px; flex: none; }
.ap-topbar-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
  transition: all 0.12s;
}
.ap-topbar-links a:hover { color: var(--text); border-color: var(--muted); }
.ap-content { flex: 1; min-height: 0; overflow-y: auto; padding: 26px clamp(20px, 3vw, 44px) 56px; }
.ap-body { width: 100%; }

.acct-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 16px;
}
.acct-span { grid-column: 1 / -1; }

.sec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.sec-name { font-size: 14px; font-weight: 600; }
.sec-desc { font-size: 12.5px; color: var(--dim); margin-top: 2px; }

/* 数据表格（交易记录等）：列宽自适应内容，说明列占满剩余宽度 */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td {
  text-align: left;
  padding: 10px 14px 10px 0;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table th {
  color: var(--dim);
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
}
.data-table tbody tr { transition: background 0.12s; }
.data-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .fit { width: 1%; white-space: nowrap; }
.data-table td.amount { font-weight: 700; font-family: Consolas, monospace; }
.data-table td.amount.pos { color: var(--accent); }
.data-table td.amount.neg { color: var(--text); }
.data-table td.dim { color: var(--muted); }
.data-table td.desc { color: var(--muted); min-width: 180px; }
.table-empty { text-align: center; color: var(--dim); padding: 26px 0 !important; }

.info-rows {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.info-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 13px;
  font-size: 13px;
}
.info-row + .info-row { border-top: 1px solid var(--border); }
.info-row span { color: var(--dim); flex: none; }
.info-row b { font-weight: 500; color: var(--text); text-align: right; word-break: break-all; }

.balance-panel { position: relative; overflow: hidden; }
.balance-panel::before {
  content: "";
  position: absolute;
  top: -70px;
  right: -70px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 255, 46, 0.14), transparent 70%);
  pointer-events: none;
}
.balance-num {
  display: flex;
  align-items: baseline;
  font-size: 34px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 4px;
}
.balance-cny { font-size: 20px; margin-right: 4px; }
.balance-sub { color: var(--dim); font-size: 12.5px; margin-bottom: 16px; }

.ap-login-tip {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

@media (max-width: 860px) {
  .ap { flex-direction: column; }
  .ap-side { width: 100%; border-right: none; border-bottom: 1px solid var(--border); flex: none; }
  .ap-side-label { display: none; }
  .ap-nav { flex-direction: row; overflow-x: auto; padding: 0 12px 12px; }
  .ap-side-foot { border-top: none; }
}

/* ---- 框架拖拽手柄 ---- */
.rz {
  flex: none;
  position: relative;
  background: var(--border);
  transition: background 0.12s;
  z-index: 30;
}
/* 拖块标识：接缝中央的短粗指示条 */
.rz::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--dim);
  border-radius: 999px;
  transition: background 0.12s;
}
.rz-col { width: 7px; margin: 0 -3px; cursor: col-resize; }
.rz-col::after { width: 3px; height: 36px; }
.rz:hover { background: var(--border-light); }
.rz:hover::after { background: var(--accent); }
body.rz-dragging { user-select: none; }
body.rz-dragging-col, body.rz-dragging-col * { cursor: col-resize !important; }
/* 拖动中保持手柄高亮 */
body.rz-dragging-col .rz-col { background: var(--border-light); }
body.rz-dragging .rz::after { background: var(--accent); }

/* ---- 右侧框架：智能体 ---- */
.wb-right {
  width: 360px;
  flex: none;
  min-height: 0;
  border-left: 1px solid var(--border);
  background: var(--panel);
  display: flex;
  flex-direction: column;
}
.agent-head {
  flex: none;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.agent-head .a-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.agent-head .a-title { font-size: 14px; font-weight: 700; }
.agent-head .a-sub { font-size: 11.5px; color: var(--dim); }
.agent-new { margin-left: auto; }
.agent-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* 实时思考过程：3 行滚动显示，不追加到对话 */
.agent-thinking {
  flex: none;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, transparent, var(--panel) 30%);
  padding: 8px 14px 10px;
  max-height: 78px;
  overflow: hidden;
  position: relative;
}
.agent-thinking::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 14px;
  background: linear-gradient(180deg, var(--panel), transparent);
  pointer-events: none;
}
.at-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--accent);
  margin-bottom: 4px;
}
.at-abort {
  margin-left: auto;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 5px;
  background: rgba(255, 77, 77, 0.12);
  color: var(--danger);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}
.at-abort svg path { fill: currentColor; stroke: currentColor; }
.at-abort:hover { background: rgba(255, 77, 77, 0.25); }
.at-head .spinner { width: 11px; height: 11px; }
/* 思考中：三点跳动打字指示 */
.typing-dots { display: inline-flex; gap: 3px; align-items: center; height: 11px; }
.typing-dots i {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
  animation: vf-dot 1.2s infinite ease-in-out both;
}
.typing-dots i:nth-child(2) { animation-delay: 0.15s; }
.typing-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes vf-dot { 0%, 80%, 100% { transform: scale(0.5); opacity: 0.35; } 40% { transform: scale(1); opacity: 1; } }
/* 流式思考文本：末尾闪烁光标 */
.at-cursor { color: var(--accent); animation: vf-blink 1s steps(2, start) infinite; margin-left: 1px; }
@keyframes vf-blink { 50% { opacity: 0; } }
.at-text {
  margin: 0;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 52px;
  overflow: hidden;
}
.msg { max-width: 88%; padding: 9px 13px; border-radius: 10px; font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; }
.msg.agent { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--border); }
.msg.user { align-self: flex-end; background: var(--accent); color: #000; }
.msg-refs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.msg-ref-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 5px;
  cursor: pointer;
  transition: opacity 0.12s;
}
.msg-ref-tag:hover { opacity: 0.8; }
.msg-ref-tag.ref-ref { background: rgba(0, 0, 0, 0.15); color: #000; }
.msg-ref-tag.ref-clip { background: rgba(0, 0, 0, 0.25); color: #000; }
.user-files { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.user-file { cursor: pointer; }
.user-file-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(0, 0, 0, 0.2);
}
.user-file-icon {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.15);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* 智能体动作步骤（实时状态） */
.msg.action { align-self: stretch; max-width: 100%; background: none; border: none; padding: 0; }
.action-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 11px;
}
.action-row .spinner { width: 11px; height: 11px; flex: none; }
.action-row.st-done { color: var(--accent); border-color: rgba(200, 255, 46, 0.3); }
.action-row.st-error { color: var(--danger); border-color: rgba(255, 77, 77, 0.35); }
.action-row .action-text { color: var(--muted); min-width: 0; }
.action-row.st-done .action-text { color: var(--text); }

/* 排队中的用户消息：原文 + 等待指示，可单独撤回 */
.msg.user.queued {
  align-self: flex-end;
  background: var(--panel-2);
  color: var(--muted);
  border: 1px dashed var(--border-light);
  max-width: 88%;
}
.queued-bubble {
  display: flex;
  align-items: center;
  gap: 8px;
}
.queued-spin { width: 11px; height: 11px; flex: none; }
.queued-text { min-width: 0; }
.qcancel {
  flex: none;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qcancel:hover { background: rgba(255, 77, 77, 0.18); color: var(--danger); }

/* 生成结果（图像/视频）内嵌展示 */
.media-result {
  align-self: stretch;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
}
.media-thumb {
  width: 140px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: var(--panel-2);
}
.media-thumb img, .media-thumb video { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.media-thumb:hover { border-color: var(--accent); }

/* 智能体交互卡片（预置单选/多选 + 自定义 HTML） */
.msg.interactive { align-self: stretch; max-width: 100%; background: none; border: none; padding: 0; }
.interactive-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.interactive-card.done { opacity: 0.65; }
.ic-prompt { font-size: 13.5px; margin-bottom: 10px; }
.ic-choices { display: flex; flex-direction: column; gap: 6px; }
.ic-choice {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  background: none;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.12s;
}
.ic-choice:hover { border-color: var(--muted); }
.ic-choice.sel { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }
.ic-choice:disabled { cursor: default; }
.ic-choice-thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  flex: none;
}
.ic-choice.has-thumb { padding: 5px 10px 5px 5px; }
.ic-choice-check {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: #000;
}
.ic-choice.sel .ic-choice-check { background: var(--accent); border-color: var(--accent); }
.ic-confirm { margin-top: 10px; margin-left: auto; display: flex; }
.ic-html { font-size: 13px; line-height: 1.6; color: var(--text); }
.ic-html img { max-width: 100%; border-radius: 6px; margin: 4px 0; display: block; }
.ic-html p { margin: 4px 0; }
.ic-html h3, .ic-html h4 { margin: 8px 0 4px; }
.msg.options { align-self: stretch; max-width: 100%; background: none; border: none; padding: 0; }
.options-card {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
}
.options-card.done { opacity: 0.75; }
.oc-title { font-size: 13.5px; margin-bottom: 10px; }
.oc-list { display: flex; flex-direction: column; gap: 6px; }
.oc-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  background: none;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  padding: 8px 12px;
  cursor: pointer;
  transition: all 0.12s;
}
.oc-opt-thumb {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  object-fit: cover;
  flex: none;
}
.oc-opt.has-thumb { padding: 5px 10px 5px 5px; }
.oc-opt:hover { border-color: var(--muted); }
.oc-opt.sel { border-color: var(--accent); background: var(--accent-dim); color: var(--accent); }
.oc-opt:disabled { cursor: default; }
.oc-check {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  color: #000;
}
.oc-opt.sel .oc-check { background: var(--accent); border-color: var(--accent); }
.oc-confirm { margin-top: 10px; margin-left: auto; display: flex; }
.msg .msg-tag {
  display: inline-block;
  font-size: 11px;
  color: var(--dim);
  margin-bottom: 4px;
}
.agent-input {
  flex: none;
  display: flex;
  gap: 8px;
  padding: 12px 14px 16px;
  position: relative;
  flex-wrap: wrap;
}
.agent-input-wrap { position: relative; flex: 1; min-width: 0; }
.agent-editor {
  width: 100%;
  min-height: 36px;
  max-height: 120px;
  overflow-y: auto;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.5;
  outline: none;
  transition: border-color 0.15s;
  word-break: break-word;
}
.agent-editor:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.agent-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--dim);
  pointer-events: none;
}
.agent-chip {
  display: inline-block;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 5px;
  padding: 1px 7px;
  margin: 0 1px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: default;
  user-select: none;
}
.agent-mention-pop {
  bottom: 100%;
  top: auto;
  left: 0;
  margin-bottom: 4px;
  z-index: 200;
  padding: 4px;
  overflow: visible;
}
/* 两级菜单 */
.am-menu { display: flex; flex-direction: column; gap: 0; overflow: visible; }
.am-group {
  position: relative;
  padding: 7px 12px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  border-radius: 7px;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: background 0.1s;
}
.am-group:hover, .am-group.active { background: var(--panel); color: var(--text); }
.am-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--dim);
  background: var(--panel-2);
  border-radius: 999px;
  padding: 1px 7px;
}
.am-sub {
  position: absolute;
  left: 100%;
  bottom: 0;
  min-width: 220px;
  max-height: 260px;
  overflow-y: auto;
  background: var(--panel-2);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 5px;
  margin-left: 4px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  z-index: 210;
}
.am-sub .mention-item { padding: 6px 10px; }
.am-sub .mi-name { font-size: 12.5px; }
.am-sub img, .am-sub .mi-audio { width: 26px; height: 26px; border-radius: 5px; }
.agent-files {
  display: flex;
  gap: 8px;
  width: 100%;
  overflow-x: auto;
  padding-bottom: 4px;
}
.agent-file-item {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--panel-2);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 4px 8px 4px 4px;
  max-width: 200px;
}
.agent-file-thumb {
  width: 32px;
  height: 32px;
  border-radius: 5px;
  object-fit: cover;
  flex: none;
}
.agent-file-icon {
  width: 32px;
  height: 32px;
  border-radius: 5px;
  background: var(--accent-dim);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.agent-file-name {
  font-size: 12px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agent-file-progress {
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  flex: none;
}
.agent-input .input { flex: 1; }
.agent-input .btn { padding: 10px 16px; }
.agent-attach {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  flex: none;
  transition: all 0.12s;
}
.agent-attach:hover { color: var(--accent); border-color: var(--accent); }
.agent-file-chip {
  position: absolute;
  top: -30px;
  left: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-dim);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  color: var(--accent);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---- 弹窗 ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  overflow-y: auto;
}
.modal {
  position: relative;
  width: 380px;
  max-width: calc(100vw - 40px);
  background: var(--panel);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 24px;
}
.modal h3 { font-size: 17px; margin-bottom: 18px; padding-right: 26px; }

/* 自定义对话框（替代原生 prompt/confirm） */
.modal.dialog-modal { width: 440px; }
.dialog-modal .dialog-message {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 16px;
  white-space: pre-wrap;
}
.dialog-modal .input { margin-bottom: 16px; }
.dialog-modal .dialog-input-multiline { min-height: 90px; font-family: monospace; resize: vertical; }
.dialog-modal .dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
}
.modal-close:hover { color: var(--danger); border-color: var(--danger); background: rgba(255, 77, 77, 0.08); }
.modal-close:disabled { opacity: 0.4; cursor: not-allowed; }
.modal-close:disabled:hover { color: var(--muted); border-color: transparent; background: none; }
/* 顶部 toast 提示 */
.vf-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  max-width: min(560px, calc(100vw - 48px));
  background: rgba(20, 22, 30, 0.96);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 13.5px;
  color: var(--text);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vf-toast.toast-success { border-color: rgba(63, 185, 80, 0.6); }
.vf-toast.toast-success::before { content: "✓ "; color: #3fb950; }
.vf-toast.toast-error { border-color: rgba(255, 77, 77, 0.6); }
.vf-toast.toast-error::before { content: "✕ "; color: #ff4d4d; }
.vf-toast.toast-warning { border-color: rgba(255, 176, 32, 0.6); }
.vf-toast.toast-warning::before { content: "⚠ "; color: #ffb020; }
.vf-toast-enter-active, .vf-toast-leave-active { transition: opacity 0.2s, transform 0.2s; }
.vf-toast-enter-from, .vf-toast-leave-to { opacity: 0; transform: translateX(-50%) translateY(-8px); }
/* 历史版本弹窗 */
.versions-modal { width: min(460px, calc(100vw - 40px)); }
.ver-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 380px;
  overflow-y: auto;
}
.ver-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--panel-2);
}
.ver-time { flex: 1; font-size: 13px; color: var(--text); font-variant-numeric: tabular-nums; }
.ver-size { font-size: 11.5px; color: var(--dim); }
.versions-loading { display: flex; align-items: center; gap: 8px; padding: 18px; color: var(--dim); font-size: 13px; }
.modal .field { margin-bottom: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.modal .switch-line {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  margin-top: 14px;
}
.modal .switch-line a { color: var(--accent); cursor: pointer; }
.gp-input { width: 100%; min-height: 60px !important; }
.gp-editor {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.7;
  outline: none;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  transition: border-color 0.15s;
}
.gp-editor:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.gp-editor:empty::before { content: attr(data-placeholder); color: var(--dim); pointer-events: none; }
.gp-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 150px;
  white-space: nowrap;
  background: rgba(199, 125, 255, 0.15);
  color: #c77dff;
  border-radius: 6px;
  padding: 0 7px;
  margin: 0 1px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: default;
  user-select: none;
  vertical-align: baseline;
}
.gp-chip::before { content: "✦"; font-size: 9px; opacity: 0.85; margin-right: 1px; }
.gp-groups { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.gp-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gp-cat { flex: none; font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-dim); border-radius: 4px; padding: 2px 7px; }
.gp-group .gp-chips { margin-top: 0; }
.gp-chips .chip { font-size: 11px; padding: 2px 8px; }
.gp-tip {
  position: absolute;
  z-index: 80;
  max-width: 340px;
  background: rgba(18, 20, 28, 0.97);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  white-space: pre-wrap;
  word-break: break-word;
}
.mi-preset { background: rgba(199, 125, 255, 0.15); color: #c77dff; }
/* 项目属性：尺寸自适应内容，无滚动条 */
.project-settings-modal {
  width: min(1360px, calc(100vw - 40px));
}
.ps-cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
  align-items: start;
}
.ps-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ps-models-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
@media (max-width: 760px) {
  .ps-cols { grid-template-columns: 1fr; gap: 16px; }
}

/* 导出弹窗 */
.export-opts {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 0 14px;
  border-top: 1px solid var(--border);
}
.export-opts .ops-opt-label { font-size: 11.5px; color: var(--dim); font-weight: 600; }
.export-opts .chip-row { flex-wrap: wrap; }
.export-opts .chip { font-size: 11.5px; padding: 3px 9px; }
.export-opts .ops-opt-hint { font-size: 10.5px; color: var(--dim); opacity: 0.75; line-height: 1.4; }
.export-clip-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.12s;
}
.export-clip-row.sel { border-color: var(--accent); background: var(--accent-dim); }
.export-clip-row input { accent-color: var(--accent); }
.export-thumb {
  width: 40px;
  height: 24px;
  border-radius: 4px;
  object-fit: cover;
  flex: none;
}
.export-thumb-placeholder {
  width: 40px;
  height: 24px;
  border-radius: 4px;
  background: var(--panel);
  color: var(--dim);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.export-clip-name { flex: 1; font-size: 13px; }
.export-clip-dur { font-size: 12px; color: var(--dim); flex: none; }
.export-progress { text-align: center; padding: 20px 0; }
.export-done p, .export-fail p { margin: 10px 0 16px; }
.export-done .accent { color: var(--accent); }
.export-running p { margin-bottom: 12px; color: var(--muted); font-size: 13px; }
.modal-desc { font-size: 13.5px; color: var(--muted); margin-bottom: 16px; }
.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.check-line input[type="checkbox"] { accent-color: var(--accent); cursor: pointer; }

/* 实体识别素材关联弹窗 */
.entity-modal { width: 580px; }
.ent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
  margin-bottom: 6px;
}
.ent-row {
  position: relative;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
}
.ent-row.on { border-color: var(--border-light); }
.ent-main { display: flex; align-items: center; gap: 8px; }
.ent-check { display: flex; align-items: center; cursor: pointer; }
.ent-check input { accent-color: var(--accent); cursor: pointer; }
.ent-type {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 5px;
}
.ent-scene { background: rgba(88, 166, 255, 0.15); color: #58a6ff; }
.ent-character { background: var(--accent-dim); color: var(--accent); }
.ent-prop { background: rgba(255, 176, 80, 0.12); color: #ffb050; }
.ent-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ent-linked { flex: none; display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--accent); }
.ent-linked-thumb {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  object-fit: cover;
  border: 1px solid rgba(200, 255, 46, 0.5);
}
.ent-linked-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-dim);
  color: var(--accent);
}
.ent-actions { flex: none; display: flex; gap: 6px; margin-left: auto; }
.ent-gen { color: var(--accent); }
.ent-picker {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  max-height: 220px;
  overflow-y: auto;
  background: var(--panel-2);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 10px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}
.ent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
  margin-top: 9px;
}
.ent-opt {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: var(--panel);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.ent-opt:hover { border-color: var(--border-light); }
.ent-opt.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }
.ent-opt img, .ent-opt video { width: 100%; height: 52px; object-fit: cover; display: block; }
.ent-opt-audio {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: var(--accent-dim);
}
.ent-opt-name {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  padding: 3px 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ent-upload {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 79px;
  color: var(--dim);
  font-size: 11px;
  border-style: dashed;
}
.ent-upload:hover { color: var(--accent); border-color: var(--accent); }

/* AI 生成素材弹窗（横板） */
.imggen-modal { width: min(860px, calc(100vw - 48px)); }
.imggen-modal h3 { display: flex; align-items: center; gap: 10px; }
.ig-model-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-dim);
  border-radius: 999px;
  padding: 2px 10px;
}
.ig-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.ig-grid { max-height: 280px; overflow-y: auto; }
@media (max-width: 720px) { .ig-cols { grid-template-columns: 1fr; } }

@media (max-width: 1100px) {
  .wb-right { width: 300px; }
}
