:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --panel: #ffffff;
  --line: #d9e1ea;
  --line-soft: #e8edf3;
  --text: #17202a;
  --muted: #657386;
  --brand: #116466;
  --brand-2: #1f7a76;
  --accent: #d97706;
  --danger: #b91c1c;
  --shadow: 0 18px 40px rgba(23, 32, 42, 0.14);
  --teal: #E6001F;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-bg-quiet: rgba(255, 255, 255, 0.65);
  --glass-bg-strong: rgba(255, 255, 255, 0.88);
  --glass-line: rgba(255, 255, 255, 0.4);
  --glass-blur: blur(20px) saturate(180%);
}

.glass {
  background: rgba(255, 255, 255, 0.95);
  background: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}

.leaflet-container {
  overflow: hidden;
  position: relative;
  outline-offset: 1px;
  font-family: inherit;
  background: #dbe6ef;
  touch-action: pan-x pan-y;
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
  position: absolute;
  left: 0;
  top: 0;
}

.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
  user-select: none;
  -webkit-user-drag: none;
}

.leaflet-tile {
  border: 0;
  visibility: hidden;
  filter: inherit;
  width: 256px;
  height: 256px;
  max-width: none;
  max-height: none;
}

.leaflet-container img.leaflet-tile {
  max-width: none;
  max-height: none;
}

.leaflet-tile-loaded {
  visibility: inherit;
}

.leaflet-map-pane {
  z-index: 400;
}

.leaflet-tile-pane {
  z-index: 200;
}

.leaflet-overlay-pane {
  z-index: 400;
}

.leaflet-shadow-pane {
  z-index: 500;
}

.leaflet-marker-pane {
  z-index: 600;
}

.leaflet-tooltip-pane {
  z-index: 650;
}

.leaflet-popup-pane {
  z-index: 700;
}

.leaflet-control {
  position: relative;
  z-index: 800;
  pointer-events: visiblePainted;
  pointer-events: auto;
}

.leaflet-top,
.leaflet-bottom {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
}

.leaflet-top {
  top: 0;
}

.leaflet-right {
  right: 0;
}

.leaflet-bottom {
  bottom: 0;
}

.leaflet-left {
  left: 0;
}

.leaflet-control {
  float: left;
  clear: both;
}

.leaflet-right .leaflet-control {
  float: right;
}

.leaflet-top .leaflet-control {
  margin-top: 10px;
}

.leaflet-bottom .leaflet-control {
  margin-bottom: 10px;
}

.leaflet-left .leaflet-control {
  margin-left: 10px;
}

.leaflet-right .leaflet-control {
  margin-right: 10px;
}

.leaflet-control-zoom a {
  display: block;
  width: 30px;
  height: 30px;
  line-height: 30px;
  border-bottom: 1px solid #d7dde4;
  background: #fff;
  color: #17202a;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
}

.leaflet-control-zoom a:first-child {
  border-radius: 6px 6px 0 0;
}

.leaflet-control-zoom a:last-child {
  border-bottom: 0;
  border-radius: 0 0 6px 6px;
}

.leaflet-control-zoom {
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 6px 14px rgba(23, 32, 42, 0.14);
  overflow: hidden;
}

.leaflet-popup {
  position: absolute;
  margin-bottom: 20px;
  text-align: center;
  pointer-events: auto;
}

.leaflet-popup-content-wrapper {
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(23, 32, 42, 0.18);
  text-align: left;
  pointer-events: auto;
}

.leaflet-popup-tip-container {
  position: absolute;
  left: 50%;
  width: 40px;
  height: 20px;
  margin-left: -20px;
  overflow: hidden;
  pointer-events: none;
}

.leaflet-popup-tip {
  width: 16px;
  height: 16px;
  margin: -8px auto 0;
  background: #fff;
  transform: rotate(45deg);
  box-shadow: 0 8px 24px rgba(23, 32, 42, 0.12);
}

.leaflet-container a.leaflet-popup-close-button {
  position: absolute;
  top: 0;
  right: 0;
  width: 26px;
  height: 26px;
  color: #657386;
  text-align: center;
  text-decoration: none;
  font: 18px/26px Arial, sans-serif;
}

.leaflet-container .leaflet-control-attribution {
  margin: 0;
  padding: 3px 6px;
  background: rgba(255, 255, 255, 0.86);
  color: #657386;
  font-size: 11px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  font-family: "Inter", "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  overflow-wrap: break-word;
  word-break: normal;
}

img,
svg,
canvas,
video {
  max-width: 100%;
}

p,
h1,
h2,
h3,
h4,
h5,
h6,
span,
small,
strong,
label,
button,
a,
td,
th,
dt,
dd,
li {
  overflow-wrap: break-word;
  word-break: normal;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(360px, 430px) 1fr;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: var(--panel);
  border-right: 1px solid var(--line);
  z-index: 500;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.title-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.title-line h1 {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.certified-count-note {
  margin-left: 8px;
  color: #E6001F;
  font-weight: 800;
}

.data-source {
  display: block;
  margin-top: 4px;
  color: #7a8797;
  font-size: 12px;
  line-height: 1.35;
}

.topbar .data-source {
  display: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.hot-rank-button {
  background: #fff7ed;
  border-color: rgba(217, 119, 6, 0.35);
  color: #9a3412;
  flex: 0 0 auto;
}

@media (min-width: 901px) {
  .title-line {
    display: block;
  }

  .title-line .hot-rank-button {
    margin-top: 10px;
  }
}

.my-page-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #f8fafc;
  color: #64748b;
}

.my-page-button svg {
  width: 19px;
  height: 19px;
}

.filters {
  display: grid;
  grid-template-columns: 1fr 132px;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.search-box svg {
  width: 17px;
  height: 17px;
  color: var(--muted);
  flex: 0 0 auto;
}

.search-box input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--text);
}

select {
  height: 38px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
}

.segmented {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  height: 36px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #eef3f7;
}

.segmented button {
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}

.segmented button.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 1px 2px rgba(23, 32, 42, 0.08);
}

.panel {
  display: none;
  min-height: 0;
  flex: 1;
}

.panel.active {
  display: flex;
  flex-direction: column;
}

.list-header,
.compare-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line-soft);
  font-weight: 700;
}

.compare-head small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 500;
}

.school-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.favorites-action {
  padding: 12px 16px;
  border-top: 1px solid var(--line-soft);
  background: #fff;
}

.favorites-action small {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.primary-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid #0f766e;
  border-radius: 6px;
  background: #0f766e;
  color: #fff;
  font-weight: 800;
}

.primary-action-button:hover {
  background: #115e59;
}

.primary-action-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary-action-button svg {
  width: 18px;
  height: 18px;
}

.primary-action-button.compact {
  width: auto;
  min-height: 36px;
  padding: 8px 14px;
  white-space: nowrap;
}

.secondary-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--brand);
  font-weight: 800;
  white-space: nowrap;
}

.secondary-action-button:hover {
  background: #eef7f6;
}

a.primary-action-button,
a.secondary-action-button {
  text-decoration: none;
}

.school-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: #fff;
}

.school-row:hover {
  background: #f4fbfb;
}

.school-row h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  letter-spacing: 0;
}

.school-row-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  margin-bottom: 5px;
}

.school-title-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

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

.row-actions {
  display: flex;
  align-items: start;
  gap: 6px;
}

.compare-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 40px;
  min-width: 40px;
  min-height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.compare-check input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--brand);
}

.icon-button,
.favorite-small,
.text-button,
.icon-text-button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 6px;
}

.icon-button,
.favorite-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
}

.icon-button svg,
.favorite-small svg,
.icon-text-button svg {
  width: 17px;
  height: 17px;
}

.favorite-small.active,
.icon-text-button.active {
  border-color: #f2c36b;
  background: #fff7e8;
  color: var(--accent);
}

.text-button {
  height: 30px;
  padding: 0 10px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.icon-text-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px;
  font-weight: 700;
}

.empty-state {
  padding: 26px 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.map-stage {
  position: relative;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 100%;
  background: #edf2f7;
}

.school-marker {
  position: relative;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 2px 7px rgba(23, 32, 42, 0.28);
  transition:
    width 300ms ease,
    height 300ms ease,
    background-color 300ms ease,
    box-shadow 300ms ease,
    opacity 300ms ease,
    transform 300ms ease;
}

.school-marker.precise {
  background: #E6001F;
}

.school-marker.fallback {
  background: #E6001F;
}

.school-marker.favorite-marker {
  background: #f59e0b;
  box-shadow:
    0 0 0 3px rgba(245, 158, 11, 0.24),
    0 3px 9px rgba(146, 64, 14, 0.34);
}

.school-marker.selected-marker {
  width: 32px;
  height: 32px;
  background: #ff9500;
  box-shadow:
    0 0 0 4px rgba(255, 149, 0, 0.2),
    0 4px 14px rgba(146, 64, 14, 0.42);
}

.school-marker.selected-marker::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  border: 2px solid rgba(255, 149, 0, 0.48);
  animation: markerPulse 1.5s ease-out infinite;
}

.school-marker.mext-marker {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 0;
  background: transparent;
  box-shadow: none;
  font-size: 22px;
  line-height: 1;
  text-shadow:
    0 1px 3px rgba(23, 32, 42, 0.28),
    0 0 0 #fff;
}

.school-marker.mext-marker.selected-marker {
  width: 32px;
  height: 32px;
  background: rgba(255, 149, 0, 0.12);
  border: 2px solid #ff9500;
  font-size: 24px;
}

.school-cluster {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #E6001F;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  transition:
    width 300ms ease,
    height 300ms ease,
    transform 300ms ease,
    opacity 300ms ease;
}

.school-row {
  transition: background-color 300ms ease;
}

.school-row.list-linked-highlight {
  background: #e6f7f5;
}

@keyframes markerPulse {
  0% {
    transform: scale(1);
    opacity: 0.58;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

.leaflet-popup-content {
  margin: 12px;
  min-width: 260px;
}

.popup-title {
  margin: 0 0 7px;
  font-size: 15px;
}

.popup-meta {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.popup-actions button {
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--brand);
  font-weight: 700;
  font-size: 12px;
  pointer-events: auto;
}

dialog {
  width: min(920px, calc(100vw - 32px));
  max-height: calc(100vh - 36px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

dialog.fullscreen-dialog {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  border-radius: 0;
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.dialog-shell {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 36px);
  background: #fff;
}

.fullscreen-dialog .dialog-shell {
  width: 100%;
  height: 100%;
  max-height: none;
}

.dialog-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border-bottom: 1px solid var(--line-soft);
}

.dialog-header p {
  margin: 0 0 6px;
  color: var(--brand);
  font-weight: 700;
  font-size: 13px;
}

.dialog-header small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-weight: 700;
}

.dialog-header h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 0;
}

.dialog-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.detail-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0;
  padding: 0 20px 20px;
  overflow: auto;
}

.detail-grid dt,
.detail-grid dd {
  margin: 0;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.detail-grid dt {
  color: var(--muted);
  font-weight: 700;
}

.detail-grid dd {
  min-width: 0;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.detail-grid a {
  color: var(--brand);
}

.masked-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mosaic {
  display: inline-flex;
  align-items: center;
  min-width: 168px;
  min-height: 24px;
  padding: 2px 10px;
  border-radius: 5px;
  color: transparent;
  user-select: none;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.18) 25%, transparent 25%) 0 0 / 8px 8px,
    linear-gradient(225deg, rgba(15, 118, 110, 0.18) 25%, transparent 25%) 0 0 / 8px 8px,
    #dbe7e8;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.12);
  filter: blur(0.2px);
}

.unlock-chip {
  position: relative;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid rgba(217, 119, 6, 0.45);
  border-radius: 999px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 6px 14px rgba(154, 52, 18, 0.12);
}

.unlock-chip:hover {
  background: #ffedd5;
}

.welcome-dialog {
  width: min(620px, calc(100vw - 32px));
}

.welcome-shell {
  padding: 26px;
  gap: 18px;
  text-align: center;
}

.welcome-copy p {
  display: inline-block;
  margin: 0 0 10px;
  padding: 6px 12px;
  border: 1px solid rgba(13, 148, 136, 0.22);
  border-radius: 8px;
  background: rgba(240, 253, 250, 0.92);
  color: var(--brand);
  font-weight: 900;
  font-size: 24px;
  line-height: 1.25;
}

.welcome-nowrap,
.welcome-title-line {
  display: inline-block;
  white-space: nowrap;
}

.welcome-copy h2 {
  margin: 0;
  color: var(--text);
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: 0;
}

.welcome-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.member-float {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1200;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: min(520px, calc(100vw - 44px));
  padding: 10px 12px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.member-float strong {
  display: block;
  margin-bottom: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.2;
  white-space: nowrap;
}

.member-float p {
  display: none;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.member-float-actions,
.member-inline-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.member-float .primary-action-button,
.member-float .secondary-action-button {
  width: auto;
  min-width: 72px;
  min-height: 34px;
  padding: 6px 12px;
  font-size: 13px;
  line-height: 1;
}

.member-float.member-active {
  border-color: rgba(217, 119, 6, 0.25);
}

.consult-float {
  position: fixed;
  right: 22px;
  bottom: 112px;
  z-index: 9999;
  touch-action: auto;
  user-select: none;
  cursor: pointer;
}

.consult-float.dragging {
  cursor: grabbing;
}

.consult-button {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid rgba(217, 119, 6, 0.42);
  border-radius: 999px;
  background: #d97706;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 14px 30px rgba(217, 119, 6, 0.28);
}

.consult-button:hover {
  background: #b45309;
}

/* 弹窗容器宽度要和内部表单一致，否则 dialog 默认 920px 会在右侧留大片空白 */
.register-dialog,
.register-dialog .dialog-shell {
  width: min(480px, calc(100vw - 28px));
}

/* 登录弹窗字段少，收窄避免右侧空白 */
.login-dialog,
.login-dialog .dialog-shell {
  width: min(400px, calc(100vw - 28px));
}

.register-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 0 20px 14px;
}

.register-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.register-grid input,
.register-grid select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.wechat-register-card {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 116px 1fr;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #f8fafc;
}

.wechat-register-card img {
  width: 116px;
  height: 116px;
  border-radius: 6px;
  object-fit: contain;
  background: #fff;
}

.wechat-register-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  font-weight: 700;
}

.code-field {
  grid-column: 1 / -1;
}

.code-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.code-field small {
  min-height: 18px;
  color: var(--accent);
  font-weight: 800;
}

.required-mark {
  color: var(--danger);
  font-style: normal;
  font-weight: 900;
}

.optional-mark {
  margin-left: 4px;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.register-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px 20px;
  border-top: 1px solid var(--line-soft);
}

.register-footer span {
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.register-footer .primary-action-button {
  width: auto;
  min-width: 140px;
}

.rank-dialog {
  width: min(860px, calc(100vw - 32px));
}

.rank-tabs {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-soft);
  overflow-x: auto;
}

.rank-tabs button {
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 900;
  white-space: nowrap;
}

.rank-tabs button.active {
  border-color: rgba(15, 118, 110, 0.45);
  background: #ecfdf5;
  color: var(--brand);
}

.rank-area-filter {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 20px 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.rank-area-filter select {
  min-width: 110px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
}

.rank-list {
  display: grid;
  gap: 0;
  padding: 0 20px 20px;
  overflow: auto;
}

.rank-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  text-align: left;
}

.rank-row:hover {
  background: #f8fafc;
}

.rank-index {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #0f766e;
  color: #fff;
  font-weight: 900;
}

.rank-main {
  min-width: 0;
}

.rank-main strong,
.rank-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-main strong {
  color: var(--text);
  font-size: 14px;
}

.rank-main small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.rank-score {
  color: #9a3412;
  font-weight: 900;
  white-space: nowrap;
}

.consult-dialog {
  width: min(460px, calc(100vw - 32px));
}

.consult-dialog .dialog-header h2 {
  white-space: nowrap;
  word-break: keep-all;
  font-size: clamp(22px, 5.8vw, 34px);
  letter-spacing: 0;
}

.consult-qr {
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 0 24px 24px;
  text-align: center;
}

.consult-qr img {
  width: min(280px, 78vw);
  max-height: 320px;
  object-fit: contain;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
}

.consult-info-block {
  display: grid;
  gap: 12px;
  width: 100%;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.consult-info-block section {
  display: grid;
  gap: 8px;
}

.consult-info-block h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
}

.consult-info-block p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  text-align: left;
}

.consult-partner-logo-row img {
  height: 42px;
}

.my-page-dialog {
  width: min(680px, calc(100vw - 32px));
}

.my-page-dialog .dialog-shell {
  max-height: calc(100dvh - 32px);
  border-radius: 14px;
  overflow: hidden;
}

.my-page-dialog .dialog-header {
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--line-soft);
}

.my-page-dialog .dialog-header p {
  margin: 0;
}

.my-page-dialog .dialog-header h2 {
  display: none;
}

.my-page-content {
  display: grid;
  flex: 1 1 auto;
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 16px 20px 20px;
}

.my-page-content h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.my-page-card {
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fbfdff;
}

.my-page-details {
  padding: 0;
  overflow: hidden;
}

.my-page-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 800;
}

.my-page-details summary small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.my-school-list {
  display: grid;
  gap: 8px;
  min-height: 170px;
  max-height: 260px;
  padding: 0 14px 14px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.my-school-link {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.my-school-link span {
  color: var(--muted);
  font-size: 12px;
}

.partner-logo-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: center;
}

.partner-logo-row img {
  width: 100%;
  height: 54px;
  object-fit: contain;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  padding: 6px;
}

.register-page {
  min-height: 100vh;
  overflow: auto;
  background: var(--bg);
}

.register-page-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.register-page-panel {
  width: min(720px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.register-page-header {
  padding: 24px 24px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.register-page-header p {
  margin: 0 0 8px;
  color: var(--brand);
  font-weight: 900;
}

.register-page-header h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.3;
  letter-spacing: 0;
}

.page-register-grid {
  padding: 20px 24px 24px;
}

.register-page-footer {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 6px;
}

.register-page-footer span {
  flex: 1;
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
}

.admin-page {
  min-height: 100vh;
  overflow: auto;
  background: var(--bg);
}

.admin-shell {
  width: min(1280px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 42px;
}

.admin-login-card {
  width: min(460px, 100%);
  margin: 12vh auto 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.admin-login-card header p {
  margin: 0 0 6px;
  color: var(--brand);
  font-weight: 800;
}

.admin-login-card header h1 {
  margin: 0 0 18px;
  font-size: 24px;
}

.admin-login-form {
  display: grid;
  gap: 12px;
}

.admin-login-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.admin-login-form input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--text);
}

.admin-login-form span {
  min-height: 18px;
  color: var(--danger);
  font-size: 13px;
}

.admin-header,
.admin-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(23, 32, 42, 0.08);
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  margin-bottom: 18px;
}

.admin-header p {
  margin: 0 0 4px;
  color: var(--muted);
  font-weight: 800;
}

.admin-header h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

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

.admin-actions .secondary-action-button {
  text-decoration: none;
}

.admin-section {
  margin-top: 16px;
  overflow: hidden;
}

.admin-rank-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.admin-rank-grid .admin-section {
  min-width: 0;
}

.admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.admin-section-head h2 {
  margin: 0;
  font-size: 17px;
  letter-spacing: 0;
}

.admin-section-head span {
  color: var(--muted);
  font-weight: 800;
}

.admin-export-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
}

.admin-export-actions label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.admin-export-actions input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  color: var(--text);
}

.admin-upload-panel {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 18px;
  border-top: 1px solid var(--line-soft);
}

.admin-upload-panel img {
  width: 112px;
  height: 112px;
  object-fit: contain;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.admin-upload-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.admin-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f4f7fa;
}

.admin-tabs button {
  min-width: 64px;
  min-height: 32px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.admin-tabs button.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 1px 4px rgba(23, 32, 42, 0.12);
}

.admin-table-wrap {
  overflow: auto;
}

.admin-table {
  width: 100%;
  min-width: 860px;
  border-collapse: separate;
  border-spacing: 0;
}

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

.admin-table th,
.admin-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
  line-height: 1.5;
}

.admin-table th {
  background: #f8fafc;
  color: var(--muted);
  font-weight: 900;
}

.admin-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--text);
}

.compare-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 0 16px;
}

.compare-dialog-wrap {
  padding: 0;
}

.compare-dialog-header {
  align-items: center;
}

.compare-dialog-shell .compare-table {
  min-width: 100%;
}

.compare-dialog-shell .compare-table th,
.compare-dialog-shell .compare-table td {
  min-width: 220px;
  max-width: 360px;
}

.compare-dialog:fullscreen,
.compare-dialog-shell:fullscreen {
  width: 100vw;
  height: 100vh;
  background: #fff;
}

.compare-dialog-shell:fullscreen {
  display: flex;
  flex-direction: column;
  border-radius: 0;
}

.compare-dialog-shell:fullscreen .compare-dialog-wrap {
  flex: 1;
  min-height: 0;
}

body.compare-landscape-fallback {
  overflow: hidden;
}

body.compare-landscape-fallback .compare-dialog[open] {
  position: fixed;
  inset: 0;
  width: 100dvw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  padding: 0;
  overflow: hidden;
  background: #fff;
}

body.compare-landscape-fallback .compare-dialog::backdrop {
  background: #fff;
}

body.compare-landscape-fallback .compare-dialog-shell {
  position: absolute;
  top: 0;
  left: 0;
  width: 100dvh;
  height: 100dvw;
  max-width: none;
  max-height: none;
  border-radius: 0;
  transform: rotate(90deg) translateY(-100%);
  transform-origin: top left;
}

body.compare-landscape-fallback .compare-dialog-header {
  min-height: 56px;
  padding: 10px 14px;
}

body.compare-landscape-fallback .compare-dialog-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.compare-table {
  border-collapse: separate;
  border-spacing: 0;
  min-width: 900px;
  width: max-content;
}

.compare-table th,
.compare-table td {
  max-width: 280px;
  min-width: 180px;
  padding: 11px 12px;
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.compare-table th:first-child,
.compare-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  min-width: 128px;
  max-width: 128px;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 800;
}

.compare-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #0f766e;
  color: #fff;
  font-weight: 800;
}

.compare-table thead th:first-child {
  z-index: 3;
  background: #115e59;
  color: #fff;
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: 48vh 52vh;
  }

  .map-stage {
    grid-row: 1;
    height: 48vh;
  }

  .sidebar {
    grid-row: 2;
    height: 52vh;
    min-height: 0;
    border-right: 0;
    border-top: 1px solid var(--line);
  }

  .topbar {
    padding: 14px 14px 10px;
    align-items: flex-start;
  }

  .topbar h1 {
    font-size: 18px;
  }

  .title-line {
    gap: 8px;
  }

  .topbar-actions {
    flex-direction: column;
    align-items: flex-end;
  }

  .filters {
    grid-template-columns: 1fr;
    padding: 10px 12px;
  }

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

  .detail-grid dt {
    padding-bottom: 3px;
    border-bottom: 0;
  }

  .detail-grid dd {
    padding-top: 0;
  }

  .member-float {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
  }

  .consult-float {
    right: 12px;
    bottom: 104px;
  }

  .account-float {
    right: 12px;
    bottom: 156px;
  }

  .register-grid {
    grid-template-columns: 1fr;
  }

  .code-row {
    grid-template-columns: 1fr;
  }

  .wechat-register-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .rank-row {
    grid-template-columns: 36px 1fr;
  }

  .rank-score {
    grid-column: 2;
  }

  .admin-shell {
    width: min(100vw - 20px, 1280px);
    padding-top: 10px;
  }

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

  .admin-rank-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .admin-actions .primary-action-button,
  .admin-actions .secondary-action-button {
    width: 100%;
  }

  .welcome-copy h2,
  .register-page-header h1 {
    font-size: 22px;
  }

  .welcome-copy p {
    font-size: 20px;
  }

  .register-page-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .register-page-footer .primary-action-button,
  .register-page-footer .secondary-action-button {
    width: 100%;
  }
}

@media (max-width: 768px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  body {
    line-height: 1.6;
  }

  button,
  .primary-action-button,
  .secondary-action-button,
  .icon-button,
  .favorite-small,
  .my-page-button,
  .text-button,
  .icon-text-button,
  .compare-check,
  .rank-tabs button,
  .admin-tabs button,
  .popup-actions button,
  .consult-button {
    min-width: 44px;
    min-height: 44px;
    height: auto;
    max-width: 100%;
    padding: 0.48rem 0.68rem;
    white-space: normal;
    line-height: 1.25;
    overflow-wrap: anywhere;
    word-break: normal;
    text-align: center;
  }

  .icon-button,
  .favorite-small,
  .my-page-button {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    padding: 0;
  }

  .primary-action-button.compact,
  .secondary-action-button.compact {
    width: auto;
    min-width: 40px;
    min-height: 40px;
    padding: 0.48rem 0.72rem;
  }

  .app-shell,
  .register-page-shell,
  .admin-shell {
    max-width: 100%;
    overflow-x: hidden;
  }

  .app-shell {
    height: 100svh;
    height: 100dvh;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(220px, 44dvh) minmax(0, 56dvh);
    transition: grid-template-rows 340ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  .map-stage,
  .sidebar {
    height: auto;
    min-height: 0;
    transition:
      opacity 220ms ease,
      transform 340ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  #map {
    height: 100%;
    min-height: 0;
  }

  body.mobile-map-expanded .app-shell {
    grid-template-rows: minmax(0, calc(100dvh - 76px)) 76px;
  }

  body.mobile-list-expanded .app-shell {
    grid-template-rows: minmax(150px, 25dvh) minmax(0, 75dvh);
  }

  body.mobile-map-expanded .sidebar {
    overflow: hidden;
    border-top: 1px solid var(--line);
  }

  body.mobile-map-expanded .map-stage,
  body.mobile-list-expanded .map-stage,
  body.mobile-map-expanded .sidebar,
  body.mobile-list-expanded .sidebar {
    height: auto;
  }

  body.mobile-map-expanded .sidebar .topbar,
  body.mobile-map-expanded .sidebar .panel,
  body.mobile-map-expanded .sidebar .filters select,
  body.mobile-map-expanded .sidebar .segmented {
    display: none;
  }

  body.mobile-map-expanded .sidebar .filters {
    min-height: 76px;
    display: flex;
    align-items: center;
    padding-top: 10px;
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    background: var(--panel);
  }

  body.mobile-map-expanded .sidebar .search-box {
    width: 100%;
    min-width: 0;
  }

  body.mobile-map-expanded .member-float {
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
  }

  .sidebar,
  .topbar,
  .filters,
  .tabbar,
  .list-header,
  .school-row,
  .favorites-action,
  .dialog-shell,
  .welcome-shell,
  .register-shell,
  .rank-shell,
  .consult-shell,
  .register-page-panel,
  .admin-section,
  .admin-header {
    max-width: 100%;
  }

  .topbar,
  .filters,
  .tabbar,
  .list-header,
  .school-row,
  .favorites-action,
  .detail-grid,
  .register-grid,
  .register-footer,
  .dialog-header,
  .welcome-shell,
  .rank-shell,
  .consult-shell,
  .register-page-panel,
  .admin-header,
  .admin-section-head,
  .admin-table th,
  .admin-table td {
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }

  .topbar {
    position: relative;
    gap: 0.4rem;
    flex-wrap: wrap;
    padding-right: max(54px, calc(10px + env(safe-area-inset-right)));
    padding-top: 10px;
    padding-bottom: 6px;
  }

  .topbar > div:first-child {
    flex: 1 1 100%;
  }

  .topbar > div,
  .dialog-header > div,
  .register-page-header,
  .admin-header > div {
    min-width: 0;
  }

  .topbar h1,
  .topbar p,
  .data-source,
  .school-row h3,
  .school-row p,
  .detail-grid dd,
  .welcome-copy p,
  .welcome-copy h2,
  .register-page-header h1,
  .rank-main strong,
  .rank-main small,
  .admin-header h1,
  .admin-table th,
  .admin-table td {
    line-height: 1.45;
    overflow-wrap: break-word;
    word-break: normal;
  }

  .topbar h1 {
    font-size: 20px;
    line-height: 1.25;
  }

  .topbar p {
    margin-top: 2px;
    font-size: 12px;
  }

  .topbar .data-source {
    display: none;
  }

  .data-source {
    font-size: 14px;
    line-height: 1.45;
  }

  .topbar-actions,
  .row-actions,
  .dialog-actions,
  .admin-actions,
  .admin-export-actions,
  .register-page-footer {
    max-width: 100%;
    flex-wrap: wrap;
  }

  .topbar-actions {
    position: absolute;
    top: 8px;
    right: max(10px, env(safe-area-inset-right));
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: auto;
    gap: 0;
  }

  .title-line {
    align-items: center;
    gap: 6px;
  }

  .title-line .hot-rank-button {
    width: auto;
    min-width: 0;
    min-height: 44px;
    padding: 0.38rem 0.62rem;
    border-radius: 999px;
    font-size: 13px;
    white-space: nowrap;
  }

  .title-line .hot-rank-button svg {
    width: 15px;
    height: 15px;
  }

  #fitMapBtn {
    display: none;
  }

  .topbar-actions .icon-button {
    width: 40px;
    min-width: 40px;
  }

  .topbar-actions .my-page-button {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }

  .filters select,
  .filters input,
  .register-grid input,
  .register-grid select,
  .admin-export-actions input,
  .rank-area-filter select {
    min-width: 0;
    max-width: 100%;
    min-height: 40px;
  }

  .filters {
    grid-template-columns: minmax(0, 1fr) minmax(104px, max-content);
    gap: 6px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .search-box {
    height: 36px;
    padding-left: 9px;
    padding-right: 9px;
  }

  select {
    height: 36px;
    padding-left: 9px;
    padding-right: 9px;
  }

  .filters select {
    width: auto;
    min-width: 104px;
    max-width: 124px;
    font-size: 13px;
  }

  .filters .segmented {
    grid-column: 1 / -1;
  }

  .school-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .row-actions {
    align-items: flex-start;
    justify-content: flex-end;
    min-width: 44px;
  }

  .school-row .favorite-small {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }

  .dialog-shell {
    width: min(100vw - 24px, 620px);
    max-height: calc(100vh - 24px);
    overflow-x: hidden;
  }

  .welcome-dialog,
  .rank-dialog,
  .consult-dialog {
    width: min(100vw - 24px, 620px);
  }

  .welcome-copy p {
    display: block;
    max-width: 100%;
  }

  .welcome-shell {
    padding: 18px 12px;
  }

  .welcome-copy {
    max-width: 100%;
  }

  .welcome-copy p {
    width: 100%;
    padding: 8px 8px;
    font-size: clamp(15px, 4.3vw, 18px);
    line-height: 1.35;
  }

  .welcome-nowrap {
    max-width: 100%;
    white-space: normal;
  }

  .welcome-copy h2 {
    font-size: clamp(22px, 6.7vw, 28px);
    line-height: 1.22;
  }

  .welcome-title-line {
    display: block;
    white-space: normal;
  }

  .welcome-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: 100%;
  }

  .welcome-actions .primary-action-button,
  .welcome-actions .secondary-action-button {
    width: 100%;
    min-width: 0;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
  }

  .welcome-actions .icon-button {
    grid-column: 1 / -1;
    justify-self: center;
  }

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

  .wechat-register-card,
  .consult-qr,
  .school-row,
  .rank-row {
    min-width: 0;
    overflow: hidden;
  }

  .wechat-register-card img,
  .consult-qr img {
    width: min(116px, 100%);
    height: auto;
    aspect-ratio: 1;
  }

  .rank-tabs,
  .admin-tabs,
  .segmented {
    width: 100%;
    max-width: 100%;
    overflow: visible;
    gap: 4px;
  }

  .rank-tabs button,
  .admin-tabs button,
  .segmented button {
    flex: 1 1 0;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .segmented {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    height: auto;
    min-height: 44px;
  }

  .segmented button {
    min-width: 0;
    font-size: clamp(10px, 3vw, 12px);
    line-height: 1.18;
    padding: 5px 3px;
  }

  .rank-tabs {
    flex-wrap: nowrap;
    gap: 6px;
    padding: 10px 12px;
    overflow: visible;
  }

  .rank-tabs button {
    flex: 1 1 0;
    flex-basis: auto;
    min-width: 0;
    min-height: 34px;
    padding: 6px 8px;
    border-radius: 999px;
    font-size: 13px;
    line-height: 1.15;
    white-space: nowrap;
    word-break: keep-all;
  }

  .consult-button {
    max-width: calc(100vw - 24px);
    padding-left: 12px;
    padding-right: 12px;
  }

  .consult-float {
    touch-action: none;
    cursor: grab;
  }

  .admin-table {
    min-width: 0;
  }

  .admin-table-wrap,
  .compare-wrap,
  .rank-list {
    max-width: 100%;
    overflow-x: auto;
  }

  .member-float,
  .consult-float {
    max-width: calc(100vw - 24px);
  }

  .consult-float {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .account-float {
    right: 12px;
    bottom: calc(64px + env(safe-area-inset-bottom));
  }

  .member-float {
    left: 12px;
    right: 12px;
    bottom: calc(68px + env(safe-area-inset-bottom));
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 9px 10px;
  }

  .member-float > div:first-child {
    min-width: 0;
  }

  .member-float strong {
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
  }

  .member-float-actions {
    display: flex;
    gap: 6px;
    min-width: 0;
  }

  .member-float .primary-action-button,
  .member-float .secondary-action-button {
    width: auto;
    min-width: 66px;
    min-height: 34px;
    padding-left: 10px;
    padding-right: 10px;
    font-size: 13px;
  }

  .member-inline-actions {
    flex-wrap: wrap;
  }

  .partner-logo-row {
    gap: 6px;
  }

  .partner-logo-row img {
    height: 40px;
    border-radius: 6px;
    padding: 4px;
  }

  body.compare-landscape-fallback {
    overflow: hidden;
  }

  body.compare-landscape-fallback .compare-dialog[open] {
    position: fixed;
    inset: 0;
    width: 100dvw;
    height: 100dvh;
    max-width: none;
    max-height: none;
    margin: 0;
    border: 0;
    padding: 0;
    overflow: hidden;
    background: #fff;
  }

  body.compare-landscape-fallback .compare-dialog-shell {
    width: 100dvh;
    height: 100dvw;
    max-width: none;
    max-height: none;
    border-radius: 0;
    transform: rotate(90deg) translateY(-100%);
    transform-origin: top left;
  }

  body.compare-landscape-fallback .compare-dialog-wrap {
    flex: 1;
    min-height: 0;
    overflow: auto;
  }

  body.mobile-list-expanded .member-float,
  body.mobile-input-active .member-float {
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
  }
}

/* Glass UI refresh */
.leaflet-tile-pane {
  z-index: 180;
}

.leaflet-overlay-pane {
  z-index: 360;
}

.leaflet-marker-pane {
  z-index: 560;
}

.leaflet-popup-pane {
  z-index: 720;
}

.sidebar {
  background: rgba(248, 250, 252, 0.58);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  backdrop-filter: blur(18px) saturate(170%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.topbar h1 {
  color: #111827;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.hot-rank-button,
.my-page-button,
.topbar-actions .icon-button {
  border: 0;
  background: rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(14px) saturate(170%);
  backdrop-filter: blur(14px) saturate(170%);
  color: #17202a;
  box-shadow: 0 2px 10px rgba(23, 32, 42, 0.08);
}

.hot-rank-button:hover,
.my-page-button:hover,
.topbar-actions .icon-button:hover {
  background: rgba(255, 255, 255, 0.9);
}

.hot-rank-button {
  border-radius: 999px;
}

.filters {
  background: rgba(255, 255, 255, 0.52);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.42);
}

.search-box,
select {
  border-radius: 12px;
  border-color: rgba(217, 225, 234, 0.86);
  background: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    background-color 180ms ease;
}

.search-box:focus-within,
select:focus {
  border-color: rgba(0, 137, 123, 0.4);
  box-shadow: 0 0 0 4px rgba(0, 137, 123, 0.1);
}

.search-box input {
  background: transparent;
}

.search-box input::placeholder {
  color: #999;
  opacity: 1;
}

.segmented {
  position: relative;
  isolation: isolate;
  min-height: 44px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  backdrop-filter: blur(18px) saturate(170%);
  box-shadow: inset 0 0 0 1px rgba(217, 225, 234, 0.45);
  overflow: hidden;
}

.segmented::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  z-index: -1;
  width: calc((100% - 8px) / var(--seg-count, 3));
  border-radius: 12px;
  background: var(--teal);
  box-shadow: 0 2px 8px rgba(0, 137, 123, 0.25);
  transform: translateX(calc(var(--seg-index, 0) * 100%));
  transition: transform 200ms ease-out;
}

.segmented button {
  position: relative;
  z-index: 1;
  border-radius: 12px;
  background: transparent;
  color: #666;
  transition:
    color 180ms ease,
    transform 180ms ease;
}

.segmented button.active {
  background: transparent;
  color: #fff;
  box-shadow: none;
}

.school-list {
  padding: 12px;
}

.school-row {
  position: relative;
  display: block;
  margin: 0 0 12px;
  padding: 14px 64px 14px 14px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.65);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  transition:
    background-color 200ms ease,
    box-shadow 200ms ease,
    transform 200ms ease;
}

.school-row:hover,
.school-row:focus-within {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.1);
  transform: scale(1.01);
}

.school-row.list-linked-highlight {
  background: #e6f7f5;
}

.school-row-title {
  display: block;
  margin-bottom: 6px;
}

.school-row h3 {
  margin: 0;
  color: #1a1a1a;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}

.school-row-cn {
  margin: 0 0 3px;
  color: #666;
  font-size: 14px;
  line-height: 1.45;
}

.school-row-address {
  margin: 0;
  color: #8a8a8a;
  font-size: 13px;
  line-height: 1.45;
}

.school-title-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.favorite-small,
.compare-check {
  width: 40px;
  min-width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border: 1px solid rgba(217, 225, 234, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.8);
  -webkit-backdrop-filter: blur(8px) saturate(170%);
  backdrop-filter: blur(8px) saturate(170%);
  box-shadow: 0 2px 8px rgba(23, 32, 42, 0.08);
}

.compare-check {
  gap: 0;
}

.favorite-small.active {
  background: rgba(255, 247, 232, 0.86);
}

.leaflet-popup-content-wrapper {
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.18);
}

.leaflet-popup-tip {
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
}

.popup-title {
  color: #17202a;
  font-size: 16px;
  font-weight: 800;
}

.popup-actions button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(0, 137, 123, 0.2);
  border-radius: 10px;
  background: rgba(0, 137, 123, 0.1);
  color: var(--teal);
  transition:
    background-color 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.popup-actions button:hover {
  background: var(--teal);
  color: #fff;
}

.favorites-action {
  position: sticky;
  bottom: 20px;
  z-index: 12;
  margin: 0 12px 16px;
  padding: 10px 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.68);
  -webkit-backdrop-filter: blur(12px) saturate(170%);
  backdrop-filter: blur(12px) saturate(170%);
  box-shadow: 0 8px 24px rgba(0, 137, 123, 0.18);
}

.favorites-action .primary-action-button {
  border: 0;
  border-radius: 999px;
  background: rgba(0, 137, 123, 0.85);
  -webkit-backdrop-filter: blur(12px) saturate(170%);
  backdrop-filter: blur(12px) saturate(170%);
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  box-shadow: 0 8px 24px rgba(0, 137, 123, 0.35);
}

.dialog-shell,
.rank-shell,
.consult-shell,
.welcome-shell,
.register-shell,
.my-page-dialog .dialog-shell {
  background: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.74);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
}

.my-page-card,
.admin-section,
.register-page-panel,
.empty-state {
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.68);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.empty-state {
  margin: 12px;
}

.compare-dialog-shell .compare-table,
.compare-table {
  border-collapse: separate;
  border-spacing: 0 8px;
}

.compare-table thead th {
  background: rgba(0, 137, 123, 0.95);
  background: rgba(0, 137, 123, 0.85);
  -webkit-backdrop-filter: blur(12px) saturate(170%);
  backdrop-filter: blur(12px) saturate(170%);
  color: #fff;
}

.compare-table thead th:first-child {
  background: rgba(0, 105, 95, 0.88);
}

.compare-table tbody td {
  border-top: 1px solid rgba(255, 255, 255, 0.38);
  border-bottom: 1px solid rgba(255, 255, 255, 0.38);
  background: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.65);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
}

.compare-table tbody td:first-child {
  background: rgba(255, 255, 255, 0.88);
}

.compare-field-tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(0, 137, 123, 0.1);
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.compare-head .text-button,
.dialog-actions .icon-text-button {
  border: 1px solid rgba(0, 137, 123, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(12px) saturate(170%);
  backdrop-filter: blur(12px) saturate(170%);
  color: var(--teal);
}

.compare-head .text-button:hover,
.dialog-actions .icon-text-button:hover {
  background: var(--teal);
  color: #fff;
}

.school-marker.precise,
.school-marker.fallback {
  background: var(--teal);
}

@media (max-width: 768px) {
  .topbar {
    background: rgba(255, 255, 255, 0.88);
  }

  .school-list {
    padding: 10px;
  }

  .school-row {
    padding: 12px 58px 12px 12px;
  }

  .school-title-actions {
    top: 10px;
    right: 10px;
    gap: 6px;
  }

  .favorite-small,
  .compare-check {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
  }

  .favorites-action {
    bottom: max(20px, env(safe-area-inset-bottom));
  }
}

/* ===== 个人账号悬浮按钮（与"点我免费咨询"同款风格） ===== */
.account-float {
  position: fixed;
  right: 22px;
  bottom: 164px;
  z-index: 1200;
  touch-action: auto;
  user-select: none;
}

.account-float-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid rgba(217, 119, 6, 0.42);
  border-radius: 999px;
  background: #d97706;
  color: #fff;
  font-weight: 900;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(217, 119, 6, 0.28);
  transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.account-float-button:hover {
  background: #b45309;
  box-shadow: 0 18px 36px rgba(217, 119, 6, 0.34);
}
.account-float-button:active {
  transform: scale(0.97);
}
.account-float-button svg {
  flex-shrink: 0;
}

/* ===== 人机验证（滑动验证） ===== */
.captcha-row {
  margin: 6px 0 2px;
}
/* 登录方式切换标签 */
.login-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 20px 0;
}
.login-tab {
  flex: 1;
  padding: 9px 0;
  border: 1px solid rgba(127, 127, 127, 0.25);
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.login-tab:hover { border-color: var(--accent); color: var(--foreground); }
.login-tab.active {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
/* 根据登录方式显隐字段 / 滑块（hidden 属性兜底） */
.login-mode-password[hidden],
.captcha-row.login-mode-password[hidden] { display: none !important; }

/* 密码强度指示 */
.pw-strength { margin-top: 7px; }
.pw-strength-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(127, 127, 127, 0.18);
  overflow: hidden;
}
.pw-strength-bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  transition: width 0.2s ease, background 0.2s ease;
}
.pw-strength-text {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.pw-strength.weak .pw-strength-bar span { width: 33%; background: #ef4444; }
.pw-strength.weak .pw-strength-text { color: #ef4444; }
.pw-strength.medium .pw-strength-bar span { width: 66%; background: #f59e0b; }
.pw-strength.medium .pw-strength-text { color: #f59e0b; }
.pw-strength.strong .pw-strength-bar span { width: 100%; background: #22c55e; }
.pw-strength.strong .pw-strength-text { color: #22c55e; }

/* 我的页面：登录有效期设置 */
.session-setting {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.session-setting .session-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.session-setting select {
  flex: 1;
  min-width: 150px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(127, 127, 127, 0.25);
  background: var(--background);
  color: var(--foreground);
}
.session-setting .session-msg { font-size: 12px; color: #22c55e; min-height: 14px; }
.captcha-widget {
  width: 100%;
}
.captcha-track {
  position: relative;
  height: 44px;
  border-radius: 10px;
  /* 仿验证码背景图：渐变底图，缺口与滑块块叠加其上 */
  background: linear-gradient(110deg, #0f766e 0%, #14b8a6 32%, #d97706 66%, #ef4444 100%);
  border: 1px solid rgba(127, 127, 127, 0.22);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
.captcha-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: color-mix(in srgb, var(--teal) 22%, transparent);
  border-right: 1px solid var(--teal);
  z-index: 1;
}
.captcha-hole {
  position: absolute;
  top: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%); /* 缺口中心位置由 JS 按 targetX 设置 left% */
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.30);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.55), inset 0 3px 8px rgba(0, 0, 0, 0.45);
  z-index: 0;
  pointer-events: none;
}
.captcha-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  z-index: 1;
}
.captcha-knob {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border: 1px solid rgba(127, 127, 127, 0.25);
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  color: var(--brand);
  font-size: 20px;
  font-weight: 700;
  cursor: grab;
  touch-action: none;
  z-index: 3;
}
.captcha-knob::before {
  content: "\2192";
  line-height: 1;
}
.captcha-knob:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}
.captcha-widget.verified .captcha-knob {
  cursor: default;
  background: var(--teal);
  color: #ffffff;
  border-color: var(--teal);
}
.captcha-widget.verified .captcha-knob::before {
  content: "\2713";
}
.captcha-widget.verified .captcha-fill {
  background: color-mix(in srgb, var(--teal) 28%, transparent);
}
.captcha-widget.verified .captcha-text {
  color: var(--teal);
}

@media (prefers-color-scheme: dark) {
  .captcha-knob {
    background: #1f2937;
    color: var(--teal);
    border-color: rgba(127, 127, 127, 0.35);
  }
  .captcha-widget.verified .captcha-knob {
    color: #ffffff;
  }
}
