/* ==========================================================================
   QXAI — interface system
   ========================================================================== */
:root {
  --bg: #f3f6fb;
  --bg-elevated: #eef3f9;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-muted: #f1f5f9;
  --text: #0b1424;
  --text-soft: #334155;
  --muted: #66758c;
  --faint: #94a3b8;
  --line: #e3e9f2;
  --line-strong: #cbd5e1;
  --brand: #2f5fe8;
  --brand-strong: #214bc4;
  --brand-soft: #edf3ff;
  --brand-ink: #ffffff;
  --accent: #0f9f92;
  --accent-soft: #e8faf6;
  --danger: #d92d4e;
  --danger-soft: #fff0f3;
  --warning: #b7791f;
  --warning-soft: #fff8e6;
  --success: #087f5b;
  --success-soft: #e9f9f2;
  --shadow-xs: 0 1px 2px rgba(16, 30, 54, .04);
  --shadow-sm: 0 1px 3px rgba(16, 30, 54, .05), 0 8px 24px -16px rgba(16, 30, 54, .16);
  --shadow-md: 0 12px 40px -18px rgba(16, 30, 54, .24);
  --shadow-lg: 0 30px 70px -30px rgba(16, 30, 54, .32);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --sidebar: 270px;
  --header: 68px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
html.dark {
  --bg: #080d16;
  --bg-elevated: #0b1220;
  --surface: #0e1726;
  --surface-soft: #111c2d;
  --surface-muted: #162236;
  --text: #ecf2fb;
  --text-soft: #c4d0e2;
  --muted: #8d9db4;
  --faint: #62738b;
  --line: #1c2a3e;
  --line-strong: #2a3b54;
  --brand: #6b8cff;
  --brand-strong: #8aa3ff;
  --brand-soft: rgba(84, 116, 255, .13);
  --brand-ink: #071120;
  --accent: #43d6c5;
  --accent-soft: rgba(67, 214, 197, .1);
  --danger: #ff6b85;
  --danger-soft: rgba(255, 107, 133, .09);
  --warning: #e5b567;
  --warning-soft: rgba(229, 181, 103, .09);
  --success: #55d6a7;
  --success-soft: rgba(85, 214, 167, .09);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .2);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, .22), 0 12px 28px -18px rgba(0, 0, 0, .5);
  --shadow-md: 0 18px 48px -22px rgba(0, 0, 0, .58);
  --shadow-lg: 0 36px 80px -34px rgba(0, 0, 0, .8);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: light; }
html.dark { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body.no-scroll { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
code, pre { font-family: var(--mono); }
::selection { background: color-mix(in srgb, var(--brand) 24%, transparent); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon-lg { width: 22px; height: 22px; }
.icon-sm { width: 15px; height: 15px; }
.icon-xl { width: 28px; height: 28px; }
.icon-brand { fill: currentColor; stroke: none; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes pulseSoft { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
.fade-up { animation: fadeUp .55s cubic-bezier(.22,1,.36,1) both; }
.font-mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.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; }

/* ---------- primitives ---------- */
.container { width: min(1220px, calc(100% - 48px)); margin-inline: auto; }
.container-narrow { width: min(920px, calc(100% - 48px)); margin-inline: auto; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.card-pad { padding: 24px; }
.panel { background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius); }
.divider { height: 1px; background: var(--line); border: 0; margin: 20px 0; }
.btn {
  --btn-bg: var(--surface);
  --btn-color: var(--text);
  --btn-border: var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border: 1px solid var(--btn-border); border-radius: 11px;
  background: var(--btn-bg); color: var(--btn-color); font-size: 13.5px; font-weight: 600;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }
.btn:disabled { cursor: not-allowed; opacity: .55; transform: none; box-shadow: none; }
.btn-primary { --btn-bg: var(--brand); --btn-color: #fff; --btn-border: transparent; box-shadow: 0 8px 20px -12px color-mix(in srgb, var(--brand) 80%, transparent); }
.btn-primary:hover { --btn-bg: var(--brand-strong); }
.btn-dark { --btn-bg: var(--text); --btn-color: var(--surface); --btn-border: transparent; }
.btn-soft { --btn-bg: var(--brand-soft); --btn-color: var(--brand); --btn-border: transparent; }
.btn-ghost { --btn-bg: transparent; --btn-border: transparent; --btn-color: var(--muted); }
.btn-ghost:hover { --btn-bg: var(--surface-muted); --btn-color: var(--text); }
.btn-danger { --btn-bg: var(--danger-soft); --btn-color: var(--danger); --btn-border: transparent; }
.btn-sm { min-height: 32px; padding: 0 11px; border-radius: 9px; font-size: 12.5px; }
.btn-lg { min-height: 50px; padding: 0 24px; border-radius: 13px; font-size: 15px; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn-block { width: 100%; }
.btn .icon { width: 17px; height: 17px; }
.btn.loading .icon { animation: spin 1s linear infinite; }
.field { display: flex; flex-direction: column; gap: 7px; }
.label { color: var(--text-soft); font-size: 12.5px; font-weight: 600; letter-spacing: .01em; }
.hint { color: var(--faint); font-size: 11.5px; line-height: 1.55; }
.input, .select, .textarea {
  width: 100%; min-height: 42px; border: 1px solid var(--line-strong); border-radius: 11px;
  background: var(--surface); padding: 0 13px; color: var(--text); font-size: 13.5px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.textarea { min-height: 110px; padding: 11px 13px; resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 12%, transparent); }
.input:disabled, .select:disabled { background: var(--surface-muted); color: var(--muted); }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.input-group { position: relative; }
.input-group .input { padding-right: 44px; }
.input-group .group-btn { position: absolute; right: 5px; top: 5px; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); display: grid; place-items: center; }
.input-group .group-btn:hover { background: var(--surface-muted); color: var(--text); }
.check { display: flex; gap: 9px; align-items: flex-start; color: var(--text-soft); font-size: 13px; }
.check input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--brand); }
.check-group { display: flex; flex-wrap: wrap; gap: 9px 18px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); }
.check-group .check { align-items: center; gap: 7px; font-size: 12.5px; }
.check-group .check input { margin-top: 0; }
.badge { display: inline-flex; align-items: center; gap: 5px; min-height: 23px; padding: 0 8px; border-radius: 999px; background: var(--surface-muted); color: var(--muted); font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge .icon { width: 12px; height: 12px; }
.badge-brand { background: var(--brand-soft); color: var(--brand); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.avatar { display: inline-grid; place-items: center; vertical-align: middle; width: 38px; height: 38px; border-radius: 12px; overflow: hidden; flex: none; background: var(--surface-muted); }
.avatar svg { width: 100%; height: 100%; }
.avatar-sm { width: 28px; height: 28px; border-radius: 9px; }
.avatar-lg { width: 74px; height: 74px; border-radius: 22px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--brand); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.eyebrow::before { content: ""; width: 20px; height: 1px; background: currentColor; opacity: .55; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.section-head h2 { font-size: clamp(24px, 3vw, 36px); letter-spacing: -.035em; line-height: 1.16; }
.section-head p { color: var(--muted); margin-top: 7px; max-width: 620px; }

/* ---------- theme toggle / icon button ---------- */
.theme-toggle, .icon-btn { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--muted); display: inline-grid; place-items: center; transition: .18s; }
.theme-toggle:hover, .icon-btn:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-soft); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn.danger:hover { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.theme-toggle .sun { display: none; }
html.dark .theme-toggle .sun { display: block; }
html.dark .theme-toggle .moon { display: none; }

/* ---------- toasts / modal ---------- */
.toast-root { position: fixed; right: 20px; top: 20px; z-index: 200; display: flex; flex-direction: column; gap: 9px; pointer-events: none; }
.toast { pointer-events: auto; min-width: 240px; max-width: 360px; padding: 12px 15px; border-radius: 12px; background: var(--text); color: var(--surface); box-shadow: var(--shadow-lg); font-size: 13px; display: flex; gap: 9px; align-items: flex-start; animation: fadeUp .28s ease both; }
.toast .icon { margin-top: 1px; }
.toast.error { background: var(--danger); color: #fff; }
.toast.success { background: var(--success); color: #fff; }
.modal-root { position: fixed; inset: 0; z-index: 180; display: none; align-items: center; justify-content: center; padding: 18px; }
.modal-root.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(5, 11, 21, .58); backdrop-filter: blur(5px); animation: fadeIn .2s ease; }
.modal { position: relative; width: min(540px, 100%); max-height: min(88vh, 860px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 26px; animation: fadeUp .3s cubic-bezier(.22,1,.36,1); }
.modal.wide { width: min(820px, 100%); }
.modal.xwide { width: min(1040px, 100%); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.modal-head h3 { font-size: 19px; letter-spacing: -.02em; }
.modal-head p { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal .form-grid { margin-top: 18px; }
.drawer-root { position: fixed; inset: 0; z-index: 170; display: none; }
.drawer-root.open { display: block; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(640px, 100%); background: var(--surface); border-left: 1px solid var(--line); box-shadow: var(--shadow-lg); overflow: auto; padding: 28px; animation: slideRight .32s cubic-bezier(.22,1,.36,1); }
@keyframes slideRight { from { transform: translateX(40px); opacity: .6; } to { transform: none; opacity: 1; } }

/* ---------- tables ---------- */
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.table { width: 100%; border-collapse: collapse; min-width: 700px; }
.table th { text-align: left; padding: 11px 15px; color: var(--faint); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; background: var(--surface-soft); border-bottom: 1px solid var(--line); white-space: nowrap; font-weight: 700; }
.table td { padding: 13px 15px; border-bottom: 1px solid var(--line); font-size: 12.8px; color: var(--text-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--surface-soft); }
.table .strong { color: var(--text); font-weight: 600; }
.table-actions { display: flex; align-items: center; gap: 5px; justify-content: flex-end; }
.empty { padding: 54px 24px; text-align: center; color: var(--muted); }
.empty .empty-icon { width: 52px; height: 52px; margin: 0 auto 14px; border-radius: 16px; background: var(--surface-muted); display: grid; place-items: center; color: var(--faint); }
.empty h3 { color: var(--text); font-size: 15px; }
.empty p { font-size: 12.5px; margin-top: 5px; }
.skeleton { border-radius: 10px; background: linear-gradient(90deg, var(--surface-muted) 25%, var(--surface-soft) 50%, var(--surface-muted) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner-lg { width: 28px; height: 28px; border: 2px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }

/* ---------- landing ---------- */
.site-body { background: var(--bg); overflow-x: hidden; }
.site-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.site-bg::before { content: ""; position: absolute; width: 720px; height: 720px; top: -360px; right: -180px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--brand) 15%, transparent), transparent 68%); }
.site-bg::after { content: ""; position: absolute; width: 600px; height: 600px; bottom: -300px; left: -260px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 13%, transparent), transparent 68%); }
.site-header { position: sticky; top: 0; z-index: 90; border-bottom: 1px solid color-mix(in srgb, var(--line) 75%, transparent); background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(18px); }
.nav { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 750; letter-spacing: -.02em; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(145deg, var(--brand), var(--accent)); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--brand) 70%, transparent); }
.brand-mark .icon { width: 23px; height: 23px; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.brand-text { font-size: 16px; }
.brand-sub { display: block; color: var(--faint); font-size: 9px; letter-spacing: .18em; font-weight: 600; margin-top: -2px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link { padding: 7px 11px; border-radius: 8px; color: var(--muted); font-size: 12.5px; font-weight: 550; transition: .18s; }
.nav-link:hover { color: var(--text); background: var(--surface-muted); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.nav-user { display: inline-flex; align-items: center; gap: 7px; padding: 4px 6px 4px 4px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); }
.nav-user .avatar { width: 28px; height: 28px; border-radius: 8px; }
.mobile-toggle { display: none; }
.hero { padding: clamp(56px, 8vw, 104px) 0 clamp(52px, 7vw, 88px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(360px, .74fr); align-items: center; gap: clamp(40px, 6vw, 92px); }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 72%, transparent); padding: 6px 11px 6px 7px; border-radius: 999px; color: var(--muted); font-size: 11.5px; font-weight: 600; box-shadow: var(--shadow-xs); }
.hero-badge .pill { border-radius: 999px; background: var(--brand-soft); color: var(--brand); padding: 3px 8px; font-size: 9px; letter-spacing: .1em; }
.hero h1 { margin-top: 23px; font-size: clamp(42px, 6.4vw, 78px); line-height: .98; letter-spacing: -.065em; font-weight: 760; }
.hero h1 .gradient { display: block; background: linear-gradient(100deg, var(--brand) 8%, var(--accent) 82%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-desc { max-width: 580px; margin-top: 24px; color: var(--muted); font-size: clamp(14px, 1.5vw, 16.5px); line-height: 1.85; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 11px; margin-top: 30px; }
.hero-points { display: flex; flex-wrap: wrap; gap: 17px; margin-top: 28px; color: var(--muted); font-size: 11.5px; }
.hero-points span { display: inline-flex; align-items: center; gap: 6px; }
.hero-points .icon { width: 14px; height: 14px; color: var(--accent); }
.auth-card { position: relative; padding: 3px; border-radius: 25px; background: linear-gradient(145deg, color-mix(in srgb, var(--brand) 32%, var(--line)), var(--line) 36%, color-mix(in srgb, var(--accent) 26%, var(--line))); box-shadow: var(--shadow-lg); }
.auth-inner { position: relative; border-radius: 23px; background: var(--surface); padding: 30px; overflow: hidden; }
.auth-inner::before { content: ""; position: absolute; width: 220px; height: 220px; right: -100px; top: -140px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 20%, transparent), transparent 68%); pointer-events: none; }
.auth-kicker { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--faint); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.auth-kicker .live { display: inline-flex; align-items: center; gap: 5px; color: var(--success); letter-spacing: .05em; }
.auth-kicker .live .dot { animation: pulseSoft 1.8s infinite; }
.auth-inner h2 { font-size: 23px; letter-spacing: -.035em; margin-top: 16px; }
.auth-inner > p { color: var(--muted); font-size: 12.5px; margin-top: 5px; }
.auth-form { margin-top: 23px; display: flex; flex-direction: column; gap: 14px; }
.auth-error { display: none; padding: 9px 11px; border-radius: 9px; background: var(--danger-soft); color: var(--danger); font-size: 12px; }
.auth-error.show { display: block; animation: fadeUp .2s ease; }
.auth-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 17px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--faint); font-size: 10.5px; }
.auth-foot .secure { display: inline-flex; align-items: center; gap: 5px; }
.auth-user { text-align: center; padding: 12px 0 3px; }
.auth-user .avatar { margin: 0 auto; }
.auth-user h3 { margin-top: 12px; font-size: 20px; letter-spacing: -.02em; }
.auth-user p { color: var(--muted); font-size: 12px; margin-top: 3px; }
.auth-balance { display: flex; justify-content: space-between; align-items: center; margin: 19px 0; padding: 13px 15px; border-radius: 12px; background: var(--surface-soft); border: 1px solid var(--line); }
.auth-balance strong { font-size: 21px; letter-spacing: -.04em; }
.auth-balance span { color: var(--faint); font-size: 10.5px; }
.trust-strip { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 52%, transparent); }
.trust-row { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.trust-label { color: var(--faint); font-size: 10px; letter-spacing: .13em; text-transform: uppercase; }
.trust-items { display: flex; align-items: center; gap: clamp(20px, 4vw, 48px); flex-wrap: wrap; }
.trust-item { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 600; }
.trust-item .icon { color: var(--brand); }
.section { padding: clamp(60px, 8vw, 106px) 0; }
.section-soft { background: color-mix(in srgb, var(--bg-elevated) 70%, transparent); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature-card { padding: 26px; border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface); min-height: 218px; position: relative; overflow: hidden; transition: transform .25s, box-shadow .25s, border-color .25s; }
.feature-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--brand) 24%, var(--line)); }
.feature-card::after { content: ""; position: absolute; width: 150px; height: 150px; right: -80px; bottom: -100px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--brand) 13%, transparent), transparent 68%); }
.feature-icon { width: 43px; height: 43px; border-radius: 13px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 22px; }
.feature-card:nth-child(2) .feature-icon { background: var(--accent-soft); color: var(--accent); }
.feature-card:nth-child(3) .feature-icon { background: var(--warning-soft); color: var(--warning); }
.feature-card h3 { font-size: 16px; letter-spacing: -.015em; }
.feature-card p { margin-top: 9px; color: var(--muted); font-size: 12.8px; line-height: 1.8; }
.feature-link { display: inline-flex; align-items: center; gap: 5px; margin-top: 19px; color: var(--brand); font-size: 12px; font-weight: 650; }
.model-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.model-card { padding: 18px; border-radius: 15px; border: 1px solid var(--line); background: var(--surface); transition: .22s; min-width: 0; }
.model-card:hover { border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.model-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.model-logo { width: 38px; height: 38px; border-radius: 11px; background: var(--surface-muted); overflow: hidden; flex: none; display: grid; place-items: center; color: var(--brand); }
.model-logo img { width: 100%; height: 100%; object-fit: cover; }
.model-logo .icon { width: 20px; height: 20px; }
.model-name { min-width: 0; }
.model-name strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model-name span { display: block; color: var(--faint); font-size: 10px; font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.model-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 15px; }
.model-meta .badge { font-size: 9.5px; min-height: 21px; }
.model-empty { grid-column: 1 / -1; padding: 42px; text-align: center; border: 1px dashed var(--line-strong); border-radius: 15px; color: var(--muted); font-size: 12.5px; }
.code-window { border-radius: 19px; border: 1px solid var(--line); background: #0a1220; color: #dce5f5; overflow: hidden; box-shadow: var(--shadow-md); }
.code-top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,.08); color: #8192ae; font-size: 10.5px; }
.code-dots { display: flex; gap: 5px; }
.code-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.18); }
.code-copy { display: inline-flex; align-items: center; gap: 5px; color: #8ba0c0; border: 0; background: transparent; font-size: 10.5px; }
.code-copy:hover { color: #fff; }
.code-window pre { margin: 0; padding: 22px 18px 24px; overflow-x: auto; font-size: 12px; line-height: 1.9; }
.code-window .c { color: #5f7291; }
.code-window .k { color: #79a6ff; }
.code-window .s { color: #80d9c8; }
.code-window .v { color: #f1c37e; }
.api-layout { display: grid; grid-template-columns: .8fr 1.2fr; gap: 36px; align-items: center; }
.api-copy h2 { font-size: clamp(27px, 3.2vw, 40px); line-height: 1.15; letter-spacing: -.04em; }
.api-copy p { color: var(--muted); margin-top: 14px; line-height: 1.8; }
.api-facts { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.api-fact { display: flex; align-items: center; gap: 10px; color: var(--text-soft); font-size: 12.5px; }
.api-fact .icon { color: var(--accent); }
.news-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
.news-card { display: block; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); transition: .2s; }
.news-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--line-strong); }
.news-meta { display: flex; align-items: center; gap: 8px; color: var(--faint); font-size: 10.5px; }
.news-card h3 { margin-top: 10px; font-size: 14.5px; line-height: 1.45; letter-spacing: -.01em; }
.news-card p { margin-top: 6px; color: var(--muted); font-size: 12px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.site-footer { border-top: 1px solid var(--line); padding: 38px 0 28px; color: var(--muted); font-size: 11.5px; }
.footer-main { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.footer-note { max-width: 300px; margin-top: 9px; color: var(--faint); line-height: 1.7; }
.footer-links { display: flex; gap: 24px; flex-wrap: wrap; }
.footer-links a:hover { color: var(--text); }
.footer-bottom { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; color: var(--faint); font-size: 10.5px; }

/* ---------- app shell ---------- */
.app-body { background: var(--bg); }
.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 120; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); transition: width .28s cubic-bezier(.22,1,.36,1), transform .28s cubic-bezier(.22,1,.36,1); overflow: hidden; }
.sidebar-head { height: var(--header); padding: 0 18px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--line); flex: none; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sidebar-brand .brand-mark { width: 34px; height: 34px; border-radius: 10px; flex: none; }
.sidebar-brand .brand-name { white-space: nowrap; overflow: hidden; }
.sidebar-brand .brand-name strong { display: block; font-size: 14px; letter-spacing: -.02em; }
.sidebar-brand .brand-name span { display: block; color: var(--faint); font-size: 9px; letter-spacing: .12em; }
.sidebar-collapse { color: var(--faint); }
.sidebar-scroll { flex: 1; overflow-y: auto; padding: 18px 12px; scrollbar-width: thin; }
.nav-section { margin-bottom: 20px; }
.nav-section-title { color: var(--faint); font-size: 9px; letter-spacing: .13em; font-weight: 700; padding: 0 11px 8px; text-transform: uppercase; white-space: nowrap; }
.nav-item { display: flex; align-items: center; gap: 11px; height: 42px; padding: 0 11px; margin-bottom: 3px; border-radius: 11px; color: var(--muted); font-size: 12.5px; font-weight: 550; transition: .16s; position: relative; white-space: nowrap; }
.nav-item .icon { flex: none; color: var(--faint); transition: .16s; }
.nav-item:hover { background: var(--surface-soft); color: var(--text); }
.nav-item:hover .icon { color: var(--text); }
.nav-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.nav-item.active .icon { color: var(--brand); }
.nav-item.active::after { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.nav-item .nav-end { margin-left: auto; min-width: 18px; height: 18px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 9px; display: grid; place-items: center; padding: 0 5px; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--line); flex: none; }
.side-mini { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; transition: .16s; }
.side-mini:hover { background: var(--surface-soft); }
.side-mini .avatar { width: 34px; height: 34px; border-radius: 10px; }
.side-mini-info { min-width: 0; }
.side-mini-info strong { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-mini-info span { display: block; color: var(--faint); font-size: 10px; }
.side-mini .icon { margin-left: auto; color: var(--faint); }
.sidebar-collapsed .sidebar { width: 78px; }
.sidebar-collapsed .sidebar .brand-name, .sidebar-collapsed .sidebar .nav-section-title, .sidebar-collapsed .sidebar .nav-item span, .sidebar-collapsed .sidebar .side-mini-info, .sidebar-collapsed .sidebar .side-mini > .icon, .sidebar-collapsed .sidebar .nav-item .nav-end { display: none; }
.sidebar-collapsed .sidebar .sidebar-head { justify-content: center; padding: 0; }
.sidebar-collapsed .sidebar .sidebar-collapse { display: none; }
.sidebar-collapsed .sidebar .nav-item { justify-content: center; padding: 0; }
.sidebar-collapsed .sidebar .nav-item.active::after { left: 0; }
.sidebar-collapsed .sidebar .side-mini { justify-content: center; padding: 8px 0; }
.sidebar-collapsed .main-shell { margin-left: 78px; }
.main-shell { min-height: 100vh; margin-left: var(--sidebar); transition: margin-left .28s cubic-bezier(.22,1,.36,1); }
.topbar { position: sticky; top: 0; z-index: 80; height: var(--header); padding: 0 26px; display: flex; align-items: center; gap: 14px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(18px); border-bottom: 1px solid color-mix(in srgb, var(--line) 72%, transparent); }
.topbar-title { min-width: 0; }
.topbar-title h1 { font-size: 17px; letter-spacing: -.025em; line-height: 1.3; }
.topbar-title p { color: var(--faint); font-size: 10.5px; margin-top: 1px; }
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 7px; }
.wallet-pill { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 11.5px; color: var(--muted); }
.wallet-pill strong { color: var(--text); font-size: 13px; letter-spacing: -.02em; }
.wallet-pill .icon { color: var(--accent); }
.content { padding: 25px 26px 44px; max-width: 1520px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 21px; }
.page-head h2 { font-size: 24px; letter-spacing: -.035em; line-height: 1.2; }
.page-head p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mobile-menu-btn { display: none; }
.sidebar-overlay { display: none; position: fixed; inset: 0; z-index: 110; background: rgba(5, 11, 21, .48); backdrop-filter: blur(3px); animation: fadeIn .2s; }
.sidebar-overlay.open { display: block; }

/* ---------- dashboard ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin-bottom: 16px; }
.stat-card { position: relative; padding: 19px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); overflow: hidden; }
.stat-card::after { content: ""; position: absolute; width: 110px; height: 110px; right: -50px; bottom: -70px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--brand) 11%, transparent), transparent 68%); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-label { color: var(--muted); font-size: 11px; }
.stat-icon { width: 31px; height: 31px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.stat-icon.accent { background: var(--accent-soft); color: var(--accent); }
.stat-icon.warn { background: var(--warning-soft); color: var(--warning); }
.stat-icon.danger { background: var(--danger-soft); color: var(--danger); }
.stat-value { margin-top: 13px; font-size: clamp(21px, 2.4vw, 28px); font-weight: 720; letter-spacing: -.045em; line-height: 1.1; }
.stat-sub { color: var(--faint); font-size: 10.5px; margin-top: 6px; }
.stat-sub strong { color: var(--success); font-weight: 600; }
.grid-2 { display: grid; grid-template-columns: 1.45fr .85fr; gap: 14px; }
.grid-2-equal { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.panel-card { border: 1px solid var(--line); border-radius: 15px; background: var(--surface); overflow: hidden; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 19px 0; }
.panel-head h3 { font-size: 14px; letter-spacing: -.01em; }
.panel-head p { color: var(--faint); font-size: 10.5px; margin-top: 3px; }
.panel-body { padding: 17px 19px 19px; }
.chart-wrap { position: relative; min-height: 190px; }
.chart-legend { display: flex; gap: 14px; color: var(--muted); font-size: 10.5px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend i { width: 7px; height: 7px; border-radius: 2px; background: var(--brand); }
.chart-svg { width: 100%; height: 190px; overflow: visible; }
.chart-axis { stroke: var(--line); stroke-width: 1; }
.chart-line { fill: none; stroke: var(--brand); stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.chart-area { fill: url(#areaBrand); }
.chart-dot { fill: var(--surface); stroke: var(--brand); stroke-width: 2; }
.chart-label { fill: var(--faint); font-size: 8px; font-family: var(--font); }
.token-split { display: flex; flex-direction: column; gap: 13px; }
.token-row { display: grid; grid-template-columns: 76px 1fr 64px; align-items: center; gap: 10px; font-size: 11px; }
.token-row span:first-child { color: var(--muted); }
.token-row strong { text-align: right; font-size: 11px; font-weight: 650; }
.token-track { height: 6px; border-radius: 999px; background: var(--surface-muted); overflow: hidden; }
.token-track i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.token-track i.accent { background: var(--accent); }
.token-track i.warn { background: var(--warning); }
.token-track i.muted { background: var(--faint); }
.balance-card { padding: 21px; border-radius: 16px; background: linear-gradient(135deg, #17233a, #0c1424); color: #f2f6ff; position: relative; overflow: hidden; }
html.dark .balance-card { background: linear-gradient(135deg, #18304d, #0c1727); border: 1px solid #223650; }
.balance-card::after { content: ""; position: absolute; width: 180px; height: 180px; right: -70px; top: -100px; border-radius: 50%; background: radial-gradient(circle, rgba(70, 213, 197, .28), transparent 68%); }
.balance-card .label { color: #8fa3c3; }
.balance-number { margin-top: 7px; font-size: 35px; font-weight: 720; letter-spacing: -.055em; }
.balance-number small { font-size: 12px; font-weight: 500; color: #9fb1cc; margin-left: 5px; letter-spacing: 0; }
.balance-foot { display: flex; justify-content: space-between; gap: 14px; margin-top: 19px; padding-top: 13px; border-top: 1px solid rgba(255,255,255,.11); color: #9fb1cc; font-size: 10.5px; }
.balance-foot strong { color: #fff; }
.quick-list { display: flex; flex-direction: column; gap: 2px; }
.quick-item { display: flex; align-items: center; gap: 11px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.quick-item:last-child { border-bottom: 0; }
.quick-item .quick-icon { width: 32px; height: 32px; border-radius: 9px; background: var(--surface-muted); color: var(--muted); display: grid; place-items: center; flex: none; }
.quick-item strong { display: block; font-size: 12px; }
.quick-item span { display: block; color: var(--faint); font-size: 10.5px; }
.quick-item .icon:last-child { margin-left: auto; color: var(--faint); }
.recent-list { display: flex; flex-direction: column; }
.recent-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.recent-row:last-child { border-bottom: 0; }
.recent-row .model-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.recent-row .recent-main { flex: 1; min-width: 0; }
.recent-row strong { display: block; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-row span { color: var(--faint); font-size: 10px; }
.recent-row .recent-cost { color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.status { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 600; white-space: nowrap; }
.status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.status.success { color: var(--success); }
.status.error { color: var(--danger); }
.status.aborted { color: var(--warning); }
.status.pending { color: var(--faint); }

/* ---------- forms/grids ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.form-grid .full { grid-column: 1 / -1; }
.form-section { padding: 20px 0; border-top: 1px solid var(--line); }
.form-section:first-child { padding-top: 0; border-top: 0; }
.form-section-title { font-size: 11px; font-weight: 700; letter-spacing: .07em; color: var(--faint); text-transform: uppercase; margin-bottom: 13px; }
.auth-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; color: var(--muted); font-size: 11.5px; }
.form-note { padding: 11px 13px; border-radius: 10px; background: var(--surface-soft); border: 1px solid var(--line); color: var(--muted); font-size: 11.5px; line-height: 1.65; }
.form-error { display: none; padding: 10px 12px; border-radius: 10px; background: var(--danger-soft); color: var(--danger); font-size: 11.5px; }
.form-error.show { display: block; }
.file-drop { display: flex; align-items: center; gap: 11px; border: 1px dashed var(--line-strong); border-radius: 11px; padding: 10px 12px; background: var(--surface-soft); color: var(--muted); font-size: 11.5px; cursor: pointer; }
.file-drop:hover { border-color: var(--brand); }
.file-drop input { display: none; }
.file-drop .icon { color: var(--brand); }
.logo-preview { width: 44px; height: 44px; border-radius: 11px; background: var(--surface-muted); overflow: hidden; display: grid; place-items: center; color: var(--faint); flex: none; }
.logo-preview img { width: 100%; height: 100%; object-fit: cover; }
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .input, .toolbar .select { width: auto; min-width: 150px; height: 37px; min-height: 37px; font-size: 12.5px; }
.toolbar .spacer { flex: 1; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-top: 14px; color: var(--faint); font-size: 11px; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface-muted); border-radius: 11px; width: fit-content; max-width: 100%; overflow: auto; }
.tab { border: 0; background: transparent; color: var(--muted); padding: 6px 12px; border-radius: 8px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }

/* ---------- keys ---------- */
.key-list { display: grid; gap: 10px; }
.key-card { display: flex; align-items: center; gap: 15px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); transition: .18s; }
.key-card:hover { border-color: var(--line-strong); }
.key-icon { width: 38px; height: 38px; border-radius: 11px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.key-main { flex: 1; min-width: 0; }
.key-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.key-title strong { font-size: 13px; }
.key-code { color: var(--muted); font-family: var(--mono); font-size: 10.5px; margin-top: 2px; }
.key-meta { display: flex; flex-wrap: wrap; gap: 14px; color: var(--faint); font-size: 10.5px; margin-top: 7px; }
.key-actions { display: flex; align-items: center; gap: 5px; }
.secret-box { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 10px; background: var(--surface-soft); border: 1px solid var(--line); }
.secret-box code { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 11.5px; color: var(--text-soft); }
.secret-warning { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--warning-soft); color: var(--warning); font-size: 11.5px; line-height: 1.6; }
.secret-warning .icon { margin-top: 2px; }
.limit-note { display: flex; align-items: center; gap: 10px; padding: 12px 15px; border-radius: 11px; background: var(--surface-soft); border: 1px solid var(--line); color: var(--muted); font-size: 11.5px; margin-bottom: 14px; }
.limit-note strong { color: var(--text); }
.limit-note .icon { color: var(--brand); }

/* ---------- model cards / chat ---------- */
.model-rail { display: flex; flex-direction: column; gap: 7px; max-height: calc(100vh - 190px); overflow-y: auto; padding-right: 3px; }
.rail-model { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid transparent; border-radius: 12px; text-align: left; width: 100%; background: transparent; transition: .16s; }
.rail-model:hover { background: var(--surface-soft); }
.rail-model.active { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 20%, transparent); }
.rail-model .model-logo { width: 32px; height: 32px; border-radius: 9px; }
.rail-model .rail-info { min-width: 0; flex: 1; }
.rail-model strong { display: block; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-model span { display: block; color: var(--faint); font-size: 9.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail-model .icon { color: var(--faint); }
.chat-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 14px; align-items: start; }
.chat-rail { border: 1px solid var(--line); border-radius: 15px; background: var(--surface); padding: 12px; position: sticky; top: 90px; }
.chat-rail-head { padding: 6px 7px 12px; display: flex; justify-content: space-between; align-items: center; }
.chat-rail-head strong { font-size: 12px; }
.chat-rail-head span { color: var(--faint); font-size: 10px; }
.chat-main { border: 1px solid var(--line); border-radius: 16px; background: var(--surface); min-height: calc(100vh - 150px); display: flex; flex-direction: column; overflow: hidden; }
.chat-top { min-height: 58px; padding: 10px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.chat-top .model-logo { width: 33px; height: 33px; border-radius: 9px; }
.chat-top-info { min-width: 0; flex: 1; }
.chat-top-info strong { display: block; font-size: 12.5px; }
.chat-top-info span { display: block; color: var(--faint); font-size: 10px; }
.chat-top .badge { font-size: 9px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 22px; min-height: 300px; }
.chat-empty { min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); }
.chat-empty .chat-orbit { width: 74px; height: 74px; border-radius: 23px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 17px; }
.chat-empty .chat-orbit .icon { width: 32px; height: 32px; }
.chat-empty h3 { color: var(--text); font-size: 16px; }
.chat-empty p { max-width: 380px; margin-top: 6px; font-size: 11.5px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin-top: 17px; }
.suggestion { border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 7px 10px; font-size: 11px; color: var(--muted); }
.suggestion:hover { border-color: var(--brand); color: var(--brand); }
.msg { display: flex; gap: 10px; margin-bottom: 21px; animation: fadeUp .3s ease both; }
.msg.user { flex-direction: row-reverse; }
.msg-avatar { width: 29px; height: 29px; border-radius: 9px; background: var(--surface-muted); color: var(--muted); display: grid; place-items: center; flex: none; overflow: hidden; }
.msg-avatar .icon { width: 15px; height: 15px; }
.msg.user .msg-avatar { background: var(--brand); color: #fff; }
.msg-body { max-width: min(720px, 82%); min-width: 0; }
.msg-meta { display: flex; align-items: center; gap: 7px; color: var(--faint); font-size: 9.5px; margin-bottom: 5px; }
.msg.user .msg-meta { justify-content: flex-end; }
.msg-bubble { padding: 11px 14px; border-radius: 4px 13px 13px 13px; background: var(--surface-soft); border: 1px solid var(--line); font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.msg.user .msg-bubble { border-radius: 13px 4px 13px 13px; background: var(--brand); border-color: transparent; color: #fff; }
.msg-bubble p { margin: 0 0 8px; }
.msg-bubble p:last-child { margin-bottom: 0; }
.msg-bubble pre { background: #0b1322; color: #dbe6f7; padding: 12px; border-radius: 9px; overflow-x: auto; font-size: 11.5px; margin: 9px 0; }
.msg-bubble code { font-size: .92em; background: color-mix(in srgb, var(--text) 7%, transparent); padding: 1px 5px; border-radius: 4px; }
.msg-bubble pre code { background: none; padding: 0; }
.msg-actions { display: flex; align-items: center; gap: 4px; margin-top: 6px; opacity: 0; transition: .15s; }
.msg:hover .msg-actions { opacity: 1; }
.msg-tool { border: 0; background: transparent; color: var(--faint); font-size: 9.5px; padding: 3px 5px; border-radius: 5px; display: inline-flex; gap: 4px; align-items: center; }
.msg-tool:hover { color: var(--text); background: var(--surface-muted); }
.msg-tool .icon { width: 12px; height: 12px; }
.reasoning { margin-bottom: 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); overflow: hidden; }
.reasoning summary { cursor: pointer; list-style: none; padding: 8px 11px; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 10.5px; }
.reasoning summary::-webkit-details-marker { display: none; }
.reasoning summary .icon { width: 13px; height: 13px; color: var(--accent); }
.reasoning .reasoning-body { padding: 0 11px 10px; color: var(--muted); font-size: 11.5px; white-space: pre-wrap; line-height: 1.75; max-height: 300px; overflow-y: auto; }
.reasoning .reasoning-tools { display: flex; gap: 6px; padding: 0 8px 8px; }
.reasoning .reasoning-tools button { border: 0; background: var(--surface-muted); color: var(--faint); font-size: 9.5px; border-radius: 5px; padding: 3px 6px; }
.chat-typing { display: inline-flex; gap: 3px; align-items: center; height: 18px; }
.chat-typing i { width: 4px; height: 4px; border-radius: 50%; background: var(--faint); animation: pulseSoft 1.1s infinite; }
.chat-typing i:nth-child(2) { animation-delay: .15s; }
.chat-typing i:nth-child(3) { animation-delay: .3s; }
.composer { border-top: 1px solid var(--line); padding: 12px 14px 11px; background: var(--surface); }
.composer-box { border: 1px solid var(--line-strong); border-radius: 13px; background: var(--surface); padding: 8px 9px 7px 12px; transition: .18s; }
.composer-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 10%, transparent); }
.composer textarea { width: 100%; border: 0; outline: 0; resize: none; min-height: 38px; max-height: 170px; background: transparent; font-size: 12.8px; line-height: 1.65; padding: 3px 0; }
.composer-bottom { display: flex; align-items: center; gap: 6px; padding-top: 4px; }
.composer-bottom .spacer { flex: 1; }
.composer-hint { color: var(--faint); font-size: 9.5px; }
.send-btn { width: 33px; height: 33px; border: 0; border-radius: 9px; background: var(--brand); color: #fff; display: grid; place-items: center; }
.send-btn:disabled { background: var(--surface-muted); color: var(--faint); }
.send-btn.stop { background: var(--danger); }
.composer-foot { text-align: center; color: var(--faint); font-size: 9px; padding-top: 7px; }
.chat-mobile-models { display: none; }

/* ---------- research ---------- */
.research-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px; align-items: start; }
.research-side { position: sticky; top: 90px; }
.filter-group { display: flex; flex-direction: column; gap: 2px; }
.filter-item { border: 0; background: transparent; text-align: left; padding: 7px 10px; border-radius: 8px; font-size: 11.5px; color: var(--muted); }
.filter-item:hover { background: var(--surface-soft); color: var(--text); }
.filter-item.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.article-list { display: flex; flex-direction: column; gap: 10px; }
.article-card { display: block; width: 100%; text-align: left; padding: 17px 19px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); transition: .18s; }
.article-card:hover { border-color: var(--line-strong); transform: translateY(-1px); box-shadow: var(--shadow-xs); }
.article-top { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.article-card h3 { font-size: 14.5px; letter-spacing: -.01em; line-height: 1.45; }
.article-card p { margin-top: 5px; color: var(--muted); font-size: 11.5px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-foot { display: flex; align-items: center; gap: 9px; color: var(--faint); font-size: 10px; margin-top: 10px; }
.article-content { color: var(--text-soft); font-size: 13.5px; line-height: 1.9; }
.article-content h1, .article-content h2, .article-content h3 { color: var(--text); margin: 25px 0 9px; letter-spacing: -.02em; line-height: 1.35; }
.article-content h1 { font-size: 24px; } .article-content h2 { font-size: 19px; } .article-content h3 { font-size: 16px; }
.article-content p { margin: 0 0 13px; }
.article-content ul, .article-content ol { margin: 10px 0 15px; padding-left: 22px; }
.article-content ul { list-style: disc; } .article-content ol { list-style: decimal; }
.article-content li { margin: 4px 0; }
.article-content blockquote { margin: 15px 0; padding: 10px 15px; border-left: 3px solid var(--brand); background: var(--surface-soft); color: var(--muted); }
.article-content pre { background: #0b1322; color: #dbe6f7; border-radius: 10px; padding: 14px; overflow: auto; font-size: 11.5px; }
.article-content code { background: var(--surface-muted); padding: 1px 5px; border-radius: 4px; font-size: .9em; }
.article-content a { color: var(--brand); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- profile ---------- */
.profile-hero { display: flex; align-items: center; gap: 18px; padding: 23px; border: 1px solid var(--line); border-radius: 17px; background: var(--surface); position: relative; overflow: hidden; }
.profile-hero::after { content: ""; position: absolute; width: 260px; height: 260px; right: -100px; top: -160px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--brand) 12%, transparent), transparent 68%); }
.profile-id { flex: 1; min-width: 0; }
.profile-id h2 { font-size: 21px; letter-spacing: -.03em; }
.profile-id .uid { display: inline-flex; align-items: center; gap: 6px; color: var(--faint); font-family: var(--mono); font-size: 10.5px; margin-top: 4px; }
.profile-id .uid button { border: 0; background: transparent; color: var(--faint); padding: 0; }
.profile-id .uid button:hover { color: var(--brand); }
.profile-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.profile-actions { display: flex; gap: 7px; flex-wrap: wrap; justify-content: flex-end; z-index: 1; }
.mini-chart { height: 120px; width: 100%; }
.trend-bars { display: flex; align-items: flex-end; gap: 4px; height: 100px; }
.trend-bar { flex: 1; min-width: 2px; border-radius: 3px 3px 0 0; background: var(--brand-soft); position: relative; height: var(--h, 4%); min-height: 3px; transition: height .5s; }
.trend-bar:hover { background: var(--brand); }
.trend-bar.today { background: var(--brand); }
.trend-x { display: flex; justify-content: space-between; color: var(--faint); font-size: 8.5px; margin-top: 5px; }

/* ---------- admin ---------- */
.admin-stat .stat-value { font-size: 24px; }
.admin-bars { display: flex; flex-direction: column; gap: 11px; }
.admin-bar-row { display: grid; grid-template-columns: 120px 1fr 52px; gap: 9px; align-items: center; font-size: 10.5px; }
.admin-bar-row .bar-label { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-bar-track { height: 6px; border-radius: 999px; background: var(--surface-muted); overflow: hidden; }
.admin-bar-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: inherit; }
.admin-bar-row strong { text-align: right; font-weight: 600; }
.admin-login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; background: var(--bg); }
.admin-login-page::before { content: ""; position: absolute; width: 620px; height: 620px; right: -180px; top: -230px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--brand) 14%, transparent), transparent 68%); }
.admin-login-card { width: min(420px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-lg); position: relative; }
.admin-login-card .brand { justify-content: center; }
.admin-login-card h1 { text-align: center; font-size: 22px; margin-top: 22px; letter-spacing: -.03em; }
.admin-login-card > p { text-align: center; color: var(--muted); font-size: 11.5px; margin-top: 5px; }
.admin-login-form { margin-top: 24px; display: flex; flex-direction: column; gap: 14px; }
.admin-kicker { display: flex; justify-content: center; margin-top: 16px; color: var(--faint); font-size: 9.5px; letter-spacing: .12em; }
.usage-cell { display: flex; align-items: center; gap: 7px; }
.mini-track { width: 60px; height: 4px; border-radius: 999px; background: var(--surface-muted); overflow: hidden; }
.mini-track i { display: block; height: 100%; background: var(--brand); }
.code-input { font-family: var(--mono); font-size: 12px; letter-spacing: .04em; }

/* ---------- force password ---------- */
.force-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); position: relative; overflow: hidden; }
.force-screen::before { content: ""; position: absolute; width: 580px; height: 580px; left: 50%; top: -330px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--brand) 16%, transparent), transparent 68%); }
.force-card { width: min(440px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); box-shadow: var(--shadow-lg); position: relative; }
.force-icon { width: 49px; height: 49px; border-radius: 15px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; margin-bottom: 19px; }
.force-card h1 { font-size: 23px; letter-spacing: -.035em; }
.force-card p { color: var(--muted); font-size: 12px; margin-top: 7px; line-height: 1.7; }
.force-form { margin-top: 22px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- boot/error ---------- */
.boot-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.boot-card { text-align: center; }
.boot-card h1 { font-size: 20px; }
.boot-card p { color: var(--muted); font-size: 12px; margin-top: 7px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .model-grid { grid-template-columns: repeat(3, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .api-layout { grid-template-columns: 1fr; gap: 26px; }
  .feature-grid { gap: 12px; }
}
@media (max-width: 960px) {
  :root { --sidebar: 260px; }
  .nav-links { display: none; }
  .mobile-toggle { display: inline-grid; }
  .hero-grid { grid-template-columns: 1fr; gap: 42px; }
  .auth-card { max-width: 460px; width: 100%; }
  .hero { padding-top: 50px; }
  .feature-grid { grid-template-columns: 1fr; }
  .feature-card { min-height: 0; }
  .model-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: 1fr; }
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.mobile-open { transform: none; }
  .main-shell, .sidebar-collapsed .main-shell { margin-left: 0; }
  .mobile-menu-btn { display: inline-grid; }
  .sidebar-collapse { display: none; }
  .topbar { padding: 0 17px; }
  .content { padding: 18px 17px 36px; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-rail { display: none; }
  .chat-mobile-models { display: flex; }
  .research-layout { grid-template-columns: 1fr; }
  .research-side { position: static; }
  .research-side .filter-group { flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .filter-item { white-space: nowrap; }
  .profile-hero { align-items: flex-start; flex-wrap: wrap; }
  .profile-actions { width: 100%; justify-content: flex-start; }
}
@media (max-width: 640px) {
  .container, .container-narrow { width: calc(100% - 30px); }
  .nav { height: 64px; }
  .brand-text { font-size: 15px; }
  .nav-actions .theme-toggle { display: none; }
  .nav-actions .btn span.hide-sm { display: none; }
  .hero h1 { font-size: clamp(38px, 12vw, 58px); }
  .hero-desc { font-size: 13.5px; }
  .hero-actions .btn { flex: 1; min-width: 130px; }
  .auth-inner { padding: 23px; }
  .section { padding: 52px 0; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { padding: 15px; }
  .stat-value { font-size: 22px; }
  .model-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .model-card { padding: 13px; }
  .model-logo { width: 32px; height: 32px; border-radius: 9px; }
  .model-name strong { font-size: 11.5px; }
  .model-meta .badge:nth-child(n+3) { display: none; }
  .grid-2-equal { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 12px; }
  .topbar-title h1 { font-size: 15px; }
  .topbar-title p { display: none; }
  .wallet-pill { padding: 0 9px; }
  .wallet-pill span { display: none; }
  .topbar-actions .btn span { display: none; }
  .topbar { height: 60px; padding: 0 13px; gap: 8px; }
  .content { padding: 15px 13px 30px; }
  .chat-main { min-height: calc(100vh - 110px); border-radius: 13px; }
  .chat-messages { padding: 15px; }
  .msg-body { max-width: 88%; }
  .composer { padding: 9px 9px 8px; }
  .composer-hint { display: none; }
  .modal { padding: 21px; border-radius: 17px; }
  .drawer { padding: 21px; }
  .key-card { align-items: flex-start; flex-wrap: wrap; }
  .key-actions { width: 100%; justify-content: flex-end; }
  .table { min-width: 620px; }
  .footer-main { flex-direction: column; }
  .footer-bottom { flex-direction: column; }
  .article-card { padding: 15px; }
  .profile-hero { padding: 18px; }
  .profile-hero .avatar-lg { width: 60px; height: 60px; border-radius: 18px; }
  .balance-number { font-size: 29px; }
}

/* ---------- mobile landing nav ---------- */
.mobile-nav { display: none; position: absolute; top: 64px; left: 15px; right: 15px; z-index: 95; padding: 9px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: var(--shadow-lg); }
.mobile-nav.open { display: flex; flex-direction: column; animation: fadeUp .2s ease both; }
.mobile-nav a { padding: 11px 12px; border-radius: 8px; color: var(--text-soft); font-size: 14px; font-weight: 500; }
.mobile-nav a:hover { background: var(--surface-soft); color: var(--text); }
/* 遮罩必须低于 header（z-index:90），否则会盖住 header 内的下拉菜单，导致菜单发虚且点不动 */
.mobile-nav-backdrop { display: none; position: fixed; inset: 64px 0 0; z-index: 89; background: rgba(5,11,21,.35); backdrop-filter: blur(2px); }
.mobile-nav-backdrop.open { display: block; }
@media (min-width: 961px) { .mobile-nav, .mobile-nav-backdrop { display: none !important; } }
@media (max-width: 640px) { .hide-sm { display: none !important; } }

.justify-start { justify-content: flex-start !important; }

/* ---------- mobile sidebar always expanded ---------- */
@media (max-width: 960px) {
  .sidebar-collapsed .sidebar { width: var(--sidebar); }
  .sidebar-collapsed .sidebar .brand-name,
  .sidebar-collapsed .sidebar .nav-section-title,
  .sidebar-collapsed .sidebar .nav-item span,
  .sidebar-collapsed .sidebar .side-mini-info,
  .sidebar-collapsed .sidebar .side-mini > .icon,
  .sidebar-collapsed .sidebar .nav-item .nav-end { display: initial; }
  .sidebar-collapsed .sidebar .nav-section-title { display: block; }
  .sidebar-collapsed .sidebar .sidebar-head { justify-content: space-between; padding: 0 18px; }
  .sidebar-collapsed .sidebar .nav-item { justify-content: flex-start; padding: 0 11px; }
  .sidebar-collapsed .sidebar .side-mini { justify-content: flex-start; padding: 10px; }
  .sidebar-collapsed .sidebar .brand-name { display: block; }
  .sidebar-collapsed .sidebar .nav-item { display: flex; }
}

.reasoning summary .reason-chevron { margin-left: 4px; transition: transform .2s; }
.reasoning[open] summary .reason-chevron { transform: rotate(180deg); }

/* ---------- chat history / context / token footer ---------- */
.chat-rail-head .icon-btn { flex: none; }
.chat-rail-tabs { display: flex; gap: 4px; padding: 4px; margin: 0 0 10px; border-radius: 9px; background: var(--surface-muted); }
.chat-rail-tab { flex: 1; border: 0; border-radius: 7px; background: transparent; color: var(--faint); padding: 6px 4px; font-size: 10.5px; font-weight: 600; transition: .15s; }
.chat-rail-tab:hover { color: var(--text); }
.chat-rail-tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-xs); }
.chat-rail-pane { overflow-y: auto; max-height: calc(100vh - 255px); padding-right: 2px; scrollbar-width: thin; }
.history-list { display: flex; flex-direction: column; gap: 3px; }
.history-item { display: flex; align-items: center; gap: 3px; border-radius: 9px; padding: 2px; transition: background .15s; }
.history-item:hover { background: var(--surface-soft); }
.history-item.active { background: var(--brand-soft); }
.history-main { flex: 1; min-width: 0; border: 0; background: transparent; text-align: left; padding: 7px 7px 7px 8px; border-radius: 7px; color: var(--text-soft); }
.history-main strong { display: block; font-size: 11px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.history-main span { display: block; color: var(--faint); font-size: 9px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin-top: 2px; }
.history-item.active .history-main strong { color: var(--brand); }
.history-del { flex: none; width: 25px; height: 25px; border: 0; border-radius: 6px; background: transparent; color: var(--faint); display: grid; place-items: center; opacity: 0; }
.history-item:hover .history-del, .history-item.active .history-del { opacity: 1; }
.history-del:hover { background: var(--danger-soft); color: var(--danger); }
.history-del .icon { width: 12px; height: 12px; }
.history-empty { display: flex; flex-direction: column; align-items: center; gap: 7px; color: var(--faint); font-size: 10.5px; padding: 28px 10px; text-align: center; }
.history-empty .icon { color: var(--faint); }
.chat-top { flex-wrap: wrap; }
.chat-top-new { flex: none; }
.chat-context { margin-left: auto; width: 142px; flex: none; }
.chat-context-top { display: flex; justify-content: space-between; gap: 5px; color: var(--faint); font-size: 9px; margin-bottom: 4px; }
.chat-context-top strong { color: var(--muted); font-size: 9.5px; font-weight: 600; white-space: nowrap; }
.context-track { height: 4px; border-radius: 999px; background: var(--surface-muted); overflow: hidden; }
.context-track i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--brand)); transition: width .3s; }
.context-track i.warn { background: var(--danger); }
.chat-mobile-models { display: none; }
.msg-usage { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--faint); font-size: 9.5px; padding: 6px 2px 0; line-height: 1.5; }
.msg-usage b { color: var(--text-soft); font-weight: 600; }
.msg-usage .cost { color: var(--accent); }
.msg-usage .badge { min-height: 18px; font-size: 9px; padding: 0 6px; }
.msg.user .msg-usage { justify-content: flex-end; }
.msg.user .msg-usage b { color: rgba(255,255,255,.9); }
.msg.user .msg-usage { color: rgba(255,255,255,.58); }
.composer-foot { transition: color .2s; }
.composer-foot.near-limit { color: var(--danger); }
.auth-user .avatar-lg { width: 64px; height: 64px; border-radius: 19px; }
.nav-user > span:not(.avatar) { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 960px) {
  .chat-context { width: 120px; }
  .chat-mobile-models { display: inline-grid; }
}
@media (max-width: 640px) {
  .auth-user .avatar-lg { width: 54px; height: 54px; border-radius: 17px; }
  .nav-user { padding: 3px; }
  .nav-user > span:not(.avatar) { display: none; }
  .chat-top { gap: 8px; padding: 9px 11px; }
  .chat-top .chat-context { order: 8; width: 100%; margin-left: 0; margin-top: 1px; }
  .chat-top-new { display: none; }
  .chat-context-top { margin-bottom: 3px; }
  .chat-mobile-models { display: inline-grid; }
  .msg-usage { font-size: 9px; gap: 6px; }
  .history-del { opacity: 1; }
}

/* ---------- reasoning level slider ---------- */
.reasoning-control { display: inline-flex; align-items: center; gap: 6px; min-height: 27px; padding: 0 4px; border-radius: 7px; --reasoning-color: var(--faint); --reasoning-pct: 0%; }
.reasoning-control.disabled { opacity: .42; }
.reasoning-caption { color: var(--faint); font-size: 9.5px; white-space: nowrap; }
.reasoning-range { width: 74px; height: 4px; appearance: none; -webkit-appearance: none; border-radius: 999px; background: linear-gradient(90deg, var(--reasoning-color) 0 var(--reasoning-pct), var(--surface-muted) var(--reasoning-pct) 100%); outline: 0; cursor: pointer; }
.reasoning-range::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 11px; border-radius: 50%; background: var(--reasoning-color); border: 2px solid var(--surface); box-shadow: 0 0 0 1px color-mix(in srgb, var(--reasoning-color) 40%, transparent); transition: transform .15s; }
.reasoning-range::-moz-range-thumb { width: 8px; height: 8px; border-radius: 50%; background: var(--reasoning-color); border: 2px solid var(--surface); }
.reasoning-range:active::-webkit-slider-thumb { transform: scale(1.2); }
.reasoning-level { min-width: 23px; color: var(--reasoning-color); font-size: 9.5px; font-weight: 650; white-space: nowrap; transition: color .2s; }
.reasoning-control[data-level="0"] .reasoning-level { color: var(--faint); }
.reasoning-control[data-level="5"] .reasoning-range { background: linear-gradient(90deg, #3b82f6, #06b6d4, #8b5cf6, #ec4899, #f59e0b); box-shadow: 0 0 9px rgba(236, 72, 153, .55); }
.reasoning-control[data-level="5"] .reasoning-range::-webkit-slider-thumb { background: conic-gradient(from 180deg, #3b82f6, #06b6d4, #8b5cf6, #ec4899, #f59e0b, #3b82f6); box-shadow: 0 0 8px rgba(236, 72, 153, .75); }
.reasoning-control[data-level="5"] .reasoning-level { background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899, #f59e0b); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 750; }
.reasoning-control[data-level="5"] .reasoning-caption { color: var(--muted); }
@media (max-width: 640px) {
  .reasoning-control { gap: 4px; padding-left: 1px; }
  .reasoning-range { width: 62px; }
  .reasoning-caption { font-size: 9px; }
}

/* ---------- model ecosystem marquee ---------- */
.ecosystem { padding: 25px 0 29px; border-bottom: 1px solid var(--line); overflow: hidden; background: color-mix(in srgb, var(--surface) 34%, transparent); }
.ecosystem-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.ecosystem-head .eyebrow { margin-bottom: 5px; font-size: 9px; }
.ecosystem-head h2 { font-size: 16px; letter-spacing: -.02em; font-weight: 650; }
.ecosystem-head p { color: var(--faint); font-size: 10px; }
.ecosystem-head p span { color: var(--muted); font-size: 9px; margin-left: 5px; }
.vendor-marquee { position: relative; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.vendor-track { display: flex; width: max-content; animation: vendorScroll 46s linear infinite; will-change: transform; }
.vendor-marquee:hover .vendor-track { animation-play-state: paused; }
.vendor-set { display: flex; align-items: center; gap: 35px; padding-right: 35px; }
.vendor-item { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; opacity: .78; transition: opacity .2s; }
.vendor-item:hover { opacity: 1; }
.vendor-logo { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--vendor-color); background: color-mix(in srgb, var(--vendor-color) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--vendor-color) 20%, var(--line)); }
.vendor-logo .icon { width: 18px; height: 18px; stroke-width: 1.6; }
.vendor-name { color: var(--muted); font-size: 11.5px; font-weight: 600; letter-spacing: -.01em; }
@keyframes vendorScroll { to { transform: translateX(-50%); } }
@media (max-width: 640px) {
  .ecosystem { padding: 20px 0 23px; }
  .ecosystem-head { align-items: flex-start; flex-direction: column; gap: 5px; }
  .ecosystem-head h2 { font-size: 14px; }
  .ecosystem-head p { font-size: 9px; }
  .vendor-set { gap: 25px; padding-right: 25px; }
  .vendor-logo { width: 27px; height: 27px; border-radius: 8px; }
  .vendor-name { font-size: 10.5px; }
  .vendor-track { animation-duration: 38s; }
}
@media (prefers-reduced-motion: reduce) {
  .vendor-track { animation: none; }
  .vendor-marquee { overflow-x: auto; }
}

/* ---------- SweetAlert-style notifications ---------- */
.toast-root { left: 50%; right: auto; top: 18px; transform: translateX(-50%); align-items: center; z-index: 240; }
.notice { --notice-accent: var(--brand); position: relative; width: min(410px, calc(100vw - 32px)); display: flex; align-items: flex-start; gap: 12px; padding: 15px 42px 15px 15px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 18px 55px -22px rgba(8, 18, 35, .55); pointer-events: auto; overflow: hidden; animation: noticeIn .28s cubic-bezier(.22,1,.36,1) both; }
.notice-leaving { animation: noticeOut .2s ease both; }
.notice-success { --notice-accent: var(--success); }
.notice-error { --notice-accent: var(--danger); }
.notice-warning { --notice-accent: var(--warning); }
.notice-info { --notice-accent: var(--brand); }
.notice-icon { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; color: var(--notice-accent); background: color-mix(in srgb, var(--notice-accent) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--notice-accent) 24%, var(--line)); }
.notice-success .notice-icon { background: var(--success-soft); border-color: transparent; }
.notice-error .notice-icon { background: var(--danger-soft); border-color: transparent; }
.notice-warning .notice-icon { background: var(--warning-soft); border-color: transparent; }
.notice-content { min-width: 0; padding-top: 1px; }
.notice-title { color: var(--text); font-size: 13px; font-weight: 700; letter-spacing: -.01em; }
.notice-text { color: var(--muted); font-size: 11.5px; line-height: 1.65; margin-top: 2px; overflow-wrap: anywhere; }
.notice-close { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent; color: var(--faint); display: grid; place-items: center; }
.notice-close:hover { color: var(--text); background: var(--surface-muted); }
.notice-progress { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--notice-accent); transform-origin: left; animation: noticeProgress var(--notice-duration, 3800ms) linear forwards; opacity: .7; }
.notice-paused .notice-progress { animation-play-state: paused; }
@keyframes noticeIn { from { opacity: 0; transform: translateY(-9px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes noticeOut { to { opacity: 0; transform: translateY(-7px) scale(.97); } }
@keyframes noticeProgress { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.swal-dialog { text-align: center; padding: 6px 4px 0; }
.swal-icon { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 16px; color: var(--brand); background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 18%, transparent); }
.swal-icon.error { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.swal-icon.success { color: var(--success); background: var(--success-soft); border-color: transparent; }
.swal-icon.warning { color: var(--warning); background: var(--warning-soft); border-color: transparent; }
.swal-dialog h3 { font-size: 19px; letter-spacing: -.025em; }
.swal-dialog p { color: var(--muted); font-size: 12.5px; line-height: 1.7; margin-top: 6px; }
.swal-actions { display: flex; justify-content: center; gap: 9px; margin-top: 22px; }
.swal-actions .btn { min-width: 96px; }
@media (max-width: 640px) {
  .toast-root { top: 10px; }
  .notice { width: calc(100vw - 24px); padding: 13px 38px 13px 13px; border-radius: 14px; }
  .notice-icon { width: 32px; height: 32px; }
  .notice-title { font-size: 12.5px; }
  .notice-text { font-size: 11px; }
  .swal-actions { flex-direction: column-reverse; }
  .swal-actions .btn { width: 100%; }
}

/* ---------- registration / verification ---------- */
.auth-page { min-height: 100vh; background: var(--bg); position: relative; overflow-x: hidden; }
.auth-page::before { content: ""; position: fixed; width: 720px; height: 720px; right: -260px; top: -330px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--brand) 14%, transparent), transparent 68%); pointer-events: none; }
.auth-page::after { content: ""; position: fixed; width: 540px; height: 540px; left: -280px; bottom: -300px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--accent) 12%, transparent), transparent 68%); pointer-events: none; }
.auth-page-wrap { position: relative; z-index: 1; width: min(540px, calc(100% - 30px)); margin: 0 auto; padding: 34px 0 30px; }
.auth-page-brand { justify-content: center; margin-bottom: 19px; }
.auth-register-card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 29px; box-shadow: var(--shadow-lg); }
.auth-register-card > h1 { font-size: 25px; letter-spacing: -.04em; margin-top: 4px; }
.auth-register-card > .swal-icon { margin-top: 4px; }
.register-kicker { color: var(--brand); font-size: 9px; letter-spacing: .16em; font-weight: 700; }
.register-sub { color: var(--muted); font-size: 12px; line-height: 1.75; margin-top: 7px; }
.register-form { margin-top: 21px; }
.register-geetest { min-height: 0; color: var(--faint); font-size: 10.5px; margin-top: 12px; }
.register-form > .btn { margin-top: 18px; }
.register-foot { display: flex; justify-content: center; gap: 5px; color: var(--faint); font-size: 11px; margin-top: 17px; }
.register-foot a { color: var(--brand); font-weight: 600; }
.register-success { text-align: center; padding: 6px 0 0; }
.register-success h2 { font-size: 21px; letter-spacing: -.025em; margin-top: 15px; }
.register-success > p { color: var(--muted); font-size: 12px; line-height: 1.7; margin-top: 7px; }
.register-success .btn { margin-top: 20px; }
.auth-page-footer { text-align: center; color: var(--faint); font-size: 9.5px; margin-top: 15px; }
@media (max-width: 640px) {
  .auth-page-wrap { width: calc(100% - 24px); padding-top: 20px; }
  .auth-register-card { padding: 22px 18px; border-radius: 18px; }
  .auth-register-card > h1 { font-size: 22px; }
}

/* ---------- admin model grouping / batch ---------- */
.model-toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 12px; }
.model-toolbar .input-group, .model-toolbar .select { min-width: 170px; }
.model-toolbar .spacer { flex: 1; }
.vendor-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.vendor-chip { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 5px 10px; font-size: 10.5px; font-weight: 600; transition: .15s; }
.vendor-chip b { color: var(--faint); font-weight: 650; margin-left: 3px; }
.vendor-chip:hover { border-color: var(--brand); color: var(--brand); }
.vendor-chip.active { background: var(--brand-soft); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 22%, var(--line)); }
.vendor-chip.active b { color: var(--brand); }
.batch-bar { display: none; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 12px; margin-bottom: 10px; border: 1px solid color-mix(in srgb, var(--brand) 22%, var(--line)); background: var(--brand-soft); border-radius: 11px; color: var(--brand); font-size: 11.5px; }
.batch-bar.open { display: flex; }
.batch-bar .spacer { flex: 1; }
.batch-bar strong { font-weight: 750; }
.table .model-check, .table #modelSelectAll { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }

/* ---------- in-site messages ---------- */
.message-list { display: flex; flex-direction: column; gap: 8px; }
.message-item { display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left; padding: 15px 17px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); position: relative; transition: .18s; }
.message-item:hover { border-color: color-mix(in srgb, var(--brand) 28%, var(--line)); box-shadow: var(--shadow-xs); }
.message-item.unread { border-color: color-mix(in srgb, var(--brand) 24%, var(--line)); background: color-mix(in srgb, var(--brand-soft) 52%, var(--surface)); }
.message-icon { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.message-main { min-width: 0; flex: 1; }
.message-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.message-head strong { color: var(--text); font-size: 12.5px; }
.message-preview { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.message-time { display: block; color: var(--faint); font-size: 9.5px; margin-top: 5px; }
.message-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); flex: none; margin-top: 6px; }
.message-body { color: var(--text-soft); font-size: 13px; line-height: 1.9; padding: 4px 2px 10px; overflow-wrap: anywhere; }
