/* ============================================
   AI Relay — Design System (Lucis API 风格)
   ============================================
   浅色模式 | 墨绿色品牌色 | 极简卡片式
   ============================================ */

/* ── CSS Variables ───────────────────────── */
:root {
  /* Brand */
  --brand: #2D5A4C;
  --brand-light: #E8F5E9;
  --brand-hover: #23483C;
  --brand-text: #1F2937;

  /* Backgrounds */
  --bg-body: #F5F7FA;
  --bg-sidebar: #FDFCF8;
  --bg-card: #FFFFFF;
  --bg-header: #FFFFFF;
  --bg-hover: #F3F4F6;
  --bg-selected: #E8F5E9;

  /* Text */
  --text-primary: #1F2937;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --text-white: #FFFFFF;
  --text-link: #2D5A4C;

  /* Borders */
  --border: #E5E7EB;
  --border-light: #F3F4F6;

  /* Functional */
  --green: #10B981;
  --green-bg: rgba(16, 185, 129, 0.12);
  --yellow: #F59E0B;
  --yellow-bg: rgba(245, 158, 11, 0.12);
  --red: #EF4444;
  --red-bg: rgba(239, 68, 68, 0.12);
  --blue: #3B82F6;
  --blue-bg: rgba(59, 130, 246, 0.12);

  /* Radius */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.06), 0 4px 6px rgba(0,0,0,0.04);

  /* Transitions */
  --t: all 0.2s ease;

  /* Font */
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
}

/* ── Reset ───────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--text-link); text-decoration: none; transition: var(--t); }
a:hover { color: var(--brand-hover); }
img { max-width: 100%; }

/* ── Layout: Sidebar + Content ──────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  transition: var(--t);
  overflow-y: auto;
}

.sidebar.collapsed {
  width: 60px;
  min-width: 60px;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sidebar-logo .logo-icon {
  width: 32px;
  height: 32px;
  background: var(--brand);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1rem;
  flex-shrink: 0;
}

.sidebar.collapsed .sidebar-logo span { display: none; }

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.sidebar-group-label {
  padding: 12px 20px 4px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.sidebar.collapsed .sidebar-group-label { display: none; }

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--t);
  text-decoration: none;
  border-left: 3px solid transparent;
  position: relative;
}

.sidebar-item:hover { color: var(--text-primary); background: var(--bg-hover); }
.sidebar-item.active {
  color: var(--brand);
  background: var(--brand-light);
  border-left-color: var(--brand);
  font-weight: 600;
}

.sidebar-item .icon { width: 20px; text-align: center; font-size: 1rem; flex-shrink: 0; }
.sidebar.collapsed .sidebar-item { justify-content: center; padding: 10px 0; }
.sidebar.collapsed .sidebar-item .label { display: none; }
.sidebar.collapsed .sidebar-item .badge-sidebar { display: none; }

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.sidebar-footer-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--t);
}
.sidebar-footer-item:hover { color: var(--text-primary); }
.sidebar.collapsed .sidebar-footer-item { justify-content: center; }
.sidebar.collapsed .sidebar-footer-item span { display: none; }

/* Main Content */
.main-content {
  flex: 1;
  margin-left: 240px;
  transition: var(--t);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.sidebar.collapsed + .main-content { margin-left: 60px; }

/* Header */
.top-header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.top-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.top-header-left .breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.top-header-left .breadcrumb span { color: var(--text-primary); font-weight: 500; }

.top-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--green-bg);
  color: var(--green);
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}
.header-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }

.header-balance {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  padding: 4px 10px;
  background: var(--bg-hover);
  border-radius: var(--radius);
}

.header-icon-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius);
  font-size: 1.1rem;
  transition: var(--t);
  position: relative;
}
.header-icon-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.header-icon-btn .dot-red {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
}

.header-user {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.header-user .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}
.header-user .name { font-size: 0.85rem; font-weight: 500; }

/* Page Content */
.page-content {
  padding: 24px;
  flex: 1;
}

.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.page-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ── Container (for landing pages) ──────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ── Buttons ────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--t);
  font-family: var(--font);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

.btn-primary { background: var(--brand); color: var(--text-white); }
.btn-primary:hover { background: var(--brand-hover); color: white; transform: translateY(-1px); box-shadow: var(--shadow); }

.btn-outline { background: transparent; color: var(--text-primary); border-color: var(--border); }
.btn-outline:hover { background: var(--bg-hover); border-color: var(--text-muted); }

.btn-ghost { background: transparent; color: var(--text-secondary); border: none; }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-success { background: var(--green); color: white; }
.btn-success:hover { background: #059669; color: white; }

.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #DC2626; color: white; }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }
.btn-lg { padding: 12px 28px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--radius); font-size: 1rem; }
.btn-icon.btn-sm { width: 30px; height: 30px; font-size: 0.88rem; }

/* ── Cards ──────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  transition: var(--t);
}

.card-hover:hover { box-shadow: var(--shadow-md); border-color: #D1D5DB; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}
.card-title-sm { font-size: 0.82rem; color: var(--text-secondary); font-weight: 500; }

.card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.card-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}

.card-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Grid layouts */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

/* ── Forms ──────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; margin-bottom: 6px; font-size: 0.85rem; font-weight: 600; color: var(--text-primary); }
.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font);
  transition: var(--t);
  outline: none;
}
.form-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(45, 90, 76, 0.12); }
.form-input::placeholder { color: var(--text-muted); }
.form-input.mono { font-family: var(--font-mono); font-size: 0.85rem; }
.form-error { font-size: 0.8rem; color: var(--red); margin-top: 4px; display: none; }
.form-error.show { display: block; }
.form-help { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* Select */
.form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: var(--font);
  transition: var(--t);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(45, 90, 76, 0.12); }

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  cursor: pointer;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: #D1D5DB;
  border-radius: 24px;
  transition: var(--t);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: var(--t);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle input:checked + .toggle-slider { background: var(--brand); }
.toggle input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Badges / Tags ─────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-green { background: var(--green-bg); color: #059669; }
.badge-yellow { background: var(--yellow-bg); color: #D97706; }
.badge-red { background: var(--red-bg); color: #DC2626; }
.badge-blue { background: var(--blue-bg); color: #2563EB; }
.badge-gray { background: #F3F4F6; color: var(--text-secondary); }

.tag {
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 500;
  background: var(--bg-hover);
  color: var(--text-secondary);
}

/* ── Status Dots ────────────────────────── */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-green { background: var(--green); }
.dot-yellow { background: var(--yellow); }
.dot-red { background: var(--red); }

/* ── Tables ─────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-card); }
table { width: 100%; border-collapse: collapse; }
th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #F9FAFB;
  border-bottom: 1px solid var(--border);
}
td {
  padding: 12px 16px;
  font-size: 0.86rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #F9FAFB; }

/* ── Progress Bar ───────────────────────── */
.progress-bar {
  width: 100%;
  height: 8px;
  background: #E5E7EB;
  border-radius: 4px;
  overflow: hidden;
}
.progress-bar .fill {
  height: 100%;
  background: var(--brand);
  border-radius: 4px;
  transition: width 0.6s ease;
}
.progress-bar .fill.warning { background: var(--yellow); }
.progress-bar .fill.danger { background: var(--red); }
.progress-bar .fill.success { background: var(--green); }

/* ── Pagination ─────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  gap: 16px;
}
.pagination-info { font-size: 0.82rem; color: var(--text-secondary); }
.pagination-btns { display: flex; gap: 4px; }
.pagination-btns button {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--t);
}
.pagination-btns button:hover { background: var(--bg-hover); border-color: var(--text-muted); }
.pagination-btns button.active { background: var(--brand); color: white; border-color: var(--brand); }
.pagination-btns button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Tabs ───────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-hover);
  border-radius: var(--radius);
  padding: 3px;
  margin-bottom: 20px;
  overflow-x: auto;
}
.tab-btn {
  padding: 8px 20px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--t);
  font-family: var(--font);
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { background: var(--bg-card); color: var(--text-primary); box-shadow: var(--shadow-sm); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeUp 0.25s ease; }

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

/* ── Toast ──────────────────────────────── */
.toast-container {
  position: fixed;
  top: 72px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 18px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 0.88rem;
  box-shadow: var(--shadow-md);
  animation: slideInR 0.25s ease;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--blue); }

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

/* ── Modal ──────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.2s ease;
}
.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
}
.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 20px;
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ── Empty State ────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
}
.empty-state .icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty-state h3 { font-size: 1rem; color: var(--text-primary); margin-bottom: 6px; }
.empty-state p { font-size: 0.85rem; color: var(--text-secondary); }

/* ── Hero Section (Landing) ─────────────── */
.hero {
  background: linear-gradient(135deg, #F0FDF4 0%, #F5F7FA 50%, #FFF7ED 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
}
.hero-content { text-align: center; max-width: 720px; }
.hero h1 { font-size: 2.8rem; font-weight: 800; line-height: 1.2; margin-bottom: 16px; }
.hero .gradient-text {
  background: linear-gradient(135deg, #2D5A4C, #10B981);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-subtitle { font-size: 1.1rem; color: var(--text-secondary); line-height: 1.7; margin-bottom: 32px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; margin-bottom: 48px; }
.hero-stats { display: flex; gap: 40px; justify-content: center; }
.hero-stats .stat-num { font-size: 1.8rem; font-weight: 800; display: block; color: var(--brand); }
.hero-stats .stat-label { font-size: 0.88rem; color: var(--text-secondary); }

/* ── Sections (Landing) ─────────────────── */
.section { padding: 80px 0; }
.section-dark { background: #F9FAFB; }
.section-title { font-size: 1.8rem; font-weight: 700; text-align: center; margin-bottom: 48px; }

/* Features Grid */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  transition: var(--t);
}
.feature-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.feature-icon { width: 48px; height: 48px; border-radius: var(--radius); background: var(--brand-light); display: flex; align-items: center; justify-content: center; font-size: 1.4rem; margin-bottom: 16px; }
.feature-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.feature-card p { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.6; }

/* Models Grid (Landing) */
.models-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.model-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  transition: var(--t);
}
.model-card:hover { box-shadow: var(--shadow-md); }
.model-badge {
  width: 40px; height: 40px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem; margin: 0 auto 12px; color: white;
}
.model-badge.google { background: #4285F4; }
.model-badge.deepseek { background: #1E3A5F; }

/* Pricing Grid */
.pricing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.pricing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px 24px;
  text-align: center;
  position: relative;
  transition: var(--t);
}
.pricing-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.pricing-card.featured { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(45,90,76,0.1); }
.pricing-card .badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand);
  color: white;
  padding: 4px 16px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}
.pricing-card h3 { font-size: 1rem; margin-bottom: 12px; }
.pricing-card .price { font-size: 2rem; font-weight: 800; color: var(--brand); margin-bottom: 20px; }
.pricing-card .price span { font-size: 0.9rem; font-weight: 400; color: var(--text-muted); }
.pricing-card ul { list-style: none; text-align: left; margin-bottom: 24px; }
.pricing-card ul li { padding: 6px 0; font-size: 0.88rem; color: var(--text-secondary); }

/* Code Block */
.code-block {
  background: #1F2937;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  overflow: hidden;
}
.code-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; background: #374151;
}
.code-header span { color: #D1D5DB; font-size: 0.82rem; font-weight: 500; }
.code-header .copy-btn {
  background: none; border: none; color: #9CA3AF; cursor: pointer; font-size: 0.8rem; font-family: var(--font);
}
.code-header .copy-btn:hover { color: white; }
.code-block pre { padding: 16px; overflow-x: auto; }
.code-block code { font-family: var(--font-mono); font-size: 0.82rem; color: #E5E7EB; line-height: 1.6; white-space: pre; }

/* ── FAQ ────────────────────────────────── */
.faq-list { max-width: 640px; margin: 0 auto; }
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
  background: var(--bg-card);
}
.faq-question {
  width: 100%;
  padding: 16px 20px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font);
  transition: var(--t);
}
.faq-question:hover { background: var(--bg-hover); }
.faq-question .arrow { transition: transform 0.3s; color: var(--text-muted); font-size: 0.85rem; }
.faq-item.open .faq-question .arrow { transform: rotate(180deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.faq-answer-inner { padding: 0 20px 16px; color: var(--text-secondary); font-size: 0.88rem; line-height: 1.7; }

/* ── Footer ─────────────────────────────── */
.footer { border-top: 1px solid var(--border); padding: 32px 0; margin-top: 80px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.footer-copy { font-size: 0.82rem; color: var(--text-muted); }

/* ── Skeleton Loading ───────────────────── */
.skeleton {
  background: linear-gradient(90deg, #F3F4F6 25%, #E5E7EB 50%, #F3F4F6 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Navbar (Landing) ───────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: var(--t);
}
.navbar.scrolled { background: rgba(255,255,255,0.98); box-shadow: var(--shadow); }
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 20px;
}
.nav-logo { display: flex; align-items: center; gap: 10px; font-size: 1.2rem; font-weight: 700; color: var(--text-primary); }
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-links a { color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: var(--text-primary); }
.menu-toggle { display: none; background: none; border: none; font-size: 1.5rem; color: var(--text-primary); cursor: pointer; }

/* ── Misc Helpers ───────────────────────── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); }
.text-sm { font-size: 0.82rem; }
.mono { font-family: var(--font-mono); }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-sm { gap: 8px; }
.gap-md { gap: 16px; }
.gap-lg { gap: 24px; }
.mt-sm { margin-top: 8px; }
.mt-md { margin-top: 16px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 16px; }
.hidden { display: none; }

/* ── Responsive ─────────────────────────── */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .models-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar { width: 0; min-width: 0; overflow: hidden; }
  .sidebar.open { width: 240px; min-width: 240px; box-shadow: 4px 0 20px rgba(0,0,0,0.1); }
  .main-content { margin-left: 0; }
  .sidebar.collapsed + .main-content { margin-left: 0; }

  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .pricing-grid, .features-grid, .models-grid { grid-template-columns: 1fr; }

  .menu-toggle { display: block; }
  .nav-links { display: none; position: absolute; top: 64px; left: 0; right: 0;
    background: rgba(255,255,255,0.98); flex-direction: column; padding: 20px; gap: 12px;
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
  .nav-links.open { display: flex; }

  .hero h1 { font-size: 2rem; }
  .hero-stats { flex-direction: column; gap: 16px; }
  .page-content { padding: 16px; }
  .top-header { padding: 0 16px; }

  .header-user .name { display: none; }
  .header-badge span:not(.dot) { display: none; }
}

/* ── Auth Pages (login/register) ────────── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-md);
}
.auth-card .logo { text-align: center; margin-bottom: 24px; }
.auth-card .logo-icon {
  width: 48px; height: 48px; background: var(--brand); border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center; color: white; font-size: 1.3rem; margin: 0 auto 8px;
}
.auth-card h1 { font-size: 1.3rem; font-weight: 700; text-align: center; margin-bottom: 4px; }
.auth-card .subtitle { font-size: 0.88rem; color: var(--text-secondary); text-align: center; margin-bottom: 24px; }
.auth-tabs { display: flex; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.auth-tab {
  flex: 1; padding: 10px; text-align: center; font-size: 0.9rem; font-weight: 600;
  color: var(--text-secondary); cursor: pointer; border-bottom: 2px solid transparent; transition: var(--t);
}
.auth-tab:hover { color: var(--text-primary); }
.auth-tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.auth-form { display: none; }
.auth-form.active { display: block; }
.auth-divider { text-align: center; font-size: 0.82rem; color: var(--text-muted); margin: 16px 0; position: relative; }
.auth-divider::before, .auth-divider::after {
  content: ''; position: absolute; top: 50%; width: 40%; height: 1px; background: var(--border);
}
.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }
