/* 业绩PK作战大屏 — 工业实用风格：深墨蓝底、琥珀强调、等宽数字、发丝边框 */

:root {
  --bg: #080f17;
  --bg-2: #0d1723;
  --surface: #101d2a;
  --surface-2: #152536;
  --surface-3: #1b3043;
  --line: rgba(163, 198, 224, 0.14);
  --line-strong: rgba(163, 198, 224, 0.3);
  --text: #edf4f9;
  --muted: #93a9bb;
  --faint: #6c8497;
  --accent: #ffb020;
  --accent-soft: rgba(255, 176, 32, 0.14);
  --good: #3ddc97;
  --bad: #ff6b6b;
  --info: #63b3ff;
  --gold: #ffd166;
  --silver: #c9d5e0;
  --bronze: #d69b6c;

  --font-display: 'Barlow Condensed', 'Noto Sans SC', sans-serif;
  --font-body: 'Noto Sans SC', sans-serif;

  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-base: 14px;
  --fs-md: 18px;
  --fs-lg: 24px;
  --fs-xl: 32px;
  --fs-hero: 46px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 14px;
  --space-4: 20px;
  --space-5: 28px;
  --space-6: 44px;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;

  --shadow-1: 0 2px 10px rgba(0, 0, 0, 0.22);
  --shadow-2: 0 10px 30px rgba(0, 0, 0, 0.3);
  --shadow-3: 0 24px 70px rgba(0, 0, 0, 0.45);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 160ms;
  --dur-base: 320ms;
  --dur-slow: 640ms;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.7;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
}

/* 氛围层：渐变网格 + 细密栅格 + 颗粒 */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(52rem 34rem at 8% -8%, rgba(255, 176, 32, 0.11), transparent 62%),
    radial-gradient(46rem 38rem at 96% 2%, rgba(61, 220, 151, 0.08), transparent 58%),
    radial-gradient(40rem 30rem at 50% 100%, rgba(99, 179, 255, 0.06), transparent 65%),
    linear-gradient(var(--bg), var(--bg-2) 60%, var(--bg));
}
.atmosphere::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(163, 198, 224, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(163, 198, 224, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}
.atmosphere::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

.hidden { display: none !important; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: var(--space-5);
  min-height: 72px;
  padding: 10px clamp(16px, 3vw, 44px);
  background: rgba(8, 15, 23, 0.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.topbar::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -1px;
  height: 2px;
  width: 26%;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--bg);
  background: var(--accent);
  font-size: var(--fs-lg);
  font-weight: 900;
  clip-path: polygon(0 0, 100% 0, 100% 72%, 72% 100%, 0 100%);
}
.brand-copy { display: flex; flex-direction: column; line-height: 1.15; }
.brand-copy strong { font-size: 15px; letter-spacing: 0.08em; }
.brand-copy small {
  font-family: var(--font-display);
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--faint);
}

.filters { display: flex; gap: 10px; margin-left: auto; }
.filter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  white-space: nowrap;
}
.filter span { font-size: var(--fs-xs); color: var(--faint); letter-spacing: 0.12em; }
select, input {
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  color: var(--text);
  background: transparent;
  border: 0;
  outline: none;
}
select { cursor: pointer; padding-right: 4px; }
select option { background: var(--surface-2); color: var(--text); }
.filter select { min-width: 76px; font-weight: 700; }

.actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

.btn {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform var(--dur-fast) ease-out, background var(--dur-fast) ease-out,
    border-color var(--dur-fast) ease-out, color var(--dur-fast) ease-out;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--accent); color: #10151c; box-shadow: 0 6px 18px rgba(255, 176, 32, 0.18); }
.btn-primary:hover { background: #ffc457; }
.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--muted); }
.btn-ghost:hover { border-color: var(--line-strong); color: var(--text); background: var(--surface-2); }
.btn-icon { width: 38px; padding: 0; font-size: 18px; background: var(--surface); border-color: var(--line); color: var(--muted); }
.btn-mini { min-height: 28px; padding: 0 10px; font-size: var(--fs-xs); background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(255, 176, 32, 0.3); }
.btn-danger { background: transparent; border-color: rgba(255, 107, 107, 0.4); color: var(--bad); }
.btn-danger:hover { background: rgba(255, 107, 107, 0.12); }
.btn-danger-ghost { background: rgba(255, 107, 107, 0.08); border-color: rgba(255, 107, 107, 0.3); color: var(--bad); }
.link-btn { background: none; border: 0; color: var(--accent); font-size: var(--fs-xs); font-weight: 700; cursor: pointer; padding: 4px 6px; }
.link-btn:hover { text-decoration: underline; }

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

/* ---------- 页面主体 ---------- */
.app {
  position: relative;
  z-index: 1;
  max-width: 1840px;
  margin: 0 auto;
  padding: var(--space-5) clamp(16px, 3vw, 44px) var(--space-6);
}

/* ---------- 全局权限锁 ---------- */
.global-lock { position: fixed; inset: 72px 0 0; z-index: 55; display: grid; place-items: center; padding: 24px; background: rgba(8, 16, 25, .72); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.global-lock.hidden { display: none; }
.global-lock-card { width: min(420px, 100%); padding: 36px 30px; text-align: center; background: linear-gradient(160deg, rgba(22,40,58,.96), rgba(13,25,38,.98)); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: 0 24px 70px rgba(0,0,0,.5); }
.global-lock-card .gl-icon { font-size: 40px; line-height: 1; margin-bottom: 12px; }
.global-lock-card h2 { margin: 0 0 8px; font-size: 20px; color: var(--text); }
.global-lock-card p { margin: 0 0 20px; font-size: var(--fs-sm); color: var(--muted); }
.global-lock-card small { display: block; margin-top: 14px; font-size: var(--fs-xs); color: var(--faint); }
body.app-locked .kpi-row, body.app-locked .grid { filter: blur(9px); pointer-events: none; user-select: none; }
.login-form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.login-form .field input { width: 100%; }
.remember-row { display: flex; align-items: center; gap: 8px; font-size: var(--fs-xs); color: var(--muted); cursor: pointer; }
.remember-row input { accent-color: var(--accent); }
.wx-login-btn { min-height: 46px; font-size: 15px; font-weight: 700; letter-spacing: .04em; }
.wx-login-btn .wx-icon { font-size: 18px; }
.wx-login-note { margin: 12px 0 0; font-size: var(--fs-xs); color: var(--faint); line-height: 1.6; text-align: center; }
[data-perm].perm-hidden { display: none !important; }

/* 账号管理 */
.modal-lg { width: min(860px, 94vw); }
.user-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: var(--fs-sm); }
.user-row .u-name { font-weight: 700; color: var(--text); min-width: 90px; }
.user-row .u-role { padding: 2px 8px; border-radius: 99px; font-size: 10px; }
.user-row .u-role.super { background: var(--accent-soft); color: var(--accent); }
.user-row .u-role.normal { background: rgba(99,179,255,.14); color: var(--info); }
.user-row .u-perm { color: var(--muted); font-size: var(--fs-xs); flex: 1; }
.user-editor { border-top: 1px solid var(--line); padding-top: 16px; }
.user-editor h3 { margin: 0 0 12px; font-size: var(--fs-md); }
.user-basic { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.perm-block { margin-bottom: 16px; }
.perm-block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: var(--fs-sm); }
.perm-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 12px; }
.perm-item { display: flex; align-items: center; gap: 7px; font-size: var(--fs-xs); color: var(--text); cursor: pointer; }
.perm-item input { accent-color: var(--accent); }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: var(--space-4); }
.page-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(38px, 4.2vw, var(--fs-hero));
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.03em;
}
.page-head h1 span { color: var(--accent); margin-left: 8px; }
.page-sub { margin: 8px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.head-right { display: flex; align-items: center; gap: 9px; color: var(--muted); font-family: var(--font-display); font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 5px rgba(61, 220, 151, 0.12); animation: pulse 2.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(61, 220, 151, 0); } }

.demo-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: var(--space-4);
  padding: 10px 16px;
  border: 1px dashed rgba(255, 176, 32, 0.45);
  border-radius: var(--radius-sm);
  background: rgba(255, 176, 32, 0.06);
  color: var(--muted);
  font-size: var(--fs-sm);
}
.demo-banner strong { color: var(--accent); }

/* ---------- KPI ---------- */
.kpi-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi {
  position: relative;
  overflow: hidden;
  padding: 16px 18px 14px;
  background: linear-gradient(150deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
}
.kpi::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--accent);
  opacity: 0.8;
}
.kpi:nth-child(3)::before { background: var(--good); }
.kpi:nth-child(4)::before { background: var(--info); }
.kpi-label { color: var(--muted); font-size: var(--fs-xs); letter-spacing: 0.1em; }
.kpi-label-mvp { font-size: 15px; letter-spacing: 0.06em; }
.mvp-gold { color: var(--gold); font-family: var(--font-display); font-size: 1.18em; font-weight: 700; letter-spacing: 0.04em; text-shadow: 0 0 12px rgba(255, 209, 102, 0.28); }
.kpi-value {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.kpi-value small { font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 500; color: var(--faint); }
.kpi-foot { margin-top: 4px; font-size: var(--fs-xs); color: var(--faint); }
.kpi-foot b { color: var(--text); font-weight: 700; }
.kpi-foot-leaders { display: flex; flex-direction: column; gap: 3px; line-height: 1.5; }
.lead-dept { display: inline-block; min-width: 30px; padding: 1px 5px; border-radius: 4px; font-size: 10px; font-weight: 700; }
.kpi-value:empty { display: none; }
.pk-bonus-label-field { margin-bottom: 12px; }
.chip { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; }
.chip-up { background: rgba(61, 220, 151, 0.14); color: var(--good); }
.chip-down { background: rgba(255, 107, 107, 0.14); color: var(--bad); }
.chip-flat { background: rgba(163, 198, 224, 0.12); color: var(--muted); }

/* ---------- 卡片网格 ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.card {
  position: relative;
  min-width: 0;
  padding: 18px 20px 20px;
  background: linear-gradient(160deg, rgba(21, 37, 54, 0.92), rgba(13, 23, 35, 0.94));
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2);
  backdrop-filter: blur(8px);
}
.card::before, .card::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: var(--accent);
  opacity: 0.55;
  pointer-events: none;
}
.card::before { top: -1px; left: -1px; border-top: 2px solid; border-left: 2px solid; }
.card::after { bottom: -1px; right: -1px; border-bottom: 2px solid; border-right: 2px solid; }
.year-rank-col { grid-column: span 3; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.year-rank-card, .month-rank-card { grid-column: span 3; display: flex; flex-direction: column; }
.year-rank-col .year-rank-card { grid-column: auto; flex: 1; min-height: 0; }
.year-rank-col .rank-list-tall { max-height: none; }
.year-rank-col .rank-rate { font-size: 11px; font-weight: 600; }
.rank-list-tall { flex: 1; }
.rank-summary { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-strong); display: flex; flex-direction: column; gap: 5px; font-size: var(--fs-xs); color: var(--muted); }
.rank-summary b { color: var(--text); font-family: var(--font-display); font-size: 15px; font-weight: 700; }
.rank-summary .hi { color: var(--accent); }
.map-card { grid-column: span 6; }
.map-card .map-wrap { grid-template-columns: minmax(0, 1fr) 132px; }
.map-card .map-stage { height: 428px; }
.year-compare, .person-year-compare { grid-column: span 12; }
.chart-card { grid-column: span 4; }
.chart-card.chart-wide { grid-column: span 12; }
/* 管理员布局编辑：卡片拖动排序 */
.card-drag-handle { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; margin-right: 8px; font-size: 11px; color: var(--accent); background: rgba(255,176,32,.08); border: 1px dashed var(--accent); border-radius: var(--radius-sm); cursor: grab; user-select: none; white-space: nowrap; }
.card-drag-handle:active { cursor: grabbing; }
.layout-editing .grid > * { outline: 1px dashed rgba(255,176,32,.4); outline-offset: 2px; }
.layout-editing .grid > *:hover { outline-color: var(--accent); }
.grid > *.dragging { opacity: .45; outline: 2px solid var(--accent); }
.chart-sm { height: 260px; }
.rank-list-tall { max-height: 430px; }
.pk-compact th, .pk-compact td { padding: 9px 7px; }
.pk-compact .pk-table { font-size: var(--fs-xs); }

.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; min-height: 46px; }
.eyebrow { display: block; font-family: var(--font-display); font-size: 10px; letter-spacing: 0.24em; color: var(--accent); }
.card-head h2 { margin: 2px 0 0; font-size: var(--fs-md); font-weight: 700; letter-spacing: 0.02em; }
.card-note { font-size: var(--fs-xs); color: var(--faint); padding-top: 10px; text-align: right; }
.inline-select select { padding: 4px 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: var(--fs-xs); }

.chart { width: 100%; }
.chart-md { height: 268px; }
.chart-fallback { display: grid; place-items: center; height: 100%; color: var(--faint); font-size: var(--fs-sm); }
.chart-lock-wrap { position: relative; }
.chart-lock { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: linear-gradient(160deg, rgba(21,37,54,.92), rgba(13,25,38,.96)); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); color: var(--muted); text-align: center; }
.chart-lock.hidden { display: none; }
.chart-lock .lock-icon { font-size: 26px; line-height: 1; }
.chart-lock strong { font-size: var(--fs-sm); color: var(--text); }
.chart-lock span { font-size: var(--fs-xs); color: var(--faint); }

/* ---------- 排行榜 ---------- */
.rank-list { display: flex; flex-direction: column; gap: 9px; max-height: 268px; overflow-y: auto; padding-right: 4px; }
.rank-list::-webkit-scrollbar, .city-list::-webkit-scrollbar, .roster-list::-webkit-scrollbar { width: 5px; }
.rank-list::-webkit-scrollbar-thumb, .city-list::-webkit-scrollbar-thumb, .roster-list::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 4px; }
.rank-row { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 10px; }
.rank-no {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-3);
  border-radius: 4px;
}
.rank-row:nth-child(1) .rank-no { background: var(--gold); color: #171206; }
.rank-row:nth-child(2) .rank-no { background: var(--silver); color: #171206; }
.rank-row:nth-child(3) .rank-no { background: var(--bronze); color: #171206; }
.rank-main { min-width: 0; }
.rank-top { display: flex; justify-content: space-between; gap: 8px; font-size: var(--fs-xs); margin-bottom: 4px; }
.rank-name { font-weight: 700; color: var(--text); white-space: nowrap; }
.rank-team { color: var(--faint); font-size: 10px; margin-left: 6px; }
.rank-rate { font-family: var(--font-display); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.rank-track { height: 5px; background: rgba(163, 198, 224, 0.1); border-radius: 3px; overflow: hidden; }
.rank-fill { height: 100%; border-radius: 3px; background: var(--info); transform-origin: left; animation: growX 700ms var(--ease) both; }
.rank-fill.good { background: var(--good); }
.rank-fill.over { background: var(--accent); }
.rank-amount { font-family: var(--font-display); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
@keyframes growX { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- 地图 ---------- */
.map-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 14px; }
.map-stage { position: relative; min-width: 0; height: 392px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: #0c1824; }
#mapBox { position: absolute; inset: 0; width: 100%; height: 100%; }
.map-fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--muted); font-size: var(--fs-sm); background: var(--surface); }
#mapBox.schematic { background: radial-gradient(circle at 50% 45%, rgba(99,179,255,.10), transparent 62%), #0c1824; }
.schematic-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(163,198,224,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(163,198,224,.06) 1px, transparent 1px); background-size: 32px 32px; mask-image: radial-gradient(circle at 50% 50%, #000 30%, transparent 88%); }
.schematic-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); font-size: var(--fs-sm); }
.city-dot { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 2px 6px; border: 0; background: transparent; color: var(--text); cursor: pointer; z-index: 2; }
.city-dot i { display: block; border-radius: 50%; border: 1px solid rgba(255,255,255,.7); box-shadow: 0 0 14px rgba(99,179,255,.45); transition: transform .18s ease; }
.city-dot span { font-size: 10px; line-height: 1; white-space: nowrap; color: #d7e8f5; text-shadow: 0 1px 3px #000; }
.city-dot:hover i, .city-dot.active i { transform: scale(1.28); background: var(--gold) !important; box-shadow: 0 0 18px rgba(255,209,102,.7); }
.city-info { position: absolute; left: 12px; bottom: 12px; z-index: 3; min-width: 170px; max-width: 78%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: rgba(10,22,34,.94); box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.city-info b { display: block; font-size: 13px; }
.city-info strong { display: block; margin: 2px 0; color: var(--gold); font-family: var(--font-display); font-size: 20px; }
.city-info small { display: block; color: var(--muted); font-size: 10px; line-height: 1.4; }
.city-panel { display: flex; flex-direction: column; min-height: 0; }
.city-panel-title { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--muted); letter-spacing: 0.08em; padding: 0 2px 8px; border-bottom: 1px solid var(--line); }
.city-panel-title span { color: var(--accent); font-family: var(--font-display); font-weight: 700; }
.city-list { flex: 1; overflow-y: auto; padding: 6px 2px 0; }
.city-item { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 7px 2px; border-bottom: 1px dashed var(--line); font-size: var(--fs-xs); }
.city-item b { font-weight: 700; }
.city-item span { color: var(--muted); font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.city-bar { grid-column: 1 / -1; height: 3px; background: rgba(163, 198, 224, 0.1); border-radius: 2px; overflow: hidden; }
.city-bar i { display: block; height: 100%; background: var(--accent); }

/* ---------- PK 表格 ---------- */
.table-wrap { overflow-x: auto; }
.pk-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.pk-table th {
  padding: 10px 12px;
  text-align: left;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--faint);
  letter-spacing: 0.08em;
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}
.pk-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.pk-table tbody tr { transition: background var(--dur-fast) ease-out; }
.pk-table tbody tr:hover { background: rgba(163, 198, 224, 0.05); }
.pk-table .num { text-align: right; font-family: var(--font-display); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pk-table th.num { font-family: var(--font-body); font-size: var(--fs-xs); }
.pk-table .medal { font-family: var(--font-display); font-size: 16px; font-weight: 700; width: 28px; }
.pk-table .who { font-weight: 700; white-space: nowrap; }
.pk-table .team-cell { color: var(--muted); white-space: nowrap; }
.pk-progress { min-width: 130px; }
.pk-progress .track { height: 6px; background: rgba(163, 198, 224, 0.1); border-radius: 3px; overflow: hidden; }
.pk-progress .fill { height: 100%; border-radius: 3px; background: var(--info); transition: width var(--dur-base) var(--ease); }
.pk-progress .fill.good { background: var(--good); }
.pk-progress .fill.over { background: var(--accent); }
.pk-progress .pct { font-family: var(--font-display); font-size: 12px; color: var(--muted); }
.status { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
.s-excellent { background: rgba(255, 176, 32, 0.16); color: var(--accent); }
.s-prime { background: rgba(99, 179, 255, 0.14); color: var(--info); }
.s-good { background: rgba(61, 220, 151, 0.14); color: var(--good); }
.s-near { background: rgba(99, 179, 255, 0.14); color: var(--info); }
.s-low { background: rgba(255, 107, 107, 0.14); color: var(--bad); }
.empty-row td { padding: 34px; text-align: center; color: var(--faint); }

.foot { margin-top: var(--space-5); text-align: center; color: var(--faint); font-size: var(--fs-xs); letter-spacing: 0.08em; }

/* ---------- 弹层 ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(4, 9, 15, 0.78);
  backdrop-filter: blur(6px);
}
.modal.open { display: grid; animation: fadeIn var(--dur-base) var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-panel {
  width: min(720px, 100%);
  max-height: min(90vh, 860px);
  overflow-y: auto;
  padding: 24px 26px;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  animation: slideUp var(--dur-base) var(--ease) both;
}
.modal-panel.modal-sm { width: min(560px, 100%); }
@keyframes slideUp { from { opacity: 0; transform: translateY(22px) scale(0.985); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 18px; }
.modal-head h2 { margin: 2px 0 0; font-size: 22px; }
.modal-close { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.modal-close:hover { color: var(--text); border-color: var(--line-strong); }
.modal-hint { margin: 0 0 16px; color: var(--muted); font-size: var(--fs-sm); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span, .field-label-row > span { color: var(--muted); font-size: var(--fs-xs); letter-spacing: 0.06em; }
.field input, .field select {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  color: var(--text);
}
.field input:focus, .field select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 2px var(--accent-soft); }
.field-full { grid-column: 1 / -1; }
.field-label-row { display: flex; justify-content: space-between; align-items: center; }
.city-rows { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.city-row { display: grid; grid-template-columns: 1fr 140px 34px; gap: 8px; align-items: center; }
.city-row button { min-height: 36px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: transparent; color: var(--faint); cursor: pointer; }
.city-row button:hover { color: var(--bad); border-color: rgba(255, 107, 107, 0.4); }
.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.spacer { flex: 1; }

.roster-add { display: grid; grid-template-columns: 1fr 1fr 88px auto; gap: 8px; margin-bottom: 10px; }
.roster-add input, .roster-add select { min-height: 40px; padding: 0 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text); }
.dept-select { min-height: 30px; padding: 0 6px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text); font-size: var(--fs-xs); }
.roster-list { display: flex; flex-direction: column; }
.roster-row { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px solid var(--line); font-size: var(--fs-sm); }
.roster-row .avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--surface-3); color: var(--accent); font-size: var(--fs-xs); font-weight: 700; }
.roster-row .rname { font-weight: 700; }
.roster-row .rteam { color: var(--muted); }
.roster-row .spacer { flex: 1; }
.roster-row button { border: 0; background: transparent; color: var(--faint); cursor: pointer; font-size: var(--fs-xs); }
.roster-row button:hover { color: var(--bad); }

/* 管理员后台设置 */
.admin-section { margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.admin-section:last-of-type { border-bottom: 0; margin-bottom: 8px; }
.admin-section h3 { margin: 0 0 6px; font-size: var(--fs-md); color: var(--text); }
.admin-section .modal-hint { margin-bottom: 10px; }
.hide-name-tools { display: flex; gap: 14px; margin-bottom: 8px; }
.hide-name-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 12px; max-height: 190px; overflow-y: auto; padding: 4px 2px; }
.hide-name-item { display: flex; align-items: center; gap: 7px; font-size: var(--fs-xs); color: var(--text); cursor: pointer; }
.hide-name-item input { accent-color: var(--accent); }
.hide-name-item small { color: var(--faint); }
.amount-tier-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.amount-tier-grid input { width: 100%; }

.tier-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.tier-row { display: grid; grid-template-columns: 76px 60px 1fr 34px 56px; gap: 6px; align-items: center; font-size: var(--fs-xs); color: var(--muted); }
.tier-row input { width: 100%; min-height: 36px; padding: 0 8px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.rank-bonus { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--muted); }
.rank-bonus-inputs { display: flex; gap: 8px; }
.rank-bonus-inputs input { width: 56px; min-height: 36px; text-align: center; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.pk-rule-dept { padding: 12px; margin-bottom: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.pk-rule-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 13px; color: var(--text); }
.pk-rule-list { display: flex; flex-direction: column; gap: 6px; }
.pk-rule-row { display: grid; grid-template-columns: 1fr 1fr 1fr 30px; gap: 6px; align-items: center; }
.pk-rule-row input { width: 100%; min-height: 36px; padding: 0 8px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text); }
.pk-rule-row button { color: var(--faint); }
.pk-rule-row button:hover { color: var(--bad); }

.io-actions { display: flex; flex-direction: column; gap: 10px; }
.io-actions .btn { width: 100%; }
.file-label { display: grid; place-items: center; cursor: pointer; }
.io-danger { display: flex; align-items: center; gap: 12px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.io-danger small { color: var(--faint); font-size: var(--fs-xs); }

.toast {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 20px);
  padding: 10px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text);
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-2);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 入场序列 ---------- */
.reveal { opacity: 0; transform: translateY(18px); }
.reveal.in { opacity: 1; transform: none; transition: opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease); }
.reveal:nth-of-type(2) { transition-delay: 70ms; }
.reveal:nth-of-type(3) { transition-delay: 140ms; }
.reveal:nth-of-type(4) { transition-delay: 210ms; }
.reveal:nth-of-type(5) { transition-delay: 280ms; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- 个人进展 ---------- */
.progress-card { grid-column: span 12; }
.matrix-scroll { overflow-x: auto; margin-bottom: 14px; padding-bottom: 4px; max-height: 620px; overflow-y: auto; }
.progress-matrix { width: 100%; min-width: 980px; border-collapse: separate; border-spacing: 4px; font-size: var(--fs-xs); }
.progress-matrix th, .progress-matrix td { padding: 0; text-align: center; white-space: nowrap; }
.progress-matrix thead th { position: sticky; top: 0; z-index: 3; color: var(--muted); font-size: 11px; font-weight: 600; padding: 4px 2px; background: var(--bg-2); }
.progress-matrix thead tr:nth-child(2) th { top: 24px; }
.progress-matrix .matrix-year-head th { top: 0; z-index: 5; padding: 5px 8px; text-align: left; color: var(--accent); background: var(--accent-soft) !important; border-radius: var(--radius-sm); font-family: var(--font-display); font-size: 13px; letter-spacing: 0.08em; }
.progress-matrix thead th small { display: block; font-size: 9px; font-weight: 500; color: var(--faint); }
.progress-matrix .matrix-period-head, .progress-matrix .matrix-period { position: sticky; left: 0; z-index: 2; min-width: 62px; color: var(--text); background: var(--bg-2); }
.progress-matrix .matrix-period-head { z-index: 4; }
.progress-matrix .matrix-period { padding: 6px 8px; text-align: left; border: 1px solid var(--line); border-radius: var(--radius-sm); font-weight: 700; }
.matrix-year-row th { position: sticky; left: 0; z-index: 2; padding: 8px 10px !important; text-align: left !important; color: var(--accent); background: var(--accent-soft) !important; border-radius: var(--radius-sm); font-family: var(--font-display); font-size: 13px; letter-spacing: 0.08em; }
.matrix-cell {
  display: block; width: 100%; min-width: 58px; padding: 7px 4px; cursor: pointer;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--text); font-family: var(--font-display); font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
  transition: border-color var(--dur-fast) ease-out, background var(--dur-fast) ease-out, transform var(--dur-fast) ease-out;
}
.matrix-cell:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.matrix-cell.cell-active, .matrix-foot.cell-active { border-color: var(--accent); background: var(--accent-soft); }
.cell-hit { color: var(--good); }
.cell-near { color: var(--info); }
.cell-miss { color: var(--accent); }
.cell-none { color: var(--faint); }
.matrix-total, .matrix-foot { padding: 7px 4px; min-width: 62px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); font-family: var(--font-display); font-weight: 700; font-variant-numeric: tabular-nums; }
.matrix-total.dept-taobao, .matrix-foot.dept-taobao, thead th.dept-taobao { color: var(--accent); }
.matrix-total.dept-business, .matrix-foot.dept-business, thead th.dept-business { color: var(--info); }
.matrix-total.dept-media, .matrix-foot.dept-media, thead th.dept-media { color: #c792ea; }
.matrix-total.dept-all, .matrix-foot.dept-all, thead th.dept-all { color: var(--good); }
.progress-matrix tfoot th { position: sticky; left: 0; z-index: 2; padding: 6px 8px; text-align: left; color: var(--muted); background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.progress-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.progress-tools .btn-mini { min-height: 32px; }
.progress-body { display: block; }
.progress-body .matrix-scroll { margin-bottom: 0; }
.modal-people-list { max-height: 300px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2); }
.modal-people-list .people-row { grid-template-columns: 20px minmax(0, 1fr) 90px 44px 40px; }
.people-add-row { display: grid; grid-template-columns: minmax(0, 1fr) 92px auto; gap: 6px; margin-bottom: 8px; }
.people-add-row input, .people-add-row select { width: 100%; min-width: 0; padding: 5px 6px; font-size: 11px; color: var(--text); background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.progress-side { position: sticky; top: 14px; max-height: 620px; display: flex; flex-direction: column; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-2); }
.side-head { display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.side-head strong { font-size: 13px; color: var(--text); }
.side-note, .side-hint { color: var(--faint); font-size: 10px; line-height: 1.5; }
.side-hint { margin: 8px 0; }
.side-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; padding-right: 2px; }
.people-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) 78px 44px 36px; align-items: center; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2); }
.people-row.dragging { opacity: .45; }
.people-handle { cursor: grab; color: var(--faint); font-size: 12px; text-align: center; }
.people-label { display: flex; align-items: center; gap: 5px; min-width: 0; font-size: 11px; color: var(--text); }
.people-label input { accent-color: var(--accent); }
.people-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people-dept { width: 100%; min-width: 0; padding: 3px 2px; font-size: 10px; color: var(--muted); background: var(--bg-1); border: 1px solid var(--line); border-radius: 4px; }
.people-move { display: flex; flex-direction: column; gap: 2px; }
.people-move button { padding: 0; width: 18px; height: 15px; line-height: 13px; font-size: 10px; color: var(--muted); background: var(--surface-1); border: 1px solid var(--line); border-radius: 3px; cursor: pointer; }
.people-move button:hover { color: var(--accent); border-color: var(--accent); }
.people-edit { display: flex; flex-direction: column; gap: 2px; }
.people-edit button { padding: 0; width: 18px; height: 15px; line-height: 13px; font-size: 10px; color: var(--muted); background: var(--surface-1); border: 1px solid var(--line); border-radius: 3px; cursor: pointer; }
.people-edit button:hover { color: var(--accent); border-color: var(--accent); }
.people-edit button[data-del-person]:hover { color: var(--bad); border-color: var(--bad); }
.side-actions { display: flex; align-items: center; gap: 8px; padding-top: 8px; margin-top: 8px; border-top: 1px solid var(--line); }
.cell-detail-summary { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); font-size: var(--fs-xs); color: var(--muted); }
.cell-detail-summary strong { color: var(--accent); font-family: var(--font-display); }
.cell-detail-list { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.cell-detail-row { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg-2); font-size: var(--fs-xs); }
.cell-detail-row .detail-date { color: var(--text); font-family: var(--font-display); font-weight: 700; }
.cell-detail-row .detail-note { color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-detail-row .detail-amount { color: var(--good); font-family: var(--font-display); font-weight: 700; }
.cell-detail-empty { padding: 24px 10px; text-align: center; color: var(--faint); font-size: 12px; }
.progress-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; }
.chart-progress { height: 300px; }
.progress-timeline { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--line); padding-left: 16px; }
.timeline-title { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--muted); letter-spacing: 0.08em; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.timeline-title span { color: var(--accent); font-family: var(--font-display); font-weight: 700; }
.timeline-list { flex: 1; overflow-y: auto; max-height: 270px; padding-top: 6px; }
.timeline-row { display: grid; grid-template-columns: 52px 1fr auto 44px; align-items: center; gap: 8px; padding: 8px 2px; border-bottom: 1px dashed var(--line); font-size: var(--fs-xs); }
.timeline-ops { display: flex; gap: 6px; justify-content: flex-end; }
.timeline-ops button { font-size: 11px; }
.timeline-ops button[data-edit-progress]:hover, .detail-ops button[data-edit-detail]:hover { color: var(--accent); }
.detail-ops { display: flex; gap: 8px; }
.timeline-date { color: var(--muted); font-family: var(--font-display); font-size: 12px; }
.timeline-note { color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline-amount { font-family: var(--font-display); font-size: 14px; font-weight: 700; color: var(--good); font-variant-numeric: tabular-nums; white-space: nowrap; }
.timeline-row button { border: 0; background: transparent; color: var(--faint); cursor: pointer; font-size: 14px; }
.timeline-row button:hover { color: var(--bad); }
.timeline-sum { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line-strong); font-size: var(--fs-xs); color: var(--muted); }
.timeline-sum strong { font-family: var(--font-display); font-size: 18px; color: var(--accent); }

/* ---------- 响应式 ---------- */
@media (max-width: 1380px) {
  .topbar { flex-wrap: wrap; gap: 12px; }
  .filters { margin-left: 0; order: 3; width: 100%; }
  .actions { margin-left: auto; }
  .year-rank-col, .year-rank-card, .month-rank-card, .map-card { grid-column: span 12; }
  .year-rank-col { flex-direction: row; flex-wrap: wrap; }
  .year-rank-col .year-rank-card { flex: 1 1 320px; }
  .map-card .map-wrap { grid-template-columns: minmax(0, 1fr) 210px; }
  .progress-wrap { grid-template-columns: 1fr; }
  .progress-body { grid-template-columns: 1fr; }
  .progress-side { position: static; max-height: none; }
  .progress-timeline { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; padding-top: 12px; }
  .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-card { grid-column: span 6; }
  .chart-card.chart-wide { grid-column: span 12; }
}
@media (max-width: 760px) {
  .page-head { align-items: flex-start; }
  .kpi-row { grid-template-columns: 1fr; }
  .map-wrap { grid-template-columns: 1fr; }
  .map-stage, .map-card .map-stage { height: 320px; }
  .map-card .map-wrap { grid-template-columns: 1fr; }
  .city-panel { max-height: 200px; }
  .form-grid { grid-template-columns: 1fr; }
  .city-row { grid-template-columns: 1fr 100px 34px; }
  .roster-add { grid-template-columns: 1fr 1fr 88px; }
  .roster-add .btn { grid-column: 1 / -1; }
  .tier-row { grid-template-columns: 62px 52px 1fr 28px 48px; }
  .actions .btn-ghost { padding: 0 8px; }
  .modal-panel { padding: 18px; }
}

/* 修改记录 */
.log-list { max-height: 460px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 2px; }
.log-row { padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); background: var(--bg-2); }
.log-row.log-del { border-left-color: var(--bad); }
.log-row.log-edit { border-left-color: var(--warn, #e0a800); }
.log-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--faint); }
.log-action { font-weight: 700; color: var(--text); }
.log-actor { color: var(--accent); }
.log-summary { margin-top: 4px; font-size: 12px; color: var(--text); }
.log-before { margin-top: 3px; font-size: 11px; color: var(--faint); }
.log-ops { margin-top: 6px; }

/* ---------- 手机端适配 ---------- */
@media (max-width: 760px) {
  html, body { overflow-x: hidden; -webkit-text-size-adjust: 100%; }
  .topbar { min-height: 104px; padding: 10px 12px; gap: 10px; }
  .brand { gap: 8px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand-copy strong { font-size: 13px; }
  .brand-copy small { font-size: 8px; letter-spacing: 0.18em; }
  .filters {
    order: 3;
    width: 100%;
    margin-left: 0;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
  }
  .filters::-webkit-scrollbar { display: none; }
  .filter { flex: 1 0 104px; min-width: 104px; padding: 5px 8px; gap: 4px; }
  .filter span { font-size: 10px; }
  .filter select { min-width: 0; width: 100%; font-size: 12px; }
  .actions { gap: 4px; }
  .actions .btn { min-height: 34px; padding: 0 8px; }

  .app { padding: 14px 12px calc(28px + env(safe-area-inset-bottom)); }
  .page-head { align-items: flex-start; gap: 6px; }
  .page-head h2 { font-size: 26px; }
  .page-head .clock { font-size: 19px; }
  .page-head .sub { font-size: 11px; }

  .kpi-row { gap: 10px; }
  .kpi { padding: 14px; }
  .kpi-value { font-size: 28px; }
  .kpi-foot-leaders { font-size: 10px; }

  .grid { gap: 12px; }
  .grid > * { grid-column: span 12 !important; }
  .card { padding: 14px; }
  .card-head { flex-wrap: wrap; gap: 6px; }
  .card-head h2 { font-size: 16px; }
  .card-note { padding-top: 0; text-align: left; }

  .year-rank-col, .year-rank-col .year-rank-card { flex-direction: column; }
  .year-rank-card, .month-rank-card { min-width: 0; }
  .rank-list { max-height: 240px; gap: 7px; }
  .rank-row { grid-template-columns: 22px minmax(0, 1fr) auto; gap: 7px; }

  .map-wrap, .map-card .map-wrap { grid-template-columns: 1fr; gap: 10px; }
  .map-stage, .map-card .map-stage { height: 260px; }
  .city-panel { max-height: 180px; }
  .city-info { max-width: 92%; min-width: 0; }

  .chart-sm, .chart-md, .chart-progress { height: 230px; }
  .chart-card.chart-wide .chart-sm,
  .chart-card.chart-wide .chart-md,
  .chart-card.chart-wide .chart-progress { height: 260px; }

  .table-wrap, .matrix-scroll { -webkit-overflow-scrolling: touch; }
  .progress-matrix { min-width: 760px; font-size: 11px; }
  .progress-wrap, .progress-body { gap: 12px; }
  .progress-side { position: static; }
  .timeline-list { max-height: 240px; }
  .timeline-row { grid-template-columns: 46px minmax(0, 1fr) auto; gap: 6px; font-size: 11px; }

  .global-lock { inset: 104px 0 0; padding: 16px; }
  .global-lock-card { padding: 28px 20px; }
  .global-lock-card h2 { font-size: 18px; }
  .login-form { gap: 10px; }
  .btn { min-height: 40px; }
  .btn-mini, .btn-icon { min-height: 34px; }

  .modal { padding: 10px; }
  .modal-panel { max-height: calc(100vh - 20px); padding: 16px; }
  .modal-head h2 { font-size: 18px; }
  .form-actions { flex-wrap: wrap; gap: 8px; }
  .perm-grid, .hide-name-list, .amount-tier-grid { grid-template-columns: 1fr 1fr; }
  .user-basic, .form-grid { grid-template-columns: 1fr; }
  .roster-add { grid-template-columns: 1fr 1fr; }
  .roster-add .btn { grid-column: 1 / -1; }
  .tier-row { grid-template-columns: 58px 48px minmax(0, 1fr) 28px; }
  .tier-row .tier-bonus { grid-column: 1 / -1; }
  .pk-rule-row { grid-template-columns: 1fr 1fr 28px; }
  .pk-rule-row > :nth-child(3) { grid-column: 1 / -1; }
  .cell-detail-row { grid-template-columns: 74px minmax(0, 1fr) auto; }
  .cell-detail-row .detail-note { grid-column: 1 / -1; }
  .log-list { max-height: 340px; }
}

@media (max-width: 420px) {
  .topbar { min-height: 100px; }
  .filter span { display: none; }
  .filter { flex: 1 1 0; min-width: 0; justify-content: center; }
  .page-head h2 { font-size: 23px; }
  .page-head .clock { font-size: 17px; }
  .kpi-value { font-size: 25px; }
  .chart-sm, .chart-md, .chart-progress { height: 210px; }
  .chart-card.chart-wide .chart-sm,
  .chart-card.chart-wide .chart-md,
  .chart-card.chart-wide .chart-progress { height: 230px; }
  .map-stage, .map-card .map-stage { height: 240px; }
  .global-lock { inset: 100px 0 0; }
}
