/* =========================================================================
   灵枢 API · user portal
   Dark, restrained, data-first. No external fonts or assets.
   ========================================================================= */
:root {
  --bg: #060810;
  --bg-2: #0a0e1a;
  --panel: rgba(15, 21, 37, 0.72);
  --panel-solid: #0d1322;
  --panel-2: rgba(22, 30, 50, 0.62);
  --line: rgba(148, 163, 214, 0.13);
  --line-strong: rgba(148, 163, 214, 0.24);
  --txt: #eef2ff;
  --muted: #909bb8;
  --faint: #5c6784;
  --violet: #7c5cff;
  --blue: #4f8cff;
  --cyan: #2dd4bf;
  --gold: #f5c76a;
  --red: #ff6b81;
  --green: #4ade80;
  --grad: linear-gradient(135deg, #7c5cff 0%, #4f8cff 48%, #2dd4bf 100%);
  --grad-soft: linear-gradient(135deg, rgba(124, 92, 255, .18), rgba(45, 212, 191, .12));
  --shadow: 0 24px 80px rgba(0, 0, 0, .45);
  --radius: 18px;
  --radius-sm: 12px;
  --mono: "SFMono-Regular", "Cascadia Code", "JetBrains Mono", Consolas, monospace;
  --sans: "Inter", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--txt);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
[v-cloak] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(124, 92, 255, .45); color: #fff; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 214, .18); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 214, .3); }

/* ---------- ambient background ---------- */
.app-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 600px at 12% -8%, rgba(124, 92, 255, .16), transparent 60%),
    radial-gradient(800px 550px at 92% 8%, rgba(45, 212, 191, .09), transparent 60%),
    radial-gradient(700px 500px at 50% 110%, rgba(79, 140, 255, .08), transparent 65%),
    var(--bg);
}
.app-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 214, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 214, .035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 20%, #000 0%, transparent 75%);
}
.noise {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- primitives ---------- */
.container { width: min(1220px, calc(100% - 48px)); margin: 0 auto; }
.row { display: flex; align-items: center; }
.between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.grow { flex: 1; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 600; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.gradient-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hr { height: 1px; background: var(--line); border: 0; margin: 18px 0; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.card-pad { padding: 24px; }
.card-hover { transition: border-color .2s, transform .2s, background .2s; }
.card-hover:hover { border-color: var(--line-strong); transform: translateY(-2px); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(148, 163, 214, .06);
  color: var(--txt);
  font-weight: 550;
  letter-spacing: .01em;
  transition: background .18s, border-color .18s, transform .18s, opacity .18s;
  white-space: nowrap;
}
.btn:hover { background: rgba(148, 163, 214, .12); border-color: rgba(148, 163, 214, .36); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary {
  border: 0;
  background: var(--grad);
  color: #fff;
  box-shadow: 0 10px 30px rgba(94, 92, 255, .22);
}
.btn-primary:hover { filter: brightness(1.08); background: var(--grad); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-danger { color: #ffd7dd; border-color: rgba(255, 107, 129, .35); background: rgba(255, 107, 129, .08); }
.btn-danger:hover { background: rgba(255, 107, 129, .15); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.btn-xs { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 9px; }
.btn-block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field > label { font-size: 12.5px; color: var(--muted); letter-spacing: .02em; }
.input, .select, .textarea {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: rgba(5, 8, 16, .55);
  color: var(--txt);
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.textarea { height: auto; min-height: 96px; padding: 11px 13px; resize: vertical; line-height: 1.6; }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:focus, .select:focus, .textarea:focus {
  border-color: rgba(124, 92, 255, .65);
  box-shadow: 0 0 0 3px rgba(124, 92, 255, .14);
  background: rgba(5, 8, 16, .78);
}
.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% - 18px) 18px, calc(100% - 13px) 18px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.select option { background: #0d1322; color: var(--txt); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 550;
  letter-spacing: .02em;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .9; }
.badge.violet { color: #c4b5fd; background: rgba(124, 92, 255, .12); border-color: rgba(124, 92, 255, .22); }
.badge.green { color: #86efac; background: rgba(74, 222, 128, .1); border-color: rgba(74, 222, 128, .2); }
.badge.red { color: #fda4af; background: rgba(255, 107, 129, .1); border-color: rgba(255, 107, 129, .2); }
.badge.gold { color: #fcd34d; background: rgba(245, 199, 106, .1); border-color: rgba(245, 199, 106, .2); }
.badge.gray { color: var(--muted); background: rgba(148, 163, 214, .07); border-color: var(--line); }
.badge.cyan { color: #99f6e4; background: rgba(45, 212, 191, .1); border-color: rgba(45, 212, 191, .2); }

.kbd {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 7px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: rgba(148, 163, 214, .08);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
}

/* ---------- boot ---------- */
.boot-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .16em;
}
.boot-mark {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--grad);
  animation: bootPulse 1.6s ease-in-out infinite;
  box-shadow: 0 0 48px rgba(124, 92, 255, .4);
}
@keyframes bootPulse { 0%,100% { transform: scale(.92) rotate(0); opacity: .7; } 50% { transform: scale(1.05) rotate(45deg); opacity: 1; } }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--grad);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 26px rgba(124, 92, 255, .32);
  position: relative;
  flex: none;
}
.brand-mark svg { width: 21px; height: 21px; }
.brand-name { font-weight: 650; font-size: 17px; letter-spacing: .04em; }
.brand-name em { font-style: normal; font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 7px; letter-spacing: .18em; }

/* ---------- auth ---------- */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; }
.auth-top { padding: 26px 0; display: flex; justify-content: space-between; align-items: center; }
.auth-main {
  flex: 1;
  display: grid;
  grid-template-columns: 1.12fr .88fr;
  gap: 64px;
  align-items: center;
  padding: 34px 0 70px;
}
.auth-hero { position: relative; padding-left: 2px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #b9c2dc;
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
  margin-bottom: 22px;
}
.eyebrow::before { content: ""; width: 26px; height: 1px; background: var(--grad); }
.auth-hero h1 {
  margin: 0 0 22px;
  font-size: clamp(40px, 5.2vw, 66px);
  line-height: 1.08;
  letter-spacing: -.035em;
  font-weight: 650;
}
.auth-hero h1 span { display: block; }
.auth-lead { max-width: 520px; color: var(--muted); font-size: 15px; line-height: 1.85; }
.auth-points { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 22px; margin: 30px 0 0; padding: 0; list-style: none; max-width: 560px; }
.auth-points li { display: flex; gap: 10px; align-items: flex-start; color: #c3cbe0; font-size: 13px; }
.auth-points svg { flex: none; margin-top: 2px; color: var(--cyan); }
.auth-stats { display: flex; gap: 36px; margin-top: 38px; padding-top: 24px; border-top: 1px solid var(--line); max-width: 560px; }
.auth-stat b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.auth-stat span { color: var(--faint); font-size: 11.5px; letter-spacing: .12em; }

.auth-card {
  width: 100%;
  max-width: 430px;
  margin-left: auto;
  padding: 32px;
  background: linear-gradient(180deg, rgba(18, 25, 43, .92), rgba(11, 16, 29, .86));
  border: 1px solid rgba(148, 163, 214, .16);
  border-radius: 24px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.auth-card::before {
  content: "";
  position: absolute;
  inset: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(124, 92, 255, .8), rgba(45, 212, 191, .7), transparent);
}
.auth-card h2 { margin: 0; font-size: 24px; letter-spacing: -.02em; font-weight: 600; }
.auth-card .sub { color: var(--muted); font-size: 13px; margin: 7px 0 24px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: rgba(5, 8, 16, .5); border: 1px solid var(--line); border-radius: 11px; margin-bottom: 24px; }
.auth-tab { height: 34px; border: 0; background: transparent; color: var(--muted); border-radius: 8px; font-size: 13px; transition: .18s; }
.auth-tab.active { background: rgba(148, 163, 214, .12); color: var(--txt); box-shadow: 0 2px 10px rgba(0,0,0,.2); }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-foot { margin-top: 20px; text-align: center; color: var(--faint); font-size: 11.5px; line-height: 1.7; }
.auth-foot a { color: var(--muted); border-bottom: 1px solid var(--line-strong); }

/* ---------- shell ---------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; position: relative; z-index: 1; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 9, 17, .78);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.topbar-inner { height: 68px; display: flex; align-items: center; gap: 28px; }
.nav { display: flex; align-items: center; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  transition: color .18s, background .18s;
}
.nav-link:hover { color: var(--txt); background: rgba(148, 163, 214, .06); }
.nav-link.active { color: var(--txt); background: rgba(124, 92, 255, .14); }
.nav-link.active svg { color: #c4b5fd; }
.top-right { display: flex; align-items: center; gap: 12px; flex: none; }
.balance-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 13px;
  border-radius: 9px;
  border: 1px solid rgba(45, 212, 191, .2);
  background: rgba(45, 212, 191, .07);
  color: #99f6e4;
  font-family: var(--mono);
  font-size: 12.5px;
  white-space: nowrap;
}
.balance-chip .lbl { color: rgba(153, 246, 228, .55); font-family: var(--sans); font-size: 11px; }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--grad-soft);
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-weight: 600;
  color: #d8d2ff;
  font-size: 13px;
  cursor: pointer;
  text-transform: uppercase;
}
.menu-wrap { position: relative; }
.menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 220px;
  padding: 7px;
  background: #0d1322;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: 0 22px 60px rgba(0,0,0,.55);
  z-index: 60;
}
.menu-head { padding: 10px 11px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
}
.menu-item:hover { background: rgba(148, 163, 214, .07); color: var(--txt); }
.menu-item.danger:hover { background: rgba(255, 107, 129, .1); color: #fda4af; }

.page { flex: 1; padding: 38px 0 72px; position: relative; z-index: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.page-head h1 { margin: 0 0 6px; font-size: 28px; font-weight: 620; letter-spacing: -.03em; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-title h3 { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.section-title .hint { color: var(--faint); font-size: 12px; }

/* ---------- dashboard ---------- */
.dash-grid { display: grid; grid-template-columns: 1.35fr .65fr; gap: 20px; margin-bottom: 20px; }
.balance-hero {
  position: relative;
  overflow: hidden;
  padding: 30px;
  border-radius: var(--radius);
  border: 1px solid rgba(124, 92, 255, .24);
  background:
    radial-gradient(600px 300px at 90% -20%, rgba(45, 212, 191, .16), transparent 60%),
    radial-gradient(500px 300px at 0% 120%, rgba(124, 92, 255, .2), transparent 60%),
    linear-gradient(145deg, rgba(20, 27, 47, .96), rgba(9, 13, 24, .9));
  box-shadow: 0 24px 70px rgba(0, 0, 0, .32);
}
.balance-hero::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 214, .12);
  box-shadow: 0 0 0 40px rgba(148, 163, 214, .03), 0 0 0 90px rgba(148, 163, 214, .02);
  pointer-events: none;
}
.balance-label { display: flex; align-items: center; gap: 9px; color: #aeb8d4; font-size: 12.5px; letter-spacing: .1em; text-transform: uppercase; }
.balance-amount { margin: 16px 0 4px; font-family: var(--mono); font-size: clamp(36px, 5vw, 50px); font-weight: 550; letter-spacing: -.045em; line-height: 1; }
.balance-amount .cur { font-size: .45em; color: var(--muted); margin-right: 6px; letter-spacing: 0; }
.balance-sub { color: var(--muted); font-size: 12.5px; }
.balance-actions { display: flex; gap: 10px; margin-top: 26px; position: relative; z-index: 1; flex-wrap: wrap; }
.balance-actions .btn { height: 38px; }

/* 签到福利按钮 */
.btn-gift {
  color: #ffe8b0;
  border-color: rgba(255, 200, 90, .42);
  background: linear-gradient(135deg, rgba(255, 196, 74, .22), rgba(255, 143, 92, .16));
  box-shadow: 0 0 0 1px rgba(255, 200, 90, .1), 0 10px 26px rgba(255, 160, 60, .16);
  position: relative;
  overflow: hidden;
}
.btn-gift::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, .28) 46%, transparent 62%);
  transform: translateX(-120%);
  animation: giftShine 3.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes giftShine {
  0%, 62% { transform: translateX(-120%); }
  88%, 100% { transform: translateX(120%); }
}
.btn-gift:hover:not(:disabled) {
  background: linear-gradient(135deg, rgba(255, 200, 74, .34), rgba(255, 143, 92, .24));
  border-color: rgba(255, 208, 110, .62);
}
.btn-gift.is-done,
.btn-gift.is-done:disabled {
  opacity: 1;
  color: #9aa6c4;
  background: rgba(148, 163, 214, .07);
  border-color: var(--line);
  box-shadow: none;
  cursor: default;
}
.btn-gift.is-done::after { display: none; }

.gift-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 200, 90, .3);
  background: rgba(255, 196, 74, .09);
  color: #ffd98a;
  font-size: 12px;
  position: relative;
  z-index: 1;
}
.gift-chip b { font-family: var(--mono); font-weight: 600; color: #ffe9b8; }
.gift-chip-note { color: rgba(255, 217, 138, .62); font-size: 11.5px; }

.quick-panel { padding: 24px; display: flex; flex-direction: column; }
.quick-panel h3 { margin: 0 0 6px; font-size: 15px; }
.quick-panel p { margin: 0 0 18px; color: var(--muted); font-size: 12.5px; }
.quick-list { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.quick-item { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(5, 8, 16, .35); transition: .18s; }
.quick-item:hover { border-color: var(--line-strong); background: rgba(148, 163, 214, .05); }
.quick-item .qi-icon { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--grad-soft); color: #c4b5fd; flex: none; }
.quick-item b { display: block; font-size: 12.5px; font-weight: 550; }
.quick-item span { display: block; color: var(--faint); font-size: 11.5px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat-card { padding: 19px 20px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); }
.stat-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.stat-top svg { color: var(--faint); }
.stat-value { margin-top: 10px; font-family: var(--mono); font-size: 24px; font-weight: 550; letter-spacing: -.03em; }
.stat-foot { margin-top: 4px; color: var(--faint); font-size: 11.5px; }
.stat-foot b { color: var(--cyan); font-weight: 550; }

/* model chooser */
.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.model-card {
  text-align: left;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(5, 8, 16, .32);
  color: var(--txt);
  transition: border-color .18s, background .18s, transform .18s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.model-card:hover { border-color: rgba(124, 92, 255, .4); background: rgba(124, 92, 255, .07); transform: translateY(-1px); }
.model-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.model-card-name { font-family: var(--mono); font-size: 13px; color: #d8d2ff; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-card-desc { color: var(--faint); font-size: 11.5px; line-height: 1.5; min-height: 17px; }
.model-card-price { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10.5px; font-family: var(--mono); border-top: 1px solid var(--line); padding-top: 9px; }
.model-card-go { margin-top: auto; display: flex; align-items: center; gap: 5px; color: #c4b5fd; font-size: 11.5px; }

.panel-grid { display: grid; grid-template-columns: 1.4fr .6fr; gap: 20px; margin-bottom: 20px; }
.panel { padding: 24px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.panel-head h3 { margin: 0 0 4px; font-size: 15px; }
.panel-head p { margin: 0; color: var(--faint); font-size: 12px; }

/* chart */
.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 180px; padding-top: 12px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 9px; min-width: 0; height: 100%; justify-content: flex-end; }
.bar-track { width: 100%; max-width: 44px; height: 100%; display: flex; align-items: flex-end; border-radius: 6px 6px 3px 3px; background: rgba(148, 163, 214, .045); overflow: hidden; }
.bar-fill { width: 100%; border-radius: 6px 6px 3px 3px; background: linear-gradient(180deg, #8c7bff, #4f8cff 60%, rgba(79, 140, 255, .35)); min-height: 2px; transition: height .5s cubic-bezier(.2,.8,.2,1); box-shadow: 0 0 24px rgba(124, 92, 255, .25); }
.bar-col:hover .bar-fill { filter: brightness(1.16); }
.bar-label { color: var(--faint); font-size: 10.5px; white-space: nowrap; font-family: var(--mono); }
.bar-value { color: var(--muted); font-size: 10.5px; font-family: var(--mono); opacity: 0; transition: opacity .15s; }
.bar-col:hover .bar-value { opacity: 1; }

/* table */
.table-wrap { width: 100%; overflow-x: auto; border-radius: 12px; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; min-width: 620px; }
thead th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 550;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
  background: rgba(5, 8, 16, .45);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
tbody td { padding: 13px 16px; border-bottom: 1px solid rgba(148, 163, 214, .07); font-size: 12.5px; color: #cbd3e8; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(148, 163, 214, .035); }
td.right, th.right { text-align: right; }
td.mono, th.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.table-empty { padding: 54px 20px; text-align: center; color: var(--faint); }

/* empty */
.empty { padding: 56px 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; color: var(--faint); text-align: center; }
.empty-icon { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; background: rgba(148, 163, 214, .05); border: 1px solid var(--line); color: var(--muted); }
.empty b { color: var(--muted); font-weight: 550; font-size: 13px; }
.empty span { font-size: 12px; max-width: 360px; }

/* pagination */
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 18px; color: var(--muted); font-size: 12px; }
.page-btns { display: flex; gap: 6px; }
.page-btn { min-width: 32px; height: 32px; padding: 0 9px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 12px; }
.page-btn:hover:not(:disabled) { background: rgba(148, 163, 214, .07); color: var(--txt); }
.page-btn.active { background: rgba(124, 92, 255, .16); border-color: rgba(124, 92, 255, .3); color: #d8d2ff; }
.page-btn:disabled { opacity: .35; cursor: not-allowed; }

/* forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-note { padding: 12px 14px; border-radius: 10px; background: rgba(245, 199, 106, .06); border: 1px solid rgba(245, 199, 106, .16); color: #f5d99b; font-size: 12px; line-height: 1.6; }
.form-note.danger { background: rgba(255, 107, 129, .06); border-color: rgba(255, 107, 129, .16); color: #fda4af; }
.form-note.info { background: rgba(79, 140, 255, .06); border-color: rgba(79, 140, 255, .16); color: #b7ccff; }
.form-note.success { background: rgba(74, 222, 128, .07); border-color: rgba(74, 222, 128, .18); color: #86efac; }

/* email verification code row */
.code-row { display: flex; gap: 9px; align-items: stretch; }
.code-row .input { flex: 1; min-width: 0; letter-spacing: .18em; font-size: 15px; }
.code-send { flex: none; height: 42px; padding: 0 14px; font-size: 12.5px; min-width: 108px; }
.code-send:disabled { opacity: .55; }

.auth-back {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-bottom: 12px;
  padding: 4px 9px 4px 5px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 11.5px;
  transition: .18s;
}
.auth-back:hover { color: var(--txt); border-color: var(--line-strong); background: rgba(148, 163, 214, .06); }

/* code */
.code-block { position: relative; border-radius: 12px; border: 1px solid var(--line); background: #070b14; overflow: hidden; }
.code-head { display: flex; align-items: center; justify-content: space-between; height: 38px; padding: 0 12px 0 14px; border-bottom: 1px solid var(--line); color: var(--faint); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.code-body { margin: 0; padding: 16px; overflow-x: auto; color: #b8c6e6; font-family: var(--mono); font-size: 12px; line-height: 1.75; white-space: pre; }
.code-body .tok-key { color: #c4b5fd; }
.code-body .tok-str { color: #99f6e4; }
.code-body .tok-cm { color: #5c6784; }
.code-body .tok-num { color: #f5c76a; }
.copy-btn { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border-radius: 6px; border: 1px solid var(--line); background: rgba(148, 163, 214, .05); color: var(--muted); font-size: 11px; }
.copy-btn:hover { color: var(--txt); border-color: var(--line-strong); }

/* keys */
.keys-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.key-card { padding: 20px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.key-card.revoked { opacity: .55; }
.key-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.key-name { display: flex; align-items: center; gap: 9px; font-weight: 550; font-size: 13px; }
.key-value { font-family: var(--mono); font-size: 12px; color: #aeb8d4; padding: 10px 12px; border-radius: 8px; background: rgba(5, 8, 16, .5); border: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.key-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin-top: 14px; font-size: 11.5px; color: var(--faint); }
.key-meta b { color: var(--muted); font-weight: 500; }

/* usage */
.filter-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.filter-row .input, .filter-row .select { width: auto; min-width: 150px; height: 36px; font-size: 12.5px; }
.filter-row .input.wide { min-width: 220px; flex: 1; }
.summary-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.summary-item { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: rgba(148, 163, 214, .03); }
.summary-item span { display: block; color: var(--faint); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.summary-item b { display: block; margin-top: 5px; font-family: var(--mono); font-size: 18px; font-weight: 550; }

/* modal */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(2, 4, 9, .7);
  backdrop-filter: blur(7px);
  animation: fadeIn .18s ease-out;
}
.modal {
  width: 100%;
  max-width: 520px;
  max-height: min(86vh, 800px);
  overflow-y: auto;
  background: linear-gradient(180deg, #111829, #0b101d);
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(0,0,0,.6);
  animation: modalUp .22s cubic-bezier(.2,.8,.2,1);
}
.modal.wide { max-width: 720px; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 24px 0; }
.modal-head h3 { margin: 0 0 4px; font-size: 18px; letter-spacing: -.02em; }
.modal-head p { margin: 0; color: var(--muted); font-size: 12px; }
.modal-body { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 0 24px 24px; }
.modal-close { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); display: grid; place-items: center; }
.modal-close:hover { color: var(--txt); background: rgba(148, 163, 214, .07); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalUp { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }

/* toast */
.toasts { position: fixed; top: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 9px; width: min(360px, calc(100vw - 36px)); pointer-events: none; }
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: rgba(15, 21, 37, .96);
  box-shadow: 0 14px 44px rgba(0,0,0,.42);
  color: var(--txt);
  font-size: 12.5px;
  line-height: 1.55;
  pointer-events: auto;
  animation: toastIn .24s cubic-bezier(.2,.8,.2,1);
}
.toast .dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; flex: none; background: var(--cyan); box-shadow: 0 0 10px currentColor; }
.toast.success .dot { background: var(--green); color: var(--green); }
.toast.error .dot { background: var(--red); color: var(--red); }
.toast.info .dot { background: var(--blue); color: var(--blue); }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }

/* playground */
.playground { display: grid; grid-template-columns: 300px 1fr; gap: 18px; align-items: stretch; }
.pg-side { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.pg-side h3 { margin: 0; font-size: 14px; }
.pg-chat { display: flex; flex-direction: column; min-height: 620px; height: calc(100vh - 190px); max-height: 860px; overflow: hidden; }
.chat-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 20px; border-bottom: 1px solid var(--line); }
.chat-head .model { font-family: var(--mono); font-size: 12px; color: #c4b5fd; }
.chat-model-select { width: auto; min-width: 150px; max-width: 240px; height: 30px; font-size: 12px; padding: 0 28px 0 9px; background-position: calc(100% - 17px) 12px, calc(100% - 12px) 12px; }
.chat-body { flex: 1; overflow-y: auto; padding: 22px 20px; display: flex; flex-direction: column; gap: 18px; background: radial-gradient(600px 300px at 50% 0%, rgba(124, 92, 255, .035), transparent 70%); }
.msg { display: flex; gap: 11px; max-width: 92%; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar { width: 30px; height: 30px; border-radius: 9px; flex: none; display: grid; place-items: center; font-size: 11px; font-weight: 600; border: 1px solid var(--line-strong); color: var(--muted); }
.msg.assistant .msg-avatar { background: var(--grad-soft); color: #d8d2ff; }
.msg.user .msg-avatar { background: rgba(45, 212, 191, .1); color: #99f6e4; }
.msg-content { padding: 12px 15px; border-radius: 13px; background: rgba(148, 163, 214, .055); border: 1px solid var(--line); color: #d7ddef; font-size: 13px; line-height: 1.75; overflow-wrap: anywhere; }
.msg.user .msg-content { background: rgba(124, 92, 255, .13); border-color: rgba(124, 92, 255, .22); }
.msg-content pre { margin: 8px 0; padding: 12px; border-radius: 8px; background: #060a12; border: 1px solid var(--line); overflow-x: auto; font-family: var(--mono); font-size: 12px; }
.msg-content code { font-family: var(--mono); font-size: .92em; color: #99f6e4; }
.msg-meta { margin-top: 6px; color: var(--faint); font-size: 10.5px; font-family: var(--mono); }
.typing { display: inline-flex; gap: 3px; padding: 4px 0; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--muted); animation: typing 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes typing { 0%,60%,100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }
.chat-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--faint); text-align: center; }
.chat-empty .orb { width: 56px; height: 56px; border-radius: 18px; background: var(--grad-soft); border: 1px solid rgba(124, 92, 255, .22); display: grid; place-items: center; color: #c4b5fd; }
.chat-foot { padding: 14px 16px 16px; border-top: 1px solid var(--line); background: rgba(5, 8, 16, .35); }
.composer { display: flex; gap: 10px; align-items: flex-end; padding: 8px; border-radius: 13px; border: 1px solid var(--line-strong); background: rgba(5, 8, 16, .58); }
.composer textarea { flex: 1; border: 0; background: transparent; color: var(--txt); outline: none; resize: none; min-height: 44px; max-height: 150px; padding: 10px 10px; line-height: 1.6; font-size: 13px; }
.composer .send { width: 38px; height: 38px; border-radius: 9px; border: 0; background: var(--grad); color: #fff; display: grid; place-items: center; flex: none; }
.composer .send:disabled { opacity: .4; }
.chat-usage { display: flex; align-items: center; gap: 14px; padding: 0 3px 9px; color: var(--faint); font-size: 10.5px; font-family: var(--mono); flex-wrap: wrap; }
.chat-usage b { color: var(--muted); font-weight: 500; }
.pg-tip { color: var(--faint); font-size: 11px; line-height: 1.65; }
.slider-row { display: flex; align-items: center; gap: 12px; }
.slider-row input[type=range] { flex: 1; accent-color: var(--violet); }
.slider-val { width: 38px; text-align: right; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--muted); }
.switch input { width: 36px; height: 20px; appearance: none; border-radius: 99px; background: rgba(148, 163, 214, .18); position: relative; outline: none; cursor: pointer; transition: .2s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked { background: var(--violet); }
.switch input:checked::after { transform: translateX(16px); }

/* docs */
.docs-layout { display: grid; grid-template-columns: 210px 1fr; gap: 34px; align-items: start; }
.docs-toc { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 2px; }
.docs-toc a { padding: 7px 12px; border-radius: 7px; color: var(--muted); font-size: 12.5px; border-left: 2px solid transparent; }
.docs-toc a:hover { color: var(--txt); background: rgba(148, 163, 214, .05); }
.docs-toc a.active { color: #c4b5fd; border-left-color: var(--violet); background: rgba(124, 92, 255, .07); }
.docs-content { min-width: 0; }
.doc-section { padding: 26px; margin-bottom: 18px; scroll-margin-top: 96px; }
.doc-section h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: -.025em; }
.doc-section h3 { margin: 24px 0 10px; font-size: 15px; }
.doc-section p { color: var(--muted); font-size: 13px; line-height: 1.8; }
.doc-section ul { color: var(--muted); font-size: 13px; line-height: 1.9; padding-left: 20px; }
.doc-section code.inline { padding: 2px 6px; border-radius: 5px; background: rgba(148, 163, 214, .08); color: #c4b5fd; font-family: var(--mono); font-size: 12px; }
.endpoint { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border-radius: 9px; border: 1px solid var(--line); background: rgba(5, 8, 16, .4); font-family: var(--mono); font-size: 12px; margin: 12px 0; }
.method { padding: 3px 7px; border-radius: 5px; background: rgba(74, 222, 128, .12); color: #86efac; font-size: 10px; font-weight: 600; }
.error-table td:first-child { font-family: var(--mono); color: #fda4af; white-space: nowrap; }

/* misc */
.feature-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 20px; }
.feature { padding: 16px; border-radius: 12px; border: 1px solid var(--line); background: rgba(148, 163, 214, .025); }
.feature b { display: block; font-size: 12.5px; margin-bottom: 4px; }
.feature span { color: var(--faint); font-size: 11.5px; line-height: 1.6; }
.loading-dots { display: inline-flex; gap: 4px; }
.loading-dots i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: typing 1.2s infinite; }
.loading-dots i:nth-child(2) { animation-delay: .15s; }
.loading-dots i:nth-child(3) { animation-delay: .3s; }
.hide-sm { display: initial; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .auth-main { display: flex; flex-direction: column; gap: 28px; padding-top: 0; }
  .auth-card { order: -1; margin: 0 auto; width: 100%; max-width: 430px; }
  .auth-hero { order: 1; }
  .auth-hero h1 { font-size: 40px; }
  .dash-grid, .panel-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .playground { grid-template-columns: 260px 1fr; }
}
@media (max-width: 820px) {
  .container { width: calc(100% - 32px); }
  .topbar-inner { height: 60px; gap: 14px; }
  .brand-name em { display: none; }
  .nav { gap: 0; }
  .nav-link { padding: 0 9px; font-size: 12px; }
  .nav-link svg { display: none; }
  .balance-chip .lbl { display: none; }
  .page { padding: 26px 0 56px; }
  .page-head h1 { font-size: 23px; }
  .keys-grid { grid-template-columns: 1fr; }
  .playground { grid-template-columns: 1fr; }
  .pg-chat { height: 70vh; min-height: 520px; }
  .pg-side { order: 2; }
  .docs-layout { grid-template-columns: 1fr; gap: 18px; }
  .docs-toc { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .docs-toc a { white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; }
  .docs-toc a.active { border-bottom-color: var(--violet); }
  .auth-stats { gap: 22px; }
  .feature-strip { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .auth-main { padding-bottom: 28px; gap: 20px; }
  .auth-hero h1 { font-size: 30px; }
  .auth-lead { font-size: 13px; }
  .auth-card { padding: 20px; border-radius: 18px; }
  .auth-points { display: none; }
  .auth-stats { display: none; }
  .auth-hero { margin-top: 8px; }
  .top-right .btn { display: none; }
  .top-right { gap: 8px; }
  .balance-chip { font-size: 11.5px; padding: 0 9px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 15px; }
  .stat-value { font-size: 20px; }
  .summary-row { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .modal { max-height: 92vh; }
  .modal-body { padding: 18px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .bar-chart { height: 140px; gap: 5px; }
  .bar-label { font-size: 9px; }
  .msg { max-width: 100%; }
  .chat-body { padding: 16px 12px; }
  .chat-head { padding: 12px 14px; }
  .chat-foot { padding: 10px; }
}
