:root {
  --ink: #edf7ff;
  --muted: #9eb4c8;
  --panel: rgba(18, 30, 49, 0.82);
  --panel-solid: #121e31;
  --line: rgba(166, 209, 226, 0.18);
  --field: rgba(239, 248, 255, 0.08);
  --accent: #50d4c7;
  --accent-strong: #9eece5;
  --amber: #f0b75b;
  --green: #74c981;
  --blue: #7cb8ff;
  --water: #77d6f6;
  --building: #ee927c;
  --road: #9fb2c1;
  --land: #d9bd72;
  --shadow: 0 22px 64px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  color: var(--ink);
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background:
    radial-gradient(circle at 12% 18%, rgba(116, 201, 129, 0.16) 0 1px, transparent 2px),
    radial-gradient(circle at 84% 16%, rgba(240, 183, 91, 0.20) 0 1px, transparent 2px),
    radial-gradient(circle at 68% 70%, rgba(124, 184, 255, 0.16) 0 1px, transparent 2px),
    linear-gradient(135deg, rgba(80, 212, 199, 0.14), transparent 34%),
    linear-gradient(315deg, rgba(240, 183, 91, 0.10), transparent 36%),
    #07111f;
  background-size: 220px 220px, 180px 180px, 260px 260px, auto, auto, auto;
  overscroll-behavior: none;
}

.startup-screen {
  position: fixed;
  inset: 0;
  z-index: 3000;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: #fff6de;
  background: #071a36;
  transition: opacity 700ms ease, visibility 700ms ease;
}

.startup-screen.is-closing {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.startup-screen[hidden] {
  display: none;
}

.startup-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.018);
  animation: startup-drift 12s ease-in-out infinite alternate;
}

.startup-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 48%, rgba(5, 16, 38, 0.10), rgba(4, 13, 32, 0.28) 52%, rgba(2, 8, 22, 0.62) 100%),
    linear-gradient(180deg, rgba(3, 11, 28, 0.24), rgba(3, 11, 28, 0.04) 46%, rgba(3, 11, 28, 0.62));
}

.startup-content {
  position: relative;
  width: min(560px, calc(100vw - 40px));
  display: grid;
  justify-items: center;
  padding: 28px 30px 24px;
  border: 1px solid rgba(255, 223, 158, 0.32);
  border-radius: 22px;
  text-align: center;
  background: rgba(4, 16, 39, 0.48);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.36), inset 0 0 40px rgba(255, 214, 125, 0.04);
  backdrop-filter: blur(16px) saturate(1.12);
}

.startup-eyebrow {
  margin: 0 0 8px;
  color: #ffdc91;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.startup-content h1 {
  margin: 0;
  color: #fff4d6;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.12;
  text-shadow: 0 2px 18px rgba(255, 202, 104, 0.30);
}

.startup-summary {
  margin: 12px 0 20px;
  color: rgba(239, 246, 255, 0.82);
  font-size: 14px;
}

.startup-loader {
  display: flex;
  gap: 9px;
  height: 18px;
  align-items: center;
}

.startup-loader span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffd879;
  box-shadow: 0 0 12px rgba(255, 216, 121, 0.78);
  animation: startup-star 1.1s ease-in-out infinite;
}

.startup-loader span:nth-child(2) { animation-delay: 140ms; }
.startup-loader span:nth-child(3) { animation-delay: 280ms; }

.startup-status {
  min-height: 20px;
  margin: 8px 0 10px;
  color: rgba(242, 248, 255, 0.88);
  font-size: 12px;
}

.startup-progress {
  width: min(280px, 70vw);
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.startup-progress span {
  width: 8%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffd477, #fff4cb, #8fe8ff);
  box-shadow: 0 0 16px rgba(255, 214, 119, 0.52);
  transition: width 420ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.startup-retry {
  margin-top: 16px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 223, 158, 0.62);
  border-radius: 999px;
  color: #12203a;
  background: #ffe1a1;
  font-weight: 700;
  cursor: pointer;
}

.startup-screen.is-error .startup-loader {
  display: none;
}

.startup-screen.is-error .startup-progress span {
  background: linear-gradient(90deg, #ffb07a, #ffe0a0);
}

.startup-record {
  position: absolute;
  bottom: max(16px, env(safe-area-inset-bottom));
  color: rgba(235, 242, 252, 0.66);
  font-size: 12px;
  text-decoration: none;
}

.startup-record:hover,
.site-record:hover {
  color: #ffe0a0;
}

.is-booting .app-shell {
  opacity: 0;
}

.app-shell {
  transition: opacity 600ms ease;
}

.site-record {
  margin: auto auto 0;
  padding-top: 5px;
  color: var(--muted);
  font-size: 11px;
  text-decoration: none;
  opacity: 0.72;
}

@keyframes startup-star {
  50% {
    opacity: 0.28;
    transform: translateY(-5px) scale(0.72);
  }
}

@keyframes startup-drift {
  to { transform: scale(1.045) translate3d(0, -0.5%, 0); }
}

button,
input,
a {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 410px) 1fr;
  gap: 18px;
  width: min(1640px, calc(100vw - 28px));
  height: calc(100vh - 28px);
  margin: 14px auto;
}

.sidebar,
.map-stage {
  border: 1px solid rgba(158, 236, 229, 0.18);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(1.15);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  overflow: auto;
  min-height: 0;
}

.brand-block {
  padding: 4px 2px 8px;
}

.eyebrow,
.source-line,
.label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  margin-top: 7px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.05;
}

.summary {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.panel {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-head h2,
.panel h2 {
  font-size: 15px;
}

.section-head span {
  min-width: 28px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #06121f;
  background: linear-gradient(135deg, var(--accent), #f0d58c);
  font-size: 12px;
  font-weight: 700;
}

.campus-list,
.key-places,
.search-results,
.address-road-panel {
  display: grid;
  gap: 9px;
}

.campus-button,
.place-button,
.result-button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(239, 248, 255, 0.07);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.campus-button {
  min-height: 86px;
  padding: 13px;
}

.place-button,
.result-button {
  min-height: 44px;
  padding: 10px 11px;
}

.campus-button:hover,
.place-button:hover,
.result-button:hover {
  transform: translateY(-1px);
  border-color: rgba(80, 212, 199, 0.58);
  background: rgba(239, 248, 255, 0.11);
}

.campus-button.active {
  border-color: var(--accent);
  background: linear-gradient(135deg, rgba(80, 212, 199, 0.18), rgba(240, 183, 91, 0.10));
  box-shadow: inset 0 0 0 1px rgba(158, 236, 229, 0.18);
}

.campus-button strong,
.place-button strong,
.result-button strong {
  display: block;
  font-size: 16px;
  line-height: 1.25;
}

.campus-button span,
.place-button span,
.result-button span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.campus-meta {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(239, 248, 255, 0.10);
  color: #c7d7e4;
  font-size: 12px;
}

.pill.warn {
  color: #f4d59a;
  background: rgba(240, 183, 91, 0.14);
}

.search-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.search-box input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(5, 14, 27, 0.38);
  outline: none;
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(80, 212, 199, 0.16);
}

.search-box button,
.small-button,
.tool-button {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--panel);
  cursor: pointer;
}

.search-box button {
  min-width: 58px;
  min-height: 40px;
  border-radius: 8px;
  color: #06121f;
  background: linear-gradient(135deg, var(--accent), #d9f2bb);
  border-color: var(--accent);
  font-weight: 700;
}

.search-results {
  margin-top: 9px;
}

.empty-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.address-card {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(239, 248, 255, 0.07);
}

.address-card strong {
  display: block;
  font-size: 14px;
  line-height: 1.35;
}

.address-card p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.road-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.road-chip {
  max-width: 100%;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(159, 178, 193, 0.15);
  color: #c6d6e3;
  font-size: 12px;
}

.layer-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.layer-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(239, 248, 255, 0.07);
  color: #d5e2ed;
  cursor: pointer;
  user-select: none;
}

.layer-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex: 0 0 auto;
}

.small-button {
  min-width: 58px;
  min-height: 30px;
  border-radius: 7px;
}

.download-panel {
  display: grid;
  gap: 9px;
}

.download-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 8px;
  color: #06121f;
  background: linear-gradient(135deg, var(--accent), #f0d58c);
  text-decoration: none;
  font-weight: 700;
}

.download-link.secondary {
  color: var(--accent-strong);
  border: 1px solid rgba(80, 212, 199, 0.24);
  background: rgba(80, 212, 199, 0.08);
}

.map-stage {
  display: grid;
  grid-template-rows: auto minmax(520px, 1fr) auto;
  overflow: hidden;
  min-height: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(18, 30, 49, 0.96), rgba(12, 22, 39, 0.88)),
    radial-gradient(circle at 80% 20%, rgba(240, 183, 91, 0.12), transparent 36%);
}

#campusTitle {
  margin-top: 4px;
  font-size: clamp(24px, 3vw, 40px);
}

.toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tool-button {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-size: 20px;
  font-weight: 700;
  background: rgba(239, 248, 255, 0.08);
  color: var(--ink);
}

.text-tool {
  width: auto;
  min-width: 58px;
  padding: 0 11px;
  font-size: 14px;
}

.mobile-controls {
  display: none;
}

.map-wrap {
  position: relative;
  min-height: 0;
  background: #07111f;
}

.map-spotlight {
  --spot-x: 50%;
  --spot-y: 50%;
  position: absolute;
  inset: 0;
  z-index: 480;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(
      circle 175px at var(--spot-x) var(--spot-y),
      rgba(2, 7, 16, 0) 0 42%,
      rgba(2, 7, 16, 0.06) 58%,
      rgba(2, 7, 16, 0.22) 78%,
      rgba(2, 7, 16, 0.34) 100%
    );
  transition: opacity 180ms ease;
}

.map-spotlight.is-visible {
  opacity: 1;
}

.map-wrap .map-spotlight.is-visible {
  opacity: 1;
}

.map-spotlight.is-pinned {
  background:
    radial-gradient(
      circle 190px at var(--spot-x) var(--spot-y),
      rgba(2, 7, 16, 0) 0 40%,
      rgba(2, 7, 16, 0.08) 58%,
      rgba(2, 7, 16, 0.25) 79%,
      rgba(2, 7, 16, 0.38) 100%
    );
}

.leaflet-map {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 22%, rgba(240, 183, 91, 0.22) 0 1px, transparent 2px),
    radial-gradient(circle at 78% 28%, rgba(80, 212, 199, 0.18) 0 1px, transparent 2px),
    radial-gradient(circle at 60% 82%, rgba(124, 184, 255, 0.16) 0 1px, transparent 2px),
    linear-gradient(rgba(158, 236, 229, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(158, 236, 229, 0.055) 1px, transparent 1px),
    #0a1728;
  background-size: 48px 48px;
  touch-action: none;
}

.leaflet-container {
  font: inherit;
  background:
    radial-gradient(circle at 18% 22%, rgba(240, 183, 91, 0.22) 0 1px, transparent 2px),
    radial-gradient(circle at 78% 28%, rgba(80, 212, 199, 0.18) 0 1px, transparent 2px),
    radial-gradient(circle at 60% 82%, rgba(124, 184, 255, 0.16) 0 1px, transparent 2px),
    linear-gradient(rgba(158, 236, 229, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(158, 236, 229, 0.055) 1px, transparent 1px),
    #0a1728;
  background-size: 48px 48px;
}

.campus-boundary {
  filter: drop-shadow(0 0 10px rgba(80, 212, 199, 0.22)) drop-shadow(0 12px 16px rgba(0, 0, 0, 0.22));
}

.feature-label {
  display: inline-block;
  max-width: 168px;
  padding: 2px 5px;
  border: 1px solid rgba(158, 236, 229, 0.24);
  border-radius: 4px;
  color: #eff8ff;
  background: rgba(10, 23, 40, 0.78);
  box-shadow: 0 0 14px rgba(80, 212, 199, 0.12), 0 8px 18px rgba(0, 0, 0, 0.20);
  font-size: 12px;
  line-height: 1.25;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: auto;
}

.feature-label.major {
  color: #06121f;
  border-color: rgba(240, 213, 140, 0.65);
  background: linear-gradient(135deg, rgba(240, 213, 140, 0.95), rgba(158, 236, 229, 0.92));
  font-size: 13px;
}

.feature-label.small {
  font-size: 11px;
  font-weight: 600;
}

.road-label {
  display: inline-block;
  max-width: 180px;
  padding: 1px 5px;
  color: #d3e2ef;
  background: rgba(11, 24, 40, 0.58);
  border: 1px solid rgba(159, 178, 193, 0.25);
  border-radius: 999px;
  box-shadow: 0 2px 7px rgba(22, 37, 50, 0.08);
  font-size: 11px;
  line-height: 1.3;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: auto;
  transform: rotate(var(--angle, 0deg));
  transform-origin: center;
}

.area-label {
  display: inline-block;
  max-width: 190px;
  padding: 2px 6px;
  color: #dff8df;
  background: rgba(28, 64, 45, 0.62);
  border: 1px solid rgba(116, 201, 129, 0.30);
  border-radius: 999px;
  box-shadow: 0 3px 9px rgba(22, 37, 50, 0.08);
  font-size: 11px;
  line-height: 1.3;
  font-weight: 700;
  white-space: nowrap;
  pointer-events: auto;
}

.campus-address-label {
  display: block;
  min-width: 150px;
  max-width: 260px;
  padding: 8px 10px;
  border: 1px solid rgba(80, 212, 199, 0.34);
  border-radius: 8px;
  color: #edf7ff;
  background: rgba(14, 27, 45, 0.86);
  box-shadow: 0 0 24px rgba(80, 212, 199, 0.14), 0 16px 32px rgba(0, 0, 0, 0.26);
  pointer-events: auto;
}

.campus-address-label strong,
.campus-address-label em {
  display: block;
  font-style: normal;
  line-height: 1.35;
}

.campus-address-label strong {
  font-size: 14px;
}

.campus-address-label em {
  margin-top: 2px;
  color: #a9bdce;
  font-size: 12px;
}

.landmark-marker {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: max(72px, calc(var(--icon-size, 54px) + 28px));
  pointer-events: auto;
}

.landmark-marker img {
  width: var(--icon-size, 54px);
  height: var(--icon-size, 54px);
  display: block;
  border: 1px solid rgba(240, 213, 140, 0.62);
  border-radius: calc(var(--icon-size, 54px) * 0.32);
  background: rgba(239, 248, 255, 0.92);
  box-shadow: 0 0 0 4px rgba(80, 212, 199, 0.13), 0 14px 30px rgba(0, 0, 0, 0.32);
  object-fit: cover;
}

.landmark-marker strong {
  max-width: 86px;
  padding: 2px 7px;
  border: 1px solid rgba(240, 213, 140, 0.52);
  border-radius: 999px;
  color: #07111f;
  background: linear-gradient(135deg, rgba(240, 213, 140, 0.96), rgba(158, 236, 229, 0.94));
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  font-size: 12px;
  line-height: 1.25;
  white-space: nowrap;
}

.search-highlight {
  width: 18px;
  height: 18px;
  border: 3px solid #f8fbff;
  border-radius: 50%;
  background: #f0b75b;
  box-shadow: 0 0 0 5px rgba(240, 183, 91, 0.26), 0 0 18px rgba(80, 212, 199, 0.34), 0 8px 18px rgba(0, 0, 0, 0.26);
}

.map-badge {
  position: absolute;
  right: 16px;
  bottom: 14px;
  z-index: 500;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.map-badge span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border: 1px solid rgba(158, 236, 229, 0.24);
  border-radius: 999px;
  background: rgba(12, 24, 40, 0.76);
  color: #d8e9f4;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.memory-drawer {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 650;
  width: min(380px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  display: grid;
  grid-template-rows: auto minmax(120px, 1fr) auto;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(158, 236, 229, 0.22);
  border-radius: 8px;
  background: rgba(15, 28, 46, 0.92);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px);
  overscroll-behavior: contain;
}

.memory-drawer[hidden] {
  display: none;
}

.memory-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.memory-head h2 {
  margin-top: 4px;
  font-size: 20px;
  line-height: 1.2;
}

.memory-head p:last-child {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.memory-head .tool-button {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  font-size: 20px;
}

.memory-list {
  display: grid;
  align-content: start;
  gap: 9px;
  overflow: auto;
  padding-right: 2px;
}

.memory-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(239, 248, 255, 0.07);
}

.memory-item p {
  margin: 0;
  color: #e9f4ff;
  font-size: 13px;
  line-height: 1.5;
}

.memory-item span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
}

.memory-form {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.memory-form label {
  display: grid;
  gap: 5px;
  color: #d6e6f1;
  font-size: 12px;
  font-weight: 700;
}

.memory-form textarea,
.memory-form input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--ink);
  background: rgba(5, 14, 27, 0.42);
  outline: none;
  resize: vertical;
}

.memory-form textarea:focus,
.memory-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(80, 212, 199, 0.16);
}

.memory-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  align-items: end;
}

.memory-row button {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: #06121f;
  background: linear-gradient(135deg, var(--accent), #f0d58c);
  font-weight: 700;
  cursor: pointer;
}

.map-settings {
  padding: 0;
}

.map-settings summary {
  padding: 12px 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.map-settings summary::-webkit-details-marker {
  display: none;
}

.map-settings summary::after {
  content: "＋";
  float: right;
}

.map-settings[open] summary::after {
  content: "−";
}

.map-settings[open] .section-head,
.map-settings[open] .layer-controls {
  margin: 0 14px 12px;
}

.memory-guide {
  position: absolute;
  bottom: 14px;
  left: 16px;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 218, 158, 0.24);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(8, 17, 34, 0.72);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.20);
  backdrop-filter: blur(10px);
  font-size: 11px;
  pointer-events: none;
}

.memory-guide span {
  color: #ffe2a2;
}

.memory-guide strong {
  color: var(--ink);
}

.memory-guide em {
  font-style: normal;
}

/* Shared memory-drawer behavior for the base and hand-drawn themes. */
.memory-scrim {
  position: absolute;
  inset: 0;
  z-index: 620;
  border: 0;
  padding: 0;
  background: rgba(2, 5, 18, 0);
  transition: background 220ms ease;
}

.map-wrap.memory-open .memory-scrim {
  background: rgba(2, 5, 18, 0.12);
}

.memory-scrim[hidden],
.memory-form label[hidden] {
  display: none;
}

.memory-drawer {
  transform-origin: right center;
  transition: transform 240ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 180ms ease;
  will-change: transform, opacity;
}

.memory-drawer[data-state="opening"],
.memory-drawer[data-state="closing"] {
  opacity: 0;
  transform: translateX(24px) scale(0.985);
}

.memory-drawer[data-state="open"] {
  opacity: 1;
  transform: none;
}

.memory-handle {
  display: none;
}

.memory-item {
  position: relative;
  overflow: hidden;
  animation: base-memory-note-in 360ms both cubic-bezier(0.2, 0.8, 0.2, 1);
  animation-delay: calc(var(--memory-index, 0) * 34ms);
}

.memory-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12px;
  width: 38px;
  height: 2px;
  background: linear-gradient(90deg, #ffe2a2, #ffb4d0, #9eefff);
}

.memory-item-new {
  border-color: rgba(255, 226, 162, 0.7);
  animation: base-memory-note-new 600ms both cubic-bezier(0.2, 0.9, 0.2, 1);
}

.memory-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.memory-label-row > span:last-child {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.memory-row button {
  grid-column: 1 / -1;
  justify-self: stretch;
}

.memory-submit-star {
  display: inline-block;
  margin-left: 5px;
}

.memory-row button.is-submitting .memory-submit-star {
  animation: base-memory-star-spin 900ms linear infinite;
}

.memory-status {
  min-height: 16px;
  margin: -3px 0 0;
  color: #ffe2a2;
  font-size: 12px;
}

.memory-empty {
  min-height: 150px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 7px;
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.memory-empty strong {
  color: var(--ink);
  font-size: 14px;
}

.memory-empty p {
  margin: 0;
  font-size: 12px;
}

.memory-empty-star {
  color: #ffe2a2;
  font-size: 28px;
  filter: drop-shadow(0 0 12px rgba(255, 226, 162, 0.6));
}

.memory-loading {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.memory-loading span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffb4d0, #9eefff);
  animation: base-memory-loading 900ms ease-in-out infinite;
}

.memory-loading span:nth-child(2) { animation-delay: 120ms; }
.memory-loading span:nth-child(3) { animation-delay: 240ms; }

.memory-place-highlight {
  position: relative;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.memory-place-highlight::before,
.memory-place-highlight::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 2px solid rgba(255, 226, 162, 0.88);
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(255, 180, 208, 0.55);
  animation: base-memory-place-pulse 1.8s ease-out infinite;
}

.memory-place-highlight::after { animation-delay: 700ms; }

.memory-place-highlight span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff0cb;
  box-shadow: 0 0 16px #ffb4d0, 0 0 28px #58e6ff;
}

@keyframes base-memory-note-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
}

@keyframes base-memory-note-new {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

@keyframes base-memory-star-spin {
  to { transform: rotate(360deg); }
}

@keyframes base-memory-loading {
  50% { opacity: 0.35; transform: translateY(-5px); }
}

@keyframes base-memory-place-pulse {
  from { opacity: 0.85; transform: scale(0.45); }
  to { opacity: 0; transform: scale(1.35); }
}

.inspector {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr)) minmax(220px, 1.5fr);
  gap: 1px;
  border-top: 1px solid var(--line);
  background: rgba(158, 236, 229, 0.16);
}

.inspector section {
  min-height: 78px;
  padding: 14px;
  background: rgba(12, 24, 40, 0.82);
}

.inspector strong {
  display: block;
  margin-top: 6px;
  font-size: 23px;
  line-height: 1.1;
  color: #f2fbff;
}

.inspector .wide strong {
  font-size: 16px;
  line-height: 1.35;
}

@media (max-width: 980px) {
  body {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }

  .app-shell {
    display: block;
    width: 100%;
    height: 100dvh;
    margin: 0;
  }

  .sidebar,
  .inspector {
    display: none;
  }

  .map-stage {
    width: 100%;
    height: 100dvh;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr);
    border: 0;
    border-radius: 0;
  }

  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding: max(10px, env(safe-area-inset-top)) 12px 10px;
  }

  #campusTitle {
    font-size: 21px;
    line-height: 1.15;
  }

  .source-line {
    max-width: 55vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .toolbar {
    gap: 6px;
  }

  .toolbar #zoomIn,
  .toolbar #zoomOut,
  .toolbar #resetView {
    display: none;
  }

  .tool-button {
    min-width: 42px;
    min-height: 42px;
  }

  .theme-button,
  .auth-button {
    width: auto;
    max-width: 108px;
    padding: 0 10px;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-controls {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: minmax(110px, 0.8fr) minmax(170px, 1.2fr);
    gap: 8px;
  }

  .mobile-controls select,
  .mobile-search {
    min-width: 0;
    height: 42px;
  }

  .mobile-controls select,
  .mobile-search input {
    min-width: 0;
    border: 1px solid var(--line);
    color: var(--ink);
    background: rgba(5, 14, 27, 0.78);
  }

  .mobile-controls select {
    width: 100%;
    padding: 0 9px;
    border-radius: 9px;
  }

  .mobile-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .mobile-search input {
    width: 100%;
    padding: 0 10px;
    border-radius: 9px 0 0 9px;
    outline: none;
  }

  .mobile-search button {
    padding: 0 12px;
    border: 0;
    border-radius: 0 9px 9px 0;
    color: #07111f;
    background: linear-gradient(135deg, var(--accent), #f0d58c);
    font-weight: 700;
  }

  .map-wrap,
  .leaflet-map {
    min-height: 0;
    height: 100%;
  }

  .map-badge {
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
  }

  .map-badge span:last-child {
    display: none;
  }

  .memory-drawer {
    position: absolute;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: min(62dvh, 620px);
    grid-template-rows: auto minmax(80px, 1fr) auto;
    padding: 14px 14px max(14px, env(safe-area-inset-bottom));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 18px 18px 0 0;
    backdrop-filter: none;
    background: rgba(15, 28, 46, 0.98);
    touch-action: pan-y;
  }

  .memory-list {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .memory-form textarea {
    max-height: 96px;
    resize: none;
  }
}

@media (max-width: 620px) {
  .mobile-controls {
    grid-template-columns: 112px minmax(0, 1fr);
  }

  .feature-label,
  .road-label,
  .area-label {
    font-size: 10px;
  }

  .campus-address-label {
    display: none;
  }
}

/* 2026-06-20: homepage-first layout, compact map topbar, larger memory space. */
body.view-home {
  overflow: hidden;
  background: #04102a;
}

body.view-home .app-shell,
body.view-map .app-shell {
  display: block;
  width: 100%;
  max-width: none;
  height: 100dvh;
  margin: 0;
}

.home-screen {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(280px, 0.84fr) minmax(540px, 1.16fr);
  grid-template-rows: 1fr auto;
  gap: clamp(18px, 3vw, 44px);
  align-items: center;
  padding: clamp(28px, 5vw, 76px);
  color: #f7fbff;
  isolation: isolate;
}

.home-backdrop,
.home-shade {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.home-backdrop {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.01);
  filter: saturate(1.05) contrast(1.02);
}

.home-shade {
  z-index: -1;
  background:
    radial-gradient(circle at 49% 48%, rgba(21, 81, 255, 0.04), rgba(4, 14, 40, 0.18) 38%, rgba(2, 8, 22, 0.56) 100%),
    linear-gradient(90deg, rgba(2, 8, 22, 0.76), rgba(2, 8, 22, 0.30) 45%, rgba(2, 8, 22, 0.38));
}

.home-hero {
  max-width: 520px;
  padding: 26px;
  border: 1px solid rgba(164, 201, 255, 0.22);
  border-radius: 24px;
  background: rgba(3, 14, 37, 0.40);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(14px);
}

.home-hero h1 {
  color: #fff4db;
  font-size: clamp(40px, 5.4vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.05em;
  text-shadow: 0 0 26px rgba(79, 147, 255, 0.26);
}

.home-hero .summary {
  max-width: 430px;
  color: rgba(238, 246, 255, 0.84);
  font-size: 15px;
}

.home-actions {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  display: flex;
  gap: 8px;
  z-index: 3;
}

.campus-home-panel {
  align-self: center;
  width: min(760px, 100%);
  justify-self: end;
  padding: clamp(14px, 1.8vw, 22px);
  border: 1px solid rgba(145, 196, 255, 0.20);
  border-radius: 28px;
  background: rgba(2, 10, 28, 0.26);
  box-shadow: inset 0 0 60px rgba(65, 133, 255, 0.08), 0 26px 90px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(10px);
}

.campus-home-panel .section-head {
  margin: 0 2px 14px;
}

.campus-home-panel .section-head h2 {
  color: rgba(245, 250, 255, 0.90);
}

.campus-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 1.5vw, 18px);
}

.campus-card {
  position: relative;
  min-height: clamp(150px, 18vh, 210px);
  overflow: hidden;
  padding: 18px;
  border-radius: 24px;
  color: #f7fbff;
  background:
    radial-gradient(circle at 78% 24%, rgba(95, 157, 255, 0.28), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(17, 48, 112, 0.22));
  border: 1px solid rgba(180, 214, 255, 0.24);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.20), inset 0 0 28px rgba(45, 120, 255, 0.08);
}

.campus-card::after {
  content: "进入地图";
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 5px 10px;
  border-radius: 999px;
  color: #07142c;
  background: linear-gradient(135deg, #9eefff, #ffe2a2);
  font-size: 12px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.campus-card:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.campus-card:hover {
  transform: translateY(-3px);
  border-color: rgba(160, 220, 255, 0.58);
  background:
    radial-gradient(circle at 78% 24%, rgba(118, 180, 255, 0.40), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), rgba(17, 48, 112, 0.28));
}

.campus-card .campus-orb {
  width: 34px;
  height: 34px;
  display: block;
  margin-bottom: 26px;
  border-radius: 50%;
  background: #9edbff;
  box-shadow: 0 0 0 8px rgba(70, 126, 255, 0.14), 0 0 34px rgba(80, 149, 255, 0.76);
}

.campus-card strong {
  color: #fff8df;
  font-size: clamp(22px, 2.2vw, 34px);
  letter-spacing: -0.04em;
}

.campus-card span:not(.campus-orb) {
  color: rgba(237, 246, 255, 0.80);
}

/* Overlay the four campus entries on the four visual islands in the splash map. */
body.view-home .home-screen {
  display: block;
  padding: 0;
}

body.view-home .home-hero {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  left: max(18px, env(safe-area-inset-left));
  z-index: 4;
  pointer-events: none;
  width: min(440px, calc(100vw - 36px));
  padding: 18px 20px;
}

body.view-home .home-hero h1 {
  font-size: clamp(32px, 4.1vw, 58px);
}

body.view-home .home-hero .summary {
  margin-top: 9px;
  font-size: 13px;
  line-height: 1.55;
}

.campus-home-panel {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  justify-self: stretch;
  align-self: stretch;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  pointer-events: none;
}

.campus-home-panel .section-head {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.campus-grid {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
}

.campus-card {
  --hot-x: 50%;
  --hot-y: 50%;
  position: absolute;
  left: var(--hot-x);
  top: var(--hot-y);
  width: clamp(172px, 14vw, 230px);
  min-height: 0;
  padding: 13px 14px 14px;
  border-radius: 18px;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.campus-card:hover {
  transform: translate(-50%, calc(-50% - 4px));
}

.campus-handan {
  --hot-x: 28%;
  --hot-y: 31%;
}

.campus-jiangwan {
  --hot-x: 72%;
  --hot-y: 31%;
}

.campus-fenglin {
  --hot-x: 29%;
  --hot-y: 69%;
}

.campus-zhangjiang {
  --hot-x: 72%;
  --hot-y: 68%;
}

.campus-card .campus-orb {
  width: 18px;
  height: 18px;
  margin-bottom: 9px;
  box-shadow: 0 0 0 7px rgba(70, 126, 255, 0.16), 0 0 30px rgba(80, 149, 255, 0.86);
}

.campus-card strong {
  font-size: clamp(18px, 1.5vw, 25px);
}

.campus-card .campus-meta {
  margin-top: 8px;
}

.home-record {
  position: absolute;
  left: 50%;
  bottom: max(14px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  color: rgba(238, 246, 255, 0.62);
}

body.view-map .map-stage {
  width: min(1680px, calc(100vw - 24px));
  height: calc(100dvh - 24px);
  margin: 12px auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

body.view-map .map-stage[hidden],
.home-screen[hidden],
body.view-map .home-screen,
body.view-home .map-stage {
  display: none;
}

.map-title-block {
  min-width: 0;
}

body.view-map .topbar {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr) minmax(220px, 360px) minmax(128px, auto) auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px 10px;
}

.back-home {
  min-width: 76px;
}

.top-search {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
}

.top-search input {
  min-width: 0;
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px 0 0 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  outline: none;
}

.top-search button {
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-left: 0;
  border-radius: 0 10px 10px 0;
  color: #fff;
  background: var(--accent);
  font-weight: 800;
  cursor: pointer;
}

.top-search .search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 900;
  max-height: min(360px, calc(100dvh - 160px));
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(251, 252, 248, 0.96);
  box-shadow: 0 18px 46px rgba(25, 38, 44, 0.18);
  backdrop-filter: blur(12px);
}

.top-search .search-results:empty {
  display: none;
}

.campus-switch {
  height: 40px;
  min-width: 128px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.90);
}

.tool-menu {
  position: relative;
}

.tool-menu summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  list-style: none;
}

.tool-menu summary::-webkit-details-marker {
  display: none;
}

.tool-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 900;
  width: min(360px, calc(100vw - 24px));
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(251, 252, 248, 0.97);
  box-shadow: 0 18px 48px rgba(25, 38, 44, 0.18);
}

.top-key-places {
  grid-column: 1 / -1;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 4px;
  scrollbar-width: thin;
}

.top-key-places .place-button {
  flex: 0 0 auto;
  width: auto;
  min-width: 120px;
  min-height: 34px;
  padding: 7px 10px;
  white-space: nowrap;
}

.top-key-places .place-button strong {
  display: inline;
  font-size: 13px;
}

.top-key-places .place-button span {
  display: none;
}

body.is-map-loading .map-wrap::after {
  content: "正在绘制校区地图…";
  position: absolute;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  color: #fff8df;
  background: rgba(3, 12, 28, 0.42);
  backdrop-filter: blur(6px);
  font-weight: 800;
}

body.view-map .memory-drawer {
  width: min(560px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  grid-template-rows: auto minmax(180px, 1fr) auto;
  padding: 18px;
  border-radius: 18px;
}

body.view-map .memory-head h2 {
  font-size: clamp(22px, 2vw, 30px);
}

body.view-map .memory-list {
  gap: 11px;
}

body.view-map .memory-item {
  padding: 14px;
  border-radius: 14px;
}

body.view-map .memory-item p {
  font-size: 14px;
  line-height: 1.65;
}

body.view-map .memory-form textarea {
  min-height: 118px;
  font-size: 14px;
  line-height: 1.6;
}

/* Spotlight visibility is background-driven so it remains stable across browsers. */
.map-wrap .map-spotlight {
  opacity: 1;
  background: none;
}

.map-wrap .map-spotlight.is-visible {
  opacity: 1;
  background:
    radial-gradient(
      circle 175px at var(--spot-x) var(--spot-y),
      rgba(2, 7, 16, 0) 0 42%,
      rgba(2, 7, 16, 0.06) 58%,
      rgba(2, 7, 16, 0.22) 78%,
      rgba(2, 7, 16, 0.34) 100%
    );
}

.map-wrap .map-spotlight.is-pinned {
  background:
    radial-gradient(
      circle 190px at var(--spot-x) var(--spot-y),
      rgba(2, 7, 16, 0) 0 40%,
      rgba(2, 7, 16, 0.08) 58%,
      rgba(2, 7, 16, 0.25) 79%,
      rgba(2, 7, 16, 0.38) 100%
    );
}
