:root {
  --paper: #f4efe3;
  --paper-bright: #fffdf7;
  --ink: #173436;
  --muted: #647575;
  --red: #c94b33;
  --teal: #2f776e;
  --gold: #d6942e;
  --line: rgba(23, 52, 54, .16);
  --shadow: 0 18px 50px rgba(25, 57, 55, .14);
  --radius: 24px;
  --ease: cubic-bezier(.2,.8,.2,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(214,148,46,.13), transparent 28%),
    radial-gradient(circle at 88% 5%, rgba(47,119,110,.13), transparent 25%),
    var(--paper);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  min-height: 100vh;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  opacity: .2;
  pointer-events: none;
  background-image: repeating-linear-gradient(0deg, transparent, transparent 5px, rgba(23,52,54,.04) 6px);
  z-index: 9999;
}
a { color: inherit; }
button, input { font: inherit; }
button { color: inherit; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 99999; padding: 12px 18px; background: var(--ink); color: white; border-radius: 12px; }
.skip-link:focus { top: 12px; }

.access-gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 16% 16%, rgba(214,148,46,.24), transparent 30%), radial-gradient(circle at 86% 82%, rgba(47,119,110,.24), transparent 32%), var(--paper); }
.access-gate[hidden] { display: none; }
.access-card { width: min(520px, 100%); padding: clamp(28px, 6vw, 54px); color: #f8f3e8; background: var(--ink); border-radius: 30px; box-shadow: 0 28px 80px rgba(16,43,43,.28); position: relative; overflow: hidden; }
.access-card::after { content: ""; position: absolute; width: 210px; height: 210px; border: 42px solid rgba(255,255,255,.055); border-radius: 50%; right: -98px; top: 54px; pointer-events: none; }
.access-card .brand-mark { margin-bottom: 28px; }
.access-card h1 { font-size: clamp(42px, 10vw, 68px); position: relative; z-index: 1; }
.access-card > p:not(.eyebrow) { max-width: 34em; color: rgba(255,255,255,.72); line-height: 1.75; position: relative; z-index: 1; }
.access-form { display: grid; gap: 10px; margin-top: 28px; position: relative; z-index: 1; }
.access-form label { font-size: 12px; font-weight: 800; color: #eec782; }
.access-form input { width: 100%; padding: 15px 16px; border: 1px solid rgba(255,255,255,.24); border-radius: 14px; background: rgba(255,255,255,.08); color: white; text-transform: uppercase; letter-spacing: .08em; outline: none; }
.access-form input:focus { border-color: #eec782; box-shadow: 0 0 0 4px rgba(238,199,130,.14); }
.access-form button { border: 0; border-radius: 14px; padding: 15px; color: var(--ink); background: #eec782; font-weight: 900; cursor: pointer; }
.access-form button:disabled { opacity: .6; cursor: wait; }
.access-status { min-height: 22px; margin-top: 12px; color: #ffb8a9; font-size: 13px; }
.access-card > small { display: block; margin-top: 12px; color: rgba(255,255,255,.48); line-height: 1.6; }

.topbar {
  min-height: 78px;
  padding: 14px clamp(18px, 4vw, 56px);
  display: flex;
  align-items: center;
  gap: 18px;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(255,253,247,.76);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: max-content; }
.brand-mark { width: 44px; height: 44px; border-radius: 50%; background: var(--red); color: white; display: grid; place-items: center; font: 700 20px/1 Georgia, serif; box-shadow: inset 0 0 0 5px rgba(255,255,255,.22); }
.brand strong { display: block; font-size: 17px; letter-spacing: .04em; }
.brand span { display: block; margin-top: 2px; font: 600 10px/1.2 ui-monospace, SFMono-Regular, monospace; color: var(--muted); letter-spacing: .14em; }
.campus-tabs { display: flex; gap: 6px; padding: 5px; background: rgba(23,52,54,.08); border-radius: 999px; }
.tab { border: 0; background: transparent; padding: 10px 16px; border-radius: 999px; cursor: pointer; transition: .25s var(--ease); font-weight: 700; }
.tab.active { color: white; background: var(--ink); box-shadow: 0 6px 18px rgba(23,52,54,.2); }
.painted-map-trigger { border: 0; padding: 10px 16px; border-radius: 999px; color: var(--ink); background: #eec782; font-weight: 900; cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.painted-map-trigger:hover, .painted-map-trigger:focus-visible { transform: translateY(-1px); box-shadow: 0 7px 18px rgba(180,124,36,.24); outline: 2px solid var(--paper-bright); outline-offset: 2px; }
.campus-static { display: inline-flex; align-items: center; cursor: default; }
.locate-top { border: 1px solid var(--line); background: var(--paper-bright); border-radius: 999px; padding: 11px 16px; cursor: pointer; font-weight: 700; }

.shell { max-width: 1600px; margin: 0 auto; padding: 24px clamp(16px, 3vw, 42px) 42px; }
.hero { display: grid; grid-template-columns: minmax(250px,.72fr) minmax(540px,1.7fr); gap: 20px; align-items: stretch; }
.intro-panel { position: relative; overflow: hidden; background: var(--ink); color: #f8f3e8; border-radius: var(--radius); padding: clamp(26px, 4vw, 56px); min-height: 660px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow); }
.intro-panel::after { content: ""; position: absolute; width: 260px; height: 260px; border: 52px solid rgba(255,255,255,.06); border-radius: 50%; right: -110px; top: 70px; }
.eyebrow { margin: 0 0 18px; font: 700 11px/1 ui-monospace, SFMono-Regular, monospace; letter-spacing: .2em; color: #eec782; }
h1 { margin: 0; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(48px, 6vw, 88px); line-height: .92; letter-spacing: -.06em; }
h1 span { display: block; color: #e8b65e; }
.lead { max-width: 34em; line-height: 1.8; color: rgba(255,255,255,.78); font-size: 15px; }
.address-card { border-top: 1px solid rgba(255,255,255,.18); padding-top: 20px; position: relative; z-index: 1; }
.address-card small { display: block; color: #eec782; margin-bottom: 8px; }
.address-card strong { line-height: 1.6; }

.map-panel { background: var(--paper-bright); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); min-height: 660px; position: relative; overflow: hidden; }
#map { height: 640px; border-radius: 18px; background: #d9e0d9; }
.map-toolbar { position: absolute; z-index: 600; left: 24px; right: 24px; top: 24px; display: flex; gap: 10px; pointer-events: none; }
.search-wrap { flex: 1; max-width: 440px; pointer-events: auto; position: relative; }
#search { width: 100%; border: 1px solid rgba(23,52,54,.13); border-radius: 16px; padding: 15px 18px 15px 46px; box-shadow: 0 12px 30px rgba(23,52,54,.17); background: rgba(255,253,247,.96); outline: none; }
.search-wrap::before { content: "⌕"; position: absolute; left: 17px; top: 9px; font-size: 27px; color: var(--muted); z-index: 1; }
.map-action { pointer-events: auto; border: 0; border-radius: 16px; padding: 0 16px; background: var(--red); color: white; cursor: pointer; box-shadow: 0 12px 30px rgba(201,75,51,.28); font-weight: 800; }
.pure-map-link { display: inline-flex; align-items: center; justify-content: center; background: var(--ink); text-decoration: none; white-space: nowrap; box-shadow: 0 12px 30px rgba(23,52,54,.2); }
.search-results { position: absolute; left: 0; right: 0; top: 58px; display: none; background: var(--paper-bright); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.search-results.show { display: block; }
.result { width: 100%; border: 0; background: transparent; text-align: left; padding: 13px 16px; cursor: pointer; border-bottom: 1px solid var(--line); }
.result:hover, .result:focus { background: #efe8d8; }
.status-pill { position: absolute; z-index: 500; left: 24px; bottom: 24px; max-width: calc(100% - 48px); padding: 10px 14px; color: white; background: rgba(23,52,54,.9); border-radius: 12px; font-size: 12px; box-shadow: var(--shadow); }

.section { margin-top: 22px; background: rgba(255,253,247,.66); border: 1px solid rgba(23,52,54,.08); border-radius: var(--radius); padding: clamp(22px, 3vw, 38px); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-family: Georgia, "Noto Serif SC", serif; font-size: clamp(28px, 4vw, 50px); letter-spacing: -.04em; }
.section-heading p { margin: 0; color: var(--muted); max-width: 38em; line-height: 1.7; }
.routes-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.route-card { position: relative; border: 1px solid var(--line); background: var(--paper-bright); border-radius: 18px; padding: 22px; cursor: pointer; text-align: left; transition: .28s var(--ease); overflow: hidden; min-height: 170px; }
.route-card:hover, .route-card:focus { transform: translateY(-5px); box-shadow: 0 16px 30px rgba(23,52,54,.12); outline: none; }
.route-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 7px; background: var(--route); }
.route-card small { color: var(--muted); }
.route-card h3 { font: 700 24px/1.25 Georgia, "Noto Serif SC", serif; margin: 10px 0 18px; }
.route-stops { color: var(--muted); line-height: 1.7; font-size: 13px; }

.essentials { display: grid; grid-template-columns: 1.3fr .7fr; gap: 18px; }
.poi-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
.poi-card { border: 1px solid var(--line); background: var(--paper-bright); border-radius: 16px; padding: 16px; display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; cursor: pointer; }
.poi-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: white; font-weight: 800; background: var(--poi); }
.poi-card strong { display: block; font-size: 14px; }
.poi-card small { display: block; color: var(--muted); margin-top: 4px; line-height: 1.35; }
.verified { color: var(--teal); font-weight: 800; font-size: 11px; }
.contacts { background: var(--ink); color: white; border-radius: 18px; padding: 24px; }
.contacts h3 { margin: 0 0 18px; font: 700 26px/1.2 Georgia, "Noto Serif SC", serif; }
.contact-row { display: flex; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid rgba(255,255,255,.14); }
.contact-row a { color: #f0c978; font-weight: 800; text-decoration: none; }
.note { color: var(--muted); font-size: 12px; line-height: 1.65; margin-top: 14px; }
footer { display: flex; gap: 18px; justify-content: space-between; align-items: center; padding: 24px 4px 0; color: var(--muted); font-size: 12px; }
.source-links { display: flex; flex-wrap: wrap; gap: 14px; }
.source-links a { text-underline-offset: 3px; }

.leaflet-control-attribution { font-size: 9px !important; }
.campus-marker { border: 0; background: transparent; }
.marker-dot { width: 34px; height: 34px; border-radius: 12px 12px 12px 3px; transform: rotate(-45deg); color: white; display: grid; place-items: center; box-shadow: 0 5px 14px rgba(23,52,54,.28); border: 3px solid rgba(255,255,255,.9); }
.marker-dot span { transform: rotate(45deg); font-weight: 900; font-size: 12px; }
.user-marker { width: 22px; height: 22px; border: 4px solid white; border-radius: 50%; background: #2877c9; box-shadow: 0 0 0 10px rgba(40,119,201,.2); }
.leaflet-popup-content-wrapper { border-radius: 16px; box-shadow: var(--shadow); }
.popup h3 { margin: 0 0 4px; font-size: 16px; }
.popup p { margin: 0 0 12px; color: var(--muted); }
.popup-actions { display: flex; gap: 7px; }
.popup-actions button { border: 0; padding: 9px 10px; border-radius: 10px; background: var(--ink); color: white; cursor: pointer; }
.popup-actions:has(button:only-child) button { width: 100%; }
.popup-actions button:last-child { background: var(--red); }

.painted-map-dialog { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); border: 0; color: var(--ink); background: rgba(16, 39, 40, .82); backdrop-filter: blur(14px); }
.painted-map-dialog::backdrop { background: rgba(10, 29, 30, .58); }
.painted-map-dialog[open] { display: grid; place-items: center; }
.painted-map-sheet { width: min(1120px, 100%); height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 10px; padding: 12px; border: 1px solid rgba(255,255,255,.34); border-radius: 28px; background: var(--paper-bright); box-shadow: 0 30px 90px rgba(7,24,24,.38); }
.painted-map-header { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 2px 4px 2px 10px; }
.painted-map-header span { color: var(--red); font: 800 10px/1 ui-monospace, SFMono-Regular, monospace; letter-spacing: .16em; }
.painted-map-header h2 { margin: 5px 0 0; font: 700 clamp(20px, 3vw, 30px)/1.1 Georgia, "Noto Serif SC", serif; }
.painted-map-controls { display: flex; gap: 8px; }
.painted-map-controls button { min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--paper); font-weight: 800; cursor: pointer; }
.painted-map-controls .painted-map-close { border-color: transparent; color: white; background: var(--ink); }
.painted-map-controls button:focus-visible { outline: 3px solid rgba(214,148,46,.5); outline-offset: 2px; }
.painted-map-canvas { min-height: 0; position: relative; overflow: hidden; border-radius: 20px; background: #e5dece; }
#painted-map-preview { width: 100%; height: 100%; min-height: 420px; background: #e5dece; }
.painted-map-hint { position: absolute; z-index: 600; left: 50%; bottom: 14px; transform: translateX(-50%); padding: 9px 15px; border-radius: 12px; color: white; background: rgba(23,52,54,.9); box-shadow: 0 10px 28px rgba(23,52,54,.2); font-size: 12px; white-space: nowrap; pointer-events: none; }
.painted-map-dialog .leaflet-container { touch-action: pan-x pan-y; }

@media (max-width: 980px) {
  .topbar { flex-wrap: wrap; }
  .locate-top { display: none; }
  .hero { grid-template-columns: 1fr; }
  .intro-panel { min-height: 380px; }
  .map-panel { min-height: 590px; }
  #map { height: 570px; }
  .routes-grid { grid-template-columns: 1fr; }
  .essentials { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .topbar { padding: 10px 14px; gap: 10px; }
  .brand strong { font-size: 14px; }
  .brand span { display: none; }
  .brand-mark { width: 38px; height: 38px; }
  .campus-tabs { margin-left: auto; }
  .tab { padding: 9px 12px; font-size: 13px; }
  .painted-map-trigger { padding: 9px 12px; font-size: 12px; }
  .shell { padding: 12px 12px 30px; }
  .hero { gap: 12px; }
  .intro-panel { min-height: 320px; border-radius: 20px; padding: 26px 22px; }
  h1 { font-size: 54px; }
  .lead { font-size: 13px; }
  .map-panel { border-radius: 20px; min-height: 560px; }
  #map { height: 540px; }
  .map-toolbar { left: 18px; right: 18px; top: 18px; }
  .map-action { padding: 0 13px; font-size: 12px; }
  .section { margin-top: 12px; padding: 22px 16px; border-radius: 20px; }
  .section-heading { display: block; }
  .section-heading p { margin-top: 8px; }
  .poi-grid { grid-template-columns: 1fr; }
  footer { display: block; line-height: 1.7; }
  .source-links { margin-top: 8px; }
  .painted-map-dialog { padding: max(6px, env(safe-area-inset-top)) max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left)); }
  .painted-map-sheet { gap: 6px; padding: 7px; border-radius: 20px; }
  .painted-map-header { min-height: 56px; gap: 8px; padding-left: 7px; }
  .painted-map-header h2 { font-size: 17px; }
  .painted-map-header span { font-size: 8px; }
  .painted-map-controls button { min-height: 40px; padding: 8px 10px; font-size: 12px; }
  .painted-map-canvas { border-radius: 15px; }
  #painted-map-preview { min-height: 360px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
