:root {
  color-scheme: light;
  --background: #ffffff;
  --foreground: #09090b;
  --card: #ffffff;
  --card-soft: #fafafa;
  --muted: #f4f4f5;
  --muted-foreground: #71717a;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --primary: #1a75c5;
  --primary-hover: #1565ad;
  --primary-foreground: #ffffff;
  --primary-soft: rgba(26, 117, 197, 0.09);
  --success: #15803d;
  --success-soft: rgba(21, 128, 61, 0.1);
  --warning: #b45309;
  --warning-soft: rgba(180, 83, 9, 0.1);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.1);
  --header: rgba(255, 255, 255, 0.84);
  --shadow: 0 20px 55px rgba(15, 23, 42, 0.08);
  --radius-sm: 7px;
  --radius: 12px;
  --radius-lg: 18px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    "Courier New", monospace;
}

html.dark {
  color-scheme: dark;
  --background: #121212;
  --foreground: #f5f5f5;
  --card: #191919;
  --card-soft: #171717;
  --muted: #262626;
  --muted-foreground: #b5b5b5;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --primary: #247bc8;
  --primary-hover: #338bd9;
  --primary-foreground: #ffffff;
  --primary-soft: rgba(36, 123, 200, 0.13);
  --success: #58c982;
  --success-soft: rgba(88, 201, 130, 0.12);
  --warning: #f0a84b;
  --warning-soft: rgba(240, 168, 75, 0.12);
  --danger: #f87171;
  --danger-soft: rgba(248, 113, 113, 0.12);
  --header: rgba(18, 18, 18, 0.86);
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

::selection {
  color: var(--primary-foreground);
  background: var(--primary);
}

.boot-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  align-content: center;
  gap: 16px;
  color: var(--muted-foreground);
  font-size: 13px;
}

.boot-screen img {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  animation: breathe 1.7s ease-in-out infinite;
}

@keyframes breathe {
  50% {
    opacity: 0.7;
    transform: scale(0.96);
  }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.icon-sm {
  width: 15px;
  height: 15px;
}

.icon-lg {
  width: 22px;
  height: 22px;
}

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  pointer-events: none;
}

.header-inner {
  pointer-events: auto;
  width: min(100%, 1280px);
  margin: 0 auto;
  padding: 0 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 64px;
  padding: 0 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.brand:hover .brand-logo {
  transform: scale(1.06);
}

.brand-logo {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border-radius: 8px;
  transition: transform 180ms ease;
}

.brand-name {
  max-width: 240px;
  overflow: hidden;
  color: var(--foreground);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.nav-link {
  min-width: 0;
  padding: 6px 12px;
  overflow: hidden;
  border-radius: 8px;
  color: var(--muted-foreground);
  font-size: 14px;
  font-weight: 520;
  text-overflow: ellipsis;
  transition:
    color 160ms ease,
    background 160ms ease;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--foreground);
  background: var(--muted);
}

.nav-divider {
  width: 1px;
  height: 16px;
  margin: 0 8px;
  background: var(--border);
}

.header-actions,
.mobile-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mobile-actions {
  display: none;
}

.icon-button {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition:
    color 160ms ease,
    background 160ms ease;
}

.icon-button:hover {
  color: var(--foreground);
  background: var(--muted);
}

.icon-button.has-notice {
  position: relative;
}

.notice-dot {
  position: absolute;
  top: 2px;
  right: 0;
  display: inline-flex;
  min-width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 10px;
  font-weight: 700;
}

.mobile-menu-button {
  display: none;
}

.mobile-menu-button .menu-lines {
  position: relative;
  width: 16px;
  height: 16px;
}

.mobile-menu-button .menu-lines span {
  position: absolute;
  right: 0;
  left: 0;
  height: 1.5px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 220ms ease, opacity 220ms ease, top 220ms ease;
}

.mobile-menu-button .menu-lines span:nth-child(1) {
  top: 3px;
}

.mobile-menu-button .menu-lines span:nth-child(2) {
  top: 7px;
}

.mobile-menu-button .menu-lines span:nth-child(3) {
  top: 11px;
}

.mobile-menu-button[aria-expanded="true"] .menu-lines span:nth-child(1) {
  top: 7px;
  transform: rotate(45deg);
}

.mobile-menu-button[aria-expanded="true"] .menu-lines span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-button[aria-expanded="true"] .menu-lines span:nth-child(3) {
  top: 7px;
  transform: rotate(-45deg);
}

.btn {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--foreground);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 120ms ease,
    opacity 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-secondary {
  border-color: var(--border);
  background: var(--card);
}

.btn-secondary:hover {
  border-color: var(--border-strong);
  background: var(--muted);
}

.btn-ghost:hover {
  background: var(--muted);
}

.btn-danger {
  border-color: color-mix(in srgb, var(--danger) 28%, transparent);
  color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger-soft);
}

.btn-sm {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
}

.btn-lg {
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
}

.mobile-drawer {
  position: absolute;
  top: 64px;
  right: 16px;
  left: 16px;
  z-index: 60;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: color-mix(in srgb, var(--card) 96%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  animation: drawer-in 180ms ease-out;
}

@keyframes drawer-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.mobile-drawer a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--muted-foreground);
  font-size: 14px;
}

.mobile-drawer a:hover,
.mobile-drawer a.active {
  background: var(--muted);
  color: var(--foreground);
}

.mobile-drawer .drawer-auth {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px 4px 4px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
}

.home-main {
  width: 100%;
  min-height: 100vh;
  padding: 80px 24px 24px;
}

.home-article-wrap {
  width: min(100%, 1152px);
  margin: 0 auto;
  padding: 32px;
}

.article {
  max-width: none;
  overflow-wrap: anywhere;
}

.article > :first-child {
  margin-top: 0 !important;
}

.article > :last-child {
  margin-bottom: 0 !important;
}

.article h1,
.article h2,
.article h3,
.article h4 {
  color: var(--foreground);
  font-weight: 600;
  letter-spacing: -0.025em;
}

.article h1 {
  margin: 24px 0 12px;
  font-size: 24px;
  line-height: 1.34;
}

.article h2 {
  margin: 20px 0 12px;
  font-size: 20px;
  line-height: 1.4;
}

.article h3 {
  margin: 16px 0 8px;
  font-size: 18px;
  line-height: 1.45;
}

.article p {
  margin: 8px 0;
  line-height: 1.625;
}

.article a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article a:hover {
  color: color-mix(in srgb, var(--primary) 82%, white);
}

.article strong {
  font-weight: 650;
}

.article ol,
.article ul {
  margin: 8px 0;
  padding-left: 20px;
}

.article li {
  margin: 4px 0;
  padding-left: 4px;
  line-height: 1.65;
}

.article code {
  padding: 2px 4px;
  border-radius: 4px;
  background: var(--muted);
  color: var(--foreground);
  font-family: var(--font-mono);
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

.article pre {
  margin: 12px 0;
  padding: 14px 16px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--muted);
}

.article pre code {
  padding: 0;
  background: transparent;
  font-size: 13px;
}

.article table {
  display: block;
  width: 100%;
  margin: 16px 0;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 14px;
}

.article thead {
  background: var(--muted);
}

.article th,
.article td {
  padding: 8px 12px;
  border: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.article th {
  color: var(--foreground);
  font-weight: 600;
  white-space: nowrap;
}

.article hr {
  margin: 24px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.article blockquote {
  margin: 12px 0;
  padding: 5px 0 5px 16px;
  border-left: 2px solid var(--primary);
  background: color-mix(in srgb, var(--muted) 55%, transparent);
}

.inline-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card-soft);
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 600;
  vertical-align: 2px;
}

.home-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0 4px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px var(--success-soft);
}

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 104px 0 56px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.page-title {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  font-weight: 680;
  letter-spacing: -0.045em;
  line-height: 1.15;
}

.page-description {
  max-width: 660px;
  margin: 10px 0 0;
  color: var(--muted-foreground);
  font-size: 15px;
  line-height: 1.7;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.015);
}

.card-pad {
  padding: 22px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
}

.card-subtitle {
  margin: 3px 0 0;
  color: var(--muted-foreground);
  font-size: 12px;
}

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

.model-card {
  position: relative;
  overflow: hidden;
  padding: 22px;
  transition:
    transform 180ms ease,
    border-color 180ms ease;
}

.model-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.model-card::after {
  position: absolute;
  top: -65px;
  right: -65px;
  width: 145px;
  height: 145px;
  border-radius: 50%;
  background: var(--model-accent);
  content: "";
  filter: blur(38px);
  opacity: 0.1;
  pointer-events: none;
}

.model-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.provider-icon {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: color-mix(in srgb, var(--model-accent) 15%, transparent);
  color: var(--model-accent);
  font-size: 13px;
  font-weight: 700;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.badge-success {
  background: var(--success-soft);
  color: var(--success);
}

.badge-warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge-primary {
  background: var(--primary-soft);
  color: var(--primary);
}

.model-name {
  margin: 18px 0 4px;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.model-provider {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 13px;
}

.model-desc {
  min-height: 42px;
  margin: 14px 0 18px;
  color: var(--muted-foreground);
  font-size: 13px;
  line-height: 1.6;
}

.price-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 15px;
  border-top: 1px solid var(--border);
}

.price-label {
  display: block;
  margin-bottom: 3px;
  color: var(--muted-foreground);
  font-size: 10px;
}

.price-value {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 650;
}

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.search-box {
  position: relative;
  width: min(100%, 320px);
}

.search-box .icon {
  position: absolute;
  top: 50%;
  left: 11px;
  color: var(--muted-foreground);
  transform: translateY(-50%);
}

.search-box input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 35px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  background: var(--background);
  color: var(--foreground);
  font-size: 13px;
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.data-table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--card-soft);
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.035em;
  text-align: left;
  text-transform: uppercase;
}

.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--foreground);
  vertical-align: middle;
}

.data-table tr:last-child td {
  border-bottom: 0;
}

.data-table tbody tr:hover {
  background: color-mix(in srgb, var(--muted) 58%, transparent);
}

.mono {
  font-family: var(--font-mono);
}

.muted {
  color: var(--muted-foreground);
}

.small {
  font-size: 12px;
}

.auth-page {
  display: grid;
  min-height: 100vh;
  padding: 104px 20px 50px;
  place-items: center;
}

.auth-layout {
  display: grid;
  width: min(920px, 100%);
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.75fr);
  gap: 28px;
  align-items: stretch;
}

.auth-story {
  position: relative;
  min-height: 460px;
  overflow: hidden;
  padding: 42px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 107, 53, 0.16), transparent 36%),
    radial-gradient(circle at 88% 18%, rgba(36, 123, 200, 0.16), transparent 30%),
    var(--card);
}

.auth-story::after {
  position: absolute;
  right: -80px;
  bottom: -100px;
  width: 330px;
  height: 330px;
  border: 1px solid var(--border);
  border-radius: 50%;
  box-shadow:
    0 0 0 48px color-mix(in srgb, var(--border) 30%, transparent),
    0 0 0 96px color-mix(in srgb, var(--border) 15%, transparent);
  content: "";
}

.auth-story h1 {
  position: relative;
  z-index: 1;
  max-width: 440px;
  margin: 38px 0 18px;
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1.08;
}

.auth-story p {
  position: relative;
  z-index: 1;
  max-width: 450px;
  margin: 0;
  color: var(--muted-foreground);
  font-size: 15px;
  line-height: 1.75;
}

.auth-features {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  margin-top: 36px;
}

.auth-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted-foreground);
  font-size: 13px;
}

.auth-feature i {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: var(--success-soft);
  color: var(--success);
}

.auth-card {
  align-self: center;
  padding: 28px;
}

.auth-card h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.auth-card > p {
  margin: 7px 0 24px;
  color: var(--muted-foreground);
  font-size: 13px;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field label {
  color: var(--foreground);
  font-size: 12px;
  font-weight: 600;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  background: var(--background);
  color: var(--foreground);
  font-size: 13px;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.textarea {
  min-height: 90px;
  resize: vertical;
  line-height: 1.55;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.input::placeholder,
.textarea::placeholder {
  color: color-mix(in srgb, var(--muted-foreground) 70%, transparent);
}

.form-help {
  color: var(--muted-foreground);
  font-size: 11px;
  line-height: 1.5;
}

.auth-alternate {
  margin: 18px 0 0 !important;
  color: var(--muted-foreground);
  font-size: 12px !important;
  text-align: center;
}

.auth-alternate a {
  color: var(--primary);
  font-weight: 600;
}

.demo-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding: 11px 12px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  background: var(--card-soft);
  color: var(--muted-foreground);
  font-size: 11px;
}

.demo-account code {
  color: var(--foreground);
  font-family: var(--font-mono);
}

.console-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 232px minmax(0, 1fr);
  padding-top: 64px;
}

.console-sidebar {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 18px 12px;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--card-soft) 60%, var(--background));
}

.sidebar-section-title {
  margin: 18px 10px 7px;
  color: var(--muted-foreground);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-links {
  display: grid;
  gap: 2px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 520;
  transition:
    background 150ms ease,
    color 150ms ease;
}

.sidebar-link:hover {
  background: var(--muted);
  color: var(--foreground);
}

.sidebar-link.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 620;
}

.console-main {
  width: 100%;
  min-width: 0;
  padding: 30px clamp(18px, 4vw, 46px) 48px;
}

.console-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.console-heading h1 {
  margin: 0;
  font-size: 25px;
  font-weight: 680;
  letter-spacing: -0.04em;
}

.console-heading p {
  margin: 5px 0 0;
  color: var(--muted-foreground);
  font-size: 12px;
}

.user-chip {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  padding: 6px 9px 6px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
}

.avatar {
  display: inline-flex;
  width: 27px;
  height: 27px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff8b4c, #e53d4c);
  color: #fff;
  font-size: 11px;
  font-weight: 750;
}

.user-chip span:last-child {
  max-width: 110px;
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
}

.stat-card::after {
  position: absolute;
  right: -30px;
  bottom: -35px;
  width: 95px;
  height: 95px;
  border-radius: 50%;
  background: var(--primary-soft);
  content: "";
}

.stat-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 600;
}

.stat-icon {
  display: inline-flex;
  width: 27px;
  height: 27px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary);
}

.stat-value {
  position: relative;
  z-index: 1;
  margin: 14px 0 5px;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.stat-meta {
  position: relative;
  z-index: 1;
  color: var(--muted-foreground);
  font-size: 11px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(270px, 0.8fr);
  gap: 16px;
  margin-top: 16px;
}

.chart-card {
  min-height: 320px;
}

.chart-wrap {
  padding: 20px;
}

.bar-chart {
  display: flex;
  height: 208px;
  align-items: flex-end;
  gap: clamp(10px, 3vw, 24px);
  padding: 12px 2px 0;
}

.bar-column {
  display: flex;
  height: 100%;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  text-align: center;
}

.bar-track {
  position: relative;
  display: flex;
  height: 164px;
  align-items: flex-end;
  overflow: hidden;
  border-radius: 5px;
  background: color-mix(in srgb, var(--muted) 80%, transparent);
}

.bar {
  width: 100%;
  min-height: 3px;
  border-radius: 5px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 80%, white), var(--primary));
  transition: height 500ms cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-label {
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-list {
  display: grid;
}

.quick-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.quick-item:last-child {
  border-bottom: 0;
}

.quick-item > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.quick-item strong {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
}

.quick-item small {
  display: block;
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}

.key-box:last-child {
  border-bottom: 0;
}

.key-icon {
  display: inline-flex;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--muted);
  color: var(--muted-foreground);
}

.key-details {
  min-width: 0;
  flex: 1;
}

.key-details strong {
  display: block;
  margin-bottom: 3px;
  font-size: 12px;
}

.key-details code {
  display: block;
  overflow: hidden;
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty-state {
  display: grid;
  justify-items: center;
  padding: 56px 24px;
  text-align: center;
}

.empty-icon {
  display: inline-flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--muted);
  color: var(--muted-foreground);
}

.empty-state h3 {
  margin: 14px 0 5px;
  font-size: 14px;
}

.empty-state p {
  max-width: 380px;
  margin: 0 0 18px;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.6;
}

.wallet-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 16px;
  margin-bottom: 16px;
}

.balance-card {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border: 1px solid color-mix(in srgb, var(--primary) 26%, var(--border));
  background:
    radial-gradient(circle at 92% 12%, rgba(36, 123, 200, 0.24), transparent 34%),
    radial-gradient(circle at 5% 95%, rgba(255, 107, 53, 0.14), transparent 40%),
    var(--card);
}

.balance-label {
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 600;
}

.balance-value {
  margin: 13px 0 6px;
  font-size: clamp(34px, 5vw, 50px);
  font-weight: 700;
  letter-spacing: -0.06em;
  line-height: 1;
}

.balance-value small {
  margin-left: 5px;
  color: var(--muted-foreground);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
}

.balance-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.recharge-card {
  padding: 22px;
}

.amount-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0;
}

.amount-option {
  padding: 11px 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--background);
  color: var(--muted-foreground);
  font-size: 12px;
  cursor: pointer;
}

.amount-option.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 650;
}

.playground-shell {
  display: grid;
  height: calc(100vh - 126px);
  min-height: 560px;
  grid-template-columns: minmax(0, 1fr) 290px;
  overflow: hidden;
}

.chat-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

.chat-welcome {
  display: grid;
  max-width: 460px;
  margin: 34px auto;
  justify-items: center;
  text-align: center;
}

.chat-welcome img {
  width: 58px;
  height: 58px;
  border-radius: 16px;
}

.chat-welcome h2 {
  margin: 18px 0 7px;
  font-size: 22px;
  letter-spacing: -0.04em;
}

.chat-welcome p {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.65;
}

.message {
  display: flex;
  gap: 11px;
  max-width: 780px;
  margin: 0 auto 20px;
}

.message-avatar {
  display: inline-flex;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 10px;
  font-weight: 700;
}

.message.assistant .message-avatar {
  background: linear-gradient(135deg, #ff8b4c, #e53d4c);
  color: white;
}

.message-content {
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 4px 12px 12px;
  background: var(--card);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.message.user .message-content {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: transparent;
}

.typing {
  display: inline-flex;
  gap: 4px;
  padding: 5px 0;
}

.typing span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted-foreground);
  animation: typing 1s infinite ease-in-out;
}

.typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typing {
  50% {
    opacity: 0.35;
    transform: translateY(-2px);
  }
}

.composer {
  padding: 10px 24px 18px;
}

.composer-inner {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
  padding: 11px 52px 11px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.composer textarea {
  width: 100%;
  min-height: 54px;
  max-height: 170px;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--foreground);
  font-size: 13px;
  line-height: 1.55;
  resize: none;
}

.send-button {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: var(--primary);
  color: var(--primary-foreground);
  cursor: pointer;
}

.send-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.chat-options {
  padding: 18px;
  border-left: 1px solid var(--border);
  background: var(--card-soft);
}

.chat-options h3 {
  margin: 0 0 14px;
  font-size: 13px;
}

.option-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
}

.option-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 11px;
}

.option-line:first-child {
  padding-top: 0;
}

.option-line:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.option-line strong {
  color: var(--foreground);
  font-weight: 600;
}

.notice-panel {
  margin-top: 14px;
  padding: 13px;
  border-radius: 9px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 11px;
  line-height: 1.6;
}

.docs-layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 34px;
}

.docs-nav {
  position: sticky;
  top: 92px;
  align-self: start;
  padding-right: 14px;
}

.docs-nav strong {
  display: block;
  margin: 0 0 9px 10px;
  color: var(--muted-foreground);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.docs-nav a {
  display: block;
  padding: 7px 10px;
  border-radius: 7px;
  color: var(--muted-foreground);
  font-size: 12px;
}

.docs-nav a:hover {
  background: var(--muted);
  color: var(--foreground);
}

.docs-content {
  padding: 28px 34px;
}

.docs-content .article h1 {
  margin-top: 0;
  font-size: 30px;
}

.code-sample {
  position: relative;
}

.copy-code {
  position: absolute;
  top: 8px;
  right: 8px;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card);
  color: var(--muted-foreground);
  font-size: 10px;
  cursor: pointer;
}

.ranking-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 18px;
}

.rank-number {
  display: inline-flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: var(--muted);
  color: var(--muted-foreground);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}

.rank-number.top {
  background: var(--warning-soft);
  color: var(--warning);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  padding: 20px;
  overflow-y: auto;
  place-items: center;
  background: rgba(0, 0, 0, 0.58);
  backdrop-filter: blur(5px);
  animation: fade-in 150ms ease-out;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.modal {
  width: min(470px, 100%);
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow);
  animation: modal-in 180ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 0;
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.025em;
}

.modal-header p {
  margin: 5px 0 0;
  color: var(--muted-foreground);
  font-size: 12px;
}

.modal-body {
  padding: 20px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 20px 20px;
}

.secret-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--muted);
}

.secret-box code {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--foreground);
  font-family: var(--font-mono);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.callout {
  display: flex;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid color-mix(in srgb, var(--warning) 24%, var(--border));
  border-radius: 9px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 11px;
  line-height: 1.6;
}

.callout-success {
  border-color: color-mix(in srgb, var(--success) 24%, var(--border));
  background: var(--success-soft);
  color: var(--success);
}

.toast-region {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 150;
  display: grid;
  width: min(380px, calc(100vw - 36px));
  gap: 8px;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--foreground);
  font-size: 12px;
  line-height: 1.5;
  animation: toast-in 220ms ease-out;
}

.toast.success .icon {
  color: var(--success);
}

.toast.error .icon {
  color: var(--danger);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.skeleton {
  display: block;
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    var(--muted) 20%,
    color-mix(in srgb, var(--muted) 40%, var(--border)) 50%,
    var(--muted) 80%
  );
  background-size: 300% 100%;
  animation: shimmer 1.5s linear infinite;
}

@keyframes shimmer {
  to {
    background-position: -150% 0;
  }
}

.error-page {
  display: grid;
  min-height: 100vh;
  padding: 90px 20px;
  place-items: center;
  text-align: center;
}

.error-code {
  margin: 0;
  background: linear-gradient(135deg, #ff8b4c, #247bc8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: clamp(72px, 18vw, 150px);
  font-weight: 800;
  letter-spacing: -0.08em;
  line-height: 1;
}

.error-page h1 {
  margin: 4px 0 10px;
  font-size: 24px;
}

.error-page p {
  margin: 0 0 22px;
  color: var(--muted-foreground);
}

@media (max-width: 1040px) {
  .desktop-nav {
    display: none;
  }

  .mobile-actions {
    display: flex;
  }

  .mobile-menu-button {
    display: inline-flex;
  }

  .header-actions {
    display: none;
  }

  .brand {
    flex: 0 1 auto;
  }

  .topbar {
    gap: 8px;
  }

  .topbar::after {
    flex: 1;
    content: "";
  }

  .model-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .playground-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .chat-options {
    display: none;
  }
}

@media (max-width: 820px) {
  .page-shell {
    width: min(100% - 28px, 1180px);
    padding-top: 92px;
  }

  .auth-layout {
    grid-template-columns: 1fr;
    max-width: 480px;
  }

  .auth-story {
    display: none;
  }

  .auth-card {
    padding: 24px;
  }

  .console-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .console-sidebar {
    display: none;
  }

  .dashboard-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .wallet-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .ranking-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .docs-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .docs-nav {
    display: none;
  }

  .docs-content {
    padding: 24px;
  }
}

@media (max-width: 620px) {
  .header-inner {
    padding: 0 16px;
  }

  .home-main {
    padding: 72px 16px 16px;
  }

  .home-article-wrap {
    padding: 24px 16px;
  }

  .home-article-wrap .article h1 {
    margin-top: 6px;
  }

  .model-grid,
  .stat-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-heading,
  .console-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .page-heading {
    margin-bottom: 20px;
  }

  .table-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    width: 100%;
  }

  .field-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .key-box {
    align-items: flex-start;
  }

  .key-box .btn {
    padding-right: 0;
    padding-left: 0;
  }

  .playground-shell {
    height: calc(100vh - 118px);
    min-height: 520px;
  }

  .chat-messages {
    padding: 18px 14px;
  }

  .composer {
    padding: 8px 14px 14px;
  }

  .amount-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .data-table th,
  .data-table td {
    padding: 12px;
  }

  .modal-backdrop {
    align-items: end;
    padding: 10px;
  }

  .modal {
    border-radius: 16px;
  }
}

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