/* Sovell 控制台 — 原生 CSS，无外部资源 */

:root {
  --primary: #2563eb;
  --primary-600: #1d4ed8;
  --primary-50: #eff6ff;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-soft: #334155;
  --muted: #64748b;
  --sidebar: #0f172a;
  --ok: #15803d;
  --ok-bg: #ecfdf5;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 10px 28px -18px rgba(15, 23, 42, 0.25);
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

a {
  color: var(--primary);
}

button,
input,
select,
textarea {
  font-family: inherit;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

code {
  font-family: var(--mono);
  font-size: 12.5px;
  background: #f1f5f9;
  color: var(--text);
  padding: 1px 6px;
  border-radius: 5px;
}

pre code {
  background: none;
  padding: 0;
  border-radius: 0;
}

.muted {
  color: var(--muted);
}

.strong {
  font-weight: 600;
}

.nowrap {
  white-space: nowrap;
}

.text-warn {
  color: var(--warn);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 启动遮罩 ---------- */

.boot {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--bg);
  color: var(--muted);
  font-size: 13.5px;
}

.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #dbeafe;
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
  flex: none;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- 登录页 ---------- */

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
  background:
    radial-gradient(900px 460px at 12% -10%, #dbeafe 0%, rgba(219, 234, 254, 0) 60%),
    radial-gradient(760px 420px at 100% 0%, #e0e7ff 0%, rgba(224, 231, 255, 0) 55%),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 24px 60px -32px rgba(15, 23, 42, 0.4);
}

.login-card h1 {
  margin: 22px 0 4px;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.login-card > p.muted {
  margin: 0 0 22px;
  font-size: 13px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 18px;
  color: #f8fafc;
}

.brand strong {
  display: block;
  font-size: 16px;
  letter-spacing: 0.02em;
}

.brand small {
  display: block;
  color: #94a3b8;
  font-size: 11px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
}

.brand--login {
  padding: 0;
  color: var(--text);
}

.brand--login small {
  color: var(--muted);
}

/* ---------- 应用外壳 ---------- */

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: 232px;
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  background: var(--sidebar);
  color: #cbd5e1;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  color: #cbd5e1;
  font-size: 14px;
  text-decoration: none;
}

.nav-item svg {
  flex: none;
  opacity: 0.8;
}

.nav-item:hover {
  background: rgba(148, 163, 184, 0.14);
  color: #f8fafc;
}

.nav-item.is-active {
  background: var(--primary);
  color: #fff;
}

.nav-item.is-active svg {
  opacity: 1;
}

.sidebar-foot {
  margin-top: auto;
  padding: 12px 10px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  color: #64748b;
  font-size: 11px;
}

.main {
  margin-left: 232px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 28px;
  background: rgba(244, 246, 251, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.topbar-heading {
  min-width: 0;
}

.topbar-heading h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.topbar-heading p {
  margin: 1px 0 0;
  font-size: 12.5px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.avatar {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--primary-50);
  color: var(--primary-600);
  font-size: 13px;
  font-weight: 600;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}

.user-meta strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-meta small {
  color: var(--muted);
  font-size: 11px;
}

.view {
  flex: 1;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 28px 48px;
  outline: none;
}

/* ---------- 按钮 ---------- */

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text-soft);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.btn:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #94a3b8;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-600);
  border-color: var(--primary-600);
}

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

.btn-danger:hover:not(:disabled) {
  background: #991b1b;
  border-color: #991b1b;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
}

.btn-ghost:hover:not(:disabled) {
  background: #fff;
  border-color: var(--border-strong);
}

.btn-danger-ghost {
  background: #fff;
  border-color: #fecaca;
  color: var(--danger);
}

.btn-danger-ghost:hover:not(:disabled) {
  background: var(--danger-bg);
  border-color: #fca5a5;
}

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

.btn-block {
  width: 100%;
}

.btn.is-busy {
  cursor: progress;
}

/* ---------- 表单 ---------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-soft);
}

.field input,
.field select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
}

.field input::placeholder {
  color: #94a3b8;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.form-error {
  margin: 0 0 12px;
  padding: 9px 12px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 12.5px;
}

.demo-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 22px;
  padding: 12px 14px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12.5px;
}

.demo-hint code {
  color: var(--text);
}

.demo-hint .btn {
  margin-left: auto;
}

/* ---------- 页面布局 ---------- */

.page-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.card-head > div:first-child {
  min-width: 0;
}

.card-head h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.005em;
}

.card-head p {
  margin: 2px 0 0;
  font-size: 12.5px;
}

.card-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: none;
  margin-left: auto;
}

.card-head-actions .btn {
  flex: none;
}

.card-head-actions .btn-primary {
  min-width: 76px;
}

.card-body {
  padding: 18px 20px;
}

.card-body--flush {
  padding: 0;
}

.card--table {
  overflow: hidden;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 1279px) {
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
}

.metric-label {
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}

.metric-value {
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -0.015em;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.metric-value .unit {
  margin-left: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.metric-sub {
  color: var(--muted);
  font-size: 12px;
}

.metric-sub.is-warn {
  color: var(--warn);
  font-weight: 500;
}

/* ---------- 表格 ---------- */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead th {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: #f8fafc;
}

th.num,
td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

th.actions-col,
td.actions-col {
  text-align: right;
  white-space: nowrap;
}

tfoot th,
tfoot td {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  background: #f8fafc;
  font-size: 12.5px;
  text-align: left;
}

tfoot th.num,
tfoot td.num {
  text-align: right;
}

.row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.cell-ellipsis {
  display: inline-block;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}

/* ---------- 徽标 ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}

.badge--ok {
  background: var(--ok-bg);
  border-color: #a7f3d0;
  color: var(--ok);
}

.badge--warn {
  background: var(--warn-bg);
  border-color: #fde68a;
  color: var(--warn);
}

.badge--danger {
  background: var(--danger-bg);
  border-color: #fecaca;
  color: var(--danger);
}

.badge--muted {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #475569;
}

.badge--info {
  background: var(--primary-50);
  border-color: #bfdbfe;
  color: var(--primary-600);
}

/* ---------- 图表 ---------- */

.chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding-top: 16px;
}

.bar-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.bar-value {
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.bar-track {
  width: 100%;
  max-width: 52px;
  height: 160px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  border-radius: 7px 7px 4px 4px;
  background: #f1f5f9;
}

.bar-fill {
  width: 100%;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #60a5fa, #2563eb);
  min-height: 3px;
}

.bar-fill--zero {
  min-height: 2px;
  background: #e2e8f0;
}

.bar-label {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.chart-foot {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
}

/* ---------- 最近审计列表 ---------- */

.audit-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 332px;
  overflow: auto;
}

.audit-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid #f1f5f9;
}

.audit-list li:last-child {
  border-bottom: 0;
}

.audit-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.audit-action {
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
}

.audit-target {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audit-list time {
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}

/* ---------- 空态 / 加载 / 错误 ---------- */

.empty {
  padding: 32px 16px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.empty--sm {
  padding: 20px 16px;
}

.loading-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 64px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 13.5px;
}

.state-card {
  padding: 40px 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.state-card h2 {
  margin: 0 0 6px;
  font-size: 16px;
}

.state-card p {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- 代码块 / 密钥 ---------- */

.code-block {
  margin: 0;
  padding: 14px 16px;
  overflow: auto;
  border-radius: 10px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
}

.code-block code {
  background: none;
  padding: 0;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
}

.key-box {
  display: block;
  max-height: 150px;
  overflow: auto;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #f8fafc;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.key-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.key-row .key-box {
  flex: 1;
  min-width: 220px;
}

.alert {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 13px;
}

.alert strong {
  display: block;
  margin-bottom: 2px;
}

.alert p {
  margin: 0;
  font-size: 12.5px;
}

.alert--warn {
  border-color: #fde68a;
  background: var(--warn-bg);
  color: #92400e;
}

.secret-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.secret-box code {
  display: block;
  padding: 12px 14px;
  border-radius: 9px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.mini-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 16px;
  margin: 0;
  font-size: 12.5px;
}

.mini-meta dt {
  color: var(--muted);
}

.mini-meta dd {
  margin: 0;
}

/* ---------- 弹窗 ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.5);
}

.modal {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 40px);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 60px -20px rgba(15, 23, 42, 0.5);
  animation: modal-in 0.16s ease-out;
}

.modal--wide {
  max-width: 640px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-head h2 {
  margin: 0;
  font-size: 16px;
}

.modal-close {
  padding: 2px 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.modal-close:hover {
  background: #f1f5f9;
  color: var(--text);
}

.modal-body {
  padding: 20px;
  overflow-y: auto;
}

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  border-radius: 0 0 14px 14px;
  background: #f8fafc;
}

.modal-text {
  margin: 0;
  color: var(--text-soft);
  font-size: 13.5px;
  line-height: 1.65;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Toast ---------- */

.toast-root {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(360px, calc(100vw - 24px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 12px;
  border-radius: 10px;
  background: #0f172a;
  color: #f8fafc;
  box-shadow: 0 12px 30px -12px rgba(15, 23, 42, 0.5);
  font-size: 13px;
  pointer-events: auto;
  animation: toast-in 0.16s ease-out;
}

.toast--error {
  background: #7f1d1d;
}

.toast-icon {
  width: 18px;
  height: 18px;
  flex: none;
  display: grid;
  place-items: center;
  margin-top: 1px;
  border-radius: 50%;
  background: #334155;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.toast--success .toast-icon {
  background: #16a34a;
}

.toast--error .toast-icon {
  background: #ef4444;
}

.toast-text {
  flex: 1;
  overflow-wrap: anywhere;
}

.toast-close {
  padding: 0 2px;
  border: 0;
  background: none;
  color: #cbd5e1;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.toast.is-out {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 移动端 ---------- */

.bottom-nav {
  display: none;
}

@media (max-width: 1040px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .sidebar {
    display: none;
  }

  .main {
    margin-left: 0;
  }

  .topbar {
    padding: 10px 16px;
    gap: 10px;
  }

  .topbar-heading h1 {
    font-size: 17px;
  }

  .topbar-heading p {
    display: none;
  }

  .user-meta {
    display: none;
  }

  .view {
    padding: 16px 14px 92px;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .metric {
    padding: 13px 14px;
  }

  .metric-value {
    font-size: 22px;
  }

  .card-head {
    padding: 14px;
  }

  .card-body {
    padding: 14px;
  }

  thead th,
  tbody td,
  tfoot th,
  tfoot td {
    padding: 9px 12px;
  }

  .table-wrap table {
    min-width: 620px;
  }

  .table-wrap--wide table {
    min-width: 900px;
  }

  .chart {
    gap: 6px;
  }

  .chart .bar-track {
    height: 150px;
  }

  .chart .bar-value {
    font-size: 10.5px;
  }

  .toast-root {
    top: 12px;
    right: 12px;
    left: 12px;
    width: auto;
  }

  .modal-backdrop {
    padding: 12px;
    align-items: flex-end;
  }

  .modal {
    max-height: calc(100vh - 24px);
  }

  .modal-foot {
    flex-wrap: wrap;
  }

  .cell-ellipsis {
    max-width: 200px;
  }

  .bottom-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 25;
    display: flex;
    justify-content: space-around;
    padding: 6px max(10px, env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom))
      max(10px, env(safe-area-inset-right));
    border-top: 1px solid var(--border);
    background: #fff;
  }

  .bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 4px 0;
    border-radius: 8px;
    color: var(--muted);
    font-size: 10.5px;
    text-decoration: none;
  }

  .bottom-nav a.is-active {
    color: var(--primary);
  }
}

@media (max-width: 460px) {
  .login-card {
    padding: 24px 20px;
  }

  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .row-actions {
    justify-content: flex-start;
  }

  .user-chip {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- 补充：单元格堆叠与间距 ---------- */

.cell-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}

.cell-stack small {
  font-size: 11.5px;
  line-height: 1.3;
}

.field-hint--spaced {
  margin-top: 10px;
}
