/* Generated from web/styles/src/* by web/scripts/build-css.cjs. Do not edit app.css directly. */
/* ============== Design Tokens — v18.10.31 视觉升级 ============== */
:root {
  --bg-0: #08080d;
  --bg-1: #0e0e16;
  --bg-2: #16161f;
  --bg-elev: #1a1a25;
  --surface: rgba(255,255,255,0.035);
  --surface-2: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.07);
  --border-strong: rgba(255,255,255,0.14);
  --text: #f5f5f9;
  --text-2: #b1b4c0;
  --text-3: #6e7280;
  --brand: #8b6dff;
  --brand-2: #ff6dc4;
  --accent: #00e6c3;
  --warn: #ffb547;
  --danger: #ff5c7a;
  --grad-1: linear-gradient(135deg,#8b6dff 0%,#ff6dc4 55%,#ffb05c 100%);
  --grad-2: linear-gradient(135deg,#00e6c3 0%,#8b6dff 100%);
  --grad-glow: radial-gradient(60% 60% at 50% 0%, rgba(139,109,255,.35) 0%, transparent 70%);
  --grad-card: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.01) 100%);
  --shadow-1: 0 1px 0 rgba(255,255,255,0.04) inset, 0 12px 40px rgba(0,0,0,0.45);
  --shadow-2: 0 24px 60px -20px rgba(139,109,255,0.5);
  --shadow-card: 0 1px 0 rgba(255,255,255,0.05) inset, 0 4px 20px rgba(0,0,0,0.25), 0 16px 48px -16px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 0 1px rgba(139,109,255,.45), 0 8px 32px -4px rgba(139,109,255,.4);
  --r-sm: 12px; --r-md: 16px; --r-lg: 22px; --r-xl: 30px;
  --t-fast: 160ms cubic-bezier(.2,.8,.2,1);
  --t-mid:  280ms cubic-bezier(.16,1,.3,1);
  --t-slow: 600ms cubic-bezier(.16,1,.3,1);
}
html[data-theme="light"]{
  --bg-0:#f7f7fb; --bg-1:#ffffff; --bg-2:#f0f1f6;
  --surface: rgba(10,10,20,0.03);
  --surface-2: rgba(10,10,20,0.05);
  --border: rgba(10,10,20,0.08);
  --border-strong: rgba(10,10,20,0.18);
  --text:#15151c; --text-2:#52535e; --text-3:#8a8d99;
  --shadow-1: 0 1px 0 rgba(255,255,255,0.6) inset, 0 10px 30px rgba(20,20,40,0.06);
}

* { box-sizing: border-box; }
html, body { margin:0; padding:0; background: var(--bg-0); color: var(--text); font-family:"Inter","PingFang SC","Microsoft YaHei",system-ui,sans-serif; -webkit-font-smoothing:antialiased; }
body { min-height:100vh; overflow-x:hidden; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ============== v18.9 启动遮罩：autoResume 跑完前盖住一切 ============== */
body.booting #page-login,
body.booting #page-app { visibility: hidden; }
body.booting #bootSplash { display: flex; }
#bootSplash {
  display: none;
  position: fixed; inset: 0;
  background: var(--bg-0, #0a0a18);
  z-index: 9999;
  align-items: center; justify-content: center;
  animation: bootFadeIn .2s ease;
}
#bootSplash .boot-card {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 32px 44px;
}
#bootSplash .boot-spinner {
  width: 36px; height: 36px; border-radius: 50%;
  background: conic-gradient(from 0deg, #7c5cff, #ff5cb6, #00e6c3, #7c5cff);
  -webkit-mask: radial-gradient(circle at center, transparent 11px, #000 12px);
          mask: radial-gradient(circle at center, transparent 11px, #000 12px);
  animation: spin 1.1s linear infinite;
}
#bootSplash .boot-text {
  font-size: 13px; color: rgba(255,255,255,.6);
  letter-spacing: .12em; font-weight: 500;
}
html[data-theme="light"] #bootSplash { background: #ffffff; }
html[data-theme="light"] #bootSplash .boot-text { color: rgba(0,0,0,.55); }
@keyframes bootFadeIn { from { opacity: 0; } to { opacity: 1; } }
::selection { background: rgba(124,92,255,.35); color:#fff; }

/* ============== Ambient Background — v18.10.31 更明显的氛围光 ============== */
.ambient {
  position: fixed; inset:0; z-index:0; pointer-events:none;
  background:
    radial-gradient(50% 40% at 85% 15%, rgba(139,109,255,.28), transparent 60%),
    radial-gradient(45% 35% at 10% 5%,  rgba(255,109,196,.20), transparent 60%),
    radial-gradient(40% 35% at 50% 100%, rgba(0,230,195,.12), transparent 60%),
    radial-gradient(80% 60% at 50% 50%, rgba(255,255,255,.02), transparent 70%);
  filter: saturate(125%);
}
.ambient::after{
  content:""; position:absolute; inset:-20%;
  background:
    repeating-linear-gradient(90deg, transparent 0 79px, rgba(255,255,255,.022) 80px),
    repeating-linear-gradient(0deg, transparent 0 79px, rgba(255,255,255,.022) 80px);
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
}
html[data-theme="light"] .ambient{
  background:
    radial-gradient(40% 30% at 80% 10%, rgba(124,92,255,.10), transparent 60%),
    radial-gradient(35% 25% at 10% 0%,  rgba(255,92,182,.08), transparent 60%),
    radial-gradient(30% 25% at 50% 100%, rgba(0,230,195,.08), transparent 60%);
}

/* ============== Glass Card — v18.10.31 更精致 ============== */
.glass {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  box-shadow: var(--shadow-card);
  position: relative;
}
/* 顶部高光描边 */
.glass::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.12) 30%, rgba(255,255,255,0.12) 70%, transparent 100%);
  pointer-events: none;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

/* ============== Topbar ============== */
.topbar {
  position: sticky; top:0; z-index:50;
  display:flex; align-items:center; justify-content:space-between;
  padding: 14px 28px;
  background: color-mix(in oklab, var(--bg-0) 70%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.brand { display:flex; align-items:center; gap:12px; font-weight:600; letter-spacing:.2px; min-width: 0;}
.brand-logo {
  display:block;
  width:132px;
  height:32px;
  object-fit: contain;
  flex-shrink: 0;
}
.brand-copy { display:none; }
.brand-name { font-size: 15px; line-height: 1.15; }
.brand-sub  { font-size: 12px; line-height: 1.15; color: var(--text-3); margin-left: 0; }

.nav-tabs { display:flex; gap:2px; padding:4px; background: var(--surface); border:1px solid var(--border); border-radius: 999px; flex-wrap: nowrap; }
.nav-tab {
  white-space: nowrap;
  padding: 8px 14px; font-size: 13px; color: var(--text-2);
  background: transparent; border: 0; border-radius: 999px; cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast);
}
.nav-tab:hover { color: var(--text); }
.nav-tab.active { color: var(--text); background: var(--bg-1); box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 6px 14px rgba(0,0,0,.25);}

.top-actions { display:flex; align-items:center; gap:10px; }
.wallet-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  max-width: 148px;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.wallet-balance-btn {
  font-family: inherit;
  cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.wallet-balance-btn:hover {
  color: var(--text);
  border-color: color-mix(in oklab, var(--accent) 42%, var(--border));
  transform: translateY(-1px);
}
.wallet-balance-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(0,230,195,.14);
}
.wallet-balance-icon {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  color: var(--accent);
}
.top-actions .wallet-pill {
  flex: 0 1 auto;
  color: var(--text);
  background: color-mix(in oklab, var(--accent) 10%, var(--surface));
  border-color: color-mix(in oklab, var(--accent) 24%, var(--border));
}
.wallet-status-frozen {
  color: var(--warn);
  background: color-mix(in oklab, var(--warn) 14%, rgba(0,0,0,.28));
  border-color: color-mix(in oklab, var(--warn) 34%, transparent);
}
.wallet-status-settled {
  color: var(--accent);
  background: color-mix(in oklab, var(--accent) 13%, rgba(0,0,0,.28));
  border-color: color-mix(in oklab, var(--accent) 32%, transparent);
}
.wallet-status-released {
  color: var(--text-2);
  background: color-mix(in oklab, var(--text-2) 12%, rgba(0,0,0,.28));
  border-color: color-mix(in oklab, var(--text-2) 24%, transparent);
}
.icon-btn {
  position: relative;
  width:36px;height:36px;display:grid;place-items:center;border-radius:10px;
  background: var(--surface); border:1px solid var(--border); color: var(--text-2); cursor:pointer;
  transition: all var(--t-fast);
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px);}
.avatar { width:34px;height:34px;border-radius:50%; background: var(--grad-2); display:grid; place-items:center; font-size:13px; font-weight:600; color:#0a0a14;}

/* ============== Buttons ============== */
.btn {
  --pad-y: 10px; --pad-x: 18px;
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding: var(--pad-y) var(--pad-x); font-size: 13px; font-weight:500; letter-spacing:.2px;
  border-radius: 12px; border: 1px solid var(--border); cursor:pointer;
  background: var(--surface); color: var(--text);
  transition: transform var(--t-fast), background var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}
.btn:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.btn-primary {
  border: 0; color:#fff;
  background: var(--grad-1);
  box-shadow: 0 8px 24px rgba(124,92,255,.45), inset 0 1px 0 rgba(255,255,255,.25);
}
.btn-primary:hover { box-shadow: 0 14px 32px rgba(124,92,255,.55), inset 0 1px 0 rgba(255,255,255,.3); }
.btn-ghost { background: transparent; }
.btn-lg { --pad-y:14px; --pad-x:22px; font-size:14px; border-radius:14px; }
.btn-block { width:100%; }
.btn[disabled]{ opacity:.55; cursor:not-allowed; transform:none; }

/* ============== Pages ============== */
.page { display:none; position:relative; z-index:1; }
.page.active { display:block; animation: fadeUp .5s var(--t-slow); }
@keyframes fadeUp { from { opacity:0; transform: translateY(8px);} to { opacity:1; transform:none;} }

/* ============== Login ============== */
.login-wrap {
  min-height: 100vh; display:grid; place-items:center; padding: 24px;
  position: relative;
}
.login-card {
  width: min(440px, 100%);
  padding: 40px 36px 32px;
  border-radius: var(--r-xl);
  position: relative;
  isolation: isolate;
  border-color: rgba(139,109,255,.24);
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(255,109,196,.10);
}
.login-card::before {
  content:none;
}
.login-hero { text-align:center; margin-bottom: 28px;}
.login-logo {
  display:block;
  width:180px;
  height:44px;
  object-fit: contain;
  margin: 0 auto 22px;
}
.login-hero .badge {
  display:inline-flex; align-items:center; gap:8px; padding:5px 12px; border-radius: 999px;
  background: var(--surface); border:1px solid var(--border); font-size:11px; color: var(--text-2);
}
.login-hero h1 {
  font-size: 28px; line-height: 1.15; margin: 0 0 8px; letter-spacing: -0.5px;
  background: var(--grad-1); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login-hero p { color: var(--text-2); font-size: 13px; margin:0;}

/* v18.7 三个能力点 */
.login-pillars {
  display:flex; flex-direction: column; gap: 8px;
  margin: 0 0 22px;
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(124,92,255,.06), rgba(0,230,195,.04));
  border: 1px solid var(--border);
  border-radius: 12px;
}
.login-pillars .pillar {
  display:flex; align-items:center; gap: 10px;
  font-size: 12px; color: var(--text-2); line-height: 1.5;
}
.login-pillars .pillar-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(124,92,255,.4);
}

.role-switch {
  display:grid; grid-template-columns: 1fr 1fr; gap:6px; padding:5px;
  background: var(--surface); border:1px solid var(--border); border-radius: 14px; margin-bottom: 20px;
}
.role-opt {
  border:0; background:transparent; color: var(--text-2); padding:10px; border-radius:10px;
  font-size:13px; cursor:pointer; transition: all var(--t-fast);
  display:flex; align-items:center; justify-content:center; gap:8px;
}
.role-opt.active { background: var(--bg-1); color: var(--text); box-shadow: 0 4px 12px rgba(0,0,0,.18);}

.field { margin-bottom: 14px; }
.field label { display:block; font-size:12px; color: var(--text-2); margin-bottom: 6px; }
.field input {
  width:100%; padding: 12px 14px; border-radius: 12px;
  background: var(--bg-1); border: 1px solid var(--border); color: var(--text);
  font-size: 14px; font-family: inherit; outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(124,92,255,.18);}
.row-between { display:flex; align-items:center; justify-content:space-between; font-size:12px; color: var(--text-2); margin: 6px 0 18px;}
.row-between a { color: var(--brand); }
.login-alt-row {
  display:flex;
  justify-content:center;
  margin: 14px 0 0;
}
.link-btn {
  border:0;
  background:transparent;
  color: var(--brand);
  font: inherit;
  font-size: 13px;
  cursor:pointer;
  padding: 4px 6px;
}
.link-btn:hover { color: var(--brand-2); }
.signup-panel {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.signup-panel[hidden],
#password-reset-panel[hidden] { display:none; }
.code-row {
  display:grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.code-row .btn {
  white-space: nowrap;
  padding-inline: 14px;
}

.divider { display:flex; align-items:center; gap:12px; color: var(--text-3); font-size:11px; margin: 18px 0 12px;}
.divider::before,.divider::after{ content:""; flex:1; height:1px; background: var(--border);}
.oauth-row { display:grid; grid-template-columns: repeat(3,1fr); gap:8px; }
.oauth-btn { padding: 10px; }

/* ============== Layout (App) ============== */
.app-shell {
  display:grid; grid-template-columns: 240px 1fr;
  height: calc(100vh - 65px);
  height: calc(100dvh - 65px);
  min-height: 0;
  overflow: hidden;
}
.sidebar {
  border-right: 1px solid var(--border);
  padding: 32px 14px 20px; display:flex; flex-direction:column; gap:4px;
  background: color-mix(in oklab, var(--bg-0) 88%, transparent);
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: transparent transparent;
  scrollbar-width: thin;
}
.sidebar:hover,
.sidebar:focus-within { scrollbar-color: var(--border-strong) transparent; }
.sidebar::-webkit-scrollbar { width: 10px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb {
  background: transparent;
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}
.sidebar:hover::-webkit-scrollbar-thumb,
.sidebar:focus-within::-webkit-scrollbar-thumb { background-color: var(--border-strong); }
.side-section { font-size:11px; text-transform: uppercase; letter-spacing:.12em; color: var(--text-3); padding: 14px 12px 6px; }
.side-item {
  display:flex; align-items:center; gap:11px;
  padding: 11px 12px; border-radius: 10px; color: var(--text-2);
  cursor:pointer; font-size: 14px; transition: all var(--t-fast); border:1px solid transparent;
}
.side-item .i { width:17px; height:17px; flex-shrink:0; }
.side-item:hover { color: var(--text); background: var(--surface);}
.side-item.active { color: var(--text); background: var(--surface-2); border-color: var(--border); }
.side-item .dot { width:6px; height:6px; border-radius:50%; background: var(--accent);}
.side-foot { margin-top:auto; padding: 12px; border:1px dashed var(--border); border-radius: 12px; font-size:12px; color: var(--text-2);}
.side-foot b { background: var(--grad-1); -webkit-background-clip: text; background-clip:text; color: transparent;}

.main {
  padding: 32px 38px 70px;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: transparent transparent;
  scrollbar-width: thin;
}
.main:hover,
.main:focus-within { scrollbar-color: var(--border-strong) transparent; }
.main::-webkit-scrollbar { width: 10px; }
.main::-webkit-scrollbar-track { background: transparent; }
.main::-webkit-scrollbar-thumb {
  background: transparent;
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}
.main:hover::-webkit-scrollbar-thumb,
.main:focus-within::-webkit-scrollbar-thumb { background-color: var(--border-strong); }

.page-head { display:flex; align-items:center; justify-content:space-between; margin-bottom: 28px; flex-wrap: wrap; gap:14px;}
.page-head h2 {
  font-size: 26px; margin: 0; letter-spacing: -0.4px; font-weight: 700;
  background: linear-gradient(180deg, #fff 0%, #b1b4c0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html[data-theme="light"] .page-head h2 {
  background: linear-gradient(180deg, #15151c 0%, #52535e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.page-head .sub { color: var(--text-2); font-size:13px; margin-top:5px; line-height: 1.5;}
/* ============== Studio Layout — v18.10.72 对齐页头、面板和控件节奏 ============== */
.studio-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  max-width: 1480px;
  margin: 0 auto 20px;
  width: 100%;
}
.studio-head-main {
  display: flex;
  align-items: center;
  min-width: 260px;
}
.studio-head-control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}
.studio-mode-tabs {
  width: min(264px, 100%);
  flex-shrink: 0;
}
.studio-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 2px;
}
.studio-head-actions .btn {
  min-height: 38px;
  white-space: nowrap;
}
.studio {
  display: grid;
  grid-template-columns: minmax(420px, 460px) minmax(0, 1fr);
  gap: 24px;
  align-items: stretch;
  max-width: 1480px;
  margin: 0 auto;
  width: 100%;
}
.panel { padding: 24px 22px; }
.panel.studio-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
}
.panel.canvas { padding: 20px; }
.panel h3 { margin: 0 0 14px; font-size:14px; font-weight:600; display:flex; align-items:center; justify-content:space-between;}
.panel h3 small { color: var(--text-3); font-weight:400; font-size:12px; }

.task-tabs { display:grid; grid-template-columns: repeat(4, 1fr); gap:6px; padding: 5px; background: var(--surface); border:1px solid var(--border); border-radius: 14px; margin-bottom: 18px;}
.task-tab {
  border:0; background:transparent; color: var(--text-2); cursor:pointer;
  padding: 9px 6px; border-radius: 10px; font-size:12px; transition: all var(--t-fast);
  display:flex; align-items:center; justify-content:center; gap:5px;
  white-space: nowrap;
  min-width: 0;
}
.task-tab > svg { flex-shrink: 0; }
.task-tab.active { background: var(--bg-1); color: var(--text); box-shadow: 0 6px 14px rgba(0,0,0,.18);}
.task-tabs.studio-mode-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(116px, 1fr));
  margin: 0;
}

.label { font-size:12.5px; color: var(--text-2); margin: 18px 0 10px; display:flex; align-items:center; justify-content:space-between; gap: 10px; }
.label b { color: var(--text); font-weight:600;}
.label > span { color: var(--text-3); font-size: 11px; }

textarea.prompt {
  width:100%; min-height: 120px; resize: vertical;
  padding: 12px 14px; border-radius: 12px; background: var(--bg-1);
  border:1px solid var(--border); color: var(--text); font-size:13px; line-height:1.55;
  font-family: inherit; outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
textarea.prompt:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(124,92,255,.16);}

.suggestions { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px;}
.chip {
  padding: 5px 10px; font-size: 11px; color: var(--text-2);
  background: var(--surface); border:1px solid var(--border); border-radius: 999px; cursor:pointer;
  transition: all var(--t-fast);
}
.chip:hover { color: var(--text); border-color: var(--border-strong); transform: translateY(-1px);}
/* v18.10.37 资产类型切换 chip 选中态 */
.asset-type-chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }

.model-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.model-card {
  padding: 14px 14px; border-radius: 14px;
  background: var(--bg-1);
  border:1px solid var(--border);
  cursor:pointer; transition: all var(--t-fast); position:relative;
  overflow: hidden;
}
.model-card::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(139,109,255,.06) 0%, transparent 60%);
  opacity: 0;
  transition: opacity var(--t-fast);
  pointer-events: none;
}
.model-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: 0 8px 24px -8px rgba(0,0,0,.4); }
.model-card:hover::before { opacity: 1; }
.model-card.active {
  border-color: rgba(139,109,255,.55);
  background: linear-gradient(135deg, rgba(139,109,255,.12) 0%, rgba(255,109,196,.06) 100%), var(--bg-1);
  box-shadow: var(--shadow-glow);
}
.model-card.active::before { opacity: 1; }
.model-card .name { font-size:13px; font-weight:600; line-height: 1.45; color: var(--text); }
.model-card .meta { font-size:11px; color: var(--text-3); margin-top:5px; line-height: 1.5; }
.model-card.disabled { opacity: .28; cursor: not-allowed; }
.model-card.disabled:hover { border-color: var(--border); transform: none; box-shadow: none; }
.model-card .group-tag {
  display: inline-block; font-size: 10px; padding: 2px 7px; border-radius: 6px;
  background: linear-gradient(135deg, rgba(139,109,255,.18), rgba(255,109,196,.14));
  color: var(--brand); margin-right: 6px;
  vertical-align: middle; font-weight: 500;
  letter-spacing: .2px;
}

.params-grid { display:grid; grid-template-columns: 1fr 1fr; gap:10px;}
.params-grid .field-mini { background: var(--bg-1); border:1px solid var(--border); padding: 9px 11px; border-radius: 10px;}
.params-grid .field-mini .k { font-size: 11px; color: var(--text-3);}
.params-grid .field-mini select,
.params-grid .field-mini input {
  width:100%; background:transparent; border:0; color: var(--text); padding: 4px 0 0; font-size: 13px; outline:none; font-family: inherit;
}

/* ============== Custom Select (与玻璃态风格一致) ============== */
.cs {
  position: relative;
  user-select: none;
  cursor: pointer;
}
.cs-trigger {
  width:100%; background:transparent; border:0; color: var(--text); padding: 4px 0 0;
  font-size: 13px; font-family: inherit; display:flex; align-items:center; justify-content:space-between; gap:6px;
}
.cs-trigger .cs-caret {
  width:14px; height:14px; opacity:.55; transition: transform var(--t-fast);
}
.cs.open .cs-trigger .cs-caret { transform: rotate(180deg); opacity:1; }
.cs-menu {
  position: absolute; left: -8px; right: -8px; top: calc(100% + 8px); z-index: 40;
  background: var(--bg-1); border:1px solid var(--border-strong); border-radius: 12px;
  padding: 6px; opacity: 0; transform: translateY(-4px) scale(.98);
  pointer-events: none; transition: all var(--t-fast);
  box-shadow: 0 12px 32px rgba(0,0,0,.35), 0 0 0 1px var(--border) inset;
  backdrop-filter: blur(20px);
  max-height: 260px; overflow:auto;
}
.cs.open .cs-menu { opacity:1; transform:none; pointer-events:auto;}
.cs-opt {
  padding: 8px 10px; border-radius: 8px; font-size: 13px; color: var(--text-2);
  display:flex; align-items:center; gap:8px; transition: all var(--t-fast);
}
.cs-opt:hover { background: var(--surface-2); color: var(--text);}
.cs-opt.sel { background: linear-gradient(90deg, rgba(124,92,255,.18), rgba(255,92,182,.10)); color: var(--text);}
.cs-opt .cs-tick { margin-left:auto; opacity:0; color: var(--brand);}
.cs-opt.sel .cs-tick { opacity:1; }
.cs-opt.disabled { opacity:.35; cursor: not-allowed; pointer-events: none;}
.cs-opt.disabled .cs-disabled-hint { font-size:10px; color: var(--text-3); margin-left:auto;}

.ar-cell.disabled, .field-mini.disabled, .section-acc.disabled .acc-head {
  opacity: .35; pointer-events: none; cursor: not-allowed;
}
.field-mini.disabled .cs-trigger { color: var(--text-3); }

.unsupported-tip {
  position: absolute; right: 10px; top: 10px;
  font-size: 10px; padding: 2px 6px; border-radius: 6px;
  background: var(--bg-2); border: 1px solid var(--border); color: var(--text-3);
  pointer-events: none;
}
.acc-head .unsupported-tip { position: static; margin-left: 8px; }
.field-mini { position: relative; }
.field-mini .unsupported-tip { right: 8px; top: 8px; }

/* ============== Menu (用户头像下拉) ============== */
.user-menu {
  position: fixed; top: 56px; right: 22px; min-width: 220px;
  background: var(--bg-1); border:1px solid var(--border-strong); border-radius: 14px;
  padding: 6px; box-shadow: 0 18px 50px rgba(0,0,0,.4); z-index: 60;
  display: none;
}
.user-menu.show { display:block; animation: fadeIn .15s ease; }
.user-menu .head { padding: 12px 12px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px;}
.user-menu .head .name { font-size: 13px; font-weight:500;}
.user-menu .head .role { font-size:11px; color: var(--text-3); margin-top:2px;}
.menu-item {
  padding: 9px 12px; border-radius: 8px; font-size: 13px; color: var(--text-2);
  cursor: pointer; display:flex; align-items:center; gap:10px;
  transition: all var(--t-fast);
}
.menu-item:hover { background: var(--surface-2); color: var(--text); }
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: rgba(255,92,122,.08); }

/* Empty / generic state */
.empty-pane {
  padding: 80px 20px; text-align:center; color: var(--text-2);
}
.empty-pane svg { opacity:.4; }
.empty-pane h4 { margin: 14px 0 4px; color: var(--text); font-size: 16px;}
.empty-pane p { margin:0; font-size:13px;}

/* Market grid */
.market-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap:14px;}
.market-card { padding: 18px; border-radius: 14px; background: var(--surface); border:1px solid var(--border); position: relative; overflow: hidden; transition: all var(--t-mid);}
.market-card:hover { transform: translateY(-3px); border-color: var(--border-strong);}
.market-card .head { display:flex; align-items:center; gap:10px; margin-bottom: 10px;}
.market-card .logo { width:40px; height:40px; border-radius:10px; display:grid; place-items:center; color:#fff; font-weight:600; font-size: 14px;}
.market-card .name { font-size:14px; font-weight:500;}
.market-card .vendor { font-size:11px; color: var(--text-3);}
.market-card .desc { font-size:12px; color: var(--text-2); line-height:1.5; min-height: 36px;}
.market-card .foot { display:flex; align-items:center; justify-content:space-between; margin-top:14px;}

/* ============== Dashboard ============== */
.dash-hero {
  padding: 32px 36px; border-radius: var(--r-xl);
  display:grid; grid-template-columns: 1fr 240px; gap: 20px; align-items:center;
  position: relative; overflow:hidden; margin-bottom: 22px;
  background:
    radial-gradient(70% 70% at 0% 0%, rgba(124,92,255,.18), transparent 60%),
    radial-gradient(70% 70% at 100% 100%, rgba(255,92,182,.14), transparent 60%),
    var(--surface);
}
.dash-greet { color: var(--text-3); font-size: 13px; letter-spacing: .12em; text-transform: uppercase;}
.dash-hero h2 { font-size: 28px; margin: 8px 0 6px; letter-spacing:-0.5px;}
.dash-hero h2 span { background: var(--grad-1); -webkit-background-clip:text; background-clip:text; color: transparent;}
.dash-hero .sub { color: var(--text-2); font-size: 13px; margin: 0;}
.dash-hero-right { display:grid; place-items:center;}
.dash-orb {
  width: 200px; height: 200px; border-radius:50%;
  background: conic-gradient(from 220deg at 50% 50%, #7c5cff, #ff5cb6, #00e6c3, #ffb547, #7c5cff);
  filter: blur(2px) saturate(150%);
  animation: orbSpin 22s linear infinite;
  box-shadow: 0 24px 80px rgba(124,92,255,.45);
  mask: radial-gradient(circle at center, transparent 38%, #000 39%, #000 70%, transparent 71%);
  -webkit-mask: radial-gradient(circle at center, transparent 38%, #000 39%, #000 70%, transparent 71%);
}
@keyframes orbSpin { to { transform: rotate(360deg);}}

.dash-stats { display:grid; grid-template-columns: repeat(4, 1fr); gap:14px; margin-bottom: 22px;}
@media (max-width: 1100px){ .dash-stats { grid-template-columns: repeat(2, 1fr);} }

.dash-grid {
  display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap:18px;
}
@media (max-width: 1100px){ .dash-grid { grid-template-columns: 1fr;} }

.quick-actions { display:flex; flex-direction: column; gap: 8px;}
.quick-card {
  display:flex; align-items:center; gap:12px;
  padding: 12px; border-radius: 12px; cursor:pointer;
  background: var(--bg-1); border:1px solid var(--border);
  transition: all var(--t-fast);
}
.quick-card:hover { transform: translateX(3px); border-color: var(--border-strong); }
.qc-icon { width: 38px; height: 38px; border-radius:10px; display:grid; place-items:center; flex-shrink:0;}
.qc-name { font-size: 13px; font-weight: 500;}
.qc-desc { font-size: 11px; color: var(--text-3); margin-top: 2px;}

.inspire-row { display:grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px;}
.inspire-card {
  position: relative; aspect-ratio: 4/3; border-radius: 14px; overflow: hidden;
  cursor: pointer; transition: transform var(--t-mid), border-color var(--t-fast), box-shadow var(--t-fast);
  border: 1px solid var(--border);
  background:
    linear-gradient(145deg, rgba(139,109,255,.10), rgba(255,255,255,.035) 46%, rgba(0,230,195,.055)),
    var(--grad-card),
    var(--bg-1);
  box-shadow: 0 1px 0 rgba(255,255,255,.045) inset, 0 10px 28px rgba(0,0,0,.20);
}
.inspire-card::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(68% 58% at 18% 12%, rgba(139,109,255,.14), transparent 62%),
    radial-gradient(72% 66% at 86% 18%, rgba(0,230,195,.08), transparent 64%),
    linear-gradient(180deg, rgba(8,8,13,.18), rgba(8,8,13,.66));
}
.inspire-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow: 0 1px 0 rgba(255,255,255,.06) inset, 0 16px 40px rgba(0,0,0,.30), 0 16px 42px -28px rgba(139,109,255,.45);
}
.inspire-card > .cover {
  filter: saturate(58%) brightness(.68) contrast(.9);
  opacity: .72;
  transform: scale(1.02);
}
.inspire-card > .cover > div {
  max-width: 82%;
  opacity: .26;
  font-size: 13px;
  line-height: 1.35;
  text-shadow: 0 2px 14px rgba(0,0,0,.35);
}
.inspire-card .ic-cover {
  position:absolute; inset:0; z-index: 1; opacity: .24;
  background:
    linear-gradient(135deg, rgba(255,255,255,.08), transparent 34%),
    radial-gradient(60% 72% at 80% 80%, rgba(139,109,255,.12), transparent 68%);
}
.inspire-card .ic-meta {
  position:absolute; inset:auto 10px 10px 10px; z-index: 2; color:#fff; font-size: 12px; line-height:1.4;
}
.inspire-card .ic-copy {
  padding: 10px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: rgba(8,8,13,.46);
  backdrop-filter: blur(14px) saturate(115%);
  -webkit-backdrop-filter: blur(14px) saturate(115%);
  box-shadow: 0 8px 22px rgba(0,0,0,.22);
}
.inspire-card .ic-title { font-weight: 600; margin-bottom: 3px; }
.inspire-card .ic-prompt {
  opacity:.82; font-size:11px; line-height:1.42; max-height:32px; overflow:hidden;
}
.inspire-card .ic-tag {
  position:absolute; top:8px; left:8px; z-index: 2; font-size:10px; padding:4px 8px; border-radius:999px;
  background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.16); color:#fff;
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
  box-shadow: 0 6px 16px rgba(0,0,0,.18);
}

/* ============== Studio Pro Panels (业界主流交互) ============== */
.section-acc { /* accordion */
  border-top: 1px solid var(--border);
  margin-top: 18px;
}
.section-acc .acc-head {
  display:flex; align-items:center; justify-content:space-between; cursor:pointer;
  padding: 12px 0;
}
.section-acc .acc-head h4 { margin:0; font-size:13px; font-weight:500;}
.section-acc .acc-head .acc-caret {
  width:16px; height:16px; transition: transform var(--t-fast); opacity:.6;
}
.section-acc.open .acc-head .acc-caret { transform: rotate(180deg); opacity:1;}
.section-acc .acc-body { max-height: 0; overflow:hidden; transition: max-height var(--t-mid); }
.section-acc.open .acc-body { max-height: 800px; }
.section-acc .acc-body-inner { padding: 4px 0 12px;}

/* 纵横比可视化 */
.ar-grid { display:grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-bottom: 4px;}
.ar-cell {
  background: var(--bg-1); border: 1px solid var(--border); border-radius: 10px;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  cursor:pointer; padding: 10px 4px; gap: 5px; transition: all var(--t-fast);
  min-height: 56px;
}
.ar-cell:hover { border-color: var(--border-strong); transform: translateY(-1px);}
.ar-cell.active { border-color: transparent; background: linear-gradient(var(--bg-1),var(--bg-1)) padding-box, var(--grad-1) border-box; border:1px solid transparent;}
.ar-cell .ar-shape { background: var(--surface-2); border:1px solid var(--border); border-radius: 3px;}
.ar-cell .ar-label { font-size: 10px; color: var(--text-2);}
.ar-cell.active .ar-label { color: var(--text);}

/* Slider */
.slider-row { display:flex; align-items:center; gap: 12px; padding: 6px 0;}
.slider-row label { flex: 0 0 90px; font-size: 12px; color: var(--text-2);}
.slider-row .val { flex: 0 0 40px; font-size: 12px; color: var(--text); text-align:right; font-family: 'JetBrains Mono', monospace;}
.slider-row input[type=range] {
  flex: 1; -webkit-appearance: none; appearance: none;
  height: 4px; border-radius: 99px; background: var(--bg-1);
  outline: none; cursor: pointer;
}
.slider-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 14px; height:14px; border-radius:50%;
  background: var(--grad-1);
  box-shadow: 0 0 0 4px rgba(124,92,255,.18), 0 2px 6px rgba(0,0,0,.3);
  cursor: pointer; transition: transform var(--t-fast);
}
.slider-row input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.2);}

/* 负向提示词 */
textarea.neg-prompt {
  width:100%; min-height: 60px; resize: vertical;
  padding: 10px 12px; border-radius: 10px; background: var(--bg-1);
  border:1px solid var(--border); color: var(--text); font-size:12px; line-height:1.5;
  font-family: inherit; outline: none;
}
textarea.neg-prompt:focus { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(255,92,122,.16);}

/* Style Reference 卡 */
.sref-row { display:flex; gap:8px; flex-wrap: wrap;}
.sref-card {
  width: 56px; height: 56px; border-radius: 10px; cursor:pointer;
  border: 2px solid var(--border); transition: all var(--t-fast);
  background-size: cover; background-position: center; position: relative;
}
.sref-card.active { border-color: var(--brand); transform: translateY(-2px); box-shadow: 0 6px 16px rgba(124,92,255,.4);}
.sref-card.empty {
  border-style: dashed; display: grid; place-items: center; color: var(--text-3);
}

/* Prompt Library Drawer */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(6px);
  z-index: 90; display:none; opacity:0; transition: opacity var(--t-mid);
}
.drawer-mask.show { display:block; opacity:1;}
.drawer {
  position: fixed; right: 0; top: 0; bottom: 0; width: min(560px, 100%);
  background: var(--bg-1); border-left: 1px solid var(--border-strong);
  z-index: 95; display:flex; flex-direction:column;
  transform: translateX(100%); transition: transform var(--t-mid);
  box-shadow: -24px 0 60px rgba(0,0,0,.4);
}
.drawer.show { transform: none;}
.drawer header { padding: 16px 20px; border-bottom: 1px solid var(--border); display:flex; align-items:center; justify-content:space-between;}
.drawer header h3 { margin:0; font-size:15px;}
.drawer .body { padding: 16px 20px; overflow:auto; flex:1;}
.lib-cat { display:flex; gap:6px; flex-wrap:wrap; margin-bottom: 14px;}
.lib-item {
  padding: 12px 14px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--border); margin-bottom: 8px; cursor:pointer; transition: all var(--t-fast);
}
.lib-item:hover { border-color: var(--brand); background: var(--surface-2); transform: translateX(3px);}
.lib-item .lib-title { font-size: 13px; font-weight: 500;}
.lib-item .lib-prompt { font-size: 12px; color: var(--text-2); margin-top: 4px; line-height: 1.5;}
.lib-item .lib-tags { display:flex; gap:4px; margin-top: 6px; flex-wrap: wrap;}
.lib-tag { font-size:10px; padding: 2px 7px; border-radius: 99px; background: var(--bg-1); color: var(--text-3); border:1px solid var(--border);}

/* ============== v17 Library 搜索 + 卡片动作 ============== */
.lib-search {
  display:flex; align-items:center; gap:8px; padding: 9px 12px;
  background: var(--bg-1); border:1px solid var(--border); border-radius: 10px;
  margin-bottom: 12px;
}
.lib-search input {
  flex:1; background: transparent; border:0; outline:none;
  color: var(--text); font-size: 13px; font-family: inherit;
}
.lib-search svg { color: var(--text-3); width:14px; height:14px; flex-shrink:0;}
.lib-toolbar { display:flex; align-items:center; justify-content:space-between; margin-bottom: 10px; }
.lib-toolbar .meta { font-size: 11px; color: var(--text-3);}
.lib-toolbar .actions { display:flex; gap:6px;}
.lib-item {
  position: relative;
}
.lib-item-actions {
  position: absolute; top: 10px; right: 10px;
  display: none; gap: 4px;
}
.lib-item:hover .lib-item-actions { display: flex; }
.lib-act-btn {
  width: 26px; height: 26px; border-radius: 7px;
  display:grid; place-items:center; cursor:pointer;
  background: rgba(0,0,0,.32); border:1px solid var(--border);
  color: #fff; transition: all var(--t-fast);
}
.lib-act-btn:hover { background: var(--brand); border-color: var(--brand); transform: scale(1.08); }
.lib-act-btn svg { width:13px; height:13px;}
.lib-empty {
  text-align:center; padding: 40px 20px; color: var(--text-3); font-size: 12px;
}
.hot-badge {
  display:inline-flex; align-items:center; gap:4px;
  font-size: 10px; padding: 2px 7px; border-radius: 6px;
  background: linear-gradient(135deg, #ff5cb6, #ffb547); color:#fff; font-weight:500;
}

/* ============== v17 AI 改写：建议卡 ============== */
.rewrite-cards-wrap {
  margin-top: 10px;
  display: flex; flex-direction: column; gap: 10px;
}
.rewrite-card {
  background: linear-gradient(180deg, rgba(124,92,255,.06), transparent);
  border: 1px solid var(--brand);
  border-radius: 12px; padding: 12px 14px;
  animation: fadeUp .3s var(--t-slow);
  position: relative;
}
.rewrite-card .rc-head {
  display:flex; align-items:center; gap:8px; margin-bottom: 8px;
  font-size: 12px;
}
.rewrite-card .rc-mode {
  display:inline-flex; align-items:center; gap:4px;
  padding: 3px 9px; border-radius: 99px;
  background: var(--brand); color:#fff; font-weight:500; font-size:11px;
}
.rewrite-card .rc-source {
  font-size: 10px; color: var(--text-3); padding: 2px 6px;
  border:1px solid var(--border); border-radius: 6px;
}
.rewrite-card .rc-close {
  margin-left:auto; cursor:pointer; color: var(--text-3); padding: 2px;
}
.rewrite-card .rc-close:hover { color: var(--danger);}
.rewrite-card .rc-tabs {
  display:flex; gap:4px; margin-bottom: 8px; flex-wrap: wrap;
}
.rewrite-card .rc-tab {
  font-size: 11px; padding: 4px 10px;
  background: var(--bg-1); border:1px solid var(--border); border-radius: 99px;
  cursor: pointer; transition: all var(--t-fast); color: var(--text-2);
}
.rewrite-card .rc-tab:hover { border-color: var(--brand); }
.rewrite-card .rc-tab.active { background: var(--brand); color:#fff; border-color: var(--brand);}
.rewrite-card .rc-text {
  background: var(--bg-1); border:1px solid var(--border); border-radius: 10px;
  padding: 10px 12px; font-size: 12.5px; line-height: 1.65; color: var(--text);
  margin-bottom: 10px; min-height: 50px; max-height: 200px; overflow-y: auto;
  word-break: break-word; white-space: pre-wrap;
}
.rewrite-card .rc-actions {
  display:flex; gap:6px; flex-wrap: wrap;
}
.rewrite-card .rc-actions .btn {
  --pad-y: 7px; --pad-x: 12px; font-size: 12px;
}
.rewrite-card.loading .rc-text {
  display:flex; align-items:center; justify-content:center;
  color: var(--text-3); font-size: 11px;
}
.rewrite-card.loading .rc-text::before {
  content:''; width:14px; height:14px; margin-right: 8px;
  border:2px solid var(--brand); border-top-color: transparent;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg);} }

/* ============== Profile (账号 / 会话 / API Key) ============== */
.profile-tabs { display:flex; gap: 6px; padding: 5px; background: var(--surface); border:1px solid var(--border); border-radius: 14px; margin-bottom: 18px; max-width: 720px; overflow-x: auto; }
.profile-tabs .task-tab { flex:1; }
.prof-pane { animation: fadeUp .35s var(--t-slow); }
.prof-row {
  display: grid; grid-template-columns: 140px 1fr; gap: 12px;
  align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border);
}
/* v18.10.1：让 grid 的 1fr 列内部能收缩，防止超长文件名撑破 modal */
.prof-row > * { min-width: 0; }
.prof-row .upload-preview,
.prof-row .upload-preview .info { min-width: 0; max-width: 100%; }
.prof-row:last-child { border-bottom: 0;}
.prof-row label { font-size: 13px; color: var(--text-2);}
.prof-row input,
.prof-row textarea {
  width: 100%;
  padding: 10px 12px; border-radius: 10px; background: var(--bg-1);
  border:1px solid var(--border); color: var(--text); font-size: 13px;
  font-family: inherit; outline: none; resize: vertical;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.prof-row input:focus,
.prof-row textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(124,92,255,.16);}
.prof-row .ro { font-size: 13px; color: var(--text); padding: 8px 0;}
.wallet-entry-list {
  display: grid;
  gap: 8px;
  min-height: 42px;
}
.wallet-entry-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-1);
  min-width: 0;
}
.wallet-entry-row.empty,
.wallet-profile-empty {
  display: block;
  padding: 16px;
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: var(--surface);
}
.wallet-entry-title,
.wallet-entry-points {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wallet-entry-points { text-align: right; font-family: "JetBrains Mono", monospace; }
.wallet-entry-points.is-frozen,
.wallet-admin-points.is-frozen { color: var(--text-3); }
.wallet-entry-meta {
  margin-top: 3px;
  max-width: 360px;
  color: var(--text-3);
  font-size: 11px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wallet-admin-notice {
  display: none;
  margin-bottom: 14px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.5;
}
.wallet-admin-notice.show { display: block; }
.wallet-admin-kpis .value {
  font-family: "JetBrains Mono", monospace;
  font-size: 22px;
}
.wallet-admin-risk {
  display: none;
  align-items: center;
  gap: 10px;
  margin: -8px 0 18px;
  padding: 10px 12px;
  border: 1px solid rgba(255,181,71,.28);
  border-radius: 10px;
  background: rgba(255,181,71,.08);
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.45;
}
.wallet-admin-risk.show { display: flex; flex-wrap: wrap; }
.wallet-admin-risk b { color: var(--warn); }
.wallet-admin-risk .link-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--warn);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.wallet-admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr);
  gap: 18px;
  margin-bottom: 22px;
  align-items: start;
}
.wallet-admin-tools,
.wallet-admin-filters {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.wallet-admin-filters {
  justify-content: flex-start;
  padding: 0 18px 14px;
  border-bottom: 1px solid var(--border);
}
.wallet-admin-control {
  display: grid;
  gap: 5px;
  min-width: 132px;
  color: var(--text-3);
  font-size: 11px;
  line-height: 1.2;
}
.wallet-admin-control-wide { min-width: 220px; }
.wallet-admin-control input,
.wallet-admin-control select {
  height: 34px;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-1);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  outline: none;
}
.wallet-admin-control input:focus,
.wallet-admin-control select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(124,92,255,.14);
}
.wallet-admin-panel {
  padding: 18px;
  display: grid;
  gap: 16px;
}
.wallet-admin-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
.wallet-admin-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}
.wallet-admin-form-head,
.wallet-admin-form h3 {
  grid-column: 1 / -1;
}
.wallet-admin-form-head {
  display: grid;
  gap: 10px;
}
.wallet-admin-form h3 {
  margin: 0;
  font-size: 13px;
}
.wallet-admin-form button {
  grid-column: 1 / -1;
  justify-self: start;
  align-self: end;
}
.wallet-admin-form label {
  display: grid;
  gap: 6px;
  color: var(--text-2);
  font-size: 12px;
}
.wallet-admin-form input,
.wallet-admin-form select {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-1);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
}
.wallet-admin-form input:focus,
.wallet-admin-form select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(124,92,255,.16);
}
.wallet-admin-owner-link,
.wallet-admin-row-action {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.wallet-admin-owner-link:hover,
.wallet-admin-row-action:hover {
  color: var(--brand);
}
.wallet-admin-row-action {
  color: var(--text-2);
  font-size: 12px;
}
.wallet-ledger-modal {
  width: min(920px, calc(100vw - 36px));
  max-height: min(760px, calc(100vh - 48px));
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.wallet-ledger-modal header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}
.wallet-ledger-modal header h3 {
  margin: 0 0 4px;
  font-size: 15px;
}
.wallet-ledger-modal .sub,
.wallet-admin-pricing .sub {
  color: var(--text-3);
  font-size: 12px;
}
.wallet-ledger-body {
  padding: 18px 22px 22px;
  overflow: auto;
}
.wallet-ledger-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.wallet-ledger-stat {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-1);
}
.wallet-ledger-stat span {
  display: block;
  color: var(--text-3);
  font-size: 11px;
  margin-bottom: 5px;
}
.wallet-ledger-stat b {
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  color: var(--text);
}
.wallet-ledger-list .wallet-entry-row {
  grid-template-columns: minmax(0, 1fr) minmax(120px, auto);
}
.wallet-admin-user-active {
  background: color-mix(in oklab, var(--brand) 12%, transparent);
}
.wallet-admin-user-metrics {
  display: grid;
  gap: 3px;
  min-width: 92px;
  white-space: nowrap;
}
.wallet-admin-user-metrics b {
  color: var(--text);
  font-size: 12px;
}
.wallet-admin-user-metrics span,
.wallet-admin-user-video {
  color: var(--text-3);
  font-size: 11px;
  white-space: nowrap;
}
.wallet-admin-owner {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  color: var(--text-2);
}
.wallet-admin-points {
  font-family: "JetBrains Mono", monospace;
  white-space: nowrap;
}
.wallet-admin-activity {
  margin-bottom: 22px;
  overflow-x: auto;
}
.wallet-admin-activity-pref {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 180px;
  max-width: 300px;
}
.wallet-admin-chip {
  display: inline-flex;
  align-items: center;
  max-width: 180px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wallet-admin-chip.model { color: var(--text); background: rgba(124,92,255,.12); }
.wallet-admin-chip.kind { color: var(--accent); background: rgba(0,230,195,.10); }
.wallet-admin-chip.points { color: var(--warn); background: rgba(255,181,71,.12); }
.wallet-admin-chip.muted { color: var(--text-3); }
.wallet-admin-task-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 280px;
  max-width: 520px;
  white-space: nowrap;
}
.wallet-admin-task-status {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 600;
}
.wallet-admin-task-status.ok { color: var(--accent); background: rgba(0,230,195,.12); }
.wallet-admin-task-status.warn { color: var(--warn); background: rgba(255,181,71,.12); }
.wallet-admin-task-status.off { color: var(--danger); background: rgba(255,92,122,.12); }
.wallet-admin-task-status.muted { color: var(--text-3); background: var(--surface); }
.wallet-admin-task-id {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-2);
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
}
.wallet-admin-task-metrics {
  color: var(--text-3);
  flex: 0 0 auto;
  font-size: 11px;
}
.wallet-admin-task-empty { color: var(--text-3); }
.wallet-admin-pricing {
  margin-bottom: 22px;
  overflow-x: auto;
}
.wallet-pricing-workbench {
  padding: 0 18px 18px;
  border-bottom: 1px solid var(--border);
}
.wallet-pricing-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(140px, .8fr) minmax(120px, .6fr) minmax(120px, .6fr);
  gap: 10px;
  align-items: end;
}
.wallet-pricing-form-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.wallet-pricing-form h4 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
}
.wallet-pricing-form label {
  display: grid;
  gap: 6px;
  color: var(--text-2);
  font-size: 12px;
}
.wallet-pricing-form input,
.wallet-pricing-form select {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--bg-1);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  outline: none;
}
.wallet-pricing-form input:focus,
.wallet-pricing-form select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(124,92,255,.14);
}
.wallet-pricing-field-image,
.wallet-pricing-field-video {
  display: none;
}
.wallet-pricing-form.is-image .wallet-pricing-field-image,
.wallet-pricing-form.is-video .wallet-pricing-field-video {
  display: grid;
}
.wallet-pricing-preview {
  min-height: 36px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.35;
}
.wallet-pricing-preview.ok { color: var(--accent); background: rgba(0,230,195,.08); border-color: rgba(0,230,195,.22); }
.wallet-pricing-preview.err { color: var(--danger); background: rgba(255,92,122,.08); border-color: rgba(255,92,122,.24); }
.wallet-pricing-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.wallet-pricing-actions .btn {
  min-height: 36px;
}
.wallet-admin-activity table,
.wallet-admin-pricing table {
  min-width: 760px;
}

/* ============== Agent Chat ============== */
.agent-shell {
  display: grid;
  grid-template-columns: minmax(240px, 300px) 1fr;
  height: clamp(520px, calc(100vh - 190px), 760px);
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
}
.agent-service-card {
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--surface);
  padding:12px 14px;
  margin:0 0 12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.agent-service-copy { min-width:0; }
.agent-service-title { font-size:14px; font-weight:600; color:var(--text); }
.agent-service-text { margin-top:4px; font-size:12px; line-height:1.5; color:var(--text-2); }
.agent-service-actions { flex-shrink:0; display:flex; align-items:center; gap:8px; }
.agent-panel {
  border-right: 1px solid var(--border);
  padding: 16px;
  background: color-mix(in oklab, var(--bg-0) 82%, transparent);
  display:flex;
  flex-direction:column;
  min-height:0;
  overflow:hidden;
}
.agent-panel-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px; }
.agent-panel-head h3 { margin:0; font-size:14px; }
.agent-current-card {
  border:1px solid var(--border); border-radius:14px; padding:12px;
  background:var(--bg-1); margin-bottom:12px;
  box-sizing:border-box; width:100%;
}
.agent-current-card.agent-current-inline {
  margin: 0;
}
.agent-current-card.agent-current-composer {
  margin:0;
  min-height:32px;
  padding:0;
  border:0;
  border-radius:0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  background:transparent;
  width:auto;
  min-width:0;
  flex:1 1 auto;
}
.agent-current-main {
  display:flex; align-items:center; gap:7px; min-width:0;
}
.agent-current-label {
  color:var(--text-3); font-size:11px; flex-shrink:0;
}
.agent-current-composer .agent-current-name {
  font-size:13px; min-width:0;
}
.agent-current-composer .agent-current-id {
  margin-top:0; font-size:11px; color:var(--text-3); min-width:0; max-width:220px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.agent-current-meta {
  display:flex; align-items:center; justify-content:flex-end; gap:6px; flex-shrink:0; min-width:0;
}
.agent-current-status {
  display:inline-flex; align-items:center; gap:5px; color:var(--accent); font-size:11px; flex-shrink:0;
}
.agent-current-status-dot {
  width:6px; height:6px; border-radius:50%; background:var(--accent);
}
.agent-current-model {
  max-width:220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.agent-current-top { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.agent-current-name { font-size:14px; font-weight:600; color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.agent-current-id { margin-top:4px; font-size:11px; color:var(--text-3); word-break:break-all; }
.agent-badges { display:flex; gap:6px; flex-wrap:wrap; margin-top:10px; }
.agent-pill {
  border:1px solid var(--border); border-radius:999px; padding:3px 8px;
  font-size:11px; color:var(--text-2); line-height:1.4;
}
.agent-pill.ok { color:var(--accent); border-color:color-mix(in oklab, var(--accent) 45%, var(--border)); }
.agent-pill.default { color:var(--brand-2); border-color:color-mix(in oklab, var(--brand-2) 45%, var(--border)); }
.agent-select {
  width:100%; border:1px solid var(--border); border-radius:10px;
  background:var(--bg-1); color:var(--text); padding:10px 12px;
  font-family:inherit; outline:none; margin-bottom:12px;
}
.agent-conv-list { display:flex; flex-direction:column; gap:8px; flex:1; min-height:0; max-height:none; overflow:auto; }
.agent-conv {
  border:1px solid var(--border); border-radius:12px; padding:10px 12px;
  background:var(--bg-1); cursor:pointer; transition:all var(--t-fast);
}
.agent-conv:hover { border-color:var(--border-strong); }
.agent-conv.active { border-color:var(--brand); box-shadow:0 0 0 3px rgba(124,92,255,.12); }
.agent-conv .name { font-size:13px; color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.agent-conv .meta { margin-top:4px; font-size:11px; color:var(--text-3); }
.agent-chat { display:flex; flex-direction:column; min-width:0; min-height:0; height:100%; overflow:hidden; }
.agent-chat-head {
  min-height:62px; padding:14px 18px; border-bottom:1px solid var(--border);
  display:flex; align-items:center; justify-content:space-between; gap:14px;
}
.agent-chat-head h3 { margin:0; font-size:15px; }
.agent-status { font-size:12px; color:var(--text-2); }
.agent-status.ok { color:var(--accent); }
.agent-status.err { color:var(--danger); }
.agent-device-strip {
  margin-top:6px;
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  color:var(--text-2);
  font-size:12px;
  line-height:1.45;
}
.agent-device-strip[style*="display: none"] { display:none !important; }
.agent-device-status {
  display:inline-flex;
  align-items:center;
  gap:6px;
  min-width:0;
}
.agent-device-dot {
  width:6px;
  height:6px;
  border-radius:50%;
  background:var(--text-3);
  flex-shrink:0;
}
.agent-device-dot.ok { background:var(--accent); }
.agent-device-dot.warn { background:#f5a524; }
.agent-device-dot.err { background:var(--danger); }
.agent-device-action {
  --pad-y:4px;
  --pad-x:9px;
  border-radius:999px;
  font-size:11px;
}
.agent-mobile-modal {
  width:min(520px, 100%);
  padding:22px 24px;
  border-radius:16px;
}
.agent-mobile-modal-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  margin-bottom:16px;
}
.agent-mobile-modal-head h3 {
  margin:0 0 4px;
  font-size:16px;
  color:var(--text);
}
.agent-mobile-modal-sub {
  color:var(--text-2);
  font-size:12.5px;
  line-height:1.55;
}
.agent-mobile-modal-body {
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--bg-1);
  padding:14px;
  min-height:128px;
}
.agent-mobile-state-title {
  font-size:14px;
  font-weight:600;
  color:var(--text);
}
.agent-mobile-state-text {
  margin-top:6px;
  color:var(--text-2);
  font-size:12.5px;
  line-height:1.6;
}
.agent-mobile-qr {
  margin-top:12px;
  border:1px dashed var(--border-strong);
  border-radius:12px;
  padding:12px;
  background:var(--surface);
  color:var(--text-2);
  font-family:'JetBrains Mono', monospace;
  font-size:11px;
  line-height:1.5;
  word-break:break-all;
}
.agent-mobile-capabilities {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:12px;
}
.agent-mobile-capabilities span {
  border:1px solid var(--border);
  border-radius:999px;
  padding:4px 8px;
  color:var(--text-2);
  font-size:11px;
}
.agent-mobile-modal-actions {
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin-top:14px;
}
.agent-error-card {
  margin:12px 18px 0; border:1px solid color-mix(in oklab, var(--danger) 45%, var(--border));
  border-radius:12px; padding:10px 12px; background:rgba(255,77,109,.08);
}
.agent-error-title { font-size:13px; color:var(--danger); font-weight:600; }
.agent-error-text { margin-top:4px; color:var(--text-2); font-size:12px; line-height:1.5; max-height:48px; overflow:hidden; }
.agent-error-actions { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; }
.agent-error-actions .btn { --pad-y:6px; --pad-x:10px; font-size:12px; border-radius:9px; }
.agent-messages {
  flex:1; padding:18px; overflow:auto; display:flex; flex-direction:column; gap:12px;
  min-height:0;
}
.agent-empty { margin:auto; color:var(--text-3); font-size:13px; text-align:center; line-height:1.8; }
.agent-quick-row { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; margin-top:12px; }
.agent-quick-chip {
  border:1px solid var(--border); border-radius:999px; padding:7px 10px;
  background:var(--bg-1); color:var(--text-2); cursor:pointer; font-size:12px;
  transition:color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.agent-quick-chip:hover { color:var(--text); border-color:var(--border-strong); }
.agent-msg { display:flex; gap:10px; align-items:flex-start; }
.agent-msg.user { flex-direction:row-reverse; }
.agent-msg.pending .agent-bubble { color:var(--text-2); border-style:dashed; min-width:92px; text-align:center; font-variant-numeric:tabular-nums; }
.agent-avatar {
  width:30px; height:30px; border-radius:10px; flex-shrink:0;
  display:grid; place-items:center; background:var(--bg-1); border:1px solid var(--border);
  font-size:12px; color:var(--text-2);
}
.agent-msg.user .agent-avatar { background:var(--brand); color:#fff; border-color:var(--brand); }
.agent-bubble {
  max-width:min(760px, 82%); padding:11px 13px; border-radius:14px;
  background:var(--bg-1); border:1px solid var(--border);
  color:var(--text); font-size:13px; line-height:1.65; white-space:pre-wrap; word-break:break-word;
}
.agent-bubble.markdown {
  white-space:normal;
}
.agent-bubble.markdown :where(h1,h2,h3,h4,h5,h6) {
  margin: 0.45em 0 0.2em;
  line-height: 1.3;
  font-weight: 600;
  color: var(--text);
}
.agent-bubble.markdown p {
  margin: 0.42em 0;
}
.agent-bubble.markdown ul, .agent-bubble.markdown ol {
  margin: 0.35em 0 0.35em 1.2em;
  padding-left: 1.05em;
}
.agent-bubble.markdown li {
  margin: 0.18em 0;
}
.agent-bubble.markdown pre {
  margin: 0.5em 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #0d1117;
  color: #e6edf3;
  border: 1px solid var(--border);
  overflow: auto;
  white-space: pre;
}
.agent-bubble.markdown blockquote {
  margin: 0.5em 0;
  padding: 0.35em 0.7em;
  border-left: 3px solid var(--border-strong);
  color: var(--text-2);
  background: rgba(124, 92, 255, .06);
}
.agent-bubble.markdown table {
  width:100%; border-collapse: collapse;
  margin: 0.45em 0;
  background: var(--bg-1);
}
.agent-bubble.markdown th, .agent-bubble.markdown td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}
.agent-bubble.markdown a {
  color: #7c5cff;
  text-decoration: underline;
}
.agent-bubble.markdown code {
  padding: 0.08em 0.34em;
  border-radius: 6px;
  background: rgba(124, 92, 255, .11);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}
.agent-bubble.markdown img {
  display:block;
  max-width:100%;
  max-height:360px;
  object-fit:contain;
  margin:0.55em 0;
  border-radius:10px;
  border:1px solid var(--border);
  background:var(--bg-2);
}
.agent-bubble.markdown hr {
  border:0;
  border-top:1px solid var(--border);
  margin:0.75em 0;
}
.agent-msg.user .agent-bubble { background:rgba(124,92,255,.16); border-color:rgba(124,92,255,.35); }
.agent-composer { padding:12px 14px; flex-shrink:0; }
.agent-input-box {
  width:calc(100% - 32px);
  max-width:720px;
  margin:0 auto;
  min-height:118px;
  border:1px solid var(--border);
  border-radius:18px;
  background:var(--bg-1);
  display:flex;
  flex-direction:column;
  gap:7px;
  padding:10px;
  box-sizing:border-box;
  transition:border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.agent-input-box:focus-within {
  border-color:var(--brand);
  box-shadow:0 0 0 4px rgba(124,92,255,.12);
}
.agent-composer textarea {
  height:48px; min-height:48px; max-height:96px; resize:none; overflow:auto;
  border:0; border-radius:0; background:transparent;
  color:var(--text); padding:2px 4px; font-family:inherit; line-height:1.5; outline:none;
}
.agent-composer textarea:focus { box-shadow:none; }
.agent-composer-tools {
  display:flex; align-items:center; justify-content:space-between; gap:10px; width:100%;
}
.agent-composer-left {
  display:flex; align-items:center; gap:8px; min-width:0; flex:1 1 auto;
}
.agent-composer-actions {
  display:flex; align-items:center; gap:8px; margin-left:auto; flex-shrink:0;
}
.agent-icon-btn {
  width:34px; height:34px; padding:0; border-radius:50%;
  display:inline-flex; align-items:center; justify-content:center; flex-shrink:0;
}
.agent-icon-btn .i { margin:0; }
.agent-send-round {
  width:36px; height:36px; padding:0; border-radius:50%;
  display:inline-flex; align-items:center; justify-content:center;
}
.agent-send-round .i { margin:0; }
.agent-compose-attach-list {
  display:flex; flex-wrap:wrap; gap:6px; min-height:0; max-height:72px; overflow:auto;
}
.agent-compose-attach-list:empty { display:none; }
.agent-attach-item {
  display:inline-flex; align-items:center; gap:6px; padding:4px 8px;
  border:1px solid var(--border); border-radius:999px;
  background:var(--bg-1); color:var(--text); font-size:12px; max-width:260px;
}
.agent-attach-item .agent-attach-name {
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:186px;
}
.agent-attach-item .agent-attach-type {
  color:var(--text-3); font-size:11px;
}
.agent-attach-item button {
  border:0; background:transparent; color:var(--text-3); width:18px; height:18px;
  display:inline-flex; align-items:center; justify-content:center; border-radius:50%; cursor:pointer;
  padding:0; line-height:1;
}
.agent-attach-item button:hover { background:var(--surface-2); color:var(--text); }
@media (max-width: 860px) {
  .agent-shell { grid-template-columns:1fr; }
  .agent-panel { border-right:0; border-bottom:1px solid var(--border); }
  .agent-conv-list { max-height:180px; }
  .agent-bubble { max-width:88%; }
  .agent-input-box { width:100%; max-width:none; }
  .agent-composer-tools { align-items:flex-start; }
  .agent-composer-left { align-items:flex-start; }
  .agent-current-card.agent-current-composer { align-items:flex-start; flex-direction:column; }
  .agent-current-meta { justify-content:flex-start; max-width:100%; }
  .agent-current-model { max-width:100%; }
  .agent-mobile-modal { padding:20px; }
}
.page-agent-head {
  align-items: flex-start;
}

.page-agent-eyebrow {
  color: var(--brand-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.page-agent-statusbar {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.page-agent-statusbar > div,
.page-agent-panel {
  border: 1px solid color-mix(in srgb, var(--border) 82%, transparent);
  background: var(--bg-card);
  border-radius: 8px;
}

.page-agent-statusbar > div {
  min-height: 76px;
  padding: 13px 14px 12px;
}

.page-agent-statusbar span,
.page-agent-kv dt {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-3);
  font-size: 12px;
  margin-bottom: 4px;
}

.page-agent-status-dot {
  background: var(--brand-2);
  border-radius: 999px;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 18%, transparent);
  display: inline-block;
  height: 6px;
  width: 6px;
}

.page-agent-statusbar strong {
  color: var(--text);
  display: block;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.page-agent-shell {
  display: grid;
  grid-template-columns: minmax(320px, 1.1fr) minmax(260px, .9fr);
  gap: 16px;
}

.page-agent-panel {
  padding: 18px;
}

.page-agent-panel-head {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.page-agent-panel h3 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0;
}

.page-agent-panel-head p,
.page-agent-action-note,
.page-agent-config-helper {
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.55;
  margin: 5px 0 0;
}

.page-agent-panel-head > span {
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-2);
  flex: 0 0 auto;
  font-size: 12px;
  line-height: 1;
  padding: 6px 9px;
}

.page-agent-compose textarea {
  background: color-mix(in srgb, var(--bg-1) 84%, transparent);
  border-color: color-mix(in srgb, var(--border) 90%, transparent);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  width: 100%;
  resize: vertical;
  min-height: 168px;
  padding: 13px 14px;
  line-height: 1.55;
}

.page-agent-compose textarea::placeholder {
  color: var(--text-3);
}

.page-agent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 8px;
}

.page-agent-actions .btn {
  min-height: 38px;
}

.page-agent-action-note {
  text-align: left;
}

.page-agent-run-summary {
  border: 1px solid color-mix(in srgb, var(--brand-2) 24%, var(--border));
  border-radius: 8px;
  display: grid;
  gap: 7px;
  margin-top: 14px;
  padding: 12px 13px;
  background: color-mix(in srgb, var(--brand-2) 8%, var(--bg-1));
}

.page-agent-run-summary span {
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 700;
}

.page-agent-run-summary strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.page-agent-config-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.page-agent-pairing {
  border-top: 1px solid var(--border);
  margin-top: 16px;
  padding-top: 16px;
}

.page-agent-pairing-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.page-agent-pairing-head span {
  color: var(--text-3);
  font-size: 12px;
}

.page-agent-pairing-head strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.page-agent-pairing-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 11px;
}

.page-agent-pairing-row input {
  background: color-mix(in srgb, var(--bg-1) 84%, transparent);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.45;
  min-width: 0;
  padding: 9px 10px;
}

.page-agent-pairing-row input::placeholder {
  color: var(--text-3);
}

.page-agent-install {
  border-top: 1px solid var(--border);
  margin-top: 16px;
  padding-top: 16px;
}

.page-agent-install-head {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.page-agent-install-head span {
  color: var(--text-3);
  font-size: 12px;
}

.page-agent-install-head strong {
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.page-agent-install-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 11px;
}

.page-agent-install-steps {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.7;
  margin: 12px 0 0;
  padding-left: 22px;
}

.page-agent-install-steps li + li {
  margin-top: 4px;
}

.page-agent-kv {
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--border) 74%, transparent);
  border-radius: 8px;
  overflow: hidden;
}

.page-agent-kv > div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-1) 54%, transparent);
}

.page-agent-kv > div:last-child {
  border-bottom: 0;
}

.page-agent-kv dd {
  margin: 0;
  color: var(--text);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.page-agent-checklist {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.page-agent-checklist span {
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-2);
  font-size: 13px;
  padding: 7px 10px;
}

.page-agent-risk {
  background: color-mix(in srgb, var(--danger) 11%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 36%, var(--border));
  border-radius: 8px;
  color: var(--danger);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 10px;
  padding: 10px 12px;
}

.page-agent-safety p {
  margin: 0;
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.65;
}

.page-agent-activity {
  grid-column: 1 / -1;
}

.page-agent-activity-list {
  display: grid;
  gap: 0;
  border: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  border-radius: 8px;
  overflow: hidden;
}

.page-agent-activity-item {
  border: 0;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  padding: 12px 13px;
  background: color-mix(in srgb, var(--bg-1) 62%, transparent);
}

.page-agent-activity-item:last-child {
  border-bottom: 0;
}

.page-agent-activity-main,
.page-agent-activity-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.page-agent-activity-main span,
.page-agent-activity-meta span {
  color: var(--text-3);
  font-size: 12px;
}

.page-agent-activity-summary,
.page-agent-empty {
  color: var(--text-2);
  font-size: 13px;
  margin-top: 7px;
}

.page-agent-empty {
  padding: 12px 13px;
}

@media (max-width: 920px) {
  .page-agent-statusbar,
  .page-agent-shell {
    grid-template-columns: 1fr;
  }

  .page-agent-pairing-row {
    grid-template-columns: 1fr;
  }

  .page-agent-actions,
  .page-agent-action-note,
  .page-agent-config-actions {
    justify-content: flex-start;
    text-align: left;
  }
}
/* ============== Text Models ============== */
.text-model-shell {
  display:grid;
  grid-template-columns:minmax(300px, 420px) minmax(0, 1fr);
  gap:18px;
  align-items:stretch;
}
.text-model-panel {
  padding:20px;
}
.text-model-panel h3 {
  margin:0 0 14px;
  font-size:14px;
}
.text-model-field { margin-bottom:14px; }
.text-model-field label {
  display:block;
  font-size:12px;
  color:var(--text-2);
  margin-bottom:7px;
}
.text-model-field select,
.text-model-field input,
.text-model-field textarea {
  width:100%;
  border:1px solid var(--border);
  border-radius:12px;
  background:var(--bg-1);
  color:var(--text);
  padding:11px 12px;
  font-family:inherit;
  outline:none;
  box-sizing:border-box;
}
.text-model-field textarea {
  min-height:120px;
  resize:vertical;
  line-height:1.55;
}
.text-model-shortcut-hint {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:6px;
  margin-top:7px;
  color:var(--text-3);
  font-size:11px;
  line-height:1.4;
}
.text-model-shortcut-hint kbd {
  border:1px solid var(--border);
  border-bottom-color:var(--border-strong);
  border-radius:6px;
  background:var(--bg-2);
  color:var(--text-2);
  padding:2px 6px;
  font:inherit;
}
.text-model-shortcut-sep {
  color:var(--text-3);
}
.text-model-field select:focus,
.text-model-field input:focus,
.text-model-field textarea:focus {
  border-color:var(--brand);
  box-shadow:0 0 0 4px rgba(124,92,255,.14);
}
.text-model-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.guild-script-fieldset {
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid var(--border);
}
.guild-script-fieldset:first-of-type {
  margin-top:0;
  padding-top:0;
  border-top:0;
}
.guild-script-fieldset h4 {
  margin:0 0 10px;
  color:var(--text);
  font-size:13px;
}
.required-mark {
  display:inline-flex;
  align-items:center;
  margin-left:6px;
  padding:1px 6px;
  border-radius:999px;
  background:rgba(255,92,122,.14);
  color:var(--danger);
  font-size:10px;
  font-weight:600;
  line-height:1.5;
}
.required-mark.optional-required {
  background:rgba(255,181,71,.14);
  color:var(--warn);
}
.text-model-actions {
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin-top:6px;
}
.text-model-status {
  font-size:12px;
  color:var(--text-2);
}
.text-model-status.ok { color:var(--accent); }
.text-model-status.err { color:var(--danger); }
.text-model-result {
  padding:20px;
  display:flex;
  flex-direction:column;
  min-height:0;
}
.text-model-result-head {
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  margin-bottom:14px;
}
.text-model-tabs {
  display:inline-flex;
  gap:4px;
  padding:3px;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--bg-1);
}
.text-model-tab {
  border:0;
  border-radius:999px;
  padding:7px 12px;
  color:var(--text-2);
  background:transparent;
  cursor:pointer;
  font-size:12px;
  transition:background var(--t-fast), color var(--t-fast);
}
.text-model-tab.active {
  color:var(--text);
  background:var(--bg-2);
}
.text-model-head-actions {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex:1;
}
.text-model-panel-view {
  display:none;
  min-height:0;
  flex:1;
  flex-direction:column;
}
.text-model-panel-view.active {
  display:flex;
}
.guild-script-head-actions {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  flex:1;
  min-width:0;
}
.guild-script-tabs {
  display:inline-flex;
  gap:4px;
  padding:3px;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--bg-1);
}
.guild-script-tab {
  border:0;
  border-radius:999px;
  padding:7px 12px;
  color:var(--text-2);
  background:transparent;
  cursor:pointer;
  font-size:12px;
  transition:background var(--t-fast), color var(--t-fast);
}
.guild-script-tab.active {
  color:var(--text);
  background:var(--bg-2);
}
.guild-script-panel {
  display:none;
  min-height:0;
  flex:1;
  flex-direction:column;
}
.guild-script-panel.active {
  display:flex;
}
.text-model-output {
  flex:none;
  height:clamp(320px, calc(100vh - 320px), 560px);
  min-height:0;
  border:1px solid var(--border);
  border-radius:14px;
  background:var(--bg-1);
  padding:14px;
  font-size:13px;
  line-height:1.58;
  white-space:pre-wrap;
  word-break:break-word;
  overflow-y:auto;
  overscroll-behavior:contain;
  color:var(--text);
}
.text-model-output.empty {
  color:var(--text-3);
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
}
.text-model-output.markdown {
  white-space:normal;
}
.text-model-output.conversation {
  display:flex;
  flex-direction:column;
  gap:12px;
}
.text-model-message {
  display:flex;
  flex-direction:column;
  gap:5px;
  max-width:min(86%, 760px);
}
.text-model-message.user {
  align-self:flex-end;
  align-items:flex-end;
}
.text-model-message.assistant {
  align-self:flex-start;
  align-items:flex-start;
}
.text-model-message-role {
  font-size:11px;
  color:var(--text-3);
  padding:0 4px;
}
.text-model-message-bubble {
  border:1px solid var(--border);
  border-radius:12px;
  padding:10px 12px;
  background:rgba(255,255,255,.035);
  color:var(--text);
  font-size:13px;
  line-height:1.58;
}
.text-model-message.user .text-model-message-bubble {
  background:rgba(124,92,255,.16);
  border-color:rgba(124,92,255,.32);
}
.text-model-message.assistant.error .text-model-message-bubble {
  background:rgba(255,92,122,.10);
  border-color:rgba(255,92,122,.38);
}
.text-model-message.assistant.pending .text-model-message-bubble {
  color:var(--text-3);
}
.text-model-message-content.markdown {
  white-space:normal;
}
.text-model-output.markdown :where(h1,h2,h3,h4,h5,h6),
.text-model-message-content.markdown :where(h1,h2,h3,h4,h5,h6) {
  margin: 0.45em 0 0.2em;
  font-size:14px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--text);
}
.text-model-output.markdown p,
.text-model-message-content.markdown p {
  margin: 0.42em 0;
}
.text-model-output.markdown ul, .text-model-output.markdown ol,
.text-model-message-content.markdown ul, .text-model-message-content.markdown ol {
  margin: 0.35em 0 0.35em 1.2em;
  padding-left: 1.05em;
}
.text-model-output.markdown li,
.text-model-message-content.markdown li {
  margin: 0.18em 0;
}
.text-model-output.markdown pre,
.text-model-message-content.markdown pre {
  margin: 0.5em 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #0d1117;
  color: #e6edf3;
  border: 1px solid var(--border);
  overflow: auto;
  white-space: pre;
}
.text-model-output.markdown blockquote,
.text-model-message-content.markdown blockquote {
  margin: 0.5em 0;
  padding: 0.35em 0.7em;
  border-left: 3px solid var(--border-strong);
  color: var(--text-2);
  background: rgba(124, 92, 255, .06);
}
.text-model-output.markdown table,
.text-model-message-content.markdown table {
  width:100%;
  border-collapse: collapse;
  margin: 0.45em 0;
  background: var(--bg-1);
}
.text-model-output.markdown th, .text-model-output.markdown td,
.text-model-message-content.markdown th, .text-model-message-content.markdown td {
  border: 1px solid var(--border);
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
}
.text-model-output.markdown a,
.text-model-message-content.markdown a {
  color: #7c5cff;
  text-decoration: underline;
}
.text-model-output.markdown code,
.text-model-message-content.markdown code {
  padding: 0.08em 0.34em;
  border-radius: 6px;
  background: rgba(124, 92, 255, .11);
  font-family: 'JetBrains Mono', monospace;
}
.text-model-output.markdown img,
.text-model-message-content.markdown img {
  display:block;
  max-width:100%;
  max-height:520px;
  object-fit:contain;
  margin:0.65em 0;
  border-radius:12px;
  border:1px solid var(--border);
  background:var(--bg-2);
}
.text-model-output.markdown hr,
.text-model-message-content.markdown hr {
  border:0;
  border-top:1px solid var(--border);
  margin:0.85em 0;
}
.text-model-records {
  display:flex;
  flex-direction:column;
  gap:10px;
  flex:1;
  min-height:0;
  overflow:auto;
  color:var(--text-3);
  font-size:12px;
}
.text-model-record {
  border:1px solid var(--border);
  border-radius:12px;
  padding:12px;
  background:var(--bg-1);
}
.text-model-record-head {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom:8px;
}
.text-model-record-title {
  color:var(--text);
  font-weight:700;
  line-height:1.35;
}
.text-model-record-time {
  color:var(--text-3);
  font-size:11px;
  white-space:nowrap;
}
.text-model-record-preview {
  color:var(--text-2);
  line-height:1.45;
  max-height:42px;
  overflow:hidden;
  margin-bottom:10px;
}
.text-model-record-footer {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap;
}
.text-model-record-meta {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.text-model-record-meta span {
  border:1px solid var(--border);
  border-radius:999px;
  padding:3px 8px;
  color:var(--text-3);
  background:var(--bg-2);
}
.text-model-record-actions {
  display:flex;
  gap:6px;
  justify-content:flex-end;
  flex-wrap:wrap;
}
.view-guild-scripts .text-model-output {
  padding:10px;
  line-height:1.42;
}
.view-guild-scripts .guild-script-item {
  gap:6px;
  padding:6px 0;
}
.view-guild-scripts .guild-script-result-card {
  display:flex;
  flex-direction:column;
  gap:6px;
  padding:10px 12px;
}
.view-guild-scripts .guild-script-result-card .guild-script-card-head {
  margin-bottom:0;
}
.view-guild-scripts .guild-script-text {
  line-height:1.42;
}
.view-guild-scripts .guild-script-cn {
  margin-top:3px;
  line-height:1.35;
}
.text-model-meta {
  margin-top:12px;
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  color:var(--text-3);
  font-size:12px;
}
.text-model-meta span {
  border:1px solid var(--border);
  border-radius:999px;
  padding:4px 9px;
  background:var(--bg-1);
}
.guild-script-item {
  border:1px solid var(--border);
  border-radius:12px;
  background:rgba(255,255,255,.025);
  margin-bottom:8px;
}
.guild-script-item:last-child { margin-bottom:0; }
.guild-script-index {
  width:22px;
  height:22px;
  border-radius:999px;
  display:grid;
  place-items:center;
  background:rgba(0,230,195,.14);
  color:var(--accent);
  font-size:12px;
  font-weight:700;
}
.guild-script-card-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:8px;
}
.guild-script-card-title {
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}
.guild-script-card-label {
  color:var(--text-2);
  font-size:12px;
  font-weight:600;
}
.guild-script-card-actions {
  display:flex;
  align-items:center;
  gap:6px;
  flex-shrink:0;
}
.guild-script-card-body {
  display:flex;
  flex-direction:column;
  gap:6px;
}
.guild-script-text {
  color:var(--text);
  line-height:1.5;
}
.guild-script-cn {
  margin-top:4px;
  color:var(--text-3);
  font-size:12px;
  line-height:1.45;
}
.guild-script-cn-strip {
  display:flex;
  gap:8px;
  align-items:flex-start;
  padding:7px 9px;
  border-radius:10px;
  background:rgba(255,255,255,.035);
}
.guild-script-cn-label {
  flex-shrink:0;
  color:var(--accent);
  font-weight:600;
}
.guild-script-records-head {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom:10px;
}
.guild-script-title-row {
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}
.guild-script-records-head h3 {
  margin:0;
  font-size:14px;
}
.guild-script-title-stat {
  display:inline-flex;
  align-items:center;
  gap:8px;
  color:var(--text-3);
  font-size:12px;
  white-space:nowrap;
}
.guild-script-title-stat::before {
  content:'';
  width:4px;
  height:4px;
  border-radius:50%;
  background:var(--text-3);
  opacity:.7;
}
.guild-script-record-tools {
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.guild-script-panel-action-slot {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  min-height:34px;
}
.text-model-result-head .guild-script-record-tools {
  justify-content:flex-end;
  flex-wrap:nowrap;
  min-width:0;
}
.text-model-result-head .guild-script-search-box {
  flex:0 1 180px;
}
.guild-script-filter {
  display:inline-flex;
  align-items:center;
  gap:5px;
  color:var(--text-2);
  font-size:12px;
  white-space:nowrap;
}
.guild-script-records {
  display:flex;
  flex-direction:column;
  gap:10px;
  color:var(--text-3);
  font-size:12px;
  flex:1;
  max-height:none;
  min-height:0;
  overflow:auto;
}
.guild-script-record {
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  background:var(--bg-1);
}
.guild-script-record.active {
  border-color:rgba(0,230,195,.45);
  box-shadow:0 0 0 3px rgba(0,230,195,.08);
}
.guild-script-record-head {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom:10px;
}
.guild-script-record-title-row,
.guild-script-favorite-title-row {
  display:flex;
  align-items:baseline;
  gap:8px;
  flex-wrap:wrap;
  min-width:0;
}
.guild-script-record-title {
  color:var(--text);
  font-weight:700;
  line-height:1.35;
}
.guild-script-record-time {
  color:var(--text-3);
  font-size:11px;
  line-height:1.35;
}
.guild-script-record-actions {
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.guild-script-record-preview {
  display:flex;
  flex-direction:column;
  gap:7px;
  padding:9px 10px;
  border-radius:12px;
  background:rgba(255,255,255,.025);
  margin-bottom:10px;
}
.guild-script-record-summary {
  color:var(--text-2);
  line-height:1.45;
}
.guild-script-record-cn {
  margin-top:0;
}
.guild-script-record-footer {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.guild-script-record-badges {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.guild-script-record-badges span {
  border:1px solid var(--border);
  border-radius:999px;
  padding:3px 8px;
  color:var(--text-3);
  background:var(--bg-2);
}
.guild-script-search-highlight {
  display:inline;
  color:#ffe3a6;
  background:rgba(255,181,71,.22);
  border-radius:4px;
  padding:0 2px;
}
.guild-script-record-item {
  padding:8px 0;
  border-top:1px solid var(--border);
}
.guild-script-search-box {
  position:relative;
  flex:0 1 180px;
  width:180px;
  min-width:0;
}
.guild-script-search-box .i {
  position:absolute;
  left:10px;
  top:50%;
  transform:translateY(-50%);
  width:14px;
  height:14px;
  color:var(--text-3);
  pointer-events:none;
}
.guild-script-search-box input {
  width:100%;
  border:1px solid var(--border);
  border-radius:999px;
  background:var(--bg-1);
  color:var(--text);
  padding:9px 12px 9px 34px;
  font-family:inherit;
  font-size:12px;
  outline:none;
  box-sizing:border-box;
}
.guild-script-search-box input:focus {
  border-color:var(--brand);
  box-shadow:0 0 0 3px rgba(124,92,255,.12);
}
.guild-script-favorite {
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
  background:var(--bg-1);
}
.guild-script-favorite-head {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
  margin-bottom:10px;
}
.guild-script-favorite-title {
  color:var(--text);
  font-weight:700;
  line-height:1.35;
}
.guild-script-favorite-time {
  color:var(--text-3);
  font-size:11px;
  line-height:1.35;
}
.guild-script-favorite-preview {
  margin-bottom:10px;
}
.guild-script-favorite-actions {
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
@media (max-width: 1100px) {
  .text-model-shell { grid-template-columns:1fr; }
}
.view-chat-assistant .sr-only {
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}
.guild-reply-page-head {
  align-items:flex-start;
  gap:16px;
}
.guild-reply-head-actions {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:10px;
  margin-left:auto;
}
.guild-reply-head-actions .text-model-status:empty {
  display:none;
}
.guild-reply-shell {
  display:grid;
  grid-template-columns:300px minmax(0, 1fr) 300px;
  gap:16px;
  align-items:stretch;
  min-height:640px;
  height:min(860px, calc(100vh - 220px));
}
.guild-reply-sidebar,
.guild-reply-main,
.guild-reply-result {
  min-height:0;
}
.guild-reply-sidebar,
.guild-reply-result {
  padding:16px;
}
.guild-reply-main {
  display:grid;
  grid-template-rows:auto minmax(300px, 1fr) auto;
  overflow:hidden;
}
.guild-reply-side-head,
.guild-reply-result-head,
.guild-reply-chat-head,
.guild-reply-toolbar {
  display:flex;
  align-items:center;
  gap:10px;
}
.guild-reply-side-head {
  justify-content:space-between;
  margin-bottom:12px;
}
.guild-reply-side-head h3,
.guild-reply-result-head h3 {
  margin:0;
  font-size:14px;
}
.guild-reply-icon-btn {
  width:36px;
  height:36px;
  padding:0;
  font-size:22px;
  line-height:1;
}
.guild-reply-conversation-list {
  display:flex;
  flex-direction:column;
  max-height:calc(100% - 50px);
  overflow:auto;
  color:var(--text-3);
  font-size:12px;
}
.guild-reply-conversation-row {
  position:relative;
  border-bottom:1px solid var(--border);
}
.guild-reply-conversation-row:last-child {
  border-bottom:0;
}
.guild-reply-conversation {
  width:100%;
  min-width:0;
  border:0;
  border-radius:0;
  background:transparent;
  color:var(--text);
  padding:13px 42px 13px 2px;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:5px;
  cursor:pointer;
  font-family:inherit;
  text-align:left;
}
.guild-reply-conversation span {
  max-width:100%;
  overflow:hidden;
  text-overflow:ellipsis;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  white-space:normal;
  line-height:1.35;
}
.guild-reply-conversation.active,
.guild-reply-conversation-row.active .guild-reply-conversation {
  color:var(--text);
}
.guild-reply-conversation-row.active::before {
  content:"";
  position:absolute;
  left:-16px;
  top:8px;
  bottom:8px;
  width:3px;
  border-radius:999px;
  background:var(--accent);
}
.guild-reply-conversation small {
  color:var(--text-3);
  font-size:11px;
}
.guild-reply-conversation-delete {
  position:absolute;
  top:50%;
  right:2px;
  transform:translateY(-50%);
  width:30px;
  height:30px;
  border:1px solid rgba(255,92,122,.28);
  border-radius:10px;
  background:rgba(255,92,122,.08);
  color:var(--danger);
  padding:0;
  display:grid;
  place-items:center;
  font-family:inherit;
  cursor:pointer;
  opacity:0;
  pointer-events:none;
  transition:opacity .15s ease, background .15s ease, border-color .15s ease;
}
.guild-reply-conversation-row:hover .guild-reply-conversation-delete,
.guild-reply-conversation-row:focus-within .guild-reply-conversation-delete {
  opacity:1;
  pointer-events:auto;
}
.guild-reply-conversation-delete .i {
  width:15px;
  height:15px;
}
.guild-reply-conversation-delete:hover,
.guild-reply-conversation-delete:focus-visible {
  border-color:var(--danger);
  background:rgba(255,92,122,.14);
}
.guild-reply-conversation-delete:disabled {
  cursor:not-allowed;
  opacity:0;
  pointer-events:none;
}
.guild-reply-conversation-row:hover .guild-reply-conversation-delete:disabled,
.guild-reply-conversation-row:focus-within .guild-reply-conversation-delete:disabled {
  opacity:.45;
}
.guild-reply-chat-head {
  justify-content:space-between;
  padding:18px 20px 12px;
  border-bottom:1px solid var(--border);
}
.guild-reply-title-stack {
  min-width:0;
  display:grid;
  gap:6px;
}
.guild-reply-title-input {
  width:min(620px, 100%);
  min-width:0;
  border:1px solid transparent;
  border-radius:10px;
  background:transparent;
  color:var(--text);
  padding:4px 7px;
  margin-left:-7px;
  font-family:inherit;
  font-size:18px;
  line-height:1.25;
  font-weight:700;
  outline:none;
}
.guild-reply-title-input:hover,
.guild-reply-title-input:focus {
  border-color:var(--border-strong);
  background:rgba(255,255,255,.035);
}
.guild-reply-chat-meta {
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:8px;
  color:var(--text-3);
  font-size:12px;
}
.guild-reply-chat-meta span + span {
  padding-left:8px;
  border-left:1px solid var(--border);
}
.guild-reply-context-grid .text-model-field,
.guild-reply-scene-panel .text-model-field {
  gap:6px;
}
.guild-reply-context-grid label,
.guild-reply-scene-panel label {
  font-size:11px;
  color:var(--text-3);
}
.guild-reply-context-grid input,
.guild-reply-context-grid textarea,
.guild-reply-scene-panel input,
.guild-reply-scene-panel textarea,
.guild-reply-scene-panel select,
.guild-reply-toolbar select {
  border:1px solid var(--border);
  border-radius:10px;
  background:rgba(8,8,13,.72);
  color:var(--text);
  font-family:inherit;
  outline:none;
}
.guild-reply-context-grid input,
.guild-reply-scene-panel input,
.guild-reply-scene-panel select,
.guild-reply-toolbar select {
  min-width:0;
  padding:9px 10px;
}
.guild-reply-context-grid textarea,
.guild-reply-scene-panel textarea {
  resize:vertical;
  padding:11px 12px;
  line-height:1.55;
}
.guild-reply-context-grid input:focus,
.guild-reply-context-grid textarea:focus,
.guild-reply-scene-panel input:focus,
.guild-reply-scene-panel textarea:focus,
.guild-reply-scene-panel select:focus,
.guild-reply-toolbar select:focus {
  border-color:var(--brand);
  box-shadow:0 0 0 4px rgba(139,109,255,.14);
}
.guild-reply-thread {
  min-height:0;
  overflow:auto;
  padding:18px 20px;
  display:flex;
  flex-direction:column;
  gap:14px;
}
.guild-reply-turn {
  display:grid;
  grid-template-columns:34px minmax(0, 1fr);
  gap:10px;
  align-items:start;
}
.guild-reply-turn-assistant {
  grid-template-columns:minmax(0, 1fr) 34px;
}
.guild-reply-turn-assistant .guild-reply-avatar {
  grid-column:2;
  grid-row:1;
}
.guild-reply-turn-assistant .guild-reply-turn-body {
  grid-column:1;
  grid-row:1;
  text-align:right;
}
.guild-reply-avatar {
  width:34px;
  height:34px;
  border-radius:50%;
  display:grid;
  place-items:center;
  background:rgba(255,255,255,.08);
  color:var(--text-2);
  font-size:12px;
  font-weight:700;
}
.guild-reply-avatar.assistant {
  position:relative;
  isolation:isolate;
  background:linear-gradient(135deg, rgba(139,109,255,.85), rgba(0,230,195,.55));
  color:#fff;
  box-shadow:0 0 18px rgba(139,109,255,.28);
}
.guild-reply-avatar.assistant::before {
  content:"";
  position:absolute;
  inset:-4px;
  z-index:-1;
  border-radius:inherit;
  background:conic-gradient(from 0deg, rgba(139,109,255,.08), rgba(0,230,195,.92), rgba(255,92,226,.78), rgba(139,109,255,.08));
  opacity:.55;
  filter:blur(.2px);
  animation:guild-reply-ai-halo-spin 2.2s linear infinite;
  animation-play-state:paused;
}
.guild-reply-turn-assistant.is-generating .guild-reply-avatar.assistant::before {
  opacity:1;
  animation-play-state:running;
}
@keyframes guild-reply-ai-halo-spin {
  to {
    transform:rotate(1turn);
  }
}
.guild-reply-turn-body {
  min-width:0;
}
.guild-reply-turn-meta {
  margin-bottom:6px;
  color:var(--text-3);
  font-size:12px;
}
.guild-reply-player-bubble {
  width:fit-content;
  max-width:min(620px, 92%);
  border:1px solid var(--border);
  border-radius:14px;
  border-top-left-radius:5px;
  background:rgba(255,255,255,.055);
  color:var(--text);
  padding:12px 14px;
  line-height:1.6;
  font-size:14px;
  white-space:pre-wrap;
}
.guild-reply-ocr {
  align-self:center;
  max-width:620px;
  border:1px dashed rgba(0,230,195,.28);
  border-radius:10px;
  padding:8px 12px;
  color:var(--text-3);
  background:rgba(0,230,195,.04);
  font-size:12px;
  line-height:1.45;
}
.guild-reply-suggestions {
  display:flex;
  flex-direction:column;
  gap:10px;
  min-height:92px;
  color:var(--text-3);
  font-size:12px;
}
.guild-reply-turn-assistant .guild-reply-suggestions {
  align-items:flex-end;
  text-align:right;
}
.guild-reply-suggestion {
  width:min(640px, 100%);
  margin-left:auto;
  border:1px solid rgba(139,109,255,.24);
  border-radius:14px;
  border-top-right-radius:5px;
  background:linear-gradient(180deg, rgba(139,109,255,.17), rgba(139,109,255,.08));
  padding:12px 13px;
  text-align:left;
}
.guild-reply-suggestion.risk-high {
  border-color:rgba(255,92,122,.45);
}
.guild-reply-suggestion.risk-low {
  border-color:rgba(0,230,195,.35);
}
.guild-reply-suggestion-head,
.guild-reply-suggestion-actions {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}
.guild-reply-suggestion-head strong {
  color:var(--text);
}
.guild-reply-suggestion-head span {
  color:var(--text-3);
  font-size:11px;
}
.guild-reply-suggestion-text {
  margin-top:8px;
  color:var(--text);
  line-height:1.55;
}
.guild-reply-suggestion-reason {
  margin-top:7px;
  color:var(--text-2);
  font-size:12px;
  line-height:1.45;
}
.guild-reply-suggestion-actions {
  justify-content:flex-end;
  margin-top:10px;
}
@media (prefers-reduced-motion:reduce) {
  .guild-reply-avatar.assistant::before {
    animation:none;
  }
}
.guild-reply-composer {
  padding:12px 18px 16px;
  border-top:0;
  background:transparent;
}
.guild-reply-input-box {
  width:calc(100% - 24px);
  max-width:760px;
  margin:0 auto;
  min-height:118px;
  border:1px solid var(--border);
  border-radius:18px;
  background:var(--bg-1);
  display:flex;
  flex-direction:column;
  gap:7px;
  padding:10px;
  box-sizing:border-box;
  transition:border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.guild-reply-input-box:focus-within {
  border-color:var(--brand);
  box-shadow:0 0 0 4px rgba(124,92,255,.12);
}
.guild-reply-composer textarea {
  height:48px;
  min-height:48px;
  max-height:96px;
  resize:none;
  overflow:auto;
  border:0;
  border-radius:0;
  background:transparent;
  color:var(--text);
  padding:2px 4px;
  font-family:inherit;
  line-height:1.5;
  outline:none;
}
.guild-reply-composer textarea:focus {
  box-shadow:none;
}
.guild-reply-context-grid {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:10px;
}
.guild-reply-context-grid .guild-reply-wide {
  grid-column:1 / -1;
}
.guild-reply-toolbar {
  justify-content:space-between;
  width:100%;
  min-width:0;
}
.guild-reply-toolbar-left,
.guild-reply-toolbar-actions {
  display:flex;
  align-items:center;
  gap:8px;
  min-width:0;
}
.guild-reply-toolbar-left {
  flex:1 1 auto;
  overflow:hidden;
}
.guild-reply-toolbar-actions {
  flex-shrink:0;
  margin-left:auto;
}
.guild-reply-toolbar select {
  min-height:34px;
  max-width:190px;
}
.guild-reply-round-btn,
.guild-reply-send-round {
  width:36px;
  height:36px;
  padding:0;
  border-radius:50%;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex-shrink:0;
}
.guild-reply-round-btn .i,
.guild-reply-send-round .i {
  margin:0;
}
.guild-reply-result-head {
  justify-content:space-between;
  padding-bottom:14px;
  border-bottom:1px solid var(--border);
}
.guild-reply-analysis {
  margin-top:14px;
  color:var(--text-3);
  display:grid;
  gap:0;
  font-size:12px;
}
.guild-reply-analysis div {
  display:grid;
  grid-template-columns:58px 1fr;
  gap:10px;
  padding:13px 0;
  border-bottom:1px solid var(--border);
}
.guild-reply-analysis strong {
  color:var(--text-2);
  font-weight:600;
}
.guild-reply-analysis span {
  color:var(--text);
  line-height:1.45;
}
.guild-reply-insight-panel .text-model-meta {
  margin-top:14px;
}
.guild-reply-scene-backdrop {
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.32);
  opacity:0;
  pointer-events:none;
  transition:opacity var(--t-fast);
  z-index:70;
}
.guild-reply-scene-backdrop.open {
  opacity:1;
  pointer-events:auto;
}
.guild-reply-scene-panel {
  position:fixed;
  top:0;
  right:0;
  bottom:0;
  width:min(420px, calc(100vw - 24px));
  padding:18px;
  border-left:1px solid var(--border);
  background:rgba(15,15,23,.96);
  box-shadow:-24px 0 60px rgba(0,0,0,.36);
  transform:translateX(104%);
  transition:transform var(--t-med);
  z-index:71;
  overflow:auto;
}
.guild-reply-scene-panel.open {
  transform:translateX(0);
}
.guild-reply-scene-head {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  padding-bottom:16px;
  margin-bottom:16px;
  border-bottom:1px solid var(--border);
}
.guild-reply-scene-head h3 {
  margin:0;
  font-size:18px;
}
.guild-reply-scene-head p {
  margin:6px 0 0;
  color:var(--text-3);
  font-size:12px;
  line-height:1.5;
}
.guild-reply-scene-tabs {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:6px;
  padding:4px;
  margin-bottom:14px;
  border:1px solid var(--border);
  border-radius:12px;
  background:rgba(255,255,255,.04);
}
.guild-reply-scene-tabs button {
  min-height:34px;
  border:0;
  border-radius:9px;
  background:transparent;
  color:var(--text-3);
  font:inherit;
  font-size:13px;
  cursor:pointer;
}
.guild-reply-scene-tabs button.active {
  background:rgba(139,109,255,.18);
  color:var(--text);
  box-shadow:inset 0 0 0 1px rgba(139,109,255,.25);
}
.guild-reply-scene-fields {
  display:none;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin:14px 0;
}
.guild-reply-scene-fields.active {
  display:grid;
}
.guild-reply-scene-generation {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
  margin-top:14px;
  padding-top:14px;
  border-top:1px solid var(--border);
}
.guild-reply-scene-generation .text-model-field:last-child {
  grid-column:1 / -1;
}
.guild-reply-scene-actions {
  position:sticky;
  bottom:-18px;
  margin:16px -18px -18px;
  padding:14px 18px 18px;
  border-top:1px solid var(--border);
  background:linear-gradient(180deg, rgba(15,15,23,.86), rgba(15,15,23,.98));
}
.guild-reply-scene-actions .btn {
  width:100%;
  justify-content:center;
}
@media (max-width: 1500px) {
  .guild-reply-shell {
    grid-template-columns:260px minmax(0, 1fr) 280px;
  }
}
@media (max-width: 1180px) {
  .guild-reply-shell {
    grid-template-columns:220px minmax(0, 1fr);
  }
  .guild-reply-result {
    grid-column:1 / -1;
  }
}
@media (max-width: 920px) {
  .guild-reply-shell,
  .guild-reply-context-grid {
    grid-template-columns:1fr;
  }
  .guild-reply-result {
    grid-column:auto;
  }
  .guild-reply-main {
    grid-template-rows:auto minmax(260px, 1fr) auto;
  }
  .guild-reply-title-input {
    font-size:17px;
  }
  .guild-reply-head-actions {
    width:100%;
    justify-content:space-between;
  }
  .guild-reply-toolbar {
    align-items:flex-start;
    flex-direction:column;
  }
  .guild-reply-toolbar-left {
    width:100%;
    flex-wrap:wrap;
  }
  .guild-reply-toolbar-actions {
    margin-left:0;
  }
  .guild-reply-scene-fields {
    grid-template-columns:1fr;
  }
}
.api-key-cell {
  font-family: 'JetBrains Mono', monospace; font-size: 12px;
  background: var(--bg-1); padding: 4px 10px; border-radius: 6px;
  border:1px solid var(--border); display:inline-flex; align-items:center; gap:6px;
}
.api-key-cell .copy { cursor:pointer; opacity:.6; transition: opacity var(--t-fast);}
.api-key-cell .copy:hover { opacity: 1;}

/* 创建 API Key 后一次性展示模态 */
.key-banner {
  background: linear-gradient(135deg, rgba(0,230,195,.14), rgba(124,92,255,.14));
  border: 1px solid var(--accent); border-radius: 14px; padding: 18px;
  margin-bottom: 14px;
}
.key-banner h4 { margin: 0 0 8px; font-size: 14px; color: var(--accent);}
.key-banner code {
  display:block; font-family:'JetBrains Mono', monospace; font-size: 13px;
  background: var(--bg-1); padding: 12px; border-radius: 8px;
  border:1px solid var(--border); margin: 10px 0; word-break: break-all;
}

.upload-zone {
  border:1px dashed var(--border-strong); border-radius: 14px;
  padding: 18px; text-align:center; color: var(--text-2); font-size: 13px;
  background: var(--surface); cursor:pointer; transition: all var(--t-fast);
  display: block;
}
.upload-zone:hover { background: var(--surface-2); border-color: var(--brand); color: var(--text);}
.upload-zone svg { display:block; margin: 0 auto 6px; opacity:.6;}

/* 已上传缩略图卡片 */
.upload-preview {
  position: relative; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--border); background: var(--bg-1);
  display: flex; gap: 12px; padding: 10px; align-items: center;
  /* v18 修复：限制整体高度，防止大图把后续控件挤下去 */
  max-height: 92px;
  box-sizing: border-box;
}
.upload-preview .thumb {
  width: 72px; height: 72px; flex-shrink: 0;
  border-radius: 10px; overflow: hidden; background: var(--bg-2);
  display: grid; place-items: center;
  position: relative;
}
.upload-preview .thumb img,
.upload-preview .thumb video {
  /* v18：图片严格限制在 thumb 容器内，object-fit:cover 保持比例填充 */
  width: 100%; height: 100%; max-width: 100%; max-height: 100%;
  object-fit: cover; display: block;
}
/* v18.10.9 角色卡片：紫色边框 + 角标，避免 broken-image 漏出 */
.upload-preview.is-asset .thumb {
  background: linear-gradient(135deg, #7c5cff22, #ff5cb622);
  border: 1px solid rgba(124, 92, 255, 0.45);
}
.upload-preview .thumb .asset-badge {
  position: absolute; top: 3px; right: 3px;
  width: 18px; height: 18px; border-radius: 6px;
  background: rgba(124, 92, 255, 0.92);
  display: grid; place-items: center;
  font-size: 11px; line-height: 1;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
.upload-preview .info { flex: 1; min-width: 0; overflow: hidden;}
.upload-preview .info .fname { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;}
.upload-preview .info .fmeta { font-size: 11px; color: var(--text-3); margin-top: 4px; display: flex; gap: 10px;}
.upload-preview .actions { display: flex; gap: 6px; flex-shrink: 0;}
.upload-preview .ico-btn {
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); display: grid; place-items: center; cursor: pointer;
  transition: all var(--t-fast);
}
.upload-preview .ico-btn:hover { color: var(--text); border-color: var(--border-strong);}
.upload-preview .ico-btn.danger:hover { color: var(--danger); border-color: var(--danger);}

/* 首尾帧双槽布局 */
.frame-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* v18.10.53 Seedance 模式切换器（首尾帧 / 多模态参考）— 复用 role-switch 样式但做紧凑版 */
.seedance-mode-switch {
  display:grid; grid-template-columns: 1fr 1fr; gap:4px; padding:4px;
  background: var(--surface); border:1px solid var(--border); border-radius: 10px;
  margin-bottom: 12px;
}
.seedance-mode-switch .mode-opt {
  border:0; background:transparent; color: var(--text-2); padding:7px 10px; border-radius:7px;
  font-size:12px; cursor:pointer; transition: all var(--t-fast);
  display:flex; align-items:center; justify-content:center; gap:6px;
}
.seedance-mode-switch .mode-opt.active { background: var(--bg-1); color: var(--text); box-shadow: 0 3px 8px rgba(0,0,0,.16); font-weight:500;}
.seedance-mode-switch .mode-opt .i { width:14px; height:14px; flex-shrink:0; }
.seedance-mode-hint { font-size:11px; color: var(--text-3); margin: -6px 0 12px; }
.frame-slot { min-width: 0; }
.frame-slot .frame-label { font-size: 11px; color: var(--text-2); margin-bottom: 6px; font-weight: 500; }
.frame-slot > div { min-width: 0; }

/* ============================================================
 * v18.10.31 chat-style composer — 增强玻璃质感 + 渐变光晕
 * ============================================================ */
.composer {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.025) 0%, transparent 100%),
    var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 6px 6px 12px;
  transition: all var(--t-fast);
  margin-bottom: 0;
  overflow: hidden;
}
.composer::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
  pointer-events: none;
}
.composer:focus-within {
  border-color: rgba(139,109,255,.55);
  box-shadow: 0 0 0 4px rgba(139,109,255,.12), 0 8px 32px -8px rgba(139,109,255,.3);
}
.composer-prompt {
  width: 100%;
  min-height: 132px;
  max-height: 320px;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 18px 20px 8px !important;
  resize: none !important;
  font-size: 14.5px;
  line-height: 1.65;
  outline: none;
  font-family: inherit;
  display: block;
}
.composer-attach {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 18px 4px;
  margin-top: 4px;
}
.composer-attach:empty { display: none; }
.composer-attach .att-card {
  position: relative;
  width: 64px; height: 64px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-2);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform var(--t-fast), border-color var(--t-fast);
}
.composer-attach .att-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.composer-attach .att-card img,
.composer-attach .att-card video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.composer-attach .att-card .role-tag {
  position: absolute; bottom: 0; left: 0; right: 0;
  font-size: 9.5px; line-height: 1;
  padding: 4px 5px;
  background: linear-gradient(to top, rgba(0,0,0,.78), rgba(0,0,0,0));
  color: #fff;
  text-align: center;
  letter-spacing: .2px;
}
.composer-attach .att-card .x {
  position: absolute; top: 3px; right: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(0,0,0,.62); color: #fff;
  display: none; align-items: center; justify-content: center;
  font-size: 12px; line-height: 1;
}
.composer-attach .att-card:hover .x { display: flex; }
.composer-attach .att-card .x:hover { background: var(--danger); }
.composer-attach .att-card.is-asset { border-color: rgba(124,92,255,.55); }

.composer-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 4px;
  flex-wrap: nowrap;
  min-width: 0;
}
.wallet-quote {
  margin-left: auto;
  min-width: 118px;
  max-width: 210px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-1);
  color: var(--text-2);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 0 1 auto;
}
.wallet-quote.warn {
  color: var(--warn);
  border-color: color-mix(in oklab, var(--warn) 34%, var(--border));
  background: color-mix(in oklab, var(--warn) 10%, var(--bg-1));
}
.wallet-quote.err {
  color: var(--danger);
  border-color: color-mix(in oklab, var(--danger) 36%, var(--border));
  background: color-mix(in oklab, var(--danger) 10%, var(--bg-1));
}
.wallet-quote.loading { color: var(--text-3); }
.composer-toolbar .wallet-quote + .cb-gen-btn { margin-left: 0; }
.cb-btn {
  display: inline-flex; align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  background: var(--bg-1);
  color: var(--text-2);
  border-radius: 999px;
  font-size: 12.5px;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 500;
  height: 36px;
}
.cb-btn:hover {
  color: var(--text);
  border-color: rgba(139,109,255,.4);
  background: rgba(139,109,255,.08);
  transform: translateY(-1px);
}
.cb-btn .i { width: 14px; height: 14px; flex-shrink: 0; opacity: .85; }
/* 窄屏（左面板 < 480px）只显示图标 */
@media (max-width: 1280px) {
  .cb-btn {
    width: 36px; padding: 0; justify-content: center;
    font-size: 0;
  }
  .cb-btn .i { width: 15px; height: 15px; }
}
.cb-gen-btn {
  border-radius: 999px !important;
  padding: 0 22px !important;
  font-size: 13px !important;
  height: 36px !important;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: auto;
  background: var(--grad-1) !important;
  border: 0 !important;
  color: #fff !important;
  box-shadow: 0 4px 16px -4px rgba(139,109,255,.6), 0 1px 0 rgba(255,255,255,.2) inset !important;
  transition: all var(--t-fast);
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
}
.cb-gen-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px -4px rgba(139,109,255,.75), 0 1px 0 rgba(255,255,255,.25) inset !important;
}
.cb-gen-btn:active { transform: translateY(0); }
.cb-gen-btn .i { width: 14px; height: 14px; flex-shrink: 0; }
.composer-count { font-size: 11px; color: var(--text-3); padding: 0 4px; white-space: nowrap; flex-shrink: 0; }

/* ============================================================
 * 配置 chip 行 — 更松弛
 * ============================================================ */
.chip-config-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.studio-left .chip-config-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 0;
  position: relative;
}
.config-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--border);
  background: var(--bg-1);
  border-radius: 999px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--text-2);
  transition: all var(--t-fast);
  min-height: 36px;
  white-space: nowrap;
  flex-shrink: 0;
  position: relative;
}
.studio-left .config-chip {
  width: 100%;
  min-width: 0;
  justify-content: flex-start;
  padding: 9px 12px;
}
.studio-left .config-chip .cc-value {
  flex: 1;
  min-width: 0;
  max-width: none;
}
.studio-left .config-chip .caret { margin-left: auto; }
.config-chip:hover { border-color: var(--border-strong); color: var(--text); background: var(--bg-2); transform: translateY(-1px); }
.config-chip.active {
  border-color: rgba(139,109,255,.5);
  background: linear-gradient(135deg, rgba(139,109,255,.12), rgba(255,109,196,.06));
  color: var(--text);
  box-shadow: 0 0 0 3px rgba(139,109,255,.1);
}
.config-chip .i { width: 13px; height: 13px; flex-shrink: 0; opacity: .7; }
.config-chip .caret { width: 11px; height: 11px; opacity: .5; transition: transform var(--t-fast); }
.config-chip:hover .caret { opacity: .8; }
.config-chip .cc-label { color: var(--text-3); font-size: 12px; }
.config-chip .cc-value {
  color: var(--text); font-weight: 600; font-size: 12.5px;
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ============================================================
 * v18.10.38 chip 独立悬浮 popover — 模型 / 比例 / 参数 各自下拉
 * v18.10.39 popover 高度自适应；v18.10.40 宽度相对父容器，不超画布
 * ============================================================ */
.chip-popover {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;                          /* 让 popover 撑到 chip-config-row 的右边界 */
  z-index: 60;
  width: auto;
  max-width: 100%;                   /* 关键：不超出 chip-config-row（=composer 容器宽度）*/
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(0,0,0,.32), 0 0 0 1px rgba(139,109,255,.08);
  padding: 14px 16px 16px;
  display: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .18s ease, transform .18s ease;
  /* popover 自身 overflow visible 让 cs-menu 浮出可见；超长内容由内部容器自滚 */
  overflow: visible;
}
.chip-popover.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}
/* popover 标题栏统一 */
.chip-popover .cp-head {
  display: flex; align-items: center; gap: 10px;
  margin: -2px 0 12px; padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
}
.chip-popover .cp-title { font-size: 13px; font-weight: 600; color: var(--text); flex-shrink: 0; }
.chip-popover .cp-hint  { font-size: 11.5px; color: var(--text-3); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip-popover .cp-close {
  cursor: pointer; width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px; color: var(--text-3); font-size: 16px; line-height: 1;
  transition: all var(--t-fast); flex-shrink: 0;
}
.chip-popover .cp-close:hover { background: var(--bg-2); color: var(--text); }

/* 三个 popover 内部容器统一栅格 */
/* 模型卡片网格：auto-fill 自适应列数（窄空间自动降到 1 列）；多模型时纵向滚动 */
#popoverModel .model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  max-height: 52vh;
  overflow-y: auto;
  margin: 0 -4px;
  padding: 0 4px 2px;
}
/* 比例 chip 网格：横排，自适应换行 */
#popoverRatio .ar-grid {
  display: flex; flex-wrap: wrap; gap: 8px;
}
/* 参数 grid：自适应 1~2 列 */
#popoverParam .params-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

@media (max-width: 720px) {
  /* 移动端 popover 单列；保持相对父容器 */
  #popoverModel .model-grid { grid-template-columns: 1fr; }
  #popoverParam .params-grid { grid-template-columns: 1fr; }
}

/* ============================================================
 * 配置抽屉 — 大留白（v18.10.38 已弃用，保留 CSS 防止误删兜底）
 * ============================================================ */
.config-drawer {
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-1);
  overflow: hidden;
  transition: border-color var(--t-fast);
}
.config-drawer:hover { border-color: var(--border-strong); }
.config-drawer summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 18px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-2);
  user-select: none;
  transition: background var(--t-fast), color var(--t-fast);
  font-weight: 500;
}
.config-drawer summary::-webkit-details-marker { display: none; }
.config-drawer summary:hover { color: var(--text); background: rgba(255,255,255,0.02); }
.config-drawer summary .i { width: 14px; height: 14px; opacity: .65; }
.config-drawer[open] summary .caret { transform: rotate(180deg); }
.config-drawer[open] summary { border-bottom: 1px solid var(--border); }
.config-drawer summary .caret { transition: transform var(--t-fast); opacity: .55; }
.drawer-section { padding: 16px 18px 18px; }
.drawer-section + .drawer-section { border-top: 1px dashed var(--border); }
.studio-left .config-drawer {
  margin: 0;
  border-radius: 14px;
}
.studio-left .drawer-section { padding: 14px 16px 16px; }
.studio-left .section-acc { margin-top: 0; }

/* highlight 抖动 */
@keyframes drawerPulse {
  0%, 100% { background: transparent; }
  35% { background: rgba(139,109,255,.14); }
}
.drawer-section.pulse { animation: drawerPulse 1.1s ease; }

/* v18：首尾帧槽内部强制小尺寸（覆盖通用 .upload-preview） */
.frame-slots .upload-zone { padding: 12px 8px; min-height: 78px; max-height: 78px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px; font-size:11px; box-sizing: border-box; }
.frame-slots .upload-preview { padding: 6px; gap: 8px; max-height: 76px;}
.frame-slots .upload-preview .thumb { width: 52px; height: 52px; border-radius: 8px;}
.frame-slots .upload-preview .info .fname { font-size: 11px; }
.frame-slots .upload-preview .info .fmeta { font-size: 10px; gap: 6px; margin-top:2px; }
.frame-slots .upload-preview .actions .ico-btn { width: 24px; height: 24px; }
.frame-slots .upload-preview .thumb .asset-badge { width: 14px; height: 14px; font-size: 9px; top: 2px; right: 2px; border-radius: 4px; }

/* v18.10.23 会话历史缩略带 */
#sessionStripRow::-webkit-scrollbar { height: 6px; }
#sessionStripRow::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.session-shot {
  position: relative; flex: 0 0 84px; aspect-ratio: 1/1; border-radius: 10px;
  overflow: hidden; cursor: pointer; border: 2px solid transparent;
  background: var(--bg-2); transition: all var(--t-fast);
}
.session-shot:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.session-shot.active { border-color: var(--brand); box-shadow: 0 4px 14px rgba(124,92,255,0.32); }
.session-shot img, .session-shot video {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.session-shot .ss-tag {
  position: absolute; top: 4px; left: 4px;
  font-size: 9px; padding: 2px 6px; border-radius: 6px;
  background: rgba(0,0,0,0.55); color: #fff; backdrop-filter: blur(4px);
}
.session-shot .ss-status {
  position: absolute; bottom: 4px; right: 4px;
  width: 8px; height: 8px; border-radius: 50%;
}
.session-shot .ss-status.run { background: var(--warn); animation: pulse 1.4s ease-in-out infinite; }
.session-shot .ss-status.fail { background: var(--danger); }
@keyframes pulse { 0%,100% { opacity: 1;} 50% {opacity: .35;} }
.session-shot .ss-x {
  position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(0,0,0,0.55); color: #fff; font-size: 11px;
  display: none; align-items: center; justify-content: center;
  line-height: 1; cursor: pointer;
}
.session-shot:hover .ss-x { display: flex; }
.session-shot .ss-x:hover { background: var(--danger); }

/* 多模态参考网格 */
.multi-ref-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.multi-ref-cell {
  position: relative; aspect-ratio: 1/1; border-radius: 10px; overflow: hidden;
  background-size: cover; background-position: center;
  border: 1px solid var(--border);
}
.multi-ref-cell.add {
  display: grid; place-items: center; cursor: pointer;
  border-style: dashed; color: var(--text-3); transition: all var(--t-fast);
}
.multi-ref-cell.add:hover { border-color: var(--brand); color: var(--brand); }
.multi-ref-cell .x {
  position:absolute; top:4px; right:4px; width:20px; height:20px;
  border-radius:50%; background: rgba(0,0,0,.6); color:#fff;
  display:grid; place-items:center; cursor:pointer; font-size:11px;
}
.multi-ref-cell .x:hover { background: var(--danger);}
/* v18.10.4：asset:// 引用的角色，紫色边框 + 角标 */
.multi-ref-cell.asset {
  border: 2px solid var(--brand);
  box-shadow: 0 0 0 1px rgba(124,92,255,.15);
}
.multi-ref-cell.asset::before {
  content: '📦'; position: absolute; bottom: 4px; left: 4px;
  background: var(--brand); color: #fff;
  font-size: 10px; padding: 1px 6px; border-radius: 6px;
  pointer-events: none; line-height: 1.4;
}

/* v18.10.5 图片来源选择器卡片 */
.img-source-pane .src-card {
  position: relative; aspect-ratio: 1/1; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border); cursor: pointer;
  background: var(--bg-2) center/cover no-repeat;
  transition: transform var(--t-fast), border-color var(--t-fast);
}
.img-source-pane .src-card:hover { transform: translateY(-2px); border-color: var(--brand); }
.img-source-pane .src-card .src-tag {
  position: absolute; top: 6px; left: 6px;
  font-size: 10px; padding: 2px 6px; border-radius: 5px;
  background: rgba(0,0,0,.55); color: #fff; backdrop-filter: blur(6px);
}
.img-source-pane .src-card .src-prompt {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 6px 8px; font-size: 11px; color:#fff; line-height: 1.3;
  background: linear-gradient(transparent, rgba(0,0,0,.75));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.img-source-pane .empty-state {
  grid-column: 1/-1; padding: 50px 20px; text-align: center;
  color: var(--text-3); font-size: 12px;
}

/* ============== Canvas (Right side) — v18.10.72 与左栏首屏对齐 ============== */
.canvas { padding: 24px; display:flex; flex-direction:column; min-height: 720px;}
.studio-canvas {
  min-height: clamp(560px, calc(100vh - 190px), 760px);
  height: 100%;
  padding: 20px;
  gap: 14px;
}
.canvas-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 40px;
  margin-bottom: 0;
}
.canvas-head h3 {
  margin: 0;
  min-width: 0;
}
.canvas-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.canvas-empty {
  flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
  border:1px dashed var(--border);
  border-radius: var(--r-md);
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(139,109,255,.12), transparent 65%),
    radial-gradient(50% 50% at 100% 100%, rgba(255,109,196,.06), transparent 60%),
    radial-gradient(50% 50% at 0% 100%, rgba(0,230,195,.06), transparent 60%),
    var(--bg-1);
  color: var(--text-2);
  padding: 80px 30px;
  position: relative;
  overflow: hidden;
}
.canvas-empty::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(139,109,255,.4), transparent);
}
.canvas-empty h4 { margin: 18px 0 8px; color: var(--text); font-size: 18px; font-weight: 600;}
.canvas-empty p { margin:0; font-size:13px; line-height: 1.6; color: var(--text-3);}
.canvas-empty svg { color: var(--brand); opacity: .6; }

.gallery { display:grid; grid-template-columns: repeat(auto-fill, minmax(240px,1fr)); gap: 16px; }
.shot {
  position:relative; aspect-ratio: var(--ar, 1/1); border-radius: 14px; overflow:hidden;
  border:1px solid var(--border); background: var(--bg-2); cursor: pointer;
  transition: transform var(--t-mid);
  max-height: 70vh;
  width: 100%;
}
.shot:hover { transform: translateY(-4px); }
.shot img, .shot video {
  display:block;
  position:absolute; inset:0; width:100%; height:100%; object-fit: cover;
  background: var(--bg-2);
}
/* Studio 主画廊单图任务下，使用 contain 确保完整显示不裁切 */
#gallery.single .shot img,
#gallery.single .shot video { object-fit: contain; }

/* 视频缩略图上的播放图标 */
.play-overlay {
  position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
  width:50px; height:50px; border-radius:50%;
  background:rgba(0,0,0,.55); display:grid; place-items:center;
  backdrop-filter:blur(8px);
  pointer-events:none;
}
.play-overlay .i { color:#fff; width:20px; height:20px; }
/* 画廊：每行高度由 cell 自身比例决定，避免 stretch 拉伸 */
.gallery { align-items: start; }
.shot::after {
  content:""; position:absolute; inset:0;
  background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.65) 100%);
  opacity:0; transition: opacity var(--t-mid);
}
.shot:hover::after { opacity:1; }
.shot .meta {
  position:absolute; left:10px; right:10px; bottom:10px; color:#fff; font-size:11px;
  opacity:0; transform: translateY(6px); transition: all var(--t-mid);
  display:flex; align-items:center; justify-content:space-between;
}
.shot:hover .meta { opacity:1; transform:none;}
.shot .tag {
  position:absolute; top:8px; left:8px; font-size:10px; padding:3px 7px; border-radius: 6px;
  background: rgba(0,0,0,.5); backdrop-filter: blur(6px); color:#fff;
}
.shot .tag .wallet-pill {
  min-height: 18px;
  max-width: 92px;
  padding: 2px 5px;
  font-size: 9px;
  border-radius: 6px;
}

/* v18.2 卡片右上角删除按钮（hover 显示） */
.shot .x-btn {
  position: absolute; top: 8px; right: 8px;
  width: 26px; height: 26px; border-radius: 7px;
  display: none; place-items: center; cursor: pointer;
  background: rgba(0,0,0,.55); border: 1px solid rgba(255,255,255,.15);
  color: #fff; backdrop-filter: blur(6px); z-index: 2;
  transition: background var(--t-fast), transform var(--t-fast);
}
.shot:hover .x-btn { display: grid; }
.shot .x-btn:hover { background: var(--danger); transform: scale(1.1); }
.shot .x-btn svg { width: 13px; height: 13px;}

/* v18.2 多选模式 */
.shot.selectable .x-btn { display: none !important; }
.shot.selectable {
  cursor: pointer;
}
.shot.selectable .sel-tick {
  position: absolute; top: 8px; right: 8px;
  width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.7);
  background: rgba(0,0,0,.4); backdrop-filter: blur(6px);
  display: grid; place-items: center; z-index: 2; transition: all var(--t-fast);
}
.shot.selectable.selected {
  outline: 3px solid var(--brand); outline-offset: 2px;
  transform: translateY(-2px);
}
.shot.selectable.selected .sel-tick {
  background: var(--brand); border-color: var(--brand);
}
.shot.selectable.selected .sel-tick::after {
  content: ''; width: 10px; height: 5px;
  border-left: 2.5px solid #fff; border-bottom: 2.5px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}

/* synthesized covers */
.cover {
  position:absolute; inset:0; display:grid; place-items:center; color:#fff; font-weight:600; font-size: 15px; letter-spacing:.5px;
  filter: saturate(115%);
}
.c1 { background: radial-gradient(90% 60% at 30% 30%, #ffd66e 0%, #ff5cb6 45%, #6a3cff 100%); }
.c2 { background: radial-gradient(80% 80% at 70% 30%, #00e6c3 0%, #2c5cff 60%, #0a0a18 100%); }
.c3 { background: linear-gradient(135deg, #1a1230 0%, #6a3cff 50%, #ff5cb6 100%); }
.c4 { background: radial-gradient(60% 60% at 50% 70%, #ffb547 0%, #ff5c7a 45%, #2a0a3a 100%); }
.c5 { background: linear-gradient(160deg, #00e6c3 0%, #0a0a18 60%, #ff5cb6 100%); }
.c6 { background: radial-gradient(70% 70% at 30% 70%, #c2ff80 0%, #1a8a6e 60%, #061018 100%); }
.c7 { background: linear-gradient(140deg, #ff9f5c 0%, #ff5c7a 50%, #6a3cff 100%); }
.c8 { background: radial-gradient(75% 75% at 70% 30%, #fff 0%, #c0c5ff 35%, #6a3cff 100%); }
.cover svg { position:absolute; opacity:.3; mix-blend-mode: overlay;}

/* progress block */
.progress-card {
  display:flex; align-items:center; gap: 14px; padding: 14px 16px; margin-bottom: 16px;
  border-radius: 14px; background: var(--surface-2); border:1px solid var(--border);
}
.spinner {
  width:24px;height:24px;border-radius:50%;
  background: conic-gradient(from 0deg, var(--brand), var(--brand-2), var(--accent), var(--brand));
  -webkit-mask: radial-gradient(circle at center, transparent 8px, #000 9px);
          mask: radial-gradient(circle at center, transparent 8px, #000 9px);
  animation: spin 1.1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg);} }
.progress-bar { flex:1; height:6px; background: var(--bg-1); border-radius:99px; overflow:hidden;}
.progress-bar > div { height:100%; width:0; background: var(--grad-1); transition: width .4s ease;}

/* ============== Admin ============== */
.kpi-row { display:grid; grid-template-columns: repeat(4,1fr); gap:16px; margin-bottom: 22px;}
.kpi { padding: 18px; border-radius: var(--r-md); position: relative; overflow: hidden;}
.kpi .label { margin: 0 0 8px; font-size:12px; color: var(--text-2); text-transform: uppercase; letter-spacing:.1em;}
.kpi .value { font-size: 26px; font-weight: 600; letter-spacing: -.5px;}
.kpi .delta { font-size: 12px; color: var(--accent); margin-top: 6px; display: inline-flex; gap:4px; align-items:center;}
.kpi .delta.down { color: var(--danger); }
.kpi::after {
  content:""; position:absolute; right:-30%; top:-50%; width: 220px; height: 220px;
  background: var(--grad-1); filter: blur(60px); opacity:.18; border-radius:50%;
}

.grid-2 { display:grid; grid-template-columns: 1.6fr 1fr; gap:18px; margin-bottom: 22px;}
.chart-box { padding: 20px; height: 320px;}
.chart-box h3 { margin: 0 0 6px; font-size:14px;}
.chart-box .sub { color: var(--text-2); font-size:12px; margin-bottom: 12px;}
.chart-box canvas { max-height: 240px;}

.table-wrap { padding: 0; overflow:hidden;}
table { width:100%; border-collapse: collapse; font-size:13px;}
thead th { text-align:left; font-weight:500; color: var(--text-3); font-size:11px; text-transform: uppercase; letter-spacing: .12em; padding: 14px 18px; border-bottom: 1px solid var(--border);}
tbody td { padding: 14px 18px; border-bottom: 1px solid var(--border); color: var(--text);}
tbody tr:last-child td { border-bottom:0;}
tbody tr:hover { background: var(--surface);}
.badge {
  display:inline-flex; align-items:center; gap:6px;
  padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight:500;
}
.badge.ok { background: rgba(0,230,195,.12); color: var(--accent);}
.badge.warn { background: rgba(255,181,71,.12); color: var(--warn);}
.badge.off { background: rgba(255,92,122,.12); color: var(--danger);}
.row-actions a { color: var(--text-2); margin-right: 12px; cursor:pointer;}
.row-actions a:hover { color: var(--text);}
.t-head { display:flex; align-items:center; justify-content:space-between; padding: 18px 18px 12px;}
.t-head h3 { margin:0; font-size:14px;}
.search {
  display:flex; align-items:center; gap:8px; padding: 7px 12px;
  background: var(--bg-1); border:1px solid var(--border); border-radius: 10px; color: var(--text-2); font-size:12px;
}
.search input { background:transparent; border:0; outline:none; color: var(--text); font-size: 13px; width: 180px;}

.signup-admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 16px;
  margin-bottom: 18px;
}
.signup-settings-panel,
.signup-latest {
  padding: 18px;
  min-width: 0;
}
.signup-settings-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.signup-settings-main > div {
  min-width: 0;
}
.signup-settings-main h3,
.signup-latest-title {
  margin: 0 0 6px;
  font-size: 14px;
}
.signup-settings-main .sub {
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.signup-latest {
  min-height: 94px;
  color: var(--text-2);
  overflow: hidden;
}
.signup-latest:empty::before {
  content: "创建邀请后将在这里显示一次性链接和明文 token";
  display: block;
  color: var(--text-3);
  font-size: 11px;
  line-height: 1.45;
}
.signup-latest label {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.4;
  min-width: 0;
}
.signup-latest input,
.signup-form-row input,
.signup-form-row select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-1);
  color: var(--text);
  font-size: 13px;
  outline: none;
}
.signup-latest input {
  padding: 9px 10px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  text-overflow: ellipsis;
}
.signup-form-row {
  display: grid;
  grid-template-columns: minmax(96px, .7fr) minmax(96px, .7fr) minmax(180px, 1.3fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 0 18px 16px;
}
.signup-form-row-compact {
  grid-template-columns: minmax(160px, 1fr) minmax(120px, .7fr) minmax(150px, .8fr) minmax(180px, 1fr) auto;
}
.signup-form-row label {
  display: grid;
  gap: 6px;
  color: var(--text-2);
  font-size: 11px;
  line-height: 1.4;
  min-width: 0;
}
.signup-form-row input,
.signup-form-row select {
  height: 38px;
  padding: 0 10px;
}
.signup-code {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--bg-1);
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.35;
}
.signup-rules,
.signup-invitations,
.signup-audit {
  margin-bottom: 18px;
}
.signup-rules.table-wrap,
.signup-invitations.table-wrap,
.signup-audit.table-wrap {
  overflow-x: auto;
}
.view-admin-signup .t-head {
  gap: 12px;
}
.view-admin-signup .t-head .sub {
  font-size: 11px;
  line-height: 1.4;
  text-align: right;
  overflow-wrap: anywhere;
}
.view-admin-signup table {
  min-width: 720px;
  table-layout: fixed;
}
.view-admin-signup thead th,
.view-admin-signup tbody td {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.view-admin-signup tbody td {
  line-height: 1.45;
  vertical-align: top;
}
.view-admin-signup .row-actions {
  white-space: nowrap;
}

.permission-modal {
  max-width: 760px;
  width: min(94vw, 760px);
  max-height: 88vh;
  overflow: auto;
  padding: 24px;
  border-radius: 16px;
}
.permission-modal h3 {
  margin: 0 0 4px;
  font-size: 16px;
}
.permission-sub {
  margin-bottom: 18px;
  color: var(--text-2);
  font-size: 12px;
}
.permission-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.permission-title {
  margin-bottom: 10px;
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}
.permission-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.permission-grid-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.permission-grid label,
.permission-scope-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-1);
  font-size: 12px;
}
.permission-scope-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.permission-scope-row select {
  min-width: 0;
  flex: 1;
  height: 30px;
}
.permission-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

@media (max-width: 1100px) {
  .signup-admin-layout {
    grid-template-columns: 1fr;
  }
  .signup-form-row,
  .signup-form-row-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .signup-form-row .btn {
    width: 100%;
  }
  .permission-grid,
  .permission-grid-actions,
  .permission-scope-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .signup-settings-main {
    align-items: flex-start;
  }
  .signup-form-row,
  .signup-form-row-compact {
    grid-template-columns: 1fr;
  }
}
/* Toast */
.toast {
  position: fixed; left:50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  padding: 12px 18px; border-radius: 12px; background: var(--bg-2); border:1px solid var(--border);
  color: var(--text); font-size:13px; opacity:0; pointer-events:none;
  /* v18.10.62 z-index 提到 9999 — toast 要永远盖在所有 modal/picker/popover 上面，
     否则在弹窗里上传 / 操作时反馈消息条被 mask 遮住，用户以为没反应。 */
  box-shadow: var(--shadow-2); z-index: 9999; transition: all .3s var(--t-mid);
  display:flex; align-items:center; gap:10px;
}
.toast.show { opacity:1; transform: translateX(-50%) translateY(0); pointer-events:auto;}

/* Modal */
.modal-mask { position: fixed; inset:0; background: rgba(0,0,0,.6); backdrop-filter: blur(8px); z-index:80; display:none; align-items:center; justify-content:center; padding:24px;}
.modal-mask.show { display:flex; animation: fadeIn .25s ease;}
/* v18.10.10 嵌套 picker / confirm 层级提升 — 当从某 modal 内再触发时，必须盖在源 modal 之上 */
/* 一级嵌套（图片来源 picker / 角色注册进度）：120 */
#imgSourceMask { z-index: 120; }
/* v18.10.61 注册进度 modal 必须盖在所有其它对话框之上，否则会被 picker / prompt / 收集图弹窗压在底下 */
#assetRegMask { z-index: 200; }
/* 顶层（选项 picker / 确认弹窗 / 输入弹窗）—— 它们可能从一级嵌套里再被触发，必须更高 */
#optionPickerMask, #confirmMask, #promptMask { z-index: 160; }

/* v18.10 角色卡片 */
.asset-card {
  position: relative;
  border-radius: 14px; overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: default;
  transition: transform var(--t-fast), border-color var(--t-fast);
  display:flex; flex-direction: column;
}
.asset-card:hover { transform: translateY(-3px); border-color: var(--brand); }
.asset-card .ac-thumb {
  aspect-ratio: 1/1;
  background: var(--bg-2) center/cover no-repeat;
  position: relative;
}
.asset-card .ac-thumb img { width:100%; height:100%; object-fit: cover; display:block; }
.asset-card .ac-status {
  position: absolute; top: 8px; left: 8px;
  padding: 3px 8px; border-radius: 6px;
  font-size: 10px; font-weight: 500; color:#fff;
  backdrop-filter: blur(6px);
}
.asset-card .ac-status.WAIT,
.asset-card .ac-status.RUN  { background: rgba(255,181,71,.85); }
.asset-card .ac-status.DONE { background: rgba(0,200,150,.85); }
.asset-card .ac-status.FAIL { background: rgba(255,80,90,.85); }
.asset-card .ac-actions {
  position: absolute; top: 8px; right: 8px;
  display: none; gap: 4px;
}
.asset-card:hover .ac-actions { display: flex; }
.asset-card .ac-act {
  width: 26px; height: 26px; border-radius: 7px;
  background: rgba(0,0,0,.6); border: 1px solid rgba(255,255,255,.18);
  color: #fff; display:grid; place-items:center; cursor: pointer;
  transition: all var(--t-fast);
}
.asset-card .ac-act:hover { background: var(--brand); border-color: var(--brand); }
.asset-card .ac-act.danger:hover { background: var(--danger); border-color: var(--danger); }
.asset-card .ac-act svg { width: 13px; height: 13px;}
.asset-card .ac-info {
  padding: 10px 12px; display:flex; flex-direction: column; gap: 4px;
}
.asset-card .ac-name { font-size: 13px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.asset-card .ac-id {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  color: var(--text-3); display:flex; align-items:center; gap:6px;
}
.asset-card .ac-id .copy { cursor:pointer; opacity:.6; transition: opacity var(--t-fast); }
.asset-card .ac-id .copy:hover { opacity: 1; }
.asset-card .ac-meta {
  font-size: 11px; color: var(--text-3);
  display:flex; justify-content: space-between;
}
.asset-card .ac-err {
  font-size: 11px; color: var(--danger); padding: 0 12px 10px; line-height: 1.4;
}

@keyframes fadeIn { from {opacity:0;} to {opacity:1;}}
.modal {
  width: min(720px, 100%); padding: 0; overflow:hidden; max-height: 88vh; display:flex; flex-direction: column;
}
.modal header { padding: 18px 22px; border-bottom: 1px solid var(--border); display:flex; justify-content:space-between; align-items:center;}
.modal header h3 { margin:0; font-size:15px;}
.modal .body { padding: 18px 22px; overflow:auto; }
.modal .preview {
  border-radius: 12px; position: relative; overflow:hidden; margin-bottom: 14px;
  background: var(--bg-2);
  display: flex; align-items: center; justify-content: center;
  max-height: 60vh; min-height: 200px;
}
.modal .preview img,
.modal .preview video {
  width: 100%; height: auto; max-height: 60vh; object-fit: contain;
  display: block;
}
/* coverHTML 没 url 时是 absolute 撑开，需要给个最小高度 */
.modal .preview > .cover { position: relative; width: 100%; aspect-ratio: 16/10; }
.modal .meta-grid { display:grid; grid-template-columns: 1fr 1fr; gap:10px; font-size:12px;}
.modal .meta-grid .item { padding: 10px 12px; background: var(--bg-1); border:1px solid var(--border); border-radius:10px;}
.modal .meta-grid .item .k { color: var(--text-3); font-size: 11px;}

/* Switch */
.switch {
  position: relative;
  width: 36px;
  height: 20px;
  flex: 0 0 auto;
  cursor: pointer;
  display: inline-block;
}
.switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  margin: 0;
  z-index: 1;
}
.switch span {
  position: absolute;
  inset: 0;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.switch span::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-2);
  transition: left var(--t-fast), background var(--t-fast);
}
.switch input:checked + span,
.switch.on span {
  background: var(--brand);
  border-color: transparent;
}
.switch input:checked + span::after,
.switch.on span::after {
  left: 18px;
  background: #fff;
}
.switch input:focus-visible + span {
  box-shadow: 0 0 0 4px rgba(139,109,255,.18);
}
/* Responsive */
@media (max-width: 1280px){
  .studio { grid-template-columns: minmax(400px, 440px) minmax(0, 1fr); gap: 22px; }
}
@media (max-width: 1100px){
  .studio-head { margin-bottom: 18px; }
  .studio { grid-template-columns: 1fr;}
  .studio-canvas { min-height: 560px; }
  .grid-2 { grid-template-columns: 1fr;}
  .kpi-row { grid-template-columns: repeat(2,1fr);}
  .wallet-admin-grid { grid-template-columns: 1fr; }
  .wallet-admin-actions { grid-template-columns: 1fr; }
}
@media (max-width: 760px){
  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(100vh - 65px);
    overflow: visible;
  }
  .sidebar { display:none;}
  .nav-tabs { display:none;}
  .main {
    padding: 18px;
    min-height: auto;
    overflow-y: visible;
    overscroll-behavior: auto;
  }
  .wallet-admin-kpis { grid-template-columns: 1fr;}
  .wallet-admin-grid { gap: 14px; }
  .wallet-admin-panel { padding: 14px; }
  .wallet-admin-form { grid-template-columns: 1fr; }
  .wallet-admin-form button { width: 100%; }
  .wallet-pricing-form { grid-template-columns: 1fr; }
  .wallet-pricing-actions .btn { width: 100%; }
  .wallet-admin-tools,
  .wallet-admin-filters {
    align-items: stretch;
    justify-content: stretch;
  }
  .wallet-admin-control,
  .wallet-admin-control-wide,
  .wallet-admin-tools .search {
    width: 100%;
    min-width: 0;
  }
  .wallet-admin-tools .search input { width: 100%; }
  .wallet-ledger-modal {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
  }
  .wallet-ledger-modal header,
  .wallet-ledger-body {
    padding-left: 14px;
    padding-right: 14px;
  }
  .wallet-ledger-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .studio-head {
    align-items: stretch;
  }
  .studio-head-main,
  .studio-head-control-row,
  .studio-head-actions { width: 100%; }
  .studio-head-control-row {
    flex-direction: column;
    align-items: stretch;
  }
  .studio-mode-tabs { width: 100%; }
  .studio-head-actions { justify-content: stretch; }
  .studio-head-actions .btn { flex: 1 1 0; min-width: 0; }
  .panel.studio-left,
  .panel.canvas { padding: 16px; }
  .studio-left .chip-config-row { grid-template-columns: 1fr; }
  .canvas-head { align-items: flex-start; }
}
/* Icon helper */
.i { width:16px; height:16px; stroke:currentColor; fill:none; stroke-width:1.6; stroke-linecap:round; stroke-linejoin:round;}
