/* ============================================================
   陪诊师平台 · 管理后台样式
   ============================================================ */

:root {
  --primary: #1677ff;
  --primary-dark: #0958d9;
  --primary-light: #e6f4ff;
  --primary-soft: #bae0fd;

  --green: #10b981;
  --green-light: #d1fae5;
  --orange: #f97316;
  --orange-light: #ffedd5;
  --red: #ef4444;
  --red-light: #fee2e2;
  --purple: #8b5cf6;
  --purple-light: #ede9fe;
  --cyan: #06b6d4;

  --text-1: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --bg: #f6f8fb;
  --card: #ffffff;
  --sidebar-bg: #0f1b2d;
  --sidebar-text: #9fb0c6;
  --sidebar-active: #1677ff;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.16);

  --sidebar-w: 232px;
  --header-h: 60px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--text-1);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================ 布局 ============================ */

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

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  transition: width 0.18s ease, flex-basis 0.18s ease;
  z-index: 30;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1677ff, #0958d9);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(22, 119, 255, 0.4);
}

.brand-mark-lg { width: 56px; height: 56px; flex-basis: 56px; border-radius: 16px; font-size: 26px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.25; white-space: nowrap; }
.brand-text strong { color: #fff; font-size: 15px; }
.brand-text span { font-size: 11px; color: #64748b; letter-spacing: 0.04em; }

.sidebar-nav { flex: 1; padding: 10px 8px 20px; }

.nav-group-title {
  padding: 14px 12px 6px;
  font-size: 11px;
  color: #52626f;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin: 2px 0;
  border-radius: var(--radius-sm);
  color: var(--sidebar-text);
  font-size: 13.5px;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; box-shadow: 0 4px 12px rgba(22, 119, 255, 0.35); }
.nav-item .nav-icon { width: 18px; text-align: center; font-size: 15px; flex: 0 0 18px; }
.nav-item .nav-badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  padding: 0 6px;
  border-radius: 9px;
  line-height: 17px;
  min-width: 18px;
  text-align: center;
}

.sidebar-foot {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 11.5px;
}

.server-status { display: flex; align-items: center; gap: 6px; color: #64748b; }
.server-status::before {
  content: '';
  width: 7px; height: 7px; border-radius: 50%;
  background: #64748b;
}
.server-status.ok { color: #10b981; }
.server-status.ok::before { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.18); }
.server-status.err { color: #ef4444; }
.server-status.err::before { background: #ef4444; }

.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: var(--header-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.breadcrumb { font-size: 14px; color: var(--text-2); font-weight: 500; }
.breadcrumb b { color: var(--text-1); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 14px;
  transition: all 0.15s;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

.user-menu { display: flex; align-items: center; gap: 8px; position: relative; padding-left: 8px; border-left: 1px solid var(--border); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #1677ff, #0958d9);
  color: #fff; display: grid; place-items: center;
  font-size: 13px; font-weight: 600;
}
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta span { font-size: 13px; font-weight: 500; }
.user-meta small { font-size: 11px; color: var(--text-3); }

.dropdown {
  position: absolute;
  right: 0;
  top: 42px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  min-width: 140px;
  padding: 6px;
  display: none;
  z-index: 40;
}
.dropdown.open { display: block; }
.dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
}
.dropdown button:hover { background: var(--primary-light); color: var(--primary); }

.content { padding: 20px 22px 40px; flex: 1; min-width: 0; }

/* 收起侧边栏 */
.app-shell.collapsed .sidebar { width: 64px; flex-basis: 64px; }
.app-shell.collapsed .brand-text,
.app-shell.collapsed .nav-item span.nav-label,
.app-shell.collapsed .nav-group-title,
.app-shell.collapsed .sidebar-foot { display: none; }
.app-shell.collapsed .nav-item { justify-content: center; }
.app-shell.collapsed .nav-item .nav-badge { display: none; }

/* ============================ 卡片 / 区块 ============================ */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
}
.card-head h3 { font-size: 15px; }
.card-head .spacer { margin-left: auto; }
.card-body { padding: 18px; }
.card-body.tight { padding: 0; }

.page-title { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.page-title h2 { font-size: 19px; }
.page-title p { margin: 2px 0 0; color: var(--text-3); font-size: 12.5px; }
.page-title .spacer { margin-left: auto; }

/* 指标卡 */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.metric::after {
  content: '';
  position: absolute;
  right: -20px; top: -20px;
  width: 76px; height: 76px;
  border-radius: 50%;
  background: var(--primary-light);
  opacity: 0.7;
}
.metric-label { font-size: 12.5px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.metric-value { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.metric-value small { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 3px; }
.metric-foot { font-size: 12px; color: var(--text-3); position: relative; z-index: 1; }
.metric-foot .up { color: var(--green); }
.metric-foot .down { color: var(--red); }
.metric.accent-green::after { background: var(--green-light); }
.metric.accent-orange::after { background: var(--orange-light); }
.metric.accent-purple::after { background: var(--purple-light); }
.metric.accent-red::after { background: var(--red-light); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
@media (max-width: 1100px) {
  .grid-2, .grid-3, .grid-2-1 { grid-template-columns: 1fr; }
}

/* ============================ 按钮 ============================ */

.btn {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-2);
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  line-height: 1.5;
}
.btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 500; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; border-color: #dc2626; color: #fff; }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover { background: #059669; border-color: #059669; color: #fff; }
.btn-warn { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-warn:hover { background: #ea580c; border-color: #ea580c; color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-light); }
.btn-sm { padding: 4px 10px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; padding: 11px 14px; font-size: 14px; }

.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ============================ 表单 ============================ */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-light);
  background: #fbfcfe;
  border-radius: var(--radius) var(--radius) 0 0;
}
.toolbar .spacer { margin-left: auto; }

.input, .select, .textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  font-size: 13px;
  color: var(--text-1);
  background: var(--card);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: inherit;
  min-width: 0;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}
.input::placeholder { color: var(--text-3); }
.textarea { resize: vertical; min-height: 78px; width: 100%; }
.select { cursor: pointer; }
.input-sm { padding: 5px 9px; font-size: 12.5px; }
.search-input { width: 220px; }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field > span { font-size: 13px; color: var(--text-2); font-weight: 500; }
.field > span .req { color: var(--red); margin-left: 2px; }
.field .hint { font-size: 12px; color: var(--text-3); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 700px) { .field-row { grid-template-columns: 1fr; } }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .span2 { grid-column: span 2; }
@media (max-width: 700px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: span 1; }
}

/* ============================ 表格 ============================ */

.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data th {
  text-align: left;
  padding: 11px 14px;
  background: #f8fafc;
  color: var(--text-2);
  font-weight: 600;
  font-size: 12.5px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}
table.data td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-2);
  vertical-align: middle;
}
table.data tbody tr:hover { background: #f8fbff; }
table.data td.strong { color: var(--text-1); font-weight: 500; }
table.data td.nowrap, table.data th.nowrap { white-space: nowrap; }
table.data .cell-actions { display: flex; gap: 6px; flex-wrap: wrap; }
table.data .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.empty {
  padding: 56px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}
.empty .empty-icon { font-size: 34px; display: block; margin-bottom: 8px; opacity: 0.5; }

/* 分页 */
.pager {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text-2);
  flex-wrap: wrap;
}
.pager .spacer { margin-left: auto; }
.pager button {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 6px;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
}
.pager button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.pager button.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager button:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============================ 标签 / 状态 ============================ */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: 20px;
  font-size: 12px;
  line-height: 19px;
  white-space: nowrap;
  font-weight: 500;
}
.tag-blue { background: var(--primary-light); color: var(--primary-dark); }
.tag-green { background: var(--green-light); color: #047857; }
.tag-orange { background: var(--orange-light); color: #b45309; }
.tag-red { background: var(--red-light); color: #b91c1c; }
.tag-purple { background: var(--purple-light); color: #6d28d9; }
.tag-grey { background: #f1f5f9; color: var(--text-2); }
.tag-cyan { background: #cffafe; color: #0e7490; }

.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

.avatar-cell { display: flex; align-items: center; gap: 9px; }
.avatar-sm {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary-light); color: var(--primary-dark);
  display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: 0 0 30px;
  overflow: hidden;
}
.avatar-sm img { width: 100%; height: 100%; object-fit: cover; }

/* ============================ 弹窗 ============================ */

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 16px 16px;
  z-index: 100;
  overflow-y: auto;
  animation: fadeIn 0.16s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 520px;
  animation: slideUp 0.18s ease;
  margin-bottom: 6vh;
}
.modal.wide { max-width: 820px; }
.modal.xwide { max-width: 1040px; }
.modal-head {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
}
.modal-head h3 { font-size: 15.5px; }
.modal-head .close { margin-left: auto; border: none; background: none; font-size: 19px; color: var(--text-3); cursor: pointer; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.modal-head .close:hover { background: var(--border-light); color: var(--text-1); }
.modal-body { padding: 20px; max-height: 66vh; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border-light); }

/* ============================ Toast ============================ */

.toast-wrap {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: #1e293b;
  color: #fff;
  padding: 9px 18px;
  border-radius: 22px;
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: slideUp 0.2s ease;
  max-width: 82vw;
}
.toast.ok { background: #059669; }
.toast.err { background: #dc2626; }
.toast.warn { background: #d97706; }

/* ============================ 图表 ============================ */

.chart-box { width: 100%; position: relative; }
.chart-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--text-2); }
.chart-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 5px; }

.bars { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 92px 1fr 62px; gap: 10px; align-items: center; font-size: 12.5px; }
.bar-row .bar-label { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { background: var(--border-light); border-radius: 20px; height: 9px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 20px; background: linear-gradient(90deg, #1677ff, #0958d9); transition: width 0.4s ease; }
.bar-row .bar-value { text-align: right; color: var(--text-1); font-variant-numeric: tabular-nums; font-weight: 500; }

/* ============================ 详情展示 ============================ */

.detail-section { margin-bottom: 22px; }
.detail-section > h4 {
  font-size: 13px;
  color: var(--text-1);
  margin-bottom: 10px;
  padding-left: 9px;
  border-left: 3px solid var(--primary);
  line-height: 1.2;
}
.detail-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; }
.detail-list.one { grid-template-columns: 1fr; }
.detail-item { display: flex; gap: 8px; font-size: 13px; min-width: 0; }
.detail-item dt { color: var(--text-3); flex: 0 0 84px; }
.detail-item dd { margin: 0; color: var(--text-1); word-break: break-all; min-width: 0; }

.kv-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kv-card { background: #f8fafc; border-radius: var(--radius-sm); padding: 12px 14px; }
.kv-card .k { font-size: 12px; color: var(--text-3); }
.kv-card .v { font-size: 18px; font-weight: 600; margin-top: 3px; font-variant-numeric: tabular-nums; }

.thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.thumb {
  width: 92px; height: 92px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); object-fit: cover; cursor: pointer; background: #f1f5f9;
}

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 16px 22px; border-left: 2px solid var(--border); }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before {
  content: ''; position: absolute; left: -6px; top: 4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.timeline .t-title { font-size: 13px; font-weight: 500; color: var(--text-1); }
.timeline .t-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }

.notice-bar {
  background: var(--primary-light);
  border: 1px solid var(--primary-soft);
  color: var(--primary-dark);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* ============================ 登录页 ============================ */

.login-body { background: var(--bg); }
.login-split { display: flex; min-height: 100vh; }

.login-brand {
  flex: 1 1 46%;
  background: linear-gradient(150deg, #0f1b2d 0%, #14355e 55%, #0b4ba8 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  position: relative;
  overflow: hidden;
}
.login-brand::before,
.login-brand::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(22, 119, 255, 0.5), transparent 70%);
}
.login-brand::before { width: 520px; height: 520px; right: -160px; top: -140px; }
.login-brand::after { width: 380px; height: 380px; left: -120px; bottom: -120px; opacity: 0.7; }
.login-brand-inner { position: relative; z-index: 1; max-width: 400px; }
.login-brand h1 { font-size: 30px; margin: 20px 0 8px; letter-spacing: 0.01em; }
.login-brand p { color: #b7c8de; margin: 0 0 26px; font-size: 14px; }
.login-features { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.login-features li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: #d6e2f0; }
.login-features li::before {
  content: '✓'; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(16, 185, 129, 0.22); color: #34d399;
  display: grid; place-items: center; font-size: 11px; flex: 0 0 20px;
}

.login-panel {
  flex: 0 0 460px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--card);
}
.login-form { width: 100%; max-width: 330px; }
.login-form h2 { font-size: 21px; margin-bottom: 6px; }
.login-hint { color: var(--text-3); font-size: 13px; margin: 0 0 24px; }
.login-error {
  background: var(--red-light);
  color: #b91c1c;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  font-size: 12.5px;
  margin-bottom: 14px;
}
.login-tip {
  margin-top: 22px;
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.7;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
@media (max-width: 900px) {
  .login-brand { display: none; }
  .login-panel { flex: 1; }
}

/* ============================ 工具类 ============================ */

.muted { color: var(--text-3); }
.small { font-size: 12px; }
.strong { font-weight: 600; color: var(--text-1); }
.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; align-items: center; gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.spacer { margin-left: auto; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-orange { color: var(--orange); }
.text-primary { color: var(--primary); }
.hidden { display: none !important; }
.center { text-align: center; }
.loading-block { padding: 50px; text-align: center; color: var(--text-3); font-size: 13px; }
.spinner {
  display: inline-block; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--primary-soft); border-top-color: var(--primary);
  animation: spin 0.7s linear infinite; vertical-align: -3px; margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }
.tab {
  padding: 9px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tab:hover { color: var(--primary); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

.switch { position: relative; display: inline-block; width: 38px; height: 21px; flex: 0 0 38px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0; background: #cbd5e1; border-radius: 20px;
  cursor: pointer; transition: 0.2s;
}
.switch span::before {
  content: ''; position: absolute; width: 15px; height: 15px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: 0.2s;
}
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::before { transform: translateX(17px); }

@media (max-width: 820px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); }
  .app-shell.mobile-open .sidebar { transform: none; }
  .content { padding: 14px; }
  .topbar { padding: 0 12px; }
  .metric-value { font-size: 22px; }
}
