:root {
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-soft: #f8faf9;
  --line: #dbe3e2;
  --line-strong: #c4d0ce;
  --text: #17211f;
  --muted: #63706d;
  --teal: #078f7d;
  --teal-dark: #006f62;
  --teal-soft: #e6f5f2;
  --amber: #c97906;
  --amber-soft: #fff5df;
  --red: #c94f4f;
  --red-soft: #fff0f0;
  --blue-soft: #eef5ff;
  --shadow: 0 16px 40px rgba(15, 32, 31, 0.08);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
}

/* ---- Disclaimer Overlay ---- */

.disclaimer-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 32, 31, 0.55);
  backdrop-filter: blur(6px);
}

.disclaimer-card {
  width: min(420px, calc(100vw - 32px));
  padding: 32px 28px 24px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 20px 48px rgba(15, 32, 31, 0.2);
  text-align: center;
}

.disclaimer-card h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

.disclaimer-card p {
  margin: 0 0 24px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.disclaimer-card button {
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}

/* ---- Topbar ---- */

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 270px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal);
  display: grid;
  place-items: center;
}

.brand-mark svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
}

.brand h1 {
  margin: 0;
  font-size: 21px;
  line-height: 1.1;
}

.brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.ghost-button,
.primary-button {
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 0 14px;
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}

.primary-button {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

.workspace {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
}

.filters,
.map-panel,
.detail-panel,
.table-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.filters {
  padding: 14px;
  align-self: start;
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 100px);
  overflow: auto;
  min-width: 0;
}

.filter-section {
  padding: 0 0 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.filter-section:last-of-type {
  border-bottom: 0;
  margin-bottom: 0;
}

.workflow-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(7, 143, 125, 0.18);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(230, 245, 242, 0.9), rgba(248, 250, 249, 0.9));
}

.workflow-step {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.workflow-step span {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.workflow-step p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.workflow-step strong {
  color: var(--text);
  margin-right: 4px;
}

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

.section-title h2,
.panel-heading h2,
.table-header h2,
.detail-panel h2 {
  margin: 0;
  font-size: 15px;
}

.section-title button {
  border: 0;
  background: transparent;
  color: var(--teal);
  cursor: pointer;
  font-size: 12px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.search-box {
  height: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  background: var(--surface-soft);
}

.search-box svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.segmented button {
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  color: var(--muted);
}

.segmented button.active {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-weight: 700;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  color: var(--text);
  font-size: 13px;
}

.check-row span {
  margin-left: auto;
  min-width: 28px;
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

input[type="checkbox"] {
  accent-color: var(--teal);
}

#profileSelect {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 0 10px;
}

.profile-score {
  margin-top: 10px;
  padding: 10px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: #26496d;
  font-size: 12px;
  line-height: 1.5;
}

.location-results,
.selected-locations {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.location-results button,
.selected-locations button,
.location-recommendation button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 6px 10px;
  color: var(--teal-dark);
  cursor: pointer;
  font-size: 12px;
}

.location-results button b {
  margin-right: 5px;
}

.location-results button span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.selected-locations button {
  background: var(--teal-soft);
  border-color: rgba(7, 143, 125, 0.24);
  font-weight: 700;
}

.selected-locations span {
  margin-left: 5px;
  color: var(--muted);
}

.location-results > span,
.location-recommendation {
  margin-top: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.location-summary {
  display: grid;
  gap: 2px;
  margin-bottom: 8px;
}

.location-summary strong {
  color: var(--text);
}

.location-stage-group {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.location-stage-group b {
  color: var(--teal-dark);
  font-size: 12px;
}

.location-recommendation .location-school-card {
  width: 100%;
  border-color: rgba(7, 143, 125, 0.28);
  border-radius: 8px;
  background: var(--surface);
  text-align: left;
  font-weight: 700;
}

.location-school-card strong,
.location-school-card span {
  display: block;
}

.location-school-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-links button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  padding: 6px 10px;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.note {
  padding: 12px;
  border-radius: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.note strong {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
}

.note p {
  margin: 0;
}

/* ---- Content / Map & Detail ---- */

.content {
  min-width: 0;
  display: grid;
  gap: 14px;
}

.map-and-detail {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.75fr);
  gap: 14px;
  align-items: start;
}

.map-panel,
.detail-panel,
.table-panel {
  overflow: hidden;
}

.panel-heading,
.table-header {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.panel-heading p,
.table-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.panel-heading a {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  text-decoration: none;
  color: var(--teal-dark);
  background: var(--teal-soft);
  font-size: 12px;
  white-space: nowrap;
}

.map-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.map-tools button,
.map-tools a {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  text-decoration: none;
  color: var(--teal-dark);
  background: var(--teal-soft);
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.map-tools button.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.map-mode-toggle {
  display: flex;
}

.map-mode-toggle button {
  border-radius: 0;
}

.map-mode-toggle button:first-child {
  border-radius: 8px 0 0 8px;
}

.map-mode-toggle button:last-child {
  border-radius: 0 8px 8px 0;
  border-left: 0;
}

.official-search {
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: #278df2;
  color: #fff;
  font-size: 13px;
}

.official-search select,
.official-search input,
.official-search button {
  height: 30px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: #fff;
  color: #17211f;
  padding: 0 8px;
}

.official-search input {
  width: min(240px, 30vw);
}

.official-search button {
  cursor: pointer;
  font-weight: 700;
}

.map-search-results {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.map-search-results button {
  height: 26px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 0 9px;
}

.local-map-wrap {
  position: relative;
  height: 450px;
  background:
    linear-gradient(90deg, rgba(7, 143, 125, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(7, 143, 125, 0.04) 1px, transparent 1px),
    #edf3f2;
  background-size: 40px 40px;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

#localMap {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}

#localMap:active {
  cursor: grabbing;
}

.map-zoom-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
  z-index: 6;
}

.map-zoom-controls button {
  min-width: 34px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--teal-dark);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(15, 32, 31, 0.08);
}

.district-shape {
  fill: rgba(255, 255, 255, 0.08);
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.satellite-tiles {
  opacity: 0.58;
  pointer-events: none;
}

.school-polygon {
  fill: rgba(255, 255, 255, 0.1);
  stroke: #d21f1f;
  stroke-width: 1.7;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: fill 0.16s ease, stroke 0.16s ease;
  stroke-dasharray: 5 4;
}

.school-polygon.risk.low {
  fill: rgba(7, 143, 125, 0.16);
  stroke: rgba(7, 143, 125, 0.7);
  stroke-dasharray: none;
}

.school-polygon.risk.medium {
  fill: rgba(201, 121, 6, 0.18);
  stroke: rgba(201, 121, 6, 0.72);
  stroke-dasharray: none;
}

.school-polygon.risk.high {
  fill: rgba(201, 79, 79, 0.16);
  stroke: rgba(201, 79, 79, 0.72);
  stroke-dasharray: none;
}

.school-polygon.risk.unknown {
  fill: rgba(92, 105, 112, 0.12);
  stroke: rgba(92, 105, 112, 0.5);
  stroke-dasharray: none;
}

.school-polygon:hover,
.school-polygon.hovered,
.school-polygon.selected {
  fill: rgba(255, 221, 0, 0.32);
  stroke: #d21f1f;
  stroke-width: 2.4;
}

.school-marker {
  fill: #ffffff;
  stroke: var(--teal-dark);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
}

.school-hit {
  fill: rgba(255, 255, 255, 0);
  stroke: transparent;
  cursor: pointer;
}

.school-label {
  fill: #173d38;
  font-size: 10px;
  font-weight: 700;
  opacity: 0;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.92);
  stroke-width: 4px;
  stroke-linejoin: round;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.school-label.visible {
  opacity: 1;
}

.map-info-card {
  position: absolute;
  top: 14px;
  left: 14px;
  width: min(360px, calc(100% - 28px));
  max-height: 360px;
  overflow: auto;
  padding: 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  box-shadow: 0 12px 30px rgba(15, 32, 31, 0.14);
  z-index: 5;
}

.map-info-card h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.map-info-mode {
  display: inline-flex;
  margin-bottom: 6px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(7, 143, 125, 0.1);
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 800;
}

.map-info-card dl {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 8px 10px;
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.map-info-card dt {
  font-weight: 700;
  color: var(--text);
}

.map-info-card dd {
  margin: 0;
  color: var(--muted);
}

.map-info-card .community-list {
  max-height: 90px;
  overflow: auto;
}

.map-hint {
  position: absolute;
  left: 14px;
  bottom: 14px;
  right: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  pointer-events: none;
}

.map-hint strong {
  color: var(--text);
  white-space: nowrap;
}

/* ---- Detail Panel ---- */

.detail-panel {
  padding: 0;
  overflow-y: auto;
  max-height: calc(100vh - 120px);
  position: sticky;
  top: 86px;
}

.detail-empty {
  min-height: 280px;
  display: grid;
  place-content: center;
  padding: 36px 28px;
  text-align: center;
  gap: 8px;
}

.detail-empty::before {
  content: "";
  width: 48px;
  height: 48px;
  margin: 0 auto 8px;
  border-radius: 12px;
  background: var(--teal);
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 48 48' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='8' y='14' width='32' height='24' rx='3' fill='black'/%3E%3Cline x1='8' y1='14' x2='24' y2='6' stroke='black' stroke-width='3'/%3E%3Cline x1='40' y1='14' x2='24' y2='6' stroke='black' stroke-width='3'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 48 48' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='8' y='14' width='32' height='24' rx='3' fill='black'/%3E%3Cline x1='8' y1='14' x2='24' y2='6' stroke='black' stroke-width='3'/%3E%3Cline x1='40' y1='14' x2='24' y2='6' stroke='black' stroke-width='3'/%3E%3C/svg%3E");
  mask-size: contain;
  -webkit-mask-size: contain;
}

.detail-empty h2 {
  margin: 0;
  font-size: 16px;
}

.detail-empty p {
  color: var(--muted);
  max-width: 260px;
  line-height: 1.6;
}

.detail-head {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(7,143,125,0.04) 0%, transparent 100%);
  position: relative;
}

.detail-head::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 4px;
  background: var(--teal);
  border-radius: 0 3px 3px 0;
}

.detail-kicker {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-right: 28px;
}

.detail-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  transition: background 0.12s ease, color 0.12s ease;
}

.detail-close:hover {
  background: var(--red-soft);
  color: var(--red);
  border-color: var(--red);
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
}

.chip.high {
  background: var(--red-soft);
  color: var(--red);
}

.chip.medium {
  background: var(--amber-soft);
  color: var(--amber);
}

.chip.low {
  background: var(--teal-soft);
  color: var(--teal-dark);
}

.chip.unknown {
  background: #eef0f2;
  color: #596066;
}

.chip.stage {
  background: #eef5ff;
  color: #2a5d91;
}

.chip.match-chip.good {
  background: var(--teal-soft);
  color: var(--teal-dark);
  border: 1px solid rgba(7, 143, 125, 0.3);
}

.chip.match-chip.maybe {
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid rgba(201, 121, 6, 0.3);
}

.chip.match-chip.bad {
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid rgba(201, 79, 79, 0.3);
}

.detail-head h2 {
  font-size: 20px;
  line-height: 1.25;
}

.detail-head p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.score-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.score-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  text-align: center;
}

.score-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 6px;
}

.score-card strong {
  display: block;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
}

.score-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.score-card.points-compare.good {
  border-color: rgba(7, 143, 125, 0.28);
  background: var(--teal-soft);
}

.score-card.points-compare.maybe {
  border-color: rgba(201, 121, 6, 0.28);
  background: var(--amber-soft);
}

.score-card.points-compare.bad {
  border-color: rgba(201, 79, 79, 0.28);
  background: var(--red-soft);
}

.score-card.muted-score strong {
  color: var(--muted);
  font-size: 15px;
}

.requirement-list {
  padding: 16px 20px;
  display: grid;
  gap: 8px;
}

.requirement {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.requirement:last-child {
  border-bottom: 1px solid var(--line);
}

.requirement b {
  font-size: 13px;
  color: var(--teal-dark);
  font-weight: 700;
}

.requirement p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 13px;
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 20px 20px;
}

.detail-actions button,
.detail-actions a {
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  color: var(--teal-dark);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.12s ease, border-color 0.12s ease;
}

.detail-actions button:hover,
.detail-actions a:hover {
  background: var(--teal-soft);
  border-color: var(--teal);
}

.detail-actions a {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

.detail-actions a:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}

/* ---- Multi School Cards ---- */

.multi-school-list {
  display: grid;
  gap: 8px;
  padding: 16px 20px;
  max-height: 360px;
  overflow: auto;
}

.multi-school-card {
  display: block;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
  font: inherit;
  color: inherit;
}

.multi-school-card:hover {
  background: var(--teal-soft);
  border-color: var(--teal);
}

.multi-school-card strong {
  display: block;
  font-size: 15px;
  color: var(--teal-dark);
  margin-bottom: 4px;
}

.multi-school-card span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 6px;
}

.multi-school-card em {
  display: block;
  font-size: 12px;
  color: var(--muted);
  font-style: normal;
  line-height: 1.45;
  margin-bottom: 4px;
}

.multi-school-card small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}

/* ---- Table Panel ---- */

.table-header h2 span {
  color: var(--teal);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.dot.high {
  background: var(--red);
}

.dot.medium {
  background: var(--amber);
}

.dot.low {
  background: var(--teal);
}

.dot.unknown {
  background: #8c969b;
}

.table-wrap {
  overflow: auto;
  max-height: 580px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1020px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
  line-height: 1.4;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 1px 0 0 var(--line-strong);
}

td:first-child,
th:first-child {
  text-align: center;
  width: 48px;
  padding-left: 16px;
  padding-right: 8px;
}

td:last-child {
  padding-right: 16px;
}

tbody tr:nth-child(even) {
  background: rgba(248, 250, 249, 0.6);
}

tbody tr {
  cursor: pointer;
  transition: background 0.12s ease;
}

tbody tr:hover {
  background: var(--teal-soft);
}

tbody tr.selected {
  background: rgba(7, 143, 125, 0.12);
  box-shadow: inset 3px 0 0 var(--teal);
}

tbody tr.selected:hover {
  background: rgba(7, 143, 125, 0.18);
}

.school-name {
  color: var(--teal-dark);
  font-weight: 700;
  max-width: 260px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.muted-cell {
  color: var(--muted);
  line-height: 1.45;
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.match {
  font-weight: 700;
}

.match.good {
  color: var(--teal-dark);
}

.match.maybe {
  color: var(--amber);
}

.match.bad {
  color: var(--red);
}

/* ---- Points Float Panel ---- */

.points-float {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  pointer-events: none;
}

.points-float-inner {
  display: flex;
  flex-direction: row-reverse;
  align-items: stretch;
  pointer-events: auto;
}

.points-float-panel {
  width: 440px;
  max-height: min(760px, calc(100vh - 32px));
  overflow: auto;
  padding: 14px 16px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px 0 0 12px;
  box-shadow: -4px 0 24px rgba(15, 32, 31, 0.14);
  display: none;
}

.points-float.is-open .points-float-panel {
  display: block;
}

.points-float-title {
  margin: 0 0 2px;
  font-size: 15px;
  color: var(--teal-dark);
}

.points-float-disclaimer {
  margin: 0 0 10px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}

.points-float-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.points-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.points-field span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.points-field small {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.35;
}

.points-field select,
.points-field input {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 0 9px;
  font-size: 12px;
  min-width: 0;
}

.points-field select:disabled,
.points-field input:disabled {
  color: var(--muted);
  background: #edf3f1;
  cursor: not-allowed;
}

.points-field-full {
  grid-column: 1 / -1;
}

.points-float-bonus {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px 10px;
  margin-bottom: 6px;
  border-radius: 6px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.bonus-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  line-height: 1.35;
}

.bonus-row input[type="checkbox"] {
  accent-color: var(--teal);
  width: 13px;
  height: 13px;
}

.points-float-result {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--teal-soft);
}

.points-float-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
  min-height: 24px;
}

.points-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid rgba(0, 128, 116, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
}

.points-chip strong {
  color: var(--teal-dark);
}

.points-float-total {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.points-float-total span {
  font-size: 11px;
  color: var(--muted);
}

.points-float-total strong {
  font-size: 22px;
  font-weight: 900;
  color: var(--teal-dark);
}

.points-warning {
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1px solid rgba(206, 70, 70, 0.24);
  border-radius: 10px;
  background: #fff3f1;
  color: #92413b;
  font-size: 11px;
  line-height: 1.45;
}

.points-warning div + div {
  margin-top: 4px;
}

.points-recommendation {
  border-top: 1px solid rgba(0, 128, 116, 0.15);
  padding-top: 8px;
  color: #164a66;
  font-size: 11px;
  line-height: 1.45;
}

.points-float-tab {
  width: 38px;
  min-height: 120px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 6px;
  border: 1px solid var(--line);
  border-right: none;
  border-radius: 10px 0 0 10px;
  background: var(--surface);
  color: var(--teal-dark);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  box-shadow: -2px 0 12px rgba(15, 32, 31, 0.08);
  writing-mode: vertical-rl;
  letter-spacing: 4px;
  transition: background 0.12s ease;
}

.points-float-tab:hover {
  background: var(--teal-soft);
}

.points-float.is-open .points-float-tab {
  border-radius: 0;
  border-right: 1px solid var(--line);
  box-shadow: none;
}

/* ---- Responsive ---- */

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

  .filters {
    position: static;
    max-height: none;
  }

  .map-and-detail {
    grid-template-columns: 1fr;
  }
}

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

  .header-actions {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .workspace {
    grid-template-columns: minmax(0, 1fr);
    padding: 10px;
    min-width: 0;
    overflow: hidden;
  }

  .filters,
  .content,
  .map-panel,
  .detail-panel,
  .table-panel {
    width: 100%;
    min-width: 0;
  }

  .segmented button {
    min-width: 0;
    padding: 0 6px;
  }

  .segmented {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: calc(100vw - 52px);
    max-width: calc(100vw - 52px);
  }

  .filters {
    max-width: calc(100vw - 20px);
  }

  .official-search {
    align-items: stretch;
    flex-direction: column;
  }

  .official-search input {
    width: 100%;
  }

  .local-map-wrap {
    height: 430px;
  }

  .score-strip {
    grid-template-columns: 1fr;
  }

  .detail-actions {
    grid-template-columns: 1fr;
  }

  .points-float-panel {
    width: 280px;
  }

  .points-float-fields {
    grid-template-columns: 1fr;
  }

  .points-float-result strong {
    font-size: 22px;
  }
}

@media (max-width: 400px) {
  .points-float-panel {
    width: 240px;
    padding: 10px 8px 8px;
  }

  .points-float-title {
    font-size: 14px;
    margin-bottom: 6px;
  }

  .points-float-disclaimer {
    font-size: 10px;
    margin-bottom: 10px;
  }
}

/* ===== 积分计算器样式 ===== */

.points-section {
  border: none;
  padding: 0;
  margin: 0 0 20px;
  min-width: 0;
}

.points-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--teal-dark);
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.points-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
}

.points-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--surface);
}

.points-option:hover {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.points-option input[type="radio"]:checked + .option-content {
  color: var(--teal-dark);
}

.points-option input[type="radio"]:checked ~ .points-option {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.points-option input[type="radio"]:checked {
  accent-color: var(--teal);
}

.option-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.option-content strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.option-content .score {
  font-size: 16px;
  font-weight: 800;
  color: var(--teal);
  margin: 2px 0;
}

.option-content small {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.sub-section {
  margin-bottom: 12px;
}

.sub-section h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.duration-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}

@media (max-width: 400px) {
  .duration-inputs {
    grid-template-columns: 1fr;
  }
}

.bonus-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--surface);
}

.checkbox-option:hover {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.checkbox-option input[type="checkbox"] {
  accent-color: var(--teal);
}

.checkbox-option input[type="checkbox"]:checked + span {
  color: var(--teal-dark);
  font-weight: 600;
}

.points-summary {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 8px;
  padding: 14px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}

.summary-row:last-of-type {
  margin-bottom: 10px;
}

.summary-row span:first-child {
  font-weight: 600;
}

.summary-row strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--teal-dark);
}

.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0 8px;
  padding: 10px;
  background: var(--teal);
  color: #fff;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
}

.summary-total span:first-child {
  color: rgba(255, 255, 255, 0.9);
}

.summary-total strong {
  font-size: 24px;
  font-weight: 900;
  color: #fff;
}

.score-interpretation {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  padding: 6px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 4px;
}

/* ===== 积分计算器附加样式 ===== */
