:root {
  --bg: #08111f;
  --bg-soft: #0d192b;
  --panel: #101e33;
  --panel-2: #14253d;
  --line: rgba(166, 195, 227, .17);
  --text: #eef5ff;
  --muted: #8fa5bf;
  --accent: #5eead4;
  --blue: #7dd3fc;
  --low: #66e3a4;
  --medium: #f9c74f;
  --high: #ff9f43;
  --critical: #ff5d73;
  --shadow: 0 18px 48px rgba(0, 0, 0, .26);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(circle at 12% 0%, rgba(60, 130, 246, .14), transparent 34rem),
    radial-gradient(circle at 92% 8%, rgba(94, 234, 212, .09), transparent 30rem),
    var(--bg);
  color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans CJK SC", sans-serif;
}

button, input { font: inherit; }
button { cursor: pointer; }

.topbar {
  height: 76px;
  padding: 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 17, 31, .78);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; gap: 13px; align-items: center; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 13px;
  display: grid; place-items: center;
  color: #06201f; font-weight: 900; letter-spacing: -.06em;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  box-shadow: 0 0 28px rgba(94, 234, 212, .25);
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 19px; letter-spacing: .02em; }
.brand p { color: var(--muted); font-size: 12px; margin-top: 2px; }
.top-status { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.sep { width: 1px; height: 14px; background: var(--line); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--medium); box-shadow: 0 0 10px var(--medium); }
.dot.online { background: var(--low); box-shadow: 0 0 10px var(--low); }
.dot.error { background: var(--critical); box-shadow: 0 0 10px var(--critical); }

main { max-width: 1480px; margin: 0 auto; padding: 24px 30px 44px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.58fr) minmax(340px, .82fr);
  gap: 18px;
}
.panel {
  background: linear-gradient(160deg, rgba(20, 37, 61, .94), rgba(12, 24, 42, .94));
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.live-panel { padding: 18px; }
.insight-panel { padding: 22px; display: flex; flex-direction: column; min-height: 380px; }
.panel-head, .section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.eyebrow { display: block; font-size: 10px; letter-spacing: .16em; color: var(--accent); font-weight: 700; margin-bottom: 4px; }
.panel h2, .section-head h2 { font-size: 18px; font-weight: 650; letter-spacing: .01em; }
.head-meta { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: 11px; padding-top: 7px; }
.live-wrap {
  position: relative;
  margin-top: 14px;
  aspect-ratio: 16 / 9;
  border-radius: 13px;
  overflow: hidden;
  background: #02060c;
  border: 1px solid rgba(255,255,255,.08);
}
#live { width: 100%; height: 100%; object-fit: cover; display: block; }
.live-badge {
  position: absolute; left: 12px; bottom: 12px;
  color: #c7fbed; background: rgba(3, 14, 22, .78);
  border: 1px solid rgba(94, 234, 212, .25);
  border-radius: 999px; padding: 5px 10px; font-size: 11px;
}
.live-badge.error { color: #ffc0c7; border-color: rgba(255, 93, 115, .4); }
.crosshair {
  pointer-events: none; position: absolute; inset: 16px;
  background:
    linear-gradient(var(--accent), var(--accent)) left top / 17px 1px no-repeat,
    linear-gradient(var(--accent), var(--accent)) left top / 1px 17px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right top / 17px 1px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right top / 1px 17px no-repeat,
    linear-gradient(var(--accent), var(--accent)) left bottom / 17px 1px no-repeat,
    linear-gradient(var(--accent), var(--accent)) left bottom / 1px 17px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right bottom / 17px 1px no-repeat,
    linear-gradient(var(--accent), var(--accent)) right bottom / 1px 17px no-repeat;
  opacity: .35;
}
.actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
button {
  border: 0; border-radius: 10px; padding: 10px 16px; color: var(--text);
  transition: transform .15s ease, opacity .15s ease, background .15s ease;
}
button:hover { transform: translateY(-1px); }
button:disabled { opacity: .5; cursor: wait; transform: none; }
.primary { background: linear-gradient(135deg, #5eead4, #38bdf8); color: #06202d; font-weight: 800; }
.ghost { background: rgba(255,255,255,.055); border: 1px solid var(--line); }
.hint { color: var(--muted); font-size: 11px; margin-left: auto; }

.risk-pill {
  padding: 5px 10px; border-radius: 999px; font-size: 11px; font-weight: 800;
  letter-spacing: .04em; border: 1px solid currentColor;
}
.risk-pill.none { color: var(--muted); }
.risk-pill.low { color: var(--low); background: rgba(102, 227, 164, .08); }
.risk-pill.medium { color: var(--medium); background: rgba(249, 199, 79, .08); }
.risk-pill.high { color: var(--high); background: rgba(255, 159, 67, .08); }
.risk-pill.critical { color: var(--critical); background: rgba(255, 93, 115, .08); }
.summary { margin-top: 24px; color: #c9d8e9; font-size: 15px; line-height: 1.75; min-height: 74px; }
.metric-row {
  margin-top: auto; padding-top: 22px; display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line); gap: 8px;
}
.metric strong { display: block; font-size: 24px; letter-spacing: -.04em; }
.metric span { color: var(--muted); font-size: 11px; }
.last-hazards { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; }
.last-hazard {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: rgba(255,255,255,.025); color: #dce9f8; font-size: 12px;
}
.last-hazard b { color: var(--text); }
.notice {
  margin-top: 16px; padding: 10px 12px; display: flex; gap: 9px;
  border-radius: 10px; background: rgba(249, 199, 79, .07);
  color: #e8c66c; font-size: 11px; line-height: 1.55;
}
.notice-mark { font-weight: 900; }

.events-section { margin-top: 28px; }
.section-head { align-items: end; margin-bottom: 14px; }
.filters { display: flex; gap: 6px; }
.filter { padding: 7px 12px; border-radius: 8px; background: transparent; color: var(--muted); border: 1px solid transparent; font-size: 12px; }
.filter.active { color: var(--text); background: rgba(255,255,255,.06); border-color: var(--line); }
.event-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.event-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  overflow: hidden; box-shadow: 0 8px 26px rgba(0,0,0,.16);
}
.event-image { position: relative; aspect-ratio: 16 / 9; background: #02060c; overflow: hidden; }
.event-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bbox {
  position: absolute; border: 2px solid var(--critical); border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.55), inset 0 0 0 1px rgba(255,255,255,.15);
  pointer-events: none;
}
.event-body { padding: 14px; }
.event-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.event-time { color: var(--muted); font-size: 11px; }
.event-body h3 { font-size: 14px; margin-top: 9px; }
.event-summary { color: var(--muted); font-size: 12px; margin-top: 4px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { font-size: 10px; color: #c3d4e7; padding: 3px 7px; border: 1px solid var(--line); border-radius: 999px; }
.review-row { display: flex; gap: 8px; margin-top: 12px; }
.review-row button { padding: 7px 10px; font-size: 11px; }
.review-row .ok { background: rgba(102, 227, 164, .12); color: var(--low); border: 1px solid rgba(102, 227, 164, .25); }
.review-row .no { background: rgba(255, 93, 115, .09); color: #ff9aa8; border: 1px solid rgba(255, 93, 115, .2); }
.status-text { margin-left: auto; color: var(--muted); font-size: 11px; align-self: center; }
.empty { display: none; color: var(--muted); border: 1px dashed var(--line); border-radius: 14px; padding: 34px; text-align: center; }

.token-box { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(2, 7, 14, .78); }
.token-box.hidden { display: none; }
.token-card { width: min(420px, calc(100vw - 40px)); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: var(--shadow); }
.token-card p { color: var(--muted); margin: 8px 0 15px; }
.token-card input { width: 100%; padding: 11px 12px; border-radius: 9px; border: 1px solid var(--line); background: #07101c; color: var(--text); margin-bottom: 12px; outline: none; }
.toast {
  position: fixed; right: 24px; bottom: 24px; max-width: 360px; padding: 11px 14px;
  border-radius: 10px; background: #15263c; border: 1px solid var(--line);
  color: #dce9f8; box-shadow: var(--shadow); opacity: 0; transform: translateY(8px);
  pointer-events: none; transition: .2s ease; font-size: 12px;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .event-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .topbar { padding: 0 16px; }
  main { padding: 16px; }
  .top-status { display: none; }
  .event-grid { grid-template-columns: 1fr; }
  .hint { display: none; }
}

