:root {
  --bg0: #0c1118;
  --bg1: #141c27;
  --bg2: #1a2433;
  --line: rgba(232, 168, 56, 0.18);
  --text: #e8eef6;
  --muted: #8b9bb0;
  --amber: #e8a838;
  --amber-dim: #b8862b;
  --danger: #e85d5d;
  --ok: #3ecf8e;
  --font-display: "Sora", "Noto Sans SC", sans-serif;
  --font-body: "Noto Sans SC", "Source Han Sans SC", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  color-scheme: dark;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(232,168,56,0.12), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(60,100,160,0.15), transparent 50%),
    linear-gradient(180deg, var(--bg0), #0a0e14 60%, #0c1118);
  color: var(--text);
  font-family: var(--font-body);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}
#app { position: relative; z-index: 1; min-height: 100vh; }

a { color: var(--amber); }
button {
  font: inherit;
  color: inherit;
}
/* 暗色主题下表单控件：避免白底浅字看不清（如预警规则天数/启用） */
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
select,
textarea {
  font: inherit;
  color: var(--text);
  background: var(--bg0);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 6px 10px;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--amber-dim);
}
select option {
  background: var(--bg1);
  color: var(--text);
}
.visit-fail-row input,
.visit-fail-row select,
.visit-low-row input,
.visit-low-row select {
  color: #1a1a1a;
  background: #fff;
  border-color: rgba(0,0,0,0.12);
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(420px, 100%);
  padding: 40px 36px 32px;
  background: linear-gradient(160deg, rgba(26,36,51,0.95), rgba(12,17,24,0.92));
  border: 1px solid var(--line);
  border-radius: 4px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.45);
}
.login-card .brand {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin: 0 0 8px;
}
.login-card .sub {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 28px;
  line-height: 1.5;
}
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.field input {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg0);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  outline: none;
}
.field input:focus { border-color: var(--amber-dim); }
.game-switch { margin: 12px 0 16px; padding: 0 4px; }
.game-switch select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg0);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  color: var(--text);
  outline: none;
}
.game-switch select:focus { border-color: var(--amber-dim); }
.game-switch-single .game-current {
  display: block;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 4px;
  font-size: 14px;
  color: var(--text);
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  background: var(--amber);
  color: #1a1205;
  font-weight: 600;
  transition: transform 0.15s ease, filter 0.15s;
}
.btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid rgba(255,255,255,0.1);
}
.btn-block { width: 100%; }
.err { color: var(--danger); font-size: 13px; margin-top: 12px; }

.shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
  align-items: start;
}
.side {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  background: rgba(10,14,20,0.92);
  border-right: 1px solid var(--line);
  padding: 28px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  backdrop-filter: blur(8px);
}
.side .brand {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 4px;
}
.side .brand-sub {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 28px;
}
.nav-btn {
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 10px 12px;
  border-radius: 4px;
  cursor: pointer;
}
.nav-btn.active, .nav-btn:hover {
  background: rgba(232,168,56,0.12);
  color: var(--text);
}
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.nav-caret {
  font-size: 10px;
  opacity: 0.65;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.nav-caret.open {
  transform: rotate(180deg);
}
.nav-sub {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0 6px 10px;
  margin-left: 6px;
  border-left: 1px solid rgba(255,255,255,0.08);
}
.nav-sub-btn {
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.3;
}
.nav-sub-btn:hover {
  color: var(--text);
  background: rgba(255,255,255,0.04);
}
.nav-sub-btn.active {
  background: rgba(232,168,56,0.18);
  color: var(--text);
  font-weight: 600;
}
.side .spacer { flex: 1; }
.main { padding: 28px 36px 56px; max-width: 1200px; width: 100%; }
.main-wide { max-width: 1560px; }

/* Feigua-style company board */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 20px;
  padding: 12px 14px;
  background: rgba(12, 18, 28, 0.9);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px;
}
.filter-bar select,
.filter-bar input {
  padding: 8px 10px;
  background: var(--bg0);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  color: var(--text);
  min-width: 120px;
  font-size: 13px;
}
.filter-bar input { min-width: 160px; flex: 1; }
.kpi-row-5 {
  grid-template-columns: repeat(5, 1fr);
}
.kpi-stat-board { margin-bottom: 12px; }
.kpi-stat .kpi-stat-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.kpi-stat .kpi-stat-date {
  margin: 6px 0 14px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.kpi-stat .v {
  font-size: 22px;
  line-height: 1.2;
}
.kpi-stat .unit {
  font-size: 13px;
  font-weight: 500;
  margin-left: 2px;
  color: var(--muted);
}
.kpi-stat.kpi-hero-card .unit { color: rgba(232,168,56,0.85); }
.kpi-hero-card {
  border-color: rgba(232,168,56,0.35);
  background: linear-gradient(160deg, rgba(232,168,56,0.14), rgba(20,28,39,0.9));
}
.kpi-hero-card .v { color: var(--amber); font-size: 26px; }
.kpi-muted .v { color: var(--muted); }
.kpi-amber .v { color: var(--amber); }
.kpi-amber .sub { font-size: 14px; color: var(--muted); font-weight: 500; }
.kpi-danger {
  border-color: rgba(232,93,93,0.35);
  background: rgba(232,93,93,0.08);
}
.kpi-danger .v { color: var(--danger); }
.kpi-month-hero { margin-bottom: 4px; }
.commission-line {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--text);
}
.commission-line strong { color: var(--amber); font-size: 18px; }
.alert-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.alert-item.clickable { cursor: pointer; }
.alert-item.clickable:hover { background: rgba(232,93,93,0.14); }
.warn-item { border-left-color: var(--amber); background: rgba(232,168,56,0.08); }
.chart-panel { margin-bottom: 18px; }
.chart-wrap { height: 200px; position: relative; }
.funnel-panel { margin-bottom: 18px; }
.funnel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.funnel-head h2 { margin: 0; }
.funnel-date { display: flex; align-items: center; gap: 8px; }
.funnel-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
  align-items: end;
}
.funnel-form .field { margin: 0; }
.funnel-form label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 4px;
}
.funnel-form input[type="number"] {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg0);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
}
.funnel-auto {
  padding: 8px 10px;
  border-radius: 4px;
  border: 1px dashed rgba(232,168,56,0.4);
  background: rgba(232,168,56,0.08);
  color: var(--amber);
  font-weight: 700;
  min-height: 38px;
  display: flex;
  align-items: center;
}
.funnel-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.funnel-row { margin-bottom: 10px; }
.funnel-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
  gap: 8px;
}
.funnel-track {
  height: 28px;
  border-radius: 4px;
  background: rgba(0,0,0,0.25);
  overflow: hidden;
}
.funnel-bar {
  height: 100%;
  min-width: 8%;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(232,168,56,0.9), rgba(232,168,56,0.35));
  color: #1a1205;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  padding: 0 10px;
  white-space: nowrap;
}
.funnel-rates {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.funnel-rate {
  text-align: center;
  padding: 10px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.18);
}
.funnel-rate strong {
  display: block;
  color: var(--amber);
  font-size: 16px;
}
.funnel-rate span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}
@media (max-width: 900px) {
  .funnel-form { grid-template-columns: 1fr 1fr; }
  .funnel-rates { grid-template-columns: 1fr; }
}
.table-scroll { overflow-x: auto; }
.dense-table { font-size: 12px; }
.dense-table th, .dense-table td {
  padding: 7px 6px;
  white-space: nowrap;
}
.dense-table tbody tr:nth-child(even) { background: rgba(255,255,255,0.02); }
.dense-table tbody tr:hover { background: rgba(232,168,56,0.06); }
.daily-table-wrap {
  margin-top: 8px;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px;
}
.daily-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}
.daily-table th,
.daily-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  text-align: left;
  vertical-align: middle;
}
.daily-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(20, 28, 39, 0.98);
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}
.daily-table th.sortable {
  cursor: pointer;
  user-select: none;
}
.daily-table th.sortable:hover,
.daily-table th.sortable.active {
  color: var(--amber);
}
.daily-table .sort-ico {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  opacity: 0.7;
}
.daily-table .col-date {
  font-weight: 600;
  color: var(--text);
  position: sticky;
  left: 0;
  background: rgba(20, 28, 39, 0.96);
  z-index: 1;
}
.daily-table thead th:first-child {
  left: 0;
  z-index: 2;
}
.rank { color: var(--muted); width: 28px; font-variant-numeric: tabular-nums; }
.th-month, .cell-month {
  color: var(--amber);
  font-weight: 600;
  background: rgba(232,168,56,0.06);
}
.cell-warn { color: var(--danger); font-weight: 600; }
/* 环比：颜色 + 方向符号（fmtRatio 自带 ↑↓），色盲可辨 */
.ratio-down {
  color: #ff8b7a;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.ratio-up {
  color: #5ddea8;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.feigua { display: flex; flex-direction: column; gap: 4px; }
.hero-compare-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px 28px;
  margin: 8px 0 18px;
}
.hero-main { min-width: 180px; }
.hero-main .hero-label { margin-bottom: 4px; }
.hero-main .hero-metric { margin: 0; }
.compare-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  flex: 1;
}
.compare-chip {
  min-width: 160px;
  padding: 12px 14px;
  border-radius: 4px;
  background: var(--bg2);
  border: 1px solid rgba(255,255,255,0.08);
  border-left: 4px solid rgba(139,155,176,0.55);
}
.compare-chip.ratio-up { border-left-color: #5ddea8; border-left-style: solid; }
.compare-chip.ratio-down {
  border-left-color: #ff8b7a;
  border-left-style: dashed; /* 与上涨实线区分，色盲可辨 */
}
.compare-chip-focus {
  box-shadow: 0 0 0 1px rgba(232,168,56,0.35);
  background: rgba(232,168,56,0.06);
}
.compare-chip-lab {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}
.compare-chip-v {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}
.panel-focus {
  border-color: rgba(232,168,56,0.35);
}
.alert-item-wow { border-left-style: dashed; border-left-color: #ff8b7a; }
.alert-item-mom { border-left-style: solid; border-left-color: #ff8b7a; }
.alert-item-zero { border-left-style: dotted; border-left-color: rgba(139,155,176,0.7); }
.alert-item.warn-item { border-left-color: var(--amber); border-left-style: solid; }
.dense-table-num .num,
.dense-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dense-table th.sortable {
  cursor: pointer;
  user-select: none;
}
.dense-table th.sortable:hover { color: var(--amber); }
.dense-table th.sortable.active { color: var(--amber); }
.dense-table .sort-ico {
  font-size: 11px;
  opacity: 0.7;
  margin-left: 2px;
}
.dense-table tbody tr.row-problem {
  box-shadow: inset 3px 0 0 #ff8b7a;
  background: rgba(232,93,93,0.06);
}
.dense-table tbody tr.row-problem:hover {
  background: rgba(232,93,93,0.12);
}
.linkish { color: var(--amber); cursor: pointer; text-decoration: underline dotted; }
.tag {
  display: inline-block;
  padding: 2px 7px;
  margin: 1px 2px;
  border-radius: 3px;
  font-size: 11px;
  line-height: 1.4;
}
.tag-danger { background: rgba(232,93,93,0.2); color: #ff9a9a; }
.tag-warn { background: rgba(232,168,56,0.2); color: #f0c878; }
.tag-muted { background: rgba(139,155,176,0.2); color: #a8b4c4; }
.tag-ok { background: rgba(74,180,120,0.2); color: #8fd4a8; }
.btn-xs {
  padding: 4px 8px;
  font-size: 11px;
  margin: 1px;
}
.ops { white-space: nowrap; }
.order-content {
  max-width: 220px;
  white-space: normal;
  word-break: break-word;
  color: var(--muted);
}

.filter-bar-sticky {
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  backdrop-filter: blur(10px);
}
.date-lab {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.section-title {
  font-family: var(--font-display);
  font-size: 17px;
  margin: 0 0 10px;
  letter-spacing: 0.01em;
  border-left: 3px solid var(--amber);
  padding-left: 10px;
}
.admin-page .panel { margin-bottom: 20px; }
.admin-tools {
  background: linear-gradient(145deg, rgba(232,168,56,0.08), rgba(20,28,39,0.95));
  border-color: rgba(232,168,56,0.22);
}
.tool-row { align-items: center; }
.ok-msg { color: var(--ok); font-size: 13px; margin: 8px 0 0; }
.err-msg { color: var(--danger, #e07070); font-size: 13px; margin: 8px 0 0; }
.panel h2.section-title { margin-bottom: 12px; }
.sub-section-title {
  margin: 4px 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #e8e4dc);
}
.kpi-row-5 .kpi { transition: border-color 0.2s ease, transform 0.15s ease; }
.kpi-row-5 .kpi:hover { border-color: rgba(232,168,56,0.25); transform: translateY(-1px); }
.kpi-stat-board .kpi { transition: border-color 0.2s ease, transform 0.15s ease; }
.kpi-stat-board .kpi:hover { border-color: rgba(232,168,56,0.25); transform: translateY(-1px); }

/* 今日回访监督 */
.visit-supervise { margin-top: 8px; }
.visit-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.visit-head .section-title { margin: 0; }
.visit-anomaly {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: #FFF3CD;
  color: #5c4a00;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 13px;
}
.visit-anomaly-body { flex: 1; line-height: 1.5; }
.visit-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.visit-card {
  background: #fff;
  color: #1a1a1a;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  padding: 20px;
  min-width: 120px;
  flex: 1 1 120px;
}
.visit-card-v {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  color: #1a1a1a;
}
.visit-card-l { margin-top: 6px; font-size: 12px; color: #666; }
.visit-table tbody tr:hover { background: rgba(255,255,255,0.06); }
.visit-staff-row { cursor: pointer; }
.visit-fail-row { background: #FFF5F5 !important; color: #3a3a3a; }
.visit-fail-row td { color: #3a3a3a; border-bottom-color: rgba(0,0,0,0.06); }
.visit-low-row { background: #FFFDE7 !important; }
.visit-low-row td { color: #333; }
.cat-pill {
  display: inline-block;
  margin: 1px 4px 1px 0;
  font-size: 11px;
  white-space: nowrap;
}
.conf-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.conf-high { background: #f44336; }
.conf-low { background: #FFC107; }
.visit-unqual { margin-top: 16px; }
.visit-unqual-toggle {
  width: 100%;
  text-align: left;
  background: rgba(232,93,93,0.1);
  border: 1px solid rgba(232,93,93,0.25);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 8px;
  font-weight: 600;
}
.visit-skel { display: flex; gap: 12px; flex-wrap: wrap; }
.skel {
  flex: 1 1 120px;
  height: 88px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(255,255,255,0.04), rgba(255,255,255,0.1), rgba(255,255,255,0.04));
  background-size: 200% 100%;
  animation: skelMove 1.2s ease infinite;
}
@keyframes skelMove {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.toast-crm {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  background: #fff;
  color: #222;
  padding: 12px 18px;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.25);
  font-size: 13px;
  animation: toastIn 0.25s ease;
}
.toast-ok { border-left: 4px solid #4CAF50; }
.toast-err { border-left: 4px solid #f44336; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: none; }
}
@media (max-width: 768px) {
  .visit-cards { flex-direction: column; }
  .visit-card { min-width: 0; }
}
.hero-metric {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 700;
  color: var(--amber);
  margin: 0;
  letter-spacing: -0.02em;
  animation: fadeUp 0.45s ease;
}
.hero-label {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0 24px;
}
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 28px;
}
.kpi {
  background: var(--bg2);
  border: 1px solid rgba(255,255,255,0.06);
  padding: 16px;
  border-radius: 4px;
  animation: fadeUp 0.5s ease;
}
.kpi .v {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
}
.kpi .l { color: var(--muted); font-size: 12px; margin-top: 4px; }
.panel {
  background: rgba(20,28,39,0.8);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 4px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.panel h2 {
  font-family: var(--font-display);
  font-size: 16px;
  margin: 0 0 12px;
  font-weight: 600;
}
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.alert-list {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 2px;
}
.alert-list .alert-item:last-of-type {
  margin-bottom: 0;
}
.alert-list-more {
  display: block;
  width: 100%;
  margin-top: 8px;
  text-align: center;
}
.alert-item {
  padding: 10px 12px;
  border-left: 3px solid var(--danger);
  background: rgba(232,93,93,0.08);
  margin-bottom: 8px;
  font-size: 13px;
}
.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.toolbar input, .toolbar select {
  padding: 8px 12px;
  background: var(--bg0);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  min-width: 180px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
th { color: var(--muted); font-weight: 500; }
.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 6px;
  background: var(--ok);
}
.server-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 18px;
}
.server-card {
  min-width: 140px;
  padding: 14px;
  background: var(--bg2);
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
}
.server-card.active { border-color: var(--amber); }
.server-card .id { font-family: var(--font-display); font-weight: 600; }

/* 区服详情 */
.server-detail-filters { align-items: center; }
.chk-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  background: var(--bg0);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.chk-pill input { accent-color: var(--amber); }
.week-compare-table th[colspan] {
  text-align: center;
  color: var(--amber);
  border-bottom-color: rgba(232,168,56,0.25);
}
.server-daily-table .subtotal-row td,
.dense-table .subtotal-row td {
  background: rgba(232,168,56,0.08);
  font-weight: 600;
}
.gs-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  background: rgba(255,255,255,0.06);
}
.gs-tag-0 { background: rgba(156, 120, 220, 0.25); color: #d4c2f7; }
.gs-tag-1 { background: rgba(232, 168, 56, 0.22); color: #f0c878; }
.gs-tag-2 { background: rgba(74, 180, 120, 0.22); color: #8fd4a8; }
.gs-tag-3 { background: rgba(90, 160, 220, 0.22); color: #9ec9f0; }
.gs-tag-4 { background: rgba(232, 93, 93, 0.2); color: #ff9a9a; }
.drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: grid;
  justify-content: end;
  z-index: 20;
}
.drawer {
  width: min(400px, 100%);
  background: var(--bg1);
  border-left: 1px solid var(--line);
  padding: 24px;
  animation: slideIn 0.2s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes slideIn {
  from { transform: translateX(24px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}
@media (max-width: 1100px) {
  .kpi-row-5 { grid-template-columns: repeat(3, 1fr); }
  .alert-board { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side {
    position: relative;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
  }
  .side .brand-sub, .side .spacer { display: none; }
  .kpi-row, .two-col, .kpi-row-5 { grid-template-columns: 1fr 1fr; }
  .main { padding: 16px; }
  .filter-bar-sticky { position: static; }
}
