:root {
  --ink: #17212b;
  --muted: #6a7480;
  --canvas: #eef4f9;
  --paper: #ffffff;
  --line: #e1e7ec;
  --blue: #4f7ee8;
  --blue-pale: #edf3ff;
  --green: #3d9a7a;
  --green-pale: #eaf7f2;
  --gold: #c49236;
  --gold-pale: #fbf3e3;
  --coral: #cf6672;
  --coral-pale: #fceef0;
  --violet: #865fc2;
  --violet-pale: #f2edfb;
  --brand: #b51c2e;
  --brand-deep: #8e1422;
  --brand-pale: #fbecef;
  --red: #8c2631;
  --shell: 760px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 20px;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: #f5f7f6;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.6;
  letter-spacing: 0;
}

body.modal-open { overflow: hidden; }
button, input { font: inherit; }
button, a { color: inherit; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { text-decoration: none; }

.page-shell {
  width: min(var(--shell), calc(100% - 28px));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 300;
  padding: 8px 12px;
  background: #fff;
  border: 2px solid var(--ink);
}
.skip-link:focus { top: 12px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  padding-top: 8px;
  background: rgba(245, 247, 246, 0.92);
  border-bottom: 1px solid rgba(222, 227, 224, 0.8);
  backdrop-filter: blur(14px);
}
.header-inner {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 3px;
  background: #fff;
  border: 1px solid #eadde0;
  border-radius: 50%;
  box-shadow: 0 4px 14px rgba(115, 22, 34, 0.08);
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-copy { min-width: 0; }
.brand-copy strong,
.brand-copy small { display: block; }
.brand-copy strong { color: #2b2425; font-size: 18px; line-height: 1.3; }
.brand-copy small { color: var(--muted); font-size: 11px; white-space: nowrap; }

.icon-button,
.entry-close,
.modal-close {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid #dce4eb;
  border-radius: 50%;
  color: #55616d;
  background: rgba(255,255,255,0.78);
}
.icon-button { position: relative; box-shadow: 0 0 0 4px rgba(181,28,46,0.07); }
.icon-button svg,
.entry-close svg,
.modal-close svg { width: 18px; }
.notice-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  background: var(--brand);
  border: 1px solid #fff;
  border-radius: 50%;
}

.official-note {
  min-height: 62px;
  margin-top: 12px;
  padding: 12px 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  background: #fff8f0;
  border: 1px solid #ead9c5;
  border-radius: 8px;
}
.official-note > svg { width: 19px; color: #aa7e24; }
.official-note strong { display: block; font-size: 13px; }
.official-note p { margin: 1px 0 0; color: #6f6858; font-size: 11px; }

main { padding-block: 14px 30px; }
main > section + section { margin-top: 0; }

.welcome-card {
  position: relative;
  height: 370px;
  overflow: hidden;
  color: #fff;
  background: #263849;
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(38, 51, 46, 0.15);
}
.welcome-card > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.welcome-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(14,27,37,0.18) 0%, rgba(14,27,37,0.26) 35%, rgba(14,27,37,0.82) 100%);
}
.welcome-content {
  position: relative;
  z-index: 1;
  height: 100%;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.hero-brandline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.hero-brandline img {
  width: min(300px, 68%);
  height: auto;
}
.hero-brandline span {
  padding: 4px 8px;
  color: #fff;
  background: rgba(181,28,46,0.88);
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
}
.hero-copy > p {
  margin: 0 0 5px;
  color: #f5d9dc;
  font-size: 11px;
  font-weight: 800;
}
.hero-copy h1 {
  margin: 0;
  font-size: 31px;
  line-height: 1.18;
  letter-spacing: 0;
}
.hero-copy > span { display: block; margin-top: 7px; color: rgba(255,255,255,0.82); font-size: 13px; }
.hero-actions { margin-top: 18px; display: flex; align-items: center; gap: 10px; }
.hero-button {
  min-height: 42px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 6px;
  color: var(--brand-deep);
  background: #fff;
  font-weight: 700;
}
.hero-button svg { width: 17px; }
.hero-link {
  min-height: 42px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
}
.hero-link svg { width: 16px; }

.campus-signature {
  min-height: 68px;
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  background: #fff;
  border: 1px solid #e5e8e6;
  border-radius: 8px;
}
.campus-signature > div { min-width: 0; padding: 9px 8px; text-align: center; }
.campus-signature > div + div { border-left: 1px solid #ecefed; }
.campus-signature strong,
.campus-signature span { display: block; }
.campus-signature strong { color: var(--brand); font-size: 15px; line-height: 1.2; }
.campus-signature span { margin-top: 3px; color: var(--muted); font-size: 9px; }

.guide-panel {
  margin-top: 12px;
  padding: 28px 0;
  background: transparent;
  border-top: 1px solid #e3e7e4;
}
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.section-heading p {
  margin: 0 0 2px;
  color: var(--brand);
  font-size: 10px;
  font-weight: 800;
}
.section-heading h2 { margin: 0; font-size: 21px; }
.section-heading > span {
  padding: 3px 8px;
  color: #8a95a0;
  background: #f5f7f9;
  border-radius: 4px;
  font-size: 10px;
}
.section-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
}
.section-link svg { width: 14px; }

.quick-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px 10px;
}
.quick-grid button,
.quick-grid a {
  min-width: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  border: 0;
  background: transparent;
}
.quick-grid strong { font-size: 12px; line-height: 1.35; }
.quick-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  transition: transform 150ms ease;
}
.quick-grid button:hover .quick-icon,
.quick-grid a:hover .quick-icon { transform: translateY(-2px); }
.quick-icon svg { width: 21px; }
.blue { color: var(--blue); background: var(--blue-pale); }
.green { color: var(--green); background: var(--green-pale); }
.gold { color: var(--gold); background: var(--gold-pale); }
.coral { color: var(--coral); background: var(--coral-pale); }
.violet { color: var(--violet); background: var(--violet-pale); }
.brand-red { color: var(--brand); background: var(--brand-pale); }

.campus-stories {
  padding: 28px 0;
  border-top: 1px solid #e3e7e4;
}
.campus-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.campus-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  margin: 0;
  overflow: hidden;
  background: #d9dfdc;
  border-radius: 8px;
}
.campus-photo-main { grid-column: 1 / -1; aspect-ratio: 16 / 8.5; }
.campus-photo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.campus-photo-main img { object-position: center 54%; }
.campus-photo figcaption {
  position: absolute;
  inset: auto 0 0;
  padding: 22px 13px 11px;
  color: #fff;
  background: linear-gradient(180deg, transparent, rgba(17, 25, 22, 0.84));
}
.campus-photo figcaption strong,
.campus-photo figcaption span { display: block; }
.campus-photo figcaption strong { font-size: 13px; }
.campus-photo figcaption span { margin-top: 1px; color: rgba(255,255,255,0.76); font-size: 9px; }
.photo-source { margin: 8px 0 0; color: #8a938e; font-size: 9px; text-align: right; }

.explore-grid,
.service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.explore-card {
  min-width: 0;
  min-height: 78px;
  padding: 13px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
  text-align: left;
  border: 0;
  border-radius: 8px;
}
.explore-card > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: rgba(255,255,255,0.78);
  border-radius: 7px;
}
.explore-card > span svg { width: 19px; }
.explore-card strong,
.explore-card small { display: block; }
.explore-card strong { color: var(--ink); font-size: 13px; }
.explore-card small { margin-top: 2px; color: #6f7880; font-size: 10px; }
.explore-card > svg { width: 16px; color: #8d969d; }
.explore-wide { grid-column: 1 / -1; }

.service-grid { gap: 8px; }
.service-grid button,
.service-grid a {
  min-height: 72px;
  padding: 13px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}
.service-grid strong,
.service-grid small { display: block; }
.service-grid strong { font-size: 13px; }
.service-grid small { margin-top: 2px; color: #87919a; font-size: 10px; }
.service-wide { grid-column: 1 / -1; }
.service-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 7px;
}
.service-icon svg { width: 19px; }

.site-footer {
  padding-block: 28px 34px;
  text-align: center;
  color: #c9d0cc;
  background: #252d2a;
}
.site-footer .page-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.site-footer p { margin: 8px 0 2px; font-size: 12px; }
.site-footer small { font-size: 9px; }
.footer-logo { width: min(260px, 72%); height: auto; }

.entry-backdrop,
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  padding: 18px;
  display: grid;
  place-items: center;
  background: rgba(30, 42, 55, 0.62);
  backdrop-filter: blur(5px);
}
.entry-backdrop[hidden],
.modal-backdrop[hidden] { display: none; }
.entry-sheet,
.modal {
  width: min(500px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 28px 90px rgba(18,28,38,0.28);
}
.entry-sheet > header,
.modal > header {
  min-height: 76px;
  padding: 15px 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 11px;
  border-bottom: 1px solid var(--line);
}
.entry-sheet > header > span,
.modal-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  border-radius: 7px;
}
.entry-sheet > header svg,
.modal-icon svg { width: 19px; }
.entry-sheet header small,
.modal header small { color: #6684b5; font-size: 9px; font-weight: 800; }
.entry-sheet header h2,
.modal header h2 { margin: 0; font-size: 18px; }
.entry-content,
.modal-body { padding: 18px; }
.unofficial-badge {
  display: inline-flex;
  padding: 3px 7px;
  color: #996814;
  background: var(--gold-pale);
  border-radius: 4px;
  font-size: 9px;
  font-weight: 800;
}
.entry-content h3 { margin: 8px 0 4px; font-size: 17px; }
.entry-content > p { margin: 0; color: var(--muted); font-size: 12px; }
.group-pending {
  margin-top: 15px;
  padding: 12px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafb;
}
.group-pending > span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--green);
  background: #fff;
  border-radius: 7px;
}
.group-pending svg { width: 22px; }
.group-pending small,
.group-pending strong { display: block; }
.group-pending small { color: var(--muted); font-size: 9px; }
.group-pending strong { font-size: 13px; }
.entry-warning,
.modal-source {
  margin-top: 14px;
  padding: 10px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  color: #6b6559;
  background: #fff9ed;
  border-radius: 7px;
  font-size: 10px;
}
.entry-warning svg,
.modal-source svg { width: 15px; color: var(--gold); }
.entry-warning p { margin: 0; }
.entry-button {
  width: 100%;
  min-height: 44px;
  margin-top: 15px;
  border: 0;
  border-radius: 6px;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
}

.modal-body { color: #3e4851; font-size: 13px; }
.modal-body p { margin: 0; }
.modal-body h3 { margin: 18px 0 6px; color: var(--ink); font-size: 14px; }
.modal-body ul { margin: 0; padding-left: 19px; }
.modal-body li + li { margin-top: 5px; }
.modal-body a { color: #3568cb; text-decoration: underline; text-underline-offset: 3px; }
.contact-qr {
  width: min(360px, 100%);
  margin: 16px auto 0;
  padding: 8px;
  text-align: center;
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.contact-qr img {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
  border-radius: 5px;
}
.contact-qr figcaption {
  padding: 8px 4px 2px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}
.entry-qr { width: min(310px, 100%); margin-top: 15px; }
.guide-image {
  width: min(430px, 100%);
  margin: 12px auto 0;
  padding: 7px;
  text-align: center;
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.guide-image img {
  width: 100%;
  height: auto;
  display: block;
  background: #fff;
  border-radius: 4px;
}
.guide-image figcaption {
  padding: 7px 4px 1px;
  color: var(--muted);
  font-size: 10px;
}
.dorm-zone {
  margin-top: 10px;
  padding: 11px 12px;
  background: #f7f9fb;
  border-left: 4px solid var(--blue);
  border-radius: 0 7px 7px 0;
}
.modal-body .dorm-zone h3 { margin: 0 0 3px; }
.modal-body .dorm-zone p { color: #59646e; }
.dorm-east { border-left-color: var(--green); }
.dorm-center { border-left-color: var(--gold); }
.dorm-west { border-left-color: var(--coral); }
.mini-program-link {
  margin-top: 14px;
  padding: 11px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  background: #f7f9fb;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.mini-program-link small,
.mini-program-link strong { display: block; }
.mini-program-link small { color: var(--muted); font-size: 9px; }
.mini-program-link strong { color: var(--ink); font-size: 13px; }
.mini-program-link code {
  margin-top: 3px;
  display: block;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.mini-program-link button {
  min-height: 36px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: #fff;
  background: var(--blue);
  border: 0;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}
.mini-program-link button svg { width: 15px; }
.modal-body .mini-program-help {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}
.health-callout {
  margin-top: 14px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--coral-pale);
  border-left: 4px solid var(--coral);
  border-radius: 0 7px 7px 0;
}
.health-callout small { color: var(--muted); font-size: 10px; }
.modal-body .health-callout a {
  flex: 0 0 auto;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}
.entry-copy-row { margin-top: 10px; }
.modal-source { margin: 0 18px 18px; background: #f4f7f9; color: #6a747d; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 220;
  transform: translate(-50%, 18px);
  padding: 8px 13px;
  color: #fff;
  background: #1b2630;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  font-size: 11px;
  transition: opacity 150ms ease, transform 150ms ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .site-header { padding-top: 8px; }
  .header-inner { min-height: 52px; }
  .brand { gap: 9px; }
  .brand-mark { width: 36px; height: 36px; padding: 2px; }
  .brand-copy strong { font-size: 15px; }
  .brand-copy small { font-size: 9px; }
  .icon-button { width: 36px; height: 36px; }
  .official-note { margin-top: 8px; }
  main { padding-top: 10px; }
  .welcome-card { height: 344px; }
  .welcome-card > img { object-position: center 52%; }
  .welcome-content { padding: 18px; }
  .hero-brandline { gap: 10px; }
  .hero-brandline img { width: min(228px, 72%); }
  .hero-brandline span { padding: 3px 6px; font-size: 8px; }
  .hero-copy h1 { font-size: 27px; }
  .hero-copy > span { margin-top: 5px; font-size: 11px; }
  .hero-actions { margin-top: 14px; gap: 8px; }
  .hero-button,
  .hero-link { min-height: 40px; padding-inline: 11px; }
  .hero-button { font-size: 13px; }
  .hero-link { font-size: 11px; }
  .campus-signature { min-height: 62px; }
  .campus-signature strong { font-size: 14px; }
  .guide-panel,
  .campus-stories { padding: 22px 0; }
  .section-heading { margin-bottom: 17px; }
  .quick-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 4px; }
  .quick-grid strong { font-size: 11px; }
  .quick-icon { width: 42px; height: 42px; }
  .campus-gallery { gap: 8px; }
  .campus-photo-main { aspect-ratio: 16 / 9; }
  .campus-photo figcaption { padding: 18px 10px 8px; }
  .campus-photo figcaption strong { font-size: 11px; }
  .campus-photo figcaption span { font-size: 8px; }
  .explore-grid,
  .service-grid { grid-template-columns: 1fr; }
  .explore-wide { grid-column: auto; }
  .service-wide { grid-column: auto; }
  .entry-backdrop,
  .modal-backdrop { padding: 0; place-items: end center; }
  .entry-sheet,
  .modal {
    width: 100%;
    max-height: 92vh;
    border-radius: 8px 8px 0 0;
  }
}

@media (max-width: 360px) {
  .page-shell { width: min(var(--shell), calc(100% - 20px)); }
  .brand-copy strong { font-size: 14px; }
  .brand-copy small { font-size: 8px; }
  .official-note { padding-inline: 11px; }
  .welcome-card { height: 332px; }
  .welcome-content { padding: 15px; }
  .hero-brandline img { width: min(205px, 69%); }
  .hero-copy h1 { font-size: 25px; }
  .hero-actions { gap: 6px; }
  .hero-button,
  .hero-link { padding-inline: 9px; }
  .quick-grid strong { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
