/* ============================================================
   心想是陈 · 创意工坊 — 即梦 × 苹果 高级视觉
   深色玻璃拟态 + 霓虹渐变强调 + 大留白 + 轻动效
   ============================================================ */
:root {
  /* 深色基底（即梦式高级黑） */
  --bg: #05050a;
  --bg-2: #0b0b14;
  --glass: rgba(255,255,255,.045);
  --glass-2: rgba(255,255,255,.07);
  --card: rgba(255,255,255,.035);
  --card-hover: rgba(255,255,255,.06);
  --text: #f5f5f7;
  --text-2: rgba(235,235,245,.55);
  --text-3: rgba(235,235,245,.34);
  /* 霓虹强调渐变（即梦式） */
  --acc1: #6c5ce7;
  --acc2: #00d4ff;
  --acc3: #ff5e8a;
  --grad: linear-gradient(120deg, #6c5ce7, #00d4ff 55%, #ff5e8a);
  --grad-soft: linear-gradient(120deg, rgba(108,92,231,.18), rgba(0,212,255,.14), rgba(255,94,138,.14));
  --line: rgba(255,255,255,.08);
  --line-2: rgba(255,255,255,.14);
  --glow: 0 0 40px rgba(108,92,231,.35);
  --r: 20px;
  --r-lg: 28px;
}
:root[data-theme="light"] {
  --bg: #fafafa;
  --bg-2: #f0f0f3;
  --glass: rgba(0,0,0,.03);
  --glass-2: rgba(0,0,0,.05);
  --card: #ffffff;
  --card-hover: #ffffff;
  --text: #0a0a0f;
  --text-2: rgba(10,10,15,.55);
  --text-3: rgba(10,10,15,.35);
  --line: rgba(0,0,0,.08);
  --line-2: rgba(0,0,0,.14);
  --glow: 0 0 40px rgba(108,92,231,.22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "SF Pro Display", -apple-system, "PingFang SC", "Inter", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background .5s ease, color .5s ease;
}
/* 背景光斑（即梦氛围） */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(620px 420px at 12% -5%, rgba(108,92,231,.22), transparent 60%),
    radial-gradient(560px 420px at 92% 8%, rgba(0,212,255,.16), transparent 60%),
    radial-gradient(520px 520px at 80% 96%, rgba(255,94,138,.12), transparent 60%);
}
:root[data-theme="light"] body::before {
  background:
    radial-gradient(620px 420px at 12% -5%, rgba(108,92,231,.12), transparent 60%),
    radial-gradient(560px 420px at 92% 8%, rgba(0,180,255,.1), transparent 60%);
}
button { font-family: inherit; cursor: pointer; }

/* ================= 顶栏（毛玻璃沉浸导航） ================= */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 64px;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1320px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; gap: 20px; padding: 0 28px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px;
  background: var(--grad); box-shadow: var(--glow);
  display: grid; place-items: center; color: #fff; font-size: 16px; font-weight: 700;
}
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: .3px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.brand-tag { font-size: 11px; color: var(--text-3); padding-left: 12px; border-left: 1px solid var(--line-2); }

.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav-link {
  background: none; border: none; color: var(--text-2);
  padding: 9px 18px; border-radius: 999px; font-size: 14px; font-weight: 500;
  transition: all .3s cubic-bezier(.2,.8,.2,1); position: relative;
}
.nav-link:hover { color: var(--text); background: var(--glass); }
.nav-link.active {
  color: #fff; background: var(--grad);
  box-shadow: var(--glow);
}
:root[data-theme="light"] .nav-link.active { color: #fff; }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.quota-chip {
  display: flex; align-items: baseline; gap: 5px;
  background: var(--glass-2); border: 1px solid var(--line-2);
  padding: 7px 16px; border-radius: 999px; font-size: 13px;
  backdrop-filter: blur(8px);
}
.quota-num { font-weight: 700; color: var(--acc2); font-size: 15px; }
.quota-unit { color: var(--text-2); }
.theme-toggle {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--glass); border: 1px solid var(--line-2);
  color: var(--text); font-size: 16px; display: grid; place-items: center;
  transition: all .3s;
}
.theme-toggle:hover { background: var(--glass-2); transform: rotate(20deg); }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--grad); color: #fff;
  display: grid; place-items: center; font-size: 15px; font-weight: 700;
  box-shadow: var(--glow);
}

/* ================= 布局 ================= */
.layout { padding-top: 64px; }

/* ---- 左侧图标导航条（即梦式窄栏）---- */
.rail {
  position: fixed; top: 64px; bottom: 0; left: 0; width: 72px;
  background: color-mix(in srgb, var(--bg-2) 82%, transparent);
  backdrop-filter: blur(22px);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center;
  padding: 18px 0; gap: 6px; z-index: 40;
}
.rail-item {
  width: 60px; padding: 9px 0; border-radius: 14px;
  background: none; border: none; color: var(--text-2);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 500; transition: all .25s; position: relative;
}
.rail-ico { font-size: 20px; line-height: 1; filter: grayscale(.2); transition: all .25s; }
.rail-item:hover { color: var(--text); background: var(--glass); }
.rail-item.active {
  color: #fff; background: var(--grad-soft);
  box-shadow: inset 0 0 0 1px var(--line-2);
}
.rail-item.active .rail-ico { filter: none; transform: scale(1.1); }
:root[data-theme="light"] .rail-item.active { color: var(--acc1); }
.rail-divider { width: 34px; height: 1px; background: var(--line-2); margin: 10px 0; }
.rail-bottom { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.rail-profile .rail-ico {
  width: 34px; height: 34px; border-radius: 50%; background: var(--grad);
  color: #fff; display: grid; place-items: center; font-size: 15px; box-shadow: var(--glow);
}
.rail-setting { padding: 12px 0; font-size: 18px; }
.rail-setting .rail-ico { font-size: 18px; }

.content {
  margin-left: 72px; padding: 30px 40px 90px;
  max-width: 1560px; min-height: calc(100vh - 64px);
}

/* ================= 三栏工作台（即梦式） ================= */
.workbench {
  display: grid;
  grid-template-columns: 264px minmax(0,1fr) 300px;
  gap: 20px; align-items: start;
}
/* 分镜页无左栏模型列：两栏（参数中栏 + 结果右栏） */
.view[data-panel="storyboard"] .workbench { grid-template-columns: minmax(0,1fr) 300px; }
.panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); backdrop-filter: blur(20px);
  box-shadow: 0 18px 50px rgba(0,0,0,.28);
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 20px 12px;
}
.panel-title { font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.panel-count {
  font-size: 12px; color: var(--text-2); background: var(--glass-2);
  padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line);
}
.panel-note { font-size: 12px; color: var(--text-3); }
.preview-state {
  font-size: 11px; font-weight: 700; color: #00e0a0;
  background: rgba(0,224,160,.14); padding: 3px 10px; border-radius: 999px;
}

/* ---- 左栏 ---- */
.wb-left { position: sticky; top: 80px; max-height: calc(100vh - 96px); overflow: hidden; display: flex; flex-direction: column; }
.model-search {
  margin: 6px 18px 12px; padding: 11px 14px; font-size: 13px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--glass);
  color: var(--text); width: calc(100% - 36px);
}
.model-search:focus { outline: none; box-shadow: 0 0 0 2px rgba(0,212,255,.35); border-color: transparent; }
.model-filter { display: flex; gap: 8px; padding: 0 18px 8px; }
.filter-chip {
  flex: 1; font-size: 13px; padding: 8px; border-radius: 10px;
  background: var(--glass); border: 1px solid var(--line); color: var(--text-2); font-weight: 600;
}
.filter-chip.active { background: var(--grad-soft); color: #fff; border-color: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.model-panel-list { padding: 8px 14px 14px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.mp-item {
  border: 1px solid var(--line); border-radius: 14px; padding: 13px 14px;
  cursor: pointer; transition: all .22s; background: var(--glass);
}
.mp-item:hover { background: var(--glass-2); }
.mp-item.sel { border-color: var(--acc2); background: var(--grad-soft); box-shadow: var(--glow); }
.mp-top { display: flex; align-items: center; gap: 8px; }
.mp-name { font-size: 13.5px; font-weight: 600; flex: 1; line-height: 1.35; }
.mp-check {
  width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-2);
  display: grid; place-items: center; font-size: 11px; color: transparent; flex-shrink: 0;
}
.mp-item.sel .mp-check { background: var(--grad); border-color: transparent; color: #fff; }
.mp-price { font-size: 11.5px; color: var(--text-2); margin-top: 7px; }
.mp-price b { color: var(--acc2); }
.mp-note { font-size: 11px; color: var(--text-3); margin-top: 3px; }
/* 模型分组（后台「前端分组」驱动：组头可点折叠，组内保持后台填写顺序） */
.mp-group { display: flex; flex-direction: column; gap: 8px; }
.mp-group-head {
  display: flex; align-items: center; gap: 8px; padding: 2px 4px;
  cursor: pointer; user-select: none;
}
.mp-group-head:hover .mp-group-name { color: var(--text-1); }
.mp-group-chev { font-size: 10px; color: var(--text-3); transition: transform .18s; width: 12px; }
.mp-group.collapsed .mp-group-chev { transform: rotate(-90deg); }
.mp-group.collapsed .mp-group-body { display: none; }
.mp-group-name {
  font-size: 12.5px; font-weight: 700; color: var(--text-2); letter-spacing: .3px;
  display: flex; align-items: center; gap: 6px;
}
.mp-group-name::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--grad); flex-shrink: 0; }
.mp-group-count {
  font-size: 10.5px; color: var(--text-3); background: var(--glass); border: 1px solid var(--line);
  border-radius: 9px; padding: 1px 8px;
}
.mp-group-body { display: flex; flex-direction: column; gap: 8px; padding-left: 6px; }
/* 主面板模型标题下方：详情三列（适合场景/支持能力/费用提示，后台手动填写后显示） */
.ms-detail { margin-top: 10px; }
.ms-detail-grid { display: grid; gap: 10px; margin-top: 10px; }
.ms-dc { min-width: 0; }
.ms-dk { font-size: 11px; color: var(--text-3); margin-bottom: 3px; }
.ms-dv { font-size: 12px; color: var(--text-2); line-height: 1.5; }

/* ---- 中栏 ---- */
.wb-mid { padding: 0 24px 26px; }
.model-selected {
  border: 1px solid var(--line-2); border-radius: 14px; padding: 14px 16px;
  background: var(--glass); margin-bottom: 18px;
}
.ms-name { font-size: 14px; font-weight: 700; }
.ms-desc { font-size: 12.5px; color: var(--text-2); margin-top: 4px; }
.ms-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ms-chip { font-size: 11px; padding: 4px 10px; border-radius: 999px; background: var(--glass-2); color: var(--text-2); border: 1px solid var(--line); }
.wb-mid .field { margin-bottom: 16px; }
.wb-mid .field-label { margin-bottom: 8px; }
.ref-block { margin: 6px 0 18px; }
.ref-head { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.ref-hint { font-size: 11px; color: var(--acc2); font-weight: 500; }
.ref-actions { display: flex; gap: 10px; margin-bottom: 12px; }
.ref-btn {
  font-size: 13px; padding: 9px 16px; border-radius: 10px;
  background: var(--glass); border: 1px solid var(--line-2); color: var(--text); font-weight: 500;
  transition: all .2s;
}
.ref-btn:hover { background: var(--glass-2); border-color: var(--acc2); }
.ref-thumbs { display: flex; gap: 10px; flex-wrap: wrap; min-height: 8px; }
.ref-thumb {
  width: 64px; height: 64px; border-radius: 10px; background: var(--grad);
  display: grid; place-items: center; color: #fff; font-size: 20px; position: relative;
}
.ref-thumb.x { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; border-radius: 50%;
  background: rgba(0,0,0,.7); color: #fff; font-size: 11px; display: grid; place-items: center; border: none; cursor: pointer; z-index: 2; }
.ref-thumb.clickable { cursor: pointer; }
.ref-thumb.clickable:hover { outline: 2px solid var(--acc2); outline-offset: 1px; }
.ref-thumb .ref-kind { position: absolute; bottom: 3px; left: 5px; z-index: 2;
  font-size: 10px; line-height: 1; padding: 2px 5px; border-radius: 5px;
  background: rgba(0,0,0,.6); color: #fff; font-weight: 600; }
.param-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin: 4px 0 18px; }
.param-grid .field { margin-bottom: 0; }
.compat { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--glass); margin-bottom: 18px; }
.compat-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.compat-title { font-size: 12px; color: var(--text-2); font-weight: 600; }
.compat-recheck { font-size: 11px; color: var(--acc2); background: none; border: none; font-weight: 600; }
.compat-line { font-size: 12.5px; color: var(--text-2); padding: 4px 0; }
.compat-line.ok { color: #00e0a0; }
.compat-line.warn { color: #ffb020; }
.gen-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.gen-foot .cost-hint { font-size: 13px; }

/* ---- 右栏 ---- */
.wb-right { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 80px; }
.preview { overflow: hidden; }
.preview-media {
  margin: 0 16px 16px; aspect-ratio: 9/12; border-radius: 14px;
  background: linear-gradient(160deg, #14141f, #0a0a12);
  position: relative; overflow: hidden; display: grid; place-items: center;
  border: 1px solid var(--line);
}
.preview-ph { font-size: 13px; color: var(--text-3); }
.preview-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.preview-media .preview-bar {
  position: absolute; bottom: 0; left: 0; right: 0; padding: 12px;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  display: flex; align-items: center; gap: 10px; color: #fff; font-size: 12px;
}
.preview-media .preview-bar .bar-play { width: 26px; height: 26px; border-radius: 50%; background: rgba(255,255,255,.2); display: grid; place-items: center; }
.latest { padding-bottom: 16px; }
.latest-summary { font-size: 13px; color: var(--text-2); padding: 0 20px 14px; line-height: 1.5; }
.status-tabs { display: flex; gap: 8px; padding: 0 20px 14px; }
.st-tab {
  font-size: 12px; padding: 7px 14px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--line); color: var(--text-2); font-weight: 600;
}
.st-tab.active { background: var(--grad-soft); color: #fff; border-color: transparent; }
.progress { padding: 0 20px 14px; }
.progress-track { height: 6px; border-radius: 999px; background: var(--glass-2); overflow: hidden; }
.progress-track span { display: block; height: 100%; border-radius: 999px; background: var(--grad); transition: width .5s; }
.progress-label { font-size: 11.5px; color: var(--text-3); margin-top: 8px; display: block; }
.latest-meta { padding: 0 20px; display: flex; flex-direction: column; gap: 6px; }
.meta-row { display: flex; justify-content: space-between; font-size: 12.5px; }
.meta-row span { color: var(--text-3); }
.meta-row b { font-weight: 600; }
.mono { font-family: ui-monospace, monospace; font-size: 11px !important; color: var(--acc2); }
.view-history {
  margin: 14px 20px 0; width: calc(100% - 40px); text-align: center;
  font-size: 13px; padding: 11px; border-radius: 12px;
  background: var(--glass); border: 1px solid var(--line); color: var(--text); font-weight: 600;
  transition: all .2s;
}
.view-history:hover { background: var(--glass-2); color: var(--acc2); }

/* 工作台内的画布卡片（用于 t2v/t2i/i2v 旧视图保留） */

/* ================= 视图头（苹果式大 hero） ================= */
.view { display: none; }
.view.active { display: block; animation: rise .5s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.view-head { margin-bottom: 30px; }
.view-head h1 {
  font-size: clamp(34px, 5vw, 52px); font-weight: 800;
  letter-spacing: -1.5px; margin: 0; line-height: 1.05;
}
.view-head h1 .hl {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.sub { color: var(--text-2); font-size: 16px; margin: 12px 0 0; max-width: 560px; line-height: 1.6; }

/* ================= 生成参数区（玻璃卡片） ================= */
.composer {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 30px; margin-bottom: 34px;
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.composer-body { display: flex; flex-direction: column; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 9px; flex: 1; }
.field-label { font-size: 12px; color: var(--text-2); font-weight: 600; letter-spacing: .3px; }
.char-count { float: right; color: var(--text-3); font-weight: 500; }
textarea, select, input[type="text"], input:not([type]) {
  border: 1px solid var(--line); background: var(--glass);
  color: var(--text); border-radius: 14px; padding: 14px 16px;
  font-size: 14px; outline: none; transition: all .25s; width: 100%;
  font-family: inherit;
}
textarea { resize: vertical; line-height: 1.6; }
textarea:focus, select:focus, input:focus {
  border-color: transparent; box-shadow: 0 0 0 2px rgba(0,212,255,.4), var(--glow);
  background: var(--glass-2);
}
select { appearance: none; background-image: linear-gradient(45deg,transparent 50%,var(--text-2) 50%), linear-gradient(135deg,transparent 50%,var(--text-2) 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 13px) 20px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.param-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.composer-actions { display: flex; align-items: center; justify-content: space-between; padding-top: 4px; }
.cost-hint { font-size: 14px; color: var(--text-2); }
.cost-hint b { color: var(--acc2); font-size: 18px; font-weight: 700; }

/* ================= 按钮（渐变胶囊） ================= */
.btn-primary {
  background: var(--grad); color: #fff; border: none;
  border-radius: 999px; padding: 14px 32px;
  font-size: 15px; font-weight: 700; letter-spacing: .2px;
  box-shadow: var(--glow); transition: all .25s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 0 50px rgba(0,212,255,.5); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost {
  background: var(--glass); color: var(--text);
  border: 1px solid var(--line-2); border-radius: 999px; padding: 13px 24px; font-size: 14px; font-weight: 600;
  transition: all .25s;
}
.btn-ghost:hover { background: var(--glass-2); }

/* ================= 画布结果（高级卡片） ================= */
.canvas {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 22px;
}
.canvas-empty {
  grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 260px; border: 1.5px dashed var(--line-2);
  border-radius: var(--r-lg); gap: 14px; color: var(--text-2); text-align: center; padding: 40px;
  background: var(--card); backdrop-filter: blur(10px);
}
.empty-icon { font-size: 38px; opacity: .55; filter: drop-shadow(0 0 18px rgba(108,92,231,.4)); }

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden;
  backdrop-filter: blur(20px);
  transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s;
  animation: pop .5s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes pop { from { opacity: 0; transform: scale(.9) translateY(10px); } to { opacity: 1; transform: none; } }
.card:hover { transform: translateY(-6px); box-shadow: 0 24px 50px rgba(0,0,0,.35); }
.card-media {
  aspect-ratio: 4/5; position: relative; overflow: hidden; display: grid; place-items: center;
  color: #fff;
}
/* 高质量占位：霓虹渐变+噪点+光晕，不再是死色块 */
.card-media .ph {
  position: absolute; inset: 0;
  background: var(--grad); opacity: .85;
}
.card-media .ph::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.25) 1px, transparent 1px);
  background-size: 6px 6px; opacity: .4; mix-blend-mode: overlay;
}
.card-media .ph-em { position: relative; z-index: 2; font-size: 46px; filter: drop-shadow(0 6px 18px rgba(0,0,0,.4)); }
.card-media img, .card-media video { position: relative; z-index: 3; width: 100%; height: 100%; object-fit: cover; }
.card-media .badge {
  position: absolute; top: 12px; left: 12px; z-index: 4;
  background: rgba(0,0,0,.5); backdrop-filter: blur(8px);
  font-size: 11px; padding: 4px 12px; border-radius: 999px; font-weight: 600;
}
.card-media.loading .ph { opacity: .4; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .3; } 50% { opacity: .6; } }
.card-media .spinner {
  position: relative; z-index: 3; width: 40px; height: 40px;
  border: 3px solid rgba(255,255,255,.2); border-top-color: #fff;
  border-radius: 50%; animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.card-meta { padding: 16px 18px; }
.card-title { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { font-size: 12px; color: var(--text-2); margin-top: 5px; }
.card-actions { display: flex; gap: 8px; margin-top: 12px; }
.card-actions button {
  font-size: 12px; padding: 7px 14px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--line-2); color: var(--text);
  transition: all .2s; font-weight: 500;
}
.card-actions button:hover { background: var(--glass-2); color: var(--acc2); }

/* ================= 历史任务 ================= */
.task-list { display: flex; flex-direction: column; gap: 14px; }
.task-item {
  display: flex; align-items: center; gap: 18px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px 20px; backdrop-filter: blur(20px);
  transition: all .25s;
}
.task-item:hover { background: var(--card-hover); transform: translateX(4px); }
.task-thumb {
  width: 84px; height: 56px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; color: #fff; font-size: 22px;
  background: var(--grad); opacity: .9; overflow: hidden; position: relative;
}
.task-thumb img, .task-thumb video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.task-thumb .thumb-badge {
  position: absolute; top: 5px; right: 5px; font-size: 10px;
  background: rgba(0,0,0,.55); color: #fff; padding: 2px 8px; border-radius: 999px; z-index: 2;
}
.task-item.task-expired .task-thumb { filter: grayscale(1); opacity: .5; }
.task-item.task-expired .task-title, .task-item.task-expired .task-sub { opacity: .6; }
.task-regen {
  font-size: 12px; padding: 7px 14px; border-radius: 999px;
  background: var(--glass); border: 1px solid var(--line-2); color: var(--text); font-weight: 600;
  transition: all .2s; white-space: nowrap;
}
.task-regen:hover { background: var(--grad); color: #fff; border-color: transparent; box-shadow: var(--glow); }
.task-item { gap: 16px; }
.task-info { flex: 1; min-width: 0; }
.task-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-sub { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.task-status { font-size: 12px; padding: 5px 14px; border-radius: 999px; white-space: nowrap; font-weight: 600; }
.st-done { background: rgba(0,212,150,.15); color: #00e0a0; }
.st-run { background: rgba(255,176,32,.15); color: #ffb020; }
.st-pending { background: rgba(0,212,255,.15); color: #00d4ff; }
.st-fail { background: rgba(255,69,58,.15); color: #ff6a5f; }

/* ================= 模板 ================= */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px,1fr)); gap: 24px; }
.tpl {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); overflow: hidden; cursor: pointer;
  backdrop-filter: blur(20px);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s;
}
.tpl:hover { transform: translateY(-8px) scale(1.02); box-shadow: 0 28px 60px rgba(0,0,0,.4); }
.tpl-media { aspect-ratio: 16/10; display: grid; place-items: center; color: #fff; font-size: 44px;
  position: relative; overflow: hidden; background: var(--grad); }
.tpl-media::after { content:""; position:absolute; inset:0;
  background-image: radial-gradient(rgba(255,255,255,.18) 1px, transparent 1px); background-size: 8px 8px; opacity:.5; }
.tpl-body { padding: 18px 20px; }
.tpl-tag { font-size: 11px; color: var(--acc2); font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.tpl-name { font-size: 17px; font-weight: 700; margin-top: 8px; }
.tpl-desc { font-size: 13px; color: var(--text-2); margin-top: 6px; line-height: 1.5; }

/* ================= 模型广场 ================= */
.model-list { display: flex; flex-direction: column; gap: 18px; }
.model-item {
  display: flex; align-items: center; gap: 20px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 22px 26px; backdrop-filter: blur(20px);
  transition: all .25s;
}
.model-item:hover { background: var(--card-hover); transform: translateY(-3px); box-shadow: var(--glow); }
.model-emoji {
  width: 58px; height: 58px; border-radius: 16px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 26px; color: #fff;
  background: var(--grad); box-shadow: var(--glow);
}
.model-info { flex: 1; }
.model-name { font-size: 18px; font-weight: 700; }
.model-desc { font-size: 14px; color: var(--text-2); margin-top: 5px; }
.model-price { font-size: 15px; color: var(--acc2); font-weight: 700; white-space: nowrap; }

/* ================= 账户 · 充值 ================= */
.balance-card {
  background: var(--grad); border-radius: var(--r-lg); padding: 44px;
  color: #fff; display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 32px; position: relative; overflow: hidden;
  box-shadow: 0 24px 60px rgba(108,92,231,.4);
}
.balance-card::after { content:""; position:absolute; right:-60px; top:-60px; width:200px; height:200px;
  background: rgba(255,255,255,.15); border-radius: 50%; }
.balance-label { font-size: 15px; opacity: .9; }
.balance-num { font-size: 64px; font-weight: 800; letter-spacing: -2px; }
.recharge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px,1fr)); gap: 18px; margin-bottom: 32px; }
.recharge-card {
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: var(--r); padding: 26px 22px; cursor: pointer; text-align: center;
  backdrop-filter: blur(20px); transition: all .25s; position: relative;
}
.recharge-card:hover { border-color: var(--acc2); transform: translateY(-4px); }
.recharge-card.sel { border-color: var(--acc1); background: var(--grad-soft); }
.rc-amount { font-size: 34px; font-weight: 800; letter-spacing: -1px; }
.rc-desc { font-size: 13px; color: var(--text-2); margin-top: 8px; }
.rc-detail { display: flex; flex-direction: column; gap: 4px; margin-top: 12px;
  padding-top: 12px; border-top: 1px dashed var(--line-2); font-size: 12px; color: var(--text-3); }
.rc-detail b { color: var(--text); font-weight: 700; }

/* 充值页自定义卡片（图左文右 · 铺满整列 · 舒展） */
.recharge-custom { margin: 20px auto 28px; }
.recharge-custom .rcard {
  display: flex; align-items: center; gap: 22px; text-align: left;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 24px 28px;
  backdrop-filter: blur(20px);
}
.rcard-img {
  flex: 0 0 auto; width: 150px; height: 150px; object-fit: contain;
  border-radius: 12px; border: 1px solid var(--line-2); background: #fff; padding: 6px;
}
.rcard-body { flex: 1; min-width: 0; }
.rcard-title { font-size: 18px; font-weight: 800; margin-bottom: 10px; letter-spacing: -0.3px; }
.rcard-text { font-size: 13.5px; color: var(--text-2); line-height: 1.85; white-space: pre-line; }
/* 无图时单列居中、更大 */
.recharge-custom.no-img .rcard { flex-direction: column; align-items: flex-start; text-align: left; }
.recharge-custom.no-img .rcard-title { font-size: 20px; }
.rcard-img.err { display: none; }
/* 手机窄屏：图在上、文在下 */
@media (max-width: 640px) {
  .recharge-custom .rcard { flex-direction: column; align-items: center; gap: 14px; }
  .rcard-body { text-align: center; }
  .rcard-img { width: 132px; height: 132px; }
}
.rc-tag { font-size: 11px; color: #fff; background: var(--grad); font-weight: 700;
  padding: 4px 12px; border-radius: 999px; margin-top: 12px; display: inline-block; }
.redeem-box { background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 24px; backdrop-filter: blur(20px); }
.redeem-row { display: flex; gap: 10px; }
.redeem-row input { flex: 1; }

/* ================= 扫码支付 ================= */
.pay-panel {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); padding: 24px; margin-bottom: 28px;
  backdrop-filter: blur(20px); text-align: center;
}
.pay-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.pay-title { font-size: 15px; font-weight: 700; }
.pay-type-toggle { display: flex; gap: 8px; }
.pay-type {
  background: var(--glass); border: 1px solid var(--line); color: var(--text-2);
  padding: 6px 14px; border-radius: 999px; cursor: pointer; font-size: 12px; transition: all .2s;
}
.pay-type.active { background: var(--grad-soft); border-color: var(--acc1); color: var(--text); font-weight: 600; }
.pay-qr { display: flex; justify-content: center; margin: 12px 0; }
.pay-qr img { width: 200px; height: 200px; border-radius: 12px; border: 4px solid #fff;
  box-shadow: 0 0 0 2px var(--line-2), var(--glow); }
.pay-qr .qr-placeholder {
  width: 200px; height: 200px; display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--line-2); border-radius: 12px; color: var(--text-3); font-size: 13px;
}
.pay-status { font-size: 14px; font-weight: 600; margin-top: 8px; }
.pay-status.paid { color: #2ecc71; }
.pay-status.pending { color: var(--text-2); }
.pay-status.error { color: var(--acc3); }
.pay-note { font-size: 12px; color: var(--text-3); margin-top: 8px; line-height: 1.6; }

/* 充值弹窗（覆盖在页面上的二级框） */
.pay-overlay {
  position: fixed; inset: 0; z-index: 95; display: none;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,.6); backdrop-filter: blur(6px);
}
.pay-overlay.show { display: flex; }
.pay-modal {
  position: relative; width: min(400px, 94vw); max-height: 92vh; overflow-y: auto;
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: 20px;
  padding: 22px; text-align: center; box-shadow: var(--glow);
}
.pay-close {
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px;
  border-radius: 50%; border: 1px solid var(--line-2); background: var(--glass);
  color: var(--text-2); cursor: pointer; font-size: 13px;
}
.pay-close:hover { color: var(--text); }
.pay-m-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pay-m-title { font-size: 16px; font-weight: 700; }
.pay-m-order { font-size: 11px; color: var(--text-3); margin: 6px 0 12px; word-break: break-all; }
.pay-m-order b { color: var(--text-2); font-family: monospace; }
.pay-m-amt {
  background: var(--glass); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 16px; margin-bottom: 14px; text-align: left;
}
.pma-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); padding: 3px 0; }
.pma-row b { color: var(--text); }
.pma-total { border-top: 1px dashed var(--line-2); margin-top: 6px; padding-top: 8px; }
.pma-total b { color: var(--acc2); font-size: 16px; }
.pay-m-mob { margin-top: 10px; }
.pay-m-mob .btn-ghost { font-size: 12px; }
.pay-status.paid { color: #2ecc71; font-size: 15px; }



/* ================= 消费记录 ================= */
.record-table { background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r); backdrop-filter: blur(20px); overflow: hidden; }
.rec-head, .rec-row {
  display: grid; grid-template-columns: 2fr 1.2fr 1fr 1fr; gap: 12px;
  padding: 16px 22px; align-items: center; font-size: 14px;
}
.rec-head { color: var(--text-2); font-size: 12px; border-bottom: 1px solid var(--line);
  letter-spacing: .5px; text-transform: uppercase; font-weight: 600; }
.rec-row { border-bottom: 1px solid var(--line); }
.rec-row:last-child { border-bottom: none; }
.rec-row:hover { background: var(--glass); }
.rec-row .amt { color: #ff6a5f; font-weight: 700; }

/* ================= 设置 ================= */
.settings-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 32px; backdrop-filter: blur(20px);
  display: flex; flex-direction: column; gap: 20px; max-width: 480px;
}

/* ================= 上传区 ================= */
.upload-drop {
  border: 1.5px dashed var(--line-2); border-radius: var(--r);
  padding: 36px; text-align: center; cursor: pointer; color: var(--text-2);
  transition: all .25s;
}
.upload-drop:hover { border-color: var(--acc2); background: var(--glass); }
.upload-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 14px; }

/* ================= Toast ================= */
.toast {
  position: fixed; bottom: 36px; left: 50%;
  transform: translateX(-50%) translateY(90px);
  background: rgba(20,20,28,.9); border: 1px solid var(--line-2);
  color: #fff; padding: 15px 28px; border-radius: 999px; font-size: 14px; font-weight: 600;
  opacity: 0; transition: all .45s cubic-bezier(.2,.8,.2,1); z-index: 999; pointer-events: none;
  box-shadow: 0 20px 50px rgba(0,0,0,.4), var(--glow);
  backdrop-filter: blur(10px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   无限画布工作台（节点式）
   ============================================================ */
.cvs-wrap {
  display: flex; flex-direction: column;
  height: calc(100vh - 64px); min-height: 640px;
  border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  background: var(--bg-2); box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

/* 顶部工具栏 */
.cvs-toolbar {
  display: flex; align-items: center; gap: 8px; padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-2) 85%, transparent);
  backdrop-filter: blur(14px); z-index: 20; flex-wrap: nowrap; overflow-x: auto;
}
.tb-title { font-size: 15px; font-weight: 700; white-space: nowrap; margin-right: 6px; }
.tb-chip {
  font-size: 13px; padding: 7px 14px; border-radius: 10px; white-space: nowrap;
  background: var(--grad-soft); color: #fff; border: 1px solid var(--line-2); font-weight: 600;
}
.tb-ico {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: var(--glass); border: 1px solid var(--line); color: var(--text-2);
  font-size: 15px; display: grid; place-items: center; transition: all .2s;
}
.tb-ico:hover { background: var(--glass-2); color: var(--text); }
.tb-ico.active { background: var(--grad); color: #fff; border-color: transparent; box-shadow: var(--glow); }
.tb-run {
  font-size: 13px; font-weight: 700; padding: 9px 18px; border-radius: 10px;
  background: var(--grad); color: #fff; border: none; white-space: nowrap; box-shadow: var(--glow);
}
.tb-run.ghost { background: var(--glass); border: 1px solid var(--line-2); color: var(--text); box-shadow: none; }
.tb-run.ghost:hover { background: var(--glass-2); }

/* 工具栏右侧：模型来源 + 模型选择 */
.tb-right { display: flex; gap: 8px; margin-left: auto; }
.src-pick {
  display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-2);
  background: var(--glass); border: 1px solid var(--line); padding: 5px 10px; border-radius: 10px;
}
.src-pick select {
  border: none; background: transparent; color: var(--text); font-size: 12px;
  padding: 0 4px; outline: none; cursor: pointer;
}
.src-pick select option { background: var(--bg-2); color: var(--text); }

/* 画布区（React Flow 挂载点） */
.cvs-canvas {
  flex: 1; position: relative; overflow: hidden;
  background-color: var(--bg);
}

/* 节点卡片（React Flow 用） */
.rf-node {
  width: 280px; min-height: 80px;
  background: var(--card); border: 1px solid var(--line-2);
  border-radius: 14px; backdrop-filter: blur(20px);
  box-shadow: 0 12px 34px rgba(0,0,0,.32);
  transition: box-shadow .2s;
  font-family: inherit;
}
.rf-node:global(.selected) { box-shadow: 0 0 0 2px var(--acc2), var(--glow); }
.node-hd {
  display: flex; align-items: center; gap: 8px; padding: 11px 14px;
  border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 700;
}
.node-hd .nt { color: var(--text-2); font-weight: 500; flex: 1; }
.node-status {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px;
  background: rgba(0,224,160,.15); color: #00e0a0;
}
.node-bd { padding: 12px 14px; }
.node-sub { font-size: 12px; color: var(--text-2); line-height: 1.5; margin-bottom: 10px; }

/* 节点里配置行 */
.node .cfg-row { display: flex; gap: 8px; margin-bottom: 8px; }
.node .cfg-row select, .node .cfg-row input {
  flex: 1; font-size: 12px; padding: 7px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--glass); color: var(--text);
}
.node .node-hint { font-size: 11px; color: var(--text-3); margin: 8px 0 10px; }
.node .btn-primary { width: 100%; padding: 10px; font-size: 13px; }
.node .btn-primary.small { padding: 9px 18px; font-size: 12px; }

/* 节点里模型选择器（关键） */
.model-pick {
  flex-direction: column; align-items: stretch; gap: 6px;
  background: var(--glass); border: 1px solid var(--line); border-radius: 12px; padding: 10px;
}
.mp-label { display: flex; flex-direction: column; gap: 6px; }
.mp-label span { font-size: 11px; color: var(--text-2); font-weight: 600; }
.mp-label select {
  border: 1px solid var(--line-2); background: var(--card); color: var(--text);
  border-radius: 10px; padding: 9px 10px; font-size: 13px; font-weight: 600; outline: none;
  box-shadow: 0 0 0 2px rgba(0,212,255,.15);
}
.mp-label select:focus { box-shadow: 0 0 0 2px rgba(0,212,255,.5); }
.mp-src { font-size: 11px; color: var(--text-3); }
.rf-input {
  width: 100%; min-height: 60px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--glass); color: var(--text);
  font-size: 13px; padding: 10px; outline: none; resize: vertical;
}
.rf-input:focus { box-shadow: 0 0 0 2px rgba(0,212,255,.35); }

/* 节点：结果 */
.node-result .res-media {
  margin-top: 8px; aspect-ratio: 16/9; border-radius: 10px; background: var(--glass);
  display: grid; place-items: center; overflow: hidden; position: relative;
}
.node-result .res-media img { width: 100%; height: 100%; object-fit: cover; }
.node-result .res-media .spinner, .node-result .spinner {
  width: 28px; height: 28px; border: 3px solid var(--glass-2);
  border-top-color: var(--acc2); border-radius: 50%; animation: spin .8s linear infinite;
}

/* React Flow 视觉覆盖 */
.react-flow__node { font-size: 0; }
.react-flow__handle {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--acc2); border: 2px solid var(--bg);
}
.react-flow__handle:hover { box-shadow: 0 0 0 4px rgba(0,212,255,.3); }
.react-flow__edge-path { stroke: url(#rfGrad); stroke-width: 2.4; }
.react-flow__edge.selected .react-flow__edge-path { stroke-width: 3.4; filter: drop-shadow(0 0 8px rgba(0,212,255,.5)); }
.react-flow__controls {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden;
}
.react-flow__controls button {
  background: var(--card); color: var(--text); border-bottom: 1px solid var(--line);
}
.react-flow__minimap {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden;
}
.react-flow__minimap .react-flow__minimap-node { fill: var(--acc1); opacity: .8; }
.react-flow__background { background-color: var(--bg); }
.react-flow__attribution { display: none; }

/* 时间轴 */
.cvs-timeline {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  border-top: 1px solid var(--line); background: var(--card); backdrop-filter: blur(14px);
}
.tl-label { font-size: 13px; font-weight: 700; white-space: nowrap; }
.tl-label em { font-style: normal; font-weight: 500; color: var(--text-2); font-size: 12px; }
.tl-track { flex: 1; height: 6px; border-radius: 999px; background: var(--glass-2); position: relative; }
.tl-track span { position: absolute; left: 0; top: -4px; width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 12px solid var(--acc2); transform: translateX(-50%); }
.tl-del { font-size: 12px; padding: 6px 14px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); color: var(--text-2); }

/* 状态栏 */
.cvs-status {
  display: flex; align-items: center; gap: 14px; padding: 9px 18px;
  border-top: 1px solid var(--line); background: var(--bg-2); font-size: 12.5px;
}
.st-ready { color: var(--text); font-weight: 600; }
.st-hint { color: var(--text-3); }

/* 底部工具条 */
.cvs-actionbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 18px; border-top: 1px solid var(--line);
  background: var(--card); backdrop-filter: blur(14px);
}
.ab-hint { font-size: 12.5px; color: var(--text-2); }
.btn-primary.small { padding: 10px 22px; font-size: 13px; }

/* 画布页全屏时收窄内容 */
.content:has(.cvs-wrap.active) { max-width: none; padding: 18px 24px; }

/* ================= 模型管理 ================= */
.mm-api { margin-bottom: 18px; }
.mm-status { font-size: 12px; font-weight: 600; padding: 4px 12px; border-radius: 999px; background: var(--glass-2); }
.mm-grid { display: grid; grid-template-columns: 1.4fr 1.4fr 1fr; gap: 14px; margin: 14px 0; }
.mm-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mm-hint { font-size: 12px; color: var(--text-3); }
.btn-ghost {
  background: transparent; border: 1px solid var(--line-2); color: var(--text-2);
  padding: 10px 18px; border-radius: 12px; font-size: 13px; font-weight: 600; transition: all .2s; cursor: pointer;
}
.btn-ghost:hover { color: var(--text); border-color: var(--acc2); background: var(--glass); }
.mm-newbar {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px; margin-bottom: 18px;
  background: var(--grad-soft); border: 1px solid var(--line-2); border-radius: 14px;
  font-size: 13.5px; box-shadow: var(--glow);
}
.mm-newico { font-size: 16px; }
.mm-newbar b { color: var(--acc2); }
.mm-newbtn {
  margin-left: auto; background: var(--acc1); color: #fff; border: none;
  padding: 7px 16px; border-radius: 999px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.mm-search {
  width: 100%; background: var(--glass); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 14px; color: var(--text); font-size: 13px; margin: 12px 0; outline: none;
}
.mm-search:focus { border-color: var(--acc2); }
.mm-meta { font-size: 12px; color: var(--text-3); }
.mm-models { display: flex; flex-direction: column; gap: 8px; max-height: 520px; overflow-y: auto; padding: 4px; }
.mm-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  background: var(--glass); border: 1px solid var(--line); border-radius: 12px; transition: all .2s;
}
.mm-row:hover { border-color: var(--line-2); background: var(--glass-2); }
.mm-ico { font-size: 18px; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: var(--grad-soft); flex-shrink: 0; }
.mm-info { flex: 1; min-width: 0; }
.mm-id { font-family: var(--mono, monospace); font-size: 13.5px; font-weight: 600; word-break: break-all; }
.mm-type { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.mm-use {
  background: var(--grad); color: #fff; border: none; padding: 7px 16px;
  border-radius: 999px; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
@media (max-width: 1280px) {
  .mm-grid { grid-template-columns: 1fr 1fr; }
}

/* ================= 响应式 ================= */
@media (max-width: 1280px) {
  .workbench { grid-template-columns: 240px minmax(0,1fr); }
  .wb-right { display: none; }
}
/* 分镜面板没有左栏，窄屏改单列堆叠，右栏（预览/下载）保持可见 */
@media (max-width: 1280px) {
  .view[data-panel="storyboard"] .workbench { grid-template-columns: 1fr; }
  .view[data-panel="storyboard"] .wb-right { display: flex; position: static; }
}
@media (max-width: 900px) {
  .rail { width: 56px; }
  .rail-lbl { display: none; }
  .content { margin-left: 56px; padding: 28px 18px 70px; }
  .topbar-inner { gap: 10px; padding: 0 16px; }
  .brand-tag, .quota-chip .quota-unit { display: none; }
  .nav-link { padding: 8px 12px; font-size: 13px; }
  .workbench { grid-template-columns: 1fr; }
  .wb-left { position: static; max-height: 360px; }
  .param-grid { grid-template-columns: repeat(2,1fr); }
}

/* ===== 顶栏登录/注册 chip ===== */
.login-chip {
  background: transparent; border: 1px solid var(--border, rgba(255,255,255,.14));
  color: var(--text-2); border-radius: 999px; padding: 6px 14px; font-size: 13px;
  cursor: pointer; margin-right: 8px; transition: all .15s;
}
.login-chip:hover { border-color: var(--acc, #6c5ce7); color: var(--text-1); }
.login-chip.on { color: var(--acc2, #00e0a0); border-color: rgba(0,224,160,.4); font-weight: 600; }
.login-chip.logout-chip { margin-right: 0; border-color: rgba(255,84,112,.35); color: #ff8a9e; }
.login-chip.logout-chip:hover { border-color: #ff5470; color: #ff5470; background: rgba(255,84,112,.08); }
.logout-full { color: #ff5470; border-color: rgba(255,84,112,.4); width: 100%; margin-top: 8px; }
.logout-full:hover { background: rgba(255,84,112,.1); border-color: #ff5470; color: #ff5470; }

/* ===== 模型列表空态 ===== */
.model-empty { padding: 18px 12px; color: var(--text-3); font-size: 13px; line-height: 1.6; }

/* ===== 登录/注册 弹窗 ===== */
.auth-overlay {
  position: fixed; inset: 0; z-index: 90; display: none;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,.55); backdrop-filter: blur(6px);
}
.auth-overlay.show { display: flex; }
.auth-modal {
  position: relative; width: min(420px, 92vw); background: var(--bg-2);
  border: 1px solid var(--border, rgba(255,255,255,.12)); border-radius: 18px;
  padding: 26px 24px; box-shadow: 0 24px 60px rgba(0,0,0,.5);
}
.auth-close { position: absolute; top: 14px; right: 14px; background: none; border: none;
  color: var(--text-3); font-size: 18px; cursor: pointer; }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.auth-tab {
  flex: 1; padding: 9px; background: transparent; border: 1px solid var(--border, rgba(255,255,255,.12));
  color: var(--text-2); border-radius: 10px; cursor: pointer; font-size: 14px; transition: all .15s;
}
.auth-tab.active { color: var(--text-1); border-color: var(--acc, #6c5ce7); background: rgba(108,92,231,.12); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .field { display: block; }
.auth-form .field-label { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.auth-form input {
  width: 100%; padding: 10px 12px; background: var(--bg-1, #0b0d12); color: var(--text-1);
  border: 1px solid var(--border, rgba(255,255,255,.12)); border-radius: 10px; font-size: 14px;
}
.auth-form input:focus { outline: none; border-color: var(--acc, #6c5ce7); }
.auth-submit { margin-top: 4px; width: 100%; }
.auth-submit:disabled { opacity: .6; cursor: not-allowed; }
.auth-note { margin: 16px 0 0; font-size: 12px; color: var(--text-3); text-align: center; }
