/* 星际思维 Studio — 设计系统 v3
   基线：UI/UX Pro Max（Adobe Spectrum × Swiss Minimalism 深色变体）
   - 语义化 token，不写死颜色
   - 层深靠 surface 阶梯，不靠模糊玻璃
   - 动效 200ms，尊重 prefers-reduced-motion
   - 焦点环始终可见 */
:root {
  /* ═══ 设计系统 v4 ═══
     Adobe Spectrum × Swiss Minimalism（深色变体）
     原则：中性灰阶分层 / 单一功能色 / 4px 网格 / 无发光无模糊 */

  /* ── Surface 五级阶梯：越靠前越亮 ── */
  --bg:            #0a0a0b;   /* 画布外最底层 */
  --bg-soft:       #0f0f11;
  --panel:         #101012;   /* 侧栏、面板 */
  --panel-2:       #16161a;   /* 卡片 */
  --panel-3:       #1c1c21;   /* hover 态 */
  --surface-4:     #26262c;   /* 选中、激活 */

  /* ── 边框三级 ── */
  --line:          #1f1f24;
  --line-strong:   #2a2a31;
  --border-strong: #3a3a44;

  /* ── 文字三级（均过 4.5:1）── */
  --text:          #f4f4f5;   /* 标题、数值 */
  --text-dim:      #a1a1aa;   /* 正文、标签 */
  --text-faint:    #6e6e78;   /* 辅助、占位 */

  /* ── 功能色：取自官方品牌靛蓝 ── */
  --accent:        #6366f1;
  --accent-hover:  #818cf8;
  --accent-subtle: rgba(99,102,241,.14);
  --accent-2:      #8b5cf6;
  --accent-soft:   #a5b4fc;   /* 官方渐变里最常用的淡紫 */
  --accent-cyan:   #06b6d4;   /* 星云第二色 */

  /* ── 内容强调（仅主 CTA 一处使用）── */
  --gold:          #f5c542;

  /* ── 语义 ── */
  --success:       #22c55e;
  --warning:       #f59e0b;
  --danger:        #ef4444;
  --green:         #22c55e;
  --red:           #ef4444;
  --blue:          #3b82f6;

  /* ── 圆角：收敛到 4 档 ── */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 16px;      /* 兼容旧引用 */
  --r-full: 999px;   /* 仅 pill 组件使用 */

  /* ── 间距：严格 4px 网格 ── */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px;
  --s-4: 16px; --s-5: 24px; --s-6: 32px;

  /* ── 动效 ── */
  --ease:      cubic-bezier(.16, 1, .3, 1);
  --ease-out:  cubic-bezier(.16, 1, .3, 1);
  --dur-fast:  120ms;
  --dur:       200ms;
  --dur-slow:  280ms;

  /* ── 阴影：只表达层深 ── */
  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 4px 16px rgba(0,0,0,.45);
  --shadow-3: 0 12px 32px rgba(0,0,0,.55);

  /* ── 字体：Inter 主导，中文 PingFang 回落 ── */
  --font: "Inter", -apple-system, "SF Pro SC", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --font-display: "Inter", -apple-system, "PingFang SC", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* ── 字号刻度：6 档 ── */
  --fs-1: 11px;   /* 极小标注 */
  --fs-2: 12px;   /* 辅助 */
  --fs-3: 13px;   /* 正文 */
  --fs-4: 15px;   /* 面板标题 */
  --fs-5: 20px;   /* 页面标题 */
  --fs-6: 28px;   /* 大数字 */
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* 官方字标字体（Exo 2 Italic，SIL OFL 1.1） */
@font-face {
  font-family: "Stellar Exo 2";
  src: url('/assets/exo2.ttf') format('truetype');
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
}

* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
/* 键盘焦点必须可见（技能包硬性检查项） */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}
button, a, [role="button"] { cursor: pointer; }

/* ── 浏览器原生表面也纳入设计体系（全站生效）── */
::selection { background: rgba(99,102,241,.34); color: #fff; }
::-moz-selection { background: rgba(99,102,241,.34); color: #fff; }
a { text-underline-offset: 3px; text-decoration-thickness: 1px; }
input, textarea, [contenteditable] { caret-color: var(--accent-hover); }
input[type="checkbox"], input[type="radio"], input[type="range"] { accent-color: var(--accent); }

/* 尊重系统减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(720px 420px at 12% -8%, rgba(106, 91, 255, .18), transparent 62%),
    radial-gradient(620px 380px at 88% 4%, rgba(255, 79, 216, .12), transparent 60%),
    radial-gradient(900px 520px at 50% 108%, rgba(255, 216, 77, .05), transparent 65%);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; }
img { display: block; }
::selection { background: rgba(106, 91, 255, .4); }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .13); border-radius: 9px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .22); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── 布局 ── */
.shell { position: relative; z-index: 1; width: 100%; min-height: 100%; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: var(--s-4);
  height: 56px; padding: 0 var(--s-4);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand-logo { width: 26px; height: 26px; display: block; flex: none; }
.brand-name {
  font-size: var(--fs-4); font-weight: 600; color: var(--text);
  letter-spacing: .5px; white-space: nowrap;
}
.brand-sub {
  font-family: "Stellar Exo 2", Arial, sans-serif;
  font-size: 11px; font-weight: 600; font-style: italic;
  color: #b4c5e4; letter-spacing: .4px;
  align-self: flex-end; padding-bottom: 3px; white-space: nowrap;
}
.brand .sub { color: var(--text-faint); font-weight: 450; font-size: 11px; letter-spacing: 1.4px; }
.nav { display: flex; gap: 2px; margin-left: 10px; }
.nav { display: flex; gap: var(--s-1); height: 100%; align-items: stretch; }
.nav a {
  position: relative; display: flex; align-items: center;
  padding: 0 var(--s-3); font-size: var(--fs-3); color: var(--text-dim);
  text-decoration: none; transition: color var(--dur-fast) var(--ease);
}
.nav a::after {
  content: ''; position: absolute; left: var(--s-3); right: var(--s-3); bottom: 0;
  height: 2px; background: var(--accent); border-radius: 2px 2px 0 0;
  transform: scaleX(0); transform-origin: center;
  transition: transform var(--dur) var(--ease);
}
.nav a:hover { color: var(--text); }
.nav a.active { color: var(--text); font-weight: 500; }
.nav a.active::after { transform: scaleX(1); }
.spacer { flex: 1; }

.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px;
  border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line);
  font-size: 12.5px; color: var(--text-dim); white-space: nowrap;
}
.chip b { color: var(--gold); font-variant-numeric: tabular-nums; font-weight: 650; }
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.chip.ok { color: var(--green); border-color: rgba(61, 220, 151, .3); background: rgba(61, 220, 151, .08); }
.chip.warn { color: var(--gold); border-color: rgba(255, 216, 77, .3); background: rgba(255, 216, 77, .08); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--panel-2); object-fit: cover; }

.btn {
  height: 36px; padding: 0 var(--s-4); border-radius: var(--r-sm);
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--text);
  font-size: var(--fs-3); font-family: inherit; text-decoration: none;
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
  white-space: nowrap;
}
.btn:hover { background: var(--panel-3); border-color: var(--border-strong); }
.btn.primary {
  background: var(--accent); color: #fff; border-color: transparent; font-weight: 600;
}
.btn.primary:hover { background: var(--accent-hover); }
.btn.accent {
  background: var(--accent); color: #fff; border-color: transparent; font-weight: 600;
}
.btn.accent:hover { background: var(--accent-hover); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text-dim); }
.btn.ghost:hover { color: var(--text); }
.btn.sm { height: 30px; padding: 0 12px; font-size: 12.5px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }

.page { flex: 1; width: 100%; min-width: 0; }
.container { max-width: 1320px; margin: 0 auto; padding: 26px 18px 90px; }

/* ── Hero ── */
.hero { position: relative; padding: 76px 18px 30px; text-align: center; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px;
  padding: 5px 14px 5px 8px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--panel-2); font-size: 12px; color: var(--text-dim);
}
.hero .eyebrow i {
  width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-style: normal;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-size: 10px;
}
.hero h1 {
  margin: 0 0 14px; font-size: clamp(34px, 5vw, 58px); line-height: 1.06; font-weight: 600; letter-spacing: -1.4px;
  background: linear-gradient(180deg, #fff 30%, rgba(255, 255, 255, .68));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { margin: 0 auto 30px; max-width: 620px; color: var(--text-dim); font-size: clamp(15px, 1.6vw, 18px); }
.promptbar {
  display: flex; align-items: center; gap: 10px; max-width: 680px; margin: 0 auto;
  padding: 8px 8px 8px 20px; border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--panel-3), rgba(255, 255, 255, .02));
  border: 1px solid var(--line-strong);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .55), inset 0 1px 0 var(--panel-3);
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.promptbar:focus-within { border-color: rgba(106, 91, 255, .65); box-shadow: 0 20px 70px rgba(106, 91, 255, .22), inset 0 1px 0 var(--line); }
.promptbar input { flex: 1; height: 46px; background: none; border: 0; outline: none; color: var(--text); font-size: 15.5px; }
.promptbar input::placeholder { color: var(--text-faint); }
.hero-hints { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.hero-hints button {
  padding: 6px 12px; border-radius: 999px; font-size: 12.5px; color: var(--text-dim);
  background: rgba(255, 255, 255, .035); border: 1px solid var(--line);
  transition: all var(--dur) var(--ease);
}
.hero-hints button:hover { color: var(--text); border-color: var(--line-strong); background: var(--line); }

/* ── 筛选条 ── */
.section-head {
  display: flex; align-items: center; gap: 12px; max-width: 1320px; margin: 26px auto 12px; padding: 0 18px;
}
.section-head h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.2px; }
.filters { display: flex; gap: 7px; overflow-x: auto; padding: 0; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters button {
  height: 32px; padding: 0 14px; border-radius: 999px; white-space: nowrap; font-size: 12.5px;
  background: transparent; border: 1px solid var(--line); color: var(--text-dim);
  transition: all var(--dur) var(--ease);
}
.filters button:hover { color: var(--text); border-color: var(--line-strong); }
.filters button.active { background: var(--text); color: var(--bg); border-color: transparent; font-weight: 600; }
.search {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; min-width: 190px;
  border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line);
}
.search input { width: 100%; background: none; border: 0; outline: none; color: var(--text); font-size: 12.5px; }

/* ── 画廊卡片 ── */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s-3);
}
.card {
  position: relative; border-radius: var(--r-md); overflow: hidden; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line);
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.card:hover { border-color: var(--border-strong); background: var(--panel-3); }
.card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.card .thumb-wrap { position: relative; aspect-ratio: 1 / 1.06; overflow: hidden; background: var(--panel-2); }
.card .thumb { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease), opacity .2s; }
.card:hover .thumb { transform: scale(1.045); }
.card .thumb.alt { position: absolute; inset: 0; opacity: 0; transition: opacity .28s var(--ease); }
.card:hover .thumb.alt { opacity: 1; }
.card .badge {
  position: absolute; top: 10px; left: 10px; padding: 3px 9px; border-radius: 999px;
  background: var(--panel-3);  font-size: 11px; color: rgba(255, 255, 255, .82);
  border: 1px solid var(--line-strong); letter-spacing: .2px;
}
.card .meta { display: flex; align-items: center; gap: 8px; padding: 11px 12px; }
.card .meta .avatar { width: 20px; height: 20px; }
.card .name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.card .likes {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-faint);
  transition: color .16s; background: none; border: 0; padding: 2px 4px; border-radius: 6px;
}
.card .likes:hover { color: var(--accent-2); background: rgba(255, 79, 216, .1); }
.card .likes.on { color: var(--accent-2); }

/* ── 面板 / 工作台 ── */
.workspace { display: grid; grid-template-columns: 224px minmax(420px, 1fr) 372px; gap: 14px; height: calc(100vh - 62px); padding: 14px 16px; }
.panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .012));
  border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; overflow: auto;
  box-shadow: inset 0 1px 0 var(--panel-2);
}
.panel::-webkit-scrollbar { width: 6px; }
.panel h3 {
  margin: 2px 4px 12px; font-size: 11.5px; font-weight: 650; letter-spacing: 1.1px;
  text-transform: uppercase; color: var(--text-faint);
}
.modules { display: flex; flex-direction: column; gap: 2px; }
.modules button {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 11px;
  border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-dim);
  text-align: left; font-size: 13.5px; transition: all .15s var(--ease);
}
.modules button:hover { background: var(--panel-2); color: var(--text); }
.modules button.active {
  background: linear-gradient(90deg, rgba(106, 91, 255, .22), rgba(106, 91, 255, .05));
  color: #fff; font-weight: 600; box-shadow: inset 2px 0 0 var(--accent);
}
.modules .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .55; }

.drop {
  position: relative; border: 1.5px dashed rgba(255, 255, 255, .16); border-radius: var(--r-lg);
  padding: 30px 20px; text-align: center; color: var(--text-dim); cursor: pointer;
  background: radial-gradient(120% 120% at 50% 0%, var(--panel-2), transparent 60%);
  transition: all .2s var(--ease);
}
.drop:hover { border-color: rgba(106, 91, 255, .55); color: var(--text); }
.drop.hot { border-color: var(--accent); background: rgba(106, 91, 255, .1); }
.drop.has-file { padding: 14px; border-style: solid; border-color: var(--line); }
.drop img { max-height: 190px; width: auto; margin: 0 auto 10px; border-radius: var(--r-sm); }
.drop .hint { font-size: 12px; color: var(--text-faint); margin-top: 6px; }

.field { margin-top: 16px; }
.field > label {
  display: flex; align-items: center; gap: 6px; font-size: 11.5px; letter-spacing: .6px;
  text-transform: uppercase; color: var(--text-faint); margin-bottom: 8px; font-weight: 600;
}
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button {
  height: 32px; padding: 0 13px; border-radius: var(--r-sm); font-size: 12.5px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text-dim);
  transition: all .15s var(--ease);
}
.seg button:hover { color: var(--text); border-color: var(--line-strong); }
.seg button.active {
  background: rgba(106, 91, 255, .18); border-color: rgba(106, 91, 255, .65); color: #fff; font-weight: 600;
}
.input {
  width: 100%; height: 40px; padding: 0 13px; border-radius: var(--r-sm);
  background: rgba(0, 0, 0, .35); border: 1px solid var(--line); color: var(--text); outline: none;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.input:focus { border-color: rgba(106, 91, 255, .7); box-shadow: 0 0 0 3px rgba(106, 91, 255, .16); }
textarea.input { height: 92px; padding: 11px 13px; resize: vertical; line-height: 1.6; }
.switch { display: inline-flex; align-items: center; gap: 8px; color: var(--text-dim); font-size: 13px; cursor: pointer; }
.switch input { width: 16px; height: 16px; accent-color: var(--accent); }

/* ── 任务卡 ── */
.taskbar { display: flex; flex-direction: column; gap: 10px; }
.task {
  padding: 12px; border-radius: var(--r-md); background: rgba(0, 0, 0, .3);
  border: 1px solid var(--line); transition: border-color .2s;
}
.task.success { border-color: rgba(61, 220, 151, .28); background: rgba(61, 220, 151, .05); }
.task.failed { border-color: rgba(255, 92, 92, .3); background: rgba(255, 92, 92, .06); }
.task .row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-dim); }
.task .type { color: var(--text); font-size: 12.5px; font-family: var(--mono); }
.task .bar { height: 4px; border-radius: 4px; background: var(--line); margin: 10px 0 8px; overflow: hidden; }
.task .bar > i {
  display: block; height: 100%; border-radius: 4px; width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width .45s var(--ease);
}
.task.success .bar > i { background: var(--green); }
.task.failed .bar > i { background: var(--red); }
.status-pill {
  padding: 2px 9px; border-radius: 999px; font-size: 11px; letter-spacing: .3px;
  background: var(--line); border: 1px solid var(--line);
}
.task.success .status-pill { color: var(--green); border-color: rgba(61, 220, 151, .35); }
.task.failed .status-pill { color: var(--red); border-color: rgba(255, 92, 92, .35); }

.assets-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.assets-mini .mini {
  position: relative; border-radius: var(--r-sm); overflow: hidden; background: var(--panel-2);
  border: 1px solid var(--line); transition: border-color .16s var(--ease), transform .16s var(--ease);
}
.assets-mini .mini:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.assets-mini img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.assets-mini .t {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 7px 5px; font-size: 10.5px;
  background: linear-gradient(0deg, rgba(0, 0, 0, .82), transparent); color: rgba(255, 255, 255, .9);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── 查看器 ── */
.viewer-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 348px; height: calc(100vh - 62px); overflow: hidden; }
#canvas-host {
  position: relative; overflow: hidden; min-width: 0; min-height: 0;
  height: 100%;
  background:
    radial-gradient(120% 80% at 50% 8%, #2b2f37 0%, #1b1e24 38%, #0d0f13 78%, #08090c 100%);
}
#canvas-host canvas { display: block; }
.viewer-tools { position: absolute; left: 100px; top: 18px; display: flex; flex-direction: column; gap: 6px; }
.viewer-tools button {
  width: 36px; height: 36px; border-radius: 11px; font-size: 14px;
  background: rgba(10, 11, 14, .62); border: 1px solid var(--line-strong); color: rgba(255, 255, 255, .8);
   transition: all var(--dur) var(--ease);
}
.viewer-tools button:hover { color: #fff; border-color: rgba(255, 255, 255, .3); transform: translateY(-1px); }
.viewer-tools .tool-sep { width: 22px; height: 1px; background: rgba(255,255,255,.14); margin: 3px auto; }
.viewer-tools button#toolTex, .viewer-tools button#toolRig, .viewer-tools button#toolAnim {
  color: var(--accent); border-color: rgba(140,110,255,.35);
}
.viewer-tools button#toolTex:hover, .viewer-tools button#toolRig:hover, .viewer-tools button#toolAnim:hover {
  color: #fff; background: rgba(124,92,255,.22); border-color: rgba(140,110,255,.7);
}
.viewer-tools button.active { background: var(--accent); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(106, 91, 255, .45); }
.viewer-hud {
  position: absolute; left: 18px; bottom: 18px; display: flex; gap: 14px; font-size: 11.5px;
  color: var(--text-faint); font-family: var(--mono);
}
.viewer-side { border-left: 1px solid var(--line); border-radius: 0; overflow: auto; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin-top: 4px; }
.info-grid > div { min-width: 0; }
.info-grid .k { font-size: 10.5px; letter-spacing: .7px; text-transform: uppercase; color: var(--text-faint); }
.info-grid .v { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── 定价 ── */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(214px, 1fr)); gap: 14px; }
.plan {
  position: relative; padding: 20px; border-radius: var(--r-lg); display: flex; flex-direction: column; gap: 12px;
  background: linear-gradient(180deg, var(--panel-2), rgba(255, 255, 255, .012));
  border: 1px solid var(--line); transition: all .2s var(--ease);
}
.plan:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.plan.popular { border-color: rgba(106, 91, 255, .6); box-shadow: 0 20px 60px rgba(106, 91, 255, .18); }
.plan.popular::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, rgba(106, 91, 255, .9), rgba(255, 79, 216, .55), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.plan .tier { font-size: 13px; letter-spacing: .3px; color: var(--text-dim); }
.plan .price { font-size: 30px; font-weight: 650; letter-spacing: -1px; line-height: 1; }
.plan .price small { font-size: 12.5px; font-weight: 400; color: var(--text-faint); letter-spacing: 0; }
.plan .credits { font-size: 12.5px; color: var(--gold); }
.plan ul { margin: 2px 0 6px; padding-left: 15px; color: var(--text-dim); font-size: 12.5px; line-height: 1.9; }
.plan ul li::marker { color: var(--accent); }

/* ── 弹窗 / toast / 空态 / 骨架 ── */
.modal-mask {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  background: var(--panel); 
  animation: fade .18s var(--ease);
}
@keyframes fade { from { opacity: 0 } }
.modal {
  width: min(400px, calc(100vw - 32px)); padding: 24px; border-radius: var(--r-xl);
  background: linear-gradient(180deg, #14161c, #0e1014);
  border: 1px solid var(--line-strong); display: flex; flex-direction: column; gap: 13px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, .7);
  animation: pop .22s var(--ease);
}
@keyframes pop { from { transform: translateY(10px) scale(.985); opacity: 0 } }
.modal h2 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -.3px; }
.modal .hint { font-size: 12px; color: var(--text-faint); }
.tabs { display: flex; padding: 3px; border-radius: 999px; background: rgba(0, 0, 0, .45); border: 1px solid var(--line); }
.tabs button { flex: 1; height: 30px; border: 0; border-radius: 999px; background: transparent; color: var(--text-dim); font-size: 13px; }
.tabs button.active { background: var(--accent); color: #fff; font-weight: 600; }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  padding: 11px 20px; border-radius: 999px; background: var(--text); color: var(--bg);
  font-size: 13px; z-index: 200; box-shadow: 0 14px 40px rgba(0, 0, 0, .55);
  animation: toastin .22s var(--ease);
}
@keyframes toastin { from { transform: translate(-50%, 12px); opacity: 0 } }
.toast.err { background: var(--red); color: #fff; }
.empty { text-align: center; padding: 72px 16px; color: var(--text-faint); }
.empty .ico { font-size: 40px; opacity: .5; margin-bottom: 12px; }
.empty h2 { margin: 0 0 8px; font-size: 18px; font-weight: 550; color: var(--text); }
.skeleton {
  background: linear-gradient(100deg, var(--panel-2) 20%, var(--line) 38%, var(--panel-2) 56%);
  background-size: 220% 100%; animation: shimmer 1.3s infinite; border-radius: var(--r-md);
}
@keyframes shimmer { from { background-position: 180% 0 } to { background-position: -40% 0 } }
.menu {
  position: absolute; z-index: 60; min-width: 168px; padding: 6px;
  border-radius: var(--r-md); background: #16181f; border: 1px solid var(--line-strong);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .65);
}
.menu button {
  display: flex; width: 100%; align-items: center; gap: 9px; padding: 8px 10px; border: 0;
  background: transparent; border-radius: 8px; color: var(--text-dim); font-size: 13px; text-align: left;
}
.menu button:hover { background: var(--line); color: var(--text); }
.menu button.danger { color: var(--red); }

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 1fr; height: auto; }
  .viewer-wrap { grid-template-columns: 1fr; height: auto; }
  #canvas-host { height: 58vh; }
  .viewer-side { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .topbar { gap: 8px; padding: 0 12px; height: 56px; }
  .nav { display: none; }
  .hero { padding-top: 44px; }
  .container { padding: 18px 12px 70px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .card .meta { padding: 8px 9px; }
}

/* ── 多视图 / 批量 / 集合 / 消息 / 设置 ── */
.mv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mv-slot { min-height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.batch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 10px; }
.batch-item { position: relative; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); background: var(--panel-2); }
.batch-item img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.batch-item .x {
  position: absolute; top: 3px; right: 5px; width: 16px; height: 16px; border-radius: 50%;
  background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; line-height: 16px; text-align: center; cursor: pointer;
}
.batch-item .wait {
  position: absolute; inset: auto 0 0 0; padding: 3px 4px; font-size: 10px; text-align: center;
  background: rgba(0, 0, 0, .65); color: var(--gold);
}

.list-row {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: rgba(255, 255, 255, .02); transition: border-color .16s var(--ease);
}
.list-row:hover { border-color: var(--line-strong); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { font-size: 13.5px; color: var(--text); }
.list-row .sub { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.unread-dot {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 10.5px;
  background: var(--accent); color: #fff; display: inline-grid; place-items: center; font-weight: 600;
}
.tag {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel-2); font-size: 11.5px; color: var(--text-dim);
}
.tag:hover { color: var(--text); border-color: var(--line-strong); }
.form-grid { display: grid; gap: 14px; max-width: 460px; }
.bulkbar {
  position: sticky; bottom: 16px; display: flex; align-items: center; gap: 10px; margin-top: 18px;
  padding: 10px 14px; border-radius: 999px; background: #16181f; border: 1px solid var(--line-strong);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .6); z-index: 30;
}
.card.sel { border-color: rgba(106, 91, 255, .75); box-shadow: 0 0 0 1px rgba(106, 91, 255, .45) inset; }
.card .pick {
  position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; border-radius: 6px;
  border: 1.5px solid rgba(255, 255, 255, .5); background: rgba(0, 0, 0, .45); z-index: 3;
}
.card .pick.on { background: var(--accent); border-color: var(--accent); }
.card .pick.on::after { content: "✓"; position: absolute; inset: 0; color: #fff; font-size: 12px; display: grid; place-items: center; }
.print-preview { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background: #12141a; }
.badge-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-2); margin-left: 3px; vertical-align: super;
}

/* ── 模型能力卡片 ── */
.model-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1180px) { .model-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px) { .model-grid { grid-template-columns: 1fr; } }
.model-card {
  display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: var(--r-lg);
  border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.012));
  transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.model-card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: 0 20px 50px rgba(0,0,0,.45); }
.mc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.mc-name { font-size: 19px; font-weight: 650; letter-spacing: -.3px; }
.mc-tag { font-size: 11.5px; color: var(--text-faint); margin-top: 3px; }
.mc-dot { width: 26px; height: 26px; border-radius: 9px; flex: none; }
.mc-desc { font-size: 12.8px; color: var(--text-dim); line-height: 1.65; min-height: 62px; }
.mc-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.mc-specs span { display: block; font-size: 10.5px; color: var(--text-faint); letter-spacing: .5px; text-transform: uppercase; }
.mc-specs b { font-size: 12.5px; font-weight: 550; color: var(--text); }
.mc-specs + .btn { align-self: flex-start; }
.picker-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.picker {
  text-align: left; padding: 12px; border-radius: var(--r-md); border: 1px solid var(--line);
  background: rgba(255,255,255,.03); display: flex; flex-direction: column; gap: 4px;
  transition: all var(--dur) var(--ease);
}
.picker:hover { border-color: var(--line-strong); }
.picker.on { border-color: rgba(106,91,255,.75); background: rgba(106,91,255,.1); box-shadow: 0 0 0 1px rgba(106,91,255,.35) inset; }
.picker .n { font-size: 13.5px; font-weight: 600; }
.picker .d { font-size: 11px; color: var(--text-faint); line-height: 1.5; }

/* ── 模型能力横条 ── */
.models-strip { max-width: 1320px; margin: 6px auto 4px; padding: 0 18px; }
.strip-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.strip-head h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.2px; }
.strip-head .more { margin-left: auto; font-size: 12.5px; color: var(--text-dim); }
.strip-head .more:hover { color: var(--text); }
.strip-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.strip-card {
  display: flex; flex-direction: column; gap: 3px; padding: 13px 14px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: linear-gradient(180deg, var(--panel-2), rgba(255, 255, 255, .012));
  transition: all .18s var(--ease); min-width: 0;
}
.strip-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: 0 14px 34px rgba(0, 0, 0, .4); }
.strip-card .sc-dot { width: 18px; height: 18px; border-radius: 6px; margin-bottom: 6px; }
.strip-card .sc-name { font-size: 13.5px; font-weight: 620; }
.strip-card .sc-tag { font-size: 11px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip-card .sc-speed { font-size: 10.5px; color: var(--text-faint); opacity: .8; }

/* ── 富空态 ── */
.empty-rich { text-align: center; padding: 76px 20px; }
.empty-rich .er-orb {
  width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .22), rgba(106, 91, 255, .35) 45%, rgba(255, 79, 216, .18) 70%, transparent 72%);
  box-shadow: 0 0 60px rgba(106, 91, 255, .35), inset 0 0 30px var(--line-strong);
  animation: float 5s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-8px) } }
.empty-rich h2 { margin: 0 0 8px; font-size: 18px; font-weight: 550; }
.empty-rich p { margin: 0 0 18px; color: var(--text-faint); font-size: 13px; }

@media (max-width: 1100px) { .strip-row { grid-template-columns: repeat(2, 1fr); } }

/* ── 面板空态 ── */
.panel-empty { text-align: center; padding: 26px 12px; border: 1px dashed var(--line); border-radius: var(--r-md); background: rgba(255, 255, 255, .015); }
.panel-empty .pe-ico { font-size: 20px; opacity: .45; margin-bottom: 8px; }
.panel-empty .pe-t { font-size: 12.5px; color: var(--text-dim); }
.panel-empty .pe-d { font-size: 11px; color: var(--text-faint); margin-top: 4px; }
.lbl { font-size: 11.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .6px; }

/* ── 查看器统计浮层（对齐原站右上角） ── */
.viewer-stats {
  position: absolute; right: 18px; top: 18px; display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; color: var(--text-dim); text-align: right; pointer-events: none;
}
.viewer-stats > div { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.viewer-stats span { color: var(--text-faint); font-size: 11.5px; letter-spacing: .4px; }
.viewer-stats b { color: var(--text); font-weight: 550; font-variant-numeric: tabular-nums; min-width: 68px; text-align: left; }

/* 画布必须跟容器同尺寸（DPR>1 时旧写法会把画布撑成两倍，模型跑到角落） */
#canvas-host { position: relative; }
#canvas-host canvas { display: block !important; width: 100% !important; height: 100% !important; }

/* 模型页工具卡片（参考原站左侧功能导航的形态） */
.tool-cards { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.tool-card {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 10px 12px; text-align: left;
  background: rgba(255,255,255,.035);
  border: 1px solid var(--line, rgba(255,255,255,.09));
  border-radius: 11px; cursor: pointer;
  transition: background .16s, border-color .16s, transform .12s;
}
.tool-card:hover {
  background: rgba(124,92,255,.16);
  border-color: rgba(140,110,255,.55);
  transform: translateY(-1px);
}
.tool-card:active { transform: translateY(0); }
.tool-card:disabled { opacity: .5; cursor: default; transform: none; }
.tool-card .tc-ico {
  flex: 0 0 30px; height: 30px; display: grid; place-items: center;
  border-radius: 8px; font-size: 15px;
  background: rgba(124,92,255,.18); color: var(--accent);
}
.tool-card .tc-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tool-card .tc-txt b { font-size: 12.5px; font-weight: 600; color: var(--text); }
.tool-card .tc-txt i { font-size: 11px; font-style: normal; color: var(--text-faint); }

/* 左侧功能栏（参考原站 segmentation 页） */
.fn-rail {
  position: absolute; left: 0; top: 0; bottom: 0; width: 86px; z-index: 6;
  display: flex; flex-direction: column; gap: 2px; padding: 10px 0;
  background: rgba(14,16,22,.92); border-right: 1px solid rgba(255,255,255,.07);
  overflow-y: auto;
}
.fn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 11px 4px; background: none; border: none; cursor: pointer;
  color: var(--text-faint, var(--text-dim)); transition: color .15s, background .15s;
  border-left: 2px solid transparent;
}
.fn i { font-style: normal; font-size: 17px; }
.fn span { font-size: 10.5px; letter-spacing: .2px; }
.fn:hover { color: #d8dbe3; background: rgba(255,255,255,.04); }
.fn.active {
  color: var(--accent-soft); background: var(--panel-2);
  border-left-color: var(--accent);
}

/* 右侧参数面板 */
.fn-panel {
  border: 1px solid rgba(255,255,255,.09); border-radius: 12px;
  padding: 14px; margin-bottom: 16px; background: rgba(255,255,255,.03);
}
.fp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.fp-head b { font-size: 13.5px; }
.fp-cost { font-size: var(--fs-1); color: var(--accent-soft); }
.fp-desc { margin: 0 0 12px; font-size: 11.5px; line-height: 1.6; color: var(--text-faint, var(--text-dim)); }
.fp-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 11.5px; color: var(--text-dim, var(--text-dim)); margin-bottom: 8px;
}
.fp-row input[type="number"], .fp-row select {
  width: 96px; padding: 4px 7px; font-size: 11.5px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px; color: var(--text, var(--text));
}
.fp-run { width: 100%; margin-top: 4px; }

.fp-col { display: block; font-size: 11.5px; color: var(--text-dim, var(--text-dim)); margin-bottom: 10px; }
.fp-col input[type="text"] {
  width: 100%; margin-top: 6px; padding: 7px 9px; font-size: 12px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 7px; color: var(--text, var(--text));
}
.fp-hint { margin: 4px 0 10px; font-size: 11px; line-height: 1.55; color: var(--text-faint, var(--text-faint)); }

/* ═══ 模型工作台（对齐原站三栏 + 浮层）═══ */
.wk {
  display: grid;
  grid-template-columns: 64px 252px minmax(0, 1fr) 288px;
  width: 100%; height: 100%; min-height: 0; min-width: 0;
  background: #0a0b0f;
}

/* ① 功能栏 */
.wk-rail {
  display: flex; flex-direction: column; gap: 0;
  background: var(--panel-2); border-radius: 20px 0 0 20px;
  padding: 6px 0; overflow-y: auto;
}
.wk-rail .fn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  height: 78px; padding: 0 2px; background: none; border: none; cursor: pointer;
  color: var(--text-dim); transition: var(--dur-fast); border-radius: 12px; margin: 0 4px;
}
.wk-rail .fn i {
  width: 16px; height: 16px; flex: none;
  transition: transform .2s;
}
.wk-rail .fn span { font-size: 10px; line-height: 1.2; text-align: center; }
.wk-rail .fn:hover { color: var(--text); background: rgba(255,255,255,.03); }
.wk-rail .fn:hover i { transform: rotate(-30deg); }
/* 选中态：品牌靛蓝高亮。图标是 currentColor 的 mask，会自动一起变蓝 */
.wk-rail .fn.active {
  color: var(--accent-hover);
  background: var(--accent-subtle);
  box-shadow: inset 0 0 0 1px rgba(99,102,241,.34);
}
.wk-rail .fn.active:hover { color: var(--accent-hover); background: rgba(99,102,241,.2); }
.wk-rail .fn.active i { transform: none; }

/* 「部件拆分」可展开：下方三角随选中态变蓝，展开时翻转朝上 */
.wk-rail .fn-expandable::after {
  content: ""; width: 0; height: 0; flex: none;
  border-left: 5px solid transparent; border-right: 5px solid transparent;
  border-top: 6px solid currentColor;
  opacity: .4;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.wk-rail .fn-expandable.expanded::after { transform: rotate(180deg); opacity: .9; }

/* 「部件补全」是拆分的后续子项：默认隐藏，点开拆分后才出现 */
.wk-rail .fn[hidden] { display: none; }   /* 必须覆盖 .fn 的 display:flex，否则 hidden 属性失效 */
.wk-rail .fn-child {
  height: 66px; margin: 0 4px 0 12px;
  border-radius: 0 10px 10px 0;
  box-shadow: inset 1px 0 0 var(--line-strong);   /* 1px 中性连接线，表达从属层级 */
  color: var(--text-faint);
}
.wk-rail .fn-child.active {
  color: var(--accent-hover);
  /* 选中描边与分组竖线并存，竖线不在高亮处断开 */
  box-shadow: inset 1px 0 0 rgba(129,140,248,.65), inset 0 0 0 1px rgba(99,102,241,.34);
}

/* 连续子项拼成一段分组：相邻处收掉圆角，只保留整组首尾；组与上下功能留出呼吸间距 */
.wk-rail .fn-expandable + .fn-child { margin-top: 4px; }
.wk-rail .fn-child:has(+ .fn-child) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.wk-rail .fn-child + .fn-child { border-top-left-radius: 0; border-top-right-radius: 0; }
.wk-rail .fn-child:has(+ .fn:not(.fn-child)) { margin-bottom: 6px; }

/* 展开时的一次性淡入，不叠加重复入场 */
@keyframes fn-child-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.wk-rail .fn-child:not([hidden]) { animation: fn-child-in var(--dur) var(--ease) both; }
@media (prefers-reduced-motion: reduce) {
  .wk-rail .fn-child:not([hidden]) { animation: none; }
}

/* ② 功能面板 */
.wk-side {
  display: flex; flex-direction: column;
  background: var(--panel); border-right: 1px solid rgba(255,255,255,.06);
  padding: 16px 14px; overflow-y: auto;
}
.wk-side-empty { margin: auto; text-align: center; color: var(--text-faint); font-size: 12px; }
.wk-empty-ico { font-size: 30px; margin-bottom: 10px; opacity: .35; }
.wk-side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.wk-side-head b { font-size: 14px; color: var(--text); }
.wk-cost { font-size: 11px; color: var(--gold); }
.wk-side-desc { margin: 0 0 16px; font-size: 11.5px; line-height: 1.65; color: var(--text-dim); }
.wk-side-visual {
  border: 1px dashed rgba(255,255,255,.10); border-radius: 10px;
  padding: 26px 12px; text-align: center; margin: 8px 0 16px; color: var(--text-faint);
}
.wk-visual-ico { font-size: 30px; margin-bottom: 8px; }
.wk-side-visual p { margin: 0; font-size: 11px; }

/* 功能说明示意图：图片底色已校准为面板色，作为面板内容直接通栏铺入，
   不做成可点开 / 可放大的卡片，也不留独立色块 */
.wk-guide-inline {
  margin: 2px -14px 16px;
  background: var(--panel);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 1.2%, #000 98.8%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 1.2%, #000 98.8%, transparent 100%);
}
.wk-guide-inline img {
  display: block; width: 100%; height: auto;
  opacity: .96; filter: saturate(.95);
}

.wk-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 11.5px; color: var(--text-dim); margin-bottom: 9px;
}
.wk-row input[type="number"], .wk-row select {
  width: 92px; padding: 4px 7px; font-size: 11.5px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px; color: var(--text);
}
.wk-col { display: block; font-size: 11.5px; color: var(--text-dim); margin-bottom: 10px; }
.wk-col input[type="text"] {
  width: 100%; margin-top: 6px; padding: 7px 9px; font-size: 12px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 7px; color: var(--text);
}
.wk-hint { margin: 0 0 12px; font-size: 10.5px; line-height: 1.6; color: var(--text-faint); }
.wk-run {
  margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 20px; border: none; border-radius: 100px; cursor: pointer;
  background: linear-gradient(135deg, #ffdc6a 0%, #f7bd22 55%, #f0a800 100%);
  color: #1a1400; font-size: 14px; font-weight: 700;
  box-shadow: 0 4px 14px rgba(240,168,0,.28);
}
.wk-run:hover { filter: brightness(1.06); }
.wk-run:active { transform: translateY(1px); filter: brightness(.98); }
.wk-run:disabled { opacity: .55; cursor: default; }
.wk-run b { font-size: 11.5px; font-weight: 600; opacity: .75; }

/* 绑定与动画面板：上半自动绑定，下半动作库 */
.anim-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.anim-head b { font-size: 14px; color: var(--text); }
.anim-tag { font-size: 10px; letter-spacing: .06em; color: var(--text-dim); }
.anim-bind-card {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel-2);
}
.anim-bind-ico {
  width: 34px; height: 34px; flex: none; display: grid; place-items: center;
  border-radius: 9px; color: #fff;
  background: linear-gradient(150deg, #22d3ee 0%, #6366f1 100%);
}
.anim-bind-ico svg { width: 25px; height: 30px; }
.anim-bind-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.anim-bind-meta b { font-size: 12px; color: var(--text); }
.anim-bind-meta small { font-size: 10px; line-height: 1.3; color: var(--text-dim); }
.anim-bind-badge {
  margin-left: auto; flex: none; padding: 3px 7px; border-radius: 999px;
  border: 1px solid var(--line); font-size: 10px; color: var(--text-dim);
}
.wk-run.anim-bind-run, .wk-run.anim-apply {
  width: 100%; height: 38px; margin-top: 10px; font-size: 13px;
}
.anim-divider {
  display: flex; align-items: center; gap: 10px; margin: 18px 0 12px;
  font-size: 10.5px; letter-spacing: .08em; color: var(--text-dim);
}
.anim-divider::before, .anim-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.anim-search {
  display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2);
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.anim-search:focus-within {
  border-color: rgba(99,102,241,.6);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
}
.anim-search svg {
  width: 14px; height: 14px; flex: none; color: var(--text-dim);
  fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round;
}
.anim-search input {
  flex: 1; min-width: 0; border: none; outline: none; background: none;
  color: var(--text); font: 12px inherit;
}
.anim-search input::placeholder { color: var(--text-dim); }
.anim-tabs {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px; margin: 10px 0 12px;
}
.anim-tabs button {
  padding: 5px 2px; border-radius: 999px; cursor: pointer; text-align: center;
  border: 1px solid var(--line); background: none; color: var(--text-dim);
  font-size: 10.5px; font-family: inherit;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.anim-tabs button:hover { color: var(--text); border-color: var(--border-strong); }
.anim-tabs button.active {
  color: var(--accent-hover); border-color: rgba(99,102,241,.55); background: var(--accent-subtle);
}
.anim-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.anim-card {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px;
  min-height: 118px; padding: 8px 4px 10px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; background: rgba(0,0,0,.32);
  color: var(--text-dim);
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.anim-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.anim-card.active {
  color: var(--accent-hover); border-color: rgba(99,102,241,.7);
  background: rgba(99,102,241,.10); box-shadow: inset 0 0 0 1px rgba(99,102,241,.28);
}
.anim-figure {
  display: grid; place-items: center; width: 100%; height: 84px;
  color: rgba(226,232,255,.8);
}
.anim-figure svg { width: 100%; height: 84px; }
.anim-card.active .anim-figure { color: #c7d2fe; }
.anim-name { font-size: 11px; line-height: 1.2; text-align: center; }
.anim-empty { margin: 16px 0; text-align: center; font-size: 11px; color: var(--text-dim); }
.wk-run.anim-apply {
  position: sticky; bottom: 0; margin-top: 14px;
  box-shadow: 0 8px 20px rgba(0,0,0,.5), 0 4px 14px rgba(240,168,0,.28);
}
.anim-card:focus-visible, .anim-tabs button:focus-visible,
.wk-run.anim-bind-run:focus-visible, .wk-run.anim-apply:focus-visible {
  outline: 2px solid var(--accent-hover); outline-offset: 2px;
}

/* ③ 画布 */
.wk-canvas { position: relative; overflow: hidden; isolation: isolate; background: var(--bg-soft); }
.wk-stats {
  position: absolute; right: 16px; top: 14px; z-index: 5;
  display: flex; flex-direction: column; gap: 5px; text-align: right;
  font-size: 11.5px; color: #6d727d; pointer-events: none;
}
.wk-stat span { margin-right: 8px; }
.wk-stat b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.wk-viewtools {
  position: absolute; right: 14px; top: 108px; z-index: 5;
  display: flex; flex-direction: column; gap: 4px;
  background: rgba(22,24,30,.86); border: 1px solid rgba(255,255,255,.07);
  border-radius: 12px; padding: 5px; 
}
.wk-viewtools button {
  width: 30px; height: 30px; border: none; border-radius: 8px; cursor: pointer;
  background: none; color: #7b8090; font-size: 13px;
}
.wk-viewtools button:hover { background: rgba(255,255,255,.07); color: var(--text); }
.wk-viewtools button.active { background: rgba(124,92,255,.5); color: #fff; }
.wk-swatches {
  position: absolute; left: 50%; bottom: 72px; transform: translateX(-50%); z-index: 5;
  display: flex; gap: 2px; padding: 3px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--r-full);
}
.wk-swatches button {
  white-space: nowrap; padding: 5px 13px; border: none; border-radius: var(--r-full); cursor: pointer;
  background: none; color: var(--text-faint);
  font-size: var(--fs-2); font-family: inherit;
  transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.wk-swatches button:hover { color: var(--text-dim); }
.wk-swatches button.active { background: var(--surface-4); color: var(--text); font-weight: 500; }

.wk-dock {
  position: absolute; left: 50%; bottom: var(--s-4); transform: translateX(-50%); z-index: 5;
  display: flex; align-items: center; gap: 2px; padding: 4px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-2);
}
.wk-dock-btn {
  display: flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 7px 14px; border-radius: var(--r-sm); border: none; cursor: pointer;
  background: none; color: var(--text-dim);
  font-size: var(--fs-2); font-family: inherit; text-decoration: none;
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.wk-dock-btn i { width: 14px; height: 14px; }
.wk-dock-btn:hover { background: var(--panel-3); color: var(--text); }
.wk-dock-btn.primary { background: var(--accent); color: #fff; }
.wk-dock-btn.primary:hover { background: var(--accent-hover); }
.wk-dock-sep { width: 1px; height: 18px; background: var(--line); margin: 0 3px; }

@media (max-width: 1180px) {
  .workspace { grid-template-columns: 1fr; height: auto; }
  .viewer-wrap { grid-template-columns: 1fr; height: auto; }
  #canvas-host { height: 58vh; }
  .viewer-side { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .topbar { gap: 8px; padding: 0 12px; height: 56px; }
  .nav { display: none; }
  .hero { padding-top: 44px; }
  .container { padding: 18px 12px 70px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .card .meta { padding: 8px 9px; }
}

/* ── 多视图 / 批量 / 集合 / 消息 / 设置 ── */
.mv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mv-slot { min-height: 96px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.batch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-top: 10px; }
.batch-item { position: relative; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); background: var(--panel-2); }
.batch-item img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.batch-item .x {
  position: absolute; top: 3px; right: 5px; width: 16px; height: 16px; border-radius: 50%;
  background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; line-height: 16px; text-align: center; cursor: pointer;
}
.batch-item .wait {
  position: absolute; inset: auto 0 0 0; padding: 3px 4px; font-size: 10px; text-align: center;
  background: rgba(0, 0, 0, .65); color: var(--gold);
}

.list-row {
  display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: rgba(255, 255, 255, .02); transition: border-color .16s var(--ease);
}
.list-row:hover { border-color: var(--line-strong); }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { font-size: 13.5px; color: var(--text); }
.list-row .sub { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.unread-dot {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 10.5px;
  background: var(--accent); color: #fff; display: inline-grid; place-items: center; font-weight: 600;
}
.tag {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel-2); font-size: 11.5px; color: var(--text-dim);
}
.tag:hover { color: var(--text); border-color: var(--line-strong); }
.form-grid { display: grid; gap: 14px; max-width: 460px; }
.bulkbar {
  position: sticky; bottom: 16px; display: flex; align-items: center; gap: 10px; margin-top: 18px;
  padding: 10px 14px; border-radius: 999px; background: #16181f; border: 1px solid var(--line-strong);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .6); z-index: 30;
}
.card.sel { border-color: rgba(106, 91, 255, .75); box-shadow: 0 0 0 1px rgba(106, 91, 255, .45) inset; }
.card .pick {
  position: absolute; top: 10px; right: 10px; width: 20px; height: 20px; border-radius: 6px;
  border: 1.5px solid rgba(255, 255, 255, .5); background: rgba(0, 0, 0, .45); z-index: 3;
}
.card .pick.on { background: var(--accent); border-color: var(--accent); }
.card .pick.on::after { content: "✓"; position: absolute; inset: 0; color: #fff; font-size: 12px; display: grid; place-items: center; }
.print-preview { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background: #12141a; }
.badge-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent-2); margin-left: 3px; vertical-align: super;
}

/* ── 模型能力卡片 ── */
.model-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1180px) { .model-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px) { .model-grid { grid-template-columns: 1fr; } }
.model-card {
  display: flex; flex-direction: column; gap: 12px; padding: 20px; border-radius: var(--r-lg);
  border: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.012));
  transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.model-card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: 0 20px 50px rgba(0,0,0,.45); }
.mc-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.mc-name { font-size: 19px; font-weight: 650; letter-spacing: -.3px; }
.mc-tag { font-size: 11.5px; color: var(--text-faint); margin-top: 3px; }
.mc-dot { width: 26px; height: 26px; border-radius: 9px; flex: none; }
.mc-desc { font-size: 12.8px; color: var(--text-dim); line-height: 1.65; min-height: 62px; }
.mc-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.mc-specs span { display: block; font-size: 10.5px; color: var(--text-faint); letter-spacing: .5px; text-transform: uppercase; }
.mc-specs b { font-size: 12.5px; font-weight: 550; color: var(--text); }
.mc-specs + .btn { align-self: flex-start; }
.picker-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.picker {
  text-align: left; padding: 12px; border-radius: var(--r-md); border: 1px solid var(--line);
  background: rgba(255,255,255,.03); display: flex; flex-direction: column; gap: 4px;
  transition: all var(--dur) var(--ease);
}
.picker:hover { border-color: var(--line-strong); }
.picker.on { border-color: rgba(106,91,255,.75); background: rgba(106,91,255,.1); box-shadow: 0 0 0 1px rgba(106,91,255,.35) inset; }
.picker .n { font-size: 13.5px; font-weight: 600; }
.picker .d { font-size: 11px; color: var(--text-faint); line-height: 1.5; }

/* ── 模型能力横条 ── */
.models-strip { max-width: 1320px; margin: 6px auto 4px; padding: 0 18px; }
.strip-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px; }
.strip-head h2 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.2px; }
.strip-head .more { margin-left: auto; font-size: 12.5px; color: var(--text-dim); }
.strip-head .more:hover { color: var(--text); }
.strip-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.strip-card {
  display: flex; flex-direction: column; gap: 3px; padding: 13px 14px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: linear-gradient(180deg, var(--panel-2), rgba(255, 255, 255, .012));
  transition: all .18s var(--ease); min-width: 0;
}
.strip-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: 0 14px 34px rgba(0, 0, 0, .4); }
.strip-card .sc-dot { width: 18px; height: 18px; border-radius: 6px; margin-bottom: 6px; }
.strip-card .sc-name { font-size: 13.5px; font-weight: 620; }
.strip-card .sc-tag { font-size: 11px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip-card .sc-speed { font-size: 10.5px; color: var(--text-faint); opacity: .8; }

/* ── 富空态 ── */
.empty-rich { text-align: center; padding: 76px 20px; }
.empty-rich .er-orb {
  width: 84px; height: 84px; margin: 0 auto 18px; border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .22), rgba(106, 91, 255, .35) 45%, rgba(255, 79, 216, .18) 70%, transparent 72%);
  box-shadow: 0 0 60px rgba(106, 91, 255, .35), inset 0 0 30px var(--line-strong);
  animation: float 5s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-8px) } }
.empty-rich h2 { margin: 0 0 8px; font-size: 18px; font-weight: 550; }
.empty-rich p { margin: 0 0 18px; color: var(--text-faint); font-size: 13px; }

@media (max-width: 1100px) { .strip-row { grid-template-columns: repeat(2, 1fr); } }

/* ── 面板空态 ── */
.panel-empty { text-align: center; padding: 26px 12px; border: 1px dashed var(--line); border-radius: var(--r-md); background: rgba(255, 255, 255, .015); }
.panel-empty .pe-ico { font-size: 20px; opacity: .45; margin-bottom: 8px; }
.panel-empty .pe-t { font-size: 12.5px; color: var(--text-dim); }
.panel-empty .pe-d { font-size: 11px; color: var(--text-faint); margin-top: 4px; }
.lbl { font-size: 11.5px; color: var(--text-faint); text-transform: uppercase; letter-spacing: .6px; }

/* ── 查看器统计浮层（对齐原站右上角） ── */
.viewer-stats {
  position: absolute; right: 18px; top: 18px; display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; color: var(--text-dim); text-align: right; pointer-events: none;
}
.viewer-stats > div { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.viewer-stats span { color: var(--text-faint); font-size: 11.5px; letter-spacing: .4px; }
.viewer-stats b { color: var(--text); font-weight: 550; font-variant-numeric: tabular-nums; min-width: 68px; text-align: left; }

/* 画布必须跟容器同尺寸（DPR>1 时旧写法会把画布撑成两倍，模型跑到角落） */
#canvas-host { position: relative; }
#canvas-host canvas { display: block !important; width: 100% !important; height: 100% !important; }

/* 模型页工具卡片（参考原站左侧功能导航的形态） */
.tool-cards { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.tool-card {
  display: flex; align-items: center; gap: 11px;
  width: 100%; padding: 10px 12px; text-align: left;
  background: rgba(255,255,255,.035);
  border: 1px solid var(--line, rgba(255,255,255,.09));
  border-radius: 11px; cursor: pointer;
  transition: background .16s, border-color .16s, transform .12s;
}
.tool-card:hover {
  background: rgba(124,92,255,.16);
  border-color: rgba(140,110,255,.55);
  transform: translateY(-1px);
}
.tool-card:active { transform: translateY(0); }
.tool-card:disabled { opacity: .5; cursor: default; transform: none; }
.tool-card .tc-ico {
  flex: 0 0 30px; height: 30px; display: grid; place-items: center;
  border-radius: 8px; font-size: 15px;
  background: rgba(124,92,255,.18); color: var(--accent);
}
.tool-card .tc-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tool-card .tc-txt b { font-size: 12.5px; font-weight: 600; color: var(--text); }
.tool-card .tc-txt i { font-size: 11px; font-style: normal; color: var(--text-faint); }

/* 左侧功能栏（参考原站 segmentation 页） */
.fn-rail {
  position: absolute; left: 0; top: 0; bottom: 0; width: 86px; z-index: 6;
  display: flex; flex-direction: column; gap: 2px; padding: 10px 0;
  background: rgba(14,16,22,.92); border-right: 1px solid rgba(255,255,255,.07);
  overflow-y: auto;
}
.fn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 11px 4px; background: none; border: none; cursor: pointer;
  color: var(--text-faint, var(--text-dim)); transition: color .15s, background .15s;
  border-left: 2px solid transparent;
}
.fn i { font-style: normal; font-size: 17px; }
.fn span { font-size: 10.5px; letter-spacing: .2px; }
.fn:hover { color: #d8dbe3; background: rgba(255,255,255,.04); }
.fn.active {
  color: var(--accent-soft); background: var(--panel-2);
  border-left-color: var(--accent);
}

/* 右侧参数面板 */
.fn-panel {
  border: 1px solid rgba(255,255,255,.09); border-radius: 12px;
  padding: 14px; margin-bottom: 16px; background: rgba(255,255,255,.03);
}
.fp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.fp-head b { font-size: 13.5px; }
.fp-cost { font-size: var(--fs-1); color: var(--accent-soft); }
.fp-desc { margin: 0 0 12px; font-size: 11.5px; line-height: 1.6; color: var(--text-faint, var(--text-dim)); }
.fp-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 11.5px; color: var(--text-dim, var(--text-dim)); margin-bottom: 8px;
}
.fp-row input[type="number"], .fp-row select {
  width: 96px; padding: 4px 7px; font-size: 11.5px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 6px; color: var(--text, var(--text));
}
.fp-run { width: 100%; margin-top: 4px; }

.fp-col { display: block; font-size: 11.5px; color: var(--text-dim, var(--text-dim)); margin-bottom: 10px; }
.fp-col input[type="text"] {
  width: 100%; margin-top: 6px; padding: 7px 9px; font-size: 12px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  border-radius: 7px; color: var(--text, var(--text));
}
.fp-hint { margin: 4px 0 10px; font-size: 11px; line-height: 1.55; color: var(--text-faint, var(--text-faint)); }

/* ④ 资产栏 */
.wk-assets {
  display: flex; flex-direction: column;
  background: var(--panel); border-left: 1px solid var(--line);
  padding: var(--s-3) var(--s-3) 0;
  overflow-y: auto; overflow-x: hidden;
  min-height: 0; max-height: 100%;
  scroll-padding-bottom: 96px;   /* 滚到底部保留留白 */
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.wk-assets::-webkit-scrollbar { width: 8px; }
.wk-assets::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.28); border-radius: 4px;
}
.wk-assets::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.45); }
.wk-assets::-webkit-scrollbar-track { background: transparent; }
.wk-assets-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.wk-assets-head b { font-size: 13.5px; color: var(--text); }
.wk-assets-head a { font-size: 11.5px; color: #6d727d; text-decoration: none; }
.wk-assets-head a:hover { color: var(--accent); }
.wk-asset-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
  align-content: start;
  flex: 0 0 auto;
  margin-bottom: 80px;   /* 底部留白：滚到底也留有呼吸感 */
}
.wk-asset {
  position: relative;
  display: grid; place-items: center;
  aspect-ratio: 1;
  border-radius: var(--r-sm); overflow: hidden;
  background: radial-gradient(130% 120% at 50% 0%, #18181e 0%, var(--panel-2) 62%);
  border: 1px solid var(--line);
  transition: border-color var(--dur-fast) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
/* 关键修复：图片绝对定位撑满卡片，height:100% 才能相对卡片（aspect-ratio 提供的确定高度）解析，
   object-fit:contain 才真正生效。否则百分比高度失效、图片按原高溢出，下半截被 overflow:hidden 裁掉。 */
.wk-asset img {
  position: absolute; inset: 0;
  display: block;
  width: 100%; height: 100%;
  object-fit: contain; object-position: center;
  transition: transform var(--dur) var(--ease);
}
.wk-asset:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0,0,0,.5);
}
.wk-asset:hover img { transform: scale(1.04); }
.wk-asset-ph { color: var(--text-faint); font-size: 14px; }

/* 资产栏首格：上传 3D 模型 */
.wk-upload {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; padding: 6px;
  aspect-ratio: 1;
  border: 1px dashed rgba(255,255,255,.20); border-radius: var(--r-sm);
  background: rgba(255,255,255,.018);
  color: var(--text-dim); text-align: center; cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), transform var(--dur) var(--ease);
}
.wk-upload:hover {
  border-color: var(--accent-hover);
  background: rgba(129,140,248,.07);
  transform: translateY(-2px);
}
.wk-upload:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
.wk-upload:disabled { opacity: .72; cursor: default; transform: none; }
.wk-upload-plus {
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.20);
  font-size: 17px; line-height: 1; color: var(--text);
}
.wk-upload b { font-size: 11px; font-weight: 600; color: var(--text); }
.wk-upload small { font-size: 8.5px; line-height: 1.55; white-space: nowrap; color: #8b8b96; }
.wk-upload-spin {
  width: 20px; height: 20px; flex: none; border-radius: 50%;
  border: 2px solid rgba(129,140,248,.25); border-top-color: var(--accent-hover);
  animation: wkUploadSpin .8s linear infinite;
}
@keyframes wkUploadSpin { to { transform: rotate(360deg); } }

/* 未选中模型：中间画布就是星空大屏，隐藏只对具体模型有意义的控件 */
.wk.wk-no-model .wk-stats,
.wk.wk-no-model .wk-viewtools,
.wk.wk-no-model .wk-swatches,
.wk.wk-no-model .wk-dock { display: none; }
/* 中间画布比整页窄，横向裁切后把黑洞留在可见区中央偏左，品牌标识相应收紧 */
.wk.wk-no-model .wk-idle-art { object-position: 14% center; }
.wk.wk-no-model .wk-idle-brand { gap: 10px; }
.wk.wk-no-model .wk-idle-brand img { width: 50px; height: 50px; }
.wk.wk-no-model .wk-idle-word b { font-size: 24px; }
.wk.wk-no-model .wk-idle-word em { font-size: 12px; }

/* 空闲大屏：仅在未选中模型时显示黑洞太空画面，标题位置换成星际思维品牌标识。
   选中模型后整层隐藏，画布回到 --bg-soft 纯色，避免与 3D 观察争注意力。 */
.wk-idle {
  position: absolute; inset: 0; z-index: -1; overflow: hidden;
  pointer-events: none; background: #05070f;
  transition: opacity .5s var(--ease);
}
.wk-canvas.has-model .wk-idle { opacity: 0; visibility: hidden; }
/* 背景已按当前画布比例裁成 886×712（约 1.24:1），铺入时几乎不需要二次缩放，
   只保留左上角黑洞与右下角一小段地球弧线，不再把整条地平线拉满画面。 */
.wk-idle-art {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 20% center;
  animation: wkIdleDrift 46s ease-in-out infinite alternate;
}
@keyframes wkIdleDrift {
  from { transform: scale(1.02); }
  to   { transform: scale(1.09) translate3d(-1.2%, -0.8%, 0); }
}
.wk-idle-sky { position: absolute; inset: 0; width: 100%; height: 100%; }
.wk-idle-shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(4,7,16,.42) 0%, rgba(4,7,16,.18) 38%, rgba(4,7,16,0) 74%),
    linear-gradient(0deg, rgba(4,7,16,.48) 0%, rgba(4,7,16,0) 42%);
}
.wk-idle-brand {
  position: absolute; left: 8%; top: 46%; transform: translateY(-50%);
  display: flex; align-items: center; gap: 14px;
}
.wk-idle-brand img { width: 64px; height: 64px; flex: none; }
.wk-idle-word { display: flex; flex-direction: column; gap: 3px; }
.wk-idle-word b {
  font-size: 30px; font-weight: 700; letter-spacing: .04em;
  line-height: 1.1; color: #f2f4ff;
}
.wk-idle-word em {
  font-size: 15px; font-style: italic; letter-spacing: .06em; color: #a5b4fc;
}
.wk-idle-full {
  position: relative; height: calc(100vh - 62px); overflow: hidden;
  isolation: isolate; background: #05070f;
}
.wk-idle-full .wk-idle-brand { left: 10%; top: 45%; gap: 16px; }
.wk-idle-full .wk-idle-brand img { width: 78px; height: 78px; }
.wk-idle-full .wk-idle-word b { font-size: 40px; }
.wk-idle-full .wk-idle-word em { font-size: 19px; }
.wk-idle-entry {
  position: absolute; right: 28px; bottom: 26px; z-index: 1;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18); background: rgba(10,14,28,.55);
  color: #dfe4f5; font-size: 12px; text-decoration: none;
  transition: border-color .18s ease, background .18s ease;
}
.wk-idle-entry:hover { border-color: var(--accent-hover); background: rgba(129,140,248,.18); }
.wk-idle-entry:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
.wk-idle-entry span { font-size: 14px; }
@media (max-width: 900px) {
  .wk-idle-brand { left: 6%; gap: 10px; }
  .wk-idle-brand img { width: 48px; height: 48px; }
  .wk-idle-word b { font-size: 22px; }
  .wk-idle-word em { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .wk-idle-art { animation: none; }
  .wk-idle, .wk-idle-entry { transition: none; }
  .wk-upload-spin { animation-duration: 2s; }
}

.wk-info-title {
  font-size: var(--fs-4); font-weight: 600; color: var(--text);
  line-height: 1.35; margin-bottom: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wk-info-sub { font-size: var(--fs-2); color: var(--text-faint); margin-bottom: var(--s-2); }
.wk-kv {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3);
  padding: 5px 0; border-bottom: 1px solid var(--line);
  font-size: var(--fs-2); color: var(--text-faint);
}
.wk-kv:last-of-type { border-bottom: none; }
.wk-kv b {
  color: var(--text); font-weight: 500; font-family: var(--mono);
  font-size: var(--fs-2); font-variant-numeric: tabular-nums;
}

/* 工作台撑满视口（顶栏 56px）：父容器也要撑高，否则只剩内容高度 */
/* 工作台是定高应用页：用 body 上的标记锁死高度，不依赖 :has() */
body.wk-page { width: 100%; height: 100vh; overflow: hidden; }
body.wk-page .shell { width: 100%; height: 100vh; min-height: 0; overflow: hidden; }
body.wk-page .page { flex: 1 1 auto; width: 100%; min-width: 0; min-height: 0; overflow: hidden; }
.wk { width: 100%; height: 100%; min-height: 0; grid-template-rows: 100%; }

/* ── 生成模型面板 ── */
.gen-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.gen-head i { width: 16px; height: 16px; color: var(--accent); }
.gen-head b { font-size: 14px; color: var(--text); }
/* 生成方式：图标胶囊切换，名称只在 hover / 键盘聚焦时出现 */
.gen-modebar {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px;
  padding: 5px; margin-bottom: 12px;
  border-radius: 100px; background: rgba(9, 11, 24, .62);
  border: 1px solid rgba(255,255,255,.07);
}
.gen-mode {
  position: relative; display: grid; place-items: center;
  height: 34px; padding: 0; border: none; border-radius: 100px;
  background: transparent; color: #c6cbdd; cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.gen-mode svg {
  width: 19px; height: 19px; fill: none; stroke: currentColor;
  stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round;
}
.gen-mode:hover { background: rgba(255,255,255,.09); color: #fff; }
.gen-mode.active, .gen-mode.active:hover { background: #fff; color: #171a2e; }
.gen-mode:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
.gen-mode::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 9px); left: 50%;
  transform: translate(-50%, -4px); z-index: 30;
  padding: 5px 9px; border-radius: 7px; white-space: nowrap;
  background: #23263c; border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 8px 20px rgba(0,0,0,.45);
  color: #eef0f7; font-size: 11px; line-height: 1.25;
  opacity: 0; pointer-events: none;
  transition: opacity .16s ease, transform .16s cubic-bezier(.16,1,.3,1);
}
.gen-mode:hover::after, .gen-mode:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.gen-mode:first-child::after { left: 0; transform: translate(0, -4px); }
.gen-mode:first-child:hover::after, .gen-mode:first-child:focus-visible::after { transform: translate(0, 0); }
.gen-mode:last-child::after { left: auto; right: 0; transform: translate(0, -4px); }
.gen-mode:last-child:hover::after, .gen-mode:last-child:focus-visible::after { transform: translate(0, 0); }
.gen-hint { margin: 0 0 10px; font-size: 10.5px; color: #a3a7ba; line-height: 1.5; transition: opacity .16s ease; }
/* hover 图标时说明文字让位给浮出的名称提示 */
.gen-modebar:hover ~ .gen-hint { opacity: .22; }

/* 棋盘格 + 虚线：上传区（单图 / 多视图共用一套视觉） */
.gen-drop, .gen-views {
  background-color: #191b2b;
  background-image:
    linear-gradient(45deg, rgba(255,255,255,.045) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,.045) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,.045) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.045) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  border: 1px dashed rgba(140,110,255,.55); border-radius: 12px;
}
.gen-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px;
  min-height: 172px; cursor: pointer; margin-bottom: 10px;
}
.gen-drop:hover { border-color: rgba(140,110,255,.9); }
.gen-drop-ico { display: grid; place-items: center; width: 34px; height: 34px; color: #e3e7f6; }
.gen-drop-ico svg {
  width: 30px; height: 30px; fill: none; stroke: currentColor;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.gen-drop > span:not(.gen-drop-ico) { font-size: 12.5px; color: #e6e9f5; }
.gen-drop em { font-size: 10px; color: #a3a7ba; font-style: normal; text-align: center; }

/* 多视图：前 / 左侧 / 右侧 / 后 四个独立上传格 */
.gen-views {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px;
  padding: 6px; margin-bottom: 10px;
}
.gen-view {
  position: relative; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  min-height: 94px; padding: 6px 3px; font: inherit; text-align: center;
  border: 1px dashed rgba(255,255,255,.16); border-radius: 9px;
  background: rgba(9, 11, 24, .42); color: #dfe4f5; cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}
.gen-view:hover { border-color: rgba(140,110,255,.85); background: rgba(22,24,44,.66); }
.gen-view:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 1px; }
.gen-view-ico { display: grid; place-items: center; color: #c9d0e6; }
.gen-view-ico svg {
  width: 26px; height: 26px; fill: none; stroke: currentColor;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.gen-view-ico.flip svg { transform: scaleX(-1); }
.gen-view b { font-size: 11.5px; font-weight: 600; color: #e9ecf7; }
.gen-view em { font-size: 9px; line-height: 1.45; color: #a3a7ba; font-style: normal; }
.gen-view.filled { padding: 0; border-style: solid; border-color: rgba(129,140,248,.6); }
.gen-view.filled img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; border-radius: 8px;
}
.gen-view-del {
  position: absolute; right: 4px; top: 4px; z-index: 2;
  display: grid; place-items: center; width: 18px; height: 18px;
  border-radius: 50%; background: rgba(8,10,20,.82);
  border: 1px solid rgba(255,255,255,.2); color: #fff; font-size: 12px; line-height: 1;
}
.gen-view-del:hover { background: rgba(129,140,248,.6); }
@media (prefers-reduced-motion: reduce) {
  .gen-mode, .gen-mode::after, .gen-view, .gen-hint { transition: none; }
}

.gen-textarea {
  width: 100%; min-height: 120px; padding: 10px 12px; margin-bottom: 10px;
  font-size: 12px; line-height: 1.6; resize: vertical;
  background: var(--panel-2); border: 1px solid rgba(140,110,255,.35);
  border-radius: 10px; color: var(--text); outline: none;
}
.gen-textarea:focus { border-color: rgba(140,110,255,.8); }

.gen-thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-bottom: 10px; }
.gen-thumb { position: relative; aspect-ratio: 1; border-radius: 7px; overflow: hidden; background: var(--panel-2); }
.gen-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gen-thumb button {
  position: absolute; right: 2px; top: 2px; width: 16px; height: 16px;
  border: none; border-radius: 50%; cursor: pointer;
  background: rgba(0,0,0,.7); color: #fff; font-size: 11px; line-height: 1;
}

.gen-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 11.5px; color: var(--text-dim); margin-bottom: 10px;
}
.gen-row > span { white-space: nowrap; flex: none; }
.gen-row input[type="range"] { flex: 1; min-width: 0; accent-color: var(--accent); }
.gen-row input[type="number"] {
  flex: none; width: 68px; padding: 5px 7px; font-size: 11.5px; text-align: center;
  background: var(--panel-2); border: 1px solid rgba(255,255,255,.12);
  border-radius: 7px; color: var(--text);
}
.gen-pill { display: flex; gap: 3px; padding: 2px; background: var(--panel-2); border-radius: 8px; }
.gen-pill button {
  padding: 5px 14px; border: none; border-radius: 6px; cursor: pointer;
  background: none; color: var(--text-dim); font-size: 11.5px;
}
.gen-pill button.active { background: rgba(124,92,255,.35); color: #fff; }

/* ── 重拓扑 / 纹理生成 / 局部重绘：参考稿同款控件 ── */
.wk-side-head { gap: 8px; }
.wk-side-head i { width: 16px; height: 16px; flex: none; color: var(--accent-hover); }
.wk-side-head b { margin-right: auto; }
.wk-side-head .wk-cost { flex: none; }
.wk-side .wk-hint { color: #a3a7ba; }

.wk-label {
  display: flex; align-items: center; gap: 6px;
  margin: 18px 0 10px; font-size: 12.5px; font-weight: 600; color: var(--text);
}
.wk-help {
  position: relative; display: inline-grid; place-items: center;
  width: 15px; height: 15px; flex: none; color: var(--text-dim); cursor: help;
}
.wk-help i { width: 14px; height: 14px; }
.wk-help::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 9px); left: 0; z-index: 40;
  width: max-content; max-width: 206px; white-space: normal;
  padding: 7px 9px; border-radius: 8px;
  background: #23263c; border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 8px 20px rgba(0,0,0,.45);
  color: #eef0f7; font-size: 10.5px; font-weight: 400; line-height: 1.5;
  opacity: 0; pointer-events: none;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s cubic-bezier(.16,1,.3,1);
}
.wk-help:hover::after, .wk-help:focus-visible::after { opacity: 1; transform: none; }
.wk-help:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; border-radius: 50%; }
.wk-toggle-row .wk-help::after { left: auto; right: 0; }

.wk-seg2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.wk-seg2 button {
  height: 46px; border-radius: 10px; cursor: pointer; font: inherit;
  font-size: 13px; font-weight: 600;
  border: 1px solid rgba(255,255,255,.13); background: rgba(255,255,255,.03);
  color: var(--text-dim);
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.wk-seg2 button:hover { border-color: rgba(129,140,248,.55); color: #e8ebf6; }
.wk-seg2 button:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
.wk-seg2 button.active, .wk-seg2 button.active:hover {
  background: rgba(99,102,241,.22); border-color: rgba(129,140,248,.82); color: #fff;
  box-shadow: inset 0 0 0 1px rgba(129,140,248,.18);
}
.wk-seg2.soft {
  gap: 3px; padding: 3px; margin-bottom: 14px;
  background: rgba(9,11,24,.62); border: 1px solid rgba(255,255,255,.07);
  border-radius: 100px;
}
.wk-seg2.soft button { height: 36px; border: none; border-radius: 100px; background: transparent; font-size: 12.5px; }
.wk-seg2.soft button.active, .wk-seg2.soft button.active:hover {
  background: #fff; color: #171a2e; box-shadow: 0 2px 8px rgba(0,0,0,.28);
}

.wk-toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 16px 0 4px; font-size: 12px; color: var(--text);
}
.wk-toggle-label { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.wk-switch { position: relative; flex: none; display: inline-block; width: 38px; height: 22px; cursor: pointer; }
.wk-switch input {
  position: absolute; inset: 0; z-index: 2;
  width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer;
}
.wk-switch-track {
  display: block; width: 38px; height: 22px; border-radius: 100px;
  background: #3a3d4b; border: 1px solid rgba(255,255,255,.10);
  transition: background .2s ease, border-color .2s ease;
}
.wk-switch-track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%; background: #e9ecf5;
  box-shadow: 0 2px 5px rgba(0,0,0,.35);
  transition: transform .2s cubic-bezier(.16,1,.3,1);
}
.wk-switch input:checked + .wk-switch-track { background: #6366f1; border-color: #818cf8; }
.wk-switch input:checked + .wk-switch-track::after { transform: translateX(16px); }
.wk-switch input:focus-visible + .wk-switch-track { outline: 2px solid var(--accent-hover); outline-offset: 2px; }

.wk-slider-row { display: flex; align-items: center; gap: 10px; }
.wk-slider-row input[type="range"] { flex: 1; min-width: 0; accent-color: var(--accent); }
.wk-slider-row input[type="range"].is-zero { opacity: .6; }
.wk-auto, .wk-value {
  flex: none; min-width: 64px; height: 34px; padding: 0 8px;
  display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.14); border-radius: 10px;
  background: rgba(255,255,255,.04); color: var(--text-dim);
  font: inherit; font-size: 11.5px; text-align: center;
}
.wk-auto { cursor: pointer; }
.wk-auto:hover { border-color: rgba(129,140,248,.6); }
.wk-auto.active { border-color: rgba(129,140,248,.62); background: rgba(99,102,241,.16); color: #eef0f7; }
.wk-auto:focus-visible, .wk-select-row:focus-visible, .wk-tex-recap:focus-visible {
  outline: 2px solid var(--accent-hover); outline-offset: 2px;
}

/* 纹理生成：紫色描边卡片 + 三图标来源切换 */
.wk-tex-card {
  padding: 10px; margin-bottom: 2px;
  border: 1px solid rgba(129,140,248,.7); border-radius: 14px;
  background: rgba(99,102,241,.07);
}
.wk-tex-card .gen-modebar { margin-bottom: 10px; }
.gen-modebar.three { grid-template-columns: repeat(3, 1fr); }
/* 多视图四格与文本描述框共用卡片内边距，不留多余外边距 */
.wk-tex-views { margin-bottom: 0; }
.wk-tex-prompt {
  min-height: 190px; margin-bottom: 0; padding: 12px 12px 34px;
  background: rgba(9, 11, 24, .62);
}
.wk-tex-idea {
  position: absolute; left: 10px; bottom: 11px; z-index: 2;
  display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: 50%; border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.08); color: #e6e9f5; cursor: pointer;
  transition: background .18s ease;
}
.wk-tex-idea svg {
  width: 17px; height: 17px; fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.wk-tex-idea:hover, .wk-tex-idea:focus-visible { background: rgba(129,140,248,.5); outline: none; }
.wk-tex-card .wk-counter { bottom: 18px; }
.wk-tex-drop { position: relative; min-height: 150px; margin-bottom: 0; overflow: hidden; }
.wk-tex-preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.wk-tex-clear {
  position: absolute; right: 8px; top: 8px; z-index: 2;
  display: grid; place-items: center; width: 22px; height: 22px;
  border-radius: 50%; background: rgba(8,10,20,.82);
  border: 1px solid rgba(255,255,255,.2); color: #fff; font-size: 14px; line-height: 1; cursor: pointer;
}
.wk-tex-clear:hover { background: rgba(129,140,248,.6); }
.wk-tex-state {
  position: relative; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  min-height: 150px; padding: 12px; text-align: center;
  border: 1px dashed rgba(140,110,255,.35); border-radius: 10px;
  background: rgba(9,11,24,.42);
}
.wk-tex-state-ico { display: grid; place-items: center; width: 34px; height: 34px; color: #c9d0e6; }
.wk-tex-state-ico svg {
  width: 30px; height: 30px; fill: none; stroke: currentColor;
  stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.wk-tex-state b { font-size: 12px; color: #e6e9f5; }
.wk-tex-state em { font-size: 10px; font-style: normal; color: #a3a7ba; line-height: 1.5; }
.wk-tex-view {
  display: block; width: 100%; height: 112px; object-fit: contain;
  border-radius: 9px; background: #0d0f18;
}
.wk-tex-recap {
  padding: 5px 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 100px;
  background: rgba(12,14,26,.85); color: #dfe4f5; font: inherit; font-size: 10.5px; cursor: pointer;
}
.wk-tex-recap:hover:not(:disabled) { border-color: rgba(129,140,248,.7); }
.wk-tex-recap:disabled { opacity: .5; cursor: default; }

.wk-select-row {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px;
  border: 1px solid rgba(255,255,255,.12); border-radius: 12px;
  background: var(--panel-2); color: var(--text); font: inherit;
  cursor: pointer; text-align: left;
  transition: border-color .18s ease;
}
.wk-select-row:hover { border-color: rgba(129,140,248,.6); }
.wk-select-chip {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px;
  border-radius: 9px; background: #101218; color: #9aa1b5;
}
.wk-select-chip i { width: 18px; height: 18px; }
.wk-select-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wk-select-text b { font-size: 12px; font-weight: 600; }
.wk-select-text em { font-size: 10px; font-style: normal; color: var(--text-dim); }
.wk-chevron {
  flex: none; width: 16px; height: 16px; margin-left: auto;
  fill: none; stroke: var(--text-dim); stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

/* 局部重绘 · 绘制模式：HSV 选色板，选到的颜色直接驱动蒙版笔刷 */
.wk-picker { margin-bottom: 10px; }
.wk-picker-sv {
  position: relative; height: 136px; border-radius: 11px; cursor: crosshair;
  touch-action: none; border: 1px solid rgba(255,255,255,.14);
  background:
    linear-gradient(to top, rgba(0,0,0,.9), rgba(0,0,0,0)),
    linear-gradient(to right, #fff, rgba(255,255,255,0)),
    hsl(var(--hue, 0), 100%, 50%);
}
.wk-picker-sv:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
.wk-picker-cursor {
  position: absolute; left: 0; top: 0; width: 14px; height: 14px;
  border-radius: 50%; border: 2px solid #fff; pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px rgba(0,0,0,.6), 0 2px 6px rgba(0,0,0,.4);
}
.wk-picker-hue { margin-top: 10px; }
.wk-picker-hue input[type="range"] {
  -webkit-appearance: none; appearance: none; display: block;
  width: 100%; height: 12px; margin: 0; padding: 0; cursor: pointer;
  border: 1px solid rgba(255,255,255,.16); border-radius: 999px;
  background: linear-gradient(to right, #f00 0%, #ff0 16.6%, #0f0 33.3%, #0ff 50%, #00f 66.6%, #f0f 83.3%, #f00 100%);
}
.wk-picker-hue input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  border: 1px solid rgba(0,0,0,.35); box-shadow: 0 2px 5px rgba(0,0,0,.4);
}
.wk-picker-hue input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  border: 1px solid rgba(0,0,0,.35); box-shadow: 0 2px 5px rgba(0,0,0,.4);
}
.wk-picker-hue input[type="range"]:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 3px; }
.wk-picker-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.wk-picker-dot {
  flex: none; width: 34px; height: 34px; border-radius: 50%; background: #fff;
  border: 1px solid rgba(255,255,255,.24); box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
.wk-picker-hex {
  width: 112px; padding: 7px 9px; text-align: center;
  font: inherit; font-size: 11.5px; letter-spacing: .1em; font-variant-numeric: tabular-nums;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14);
  border-radius: 9px; color: var(--text);
}
.wk-picker-hex:focus-visible { outline: 2px solid var(--accent-hover); outline-offset: 2px; }
.wk-paint-tip { margin: 0 0 10px; }

/* 局部重绘：描述框 / 绘制蒙版 */
.wk-textarea-wrap { position: relative; }
.wk-re-textarea { min-height: 160px; margin-bottom: 10px; padding-bottom: 26px; }
.wk-counter { position: absolute; right: 10px; bottom: 19px; font-size: 10px; color: #a3a7ba; pointer-events: none; }
.wk-paint { margin-bottom: 10px; }
.wk-paint canvas {
  display: block; width: 100%; height: auto; aspect-ratio: 11 / 8;
  border: 1px solid rgba(255,255,255,.14); border-radius: 10px;
  background: #0d0f18; cursor: crosshair; touch-action: none;
}
.wk-paint-empty { margin: 0 0 10px; min-height: 140px; }
.wk-paint-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 7px; font-size: 10px; color: #a3a7ba; }
.wk-paint-bar button {
  flex: none; padding: 3px 9px; border: 1px solid rgba(255,255,255,.16); border-radius: 100px;
  background: rgba(255,255,255,.04); color: #dfe4f5; font: inherit; font-size: 10px; cursor: pointer;
}
.wk-paint-bar button:hover { border-color: rgba(129,140,248,.7); }
.wk-mini-field { display: block; margin-bottom: 10px; font-size: 11px; color: var(--text-dim); }
.wk-mini-field input {
  width: 100%; margin-top: 6px; padding: 8px 10px; font: inherit; font-size: 11.5px;
  background: var(--panel-2); border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px; color: var(--text);
}
@media (prefers-reduced-motion: reduce) {
  .wk-seg2 button, .wk-switch-track, .wk-switch-track::after,
  .wk-help::after, .wk-select-row { transition: none; }
}

/* 资产卡片删除按钮：悬停显现 */
.card-del {
  position: absolute; right: 6px; top: 6px; z-index: 3;
  width: 22px; height: 22px; border: none; border-radius: 50%; cursor: pointer;
  background: rgba(0,0,0,.62); color: #fff; font-size: 15px; line-height: 1;
  opacity: 0; transition: opacity .15s, background .15s;
  display: grid; place-items: center; padding: 0;
}
.card:hover .card-del, .card-del:focus { opacity: 1; }
.card-del:hover { background: var(--red); }


/* ═══ M6：响应式（桌面端资产栏始终可见）═══ */
@media (max-width: 1439px) {
  .wk { grid-template-columns: 56px 220px 1fr 240px; }
}
@media (max-width: 1279px) {
  .wk { grid-template-columns: 56px 200px 1fr 224px; }
}
@media (max-width: 1023px) {
  .wk { grid-template-columns: 56px 1fr 224px; }
  .wk-side { display: none; }
  .wk-rail .fn span { font-size: 9.5px; }
  .wk-rail .fn { height: 60px; }
  .wk-rail .fn i { width: 16px; height: 16px; }
}
@media (max-width: 767px) {
  .wk { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .wk-assets { display: none; }
  .wk-rail {
    flex-direction: row; overflow-x: auto; border-right: none;
    border-top: 1px solid var(--line); padding: 0 var(--s-2);
    order: 2; height: 58px; align-items: center;
  }
  .wk-rail .fn { height: 50px; flex: 0 0 58px; }
  .wk-rail .fn::before { display: none; }
  .wk-canvas { order: 1; }
  .wk-swatches { bottom: 70px; }
  .wk-dock { bottom: var(--s-2); }
}

/* ═══ M6：空 / 加载 / 错误状态 ═══ */
.state-box {
  display: grid; place-items: center; text-align: center;
  padding: var(--s-6) var(--s-4); gap: var(--s-2);
}
.state-ico { font-size: 32px; color: var(--text-faint); opacity: .5; }
.state-title { font-size: var(--fs-3); font-weight: 500; color: var(--text-dim); }
.state-desc { font-size: var(--fs-2); color: var(--text-faint); max-width: 28ch; line-height: 1.6; }
.state-error { border-left: 2px solid var(--danger); padding-left: var(--s-3); text-align: left; }

/* ═══ 光扫标题：借用官方 wordmark 的高光扫过手法 ═══ */
.shine-text {
  position: relative;
  display: inline-block;
  isolation: isolate;
}
.shine-text::after {
  content: attr(data-text);
  position: absolute; inset: 0;
  pointer-events: none;
  font: inherit; letter-spacing: inherit; line-height: inherit;
  color: transparent;
  -webkit-text-fill-color: transparent;
  background-image: linear-gradient(
    105deg,
    transparent 37%,
    #9deaff 44%,
    #f7fcff 49%,
    #d9d0ff 54%,
    transparent 62%
  );
  background-size: 250% 100%;
  background-position: 140% center;
  background-clip: text;
  -webkit-background-clip: text;
  animation: shine-sweep 9s var(--ease) infinite;
}
@keyframes shine-sweep {
  0%, 82% { background-position: 140% center; }
  92%, 100% { background-position: -40% center; }
}
@media (prefers-reduced-motion: reduce) {
  .shine-text::after { animation: none; opacity: 0; }
}

/* ═══ 空状态：卫星背景 ═══ */
.empty-hero {
  position: relative;
  display: grid; place-items: center; text-align: center;
  min-height: 380px; border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
}
.empty-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url('/assets/satellite-backdrop.webp') center / cover no-repeat;
  opacity: .38;
  filter: saturate(.9);
  mask-image: radial-gradient(ellipse 72% 68% at 50% 46%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 72% 68% at 50% 46%, #000 40%, transparent 100%);
}
.empty-hero::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 100%, rgba(99,102,241,.16), transparent 70%);
}
.empty-hero > * { position: relative; z-index: 1; }
.empty-hero .eh-ico {
  font-size: 44px; line-height: 1;
  color: var(--accent-soft); opacity: .75;
  margin-bottom: var(--s-3);
}
.empty-hero .eh-title {
  font-size: var(--fs-5); font-weight: 600; color: var(--text);
  margin: 0 0 var(--s-2);
}
.empty-hero .eh-desc {
  font-size: var(--fs-2); color: var(--text-dim);
  margin: 0 0 var(--s-5); max-width: 30ch; line-height: 1.7;
}

/* ═══ 资产页：全宽卫星 hero ═══ */
.assets-page { min-height: calc(100vh - 56px); background: var(--bg); }

.assets-hero {
  position: relative;
  min-height: 248px;
  display: flex; align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.assets-hero .ah-bg {
  position: absolute; inset: 0;
  background: url('/assets/satellite-backdrop.webp') center 38% / cover no-repeat;
  opacity: .42;
  mask-image: linear-gradient(to bottom, #000 0%, #000 58%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 58%, transparent 100%);
}
.assets-hero::after {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 46% 80% at 8% 60%, rgba(99,102,241,.20), transparent 70%),
    linear-gradient(to right, rgba(10,10,11,.86) 0%, rgba(10,10,11,.42) 46%, transparent 78%);
}
.assets-hero .ah-inner {
  position: relative; z-index: 1;
  width: 100%; max-width: 1400px; margin: 0 auto;
  padding: var(--s-6) var(--s-6) var(--s-6);
}
.ah-title {
  margin: 0 0 var(--s-2);
  font-size: var(--fs-6); font-weight: 600; color: var(--text);
  letter-spacing: -.5px;
}
.ah-sub {
  margin: 0 0 var(--s-4);
  font-size: var(--fs-3); color: var(--text-dim);
}
.ah-actions { display: flex; gap: var(--s-2); }

.assets-body {
  max-width: 1400px; margin: 0 auto;
  padding: var(--s-5) var(--s-6) 96px;
}

@media (max-width: 767px) {
  .assets-hero { min-height: 190px; }
  .assets-hero .ah-inner { padding: var(--s-5) var(--s-4); }
  .ah-title { font-size: var(--fs-5); }
  .assets-body { padding: var(--s-4) var(--s-4) 80px; }
}

/* 深色主题下可见的细滚动条 */
.wk-assets, .wk-side, .wk-rail, .assets-body { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.wk-assets::-webkit-scrollbar, .wk-side::-webkit-scrollbar,
.wk-rail::-webkit-scrollbar { width: 6px; }
.wk-assets::-webkit-scrollbar-thumb, .wk-side::-webkit-scrollbar-thumb,
.wk-rail::-webkit-scrollbar-thumb {
  background: var(--line-strong); border-radius: 3px;
}
.wk-assets::-webkit-scrollbar-track, .wk-side::-webkit-scrollbar-track,
.wk-rail::-webkit-scrollbar-track { background: transparent; }

/* 资产页底部多留呼吸空间 */
.assets-body { padding-bottom: 160px; }
@media (max-width: 767px) { .assets-body { padding-bottom: 120px; } }

/* ═══ 资产页：批量选择模式 ═══ */
.grid.batch-mode .card { cursor: pointer; }
.grid.batch-mode .card::after {
  content: '';
  position: absolute; top: 8px; right: 8px;
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.4);
  background: rgba(0,0,0,.4);
  transition: all var(--dur-fast) var(--ease);
}
.grid.batch-mode .card.picked::after {
  content: '✓';
  display: grid; place-items: center;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff; font-size: 11px; font-weight: 700;
}
.grid.batch-mode .card.picked { outline: 2px solid var(--accent); outline-offset: 1px; }
.card { position: relative; }

/* ═══ 画廊卡片 ═══ */
.g-card .meta { gap: 6px; }
.g-like, .g-collect {
  background: none; border: 0; cursor: pointer;
  color: var(--text-faint); font-size: var(--fs-1);
  padding: 2px 6px; border-radius: var(--r-xs);
  transition: all var(--dur-fast) var(--ease);
  font-variant-numeric: tabular-nums;
}
.g-like:hover, .g-collect:hover { color: var(--text); background: var(--panel-3); }
.g-like.on { color: #f472b6; }
.g-collect.on { color: var(--accent-soft); }

/* 画廊：作者标签 */
.g-owner {
  position: absolute; left: 8px; bottom: 8px;
  font-size: var(--fs-1); color: rgba(255,255,255,.72);
  background: rgba(0,0,0,.45); padding: 2px 7px; border-radius: 999px;
  backdrop-filter: blur(6px);
}

.anim-badge.warn { color: #f5c542; border-color: rgba(245,197,66,.4); background: rgba(245,197,66,.1); }



/* ═══ 工作台动画面板：97 个动作的滚动容器 ═══ */
#fnPanel .anim-grid {
  max-height: 420px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.22) transparent;
}
#fnPanel .anim-grid::-webkit-scrollbar { width: 6px; }
#fnPanel .anim-grid::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.22); border-radius: 3px;
}
#fnPanel .anim-grid::-webkit-scrollbar-track { background: transparent; }

/* 动作卡片：封面图 */
#fnPanel .anim-thumb {
  display: block; width: 100%; aspect-ratio: 1;
  border-radius: var(--r-xs); overflow: hidden;
  background: var(--panel-2);
}
#fnPanel .anim-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
#fnPanel .anim-card { padding: 0; background: transparent; border: 1px solid transparent; }
#fnPanel .anim-card.active { border-color: var(--accent); background: rgba(99,102,241,.1); }

/* ═══ 动画面板：绑定卡片改为上下布局（252px 面板放不下横排）═══ */
#fnPanel .anim-bind {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: var(--s-3);
}
#fnPanel .anim-bind-card {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  width: 100%;
}
#fnPanel .anim-bind-ico {
  display: grid; place-items: center;
  width: 30px; height: 30px; flex: 0 0 30px;
  border-radius: var(--r-xs);
  background: rgba(99,102,241,.16);
  color: var(--accent-soft);
}
#fnPanel .anim-bind-ico i { width: 15px; height: 15px; }
#fnPanel .anim-bind-meta {
  display: flex; flex-direction: column; gap: 1px;
  min-width: 0; flex: 1 1 auto;
}
#fnPanel .anim-bind-meta b { font-size: var(--fs-2); color: var(--text); font-weight: 600; }
#fnPanel .anim-bind-meta small {
  font-size: 10px; color: var(--text-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#fnPanel .anim-bind-badge {
  font-size: 10px; padding: 2px 7px; border-radius: 999px;
  background: rgba(255,255,255,.08); color: var(--text-dim);
  white-space: nowrap; flex: 0 0 auto;
}

/* 自动绑定按钮：黄色主按钮，横排不换行 */
#fnPanel .anim-bind-run {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 11px;
  background: linear-gradient(135deg, #ffdc6a 0%, #f7bd22 100%);
  color: #1a1400; border: 0; border-radius: var(--r-sm);
  font-size: var(--fs-2); font-weight: 600;
  white-space: nowrap;
}
#fnPanel .anim-bind-run span { flex: 0 0 auto; }
#fnPanel .anim-bind-run b { font-weight: 600; opacity: .65; flex: 0 0 auto; }
#fnPanel .anim-bind-run:hover { filter: brightness(1.06); }

/* 应用动作按钮 */
#fnPanel .anim-apply {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 11px; margin-top: var(--s-2);
  background: var(--accent); color: #fff;
  border: 0; border-radius: var(--r-sm);
  font-size: var(--fs-2); font-weight: 500;
  white-space: nowrap;
}
#fnPanel .anim-apply b { font-weight: 500; opacity: .75; flex: 0 0 auto; }
#fnPanel .anim-apply:hover { background: var(--accent-hover); }

/* ═══ 生成中：画布进度层 ═══ */
.wk-progress {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow: hidden;
}
.wk-progress-art {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: .55;
}
.wk-progress-glow {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 46% 42% at 50% 46%, rgba(99,102,241,.30), transparent 72%);
}

/* 三层旋转环 */
.wk-progress-ring {
  position: relative; width: 148px; height: 148px;
  margin-bottom: var(--s-5);
}
.wk-progress-ring span {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid transparent;
}
.wk-progress-ring span:nth-child(1) {
  border-top-color: rgba(165,180,252,.95);
  border-right-color: rgba(99,102,241,.4);
  animation: prog-spin 2.4s linear infinite;
}
.wk-progress-ring span:nth-child(2) {
  inset: 14px;
  border-bottom-color: rgba(129,140,248,.8);
  border-left-color: rgba(99,102,241,.25);
  animation: prog-spin 3.6s linear infinite reverse;
}
.wk-progress-ring span:nth-child(3) {
  inset: 28px;
  border-top-color: rgba(226,232,240,.6);
  animation: prog-spin 5s linear infinite;
}
@keyframes prog-spin { to { transform: rotate(360deg); } }

/* 进度信息 */
.wk-progress-info {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  width: min(420px, 72%);
}
.wk-progress-info b {
  font-size: var(--fs-4); font-weight: 500; color: var(--text);
  letter-spacing: .5px;
}
.wk-progress-bar {
  width: 100%; height: 4px; border-radius: 999px;
  background: rgba(255,255,255,.12); overflow: hidden;
}
.wk-progress-bar i {
  display: block; height: 100%; width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #6366f1, #a5b4fc);
  box-shadow: 0 0 14px rgba(129,140,248,.8);
  transition: width .6s cubic-bezier(.4,0,.2,1);
}
.wk-progress-info em {
  font-size: var(--fs-2); color: var(--accent-soft);
  font-variant-numeric: tabular-nums; font-style: normal;
}

/* 右侧资产栏：生成中占位卡片 */
.wk-asset.gen-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px;
  background: var(--panel-2);
  border: 1px solid var(--accent);
  overflow: hidden;
}
.wk-asset.gen-card::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 38%, rgba(165,180,252,.22) 50%, transparent 62%);
  animation: gen-sweep 1.8s linear infinite;
}
@keyframes gen-sweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.gen-card-spin {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.18);
  border-top-color: var(--accent-soft);
  animation: prog-spin 1s linear infinite;
}
.wk-asset.gen-card em {
  font-size: var(--fs-1); color: var(--accent-soft);
  font-style: normal; font-variant-numeric: tabular-nums;
}
.wk-asset.gen-card b {
  font-size: 10px; color: var(--text-faint); font-weight: 400;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 92%;
}

/* 进度层激活时只藏品牌文字，星空背景保留 */
.wk-canvas:has(.wk-progress) .wk-idle-brand { opacity: 0; transition: opacity .4s; }
.wk-progress-art { opacity: .55; }


/* 生成中：藏掉已有模型的画布与底部控件，只留进度层（工序层除外） */
.wk-canvas:has(#wkProgress) > canvas,
.wk-canvas:has(#wkProgress) .wk-swatches,
.wk-canvas:has(#wkProgress) .wk-dock,
.wk-canvas:has(#wkProgress) .wk-stats,
.wk-canvas:has(#wkProgress) .wk-viewtools,
.wk-canvas:has(#wkProgress) .viewer-hud {
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity .25s var(--ease);
}

/* ═══ 工序进度角标（画布右下角，不遮挡模型）═══ */
.op-badge {
  position: absolute; right: var(--s-4); bottom: 96px; z-index: 6;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  background: rgba(22,22,26,.92);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  box-shadow: 0 6px 24px rgba(0,0,0,.45);
}
.op-badge[hidden] { display: none; }
.op-badge-spin {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.16);
  border-top-color: var(--accent-soft);
  animation: prog-spin 1s linear infinite;
  flex: 0 0 14px;
}
.op-badge b { font-size: var(--fs-2); color: var(--text); font-weight: 500; white-space: nowrap; }
.op-badge em {
  font-size: var(--fs-1); color: var(--accent-soft);
  font-style: normal; font-variant-numeric: tabular-nums;
}


/* ═══ 工序全屏进度层（区别于生成：半透明遮罩，不换背景）═══ */
.op-progress { z-index: 8; }
.op-progress-scrim {
  position: absolute; inset: 0;
  background: rgba(10,10,11,.72);
  backdrop-filter: blur(6px);
}
.op-progress .wk-progress-ring { width: 96px; height: 96px; margin-bottom: var(--s-4); }
.op-progress .wk-progress-info { width: min(360px, 62%); }
.op-progress .wk-progress-info b {
  font-size: var(--fs-3); letter-spacing: .3px; color: var(--text);
  text-align: center;
}
.op-progress .wk-progress-bar { height: 3px; }
.op-progress hidden { display: none; }

/* ═══ 部件列表（拆分后展示）═══ */
.wk-parts {
  margin: var(--s-3) 0;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--panel-2);
  max-height: 260px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.wk-parts-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px;
  background: var(--panel-3);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 1;
}
.wk-parts-head b { font-size: var(--fs-1); color: var(--text-dim); font-weight: 600; }
.wk-parts-head span { font-size: 10px; color: var(--text-faint); }
.wk-part {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 6px 10px;
  background: transparent; border: 0; border-bottom: 1px solid rgba(255,255,255,.04);
  color: var(--text-dim); font-size: var(--fs-1);
  cursor: pointer; text-align: left;
  transition: background var(--dur-fast) var(--ease);
}
.wk-part:last-child { border-bottom: 0; }
.wk-part:hover { background: var(--panel-3); color: var(--text); }
.wk-part-dot {
  width: 8px; height: 8px; border-radius: 2px; flex: 0 0 8px;
  background: var(--c, var(--accent));
}
.wk-part-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 部件列表：选中态 */
.wk-part.on {
  background: rgba(99,102,241,.16);
  color: var(--text);
  box-shadow: inset 2px 0 0 var(--accent);
}

/* 部件补全：复选列表（对齐原站） */
.wk-parts.checkbox { max-height: 420px; }
.wk-part-check {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 12px;
  background: transparent; border: 0;
  border-bottom: 1px solid rgba(255,255,255,.04);
  color: var(--text-dim); font-size: var(--fs-2);
  cursor: pointer; text-align: left;
  transition: background var(--dur-fast) var(--ease);
}
.wk-part-check:last-child { border-bottom: 0; }
.wk-part-check:hover { background: var(--panel-3); color: var(--text); }
.wk-check-box {
  width: 15px; height: 15px; flex: 0 0 15px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.28);
  position: relative;
  transition: all var(--dur-fast) var(--ease);
}
.wk-part-check.on .wk-check-box {
  border-color: var(--accent);
  background: var(--accent);
}
.wk-part-check.on .wk-check-box::after {
  content: '✓';
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: #fff; font-size: 10px; font-weight: 700;
}
.wk-part-check.on { color: var(--text); background: rgba(99,102,241,.1); }

/* 变换手柄模式条 */
.wk-gizmo-bar {
  display: flex; gap: 4px; margin: 6px 0 var(--s-3);
  padding: 4px; border-radius: var(--r-sm);
  background: var(--panel-2); border: 1px solid var(--line);
}
.wk-gizmo-bar button {
  flex: 1; padding: 5px 8px; border-radius: var(--r-xs);
  background: transparent; border: 0;
  color: var(--text-faint); font-size: var(--fs-1);
  cursor: pointer; transition: all var(--dur-fast) var(--ease);
}
.wk-gizmo-bar button:hover { color: var(--text); background: var(--panel-3); }
.wk-gizmo-bar button.on { background: var(--accent); color: #fff; }

/* 部件悬停提示（跟随鼠标） */
.part-tip {
  position: absolute; z-index: 20;
  padding: 5px 10px; border-radius: var(--r-xs);
  background: rgba(22,22,26,.94);
  border: 1px solid var(--accent);
  color: var(--accent-soft);
  font-size: var(--fs-1); font-weight: 500;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.5);
  backdrop-filter: blur(8px);
}
/* 列表项悬停态 */
.wk-part.hover {
  background: rgba(99,102,241,.2);
  color: var(--text);
  box-shadow: inset 2px 0 0 var(--accent-soft);
}

/* ═══ DCC Bridge ═══ */
.dcc-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: var(--panel-2); border: 1px solid var(--line);
  color: var(--text-dim); font-size: var(--fs-2);
  cursor: pointer; white-space: nowrap;
  transition: all var(--dur-fast) var(--ease);
}
.dcc-btn i { width: 14px; height: 14px; }
.dcc-btn:hover { border-color: var(--border-strong); color: var(--text); background: var(--panel-3); }

.dcc-modal { width: min(560px, 94vw); }
.dcc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.dcc-head h2 { margin: 0; font-size: var(--fs-5); font-weight: 600; }
.dcc-close {
  background: none; border: 0; color: var(--text-faint);
  font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px;
}
.dcc-close:hover { color: var(--text); }
.dcc-desc { margin: 0 0 var(--s-4); font-size: var(--fs-2); color: var(--text-dim); line-height: 1.7; }

.dcc-list { border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.dcc-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.dcc-row:last-child { border-bottom: 0; }
.dcc-row:hover { background: var(--panel-3); }
.dcc-name { font-size: var(--fs-2); color: var(--text); font-weight: 500; min-width: 68px; }
.dcc-port { font-size: 10px; color: var(--text-faint); font-family: var(--mono); }
.dcc-dl {
  font-size: var(--fs-1); color: var(--accent-soft);
  text-decoration: none; white-space: nowrap;
}
.dcc-dl em { font-style: normal; color: var(--text-faint); font-size: 10px; }
.dcc-dl:hover { text-decoration: underline; }
.dcc-state {
  font-size: 10px; color: var(--text-faint);
  min-width: 68px; text-align: right;
}
.dcc-state.ok { color: #34d399; }
.dcc-state.err { color: #f87171; }
.dcc-state.busy { color: var(--accent-soft); }

/* 开关 */
.dcc-switch { position: relative; display: inline-flex; cursor: pointer; flex: 0 0 auto; }
.dcc-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.dcc-track {
  width: 34px; height: 19px; border-radius: 999px;
  background: rgba(255,255,255,.14);
  position: relative; transition: background var(--dur-fast) var(--ease);
}
.dcc-track i {
  position: absolute; top: 2px; left: 2px;
  width: 15px; height: 15px; border-radius: 50%;
  background: #fff; transition: transform var(--dur-fast) var(--ease);
}
.dcc-switch input:checked + .dcc-track { background: var(--accent); }
.dcc-switch input:checked + .dcc-track i { transform: translateX(15px); }

.dcc-hint { margin: var(--s-3) 0 0; font-size: var(--fs-1); color: var(--text-faint); line-height: 1.7; }

/* DCC 已连接徽标 */
.dcc-badge {
  font-style: normal;
  min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 999px;
  background: #34d399; color: #06281c;
  font-size: 10px; font-weight: 700;
  display: inline-grid; place-items: center;
  line-height: 1;
}
.dcc-badge[hidden] { display: none; }
.dcc-btn.on { border-color: rgba(52,211,153,.45); color: #34d399; }
