*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #08080f;
  --panel: rgba(14,14,24,0.90);
  --border: rgba(255,255,255,0.07);
  --accent: #0A84FF;
  --green: #30D158;
  --red: #FF453A;
  --t1: rgba(255,255,255,0.92);
  --t2: rgba(255,255,255,0.45);
  --t3: rgba(255,255,255,0.20);
  --blur: blur(5px) saturate(200%);
  --r: 14px;
  --shadow: 0 8px 40px rgba(0,0,0,0.6), 0 2px 8px rgba(0,0,0,0.4);
}
html, body { width:100%; height:100%; overflow:hidden; background:var(--bg);
  font-family:-apple-system,'SF Pro Display','Helvetica Neue',Arial,sans-serif;
  color:var(--t1); -webkit-font-smoothing:antialiased; }
#map { position:fixed; inset:0; z-index:0; }

/* ── Top Bar ── */
.topbar {
  position:fixed; top:0; left:0; right:0; height:46px;
  background:transparent; backdrop-filter:none; -webkit-backdrop-filter:none;
  border-bottom:none; border-radius:0;
  box-shadow:none; z-index:1000;
  display:flex; align-items:center; gap:7px; padding:0 18px 0 14px;
}
.topbar-logo {
  display:flex; align-items:center; gap:7px;
  font-size:13px; font-weight:700; white-space:nowrap; margin-right:2px;
  letter-spacing:.2px;
}
.logo-mark {
  width:24px; height:24px; border-radius:7px; flex-shrink:0;
  overflow:hidden;
  position:relative;
  background:linear-gradient(145deg, #8aa8ff 0%, #6f84ff 48%, #d2a270 100%);
  box-shadow:0 0 0 1px rgba(255,255,255,0.24) inset, 0 8px 22px rgba(91,184,255,0.28);
}
.logo-mark::before,
.logo-mark::after {
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
}
.logo-mark::before {
  width:14px;
  height:14px;
  border-radius:50%;
  border:2px solid #142647;
  box-shadow:0 0 0 1px rgba(138,216,255,0.5);
}
.logo-mark::after {
  width:18px;
  height:18px;
  border-radius:2px;
  background:
    linear-gradient(#142647, #142647) center/2px 18px no-repeat,
    linear-gradient(90deg, #142647, #142647) center/18px 2px no-repeat,
    radial-gradient(circle, #142647 0 2px, transparent 2px);
}
.logo-mark img { display:none; }
.topbar-sep { width:1px; height:22px; background:var(--border); margin:0 2px; flex-shrink:0; }
.map-tabs { display:flex; gap:2px; flex:1; overflow-x:auto; overflow-y:visible; scrollbar-width:none; }
.map-tabs::-webkit-scrollbar { display:none; }
.map-tab {
  padding:5px 11px; border-radius:8px; font-size:11px; font-weight:500;
  color:var(--t2); cursor:pointer; border:none; background:transparent;
  transition:all .15s; white-space:nowrap; font-family:inherit;
}
.map-tab:hover { color:var(--t1); background:rgba(255,255,255,0.07); }
.map-tab.active { color:var(--accent); background:rgba(10,132,255,0.15); }
.topbar-pill {
  display:flex; align-items:center; gap:5px;
  height:42px;
  padding:0 12px; border-radius:15px; cursor:pointer;
  background:rgba(255,255,255,0.05); border:1px solid var(--border);
  font-size:11px; font-weight:500; color:var(--t2);
  transition:all .15s; white-space:nowrap; font-family:inherit;
}
.topbar-pill:hover { background:rgba(255,255,255,0.1); color:var(--t1); }
.topbar-pill.active { color:var(--accent); border-color:rgba(10,132,255,0.3); background:rgba(10,132,255,0.1); }
.conn-dot { width:6px; height:6px; border-radius:50%; background:#636366; transition:background .3s; flex-shrink:0; }
.conn-dot.ok  { background:var(--green); box-shadow:0 0 7px var(--green); }
.conn-dot.err { background:var(--red); }
.fullscreen-pill {
  margin-left:auto;
  width:48px;
  justify-content:center;
  color:rgba(10,132,255,0.92);
  background:rgba(12,18,28,0.34);
  border-color:rgba(255,255,255,0.10);
  transform:translateY(6px);
}
.conn-pill {
  min-width:150px;
  height:42px;
  padding:6px 12px;
  flex-direction:column;
  align-items:stretch;
  gap:3px;
  border-radius:14px;
  margin-right:4px;
  background:rgba(18,20,24,0.36);
  transform:translateY(6px);
}
.conn-main,
.conn-rate {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:7px;
}
.conn-main {
  justify-content:flex-start;
}
.conn-rate {
  padding-left:11px;
  font-size:10px;
  color:rgba(255,255,255,0.38);
}
.conn-rate b {
  color:rgba(255,196,91,0.9);
  font-size:10px;
  font-weight:900;
}

/* ── 浮动当局统计（收缩侧边栏时，收缩按钮下方，两列布局） ── */
.float-stats {
  position:fixed; top:110px; left:10px; z-index:998;
  display:none;
  flex-wrap:wrap; gap:1px 10px;
  width:150px;
  padding:6px 8px;
  background:transparent;
  pointer-events:none;
  user-select:none;
}
.float-stats.show { display:flex; }
.fs-title {
  width:100%;
  font-size:10px; font-weight:700; color:rgba(255,255,255,0.45);
  letter-spacing:1px; margin-bottom:2px;
  text-shadow:0 1px 3px rgba(0,0,0,0.8);
}
.fs-row {
  display:flex; align-items:center; gap:4px;
  width:calc(50% - 5px);
  font-size:11px; line-height:1.7;
}
.fs-dot {
  width:5px; height:5px; border-radius:50%; flex-shrink:0;
}
.fs-val {
  font-weight:700; font-size:12px; min-width:14px;
  color:#fff; text-shadow:0 1px 4px rgba(0,0,0,0.9);
}
.fs-lbl {
  color:rgba(255,255,255,0.5); font-size:10px;
  text-shadow:0 1px 3px rgba(0,0,0,0.8);
}

/* ── 浮动队伍面板（左下角）── */
.team-float {
  position:fixed; bottom:14px; left:14px; z-index:998;
  display:none; flex-direction:column; gap:3px;
  min-width:200px; max-width:240px;
}
.team-float.show { display:flex; }
.team-card {
  background:rgba(0,0,0,0.65); backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px);
  border:1px solid rgba(255,255,255,0.08); border-radius:6px;
  padding:6px 8px; cursor:pointer; transition:all .15s;
}
.team-card:hover { background:rgba(0,0,0,0.8); border-color:rgba(255,255,255,0.15); }
.team-card.active { border-color:rgba(10,132,255,0.5); background:rgba(10,132,255,0.12); }
.team-card .tc-top { display:flex; align-items:center; justify-content:space-between; margin-bottom:3px; }
.team-card .tc-name { font-size:12px; font-weight:600; color:#e6edf3; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:120px; }
.team-card .tc-gear { display:flex; gap:4px; align-items:center; font-size:10px; color:#8b949e; }
.team-card .tc-gear span { display:flex; align-items:center; gap:1px; }
.team-card .tc-bar { height:4px; border-radius:2px; background:rgba(255,255,255,0.1); overflow:hidden; }
.team-card .tc-bar-fill { height:100%; border-radius:2px; transition:width .3s; }

/* Inputs */
select, input[type=text] {
  width:100%; background:rgba(255,255,255,0.05);
  border:1px solid var(--border); border-radius:8px;
  color:var(--t1); font-size:12px; padding:7px 10px;
  outline:none; transition:border-color .15s; font-family:inherit;
  -webkit-appearance:none; appearance:none;
}
select:focus, input[type=text]:focus { border-color:rgba(10,132,255,0.5); }
select option { background:var(--panel); color:var(--t1); }
select option:checked { background:rgba(10,132,255,0.3); }
.cfg-row { display:flex; align-items:center; gap:8px; margin-top:7px; }
.cfg-lbl { font-size:11px; color:var(--t2); white-space:nowrap; width:28px; flex-shrink:0; }
.btn-row { display:flex; gap:6px; margin-top:9px; }
.btn {
  flex:1; padding:8px; border-radius:8px; font-size:11px; font-weight:600;
  cursor:pointer; border:1px solid var(--border);
  background:rgba(255,255,255,0.06); color:var(--t1);
  transition:all .15s; font-family:inherit;
}
.btn:hover { background:rgba(255,255,255,0.13); }
.btn-accent { background:var(--accent); border-color:var(--accent); color:#fff; }
.btn-accent:hover { background:#2898FF; border-color:#2898FF; }
.hint { font-size:10px; color:var(--t3); margin-top:6px; line-height:1.4; }

/* Toast */
#toast {
  position:fixed; bottom:20px; left:50%; transform:translateX(-50%) translateY(16px);
  background:rgba(28,28,42,0.96); backdrop-filter:blur(24px);
  border:1px solid var(--border); border-radius:20px;
  padding:9px 20px; font-size:12px; font-weight:500; color:var(--t1);
  opacity:0; transition:all .22s ease; pointer-events:none; z-index:9999;
  box-shadow:var(--shadow);
}
#toast.show { opacity:1; transform:translateX(-50%) translateY(0); }

/* Settings menu v2 */
.settings-v2-entry {
  position:fixed;
  right:22px;
  bottom:20px;
  width:50px;
  height:50px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,0.16);
  background:rgba(17,22,31,0.78);
  box-shadow:0 18px 44px rgba(0,0,0,0.46), 0 0 0 1px rgba(91,184,255,0.14) inset;
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  z-index:1200;
  cursor:pointer;
}
.settings-v2-entry::before,
.settings-v2-entry::after {
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  pointer-events:none;
}
.settings-v2-entry::before {
  width:24px;
  height:24px;
  border-radius:50%;
  border:3px solid #5bb8ff;
  background:
    radial-gradient(circle at center, transparent 0 5px, #5bb8ff 5px 7px, transparent 7px),
    conic-gradient(from 12deg, #5bb8ff 0 12deg, transparent 12deg 48deg, #5bb8ff 48deg 60deg, transparent 60deg 108deg, #5bb8ff 108deg 120deg, transparent 120deg 168deg, #5bb8ff 168deg 180deg, transparent 180deg 228deg, #5bb8ff 228deg 240deg, transparent 240deg 288deg, #5bb8ff 288deg 300deg, transparent 300deg);
  box-shadow:0 0 18px rgba(91,184,255,0.34);
}
.settings-v2-entry::after {
  width:8px;
  height:8px;
  border-radius:50%;
  background:#111722;
  box-shadow:0 0 0 2px #5bb8ff inset;
}
.settings-v2-crosshair {
  display:none;
}
.settings-v2-crosshair::before,
.settings-v2-crosshair::after {
  display:none;
}
.settings-v2-crosshair::before {
  left:50%;
  top:-6px;
  width:2px;
  height:34px;
  transform:translateX(-50%);
}
.settings-v2-crosshair::after {
  top:50%;
  left:-6px;
  width:34px;
  height:2px;
  transform:translateY(-50%);
}
.settings-v2-overlay {
  position:fixed;
  inset:0;
  z-index:5000;
  display:none;
  background:
    radial-gradient(circle at 18% 12%, rgba(91,184,255,0.16), transparent 24%),
    radial-gradient(circle at 82% 18%, rgba(255,196,91,0.13), transparent 20%),
    rgba(0,0,0,0.24);
  backdrop-filter:blur(3px) saturate(120%);
  -webkit-backdrop-filter:blur(3px) saturate(120%);
}
.settings-v2-overlay.open { display:block; }
.settings-v2-panel {
  position:absolute;
  left:50%;
  top:50%;
  width:min(980px, calc(100vw - 42px));
  height:min(620px, calc(100vh - 46px));
  transform:translate(-50%,-50%);
  display:grid;
  grid-template-columns:116px 1fr;
  overflow:hidden;
  border-radius:24px;
  color:rgba(246,249,255,0.92);
  background:rgba(11,15,22,0.48);
  border:1px solid rgba(255,255,255,0.18);
  box-shadow:0 26px 82px rgba(0,0,0,0.48), 0 0 0 1px rgba(255,255,255,0.06) inset;
  backdrop-filter:blur(28px) saturate(165%);
  -webkit-backdrop-filter:blur(28px) saturate(165%);
}
.settings-v2-nav {
  padding:14px 10px;
  border-right:1px solid rgba(255,255,255,0.10);
  background:linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.025));
}
.settings-v2-brand {
  height:44px;
  display:flex;
  align-items:center;
  gap:8px;
  padding:0 6px 10px;
  color:rgba(246,249,255,0.52);
  font-size:11px;
  font-weight:900;
  letter-spacing:1.4px;
}
.settings-v2-brand span {
  width:26px;
  height:26px;
  border-radius:8px;
  position:relative;
  background:linear-gradient(145deg, #8aa8ff 0%, #6f84ff 48%, #d2a270 100%);
  box-shadow:0 10px 26px rgba(91,184,255,0.22);
}
.settings-v2-brand span::before {
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  width:15px;
  height:15px;
  transform:translate(-50%,-50%);
  border-radius:50%;
  border:2px solid #142647;
  box-shadow:0 0 0 1px rgba(138,216,255,0.5);
}
.settings-v2-brand span::after {
  content:"";
  position:absolute;
  left:50%;
  top:50%;
  width:19px;
  height:19px;
  transform:translate(-50%,-50%);
  border-radius:2px;
  background:
    linear-gradient(#142647, #142647) center/2px 19px no-repeat,
    linear-gradient(90deg, #142647, #142647) center/19px 2px no-repeat,
    radial-gradient(circle, #142647 0 2px, transparent 2px);
}
.settings-v2-navbtn {
  width:100%;
  height:82px;
  margin-bottom:8px;
  padding:9px 8px;
  display:grid;
  grid-template-rows:32px auto;
  justify-items:center;
  align-items:center;
  border-radius:18px;
  border:1px solid rgba(255,255,255,0.08);
  background:rgba(255,255,255,0.045);
  color:rgba(246,249,255,0.52);
  font-family:inherit;
  cursor:pointer;
}
.settings-v2-navbtn.active {
  color:#10141d;
  background:linear-gradient(135deg, #7cc9ff, #ffc45b);
  border-color:rgba(255,255,255,0.22);
  box-shadow:0 16px 36px rgba(91,184,255,0.22);
}
.settings-v2-navbtn svg {
  width:28px;
  height:28px;
  stroke:currentColor;
  fill:none;
  stroke-width:1.9;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.settings-v2-navbtn span {
  font-size:13px;
  font-weight:900;
}
.settings-v2-main {
  min-width:0;
  min-height:0;
  display:grid;
  grid-template-rows:auto minmax(0, 1fr);
  padding:18px 20px 20px;
  overflow:hidden;
}
.settings-v2-head {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding-bottom:13px;
  border-bottom:1px solid rgba(255,255,255,0.10);
}
.settings-v2-head h2 {
  margin:0;
  font-size:20px;
  line-height:1.1;
  letter-spacing:.6px;
}
.settings-v2-head p {
  margin:5px 0 0;
  color:rgba(246,249,255,0.52);
  font-size:12px;
  font-weight:700;
}
.settings-v2-close,
.settings-v2-action {
  height:30px;
  padding:0 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.12);
  background:rgba(255,255,255,0.075);
  color:rgba(255,255,255,0.78);
  font-size:12px;
  font-weight:900;
  font-family:inherit;
  cursor:pointer;
}
.settings-v2-page {
  min-height:0;
  height:100%;
  padding-top:12px;
  display:none;
  display:none;
  overflow-y:auto;
  overflow-x:hidden;
  padding-right:6px;
  padding-bottom:18px;
  scrollbar-width:thin;
  scrollbar-color:rgba(255,255,255,0.22) rgba(255,255,255,0.05);
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
}
.settings-v2-page.active { display:block; }
.settings-v2-page.settings-v2-grid.active {
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  align-content:start;
  gap:10px;
}
.settings-v2-page.settings-v2-columns.active {
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  align-content:start;
  gap:10px;
}
.settings-v2-col {
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.settings-v2-page::-webkit-scrollbar { width:6px; }
.settings-v2-page::-webkit-scrollbar-track {
  background:rgba(255,255,255,0.05);
  border-radius:999px;
}
.settings-v2-page::-webkit-scrollbar-thumb {
  background:rgba(255,255,255,0.22);
  border-radius:999px;
}
.settings-v2-card {
  min-width:0;
  display:block;
  width:100%;
  margin:0;
  align-self:start;
  border-radius:18px;
  overflow:hidden;
  background:rgba(20,26,36,0.38);
  border:1px solid rgba(255,255,255,0.13);
  box-shadow:0 10px 28px rgba(0,0,0,0.18);
  backdrop-filter:blur(18px) saturate(150%);
  -webkit-backdrop-filter:blur(18px) saturate(150%);
}
.settings-v2-cardhead {
  min-height:42px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:9px 12px;
  background:linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.025));
  border-bottom:1px solid rgba(255,255,255,0.08);
}
.settings-v2-cardhead strong {
  font-size:13px;
  letter-spacing:.3px;
}
.settings-v2-cardhead small {
  min-width:34px;
  padding:4px 7px;
  border-radius:999px;
  color:rgba(255,255,255,0.78);
  background:rgba(255,255,255,0.08);
  border:1px solid rgba(255,255,255,0.10);
  font-size:9px;
  font-weight:900;
  text-align:center;
}
.settings-v2-row {
  min-height:34px;
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(96px, 1.05fr) minmax(40px, auto);
  align-items:center;
  gap:8px;
  padding:6px 12px;
  border-top:1px solid rgba(255,255,255,0.065);
}
.settings-v2-row:first-of-type { border-top:0; }
.settings-v2-row span {
  min-width:0;
  color:rgba(255,255,255,0.72);
  font-size:12px;
  line-height:1.35;
  font-weight:700;
}
.settings-v2-row:not(.range-row):not(.color-row) {
  grid-template-columns:minmax(0,1fr) auto;
}
.settings-v2-row input[type=checkbox] {
  display:none;
}
.settings-v2-row i {
  width:36px;
  height:20px;
  padding:3px;
  border-radius:999px;
  background:rgba(255,255,255,0.12);
  box-shadow:none;
  transition:background .16s;
}
.settings-v2-row i::after {
  content:"";
  display:block;
  width:14px;
  height:14px;
  border-radius:50%;
  background:rgba(255,255,255,0.45);
  transition:margin .16s, background .16s;
}
.settings-v2-row input[type=checkbox]:checked + i {
  background:linear-gradient(135deg, #5bb8ff, #a78bfa);
  box-shadow:0 0 18px rgba(91,184,255,0.18);
}
.settings-v2-row input[type=checkbox]:checked + i::after {
  margin-left:16px;
  background:#fff;
}
.settings-v2-row.disabled { opacity:.45; }
.settings-v2-row select,
.settings-v2-row input[type=text] {
  width:120px;
  height:26px;
  border-radius:999px;
  color:rgba(255,255,255,0.78);
  background:rgba(255,255,255,0.08);
  border:1px solid rgba(255,255,255,0.10);
  padding:0 10px;
  font-size:11px;
  font-weight:900;
}
.settings-v2-row input[type=range] {
  width:100%;
  accent-color:#ffc45b;
}
.settings-v2-row b {
  min-width:40px;
  color:rgba(255,255,255,0.78);
  font-size:11px;
  font-weight:900;
  text-align:right;
}
.settings-v2-row em {
  max-width:150px;
  color:rgba(255,255,255,0.38);
  font-size:10px;
  font-style:normal;
  text-align:right;
}
.settings-v2-row.color-row input[type=color] {
  width:42px;
  height:26px;
  padding:2px;
  border-radius:999px;
  border:1px solid color-mix(in srgb, var(--picked-color, #ffffff) 54%, rgba(255,255,255,0.18));
  background:linear-gradient(135deg, color-mix(in srgb, var(--picked-color, #ffffff) 34%, rgba(255,255,255,0.08)), rgba(255,255,255,0.08));
  box-shadow:0 0 16px color-mix(in srgb, var(--picked-color, #ffffff) 24%, transparent);
  cursor:pointer;
}
.settings-v2-row.color-row b {
  min-width:70px;
  font-size:10px;
  color:color-mix(in srgb, var(--picked-color, #ffffff) 64%, rgba(255,255,255,0.70));
}
.settings-v2-quality {
  padding:9px 12px;
  border-top:1px solid rgba(255,255,255,0.065);
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:6px;
}
.settings-v2-quality span {
  width:100%;
  color:rgba(255,255,255,0.72);
  font-size:12px;
  font-weight:700;
}
.settings-v2-quality button {
  padding:5px 8px;
  border-radius:999px;
  color:color-mix(in srgb, var(--q-color, #ffc45b) 58%, #ffffff 42%);
  background:color-mix(in srgb, var(--q-color, #ffc45b) 16%, rgba(255,255,255,0.075));
  border:1px solid color-mix(in srgb, var(--q-color, #ffc45b) 48%, rgba(255,255,255,0.10));
  font-size:11px;
  font-weight:900;
  cursor:pointer;
  box-shadow:0 0 14px color-mix(in srgb, var(--q-color, #ffc45b) 18%, transparent);
}
.settings-v2-quality button.active {
  color:#10141d;
  background:var(--q-color, #ffc45b);
  border-color:transparent;
  box-shadow:0 8px 20px color-mix(in srgb, var(--q-color, #ffc45b) 34%, transparent);
}
.settings-v2-action {
  width:calc(100% - 28px);
  margin:8px 14px 12px;
}
@media (max-width:1080px) {
  .settings-v2-panel { width:calc(100vw - 24px); height:calc(100vh - 28px); grid-template-columns:106px 1fr; }
  .settings-v2-page.settings-v2-grid.active,
  .settings-v2-page.settings-v2-columns.active { grid-template-columns:repeat(2, minmax(0, 1fr)); }
  .settings-v2-navbtn { height:76px; border-radius:16px; }
}
@media (max-width:820px) {
  .settings-v2-panel { width:calc(100vw - 16px); height:calc(100vh - 18px); grid-template-columns:92px 1fr; }
  .settings-v2-main { padding:14px 14px 16px; }
  .settings-v2-nav { padding:12px 8px; }
  .settings-v2-brand { font-size:10px; gap:6px; padding-left:3px; }
  .settings-v2-navbtn { height:74px; padding:8px 6px; }
  .settings-v2-page.settings-v2-grid.active,
  .settings-v2-page.settings-v2-columns.active { grid-template-columns:1fr; }
}
@media (max-width:560px) {
  .settings-v2-overlay {
    padding:10px;
    overflow:hidden;
  }
  .settings-v2-panel {
    top:auto;
    bottom:max(10px, env(safe-area-inset-bottom));
    width:calc(100vw - 20px);
    height:min(86vh, calc(100dvh - 22px));
    max-height:calc(100dvh - 22px);
    transform:translateX(-50%);
    grid-template-columns:1fr;
    grid-template-rows:auto minmax(0, 1fr);
    overflow:hidden;
    border-radius:22px;
  }
  .settings-v2-nav {
    min-width:0;
    padding:10px 10px 9px;
    border-right:0;
    border-bottom:1px solid rgba(255,255,255,0.10);
    display:grid;
    grid-template-columns:1fr 1fr 1fr 1fr;
    gap:7px;
    align-items:stretch;
    background:linear-gradient(180deg, rgba(255,255,255,0.09), rgba(255,255,255,0.025));
  }
  .settings-v2-brand {
    grid-column:1 / -1;
    height:28px;
    padding:0 2px 2px;
    font-size:10px;
    letter-spacing:1px;
  }
  .settings-v2-brand span {
    width:23px;
    height:23px;
    border-radius:7px;
  }
  .settings-v2-navbtn {
    width:100%;
    height:54px;
    margin:0;
    padding:6px 4px;
    display:grid;
    grid-template-rows:22px auto;
    border-radius:15px;
  }
  .settings-v2-navbtn svg {
    width:22px;
    height:22px;
    stroke-width:2;
  }
  .settings-v2-navbtn span {
    font-size:12px;
  }
  .settings-v2-main {
    min-height:0;
    padding:13px 12px 12px;
    overflow:hidden;
  }
  .settings-v2-head {
    gap:8px;
    padding-bottom:10px;
  }
  .settings-v2-head h2 {
    font-size:19px;
  }
  .settings-v2-head p {
    margin-top:3px;
    font-size:11px;
    line-height:1.35;
  }
  .settings-v2-close {
    width:58px;
    height:32px;
    flex-shrink:0;
    border-radius:13px;
  }
  .settings-v2-page {
    height:100%;
    overflow-y:auto;
    overflow-x:hidden;
    padding-top:9px;
    padding-right:2px;
    padding-bottom:18px;
    -webkit-overflow-scrolling:touch;
  }
  .settings-v2-page.settings-v2-grid.active,
  .settings-v2-page.settings-v2-columns.active { grid-template-columns:1fr; }
  .settings-v2-col {
    gap:9px;
  }
  .settings-v2-card {
    border-radius:16px;
  }
  .settings-v2-cardhead {
    min-height:38px;
    padding:8px 10px;
  }
  .settings-v2-cardhead strong {
    font-size:13px;
  }
  .settings-v2-row {
    min-height:36px;
    padding:7px 10px;
    gap:7px;
    grid-template-columns:minmax(0,1fr) minmax(92px, 1fr) minmax(38px, auto);
  }
  .settings-v2-row:not(.range-row):not(.color-row) {
    grid-template-columns:minmax(0,1fr) auto;
  }
  .settings-v2-row span {
    font-size:12px;
  }
  .settings-v2-row select,
  .settings-v2-row input[type=text] {
    width:112px;
  }
  .settings-v2-row b {
    min-width:38px;
  }
  .settings-v2-quality {
    padding:8px 10px 10px;
  }
  .settings-v2-action {
    width:calc(100% - 20px);
    margin:8px 10px 10px;
  }
}

/* Slider */
.scale-row { display:flex; align-items:center; gap:8px; margin-top:8px; }
.scale-row .cfg-lbl { width:auto; }
.scale-slider {
  flex:1; -webkit-appearance:none; appearance:none; height:4px;
  background:rgba(255,255,255,0.12); border-radius:2px; outline:none;
}
.scale-slider::-webkit-slider-thumb {
  -webkit-appearance:none; width:14px; height:14px; border-radius:50%;
  background:var(--accent); cursor:pointer; border:2px solid rgba(255,255,255,0.3);
}
.scale-val { font-size:11px; color:var(--t2); min-width:28px; text-align:right; }
.scale-val.wide { min-width:44px; color:rgba(255,255,255,0.68); font-weight:800; }
.scale-val-input {
  width:42px !important; min-width:42px; max-width:42px; padding:2px 4px !important;
  font-size:11px; text-align:center; color:var(--t2);
  background:rgba(255,255,255,0.06); border:1px solid transparent !important;
  border-radius:5px; outline:none; transition:border-color .15s;
}
.scale-val-input:hover { border-color:var(--border) !important; }
.scale-val-input:focus { border-color:rgba(10,132,255,0.5) !important; color:var(--t1); background:rgba(255,255,255,0.10); }

/* Scheme G: compact high-value loot rail */
.high-loot-panel {
  --loot-bg-alpha:0;
  --loot-scale:1;
  position:fixed; right:42px; top:38%;
  width:236px; max-width:calc(100vw - 28px);
  z-index:997;
  display:none;
  transform:translateY(-50%) scale(var(--loot-scale));
  transform-origin:right center;
  color:#fff;
  user-select:none;
  cursor:grab;
  touch-action:none;
}
.high-loot-panel.show { display:block; }
.high-loot-panel.dragging { cursor:grabbing; }
.high-loot-shell {
  position:relative;
  overflow:hidden;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.16);
  background:rgba(0,0,0,var(--loot-bg-alpha));
  box-shadow:none;
  backdrop-filter:blur(8px) saturate(130%);
  -webkit-backdrop-filter:blur(8px) saturate(130%);
}
.high-loot-shell::before {
  display:none;
}
.high-loot-head {
  position:relative;
  display:flex; align-items:center; justify-content:space-between;
  height:30px; padding:0 9px;
  background:transparent;
  border-bottom:1px solid rgba(255,255,255,0.12);
}
.high-loot-title {
  font-size:10px; font-weight:900; letter-spacing:1.4px;
  color:rgba(255,255,255,0.92);
}
.high-loot-count {
  font-size:9px; font-weight:800; color:rgba(255,255,255,0.82);
}
.high-loot-list {
  position:relative;
  padding:5px;
  display:flex; flex-direction:column; gap:3px;
}
.high-loot-row {
  min-height:34px;
  display:grid; grid-template-columns:23px 30px minmax(0,1fr) 45px;
  align-items:center; gap:5px;
  padding:4px 6px 4px 4px;
  border-radius:6px;
  background:transparent;
  border:1px solid rgba(255,255,255,0.10);
}
.high-loot-row:nth-child(1) {
  background:transparent;
  border-color:rgba(255,255,255,0.18);
}
.high-loot-rank {
  font-size:10px; font-weight:900;
  color:rgba(255,255,255,0.38);
  text-align:center;
}
.high-loot-row:nth-child(1) .high-loot-rank { color:rgba(255,255,255,0.78); }
.high-loot-icon {
  width:28px; height:28px; border-radius:6px;
  display:flex; align-items:center; justify-content:center;
  background:rgba(0,0,0,0.10);
  border:1px solid rgba(255,255,255,0.10);
  overflow:hidden; flex-shrink:0;
}
.high-loot-icon img {
  width:25px; height:25px; object-fit:contain;
  filter:drop-shadow(0 2px 5px rgba(0,0,0,0.5));
}
.high-loot-icon-fallback {
  width:16px; height:16px; border-radius:50%;
  display:block;
  box-shadow:none;
  border:1px solid rgba(255,255,255,0.22);
  opacity:.92;
}
.high-loot-main { min-width:0; }
.high-loot-name {
  font-size:11px; line-height:1.15; font-weight:800;
  color:rgba(255,255,255,0.92);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.high-loot-meta {
  margin-top:2px;
  font-size:9px; line-height:1.1;
  color:rgba(255,255,255,0.46);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.high-loot-value {
  font-size:11px; font-weight:900;
  color:rgba(255,255,255,0.92); text-align:right;
  text-shadow:0 1px 5px rgba(0,0,0,0.8);
  white-space:nowrap;
}
.high-loot-empty {
  position:relative;
  padding:16px 10px 18px;
  text-align:center;
  font-size:11px; font-weight:700;
  color:rgba(255,255,255,0.40);
}
.high-loot-quality-wrap {
  position:relative;
}
.high-loot-quality-btn {
  width:100%;
  justify-content:space-between;
}
.high-loot-quality-btn span {
  margin-left:auto;
  color:rgba(255,255,255,0.52);
  font-size:10px;
}
.high-loot-quality-pop {
  left:0;
  right:0;
  z-index:140;
}
.team-panel {
  --team-panel-bg-alpha:0;
  --team-panel-scale:1;
  position:fixed; right:42px; top:58%;
  width:200px; max-width:calc(100vw - 28px);
  max-height:70vh;
  z-index:996;
  display:none;
  transform:translateY(-50%) scale(var(--team-panel-scale));
  transform-origin:right center;
  color:#fff;
  user-select:none;
  cursor:default;
  touch-action:auto;
}
.team-panel.show { display:block; }
.team-panel.dragging { cursor:grabbing; }
.team-panel-shell {
  overflow:hidden;
  border-radius:8px;
  border:1px solid rgba(255,255,255,0.16);
  background:rgba(0,0,0,var(--team-panel-bg-alpha));
  box-shadow:none;
  backdrop-filter:blur(8px) saturate(130%);
  -webkit-backdrop-filter:blur(8px) saturate(130%);
}
.team-panel-head {
  display:flex; align-items:center; justify-content:space-between;
  height:30px; padding:0 7px 0 9px;
  border-bottom:1px solid rgba(255,255,255,0.12);
  cursor:grab;
  touch-action:none;
  gap:6px;
}
.team-panel-title {
  font-size:10px; font-weight:900; letter-spacing:1.4px;
  color:rgba(255,255,255,0.92);
  margin-right:auto;
}
.team-panel-count {
  font-size:9px; font-weight:800; color:rgba(255,255,255,0.82);
}
.team-panel-filter {
  height:20px;
  padding:0 6px;
  border-radius:5px;
  border:1px solid rgba(255,255,255,0.16);
  background:rgba(255,255,255,0.06);
  color:rgba(255,255,255,0.62);
  font-size:9px;
  font-weight:900;
  cursor:pointer;
}
.team-panel-filter.active {
  color:#fff;
  border-color:rgba(48,209,88,0.56);
  background:rgba(48,209,88,0.18);
}
.team-panel-list {
  max-height:calc(70vh - 31px);
  overflow:auto;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
  touch-action:pan-y;
  padding:5px;
  display:flex; flex-direction:column; gap:4px;
  scrollbar-width:none;
}
.team-panel-list::-webkit-scrollbar { display:none; }
.team-card-compact {
  --team-color:#fff;
  position:relative;
  min-height:82px;
  border-radius:7px;
  border:1px solid rgba(255,255,255,0.10);
  background:transparent;
  overflow:hidden;
  cursor:default;
}
.team-card-compact::before {
  content:"";
  position:absolute; left:0; top:0; bottom:0; width:3px;
  background:var(--team-color);
}
.team-card-top {
  display:flex; align-items:center; justify-content:space-between;
  padding:6px 8px 1px 10px;
}
.team-card-id {
  font-size:11px; font-weight:900; color:var(--team-color);
}
.team-card-state {
  font-size:10px; font-weight:800; color:var(--team-color);
}
.team-avatar-strip {
  display:flex; gap:7px; padding:4px 8px 6px 10px;
  align-items:flex-start;
  flex-wrap:wrap;
  max-height:68px;
  overflow:hidden;
}
.team-avatar-unit {
  width:38px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-start;
  gap:2px;
  flex:0 0 auto;
}
.team-avatar-info {
  width:56px;
  margin-left:0;
  text-align:center;
  white-space:nowrap;
  transform-origin:center top;
  display:flex;
  flex-direction:column;
  align-items:center;
}
.team-avatar-gear {
  font-size:11px;
  line-height:1.1;
  font-weight:900;
  text-shadow:0 1px 4px rgba(0,0,0,0.9);
}
.team-avatar-weapon {
  margin-top:1px;
  font-size:11px;
  line-height:1.1;
  font-weight:800;
  color:rgba(255,255,255,0.66);
  overflow:hidden;
  text-overflow:ellipsis;
  max-width:56px;
  text-align:center;
}
.team-mini-avatar {
  position:relative;
  width:24px; height:24px; border-radius:50%;
  flex:0 0 auto;
  border:1px solid rgba(255,255,255,0.18);
  background:rgba(255,255,255,0.08);
}
.team-mini-avatar img {
  width:100%; height:100%; border-radius:50%; object-fit:cover;
  display:block;
}
.team-mini-avatar::after {
  content:"";
  position:absolute; inset:-3px;
  border-radius:50%;
  border:3px solid rgba(255,255,255,0.14);
}
.team-mini-avatar .hp-arc {
  position:absolute; inset:-3px; border-radius:50%;
  background:conic-gradient(from -90deg, var(--team-color) calc(var(--hp, 100) * 1%), rgba(255,255,255,0.14) 0);
  -webkit-mask:radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
  mask:radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px));
}
.team-mini-avatar.down {
  background:rgba(80,80,72,0.92);
  border-color:var(--team-color);
}
.team-mini-avatar.dead {
  background:rgba(72,74,82,0.95);
  border-color:rgba(160,165,176,0.58);
}
.team-mini-avatar.unknown {
  background:rgba(72,74,82,0.72);
  border-color:rgba(180,185,196,0.44);
}
.team-mini-avatar.down img { opacity:.32; }
.team-mini-avatar.dead img {
  opacity:.62;
  filter:grayscale(1) brightness(.62);
}
.team-mini-avatar.unknown img {
  opacity:.82;
  filter:grayscale(.75) brightness(.78);
}
.team-mini-avatar .state-word {
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  font-size:13px; font-weight:900;
  z-index:2; text-shadow:0 1px 5px rgba(0,0,0,0.9);
}
.team-mini-avatar.down .state-word { color:#ffd60a; }
.team-mini-avatar.dead .state-word { color:#ff453a; }
.team-panel-empty {
  padding:18px 10px;
  text-align:center;
  font-size:11px; font-weight:700;
  color:rgba(255,255,255,0.40);
}

/* Box config dropdown */
.box-cfg-btn {
  font-size:12px; cursor:pointer; color:var(--t2); padding:0 4px;
  border-radius:4px; transition:color .15s, background .15s; line-height:1; user-select:none;
}
.box-cfg-btn:hover { color:var(--t1); background:rgba(255,255,255,0.08); }
.box-cfg-pop {
  display:none; position:absolute; top:100%; left:0; right:0; z-index:100;
  background:rgba(20,20,34,0.97); backdrop-filter:blur(16px);
  border:1px solid var(--border); border-radius:8px;
  padding:6px 8px; margin-top:2px;
}
.box-cfg-pop.open { display:block; }
.box-chk-row {
  display:flex; align-items:center; gap:6px; padding:4px 2px;
  font-size:11px; font-weight:500; cursor:pointer; border-radius:4px;
}
.box-chk-row:hover { background:rgba(255,255,255,0.06); }
.box-chk-row input[type=checkbox] {
  accent-color:var(--accent); width:14px; height:14px; cursor:pointer;
}

/* Leaflet overrides */
.leaflet-container { background:#0a0a16; }
.leaflet-control-zoom { display:none; }

/* Region labels on map */
.map-region-name {
  overflow:visible !important; background:none !important; border:none !important;
  pointer-events:none !important;
}
.map-region-name span {
  display:inline-block; transform:translate(-50%,-50%);
  white-space:nowrap; font-size:12px; font-weight:600;
  color:rgba(255,255,255,0.82); font-family:-apple-system,'SF Pro Display',sans-serif;
  text-shadow:0 1px 4px rgba(0,0,0,0.95),0 0 8px rgba(0,0,0,0.8);
  letter-spacing:0.3px; pointer-events:none;
}

/* ── Landing Page ── */
.landing-overlay {
  position:fixed; inset:0; z-index:9999;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:14px;
  padding:28px 16px;
  background:radial-gradient(ellipse at 50% 40%, #0f1528 0%, #080810 70%);
  transition:opacity .4s, visibility .4s;
}
.landing-overlay.hidden { opacity:0; visibility:hidden; pointer-events:none; }
.landing-card {
  display:flex; flex-direction:column; align-items:center;
  width:min(390px, calc(100vw - 32px));
  padding:30px 34px 28px; border-radius:22px;
  background:rgba(16,16,30,0.85);
  backdrop-filter:blur(40px) saturate(180%); -webkit-backdrop-filter:blur(40px) saturate(180%);
  border:1px solid rgba(255,255,255,0.10);
  box-shadow:0 22px 70px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.045) inset;
  animation:landingIn .6s ease-out;
}
@keyframes landingIn {
  from { opacity:0; transform:translateY(24px) scale(0.96); }
  to   { opacity:1; transform:translateY(0) scale(1); }
}
.landing-icon {
  width:64px; height:64px; border-radius:18px; overflow:hidden;
  box-shadow:0 4px 20px rgba(10,132,255,0.3);
  margin-bottom:20px;
}
.landing-icon img { width:100%; height:100%; object-fit:cover; }
.landing-title {
  font-size:22px; font-weight:800; color:#fff;
  letter-spacing:.8px; margin:0 0 8px;
}
.landing-desc {
  font-size:13px; color:rgba(255,255,255,0.52); margin:0 0 16px;
}
.landing-tabs {
  display:flex; width:100%; padding:3px; gap:3px; margin-bottom:14px;
  border-radius:10px; background:rgba(255,255,255,0.055);
  border:1px solid rgba(255,255,255,0.09);
}
.landing-tab {
  flex:1; height:32px; border:0; border-radius:8px; cursor:pointer;
  background:transparent; color:rgba(255,255,255,0.52);
  font-size:13px; font-weight:700; font-family:inherit;
}
.landing-tab.active {
  color:#fff; background:rgba(10,132,255,0.28);
  box-shadow:0 0 0 1px rgba(10,132,255,0.22) inset;
}
.landing-tab.disabled {
  color:rgba(255,255,255,0.28);
  background:transparent;
}
.landing-input-wrap {
  display:flex; gap:8px; width:100%;
}
.landing-input {
  flex:1; min-width:0; height:44px; border-radius:10px; border:1px solid rgba(255,255,255,0.12);
  background:rgba(255,255,255,0.06); color:#fff; padding:0 16px;
  font-size:15px; font-family:inherit; outline:none;
  transition:border-color .2s, box-shadow .2s;
}
.landing-input::placeholder { color:rgba(255,255,255,0.25); }
.landing-input:focus {
  border-color:rgba(10,132,255,0.6);
  box-shadow:0 0 0 3px rgba(10,132,255,0.15);
}
.landing-btn {
  height:44px; padding:0 23px; border-radius:10px; border:none;
  background:linear-gradient(135deg, #0A84FF, #0066d6);
  color:#fff; font-size:15px; font-weight:600; cursor:pointer;
  font-family:inherit; transition:transform .15s, box-shadow .15s;
}
.landing-btn:hover { transform:translateY(-1px); box-shadow:0 4px 16px rgba(10,132,255,0.4); }
.landing-btn:active { transform:translateY(0); }
.landing-btn:disabled { opacity:.65; cursor:not-allowed; transform:none; box-shadow:none; }
.landing-btn.ghost {
  background:rgba(255,255,255,0.08);
  border:1px solid rgba(255,255,255,0.12);
}
.landing-hint {
  font-size:11px; color:rgba(255,255,255,0.34); margin:14px 0 0;
}
.activation-result {
  width:100%; margin-top:16px; padding:14px; border-radius:14px;
  background:rgba(255,255,255,0.055);
  border:1px solid rgba(255,255,255,0.09);
}
.result-title {
  color:#fff; font-size:15px; font-weight:700; margin-bottom:12px;
}
.result-row {
  display:flex; align-items:center; justify-content:space-between;
  min-height:28px; color:rgba(255,255,255,0.52); font-size:12px;
}
.result-row b {
  color:#fff; font-size:14px; font-weight:700;
}
.result-link {
  margin-top:10px; padding:10px; border-radius:10px;
  background:rgba(0,0,0,0.22); color:rgba(255,255,255,0.72);
  font-size:12px; line-height:1.4; word-break:break-all;
}
.result-actions {
  display:grid; grid-template-columns:1fr 1fr 1fr; gap:8px; margin-top:12px;
}
.result-actions .landing-btn { width:100%; padding:0 8px; font-size:13px; }
.landing-notice {
  width:min(680px, calc(100vw - 32px));
  max-height:180px;
  padding:16px 20px;
  border-radius:14px;
  background:rgba(16,16,30,0.78);
  backdrop-filter:blur(30px) saturate(170%);
  -webkit-backdrop-filter:blur(30px) saturate(170%);
  border:1px solid rgba(255,255,255,0.10);
  box-shadow:0 16px 48px rgba(0,0,0,0.42), 0 0 0 1px rgba(255,255,255,0.035) inset;
  color:rgba(255,255,255,0.78);
  overflow:auto;
  animation:landingIn .6s ease-out;
}
.landing-notice-title {
  margin-bottom:8px;
  color:rgba(255,255,255,0.92);
  font-size:13px;
  font-weight:700;
}
.landing-notice-body {
  white-space:pre-wrap;
  word-break:break-word;
  font-size:13px;
  line-height:1.7;
}

/* 移动端竖屏：隐藏logo，地名靠左，全屏+状态靠右 */
@media (max-width: 600px) and (orientation: portrait) {
  .topbar-logo { display:none; }
  .topbar-sep { display:none; }
  .topbar {
    height:48px;
    padding:6px 10px 0;
    gap:6px;
    align-items:flex-start;
  }
  .map-tabs {
    min-width:0;
    padding-top:3px;
  }
  .map-tab {
    padding:5px 8px;
    font-size:10px;
    border-radius:9px;
  }
  #btnFullscreen {
    margin-left:auto;
  }
  .fullscreen-pill {
    width:42px;
    height:36px;
    transform:none;
    border-radius:13px;
  }
  .conn-pill {
    min-width:96px;
    max-width:112px;
    height:36px;
    padding:5px 8px;
    margin-right:0;
    transform:none;
    border-radius:13px;
    gap:1px;
  }
  .conn-main {
    min-width:0;
    font-size:10px;
  }
  .conn-main span {
    overflow:hidden;
    text-overflow:ellipsis;
  }
  .conn-rate {
    padding-left:10px;
    font-size:9px;
  }
  .conn-rate b {
    font-size:9px;
  }
  .settings-v2-entry {
    right:12px;
    bottom:max(14px, env(safe-area-inset-bottom));
  }
}

/* 全屏模式：确保所有内容铺满屏幕 */
:fullscreen, :-webkit-full-screen {
  background:var(--bg);
  width:100vw !important; height:100vh !important;
  overflow:hidden;
}
::backdrop, ::-webkit-backdrop { background:var(--bg); }
:fullscreen #map, :-webkit-full-screen #map {
  position:fixed !important; inset:0 !important;
  width:100vw !important; height:100vh !important;
}
