:root {
  --bg: #0f1216; --panel: #171b21; --panel-2: #1e232b; --line: #2a313b;
  --text: #e6e9ee; --muted: #8b95a3; --faint: #5d6672;
  --accent: #5fb3ff; --good: #4cc38a; --warn: #f2b84b; --bad: #ef6461;
  --combat: #ef6461; --progress: #c792ea; --explore: #4cc38a; --social: #5fb3ff; --server: #f2b84b;
  --radius: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5; }
a { color: var(--accent); }
header {
  display: flex; align-items: center; gap: 16px; padding: 12px 24px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: rgba(15, 18, 22, .92); backdrop-filter: blur(6px); z-index: 1000;
}
header h1 { font-size: 17px; margin: 0; font-weight: 650; letter-spacing: .3px; }
header .spacer { flex: 1; }
.pill { padding: 3px 10px; border-radius: 99px; background: var(--panel-2); border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.pill.good { color: var(--good); border-color: rgba(76, 195, 138, .35); }
.pill.warn { color: var(--warn); border-color: rgba(242, 184, 75, .35); }
.pill.bad { color: var(--bad); border-color: rgba(239, 100, 97, .35); }
main { padding: 18px 24px 40px; display: grid; gap: 16px; grid-template-columns: repeat(12, 1fr); max-width: 1680px; margin: 0 auto; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; min-width: 0; }
.card h2 { font-size: 13px; text-transform: none; color: var(--muted); font-weight: 600; margin: 0 0 10px; display: flex; align-items: center; gap: 8px; }
.card h2 .right { margin-left: auto; font-weight: 400; }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; }
@media (max-width: 1100px) { .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; } main { padding: 12px 16px; } header { padding: 10px 16px; flex-wrap: wrap; } }
.summary p { margin: 0 0 6px; font-size: 15px; }
.summary p:first-child { font-size: 16px; font-weight: 550; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12px; }
.players { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.player { background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; padding: 12px; display: grid; gap: 6px; cursor: pointer; }
.player:hover { border-color: #3a4452; }
.player .top { display: flex; align-items: center; gap: 10px; }
.player img.head { width: 36px; height: 36px; border-radius: 6px; image-rendering: pixelated; background: #222; }
.player .name { font-weight: 650; font-size: 15px; }
.badge { font-size: 12px; padding: 1px 8px; border-radius: 99px; background: #26303c; color: var(--accent); white-space: nowrap; }
.badge.afk { color: var(--faint); } .badge.fight { color: var(--combat); } .badge.mine { color: var(--warn); } .badge.build { color: var(--progress); } .badge.explore { color: var(--good); }
.bar { height: 6px; border-radius: 3px; background: #2a313b; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--bad); }
.bar.food > i { background: #c98a4b; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 12.5px; }
.kv span:nth-child(odd) { color: var(--muted); }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }
#map { height: 560px; border-radius: 8px; background: #0b0d10; }
.leaflet-container { background: #0b0d10 !important; font: inherit; }
.leaflet-tooltip { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--panel-2); color: var(--text); }
.map-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; align-items: center; }
select, input, button, textarea {
  font: inherit; color: var(--text); background: var(--panel-2); border: 1px solid var(--line); border-radius: 7px; padding: 5px 10px;
}
button { cursor: pointer; } button:hover { border-color: #46515f; }
button.primary { background: #1f4f7a; border-color: #2c6aa1; }
button.danger { background: #5a2323; border-color: #8a3333; }
button:disabled { opacity: .5; cursor: default; }
.timeline { max-height: 610px; overflow-y: auto; display: grid; gap: 2px; }
.ev { display: grid; grid-template-columns: 46px 8px 1fr; gap: 8px; align-items: baseline; padding: 4px 2px; border-bottom: 1px solid #1d2229; }
.ev time { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.ev .dot { width: 8px; height: 8px; border-radius: 50%; align-self: center; }
.ev .who { font-weight: 600; margin-right: 4px; }
.ev.day { display: block; color: var(--muted); font-size: 12px; padding: 10px 2px 4px; border: 0; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.chip { font-size: 12px; padding: 2px 9px; border-radius: 99px; border: 1px solid var(--line); background: transparent; color: var(--muted); }
.chip.on { color: var(--text); background: var(--panel-2); }
.chart { width: 100%; height: 120px; display: block; }
.charts { display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.chart-title { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.tabs { display: flex; gap: 6px; margin-bottom: 10px; flex-wrap: wrap; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.ai-answer { white-space: pre-wrap; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-top: 8px; }
.ai-row { display: flex; gap: 8px; }
.ai-row input { flex: 1; }
.ai-list { max-height: 300px; overflow-y: auto; margin-top: 8px; }
.ai-list details { border-bottom: 1px solid var(--line); padding: 6px 0; }
.ai-list summary { cursor: pointer; color: var(--muted); }
.toast { position: fixed; bottom: 18px; right: 18px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; z-index: 2000; max-width: 420px; }
.place-label { background: transparent; border: 0; box-shadow: none; color: #cfd6df; font-size: 11.5px; text-shadow: 0 0 3px #000, 0 0 3px #000; }
.player-label { background: transparent; border: 0; box-shadow: none; color: #fff; font-weight: 650; font-size: 12px; text-shadow: 0 0 3px #000, 0 0 4px #000; }
.leaflet-tooltip.place-label::before, .leaflet-tooltip.player-label::before { display: none; }
code { background: #0b0d10; padding: 1px 5px; border-radius: 4px; }
