/* iAnnouncer 飞行员 Portal。源文件在 EFB 仓库 tools/portal/src，改完用 tools/portal/deploy.ps1 发布。 */
:root {
  color-scheme: dark;
  --bg: #070a0f;
  --panel: #111722;
  --panel-2: #17202d;
  --line: rgba(188, 203, 222, .14);
  --line-2: rgba(188, 203, 222, .24);
  --text: #f4f8fc;
  --muted: #a9b7c9;
  --dim: #6f7f92;
  --blue: #38bdf8;
  --green: #35d399;
  --amber: #f8c15c;
  --red: #ef6363;
  --violet: #a78bfa;
  --gold: #e0a82e;
  --teal: #5eead4;
  --radius: 14px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}
:root:lang(ja) { font-family: Inter, "Segoe UI", "Yu Gothic UI", "Yu Gothic", YuGothic, "Hiragino Sans", system-ui, sans-serif; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; color: var(--text); line-height: 1.55; font-size: 14px;
  background:
    radial-gradient(circle at 12% -8%, rgba(56, 189, 248, .11), transparent 32rem),
    radial-gradient(circle at 88% -4%, rgba(167, 139, 250, .08), transparent 28rem),
    var(--bg);
  background-attachment: fixed;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--blue); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
.wrap { width: min(1280px, calc(100% - 32px)); margin: 0 auto; padding: 0 0 64px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; margin: 0 -16px 22px; padding: 10px 16px;
  display: flex; align-items: center; gap: 14px;
  background: rgba(7, 10, 15, .78); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 800; flex: none; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand span { line-height: 1.15; }
.brand small { display: block; color: var(--dim); font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.tabs { display: flex; gap: 2px; margin: 0 auto; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: rgba(17, 23, 34, .7); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 15px; border: 0; border-radius: 999px; background: transparent;
  color: var(--muted); font-size: 13px; font-weight: 800; white-space: nowrap; transition: background .15s, color .15s;
}
.tab svg { width: 15px; height: 15px; flex: none; }
.tab:hover { color: var(--text); background: rgba(255, 255, 255, .05); }
.tab.is-on { color: #03111c; background: linear-gradient(180deg, #67d7ff, #22a9e8); }
.tab .dot { min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px; background: var(--gold); color: #1a1203; font-size: 10px; line-height: 17px; text-align: center; }
.top-right { display: flex; align-items: center; gap: 10px; flex: none; margin-left: auto; }
.tabs:not([hidden]) + .top-right { margin-left: 0; }
.zulu { padding: 5px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--blue); font-size: 12px; font-weight: 900; background: rgba(56, 189, 248, .07); }
.langs { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; }
.langs button { border: 0; background: transparent; color: var(--muted); padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.langs button.active { background: rgba(56, 189, 248, .16); color: var(--blue); }

/* ---------- 按键 ---------- */
.btn {
  min-height: 40px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px; font-weight: 800; font-size: 13px; text-decoration: none; transition: transform .15s, background .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { color: #03111c; background: linear-gradient(180deg, #67d7ff, #22a9e8); }
.btn-ghost { border-color: var(--line); background: rgba(255, 255, 255, .05); color: #d7e4f5; }
.btn-ghost:hover { border-color: var(--line-2); }
.btn-sm { min-height: 32px; padding: 0 12px; font-size: 12px; border-radius: 8px; }
.btn[disabled] { opacity: .55; cursor: progress; transform: none; }
.btn svg { width: 15px; height: 15px; }

/* ---------- 访客页 ---------- */
.guest { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 34px; align-items: center; padding: 26px 0 8px; }
.guest h1 { margin: 0 0 12px; font-size: clamp(30px, 4vw, 46px); line-height: 1.08; letter-spacing: -.02em; }
.guest h1 em { font-style: normal; background: linear-gradient(90deg, #67d7ff, #a78bfa); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { margin: 0 0 22px; color: var(--muted); font-size: 15.5px; max-width: 620px; }
.feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.feats li { display: flex; gap: 11px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(17, 23, 34, .6); }
.feats svg { width: 20px; height: 20px; flex: none; color: var(--blue); margin-top: 1px; }
.feats b { display: block; font-size: 13.5px; }
.feats span { color: var(--dim); font-size: 12.5px; }
.login-card {
  padding: 26px; border: 1px solid var(--line); border-radius: 18px;
  background: linear-gradient(180deg, rgba(24, 33, 47, .94), rgba(13, 18, 27, .96)); box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
}
.login-card h2 { margin: 0 0 4px; font-size: 20px; }
.login-card .hint { margin: 0 0 18px; color: var(--dim); font-size: 13px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span { color: #dce8f6; font-size: 12px; font-weight: 800; }
.field input {
  width: 100%; min-height: 44px; padding: 0 13px; border: 1px solid var(--line-2); border-radius: 10px;
  background: rgba(255, 255, 255, .05); color: var(--text); font-size: 15px;
}
.field input:focus { outline: none; border-color: rgba(56, 189, 248, .7); background: rgba(56, 189, 248, .08); }
.key-row { position: relative; }
.key-row input { font-family: var(--mono); text-transform: uppercase; font-size: 13px; padding-right: 44px; }
.key-row button { position: absolute; right: 4px; top: 4px; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--dim); display: grid; place-items: center; }
.key-row button:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.key-row svg { width: 17px; height: 17px; }
.remember { display: flex; align-items: center; gap: 9px; margin: 0 0 16px; cursor: pointer; color: var(--muted); font-size: 13px; font-weight: 700; }
.remember input { width: 16px; height: 16px; accent-color: #22a9e8; }
.login-card .btn { width: 100%; min-height: 46px; font-size: 14px; }
.note { margin: 12px 0 0; color: var(--dim); font-size: 11.5px; line-height: 1.6; }
.msg { margin-top: 14px; padding: 10px 13px; border-radius: 10px; font-size: 13px; font-weight: 700; border: 1px solid rgba(239, 99, 99, .5); background: rgba(239, 99, 99, .1); color: #fecaca; }

/* ---------- 卡片与栅格 ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(180deg, rgba(24, 33, 47, .82), rgba(13, 18, 27, .88)); min-width: 0; }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px 0; flex-wrap: wrap; }
.card-head h3 { margin: 0; font-size: 14px; font-weight: 900; letter-spacing: .01em; }
.card-head .sub { color: var(--dim); font-size: 12px; font-weight: 700; }
.card-foot { padding: 10px 20px 14px; color: var(--dim); font-size: 12px; border-top: 1px solid var(--line); }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
.stack { display: grid; gap: 14px; }
.sec { display: flex; align-items: center; gap: 10px; margin: 30px 0 12px; font-size: 12px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; color: var(--dim); }
.sec::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.sec .tools { order: 3; display: flex; gap: 8px; align-items: center; letter-spacing: 0; text-transform: none; }
.page > .sec:first-child { margin-top: 4px; }
.page { display: none; animation: rise .28s ease both; }
.page.is-on { display: block; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .page, .btn, .bar i, .ring-fg { animation: none !important; transition: none !important; } }

/* ---------- 读数 ---------- */
.tile { padding: 15px 17px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(180deg, rgba(24, 33, 47, .8), rgba(13, 18, 27, .86)); min-width: 0; }
.tile-label { color: var(--dim); font-size: 11px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }
.tile-value { margin-top: 4px; font-size: 25px; font-weight: 900; line-height: 1.15; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile-value small { font-size: 13px; color: var(--muted); font-weight: 800; margin-left: 3px; }
.tile-note { margin-top: 2px; color: var(--dim); font-size: 12px; font-weight: 700; min-height: 1.5em; }
.tile.sm .tile-value { font-size: 19px; }
.c-blue .tile-value { color: var(--blue); } .c-green .tile-value { color: var(--green); } .c-amber .tile-value { color: var(--amber); }
.c-violet .tile-value { color: var(--violet); } .c-red .tile-value { color: var(--red); } .c-gold .tile-value { color: var(--gold); }

/* ---------- 飞行员抬头 ---------- */
.pilot-head {
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 26px; align-items: center;
  padding: 22px 24px; margin-bottom: 16px; border: 1px solid rgba(56, 189, 248, .28); border-radius: 18px;
  background: radial-gradient(circle at 92% 20%, rgba(56, 189, 248, .14), transparent 55%), linear-gradient(180deg, rgba(30, 41, 59, .92), rgba(13, 18, 27, .94));
}
.pilot-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.avatar {
  width: 64px; height: 64px; flex: none; display: grid; place-items: center; border-radius: 18px; font-size: 24px; font-weight: 900; color: #cdeeff;
  background: linear-gradient(145deg, rgba(56, 189, 248, .34), rgba(17, 24, 39, .9)); border: 1px solid rgba(56, 189, 248, .45);
}
.pilot-name { font-size: 22px; font-weight: 900; line-height: 1.2; overflow-wrap: anywhere; }
.pilot-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 13px; font-weight: 700; margin-top: 4px; }
.chips { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: var(--muted); }
.chip.ok { border-color: rgba(53, 211, 153, .45); background: rgba(53, 211, 153, .13); color: #a7f3d0; }
.chip.gold { border-color: rgba(224, 168, 46, .5); background: rgba(224, 168, 46, .13); color: #f5d58a; }
.chip.accent { border-color: rgba(56, 189, 248, .45); background: rgba(56, 189, 248, .13); color: #bfeaff; }
.saved { margin-top: 10px; color: var(--dim); font-size: 11.5px; font-weight: 700; }
.alogo { height: 22px; width: auto; max-width: 78px; object-fit: contain; vertical-align: middle; border-radius: 5px; background: #fff; padding: 2px 5px; }
.badge { display: inline-grid; place-items: center; min-width: 38px; height: 22px; padding: 0 6px; border-radius: 6px; font-family: var(--mono); font-size: 11px; font-weight: 900; letter-spacing: .04em; color: #fff; }

/* 等级阶梯 */
.ladder { display: grid; gap: 10px; min-width: 0; }
.ladder-top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); font-weight: 800; }
.ladder-top b { color: var(--text); font-size: 14px; }
.ladder-track { position: relative; height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); }
.ladder-track i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: linear-gradient(90deg, #22a9e8, #67d7ff); transition: width .7s ease; }
.ladder-steps { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.ladder-step { text-align: center; font-size: 10.5px; font-weight: 800; color: var(--dim); line-height: 1.25; }
.ladder-step::before { content: ''; display: block; width: 9px; height: 9px; margin: 0 auto 5px; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.ladder-step.done { color: var(--muted); } .ladder-step.done::before { background: var(--blue); }
.ladder-step.now { color: var(--text); } .ladder-step.now::before { background: #fff; box-shadow: 0 0 0 4px rgba(56, 189, 248, .35); }

/* ---------- 环 ---------- */
.hero-stats { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 26px; align-items: center; }
.rings { display: flex; gap: 22px; }
.ring { width: 122px; text-align: center; }
.ring svg { width: 108px; height: 108px; display: block; margin: 0 auto; }
.ring-bg { fill: none; stroke: rgba(255, 255, 255, .08); stroke-width: 9; }
.ring-fg { fill: none; stroke: var(--blue); stroke-width: 9; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .9s ease; }
.ring.ok .ring-fg { stroke: var(--green); } .ring.warn .ring-fg { stroke: var(--amber); } .ring.bad .ring-fg { stroke: var(--red); } .ring.gold .ring-fg { stroke: var(--gold); }
.ring text { fill: var(--text); font-weight: 900; font-size: 21px; text-anchor: middle; font-variant-numeric: tabular-nums; }
.ring text.s { fill: var(--dim); font-size: 10.5px; font-weight: 800; }
.ring-label { margin-top: 6px; font-size: 12.5px; font-weight: 900; }
.ring-note { color: var(--dim); font-size: 11.5px; font-weight: 700; min-height: 1.5em; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

/* ---------- 行 ---------- */
.row { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row-main { min-width: 0; flex: 1; }
.row-main b { display: block; font-size: 13.5px; }
.row-main span { color: var(--muted); font-size: 12.5px; }
.row-side { flex: none; text-align: right; font-weight: 900; font-variant-numeric: tabular-nums; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 900; white-space: nowrap; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: var(--muted); }
.tag.ok { border-color: rgba(53, 211, 153, .45); background: rgba(53, 211, 153, .13); color: #a7f3d0; }
.tag.warn { border-color: rgba(248, 193, 92, .45); background: rgba(248, 193, 92, .12); color: #fde3a7; }
.tag.bad { border-color: rgba(239, 99, 99, .5); background: rgba(239, 99, 99, .12); color: #fecaca; }
.tag.info, .tag.accent { border-color: rgba(56, 189, 248, .45); background: rgba(56, 189, 248, .12); color: #bfeaff; }
.tag.gold { border-color: rgba(224, 168, 46, .5); background: rgba(224, 168, 46, .13); color: #f5d58a; }
.tag.violet { border-color: rgba(167, 139, 250, .45); background: rgba(167, 139, 250, .12); color: #ddd0ff; }
.att-tag { min-width: 62px; justify-content: center; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px dashed var(--line); font-size: 13px; color: var(--muted); }
.kv:first-of-type { border-top: 0; }
.kv b { color: var(--text); font-variant-numeric: tabular-nums; }
.big { font-size: 34px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.big-cap { color: var(--dim); font-size: 11px; font-weight: 900; letter-spacing: .07em; text-transform: uppercase; }

/* 航线条 */
.routeline { display: grid; grid-template-columns: auto minmax(60px, 1fr) auto; gap: 14px; align-items: center; }
.rl-code { font-family: var(--mono); font-size: 26px; font-weight: 900; line-height: 1.1; }
.rl-name { color: var(--dim); font-size: 11.5px; font-weight: 700; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rl-end { text-align: right; }
.rl-mid { text-align: center; color: var(--muted); font-size: 12px; font-weight: 800; }
.rl-line { position: relative; height: 2px; margin: 6px 0; background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 11px); }
.rl-line svg { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; transform: translate(-50%, -50%); color: var(--blue); background: #111927; border-radius: 50%; }

/* 进度条 */
.bar { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #22a9e8, #67d7ff); transition: width .7s ease; }
.bar.ok i { background: linear-gradient(90deg, #1fb57f, #35d399); } .bar.gold i { background: linear-gradient(90deg, #c8962a, #f0c257); }
.bar.amber i { background: linear-gradient(90deg, #e8890f, #f8c15c); } .bar.red i { background: linear-gradient(90deg, #f8a15c, #ef6363); }
.prog { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 800; }
.prog .bar { flex: 1; }

/* 每周挑战 / 任务 */
.chals { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.chal { display: flex; flex-direction: column; gap: 9px; padding: 16px 20px; border-left: 1px solid var(--line); }
.chal:first-child { border-left: 0; }
.chal-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.chal-top b { font-size: 13.5px; line-height: 1.35; }
.chal-cat { color: var(--dim); font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.chal.done { background: linear-gradient(180deg, rgba(53, 211, 153, .07), transparent); }

/* 成就 */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.ach { display: flex; flex-direction: column; gap: 13px; padding: 17px 18px; transition: transform .16s, border-color .16s; }
.ach:hover { transform: translateY(-2px); border-color: var(--line-2); }
.ach-head { display: flex; gap: 12px; align-items: flex-start; }
.ach-head b { display: block; font-size: 14.5px; }
.ach-head span { color: var(--muted); font-size: 12.5px; }
.medal { flex: none; width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; background: rgba(255, 255, 255, .05); }
.medal .rib { fill: #56657a; } .medal .disc { fill: #4a586b; } .medal .rim { fill: none; stroke: #2a3443; stroke-width: 1.4; } .medal .star { fill: #2a3443; }
.ach.got .medal { background: linear-gradient(145deg, rgba(224, 168, 46, .3), rgba(224, 168, 46, .08)); box-shadow: inset 0 0 0 1px rgba(224, 168, 46, .42); }
.ach.got .medal .rib { fill: var(--blue); } .ach.got .medal .disc { fill: #e0a82e; } .ach.got .medal .rim { stroke: #c8962a; } .ach.got .medal .star { fill: #fff; }
.ach.got { border-color: rgba(224, 168, 46, .3); }
.ach-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 11px; border-top: 1px solid var(--line); color: var(--dim); font-size: 12px; font-weight: 800; margin-top: auto; }

/* 记录 */
.rec-ic { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--c, var(--blue)); background: color-mix(in srgb, var(--c, var(--blue)) 16%, transparent); }
.rec-ic svg { width: 18px; height: 18px; }

/* 执照 / 航司履历 */
.lic { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; padding: 16px 20px; }
.lic-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255, 255, 255, .03); }
.lic-item.owned { border-color: rgba(53, 211, 153, .4); }
.lic-code { font-family: var(--mono); font-size: 18px; font-weight: 900; }
.lic-sub { color: var(--dim); font-size: 12px; font-weight: 700; }

/* ---------- 图表 / 地图 ---------- */
.chart-box { position: relative; height: 240px; padding: 12px 16px 16px; }
.chart-box.tall { height: 300px; }
.seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 255, 255, .03); }
.seg button { border: 0; background: transparent; color: var(--muted); padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button.is-on { background: rgba(56, 189, 248, .16); color: var(--blue); }
.map { height: 400px; border-radius: 0 0 var(--radius) var(--radius); background: #0b1017; overflow: hidden; }
.map.solo { border-radius: var(--radius); border: 1px solid var(--line); }
.leaflet-container { background: #0b1017; font-family: inherit; }
.leaflet-tile-pane { filter: invert(1) hue-rotate(195deg) brightness(.82) contrast(.92) saturate(.55); }
.leaflet-control-attribution { background: rgba(7, 10, 15, .7) !important; color: var(--dim) !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: var(--muted) !important; }
.leaflet-bar a { background: #131a26 !important; color: var(--text) !important; border-color: var(--line) !important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #131a26; color: var(--text); border: 1px solid var(--line); }
.leaflet-popup-content { margin: 10px 13px; font-size: 13px; font-weight: 700; }
.leaflet-tooltip { background: rgba(7, 13, 21, .92); border: 1px solid rgba(56, 189, 248, .45); color: #cdeeff; font-size: 11px; font-weight: 900; box-shadow: none; padding: 3px 7px; }
.leaflet-tooltip::before { display: none; }
.map-hint { padding: 9px 20px; color: var(--dim); font-size: 12px; font-weight: 700; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.map-hint button { border: 0; background: transparent; color: var(--blue); font-weight: 800; padding: 0; }

/* 活跃度日历 */
.heat { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 13px); grid-auto-columns: 13px; gap: 3px; padding: 14px 20px 6px; overflow-x: auto; justify-content: start; }
.heat i { border-radius: 3px; background: rgba(255, 255, 255, .06); }
.heat i[data-n="1"] { background: rgba(56, 189, 248, .35); } .heat i[data-n="2"] { background: rgba(56, 189, 248, .6); }
.heat i[data-n="3"] { background: rgba(56, 189, 248, .85); } .heat i[data-n="4"] { background: #9be6ff; }
.heat i.off { visibility: hidden; }
.heat-legend { display: flex; align-items: center; gap: 5px; padding: 4px 20px 14px; color: var(--dim); font-size: 11.5px; font-weight: 700; }
.heat-legend i { width: 12px; height: 12px; border-radius: 3px; background: rgba(255, 255, 255, .06); }

/* ---------- 表格 ---------- */
.table-tools > * { min-width: 0; }
.table-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.search { position: relative; flex: 1 1 220px; max-width: 320px; }
.search input { width: 100%; height: 36px; padding: 0 12px 0 34px; border: 1px solid var(--line-2); border-radius: 9px; background: rgba(255, 255, 255, .05); font-size: 13px; }
.search input:focus { outline: none; border-color: rgba(56, 189, 248, .7); }
.search svg { position: absolute; left: 10px; top: 10px; width: 16px; height: 16px; color: var(--dim); pointer-events: none; }
.spacer { flex: 1; }
.count { color: var(--dim); font-size: 12px; font-weight: 800; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--dim); background: rgba(255, 255, 255, .03); font-weight: 900; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; position: sticky; top: 0; }
th button { border: 0; background: transparent; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; padding: 0; display: inline-flex; align-items: center; gap: 4px; }
th button:hover { color: var(--text); }
th button .ar { opacity: .35; font-size: 9px; } th.sorted button { color: var(--blue); } th.sorted .ar { opacity: 1; }
td { color: var(--muted); font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td, tbody tr.click:focus-visible td { background: rgba(56, 189, 248, .06); }
tbody tr.me td { background: rgba(224, 168, 46, .09); }
td.r, th.r { text-align: right; font-variant-numeric: tabular-nums; }
.route { color: var(--text); font-weight: 900; font-family: var(--mono); }
.strong { color: var(--text); font-weight: 900; }
.score { font-weight: 900; } .score.good { color: var(--green); } .score.mid { color: var(--amber); } .score.low { color: var(--red); }
.pos { color: var(--green); } .neg { color: var(--red); }
.rank-no { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; font-size: 11px; font-weight: 900; }
.rank-no.m1 { background: rgba(248, 193, 92, .22); color: #ffd98a; } .rank-no.m2 { background: rgba(203, 213, 225, .18); color: #dbe4ee; } .rank-no.m3 { background: rgba(217, 119, 66, .22); color: #f0b088; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--line); color: var(--dim); font-size: 12px; font-weight: 800; }
.pager button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255, 255, 255, .04); color: var(--text); }
.pager button[disabled] { opacity: .35; cursor: default; }
.empty { padding: 30px 20px; text-align: center; color: var(--dim); font-size: 13.5px; }
.empty b { display: block; color: var(--muted); font-size: 15px; margin-bottom: 4px; }

/* 条形排行 */
.hbar { display: grid; gap: 9px; padding: 16px 20px; }
.hbar-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) 44px; gap: 10px; align-items: center; font-size: 12.5px; font-weight: 800; color: var(--muted); }
.hbar-row .bar { height: 10px; }
.hbar-row b { text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }

/* 全球对比 */
.cmp { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cmp-item { padding: 16px 20px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); display: grid; gap: 8px; }
.cmp-item:nth-child(3n + 1) { border-left: 0; }
.cmp-rank { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cmp-rank b { font-size: 28px; font-weight: 900; line-height: 1.1; }
.cmp-rank span.num { color: var(--dim); font-size: 13px; font-weight: 800; }
.cmp-rank .tag { align-self: center; margin-left: auto; }
.cmp-track { position: relative; padding: 4px 0; }
.cmp-avg { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; border-radius: 2px; background: #fff; opacity: .85; }
.cmp-legend { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; color: var(--dim); font-size: 11.5px; font-weight: 700; }
.cmp-legend b { color: var(--text); }
.linkbtn { border: 0; background: transparent; color: var(--blue); font-weight: 800; padding: 0; }
@media (max-width: 900px) { .cmp { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cmp-item:nth-child(3n + 1) { border-left: 1px solid var(--line); } .cmp-item:nth-child(2n + 1) { border-left: 0; } }
@media (max-width: 560px) { .cmp { grid-template-columns: minmax(0, 1fr); } .cmp-item { border-left: 0 !important; } }

/* ---------- 抽屉 ---------- */
.drawer-back { position: fixed; inset: 0; z-index: 60; background: rgba(3, 6, 10, .6); backdrop-filter: blur(3px); opacity: 0; pointer-events: none; transition: opacity .2s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(440px, 100%); background: #0e141e; border-left: 1px solid var(--line-2); transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column; }
body.drawer-open .drawer-back { opacity: 1; pointer-events: auto; }
body.drawer-open .drawer { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { margin: 0; font-size: 16px; }
.drawer-head button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255, 255, 255, .04); font-size: 16px; }
.drawer-body { padding: 18px 20px 28px; overflow-y: auto; display: grid; gap: 16px; align-content: start; }
.drawer-body h4 { margin: 4px 0 0; color: var(--dim); font-size: 11px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.dgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.dcell { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, .03); }
.dcell span { display: block; color: var(--dim); font-size: 11px; font-weight: 800; }
.dcell b { font-size: 15px; font-variant-numeric: tabular-nums; }
.sbar { display: grid; grid-template-columns: 110px minmax(0, 1fr) 38px; gap: 10px; align-items: center; font-size: 12.5px; color: var(--muted); font-weight: 800; }
.sbar b { text-align: right; color: var(--text); }

/* ---------- 其它 ---------- */
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 80; transform: translate(-50%, 20px); padding: 10px 16px; border-radius: 10px; background: #1b2636; border: 1px solid var(--line-2); font-size: 13px; font-weight: 800; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.skel { border-radius: 12px; background: linear-gradient(90deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .09), rgba(255, 255, 255, .04)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 14px; border: 1px solid rgba(248, 193, 92, .4); border-radius: 12px; background: rgba(248, 193, 92, .08); color: #fde3a7; font-size: 13px; font-weight: 700; }
footer { margin-top: 44px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--dim); font-size: 13px; display: flex; gap: 18px; flex-wrap: wrap; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--blue); }

@media (max-width: 1080px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .pilot-head, .hero-stats { grid-template-columns: minmax(0, 1fr); }
  .rings { justify-content: space-around; }
  .guest { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; }
  .tabs { order: 3; width: 100%; margin: 0; }
  .g2, .g3 { grid-template-columns: minmax(0, 1fr); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .feats { grid-template-columns: minmax(0, 1fr); }
  .chal { border-left: 0; border-top: 1px solid var(--line); } .chal:first-child { border-top: 0; }
  .zulu { display: none; }
  .ring { width: 100px; } .ring svg { width: 92px; height: 92px; }
  .rings { gap: 8px; }
  .map { height: 300px; }
  .ladder-step { font-size: 0; } .ladder-step.now { font-size: 10.5px; }
}
@media (max-width: 480px) { .g4 { grid-template-columns: minmax(0, 1fr); } .tile-value { font-size: 22px; } }
