/* ==========================================================================
   面视通 · 运营后台
   设计口径：深色侧栏 + 浅色内容区，信息密度优先，克制的蓝/绿/琥珀语义色。
   不依赖任何 CDN，所有图形（图表、图标）都是内联 SVG。
   ========================================================================== */

:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --line: #e8edf5;
  --line-strong: #dbe3ef;
  --ink: #0f172a;
  --text: #1d2939;
  --muted: #667085;
  --faint: #98a2b3;

  --primary: #2e6bf6;
  --primary-deep: #1e55d6;
  --primary-soft: #edf2ff;

  --green: #12b76a;
  --green-soft: #e8f8f1;
  --amber: #f79009;
  --amber-soft: #fef5e7;
  --red: #f04438;
  --red-soft: #feeceb;
  --purple: #7a5af8;
  --purple-soft: #f3efff;
  --cyan: #06aed4;
  --cyan-soft: #e6f8fc;

  --sidebar: #0b1220;
  --sidebar-2: #0e1728;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-pop: 0 18px 40px -18px rgba(16, 24, 40, 0.28), 0 2px 8px rgba(16, 24, 40, 0.05);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
svg { display: block; }

::selection { background: #d7e2ff; }

.num { font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ 骨架 */

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 248px;
  background: linear-gradient(180deg, #0c1425 0%, var(--sidebar) 45%, #080e1a 100%);
  display: flex;
  flex-direction: column;
  padding: 20px 14px 14px;
  z-index: 40;
  border-right: 1px solid rgba(255, 255, 255, 0.04);
}

.sidebar::after {
  content: "";
  position: absolute;
  top: -120px;
  left: -60px;
  width: 280px;
  height: 280px;
  background: radial-gradient(closest-side, rgba(46, 107, 246, 0.22), transparent 70%);
  pointer-events: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 20px;
  position: relative;
  z-index: 1;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(145deg, #4d86ff 0%, #2e6bf6 55%, #1e4fd0 100%);
  display: grid;
  place-items: center;
  box-shadow: 0 8px 18px -8px rgba(46, 107, 246, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  flex: none;
}

.brand-text { min-width: 0; }
.brand-name {
  color: #fff;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.brand-sub {
  color: #6b7d99;
  font-size: 11px;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

.nav { flex: 1; overflow-y: auto; padding-top: 2px; position: relative; z-index: 1; }
.nav::-webkit-scrollbar { width: 0; }

.nav-group { padding: 14px 10px 6px; }
.nav-group span {
  color: #4f6280;
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 10px;
  border-radius: 9px;
  color: #a5b3c8;
  font-size: 13px;
  margin-bottom: 2px;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-item svg { width: 17px; height: 17px; opacity: 0.9; flex: none; }
.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: #e8eef8; }

.nav-item.active {
  background: linear-gradient(90deg, rgba(46, 107, 246, 0.2), rgba(46, 107, 246, 0.08));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(89, 138, 255, 0.18);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: -14px;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: #4d86ff;
  box-shadow: 0 0 12px rgba(77, 134, 255, 0.9);
}

.nav-item.active svg { color: #8fb4ff; opacity: 1; }

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 19px;
  padding: 0 6px;
  border-radius: 6px;
  background: rgba(240, 68, 56, 0.16);
  color: #ff8b82;
  font-size: 11px;
  font-weight: 600;
  display: grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}
.nav-badge.calm { background: rgba(46, 107, 246, 0.16); color: #8fb4ff; }

.sidebar-foot {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 12px;
  margin-top: 8px;
  position: relative;
  z-index: 1;
}

.who {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px;
  border-radius: 10px;
}
.who:hover { background: rgba(255, 255, 255, 0.04); }
.who-meta { min-width: 0; flex: 1; }
.who-name { color: #eef3fb; font-size: 12.5px; font-weight: 600; }
.who-role { color: #64748b; font-size: 11px; margin-top: 1px; }
.who form { display: flex; }
.who .logout {
  width: 28px; height: 28px; border: 0; border-radius: 8px;
  background: transparent; color: #64748b; cursor: pointer;
  display: grid; place-items: center;
}
.who .logout:hover { background: rgba(240, 68, 56, 0.14); color: #ff8b82; }

/* ------------------------------------------------------------------ 主区 */

.main {
  margin-left: 248px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 66px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 18px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}

.page-title { min-width: 0; }
.page-title h1 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--ink);
  line-height: 1.3;
}
.page-title p {
  margin: 2px 0 0;
  color: var(--faint);
  font-size: 11.5px;
}

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }

.search {
  position: relative;
  width: 246px;
}
.search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--faint);
}
.search input {
  width: 100%;
  height: 36px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: #f1f4f9;
  padding: 0 12px 0 34px;
  font-size: 12.5px;
  color: var(--text);
  outline: none;
  transition: 0.15s ease;
}
.search input::placeholder { color: #a6b0c0; }
.search input:focus {
  background: #fff;
  border-color: #c6d6ff;
  box-shadow: 0 0 0 3px rgba(46, 107, 246, 0.1);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: #667085;
  cursor: pointer;
  display: grid;
  place-items: center;
  position: relative;
}
.icon-btn:hover { background: #f1f4f9; color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 2px #fff;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 3px 10px 3px 4px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}
.topbar-user .meta { line-height: 1.2; }
.topbar-user .meta b { display: block; font-size: 12px; font-weight: 600; color: var(--text); }
.topbar-user .meta span { display: block; font-size: 10.5px; color: var(--faint); margin-top: 1px; }

.content {
  padding: 24px 28px 56px;
  max-width: 1480px;
  width: 100%;
  margin: 0 auto;
}

/* ------------------------------------------------------------------ 通用 */

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

.card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 20px 0;
}
.card-head.tight { padding-bottom: 14px; border-bottom: 1px solid #f1f4f9; }
.card-title { font-size: 13.5px; font-weight: 650; color: var(--ink); letter-spacing: 0.01em; }
.card-sub { font-size: 11.5px; color: var(--faint); margin-top: 2px; }
.card-head .right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.card-body { padding: 16px 20px 20px; }
.card-body.flush { padding: 14px 0 4px; }

.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); gap: 16px; }

.section-gap { margin-top: 16px; }

.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 11.5px; }
.strong { font-weight: 650; color: var(--ink); }
.mono { font-family: var(--mono); }

.hr { height: 1px; background: #f1f4f9; border: 0; margin: 16px 0; }

/* ------------------------------------------------------------------ KPI */

.kpi {
  position: relative;
  padding: 17px 18px 15px;
  overflow: hidden;
}
.kpi-top { display: flex; align-items: center; gap: 9px; }
.kpi-ico {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; flex: none;
}
.kpi-ico svg { width: 16px; height: 16px; }
.kpi-label { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi-value {
  font-size: 27px;
  font-weight: 660;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-top: 12px;
  font-variant-numeric: tabular-nums;
}
.kpi-value small { font-size: 12px; font-weight: 500; color: var(--faint); margin-left: 4px; letter-spacing: 0; }
.kpi-foot { display: flex; align-items: flex-end; gap: 8px; margin-top: 8px; }
.kpi-spark { margin-left: auto; opacity: 0.9; }

.delta {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 19px;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.delta svg { width: 11px; height: 11px; }
.delta.up { background: var(--green-soft); color: #067647; }
.delta.down { background: var(--red-soft); color: #b42318; }
.delta.flat { background: #f2f4f7; color: var(--muted); }
.delta-note { font-size: 11px; color: var(--faint); }

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

.chart-wrap { padding: 6px 14px 10px 14px; }
.chart-svg { width: 100%; height: auto; overflow: visible; }
.chart-grid line { stroke: #eef2f8; stroke-width: 1; }
.chart-axis text { fill: #a4aec0; font-size: 10px; font-variant-numeric: tabular-nums; }
.chart-label text { fill: #98a2b3; font-size: 10px; }
.chart-dot { fill: #fff; stroke: var(--primary); stroke-width: 2; }
.chart-peak { fill: #0f172a; font-size: 10.5px; font-weight: 600; }

.legend { display: flex; align-items: center; gap: 14px; font-size: 11.5px; color: var(--muted); }
.legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 5px; }

.donut-wrap { display: flex; align-items: center; gap: 18px; padding: 6px 18px 4px; }
.donut-meta { flex: 1; display: flex; flex-direction: column; gap: 9px; }
.donut-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.donut-row i { width: 8px; height: 8px; border-radius: 3px; }
.donut-row b { margin-left: auto; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.donut-row span.pct { color: var(--faint); font-size: 10.5px; width: 34px; text-align: right; }

.donut-center { fill: var(--ink); font-size: 19px; font-weight: 650; }
.donut-center-sub { fill: #98a2b3; font-size: 9.5px; }

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

.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8b97ab;
  background: #fafbfe;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td {
  padding: 12px 16px;
  border-bottom: 1px solid #f2f5fa;
  vertical-align: middle;
  font-size: 12.5px;
  color: var(--text);
}
.tbl tbody tr:hover td { background: #fbfcff; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .right { text-align: right; }
.tbl .nowrap { white-space: nowrap; }
.tbl .shrink { width: 1%; white-space: nowrap; }

.cell-main { font-weight: 550; color: var(--ink); }
.cell-sub { color: var(--faint); font-size: 11px; margin-top: 1px; }
.cell-person { display: flex; align-items: center; gap: 9px; }

.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 650;
  flex: none;
  letter-spacing: 0;
}
.avatar.lg { width: 54px; height: 54px; font-size: 19px; border-radius: 16px; }
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
.tone-0 { background: #e9f0ff; color: #2e6bf6; }
.tone-1 { background: #e8f8f1; color: #0f9f61; }
.tone-2 { background: #fef3e6; color: #dc7a05; }
.tone-3 { background: #f3efff; color: #6d4df0; }
.tone-4 { background: #e6f8fc; color: #0797b8; }
.tone-5 { background: #feeceb; color: #d93a2f; }

/* 徽章 */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 550;
  white-space: nowrap;
}
.badge i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.green { background: var(--green-soft); color: #067647; }
.badge.amber { background: var(--amber-soft); color: #b54708; }
.badge.red { background: var(--red-soft); color: #b42318; }
.badge.blue { background: var(--primary-soft); color: var(--primary-deep); }
.badge.purple { background: var(--purple-soft); color: #5b3ee0; }
.badge.gray { background: #f2f4f7; color: #475467; }
.badge.cyan { background: var(--cyan-soft); color: #0b7f97; }

/* 按钮 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 13px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 12.5px;
  font-weight: 550;
  cursor: pointer;
  background: #fff;
  color: var(--text);
  transition: 0.14s ease;
  white-space: nowrap;
}
.btn svg { width: 14px; height: 14px; }
.btn:hover { background: #f7f9fc; }
.btn.primary { background: var(--primary); color: #fff; box-shadow: 0 6px 14px -8px rgba(46, 107, 246, 0.8); }
.btn.primary:hover { background: var(--primary-deep); }
.btn.ghost { border-color: var(--line-strong); }
.btn.ghost:hover { border-color: #c8d4e6; background: #fff; }
.btn.soft { background: var(--primary-soft); color: var(--primary-deep); }
.btn.soft:hover { background: #e0eaff; }
.btn.danger { background: var(--red-soft); color: #b42318; }
.btn.danger:hover { background: #fddcd9; }
.btn.success { background: var(--green-soft); color: #067647; }
.btn.success:hover { background: #d4f3e5; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 11.5px; border-radius: 7px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-icon {
  width: 28px; height: 28px; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; display: inline-grid; place-items: center; cursor: pointer; color: var(--muted);
}
.btn-icon:hover { color: var(--ink); border-color: var(--line-strong); }
.btn-icon svg { width: 14px; height: 14px; }

/* ------------------------------------------------------------------ 筛选 / 标签页 */

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-bottom: 1px solid #f1f4f9;
}

.chips { display: flex; gap: 4px; background: #f2f5fa; padding: 3px; border-radius: 9px; }
.chip {
  height: 28px;
  padding: 0 11px;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.chip b {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  background: #e5eaf3;
  color: #667085;
  font-variant-numeric: tabular-nums;
}
.chip:hover { color: var(--text); }
.chip.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08); }
.chip.active b { background: var(--primary-soft); color: var(--primary-deep); }

.field {
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
  font-size: 12px;
  color: var(--text);
  outline: none;
  font-family: inherit;
  min-width: 0;
}
.field:focus { border-color: #a9c1fb; box-shadow: 0 0 0 3px rgba(46, 107, 246, 0.1); }
.field.inline { display: inline-block; }
select.field { padding-right: 26px; appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2398a2b3' stroke-width='1.6'%3E%3Cpath d='M3 5l3 3 3-3'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; }

.search-inline { position: relative; }
.search-inline svg { position: absolute; left: 9px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--faint); }
.search-inline .field { padding-left: 29px; width: 200px; }

/* ------------------------------------------------------------------ 分页 */

.pager {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 13px 20px;
  border-top: 1px solid #f1f4f9;
}
.pager .info { color: var(--faint); font-size: 11.5px; margin-right: auto; }
.pager a, .pager span.cur {
  min-width: 28px;
  height: 28px;
  border-radius: 7px;
  display: inline-grid;
  place-items: center;
  font-size: 11.5px;
  color: var(--muted);
  padding: 0 6px;
  font-variant-numeric: tabular-nums;
}
.pager a:hover { background: #f2f5fa; color: var(--text); }
.pager span.cur { background: var(--ink); color: #fff; font-weight: 600; }
.pager .disabled { opacity: 0.35; pointer-events: none; }

/* ------------------------------------------------------------------ 列表 / 待办 */

.todo { display: flex; flex-direction: column; }
.todo-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  border-bottom: 1px solid #f4f6fa;
}
.todo-item:last-child { border-bottom: 0; }
.todo-item:hover { background: #fbfcff; }
.todo-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; }
.todo-ico svg { width: 15px; height: 15px; }
.todo-label { font-size: 12.5px; color: var(--text); }
.todo-sub { font-size: 10.5px; color: var(--faint); margin-top: 1px; }
.todo-value { margin-left: auto; font-size: 16px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.todo-item .go { color: #c0c8d6; margin-left: 4px; }

.empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--faint);
  font-size: 12.5px;
}
.empty svg { width: 34px; height: 34px; margin: 0 auto 10px; color: #cdd5e3; }

/* ------------------------------------------------------------------ 量子 (问题/公司) */

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

.plan {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: #fff;
  position: relative;
}
.plan.active { border-color: #bcd0ff; box-shadow: 0 0 0 3px rgba(46, 107, 246, 0.07); }
.plan h4 { margin: 0; font-size: 12.5px; font-weight: 650; color: var(--ink); }
.plan .price { font-size: 23px; font-weight: 660; color: var(--ink); margin-top: 8px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.plan .price span { font-size: 11px; color: var(--faint); font-weight: 500; }
.plan ul { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.plan li { font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; }
.plan li svg { width: 13px; height: 13px; color: var(--green); flex: none; margin-top: 1px; }

.question-row .q { font-size: 13px; color: var(--ink); font-weight: 500; line-height: 1.5; }
.question-row .meta { display: flex; gap: 10px; align-items: center; margin-top: 5px; color: var(--faint); font-size: 11px; flex-wrap: wrap; }

.company-card { padding: 16px; }
.company-top { display: flex; align-items: flex-start; gap: 10px; }
.company-name { font-size: 13.5px; font-weight: 650; color: var(--ink); }
.company-alias { font-size: 10.5px; color: var(--faint); margin-top: 2px; }
.company-stats { display: flex; gap: 18px; margin-top: 14px; }
.company-stat b { display: block; font-size: 17px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.company-stat span { font-size: 10.5px; color: var(--faint); }

/* ------------------------------------------------------------------ 配置 */

.setting-group { display: flex; flex-direction: column; }
.setting-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 20px;
  border-bottom: 1px solid #f4f6fa;
}
.setting-row:last-child { border-bottom: 0; }
.setting-copy { flex: 1; min-width: 0; }
.setting-label { font-size: 12.5px; font-weight: 550; color: var(--ink); }
.setting-help { font-size: 11px; color: var(--faint); margin-top: 2px; }
.setting-control { flex: none; display: flex; align-items: center; gap: 8px; }
.setting-control .field { width: 130px; text-align: right; }

.switch { position: relative; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span {
  position: absolute; inset: 0; border-radius: 999px; background: #d5dbe6;
  transition: 0.18s ease; cursor: pointer;
}
.switch span::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; top: 3px; left: 3px; box-shadow: 0 1px 3px rgba(16, 24, 40, 0.2);
  transition: 0.18s ease;
}
.switch input:checked + span { background: var(--primary); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px rgba(46, 107, 246, 0.18); }

/* ------------------------------------------------------------------ 审计 */

.audit-row td { font-size: 12px; }
.audit-detail { color: var(--muted); font-size: 11.5px; }

/* ------------------------------------------------------------------ 弹窗 / 提示 */

dialog.modal {
  border: 0;
  border-radius: 16px;
  padding: 0;
  width: 420px;
  max-width: calc(100vw - 32px);
  box-shadow: var(--shadow-pop);
  color: var(--text);
}
dialog.modal::backdrop { background: rgba(15, 23, 42, 0.45); backdrop-filter: blur(3px); }
.modal-head { padding: 18px 20px 0; display: flex; align-items: flex-start; gap: 10px; }
.modal-head h3 { margin: 0; font-size: 14.5px; font-weight: 650; color: var(--ink); }
.modal-head p { margin: 3px 0 0; font-size: 11.5px; color: var(--faint); }
.modal-body { padding: 16px 20px 6px; display: grid; gap: 12px; }
.modal-foot { padding: 14px 20px 18px; display: flex; justify-content: flex-end; gap: 8px; }
.modal-close { margin-left: auto; }

.form-row label { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 5px; font-weight: 500; }
.form-row .field { width: 100%; height: 36px; }

.toasts { position: fixed; top: 78px; right: 24px; z-index: 90; display: grid; gap: 8px; }
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: 10px;
  padding: 10px 14px;
  min-width: 240px;
  box-shadow: var(--shadow-pop);
  font-size: 12.5px;
  animation: toast-in 0.25s ease;
}
.toast.error { border-left-color: var(--red); }
.toast svg { width: 16px; height: 16px; color: var(--green); flex: none; }
.toast.error svg { color: var(--red); }
.toast .close { margin-left: auto; background: none; border: 0; color: var(--faint); cursor: pointer; font-size: 15px; line-height: 1; }

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

/* ------------------------------------------------------------------ 页面局部 */

.hero-stats { display: flex; gap: 26px; flex-wrap: wrap; }
.hero-stat b { display: block; font-size: 17px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.hero-stat span { font-size: 10.5px; color: var(--faint); }

.user-head { display: flex; align-items: center; gap: 14px; padding: 20px; flex-wrap: wrap; }
.user-head .who-name { color: var(--ink); font-size: 16px; font-weight: 650; }
.user-head .who-role { color: var(--faint); font-size: 11.5px; margin-top: 3px; }
.user-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.stat-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid #f1f4f9; }
.stat-strip .item { padding: 14px 20px; border-right: 1px solid #f4f6fa; }
.stat-strip .item:last-child { border-right: 0; }
.stat-strip b { display: block; font-size: 18px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat-strip span { font-size: 10.5px; color: var(--faint); }

.review-bar {
  position: sticky;
  bottom: 16px;
  margin: 16px 20px 0;
  background: #0f172a;
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-pop);
  z-index: 10;
}
.review-bar .n { font-size: 12px; color: #cbd5e1; }
.review-bar .n b { color: #fff; }
.review-bar .spacer { flex: 1; }

.range-tabs { display: flex; gap: 4px; }
.range-tabs a {
  height: 28px; padding: 0 11px; border-radius: 7px; display: inline-grid; place-items: center;
  font-size: 11.5px; color: var(--muted); border: 1px solid transparent;
}
.range-tabs a:hover { background: #f2f5fa; }
.range-tabs a.active { background: #fff; border-color: var(--line-strong); color: var(--ink); font-weight: 550; box-shadow: var(--shadow); }

.progress { height: 6px; border-radius: 999px; background: #eef2f8; overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 999px; background: var(--primary); }

.bars { display: flex; flex-direction: column; gap: 12px; padding: 4px 20px 8px; }
.bar-row .top { display: flex; align-items: baseline; gap: 8px; font-size: 12px; }
.bar-row .top b { margin-left: auto; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-row .top span { color: var(--faint); font-size: 10.5px; }

.activity { display: flex; flex-direction: column; }
.activity-item { display: flex; gap: 11px; padding: 12px 20px; border-bottom: 1px solid #f5f7fb; }
.activity-item:last-child { border-bottom: 0; }
.activity-dot {
  width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none;
  background: var(--primary-soft); color: var(--primary-deep); font-size: 10px; font-weight: 650;
}
.activity-copy { min-width: 0; }
.activity-copy .t { font-size: 12px; color: var(--text); }
.activity-copy .t b { font-weight: 600; color: var(--ink); }
.activity-copy .s { font-size: 10.5px; color: var(--faint); margin-top: 1px; }

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

.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.06fr 1fr;
  background: #fff;
}

.login-art {
  position: relative;
  overflow: hidden;
  background: #0a1120;
  color: #fff;
  padding: 44px 52px;
  display: flex;
  flex-direction: column;
  isolation: isolate;
}
.login-art::before {
  content: "";
  position: absolute;
  inset: -30% -20% auto -20%;
  height: 80%;
  background: radial-gradient(60% 60% at 30% 30%, rgba(46, 107, 246, 0.5), transparent 70%),
    radial-gradient(45% 45% at 75% 20%, rgba(18, 183, 106, 0.22), transparent 70%);
  filter: blur(10px);
  z-index: -1;
}
.login-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(70% 60% at 40% 40%, #000 30%, transparent 85%);
  z-index: -1;
}

.login-art .brand { padding: 0; }
.login-art h2 {
  margin: auto 0 0;
  font-size: 30px;
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: 0.01em;
  max-width: 420px;
}
.login-art h2 em { font-style: normal; color: #7fa9ff; }
.login-art p.lead { color: #8fa1bd; font-size: 13px; margin: 14px 0 0; max-width: 400px; line-height: 1.7; }
.login-points { display: grid; gap: 10px; margin: 26px 0 0; }
.login-point { display: flex; gap: 9px; align-items: center; color: #b9c6da; font-size: 12px; }
.login-point svg { width: 15px; height: 15px; color: #4ade80; flex: none; }
.login-foot { color: #4b5b74; font-size: 11px; margin-top: auto; padding-top: 30px; }

.login-form {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: #fff;
}
.login-card { width: 340px; }
.login-card h1 { margin: 0; font-size: 22px; font-weight: 660; color: var(--ink); letter-spacing: -0.01em; }
.login-card .sub { margin: 7px 0 26px; color: var(--faint); font-size: 12.5px; }
.login-card label { display: block; font-size: 12px; color: var(--muted); margin: 0 0 6px; font-weight: 500; }
.login-card .input-wrap { position: relative; margin-bottom: 15px; }
.login-card .input-wrap svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: #a4aec0; }
.login-card input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 0 12px 0 38px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
  color: var(--text);
  background: #fff;
}
.login-card input:focus { border-color: #a9c1fb; box-shadow: 0 0 0 3px rgba(46, 107, 246, 0.12); }
.login-card .btn { height: 42px; border-radius: 10px; font-size: 13px; }
.login-error {
  background: var(--red-soft);
  color: #b42318;
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 12px;
  margin-bottom: 14px;
  display: flex;
  gap: 7px;
  align-items: center;
}
.login-hint { margin-top: 18px; font-size: 11px; color: var(--faint); line-height: 1.7; }
.login-hint code { background: #f2f5fa; padding: 1px 5px; border-radius: 4px; font-family: var(--mono); font-size: 10.5px; color: var(--muted); }

/* ------------------------------------------------------------------ 响应式 */

.mobile-toggle { display: none; }

@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; }
  body.nav-open .sidebar { transform: none; }
  .main { margin-left: 0; }
  .mobile-toggle { display: grid; }
  .search { display: none; }
  .login-page { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .content { padding: 18px 16px 40px; }
  .topbar { padding: 0 16px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip .item:nth-child(2) { border-right: 0; }
}

@media (max-width: 640px) {
  .g4 { grid-template-columns: 1fr; }
  .topbar-user .meta { display: none; }
  .toolbar { padding: 12px 14px; }
  .search-inline .field { width: 130px; }
  .legend { white-space: nowrap; }
  .hero-stats { gap: 12px 20px; }
  .hero-stat { min-width: 42%; }
  .hero-stat b, .hero-stat span { white-space: nowrap; }
  /* 窄屏表格横向滚动，别把汉字挤成竖排 */
  .table-wrap .tbl { min-width: 640px; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
}
