:root {
  --bg: #0f1117;
  --sidebar: #161b22;
  --card: #1c2128;
  --border: #30363d;
  --text: #e6edf3;
  --muted: #8b949e;
  --accent: #58a6ff;
  --green: #3fb950;
  --orange: #d29922;
  --red: #f85149;
  --purple: #a371f7;
  --code-bg: #0d1117;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.7;
}

/* Sidebar */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 24px 0;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 10;
}
.logo { padding: 0 18px 20px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.logo a { text-decoration: none; color: inherit; }
.logo-name { font-size: 17px; font-weight: 700; }
.logo-sub  { font-size: 11px; color: var(--muted); margin-top: 3px; }
.nav-group { margin-bottom: 6px; }
.nav-group-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 6px 18px 3px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 18px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: all .15s;
  text-decoration: none;
}
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.04); }
.nav-item.current {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(88,166,255,.07);
}
.nav-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }

/* Main */
.main {
  margin-left: 240px;
  flex: 1;
  max-width: 820px;
  padding: 48px 56px 100px;
}

/* Page header */
.page-title { font-size: 28px; font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-sub { color: var(--muted); margin-bottom: 24px; font-size: 15px; }

/* Section */
.section { margin-bottom: 28px; }
.section-title {
  font-size: 20px;
  font-weight: 700;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
h3 { font-size: 16px; margin-top: 22px; margin-bottom: 8px; }
p { margin-bottom: 8px; }

/* Base URL */
.base-url-box {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}
.base-url-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}
.base-url-val {
  font-family: monospace;
  font-size: 15px;
  color: var(--green);
  font-weight: 600;
}

/* Badge */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}
.b-gpt { background: rgba(88,166,255,.12); color: var(--accent); }
.b-grok { background: rgba(163,113,247,.12); color: var(--purple); }
.b-img { background: rgba(63,185,80,.12); color: var(--green); }
.b-tok { background: rgba(210,153,34,.12); color: var(--orange); }
.b-once { background: rgba(248,81,73,.10); color: var(--red); }
.b-vip { background: rgba(248,81,73,.12); color: var(--red); }

/* Table */
.mtable { width: 100%; border-collapse: collapse; margin: 12px 0 20px; }
.mtable th {
  text-align: left;
  font-size: 12px;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.mtable td {
  padding: 10px;
  border-bottom: 1px solid rgba(48,54,61,.5);
  font-size: 13px;
}
.mname { font-weight: 600; font-family: monospace; color: var(--accent); }
.mprice { font-weight: 700; color: var(--green); }
.mcache { color: var(--muted); font-size: 12px; margin-left: 4px; }
code {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 12.5px;
  background: rgba(255,255,255,.06);
  padding: 1px 5px;
  border-radius: 3px;
}

/* Code */
.code-wrap {
  position: relative;
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  margin: 12px 0 20px;
  overflow-x: auto;
}
.code-wrap pre {
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre;
  color: var(--text);
}
.str { color: #a5d6ff; }
.kw  { color: #ff7b72; }
.cm  { color: #8b949e; font-style: italic; }
.cp {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
}
.cp:hover { color: var(--text); }

/* Alert */
.alert { border-radius: 8px; padding: 12px 16px; margin: 16px 0; font-size: 13px; line-height: 1.6; }
.alert-blue { background: rgba(88,166,255,.08); border-left: 3px solid var(--accent); }
.alert-green { background: rgba(63,185,80,.08); border-left: 3px solid var(--green); }
.alert-orange { background: rgba(210,153,34,.08); border-left: 3px solid var(--orange); }
.alert-red { background: rgba(248,81,73,.08); border-left: 3px solid var(--red); }

/* Divider */
.divider { border-top: 1px solid var(--border); margin: 28px 0; }

/* Tabs */
.tab-bar { display: flex; gap: 0; margin-bottom: -1px; }
.tab-btn {
  padding: 8px 18px;
  font-size: 13px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  cursor: pointer;
}
.tab-btn.active {
  color: var(--text);
  background: var(--code-bg);
  border-color: var(--border);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* Cards on home */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin: 16px 0 28px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, transform .15s;
  display: block;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.card-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* Footer */
.footer {
  margin-top: 60px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}
.footer a { color: var(--accent); text-decoration: none; }

/* Mobile */
@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 24px 16px 60px; }
}
