/* ============================================================
   无敌API — User Portal Stylesheet
   Apple Design Language — Dark, SF Pro, Frosted Glass
   ============================================================ */

:root {
  /* Core palette — restrained iOS dark system */
  --bg-primary: #0b0b0f;
  --bg-secondary: #1a1a1d;
  --bg-tertiary: #202024;
  --bg-hover: #242428;
  --navbar-bg: rgba(12, 16, 18, 0.46);
  --mobile-nav-bg: rgba(12, 16, 18, 0.78);
  --border-color: rgba(255, 255, 255, 0.10);
  --border-light: rgba(255, 255, 255, 0.16);

  /* Surfaces */
  --surface-default: #1d1d1f;
  --surface-overlay: rgba(0, 0, 0, 0.65);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --surface-subtle: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.08);
  --input-bg: rgba(255, 255, 255, 0.04);
  --input-focus-bg: rgba(255, 255, 255, 0.06);
  --search-bg: rgba(255, 255, 255, 0.04);
  --code-bg: rgba(0, 0, 0, 0.26);
  --thumb-bg: rgba(255, 255, 255, 0.15);
  --thumb-bg-hover: rgba(255, 255, 255, 0.25);
  --spinner-track: rgba(255, 255, 255, 0.10);

  /* Accent */
  --accent: #32f08c;
  --accent-hover: #28d078;
  --accent-muted: rgba(50, 240, 140, 0.14);

  /* Semantic — Apple system colors */
  --success: #30d158;
  --success-muted: rgba(48, 209, 88, 0.15);
  --warning: #ff9f0a;
  --warning-muted: rgba(255, 159, 10, 0.15);
  --danger: #ff453a;
  --danger-muted: rgba(255, 69, 58, 0.15);
  --info: #64d2ff;

  /* Text — Apple hierarchy */
  --text-primary: #f5f5f7;
  --text-secondary: #b4b4bb;
  --text-tertiary: #7c7c84;
  --text-inverse: #000000;

  /* Sizing & spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 14px 34px rgba(0, 0, 0, 0.30);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.36);

  /* Layout */
  --navbar-height: 56px;
  --sidebar-width: 240px;
  --max-content-width: 1200px;
  --transition-fast: 200ms cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition-base: 250ms cubic-bezier(0.25, 0.1, 0.25, 1);
  --transition-spring: 400ms cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* Font */
  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', 'Consolas', monospace;
}


/* ---- Reset ---- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  color-scheme: dark;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  letter-spacing: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--accent-hover); }

ul, ol { list-style: none; }

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

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--thumb-bg); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--thumb-bg-hover); }

/* ---- Selection ---- */
::selection {
  background: rgba(50, 240, 140, 0.35);
  color: #fff;
}

/* ---- Focus ring ---- */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================================
   TOP NAVBAR — Frosted glass
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.025)),
    var(--navbar-bg);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 12px 34px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 100;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0;
}
.navbar-logo .logo-icon {
  position: relative;
  overflow: hidden;
  width: 32px;
  height: 32px;
  background:
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.24), transparent 30%),
    linear-gradient(145deg, rgba(50, 240, 140, 0.24), rgba(100, 210, 255, 0.12) 48%, rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 8px 22px rgba(0, 0, 0, 0.22);
}
.logo-icon::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), transparent 46%);
  pointer-events: none;
}
.brand-mark {
  position: relative;
  z-index: 1;
  display: block;
}
.brand-mark-route,
.brand-mark-gate {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.2;
}
.brand-mark-route {
  stroke: rgba(255, 255, 255, 0.92);
}
.brand-mark-gate {
  stroke: var(--accent);
}
.brand-mark-node {
  fill: var(--accent);
}
.brand-mark-node-alt {
  fill: var(--info);
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}
.navbar-nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition-fast);
  white-space: nowrap;
  letter-spacing: 0;
}
.navbar-nav a:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}
.navbar-nav a.active {
  color: var(--accent);
  background: var(--accent-muted);
}
.navbar-nav a .nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.navbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}

/* Nav Auth Buttons */
.nav-auth-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* User Dropdown */
.user-dropdown {
  position: relative;
}
.user-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--surface-hover);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.user-dropdown-btn:hover { border-color: var(--border-light); background: var(--surface-strong); }
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: var(--accent-muted);
  border: 1px solid rgba(50, 240, 140, 0.24);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
}
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--surface-default);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  padding: 6px;
  display: none;
  z-index: 200;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.user-dropdown-menu.open { display: block; }
.user-dropdown-menu a,
.user-dropdown-menu button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-family: inherit;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: all var(--transition-fast);
}
.user-dropdown-menu a:hover,
.user-dropdown-menu button:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}
.user-dropdown-menu .divider {
  height: 1px;
  background: var(--border-color);
  margin: 4px 8px;
}
.user-dropdown-menu .logout-btn { color: var(--danger); }
.user-dropdown-menu .logout-btn:hover { background: var(--danger-muted); color: var(--danger); }

/* ---- Mobile hamburger ---- */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: var(--text-primary);
  transition: all var(--transition-fast);
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.app-main {
  padding-top: calc(var(--navbar-height) + 32px);
  padding-left: 28px;
  padding-right: 28px;
  padding-bottom: 64px;
  max-width: var(--max-content-width);
  margin: 0 auto;
  min-height: 100vh;
}

.app-main:has(.site-footer) {
  padding-bottom: 0;
}

.page-header {
  margin-bottom: 32px;
}
.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: 0;
}
.page-subtitle {
  font-size: 0.9rem;
  color: var(--text-tertiary);
}

/* Dashboard Sub-navigation */
.dashboard-subnav {
  display: flex;
  gap: 2px;
  margin-bottom: 28px;
  background: var(--input-bg);
  border-radius: var(--radius-md);
  padding: 4px;
  overflow-x: auto;
}
.dashboard-subtab {
  padding: 8px 18px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: background var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
  letter-spacing: 0;
}
.dashboard-subtab:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}
.dashboard-subtab.active {
  color: var(--accent);
  background: var(--accent-muted);
}

/* ============================================================
   CARDS
   ============================================================ */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast);
}
.card:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-light);
  box-shadow: var(--shadow-sm);
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}
.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0;
}

/* Stat cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}
.stat-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all var(--transition-fast);
}
.stat-card:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-light);
  box-shadow: var(--shadow-sm);
}
.stat-label {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.15;
  letter-spacing: 0;
}
.stat-delta {
  font-size: 0.78rem;
  font-weight: 600;
}
.stat-delta.up { color: var(--success); }
.stat-delta.down { color: var(--danger); }

/* ============================================================
   TABLES
   ============================================================ */
.table-container {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-secondary);
}
thead { border-bottom: 1px solid var(--border-color); }
th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
td {
  padding: 14px 16px;
  font-size: 0.875rem;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}
tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--transition-fast); }
tbody tr:hover { background: var(--surface-subtle); }

/* ============================================================
   FORMS
   ============================================================ */
.form-group {
  margin-bottom: 20px;
}
.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
  letter-spacing: 0;
}
.form-input[type="date"],
.form-input[type="time"],
.form-input[type="datetime-local"],
.form-input[type="month"],
.form-input[type="week"] {
  color-scheme: dark;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23f5f5f7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v4M16 2v4M3 10h18'/%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px 16px;
}
.form-input[type="date"]::-webkit-calendar-picker-indicator,
.form-input[type="time"]::-webkit-calendar-picker-indicator,
.form-input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.form-input[type="month"]::-webkit-calendar-picker-indicator,
.form-input[type="week"]::-webkit-calendar-picker-indicator {
  width: 34px;
  height: 100%;
  margin-right: -8px;
  opacity: 0;
  cursor: pointer;
}
.form-input[type="date"]::-webkit-calendar-picker-indicator:hover,
.form-input[type="time"]::-webkit-calendar-picker-indicator:hover,
.form-input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
.form-input[type="month"]::-webkit-calendar-picker-indicator:hover,
.form-input[type="week"]::-webkit-calendar-picker-indicator:hover {
  opacity: 0;
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--text-tertiary); }
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent);
  background: var(--surface-hover);
  box-shadow: 0 0 0 3px var(--accent-muted);
}
.form-input.error,
.form-select.error,
.form-textarea.error {
  border-color: var(--danger);
}
.form-input.error:focus {
  box-shadow: 0 0 0 3px var(--danger-muted);
}
.form-error {
  font-size: 0.78rem;
  color: var(--danger);
  margin-top: 4px;
}
.form-textarea {
  resize: vertical;
  min-height: 80px;
}
.form-hint {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  margin-top: 4px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.settings-panel {
  width: 100%;
}

.settings-form {
  width: 100%;
  max-width: 560px;
}

/* Switch toggle */
.switch-group {
  display: flex;
  align-items: center;
  gap: 12px;
}
.switch {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.switch input { display: none; }
.switch-slider {
  position: absolute;
  inset: 0;
  background: var(--thumb-bg);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.switch-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: var(--text-inverse);
  border-radius: 50%;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.switch input:checked + .switch-slider {
  background: var(--accent);
}
.switch input:checked + .switch-slider::before {
  transform: translateX(20px);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  line-height: 1.4;
  letter-spacing: 0;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn-primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
  font-weight: 600;
}
.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #000;
  box-shadow: var(--shadow-sm);
}
.btn-secondary {
  background: var(--surface-hover);
  color: var(--text-primary);
  border-color: var(--border-color);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--surface-strong);
  border-color: var(--border-light);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text-primary);
}
.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger-muted);
}
.btn-success {
  background: var(--success);
  color: #000;
  border-color: var(--success);
  font-weight: 600;
}
.btn-success:hover:not(:disabled) {
  background: #28a745;
  border-color: #28a745;
}
.btn-sm {
  padding: 5px 12px;
  font-size: 0.78rem;
}
.btn-lg {
  padding: 12px 28px;
  font-size: 1rem;
  border-radius: var(--radius-md);
}
.btn-block { width: 100%; }
.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius-sm);
}
.btn-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
  letter-spacing: 0;
}
.badge-success { background: var(--success-muted); color: var(--success); }
.badge-warning { background: var(--warning-muted); color: var(--warning); }
.badge-danger { background: var(--danger-muted); color: var(--danger); }
.badge-info { background: var(--accent-muted); color: var(--accent); }
.badge-neutral { background: var(--surface-strong); color: var(--text-secondary); }

/* ============================================================
   MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--surface-overlay);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  padding: 28px;
  animation: fadeIn 0.2s ease;
}
.modal {
  background: var(--surface-default);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideUp 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.modal-lg { max-width: 640px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 0;
}
.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0;
}
.modal-close {
  background: var(--surface-strong);
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.modal-close:hover {
  background: var(--thumb-bg);
  color: var(--text-primary);
}
.modal-body {
  padding: 20px 28px;
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 28px 24px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 28px;
}
.tab {
  padding: 10px 22px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-tertiary);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition-fast);
  letter-spacing: 0;
}
.tab:hover { color: var(--text-secondary); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ============================================================
   CODE BLOCKS (for API docs)
   ============================================================ */
.code-block {
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin: 20px 0;
  overflow: hidden;
  padding: 10px;
}
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 12px 0 14px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.code-block-header .copy-btn {
  min-height: 28px;
  padding: 0 10px;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 0.72rem;
  border-radius: var(--radius-full);
  font-family: inherit;
  transition: all var(--transition-fast);
}
.code-block-header .copy-btn:hover {
  color: var(--accent);
  background: var(--accent-muted);
  border-color: rgba(50, 240, 140, 0.24);
}
.code-block pre {
  padding: 18px 16px 8px;
  margin: 0;
  overflow-x: auto;
}
.code-block code {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.7;
  color: var(--text-primary);
}
.code-block .keyword { color: #ff7ab2; }
.code-block .string { color: #a5d6ff; }
.code-block .comment { color: var(--text-tertiary); }
.code-block .function { color: #bf5af2; }
.code-block .number { color: #ff9f0a; }

/* Inline code */
code.inline {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 2px 6px;
  background: var(--surface-hover);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--info);
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 24px;
}
.pagination-btn {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
}
.pagination-btn:hover:not(:disabled) {
  background: var(--surface-strong);
  border-color: var(--border-light);
  color: var(--text-primary);
}
.pagination-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
}
.pagination-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  top: calc(var(--navbar-height) + 16px);
  right: 28px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--surface-default);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
  animation: slideInRight 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  font-size: 0.875rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.toast-success { border-left: 3px solid var(--success); }
.toast-error { border-left: 3px solid var(--danger); }
.toast-warning { border-left: 3px solid var(--warning); }
.toast-info { border-left: 3px solid var(--accent); }
.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.toast-icon svg {
  width: 20px;
  height: 20px;
  display: block;
}
.toast-msg { flex: 1; color: var(--text-primary); }

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(24px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ============================================================
   LOGIN / REGISTER PAGES
   ============================================================ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: var(--bg-primary);
}
.auth-back-link {
  position: fixed;
  top: 24px;
  left: 28px;
  min-height: 38px;
  padding: 0 14px 0 10px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}
.auth-back-link:hover {
  background: var(--surface-strong);
  border-color: var(--border-light);
  color: var(--text-primary);
}
.auth-back-link svg {
  width: 17px;
  height: 17px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 44px 40px;
}
.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 36px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0;
}
.auth-logo .logo-icon {
  position: relative;
  overflow: hidden;
  width: 40px;
  height: 40px;
  background:
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.24), transparent 30%),
    linear-gradient(145deg, rgba(50, 240, 140, 0.24), rgba(100, 210, 255, 0.12) 48%, rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 10px 28px rgba(0, 0, 0, 0.24);
}
.auth-title {
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
  letter-spacing: 0;
}
.auth-subtitle {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  text-align: center;
  margin-bottom: 32px;
}
.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.auth-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-tertiary);
  background: transparent;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition-fast);
}
.auth-tab.active {
  background: var(--accent);
  color: #000;
  font-weight: 600;
}
.auth-tab:not(.active):hover {
  background: var(--surface-hover);
  color: var(--text-secondary);
}
.auth-error {
  background: var(--danger-muted);
  border: 1px solid rgba(255, 69, 58, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--danger);
  font-size: 0.85rem;
  margin-bottom: 20px;
  display: none;
}
.auth-error.show { display: block; }
.auth-success {
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: #4ade80;
  font-size: 0.85rem;
  margin-bottom: 20px;
}
.auth-footer {
  text-align: center;
  margin-top: 28px;
  font-size: 0.875rem;
  color: var(--text-tertiary);
}
.auth-footer a {
  color: var(--accent);
  font-weight: 500;
}

/* ============================================================
   EMPTY STATES
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 64px 28px;
}
.empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 20px;
  opacity: 0.72;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--input-bg);
  border: 1px solid var(--border-color);
}
.empty-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.empty-description {
  font-size: 0.875rem;
  color: var(--text-tertiary);
  margin-bottom: 24px;
}

/* ============================================================
   LOADING SPINNERS
   ============================================================ */
.spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--spinner-track);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner-lg {
  width: 40px;
  height: 40px;
  border-width: 3px;
}
.spinner-sm {
  width: 16px;
  height: 16px;
  border-width: 2px;
}
.loading-center {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
  flex-direction: column;
  gap: 20px;
  color: var(--text-tertiary);
  font-size: 0.875rem;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   KEY REVEAL
   ============================================================ */
.key-reveal-box {
  background: var(--code-bg);
  border: 1px dashed rgba(50, 240, 140, 0.32);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  word-break: break-all;
  color: var(--text-primary);
  margin: 8px 0;
}
.key-warning {
  background: var(--warning-muted);
  border: 1px solid rgba(255, 159, 10, 0.25);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.85rem;
  color: var(--warning);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 20px 0;
}

/* ---- Marketplace Search ---- */
.marketplace-search-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 12px 16px;
  background: var(--surface-default);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  position: relative;
}
.marketplace-search-icon {
  width: 18px;
  height: 18px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}
.marketplace-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--text-primary);
}
.marketplace-search-input::placeholder {
  color: var(--text-tertiary);
}
/* ---- Marketplace Categories ---- */
.marketplace-categories {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.mp-cat-btn {
  padding: 7px 18px;
  font-size: 0.82rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--text-tertiary);
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.mp-cat-btn:hover {
  color: var(--text-secondary);
  border-color: var(--border-light);
  background: var(--surface-hover);
}
.mp-cat-btn.active {
  color: #000;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

/* ---- Section title inside marketplace ---- */
.mp-section-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

/* ---- Vendor logo in model card ---- */
.model-vendor-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.model-vendor-logo img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}

/* ---- Model description ---- */
.model-desc {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  line-height: 1.5;
  margin: 0;
}

/* ============================================================
   MARKETPLACE
   ============================================================ */
.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.model-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.model-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}
.model-card-header {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.model-card-header > div {
  flex: 1;
  min-width: 0;
}
.model-card-header > .badge {
  flex-shrink: 0;
  margin-left: auto;
}
.model-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 0;
}
.model-info {
  flex: 1;
  min-width: 0;
}
.model-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--text-tertiary);
  font-size: 0.72rem;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
  flex-shrink: 0;
}
.model-copy-btn svg {
  width: 13px;
  height: 13px;
}
.model-copy-btn:hover {
  color: var(--accent);
  border-color: rgba(47, 232, 136, 0.4);
  background: rgba(47, 232, 136, 0.1);
}
.model-copy-btn:active {
  transform: translateY(1px);
}
.model-vendor {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 2px;
}
.model-price {
  display: flex;
  gap: 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.model-price span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.model-price-label {
  color: var(--text-tertiary);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.model-price-value { font-weight: 600; }
.model-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: space-between;
}
.model-context {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

/* ============================================================
   DOCS SIDEBAR LAYOUT
   ============================================================ */
.docs-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  align-items: start;
}
.docs-sidebar {
  position: sticky;
  top: calc(var(--navbar-height) + 32px);
}
.docs-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.docs-sidebar-nav a {
  padding: 8px 14px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.docs-sidebar-nav a:hover { color: var(--text-primary); background: var(--surface-hover); }
.docs-sidebar-nav a.active { color: var(--accent); background: var(--accent-muted); }
.docs-content { min-width: 0; }
.docs-section {
  margin-bottom: 48px;
  scroll-margin-top: calc(var(--navbar-height) + 20px);
}
.docs-section h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 0;
}
.docs-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.docs-section p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 14px;
}
.docs-section ul {
  margin-bottom: 20px;
  padding-left: 20px;
  list-style: disc;
}
.docs-section ul li {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.8;
}
.docs-param-table {
  margin: 20px 0;
}
.docs-param-table th {
  font-size: 0.7rem;
}
.docs-param-table td {
  font-size: 0.82rem;
}
.docs-param-table td:first-child {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
}

/* ============================================================
   USAGE CHART
   ============================================================ */
.chart-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 32px;
}
.chart-container canvas {
  width: 100%;
  max-height: 300px;
}

/* ============================================================
   KEY MASKED TEXT
   ============================================================ */
.key-masked {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .navbar-nav { display: none; }
  .navbar-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025)),
      var(--mobile-nav-bg);
    backdrop-filter: blur(28px) saturate(170%);
    -webkit-backdrop-filter: blur(28px) saturate(170%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.13);
    padding: 8px;
    box-shadow: var(--shadow-md);
  }
  .navbar-nav.open a {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
  }
  .hamburger { display: flex; }
  .app-main {
    padding-left: 20px;
    padding-right: 20px;
  }
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .docs-layout {
    grid-template-columns: 1fr;
  }
  .docs-sidebar {
    position: static;
    display: flex;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 8px;
  }
  .docs-sidebar-nav {
    flex-direction: row;
    gap: 4px;
    flex-wrap: nowrap;
  }
  .docs-sidebar-nav a {
    white-space: nowrap;
  }
  .modal {
    margin: 20px;
    max-height: calc(100vh - 40px);
  }
  .model-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .auth-page {
    align-items: flex-start;
    padding-top: 86px;
  }
  .auth-back-link {
    top: 20px;
    left: 20px;
  }
  .stats-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 32px 24px; }
  .btn-group { flex-wrap: wrap; }
}

/* ============================================================
   Landing Page — Hero, Features, Steps, CTA, Footer
   iOS control-panel style
   ============================================================ */

.home-cinematic-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(50, 240, 140, 0.12), transparent 34%),
    linear-gradient(135deg, #071015 0%, #0b0b0f 48%, #08141c 100%);
}
.home-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.22;
  filter: saturate(1.2) contrast(1.08);
}
.home-aurora {
  position: absolute;
  width: 62vw;
  height: 62vw;
  min-width: 520px;
  min-height: 520px;
  border-radius: 9999px;
  opacity: 0.58;
  filter: blur(58px);
  mix-blend-mode: screen;
  will-change: transform;
}
.home-aurora-a {
  top: -22%;
  left: -14%;
  background: radial-gradient(circle, rgba(50, 240, 140, 0.46), rgba(50, 240, 140, 0.10) 42%, transparent 70%);
  animation: tokenmy-aurora-a 18s ease-in-out infinite alternate;
}
.home-aurora-b {
  top: 8%;
  right: -18%;
  background: radial-gradient(circle, rgba(64, 218, 255, 0.38), rgba(64, 218, 255, 0.10) 45%, transparent 72%);
  animation: tokenmy-aurora-b 22s ease-in-out infinite alternate;
}
.home-aurora-c {
  bottom: -34%;
  left: 24%;
  background: radial-gradient(circle, rgba(126, 245, 211, 0.22), rgba(56, 223, 255, 0.10) 38%, transparent 72%);
  animation: tokenmy-aurora-c 26s ease-in-out infinite alternate;
}
.home-bg-grid {
  position: absolute;
  inset: -20%;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 72px 72px;
  transform: perspective(800px) rotateX(62deg) translateY(-18%);
  transform-origin: 50% 0%;
  animation: tokenmy-grid-drift 20s linear infinite;
}
.home-bg-sweep {
  position: absolute;
  top: -18%;
  left: -40%;
  width: 46%;
  height: 140%;
  opacity: 0.20;
  transform: rotate(18deg);
  background: linear-gradient(90deg, transparent, rgba(158, 255, 232, 0.26), transparent);
  filter: blur(28px);
  animation: tokenmy-sweep 9s cubic-bezier(.22, 1, .36, 1) infinite;
}
.home-bg-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(760px circle at 50% 18%, rgba(50, 240, 140, 0.10), transparent 62%),
    radial-gradient(620px circle at 78% 30%, rgba(100, 210, 255, 0.08), transparent 58%),
    linear-gradient(180deg, rgba(11, 11, 15, 0.48), rgba(11, 11, 15, 0.82) 66%, var(--bg-primary));
}
.home-noise-filter {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.liquid-glass {
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.025);
  background-blend-mode: luminosity;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: none;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.10), 0 22px 70px rgba(0, 0, 0, 0.28);
}
.liquid-glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.2px;
  background: linear-gradient(180deg,
    rgba(255, 255, 255, 0.42) 0%,
    rgba(255, 255, 255, 0.14) 22%,
    rgba(255, 255, 255, 0) 44%,
    rgba(255, 255, 255, 0) 58%,
    rgba(255, 255, 255, 0.14) 80%,
    rgba(255, 255, 255, 0.42) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
@keyframes tokenmy-shiny {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes tokenmy-float-in {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes tokenmy-aurora-a {
  0% { transform: translate3d(0, 0, 0) scale(1) rotate(0deg); }
  100% { transform: translate3d(18vw, 9vh, 0) scale(1.16) rotate(18deg); }
}
@keyframes tokenmy-aurora-b {
  0% { transform: translate3d(0, 0, 0) scale(1.08) rotate(0deg); }
  100% { transform: translate3d(-16vw, 14vh, 0) scale(0.96) rotate(-16deg); }
}
@keyframes tokenmy-aurora-c {
  0% { transform: translate3d(0, 0, 0) scale(0.92) rotate(0deg); }
  100% { transform: translate3d(7vw, -16vh, 0) scale(1.12) rotate(22deg); }
}
@keyframes tokenmy-grid-drift {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 72px 144px, 72px 144px; }
}
@keyframes tokenmy-sweep {
  0%, 16% { transform: translateX(0) rotate(18deg); opacity: 0; }
  32% { opacity: 0.22; }
  68%, 100% { transform: translateX(320%) rotate(18deg); opacity: 0; }
}

/* Hero */
.hero-section {
  text-align: center;
  padding: 100px 28px 72px;
  max-width: 1100px;
  margin: 0 auto;
}
.hero-content {
  animation: tokenmy-float-in 0.8s cubic-bezier(.22, 1, .36, 1) both;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: rgba(245, 245, 247, 0.62);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.hero-eyebrow span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 18px rgba(50, 240, 140, 0.72);
}
.hero-title {
  font-size: clamp(2.7rem, 7vw, 5.25rem);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 0.95;
  margin-bottom: 20px;
  letter-spacing: 0;
}
.hero-title span {
  display: inline-block;
  background-image: linear-gradient(to right, #dffcff 0%, #8cf9d2 18%, #38dfff 38%, #f5ffff 50%, #38dfff 62%, #8cf9d2 82%, #dffcff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: url(#tokenmy-noise);
  animation: tokenmy-shiny 6s linear infinite;
  -webkit-text-stroke: 1px rgba(210, 255, 250, 0.18);
  text-shadow: 0 0 18px rgba(56, 223, 255, 0.28), 0 0 34px rgba(50, 240, 140, 0.20);
}
.hero-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 36px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 56px;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 56px;
  opacity: 0.72;
}
.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.hero-stat-num {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0;
}
.hero-stat-label {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}
.hero-vendor-cloud {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  animation: tokenmy-float-in 0.82s cubic-bezier(.22, 1, .36, 1) 0.08s both;
}
.hero-vendor-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
}
.vendor-logo-card {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  opacity: 0.82;
  transition: transform var(--transition-fast), opacity var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}
.vendor-logo-card:hover {
  transform: translateY(-3px);
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.075);
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.25), 0 0 22px rgba(47, 232, 136, 0.08);
}
.vendor-logo-img {
  display: block;
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.28));
}

.gateway-mockup {
  margin: 72px auto 0;
  max-width: 1040px;
  border-radius: 22px;
  background: rgba(14, 16, 20, 0.78);
  text-align: left;
  animation: tokenmy-float-in 0.9s cubic-bezier(.22, 1, .36, 1) 0.14s both;
}
.mockup-titlebar {
  height: 42px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  color: rgba(245, 245, 247, 0.52);
  font-size: 0.76rem;
}
.traffic-lights {
  display: flex;
  gap: 7px;
}
.traffic-lights span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}
.traffic-lights span:nth-child(1) { background: #ff5f57; }
.traffic-lights span:nth-child(2) { background: #febc2e; }
.traffic-lights span:nth-child(3) { background: #28c840; }
.mockup-status {
  justify-self: end;
  color: var(--accent);
  font-weight: 700;
}
.mockup-grid {
  display: grid;
  grid-template-columns: 220px minmax(260px, 360px) 1fr;
  min-height: 430px;
}
.mockup-sidebar,
.mockup-models {
  border-right: 1px solid rgba(255, 255, 255, 0.10);
}
.mockup-sidebar {
  padding: 18px;
  background: rgba(0, 0, 0, 0.24);
}
.mockup-sidebar,
.mockup-models,
.mockup-reader,
.model-row,
.summary-card {
  min-width: 0;
}
.mockup-compose {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #fff;
  color: #000;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.mockup-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: rgba(245, 245, 247, 0.62);
  font-size: 0.82rem;
}
.mockup-nav.active {
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
}
.mockup-nav span {
  color: rgba(245, 245, 247, 0.42);
}
.mockup-models {
  padding: 14px;
}
.mockup-search {
  height: 34px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  margin-bottom: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(245, 245, 247, 0.40);
  font-size: 0.78rem;
}
.model-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 13px 10px;
  border-radius: 12px;
  color: rgba(245, 245, 247, 0.76);
}
.model-row.active {
  background: rgba(255, 255, 255, 0.09);
}
.model-row strong,
.summary-card strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.84rem;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.model-row small {
  color: rgba(245, 245, 247, 0.42);
  font-size: 0.72rem;
}
.model-row em {
  color: var(--accent);
  font-size: 0.72rem;
  font-style: normal;
}
.model-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.model-dot.openai { background: #32f08c; }
.model-dot.claude { background: #a4f4fd; }
.model-dot.deepseek { background: #64d2ff; }
.model-dot.qwen { background: #f59e0b; }
.mockup-reader {
  padding: 18px;
}
.reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  color: rgba(245, 245, 247, 0.62);
  font-size: 0.78rem;
}
.reader-toolbar div {
  display: flex;
  gap: 6px;
}
.reader-toolbar button {
  height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(245, 245, 247, 0.62);
  font: inherit;
}
.summary-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(50, 240, 140, 0.13), rgba(100, 210, 255, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.10);
}
.summary-card p {
  margin-top: 6px;
  color: rgba(245, 245, 247, 0.58);
  font-size: 0.82rem;
  line-height: 1.65;
}
.spark-icon {
  color: #a4f4fd;
  font-size: 1.15rem;
}
.mockup-reader pre {
  margin-top: 20px;
  max-width: 100%;
  overflow-x: auto;
  padding: 18px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.mockup-reader code {
  color: rgba(245, 245, 247, 0.72);
  font-size: 0.76rem;
  line-height: 1.7;
  font-family: var(--font-mono);
}

/* Section shared */
.section-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: 0;
}
.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-tertiary);
  text-align: center;
  margin-bottom: 48px;
}

/* Why tokenmy */
.why-section {
  padding: 80px 28px;
  max-width: 1040px;
  margin: 0 auto;
}
.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.why-item {
  display: flex;
  gap: 16px;
  padding: 22px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--surface-subtle);
  transition: border-color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}
.why-item:hover {
  border-color: var(--border-light);
  background: var(--surface-default);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}
.why-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: rgba(50, 240, 140, 0.06);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}
.why-item:hover .why-icon {
  border-color: rgba(50, 240, 140, 0.22);
  background: rgba(50, 240, 140, 0.10);
}
.why-body {
  flex: 1;
  min-width: 0;
}
.why-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.why-desc {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  line-height: 1.55;
}

/* Quickstart */
.quickstart-section {
  padding: 72px 28px 64px;
  max-width: 1040px;
  margin: 0 auto;
}
.quickstart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.quickstart-steps {
  display: flex;
  flex-direction: column;
  list-style: none;
  padding: 0;
  margin: 0;
}
.quickstart-step {
  display: flex;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}
.quickstart-step:hover {
  background: var(--surface-hover);
}
.quickstart-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #000;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.quickstart-step-body {
  flex: 1;
  min-width: 0;
}
.quickstart-step-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.quickstart-step-desc {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  line-height: 1.55;
  margin-bottom: 0;
}
.quickstart-step-desc code {
  background: var(--surface-strong);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-family: var(--font-mono);
}
.quickstart-step-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* Terminal mockup */
.quickstart-terminal {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #0d0d10;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.36);
}
.terminal-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  background: #16161a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.terminal-dots {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.terminal-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.terminal-dots span:nth-child(1) { background: #ff5f57; }
.terminal-dots span:nth-child(2) { background: #febc2e; }
.terminal-dots span:nth-child(3) { background: #28c840; }
.terminal-label {
  font-size: 0.68rem;
  color: #6e6e73;
  font-family: var(--font-mono);
  margin-left: 4px;
}
.terminal-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  background: #16161a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 6px 10px 0;
}
.terminal-tab {
  flex-shrink: 0;
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #6e6e73;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.terminal-tab:hover {
  color: #c9d1d9;
}
.terminal-tab.active {
  color: #e5e5ea;
  background: #0d0d10;
  border-color: rgba(255, 255, 255, 0.10);
}
.terminal-body {
  max-height: 380px;
  overflow: auto;
}
.terminal-code {
  margin: 0;
  padding: 20px 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  line-height: 1.7;
  color: #c9d1d9;
  white-space: pre-wrap;
  word-break: break-word;
}
.terminal-code code {
  background: transparent;
  padding: 0;
  font-size: inherit;
  font-family: inherit;
  color: inherit;
}

/* Footer */
.site-footer {
  padding: 24px 28px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--text-tertiary);
  font-size: 0.82rem;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text-secondary);
}
.footer-logo-icon {
  position: relative;
  overflow: hidden;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.22), transparent 30%),
    linear-gradient(145deg, rgba(50, 240, 140, 0.22), rgba(100, 210, 255, 0.10) 48%, rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.footer-links {
  display: flex;
  gap: 20px;
}
.footer-links a {
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.15s;
}
.footer-links a:hover {
  color: var(--text-primary);
}
.footer-copy {
  width: 100%;
  text-align: center;
  margin-top: 10px;
  font-size: 0.78rem;
}

@media (max-width: 768px) {
  .hero-section,
  .why-section,
  .quickstart-section {
    padding-left: 0;
    padding-right: 0;
  }

  .hero-section {
    padding-top: 72px;
  }

  .hero-title {
    font-size: clamp(2.3rem, 13vw, 3.6rem);
    line-height: 1;
  }

  .why-grid,
  .quickstart-grid {
    grid-template-columns: 1fr;
  }

  .gateway-mockup {
    margin-top: 48px;
    border-radius: 18px;
  }

  .mockup-titlebar {
    grid-template-columns: auto 1fr auto;
    gap: 12px;
  }

  .mockup-titlebar > span:nth-child(2) {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mockup-grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .mockup-sidebar,
  .mockup-models {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  }

  .mockup-sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .mockup-compose {
    grid-column: 1 / -1;
  }

  .mockup-nav {
    margin-top: 0;
  }

  .hero-stats {
    gap: 24px;
  }

  .code-block {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .hero-actions,
  .hero-stats {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-stat {
    flex-direction: row;
    justify-content: space-between;
    padding: 0 12px;
  }

  .hero-actions {
    gap: 10px;
  }

  .hero-vendor-cloud {
    width: 100%;
  }

  .hero-vendor-logos {
    gap: 12px;
  }

  .vendor-logo-card {
    width: 48px;
    height: 48px;
    border-radius: 16px;
  }

  .mockup-sidebar {
    grid-template-columns: 1fr;
  }

  .reader-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

}
