:root {
  --bg: #f6f9fb;
  --card: #ffffff;
  --text: #17212b;
  --muted: #667085;
  --green: #00a86b;
  --green-dark: #078458;
  --ice: #e8f3fa;
  --orange: #ff8a3d;
  --border: #e5eaf0;
  --shadow: 0 20px 50px rgba(23, 33, 43, 0.08);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, rgba(232, 243, 250, 0.9), transparent 28%),
    linear-gradient(180deg, #f6f9fb 0%, #eef5f8 100%);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(229, 234, 240, 0.86);
  background: rgba(246, 249, 251, 0.88);
  backdrop-filter: blur(16px);
}

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

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 10px;
  color: #ffffff;
  background: var(--green);
  font-weight: 700;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.topnav {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.topnav a:hover {
  color: var(--green-dark);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: stretch;
  padding: 34px 0 22px;
}

.query-shell,
.brand-panel,
.results-section,
.campus-section,
.about-section {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.query-shell {
  padding: clamp(20px, 3vw, 32px);
  background:
    linear-gradient(90deg, rgba(207, 225, 227, 0.52) 1px, transparent 1px),
    linear-gradient(180deg, rgba(207, 225, 227, 0.42) 1px, transparent 1px),
    #fbfdfc;
  background-size: 48px 48px, 48px 48px, auto;
}

.query-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 136px;
  gap: clamp(16px, 3vw, 28px);
  align-items: start;
}

.coordinate-card {
  position: relative;
  min-height: 132px;
  padding: 14px;
  border: 1px solid #cfe1e3;
  border-radius: var(--radius);
  color: #13201f;
  background:
    linear-gradient(90deg, rgba(0, 143, 90, 0.14) 1px, transparent 1px),
    linear-gradient(180deg, rgba(0, 143, 90, 0.12) 1px, transparent 1px),
    rgba(243, 248, 248, 0.88);
  background-size: 16px 16px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
  font-variant-numeric: tabular-nums;
}

.coordinate-card::before,
.coordinate-card::after {
  content: "";
  position: absolute;
  background: #008f5a;
}

.coordinate-card::before {
  left: 14px;
  right: 14px;
  bottom: 32px;
  height: 1px;
}

.coordinate-card::after {
  left: 30px;
  top: 14px;
  bottom: 18px;
  width: 1px;
}

.coordinate-card span,
.coordinate-card strong,
.coordinate-card em {
  position: relative;
  z-index: 1;
  display: block;
}

.coordinate-card span {
  color: #5f6f72;
  font-size: 11px;
  letter-spacing: 0;
}

.coordinate-card strong {
  margin-top: 24px;
  color: #008f5a;
  font-family: "DIN Alternate", "Roboto Mono", Consolas, monospace;
  font-size: 34px;
  line-height: 1;
}

.coordinate-card em {
  margin-top: 8px;
  color: #5f6f72;
  font-size: 12px;
  font-style: normal;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid #cfe7dd;
  border-radius: 999px;
  color: var(--green-dark);
  background: #f0fbf7;
  font-size: 13px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin: 18px 0 8px;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.16;
  letter-spacing: 0;
  overflow-wrap: break-word;
}

.lead {
  max-width: 680px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
  overflow-wrap: break-word;
}

.tabs {
  display: flex;
  gap: 8px;
  max-width: 100%;
  padding: 6px;
  margin: 24px 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f4f8fb;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar,
.topnav::-webkit-scrollbar {
  display: none;
}

.tab {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.tab.is-active {
  color: #ffffff;
  background: var(--green);
  box-shadow: 0 8px 16px rgba(0, 168, 107, 0.18);
}

.panel {
  display: none;
}

.panel.is-active {
  display: block;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

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

label span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
}

label {
  min-width: 0;
}

input,
select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  font: inherit;
  outline: none;
}

.suggest-anchor {
  position: relative;
}

.suggestions {
  position: absolute;
  right: 0;
  left: 0;
  top: calc(100% + 6px);
  z-index: 25;
  display: none;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 36px rgba(23, 33, 43, 0.14);
}

.suggestions.is-open {
  display: block;
}

.suggestion-item {
  display: block;
  width: 100%;
  min-height: 38px;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid #eef2f5;
  color: var(--text);
  background: #ffffff;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.suggestion-item:hover,
.suggestion-item:focus {
  background: #f0fbf7;
}

input:focus,
select:focus {
  border-color: rgba(0, 168, 107, 0.55);
  box-shadow: 0 0 0 4px rgba(0, 168, 107, 0.1);
}

.range-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-width: 0;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

button,
.primary-btn,
.ghost-btn,
.map-link,
.nav-link,
.campus-card a {
  white-space: nowrap;
}

.primary-btn,
.ghost-btn {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
}

.primary-btn {
  border: 1px solid var(--green);
  color: #ffffff;
  background: var(--green);
}

.primary-btn:hover {
  background: var(--green-dark);
}

.ghost-btn {
  border: 1px solid var(--border);
  color: var(--text);
  background: #ffffff;
}

.align-end {
  align-self: end;
}

.empty-inline {
  padding: 22px;
  border: 1px dashed #cbd8e1;
  border-radius: var(--radius);
  background: #f8fbfd;
}

.empty-inline p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.brand-panel {
  min-width: 0;
  padding: 16px;
}

.service-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin-bottom: 12px;
  padding: 0 9px;
  border: 1px solid #d9e5e4;
  border-radius: 999px;
  color: #006f48;
  background: #f8fcfa;
  font-size: 12px;
}

.slider {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--ice);
}

.slide {
  display: none;
  position: relative;
  min-height: 250px;
}

.slide.is-active {
  display: block;
}

.slide img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.slide div {
  padding: 14px 16px 42px;
  background: #ffffff;
}

.slide strong,
.slide span {
  display: block;
}

.slide span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.slide-btn {
  position: absolute;
  top: 34%;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
}

.slide-btn.prev {
  left: 10px;
}

.slide-btn.next {
  right: 10px;
}

.dots {
  position: absolute;
  right: 16px;
  bottom: 18px;
  display: flex;
  gap: 6px;
}

.dot {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 50%;
  background: #cbd8e1;
  cursor: pointer;
}

.dot.is-active {
  width: 22px;
  border-radius: 999px;
  background: var(--green);
}

.stats-card,
.side-cta {
  display: block;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
}

.stats-card span,
.stats-card p {
  color: var(--muted);
  font-size: 13px;
}

.stats-card strong {
  display: block;
  margin: 5px 0;
  font-size: 30px;
  font-variant-numeric: tabular-nums;
}

.stats-card p {
  margin-bottom: 0;
}

.side-cta {
  color: #ffffff;
  background: linear-gradient(135deg, var(--green), #14b883);
}

.side-cta strong,
.side-cta span {
  display: block;
}

.side-cta span {
  font-size: 13px;
  opacity: 0.85;
}

.side-cta strong {
  margin-top: 4px;
}

.results-section,
.campus-section,
.about-section {
  margin: 18px 0;
  padding: clamp(18px, 3vw, 26px);
}

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

.section-head h2 {
  margin-bottom: 6px;
  font-size: 22px;
}

.section-head p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.result-count {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--green-dark);
  background: #effbf6;
  font-size: 13px;
  white-space: nowrap;
}

.result-overview {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.result-overview article {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fbfdfc;
}

.result-overview span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.result-overview strong {
  display: block;
  margin-top: 4px;
  color: var(--green-dark);
  font-size: clamp(18px, 2vw, 24px);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, #ffffff 30%, rgba(255, 255, 255, 0)),
    linear-gradient(90deg, rgba(255, 255, 255, 0), #ffffff 70%) 100% 0,
    radial-gradient(farthest-side at 0 50%, rgba(23, 33, 43, 0.18), transparent),
    radial-gradient(farthest-side at 100% 50%, rgba(23, 33, 43, 0.18), transparent) 100% 0;
  background-attachment: local, local, scroll, scroll;
  background-repeat: no-repeat;
  background-size: 42px 100%, 42px 100%, 14px 100%, 14px 100%;
}

table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #485464;
  background: #f4f8fb;
  font-weight: 600;
}

th:first-child,
td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #ffffff;
}

th:first-child {
  z-index: 3;
  background: #f4f8fb;
}

td.num,
th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.score-2026 {
  color: var(--green-dark);
  font-weight: 700;
}

.row-sub {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.code-pill {
  display: inline-flex;
  min-width: 34px;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #9b2633;
  background: #fff0f2;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.result-groups {
  display: grid;
  gap: 14px;
}

.school-result-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
}

.school-result-head {
  display: grid;
  grid-template-columns: minmax(160px, 0.9fr) minmax(0, 1.8fr);
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--border);
  background: #fbfdfc;
}

.school-result-head h3 {
  margin-bottom: 5px;
  font-size: 18px;
}

.school-result-head p {
  margin-bottom: 0;
  color: var(--muted);
}

.school-result-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.school-result-stats span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #dce8e7;
  border-radius: 999px;
  color: #415154;
  background: #ffffff;
  font-size: 13px;
}

.compact-table {
  border: 0;
  border-radius: 0;
}

.compact-table table {
  min-width: 1040px;
}

.mapping-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 140px)) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  margin-bottom: 14px;
}

.mapping-summary article,
.mapping-summary p {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fbfdfc;
}

.mapping-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.mapping-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--green-dark);
  font-size: 24px;
}

.mapping-summary p {
  color: var(--muted);
  line-height: 1.7;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  color: #56616d;
  background: #eef2f5;
  font-size: 12px;
}

.tier-grid,
.target-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.tier-card,
.target-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
}

.tier-card h3,
.target-card h3 {
  margin: 0;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 16px;
}

.tier-card .tier-body,
.target-card .target-body {
  padding: 14px 16px;
}

.target-number {
  display: block;
  color: var(--green-dark);
  font-size: 34px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.result-list {
  display: grid;
  gap: 10px;
}

.mini-result {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdfe;
}

.mini-result strong {
  display: block;
  margin-bottom: 5px;
}

.mini-result span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.campus-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.campus-card {
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
}

.map-preview {
  position: relative;
  display: block;
  height: 150px;
  margin: -6px -6px 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 48%, rgba(0, 168, 107, 0.22), transparent 16%),
    linear-gradient(90deg, rgba(0, 168, 107, 0.1) 1px, transparent 1px),
    linear-gradient(180deg, rgba(0, 168, 107, 0.1) 1px, transparent 1px),
    #edf6f4;
  background-size: 22px 22px;
}

.map-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, transparent 46%, rgba(0, 168, 107, 0.22) 47%, rgba(0, 168, 107, 0.22) 53%, transparent 54%),
    linear-gradient(25deg, transparent 50%, rgba(255, 138, 61, 0.22) 51%, rgba(255, 138, 61, 0.22) 54%, transparent 55%);
  opacity: 0.9;
}

.map-preview::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(0, 168, 107, 0.22);
  border-radius: 6px;
  pointer-events: none;
}

.map-pin {
  position: absolute;
  left: 50%;
  top: 44%;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px 999px 999px 4px;
  background: var(--green);
  transform: translate(-50%, -50%) rotate(-45deg);
  box-shadow: 0 10px 20px rgba(0, 168, 107, 0.2);
}

.map-pin::after {
  content: "";
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
}

.map-route {
  position: absolute;
  display: block;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(0, 168, 107, 0.14);
}

.route-a {
  left: 18px;
  right: 42px;
  top: 34px;
  transform: rotate(-10deg);
}

.route-b {
  left: 46px;
  right: 18px;
  bottom: 40px;
  transform: rotate(8deg);
}

.map-badge,
.map-label,
.map-coord {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 20px rgba(23, 33, 43, 0.08);
}

.map-badge {
  top: 12px;
  left: 12px;
  min-height: 26px;
  padding: 0 9px;
  color: var(--green-dark);
  font-size: 12px;
}

.map-label {
  right: 12px;
  bottom: 12px;
  min-height: 28px;
  padding: 0 10px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.map-coord {
  left: 12px;
  bottom: 12px;
  min-height: 24px;
  padding: 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.campus-card h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.campus-card p {
  min-height: 66px;
  margin-bottom: 14px;
  color: var(--muted);
  line-height: 1.7;
}

.campus-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.map-link,
.nav-link,
.campus-card a.cta {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 14px;
}

.map-link {
  border: 1px solid var(--border);
  color: var(--text);
}

.nav-link {
  border: 1px solid #d4eadf;
  color: var(--green-dark);
  background: #effbf6;
}

.campus-card a.cta {
  color: #ffffff;
  background: var(--green);
}

.about-section {
  margin-bottom: 90px;
}

.about-section p {
  color: var(--muted);
  line-height: 1.8;
}

.floating-appointment {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 30;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  color: #ffffff;
  background: var(--orange);
  box-shadow: 0 16px 28px rgba(255, 138, 61, 0.32);
  font-weight: 600;
}

.empty-state {
  padding: 28px;
  border: 1px dashed #cbd8e1;
  border-radius: var(--radius);
  color: var(--muted);
  background: #f8fbfd;
  line-height: 1.8;
}

.mapping-note {
  margin-top: 14px;
}

.mapping-note + #mappingResult {
  margin-top: 14px;
}

@media (max-width: 1020px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.8fr);
    gap: 14px;
  }

  .stats-card {
    margin-top: 0;
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 16px;
  }

  .topnav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  main {
    width: min(100% - 20px, 1180px);
  }

  .workspace {
    padding-top: 18px;
  }

  .query-shell {
    padding: 16px;
  }

  .query-head {
    grid-template-columns: 1fr;
  }

  .coordinate-card {
    min-height: 92px;
  }

  .coordinate-card strong {
    margin-top: 12px;
    font-size: 28px;
  }

  .brand-panel {
    display: block;
  }

  .stats-card {
    margin-top: 12px;
  }

  .form-grid,
  .target-grid,
  .tier-grid,
  .target-cards,
  .campus-grid,
  .result-overview,
  .school-result-head,
  .mapping-summary {
    grid-template-columns: 1fr;
  }

  .school-result-stats {
    justify-content: flex-start;
  }

  .actions,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-btn,
  .ghost-btn {
    width: 100%;
  }

  h1 {
    font-size: 28px;
    line-height: 1.18;
  }

  .lead {
    font-size: 15px;
  }

  .tabs {
    margin: 18px 0;
  }

  .slide {
    min-height: 0;
  }

  .slide div {
    padding-bottom: 38px;
  }

  .campus-card p {
    min-height: 0;
  }

  .floating-appointment {
    right: 12px;
    bottom: 12px;
    min-height: 42px;
    padding: 0 14px;
    font-size: 14px;
  }
}
