: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);
}
/* MiniFlow 品牌标记：亮黄圆角方块 + 深色 M */
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--accent);
  border-radius: 7px;
  color: #101204;
  font-weight: 800;
  font-size: 15px;
  line-height: 1;
  letter-spacing: -0.02em;
  flex: none;
  box-shadow: 0 0 16px rgba(200, 255, 46, 0.45);
}
.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); }
/* 语言切换器（SiteNav 全路由可见） */
.lang-switch { position: relative; display: inline-flex; }
.nav-lang-btn {
  font-size: 13px; color: var(--muted); padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--border-light); background: transparent; cursor: pointer;
  min-width: 38px; text-align: center; transition: color 0.12s, border-color 0.12s;
}
.nav-lang-btn:hover { color: var(--text); border-color: var(--muted); }
.lang-menu { width: 120px; }
.nav-drawer .drawer-lang { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border-light); margin-top: 8px; }
.nav-drawer .drawer-lang button {
  flex: 1; font-size: 13px; color: var(--muted); padding: 7px 0; border-radius: 8px;
  border: 1px solid var(--border-light); background: transparent; cursor: pointer;
}
.nav-drawer .drawer-lang button.cur { color: var(--accent); border-color: var(--accent); }
.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); }

/* ---------- 私有化部署页 ---------- */
.dp-hero { text-align: center; padding: clamp(56px, 8vw, 100px) 0 clamp(40px, 5vw, 64px); }
.dp-hero-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--accent); background: rgba(200, 255, 46, 0.08); border: 1px solid rgba(200, 255, 46, 0.3); border-radius: 999px; padding: 5px 14px; margin-bottom: 22px; }
.dp-hero h1 { font-size: clamp(34px, 4.4vw, 54px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.12; margin-bottom: 18px; }
.dp-hero-sub { max-width: 680px; margin: 0 auto; color: var(--muted); font-size: 16px; line-height: 1.75; }
.dp-hero-stats { display: flex; justify-content: center; gap: clamp(22px, 4vw, 48px); margin: 36px 0 28px; flex-wrap: wrap; }
.dp-hero-stats .stat b { display: block; font-size: 21px; font-weight: 800; letter-spacing: -0.01em; }
.dp-hero-stats .stat span { font-size: 12.5px; color: var(--dim); }
.dp-hero-cta { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
/* 部署形态卡片 */
.dp-forms { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.dp-form-card { background: var(--panel); border: 1px solid var(--border-light); border-radius: 14px; padding: 24px 22px; transition: border-color 0.15s, transform 0.15s; }
.dp-form-card:hover { border-color: rgba(200, 255, 46, 0.45); transform: translateY(-3px); }
.dp-form-icon { width: 44px; height: 44px; border-radius: 12px; background: rgba(200, 255, 46, 0.1); color: var(--accent); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.dp-form-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.dp-form-card > p { font-size: 13.5px; color: var(--muted); line-height: 1.65; margin-bottom: 12px; }
.dp-form-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.dp-form-list li { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-dim); }
.dp-form-list li svg { color: var(--accent); flex: none; }
/* 技术规格网格 */
.dp-spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.dp-spec { background: var(--panel-2); border: 1px solid var(--border-light); border-radius: 10px; padding: 14px 16px; }
.dp-spec-k { font-size: 12px; color: var(--dim); margin-bottom: 5px; }
.dp-spec-v { font-size: 13.5px; color: var(--text); font-weight: 600; line-height: 1.5; }
/* 算力设备配套 */
.dp-hw-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.dp-hw-card { background: var(--panel); border: 1px solid var(--border-light); border-radius: 14px; padding: 22px 20px; transition: border-color 0.15s, transform 0.15s; }
.dp-hw-card:hover { border-color: rgba(200, 255, 46, 0.45); transform: translateY(-3px); }
.dp-hw-tier { display: inline-block; font-size: 11.5px; font-weight: 600; border-radius: 6px; padding: 3px 9px; margin-bottom: 12px; }
.dp-hw-tier.tier-entry { color: #9ece6a; background: rgba(158, 206, 106, 0.12); }
.dp-hw-tier.tier-mid { color: #7aa2f7; background: rgba(122, 162, 247, 0.12); }
.dp-hw-tier.tier-high { color: var(--accent); background: rgba(200, 255, 46, 0.12); }
.dp-hw-card h3 { font-size: 19px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 8px; font-family: ui-monospace, Consolas, monospace; }
.dp-hw-desc { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 12px; }
.dp-hw-note { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 13px 16px; background: var(--panel-2); border: 1px solid var(--border-light); border-radius: 10px; font-size: 13px; color: var(--text-dim); line-height: 1.65; }
.dp-hw-note svg { color: var(--accent); flex: none; }

/* 主页快速需求对话框（居中单栏） */
.hero-quick { max-width: 880px; margin: 0 auto; text-align: center; }
.hero-quick p { max-width: none; }
.hero-quick .hero-stats { justify-content: center; }
.quick-box { margin-top: 30px; text-align: left; }
.quick-input {
  width: 100%;
  min-height: 132px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.65;
  resize: vertical;
}
.quick-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 10px; }
.quick-hint { font-size: 12px; color: var(--dim); }
.quick-login-tip a { color: var(--accent); font-weight: 600; }
.quick-alt { display: inline-block; margin-top: 20px; font-size: 13px; color: var(--text-dim); }
.quick-alt:hover { color: var(--accent); }

/* 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; }
.dim { color: var(--muted); }

/* 预览区 */
.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; }
.viewer-error-raw { font-size: 11.5px; color: var(--text-dim); max-width: 420px; max-height: 90px; overflow-y: auto; background: var(--panel-2); border: 1px solid var(--border-light); border-radius: 8px; padding: 8px 12px; font-family: ui-monospace, Consolas, monospace; line-height: 1.5; word-break: break-all; text-align: left; }

.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; }
/* 折叠子菜单（LoRA 训练接口列表）：切换钮 + 缩进的端点项 */
.ds-sub-toggle .ds-sub-arrow { margin-left: auto; font-size: 10px; transition: transform 0.15s; opacity: 0.7; }
.ds-sub-toggle .ds-sub-arrow.open { transform: rotate(180deg); }
.ds-sub { border-left: 1px solid var(--border); margin: 2px 0 6px 14px; padding-left: 4px; }
.ds-sub button { font-size: 12.5px; padding: 5px 8px; gap: 7px; color: var(--dim); }
.ds-sub button .ds-method { font-size: 9px; padding: 1px 5px; }
h3[id^="lora-ep-"], .docs-sec h3 { scroll-margin-top: 92px; }

.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); }

/* H3 规范细化说明 */
.h3-cn { font-family: inherit; font-weight: 400; font-size: 12px; color: var(--dim); }
.h3-note { background: rgba(200, 255, 46, 0.05); border: 1px solid rgba(200, 255, 46, 0.22); border-radius: 10px; padding: 13px 16px; margin: 14px 0; }
.h3-note-title { font-size: 12.5px; font-weight: 600; color: var(--accent); margin-bottom: 8px; }
.h3-note-list { margin: 0; padding-left: 18px; font-size: 13px; color: var(--muted); line-height: 1.85; }
.h3-note-list b { color: var(--text); }

/* H3 提示词优化工具 */
.h3-opt { border: 1px solid var(--border-light); border-radius: 10px; padding: 14px 16px; background: var(--panel-2); }
.h3-opt-input { width: 100%; min-height: 90px; resize: vertical; font-size: 13.5px; line-height: 1.6; }
.h3-opt-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: nowrap; }
.h3-opt-field { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; }
.h3-opt-field .h3-opt-sel { flex: 1; min-width: 0; width: 100%; }
.h3-opt-k { font-size: 12.5px; color: var(--text-dim); flex: none; }
.h3-opt-sel { padding: 5px 8px; font-size: 12.5px; }
.opt-model-sel { width: auto; padding: 4px 8px; font-size: 12px; }
.h3-opt-btn { flex: none; }
.h3-opt-error { font-size: 12.5px; color: var(--danger); margin-top: 12px; }
.h3-opt-result { margin-top: 12px; }
.h3-opt-pre { max-height: 460px; overflow: auto; white-space: pre-wrap; word-break: break-word; font-size: 12.5px; line-height: 1.65; }

/* 优化工具：参考素材上传 */
.h3-opt-mats { display: flex; align-items: flex-start; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.h3-opt-mat-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1; }
.h3-opt-mat { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-dim); background: var(--panel); border: 1px solid var(--border-light); border-radius: 6px; padding: 3px 6px 3px 8px; max-width: 240px; min-width: 0; }
.h3-opt-mat-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h3-opt-mat-idx { color: var(--accent); font-family: ui-monospace, Consolas, monospace; }
.h3-opt-mat-del { background: none; border: none; color: var(--dim); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.h3-opt-mat-del:hover { color: var(--danger); }
.h3-opt-upload { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--accent); border: 1px dashed rgba(200, 255, 46, 0.5); border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.h3-opt-upload.busy { opacity: 0.6; pointer-events: none; }
.h3-opt-none { font-size: 12px; color: var(--dim); }

/* 优化工具：结果 tabs + 快速执行 */
.h3-opt-tabs { display: flex; align-items: center; gap: 4px; margin-top: 14px; margin-bottom: 10px; flex-wrap: wrap; }
.h3-opt-tab { font-size: 12.5px; padding: 5px 12px; border-radius: 7px; border: 1px solid var(--border-light); background: var(--panel); color: var(--text-dim); cursor: pointer; }
.h3-opt-tab.on { color: var(--accent); border-color: var(--accent); background: rgba(200, 255, 46, 0.08); }
.h3-opt-gen { margin-left: auto; }
.h3-opt-result-body { position: relative; }
.h3-opt-genres { margin-top: 10px; font-size: 12.5px; color: var(--accent); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.h3-opt-genres code { color: var(--text); }

/* H3 官方技能库（API 文档） */
.skill-doc { border: 1px solid var(--border-light); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.skill-doc-head { display: flex; align-items: center; gap: 12px; padding: 13px 16px; cursor: pointer; background: var(--panel-2); transition: background 0.12s; }
.skill-doc-head:hover { background: rgba(255, 255, 255, 0.04); }
.skill-doc-info { flex: 1; min-width: 0; }
.skill-doc-name { font-weight: 600; font-size: 13.5px; color: var(--text); }
.skill-doc-en { font-size: 11px; color: var(--dim); font-family: ui-monospace, Consolas, monospace; font-weight: 400; }
.skill-doc-desc { font-size: 12px; color: var(--text-dim); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.skill-doc-meta { font-size: 11.5px; color: var(--dim); flex: none; }
.skill-doc-body { padding: 12px 16px; border-top: 1px solid var(--border-light); }
.skill-doc-files { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; align-items: center; }
.skill-doc-file { font-size: 12px; padding: 3px 9px; border-radius: 6px; border: 1px solid var(--border-light); background: var(--panel); color: var(--text-dim); cursor: pointer; font-family: ui-monospace, Consolas, monospace; }
.skill-doc-file:hover { color: var(--text); border-color: var(--text-dim); }
.skill-doc-file.on { color: var(--accent); border-color: var(--accent); }
.skill-doc-dl { margin-left: auto; }
.skill-doc-content { max-height: 440px; overflow: auto; background: var(--panel-2); border: 1px solid var(--border-light); border-radius: 8px; padding: 13px 15px; font-size: 12.5px; line-height: 1.65; color: var(--text-dim); white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, Consolas, monospace; margin: 0; }
.skill-doc-loading { font-size: 12px; color: var(--dim); padding: 10px 0; display: flex; align-items: center; gap: 8px; }

/* H3 技能库目录索引 */
.skill-index { margin: 6px 0 18px; }
.skill-index-title { font-size: 12.5px; font-weight: 600; color: var(--text-dim); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.skill-index-count { font-size: 11.5px; font-weight: 400; color: var(--dim); background: var(--panel-2); border: 1px solid var(--border-light); border-radius: 10px; padding: 1px 8px; }
.skill-index-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.skill-index-item { border: 1px solid var(--border-light); border-radius: 10px; padding: 11px 13px; background: var(--panel-2); cursor: pointer; transition: border-color 0.12s, background 0.12s; }
.skill-index-item:hover { border-color: var(--accent); background: rgba(255, 255, 255, 0.03); }
.skill-index-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.skill-index-name { font-size: 12.5px; font-weight: 600; color: var(--text); word-break: break-all; }
.skill-index-en { font-size: 11px; color: var(--dim); font-family: ui-monospace, Consolas, monospace; margin-top: 2px; word-break: break-all; }
.skill-index-files { font-size: 11px; color: var(--dim); flex: none; }
.skill-index-brief { font-size: 11.5px; color: var(--text-dim); margin-top: 6px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.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-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; align-items: stretch; }
  .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); }
/* 全屏预览：下载按钮（close 左侧，含实时进度文字） */
.media-preview-dl {
  position: absolute;
  top: 18px;
  right: 74px;
  height: 40px;
  padding: 0 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.14);
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
}
.media-preview-dl:hover:not(:disabled) { background: rgba(255, 255, 255, 0.28); }
.media-preview-dl:disabled { cursor: default; opacity: 0.9; }
/* 全屏预览：二次精修按钮（右下角，仅 MINIMAX_H3_LIVE 已生成视频可见） */
.media-preview-refine {
  position: absolute;
  bottom: 22px;
  right: 22px;
  height: 40px;
  padding: 0 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.14);
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
}
.media-preview-refine: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; }

/* 帧图参考图选择面板 */
.flf-refpick-modal { max-width: 560px; }
.flf-pick-loading { display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 12.5px; padding: 4px 0 10px; }
.flf-pick-grid { max-height: 40vh; overflow-y: auto; }
/* 首帧/尾帧「从素材库选择」网格 */
.flf-lib-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; max-height: 200px; overflow-y: auto; min-width: 240px; }
.flf-lib-item { display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; border-radius: 6px; padding: 3px; border: 1px solid transparent; }
.flf-lib-item:hover { border-color: var(--accent); background: rgba(200, 255, 46, 0.06); }
.flf-lib-item img { width: 100%; max-width: 52px; aspect-ratio: 1; object-fit: cover; border-radius: 5px; background: #000; }
.flf-lib-item span { font-size: 10px; color: var(--dim); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 片段标题下拉箭头 / 素材库入口按钮：仅移动端显示 */
.ops-title-arrow { display: none; font-size: 10px; color: var(--dim); margin-left: 3px; }
.ops-assets-btn { display: none; }
/* 移动端片段列表面板 */
.mclip-panel { min-width: 240px; max-width: calc(100vw - 16px); }
.mclip-list { display: flex; flex-direction: column; gap: 2px; max-height: 46vh; overflow-y: auto; padding: 2px; }
.mclip-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; cursor: pointer; }
.mclip-item:hover { background: rgba(255, 255, 255, 0.05); }
.mclip-item.on { background: var(--accent-dim); }
.mclip-item img { width: 40px; height: 24px; object-fit: cover; border-radius: 4px; background: #000; flex: none; }
.mclip-noimg { width: 40px; height: 24px; border-radius: 4px; background: var(--panel-2); display: flex; align-items: center; justify-content: center; color: var(--dim); flex: none; }
.mclip-name { flex: 1; min-width: 0; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mclip-status { flex: none; font-size: 10.5px; color: var(--dim); }
.mclip-add { color: var(--accent); }
/* 移动端素材库面板 */
.masset-panel { min-width: 260px; max-width: calc(100vw - 16px); }
.masset-grid { max-height: 46vh; }
.masset-add { float: right; display: inline-flex; gap: 4px; }
.masset-add .ops-del { width: 22px; height: 22px; }
/* 手机端：素材库抽屉的 [+] / AI 按钮加大触控目标（22px 偏小易误触/点不中） */
@media (max-width: 768px) {
  .masset-add .ops-del { width: 30px; height: 30px; }
}

/* 面板关闭按钮（统一样式）—— 白色图标（color 继承即可） */
.panel-close {
  float: right;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border: none;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  transition: all 0.12s;
  flex-shrink: 0;
}
.panel-close svg { color: inherit; }
.panel-close:hover { background: rgba(255, 255, 255, 0.2); }

/* 增强视频播放器（vf-player）：缓冲遮罩 / 下载进度 / 媒体信息 / 断线重连 */
.vf-player { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.vf-player > video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }
/* 媒体预览弹窗 / 素材预览内的自适应 */
.vf-player.media-preview-video { width: auto; height: auto; }
.vf-player.media-preview-video > video { width: auto; height: auto; max-width: 92vw; max-height: 88vh; }
.rp-body .vf-player { width: auto; height: auto; }
.rp-body .vf-player > video { width: auto; height: auto; max-width: 100%; max-height: 62vh; }
/* 状态遮罩：不拦截原生控制条（失败态的按钮除外） */
.vf-mask {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: rgba(10, 10, 10, 0.55); color: #eee; font-size: 13px; text-align: center;
  pointer-events: none;
}
.vf-mask .btn { pointer-events: auto; }
.vf-mask-soft { background: rgba(10, 10, 10, 0.35); }
/* 顶部组件条：媒体信息按钮 + 下载/缓冲进度成组，播放器左上角（原始位置） */
.vf-topbar {
  position: absolute; top: 8px; left: 8px; z-index: 6;
  display: flex; align-items: center; gap: 7px;
  transition: opacity 0.25s;
}
.vf-info-btn {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  border: 1px solid var(--border-light); background: rgba(0, 0, 0, 0.55); color: #ddd;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: opacity 0.25s;
}
.vf-info-btn:hover, .vf-info-btn.on { color: var(--accent); border-color: var(--accent); }
.vf-info-panel {
  position: absolute; top: 40px; left: 8px; z-index: 7; min-width: 190px;
  background: rgba(16, 16, 16, 0.92); border: 1px solid var(--border-light); border-radius: 8px;
  padding: 8px 10px; font-size: 12px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: opacity 0.25s;
}
.vf-info-panel div { display: flex; justify-content: space-between; gap: 14px; padding: 2px 0; }
.vf-info-panel span { color: var(--dim); }
.vf-info-panel b { font-weight: 500; color: var(--text); font-family: ui-monospace, Consolas, monospace; }
.vf-dl {
  display: flex; align-items: center; gap: 7px;
  background: rgba(0, 0, 0, 0.55); border-radius: 20px; padding: 4px 10px 4px 6px;
  font-size: 11px; color: #ccc; font-family: ui-monospace, Consolas, monospace;
  transition: opacity 0.25s;
}
/* 播放中隐藏覆盖在画面上的组件（顶部组件条、信息面板、播放全部按钮），避免遮挡观看；
   悬停播放区临时恢复（可操作停止连播/查看信息） */
.vf-player.playing .vf-topbar,
.vf-player.playing .vf-info-panel { opacity: 0; pointer-events: none; }
.vf-player.playing:hover .vf-topbar,
.vf-player.playing:hover .vf-info-panel { opacity: 1; pointer-events: auto; }
.playall-anchor { transition: opacity 0.25s; }
.playall-anchor.is-hidden { opacity: 0; pointer-events: none; }
.wb-stage-frame-area:hover .playall-anchor.is-hidden { opacity: 1; pointer-events: auto; }
.vf-dl-track { width: 52px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.18); overflow: hidden; }
.vf-dl-track i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.3s; }

.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; }
/* url 字段：粘贴链接 + 本地上传 双入口 */
.tools-url-field { display: flex; gap: 8px; align-items: center; }
.tools-url-field .tools-arg-input { flex: 1; min-width: 0; }
.tools-url-field .btn { flex: none; }
.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); }
.modal.skill-detail-modal { width: 680px; max-width: calc(100vw - 40px); max-height: 82vh; overflow-y: auto; }
.sd-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.sd-section { margin-bottom: 14px; }
.sd-label { font-size: 12px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }
.sd-text { font-size: 13.5px; line-height: 1.6; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.sd-body {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-dim);
  background: var(--panel-2);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 12px 14px;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  max-height: 50vh;
  overflow-y: auto;
}
.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: transparent;
  border: none;
  border-radius: 7px;
  color: var(--muted);
  font-size: 13px;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.12s, background 0.12s;
}
.tb-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.tb-btn svg { color: inherit; }
.tb-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.tb-btn.accent { color: var(--accent); }
/* 菜单按钮的向下小箭头标识 */
.tb-caret { font-size: 10px; margin-left: 3px; opacity: 0.75; }
/* 保存按钮：有未保存改动时的强调态 */
.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-head-opts { display: flex; gap: 6px; flex: none; }
.ops-head-opts .csd { height: 26px; padding: 0 7px; gap: 3px; font-size: 12px; border-radius: 7px; }
/* 自定义下拉 */
.csd { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 6px; height: 32px; padding: 0 10px; background: var(--panel-2); border: 1px solid var(--border-light); border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--text); user-select: none; }
.csd:hover { border-color: var(--text-dim); }
.csd-val { font-family: ui-monospace, Consolas, monospace; }
.csd-arrow { font-size: 10px; color: var(--dim); flex: none; transition: transform 0.12s; }
.csd-menu { position: absolute; top: calc(100% + 4px); left: 0; right: 0; min-width: 100%; z-index: 30; background: var(--panel); border: 1px solid var(--border-light); border-radius: 8px; padding: 4px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); max-height: 200px; overflow-y: auto; }
.csd-opt { padding: 6px 10px; border-radius: 6px; font-size: 12.5px; color: var(--text-dim); cursor: pointer; white-space: nowrap; font-family: ui-monospace, Consolas, monospace; }
.csd-opt:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.csd-opt.on { color: var(--accent); background: rgba(200, 255, 46, 0.1); }
.csd-opt.dis { opacity: 0.35; cursor: not-allowed; }
/* 时长按钮菜单：弹出垂直拖拉条（fixed 悬浮，不受滚动容器裁剪） */
.csd-menu-slider { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 16px; min-width: 64px; }
.csd-fixed { position: fixed; top: auto; left: auto; right: auto; transform: none; z-index: 220; }
/* 提示词优化按钮的下拉（选模型） */
.csd-expand { position: relative; display: inline-flex; }
.csd-expand .csd-arrow { font-size: 10px; color: var(--dim); margin-left: 4px; }
.csd-menu-expand { min-width: 172px; }
.csd-slider-val { font-size: 12px; color: var(--accent); font-weight: 600; font-family: ui-monospace, Consolas, monospace; }
.dur-v-range { writing-mode: vertical-lr; direction: rtl; width: 22px; height: 110px; accent-color: var(--accent); cursor: pointer; }
.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-label .hint { font-weight: 400; font-size: 11px; }
/* FL2VA 首帧/尾帧本地上传（编辑器上方，正方形 cover） */
.flf-row-above { display: flex; gap: 24px; margin: 6px 0 12px; justify-content: center; align-items: flex-start; }
.flf-up { position: relative; width: 96px; height: 96px; flex: none; }
.flf-up-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%; height: 100%; font-size: 12px; color: var(--accent); border: 1.5px dashed rgba(200, 255, 46, 0.5); border-radius: 8px; cursor: pointer; background: var(--panel-2); transition: border-color 0.15s; }
.flf-up-btn:hover { border-color: var(--accent); }
.flf-up-btn.busy { opacity: 0.6; pointer-events: none; }
/* 首帧/尾帧：AI 重新生成小圆钮（左上角） */
.flf-regen {
  position: absolute; top: -5px; left: -5px; z-index: 2;
  width: 16px; height: 16px; border-radius: 50%; border: none;
  background: rgba(0, 0, 0, 0.5); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; transition: opacity 0.15s;
}
.flf-up:hover .flf-regen { opacity: 1; }
.flf-thumb { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; border: 1px solid var(--border-light); display: block; cursor: pointer; }
.flf-del { position: absolute; top: -5px; right: -5px; width: 16px; height: 16px; border-radius: 50%; border: none; background: rgba(0, 0, 0, 0.5); color: rgba(255, 255, 255, 0.65); font-size: 11px; line-height: 1; cursor: pointer; z-index: 2; opacity: 0; transition: opacity 0.15s; }
.flf-up:hover .flf-del { opacity: 1; }
.flf-del:hover { background: rgba(239, 68, 68, 0.85); color: #fff; }
/* 生成模式 tabs */
.mode-tabs { display: flex; gap: 4px; background: var(--panel-2); border: 1px solid var(--border-light); border-radius: 8px; padding: 3px; }
.mode-tab { flex: 1; padding: 6px 10px; font-size: 12.5px; color: var(--text-dim); background: transparent; border: none; border-radius: 6px; cursor: pointer; transition: background 0.12s, color 0.12s; }
.mode-tab:hover { color: var(--text); }
.mode-tab.on { background: var(--accent); color: #101204; font-weight: 600; }
.prompt-mode-tabs { margin: 4px 0 10px; }
.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(680px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
}
.rp-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  flex: none;
  background: rgba(255, 255, 255, 0.02);
}
.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: 1px solid rgba(200, 255, 46, 0.25);
  border-radius: 20px;
  padding: 2px 9px;
}
.rp-body {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at center, rgba(255, 255, 255, 0.03), transparent 70%),
    #050505;
  min-height: 140px;
  max-height: 62vh;
  overflow: hidden;
  padding: 10px;
}
.rp-body img { max-width: 100%; max-height: calc(62vh - 20px); display: block; object-fit: contain; border-radius: 8px; }
.rp-body video { max-width: 100%; max-height: calc(62vh - 20px); display: block; border-radius: 8px; }
/* 素材预览全屏（点击图片/底部「全屏」按钮）：铺满屏幕黑底 contain */
.rp-body img { cursor: zoom-in; }
.rp-body img:fullscreen { width: 100vw; height: 100vh; max-width: none; max-height: none; object-fit: contain; background: #000; border-radius: 0; }
.rp-body .vf-player:fullscreen { width: 100vw; height: 100vh; background: #000; display: flex; align-items: center; justify-content: center; }
.rp-body .vf-player:fullscreen > video { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; }
.rp-body video:fullscreen { width: 100vw; height: 100vh; max-width: none; max-height: none; object-fit: contain; background: #000; }
/* 素材描述区 */
.rp-desc {
  flex: none;
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 12.5px; color: var(--text-dim); line-height: 1.65;
  background: rgba(255, 255, 255, 0.015);
}
.rp-desc-label { flex: none; display: inline-flex; align-items: center; gap: 4px; color: var(--dim); font-size: 11.5px; font-weight: 600; padding-top: 1px; }
.rp-desc-text { flex: 1; min-width: 0; }
.rp-desc-loading { display: inline-flex; align-items: center; gap: 6px; color: var(--dim); }
.rp-desc-err { display: inline-flex; align-items: center; gap: 8px; color: var(--danger); }
.rp-desc-err .btn-xs { padding: 1px 8px; font-size: 11.5px; min-height: 22px; }
.rp-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-light);
  flex: none;
  background: rgba(255, 255, 255, 0.02);
}
.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; }
/* 确保 hover 互不影响：每个按钮独立命中区域，不重叠 */
.prompt-actions .tb-btn { position: relative; z-index: 1; pointer-events: auto; }
.prompt-actions .csd-expand { position: relative; z-index: 1; pointer-events: auto; }
.prompt-actions .csd-expand .tb-btn { pointer-events: auto; }
/* 关键：禁止 prompt-actions 整体 hover 传导到子按钮 */
.prompt-actions:hover .tb-btn:not(:hover):not(.tb-active) { background: transparent; color: var(--muted); }
/* 提示词标题栏：标题不压缩，右侧操作按钮组同行不换行；
   字数/@提示全端隐藏（编辑器占位符已含 @ 引导，标题栏空间让位给按钮组） */
.prompt-field > label { flex-wrap: nowrap; align-items: center; }
.prompt-field .hint { display: none; }
.prompt-label-text { flex: none; white-space: nowrap; }
.prompt-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; flex: none; font-weight: 400; }
.prompt-actions .tb-btn { padding: 3px 7px; font-size: 12px; white-space: nowrap; }
.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); } }
/* 工具栏内联 spinner（项目列表同步等） */
.tb-spin { width: 13px; height: 13px; margin-left: 2px; }
/* 缩略图加载态（v-thumb）：请求发起→onload 全程 spinner，失败降为半透明占位 */
img.thumb-loading { opacity: 0; }
img.thumb-error { opacity: 0.25; }
.thumb-host { position: relative; }
.thumb-spin-over {
  position: absolute; top: 50%; left: 50%;
  width: 14px; height: 14px; margin: -7px 0 0 -7px; z-index: 2;
}
/* 主按钮内嵌 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);
}
.hf-ref {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
}
.hf-dlg {
  color: #34d399;
  background: rgba(52, 211, 153, 0.12);
}
.hf-task {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.14);
}

/* 标签悬浮预览卡片 */
.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);
}
/* 提级到视图根节点的 @ 引用菜单（fixed 跟随光标，覆盖弹窗层 z-200） */
.mention-pop-fixed { position: fixed; z-index: 260; }
.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.mention-upload .type-badge { position: static; flex: none; color: var(--accent); background: var(--accent-dim); }
.mention-item.mention-upload .mi-name { color: var(--accent); font-weight: 600; }
.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; }
/* 引用选择菜单内：类型图标改为内联（不悬浮在文字上，覆盖 .type-badge 的绝对定位） */
.mention-item .type-badge {
  position: static;
  flex: none;
  pointer-events: none;
}
.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;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 18px;
  position: relative;
}
.wb-stage-frame-area { flex: 1 1 auto; min-height: 0; width: 100%; display: flex; align-items: center; justify-content: center; }
/* 已生成视频历史 */
.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 12px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--muted);
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.12s, background 0.12s;
}
.video-history-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.video-history-btn svg { color: inherit; }
/* 预览区「二次精修」（MINIMAX_H3_LIVE 已生成视频专属）：强调色区分于编辑/历史 */
.cb-refine-btn { color: #a78bfa; }
.cb-refine-btn:hover { color: #c4b5fd; background: rgba(167, 139, 250, 0.12); }
.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: none;
  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; }
/* 播放全部：播放器容器（预览舞台）底部中间，按钮下方承载起点选择菜单 */
.playall-anchor { position: relative; display: flex; justify-content: center; flex: none; margin-top: 8px; }
.playall-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 14px; border-radius: 16px;
  border: 1px solid var(--border-light);
  background: var(--panel-2); color: var(--text);
  font-size: 12.5px; cursor: pointer; white-space: nowrap;
  transition: border-color 0.15s, color 0.15s;
}
.playall-btn:hover { border-color: var(--accent); color: var(--accent); }
.playall-btn.on { border-color: var(--danger); color: #ff9d9d; }
/* 起点菜单：向上弹出（.clip-menu 的 fixed 后定义会覆盖，这里用更高优先级锚定在按钮上方） */
.playall-anchor .playall-menu {
  position: absolute !important;
  top: auto !important;
  bottom: calc(100% + 6px);
  left: 50% !important;
  right: auto !important;
  transform: translateX(-50%);
  z-index: 231;
}
/* 重新生成中：底层旧视频首帧 + 半透明进度遮罩 */
.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-num { display: none; }
.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;
}

/* 隐藏文件输入：视觉隐藏而非 display:none——iOS 等移动端对 display:none 输入框的程序化 .click()
   存在文件选择器不弹 / change 不触发的问题；保持元素渲染（移出视口 + 透明）最稳妥 */
.vh-file { position: fixed; left: -9999px; top: 0; width: 1px; height: 1px; opacity: 0; overflow: hidden; }

/* ---- 用户中心（全屏：左侧导航 + 右侧工作区） ---- */
.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;
  position: relative;
}
.ap-nav button:hover { color: var(--text); background: var(--panel-2); }
.ap-nav button.active { color: var(--accent); background: linear-gradient(90deg, var(--accent-dim), transparent 85%); font-weight: 600; }
.ap-nav button.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(200, 255, 46, 0.5);
}
.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;
  background: linear-gradient(135deg, #c8ff46, #7ed957);
  color: #10230a;
  font-weight: 700;
  box-shadow: 0 0 0 1px rgba(200, 255, 46, 0.3), 0 4px 12px rgba(200, 255, 46, 0.18);
}
.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: 18px 30px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 70%), 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%; }
/* 私有化训练页：解除定高内滚（表单区域不出现内部滚动条，统一随页面滚动）；侧栏吸附导航下方保持可见 */
.fp.fp-flow { height: auto; min-height: calc(100vh - 65px); overflow: visible; }
.fp-flow .ap { overflow: visible; }
.fp-flow .ap-side { position: sticky; top: 65px; align-self: flex-start; max-height: calc(100vh - 65px); overflow-y: auto; }
.fp-flow .ap-content { overflow: visible; }

.acct-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 18px;
}
.acct-span { grid-column: 1 / -1; }

/* ---- 用户中心专业化视觉升级（作用域 .acct-body，不影响其它页面） ---- */
.acct-body .panel {
  border-radius: 14px;
  padding: 24px;
  border-color: var(--border-light);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 8px 28px rgba(0, 0, 0, 0.18);
}
.acct-body .panel-title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 18px;
}
.acct-body .panel-title svg { color: var(--accent); opacity: 0.9; }
.panel-title-note {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--dim);
  background: var(--panel-2);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 2px 9px;
}
.acct-inline-form { max-width: none; margin: 0; }

/* 资料页：头像 + 元信息 */
.acct-profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(200, 255, 46, 0.05), transparent 55%), var(--panel-2);
}
.acct-avatar-lg {
  width: 56px;
  height: 56px;
  font-size: 22px;
  font-weight: 700;
  flex: none;
  background: linear-gradient(135deg, #c8ff46, #7ed957);
  color: #10230a;
  box-shadow: 0 0 0 1px rgba(200, 255, 46, 0.35), 0 6px 18px rgba(200, 255, 46, 0.22);
}
.acct-profile-meta { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.acct-profile-name { font-size: 17px; font-weight: 700; color: var(--text); }
.acct-profile-mail { font-size: 12.5px; color: var(--muted); word-break: break-all; }

.info-rows { border: 1px solid var(--border-light); border-radius: 10px; overflow: hidden; background: rgba(0, 0, 0, 0.14); }
.info-row { padding: 10px 15px; font-size: 13px; }
.info-row span { letter-spacing: 0.04em; }
.info-row b { font-weight: 600; font-variant-numeric: tabular-nums; }

/* 安全卡：图标 + 文案 + 操作 */
.sec-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; }
.sec-row + .sec-row { border-top: 1px solid var(--border); }
.sec-main { display: flex; align-items: center; gap: 13px; min-width: 0; }
.sec-ico {
  width: 36px; height: 36px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(200, 255, 46, 0.22);
}
.sec-name { font-size: 13.5px; font-weight: 600; color: var(--text); }
.sec-desc { font-size: 12px; color: var(--dim); margin-top: 2px; line-height: 1.5; }

/* 数据表格（交易记录等）：列宽自适应内容，说明列占满剩余宽度 */
.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; }

/* 余额卡：hero 式——光晕 + 网格纹理 + 大数字 */
.balance-panel { position: relative; overflow: hidden; }
.balance-panel::before {
  content: "";
  position: absolute;
  top: -70px;
  right: -70px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(200, 255, 46, 0.16), transparent 70%);
  pointer-events: none;
}
.balance-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(circle at 100% 0%, #000 0%, transparent 62%);
  mask-image: radial-gradient(circle at 100% 0%, #000 0%, transparent 62%);
  pointer-events: none;
}
.balance-panel > * { position: relative; }
.balance-num {
  display: flex;
  align-items: baseline;
  font-size: 40px;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  text-shadow: 0 0 26px rgba(200, 255, 46, 0.3);
}
.balance-cny { font-size: 22px; margin-right: 5px; opacity: 0.85; }
.balance-sub { color: var(--dim); font-size: 12.5px; margin-bottom: 16px; }
.balance-actions { display: flex; gap: 8px; }

/* 快捷充值金额：大卡选择 */
.amt-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-bottom: 10px; }
.amt-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 10px 4px 8px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}
.amt-chip b { font-size: 15px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.amt-chip span { font-size: 10.5px; color: var(--dim); }
.amt-chip:hover { border-color: var(--muted); transform: translateY(-1px); }
.amt-chip.active {
  border-color: rgba(200, 255, 46, 0.55);
  background: var(--accent-dim);
  box-shadow: 0 0 0 1px rgba(200, 255, 46, 0.25), 0 6px 16px rgba(200, 255, 46, 0.1);
}
.amt-chip.active b { color: var(--accent); }
.amt-custom { margin-top: 2px; }

/* 交易统计条 */
.tx-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.tx-stat {
  padding: 13px 16px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 60%), var(--panel-2);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tx-stat span { font-size: 11.5px; color: var(--dim); letter-spacing: 0.05em; }
.tx-stat b { font-size: 17px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.tx-stat b.pos { color: var(--accent); }

/* 新建 Key 结果卡 */
.key-result {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  max-width: 640px;
  margin: 14px 0 16px;
  padding: 14px 16px;
  border: 1px dashed rgba(200, 255, 46, 0.45);
  border-radius: 10px;
  background: var(--accent-dim);
}
.key-result-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--accent); font-weight: 600; }
.key-result-row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.key-result-row code {
  flex: 1;
  min-width: 0;
  font-family: Consolas, monospace;
  font-size: 13px;
  color: var(--text);
  word-break: break-all;
  padding: 8px 11px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-light);
  border-radius: 8px;
}

/* 开票类型：分段选择器 */
.seg {
  display: flex;
  padding: 3px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--panel-2);
  width: fit-content;
}
.seg button {
  border: none;
  background: none;
  padding: 7px 22px;
  font-size: 13px;
  color: var(--muted);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.seg button.on {
  background: var(--accent);
  color: #10230a;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(200, 255, 46, 0.22);
}

.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 > div { min-width: 0; }
.agent-head .a-sub { font-size: 11.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent-new { margin-left: auto; }
/* 智能体标题栏操作按钮：图标+简洁文字标签 */
/* 智能体标题栏按钮：与工具栏一致（扁平化、浅灰、hover 变亮） */
.agent-act {
  width: auto; height: 28px; padding: 0 10px; gap: 5px;
  font-size: 12px; white-space: nowrap;
  border: none !important; background: transparent !important;
  color: var(--muted) !important; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; transition: color 0.12s, background 0.12s;
}
.agent-act:hover {
  color: var(--text) !important;
  background: rgba(255, 255, 255, 0.06) !important;
  border: none !important;
}
.agent-act svg { color: inherit; }
.agent-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;  /* 长 URL 等不可断行内容造成的横向溢出直接裁切（配合 .msg 的 overflow-wrap 断行） */
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
/* 历史对话恢复中的加载提示 */
.chat-loading { display: flex; align-items: center; gap: 8px; color: var(--dim); font-size: 12.5px; padding: 4px 2px; }
/* 实时思考过程：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%; min-width: 0; padding: 9px 13px; border-radius: 10px; font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; -webkit-user-select: text; }
.msg ::selection { background: rgba(255, 255, 255, 0.35); }
.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;
}
/* 前置登录信息获取遮罩：登录态校验完成前工作区不可操作（任务不启动） */
.boot-login-mask {
  position: fixed; z-index: 520;
  /* 只覆盖工作区内容区：top = 站点导航栏下沿（64px），全站主菜单保持可见可点 */
  top: 64px; left: 0; right: 0; bottom: 0;
  /* 纯色加载屏：站点底色为纯黑，半透明黑盖上去等同纯黑（用户感知为「黑屏」）；用面板色 + 纵向布局明确传达「加载中」 */
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  color: var(--muted); font-size: 14px;
}
.boot-login-mask .spinner { width: 30px; height: 30px; border-width: 3px; }

/* 快捷技能：上传按钮右侧 / 按钮 + 弹出菜单 */
.agent-quick-anchor { position: relative; flex: none; display: flex; }
/* 消息内嵌快捷技能列表（欢迎语/新对话提示） */
.agent-msg-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.amq-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 14px; font-size: 12px;
  border: 1px solid var(--border-light); background: var(--panel-2); color: var(--text-dim);
  cursor: pointer; transition: color .15s, border-color .15s, background .15s;
}
.amq-chip:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }
.aq-slash {
  font-size: 15px; font-weight: 700; line-height: 1;
  font-family: ui-monospace, Consolas, monospace;
}
.agent-attach.on { color: var(--accent); border-color: var(--accent); }
.agent-quick-menu {
  position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 30;
  min-width: 300px; max-width: min(420px, 70vw);
  background: var(--panel-2); border: 1px solid var(--border-light); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); padding: 4px; overflow: hidden;
}
.agent-quick-menu .am-header { font-size: 11px; color: var(--dim); cursor: default; }
.agent-quick-menu .am-header:hover { background: none; }
.agent-quick-menu .aq-item { cursor: pointer; }
.agent-quick-menu .aq-item:hover { background: rgba(255, 255, 255, 0.06); }
.agent-quick-menu .aq-item .mi-idx {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px;
}

.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; }
/* 素材入库弹窗：z-index 必须高于一键剧本等 modal-overlay(200)，否则在一键剧本内点「导入素材」时被压在弹窗下 */
.modal-overlay.rn-overlay { z-index: 300; }

/* 自定义对话框（替代原生 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; }

/* 创建 Serverless 端点：简化窗口 */
.modal.pe-create {
  width: 560px;
  max-width: calc(100vw - 40px);
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.modal.pe-create h3 { flex: none; }
.pe-create-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.modal.pe-create .modal-actions { flex: none; margin-top: 16px; }
/* 确认弹窗内勾选项（销毁端点时同步删卷等） */
.confirm-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); margin: -6px 0 14px; cursor: pointer; user-select: none; }
.confirm-check input { accent-color: var(--accent); width: 15px; height: 15px; flex: none; cursor: pointer; }
/* 服务端点标题栏：GPU 全局库存徽章 */
.gpu-stock-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0 4px; }
.gpu-stock { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border-light); color: var(--muted); white-space: nowrap; cursor: default; }
.gpu-stock.st-high { color: #3fb950; border-color: rgba(63, 185, 80, 0.5); }
.gpu-stock.st-mid { color: #ffb020; border-color: rgba(255, 176, 32, 0.5); }
.gpu-stock.st-low { color: #ff7b2d; border-color: rgba(255, 123, 45, 0.5); }
.gpu-stock.st-none { color: var(--danger); border-color: rgba(255, 77, 77, 0.5); }
/* GPU 库存首载骨架屏（微光扫过动效，尺寸对齐真实徽章） */
.gpu-stock.sk { width: 88px; height: 23px; border: none; cursor: default;
  background: linear-gradient(100deg, var(--bg-card, #1c2333) 40%, #2a3346 50%, var(--bg-card, #1c2333) 60%);
  background-size: 200% 100%; animation: gpu-sk-shimmer 1.2s linear infinite; }
@keyframes gpu-sk-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .gpu-stock.sk { animation: none; } }
/* 创建端点：高级选项折叠区 */
.adv-toggle { display: inline-block; font-size: 13px; color: var(--accent); cursor: pointer; user-select: none; }
.adv-toggle:hover { text-decoration: underline; }
/* 私有化训练（用户友好） */
.train-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border-light); }
.train-tabs button { background: none; border: none; padding: 10px 16px; font-size: 14px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; display: flex; align-items: center; gap: 6px; transition: color 0.12s; }
.train-tabs button.on { color: var(--text); font-weight: 600; border-bottom-color: var(--accent); }
.train-tab-count { background: var(--accent-dim); color: var(--accent); font-size: 11px; padding: 1px 7px; border-radius: 999px; }
.train-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.train-mode { border: 1px solid var(--border-light); border-radius: 12px; padding: 16px; cursor: pointer; display: flex; flex-direction: column; gap: 6px; transition: all 0.15s; }
.train-mode:hover { border-color: var(--accent); }
.train-mode.on { border-color: var(--accent); background: var(--accent-dim); }
.train-mode-name { font-weight: 700; font-size: 14px; color: var(--text); }
.train-mode-desc { font-size: 12px; color: var(--muted); }
.train-drop { border: 1.5px dashed var(--border); border-radius: 12px; padding: 28px; text-align: center; cursor: pointer; color: var(--muted); display: flex; flex-direction: column; gap: 6px; align-items: center; transition: all 0.15s; }
.train-drop:hover { border-color: var(--accent); color: var(--text); }
.train-files-table { margin-top: 10px; border: 1px solid var(--border-light); border-radius: 10px; overflow: hidden; }
.tft-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border-light); }
.tft-row:last-child { border-bottom: none; }
.tft-head { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--panel-2); }
.tft-thumb { flex: none; width: 46px; font-size: 12px; color: var(--muted); }
.tft-thumb img, .tft-thumb video { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; display: block; background: #000; }
.tft-name { flex: 0 0 140px; min-width: 0; font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tft-angle { flex: 0 0 100px; }
.tft-angle .input { font-size: 12.5px; padding: 6px 8px; }
.tft-caption { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; }
.tft-caption .input { font-size: 12.5px; padding: 6px 8px; flex: 1; min-width: 0; }
.tft-ai-btn { flex: none; width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border-light); background: var(--panel-2); color: var(--accent); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.tft-ai-btn:disabled { opacity: 0.5; cursor: default; }
.tft-ai-btn:hover:not(:disabled) { border-color: var(--accent); }
/* AI 描述生成中：输入框呼吸光晕（主题色脉冲），配合按钮 spinner 的动态效果 */
.tft-caption input.ai-working {
  border-color: var(--accent);
  animation: ai-working-pulse 1.2s ease-in-out infinite;
}
@keyframes ai-working-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200, 255, 46, 0); }
  50% { box-shadow: 0 0 0 3px rgba(200, 255, 46, 0.2); }
}
/* 训练准备任务卡片：上传素材/创建端点/提交训练全阶段实时展示（训练进度页顶部） */
.train-prep-card {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 12px; padding: 12px 14px;
  border: 1px solid var(--border-light); border-radius: 10px;
  background: var(--panel-2); font-size: 13px;
}
.train-prep-card.err { border-color: var(--danger); }
.train-prep-err { color: var(--danger); font-weight: 600; }
/* 训练算力：平台共享训练池说明框 */
.train-pool-box {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border: 1px solid var(--border-light);
  border-radius: 10px; background: var(--panel-2); color: var(--accent);
}
.train-toolbar { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.train-toolbar-label { font-size: 12.5px; color: var(--muted); flex: none; }
.tft-del { flex: none; width: 22px; }
.tft-del-btn { width: 22px; height: 22px; border-radius: 50%; border: none; background: rgba(0, 0, 0, 0.25); color: #fff; font-size: 13px; line-height: 1; cursor: pointer; }
.tft-del-btn:hover { background: var(--danger); }
/* LoRA 挂载选择（私有化端点生成时） */
.lora-row { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 8px; border: 1px solid var(--border-light); border-radius: 8px; background: var(--panel-2); color: var(--muted); }
.lora-sel { flex: 1; min-width: 0; font-size: 12.5px; padding: 4px 6px; }
.lora-str { width: 70px; flex: none; font-size: 12.5px; padding: 4px 6px; }
.lora-row .tb-btn { flex: none; }
@media (max-width: 760px) { .tft-name { flex-basis: 90px; } .tft-angle { flex-basis: 80px; } }
.train-jobs { display: flex; flex-direction: column; gap: 10px; }
.train-job { border: 1px solid var(--border-light); border-radius: 10px; padding: 12px 14px; }
.train-job-head { display: flex; justify-content: space-between; align-items: center; }
.train-job-name { font-weight: 600; }
.train-job-bar { display: flex; align-items: center; margin-top: 8px; }
.train-job-bar .progress-bar { flex: 1; }
.train-loras { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.train-lora { border: 1px solid var(--border-light); border-radius: 10px; padding: 12px 14px; }
.train-lora-name { font-weight: 600; word-break: break-all; }
.train-guide-sec { font-size: 13px; line-height: 1.6; padding: 10px 0; border-bottom: 1px solid var(--border-light); }
.train-guide-sec:last-child { border-bottom: none; }
.train-guide-h { font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.train-guide-row { color: var(--muted); }
/* 右侧抽屉（训练物料说明等） */
.drawer-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 260; display: flex; justify-content: flex-end; }
.drawer { width: min(520px, 92vw); height: 100%; background: var(--panel); border-left: 1px solid var(--border-light); display: flex; flex-direction: column; animation: drawer-in 0.22s ease; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border-light); flex: none; }
.drawer-title { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 4px 18px 18px; }
@keyframes drawer-in { from { transform: translateX(100%); } to { transform: translateX(0); } }
/* 物料规格实例图网格 */
.mat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin: 14px 0; }
.mat-grid-2 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.mat-fig { margin: 0; border: 1px solid var(--border-light); border-radius: 10px; overflow: hidden; background: var(--panel-2); }
.mat-fig img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.mat-fig figcaption { padding: 6px 8px; font-size: 12.5px; color: var(--muted); text-align: center; }
@media (max-width: 760px) { .train-modes { grid-template-columns: 1fr; } }
.adv-body { margin-top: 10px; padding: 14px 14px 2px; border: 1px solid var(--border-light); border-radius: 10px; background: var(--panel-2); }
.adv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; }
@media (max-width: 560px) { .adv-grid { grid-template-columns: 1fr; } }
/* 端点列表 worker 等待/初始化动态效果（省略号依次闪烁） */
.wr-pending { color: var(--muted); }
.wr-dots { display: inline-flex; gap: 2px; margin-left: 2px; }
.wr-dots i { font-style: normal; font-weight: 700; color: var(--accent); animation: wr-blink 1.2s infinite; }
.wr-dots i:nth-child(2) { animation-delay: 0.2s; }
.wr-dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes wr-blink { 0%, 60%, 100% { opacity: 0.15; } 30% { opacity: 1; } }
/* 数据中心 chip 内「支持网络存储卷」标记 */
.dc-vol { font-size: 10px; color: var(--accent); margin-left: 4px; font-weight: 700; }
/* 素材库分类过滤（通用/场景/角色/道具） */
.oa-cats { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.oa-cat { font-size: 11.5px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border-light); background: none; color: var(--muted); cursor: pointer; white-space: nowrap; }
.oa-cat:hover { color: var(--text); }
.oa-cat.on { background: var(--accent); border-color: var(--accent); color: #000; font-weight: 600; }
.masset-cats { border-bottom: 1px solid var(--border); }
.rn-cat { margin-top: 6px; font-size: 12.5px; padding: 6px 8px; }
/* 一键剧本弹窗：16:10 横板（左输入 / 右流水线步骤） */
.sg-model-tags { display: inline-flex; gap: 6px; margin-left: 12px; vertical-align: 2px; flex-wrap: wrap; }
.sg-model-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 500; color: var(--muted); border: 1px solid var(--border-light); border-radius: 999px; padding: 2px 9px; white-space: nowrap; }
.sg-model-tag svg { opacity: .7; }
/* 批处理余额不足等待弹窗 */
.bw-actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.bw-actions a { text-decoration: none; }
.bw-poll { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.sg-modal { width: min(1120px, calc(100vw - 40px)); max-height: 88vh; display: flex; flex-direction: column; }
.sg-body { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 18px; min-height: 0; }
.sg-left { display: flex; flex-direction: column; min-width: 0; }
.sg-left > label { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; display: block; }
.sg-textarea { flex: 1; min-height: 300px; resize: vertical; line-height: 1.6; font-size: 13px; }
.sg-upload { align-self: flex-start; margin-top: 10px; }
.sg-upload.disabled { opacity: 0.5; pointer-events: none; }
/* 一键剧本：导入素材区（窗口顶部） */
.sg-mats { margin-bottom: 12px; }
.sg-mats-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; max-height: 148px; overflow-y: auto; }
.sg-mat { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 76px; padding: 6px 4px 5px; border: 1px solid var(--border-light); border-radius: 8px; background: var(--panel-2); }
.sg-mat img, .sg-mat video { width: 100%; height: 44px; object-fit: cover; border-radius: 5px; background: #000; }
.sg-mat-audio { width: 100%; height: 44px; display: flex; align-items: center; justify-content: center; color: var(--muted); background: #000; border-radius: 5px; }
.sg-mat-name { font-size: 11px; color: var(--text-dim); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-mat-del { position: absolute; top: 2px; right: 2px; width: 16px; height: 16px; border-radius: 50%; border: none; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; line-height: 16px; text-align: center; cursor: pointer; padding: 0; }
.sg-mat-del:hover { background: var(--danger); }
.sg-right { display: flex; flex-direction: column; min-width: 0; }
.sg-step { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border-light); border-radius: 10px; margin-bottom: 8px; cursor: pointer; transition: all 0.12s; user-select: none; }
.sg-step:hover { border-color: var(--muted); }
.sg-step.on { border-color: var(--accent); background: var(--accent-dim); }
.sg-step.on .sg-step-num { background: var(--accent); color: #000; }
.sg-step-num { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--border-light); color: var(--muted); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.sg-step-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sg-step-main b { font-size: 13px; font-weight: 600; }
.sg-step-sub { font-size: 11.5px; color: var(--dim); margin-top: 1px; }
.sg-step input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; flex: none; }
@media (max-width: 700px) { .sg-body { grid-template-columns: 1fr; } .sg-textarea { min-height: 180px; } }
/* 一键剧本执行进度：总进度条 + 段内 i/n + 当前片段 */
.sg-progress { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--border-light); border-radius: 10px; background: var(--panel-2); }
.sg-prog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sg-prog-stage { display: inline-flex; align-items: center; font-size: 12.5px; color: var(--text); font-weight: 600; }
.sg-prog-pct { font-size: 12.5px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.sg-prog-bar { height: 8px; border-radius: 999px; background: var(--border-light); overflow: hidden; }
.sg-prog-bar i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width 0.4s ease; }
.sg-prog-bar.indet i { width: 30% !important; animation: sg-indet 1.2s ease-in-out infinite; }
@keyframes sg-indet { 0% { margin-left: -32%; } 100% { margin-left: 102%; } }
.sg-prog-detail { display: flex; align-items: center; gap: 10px; margin-top: 7px; font-size: 11.5px; color: var(--muted); flex-wrap: wrap; }
.sg-prog-clip { color: var(--text); max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-prog-stepmark { margin-left: auto; color: var(--dim); font-variant-numeric: tabular-nums; }
/* 创建窗口 GPU 型号下拉槽位 */
.gpu-slots { display: flex; flex-direction: column; gap: 8px; }
.gpu-slot { display: flex; align-items: center; gap: 10px; }
.gpu-slot-label { flex: none; width: 52px; font-size: 12px; color: var(--dim); }
.gpu-slot .input { flex: 1; }
/* 私有化部署控制台：加载中 */
.pe-loading { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.pe-loading .spinner { width: 13px; height: 13px; flex: 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(1100px, calc(100vw - 40px));
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.ps-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}
.ps-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
@media (max-width: 760px) {
  .ps-cols { grid-template-columns: 1fr; gap: 16px; }
}

/* 批量处理确认弹窗 */
.batch-modal { width: min(780px, calc(100vw - 40px)); }
/* 横屏布局：选项区双列排布（生成模式 | 处理范围 / 素材策略 | 并发数量），摘要与操作整行 */
.batch-body { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 30px; padding: 4px 0; align-items: start; }
.batch-radio {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text); cursor: pointer; margin-top: 8px;
}
.batch-summary {
  grid-column: 1 / -1;
  font-size: 12.5px; color: var(--dim);
  border-top: 1px solid var(--border); padding-top: 12px;
}
.batch-summary b { color: var(--accent); }
@media (max-width: 640px) {
  .batch-body { grid-template-columns: 1fr; }
}

/* 导出弹窗 */
.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); cursor: pointer; }
.ent-linked:hover { filter: brightness(1.2); }
.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(1060px, calc(100vw - 48px)); }
.imggen-modal .ig-type-hint { margin-top: 4px; font-size: 11px; color: var(--dim); line-height: 1.5; }
.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; }
}

/* ================= 移动端适配（Mobile RWD） ================= */
/* 基础组件（桌面隐藏，媒体查询内启用） */
.nav-burger {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-drawer { display: none; }
/* 抽屉专用遮罩（z-index 需高于页面内容与导航，低于抽屉本体 190） */
.drawer-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 150; }
.chat-fab { display: none; }
.agent-head .chat-close { display: none; }

/* ---- 平板（≤1100px）：收窄固定栏（压内联宽度） ---- */
@media (max-width: 1100px) {
  .wb-right { width: 300px !important; }
  .wb-ops { width: 300px !important; }
}

/* ---- 手机（≤768px）：纵排 + 抽屉化 ---- */
@media (max-width: 768px) {
  /* 杜绝离屏抽屉/浮动元素撑出幻影横向滚动区（clip 不建滚动容器，兼容回退 hidden） */
  html, body { overflow-x: hidden; overflow-x: clip; }

  /* 素材库：右侧全高滑出抽屉 */
  .masset-panel {
    position: fixed !important;
    left: auto !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: min(320px, 85vw) !important;
    max-width: 85vw !important;
    min-width: 0 !important;
    height: 100dvh !important;
    border-radius: 0 !important;
    border-left: 1px solid var(--border-light);
    animation: masset-slide-in 0.22s ease-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  /* 标题栏：flex 布局，float 无效 → 用 margin-left:auto 推右侧按钮组 */
  .masset-panel .clip-menu-title,
  .mclip-panel .clip-menu-title {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .masset-panel .masset-add {
    float: none !important;
    margin-left: auto;
    display: flex;
    gap: 6px;
    flex-shrink: 0;
  }
  .masset-panel .panel-close,
  .mclip-panel .panel-close {
    float: none !important;
    flex-shrink: 0;
  }
  /* 网格：3 列大缩略图（适配抽屉宽度，非弹窗 4 列小图） */
  .masset-panel .masset-grid {
    max-height: none !important;
    min-width: 0 !important;
    overflow-y: auto;
    padding: 10px;
    gap: 8px;
    grid-template-columns: repeat(3, 1fr) !important;
    -webkit-overflow-scrolling: touch;
  }
  .masset-panel .flf-lib-item img {
    max-width: none !important;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
  }
  .masset-panel .flf-lib-item span { font-size: 11px; }

  /* 片段列表：同样右侧全高抽屉（与素材库一致） */
  .mclip-panel {
    position: fixed !important;
    left: auto !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: min(300px, 82vw) !important;
    max-width: 82vw !important;
    min-width: 0 !important;
    height: 100dvh !important;
    border-radius: 0 !important;
    border-left: 1px solid var(--border-light);
    animation: masset-slide-in 0.22s ease-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .mclip-panel .mclip-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  @keyframes masset-slide-in {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
  }

  /* 全屏壳高度适配 iOS 动态视口；移动端改为页面流式布局（时间线随页面滚动访问） */
  .fp { height: auto; min-height: calc(100vh - 65px); min-height: calc(100dvh - 65px); overflow: visible; }

  /* 统一页面边距：.hero/.section/.dp-hero/.docs2 的 padding 简写会把 .container 的左右内边距清零，移动端补回 */
  .hero.container, .section.container, .dp-hero.container, .docs2.container {
    padding-left: 16px;
    padding-right: 16px;
  }

  /* 导航：隐藏横排链接，启用汉堡抽屉 */
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  .nav-drawer {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 65px;
    right: 0;
    bottom: 0;
    width: min(280px, 84vw);
    background: var(--panel);
    border-left: 1px solid var(--border-light);
    padding: 12px;
    gap: 4px;
    z-index: 190;
    transform: translateX(100%);
    transition: transform 0.25s ease;
  }
  .nav-drawer.open { transform: none; }
  .nav-drawer a {
    display: block;
    padding: 12px 14px;
    border-radius: 8px;
    color: var(--text);
    font-size: 15px;
    text-decoration: none;
  }
  .nav-drawer a.active { background: var(--accent-dim); color: var(--accent); }

  /* 工作台：三栏 → 纵排 */
  .wb { flex-direction: column; overflow: visible; }
  .wb-left { width: 100%; min-height: 0; }
  .wb-toolbar { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .rz { display: none; }

  /* 预览区：展平容器，纵排顺序 = 工具栏 → 预览画面 → 素材栏 → 片段列表 → 操作面板 */
  .wb-preview, .wb-preview-main { display: contents; }
  .wb-preview-main > div:last-child {
    order: 1;
    flex: none;
    height: auto;
    aspect-ratio: 16 / 9;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
  }
  .wb-ops {
    order: 4;
    width: 100% !important;
    flex: none;
    /* 首屏正好容纳：导航65 + 工具栏45 + 预览(56.25vw=16:9)（素材栏/片段条已收纳为标题入口） */
    height: calc(100vh - 110px - 56.25vw);
    height: calc(100dvh - 110px - 56.25vw);
    max-height: none;
    border-right: none;
  }
  /* 面板内部滚动，禁止 flex 子项压缩（否则提示词编辑器等被压塌重叠） */
  .wb-ops .ops-main > * { flex: none; }
  /* 提示词编辑器独占弹性空间、内容内部滚动；下方优化/参数/生成按钮固定可见 */
  .wb-ops .ops-main { height: 100%; overflow: visible; padding: 6px 10px; gap: 4px; }
  .wb-ops .ops-main > .field-grow { flex: 1 1 auto; min-height: 78px; }
  .wb-ops .prompt-editor { min-height: 40px; }
  /* 面板行压缩：压缩模式 tab 高度 */
  .wb-ops .mode-tab { min-height: 34px; }
  .wb-ops .csd { height: 30px; }
  .wb-ops .btn-block { min-height: 36px; padding-top: 6px; padding-bottom: 6px; }
  .wb-ops .prompt-actions .tb-btn { min-height: 28px; }
  .wb-ops .prompt-mode-tabs { margin: 0; }
  .wb-ops .ops-head { min-height: 24px; }
  .wb-ops .ops-head-opts .csd { height: 28px; }
  .wb-ops .prompt-field > label { min-height: 30px; font-size: 12.5px; }
  /* 工具栏紧凑化 */
  .wb-toolbar { padding: 6px 10px; gap: 8px; }
  .wb-toolbar .tb-btn { min-height: 32px; padding: 4px 10px; }
  /* 文件菜单：工具栏横向滚动容器会裁剪 absolute 下拉，移动端改 fixed 固定到工具栏下方 */
  .tb-menu-wrap .file-menu {
    position: fixed;
    top: 110px;
    left: 10px;
    right: 10px;
    min-width: 0;
    max-height: 60vh;
    overflow-y: auto;
    z-index: 300;
  }
  /* 移动端无 hover 且菜单全宽：级联子菜单改为内联缩进展开（点按父项展开） */
  .tb-menu-wrap .file-menu .fm-flyout {
    position: static;
    max-height: none;
    margin: 2px 0 4px 26px;
    box-shadow: none;
  }

  /* 素材面板：收起态为顶部横栏（预览画面下方），展开态为全高抽屉 */
  .ops-assets {
    order: 2;
    width: 100% !important;
    flex: none;
    height: 46px;
    flex-direction: row;
    align-items: center;
    padding: 0 8px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .ops-assets .oa-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 0 2px; }
  .ops-assets.open {
    position: fixed;
    left: 0;
    top: 65px;
    bottom: 0;
    height: auto;
    width: min(340px, 88vw) !important;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    z-index: 190;
    border-right: 1px solid var(--border-light);
    box-shadow: 12px 0 36px rgba(0, 0, 0, 0.45);
  }
  .ops-assets.open .oa-list { flex-direction: column; overflow-y: auto; overflow-x: hidden; }

  /* 智能体聊天：右侧固定栏 → 抽屉 */
  .wb-right {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(360px, 92vw) !important;
    z-index: 190;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    box-shadow: -12px 0 36px rgba(0, 0, 0, 0.45);
  }
  .wb-right.chat-open { transform: none; }
  .agent-head .chat-close { display: flex; }
  .chat-fab {
    display: flex;
    position: fixed;
    right: 14px;
    bottom: 14px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #101204;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 180;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  }
  /* 时间线：移动端隐藏横条，入口改到片段标题下拉面板（点标题展开悬浮列表） */
  .wb-timeline { display: none; }
  /* 素材栏：移动端隐藏顶部横栏，入口改到片段标题栏素材图标（悬浮面板） */
  .ops-assets { display: none; }
  /* 片段标题下拉箭头 / 素材库入口按钮（图标+文字） */
  .ops-title-arrow { display: inline; }
  .ops-assets-btn {
    display: inline-flex; align-items: center; gap: 5px;
    height: 24px; padding: 0 10px; flex: none;
    border: 1px solid var(--border-light); border-radius: 12px;
    background: var(--panel-2); color: var(--text-dim); cursor: pointer;
    font-size: 12px;
  }
  .ops-assets-btn:hover { color: var(--accent); border-color: var(--accent); }
  .ops-assets-label { white-space: nowrap; }
  /* 播放全部：移动端悬浮于视频预览区底部中间（抬高避开原生控制条） */
  .playall-anchor {
    position: absolute; bottom: 46px; left: 50%; transform: translateX(-50%);
    z-index: 9; margin-top: 0;
  }
  .playall-btn { background: rgba(10, 10, 10, 0.62); color: #eee; border-color: rgba(255, 255, 255, 0.22); backdrop-filter: blur(6px); }
  .playall-anchor .playall-menu { bottom: calc(100% + 8px); }
  .wb-track {
    flex-wrap: nowrap;
    width: 100%;
    padding: 8px 10px;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .clip-item, .add-card { width: 96px; }
  .clip-card { width: 100%; }
  .clip-item { gap: 4px; }
  /* 行内插入按钮在窄条下遮挡相邻卡片，移动端隐藏（可从末尾添加卡片新建） */
  .clip-insert { display: none; }
  .add-card { min-height: 0; }
  /* 片段卡片：移动端隐藏文字标签（状态徽章/片段名），改为左上角序号小圆点；失败态保留徽章 */
  .clip-card .badge-pos { display: none; }
  .clip-card .badge-pos.status-error { display: inline-block; }
  .clip-card .clip-name-tag { display: none; }
  /* 触屏点按会粘滞 hover 导致替换按钮常显，移动端彻底隐藏（操作走悬浮菜单） */
  .clip-card .clip-replace { display: none; }
  .clip-num {
    display: flex;
    position: absolute; top: 5px; left: 5px; z-index: 2;
    width: 18px; height: 18px; border-radius: 50%;
    background: rgba(0, 0, 0, 0.65); color: #fff;
    font-size: 10.5px; font-weight: 600;
    align-items: center; justify-content: center;
    pointer-events: none;
  }
  .clip-card.selected .clip-num { background: var(--accent); color: #101204; }

  /* 模态框：近全宽 + 内部滚动；视频历史全屏化 */
  .modal {
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    overflow-y: auto;
  }
  .modal.video-history-modal {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    padding: 16px;
  }

  /* 浮动面板（时长滑块/优化选模型）：触发按钮已在标题栏/提示词栏顶部，
     不再钉到页面底部，用内联定位（按钮正下方、水平收拢进视口） */
  .csd-fixed { max-width: calc(100vw - 16px); }
  .sel-menu { max-width: calc(100vw - 16px); overflow-x: auto; }
  .sel-picker { width: min(264px, calc(100vw - 16px)); }
  .mention-pop { width: min(244px, calc(100vw - 24px)); }
  .am-sub { max-width: calc(100vw - 16px) !important; }

  /* 触摸友好：点击区域与防 iOS 聚焦缩放 */
  .tb-btn, .mode-tab, .chip, .btn { min-height: 36px; }
  .input, textarea, select, .prompt-editor, .agent-editor { font-size: 16px; }
  pre, .code-block { overflow-x: auto; }
  /* 预览空态在矮面板下避免裁切 */
  .wb-frame .viewer-empty { padding: 10px 16px; }

  /* API 文档：表格/长字符串内部滚动或断行 */
  .docs-main table { display: block; overflow-x: auto; }
  .docs-main td, .docs-main th { word-break: break-all; }
  .key-list code { word-break: break-all; }

  /* 触屏无 hover：悬停才显示的交互控件常显 */
  .add-card .add-plus { display: none; }
  .add-card .add-btns { display: flex; }
  .flf-del { opacity: 1; }
  .flf-regen { opacity: 1; }

  /* 序列图/首尾帧：缩小帧图区域（96px → 64px），节省纵向空间 */
  .flf-row-above { gap: 10px; margin: 4px 0 8px; }
  .flf-up { width: 64px; height: 64px; }
  .flf-up-btn { border-radius: 6px; }
  .flf-thumb { border-radius: 6px; }
  .flf-regen { width: 18px; height: 18px; font-size: 8px; }
  .flf-del { width: 18px; height: 18px; font-size: 10px; }
  .seq-badge { font-size: 9px; padding: 1px 5px; }
  .seq-ph { min-height: 48px; }
  .ref-item .ref-del { display: flex; }
  .oa-cell .oa-edit { display: inline-flex; }
  /* 片段卡片的替换小按钮在移动端遮挡画面，操作入口收进点按弹出的悬浮菜单 */
  .history-card .del-btn { display: block; }
  .tools-media-thumb .tools-media-zoom { opacity: 1; }
}

/* 移动端片段卡片悬浮操作菜单 */
.clip-menu-mask { position: fixed; inset: 0; z-index: 229; }
.clip-menu {
  position: fixed; z-index: 230; min-width: 168px;
  background: var(--panel); border: 1px solid var(--border-light); border-radius: 10px;
  padding: 5px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  display: flex; flex-direction: column;
}
.clip-menu-title {
  padding: 6px 12px 4px; font-size: 11.5px; color: var(--dim); font-weight: 600;
  border-bottom: 1px solid var(--border); margin-bottom: 4px;
}
.clip-menu button {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border: none; background: none;
  color: var(--text); font-size: 13px; border-radius: 7px; cursor: pointer; text-align: left;
}
.clip-menu button:hover { background: rgba(255, 255, 255, 0.06); }
.clip-menu button:disabled { opacity: 0.4; cursor: not-allowed; }
.clip-menu button:disabled:hover { background: none; }
.clip-menu button.danger { color: var(--danger); }

/* ===== SEQ2VA 连续分镜：分镜图横条 ===== */
.seq-strip { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; justify-content: flex-start; }
.seq-cell { position: relative; flex: 0 0 auto; }
.seq-badge {
  position: absolute; top: 4px; left: 4px; z-index: 2;
  padding: 1px 7px; border-radius: 999px;
  background: rgba(10, 10, 10, 0.72); color: var(--accent);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em;
  pointer-events: none;
}
.seq-badge.miss { color: #ff9f43; }

/* ===== 技能总结（对话 → 我的技能） ===== */
.skill-sum-row { display: flex; justify-content: flex-end; padding: 2px 2px 6px; }
.skill-sum-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(200, 255, 46, 0.35); background: var(--panel-2);
  color: var(--accent); font-size: 12px;
  transition: background 0.15s;
}
.skill-sum-btn:hover { background: rgba(200, 255, 46, 0.12); }
.skill-sum-modal { width: min(680px, calc(100vw - 48px)); display: flex; flex-direction: column; gap: 10px; }
.ss-mode { display: flex; gap: 8px; }
.ss-field { display: flex; align-items: center; gap: 10px; }
.ss-field .ss-k { flex: 0 0 auto; font-size: 12.5px; color: var(--text-dim, #9a9a9a); }
.ss-field .input { flex: 1; min-width: 0; }
.ss-body-field { align-items: flex-start; }
.ss-body-ta { min-height: 220px; resize: vertical; font-family: inherit; line-height: 1.5; }
.ss-gen { align-self: flex-start; }
.ss-empty { font-size: 12px; color: var(--text-dim, #9a9a9a); }

/* 序列图模式：<<<N>>> 绑定分镜图的 chip 标识 */
.ref-chip-shot .chip-name { color: var(--accent); }

/* 序列图分镜占位卡（生成中/失败） */
.seq-ph {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; min-height: 72px;
  border: 1.5px dashed rgba(200, 255, 46, 0.4); border-radius: 8px;
  background: var(--panel-2); padding: 8px;
}
.seq-ph-err {
  font-size: 11px; color: #ff6b6b; line-height: 1.5; text-align: center;
  word-break: break-all; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.seq-cell-err .seq-ph { border-color: rgba(255, 107, 107, 0.55); }

/* 序列图分镜卡删除按钮：放在卡内右上角（不放负偏移，防被 overflow 裁剪） */
.seq-cell .seq-del {
  top: 3px !important;
  right: 3px !important;
  z-index: 3 !important;
}
/* 首尾帧删除按钮：同样不放负偏移，防被容器裁剪 */
.flf-row-above .flf-del {
  top: 3px !important;
  right: 3px !important;
  z-index: 3 !important;
}

/* 素材预览窗口：信息编辑 */
.rp-name-input { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; }
.rp-desc-ta { width: 100%; font-size: 12.5px; line-height: 1.5; resize: vertical; margin-top: 6px; }

/* 保密技能详情提示 */
.sd-confidential .sd-text { color: var(--text-dim, #9a9a9a); font-style: italic; }

/* 序列图错误占位卡：可点击重选来源 */
.seq-ph-clickable { cursor: pointer; border-color: rgba(255, 107, 107, 0.55); }
.seq-ph-clickable:hover { background: rgba(255, 107, 107, 0.08); border-color: rgba(255, 107, 107, 0.8); }

/* ===== 片段列表按钮：图标 + 文字标签 ===== */
.clip-card .clip-replace {
  width: auto; min-width: 26px; height: 24px; padding: 0 8px; gap: 4px;
  border-radius: 12px; font-size: 11px;
}
.clip-insert {
  width: auto; min-width: 22px; height: 22px; padding: 0 7px; gap: 3px;
  border-radius: 11px; font-size: 10px; right: -28px;
}
.add-icon {
  width: auto; min-width: 40px; padding: 0 10px; gap: 5px; font-size: 12px;
}

/* 项目菜单：当前项目名标签 + 子菜单 */
.tb-cur-project {
  font-size: 13px; color: var(--accent); font-weight: 600;
  max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-left: 6px; padding: 3px 12px; border-radius: 12px;
  background: var(--accent-dim); flex: none;
  cursor: pointer; user-select: none;
}
.tb-cur-project:hover { background: rgba(200, 255, 46, 0.2); }
/* 菜单按钮：图标颜色跟随文字（currentColor 自然继承） */
.file-menu button, .file-menu-section {
  display: flex; align-items: center; gap: 10px;
}
.file-menu button svg, .file-menu-section svg {
  color: inherit;
  flex-shrink: 0;
}
.file-menu-section {
  padding: 9px 14px; font-size: 13px; color: var(--text);
  background: none; border: none; cursor: pointer; text-align: left;
  position: relative; width: 100%;
  white-space: nowrap;
}
.file-menu-section:hover { background: rgba(255, 255, 255, 0.08); }
.fm-arrow { margin-left: auto; color: var(--muted); font-size: 12px; }
/* 级联菜单父项上显示当前选中值（右对齐、截断） */
.fm-sel {
  margin-left: auto; max-width: 150px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11px; color: var(--dim);
}
.fm-sel + .fm-arrow { margin-left: 6px; }
/* 级联子菜单：右侧悬浮展开（经典多级菜单） */
.fm-flyout {
  position: absolute;
  left: 100%; top: -4px;
  min-width: 200px; max-height: 280px; overflow-y: auto;
  background: var(--panel-2);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  padding: 4px;
  z-index: 10;
}
.fm-flyout button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 12px; font-size: 12.5px; color: var(--muted);
  background: none; border: none; cursor: pointer; text-align: left;
  white-space: nowrap;
}
.fm-flyout button svg { color: inherit; }
.fm-flyout button:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
.fm-flyout button.cur { color: var(--accent); }
.fm-cur-tag { margin-left: auto; font-size: 10px; color: var(--dim); }
.fm-empty { padding: 8px 12px; font-size: 12px; color: var(--dim); }
.file-menu-divider { height: 1px; background: var(--border); margin: 4px 0; }
.project-action-menu { min-width: 180px; }

/* 技能选择菜单（/ 触发）：加宽 + 右对齐向左延展（右缘不超过浏览器视口），技能名称全量显示 */
.agent-skill-menu {
  max-height: 260px; overflow-y: auto;
  width: min(460px, calc(100vw - 24px));
  left: auto; right: 0;   /* 右缘对齐输入框右缘，向左延展 */
}
.agent-skill-menu .am-header { font-size: 11px; color: var(--dim); cursor: default; }
.agent-skill-menu .am-header:hover { background: none; }
.agent-skill-menu .mi-name { color: var(--text); font-weight: 600; white-space: nowrap; flex: none; }
.agent-skill-menu .mi-idx { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; color: var(--dim); text-align: right; }

/* 视频编辑弹窗（16:9 横板：左提示词 / 右源视频） */
.ve-modal { width: min(1120px, calc(100vw - 48px)); height: min(630px, 90vh); display: flex; flex-direction: column; overflow: hidden; }
.ve-modal h3 { flex: none; }
.ve-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1.1fr 0.9fr; grid-template-rows: minmax(0, 1fr); gap: 18px; }
.ve-left { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ve-left .field { margin-bottom: 12px; }
/* 提示词字段占满左列剩余高度：字段容器 flex 拉伸，编辑器在其内 flex:1 自适应 */
.ve-prompt-field { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-bottom: 0; }
.ve-prompt-field > label { flex: none; }
.ve-left .ve-editor { flex: 1; min-height: 0; overflow-y: auto; }
.ve-right { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ve-right > label { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.ve-source { flex: 1; min-height: 0; border-radius: 10px; overflow: hidden; background: #000; display: flex; align-items: center; justify-content: center; }
.ve-source video { width: 100%; height: 100%; object-fit: contain; }
.ve-no-source { flex: 1; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--border-light); border-radius: 10px; color: var(--dim); font-size: 13px; }
.ve-modal .modal-actions { flex: none; margin-top: 16px; }
@media (max-width: 760px) { .ve-modal { height: 90vh; width: calc(100vw - 40px); } .ve-body { grid-template-columns: 1fr; } .ve-source { max-height: 200px; } }

/* 用户中心：移动端适配（统计条/金额卡/分段器/Key 结果卡） */
@media (max-width: 768px) {
  .acct-body .panel { padding: 18px; border-radius: 12px; }
  .balance-num { font-size: 34px; }
  .amt-grid { gap: 6px; }
  .amt-chip { padding: 8px 2px 7px; border-radius: 8px; }
  .amt-chip b { font-size: 13.5px; }
  .seg { width: 100%; }
  .seg button { flex: 1; }
  .key-result-row { flex-direction: column; align-items: stretch; }
  .acct-profile-head { padding: 13px; gap: 12px; }
  .acct-avatar-lg { width: 46px; height: 46px; font-size: 18px; }
}
.acct-body .param-table td:first-child { word-break: break-all; }

/* 分页器（用户中心大列表） */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.pager-info { font-size: 12.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
.pager-info b { color: var(--accent); }
.pager .btn[disabled] { opacity: 0.35; cursor: not-allowed; }

/* 完整分页器：页码窗口 + 首末页 + 每页条数 + 跳页 */
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.pager-info { font-size: 12.5px; color: var(--dim); font-variant-numeric: tabular-nums; margin-right: auto; }
.pager-ctrl { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pager-ctrl button {
  min-width: 28px; height: 28px; padding: 0 6px;
  border: 1px solid var(--border-light); border-radius: 7px;
  background: var(--panel-2); color: var(--muted);
  font-size: 12.5px; font-variant-numeric: tabular-nums; cursor: pointer;
  transition: all 0.12s;
}
.pager-ctrl button:hover:not(:disabled):not(.on) { color: var(--text); border-color: var(--muted); }
.pager-ctrl button.on {
  background: var(--accent); border-color: var(--accent); color: #10230a;
  font-weight: 700; box-shadow: 0 4px 12px rgba(200, 255, 46, 0.22);
}
.pager-ctrl button:disabled { opacity: 0.3; cursor: not-allowed; }
.pager-ell { color: var(--dim); padding: 0 2px; font-size: 12px; }
.pager-size, .pager-jump { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--dim); }
.pager-size .input { width: 62px; padding: 5px 8px; font-size: 12.5px; }
.pager-jump .input { width: 56px; padding: 5px 8px; font-size: 12.5px; }

/* 分页加载中：表格半透明 + 居中 spinner */
.pg-loading { position: relative; transition: opacity 0.18s; }
.pg-loading.on { opacity: 0.45; pointer-events: none; }
.pg-loading.on::after {
  content: "";
  position: absolute; top: 44px; left: 50%; margin-left: -11px;
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid var(--border-light); border-top-color: var(--accent);
  animation: pg-spin 0.8s linear infinite;
  z-index: 2;
}
@keyframes pg-spin { to { transform: rotate(360deg); } }
@media (max-width: 768px) { .pager { justify-content: flex-start; } .pager-info { margin-right: 0; width: 100%; } }

/* 时间线片段卡片：本地上传进度条（底部，覆盖在卡片上） */
.clip-upload-bar {
  position: absolute;
  left: 6px; right: 6px; bottom: 6px;
  height: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  overflow: hidden;
  z-index: 3;
}
.clip-upload-bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #c8ff46, #7ed957);
  box-shadow: 0 0 8px rgba(200, 255, 46, 0.5);
  transition: width 0.2s ease;
}

/* 上传片段操作面板：替换上传进度 */
.ops-upload-progress { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.ops-upload-bar { height: 5px; border-radius: 999px; background: rgba(0, 0, 0, 0.5); overflow: hidden; }
.ops-upload-bar i { display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #c8ff46, #7ed957); box-shadow: 0 0 8px rgba(200, 255, 46, 0.5);
  transition: width 0.2s ease; }
.ops-upload-text { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.tag-busy { color: var(--accent); border-color: rgba(200, 255, 46, 0.4); }
.tag-err { color: var(--danger); border-color: rgba(255, 77, 77, 0.45); }

/* 一键剧本 · 技能使用菜单（多选我的技能） */
.sg-skill-row { display: flex; align-items: center; gap: 10px; }
.sg-skill-count { background: var(--accent-dim); color: var(--accent); font-size: 11px; padding: 0 7px; border-radius: 999px; margin-left: 6px; }
.sg-skill-picked { max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-skill-menu { width: 340px; max-height: 50vh; overflow-y: auto; }
.sg-skill-loading { display: flex; align-items: center; gap: 8px; padding: 14px; color: var(--dim); font-size: 12.5px; }
.sg-skill-list { display: flex; flex-direction: column; }
.sg-skill-item { display: flex; align-items: center; gap: 8px; padding: 7px 12px; cursor: pointer; border-radius: 7px; }
.sg-skill-item:hover { background: rgba(255, 255, 255, 0.05); }
.sg-skill-item input { accent-color: var(--accent); flex: none; }
.sg-skill-name { font-size: 13px; color: var(--text); flex: none; }
.sg-skill-desc { font-size: 11px; color: var(--dim); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-skill-add {
  display: flex; align-items: center; gap: 6px; width: 100%;
  margin-top: 6px; padding: 9px 12px; border-top: 1px solid var(--border);
  background: none; border-left: none; border-right: none; border-bottom: none;
  color: var(--accent); font-size: 12.5px; cursor: pointer; text-align: left;
}
.sg-skill-add:hover { background: var(--accent-dim); }
.sg-skill-add:disabled { opacity: 0.4; cursor: not-allowed; }

/* 技能管理弹窗从一键剧本的技能菜单（z-230）打开：overlay 须高于一键剧本（z-200）与菜单层 */
.skills-overlay { z-index: 240; }

/* AI 语音设计弹窗 */
.vd-modal { width: min(560px, calc(100vw - 40px)); }
.vd-status { padding: 10px 12px; border: 1px solid var(--border-light); border-radius: 10px; background: var(--panel-2); font-size: 12.5px; color: var(--text); }
.vd-status .spinner { display: inline-block; vertical-align: -3px; margin-right: 6px; }

/* 技能详情弹窗：从技能管理（z-240）内打开，须高于它 */
.skill-detail-overlay { z-index: 260; }

/* 一键剧本 · 技能使用菜单：分组标签（剧本解析 / 素材生成） */
.sg-skill-group { display: flex; align-items: baseline; gap: 8px; padding: 8px 12px 4px; font-size: 12px; font-weight: 700; color: var(--text); border-top: 1px solid var(--border); margin-top: 4px; }
.sg-skill-group:first-child { border-top: none; margin-top: 0; }
.sg-skill-group-def { font-size: 10.5px; font-weight: 400; color: var(--dim); }

/* 一键剧本 · 素材生成确认弹窗 */
.sg-entity-overlay { z-index: 300; }
.sg-entity-modal { width: min(820px, calc(100vw - 40px)); }
.sg-entity-list { max-height: 46vh; overflow-y: auto; border: 1px solid var(--border-light); border-radius: 10px; background: rgba(0,0,0,0.16); margin-bottom: 6px; }
.sg-entity-modal .sg-entity-list { columns: 2; column-gap: 1px; }  /* 宽弹窗：实体双列排布 */
.sg-entity-item { break-inside: avoid; }
@media (max-width: 640px) { .sg-entity-modal .sg-entity-list { columns: 1; } }
.sg-entity-item { display: flex; align-items: center; gap: 10px; padding: 9px 14px; cursor: pointer; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.sg-entity-item:last-child { border-bottom: none; }
.sg-entity-item:hover { background: rgba(255,255,255,0.04); }
.sg-entity-item.off { opacity: 0.45; }
.sg-entity-item input { accent-color: var(--accent); flex: none; }
.sg-entity-type { flex: none; font-size: 11px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border-light); color: var(--dim); }
.sg-entity-type.et-character { color: #7ec8ff; border-color: rgba(126,200,255,0.4); }
.sg-entity-type.et-scene { color: #9d8cff; border-color: rgba(157,140,255,0.4); }
.sg-entity-type.et-prop { color: #ffb020; border-color: rgba(255,176,32,0.4); }
.sg-entity-name { color: var(--text); flex: 1; }
.sg-entity-lib { flex: none; font-size: 11px; color: var(--accent); background: var(--accent-dim); border-radius: 999px; padding: 1px 8px; }

/* 素材生成确认弹窗 · 统一风格提示区 */
.sg-style-field { margin-top: 12px; }
.sg-style-tools { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.sg-style-refs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.sg-style-ref { position: relative; }
.sg-style-ref img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border-light); display: block; }
.sg-style-ref-del { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%; border: none; background: var(--danger); color: #fff; font-size: 12px; line-height: 1; cursor: pointer; }

/* 风格参考图上传中的占位高亮 */
.sg-style-ref.adding img { opacity: 0.35; }
.sg-style-ref.adding::after { content: "⬆"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--accent); font-size: 18px; }

/* 标签预览卡片 · 解除关联按钮 */
.cp-unlink-btn { display: inline-flex; align-items: center; gap: 3px; flex: none; border: 1px solid rgba(255, 77, 77, 0.45); background: rgba(255, 77, 77, 0.1); color: var(--danger); font-size: 11px; padding: 2px 8px; border-radius: 6px; cursor: pointer; }
.cp-unlink-btn:hover { background: rgba(255, 77, 77, 0.22); }

/* ---------- API 服务文档（markdown 渲染）美化 ---------- */
.docs-main > h1 { font-size: clamp(26px, 3vw, 32px); font-weight: 800; letter-spacing: -0.02em; margin: 4px 0 18px; }
.docs-sec {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 26px;
  margin-bottom: 22px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.docs-sec h2 {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 12px; margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.docs-sec h2::before {
  content: ""; width: 4px; height: 18px; border-radius: 2px;
  background: var(--accent); flex: none;
}
.docs-sec h2 code { font-size: 13px; }
.docs-sec h3 { font-size: 15.5px; font-weight: 700; margin: 20px 0 10px; }
.docs-sec .param-table { margin: 4px 0 16px; }
.docs-sec .param-table thead th {
  color: var(--muted); font-weight: 600; font-size: 12px;
  background: var(--panel-2); border-bottom: 1px solid var(--border-light);
}
.docs-sec .param-table tbody tr:hover { background: var(--panel-2); }
.docs-sec .code-wrap { margin: 6px 0 18px; }
.docs-md-toolbar {
  display: flex; justify-content: flex-end;
  margin-bottom: 18px;
  position: sticky; top: 88px; z-index: 5;
}
.docs-side button.active, .docs-side button:hover { color: var(--text); }

/* 概述区（首个 ## 卡片之前）：标题/段落样式 + 与下方面板的间距 */
.docs-main > h1 { margin: 4px 0 16px; }
.docs-main > p.desc { color: var(--muted); font-size: 14px; margin: 0 0 14px; max-width: 780px; line-height: 1.7; }
.docs-main > p.desc:last-of-type { margin-bottom: 30px; }
.docs-main > blockquote, .docs-main > p[style*="border-left"] { max-width: 780px; }

/* ---------- markdown 渲染组件（marked + highlight.js）配套 ---------- */
.md-body > h1 { font-size: clamp(26px, 3vw, 32px); font-weight: 800; letter-spacing: -0.02em; margin: 4px 0 16px; }
.md-body > p.desc, .md-body > p { color: var(--muted); font-size: 14px; margin: 0 0 14px; max-width: 780px; line-height: 1.7; }
.md-body > p:last-of-type { margin-bottom: 30px; }
.md-body .docs-sec > p, .md-body .docs-sec li { color: var(--muted); font-size: 14px; line-height: 1.75; }
.md-body .docs-sec ul { margin: 0 0 16px; }
.md-body .docs-sec pre { margin: 0; background: transparent; border: none; padding: 0; }
.md-body .docs-sec .code-wrap { margin: 6px 0 18px; }
.md-body .docs-sec table { margin: 4px 0 16px; }
.md-body blockquote { margin: 0 0 16px; padding: 2px 0 2px 12px; border-left: 3px solid var(--accent-dim); color: var(--muted); }
/* highlight.js 暗色主题（贴合站点色板） */
.md-body .hljs-comment, .md-body .hljs-quote { color: #7d8b74; font-style: italic; }
.md-body .hljs-keyword, .md-body .hljs-selector-tag, .md-body .hljs-built_in, .md-body .hljs-meta { color: #c792ea; }
.md-body .hljs-string, .md-body .hljs-attr, .md-body .hljs-template-string, .md-body .hljs-regexp { color: #a5d6a7; }
.md-body .hljs-number, .md-body .hljs-literal { color: #f78c6c; }
.md-body .hljs-title, .md-body .hljs-title.function_, .md-body .hljs-name, .md-body .hljs-section { color: #82aaff; }
.md-body .hljs-variable, .md-body .hljs-params, .md-body .hljs-property { color: #e6e6e6; }
.md-body .hljs-symbol, .md-body .hljs-bullet, .md-body .hljs-link { color: var(--accent); }
.md-body .hljs-emphasis { font-style: italic; }
.md-body .hljs-strong { font-weight: 700; }

/* marked 裸表格补充：长内容换行 + 窄屏横向滚动 */
.md-body .docs-sec .param-table td, .md-body .docs-sec .param-table th { word-break: break-word; }
.md-body .docs-sec .param-table td code { word-break: break-all; }
@media (max-width: 900px) {
  .md-body .docs-sec .param-table { display: block; overflow-x: auto; }
}

/* 目录锚点定位：预留顶部悬浮占用（站点导航 64px + 吸顶文档工具栏 ≈ 150px），避免定位后被遮挡 */
.docs-sec, .docs-sec h2[id], .md-body > h1 { scroll-margin-top: 150px; }

/* 文档工具栏：fixed 悬浮，精确贴合顶部导航栏下沿（64px）；锚点偏移不再计入工具栏 */
.docs-md-toolbar {
  position: fixed;
  top: 64px;            /* 站点导航 .nav-inner 高度 64px 的底部边界 */
  right: 28px;
  z-index: 90;
  margin: 0;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.docs-sec, .docs-sec h2[id], .md-body > h1 { scroll-margin-top: 64px; }
@media (max-width: 768px) {
  .docs-md-toolbar { right: 12px; top: 60px; }
}

/* 锚点偏移修正：h2 在 panel 内（panel padding-top 24px），偏移 = 导航 64 + 24 = 88，保证卡片整体上沿也不被导航遮挡 */
.docs-sec, .docs-sec h2[id] { scroll-margin-top: 88px; }
.md-body > h1 { scroll-margin-top: 64px; }

/* 章节卡片右上角：复制本章节 Markdown */
.docs-sec { position: relative; }
.sec-copy-btn {
  position: absolute; top: 18px; right: 18px;
  font-size: 11.5px; padding: 3px 11px;
  background: var(--panel-2); color: var(--dim);
  border: 1px solid var(--border); border-radius: 999px;
  cursor: pointer; opacity: 0.5; transition: opacity 0.15s, color 0.15s;
}
.sec-copy-btn:hover { opacity: 1; color: var(--text); }

/* GPU 服务按钮：启动中过渡态（橙黄） */
.tb-btn.tb-starting { color: #f5a623; }
.tb-btn.tb-starting .spinner { border-color: rgba(245, 166, 35, 0.25); border-top-color: #f5a623; }
