:root {
  --bg: #070b12;
  --panel: rgba(13, 20, 33, 0.92);
  --line: rgba(120, 160, 220, 0.16);
  --ink: #dce6f5;
  --dim: #7f8ea6;
  --accent: #6ee7b7;
  --gold: #fbbf24;
  --red: #f87171;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}

#app { max-width: 980px; margin: 0 auto; padding: 18px 14px 30px; }

header h1 { font-size: 24px; }
header h1 .latin { color: var(--dim); font-size: 13px; letter-spacing: 0.28em; margin-left: 8px; font-weight: 500; }
.tagline { color: var(--dim); font-size: 13.5px; margin: 4px 0 14px; }

.strip { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip {
  font-size: 13px; padding: 5px 12px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line);
}
.chip span { color: var(--accent); }
.chip.alert { border-color: rgba(248,113,113,0.6); animation: blink 1.2s ease 3; }
.chip.alert span { color: var(--red); }
@keyframes blink { 50% { opacity: 0.4; } }
.chip.clock span { color: var(--ink); font-variant-numeric: tabular-nums; }

.map-wrap { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); margin-bottom: 14px; }
#map { height: 420px; background: #0a1220; }
#add-btn {
  position: absolute; top: 12px; right: 12px; z-index: 1000;
  all: unset; cursor: pointer;
  background: var(--accent); color: #04110b;
  font-weight: 700; font-size: 14px;
  padding: 10px 18px; border-radius: 999px;
  box-shadow: 0 6px 24px -6px #000;
}
#add-btn:hover { filter: brightness(1.1); }

.pulse-pin {
  position: relative; width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; background: rgba(13,20,33,0.92);
  border: 1px solid var(--line); border-radius: 50% 50% 50% 4px;
  transform: rotate(-45deg);
  box-shadow: 0 4px 14px -4px #000;
}
.pulse-pin > * { transform: rotate(45deg); }
.pulse-pin.hot { border-color: var(--accent); }
.pulse-pin i {
  position: absolute; inset: -6px; border-radius: 50%;
  border: 2px solid rgba(110,231,183,0.5);
  animation: ripple 2.4s ease-out infinite;
}
@keyframes ripple { from { transform: scale(0.6); opacity: 1; } to { transform: scale(1.5); opacity: 0; } }

.pop { font-size: 13.5px; min-width: 180px; }
.pop p { margin: 4px 0; }
.pop-meta { color: var(--dim); font-size: 12px; }
.pop-actions { display: flex; gap: 6px; margin-top: 6px; }
.pop-actions button, .acts button {
  all: unset; cursor: pointer; font-size: 12.5px;
  border: 1px solid var(--line); border-radius: 7px; padding: 4px 10px;
  background: rgba(255,255,255,0.05);
}
.pop-actions button:hover, .acts button:hover { background: rgba(110,231,183,0.18); }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px;
}
.card h2 { font-size: 14px; letter-spacing: 0.1em; color: var(--dim); margin-bottom: 10px; }
.card h2 small { font-weight: 400; margin-left: 6px; color: var(--accent); }

#feed { list-style: none; }
#feed li { display: flex; align-items: center; gap: 12px; padding: 9px 2px; border-bottom: 1px dashed rgba(255,255,255,0.06); }
#feed li.empty { color: var(--dim); justify-content: center; padding: 18px; }
#feed .k { font-size: 20px; }
#feed .body { flex: 1; min-width: 0; font-size: 14px; }
#feed .meta { color: var(--dim); font-size: 12px; }
#feed .acts { display: flex; gap: 6px; }

.sheet { position: fixed; inset: 0; z-index: 2000; background: rgba(2,5,10,0.72); display: flex; align-items: center; justify-content: center; padding: 16px; }
.sheet[hidden] { display: none; }
.sheet-inner { width: 100%; max-width: 420px; position: relative; }
.sheet-close { position: absolute; top: 10px; right: 12px; border: none !important; font-size: 20px; }
#kind-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
#kind-grid button {
  all: unset; cursor: pointer; text-align: center; font-size: 12px; line-height: 1.4;
  background: rgba(255,255,255,0.05); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 4px;
}
#kind-grid button:hover { background: rgba(110,231,183,0.14); }
#kind-grid button { font-size: 22px; }
.sheet .hint { color: var(--dim); font-size: 12.5px; margin: 10px 0; }
.sheet input {
  width: 100%; background: rgba(255,255,255,0.05); border: 1px solid var(--line);
  color: var(--ink); border-radius: 9px; padding: 10px 12px; font: inherit; margin-bottom: 12px;
}
.sheet .row { display: flex; gap: 8px; }
button.primary {
  all: unset; cursor: pointer; flex: 1; text-align: center;
  background: var(--accent); color: #04110b; font-weight: 700;
  border-radius: 9px; padding: 10px;
}
button.primary:disabled { opacity: 0.5; }

footer { color: var(--dim); font-size: 12px; margin-top: 16px; }
footer a { color: var(--dim); }
footer a:hover { color: var(--accent); }

@media (max-width: 640px) {
  #map { height: 340px; }
  #kind-grid button { font-size: 18px; }
}
