/* =========================================================
   数据门户 · 设计系统
   Apple-inspired: 克制的色彩、半透明材质、尺寸相关的字距
   ========================================================= */

:root {
  /* 画布与表面 */
  --bg: #f5f5f7;
  --bg-tint-a: rgba(10, 108, 255, 0.07);
  --bg-tint-b: rgba(110, 86, 207, 0.06);
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --glass: rgba(255, 255, 255, 0.66);
  --glass-strong: rgba(255, 255, 255, 0.82);
  --glass-line: rgba(255, 255, 255, 0.7);

  /* 文字 */
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #96969b;
  --text-invert: #ffffff;

  /* 线条 */
  --line: rgba(0, 0, 0, 0.075);
  --line-strong: rgba(0, 0, 0, 0.12);

  /* 强调色 */
  --accent: #0a6cff;
  --accent-soft: rgba(10, 108, 255, 0.1);
  --violet: #6e56cf;
  --teal: #0f9b8e;
  --amber: #e8901a;
  --pink: #d6409f;

  /* 语义色：遵循国内市场习惯，涨为红、跌为绿 */
  --up: #e5484d;
  --up-soft: rgba(229, 72, 77, 0.1);
  --down: #12a150;
  --down-soft: rgba(18, 161, 80, 0.1);

  /* 阴影 */
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-sm: 0 2px 8px -2px rgba(16, 24, 40, 0.08), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 14px 34px -16px rgba(16, 24, 40, 0.18), 0 2px 6px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 32px 60px -24px rgba(16, 24, 40, 0.22), 0 4px 12px rgba(16, 24, 40, 0.06);

  /* 半径 */
  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 30px;

  /* 布局 */
  --rail: 244px;
  --rail-collapsed: 78px;
  --gutter: 26px;

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro SC", "SF Pro Display", "PingFang SC",
    "Helvetica Neue", "Microsoft YaHei", system-ui, sans-serif;
  --font-num: "SF Mono", ui-monospace, "SFMono-Regular", "Menlo", monospace;

  color-scheme: light;
}

/* 深色模式：同一套材质逻辑，加厚、降亮 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0d;
    --bg-tint-a: rgba(10, 108, 255, 0.12);
    --bg-tint-b: rgba(110, 86, 207, 0.12);
    --surface: #17171a;
    --surface-2: #1c1c20;
    --glass: rgba(28, 28, 32, 0.68);
    --glass-strong: rgba(24, 24, 28, 0.86);
    --glass-line: rgba(255, 255, 255, 0.09);
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #78787d;
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.16);
    --shadow-md: 0 18px 40px -20px rgba(0, 0, 0, 0.8), 0 2px 6px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 40px 70px -30px rgba(0, 0, 0, 0.9);
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: hidden;
  background-color: var(--bg);
  background-image: radial-gradient(1200px 600px at 8% -10%, var(--bg-tint-a), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, var(--bg-tint-b), transparent 55%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, figure {
  margin: 0;
}

button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

input, select {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

::selection {
  background: rgba(10, 108, 255, 0.22);
}

/* 细滚动条 */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.18) transparent;
}
*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
*::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.16);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

/* =========================================================
   应用外壳
   ========================================================= */
.app {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  min-height: 100dvh;
  transition: grid-template-columns 340ms cubic-bezier(0.32, 0.72, 0, 1);
}

/* ---------- 侧栏 ---------- */
.rail {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px 14px 16px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  backdrop-filter: blur(28px) saturate(180%);
  border-right: 1px solid var(--line);
  z-index: 40;
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 4px 8px 2px;
  min-height: 40px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #3d8bff, #0a5cd8 55%, #6e56cf);
  box-shadow: 0 6px 16px -6px rgba(10, 92, 216, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.brand-text {
  min-width: 0;
  display: grid;
  gap: 1px;
  transition: opacity 180ms ease;
}

.brand-title {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-sub {
  font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 0 -4px;
  padding: 0 4px;
}

.nav-label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 14px 12px 6px;
  white-space: nowrap;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: background-color 160ms ease, color 160ms ease, transform 120ms ease;
}

.nav-item:hover {
  background: rgba(0, 0, 0, 0.035);
  color: var(--text);
}

.nav-item:active {
  transform: scale(0.985);
}

.nav-item[aria-current="page"] {
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  font-weight: 600;
}

.nav-item[aria-current="page"] .nav-icon {
  color: var(--accent);
}

.nav-icon {
  width: 20px;
  height: 20px;
  flex: none;
  display: grid;
  place-items: center;
  color: var(--text-3);
  transition: color 160ms ease;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
}

.nav-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 160ms ease;
}

.nav-badge {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-3);
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 7px;
  border-radius: 999px;
}

.rail-foot {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

/* 侧栏收起（仅图标） */
.rail-toggle {
  position: absolute;
  top: 26px;
  right: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-3);
  background: var(--surface);
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--line);
  opacity: 0;
  transition: opacity 160ms ease, color 160ms ease, transform 200ms cubic-bezier(0.32, 0.72, 0, 1);
}

.rail:hover .rail-toggle,
.rail-toggle:focus-visible {
  opacity: 1;
}

.rail-toggle:hover {
  color: var(--text);
}

.app[data-rail="collapsed"] {
  grid-template-columns: var(--rail-collapsed) minmax(0, 1fr);
}

.app[data-rail="collapsed"] .brand-text,
.app[data-rail="collapsed"] .nav-text,
.app[data-rail="collapsed"] .nav-badge,
.app[data-rail="collapsed"] .nav-label,
.app[data-rail="collapsed"] .rail-foot .nav-text {
  opacity: 0;
  pointer-events: none;
}

.app[data-rail="collapsed"] .nav-label {
  height: 12px;
  padding: 0;
  overflow: hidden;
}

.app[data-rail="collapsed"] .rail-toggle {
  transform: rotate(180deg);
}

.app[data-rail="collapsed"] .rail {
  padding-left: 12px;
  padding-right: 12px;
}

.app[data-rail="collapsed"] .nav-item {
  padding: 0 15px;
}

/* ---------- 主区 ---------- */
.main {
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 12px var(--gutter);
  background: linear-gradient(to bottom, var(--glass-strong) 62%, rgba(255, 255, 255, 0));
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}

.topbar[data-scrolled="true"] {
  border-bottom-color: var(--line);
}

.page-head {
  min-width: 0;
}

.page-title {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.022em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-sub {
  font-size: 12.5px;
  color: var(--text-3);
  letter-spacing: 0.005em;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-spacer {
  flex: 1;
}

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

/* ---------- 通用控件 ---------- */
.seg {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.045);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.03);
  isolation: isolate;
}

.seg-pill {
  position: absolute;
  top: 3px;
  left: 3px;
  height: calc(100% - 6px);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: var(--shadow-xs), 0 0 0 1px rgba(0, 0, 0, 0.04);
  z-index: 0;
  transition: transform 320ms cubic-bezier(0.32, 0.72, 0, 1), width 320ms cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform, width;
}

.seg button {
  position: relative;
  z-index: 1;
  height: 28px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-2);
  white-space: nowrap;
  transition: color 180ms ease;
}

.seg button[aria-selected="true"] {
  color: var(--text);
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: var(--text-2);
  background: transparent;
  transition: background-color 160ms ease, color 160ms ease, transform 120ms ease;
}

.icon-btn:hover {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text);
}

.icon-btn:active {
  transform: scale(0.94);
}

.icon-btn.spin svg {
  animation: spin 900ms linear infinite;
}

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

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-2);
  background: rgba(0, 0, 0, 0.045);
  white-space: nowrap;
}

.chip .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 155, 142, 0.16);
}

.avatar-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 36px;
  padding: 0 10px 0 4px;
  border-radius: 999px;
  background: transparent;
  transition: background-color 160ms ease;
}

.avatar-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 650;
  color: #fff;
  background: linear-gradient(150deg, #5b9dff, #0a5cd8);
  letter-spacing: 0;
  flex: none;
}

.avatar-name {
  font-size: 13px;
  font-weight: 550;
  color: var(--text);
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 内容区 ---------- */
.content {
  padding: 6px var(--gutter) 56px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 2px 4px;
  flex-wrap: wrap;
}

.hero-greet {
  font-size: clamp(26px, 2.6vw, 34px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.12;
  font-optical-sizing: auto;
}

.hero-greet .accent {
  background: linear-gradient(96deg, #0a6cff, #6e56cf 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
  color: var(--text-3);
  font-size: 12.5px;
  flex-wrap: wrap;
}

.hero-meta .sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--teal);
  font-weight: 550;
}

.live i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.82); }
}

.hero-side {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 15px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 550;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-xs), inset 0 0 0 1px var(--line);
  transition: transform 120ms ease, box-shadow 180ms ease, background-color 160ms ease;
}

.btn:hover {
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line-strong);
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(180deg, #2b7cff, #0a5cd8);
  box-shadow: 0 8px 20px -10px rgba(10, 92, 216, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.btn-primary:hover {
  box-shadow: 0 12px 26px -10px rgba(10, 92, 216, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.btn svg {
  width: 15px;
  height: 15px;
}

/* ---------- 卡片 ---------- */
.card {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px rgba(255, 255, 255, 0.65);
  border: 1px solid var(--line);
  overflow: hidden;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px 0;
}

.card-title {
  font-size: 14.5px;
  font-weight: 620;
  letter-spacing: -0.012em;
}

.card-desc {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 3px;
}

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

/* ---------- KPI 网格 ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.kpi {
  position: relative;
  padding: 16px 16px 12px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 148px;
  transition: transform 260ms cubic-bezier(0.32, 0.72, 0, 1), box-shadow 260ms ease,
    border-color 200ms ease;
  overflow: hidden;
}

.kpi::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(120px 90px at 100% 0%, var(--kpi-glow, rgba(10, 108, 255, 0.08)), transparent 70%);
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}

.kpi:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(0, 0, 0, 0.06);
}

.kpi:hover::after {
  opacity: 1;
}

.kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kpi-label {
  font-size: 12.5px;
  color: var(--text-2);
  font-weight: 550;
  letter-spacing: 0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-ico {
  width: 26px;
  height: 26px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex: none;
  color: var(--kpi-color, var(--accent));
  background: var(--kpi-bg, var(--accent-soft));
}

.kpi-ico svg {
  width: 14px;
  height: 14px;
}

.kpi-value {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  line-height: 1;
}

.kpi-num {
  font-size: 30px;
  font-weight: 680;
  letter-spacing: -0.035em;
}

.kpi-unit {
  font-size: 12px;
  color: var(--text-3);
  font-weight: 500;
  letter-spacing: 0;
}

.kpi-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  min-width: 0;
}

.delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 7px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.delta.up {
  color: var(--up);
  background: var(--up-soft);
}

.delta.down {
  color: var(--down);
  background: var(--down-soft);
}

.delta.flat {
  color: var(--text-3);
  background: rgba(0, 0, 0, 0.05);
}

.delta svg {
  width: 10px;
  height: 10px;
}

.kpi-spark {
  width: 74px;
  height: 34px;
  flex: none;
  opacity: 0.95;
}

/* 骨架屏 */
.skeleton {
  position: relative;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.055);
  border-radius: 8px;
  color: transparent !important;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  to {
    transform: translateX(100%);
  }
}

/* ---------- 内容网格 ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: minmax(0, 2.05fr) minmax(0, 1fr);
  gap: 14px;
}

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

/* ---------- 折线图 ---------- */
.chart-wrap {
  position: relative;
  padding: 4px 20px 12px;
}

.chart-svg {
  display: block;
  width: 100%;
  overflow: visible;
}

.chart-tip {
  position: absolute;
  z-index: 5;
  min-width: 132px;
  padding: 9px 11px;
  border-radius: 12px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--glass-line);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -6px) scale(0.96);
  transition: opacity 140ms ease, transform 160ms cubic-bezier(0.32, 0.72, 0, 1);
}

.chart-tip[data-show="true"] {
  opacity: 1;
  transform: translate(-50%, -10px) scale(1);
}

.tip-date {
  color: var(--text-3);
  font-size: 11px;
  margin-bottom: 5px;
  letter-spacing: 0.01em;
}

.tip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  line-height: 1.7;
  font-variant-numeric: tabular-nums;
}

.tip-key {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text-2);
}

.tip-key i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.tip-val {
  font-weight: 600;
}

.legend {
  display: flex;
  align-items: center;
  gap: 13px;
  flex-wrap: wrap;
}

.legend button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
  font-weight: 500;
  padding: 3px 4px;
  border-radius: 6px;
  transition: opacity 160ms ease;
}

.legend button[data-off="true"] {
  opacity: 0.38;
}

.legend i {
  width: 8px;
  height: 8px;
  border-radius: 3px;
}

/* ---------- 排行 ---------- */
.rank-list {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.rank-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
}

.rank-idx {
  font-size: 11px;
  font-weight: 650;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.rank-row:nth-child(1) .rank-idx,
.rank-row:nth-child(2) .rank-idx,
.rank-row:nth-child(3) .rank-idx {
  color: var(--text);
}

.rank-main {
  min-width: 0;
}

.rank-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.rank-name {
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-val {
  font-size: 11.5px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rank-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.055);
  overflow: hidden;
}

.rank-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(10, 108, 255, 0.55), var(--accent));
  width: 0;
  transition: width 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

.rank-share {
  font-size: 11px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  min-width: 34px;
  text-align: right;
}

/* ---------- 动态流 ---------- */
.feed {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.feed-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.feed-item:last-child {
  border-bottom: 0;
  padding-bottom: 2px;
}

.feed-ico {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-2);
  margin-top: 1px;
}

.feed-ico svg {
  width: 13px;
  height: 13px;
}

.feed-ico[data-tone="ok"] { color: var(--down); background: var(--down-soft); }
.feed-ico[data-tone="warn"] { color: var(--amber); background: rgba(232, 144, 26, 0.12); }
.feed-ico[data-tone="alert"] { color: var(--up); background: var(--up-soft); }
.feed-ico[data-tone="info"] { color: var(--accent); background: var(--accent-soft); }

.feed-text {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text);
  letter-spacing: -0.003em;
}

.feed-text b {
  font-weight: 620;
}

.feed-time {
  font-size: 11px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin-top: 2px;
}

/* ---------- 空状态 / 占位模块 ---------- */
.empty {
  display: grid;
  place-items: center;
  text-align: center;
  padding: 64px 24px;
  gap: 0;
}

.empty-art {
  width: 132px;
  height: 132px;
  margin-bottom: 22px;
  border-radius: 34px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: radial-gradient(120% 120% at 30% 20%, rgba(255, 255, 255, 0.9), rgba(10, 108, 255, 0.07));
  box-shadow: var(--shadow-md), inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.empty-art svg {
  width: 52px;
  height: 52px;
  opacity: 0.9;
}

.empty-title {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.empty-desc {
  font-size: 13.5px;
  color: var(--text-2);
  max-width: 430px;
  margin: 8px auto 0;
  line-height: 1.65;
}

.empty-tags {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 18px;
}

.tag {
  font-size: 11.5px;
  font-weight: 550;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
}

/* ---------- 弹出菜单 ---------- */
.menu-wrap {
  position: relative;
}

.menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 234px;
  padding: 6px;
  border-radius: 16px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  backdrop-filter: blur(26px) saturate(180%);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--glass-line);
  transform-origin: top right;
  opacity: 0;
  transform: scale(0.94) translateY(-4px);
  pointer-events: none;
  transition: opacity 150ms ease, transform 200ms cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 60;
}

.menu[data-open="true"] {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.menu-head {
  padding: 9px 10px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 5px;
}

.menu-name {
  font-size: 13px;
  font-weight: 620;
}

.menu-mail {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 1px;
}

.menu-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 8px 10px 4px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  border-radius: 9px;
  font-size: 12.5px;
  color: var(--text);
  text-align: left;
  transition: background-color 140ms ease;
}

.menu-item:hover {
  background: rgba(0, 0, 0, 0.05);
}

.menu-item .check {
  margin-left: auto;
  color: var(--accent);
  opacity: 0;
  width: 13px;
  height: 13px;
}

.menu-item[data-active="true"] .check {
  opacity: 1;
}

.menu-item svg {
  width: 15px;
  height: 15px;
  color: var(--text-3);
}

.menu-sep {
  height: 1px;
  background: var(--line);
  margin: 5px 4px;
}

.menu-item.danger {
  color: var(--up);
}

.menu-item.danger svg {
  color: var(--up);
}

/* ---------- Toast ---------- */
.toast-host {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 200;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--glass-line);
  font-size: 13px;
  font-weight: 550;
  color: var(--text);
  animation: toast-in 380ms cubic-bezier(0.22, 1, 0.36, 1);
}

.toast[data-leaving="true"] {
  animation: toast-out 240ms ease forwards;
}

.toast svg {
  width: 15px;
  height: 15px;
  color: var(--teal);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.94);
  }
}

@keyframes toast-out {
  to {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }
}

/* ---------- 进场动画 ---------- */
.rise {
  animation: rise 620ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* ---------- 登录页 ---------- */
.login-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  position: relative;
  overflow: hidden;
}

.login-page::before,
.login-page::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.55;
  pointer-events: none;
}

.login-page::before {
  width: 520px;
  height: 520px;
  background: rgba(61, 139, 255, 0.28);
  top: -180px;
  left: -120px;
}

.login-page::after {
  width: 460px;
  height: 460px;
  background: rgba(110, 86, 207, 0.22);
  bottom: -200px;
  right: -100px;
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(400px, 100%);
  padding: 34px 32px 28px;
  border-radius: var(--r-xl);
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(40px) saturate(190%);
  backdrop-filter: blur(40px) saturate(190%);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--glass-line);
}

.login-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, #3d8bff, #0a5cd8 55%, #6e56cf);
  box-shadow: 0 10px 24px -10px rgba(10, 92, 216, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  margin-bottom: 18px;
}

.login-title {
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.login-sub {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 6px;
  line-height: 1.5;
}

.field {
  display: grid;
  gap: 6px;
  margin-top: 16px;
}

.field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.01em;
}

.field input {
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3.5px var(--accent-soft);
}

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  font-size: 12.5px;
  color: var(--text-2);
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
}

.checkbox input {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease;
}

.checkbox input:checked {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox input:checked::after {
  content: "";
  width: 8px;
  height: 4px;
  border-left: 1.6px solid #fff;
  border-bottom: 1.6px solid #fff;
  transform: rotate(-45deg) translate(0.5px, -1px);
}

.login-submit {
  width: 100%;
  height: 46px;
  margin-top: 22px;
  border-radius: 13px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, #2b7cff, #0a5cd8);
  box-shadow: 0 10px 24px -12px rgba(10, 92, 216, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.28);
  transition: transform 120ms ease, box-shadow 200ms ease, opacity 160ms ease;
}

.login-submit:active {
  transform: scale(0.985);
}

.login-note {
  margin-top: 18px;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(10, 108, 255, 0.06);
  border: 1px solid rgba(10, 108, 255, 0.12);
  font-size: 11.5px;
  color: var(--text-2);
  line-height: 1.55;
}

.login-note b {
  color: var(--text);
  font-weight: 600;
}

/* =========================================================
   响应式
   ========================================================= */
@media (max-width: 1520px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .kpi {
    min-height: 140px;
  }
}

@media (max-width: 1180px) {
  :root {
    --rail: 84px;
    --gutter: 20px;
  }
  .brand-text,
  .nav-text,
  .nav-badge,
  .nav-label,
  .rail-foot .nav-text {
    display: none;
  }
  .nav-item {
    padding: 0 15px;
  }
  .rail-toggle {
    display: none;
  }
  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
  }
  .rail {
    position: fixed;
    inset: auto 0 0 0;
    height: auto;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid var(--line);
    background: var(--glass-strong);
    overflow: visible;
  }
  .brand,
  .rail-foot,
  .nav-label {
    display: none;
  }
  .rail-nav {
    flex-direction: row;
    justify-content: space-around;
    width: 100%;
    margin: 0;
    overflow: visible;
    gap: 2px;
  }
  .nav-item {
    flex-direction: column;
    gap: 3px;
    height: auto;
    padding: 6px 4px;
    font-size: 10px;
    flex: 1;
    border-radius: 12px;
  }
  .nav-text {
    display: block;
    font-size: 10px;
    opacity: 1;
    max-width: 100%;
  }
  .nav-item[aria-current="page"] {
    background: var(--accent-soft);
    box-shadow: none;
  }
  .main {
    padding-bottom: 74px;
  }
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 10px;
    padding: 10px 16px;
  }
  .topbar-spacer {
    display: none;
  }
  .topbar-tools {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }
  .topbar-tools .icon-btn {
    flex: none;
  }
  .page-sub {
    display: none;
  }
  .content {
    padding: 4px 16px 32px;
    gap: 14px;
  }
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .kpi {
    min-height: 132px;
    padding: 13px 13px 10px;
  }
  .kpi-num {
    font-size: 25px;
  }
  .kpi-spark {
    width: 62px;
    height: 28px;
  }
  .hero {
    padding: 8px 0 0;
  }
  .hero-side {
    width: 100%;
  }
  .seg {
    width: 100%;
    justify-content: space-between;
  }
  .seg button {
    flex: 1;
    padding: 0 6px;
  }
  .avatar-name {
    display: none;
  }
  .card-head,
  .chart-wrap {
    padding-left: 16px;
    padding-right: 16px;
  }
  .card-body {
    padding: 12px 16px 16px;
  }
}

@media (max-width: 420px) {
  .kpi-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-greet {
    font-size: 23px;
  }
}

/* 可访问性：降低动效 / 降低透明度 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .rise {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .rail,
  .topbar,
  .menu,
  .toast,
  .login-card,
  .chart-tip {
    background: var(--surface) !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }
}

@media (prefers-contrast: more) {
  .card,
  .kpi,
  .btn,
  .tag {
    border-color: var(--line-strong);
  }
  .nav-item[aria-current="page"] {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
  }
}

/* =========================================================
   表格（管理后台 / 明细视图）
   ========================================================= */
.tbl-wrap {
  overflow-x: auto;
  margin: 0 -20px;
  padding: 0 20px;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  white-space: nowrap;
}

.tbl th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-3);
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
}

.tbl td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.tbl tbody tr {
  transition: background-color 140ms ease;
}

.tbl tbody tr:hover {
  background: rgba(0, 0, 0, 0.022);
}

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

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

.user-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-cell .avatar {
  width: 30px;
  height: 30px;
  font-size: 12px;
}

.user-cell .u-name {
  font-weight: 600;
  font-size: 13px;
}

.user-cell .u-id {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 1px;
}

.perm {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 550;
  color: var(--text-2);
  background: rgba(0, 0, 0, 0.045);
  margin-right: 4px;
}

.perm.all {
  color: var(--accent);
  background: var(--accent-soft);
}

.perm.off {
  color: var(--text-3);
  background: transparent;
  border: 1px dashed var(--line-strong);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 550;
  color: var(--text-2);
}

.status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--down);
}

.status.off i {
  background: var(--text-3);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 2px 0;
  flex-wrap: wrap;
}

.section-title {
  font-size: clamp(22px, 2.2vw, 28px);
  font-weight: 680;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.section-desc {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 5px;
  max-width: 620px;
  line-height: 1.55;
}

.note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 13px 15px;
  border-radius: 14px;
  background: rgba(10, 108, 255, 0.05);
  border: 1px solid rgba(10, 108, 255, 0.12);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-2);
}

.note b {
  color: var(--text);
  font-weight: 600;
}

.note svg {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 1px;
  color: var(--accent);
}

/* 侧栏底部：数据源状态 */
.sync-state {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
}

.sync-state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: none;
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 155, 142, 0.14);
}

.rail-ver {
  padding: 1px 12px 2px;
  font-size: 10.5px;
  color: var(--text-3);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* 平板竖屏：KPI 三列 */
@media (min-width: 620px) and (max-width: 860px) {
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* =========================================================
   首页 · 城市对比矩阵（模块一）
   ========================================================= */
.mx-card .card-head {
  padding-bottom: 12px;
}

.mx-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.mx-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0 20px 10px;
  margin: 0 -20px;
  scrollbar-width: thin;
}

.mx {
  width: 100%;
  min-width: 1180px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12.5px;
}

.mx th,
.mx td {
  padding: 0 12px;
}

.mx thead th {
  white-space: nowrap;
  color: var(--text-3);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.mx thead .grp {
  text-align: center;
  padding: 8px 12px 5px;
  font-size: 12px;
  font-weight: 620;
  letter-spacing: 0;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  border-bottom: 1px solid var(--line);
  transition: color 160ms ease;
}

.mx thead .grp:hover {
  color: var(--accent);
}

.mx thead .sub {
  text-align: right;
  padding: 6px 12px 9px;
  border-bottom: 1px solid var(--line-strong);
}

.mx .city-h {
  text-align: left;
  padding: 8px 12px 9px 20px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--line-strong);
  vertical-align: bottom;
}

.mx tbody td {
  height: 46px;
  border-bottom: 1px solid var(--line);
}

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

.mx tfoot td {
  height: 48px;
  background: var(--surface-2);
  border-top: 1px solid var(--line-strong);
}

.mx .city {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--surface);
  text-align: left;
  padding-left: 20px;
}

.mx tbody tr:hover .city {
  background: var(--surface);
}

.mx tfoot .city {
  background: var(--surface-2);
}

.mx .city-name {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.mx .gsep {
  border-left: 1px solid var(--line);
}

.mx td.heat {
  background: rgba(10, 108, 255, var(--heat, 0));
}

.cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  line-height: 1.3;
}

.cell-v {
  font-variant-numeric: tabular-nums;
  font-weight: 550;
  letter-spacing: -0.01em;
}

.cell-d {
  font-size: 10.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.cell-d.up {
  color: var(--up);
}

.cell-d.down {
  color: var(--down);
}

.cell-d.flat {
  color: var(--text-3);
}

.mx tfoot .cell-v {
  font-weight: 650;
}

.caret {
  display: inline-block;
  width: 9px;
  margin-left: 3px;
  font-size: 9px;
  color: var(--text-3);
  opacity: 0.45;
}

.caret.on {
  color: var(--accent);
  opacity: 1;
}

/* =========================================================
   首页 · 业务线 / 时段条形列表（模块二）
   ========================================================= */
.grid-2e {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.bl {
  display: grid;
}

.bl-row {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) 76px 54px 56px;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
}

.bl-row + .bl-row {
  border-top: 1px solid var(--line);
}

.bl-name {
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.bl-track {
  height: 6px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.055);
  overflow: hidden;
}

.bl-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 99px;
  transition: width 720ms cubic-bezier(0.22, 1, 0.36, 1);
}

.bl-val {
  text-align: right;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.bl-share {
  text-align: right;
  font-size: 11.5px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.bl-d {
  text-align: right;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.bl-d.up {
  color: var(--up);
}

.bl-d.down {
  color: var(--down);
}

.bl-d.flat {
  color: var(--text-3);
}

@media (max-width: 900px) {
  .grid-2e {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .mx {
    min-width: 960px;
    font-size: 11.5px;
  }

  .mx th,
  .mx td {
    padding: 0 9px;
  }

  .mx .city-h,
  .mx .city {
    padding-left: 14px;
  }

  .bl-row {
    grid-template-columns: 52px minmax(0, 1fr) 62px 46px 48px;
    gap: 8px;
  }

  .bl-d {
    font-size: 10.5px;
  }
}

@media (prefers-color-scheme: dark) {
  .bl-track {
    background: rgba(255, 255, 255, 0.09);
  }

  .mx td.heat {
    background: rgba(10, 108, 255, calc(var(--heat, 0) * 0.85));
  }
}

@media (prefers-reduced-motion: reduce) {
  .bl-fill {
    transition: none;
  }
}

/* 「战报」口径标记 */
.badge-report {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  margin-left: 5px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  vertical-align: 1.5px;
  color: #8a5a12;
  background: rgba(232, 144, 26, 0.14);
  border: 1px solid rgba(232, 144, 26, 0.22);
}

.bl-row.pending .bl-track {
  background: repeating-linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.05) 0 6px,
    transparent 6px 12px
  );
}

.bl-muted {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 500;
}

@media (prefers-color-scheme: dark) {
  .badge-report {
    color: #f0b45e;
    background: rgba(232, 144, 26, 0.18);
    border-color: rgba(232, 144, 26, 0.3);
  }
}

/* 业务线卡片：数据覆盖说明 */
.bl-note {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-3);
}

/* =========================================================
   城市筛选 / 自定义区间 / 单元格提示
   ========================================================= */
/* hero 里的筛选菜单要压在下方卡片之上（.rise 动画残留 transform 会形成层叠上下文） */
.hero {
  position: relative;
  z-index: 20;
}

.menu {
  z-index: 90;
}

.icon-btn.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.range-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 272px;
  padding: 14px;
  border-radius: 16px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  backdrop-filter: blur(26px) saturate(180%);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--glass-line);
  display: grid;
  gap: 10px;
  z-index: 95;
  transform-origin: top right;
  animation: rpIn 180ms cubic-bezier(0.32, 0.72, 0, 1);
}

.range-pop[hidden] {
  display: none;
}

@keyframes rpIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-4px);
  }
}

.rp-title {
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.rp-field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--text-2);
}

.rp-field input {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 8px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.rp-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.rp-note {
  font-size: 10.5px;
  color: var(--text-3);
  letter-spacing: 0.01em;
}

.rp-apply {
  height: 34px;
  border-radius: 10px;
  justify-content: center;
  font-size: 12.5px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid transparent;
}

.btn-primary:hover {
  background: #0a5fe0;
}

.cell-tip {
  position: fixed;
  z-index: 200;
  pointer-events: none;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(24, 24, 28, 0.94);
  color: #fff;
  font-size: 11.5px;
  line-height: 1.45;
  white-space: nowrap;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.5);
  font-variant-numeric: tabular-nums;
}

.cell-tip[hidden] {
  display: none;
}

.mx td[data-tip] {
  cursor: default;
}

@media (max-width: 700px) {
  .range-pop {
    width: 244px;
  }
}

/* =========================================================
   矩阵改版：居中对齐 / 城市×业务线 / 城市×时段
   ========================================================= */
.mx {
  text-align: center;
  min-width: 1270px;
}

.mx .city,
.mx .city-h {
  text-align: center;
  padding-left: 12px;
}

.cell {
  align-items: center;
}

.cell-s {
  font-size: 11px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.cell-s.up {
  color: var(--up);
  font-weight: 600;
}

.cell-s.down {
  color: var(--down);
  font-weight: 600;
}

.cell-s.flat {
  color: var(--text-2);
}

.mx-biz {
  min-width: 860px;
}

.mx-dp {
  min-width: 1100px;
}

/* 时段对比的日期选择 */
.dp-ranges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex: none;
}

.dp-range {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-2);
}

.dp-range input {
  height: 26px;
  padding: 0 7px;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.dp-range input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.dp-tag {
  min-width: 32px;
  color: var(--text-3);
}

.dp-sep {
  color: var(--text-3);
}

/* 自定义当期 / 上期 弹层 */
.rp-split {
  height: 1px;
  background: var(--line);
  margin: 2px 0;
}

.rp-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.rp-reset {
  height: 34px;
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-2);
}

.rp-apply {
  flex: 1;
}

@media (max-width: 900px) {
  .dp-ranges {
    align-items: flex-start;
    width: 100%;
  }
}

/* 表头两级标题统一居中 */
.mx thead .sub {
  text-align: center;
}

.mx thead .grp {
  white-space: nowrap;
}

/* 三张表列数相近，宽度按列数给，避免挤压 */
.mx-biz {
  min-width: 1190px;
}

.mx-dp {
  min-width: 1060px;
}

/* 时段卡的日期输入不能被压扁 */
.dp-ranges {
  flex-wrap: wrap;
}

.dp-range input {
  width: 108px;
  min-width: 108px;
  flex: none;
}

.mx-card .card-head {
  flex-wrap: wrap;
}

/* =========================================================
   结构指标表 / 趋势对比
   ========================================================= */
.mx-struct th,
.mx-struct td {
  padding: 0 8px;
}

.trend-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 20px 4px;
}

.tchip {
  height: 26px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.tchip:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.tchip.on {
  background: var(--accent-soft);
  border-color: transparent;
  color: var(--accent);
  font-weight: 600;
}

#trendChart {
  padding: 4px 12px 16px;
}

.chart-tip .tip-val.up {
  color: var(--up);
}

.chart-tip .tip-val.down {
  color: var(--down);
}

.chart-tip .tip-val.flat {
  color: var(--text-2);
}

.trend-empty {
  height: 220px;
  display: grid;
  place-items: center;
  padding: 0 24px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-3);
}

/* 结构指标表列多，表头不换行、字号略收 */
.mx.mx-struct thead .grp,
.mx.mx-struct thead .sub {
  white-space: nowrap;
  font-size: 11.5px;
  letter-spacing: -0.01em;
}

/* =========================================================
   公司品牌栏（所有页面最上方）
   ========================================================= */
:root {
  --brandbar: 58px;
}

.app {
  grid-template-rows: var(--brandbar) minmax(0, 1fr);
}

.brandbar {
  grid-column: 1 / -1;
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 13px;
  height: var(--brandbar);
  padding: 0 var(--gutter);
  background:
    linear-gradient(
      90deg,
      rgba(244, 112, 31, 0.1) 0%,
      rgba(244, 112, 31, 0.032) 26%,
      rgba(244, 112, 31, 0) 54%
    ),
    var(--glass-strong);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  backdrop-filter: blur(26px) saturate(180%);
  border-bottom: 1px solid var(--line);
}

.brandbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, rgba(244, 112, 31, 0.5), rgba(244, 112, 31, 0) 40%);
  pointer-events: none;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.logo-mark {
  display: block;
  flex: none;
  border-radius: 10px;
  box-shadow: 0 7px 16px -9px rgba(209, 70, 15, 0.9);
}

.logo-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.logo-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.09em;
  line-height: 1;
  white-space: nowrap;
  background-image: linear-gradient(96deg, #e8551a 0%, #ff8a3c 34%, var(--text) 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo-latin {
  font-size: 7.5px;
  font-weight: 650;
  letter-spacing: 0.3em;
  line-height: 1;
  color: var(--text-3);
  white-space: nowrap;
}

.logo-div {
  width: 1px;
  height: 24px;
  flex: none;
  background: var(--line-strong);
}

.logo-portal {
  display: grid;
  gap: 2px;
  font-size: 13.5px;
  font-weight: 620;
  letter-spacing: -0.012em;
  line-height: 1.15;
  white-space: nowrap;
}

.logo-portal-sub {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-3);
}

.brandbar-spacer {
  flex: 1;
}

.brandbar-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--text-3);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brandbar-meta i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: none;
  background: linear-gradient(135deg, #ff9a4d, #e8551a);
  box-shadow: 0 0 0 3px rgba(244, 112, 31, 0.13);
}

/* 侧栏与顶栏都落在品牌栏下方 */
.rail {
  top: var(--brandbar);
  height: calc(100dvh - var(--brandbar));
}

.topbar {
  top: var(--brandbar);
}

/* 侧栏顶部只剩收起按钮 */
.rail-head {
  display: flex;
  justify-content: flex-end;
  height: 22px;
  margin: -4px -2px -4px 0;
}

.rail-toggle {
  position: static;
  opacity: 0;
}

@media (max-width: 700px) {
  :root {
    --brandbar: 52px;
  }

  .brandbar {
    padding: 0 16px;
    gap: 10px;
  }

  .logo-name {
    font-size: 15px;
    letter-spacing: 0.06em;
  }

  .logo-portal,
  .brandbar-meta {
    display: none;
  }
}

/* 登录页：品牌栏在顶，卡片居中占剩余高度；霓虹底改暖色，与标识同源 */
.login-bar + .login-page {
  min-height: calc(100dvh - var(--brandbar));
}

.login-page::before {
  background: rgba(244, 112, 31, 0.22);
}

.login-page::after {
  background: rgba(255, 176, 102, 0.2);
}

/* 移动/平板：品牌栏不再占网格行，避免把主内容挤到视口外 */
@media (max-width: 860px) {
  .app {
    display: block;
  }

  .brandbar {
    position: static;
    height: var(--brandbar);
  }

  .rail {
    top: auto;
    height: auto;
  }

  .rail-head {
    display: none;
  }

  .topbar {
    top: 0;
  }
}

/* 小屏：时间分段控件允许压缩，避免把头像和图标挤出视口 */
@media (max-width: 700px) {
  .topbar-tools {
    flex-wrap: wrap;
  }

  .topbar-tools .seg {
    flex: 1 1 auto;
    min-width: 0;
  }

  .topbar-tools .seg button {
    padding: 0 7px;
    font-size: 12px;
  }
}

/* =========================================================
   品牌标识（用公司提供的 logo 原图，已去白底）
   ========================================================= */
.logo {
  gap: 0;
}

.logo-img {
  display: block;
  height: 36px;
  width: auto;
}

/* 页首背景水印：同一张 logo，半透明压在内容之下 */
.content {
  position: relative;
  z-index: 0;
}

.watermark {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(372px, 36vw);
  z-index: -1;
  pointer-events: none;
  opacity: 0.15;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 56%, rgba(0, 0, 0, 0.45) 82%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 56%, rgba(0, 0, 0, 0.45) 82%, transparent 100%);
}

.watermark img {
  display: block;
  width: 100%;
  height: auto;
}

@media (max-width: 700px) {
  .logo-img {
    height: 28px;
  }

  /* 手机上抬头区被文字占满，水印会和问候语打架，直接不显示 */
  .watermark {
    display: none;
  }

  /* 水印不显示了，模块页顶部也不用再留空 */
  .module-body {
    padding-top: 0;
  }
}

/* 登录页水印：与内页同一套（顶部居中、底部渐隐） */
.login-watermark {
  top: 4px;
  bottom: auto;
  right: auto;
  width: min(296px, 44vw);
  z-index: 0;
  opacity: 0.12;
}

/* 模块占位页：内容包一层，保证 .content 的第 1 个子节点仍是水印；
   顶部留出与首页抬头的同高度区域，让背景 logo 能完整露出 */
.module-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 96px;
}

/* 小屏：水印不显示，模块页顶部不留空（放在最后，覆盖上面的 96px） */
@media (max-width: 700px) {
  .module-body {
    padding-top: 0;
  }
}

/* =========================================================
   管理后台：统计卡 / 账号表 / 抽屉 / 弹窗
   ========================================================= */
.head-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

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

.stat-card {
  background: var(--surface);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line);
  padding: 16px 18px 14px;
  display: grid;
  gap: 4px;
}

.stat-k {
  font-size: 11.5px;
  font-weight: 550;
  color: var(--text-3);
  letter-spacing: 0.02em;
}

.stat-v {
  font-size: 26px;
  font-weight: 680;
  letter-spacing: -0.03em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat-sub {
  font-size: 11px;
  color: var(--text-3);
}

.adm-head {
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}

.adm-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-3);
}

.search-box svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.search-box input {
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  width: 150px;
}

.seg.mini button {
  height: 24px;
  padding: 0 10px;
  font-size: 12px;
}

.adm-tbl th.right,
.adm-tbl td:last-child {
  text-align: right;
}

.adm-tbl td {
  padding: 11px 12px;
}

.u-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  vertical-align: 1px;
}

.role-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 550;
  color: var(--text-2);
  background: rgba(0, 0, 0, 0.05);
}

.role-tag.role-admin {
  color: #8a5a12;
  background: rgba(232, 144, 26, 0.14);
}

.role-tag.role-city_mgr {
  color: #0a5cd8;
  background: rgba(10, 108, 255, 0.1);
}

.perm-cell {
  max-width: 300px;
  white-space: normal;
}

.adm-actions {
  white-space: nowrap;
}

.btn-sm {
  height: 28px;
  padding: 0 10px;
  font-size: 12px;
  border-radius: 8px;
}

.icon-btn.sm {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  vertical-align: middle;
}

.btn-danger {
  background: var(--up);
  color: #fff;
  border: 1px solid transparent;
}

.btn-danger:hover {
  background: #d13b40;
}

.num.muted {
  color: var(--text-3);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.adm-empty {
  padding: 28px 0;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-3);
}

.row-menu {
  min-width: 176px;
  z-index: 320;
}

.row-menu .menu-item[disabled] {
  opacity: 0.42;
  pointer-events: none;
}

/* ---------- 操作日志 ---------- */
.audit {
  display: grid;
  gap: 1px;
}

.audit-row {
  display: grid;
  grid-template-columns: 8px 130px 96px 110px 120px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

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

.audit-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
}

.audit-dot.bad {
  background: var(--up);
}

.audit-time {
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.audit-actor {
  color: var(--text-2);
}

.audit-act {
  font-weight: 550;
}

.audit-act.bad {
  color: var(--up);
}

.audit-target {
  color: var(--text-2);
  font-weight: 550;
}

.audit-detail {
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 抽屉 ---------- */
.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 260;
  background: rgba(18, 18, 22, 0.3);
  display: flex;
  justify-content: flex-end;
}

.drawer-mask[hidden] {
  display: none;
}

.drawer {
  width: min(470px, 100%);
  height: 100dvh;
  background: var(--surface);
  box-shadow: -24px 0 60px -30px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  animation: drawerIn 300ms cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes drawerIn {
  from {
    transform: translateX(28px);
  }
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 24px 14px;
  border-bottom: 1px solid var(--line);
}

.drawer-title {
  font-size: 18px;
  font-weight: 660;
  letter-spacing: -0.02em;
}

.drawer-sub {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 5px;
  line-height: 1.5;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 24px 24px;
  display: grid;
  gap: 18px;
  align-content: start;
}

.drawer-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 24px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-block {
  display: grid;
  gap: 8px;
}

.form-label {
  font-size: 12px;
  font-weight: 550;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-hint {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-3);
}

.form-note {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.5;
}

.drawer .field span {
  font-size: 12px;
}

.drawer .field input,
.drawer input[type="text"],
.drawer input[type="password"] {
  height: 38px;
  width: 100%;
  padding: 0 11px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  transition: border-color 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.drawer input:focus {
  outline: none;
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.drawer input:disabled {
  color: var(--text-3);
  background: rgba(0, 0, 0, 0.035);
}

.role-list {
  display: grid;
  gap: 6px;
}

.role-card {
  display: grid;
  gap: 3px;
  text-align: left;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
}

.role-card:hover {
  border-color: var(--line-strong);
}

.role-card.on {
  border-color: transparent;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1.5px rgba(10, 108, 255, 0.35);
}

.role-name {
  font-size: 13px;
  font-weight: 600;
}

.role-card.on .role-name {
  color: var(--accent);
}

.role-desc {
  font-size: 11.5px;
  color: var(--text-3);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 500;
  transition: border-color 140ms ease, background-color 140ms ease, color 140ms ease;
}

.chip-toggle svg {
  width: 13px;
  height: 13px;
}

.chip-toggle:hover {
  border-color: var(--line-strong);
}

.chip-toggle.on {
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(10, 108, 255, 0.28);
}

.chip-toggle[disabled] {
  opacity: 0.4;
  pointer-events: none;
}

.input-row {
  display: flex;
  gap: 8px;
}

.input-row input {
  flex: 1;
  min-width: 0;
}

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(20, 20, 24, 0.24);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 20px;
  animation: fadeIn 160ms ease;
}

.modal-mask[hidden] {
  display: none;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
}

.modal {
  width: min(410px, 100%);
  background: var(--surface);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--glass-line);
  display: grid;
  gap: 14px;
  animation: modalIn 220ms cubic-bezier(0.32, 0.72, 0, 1);
}

.modal-wide {
  width: min(560px, 100%);
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.97) translateY(6px);
  }
}

.modal-title {
  font-size: 17px;
  font-weight: 660;
  letter-spacing: -0.02em;
}

.modal-sub {
  font-size: 12.5px;
  color: var(--text-2);
  line-height: 1.6;
  margin-top: -6px;
}

.modal-sub b {
  color: var(--text);
}

.modal-err {
  font-size: 12px;
  color: var(--up);
  margin: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}

.modal .field {
  display: grid;
  gap: 6px;
}

.modal .field span {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 550;
}

.modal input {
  height: 38px;
  padding: 0 11px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  font: inherit;
  font-size: 13px;
  color: var(--text);
}

.modal input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--surface);
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
}

.checkbox input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}

/* ---------- 登录页 ---------- */
.login-error {
  margin: 12px 0 0;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(229, 72, 77, 0.08);
  color: var(--up);
  font-size: 12.5px;
  line-height: 1.5;
}

.link-btn {
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 550;
  background: none;
}

@media (max-width: 900px) {
  .adm-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .audit-row {
    grid-template-columns: 8px 92px 80px 92px minmax(0, 1fr);
  }

  .audit-detail {
    display: none;
  }
}

@media (max-width: 700px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .drawer {
    width: 100%;
  }

  .adm-tools {
    width: 100%;
  }

  .search-box {
    flex: 1;
  }

  .search-box input {
    width: 100%;
  }

  .stat-v {
    font-size: 22px;
  }
}

/* 行内操作：icon-btn 默认 display:grid 会换行，这里改回行内 */
.adm-actions .icon-btn.sm {
  display: inline-grid;
  vertical-align: middle;
}

.adm-tbl th:last-child,
.adm-tbl td:last-child {
  min-width: 92px;
}

/* hidden 属性统一生效（.btn 的 display 会盖掉 UA 的 [hidden]） */
[hidden] {
  display: none !important;
}

/* =========================================================
   总部考核：面包屑 / 模块入口卡片
   ========================================================= */
.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 2px 0;
  font-size: 12.5px;
  color: var(--text-3);
}

.crumb a {
  color: var(--text-2);
  transition: color 150ms ease;
}

.crumb a:hover {
  color: var(--accent);
}

.crumb-sep {
  opacity: 0.55;
}

.exam-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* 模块详情页的空状态图标底色跟随模块色 */
.exam-art {
  background: radial-gradient(120% 120% at 30% 20%, rgba(255, 255, 255, 0.92), rgba(10, 108, 255, 0.06));
  background: radial-gradient(
    120% 120% at 30% 20%,
    rgba(255, 255, 255, 0.92),
    color-mix(in srgb, var(--ex, #0a6cff) 8%, transparent)
  );
}

/* 考核页顶部说明行（标题由顶栏承担，避免重复） */
.exam-intro {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 2px 2px 0;
}

.exam-intro-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-2);
  max-width: 760px;
  margin: 0;
}

/* 考核页：给页首水印留出展示带，卡片不要压住 logo */
.exam-body {
  margin-top: 60px;
}

/* =========================================================
   总部考核入口：独立模块卡（各自成块，不相连）
   ========================================================= */
.exam-panel {
  margin: 56px auto 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  width: 100%;
  max-width: 1120px;
}

.exam-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 124px;
  padding: 19px 20px 18px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line);
  transition: transform 320ms cubic-bezier(0.32, 0.72, 0, 1), box-shadow 320ms ease;
}

.exam-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), inset 0 0 0 1px var(--line-strong);
}

.exam-tile:active {
  transform: translateY(0);
}

.exam-ico {
  width: 40px;
  height: 40px;
  flex: none;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--ex, var(--accent));
  background: rgba(10, 108, 255, 0.08);
  background: color-mix(in srgb, var(--ex, #0a6cff) 9%, transparent);
  transition: transform 320ms cubic-bezier(0.32, 0.72, 0, 1);
}

.exam-ico svg {
  width: 21px;
  height: 21px;
}

.exam-tile:hover .exam-ico {
  transform: scale(1.04);
}

.exam-title {
  margin-top: 14px;
  font-size: 15px;
  font-weight: 620;
  letter-spacing: -0.015em;
  line-height: 1.42;
  color: var(--text);
}

@media (max-width: 960px) {
  .exam-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .exam-panel {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-top: 0;
  }

  .exam-tile {
    min-height: 0;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
  }

  .exam-ico {
    width: 36px;
    height: 36px;
    border-radius: 11px;
  }

  .exam-title {
    margin-top: 0;
    padding-top: 0;
    font-size: 14.5px;
  }

}

@media (prefers-reduced-motion: reduce) {
  .exam-tile,
  .exam-ico {
    transition: none;
  }
}

/* 窄屏（<1100）收起页首水印：抬头文字会压在水印上，读起来发糊；
   同时把它专用的留白一起归零，避免出现空白带 */
@media (max-width: 1099px) {
  .watermark {
    display: none;
  }

  .module-body {
    padding-top: 0;
  }

  .exam-panel,
  .exam-body {
    margin-top: 0;
  }
}

/* 考核子页的空状态插画收小一档，整体更轻 */
.exam-body .empty-art {
  width: 104px;
  height: 104px;
  border-radius: 28px;
  margin-bottom: 18px;
}

.exam-body .empty-art svg {
  width: 40px;
  height: 40px;
}

/* 入口页底部说明与模块栅格对齐 */
.exam-panel ~ .note {
  max-width: 1120px;
}

/* 入口页底部说明也居中 */
.exam-panel ~ .note {
  justify-content: center;
  text-align: center;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 640px) {
  .exam-tile {
    justify-content: center;
  }
}

/* =========================================================
   总部考核入口：模块卡整体垂直居中，不再贴顶
   ========================================================= */
body[data-exam="index"] .main > .content,
body[data-board="index"] .main > .content {
  flex: 1;
  justify-content: center;
}

body[data-exam="index"] .exam-panel,
body[data-board="index"] .exam-panel {
  margin-top: 0;
}

/* 视口很矮时改回顶部对齐，避免居中的溢出把首屏内容顶出可滚区域 */
@media (max-height: 560px) {
  body[data-exam="index"] .main > .content,
  body[data-board="index"] .main > .content {
    justify-content: flex-start;
  }
}

@media (max-width: 860px) {
  body[data-exam="index"] .main > .content,
  body[data-board="index"] .main > .content {
    justify-content: flex-start;
  }
}

/* 让上下内边距一致，垂直居中才真正对称（原底部 56px 会把整块往上推） */
body[data-exam="index"] .main > .content,
body[data-board="index"] .main > .content {
  padding-top: 24px;
  padding-bottom: 24px;
}

/* =========================================================
   总部考核 · 月度考核看板
   ========================================================= */
:root {
  --good: #0f9b8e;
  --mid: #e8901a;
  --bad: #e5484d;
}

.up { color: var(--up); }
.down { color: var(--down); }
.muted { color: var(--text-3); }
.good { color: var(--good); }
.mid { color: var(--mid); }
.bad { color: var(--bad); }
.flat { color: var(--text-3); }

/* 城市切换条 */
.exm-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.exm-cities {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.exm-city {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease,
    box-shadow 160ms ease;
}

.exm-city:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.exm-city.on {
  border-color: transparent;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm), inset 0 0 0 1.5px rgba(10, 108, 255, 0.35);
}

.exm-city-name {
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.exm-city-score {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
}

.exm-city-score.good { color: var(--good); }
.exm-city-score.mid { color: var(--mid); }
.exm-city-score.bad { color: var(--bad); }

.exm-asof {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
}

.exm-asof b {
  color: var(--text-2);
  font-weight: 600;
}

/* 四张总览 */
.exm-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.exm-kpi {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 17px 18px 15px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line);
  overflow: hidden;
}

.exm-kpi::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--ac, var(--accent));
  opacity: 0.85;
}

.exm-kpi-k {
  font-size: 11.5px;
  font-weight: 550;
  color: var(--text-3);
  letter-spacing: 0.02em;
}

.exm-kpi-v {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 27px;
  font-weight: 680;
  letter-spacing: -0.035em;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.exm-kpi-s {
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.45;
}

.exm-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  display: inline-block;
  margin-left: 2px;
  background: var(--text-3);
}

.exm-dot.good { background: var(--good); box-shadow: 0 0 0 3px rgba(15, 155, 142, 0.14); }
.exm-dot.mid { background: var(--mid); box-shadow: 0 0 0 3px rgba(232, 144, 26, 0.14); }
.exm-dot.bad { background: var(--bad); box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.12); }

/* 城市对比表 */
.exm-cmp {
  font-size: 12.5px;
}

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

.exm-cmp tbody tr {
  cursor: pointer;
}

.exm-cmp tbody tr.on {
  background: var(--accent-soft);
}

.exm-cmp td {
  padding: 12px;
}

.exm-td-city {
  display: flex;
  align-items: center;
  gap: 7px;
}

.exm-city-tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 550;
  color: var(--text-2);
  background: rgba(0, 0, 0, 0.05);
}

.exm-warn-num {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--bad);
  background: rgba(229, 72, 77, 0.09);
}

/* 小节标题 */
.exm-sec-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 4px 2px 10px;
}

.exm-sec-title {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.exm-sec-note {
  font-size: 12px;
  color: var(--text-3);
}

/* 业务结果三块 */
.exm-blocks {
  display: grid;
  /* 有的档位只考核两块（如 30W- 不算交易结构），auto-fit 让剩下的块自动铺开 */
  grid-template-columns: repeat(auto-fit, minmax(252px, 1fr));
  gap: 14px;
}

.exm-block {
  display: grid;
  gap: 0;
  padding: 17px 18px 15px;
}

.exm-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.exm-block-k {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}

.exm-block-w {
  font-size: 10.5px;
  font-weight: 550;
  color: var(--text-3);
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.045);
  font-variant-numeric: tabular-nums;
}

.exm-block-score {
  font-size: 30px;
  font-weight: 690;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin: 6px 0 12px;
  font-variant-numeric: tabular-nums;
}

.exm-items {
  display: grid;
  gap: 7px;
  border-top: 1px solid var(--line);
  padding-top: 11px;
}

.exm-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 56px 48px;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
}

.exm-item-k {
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exm-item-v {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.exm-track {
  display: block;
  height: 5px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.055);
  overflow: hidden;
}

.exm-track i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: var(--text-3);
  transition: width 620ms cubic-bezier(0.22, 1, 0.36, 1);
}

.exm-track i.good { background: var(--good); }
.exm-track i.mid { background: var(--mid); }
.exm-track i.bad { background: var(--bad); }

/* 过程两块 */
.exm-2col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
}

.exm-score-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  height: 26px;
  padding: 0 9px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
  color: var(--text);
  background: rgba(0, 0, 0, 0.045);
  font-variant-numeric: tabular-nums;
}

.exm-score-chip span {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-3);
}

.exm-rows {
  display: grid;
}

.exm-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 36px 84px 46px;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  font-size: 12.5px;
}

.exm-row + .exm-row {
  border-top: 1px solid var(--line);
}

.exm-row-k {
  color: var(--text);
  font-weight: 550;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exm-row-w {
  text-align: right;
  font-size: 11px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.exm-row-v {
  text-align: right;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.exm-foot {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-3);
}

/* 激励 */
.exm-incent-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.exm-incent-big {
  font-size: 30px;
  font-weight: 690;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.exm-incent-split {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--text-2);
  text-align: right;
}

.exm-incent-split b {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.exm-kvs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 18px;
  padding-top: 8px;
}

.exm-kv {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 2px 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.exm-kv-k {
  color: var(--text-2);
}

.exm-kv-v {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.exm-kv-n {
  grid-column: 1 / -1;
  font-size: 10.5px;
  color: var(--text-3);
}

/* 警告 */
.exm-warns {
  display: grid;
}

.exm-warn-row {
  display: grid;
  grid-template-columns: 76px 44px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}

.exm-warn-row:last-child {
  border-bottom: 0;
}

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

.exm-warn-s {
  display: inline-flex;
  justify-content: center;
  height: 20px;
  align-items: center;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  background: rgba(0, 0, 0, 0.04);
}

.exm-warn-row.hit .exm-warn-s {
  color: var(--bad);
  background: rgba(229, 72, 77, 0.1);
}

.exm-warn-r {
  color: var(--text-3);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 趋势 */
.exm-trend-tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.04);
}

.exm-tab {
  height: 24px;
  padding: 0 10px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 550;
  color: var(--text-2);
  transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

.exm-tab.on {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.exm-empty {
  grid-column: 1 / -1;
  padding: 28px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: center;
  font-size: 12.5px;
  color: var(--text-3);
}

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

@media (max-width: 980px) {
  .exm-blocks,
  .exm-2col {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .exm-kpis {
    grid-template-columns: minmax(0, 1fr);
  }

  .exm-kpi-v,
  .exm-incent-big {
    font-size: 24px;
  }

  .exm-kvs {
    grid-template-columns: minmax(0, 1fr);
  }

  .exm-row {
    grid-template-columns: minmax(0, 1fr) 34px 60px 42px;
    gap: 8px;
  }

  .exm-item {
    grid-template-columns: minmax(0, 1fr) 48px 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .exm-track i {
    transition: none;
  }
}

/* 数据页：内容密，页首水印会和城市胶囊叠在一起，直接不显示 */
body[data-live="1"] .watermark {
  display: none;
}

/* 入口卡：已接入数据的小圆点 */
.exam-live {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 5px;
  border-radius: 50%;
  vertical-align: 3px;
  background: var(--good);
  box-shadow: 0 0 0 3px rgba(15, 155, 142, 0.13);
}

/* 月度考核：小屏适配 */
@media (max-width: 640px) {
  body[data-live="1"] .content {
    padding-bottom: 92px; /* 给底部导航留位 */
  }

  .exm-kpi {
    padding: 14px 16px;
  }

  /* 列太多，手机上先收起「组内排名」，其余仍可横向滑动 */
  .exm-cmp th:nth-child(3),
  .exm-cmp td:nth-child(3) {
    display: none;
  }

  .exm-incent-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .exm-incent-split {
    text-align: left;
  }
}

/* =========================================================
   月度考核 v2：历史对比 / 折叠明细 / 溢出修正
   ========================================================= */
.exm-hist {
  display: block;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 业务结果卡片里的子项：两行结构 */
.exm-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  padding: 7px 0;
  font-size: 11.5px;
}

.exm-item + .exm-item {
  border-top: 1px dashed var(--line);
}

.exm-item-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.exm-item-k {
  min-width: 0;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exm-item-v {
  flex: none;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.exm-block-score {
  font-size: 30px;
  font-weight: 690;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 4px 0 2px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.exm-block .exm-hist {
  margin-bottom: 8px;
}

/* 折叠的过程块 */
.exm-acc {
  border-top: 1px solid var(--line);
}

.exm-acc:first-child {
  border-top: 0;
}

.exm-acc > summary {
  list-style: none;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.exm-acc > summary::-webkit-details-marker {
  display: none;
}

.exm-acc > summary:hover {
  background: rgba(0, 0, 0, 0.018);
}

.exm-acc[open] > summary .exm-caret {
  transform: rotate(90deg);
}

.exm-caret {
  color: var(--text-3);
  transition: transform 220ms cubic-bezier(0.32, 0.72, 0, 1);
  flex: none;
}

.exm-row-k {
  display: grid;
  grid-template-columns: 13px minmax(0, 1fr);
  column-gap: 6px;
  align-items: center;
  min-width: 0;
}

.exm-row-k .exm-caret {
  grid-row: 1 / span 2;
  grid-column: 1;
}

.exm-row-name {
  grid-column: 2;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exm-row-k .exm-hist {
  grid-column: 2;
}

.exm-acc-body {
  padding: 2px 0 14px;
  animation: exmFade 200ms ease;
}

@keyframes exmFade {
  from {
    opacity: 0;
    transform: translateY(-2px);
  }
}

.exm-coefs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 0 9px;
}

.exm-coef {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 10.5px;
  color: var(--text-2);
  background: rgba(232, 144, 26, 0.1);
}

.exm-coef b {
  font-weight: 650;
  color: #8a5a12;
  font-variant-numeric: tabular-nums;
}

.exm-sub {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  table-layout: fixed;
}

.exm-sub th {
  padding: 4px 5px 6px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-3);
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

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

.exm-sub td {
  padding: 5px;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.exm-sub tr:last-child td {
  border-bottom: 0;
}

.exm-sub td.k {
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-2);
}

.exm-sub th:first-child,
.exm-sub td.k {
  width: 34%;
}

/* 溢出与换行修正 */
.card-head {
  flex-wrap: wrap;
  row-gap: 8px;
}

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

.exm-kpi-s {
  overflow-wrap: anywhere;
}

.exm-score-chip {
  max-width: 100%;
  overflow: hidden;
}

.exm-score-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.exm-incent-split span {
  white-space: nowrap;
}

.exm-cmp .exm-td-city {
  white-space: nowrap;
}

.exm-warn-r {
  min-width: 0;
}

@media (max-width: 980px) {
  .exm-sub th:first-child,
  .exm-sub td.k {
    width: 30%;
  }
}

@media (max-width: 640px) {
  .exm-sub {
    font-size: 10.5px;
  }

  .exm-sub th,
  .exm-sub td {
    padding: 4px 3px;
  }

  /* 手机上把「前日 / 7 日均」两列收掉，避免表格挤成一团 */
  .exm-sub th:nth-child(5),
  .exm-sub td:nth-child(5),
  .exm-sub th:nth-child(6),
  .exm-sub td:nth-child(6) {
    display: none;
  }
}

/* 业务结果子项：进度条不再像分隔线 */
.exm-item + .exm-item {
  border-top: 0;
}

.exm-item {
  padding: 6px 0 8px;
}

.exm-item .exm-track {
  height: 4px;
  margin-top: 1px;
}

/* 展开明细表：放不下时横向滚动，不要被卡片裁掉 */
.exm-sub-wrap {
  overflow-x: auto;
  margin: 0 -2px;
  padding: 0 2px 2px;
}

.exm-sub {
  table-layout: auto;
  min-width: 360px;
  font-size: 10.8px;
}

.exm-sub th,
.exm-sub td {
  padding: 5px 4px;
}

.exm-sub th:first-child,
.exm-sub td.k {
  width: 30%;
  min-width: 96px;
}

.exm-sub td.k {
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* 过程行：进度条给足宽度，别缩成小短线 */
.exm-row {
  grid-template-columns: minmax(0, 1fr) 40px minmax(64px, 140px) 50px;
}

.exm-sub th:first-child,
.exm-sub td.k {
  width: 26%;
  min-width: 88px;
}

.exm-sub-wrap {
  padding-right: 4px;
}

.exm-sub th:last-child,
.exm-sub td:last-child {
  padding-right: 2px;
}

@media (max-width: 640px) {
  .exm-row {
    grid-template-columns: minmax(0, 1fr) 34px 64px 44px;
  }
}

/* 业务结果进度条：120% 归一 + 100% 刻度 */
.exm-track {
  position: relative;
}

.exm-track::after {
  content: "";
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: 83.33%;
  width: 1px;
  background: rgba(0, 0, 0, 0.16);
}

/* 进度条更清楚一点 */
.exm-item .exm-track {
  height: 5px;
  margin-top: 3px;
  background: rgba(0, 0, 0, 0.07);
}

.exm-track i {
  min-width: 2px;
}

/* 过程行的条是「得分/120」，没有 100% 概念，去掉刻度线 */
.exm-row .exm-track::after {
  display: none;
}

/* 可展开提示 */
.exm-acc > summary:hover .exm-row-name {
  color: var(--accent);
}

/* 对比表的横滚区不再用负外边距，避免撑出卡片 */
.exm-cmpcard .tbl-wrap {
  margin: 0;
  padding: 0;
}

/* 日期筛选 */
.exm-datetools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.exm-select {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 28px 0 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.exm-select:hover {
  border-color: var(--line-strong);
}

.exm-select:focus-within {
  border-color: transparent;
  box-shadow: 0 0 0 3px var(--accent-soft), inset 0 0 0 1.5px rgba(10, 108, 255, 0.4);
}

.exm-select > svg:first-child {
  flex: none;
  color: var(--text-3);
}

.exm-select select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  padding: 0;
  cursor: pointer;
  outline: none;
}

.exm-caret-down {
  position: absolute;
  right: 9px;
  color: var(--text-3);
  pointer-events: none;
}

/* 卡片头换行时，右侧标记仍然靠右；只有一个子元素时不推走（否则标题会被挤到中间） */
.exm-cmpcard .card-head > :last-child:not(:first-child),
.exm-2col .card-head > :last-child:not(:first-child) {
  margin-left: auto;
}

/* =========================================================
   月度考核：四张明细卡的留白与层次
   这几张卡的内容是直接写在 .card 里的（没有 .card-body），
   之前只剩 card-head 的 20px 内边距，行内容会贴到左右边框上
   ========================================================= */
.exm-list,
.exm-incent,
.exm-warns {
  padding: 6px 20px 16px;
}

/* 过程行：左右再缩进 8px，hover 时给一整块浅底 */
.exm-acc {
  border-top: 1px solid var(--line);
  margin: 0 -6px;
  padding: 0 6px;
}

.exm-acc:first-child {
  border-top: 0;
}

.exm-acc > summary {
  padding: 11px 8px;
  margin: 0 -8px;
  border-radius: 10px;
}

.exm-acc[open] > summary {
  background: rgba(0, 0, 0, 0.025);
}

.exm-acc > summary:hover {
  background: rgba(0, 0, 0, 0.03);
}

.exm-acc-body {
  padding: 4px 8px 14px;
}

/* 激励卡 */
.exm-incent {
  padding-top: 14px;
}

.exm-incent-top {
  padding-bottom: 16px;
}

.exm-kvs {
  padding-top: 6px;
}

.exm-kv {
  padding: 9px 0;
}

.exm-incent .exm-foot {
  margin: 14px 0 0;
}

/* 警告卡 */
.exm-warn-row {
  padding: 10px 0;
  grid-template-columns: 70px 42px minmax(0, 1fr);
  gap: 10px;
}

.exm-warns .exm-warn-row:first-child {
  padding-top: 6px;
}

.exm-warn-r {
  line-height: 1.4;
}

/* 卡片头与内容之间留一点呼吸 */
.exm-2col .card-head {
  padding-bottom: 2px;
}

@media (max-width: 640px) {
  .exm-list,
  .exm-incent,
  .exm-warns {
    padding-left: 16px;
    padding-right: 16px;
  }

  .exm-acc-body {
    padding-left: 4px;
    padding-right: 4px;
  }
}

/* 激励卡：系数改成三格小方块，撑满一行不空半格 */
.exm-coefgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 4px;
}

.exm-coefcell {
  display: grid;
  gap: 2px;
  padding: 11px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.028);
}

.exm-coefcell-k {
  font-size: 10.5px;
  font-weight: 550;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exm-coefcell-v {
  font-size: 16px;
  font-weight: 680;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

.exm-coefcell-n {
  font-size: 10px;
  color: var(--text-3);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 未命中的警告：降噪 */
.exm-warn-row:not(.hit) .exm-warn-s {
  background: transparent;
  color: var(--text-3);
  opacity: 0.6;
}

@media (max-width: 640px) {
  .exm-coefgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 激励点位：2×2 小格，标签在上、数值在下，和系数格同一套语言 */
.exm-points {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 22px;
  padding: 6px 0 2px;
}

.exm-point {
  display: grid;
  gap: 2px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.exm-point span {
  font-size: 10.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exm-point b {
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .exm-points {
    gap: 0 16px;
  }
}

/* 未命中的警告行收窄一点，避免整卡空荡 */
.exm-warn-row:not(.hit) {
  padding-top: 7px;
  padding-bottom: 7px;
}

.exm-list .exm-foot {
  margin-bottom: 0;
}

/* 排名走势：名次升降标签（百分位变小 = 名次前进） */
.exm-move {
  margin-left: 7px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.exm-move.up {
  color: var(--down);
}

.exm-move.down {
  color: var(--up);
}

/* 两个走势卡之间别贴太紧 */
#trendChart,
#rankChart {
  padding-top: 4px;
}

/* =========================================================
   月度考核 · 过程项监控（对齐线下宽表）
   ========================================================= */
.prc-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.prc-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.045);
}

.prc-tab {
  border: 0;
  background: transparent;
  padding: 6px 14px;
  border-radius: 9px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-2);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.prc-tab:hover {
  color: var(--text);
}

.prc-tab.on {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}

.prc-meta {
  font-size: 12px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.prc-meta b {
  color: var(--text);
  font-weight: 600;
}

.prc-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11.5px;
  color: var(--text-3);
}

.prc-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.prc-card .card-head {
  padding-bottom: 4px;
}

.prc-wrap {
  overflow: auto;
  padding: 8px 0 10px;
  max-height: min(78vh, 980px);
}

.prc {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11px;
  width: max-content;
  min-width: 100%;
  font-variant-numeric: tabular-nums;
}

.prc th,
.prc td {
  padding: 5px 6px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid rgba(0, 0, 0, 0.045);
  text-align: right;
  white-space: nowrap;
}

.prc .prc-k {
  position: sticky;
  left: 0;
  z-index: 3;
  width: 222px;
  min-width: 222px;
  max-width: 222px;
  text-align: left;
  background: var(--surface);
  border-right: 1px solid var(--line-strong);
  white-space: normal;
  line-height: 1.35;
  padding-left: 18px;
}

.prc thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--surface-2);
  color: var(--text-2);
  font-weight: 600;
  font-size: 11px;
  text-align: center;
}

.prc thead tr:nth-child(2) th {
  top: 31px;
}

.prc .prc-kh {
  left: 0;
  z-index: 6;
  text-align: left;
  padding-left: 18px;
}

.prc .prc-ch {
  background: rgba(10, 108, 255, 0.07);
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0.01em;
  border-left: 1px solid var(--line-strong);
}

.prc .prc-sh {
  font-weight: 550;
  color: var(--text-3);
  font-size: 10.5px;
}

.prc .prc-sec td {
  background: var(--surface-2);
}

.prc .prc-sec .prc-k {
  background: var(--surface-2);
  font-weight: 650;
  font-size: 11.5px;
  color: var(--text);
  letter-spacing: 0.02em;
}

.prc .prc-ith td {
  background: rgba(18, 161, 80, 0.055);
  border-top: 1px solid var(--line-strong);
}

.prc .prc-ith .prc-k {
  background: rgba(18, 161, 80, 0.075);
}

.prc .prc-name {
  display: block;
  font-weight: 600;
  color: var(--text);
  white-space: normal;
}

.prc .prc-sub {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-3);
  margin-top: 1px;
}

.prc .prc-target {
  font-weight: 650;
  color: var(--accent);
}

.prc .prc-row .prc-k {
  color: var(--text-2);
  font-size: 11px;
}

.prc .prc-rate {
  color: var(--up);
  font-weight: 600;
}

.prc .prc-gapline td {
  border-bottom: 1px solid var(--line-strong);
}

.prc .num.muted {
  color: var(--text-3);
}

.prc .num.up {
  color: var(--up);
}

.prc .num.down {
  color: var(--down);
}

.prc .prc-na {
  color: var(--text-3);
  text-align: center;
}

.prc-pill {
  display: inline-block;
  min-width: 46px;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 650;
}

.prc-pill.good {
  background: rgba(18, 161, 80, 0.14);
  color: #0b7a3c;
}

.prc-pill.mid {
  background: rgba(232, 144, 26, 0.16);
  color: #a5620a;
}

.prc-pill.bad {
  background: rgba(229, 72, 77, 0.12);
  color: #b3282d;
}

.prc-pill.flat {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-3);
}

.prc-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  vertical-align: middle;
}

.prc-dot.good {
  background: #12a150;
  box-shadow: 0 0 0 3px rgba(18, 161, 80, 0.14);
}

.prc-dot.mid {
  background: #e8901a;
  box-shadow: 0 0 0 3px rgba(232, 144, 26, 0.16);
}

.prc-dot.bad {
  background: #e5484d;
  box-shadow: 0 0 0 3px rgba(229, 72, 77, 0.14);
}

.prc-dot.flat {
  background: rgba(0, 0, 0, 0.18);
}

@media (max-width: 760px) {
  .prc .prc-k {
    width: 168px;
    min-width: 168px;
    max-width: 168px;
    padding-left: 12px;
  }

  .prc .prc-kh {
    padding-left: 12px;
  }

  .prc-wrap {
    max-height: none;
  }
}

/* B 端看板：模块宫格（与总部考核同一套卡片，7 个模块排 4 列） */
.bd-panel {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 1120px;
}

.bd-brief {
  margin-top: 7px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-3);
  max-width: 22em;
}

/* 卡片内容（图标/标题/副标题）整体纵向居中 */
.bd-panel .exam-tile {
  justify-content: center;
  min-height: 148px;
}

@media (max-width: 820px) {
  .bd-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* =========================================================
   B 端看板 · 大盘分析（趋势分析表格）
   ========================================================= */
.bm-bar {
  position: relative;
  z-index: 20; /* .rise 的 transform 会形成层叠上下文，弹层需抬到卡片之上 */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.bm-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.045);
}

.bm-tab {
  border: 0;
  background: transparent;
  padding: 6px 16px;
  border-radius: 9px;
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  color: var(--text-2);
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.bm-tab:hover {
  color: var(--text);
}

.bm-tab.on {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}

.bm-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bm-bar .menu-wrap {
  z-index: 95;
}

.bm-card .card-head {
  padding-bottom: 6px;
}

.bm-wrap {
  overflow: auto;
  padding: 4px 0 12px;
  max-height: min(72vh, 860px);
}

.bm {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  width: max-content;
  min-width: 100%;
  font-variant-numeric: tabular-nums;
}

.bm th,
.bm td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid rgba(0, 0, 0, 0.045);
  white-space: nowrap;
}

.bm thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--surface-2);
  color: var(--text-2);
  font-weight: 600;
  font-size: 11.5px;
  text-align: center;
}

.bm thead tr:nth-child(2) th {
  top: 33px;
  font-size: 10.5px;
  font-weight: 550;
  color: var(--text-3);
}

/* 小日历筛选 */
.bm-date {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
}

.bm-date input[type="date"] {
  font: inherit;
  font-size: 12px;
  color: var(--text);
  padding: 6px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.bm-date input[type="date"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 108, 255, 0.12);
}

.bm .bm-k1 {
  position: sticky;
  left: 0;
  z-index: 6;
  width: 108px;
  min-width: 108px;
  text-align: left;
  padding-left: 18px;
  border-right: 1px solid var(--line-strong);
}

.bm .bm-k2 {
  position: sticky;
  left: 108px;
  z-index: 6;
  width: 168px;
  min-width: 168px;
  text-align: left;
  border-right: 1px solid var(--line-strong);
}

.bm .bm-ph {
  min-width: 108px;
  border-left: 1px solid var(--line-strong);
  text-align: right;
}

.bm .bm-pd {
  min-width: 108px;
  border-left: 1px solid var(--line-strong);
  color: var(--text);
  font-weight: 600;
}

.bm .bm-sub {
  display: block;
  font-size: 9.5px;
  font-weight: 500;
  color: var(--text-3);
  margin-top: 1px;
}

.bm .bm-cmp-h {
  min-width: 148px;
  border-left: 2px solid var(--line-strong);
  color: var(--text);
  font-weight: 650;
}

/* 一级指标分组行：点击折叠 */
.bm .bm-grp {
  cursor: pointer;
  user-select: none;
}

.bm .bm-grp:hover .bm-g {
  background: rgba(10, 108, 255, 0.08);
}

.bm .bm-grp.off .bm-g {
  color: var(--text-3);
}

.bm .bm-g {
  position: sticky;
  left: 0;
  z-index: 3;
  background: rgba(10, 108, 255, 0.045);
  color: var(--text);
  font-weight: 650;
  font-size: 12.5px;
  text-align: left;
  padding-left: 14px;
  border-right: 1px solid var(--line-strong);
  border-top: 1px solid var(--line-strong);
}

.bm .bm-caret {
  display: inline-block;
  width: 16px;
  color: var(--text-3);
  font-size: 11px;
}

.bm .bm-g-hint {
  margin-left: 10px;
  font-size: 10px;
  font-weight: 500;
  color: var(--text-3);
  opacity: 0;
  transition: opacity 160ms ease;
}

.bm .bm-grp:hover .bm-g-hint {
  opacity: 1;
}

.bm .bm-k {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--surface);
  color: var(--text-2);
  font-weight: 550;
  text-align: left;
  padding-left: 30px;
  border-right: 1px solid var(--line-strong);
}

/* 二级指标名旁的趋势箭头 */
.bm-trend {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 7px;
  vertical-align: -4px;
  border-radius: 5px;
  color: var(--accent);
  background: rgba(10, 108, 255, 0.08);
  transition: background 160ms ease, transform 160ms ease;
}

.bm-trend svg {
  width: 12px;
  height: 12px;
}

.bm-trend:hover {
  background: rgba(10, 108, 255, 0.18);
  transform: translateY(-1px);
}

.bm td.num {
  text-align: right;
}

.bm .bm-v {
  display: block;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.bm .bm-d {
  display: block;
  margin-top: 1px;
  font-size: 10.5px;
  font-weight: 600;
}

.bm .bm-d.up {
  color: var(--up);
}

.bm .bm-d.down {
  color: var(--down);
}

.bm .bm-d.flat {
  color: var(--text-3);
}

/* 时段对比列 */
.bm .bm-cmp {
  border-left: 2px solid var(--line-strong);
  background: rgba(10, 108, 255, 0.035);
}

.bm .bm-cmp.up .bm-v,
.bm .bm-cmp.down .bm-v {
  color: var(--text);
}

.bm .bm-na {
  color: var(--text-3);
  text-align: center;
}

.tr-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

@media (max-width: 820px) {
  .bm .bm-k1 {
    min-width: 96px;
  }

  .bm .bm-k {
    padding-left: 18px;
  }

  .bm-wrap {
    max-height: none;
  }
}

/* =========================================================
   B 端看板 · 大盘分析（列内堆叠 + 趋势分析弹层）
   ========================================================= */
/* 每个日期一列：达成值在上、环比在下 */
.bm .bm-cell {
  vertical-align: top;
  min-width: 104px;
  padding: 7px 10px;
}

.bm .bm-cell .bm-v {
  display: block;
  text-align: right;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.bm .bm-cell .bm-d {
  display: block;
  margin-top: 1px;
  text-align: right;
  font-size: 10.5px;
  font-weight: 600;
}

/* 时间段标签 */
.bm-range-label {
  font-size: 11.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ---------------- 趋势分析弹层 ---------------- */
.trd-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 32px 20px;
  background: rgba(28, 28, 32, 0.34);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: trdFade 180ms cubic-bezier(0.32, 0.72, 0, 1);
}

.trd-overlay[hidden] {
  display: none;
}

@keyframes trdFade {
  from {
    opacity: 0;
  }
}

.trd-modal {
  width: min(1080px, 100%);
  max-height: calc(100vh - 64px);
  overflow: auto;
  padding: 22px 24px 20px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--glass-line);
  animation: trdIn 240ms cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes trdIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
}

.trd-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.trd-title {
  font-size: 18px;
  font-weight: 680;
  letter-spacing: -0.02em;
}

.trd-controls {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.trd-ctl {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-3);
}

.trd-input,
.trd-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
}

.trd-static {
  min-width: 190px;
  justify-content: space-between;
  color: var(--text-2);
}

.trd-select select {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  outline: none;
  cursor: pointer;
  appearance: none;
  padding-right: 2px;
}

.trd-range {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.trd-date {
  height: 34px;
  padding: 0 9px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  outline: none;
  font-variant-numeric: tabular-nums;
}

.trd-date:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.trd-arrow {
  color: var(--text-3);
  font-size: 13px;
}

.trd-opts {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 0 4px;
  font-size: 12.5px;
  color: var(--text-2);
}

.trd-chk {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.trd-chk input {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
}

.trd-hint {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.trd-chart {
  margin-top: 10px;
  min-height: 340px;
}

.trend-empty {
  padding: 60px 0;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}

@media (max-width: 760px) {
  .trd-overlay {
    padding: 12px;
  }

  .trd-modal {
    padding: 16px;
  }

  .trd-controls {
    gap: 12px;
  }
}

/* =========================================================
   大盘分析 · 时段对比分析（矩阵）
   ========================================================= */
.cm-wrap {
  overflow: auto;
  max-height: min(74vh, 900px);
  padding: 2px 0 10px;
}

.cm + .cm {
  margin-top: 18px;
}

.cm thead th {
  position: static;
}

.cm {
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  width: max-content;
  min-width: 100%;
  font-variant-numeric: tabular-nums;
}

.cm th,
.cm td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid rgba(0, 0, 0, 0.045);
  white-space: nowrap;
}

.cm thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: var(--surface-2);
  color: var(--text-2);
  font-weight: 600;
  font-size: 11.5px;
  text-align: center;
}

.cm thead tr:nth-child(2) th {
  top: 34px;
  font-size: 10.5px;
  color: var(--text-3);
  font-weight: 550;
}

.cm .cm-sub {
  display: block;
  font-size: 9.5px;
  font-weight: 500;
  color: var(--text-3);
  margin-top: 1px;
}

.cm .cm-k1 {
  position: sticky;
  left: 0;
  z-index: 6;
  min-width: 132px;
  text-align: left;
  padding-left: 14px;
  border-right: 1px solid var(--line-strong);
}

.cm .cm-k {
  position: sticky;
  left: 0;
  z-index: 3;
  background: var(--surface);
  min-width: 132px;
  text-align: left;
  padding-left: 22px;
  color: var(--text-2);
  border-right: 1px solid var(--line-strong);
}

.cm .cm-grp {
  cursor: pointer;
  user-select: none;
}

.cm .cm-g {
  background: rgba(10, 108, 255, 0.05);
  font-weight: 650;
  color: var(--text);
  font-size: 12.5px;
  padding-left: 14px;
}

.cm .cm-grp:hover .cm-g {
  background: rgba(10, 108, 255, 0.09);
}

.cm .cm-grp.off .cm-g {
  color: var(--text-3);
}

.cm .cm-caret {
  display: inline-block;
  width: 15px;
  color: var(--text-3);
  font-size: 11px;
}

.cm .cm-hint {
  margin-left: 10px;
  font-size: 10px;
  color: var(--text-3);
  font-weight: 500;
  opacity: 0;
  transition: opacity 160ms ease;
}

.cm .cm-grp:hover .cm-hint {
  opacity: 1;
}

.cm .cm-v {
  text-align: right;
  min-width: 74px;
}

.cm .cm-v2 {
  background: rgba(10, 108, 255, 0.03);
}

.cm .cm-df {
  text-align: right;
  min-width: 68px;
  font-weight: 600;
  color: var(--text);
}

.cm .cm-total td {
  border-top: 1.5px solid var(--line-strong);
  font-weight: 650;
  background: var(--surface);
}

.cm .cm-total .cm-k {
  background: var(--surface);
  color: var(--text);
}

.cm .cm-s {
  border-left: 1px solid var(--line-strong);
}

.cm .cm-s2 {
  color: var(--text-3);
}

.cm .cm-d {
  color: var(--text);
}

/* =========================================================
   首页 · 移动端筛选（原生下拉 + 起止日历，同大盘分析）
   ========================================================= */
@media (max-width: 700px) {
  .topbar-tools {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  /* 城市筛选挪到顶栏，hero 里的按钮/菜单在手机上不再显示 */
  .hero-side .menu-wrap {
    display: none;
  }

  .topbar-tools {
    gap: 6px;
  }

  .topbar-tools .exm-select {
    flex: 1 1 auto;
    min-width: 0;
    height: 34px;
    font-size: 12.5px;
    padding: 0 8px;
  }

  .topbar-tools .exm-select select {
    min-width: 0;
    width: 100%;
  }

  .topbar-tools .icon-btn {
    flex: none;
  }

  .topbar-tools .bm-date {
    gap: 0;
  }

  /* 手机上省掉「起/至」文字，让两个日历并排 */
  .topbar-tools .bm-date > span {
    display: none;
  }

  /* 排序：刷新跟在城市后面，本期/上期各占一行 */
  .topbar-tools #refreshBtn {
    order: 1;
  }

  .topbar-tools .m-range {
    order: 2;
  }

  /* 本期 / 上期 两组区间 */
  .m-range {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: 100%;
  }

  .m-rlabel {
    flex: none;
    width: 26px;
    font-size: 11.5px;
    color: var(--text-3);
  }

  .m-dash {
    font-size: 11px;
    color: var(--text-3);
  }

  .m-range input[type="date"] {
    flex: 1 1 0;
    min-width: 0;
    height: 34px;
    padding: 0 6px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    outline: none;
  }

  .m-range input[type="date"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(10, 108, 255, 0.12);
  }

  /* 兜底：万一还有弹层，别超出屏幕 */
  .range-pop,
  .menu {
    left: auto;
    right: 0;
    max-width: calc(100vw - 24px);
  }
}

/* 补贴分析：三级指标缩进 */
.bm .bm-k3 {
  padding-left: 46px;
  font-size: 11.5px;
  color: var(--text-3);
}

.bm .bm-k4 {
  padding-left: 68px;
  font-size: 11.5px;
  color: var(--text-3);
}

/* 组标题行（带数值）对齐 */
.bm tr.bm-grp > .bm-g {
  min-width: 168px;
}

/* 补贴分析：二级指标折叠 */
.bm .bm-caret-blank {
  display: inline-block;
  width: 15px;
}

.bm tr.bm-exp:hover > .bm-k {
  background: rgba(10, 108, 255, 0.045);
}

.bm tr.bm-exp.off > .bm-k {
  color: var(--text-3);
}

/* 时段对比：本期 / 上期 / 涨幅 三行 */
.bm .bm-cell .bm-p {
  display: block;
  text-align: right;
  font-size: 10px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.bm .bm-cmp-h {
  min-width: 118px;
}

.bm .bm-cmp-h .bm-sub {
  font-size: 9.5px;
}

/* 时段对比：上期 / 本期 / 对比 三列 */
.bm .bm-cmp-h {
  text-align: center;
  border-left: 1px solid var(--line-strong);
}

.bm .bm-cmp-s {
  font-size: 10.5px;
  font-weight: 550;
  color: var(--text-3);
  text-align: right;
  min-width: 82px;
  background: var(--surface-2);
}

.bm .bm-v2 {
  text-align: right;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.bm .bm-v2c {
  color: var(--text);
  font-weight: 600;
  background: rgba(10, 108, 255, 0.035);
}

.bm .bm-df {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ============ 补贴问题商户池 ============ */
.pool-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 2px 12px;
  flex-wrap: wrap;
}

.pool-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pool-chip {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-2);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  transition: all 160ms ease;
}

.pool-chip b {
  color: var(--accent);
  font-weight: 650;
}

.pool-chip:hover {
  border-color: var(--accent);
}

.pool-chip.on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pool-chip.on b {
  color: #fff;
}

.bm .pk {
  text-align: left;
  font-size: 12px;
  padding: 8px 9px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.bm .pk-id {
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.bm .pk-wide {
  min-width: 200px;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bm .pz {
  font-size: 10.5px;
  color: var(--text-3);
  text-align: right;
  min-width: 76px;
  background: var(--surface-2);
}

.bm .pv {
  text-align: right;
  padding: 6px 9px;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.bm .pv b {
  display: block;
  font-weight: 600;
  color: var(--text);
  font-size: 12.5px;
}

.bm .pv span {
  display: block;
  font-size: 10.5px;
  color: var(--text-3);
}

.bm .pd {
  text-align: right;
  padding: 6px 9px;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.bm .pd.up { color: #2f7d3a; }
.bm .pd.down { color: #c0392b; }
.bm .pd.chg { color: var(--accent); }
.bm .pd.flat { color: var(--text-3); }

.pool-tag {
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 6px;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  color: #fff;
  margin-right: 3px;
}

.pool-tag.t1 { background: #e5484d; }
.pool-tag.t2 { background: #e8901a; }
.pool-tag.t3 { background: #7c5cff; }
.pool-tag.t4 { background: #0a6cff; }

/* 商户池：显式本期/上期筛选 */
.pool-range {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-2);
}

.pool-range label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.pool-range input[type="date"] {
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.pool-range input[type="date"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10, 108, 255, 0.12);
}
