/* ═══ OpenCode Design System — 信息捕手·闪讯 Skills ═══ */

@font-face {
  font-family: 'Berkeley Mono';
  src: local('Berkeley Mono'), local('BerkeleyMono-Regular');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Primary */
  --bg: #201d1d;
  --bg-surface: #302c2c;
  --bg-elevated: #3a3535;
  --text: #fdfcfc;
  --text-secondary: #9a9898;
  --text-muted: #6e6e73;

  /* Accent */
  --accent: #007aff;
  --accent-hover: #0056b3;
  --accent-active: #004085;

  /* Semantic */
  --danger: #ff3b30;
  --danger-hover: #d70015;
  --success: #30d158;
  --warning: #ff9f0a;
  --warning-hover: #cc7f08;

  /* Border */
  --border: rgba(15, 0, 0, 0.12);
  --border-strong: #646262;
  --border-tab: #9a9898;

  /* Surface */
  --input-bg: #f8f7f7;
  --input-bg-dark: #2a2626;

  /* Font */
  --font: 'Berkeley Mono', 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;

  /* Radius */
  --radius: 4px;
  --radius-input: 6px;

  /* Transition */
  --transition: 0.15s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.50;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 2px; }
::selection { background: rgba(0, 122, 255, 0.3); color: var(--text); }

a { color: var(--text); text-decoration: underline; font-weight: 500; transition: color var(--transition); }
a:hover { color: var(--accent); }
section, footer, main { position: relative; }

/* ═══ LAYOUT ═══ */
.page { padding-top: 56px; min-height: 100vh; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 32px; }
.section { padding: 80px 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

/* ═══ NAV ═══ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; max-width: 1100px; margin: 0 auto; padding: 0 32px;
}
.nav-logo {
  display: flex; align-items: center; gap: 6px;
  text-decoration: none; user-select: none;
}
.logo-pixel {
  font-size: 14px; font-weight: 700; color: var(--text); letter-spacing: 0.5px;
}
.logo-sep { color: var(--text-muted); margin: 0 2px; }
.logo-flash { font-size: 14px; font-weight: 700; color: var(--text-secondary); }
.logo-bolt { font-size: 12px; }

.nav-links { display: flex; align-items: center; gap: 0; }
.nav-links a {
  color: var(--text-secondary); font-size: 14px; font-weight: 500;
  padding: 8px 16px; text-decoration: none; transition: color var(--transition);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }

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

.nav-hamburger {
  display: none; background: none; border: 1px solid var(--border-strong);
  border-radius: var(--radius); color: var(--text-secondary); cursor: pointer; padding: 6px;
  transition: color var(--transition);
}
.nav-hamburger:hover { color: var(--text); }

.mobile-menu {
  display: none; position: fixed; top: 56px; left: 0; right: 0; bottom: 0;
  background: var(--bg); z-index: 999;
  flex-direction: column; align-items: center; padding-top: 32px; gap: 4px;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-size: 16px; font-weight: 500; color: var(--text-secondary);
  padding: 14px 24px; width: 85%; max-width: 360px; text-align: center;
  text-decoration: none; border-radius: var(--radius); transition: color var(--transition);
}
.mobile-menu a:hover, .mobile-menu a.active { color: var(--text); }

/* ═══ BUTTONS ═══ */
.btn {
  font-family: var(--font); font-size: 14px; font-weight: 500;
  color: var(--text); background: transparent;
  border: 1px solid var(--border-strong); padding: 4px 20px;
  border-radius: var(--radius); cursor: pointer; transition: all var(--transition);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  line-height: 2.00; text-decoration: none;
}
.btn:hover { border-color: var(--text); color: var(--text); }

.btn-primary {
  background: var(--text); color: var(--bg); border-color: var(--text);
  font-weight: 700; padding: 4px 20px;
}
.btn-primary:hover { opacity: 0.88; color: var(--bg); }

.btn-accent {
  background: var(--accent); color: #fff; border-color: var(--accent);
  font-weight: 700;
}
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

.btn-danger { border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: rgba(255, 59, 48, 0.1); }

.btn-sm { padding: 2px 12px; font-size: 13px; }

.btn-copy {
  min-width: 72px; justify-content: center;
  font-size: 13px; padding: 4px 14px;
}
.btn-copy.copied {
  background: rgba(48, 209, 88, 0.1);
  border-color: var(--success);
  color: var(--success);
}

/* ═══ INPUTS ═══ */
.input, .select {
  width: 100%; background: var(--input-bg-dark);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-input); padding: 12px 16px;
  font-family: var(--font); font-size: 14px; color: var(--text);
  outline: none; transition: border-color var(--transition);
}
.input::placeholder { color: var(--text-muted); }
.input:focus, .select:focus { border-color: var(--accent); }

.select {
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236e6e73'%3E%3Cpath d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}

label {
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-muted);
  margin-bottom: 8px; display: block;
}

/* ═══ CARDS ═══ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color var(--transition);
}
.card:hover { border-color: var(--text-secondary); }

/* ═══ PAGE HEADER ═══ */
.page-header {
  margin-bottom: 32px; padding-bottom: 24px;
  position: relative;
}
.page-header::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 1px; background: var(--border-strong);
}
.section-eyebrow {
  font-size: 12px; font-weight: 500; letter-spacing: 2px;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 12px;
}
.page-title {
  font-size: 24px; font-weight: 700; letter-spacing: -0.3px;
  color: var(--text); line-height: 1.50;
}
.page-subtitle {
  font-size: 14px; color: var(--text-secondary);
  margin-top: 8px; line-height: 1.50; max-width: 600px;
}

/* ═══ HERO ═══ */
.hero {
  padding: 96px 0 80px;
  min-height: 100vh;
  display: flex; align-items: center;
}
.hero-inner {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px;
  align-items: center; width: 100%;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 4px 12px; margin-bottom: 24px;
  font-size: 12px; font-weight: 500; color: var(--text-secondary);
  letter-spacing: 1.5px; text-transform: uppercase;
}
.pulse-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--success);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.hero-title {
  font-size: 38px; font-weight: 700; line-height: 1.50;
  letter-spacing: -0.5px; margin-bottom: 20px;
}
.hero-title .line2 { color: var(--text-secondary); }

.hero-sub {
  font-size: 16px; font-weight: 400; line-height: 1.50;
  color: var(--text-secondary); margin-bottom: 32px; max-width: 560px;
}
.hero-sub strong { color: var(--text); font-weight: 700; }

.hero-btns { display: flex; gap: 12px; flex-wrap: wrap; }

/* ═══ TERMINAL ═══ */
.terminal {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  width: 100%;
}
.terminal-bar {
  display: flex; align-items: center; padding: 12px 16px;
  border-bottom: 1px solid var(--border-strong);
}
.dot-group { display: flex; gap: 6px; margin-right: 12px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-r { background: var(--danger); }
.dot-y { background: var(--warning); }
.dot-g { background: var(--success); }
.terminal-title {
  font-size: 12px; color: var(--text-muted); flex: 1; text-align: center;
}

.terminal-body {
  padding: 24px; font-size: 14px; line-height: 1.50;
  min-height: 180px; display: flex; flex-direction: column;
  justify-content: center; gap: 16px;
}

.terminal-prompt {
  display: flex; align-items: center; gap: 0;
  font-size: 14px; word-break: break-all;
}
.terminal-prompt-symbol { color: var(--success); margin-right: 8px; white-space: nowrap; }
.terminal-prompt-cmd { color: var(--text); }
.terminal-cursor {
  display: inline-block; width: 8px; height: 16px;
  background: var(--text); margin-left: 2px;
  animation: blink 1s step-end infinite;
  vertical-align: text-bottom;
  flex-shrink: 0;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.terminal-output {
  color: var(--text-secondary); font-size: 13px; line-height: 1.60;
  opacity: 0; transition: opacity 0.3s ease;
}
.terminal-output.visible { opacity: 1; }

.terminal-actions {
  display: flex; align-items: center; gap: 12px; margin-top: 4px;
}
.terminal-tag {
  display: inline-flex; padding: 2px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius); font-size: 12px;
  color: var(--text-muted);
}

/* ═══ SECTION HEADERS ═══ */
.section-title {
  font-size: 24px; font-weight: 700;
  letter-spacing: -0.3px; margin-bottom: 8px;
  line-height: 1.50;
}
.section-sub {
  font-size: 16px; color: var(--text-secondary);
  line-height: 1.50; margin-bottom: 40px;
}

/* ═══ MODULE CARDS ═══ */
.module-card { cursor: default; }
.module-card:hover { border-color: var(--text-secondary); }
.module-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.module-icon {
  width: 36px; height: 36px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary); flex-shrink: 0;
}
.module-name { font-size: 14px; font-weight: 700; }
.module-desc { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.module-card p {
  font-size: 14px; color: var(--text-secondary);
  line-height: 1.50; margin-bottom: 16px;
}
.endpoint-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 4px 10px;
  color: var(--text-muted); width: fit-content; margin-bottom: 4px;
}
.endpoint-tag .method { color: var(--success); font-weight: 700; font-size: 11px; }
.module-endpoints { display: flex; flex-direction: column; gap: 4px; }

/* ═══ SCROLL ANIMATIONS ═══ */
.fade-up {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* ═══ FOOTER ═══ */
.footer {
  border-top: 1px solid var(--border-strong);
  padding: 48px 0 24px;
}
.footer-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-strong);
  margin-bottom: 20px;
}
.footer h4 {
  font-size: 12px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 12px;
}
.footer p { font-size: 14px; color: var(--text-muted); line-height: 1.50; }
.footer a { color: var(--text-secondary); text-decoration: none; }
.footer a:hover { color: var(--text); }

.footer-wechat-list { display: flex; flex-direction: column; gap: 8px; }
.footer-wechat-item {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-secondary); font-size: 14px;
}
.footer-wechat-item svg { flex-shrink: 0; }

.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px;
  font-size: 13px; color: var(--text-muted);
}
.footer-bottom a { color: var(--text-secondary); text-decoration: underline; }

/* ═══ TABLE ═══ */
.table-wrap {
  overflow-x: auto; border: 1px solid var(--border-strong);
  border-radius: var(--radius); -webkit-overflow-scrolling: touch;
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead { background: var(--bg-surface); }
th {
  padding: 12px 16px; text-align: left;
  font-size: 12px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}
td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(15, 0, 0, 0.12);
  color: var(--text-secondary); line-height: 1.50;
  vertical-align: top;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(253, 252, 252, 0.02); }
.mono { font-family: var(--font); }
.token-masked { color: var(--text-muted); letter-spacing: 1px; }
.table-empty-cell { text-align: center; color: var(--text-muted); }
.table-empty-spacious { padding: 32px; }
.table-actions-col { text-align: right; }
.text-muted { color: var(--text-muted); }

/* ═══ BADGE ═══ */
.badge {
  display: inline-flex; padding: 2px 8px; border-radius: var(--radius);
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px;
}
.badge-admin { background: rgba(255, 159, 10, 0.1); color: var(--warning); border: 1px solid rgba(255, 159, 10, 0.2); }
.badge-user { background: rgba(0, 122, 255, 0.1); color: var(--accent); border: 1px solid rgba(0, 122, 255, 0.2); }
.badge-method { text-transform: uppercase; }
.badge-get { background: rgba(48, 209, 88, 0.1); color: var(--success); }
.badge-post { background: rgba(255, 159, 10, 0.1); color: var(--warning); }
.badge-put { background: rgba(0, 122, 255, 0.1); color: var(--accent); }
.badge-delete { background: rgba(255, 59, 48, 0.1); color: var(--danger); }

/* ═══ MODAL ═══ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(32, 29, 29, 0.9);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity 0.2s, visibility 0.2s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 32px; width: 100%; max-width: 480px;
  max-height: 85vh; overflow-y: auto;
  transform: translateY(12px); transition: transform 0.2s;
}
.modal-overlay.active .modal { transform: translateY(0); }
.modal h3 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.modal-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ═══ PROGRESS BAR ═══ */
.progress-group { margin-bottom: 16px; }
.progress-label {
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--text-muted); margin-bottom: 6px;
}
.progress-bar {
  height: 3px; background: var(--bg-elevated);
  border-radius: 2px; overflow: hidden;
}
.progress-fill {
  height: 100%; border-radius: 2px;
  background: var(--accent);
  transition: width 0.8s ease;
}
.progress-fill.warn { background: var(--warning); }
.progress-fill.danger { background: var(--danger); }

/* ═══ FORM ═══ */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.login-input-group { display: flex; gap: 8px; }
.login-input-group .input { flex: 1; }

/* ═══ TOAST ═══ */
.toast-container {
  position: fixed; top: 72px; right: 16px; z-index: 3000;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 10px 16px; border-radius: var(--radius);
  font-size: 13px; border: 1px solid var(--border-strong);
  background: var(--bg-surface); color: var(--text);
  animation: toastIn 0.2s ease, toastOut 0.2s ease 2.7s forwards;
}
.toast-success { border-color: var(--success); }
.toast-error { border-color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

/* ═══ EMPTY / STAT ═══ */
.empty-state {
  text-align: center; padding: 64px 20px;
  color: var(--text-muted); font-size: 14px;
}
.empty-state svg { margin-bottom: 12px; opacity: 0.2; }
.empty-state p { line-height: 1.50; }

.stat-card { text-align: center; padding: 20px 16px; }
.stat-value {
  font-size: 32px; font-weight: 700;
  color: var(--text); letter-spacing: -0.5px;
}
.stat-label {
  font-size: 12px; color: var(--text-muted);
  margin-top: 4px; letter-spacing: 0.5px; text-transform: uppercase;
}

/* ═══ CARD SECTION TITLE ═══ */
.card-section-title {
  font-size: 14px; font-weight: 700;
  margin-bottom: 16px; color: var(--text);
}

/* ═══ AUTH GATE ═══ */
.auth-gate {
  text-align: center; padding: 48px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius); background: var(--bg-surface);
}
.auth-gate p {
  font-size: 14px; color: var(--text-secondary); margin-bottom: 16px;
}
.auth-gate .login-input-group { max-width: 480px; margin: 0 auto; }
.auth-gate-icon { opacity: 0.15; margin-bottom: 12px; }

/* ═══ DOCS ═══ */
.docs-hero { padding-bottom: 0; }
.docs-page-header { margin-bottom: 0; }
.docs-layout {
  display: grid; grid-template-columns: 200px minmax(0, 1fr);
  gap: 40px; padding: 16px 0 40px;
}
.docs-sidebar { position: sticky; top: 72px; align-self: start; }
.docs-sidebar a {
  display: block; padding: 6px 12px; margin-bottom: 2px;
  font-size: 13px; color: var(--text-muted);
  border-radius: var(--radius); text-decoration: none;
  border-left: 2px solid transparent;
  transition: all var(--transition);
}
.docs-sidebar a:hover, .docs-sidebar a.active {
  color: var(--text); border-left-color: var(--text);
}
.docs-sidebar .sidebar-group { margin-bottom: 12px; }
.docs-sidebar .sidebar-group-title {
  font-size: 11px; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--text-muted);
  padding: 0 12px; margin-bottom: 4px; font-weight: 700;
}

.docs-content h2 {
  font-size: 20px; font-weight: 700;
  margin: 40px 0 12px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border-strong);
}
.docs-content h2:first-child { margin-top: 0; }
.docs-content h3 { font-size: 16px; font-weight: 700; margin: 20px 0 8px; }
.docs-content p {
  font-size: 14px; color: var(--text-secondary);
  margin-bottom: 12px; line-height: 1.50;
}
.docs-content code {
  font-size: 13px; background: var(--bg);
  padding: 2px 6px; border-radius: var(--radius);
  border: 1px solid var(--border-strong); color: var(--text);
}
.docs-content pre {
  background: var(--bg); border: 1px solid var(--border-strong);
  border-radius: var(--radius); padding: 16px;
  margin: 12px 0 16px; overflow-x: auto;
  font-size: 13px; line-height: 1.50; color: var(--text-secondary);
}

.param-table { width: 100%; margin: 8px 0 16px; }
.param-table th { background: var(--bg-surface); }
.param-name { color: var(--text); font-size: 13px; }
.param-required { color: var(--danger); font-size: 11px; margin-left: 4px; font-weight: 700; }
.param-optional { color: var(--text-muted); font-size: 11px; margin-left: 4px; }

.docs-list {
  color: var(--text-secondary); font-size: 14px;
  padding-left: 20px; margin: 8px 0; line-height: 1.50;
}
.docs-list li { margin-bottom: 2px; }
.docs-list li::marker { color: var(--text-muted); }

/* ═══ USER PAGE ═══ */
.usage-query-card,
.usage-section-card { margin-bottom: 20px; }
.usage-stats-grid { margin-bottom: 24px; }
.usage-endpoint-item { margin-bottom: 16px; }
.usage-endpoint-item:last-child { margin-bottom: 0; }
.usage-endpoint-path {
  font-size: 13px; color: var(--accent);
  margin-bottom: 8px; word-break: break-all;
}
.usage-modal-stats { margin-bottom: 16px; }

/* ═══ ADMIN PAGE ═══ */
.table-card { padding: 0; overflow: hidden; }
.admin-quota-cell { font-size: 13px; }
.modal-usage { max-width: 600px; }
.modal-delete { max-width: 400px; }
.action-group { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.action-group .btn-sm { padding: 2px 10px; font-size: 11px; }
.modal-warn-text {
  font-size: 13px; color: var(--danger);
  word-break: break-all; margin-bottom: 8px;
}
.form-section-label {
  font-size: 13px; color: var(--text-secondary); margin: 16px 0 8px;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .container { padding: 0 20px; }
  .nav-inner { padding: 0 20px; }
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }

  .hero { padding: 80px 0 60px; min-height: auto; }
  .hero-title { font-size: 28px; }
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }

  .hero-btns { flex-direction: column; }
  .hero-btns .btn,
  .hero-btns .btn-primary { width: 100%; justify-content: center; text-align: center; }

  .section { padding: 56px 0; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }

  /* Docs mobile: collapsible sidebar */
  .docs-layout { grid-template-columns: 1fr; gap: 0; padding-top: 0; }
  .docs-sidebar {
    position: static;
    padding-bottom: 0; margin-bottom: 20px;
    border-bottom: 1px solid var(--border-strong);
  }
  .docs-sidebar .sidebar-group { margin-bottom: 0; }
  .docs-sidebar .sidebar-group-title { display: none; }
  .docs-sidebar-inner {
    display: none; flex-direction: column; gap: 2px;
    padding: 12px 0;
  }
  .docs-sidebar-inner.open { display: flex; }
  .docs-sidebar a {
    border-left: none; padding: 8px 12px; font-size: 13px;
  }
  .docs-sidebar-toggle {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; padding: 10px 0;
    font-family: var(--font); font-size: 13px; font-weight: 700;
    color: var(--text-secondary); background: none; border: none;
    cursor: pointer; text-transform: uppercase; letter-spacing: 1px;
  }
  .docs-sidebar-toggle svg { transition: transform 0.2s; }
  .docs-sidebar-toggle.open svg { transform: rotate(180deg); }

  /* Docs content: prevent overflow */
  .docs-content { min-width: 0; overflow-x: hidden; }
  .docs-content pre {
    padding: 12px; font-size: 12px;
    overflow-x: auto; word-break: break-all;
    max-width: calc(100vw - 40px);
  }
  .docs-content code { word-break: break-all; }
  .table-wrap { max-width: calc(100vw - 40px); }

  .form-row { grid-template-columns: 1fr; }
  .flex-between { flex-wrap: wrap; }
  .table-actions-col { text-align: left; }

  .card { padding: 16px; }
  .modal { padding: 24px; width: calc(100% - 24px); }

  .terminal-body { padding: 16px; min-height: 140px; }
  .terminal-prompt { font-size: 13px; flex-wrap: wrap; }

  .footer-bottom { flex-direction: column; align-items: flex-start; }

  .page-header { margin-bottom: 24px; padding-bottom: 16px; }
  .page-subtitle { font-size: 13px; }

  .login-input-group { flex-direction: column; }
  .login-input-group .btn { width: 100%; justify-content: center; }

  table { font-size: 13px; }
  th { font-size: 11px; padding: 10px 12px; }
  td { padding: 10px 12px; }

  .docs-content h2 { font-size: 18px; margin-top: 32px; }
  .docs-content p,
  .docs-list { font-size: 13px; }

  .stat-value { font-size: 24px; }
  .toast-container { top: 64px; right: 12px; left: 12px; }

  .auth-gate { padding: 32px 16px; }

  .admin-table th:nth-child(4),
  .admin-table td:nth-child(4) { display: none; }

  /* Hide overview group on mobile docs */
  .sidebar-group-overview { display: none; }
}

/* Desktop: hide mobile sidebar toggle, show inner directly */
@media (min-width: 769px) {
  .docs-sidebar-toggle { display: none; }
  .docs-sidebar-inner { display: block; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 24px; }
  .grid-4 { grid-template-columns: 1fr; }
  .admin-table th:nth-child(2), .admin-table td:nth-child(2),
  .admin-table th:nth-child(4), .admin-table td:nth-child(4) { display: none; }
  .action-group { justify-content: flex-start; }
}
