:root {
  --bg: #0f1419;
  --panel: #182028;
  --text: #eef3f7;
  --muted: #93a4b3;
  --line: rgba(255, 255, 255, 0.08);
  --accent: #2f9e7a;
  --accent-2: #d9a441;
  --danger: #d96a6a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font);
  color: var(--text);
  background: radial-gradient(circle at top, #1b2733, var(--bg) 55%);
}

a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, Consolas, monospace; }

.topbar {
  position: fixed;
  z-index: 20;
  inset: 16px 16px auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(15, 20, 25, 0.72);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.brand { font-weight: 700; letter-spacing: 0.04em; }
.topbar-meta { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.92rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0.55rem 0.95rem;
  font: inherit;
  cursor: pointer;
  background: transparent;
  color: var(--text);
}
.btn-primary { background: var(--accent); color: #04140f; font-weight: 600; }
.btn-ghost { border-color: var(--line); background: rgba(255,255,255,0.03); }
.btn:hover { filter: brightness(1.05); }

.map {
  position: fixed;
  inset: 0;
  background: #101820;
}

.panel {
  position: fixed;
  z-index: 25;
  right: 16px;
  bottom: 16px;
  width: min(360px, calc(100vw - 32px));
  padding: 18px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(18, 26, 34, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}
.panel[hidden] { display: none; }
.panel-close {
  position: absolute;
  top: 10px;
  right: 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
}
.panel-cover {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 12px;
}
.panel h2 { margin: 0 0 6px; font-size: 1.35rem; }
.panel-date { margin: 0 0 10px; color: var(--accent-2); font-size: 0.92rem; }
.panel-note { margin: 0; color: var(--muted); line-height: 1.55; white-space: pre-wrap; }

.page-auth {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.auth-card {
  width: min(400px, 100%);
  display: grid;
  gap: 14px;
  padding: 28px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(18, 26, 34, 0.9);
  box-shadow: var(--shadow);
}
.auth-card h1 { margin: 0; font-size: 1.5rem; }
.auth-card label { display: grid; gap: 6px; color: var(--muted); font-size: 0.92rem; }
.auth-card input,
.edit-fields input,
.edit-fields textarea,
.search-row input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.7rem 0.8rem;
  background: rgba(255,255,255,0.03);
  color: var(--text);
  font: inherit;
}
.link-back { color: var(--muted); font-size: 0.9rem; }

.alert {
  margin: 0;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  font-size: 0.92rem;
}
.alert-error { background: rgba(217, 106, 106, 0.15); color: #ffb4b4; }
.alert-success { background: rgba(47, 158, 122, 0.15); color: #9ee0c8; }

.page-admin { padding: 96px 20px 40px; }
.admin-wrap { width: min(980px, 100%); margin: 0 auto; }
.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.admin-head h1, .admin-edit h1 { margin: 0 0 16px; }

.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(18, 26, 34, 0.72);
}
.table th, .table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.table th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.table tr:last-child td { border-bottom: 0; }
.actions { display: flex; gap: 12px; align-items: center; }
.actions form { margin: 0; }
.link-danger {
  border: 0;
  background: transparent;
  color: var(--danger);
  font: inherit;
  cursor: pointer;
  padding: 0;
}
.empty {
  padding: 28px;
  border-radius: 14px;
  border: 1px dashed var(--line);
  color: var(--muted);
}

.edit-grid {
  display: grid;
  grid-template-columns: minmax(280px, 380px) 1fr;
  gap: 20px;
}
.edit-fields { display: grid; gap: 12px; align-content: start; }
.edit-fields label { display: grid; gap: 6px; color: var(--muted); font-size: 0.92rem; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: flex; gap: 10px; margin-top: 6px; }
.cover-preview {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 12px;
}
.edit-map-wrap { display: grid; gap: 10px; align-content: start; }
.picker-map {
  height: min(520px, 70vh);
  border-radius: 14px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #101820;
}
.search-row { display: flex; gap: 8px; }
.search-results {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.search-results .search-error { color: #d96a6a; }
.search-results li button {
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
  background: rgba(255,255,255,0.03);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

@media (max-width: 860px) {
  .edit-grid { grid-template-columns: 1fr; }
  .topbar { inset: 10px 10px auto; }
  .panel { right: 10px; left: 10px; width: auto; bottom: 10px; }
  .table { display: block; overflow-x: auto; }
}
