:root {
  --bg: #0b0f0c;
  --panel: #131a15;
  --panel-2: #1a231c;
  --line: #2a382d;
  --text: #e8efe8;
  --muted: #93a596;
  --accent: #f5b301;
  --accent-dim: #6b5410;
  --radius: 12px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(circle at 15% 0%, rgba(245, 179, 1, 0.08), transparent 42%),
    radial-gradient(circle at 90% 10%, rgba(80, 200, 120, 0.06), transparent 40%);
  min-height: 100vh;
}

/* ---------- topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 17, 13, 0.9);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 30;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 14px; }

.brand-mark {
  font-weight: 800;
  letter-spacing: 2px;
  font-size: 12px;
  color: #0b0f0c;
  background: var(--accent);
  padding: 6px 10px;
  border-radius: 6px;
  transform: skewX(-6deg);
}

.brand-text h1 { margin: 0; font-size: 19px; letter-spacing: 1px; }
.brand-text p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }

.tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.search input {
  width: 300px;
  max-width: 60vw;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 179, 1, 0.15);
}

.view-toggle {
  display: flex;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}
.view-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 7px 18px;
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  transition: all .15s;
}
.view-btn.is-active { background: var(--accent); color: #0b0f0c; font-weight: 700; }

.add-btn {
  border: 1px solid var(--accent);
  background: rgba(245, 179, 1, 0.12);
  color: var(--accent);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
}
.add-btn:hover { background: var(--accent); color: #0b0f0c; }

/* ---------- filters ---------- */
.filters {
  display: flex;
  gap: 10px;
  padding: 14px 24px 4px;
  flex-wrap: wrap;
}

.chip {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all .15s;
}
.chip:hover { color: var(--text); border-color: #3a4d3f; }
.chip.is-active { border-color: var(--accent); color: var(--text); background: var(--panel-2); }
.chip .dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; display: inline-block; }
.chip em { font-style: normal; color: var(--muted); font-size: 12px; }

/* ---------- stage ---------- */
.stage { padding: 16px 24px 8px; }

.map-view { display: block; }

.map-frame {
  position: relative;
  width: min(100%, 900px);
  margin: 0 auto;
  aspect-ratio: 4096 / 4240;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #081825;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.map-canvas {
  position: absolute;
  inset: 0;
  transform-origin: 0 0;
  will-change: transform;
}
.map-frame.is-zoomed .map-canvas { cursor: grab; }
.map-canvas.is-dragging { cursor: grabbing !important; }
.map-frame.is-picking,
.map-frame.is-picking .map-canvas { cursor: crosshair !important; }

.base-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

/* ---------- zoom controls ---------- */
.zoom-controls {
  position: absolute;
  right: 12px;
  top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 6;
}
.zoom-controls button {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(8, 14, 10, 0.86);
  color: var(--text);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: all .15s;
}
.zoom-controls button:hover { border-color: var(--accent); color: var(--accent); }
.zoom-controls button:disabled { opacity: .35; cursor: default; }

.zoom-hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--muted);
  background: rgba(8, 14, 10, 0.75);
  padding: 4px 10px;
  border-radius: 7px;
  z-index: 6;
  white-space: nowrap;
  pointer-events: none;
}

/* ---------- markers ---------- */
.marker-layer { position: absolute; inset: 0; pointer-events: none; }

.marker {
  position: absolute;
  width: 30px;
  height: 30px;
  transform: translate(-50%, -50%) scale(var(--inv, 1));
  transform-origin: center center;
  pointer-events: auto;
  cursor: pointer;
  border: 0;
  background: transparent;
  padding: 0;
  z-index: 2;
}

.marker .pin {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 2px solid #0b0f0c;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  transition: transform .15s;
}

.marker::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0;
}

.marker:hover .pin,
.marker.is-active .pin { transform: scale(1.35); }

.marker.is-active::after {
  opacity: .8;
  animation: pulse 1.6s ease-out infinite;
}

@keyframes pulse {
  0%   { transform: scale(.7); opacity: .8; }
  100% { transform: scale(2.2); opacity: 0; }
}

.marker.is-user .pin {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35), 0 2px 8px rgba(0, 0, 0, 0.6);
}
.marker.is-user::before {
  content: "★";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -52%);
  font-size: 11px;
  color: #0b0f0c;
  z-index: 1;
  pointer-events: none;
}

.marker .label {
  position: absolute;
  left: 50%;
  top: -8px;
  transform: translate(-50%, -100%);
  white-space: nowrap;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(8, 14, 10, 0.92);
  border: 1px solid var(--line);
  color: var(--text);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s;
}
.marker:hover .label,
.marker.is-active .label { opacity: 1; }

/* ---------- legend ---------- */
.map-legend {
  position: absolute;
  left: 12px;
  bottom: 12px;
  background: rgba(8, 14, 10, 0.85);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
  z-index: 5;
  backdrop-filter: blur(4px);
}
.legend-title { display: block; color: var(--muted); margin-bottom: 7px; letter-spacing: 1px; }
.legend-items { display: flex; flex-direction: column; gap: 5px; }
.legend-items span { display: inline-flex; align-items: center; gap: 7px; color: var(--text); }
.legend-items i { width: 10px; height: 10px; border-radius: 50%; border: 1px solid #0b0f0c; }

.map-note {
  position: absolute;
  right: 12px;
  bottom: 12px;
  font-size: 11px;
  color: var(--muted);
  background: rgba(8, 14, 10, 0.75);
  padding: 5px 9px;
  border-radius: 8px;
  z-index: 5;
}

/* ---------- list ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: transform .15s, border-color .15s;
  position: relative;
  overflow: hidden;
}
.card:hover { transform: translateY(-3px); border-color: #3a4d3f; }
.card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--card-accent, var(--accent));
}
.card-cover {
  margin: -16px -16px 14px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #0d1410;
}
.card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.card h3 { margin: 0; font-size: 16px; }
.mine-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: #0b0f0c;
  background: var(--accent);
  border-radius: 4px;
  padding: 1px 5px;
  vertical-align: middle;
  margin-left: 4px;
}
.card .region { font-size: 12px; color: var(--muted); }
.card p { margin: 8px 0 0; font-size: 13px; color: #b9c8b9; line-height: 1.6; }

.card-act {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: rgba(8, 14, 10, 0.82);
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s, color .15s, border-color .15s;
  z-index: 2;
}
.card:hover .card-act { opacity: 1; }
.card-act:hover { border-color: #e85d75; color: #e85d75; }
.card-act.restore { font-size: 12px; font-weight: 700; opacity: 1; }
.card-act.restore:hover { border-color: var(--accent); color: var(--accent); }

.card.is-hidden { opacity: .5; }
.card.is-hidden .card-cover img { filter: grayscale(1); }
.card-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.tag {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--panel-2);
}
.tag.type-tag { font-weight: 700; }

.empty-hint { color: var(--muted); text-align: center; padding: 40px 0; }

/* ---------- guide ---------- */
.guide { padding: 32px 24px 8px; max-width: 1200px; margin: 0 auto; }
.guide h2 { font-size: 18px; margin: 0 0 20px; letter-spacing: 1px; }

.guide-block { margin-bottom: 32px; }
.guide-block:last-child { margin-bottom: 0; }

.guide-sub {
  font-size: 15px;
  margin: 0 0 14px;
  color: var(--text);
  letter-spacing: 1px;
  padding-left: 11px;
  border-left: 3px solid var(--accent);
  line-height: 1.2;
}

.guide-note {
  margin: -4px 0 14px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7;
}

/* ---------- poison table ---------- */
.poison-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  margin-bottom: 16px;
}
.poison-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  min-width: 460px;
}
.poison-table th,
.poison-table td {
  padding: 11px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.poison-table thead th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 1px;
  background: var(--panel-2);
}
.poison-table tbody tr:last-child td { border-bottom: 0; }
.poison-table tbody tr:hover { background: rgba(245, 179, 1, 0.05); }
.poison-table td:first-child { color: var(--text); font-weight: 700; }
.poison-table td:nth-child(2) { color: #b9c8b9; }
.poison-table .time {
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.poison-tips {
  margin: 0;
  padding: 16px 18px 16px 38px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.poison-tips li {
  font-size: 13px;
  color: #b9c8b9;
  line-height: 1.7;
  margin-bottom: 7px;
}
.poison-tips li:last-child { margin-bottom: 0; }

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 30px 24px 40px;
}

/* ---------- detail drawer ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 40;
  opacity: 0;
  transition: opacity .2s;
}
.backdrop.is-open { opacity: 1; }

.detail {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 400px;
  max-width: 92vw;
  background: var(--panel);
  border-left: 1px solid var(--line);
  z-index: 50;
  transform: translateX(105%);
  transition: transform .24s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.detail.is-open { transform: translateX(0); }

.detail-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.detail-close:hover { border-color: var(--accent); color: var(--accent); }

.detail-body { padding: 26px 22px 40px; }

.detail-body .kicker {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.detail-body h2 { margin: 0 0 6px; font-size: 23px; }
.detail-body .sub { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.detail-body .tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.detail-body .desc { font-size: 14px; line-height: 1.8; color: #cdd9cd; margin-bottom: 22px; }

.hidden-banner {
  background: rgba(232, 93, 117, 0.12);
  border: 1px solid rgba(232, 93, 117, 0.4);
  color: #f0a0b0;
  font-size: 12.5px;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
}
.detail-body h4 {
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 1px;
  margin: 0 0 10px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}
.detail-body ol { margin: 0; padding-left: 20px; }
.detail-body li { font-size: 13.5px; line-height: 1.75; color: #cdd9cd; margin-bottom: 9px; }

/* ---------- place hint ---------- */
.place-hint {
  position: fixed;
  top: 88px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  background: var(--accent);
  color: #0b0f0c;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  animation: bounceIn .2s ease;
}
@keyframes bounceIn {
  from { opacity: 0; transform: translate(-50%, -8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.map-frame.is-picking { cursor: crosshair; }
.map-frame.is-picking .base-map { filter: brightness(0.72); }
.map-frame.is-picking .marker,
.map-frame.is-picking .map-legend,
.map-frame.is-picking .map-note { pointer-events: none; }

.pick-marker {
  position: absolute;
  width: 32px;
  height: 32px;
  transform: translate(-50%, -50%) scale(var(--inv, 1));
  transform-origin: center center;
  z-index: 20;
  pointer-events: none;
}
.pick-marker::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid #fff;
  box-shadow: 0 0 0 4px rgba(245, 179, 1, 0.35), 0 4px 12px rgba(0, 0, 0, 0.6);
}
.pick-marker::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid var(--accent);
  animation: pulse 1.4s ease-out infinite;
}

/* ---------- modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.7);
  overflow-y: auto;
}

.modal-panel {
  position: relative;
  width: 560px;
  max-width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 24px 24px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
}

.modal-panel h2 { margin: 0 0 20px; font-size: 20px; }

.point-form { display: flex; flex-direction: column; gap: 15px; }

.field { display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 0; }
.field > span { font-size: 13px; color: var(--muted); }
.field > span i { color: var(--accent); font-style: normal; }

.field input[type="text"],
.field textarea,
.field select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input[type="text"]:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 179, 1, 0.15);
}
.field textarea { resize: vertical; line-height: 1.6; }

.field input[type="file"] {
  font-size: 13px;
  color: var(--muted);
  padding: 9px 10px;
  border: 1px dashed var(--line);
  border-radius: 9px;
  background: var(--panel-2);
  width: 100%;
}
.field input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 6px 14px;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: #0b0f0c;
  font-weight: 700;
  cursor: pointer;
}

.field-row { display: flex; gap: 14px; }

.coord-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 14px;
  min-height: 41px;
}
.coord-box #fCoord { color: var(--text); font-variant-numeric: tabular-nums; }
.coord-box #fCoord.is-empty { color: var(--muted); }

.mini-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 5px 12px;
  border-radius: 7px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.mini-btn:hover { border-color: var(--accent); color: var(--accent); }

.img-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.img-thumb {
  position: relative;
  width: 76px;
  height: 76px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--panel-2);
}
.img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-thumb button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.img-thumb button:hover { background: #e85d75; }

.form-error {
  margin: 0;
  color: #e85d75;
  font-size: 13px;
  background: rgba(232, 93, 117, 0.1);
  border: 1px solid rgba(232, 93, 117, 0.35);
  border-radius: 8px;
  padding: 9px 12px;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}
.btn-ghost, .btn-primary {
  padding: 10px 22px;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--line);
}
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); border-color: #3a4d3f; }
.btn-primary { background: var(--accent); color: #0b0f0c; border-color: var(--accent); }
.btn-primary:hover { filter: brightness(1.08); }

/* ---------- detail gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 0 0 22px;
}
.gallery img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: block;
  cursor: zoom-in;
  transition: transform .15s;
}
.gallery img:hover { transform: scale(1.02); }
.gallery img:first-child:nth-last-child(1) { grid-column: span 2; }

.detail-actions {
  display: flex;
  gap: 10px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.detail-actions button {
  flex: 1;
  padding: 10px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
}
.detail-actions button:hover { border-color: var(--accent); color: var(--accent); }
.detail-actions button.danger:hover { border-color: #e85d75; color: #e85d75; }

/* ---------- lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  z-index: 120;
  max-width: 90vw;
  padding: 12px 18px;
  border-radius: 10px;
  background: #1c2620;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 720px) {
  .brand-text h1 { font-size: 16px; }
  .search input { width: 100%; max-width: none; }
  .tools { width: 100%; }
  .search { flex: 1; }
  .map-note { display: none; }
  .stage, .filters { padding-left: 14px; padding-right: 14px; }
}
