:root {
  --bg: #0b1220;
  --panel: rgba(12, 18, 32, 0.92);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f4f7fb;
  --muted: #9aa8bd;
  --accent: #6ec8ff;
  --green: #3dd68c;
  --blue: #5b8cff;
  --gray: #8b95a8;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: "SF Pro Text", "PingFang HK", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
}

#app { position: relative; width: 100%; height: 100%; }
#c { display: block; width: 100%; height: 100%; touch-action: none; }

.chrome {
  position: absolute;
  z-index: 5;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  gap: 12px;
}
.brand {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: rgba(8, 14, 26, 0.72);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 12px 16px;
  pointer-events: auto;
  max-width: min(560px, 92vw);
}
.brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  margin-top: 7px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  flex-shrink: 0;
}
.brand h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0.02em;
}
.hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.meta {
  pointer-events: none;
  font-size: 12px;
  color: var(--muted);
  background: rgba(8, 14, 26, 0.55);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  backdrop-filter: blur(8px);
}

.filters {
  position: absolute;
  z-index: 5;
  top: 88px;
  left: 16px;
  right: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  pointer-events: none;
}
.filters button {
  pointer-events: auto;
  border: 1px solid var(--line);
  background: rgba(8, 14, 26, 0.72);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.filters button:hover { border-color: rgba(110, 200, 255, 0.5); }
.filters button.active {
  background: rgba(110, 200, 255, 0.18);
  border-color: rgba(110, 200, 255, 0.7);
  color: #dff3ff;
}
.filters button:active { transform: scale(0.98); }

.panel {
  position: absolute;
  z-index: 6;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  width: min(320px, calc(100vw - 32px));
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 18px 16px;
  backdrop-filter: blur(16px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}
.panel.hidden { display: none; }
.panel .close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}
.panel-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.panel-status::before {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--status, var(--gray));
  box-shadow: 0 0 10px var(--status, var(--gray));
}
.panel h2 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
}
.panel .title {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 14px;
}
.panel dl {
  margin: 0;
  display: grid;
  gap: 10px;
}
.panel dl > div {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 8px;
  font-size: 13px;
}
.panel dt { color: var(--muted); margin: 0; }
.panel dd { margin: 0; }
.panel .note {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.legend {
  position: absolute;
  z-index: 5;
  left: 16px;
  bottom: 16px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  background: rgba(8, 14, 26, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--muted);
  backdrop-filter: blur(10px);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .s {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.legend .green { background: var(--green); box-shadow: 0 0 8px var(--green); }
.legend .blue { background: var(--blue); box-shadow: 0 0 8px var(--blue); }
.legend .gray { background: var(--gray); }

@media (max-width: 720px) {
  .meta { display: none; }
  .panel {
    top: auto;
    bottom: 72px;
    right: 12px;
    left: 12px;
    width: auto;
    transform: none;
  }
  .filters { top: 96px; }
}
