/* ==========================================================================
   Bazi API — Atelier Observatory Design System (v30)
   Light: Warm Ivory (#F7F4EE) · Deep Indigo Ink (#1D3B62) · Burnished Brass (#B4741E)
   Dark:  Obsidian Ink (#0E0D0B) · Starlight Brass (#E4AD56) · Verdigris (#57CBBD)
   Covers: Public Portal · Hero Workbench · Bento · Spotlight Catalog · Command K
           AI Chat Studio · User Console · Standalone Operations Command Center
   ========================================================================== */

:root {
  --bg: #f7f4ee;
  --bg-alt: #efe9de;
  --surface: #ffffff;
  --surface-2: #fbf8f3;
  --surface-hover: #f6f1e7;
  --surface-subtle: #f2ece1;
  --surface-glass: rgba(255, 253, 249, 0.82);

  --border: rgba(58, 44, 28, 0.1);
  --border-strong: rgba(58, 44, 28, 0.2);
  --border-focus: rgba(36, 81, 133, 0.45);

  --ink: #181614;
  --ink-2: #524a41;
  --ink-3: #857a6d;

  --primary-bg: #1d3b62;
  --primary-bg-hover: #142b49;
  --primary-ink: #fffdf9;

  --accent: #245185;
  --accent-hover: #193c66;
  --accent-soft: rgba(36, 81, 133, 0.1);
  --brand-text: #245185;

  --gold: #b4741e;
  --gold-ink: #8a540d;
  --gold-soft: rgba(180, 116, 30, 0.11);
  --gold-border: rgba(180, 116, 30, 0.3);

  --teal: #166961;
  --teal-soft: rgba(22, 105, 97, 0.1);
  --teal-border: rgba(22, 105, 97, 0.28);

  --claude: #b54f24;
  --claude-soft: rgba(181, 79, 36, 0.1);
  --claude-border: rgba(181, 79, 36, 0.28);

  --ok: #237a52;
  --ok-soft: rgba(35, 122, 82, 0.11);
  --warn: #b86d14;
  --warn-soft: rgba(184, 109, 20, 0.12);
  --bad: #c23f32;
  --bad-soft: rgba(194, 63, 50, 0.1);

  --shadow-xs: 0 1px 2px rgba(38, 28, 16, 0.04);
  --shadow-sm: 0 4px 14px -2px rgba(38, 28, 16, 0.06), 0 1px 3px rgba(38, 28, 16, 0.04);
  --shadow-md: 0 18px 42px -12px rgba(32, 24, 14, 0.13), 0 3px 10px rgba(32, 24, 14, 0.05);
  --shadow-lg: 0 28px 68px -16px rgba(24, 18, 10, 0.24), 0 4px 16px rgba(24, 18, 10, 0.08);
  --spotlight: rgba(180, 116, 30, 0.09);
  --spotlight-border: rgba(180, 116, 30, 0.34);

  --radius-xs: 7px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --radius-pill: 999px;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast: 0.16s cubic-bezier(0.22, 1, 0.36, 1);
  --t-med: 0.28s cubic-bezier(0.22, 1, 0.36, 1);

  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", Georgia, serif;
  --font-sans: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", ui-monospace, Consolas, monospace;

  --nav-bg: rgba(247, 244, 238, 0.82);
  --dot-color: rgba(112, 88, 58, 0.14);
  --backdrop: rgba(20, 16, 12, 0.48);
}

html[data-theme="dark"] {
  --bg: #0e0d0b;
  --bg-alt: #14120f;
  --surface: #181613;
  --surface-2: #1d1a16;
  --surface-hover: #231f1a;
  --surface-subtle: #221e19;
  --surface-glass: rgba(24, 22, 19, 0.82);

  --border: rgba(240, 222, 196, 0.09);
  --border-strong: rgba(240, 222, 196, 0.18);
  --border-focus: rgba(228, 173, 86, 0.45);

  --ink: #f5f0e8;
  --ink-2: #b5aba0;
  --ink-3: #7e7469;

  --primary-bg: #e4ad56;
  --primary-bg-hover: #f0be6d;
  --primary-ink: #17120a;

  --accent: #7fb2ea;
  --accent-hover: #9ec6f3;
  --accent-soft: rgba(127, 178, 234, 0.14);
  --brand-text: #e8b663;

  --gold: #e6b15c;
  --gold-ink: #f3c87d;
  --gold-soft: rgba(230, 177, 92, 0.14);
  --gold-border: rgba(230, 177, 92, 0.34);

  --teal: #57cbbd;
  --teal-soft: rgba(87, 203, 189, 0.14);
  --teal-border: rgba(87, 203, 189, 0.34);

  --claude: #f09c6e;
  --claude-soft: rgba(240, 156, 110, 0.14);
  --claude-border: rgba(240, 156, 110, 0.34);

  --ok: #55cb94;
  --ok-soft: rgba(85, 203, 148, 0.14);
  --warn: #eca84e;
  --warn-soft: rgba(236, 168, 78, 0.15);
  --bad: #ec7b6e;
  --bad-soft: rgba(236, 123, 110, 0.15);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.42);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.38);
  --shadow-md: 0 20px 48px -12px rgba(0, 0, 0, 0.65);
  --shadow-lg: 0 32px 76px -14px rgba(0, 0, 0, 0.82);
  --spotlight: rgba(230, 177, 92, 0.08);
  --spotlight-border: rgba(230, 177, 92, 0.3);

  --nav-bg: rgba(14, 13, 11, 0.82);
  --dot-color: rgba(230, 194, 142, 0.09);
  --backdrop: rgba(4, 3, 2, 0.72);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: clip;
  transition: background-color 0.22s ease, color 0.22s ease;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; color: inherit; }
button:focus:not(:focus-visible), a:focus:not(:focus-visible) { outline: none; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code, pre, .mono { font-family: var(--font-mono); }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Keyframes & Micro-Animations ---------- */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes floatOrb {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(18px, -16px, 0) scale(1.06); }
}

@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(35, 122, 82, 0.45); }
  60% { box-shadow: 0 0 0 6px rgba(35, 122, 82, 0); }
}

@keyframes cursorBlink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes typingBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.38; }
  40% { transform: translateY(-4px); opacity: 1; }
}

@keyframes shimmerSweep {
  0% { transform: translateX(-120%) skewX(-18deg); }
  100% { transform: translateX(240%) skewX(-18deg); }
}

.anim-rise { animation: riseIn 0.42s var(--ease-out) both; }
.anim-d1 { animation-delay: 0.05s; }
.anim-d2 { animation-delay: 0.1s; }
.anim-d3 { animation-delay: 0.15s; }

/* ---------- Pointer-Reactive Spotlight Surface ---------- */
.spotlight-card {
  position: relative;
  overflow: hidden;
}
.spotlight-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    360px circle at var(--mx, 50%) var(--my, -200px),
    var(--spotlight),
    transparent 65%
  );
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.spotlight-card:hover::after {
  opacity: 1;
}

/* ---------- Buttons & Interactive Controls ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
  white-space: nowrap;
  user-select: none;
}
.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { opacity: 0.52; cursor: not-allowed; transform: none !important; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 14px; border-radius: 12px; gap: 8px; }
.btn-sm { height: 31px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn-xs { height: 26px; padding: 0 9px; font-size: 11.5px; border-radius: 7px; }
.btn-full { width: 100%; }

.btn-primary {
  background: var(--primary-bg);
  color: var(--primary-ink);
  box-shadow: 0 2px 10px rgba(29, 59, 98, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-bg-hover);
  transform: translateY(-1.5px);
  box-shadow: 0 8px 20px -4px rgba(29, 59, 98, 0.32);
}
html[data-theme="dark"] .btn-primary {
  box-shadow: 0 2px 12px rgba(228, 173, 86, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
html[data-theme="dark"] .btn-primary:hover:not(:disabled) {
  box-shadow: 0 8px 22px -4px rgba(228, 173, 86, 0.36);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--ink-3);
  transform: translateY(-1px);
}
.btn.is-copied {
  background: var(--ok-soft) !important;
  color: var(--ok) !important;
  border-color: var(--ok) !important;
}

.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-subtle); color: var(--ink); }

.btn-danger {
  background: var(--bad-soft);
  color: var(--bad);
  border-color: rgba(194, 63, 50, 0.2);
}
.btn-danger:hover:not(:disabled) { background: var(--bad); color: #ffffff; }

.btn-pro {
  background: linear-gradient(135deg, #1d3b62, #2f5b8f);
  color: #fffdf9 !important;
  border: 0;
  box-shadow: 0 2px 10px rgba(29, 59, 98, 0.22);
}
.btn-pro:hover:not(:disabled) {
  background: linear-gradient(135deg, #152d4d, #244a78);
  transform: translateY(-1.5px);
  box-shadow: 0 6px 16px rgba(29, 59, 98, 0.3);
}
html[data-theme="dark"] .btn-pro {
  background: linear-gradient(135deg, #e4ad56, #c6882c);
  color: #17120a !important;
}

.btn-anticut {
  background: linear-gradient(135deg, #166961, #23867c);
  color: #fdfbf7 !important;
  border: 0;
  box-shadow: 0 2px 10px rgba(22, 105, 97, 0.2);
}
.btn-anticut:hover:not(:disabled) {
  background: linear-gradient(135deg, #11524c, #1b6d65);
  transform: translateY(-1.5px);
}
html[data-theme="dark"] .btn-anticut {
  background: linear-gradient(135deg, #57cbbd, #3aa195);
  color: #0d1d1b !important;
}

.btn-claude {
  background: linear-gradient(135deg, #b54f24, #cf6c39);
  color: #fffdf9 !important;
  border: 0;
  box-shadow: 0 2px 10px rgba(181, 79, 36, 0.22);
}
.btn-claude:hover:not(:disabled) {
  background: linear-gradient(135deg, #963f1a, #b55828);
  transform: translateY(-1.5px);
}
html[data-theme="dark"] .btn-claude {
  background: linear-gradient(135deg, #f09c6e, #d57948);
  color: #1b100a !important;
}

.btn-alipay {
  background: linear-gradient(135deg, #1677ff, #1d3b62);
  color: #ffffff !important;
  border: 0;
  box-shadow: 0 4px 14px rgba(22, 119, 255, 0.26);
}
.btn-alipay:hover:not(:disabled) {
  background: linear-gradient(135deg, #0958d9, #152d4d);
  transform: translateY(-1.5px);
  box-shadow: 0 8px 20px rgba(22, 119, 255, 0.34);
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--t-fast);
  flex-shrink: 0;
}
.icon-btn:hover { border-color: var(--border-strong); color: var(--ink); background: var(--surface-hover); transform: translateY(-1px); }

.icon-sun { display: none; }
.icon-moon { display: block; }
html[data-theme="dark"] .icon-sun { display: block; }
html[data-theme="dark"] .icon-moon { display: none; }

/* ---------- Badges & Status ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--ink-2);
  white-space: nowrap;
  line-height: 1.45;
}
.badge.ok, .badge.badge-success { background: var(--ok-soft); color: var(--ok); border-color: rgba(35, 122, 82, 0.2); }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(184, 109, 20, 0.22); }
.badge.bad { background: var(--bad-soft); color: var(--bad); border-color: rgba(194, 63, 50, 0.22); }
.badge.accent { background: var(--accent-soft); color: var(--accent); border-color: rgba(36, 81, 133, 0.2); }
.badge.pro {
  background: var(--gold-soft);
  color: var(--gold-ink);
  border-color: var(--gold-border);
}
.badge.badge-reasoning {
  background: rgba(164, 74, 48, 0.11);
  color: #9e4322;
  border-color: rgba(164, 74, 48, 0.28);
}
html[data-theme="dark"] .badge.badge-reasoning {
  background: rgba(235, 134, 92, 0.16);
  color: #f3ad88;
  border-color: rgba(235, 134, 92, 0.34);
}
.badge.badge-anticut {
  background: var(--teal-soft);
  color: var(--teal);
  border-color: var(--teal-border);
}
.badge.badge-claude {
  background: var(--claude-soft);
  color: var(--claude);
  border-color: var(--claude-border);
}
.badge.badge-billing.call {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(36, 81, 133, 0.22);
}
.badge.badge-billing.token {
  background: rgba(28, 112, 126, 0.1);
  color: #196875;
  border-color: rgba(28, 112, 126, 0.24);
}
html[data-theme="dark"] .badge.badge-billing.token {
  background: rgba(92, 198, 206, 0.15);
  color: #7ad8df;
  border-color: rgba(92, 198, 206, 0.32);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  display: inline-block;
  flex-shrink: 0;
  animation: statusPulse 2.6s infinite;
}
.status-dot.degraded { background: var(--warn); animation: none; }
.status-dot.down { background: var(--bad); animation: none; }

/* ---------- Form Elements ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.field-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field-hint { font-size: 12px; color: var(--ink-3); line-height: 1.45; }

.input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 13.5px;
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background-color var(--t-fast);
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-sm { height: 34px; font-size: 13px; }
.input-row { display: flex; gap: 8px; align-items: center; }
.input-row .input { flex: 1; min-width: 0; }

.slider {
  width: 100%;
  height: 6px;
  accent-color: var(--primary-bg);
  cursor: pointer;
  border-radius: 99px;
}

.alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.55;
  border: 1px solid transparent;
}
.alert.error { background: var(--bad-soft); color: var(--bad); border-color: rgba(194, 63, 50, 0.2); }
.alert.warn { background: var(--warn-soft); color: var(--warn); border-color: rgba(184, 109, 20, 0.25); }
.alert.ok { background: var(--ok-soft); color: var(--ok); border-color: rgba(35, 122, 82, 0.2); }
.alert.info { background: var(--accent-soft); color: var(--accent); border-color: rgba(36, 81, 133, 0.2); }

/* ---------- Brand Identity ---------- */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(145deg, #1d3b62, #2f5b8f);
  color: #fffaf0;
  box-shadow: 0 3px 10px rgba(29, 59, 98, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--t-fast);
}
.brand:hover .brand-mark { transform: rotate(-4deg) scale(1.04); }
html[data-theme="dark"] .brand-mark {
  background: linear-gradient(145deg, #e4ad56, #b87924);
  color: #17120a;
  box-shadow: 0 3px 12px rgba(228, 173, 86, 0.26);
}

/* ==========================================================================
   PUBLIC NAVBAR & MOBILE DRAWER
   ========================================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.nav-left {
  display: flex;
  align-items: center;
  gap: 24px;
}
.nav-links {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border-radius: var(--radius-pill);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}
.nav-links a {
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  transition: all var(--t-fast);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.nav-actions { display: flex; align-items: center; gap: 8px; }

.cmd-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 33px;
  padding: 0 10px 0 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast);
}
.cmd-trigger-btn:hover {
  border-color: var(--border-strong);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}
.cmd-kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--ink-2);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 33px;
  padding: 0 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}

.user-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 13px 0 5px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--t-fast);
}
.user-pill:hover { background: var(--surface-hover); transform: translateY(-1px); }

.avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary-bg);
  color: var(--primary-ink);
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pub-mobile-toggle { display: none; }

.pub-mobile-drawer {
  display: none;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 12px 20px 16px;
  animation: riseIn 0.2s var(--ease-out);
}
.pub-mobile-drawer.open { display: block; }
.pub-mobile-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.pub-mobile-links a {
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
}
.pub-mobile-links a.active, .pub-mobile-links a:hover {
  background: var(--surface-subtle);
  color: var(--ink);
}
.pub-mobile-foot {
  display: flex;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.pub-mobile-foot .btn { flex: 1; }

/* ==========================================================================
   ASYMMETRIC INTERACTIVE HERO & SHOWCASE STAGE
   ========================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  padding: 56px 0 52px;
  border-bottom: 1px solid var(--border);
}

.hero-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(68px);
  pointer-events: none;
  z-index: 0;
  animation: floatOrb 14s ease-in-out infinite;
}
.hero-orb-1 {
  width: 460px;
  height: 460px;
  top: -160px;
  left: -80px;
  background: rgba(226, 174, 92, 0.22);
}
.hero-orb-2 {
  width: 440px;
  height: 440px;
  top: -100px;
  right: -60px;
  background: rgba(58, 112, 176, 0.16);
  animation-delay: -6s;
}
.hero-orb-3 {
  width: 320px;
  height: 320px;
  bottom: -140px;
  left: 42%;
  background: rgba(22, 105, 97, 0.11);
  animation-delay: -3s;
}
html[data-theme="dark"] .hero-orb-1 { background: rgba(228, 173, 86, 0.11); }
html[data-theme="dark"] .hero-orb-2 { background: rgba(74, 134, 204, 0.11); }
html[data-theme="dark"] .hero-orb-3 { background: rgba(87, 203, 189, 0.08); }

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--dot-color) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: radial-gradient(ellipse 82% 78% at 50% 28%, #000 35%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 82% 78% at 50% 28%, #000 35%, transparent 100%);
  pointer-events: none;
}

.hero-stage {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.06fr 0.94fr;
  gap: 38px;
  align-items: center;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.announcement-pill {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 13px 4px 5px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--gold-border);
  background: linear-gradient(135deg, var(--gold-soft), rgba(216, 156, 68, 0.14));
  font-size: 12.5px;
  color: var(--ink);
  margin-bottom: 18px;
  transition: all var(--t-fast);
}
.announcement-pill::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 36%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  animation: shimmerSweep 4.8s ease-in-out infinite;
  pointer-events: none;
}
html[data-theme="dark"] .announcement-pill::before {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.14), transparent);
}
.announcement-pill:hover {
  transform: translateY(-1px);
  border-color: var(--gold);
  box-shadow: var(--shadow-xs);
}
.announcement-tag {
  padding: 2px 9px;
  background: var(--gold);
  color: #fffdf9;
  font-size: 11px;
  font-weight: 700;
  border-radius: var(--radius-pill);
}
html[data-theme="dark"] .announcement-tag { color: #17120a; }
.announcement-text { font-weight: 500; color: var(--ink-2); }
.announcement-text strong { color: var(--gold-ink); font-weight: 700; }
.announcement-arrow { display: inline-flex; color: var(--gold); transition: transform var(--t-fast); }
.announcement-pill:hover .announcement-arrow { transform: translateX(3px); }

.hero-title {
  margin: 0 0 14px;
  font-family: var(--font-serif);
  font-size: clamp(27px, 3.3vw, 40px);
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.hero-title-accent {
  background: linear-gradient(125deg, var(--primary-bg) 10%, var(--teal) 55%, var(--gold) 98%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
html[data-theme="dark"] .hero-title-accent {
  background: linear-gradient(125deg, #f5f0e8 5%, #e6b15c 52%, #57cbbd 98%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-desc {
  margin: 0 0 24px;
  max-width: 520px;
  font-size: 15px;
  line-height: 1.72;
  color: var(--ink-2);
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

/* Interactive Multi-Protocol Endpoint Capsule */
.endpoint-capsule {
  width: 100%;
  max-width: 540px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.endpoint-proto-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.endpoint-proto-tabs {
  display: inline-flex;
  gap: 3px;
  background: var(--surface-subtle);
  padding: 2px;
  border-radius: 8px;
}
.endpoint-proto-tabs button {
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--t-fast);
}
.endpoint-proto-tabs button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}
.endpoint-proto-hint {
  font-size: 11px;
  color: var(--ink-3);
  font-family: var(--font-mono);
}
.endpoint-url-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 6px 3px 8px;
}
.endpoint-url {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
}
.copy-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 29px;
  padding: 0 11px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface-subtle);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
  flex-shrink: 0;
}
.copy-pill:hover { background: var(--primary-bg); color: var(--primary-ink); border-color: var(--primary-bg); }
.copy-pill.is-copied { background: var(--ok-soft); color: var(--ok); border-color: var(--ok); }

/* Right Column: Interactive Hero Workbench Window */
.showcase-window {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 382px;
}
.showcase-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
}
.showcase-dots {
  display: flex;
  gap: 6px;
}
.showcase-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  background: var(--border-strong);
}
.showcase-dots i:nth-child(1) { background: #e57368; }
.showcase-dots i:nth-child(2) { background: #e8b354; }
.showcase-dots i:nth-child(3) { background: #5ebc89; }

.showcase-tabs {
  display: inline-flex;
  gap: 3px;
  padding: 2px;
  border-radius: 9px;
  background: var(--bg);
  border: 1px solid var(--border);
}
.showcase-tabs button {
  height: 27px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
}
.showcase-tabs button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.showcase-body {
  flex: 1;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}

.demo-scene-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.demo-scene-pills button {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
}
.demo-scene-pills button:hover { color: var(--ink); border-color: var(--border-strong); }
.demo-scene-pills button.active {
  background: var(--primary-bg);
  color: var(--primary-ink);
  border-color: var(--primary-bg);
}

.demo-chat-box {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 13px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--border);
  min-height: 218px;
}
.demo-user-line {
  align-self: flex-end;
  max-width: 88%;
  padding: 7px 12px;
  border-radius: 12px 12px 3px 12px;
  background: var(--primary-bg);
  color: var(--primary-ink);
  font-size: 12.5px;
  line-height: 1.5;
}
.demo-think-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--gold-ink);
  background: var(--gold-soft);
  border: 1px solid var(--gold-border);
  padding: 3px 9px;
  border-radius: 7px;
  align-self: flex-start;
}
.demo-ai-line {
  font-size: 13px;
  line-height: 1.72;
  color: var(--ink);
  font-family: var(--font-serif);
}
.demo-cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  margin-left: 2px;
  vertical-align: -2px;
  background: var(--gold);
  border-radius: 2px;
  animation: cursorBlink 0.9s infinite;
}
.demo-foot-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 11.5px;
  color: var(--ink-3);
}

/* Showcase Tab 2: Visual SillyTavern Config */
.st-visual-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.st-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.st-field-lbl { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.st-field-val { font-size: 12.5px; font-weight: 600; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; }
.st-model-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.st-model-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  text-align: left;
  transition: all var(--t-fast);
}
.st-model-chip:hover { border-color: var(--accent); background: var(--surface-hover); transform: translateY(-1px); }
.st-model-chip code { font-size: 11.5px; font-weight: 600; color: var(--ink); }
.st-model-chip span { font-size: 10.5px; color: var(--ink-3); white-space: nowrap; }

/* Showcase Tab 3: Route Matrix */
.route-compare-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.route-compare-item {
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: all var(--t-fast);
}
.route-compare-item:hover {
  border-color: var(--border-strong);
  transform: translateX(3px);
  background: var(--surface-hover);
}
.route-compare-item strong { display: block; font-size: 13px; margin-bottom: 2px; }
.route-compare-item p { margin: 0; font-size: 12px; color: var(--ink-2); }

/* ---------- Bento Metrics Strip ---------- */
.bento-strip {
  position: relative;
  z-index: 1;
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.bento-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 17px 19px;
  box-shadow: var(--shadow-xs);
  display: flex;
  align-items: flex-start;
  gap: 13px;
  transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}
.bento-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.bento-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--primary-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
html[data-theme="dark"] .bento-icon { color: var(--gold); }
.bento-icon.is-teal { background: var(--teal-soft); border-color: var(--teal-border); color: var(--teal); }
.bento-icon.is-gold { background: var(--gold-soft); border-color: var(--gold-border); color: var(--gold-ink); }
.bento-icon.is-ok { background: var(--ok-soft); border-color: rgba(35, 122, 82, 0.24); color: var(--ok); }
.bento-meta { min-width: 0; }
.bento-val {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.bento-lbl { font-size: 12px; color: var(--ink-2); margin-top: 3px; }

/* ==========================================================================
   SECTIONS & MODEL CATALOG
   ========================================================================== */
.section { padding: 64px 0; }
.section-sm { padding: 38px 0 64px; }
.section-alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}
.section-title {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.8vw, 30px);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
}
.section-sub { margin: 0; color: var(--ink-2); font-size: 14px; max-width: 560px; }

/* Filter & Search Bar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 20px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}
.search-box {
  flex: 1 1 230px;
  max-width: 340px;
  height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  transition: all var(--t-fast);
}
.search-box:focus-within {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-box input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
}
.search-clear-btn {
  border: 0;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 14px;
  line-height: 1;
}
.search-clear-btn:hover { color: var(--ink); }

.toolbar-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
}
.segmented button {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.segmented button:hover { color: var(--ink); }
.segmented button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}
.seg-count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  opacity: 0.7;
}

/* Catalog Groups & Cards */
.catalog-group { display: flex; flex-direction: column; gap: 13px; }
.catalog-group + .catalog-group {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px dashed var(--border-strong);
}
.catalog-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.catalog-group-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.catalog-group-title strong {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
}
.catalog-group-count {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
}
.catalog-group-desc { font-size: 12.5px; color: var(--ink-3); }

.models-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.model-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 18px 15px;
  box-shadow: var(--shadow-xs);
  transition: transform var(--t-med), border-color var(--t-med), box-shadow var(--t-med);
  min-width: 0;
}
.model-card:hover {
  transform: translateY(-3px);
  border-color: var(--spotlight-border);
  box-shadow: var(--shadow-md);
}
.model-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  opacity: 0.85;
  background: transparent;
}
.model-card.card-pro::before { background: linear-gradient(90deg, #1d3b62, #b4741e, #dfa650); }
.model-card.card-anticut::before { background: linear-gradient(90deg, #166961, #2ea195, #b4741e); }
.model-card.card-claude::before { background: linear-gradient(90deg, #b54f24, #df854f); }

.model-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}
.model-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}
.vendor-badge {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.vendor-badge.pro-vendor { background: var(--gold-soft); border-color: var(--gold-border); color: var(--gold-ink); }
.vendor-badge.anticut-vendor { background: var(--teal-soft); border-color: var(--teal-border); color: var(--teal); }
.vendor-badge.claude-vendor { background: var(--claude-soft); border-color: var(--claude-border); color: var(--claude); }

.model-title-meta { min-width: 0; flex: 1; }
.model-display-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.id-copy-chip {
  margin-top: 3px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 1px 7px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 11px;
  cursor: pointer;
  transition: all var(--t-fast);
}
.id-copy-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.id-copy-chip:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.id-copy-chip.is-copied {
  border-color: var(--ok);
  color: var(--ok);
  background: var(--ok-soft);
}

.model-ctx-pill {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.model-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
}

.model-summary {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 37px;
}

.model-notice-pill {
  margin: -4px 0 10px;
  padding: 4px 9px;
  border-radius: 7px;
  background: var(--claude-soft);
  border: 1px solid var(--claude-border);
  color: var(--claude);
  font-size: 11.5px;
  font-weight: 600;
}

.price-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px 12px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  margin-bottom: 12px;
}
.price-cell { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.price-label { font-size: 11px; color: var(--ink-3); }
.price-figure {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.price-unit { font-size: 11px; font-weight: 500; color: var(--ink-3); margin-left: 2px; }

.model-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.mini-chip {
  padding: 1.5px 6px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ink-3);
}

.catalog-more-bar {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.anticut-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 11px 15px;
  margin-bottom: 14px;
  border-radius: var(--radius-md);
  background: var(--teal-soft);
  border: 1px solid var(--teal-border);
  font-size: 13px;
  color: var(--ink-2);
}
.anticut-banner.is-token {
  background: var(--accent-soft);
  border-color: rgba(36, 81, 133, 0.24);
}

/* ---------- Data Tables ---------- */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  overflow-x: auto;
}
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
.data-table th {
  padding: 11px 14px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background-color 0.12s ease; }
.data-table tbody tr:hover { background: var(--surface-hover); }

.catalog-table th, .catalog-table td { padding: 10px 10px; }
.catalog-table th:first-child, .catalog-table td:first-child { padding-left: 16px; }
.catalog-table th:last-child, .catalog-table td:last-child { padding-right: 16px; text-align: right; }

.row-group-divider td {
  padding: 9px 16px !important;
  background: var(--teal-soft) !important;
  border-top: 1px solid var(--teal-border);
  border-bottom: 1px solid var(--teal-border);
}
.row-group-divider.row-group-token td {
  background: var(--accent-soft) !important;
  border-color: rgba(36, 81, 133, 0.22);
}
.catalog-table-divider {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--ink-2);
  white-space: normal;
}

.model-name-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
}
.model-name-btn:hover { color: var(--accent); }
.at-name-prefix { color: var(--teal); font-weight: 700; }
.tok-name-suffix { color: var(--accent); font-weight: 600; font-size: 0.92em; }

/* ==========================================================================
   QUICKSTART TERMINAL & SMART COST ESTIMATOR
   ========================================================================== */
.split-layout {
  display: grid;
  grid-template-columns: 4.6fr 7.4fr;
  gap: 36px;
  align-items: center;
}
.split-left, .split-right { min-width: 0; }

.steps-list {
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.steps-list li {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform var(--t-fast), border-color var(--t-fast);
}
.steps-list li:hover { transform: translateX(4px); border-color: var(--border-strong); }
.step-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-ink);
  background: var(--gold-soft);
  border: 1px solid var(--gold-border);
  border-radius: 8px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.steps-list strong { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 2px; }
.steps-list p { margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }

.code-window {
  background: #1b1815;
  color: #f3ece2;
  border-radius: var(--radius-xl);
  border: 1px solid rgba(235, 214, 184, 0.16);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.code-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(235, 214, 184, 0.1);
  background: #24201b;
}
.code-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.code-tabs button {
  height: 28px;
  padding: 0 10px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #b7a998;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
}
.code-tabs button:hover { color: #f5ede2; }
.code-tabs button.active { background: rgba(228, 173, 86, 0.22); color: #f7d794; }

.code-model-select {
  height: 28px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid rgba(235, 214, 184, 0.2);
  background: #181512;
  color: #e9dfd1;
  font-size: 11.5px;
  font-family: var(--font-mono);
  max-width: 185px;
}
.code-body {
  margin: 0;
  padding: 18px 20px;
  overflow-x: auto;
  font-size: 12.5px;
  line-height: 1.72;
}
.tok-kw { color: #9bc0ea; }
.tok-str { color: #f0c274; }
.tok-com { color: #9c8f7e; }

/* Smart Cost Estimator */
.preset-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
}
.preset-pill {
  height: 30px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
}
.preset-pill:hover { border-color: var(--primary-bg); color: var(--ink); transform: translateY(-1px); }
.preset-pill.active {
  background: var(--primary-bg);
  color: var(--primary-ink);
  border-color: var(--primary-bg);
}

.calc-card {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.calc-inputs {
  padding: 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-right: 1px solid var(--border);
  min-width: 0;
}
.calc-results {
  padding: 24px 26px;
  background: linear-gradient(160deg, var(--surface-2), var(--surface-subtle));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
}
.calc-res-big {
  font-size: clamp(30px, 3.4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  color: var(--ink);
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}
.calc-advisor {
  padding: 11px 13px;
  border-radius: 11px;
  background: var(--surface);
  border: 1px solid var(--gold-border);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--ink-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.calc-advisor strong { color: var(--gold-ink); }
.calc-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.calc-stat { display: flex; flex-direction: column; gap: 2px; }
.calc-stat span { font-size: 11.5px; color: var(--ink-3); }
.calc-stat strong { font-size: 13.5px; font-variant-numeric: tabular-nums; }

/* Footer */
.footer {
  padding: 32px 0 38px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.footer-note { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-3); }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.footer-links a:hover { color: var(--ink); }

/* ==========================================================================
   AUTH PAGES (/login, /register)
   ========================================================================== */
.auth-page {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
}
.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  padding: 32px 30px 26px;
  box-shadow: var(--shadow-lg);
  animation: riseIn 0.35s var(--ease-out);
}
.auth-header { text-align: center; margin-bottom: 22px; }
.auth-header .brand { justify-content: center; margin-bottom: 14px; }
.auth-header h1 { margin: 0 0 5px; font-family: var(--font-serif); font-size: 23px; font-weight: 700; }
.auth-header p { margin: 0; font-size: 13px; color: var(--ink-2); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-footer { margin-top: 18px; text-align: center; font-size: 13px; color: var(--ink-2); }
.auth-footer a { color: var(--brand-text); font-weight: 600; }
.auth-back { position: relative; z-index: 1; margin-top: 16px; font-size: 13px; color: var(--ink-3); }
.auth-back:hover { color: var(--ink); }

.auth-reward-callout {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  margin-bottom: 16px;
  background: var(--gold-soft);
  border: 1px solid var(--gold-border);
  border-radius: 12px;
}
.auth-reward-callout .reward-icon { font-size: 19px; flex-shrink: 0; }
.auth-reward-callout strong { display: block; font-size: 13px; color: var(--gold-ink); }
.auth-reward-callout p { margin: 2px 0 0; font-size: 11.5px; color: var(--ink-2); }

/* ==========================================================================
   AI CHAT WORKSPACE (Rich Model Picker + Collapsible Sidebar + Reasoning)
   ========================================================================== */
.chat-shell {
  display: grid;
  grid-template-columns: 288px 1fr;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  height: calc(100vh - 128px);
  min-height: 580px;
  max-height: 880px;
  transition: grid-template-columns var(--t-med);
}
.chat-shell.in-console { height: calc(100vh - 142px); }
.chat-shell.side-collapsed { grid-template-columns: 0px 1fr; }
.chat-shell.side-collapsed .chat-side { opacity: 0; pointer-events: none; border-right: 0; overflow: hidden; }

.chat-side {
  border-right: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-y: auto;
  transition: opacity 0.2s ease;
}
.chat-side-top { padding: 12px 12px 10px; border-bottom: 1px solid var(--border); }

.chat-sessions {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 200px;
  overflow-y: auto;
  border-bottom: 1px solid var(--border);
}
.chat-sess-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all var(--t-fast);
}
.chat-sess-item:hover { background: var(--surface); color: var(--ink); }
.chat-sess-item.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border);
}
.chat-sess-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-sess-del {
  border: 0;
  background: transparent;
  color: var(--ink-3);
  padding: 2px 5px;
  border-radius: 5px;
  cursor: pointer;
  opacity: 0;
}
.chat-sess-item:hover .chat-sess-del { opacity: 1; }
.chat-sess-del:hover { color: var(--bad); background: var(--bad-soft); }

.chat-config { padding: 13px; display: flex; flex-direction: column; gap: 12px; }

/* Custom Rich Model Picker Button & Popover */
.mpick-wrap { position: relative; }
.mpick-trigger {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  text-align: left;
  transition: all var(--t-fast);
}
.mpick-trigger:hover { border-color: var(--accent); }
.mpick-trigger-left { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.mpick-trigger-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mpick-trigger-sub {
  font-size: 11px;
  color: var(--ink-3);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mpick-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 45;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  box-shadow: var(--shadow-lg);
  max-height: 350px;
  overflow-y: auto;
  padding: 6px;
  display: none;
  animation: modalPop 0.16s var(--ease-out);
}
.mpick-popover.open { display: block; }
.mpick-group-lbl {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-3);
  padding: 7px 8px 4px;
  letter-spacing: 0.04em;
}
.mpick-opt {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 7px 9px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  text-align: left;
  transition: background-color 0.12s ease;
}
.mpick-opt:hover { background: var(--surface-hover); }
.mpick-opt.active { background: var(--accent-soft); }
.mpick-opt-title { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.mpick-opt-id { font-size: 10.5px; color: var(--ink-3); font-family: var(--font-mono); }
.mpick-opt-price { font-size: 11px; font-weight: 600; color: var(--gold-ink); white-space: nowrap; }

.free-mode-banner {
  padding: 8px 11px;
  border-radius: 9px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}
.key-needed-banner {
  padding: 8px 11px;
  border-radius: 9px;
  background: var(--warn-soft);
  color: var(--warn);
  font-size: 12px;
  line-height: 1.45;
}
.reasoning-tip-banner {
  padding: 8px 11px;
  border-radius: 9px;
  background: var(--gold-soft);
  border: 1px solid var(--gold-border);
  font-size: 12px;
  line-height: 1.45;
}
.btn-link-action {
  display: inline;
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  text-decoration: underline;
  font-weight: 600;
  cursor: pointer;
  font-size: inherit;
}

.chat-adv summary {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
  padding: 4px 0;
}

.chat-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  position: relative;
  background: var(--surface);
}
.chat-main.dragover::after {
  content: "松开即可添加图片或文件附件";
  position: absolute;
  inset: 12px;
  z-index: 20;
  border: 2px dashed var(--accent);
  border-radius: 14px;
  background: var(--nav-bg);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  pointer-events: none;
}

.chat-head {
  height: 52px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}
.chat-head-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  min-width: 0;
}

.chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.chat-empty {
  margin: auto;
  max-width: 560px;
  text-align: center;
  padding: 20px 12px;
  animation: riseIn 0.35s var(--ease-out);
}
.chat-empty h3 { margin: 12px 0 6px; font-family: var(--font-serif); font-size: 20px; font-weight: 700; }
.chat-empty p { margin: 0 0 18px; font-size: 13px; color: var(--ink-2); }
.chat-starters {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  text-align: left;
}
.chat-starter-btn {
  padding: 11px 13px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 12.5px;
  cursor: pointer;
  transition: all var(--t-fast);
  text-align: left;
}
.chat-starter-btn strong { display: block; font-size: 13px; margin-bottom: 2px; }
.chat-starter-btn span { font-size: 11.5px; color: var(--ink-3); }
.chat-starter-btn:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xs);
}

/* Message Rows & Reasoning Trace */
.msg-row { display: flex; gap: 11px; align-items: flex-start; animation: riseIn 0.22s var(--ease-out); }
.msg-row.user { flex-direction: row-reverse; }
.msg-avatar {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.msg-row.user .msg-avatar { background: var(--primary-bg); color: var(--primary-ink); border-color: transparent; }
.msg-col { display: flex; flex-direction: column; gap: 5px; max-width: min(760px, calc(100% - 44px)); min-width: 0; }
.msg-row.user .msg-col { align-items: flex-end; }

.msg-bubble {
  padding: 11px 15px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.7;
  word-break: break-word;
}
.msg-row.user .msg-bubble {
  background: var(--primary-bg);
  color: var(--primary-ink);
  border-color: transparent;
  border-bottom-right-radius: 4px;
  white-space: pre-wrap;
}
.msg-row.assistant .msg-bubble { border-top-left-radius: 4px; width: 100%; }

.msg-reasoning {
  margin-bottom: 8px;
  border-radius: 9px;
  border: 1px solid var(--gold-border);
  background: var(--gold-soft);
  overflow: hidden;
}
.msg-reasoning summary {
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold-ink);
  cursor: pointer;
  user-select: none;
}
.msg-reasoning-body {
  padding: 8px 12px 10px;
  border-top: 1px solid var(--gold-border);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-2);
  white-space: pre-wrap;
  max-height: 220px;
  overflow-y: auto;
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 2px;
}
.typing-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-dots i:nth-child(2) { animation-delay: 0.16s; }
.typing-dots i:nth-child(3) { animation-delay: 0.32s; }

.msg-atts { display: flex; flex-wrap: wrap; gap: 6px; }
.msg-img-thumb {
  max-width: 180px;
  max-height: 140px;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  object-fit: cover;
}
.msg-file-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  font-size: 12px;
}
.msg-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink-3);
  padding-left: 2px;
}
.msg-meta-btn {
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-size: 11.5px;
  padding: 0;
  cursor: pointer;
}
.msg-meta-btn:hover { color: var(--accent); text-decoration: underline; }

/* Composer */
.chat-composer-wrap {
  padding: 12px 16px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.composer-atts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.att-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 9px 5px 6px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  max-width: 220px;
}
.att-chip img { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; }
.att-chip-name { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-chip-size { font-size: 10.5px; color: var(--ink-3); }
.att-remove { border: 0; background: transparent; color: var(--ink-3); cursor: pointer; font-size: 15px; }
.att-remove:hover { color: var(--bad); }

.composer-box {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 7px 9px;
  border-radius: 13px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.composer-box:focus-within {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.composer-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  resize: none;
  font-size: 13.5px;
  line-height: 1.55;
  padding: 5px 2px;
  max-height: 160px;
}

/* Markdown Typography inside Chat */
.md-p { margin: 0 0 10px; }
.md-p:last-child { margin-bottom: 0; }
.md-h1, .md-h2, .md-h3, .md-h4 { margin: 14px 0 8px; font-family: var(--font-serif); line-height: 1.3; }
.md-h1 { font-size: 19px; } .md-h2 { font-size: 17px; } .md-h3 { font-size: 15px; }
.md-list { margin: 6px 0 10px; padding-left: 20px; }
.md-list li { margin-bottom: 4px; }
.md-quote {
  margin: 8px 0 10px;
  padding: 6px 12px;
  border-left: 3px solid var(--gold);
  background: var(--surface-subtle);
  border-radius: 0 8px 8px 0;
  color: var(--ink-2);
}
.md-hr { border: 0; border-top: 1px solid var(--border); margin: 12px 0; }
.md-link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.md-inline-code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  padding: 1.5px 5px;
  border-radius: 5px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}
.md-codeblock {
  margin: 10px 0 12px;
  border-radius: 12px;
  overflow: hidden;
  background: #1b1815;
  border: 1px solid rgba(235, 214, 184, 0.14);
  color: #f2ebe1;
}
.md-codehead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: #24201b;
  border-bottom: 1px solid rgba(235, 214, 184, 0.1);
  font-size: 11.5px;
}
.md-codelang { font-family: var(--font-mono); color: #a89d90; }
.md-codebtns { display: flex; gap: 6px; }
.md-codebtn {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: #e4e4e7;
  height: 24px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
}
.md-codebtn:hover { background: rgba(255, 255, 255, 0.15); }
.md-codebtn.preview { background: rgba(37, 99, 235, 0.3); border-color: rgba(96, 165, 250, 0.45); color: #bfdbfe; }
.md-codepre { margin: 0; padding: 13px 15px; overflow-x: auto; font-size: 12.5px; line-height: 1.65; }
.md-kw { color: #93c5fd; } .md-str { color: #86efac; } .md-com { color: #8a8178; font-style: italic; } .md-num { color: #fcd34d; }
.md-table-wrap { overflow-x: auto; margin: 10px 0 12px; border: 1px solid var(--border); border-radius: 10px; }
.md-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.md-table th, .md-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left; }
.md-table th { background: var(--surface-subtle); font-weight: 600; }
.md-table tr:last-child td { border-bottom: 0; }
.preview-iframe { width: 100%; height: 460px; border: 1px solid var(--border); border-radius: 10px; background: #ffffff; }

/* ==========================================================================
   USER CONSOLE WORKSPACE (/console/*) — CLEAN & UNCLUTTERED
   ========================================================================== */
.console-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg);
}

.sidebar {
  width: 236px;
  flex-shrink: 0;
  border-right: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-head {
  height: 60px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.sidebar-nav {
  flex: 1;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
}
.nav-section-lbl {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 10px 10px 4px;
}
.side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 37px;
  padding: 0 11px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  transition: all var(--t-fast);
}
.side-item:hover { background: var(--surface-subtle); color: var(--ink); }
.side-item.active {
  background: var(--accent-soft);
  color: var(--brand-text);
  font-weight: 700;
}
.side-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.8; }
.side-item.active svg { opacity: 1; color: var(--brand-text); }

/* Compact Admin Ops Standalone Launcher (replaces crowded inline ops items) */
.admin-ops-launcher {
  margin: 0 12px 10px;
  padding: 9px 12px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(22, 105, 97, 0.1), rgba(29, 59, 98, 0.1));
  border: 1px solid var(--teal-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--teal);
  transition: all var(--t-fast);
}
.admin-ops-launcher:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
  border-color: var(--teal);
}

.sidebar-balance {
  margin: 0 12px 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: linear-gradient(155deg, var(--surface-2), var(--surface-subtle));
}
.sidebar-balance .sb-lbl { font-size: 11.5px; color: var(--ink-3); display: flex; justify-content: space-between; }
.sidebar-balance .sb-val { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.sidebar-balance .sb-sub { font-size: 11px; color: var(--ink-3); }

.sidebar-foot {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 6px;
}
.sidebar-user-meta { flex: 1; min-width: 0; }
.sidebar-user-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-group { font-size: 11px; color: var(--ink-3); }

.console-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.console-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 60px;
  padding: 0 28px;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-title { font-size: 15px; font-weight: 700; }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.mobile-menu-btn { display: none; }

.console-body {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 26px 28px 54px;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 20px;
}
.page-head h1 { margin: 0 0 3px; font-family: var(--font-serif); font-size: 22px; font-weight: 700; }
.page-head p { margin: 0; font-size: 13px; color: var(--ink-2); }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-xs);
  transition: transform var(--t-fast), border-color var(--t-fast);
}
.kpi-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.kpi-card .k-lbl { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.kpi-card .k-val { font-size: 24px; font-weight: 800; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; margin: 5px 0 2px; }
.kpi-card .k-sub { font-size: 11.5px; color: var(--ink-3); }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  margin-bottom: 18px;
  overflow: hidden;
}
.panel-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.panel-head h2 { margin: 0; font-size: 14.5px; font-weight: 700; }
.panel-body { padding: 18px; }

.console-alert-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 15px;
  background: var(--gold-soft);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  font-size: 13px;
}
.console-alert-banner .banner-body { flex: 1; color: var(--ink-2); }
.console-alert-banner .banner-title { font-weight: 700; color: var(--gold-ink); }

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.qa-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  transition: all var(--t-fast);
}
.qa-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.qa-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.qa-title { font-size: 13.5px; font-weight: 700; }
.qa-desc { font-size: 12px; color: var(--ink-3); margin-top: 1px; }

.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--ink-3);
}
.empty-box { text-align: center; padding: 42px 20px; color: var(--ink-3); font-size: 13.5px; }

/* Announcements */
.ann-panel { border-color: var(--gold-border); }
.ann-panel-head { background: linear-gradient(90deg, var(--gold-soft), transparent); }
.ann-panel-title { display: inline-flex; align-items: center; gap: 8px; }
.ann-head-icon {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--gold-soft); border: 1px solid var(--gold-border); color: var(--gold-ink);
  display: inline-flex; align-items: center; justify-content: center;
}
.ann-head-actions { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ann-list-wrap { padding: 14px 18px; }
.ann-list { display: flex; flex-direction: column; gap: 10px; }
.ann-item {
  padding: 12px 15px;
  border-radius: 11px;
  border: 1px solid var(--border);
  border-left: 3.5px solid var(--accent);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ann-item.is-promo { border-left-color: var(--gold); }
.ann-item.is-important { border-left-color: var(--teal); }
.ann-item.is-warning { border-left-color: var(--bad); }
.ann-item.is-hidden { opacity: 0.62; border-style: dashed; }
.ann-item-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.ann-item-title-row { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ann-item-title { font-size: 14px; font-weight: 700; }
.ann-item-time { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.ann-item-body { font-size: 13px; line-height: 1.65; color: var(--ink-2); word-break: break-word; }
.ann-admin-bar { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; padding-top: 6px; border-top: 1px dashed var(--border); }
.ann-expand-row { margin-top: 8px; text-align: center; }
.ann-empty { padding: 8px 4px; font-size: 13px; color: var(--ink-3); }

/* Billing & ZPay */
.topup-tier-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.topup-tier-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 16px 14px 13px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: all var(--t-fast);
}
.topup-tier-card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.topup-tier-card.active {
  border-color: var(--primary-bg);
  background: linear-gradient(155deg, var(--surface) 0%, var(--accent-soft) 100%);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
html[data-theme="dark"] .topup-tier-card.active {
  border-color: var(--gold);
  background: linear-gradient(155deg, var(--surface) 0%, var(--gold-soft) 100%);
  box-shadow: 0 0 0 3px var(--gold-soft);
}
.topup-tier-ribbon {
  position: absolute;
  top: -9px;
  right: 10px;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  background: var(--gold);
  color: #fffdf9;
  font-size: 10.5px;
  font-weight: 700;
}
html[data-theme="dark"] .topup-tier-ribbon { color: #17120a; }
.topup-tier-ribbon.is-best { background: var(--teal); color: #fffdf9; }
.topup-tier-cny { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.15; }
.topup-tier-cny small { font-size: 14px; margin-right: 1px; color: var(--ink-2); }
.topup-tier-coins { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; color: var(--gold-ink); }
.topup-tier-bonus-pill { padding: 1px 6px; border-radius: var(--radius-pill); background: var(--gold-soft); border: 1px solid var(--gold-border); font-size: 10.5px; }
.topup-tier-desc { font-size: 11.5px; color: var(--ink-3); }
.topup-order-bonus { margin-left: 4px; padding: 1px 6px; border-radius: var(--radius-pill); background: var(--gold-soft); border: 1px solid var(--gold-border); color: var(--gold-ink); font-size: 10.5px; }

.topup-action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}
.topup-action-summary { display: flex; flex-direction: column; gap: 2px; }
.topup-action-summary strong { font-size: 14.5px; }
.topup-action-summary span { font-size: 12px; color: var(--ink-3); }

.zpay-qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.zpay-qr-frame {
  width: 220px; height: 220px; padding: 10px; border-radius: 16px;
  background: #ffffff; border: 1px solid var(--border-strong); box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: center;
}
.zpay-qr-frame img { width: 100%; height: 100%; object-fit: contain; }
.zpay-amount-hero { font-size: 27px; font-weight: 800; font-variant-numeric: tabular-nums; }
.zpay-status-pill { padding: 5px 13px; border-radius: var(--radius-pill); background: var(--gold-soft); border: 1px solid var(--gold-border); color: var(--gold-ink); font-size: 12.5px; font-weight: 600; }
.zpay-order-meta { width: 100%; padding: 10px 12px; border-radius: 10px; background: var(--surface-subtle); border: 1px solid var(--border); font-size: 12px; display: flex; flex-direction: column; gap: 4px; }
.zpay-order-meta div { display: flex; justify-content: space-between; gap: 8px; }

.invite-stats-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.invite-stats-strip .stat-cell { display: flex; flex-direction: column; gap: 2px; }
.invite-stats-strip .stat-lbl { font-size: 11.5px; color: var(--ink-3); }
.invite-stats-strip .stat-val { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ==========================================================================
   STANDALONE ADMIN OPERATIONS COMMAND CENTER (/ops)
   ========================================================================== */
.ops-shell {
  min-height: 100vh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
.ops-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}
.ops-topbar-inner {
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 24px;
  min-height: 62px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ops-brand-group {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ops-tag-pill {
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--teal-soft);
  border: 1px solid var(--teal-border);
  color: var(--teal);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.ops-nav-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 11px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}
.ops-nav-tabs button {
  height: 32px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--t-fast);
}
.ops-nav-tabs button:hover { color: var(--ink); }
.ops-nav-tabs button.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.ops-main {
  flex: 1;
  width: 100%;
  max-width: 1340px;
  margin: 0 auto;
  padding: 24px 24px 56px;
}

.ops-tier-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.tier-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 17px 19px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tier-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tier-card-val { font-size: 27px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.tier-card-val small { font-size: 14px; font-weight: 500; color: var(--ink-3); margin-left: 3px; }
.tier-card-foot { font-size: 12px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 6px; }

.cap-bar {
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: var(--surface-subtle);
  overflow: hidden;
}
.cap-bar-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--ok);
  transition: width 0.35s var(--ease-out);
}
.cap-bar-fill.is-pro { background: var(--teal); }
.cap-bar-fill.is-warn { background: var(--warn); }

.io-cell { max-width: 280px; white-space: normal !important; line-height: 1.45; }
.io-preview {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12px;
  color: var(--ink-2);
  word-break: break-word;
}
.io-err {
  font-size: 11.5px;
  color: var(--bad);
  background: var(--bad-soft);
  padding: 4px 8px;
  border-radius: 6px;
  max-height: 44px;
  overflow: hidden;
}
.ops-row-clickable { cursor: pointer; }

.free-models-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.free-model-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  transition: border-color var(--t-fast);
}
.free-model-row.is-on {
  border-color: rgba(35, 122, 82, 0.34);
  background: linear-gradient(135deg, var(--surface), var(--ok-soft));
}

/* Quota Explainer */
.quota-explainer-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
}
.quota-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  background: var(--surface-2);
}
.quota-summary::-webkit-details-marker { display: none; }
.quota-summary-left { display: flex; align-items: center; gap: 12px; }
.quota-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center;
}
.quota-icon svg { width: 16px; height: 16px; }
.quota-summary-title { font-size: 14px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.quota-sub { font-size: 12px; color: var(--ink-3); display: block; margin-top: 2px; }
.quota-toggle-label { font-size: 12px; color: var(--accent); font-weight: 600; }
.quota-body { padding: 16px 18px; border-top: 1px solid var(--border); }
.quota-table th.col-highlight-pro, .quota-table td.col-highlight-pro { background: var(--teal-soft); color: var(--teal); font-weight: 700; }
.quota-table th.col-dim, .quota-table td.col-dim { color: var(--ink-3); }
.tag-disabled { color: var(--bad); font-size: 12px; }

/* ==========================================================================
   MODALS, COMMAND PALETTE (⌘K) & TOAST
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--backdrop);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalPop 0.2s var(--ease-out);
}
.modal-card.modal-lg { max-width: 700px; }
.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-head h3 { margin: 0; font-size: 15.5px; font-weight: 700; }
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; max-height: 78vh; overflow-y: auto; }
.modal-foot {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.detail-block {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 210px;
  overflow-y: auto;
}
.detail-block.err { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}
.detail-meta-grid div span { display: block; font-size: 11px; color: var(--ink-3); }
.detail-meta-grid div strong { display: block; font-family: var(--font-mono); font-size: 12px; word-break: break-all; }

.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }

/* Command Palette (Ctrl+K / ⌘K) */
.cmd-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: var(--backdrop);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 11vh 16px 20px;
}
.cmd-dialog {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalPop 0.16s var(--ease-out);
}
.cmd-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}
.cmd-input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14.5px;
  color: var(--ink);
}
.cmd-list {
  max-height: 360px;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cmd-group-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-3);
  padding: 6px 10px 3px;
}
.cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.1s ease;
}
.cmd-item:hover, .cmd-item.active { background: var(--surface-hover); }
.cmd-item-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cmd-item-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.cmd-item-sub { font-size: 11.5px; color: var(--ink-3); font-family: var(--font-mono); }
.cmd-foot {
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface-subtle);
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-3);
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translate(-50%, 16px);
  opacity: 0;
  pointer-events: none;
  z-index: 140;
  padding: 9px 18px;
  border-radius: var(--radius-pill);
  background: var(--primary-bg);
  color: var(--primary-ink);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  transition: opacity 0.2s ease, transform 0.2s var(--ease-out);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ==========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1080px) {
  .models-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .free-models-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-stage { grid-template-columns: 1fr; gap: 28px; }
  .hero-copy { align-items: center; text-align: center; }
  .hero-desc { max-width: 620px; }
  .hero-cta { justify-content: center; }
  .endpoint-capsule { margin: 0 auto; }
}

@media (max-width: 960px) {
  .bento-strip, .kpi-grid, .ops-tier-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-layout, .calc-card, .two-col { grid-template-columns: 1fr; }
  .calc-inputs { border-right: 0; border-bottom: 1px solid var(--border); }
  .quick-actions-grid { grid-template-columns: 1fr; }
  .topup-tier-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chat-shell, .chat-shell.in-console, .chat-shell.side-collapsed {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
  }
  .chat-shell.side-collapsed .chat-side { display: none; }
  .chat-side { border-right: 0; border-bottom: 1px solid var(--border); }
  .chat-messages { min-height: 380px; max-height: 540px; }
}

@media (max-width: 820px) {
  .nav-links, .status-pill, .cmd-trigger-btn span:not(.cmd-kbd) { display: none; }
  .pub-mobile-toggle { display: inline-flex; }
  .models-grid, .free-models-grid, .chat-starters { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 70;
    transform: translateX(-100%);
    transition: transform 0.22s var(--ease-out);
  }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .mobile-menu-btn { display: inline-flex; }
  .console-topbar { padding: 0 16px; }
  .console-body, .ops-main { padding: 18px 16px 46px; }
  .ops-topbar-inner { padding: 10px 16px; }
  .ops-nav-tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
}

@media (max-width: 600px) {
  .container { padding: 0 16px; }
  .nav-actions > a.btn { display: none; }
  .cmd-trigger-btn { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: var(--radius-sm); }
  .cmd-trigger-btn .cmd-kbd { display: none; }
  .hero { padding: 36px 0 38px; }
  .hero-title { font-size: 27px; }
  .announcement-pill { max-width: 100%; font-size: 11.5px; }
  .endpoint-proto-hint { display: none; }
  .showcase-bar { flex-wrap: wrap; justify-content: center; }
  .showcase-dots { display: none; }
  .bento-strip { grid-template-columns: 1fr; }
  .topup-tier-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .st-model-chips, .detail-meta-grid, .invite-stats-strip { grid-template-columns: 1fr; }
  .console-alert-banner { flex-direction: column; align-items: flex-start; }
  .segmented { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Email Binding Banner & Admin Ops Mail Settings (v31) ---------- */
.email-gate-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 14px 18px;
  margin-bottom: 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(194, 63, 50, 0.08), rgba(180, 116, 30, 0.1));
  border: 1px solid rgba(194, 63, 50, 0.3);
}
.email-gate-banner.is-soft {
  background: linear-gradient(135deg, var(--gold-soft), var(--accent-soft));
  border-color: var(--gold-border);
}
.email-gate-left {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-width: 0;
  flex: 1;
}
.email-gate-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--bad-soft);
  color: var(--bad);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 16px;
}
.email-gate-banner.is-soft .email-gate-icon {
  background: var(--gold-soft);
  color: var(--gold-ink);
}
.email-gate-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}
.email-gate-desc {
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.5;
}

.ops-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ops-toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color var(--t-fast);
}
.ops-toggle-row:hover {
  border-color: var(--border-strong);
}
.ops-toggle-row.is-critical {
  border-color: rgba(194, 63, 50, 0.28);
  background: linear-gradient(135deg, var(--surface), rgba(194, 63, 50, 0.05));
}
.ops-toggle-meta strong {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}
.ops-toggle-meta span {
  display: block;
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 2px;
  line-height: 1.45;
}
.ops-switch {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary-bg);
  flex-shrink: 0;
  cursor: pointer;
}
.ops-preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.email-status-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

/* ---------- Full Key Reveal & Mobile Clipboard Safeguards (v32) ---------- */
.token-key-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.token-full-code {
  display: inline-block;
  max-width: 280px;
  padding: 5px 9px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 11.5px;
  line-height: 1.45;
  white-space: normal;
  word-break: break-all;
  user-select: all;
  -webkit-user-select: all;
  cursor: pointer;
}
.token-full-code.is-copied {
  border-color: var(--ok);
  background: var(--ok-soft);
  color: var(--ok);
}
.vk-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 9px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  font-size: 13px;
}
.vk-full-textarea {
  height: auto !important;
  min-height: 62px;
  padding: 10px 12px !important;
  font-size: 13px !important;
  line-height: 1.55;
  word-break: break-all;
  resize: none;
  user-select: all;
  -webkit-user-select: all;
}
.keys-mobile-cards {
  display: none;
  padding: 12px;
  flex-direction: column;
  gap: 10px;
}
.key-mobile-card {
  padding: 12px 13px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.kmc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
}
.kmc-key {
  padding: 6px 8px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  word-break: break-all;
}
.kmc-meta {
  font-size: 11.5px;
  color: var(--ink-3);
}
.kmc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
@media (max-width: 820px) {
  .keys-desktop-table { display: none; }
  .keys-mobile-cards { display: flex; }
}
.auth-forgot-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--brand-text);
}
.auth-forgot-link:hover {
  text-decoration: underline;
}
