/* ============================================================ 基础 */
:root {
  --bg: #070b14;
  --bg-2: #0b1120;
  --panel: rgba(17, 24, 39, .78);
  --panel-solid: #111827;
  --line: rgba(130, 160, 210, .14);
  --line-strong: rgba(130, 160, 210, .28);
  --ink: #e9eefb;
  --ink-2: #aebbd4;
  --ink-3: #7787a5;
  --brand: #5b8cff;
  --brand-2: #22d3ee;
  --warm: #ffb020;
  --danger: #ff6b6b;
  --ok: #34d399;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  background-image:
    radial-gradient(1200px 620px at 78% -12%, rgba(59, 130, 246, .16), transparent 62%),
    radial-gradient(900px 520px at 8% 4%, rgba(34, 211, 238, .10), transparent 58%);
  background-repeat: no-repeat;
}

a { color: inherit; text-decoration: none; }
b { font-weight: 700; }
.hidden { display: none !important; }
html.no-scroll, html.no-scroll body { overflow: hidden; }

h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.4px; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

::selection { background: rgba(91, 140, 255, .35); }

/* --------------------------------------------------------------- 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 20px; border-radius: 11px; border: 1px solid transparent;
  background: linear-gradient(135deg, var(--brand), #7b6bff);
  color: #fff; font: 600 14px/1 var(--font); cursor: pointer;
  transition: transform .12s, box-shadow .2s, filter .2s;
  box-shadow: 0 10px 28px rgba(91, 140, 255, .28);
  white-space: nowrap;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 9px; }
.btn.ghost {
  background: rgba(255, 255, 255, .04); border-color: var(--line-strong);
  color: var(--ink-2); box-shadow: none;
}
.btn.ghost:hover { color: var(--ink); border-color: rgba(130, 160, 210, .45); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.ic { width: 17px; height: 17px; flex: none; }

.icon-btn, .mini, .vbtn, .chip, .mtab, .nav-item {
  font-family: var(--font); cursor: pointer; color: inherit;
}

/* ============================================================ 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 26px;
  height: 60px; padding: 0 22px;
  background: rgba(7, 11, 20, .78);
  backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  color: #cfe0ff;
  background: linear-gradient(150deg, rgba(91, 140, 255, .28), rgba(34, 211, 238, .14));
  border: 1px solid rgba(130, 170, 255, .3);
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-txt b { display: block; font-size: 15.5px; letter-spacing: .3px; white-space: nowrap; }
.brand-txt span {
  display: block; font-size: 9px; letter-spacing: 2.4px;
  color: var(--ink-3); font-weight: 600; margin-top: 1px;
}

.nav { display: flex; gap: 4px; }
.nav-item {
  height: 34px; padding: 0 15px; border: 0; border-radius: 9px;
  background: transparent; font-size: 14px; color: var(--ink-3); font-weight: 600;
  transition: background .18s, color .18s;
}
.nav-item:hover { color: var(--ink-2); background: rgba(255, 255, 255, .04); }
.nav-item.on { color: var(--ink); background: rgba(91, 140, 255, .16); }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ============================================================ 通用版心 */
main { max-width: 1240px; margin: 0 auto; padding: 0 22px 60px; }
.view { animation: fade-up .34s ease both; }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.eyebrow {
  display: inline-block; font-size: 11.5px; letter-spacing: 2.2px; font-weight: 700;
  color: var(--brand-2); text-transform: uppercase;
}

/* ============================================================ 首页 hero */
.hero {
  display: grid; grid-template-columns: 1.35fr .65fr; gap: 40px;
  align-items: end; padding: 56px 0 38px;
}
.hero h1 {
  font-size: clamp(32px, 4.6vw, 52px); margin: 14px 0 16px; font-weight: 800;
  letter-spacing: -1.6px;
}
.grad {
  background: linear-gradient(105deg, #7ea6ff 12%, #22d3ee 88%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.lede { color: var(--ink-2); font-size: 15.5px; line-height: 1.75; max-width: 560px; }
.lede b { color: var(--ink); }
.hero-actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }

/* ============================================ 联系开发者（首页主内容区） */
.dev-band {
  display: flex; align-items: center; gap: 30px; flex-wrap: wrap;
  margin: 26px 0 6px; padding: 24px 26px;
  border: 1px solid rgba(34, 211, 238, .28); border-radius: var(--radius);
  background:
    radial-gradient(600px 220px at 92% 10%, rgba(34, 211, 238, .16), transparent 70%),
    linear-gradient(120deg, rgba(91, 140, 255, .10), rgba(34, 211, 238, .06) 60%, transparent),
    var(--panel);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .32);
}
.dev-band-main { flex: 1; min-width: 280px; }
.dev-band .eyebrow { font-size: 11.5px; letter-spacing: .12em; color: var(--brand-2); font-weight: 700; }
.dev-band h2 { font-size: clamp(19px, 2.4vw, 24px); margin: 8px 0 10px; font-weight: 800; }
.dev-bio { font-size: 13.6px; line-height: 1.85; color: var(--ink-2); margin: 0; max-width: 640px; }
.dev-bio b { color: var(--ink); }
.dev-bio em { font-style: normal; color: var(--brand-2); font-weight: 700; }
.dev-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.dev-qr { flex: none; text-align: center; }
.dev-qr img {
  display: block; width: 150px; height: 150px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: #fff; padding: 6px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .35);
}
.dev-qr span { display: block; margin-top: 8px; font-size: 11.5px; color: var(--ink-3); }
@media (max-width: 720px) {
  .dev-band { padding: 20px 18px; gap: 18px; }
  .dev-qr { margin: 0 auto; }
  .dev-qr img { width: 132px; height: 132px; }
}

.hero-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); padding: 18px 16px;
}
.hero-stats .stat { text-align: center; }
.hero-stats b { display: block; font-size: 22px; letter-spacing: -.6px; }
.hero-stats span { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }

/* ============================================================ 库工具条 */
.library-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px 0 18px; border-top: 1px solid var(--line);
}
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  height: 34px; padding: 0 15px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .03);
  color: var(--ink-3); font-size: 13px; font-weight: 600;
  transition: all .16s;
}
.chip:hover { color: var(--ink-2); border-color: var(--line-strong); }
.chip.on {
  color: #dce8ff; border-color: rgba(91, 140, 255, .55);
  background: rgba(91, 140, 255, .16);
}

.search {
  margin-left: auto; display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 13px; min-width: 240px;
  border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255, 255, 255, .03); color: var(--ink-3);
}
.search input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  color: var(--ink); font: 14px var(--font);
}
.search input::placeholder { color: var(--ink-3); }

/* ============================================================ 卡片网格 */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 16px;
}

.card {
  display: block;
  position: relative; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); overflow: hidden; cursor: pointer;
  transition: transform .2s, border-color .2s, box-shadow .2s;
}
.card:hover {
  transform: translateY(-3px); border-color: rgba(91, 140, 255, .45);
  box-shadow: 0 20px 44px rgba(0, 0, 0, .42);
}
.card .thumb {
  position: relative; aspect-ratio: 4 / 3; overflow: hidden;
  background:
    radial-gradient(420px 240px at 50% 38%, rgba(91, 140, 255, .18), transparent 70%),
    linear-gradient(160deg, #0d1526, #0a0f1c);
  display: grid; place-items: center;
}
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card .thumb .ph {
  font-size: 11px; letter-spacing: 2px; color: rgba(140, 165, 205, .5);
  text-transform: uppercase;
}
.card .cat {
  position: absolute; left: 12px; top: 12px; z-index: 2;
  height: 24px; padding: 0 10px; border-radius: 7px;
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700; letter-spacing: .6px;
  color: #d8e6ff; background: rgba(9, 14, 26, .72);
  border: 1px solid rgba(130, 170, 255, .28); backdrop-filter: blur(6px);
}
.card .body { padding: 14px 16px 16px; }
.card h3 { font-size: 16.5px; margin-bottom: 6px; }
.card .desc {
  font-size: 12.8px; color: var(--ink-3); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 41px;
}
.card .meta {
  display: flex; gap: 12px; margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--ink-3);
}
.card .meta i { font-style: normal; color: var(--ink-2); font-weight: 700; }
.card .tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.pill-xs {
  font-size: 10.5px; color: var(--ink-3); padding: 2px 8px;
  border: 1px solid var(--line); border-radius: 999px; white-space: nowrap;
}

.skeleton {
  background: linear-gradient(100deg, rgba(255,255,255,.03) 20%, rgba(255,255,255,.07) 40%, rgba(255,255,255,.03) 60%);
  background-size: 220% 100%; animation: shimmer 1.3s infinite linear;
  border-radius: var(--radius); border: 1px solid var(--line);
}
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -80% 0; } }

.empty {
  grid-column: 1 / -1; padding: 50px 0; text-align: center; color: var(--ink-3);
}
.empty b { display: block; color: var(--ink-2); margin-bottom: 6px; font-size: 15px; }

/* ------------------------------------------------------------ 拖拽区 */
.drop-zone {
  display: flex; align-items: center; gap: 18px;
  margin-top: 22px; padding: 22px 24px;
  border: 1px dashed rgba(130, 160, 210, .3); border-radius: var(--radius);
  background: rgba(255, 255, 255, .02);
  transition: border-color .2s, background .2s;
}
.drop-zone.over {
  border-color: var(--brand); background: rgba(91, 140, 255, .1);
}
.dz-icon {
  width: 44px; height: 44px; flex: none; border-radius: 12px; display: grid; place-items: center;
  color: var(--brand-2); background: rgba(34, 211, 238, .1);
  border: 1px solid rgba(34, 211, 238, .24);
}
.dz-icon svg { width: 22px; height: 22px; }
.drop-zone b { font-size: 14.5px; }
.drop-zone p { font-size: 12.8px; color: var(--ink-3); margin-top: 5px; line-height: 1.6; }

/* ============================================ 本地模型：主打入口 */
/* 顶栏与 hero 的主按钮：比普通主按钮更亮一档，带青色边光 */
.btn.local-btn {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: rgba(34, 211, 238, .5);
  box-shadow: 0 10px 30px rgba(34, 211, 238, .32), 0 0 0 1px rgba(34, 211, 238, .18);
  color: #06121f;
  font-weight: 750;
}
.btn.local-btn:hover { filter: brightness(1.06); box-shadow: 0 12px 34px rgba(34, 211, 238, .42); }

/* 拖放卡：整块可点、可拖，虚线 + 渐变图标，视觉上明显压过普通卡片 */
.local-drop {
  display: flex; align-items: center; gap: 16px;
  margin-top: 20px; cursor: pointer;
  border: 1.5px dashed rgba(34, 211, 238, .42); border-radius: var(--radius);
  background:
    linear-gradient(120deg, rgba(34, 211, 238, .09), rgba(91, 140, 255, .07) 55%, transparent),
    rgba(255, 255, 255, .02);
  transition: border-color .2s, background .2s, transform .2s;
}
.local-drop:hover, .local-drop:focus-visible, .local-drop.over {
  border-color: var(--brand-2);
  background: linear-gradient(120deg, rgba(34, 211, 238, .16), rgba(91, 140, 255, .12) 55%, transparent),
              rgba(255, 255, 255, .03);
  transform: translateY(-1px);
  outline: none;
}
.ld-ic {
  width: 46px; height: 46px; flex: none; border-radius: 13px; display: grid; place-items: center;
  color: #06121f; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 8px 22px rgba(34, 211, 238, .3);
}
.ld-ic svg { width: 23px; height: 23px; }
.ld-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ld-txt b { font-size: 15.5px; }
.ld-txt span { font-size: 12.6px; color: var(--ink-3); line-height: 1.55; }
.ld-go {
  margin-left: auto; flex: none; padding: 8px 14px; border-radius: 9px;
  font-size: 13px; font-weight: 700; color: var(--brand-2);
  border: 1px solid rgba(34, 211, 238, .35); background: rgba(34, 211, 238, .08);
}
.local-drop.sm { margin-top: 16px; }
.local-drop.sm .ld-ic { width: 38px; height: 38px; border-radius: 11px; }
.local-drop.sm .ld-ic svg { width: 19px; height: 19px; }
.local-drop.sm .ld-txt b { font-size: 14.5px; }
@media (max-width: 620px) {
  .local-drop { gap: 12px; }
  .ld-go { display: none; }
  .ld-txt span { font-size: 12px; }
}

/* ============================================================ 生成页 */
.gen-wrap { max-width: 860px; margin: 0 auto; padding: 26px 0 40px; }
.gen-head h1 { font-size: clamp(28px, 3.8vw, 40px); margin: 12px 0 14px; font-weight: 800; }
.gen-box {
  margin-top: 26px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--panel); padding: 14px; box-shadow: var(--shadow);
}
.gen-box textarea {
  width: 100%; min-height: 104px; resize: vertical; border: 0; outline: none;
  background: transparent; color: var(--ink); font: 15.5px/1.7 var(--font);
  padding: 6px 6px 10px;
}
.gen-box textarea::placeholder { color: var(--ink-3); }
.gen-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: 12px;
}
.examples { display: flex; gap: 7px; flex-wrap: wrap; }
.examples .chip { height: 30px; font-size: 12.3px; padding: 0 12px; }
.gen-row .btn { margin-left: auto; }

.gen-progress, .gen-error {
  margin-top: 18px; padding: 18px 20px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel);
}
.gp-head { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.gp-time { margin-left: auto; color: var(--ink-3); font: 12px var(--mono); }
.gp-steps { display: flex; gap: 10px; margin: 14px 0 12px; flex-wrap: wrap; }
.gp-steps span {
  font-size: 12px; color: var(--ink-3); padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line); transition: all .25s;
}
.gp-steps span.done { color: var(--ok); border-color: rgba(52, 211, 153, .35); background: rgba(52, 211, 153, .08); }
.gp-steps span.active { color: #dbe7ff; border-color: rgba(91, 140, 255, .5); background: rgba(91, 140, 255, .16); }
.gp-bar { height: 4px; border-radius: 999px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.gp-bar i { display: block; height: 100%; width: 4%; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .5s ease; }
.gp-note { font-size: 12px; color: var(--ink-3); margin-top: 11px; }

.gen-error { border-color: rgba(255, 107, 107, .32); background: rgba(255, 107, 107, .06); }
.gen-error b { color: #ffb4b4; }
.gen-error p { font-size: 13px; color: var(--ink-2); margin: 8px 0 12px; line-height: 1.65; word-break: break-word; }

.gen-tips { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.gen-tips h3 { font-size: 14px; color: var(--ink-2); margin-bottom: 12px; }
.gen-tips li {
  font-size: 13px; color: var(--ink-3); line-height: 1.85; padding-left: 16px; position: relative;
}
.gen-tips li::before {
  content: ""; position: absolute; left: 2px; top: 12px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--brand);
}
.gen-tips b { color: var(--ink-2); }

.gen-note { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.gen-note h3 { font-size: 14px; color: var(--ink-2); margin-bottom: 10px; }
.gen-note p { font-size: 13px; color: var(--ink-3); line-height: 1.85; }
.gen-note a, .gen-tips a { color: var(--brand); }

/* ============================================================ 加载指示 */
.spinner {
  width: 14px; height: 14px; flex: none; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .18); border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}
.spinner.big { width: 30px; height: 30px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================ 查看器 */
.viewer {
  position: fixed; inset: 0; z-index: 60;
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr) 326px;
  grid-template-rows: 58px minmax(0, 1fr) 70px;
  grid-template-areas:
    "top top top"
    "left stage right"
    "left dock right";
  background: #060a12;
}
#canvas {
  grid-area: stage; width: 100%; height: 100%; display: block; outline: none;
  touch-action: none;
}

.v-top {
  grid-area: top; z-index: 3;
  display: flex; align-items: center; gap: 12px; padding: 0 14px;
  background: linear-gradient(180deg, rgba(6, 10, 18, .96), rgba(6, 10, 18, .7));
  border-bottom: 1px solid var(--line);
}
.icon-btn {
  width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--ink-2);
}
.icon-btn:hover { color: var(--ink); border-color: var(--line-strong); }
.icon-btn svg { width: 19px; height: 19px; }
.v-title { min-width: 0; }
.v-title b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-title span {
  display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw;
}
.v-badges { margin-left: auto; display: flex; gap: 7px; }
.badge {
  height: 24px; padding: 0 10px; border-radius: 7px; display: inline-flex; align-items: center;
  font-size: 11px; color: var(--ink-3); border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
}

.v-panel {
  background: rgba(10, 15, 26, .9);
  backdrop-filter: blur(14px);
  display: flex; flex-direction: column; min-height: 0;
}
.v-left { grid-area: left; border-right: 1px solid var(--line); }
.v-right { grid-area: right; border-left: 1px solid var(--line); overflow-y: auto; }

.panel-head {
  display: flex; align-items: center; gap: 8px; padding: 13px 14px 11px;
  border-bottom: 1px solid var(--line); font-size: 13px;
}
.panel-tools { margin-left: auto; display: flex; gap: 6px; }
.mini {
  height: 25px; padding: 0 9px; border-radius: 7px; font-size: 11.5px; font-weight: 600;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .03); color: var(--ink-3);
}
.mini:hover { color: var(--ink); border-color: var(--line-strong); }
.mini.wide { min-width: 62px; height: 30px; font-size: 12.5px; }

.part-list { flex: 1; overflow-y: auto; padding: 8px; min-height: 0; }
.part-row {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 8px 9px; border-radius: 9px; border: 1px solid transparent;
  background: transparent; text-align: left; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.part-row:hover { background: rgba(255, 255, 255, .04); }
.part-row.on { background: rgba(91, 140, 255, .16); border-color: rgba(91, 140, 255, .38); }
.part-row .dot {
  width: 9px; height: 9px; flex: none; border-radius: 3px;
  background: var(--ink-3); box-shadow: 0 0 0 1px rgba(255, 255, 255, .12) inset;
}
.part-row .nm {
  flex: 1; min-width: 0; font-size: 12.8px; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.part-row.on .nm { color: #e2ebff; font-weight: 600; }
.part-row .eye {
  width: 22px; height: 22px; flex: none; display: grid; place-items: center;
  border-radius: 6px; color: var(--ink-3); opacity: 0; transition: opacity .15s;
}
.part-row:hover .eye, .part-row.hidden-part .eye { opacity: 1; }
.part-row.hidden-part .nm { opacity: .4; text-decoration: line-through; }
.part-row .eye svg { width: 14px; height: 14px; }

.panel-foot {
  border-top: 1px solid var(--line); padding: 11px 14px 13px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 9px;
}
.switch {
  display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-3);
  cursor: pointer; user-select: none;
}
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch span {
  width: 26px; height: 15px; border-radius: 999px; flex: none; position: relative;
  background: rgba(255, 255, 255, .12); transition: background .18s;
}
.switch span::after {
  content: ""; position: absolute; left: 2px; top: 2px; width: 11px; height: 11px;
  border-radius: 50%; background: #cfd8ea; transition: transform .18s;
}
.switch input:checked + span { background: rgba(91, 140, 255, .7); }
.switch input:checked + span::after { transform: translateX(11px); background: #fff; }

/* 右侧讲解 */
.intro-block { padding: 18px 18px 15px; border-bottom: 1px solid var(--line); }
.intro-block h2 { font-size: 18px; margin-bottom: 8px; }
.intro-block p { font-size: 12.8px; color: var(--ink-3); line-height: 1.72; }

.part-detail { flex: 1; padding: 16px 18px; min-height: 120px; }
.pd-empty { display: grid; place-items: center; gap: 12px; padding: 26px 8px; text-align: center; }
.pd-empty svg { width: 72px; height: 72px; color: var(--ink-3); }
.pd-empty p { font-size: 12.3px; color: var(--ink-3); line-height: 1.7; max-width: 210px; }

.pd-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pd-head .dot { width: 10px; height: 10px; border-radius: 3px; }
.pd-head b { font-size: 15px; }
.pd-tag {
  margin-left: auto; font-size: 10.5px; color: var(--ink-3);
  border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px;
  font-family: var(--mono);
}
.pd-desc { font-size: 13px; color: var(--ink-2); line-height: 1.8; margin-top: 8px; }
.pd-size {
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--ink-3); font-family: var(--mono);
}
.pd-actions { display: flex; gap: 7px; margin-top: 13px; flex-wrap: wrap; }

.panel-note {
  border-top: 1px solid var(--line); padding: 14px 18px 16px;
  font-size: 11.5px; color: var(--ink-3);
}
.panel-note b { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 8px; }
.panel-note li { line-height: 1.85; }
kbd {
  font: 10.5px var(--mono); padding: 1px 5px; border-radius: 4px;
  border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .05);
  color: var(--ink-2);
}

/* 底部 dock */
.v-dock {
  grid-area: dock; z-index: 3;
  display: flex; align-items: center; gap: 18px; padding: 0 18px;
  border-top: 1px solid var(--line);
  background: linear-gradient(0deg, rgba(6, 10, 18, .96), rgba(6, 10, 18, .72));
  overflow-x: auto;
}
.dock-views { display: flex; gap: 5px; }
.vbtn {
  height: 30px; min-width: 42px; padding: 0 10px; border-radius: 8px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .03);
  color: var(--ink-3); font-size: 12px; font-weight: 600;
}
.vbtn:hover { color: var(--ink); }
.vbtn.on { color: #dce8ff; border-color: rgba(91, 140, 255, .5); background: rgba(91, 140, 255, .16); }

.dock-explode { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 260px; }
#explode { flex: 1; min-width: 100px; accent-color: var(--brand); height: 4px; }
.pct { font: 11.5px var(--mono); color: var(--ink-3); width: 34px; text-align: right; }
.dock-right { display: flex; gap: 6px; }

.v-mobile-tabs { display: none; }
.v-loading {
  position: absolute; inset: 0; z-index: 8; display: grid; place-content: center;
  justify-items: center; gap: 14px; background: rgba(6, 10, 18, .92);
  color: var(--ink-3); font-size: 13px;
}
.v-toast {
  position: absolute; left: 50%; bottom: 92px; transform: translate(-50%, 12px);
  z-index: 9; padding: 10px 18px; border-radius: 10px;
  background: rgba(17, 24, 39, .96); border: 1px solid var(--line-strong);
  font-size: 12.8px; color: var(--ink); opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s; max-width: 76vw; text-align: center;
}
.v-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================ 内容页通用 */
.page-head { padding: 38px 0 24px; }
.page-head h1 {
  font-size: clamp(26px, 3.4vw, 38px); font-weight: 800;
  letter-spacing: -1.1px; margin: 12px 0 14px;
}
.page-head > .lede { max-width: 700px; }
.page-head .hero-actions { margin-top: 18px; }
.page-head.notfound { padding: 90px 0 110px; text-align: center; }
.page-head.notfound .lede { margin: 0 auto; }

.crumb { font-size: 12px; color: var(--ink-3); }
.crumb ol { display: flex; gap: 8px; flex-wrap: wrap; margin: 0; padding: 0; list-style: none; }
.crumb li { display: flex; align-items: center; gap: 8px; }
.crumb li:not(:last-child)::after { content: "/"; color: rgba(130, 160, 210, .32); }
.crumb a { color: var(--ink-3); }
.crumb a:hover { color: var(--ink); }

.section { padding: 34px 0; border-top: 1px solid var(--line); }
.page-head + .section, .section:first-child { border-top: 0; }
.section h2 {
  font-size: clamp(19px, 2.2vw, 24px); font-weight: 800;
  letter-spacing: -.6px; margin: 0 0 12px;
}
.section h2 ~ h2 { margin-top: 26px; }
.section p { font-size: 13.5px; color: var(--ink-2); line-height: 1.85; }
.section p a, .section li a { color: var(--brand); }
.section p a:hover, .section li a:hover { color: #8fb2ff; }
.section > .lede { margin-bottom: 4px; }
.section .note { font-size: 12.8px; color: var(--ink-3); line-height: 1.7; margin-bottom: 14px; }

.section-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.section-head .more { margin-left: auto; }
.more { font-size: 13px; font-weight: 600; color: var(--brand); white-space: nowrap; }
.more:hover { color: #8fb2ff; }

.section.split { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; }
.section.split > div > h2:first-child { margin-bottom: 14px; }

/* 特性三栏 */
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 16px; }
.feat {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); padding: 20px 20px 22px;
}
.feat-ic { font: 700 11.5px var(--mono); letter-spacing: 1.4px; color: var(--brand-2); }
.feat h3 { font-size: 15.5px; margin: 10px 0 8px; }
.feat p { font-size: 13px; color: var(--ink-3); line-height: 1.75; }

/* 表格 */
.fmt-table, .parts-table {
  width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed;
}
.fmt-table th, .parts-table th {
  text-align: left; padding: 0 10px 9px; border-bottom: 1px solid var(--line-strong);
  font-size: 11.5px; font-weight: 600; letter-spacing: .5px; color: var(--ink-3);
}
.fmt-table th:first-child, .parts-table th:first-child { width: 34%; }
.fmt-table td, .parts-table td {
  padding: 11px 10px; border-bottom: 1px solid var(--line);
  color: var(--ink-2); line-height: 1.7; vertical-align: top;
  word-break: break-word;
}
.fmt-table td b, .parts-table td b { color: var(--ink); }
.parts-table .pid { font: 11px var(--mono); color: var(--ink-3); margin-top: 3px; }
.parts-table { margin-top: 10px; }

/* 内链清单 */
.link-list { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.link-list li {
  display: flex; align-items: center; gap: 8px; padding: 8px 0;
  border-bottom: 1px dashed rgba(130, 160, 210, .14); font-size: 13px;
}
.link-list a { color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-list a:hover { color: var(--brand); }
.link-list span { margin-left: auto; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }

/* 要点清单 */
.bullet-list { display: grid; gap: 2px; }
.bullet-list li {
  position: relative; padding: 7px 0 7px 18px;
  font-size: 13px; color: var(--ink-2); line-height: 1.75;
}
.bullet-list li::before {
  content: ""; position: absolute; left: 1px; top: 15px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--brand);
}
.bullet-list.muted li { color: var(--ink-3); }
.bullet-list.muted li::before { background: var(--ink-3); }

code {
  font: 12px var(--mono); padding: 1px 5px; border-radius: 4px;
  background: rgba(130, 160, 210, .12); color: var(--ink-2);
}

/* FAQ */
.faq-list { display: grid; gap: 10px; }
.faq-item {
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); padding: 0 16px;
}
.faq-item summary {
  cursor: pointer; padding: 14px 0; font-size: 14px; font-weight: 600;
  color: var(--ink); list-style: none; display: flex; align-items: center; gap: 10px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::before {
  content: "+"; flex: none; width: 14px; text-align: center;
  color: var(--brand); font: 600 16px var(--mono); line-height: 1;
}
.faq-item[open] summary::before { content: "−"; }
.faq-a { font-size: 13px; color: var(--ink-3); line-height: 1.85; padding: 0 0 15px 24px; }

/* 分类区 */
.cat-section h2 { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.cat-section .count { font-size: 12px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; }
.cat-intro {
  font-size: 13px; color: var(--ink-3); line-height: 1.8;
  max-width: 820px; margin-bottom: 16px;
}

/* 详情页元信息 */
.model-head .vp-meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 2px; }

/* CTA 条 */
.cta-band {
  margin: 30px 0 6px; padding: 32px 24px; text-align: center;
  border: 1px solid var(--line-strong) !important; border-radius: var(--radius);
  background:
    radial-gradient(520px 240px at 50% 0%, rgba(91, 140, 255, .16), transparent 70%),
    var(--panel);
}
.cta-band h2 { margin-bottom: 8px; }
.cta-band p {
  font-size: 13.5px; color: var(--ink-2); line-height: 1.8;
  max-width: 560px; margin: 0 auto 18px;
}

/* ============================================================ 页脚 */
.site-foot {
  border-top: 1px solid var(--line); margin-top: 40px;
  padding: 38px 22px 20px; font-size: 12.5px; color: var(--ink-3);
}
.foot-inner {
  max-width: 1240px; margin: 0 auto; display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 1.5fr; gap: 30px;
}
.foot-col b { display: block; color: var(--ink); font-size: 13.5px; margin-bottom: 10px; }
.foot-col p { line-height: 1.85; }
.foot-col a { display: block; padding: 4px 0; color: var(--ink-3); font-size: 12.5px; }
.foot-col a:hover { color: var(--brand); }

/* 开发者（二维码 + 简介） */
.dev-box { display: flex; gap: 12px; margin-top: 14px; align-items: flex-start; }
.dev-box img {
  width: 88px; height: 88px; flex: none; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; padding: 4px;
}
.dev-txt b { font-size: 12.5px; margin-bottom: 6px; }
.dev-txt span { display: block; font-size: 11.8px; line-height: 1.7; color: var(--ink-3); }
.dev-wx { color: var(--brand-2) !important; font-weight: 700; margin-top: 4px; }
.foot-bottom {
  max-width: 1240px; margin: 26px auto 0; padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex; gap: 8px 18px; flex-wrap: wrap; justify-content: center;
  font-size: 11.5px;
}
.foot-bottom a { color: var(--ink-2); text-decoration: none; }
.foot-bottom a:hover { color: var(--brand); text-decoration: underline; }

/* ============================================================ 响应式 */
@media (max-width: 1180px) {
  .viewer { grid-template-columns: 220px minmax(0, 1fr) 290px; }
}

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 24px; padding-top: 40px; }
  .hero-stats { max-width: 420px; }
  .library-bar { gap: 10px; }
  .search { margin-left: 0; width: 100%; min-width: 0; }
}

@media (max-width: 860px) {
  .topbar { height: 54px; padding: 0 14px; gap: 10px; }
  .brand-txt span { display: none; }
  .brand-txt b { font-size: 14px; }
  .nav { margin-left: auto; }
  .nav-item { padding: 0 11px; font-size: 13px; }
  .top-actions .btn { padding: 0 11px; font-size: 12.5px; }
  .top-actions .btn .ic { width: 15px; height: 15px; }
  main { padding: 0 14px 40px; }
  .hero h1 { letter-spacing: -1px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 11px; }
  .card h3 { font-size: 14.5px; }
  .card .desc { font-size: 11.8px; min-height: 0; -webkit-line-clamp: 2; }
  .card .meta { font-size: 10.5px; gap: 8px; }
  .drop-zone { flex-direction: column; align-items: flex-start; gap: 12px; padding: 18px; }
  .gen-wrap { padding-top: 34px; }

  /* 查看器：单栏 + 抽屉 */
  .viewer {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 54px minmax(0, 1fr) auto;
    grid-template-areas: "top" "stage" "dock";
  }
  .v-panel {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 6;
    max-height: 46dvh; border-radius: 16px 16px 0 0;
    border: 1px solid var(--line); border-bottom: 0;
    box-shadow: 0 -14px 40px rgba(0, 0, 0, .5);
    transform: translateY(112%); transition: transform .26s ease;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .v-panel.open { transform: translateY(0); }
  .v-left { border-right: 0; }
  .v-right { border-left: 0; }
  .panel-foot { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .switch { font-size: 11px; gap: 5px; }
  .switch span { width: 24px; height: 14px; }
  .switch span::after { width: 10px; height: 10px; }

  .v-dock { flex-wrap: wrap; gap: 8px; padding: 9px 12px calc(9px + env(safe-area-inset-bottom)); }
  .dock-views { order: 1; width: 100%; overflow-x: auto; }
  .vbtn { min-width: 38px; height: 28px; font-size: 11.5px; }
  .dock-explode { order: 2; min-width: 0; flex: 1 1 100%; }
  .dock-right { order: 3; margin-left: auto; }

  .v-mobile-tabs {
    display: flex; gap: 8px; position: absolute; z-index: 7;
    left: 12px; bottom: calc(100% - 100dvh + 108px);
  }
  .viewer[data-open-panel] .v-mobile-tabs { display: none; }
  .mtab {
    height: 32px; padding: 0 14px; border-radius: 999px; font-size: 12px; font-weight: 600;
    border: 1px solid var(--line-strong); background: rgba(10, 15, 26, .9);
    color: var(--ink-2); backdrop-filter: blur(8px);
  }
  .mtab.on { color: #dce8ff; border-color: rgba(91, 140, 255, .55); background: rgba(91, 140, 255, .22); }
  .v-title span { max-width: 58vw; }
  .v-badges .badge:nth-child(2) { display: none; }
}

@media (max-width: 520px) {
  .hero-stats { grid-template-columns: repeat(3, 1fr); padding: 14px 10px; }
  .hero-stats b { font-size: 18px; }
  .hero-stats span { font-size: 10.5px; }
  .examples { display: none; }
  .gen-row .btn { width: 100%; margin-left: 0; }
  .panel-foot { grid-template-columns: 1fr 1fr; }
}

/* ---------------------------------------------- 内容页响应式 */
@media (max-width: 960px) {
  .section.split { grid-template-columns: 1fr; gap: 26px; }
  .feat-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .page-head { padding: 26px 0 18px; }
  .page-head h1 { letter-spacing: -.8px; }
  .section { padding: 26px 0; }
  .section h2 ~ h2 { margin-top: 22px; }
  .section .note, .section p { font-size: 13px; }
  .link-list { grid-template-columns: 1fr; }
  .foot-inner { grid-template-columns: 1fr 1fr; gap: 22px; }
  .foot-inner > .foot-col:first-child { grid-column: 1 / -1; }
  .site-foot { padding: 28px 14px 18px; margin-top: 28px; }
  .fmt-table, .parts-table { font-size: 12px; }
  .fmt-table th:first-child, .parts-table th:first-child { width: 40%; }
  .faq-item summary { font-size: 13.5px; }
  .cta-band { padding: 26px 18px; }
}

/* 窄屏：顶栏改成两行，导航单独一行可横滑，避免挤压溢出 */
@media (max-width: 620px) {
  .topbar {
    height: auto; padding: 7px 12px 0; row-gap: 4px;
    flex-wrap: wrap; align-items: center;
  }
  .brand-mark { width: 30px; height: 30px; border-radius: 9px; }
  .brand-mark svg { width: 19px; height: 19px; }
  .top-actions { margin-left: auto; }
  .nav {
    order: 3; width: 100%; margin: 0 -12px; padding: 0 12px 6px;
    gap: 2px; overflow-x: auto; flex-wrap: nowrap;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav-item { flex: none; height: 30px; padding: 0 12px; font-size: 13px; }
}

@media (max-width: 520px) {
  .page-head h1 { font-size: 25px; }
  .section h2 { font-size: 18.5px; }
  .foot-inner { grid-template-columns: 1fr; }
  .card .tags { display: none; }
  .link-list li { font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
