/* DR 可视化展馆 · 深色紫蓝光效主题 */
:root {
  --bg: #08080f;
  --bg-2: #0c0d1a;
  --panel: rgba(18, 20, 40, 0.62);
  --panel-strong: rgba(22, 24, 48, 0.86);
  --line: rgba(140, 120, 255, 0.14);
  --line-strong: rgba(150, 130, 255, 0.32);
  --violet: #8b6cff;
  --violet-soft: #a58bff;
  --blue: #4d8bff;
  --cyan: #43d9ff;
  --text: #e9ecff;
  --text-dim: #9aa2c9;
  --text-faint: #6b7299;
  --good: #4be0b4;
  --warn: #ffc65c;
  --bad: #ff6b8a;
  --radius: 16px;
  --shadow-glow: 0 0 0 1px rgba(140,120,255,0.18), 0 14px 44px rgba(80, 60, 200, 0.22);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
  letter-spacing: .2px;
}

#bg-canvas {
  position: fixed; inset: 0;
  width: 100vw; height: 100vh;
  z-index: 0; pointer-events: none;
  opacity: .9;
}
.vignette {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(1200px 700px at 75% -10%, rgba(90, 60, 220, .16), transparent 60%),
    radial-gradient(1000px 640px at 8% 110%, rgba(40, 140, 255, .12), transparent 60%),
    radial-gradient(900px 600px at 50% 50%, transparent 40%, rgba(0,0,0,.42) 100%);
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  height: 60px;
  display: flex; align-items: center; gap: 26px;
  padding: 0 24px;
  background: linear-gradient(180deg, rgba(10,10,22,.92), rgba(10,10,22,.55));
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 12px var(--cyan), 0 0 26px rgba(67,217,255,.6);
  animation: pulse 2.4s ease-in-out infinite;
}
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.brand-sub { font-size: 12px; color: var(--text-faint); border-left: 1px solid var(--line-strong); padding-left: 10px; }
.company-badge {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px; letter-spacing: .5px; color: var(--text-dim); white-space: nowrap;
  padding: 5px 12px; border-radius: 20px;
  background: linear-gradient(180deg, rgba(140,120,255,.10), rgba(77,139,255,.05));
  border: 1px solid rgba(160,140,255,.22);
}
.cb-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--violet-soft);
  box-shadow: 0 0 8px var(--violet-soft);
}

.tabs { display: flex; gap: 4px; flex: 1; }
.tab {
  position: relative;
  padding: 9px 20px; border-radius: 10px;
  color: var(--text-dim); text-decoration: none; font-size: 14px; font-weight: 600;
  transition: color .18s, background .18s, box-shadow .18s;
}
.tab:hover { color: var(--text); background: rgba(140,120,255,.08); }
.tab.active {
  color: #fff;
  background: linear-gradient(180deg, rgba(140,120,255,.22), rgba(77,139,255,.12));
  box-shadow: inset 0 0 0 1px rgba(160,140,255,.35), 0 0 20px rgba(120,90,255,.25);
}

.meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-faint); white-space: nowrap; }
.exit-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 600;
  color: var(--text-dim); text-decoration: none;
  background: rgba(255,255,255,.04); border: 1px solid var(--line);
  transition: all .15s; white-space: nowrap;
}
.exit-btn:hover { color: #fff; background: rgba(255,107,138,.16); border-color: var(--bad); }

/* 常驻浮动退出按钮 */
.exit-float {
  position: fixed; right: 22px; bottom: 22px; z-index: 1200;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 11px 18px; border-radius: 999px;
  background: rgba(20,22,44,.92); border: 1px solid rgba(160,140,255,.45);
  color: #e9ecff; text-decoration: none; font-size: 13px; font-weight: 700;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px rgba(0,0,0,.5), 0 0 22px rgba(120,90,255,.3);
  transition: all .16s;
}
.exit-float:hover { background: rgba(255,107,138,.22); border-color: #ff6b8a; transform: translateY(-2px); }

/* 退出回门面：模糊淡出 */
body.leaving .app, body.leaving .topbar {
  filter: blur(14px); opacity: 0;
  transition: filter .36s ease, opacity .36s ease;
}
.meta-live { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); }

/* ---------- 主区 ---------- */
.app {
  position: relative; z-index: 2;
  height: calc(100vh - 60px);
  margin-top: 60px;
  overflow-y: auto;
  scroll-behavior: smooth;
  padding: 22px 26px 60px;
  scrollbar-width: thin;
  scrollbar-color: rgba(140,120,255,.35) transparent;
}
.app::-webkit-scrollbar { width: 8px; }
.app::-webkit-scrollbar-thumb { background: rgba(140,120,255,.28); border-radius: 8px; }

.view { animation: fadein .4s ease both; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 通用卡片 ---------- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-glow);
}
.card h3 { margin: 0 0 4px; font-size: 15px; font-weight: 700; }
.card .sub { margin: 0 0 14px; font-size: 12px; color: var(--text-faint); }

.section-title { font-size: 20px; font-weight: 700; margin: 6px 0 2px; }
.section-desc { font-size: 13px; color: var(--text-dim); margin: 0 0 18px; }

/* ---------- 指标卡 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.stat {
  position: relative; overflow: hidden;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-glow);
}
.stat .k { font-size: 12px; color: var(--text-dim); letter-spacing: .6px; }
.stat .v { font-size: 30px; font-weight: 800; margin-top: 6px; line-height: 1; }
.stat .v small { font-size: 15px; font-weight: 600; color: var(--text-dim); margin-left: 3px; }
.stat .tag { margin-top: 8px; font-size: 12px; }
.stat::after {
  content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(140,120,255,.25), transparent 65%);
}
.stat.violet .v { color: var(--violet-soft); text-shadow: 0 0 18px rgba(140,120,255,.5); }
.stat.blue .v { color: #7db4ff; text-shadow: 0 0 18px rgba(77,139,255,.5); }
.stat.cyan .v { color: #7ee6ff; text-shadow: 0 0 18px rgba(67,217,255,.5); }
.stat.bad .v { color: #ff8aa6; text-shadow: 0 0 18px rgba(255,107,138,.5); }

/* ---------- 筛选栏 ---------- */
.filter-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 16px; padding: 14px 16px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.chip-group { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  padding: 7px 14px; border-radius: 20px; cursor: pointer; user-select: none;
  font-size: 13px; color: var(--text-dim);
  background: rgba(140,120,255,.06); border: 1px solid var(--line);
  transition: all .16s;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.on {
  color: #fff; background: linear-gradient(180deg, rgba(140,120,255,.3), rgba(77,139,255,.18));
  border-color: var(--violet-soft); box-shadow: 0 0 14px rgba(140,120,255,.3);
}
select, input[type="text"], input[type="search"] {
  background: rgba(10,10,24,.7); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 9px;
  padding: 8px 10px; font-size: 13px; outline: none;
  min-width: 120px;
}
select:focus, input:focus { border-color: var(--violet-soft); box-shadow: 0 0 0 2px rgba(140,120,255,.15); }
select option { background: #12132a; color: var(--text); }
.search { flex: 1; min-width: 160px; }
.btn {
  padding: 8px 14px; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 600;
  color: var(--text); background: rgba(140,120,255,.12); border: 1px solid var(--line-strong);
  transition: all .16s;
}
.btn:hover { background: rgba(140,120,255,.22); box-shadow: 0 0 14px rgba(140,120,255,.25); }
.count-hint { font-size: 12px; color: var(--text-faint); }

/* ---------- 视频表 ---------- */
.table-wrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-glow); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead th {
  position: sticky; top: 0; z-index: 2;
  text-align: left; padding: 12px 14px; font-weight: 600; font-size: 12px; color: var(--text-dim);
  background: rgba(14,15,30,.95); border-bottom: 1px solid var(--line-strong); letter-spacing: .4px;
}
tbody td { padding: 11px 14px; border-bottom: 1px solid rgba(140,120,255,.07); vertical-align: middle; }
tbody tr { transition: background .14s; }
tbody tr:hover { background: rgba(140,120,255,.05); }
.mono { font-family: "SF Mono", "Cascadia Code", Consolas, monospace; font-size: 12px; color: var(--text-dim); }

.rate-cell { display: flex; align-items: center; gap: 10px; }
.rate-track { width: 90px; height: 7px; border-radius: 6px; background: rgba(255,255,255,.06); overflow: hidden; }
.rate-fill { height: 100%; border-radius: 6px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.rate-num { font-weight: 700; min-width: 44px; text-align: right; }

.badge { display: inline-block; padding: 3px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge.good { color: var(--good); background: rgba(75,224,180,.12); border: 1px solid rgba(75,224,180,.3); }
.badge.ok { color: #7ee6ff; background: rgba(67,217,255,.1); border: 1px solid rgba(67,217,255,.3); }
.badge.warn { color: var(--warn); background: rgba(255,198,92,.1); border: 1px solid rgba(255,198,92,.28); }
.badge.mid { color: var(--warn); background: rgba(255,198,92,.1); border: 1px solid rgba(255,198,92,.28); }
.badge.bad { color: var(--bad); background: rgba(255,107,138,.1); border: 1px solid rgba(255,107,138,.3); }
.badge.dim { color: var(--text-faint); background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); }
.dev { font-weight: 700; }
.dev.d9904 { color: #7ee6ff; }
.dev.d2225 { color: #b79bff; }

/* ---------- 复盘页 ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hl-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.hl-card {
  position: relative; padding: 16px; border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(75,224,180,.10), rgba(140,120,255,.08));
  border: 1px solid rgba(75,224,180,.32); box-shadow: 0 0 24px rgba(75,224,180,.12);
}
.hl-card .rate { font-size: 26px; font-weight: 800; color: var(--good); text-shadow: 0 0 16px rgba(75,224,180,.55); }
.hl-card .who { font-size: 15px; font-weight: 700; margin-top: 4px; }
.hl-card .scene { font-size: 12px; color: var(--text-dim); margin: 2px 0 8px; }
.hl-card .desc { font-size: 12px; color: var(--text-dim); line-height: 1.55; }

.fail-list { display: flex; flex-direction: column; gap: 12px; }
.fail-item {
  padding: 14px 16px; border-radius: 12px;
  background: rgba(255,107,138,.05); border: 1px solid rgba(255,107,138,.2);
}
.fail-item.mid { background: rgba(255,198,92,.05); border-color: rgba(255,198,92,.2); }
.fail-item .head { display: flex; align-items: center; gap: 10px; }
.fail-item .cause { font-size: 15px; font-weight: 700; }
.fail-item .nums { margin-left: auto; font-size: 12px; color: var(--text-dim); }
.fail-item .fix { font-size: 13px; color: var(--text-dim); margin-top: 6px; line-height: 1.55; }
.fail-item .fix::before { content: "→ 整改："; color: var(--cyan); font-weight: 600; }

.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.method-item { padding: 14px 16px; border-radius: 12px; background: rgba(77,139,255,.06); border: 1px solid rgba(77,139,255,.2); }
.method-item .t { font-size: 14px; font-weight: 700; color: #9cc2ff; }
.method-item .d { font-size: 13px; color: var(--text-dim); margin-top: 5px; line-height: 1.55; }

.pattern-list { display: flex; flex-direction: column; gap: 10px; }
.pattern-item { display: flex; gap: 12px; padding: 12px 14px; border-radius: 12px; background: rgba(140,120,255,.05); border: 1px solid var(--line); }
.pattern-item .idx { color: var(--violet-soft); font-weight: 800; }
.pattern-item .t { font-size: 14px; font-weight: 700; }
.pattern-item .d { font-size: 13px; color: var(--text-dim); margin-top: 3px; line-height: 1.5; }

/* ---------- 图表 ---------- */
.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bar-row { display: flex; align-items: center; gap: 10px; margin: 7px 0; }
.bar-row .lbl { width: 130px; font-size: 12px; color: var(--text-dim); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; height: 10px; border-radius: 6px; background: rgba(255,255,255,.05); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--violet), var(--blue)); box-shadow: 0 0 12px rgba(140,120,255,.4); }
.bar-val { width: 76px; font-size: 12px; color: var(--text-dim); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--text-faint); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

svg text { fill: var(--text-faint); font-size: 11px; font-family: inherit; }
svg .axis { stroke: rgba(140,120,255,.15); }

/* ---------- 进度条（配额） ---------- */
.quota-row { margin: 12px 0; }
.quota-row .top { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
.quota-row .name { font-weight: 600; }
.quota-row .num { margin-left: auto; font-size: 12px; color: var(--text-dim); }
.quota-track { height: 12px; border-radius: 7px; background: rgba(255,255,255,.05); overflow: hidden; margin-top: 6px; }
.quota-fill { height: 100%; border-radius: 7px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.quota-fill.ok { background: linear-gradient(90deg, #37b6ff, #43d9ff); box-shadow: 0 0 12px rgba(67,217,255,.4); }
.quota-fill.warn { background: linear-gradient(90deg, #ffc65c, #ff9e5c); box-shadow: 0 0 12px rgba(255,198,92,.4); }
.quota-fill.over { background: linear-gradient(90deg, #ff6b8a, #ff4d7a); box-shadow: 0 0 12px rgba(255,107,138,.5); }

/* ---------- 响应式（桌面优先，仅做轻微适配） ---------- */
@media (max-width: 1200px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .hl-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .chart-row { grid-template-columns: 1fr; }
  .method-grid { grid-template-columns: 1fr; }
}

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  z-index: 50; padding: 10px 18px; border-radius: 10px; font-size: 13px;
  background: rgba(20,22,44,.95); border: 1px solid var(--line-strong);
  color: var(--text); opacity: 0; pointer-events: none; transition: all .25s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

/* =========================================================
   展示页 · 卡片流 & 交互（v2）
   ========================================================= */
.section-title { position: relative; padding-left: 14px; }
.section-title::before {
  content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 4px;
  border-radius: 4px; background: linear-gradient(180deg, var(--violet), var(--blue));
  box-shadow: 0 0 10px rgba(140,120,255,.6);
}

/* 分段控件（设备切换） */
.seg {
  display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px;
  background: rgba(10,10,24,.6); border: 1px solid var(--line-strong);
}
.seg-btn {
  padding: 7px 15px; border: 0; border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--text-dim);
  background: transparent; transition: all .16s; letter-spacing: .3px;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.on {
  color: #fff; background: linear-gradient(180deg, rgba(140,120,255,.32), rgba(77,139,255,.2));
  box-shadow: 0 0 12px rgba(140,120,255,.3), inset 0 0 0 1px rgba(160,140,255,.4);
}

.filter-bar { align-items: center; }
.filter-bar .search { min-width: 200px; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text-dim); }
.btn.ghost:hover { color: var(--text); background: rgba(140,120,255,.1); box-shadow: none; }

/* 结果条 */
.result-bar {
  display: flex; align-items: center; gap: 14px;
  margin: 0 0 16px; padding: 10px 16px;
  background: rgba(18,20,40,.5); border: 1px solid var(--line); border-radius: 12px;
  font-size: 13px; color: var(--text-dim);
}
.result-bar .rb-count b { color: var(--text); font-size: 15px; }
.result-bar .rb-sep { width: 1px; height: 18px; background: var(--line-strong); }
.rb-item b { color: var(--text); }
.rb-rate { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.rb-rate-num { font-size: 15px; font-weight: 800; }

/* 卡片网格 */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px;
}
.v-card {
  position: relative; cursor: pointer; overflow: hidden;
  padding: 14px 16px 12px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
  animation: cardIn .4s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.v-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--tier); opacity: .85;
}
.v-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  box-shadow: 0 14px 34px rgba(60, 40, 160, .35), inset 0 0 0 1px rgba(160,140,255,.12);
}
.v-card.tier-good { --tier: var(--good); }
.v-card.tier-ok { --tier: var(--cyan); }
.v-card.tier-warn { --tier: var(--warn); }
.v-card.tier-bad { --tier: var(--bad); }

.vc-head { display: flex; align-items: center; gap: 8px; }
.vc-date { margin-left: auto; font-size: 11px; color: var(--text-faint); }
.vc-rate { margin: 12px 0 8px; }
.vc-rate-num { font-size: 30px; font-weight: 800; line-height: 1; }
.vc-rate-num small { font-size: 15px; font-weight: 700; margin-left: 1px; }
.vc-who { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.vc-loc { font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.vc-scene {
  display: inline-block; margin: 4px 0 10px; padding: 3px 9px; border-radius: 20px;
  font-size: 11px; color: var(--text-dim); background: rgba(140,120,255,.08); border: 1px solid var(--line);
}
.vc-foot {
  display: flex; justify-content: space-between; padding-top: 10px; margin-top: 2px;
  border-top: 1px solid rgba(140,120,255,.08); font-size: 12px; color: var(--text-dim);
}
.vc-reason { margin-top: 8px; font-size: 12px; color: var(--text-dim); }
.vc-reason.ok-text { color: var(--good); }

.empty { padding: 60px 20px; text-align: center; color: var(--text-faint); border: 1px dashed var(--line-strong); border-radius: var(--radius); }

/* 展示页按日期分组 */
.date-group { margin-bottom: 26px; }
.dg-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.dg-date {
  font-size: 15px; font-weight: 800; letter-spacing: .5px;
  padding: 4px 14px; border-radius: 20px; color: #fff;
  background: linear-gradient(180deg, rgba(140,120,255,.30), rgba(77,139,255,.16));
  border: 1px solid rgba(160,140,255,.4);
  box-shadow: 0 0 14px rgba(120,90,255,.25);
}
.dg-meta { font-size: 12px; color: var(--text-dim); }
.dg-meta b { font-size: 13px; }

/* 日期内按工作人员分组 */
.person-sub { margin-bottom: 14px; }
.ps-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.ps-person {
  font-size: 14px; font-weight: 800; letter-spacing: .3px;
  padding: 3px 12px; border-radius: 16px;
  background: rgba(140,120,255,.08); border: 1px solid var(--line);
}
.ps-meta { font-size: 12px; color: var(--text-dim); }
.ps-meta b { font-size: 13px; }

.pager { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 20px; }
.pager-info { font-size: 13px; color: var(--text-dim); }
.pager .btn[disabled] { opacity: .4; pointer-events: none; }

/* 详情弹窗 */
.modal-overlay {
  position: fixed; inset: 0; z-index: 40;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4,4,12,.6); backdrop-filter: blur(4px);
  animation: fadein .2s ease both;
}
.modal {
  position: relative; width: min(560px, 92vw); max-height: 86vh; overflow: auto;
  background: linear-gradient(180deg, rgba(24,26,52,.98), rgba(14,15,32,.98));
  border: 1px solid var(--line-strong); border-radius: 18px;
  padding: 22px 22px 18px; box-shadow: 0 24px 80px rgba(0,0,0,.6), 0 0 40px rgba(100,70,220,.18);
  animation: modalIn .24s cubic-bezier(.2,.8,.2,1) both;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
.modal::before { content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 3px; background: var(--tier); }
.modal.tier-good { --tier: var(--good); } .modal.tier-ok { --tier: var(--cyan); }
.modal.tier-warn { --tier: var(--warn); } .modal.tier-bad { --tier: var(--bad); }
.modal-close {
  position: absolute; top: 12px; right: 14px; width: 30px; height: 30px;
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
  background: rgba(255,255,255,.04); color: var(--text-dim); font-size: 18px; line-height: 1;
  transition: all .15s;
}
.modal-close:hover { color: #fff; background: rgba(255,107,138,.2); border-color: var(--bad); }
.m-head { display: flex; align-items: flex-start; gap: 12px; padding-right: 34px; }
.m-who { font-size: 17px; font-weight: 700; }
.m-sub { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.m-rate { margin: 14px 0 16px; }
.m-rate-num { font-size: 34px; font-weight: 800; }
.m-rate-num small { font-size: 16px; }
.m-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin-bottom: 14px; }
.m-item { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.m-item span { color: var(--text-faint); }
.m-item b { color: var(--text); font-weight: 600; }
.m-reason {
  padding: 12px 14px; border-radius: 11px; font-size: 14px;
  background: rgba(255,107,138,.07); border: 1px solid rgba(255,107,138,.22);
}
.m-reason.ok-text { background: rgba(75,224,180,.07); border-color: rgba(75,224,180,.24); color: var(--good); }
.m-reason-label { display: block; font-size: 11px; color: var(--text-faint); margin-bottom: 4px; }
.m-note { margin-top: 12px; font-size: 12px; color: var(--text-faint); line-height: 1.5; }

/* =========================================================
   配额地图（三角洲行动式选图界面）
   ========================================================= */
.app { padding-bottom: 30px; }
.map-view { display: flex; gap: 16px; height: 100%; }

.map-stage {
  position: relative; flex: 1; min-width: 0; min-height: 70vh; border-radius: 18px;
  border: 1px solid var(--line-strong); overflow: hidden;
  background: radial-gradient(1000px 600px at 50% 30%, rgba(50,34,120,.30), rgba(8,8,16,.6));
  box-shadow: var(--shadow-glow);
}
.map-stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 3;
  background: radial-gradient(120% 120% at 50% 50%, transparent 52%, rgba(2,4,10,.72) 100%);
}
#map-canvas-wrap { position: absolute; inset: 0; }
#map-canvas-wrap canvas { position: absolute; inset: 0; display: block; transition: filter .65s ease, opacity .65s ease; }
#map-canvas-wrap.exiting canvas { filter: blur(16px) brightness(.6); opacity: 0; }
.map-canvas-bg { cursor: grab; }
.map-canvas-bg:active { cursor: grabbing; }
.map-canvas-fg { pointer-events: none; }

.map-zoom { position: absolute; right: 14px; top: 14px; display: flex; flex-direction: column; gap: 7px; z-index: 5; }
.map-zoom button {
  width: 38px; height: 38px; border-radius: 10px; cursor: pointer;
  background: rgba(14,15,32,.85); color: var(--text); border: 1px solid var(--line-strong);
  font-size: 17px; line-height: 1; transition: all .15s;
}
.map-zoom button:hover { background: rgba(140,120,255,.2); box-shadow: 0 0 14px rgba(140,120,255,.3); }

.map-hint {
  position: absolute; left: 14px; bottom: 12px; z-index: 5;
  padding: 7px 12px; border-radius: 20px; font-size: 12px; color: var(--text-dim);
  background: rgba(10,10,22,.7); border: 1px solid var(--line); pointer-events: none;
}

.map-legend {
  position: absolute; left: 14px; top: 14px; z-index: 5;
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 12px; border-radius: 12px; font-size: 12px;
  background: rgba(10,10,22,.7); border: 1px solid var(--line);
}
.lg-item { display: flex; align-items: center; gap: 8px; color: var(--text-dim); }
.lg-item i { width: 9px; height: 9px; border-radius: 3px; box-shadow: 0 0 8px currentColor; }
.lg-rate { font-style: normal; font-weight: 700; margin-left: 2px; }
.lg-rate.good { color: var(--good); } .lg-rate.ok { color: var(--cyan); }
.lg-rate.warn { color: var(--warn); } .lg-rate.bad { color: var(--bad); }

/* 右侧抽屉 */
.map-drawer {
  width: 384px; flex: 0 0 384px; max-height: 100%; overflow-y: auto;
  border-radius: 18px; border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(22,24,48,.92), rgba(13,14,30,.92));
  box-shadow: var(--shadow-glow); padding: 18px 18px 20px;
  scrollbar-width: thin; scrollbar-color: rgba(140,120,255,.3) transparent;
}
.drawer-empty { text-align: center; padding: 60px 16px; color: var(--text-faint); }
.drawer-empty .de-ico { font-size: 40px; color: var(--violet-soft); opacity: .7; margin-bottom: 14px; }
.drawer-empty .de-t { font-size: 16px; color: var(--text-dim); font-weight: 600; }
.drawer-empty .de-d { font-size: 12px; margin-top: 8px; line-height: 1.6; }

.drawer-head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.drawer-title { font-size: 19px; font-weight: 800; }
.drawer-sub { font-size: 12px; color: var(--text-dim); margin-top: 3px; }
.drawer-head .btn { margin-left: auto; }

.drawer-section { margin-bottom: 16px; }
.drawer-sec-title {
  font-size: 13px; font-weight: 700; color: var(--text-dim);
  padding-bottom: 8px; margin-bottom: 10px; border-bottom: 1px solid var(--line);
  letter-spacing: .4px;
}
.sec-tag { font-weight: 400; font-size: 11px; color: var(--text-faint); }

.dw-stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dw-stat-row > div { display: flex; flex-direction: column; gap: 3px; }
.dw-k { font-size: 11px; color: var(--text-faint); }
.dw-stat-row b { font-size: 16px; }

.quota-pending { font-size: 12px; color: var(--text-faint); padding: 12px; border: 1px dashed var(--line-strong); border-radius: 10px; line-height: 1.6; }

.sub-q-wrap { margin-top: 12px; display: flex; flex-direction: column; gap: 9px; }
.sub-q-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.sub-q .quota-track { height: 7px; margin-top: 0; }

.btn.wide { width: 100%; justify-content: center; }

.dw-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 6px;
  border-bottom: 1px solid rgba(140,120,255,.07); font-size: 12px;
}
.dw-row-who { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dw-row-loc { color: var(--text-dim); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dw-row-rate { font-weight: 600; min-width: 88px; text-align: right; color: var(--text-dim); }
.dw-row-date { color: var(--text-faint); }
.dw-none { color: var(--text-faint); font-size: 12px; padding: 8px 0; }

@media (max-width: 1200px) {
  .map-view { flex-direction: column; }
  .map-drawer { width: 100%; flex: none; max-height: 420px; }
}

/* 地图标题 / 配额英雄卡 / 图例配额 */
.map-title {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  text-align: center; pointer-events: none; z-index: 4;
}
.mt-main {
  font-size: 18px; font-weight: 800; letter-spacing: 1px;
  text-shadow: 0 0 20px rgba(140,120,255,.6), 0 2px 8px rgba(0,0,0,.6);
}
.mt-sub { font-size: 11px; color: var(--text-dim); margin-top: 3px; letter-spacing: 2px; }

.lg-quota { font-style: normal; font-weight: 700; margin-left: 2px; color: #c3ccf2; }

.quota-hero {
  padding: 16px 18px; border-radius: 14px;
  background: linear-gradient(160deg, rgba(139,108,255,.20), rgba(77,139,255,.10));
  border: 1px solid rgba(160,140,255,.38);
  box-shadow: 0 0 24px rgba(100,70,220,.18);
}
.quota-hero.pending { background: rgba(140,120,255,.06); border-color: var(--line); box-shadow: none; }
.qh-label { font-size: 11px; color: var(--text-dim); letter-spacing: .5px; }
.qh-value { font-size: 34px; font-weight: 800; color: var(--violet-soft); text-shadow: 0 0 20px rgba(140,120,255,.5); line-height: 1.1; }
.qh-value small { font-size: 17px; margin-left: 2px; }
.qh-sub { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.quota-hero.pending .qh-value { font-size: 22px; color: var(--text-faint); text-shadow: none; }
