/* Telemetry Admin — Signal Console
   主题: 深色仪器侧栏 + 冷纸内容台 · 信号青绿强调
   字体: Plus Jakarta Sans (UI) + IBM Plex Mono (数据)
   原则: 侧栏定框架、数字用等宽、卡片左侧信号条、克制动效 */

@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap");

:root {
  /* 壳层 */
  --ink: #0b1220;
  --ink-2: #121a2b;
  --ink-3: #1a2438;
  --ink-border: rgba(148, 163, 184, 0.12);
  --ink-text: #e8edf7;
  --ink-muted: #8b9bb4;

  /* 内容台 */
  --paper: #eef1f6;
  --paper-grid: rgba(15, 23, 42, 0.03);
  --panel: #ffffff;
  --panel-hover: #f8fafc;

  /* 文字 */
  --text: #0f172a;
  --text-secondary: #334155;
  --muted: #64748b;
  --muted-2: #94a3b8;

  /* 边框 */
  --border: #e2e8f0;
  --border-strong: #cbd5e1;

  /* 信号色 */
  --signal: #0f9f8a;
  --signal-hover: #0d8a78;
  --signal-soft: #e6f7f4;
  --signal-glow: rgba(15, 159, 138, 0.22);

  --indigo: #4f46e5;
  --indigo-soft: #eef2ff;

  /* 语义 */
  --danger: #e11d48;
  --danger-soft: #fff1f2;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --warn: #d97706;
  --warn-soft: #fffbeb;

  /* 形状与阴影 */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --sidebar-w: 232px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px -8px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.04);

  --font: "Plus Jakarta Sans", -apple-system, "PingFang SC", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  color-scheme: light;
  font-family: var(--font);
  font-feature-settings: "ss01" 1, "cv11" 1;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}

a { color: var(--signal); text-decoration: none; }
a:hover { color: var(--signal-hover); }

code, pre, .mono, .key {
  font-family: var(--mono);
  font-size: 0.9em;
}

/* ============ 侧栏 ============ */
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(420px 280px at 0% 0%, rgba(15, 159, 138, 0.14), transparent 60%),
    linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%);
  border-right: 1px solid var(--ink-border);
  padding: 20px 14px 16px;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 18px;
  color: var(--ink-text);
  text-decoration: none;
}
.brand:hover { color: #fff; }

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(145deg, #14b8a6 0%, #0f766e 55%, #134e4a 100%);
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 8px 20px -8px rgba(15, 159, 138, .7);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,.85);
}
.brand-mark::before {
  width: 6px; height: 6px;
  left: 8px; top: 14px;
  box-shadow: 10px 0 0 rgba(255,255,255,.55), 18px 0 0 rgba(255,255,255,.3);
}
.brand-mark::after {
  width: 18px; height: 18px;
  border: 1.5px solid rgba(255,255,255,.25);
  background: transparent;
  right: -4px; bottom: -4px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.brand-text strong {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.brand-text span {
  font-size: 11px;
  color: var(--ink-muted);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  padding-top: 4px;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--ink-muted);
  font-size: 13.5px;
  font-weight: 500;
  transition: background .12s, color .12s;
}
.sidebar-nav a:hover {
  background: rgba(255,255,255,.05);
  color: var(--ink-text);
}
.sidebar-nav a.active {
  background: rgba(15, 159, 138, .14);
  color: #5eead4;
  box-shadow: inset 0 0 0 1px rgba(15, 159, 138, .22);
}
.nav-ico {
  width: 18px;
  height: 18px;
  opacity: .85;
  flex-shrink: 0;
}
.sidebar-nav a.active .nav-ico { opacity: 1; }

.sidebar-foot {
  border-top: 1px solid var(--ink-border);
  padding-top: 12px;
  margin-top: 12px;
}
.sidebar-foot .logout {
  width: 100%;
  margin: 0;
}
.sidebar-foot .logout button {
  width: 100%;
  background: transparent;
  color: var(--ink-muted);
  border: 1px solid var(--ink-border);
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 10px;
}
.sidebar-foot .logout button:hover {
  background: rgba(255,255,255,.05);
  color: var(--ink-text);
  border-color: rgba(148, 163, 184, 0.22);
}

/* ============ 主区域 ============ */
.app-main {
  min-width: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255,255,255,.55) 0%, transparent 180px),
    radial-gradient(circle at 1px 1px, var(--paper-grid) 1px, transparent 0) 0 0 / 20px 20px,
    var(--paper);
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 32px 72px;
}

/* ============ 排版 ============ */
h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.25;
}
h2 {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}
h2 .count,
.section-count {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--paper);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-family: var(--mono);
}
h3 {
  margin: 18px 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.page-head .lede {
  color: var(--muted);
  font-size: 13.5px;
  margin: 4px 0 0;
}

.muted { color: var(--muted); }
.hint {
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 12px;
  display: block;
}
.hint code {
  background: var(--paper);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

.empty {
  padding: 56px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  text-align: center;
  color: var(--muted);
  background: var(--panel);
  box-shadow: var(--shadow-xs);
}
.empty-title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.empty a { font-weight: 600; }

/* ============ 按钮 ============ */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--signal);
  color: #fff;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s, transform .08s;
  font-family: inherit;
  line-height: 1.2;
  text-decoration: none;
}
button:hover, .btn:hover {
  background: var(--signal-hover);
  color: #fff;
  text-decoration: none;
}
button:active, .btn:active { transform: translateY(0.5px); }
button:focus-visible, .btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 2px;
}

.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }

.btn-secondary {
  background: var(--panel);
  color: var(--text);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
  background: var(--panel-hover);
  border-color: var(--muted-2);
  color: var(--text);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover { background: #be123c; color: #fff; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border-color: transparent;
  box-shadow: none;
}
.btn-ghost:hover {
  background: rgba(15, 23, 42, 0.04);
  color: var(--text);
}

/* ============ 卡片 ============ */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin: 0 0 16px;
  box-shadow: var(--shadow-xs);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.card-head h2 { margin: 0; }

/* ============ 表格 ============ */
.table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--panel);
  margin: 0 0 16px;
  box-shadow: var(--shadow-xs);
}
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table thead th {
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  color: var(--muted);
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-strong);
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .08s; }
.table tbody tr:hover td { background: var(--panel-hover); }
.table td.num, .table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  font-size: 12.5px;
}
.table td strong { font-weight: 650; }

.key {
  font-size: 12px;
  word-break: break-all;
  color: var(--text-secondary);
  background: var(--paper);
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid var(--border);
}

/* ============ 统计卡片 ============ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin: 0 0 20px;
}
.stat {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px 14px 18px;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.stat::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--signal);
  border-radius: 3px 0 0 3px;
}
.stat:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.stat.tone-indigo::before { background: var(--indigo); }
.stat.tone-warn::before { background: var(--warn); }
.stat.tone-danger::before { background: var(--danger); }
.stat.tone-ok::before { background: var(--ok); }
.stat.tone-muted::before { background: var(--muted-2); }

.stat .label {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}
.stat .value {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.stat .value.small { font-size: 15px; font-weight: 550; }
.stat .delta {
  font-size: 12px;
  margin-top: 6px;
  font-weight: 500;
}
.stat .delta.up { color: var(--ok); }
.stat .delta.down { color: var(--danger); }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}
.chart { height: 320px; width: 100%; }

/* ============ 总览项目卡 ============ */
.project-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.project-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color .12s, box-shadow .12s, transform .12s;
}
.project-card:hover {
  border-color: #b6c2d4;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.project-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.project-card-top h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.project-card-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.mini-metric {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 10px 9px;
}
.mini-metric .k {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.mini-metric .v {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}
.project-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 2px;
}

/* ============ Tab / 项目导航 ============ */
.project-header {
  margin-bottom: 4px;
}
.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 10px;
}
.breadcrumb a {
  color: var(--muted);
}
.breadcrumb a:hover { color: var(--signal); }
.breadcrumb .sep { color: var(--muted-2); }

.project-header h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.project-header .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 12.5px;
  margin-bottom: 4px;
}
.project-header .meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.project-header .meta .meta-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted-2);
}

.tabs {
  display: flex;
  gap: 2px;
  margin: 18px 0 22px;
  padding: 4px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  flex-wrap: wrap;
  width: fit-content;
  max-width: 100%;
}
.tabs a {
  padding: 8px 13px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 550;
  border-radius: 8px;
  transition: color .12s, background .12s, box-shadow .12s;
}
.tabs a:hover {
  color: var(--text);
  background: rgba(255,255,255,.65);
  text-decoration: none;
}
.tabs a.active {
  color: var(--text);
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

/* ============ 表单 ============ */
.form-inline {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
}
input, select, textarea {
  background: var(--panel);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  min-width: 200px;
  font-size: 13.5px;
  font-family: inherit;
  transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--signal);
  box-shadow: 0 0 0 3px var(--signal-glow);
}
input::placeholder { color: var(--muted-2); }

/* ============ 筛选条 ============ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  margin: 0 0 18px;
  box-shadow: var(--shadow-xs);
}
.filter-bar label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.filter-bar input, .filter-bar select {
  min-width: 140px;
  padding: 7px 10px;
  text-transform: none;
  font-weight: 400;
  letter-spacing: 0;
}
.filter-bar .filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: auto;
}

/* ============ 徽章 ============ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--paper);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  line-height: 1.55;
}
.badge.unresolved { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.resolved { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.ignored { background: var(--paper); color: var(--muted); }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }

.notice {
  background: var(--warn-soft);
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin: 12px 0;
  font-size: 13px;
}

/* ============ 堆栈 ============ */
.stack {
  background: #0b1220;
  border: 1px solid #1e293b;
  border-radius: var(--radius);
  padding: 16px;
  overflow: auto;
  max-height: 480px;
  font-size: 12.5px;
  line-height: 1.65;
  white-space: pre-wrap;
  color: #cbd5e1;
  font-family: var(--mono);
}

/* ============ 登录 ============ */
body.login-shell {
  display: grid;
  place-items: center;
  min-height: 100vh;
  background:
    radial-gradient(700px 420px at 15% 10%, rgba(15, 159, 138, 0.16), transparent 55%),
    radial-gradient(560px 360px at 90% 90%, rgba(79, 70, 229, 0.1), transparent 50%),
    linear-gradient(160deg, #0b1220 0%, #121a2b 48%, #0f172a 100%);
  color: var(--ink-text);
}

.login-wrap {
  width: min(400px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.login-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-text);
  justify-content: center;
}
.login-brand .brand-mark { width: 40px; height: 40px; border-radius: 12px; }
.login-brand strong {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.login-brand span {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 500;
  margin-top: 1px;
}

.login-card {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 24px 48px -20px rgba(0,0,0,.45);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-card h1 {
  font-size: 18px;
  margin: 0;
  color: #fff;
  text-align: center;
}
.login-card .lede {
  text-align: center;
  color: var(--ink-muted);
  font-size: 13px;
  margin: -6px 0 4px;
}
.login-card .error {
  background: rgba(225, 29, 72, 0.12);
  color: #fda4af;
  border: 1px solid rgba(225, 29, 72, 0.25);
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.login-card label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}
.login-card input {
  min-width: 0;
  width: 100%;
  background: rgba(15, 23, 42, 0.45);
  border-color: rgba(148, 163, 184, 0.22);
  color: #f8fafc;
}
.login-card input:focus {
  border-color: var(--signal);
  box-shadow: 0 0 0 3px var(--signal-glow);
}
.login-card input::placeholder { color: #64748b; }
.login-card button {
  margin-top: 6px;
  width: 100%;
  padding: 11px 14px;
  font-size: 14px;
}

/* ============ 进度条 ============ */
.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.bar-row + .bar-row { border-top: 1px solid var(--border); }
.bar-row .bar-label {
  min-width: 88px;
  font-size: 12.5px;
  color: var(--text-secondary);
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-row .bar-track {
  flex: 1;
  height: 7px;
  background: var(--paper);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.bar-row .bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--signal), #2dd4bf);
  border-radius: 999px;
  transition: width .3s ease;
}
.bar-row .bar-value {
  min-width: 44px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* ============ 设置区 ============ */
.settings-grid {
  display: grid;
  gap: 14px;
}
.settings-card .card-desc {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 14px;
  line-height: 1.55;
}
.settings-card .key-block {
  display: block;
  margin: 0 0 12px;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  word-break: break-all;
}

/* ============ 设置页 · 接入文档 ============ */
.docs-panel {
  margin-top: 8px;
  padding: 20px 20px 8px;
}
.docs-panel-head {
  margin-bottom: 16px;
}
.cred-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.cred-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.cred-label {
  width: 100%;
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cred-item .key {
  flex: 1;
  min-width: 0;
  word-break: break-all;
}

.docs-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  margin: 0 0 18px;
  background: rgba(15, 23, 42, 0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.docs-tab {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 550;
  box-shadow: none;
}
.docs-tab:hover {
  background: rgba(255,255,255,.65);
  color: var(--text);
}
.docs-tab.active {
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  border-color: var(--border);
}

.docs-pane { display: none; padding-bottom: 16px; }
.docs-pane.active { display: block; }
.docs-pane h3 {
  margin: 20px 0 10px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.docs-pane h3:first-child { margin-top: 0; }
.docs-pane h4 {
  margin: 16px 0 8px;
  font-size: 13px;
  font-weight: 650;
  color: var(--text-secondary);
}
.docs-p {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.docs-steps, .docs-list {
  margin: 0 0 14px;
  padding-left: 1.25rem;
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.65;
}
.docs-steps li, .docs-list li { margin-bottom: 6px; }

.code-block {
  margin: 0 0 14px;
  border: 1px solid #1e293b;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0b1220;
}
.code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  background: #121a2b;
  border-bottom: 1px solid #1e293b;
  color: #8b9bb4;
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--mono);
}
.code-toolbar .btn-ghost {
  color: #94a3b8;
  padding: 3px 8px;
  font-size: 11.5px;
}
.code-toolbar .btn-ghost:hover {
  background: rgba(255,255,255,.06);
  color: #e2e8f0;
}
.code-block pre {
  margin: 0;
  padding: 14px 16px;
  overflow: auto;
  max-height: 420px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  color: #cbd5e1;
  white-space: pre;
}
.code-block code {
  font-family: inherit;
  font-size: inherit;
  background: none;
  padding: 0;
  border: 0;
  color: inherit;
}
.docs-table { margin: 0 0 14px; }
.docs-table .table { font-size: 13px; }
.docs-pane .hint { margin-bottom: 12px; }

/* ============ API 文档页 ============ */
.api-doc {
  padding: 0;
  overflow: hidden;
  margin-bottom: 16px;
}
.api-doc-text {
  margin: 0;
  padding: 20px 22px;
  max-height: none;
  overflow: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: #cbd5e1;
  background: #0b1220;
  white-space: pre-wrap;
  word-break: break-word;
  user-select: text;
  -webkit-user-select: text;
}
.api-snippets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.api-snippets .code-block { margin: 0; }

/* ============ 崩溃行 ============ */
.crash-title {
  font-weight: 600;
  color: var(--text);
}
.crash-title:hover { color: var(--signal); }

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  body.app-shell {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: relative;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 12px 14px;
    gap: 8px;
  }
  .brand { padding: 0 8px 0 0; }
  .sidebar-nav {
    flex-direction: row;
    flex: 1;
    padding-top: 0;
    gap: 4px;
  }
  .sidebar-nav a { padding: 8px 12px; }
  .sidebar-foot {
    border-top: 0;
    padding-top: 0;
    margin-top: 0;
    margin-left: auto;
  }
  .sidebar-foot .logout button { width: auto; }
  .container { padding: 20px 16px 56px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .project-card-metrics { grid-template-columns: repeat(2, 1fr); }
  .filter-bar .filter-actions { margin-left: 0; width: 100%; }
  .tabs { width: 100%; }
}

@media (max-width: 520px) {
  .brand-text span { display: none; }
  h1 { font-size: 20px; }
  .stat .value { font-size: 20px; }
  input, select { min-width: 0; width: 100%; }
  .filter-bar input, .filter-bar select { min-width: 0; flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }
}
