:root {
  --bg: #f4efe7;
  --paper: #fffaf2;
  --ink: #1f1a17;
  --muted: #6e6259;
  --line: #d9cbbb;
  --accent: #a53f2b;
  --accent-soft: #efd4c4;
  --deep: #3d2d24;
  --olive: #6f7a3c;
  --shadow: 0 18px 60px rgba(61, 45, 36, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Noto Serif SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(165, 63, 43, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(111, 122, 60, 0.14), transparent 22%),
    linear-gradient(180deg, #f9f4ed 0%, var(--bg) 100%);
}

.page {
  width: min(1320px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 56px;
  position: relative;
}

.build-badge {
  position: fixed;
  bottom: 12px;
  right: 12px;
  z-index: 20;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(31, 26, 23, 0.5);
  color: rgba(255, 255, 255, 0.6);
  font-size: 10px;
  letter-spacing: 0.04em;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0.4;
  transition: opacity 200ms;
}

.build-badge:hover {
  opacity: 1;
  background: rgba(31, 26, 23, 0.82);
  color: rgba(255, 255, 255, 0.92);
}

.hero {
  display: grid;
  grid-template-columns: 1.9fr 0.9fr;
  gap: 20px;
  padding: 24px 26px;
  border: 1px solid rgba(61, 45, 36, 0.08);
  border-radius: 24px;
  background: rgba(255, 250, 242, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.decision-toolbar {
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(61, 45, 36, 0.08);
  border-radius: 22px;
  background: rgba(255, 250, 242, 0.82);
  box-shadow: var(--shadow);
}

.decision-toolbar-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.decision-kicker {
  margin: 0;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--accent);
}

.decision-toolbar-head h2 {
  margin: 6px 0 0;
  font-size: 28px;
}

.decision-helper {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.decision-groups {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.decision-group {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
  align-items: start;
}

.decision-group-label {
  padding-top: 10px;
  color: var(--deep);
  font-size: 13px;
  font-weight: 700;
}

.decision-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.decision-group-soon {
  opacity: 0.82;
}

.decision-soon-text {
  grid-column: 2 / -1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.decision-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(61, 45, 36, 0.08);
}

.decision-summary strong {
  color: var(--deep);
  font-size: 16px;
}

.decision-summary span {
  color: var(--muted);
  font-size: 13px;
}

.decision-focus {
  margin-top: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(61, 45, 36, 0.08);
  border-radius: 22px;
  background: rgba(255, 250, 242, 0.82);
  box-shadow: var(--shadow);
}

.decision-focus-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.decision-focus-head h2 {
  margin: 6px 0 0;
  font-size: 28px;
}

.decision-focus-helper {
  max-width: 420px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.decision-focus-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
  max-width: 100%;
}

.decision-focus-empty {
  min-height: 100%;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(61, 45, 36, 0.08);
  background: rgba(255, 255, 255, 0.88);
  color: var(--muted);
  font-size: 14px;
}

.decision-focus-listing-card {
  overflow: hidden;
  border: 1px solid rgba(61, 45, 36, 0.08);
  border-radius: 18px;
  background: #f1efee;
  box-shadow: 0 12px 36px rgba(61, 45, 36, 0.12);
  transition: transform 180ms ease, box-shadow 180ms ease;
  cursor: pointer;
}

.decision-focus-listing-card:hover,
.decision-focus-listing-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(61, 45, 36, 0.16);
}

.decision-focus-listing-card:focus-visible {
  border-color: rgba(165, 63, 43, 0.35);
  outline: none;
}

.decision-focus-listing-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  min-height: calc(1.25em * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.decision-focus-rank-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(31, 26, 23, 0.82);
  color: rgba(255, 255, 255, 0.94);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.decision-focus-reason-tag {
  background: rgba(74, 109, 140, 0.12);
  color: #245b8e;
}

.commute-panel {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 14px;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid rgba(61, 45, 36, 0.08);
  border-radius: 20px;
  background: rgba(255, 250, 242, 0.82);
  box-shadow: var(--shadow);
}

.commute-panel-main,
.commute-panel-side {
  display: flex;
  gap: 12px;
  align-items: end;
}

.commute-panel-main {
  align-items: stretch;
}

.commute-panel-side {
  justify-content: space-between;
}

.commute-input-wrap,
.commute-threshold-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.commute-input-label {
  font-size: 12px;
  color: var(--muted);
}

.commute-input,
.commute-threshold-select {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(61, 45, 36, 0.12);
  background: rgba(255, 255, 255, 0.88);
  font-size: 14px;
  color: var(--deep);
}

.commute-hint {
  min-height: 18px;
  font-size: 12px;
  color: var(--muted);
}

.commute-actions {
  display: flex;
  gap: 10px;
  align-items: end;
}

.commute-apply {
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #2c2019, #7c3425);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.commute-refresh {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(49, 89, 122, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  color: #245b8e;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.commute-refresh:hover,
.commute-refresh:focus-visible,
.commute-apply:hover,
.commute-apply:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(61, 45, 36, 0.1);
  outline: none;
}

.commute-status-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: min(100%, 360px);
}

.commute-reference-chip,
.commute-status {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 14px;
  background: rgba(61, 45, 36, 0.06);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.commute-reference-chip {
  min-height: 34px;
  font-weight: 700;
}

.commute-meta {
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.commute-reference-chip[data-tone="success"],
.commute-status[data-tone="success"],
.commute-meta[data-tone="success"],
.commute-hint[data-tone="success"] {
  color: #2f6a33;
}

.commute-reference-chip[data-tone="success"],
.commute-status[data-tone="success"] {
  background: rgba(87, 146, 87, 0.12);
}

.commute-reference-chip[data-tone="warning"],
.commute-status[data-tone="warning"],
.commute-meta[data-tone="warning"],
.commute-hint[data-tone="warning"] {
  color: #9a4f1d;
}

.commute-reference-chip[data-tone="warning"],
.commute-status[data-tone="warning"] {
  background: rgba(181, 107, 47, 0.12);
}

.commute-reference-chip[data-tone="loading"],
.commute-status[data-tone="loading"],
.commute-meta[data-tone="loading"],
.commute-hint[data-tone="loading"] {
  color: #245b8e;
}

.commute-reference-chip[data-tone="loading"],
.commute-status[data-tone="loading"] {
  background: rgba(74, 109, 140, 0.12);
}

.filter-chip {
  border: 1px solid rgba(61, 45, 36, 0.12);
  background: rgba(255, 250, 242, 0.82);
  color: var(--deep);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 160ms ease;
}

.filter-chip:hover,
.filter-chip:focus-visible {
  border-color: rgba(165, 63, 43, 0.24);
  box-shadow: 0 8px 20px rgba(61, 45, 36, 0.08);
  outline: none;
}

.filter-chip.is-active {
  background: linear-gradient(135deg, #2c2019, #7c3425);
  color: #fff;
  border-color: transparent;
}

.filter-chip.is-disabled,
.filter-chip:disabled {
  color: #9b938d;
  background: rgba(61, 45, 36, 0.05);
  border-color: rgba(61, 45, 36, 0.08);
  cursor: not-allowed;
  box-shadow: none;
}

.eyebrow {
  margin: 0 0 12px;
  letter-spacing: 0.22em;
  font-size: 12px;
  color: var(--accent);
}

h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 60px);
  line-height: 0.95;
}

.subtitle,
.warning {
  max-width: 760px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.warning {
  color: var(--accent);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  color: var(--deep);
  font-size: 13px;
}

.refresh-link {
  color: var(--accent);
  text-decoration: none;
}

.summary-panel {
  display: grid;
  gap: 10px;
}

.summary-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 108px;
  padding: 16px 18px;
  border-radius: 20px;
  color: #fff;
  background: linear-gradient(135deg, #2c2019, #7c3425);
}

.summary-card.summary-card-soft {
  background: linear-gradient(135deg, #6f7a3c, #9a6b2d);
}

.summary-card strong {
  font-size: 34px;
  line-height: 1;
}

.summary-label {
  margin-bottom: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}

.map-section {
  margin-top: 18px;
  padding: 24px 26px;
  border: 1px solid rgba(61, 45, 36, 0.08);
  border-radius: 24px;
  background: rgba(255, 250, 242, 0.82);
  box-shadow: var(--shadow);
}

.map-copy h2 {
  margin: 6px 0 0;
  font-size: 30px;
}

.map-copy p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.map-kicker {
  margin: 0;
  letter-spacing: 0.18em;
  font-size: 12px;
  color: var(--accent);
}

.map-layout {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  gap: 18px;
  margin-top: 18px;
}

.beijing-map {
  position: relative;
  min-height: 460px;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(61, 45, 36, 0.08);
  background: #efe7de;
}

.beijing-map-canvas {
  width: 100%;
  height: 460px;
}

.map-fallback {
  position: absolute;
  inset: 16px;
  display: grid;
  place-items: center;
  padding: 24px;
  border-radius: 18px;
  background: rgba(255, 250, 242, 0.92);
  color: var(--muted);
  text-align: center;
}

.map-fallback[hidden] {
  display: none !important;
}

.map-info-window strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  line-height: 1.5;
}

.map-info-window p {
  margin: 4px 0 0;
  color: #5b534d;
  font-size: 12px;
  line-height: 1.5;
}

.map-info-window a {
  display: inline-block;
  margin-top: 10px;
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
}

.map-info-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.map-info-stage-first.map-info-badge-upcoming {
  color: #556127;
  background: rgba(111, 122, 60, 0.14);
}

.map-info-stage-second.map-info-badge-upcoming {
  color: #31597a;
  background: rgba(74, 109, 140, 0.16);
}

.map-info-stage-sale.map-info-badge-upcoming {
  color: #9a4f1d;
  background: rgba(181, 107, 47, 0.16);
}

.map-info-stage-first.map-info-badge-live {
  color: #fff;
  background: linear-gradient(135deg, #527228, #789b35);
}

.map-info-stage-second.map-info-badge-live {
  color: #fff;
  background: linear-gradient(135deg, #245b8e, #3f79af);
}

.map-info-stage-sale.map-info-badge-live {
  color: #fff;
  background: linear-gradient(135deg, #d9541f, #ff7b3d);
}

.map-info-stage-default.map-info-badge-live,
.map-info-stage-default.map-info-badge-upcoming {
  color: var(--deep);
  background: rgba(61, 45, 36, 0.08);
}

.map-list-item.is-active {
  border-color: rgba(165, 63, 43, 0.3);
  box-shadow: 0 10px 22px rgba(61, 45, 36, 0.08);
}

.map-list-item:hover {
  background: rgba(255, 255, 255, 0.76);
}

.all-active-callout {
  margin-top: 26px;
}

.all-active-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.all-active-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.district-label {
  position: absolute;
  color: rgba(61, 45, 36, 0.5);
  font-size: 13px;
  letter-spacing: 0.08em;
  display: none;
}

.map-list {
  display: grid;
  align-content: start;
  gap: 10px;
  max-height: 460px;
  overflow: auto;
  padding-right: 4px;
}

.map-list-item {
  display: block;
  padding: 14px 16px;
  border: 1px solid rgba(61, 45, 36, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.map-list-item strong,
.map-list-district,
.map-list-title,
.map-list-time {
  display: block;
}

.map-list-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
}

.map-list-district {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.map-list-status {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(61, 45, 36, 0.08);
  flex-shrink: 0;
}

.status-text-upcoming {
  color: #556127;
  background: rgba(111, 122, 60, 0.14);
}

.status-text-live {
  color: #b64918;
  background: rgba(242, 109, 51, 0.14);
}

.stage-text-upcoming-first {
  color: #556127;
  background: rgba(111, 122, 60, 0.14);
}

.stage-text-upcoming-second {
  color: #31597a;
  background: rgba(74, 109, 140, 0.16);
}

.stage-text-upcoming-sale {
  color: #7d3f18;
  background: rgba(207, 132, 54, 0.18);
}

.stage-text-live-first {
  color: #fff;
  background: linear-gradient(135deg, #5d7727, #7f9a34);
}

.stage-text-live-second {
  color: #fff;
  background: linear-gradient(135deg, #2f5f89, #4f7fad);
}

.stage-text-live-sale {
  color: #fff;
  background: linear-gradient(135deg, #c45523, #ef7a3f);
}

.stage-text-live-default,
.stage-text-upcoming-default {
  color: var(--deep);
  background: rgba(61, 45, 36, 0.08);
}

.map-list-item strong {
  font-size: 17px;
  line-height: 1.3;
}

.map-list-title {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.map-list-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.map-tag {
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.2;
}

.map-tag-stage {
  background: rgba(111, 122, 60, 0.12);
  color: var(--olive);
}


.stage-first {
  background: linear-gradient(135deg, rgba(111, 122, 60, 0.16), rgba(135, 149, 65, 0.22));
  border-color: rgba(111, 122, 60, 0.28);
  color: #556127;
}

.stage-second {
  background: linear-gradient(135deg, rgba(74, 109, 140, 0.16), rgba(102, 137, 168, 0.22));
  border-color: rgba(74, 109, 140, 0.28);
  color: #31597a;
}

.stage-sale {
  background: linear-gradient(135deg, rgba(181, 107, 47, 0.16), rgba(217, 139, 69, 0.22));
  border-color: rgba(181, 107, 47, 0.28);
  color: #9a4f1d;
}

.stage-default {
  background: rgba(61, 45, 36, 0.08);
  border-color: rgba(61, 45, 36, 0.12);
  color: var(--deep);
}

.map-tag-meta {
  background: rgba(61, 45, 36, 0.08);
  color: var(--deep);
}

.map-list-price-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  margin-top: 10px;
}

.map-price-label {
  color: var(--muted);
  font-size: 12px;
}

.map-price-value {
  color: #e3421d;
  font-size: 22px;
  line-height: 1;
}

.map-market-inline {
  color: #6f7a3c;
  font-size: 12px;
}

.map-list-time {
  margin-top: 10px;
  color: #4e6d8c;
  font-size: 12px;
}

.map-source-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 13px;
}

.map-source-label {
  color: var(--muted);
}

.map-source-value,
.map-source-link {
  color: #2f2b28;
}

.map-source-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.map-source-link:hover,
.map-source-link:focus-visible {
  text-decoration: underline;
}

.district-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0 16px;
}

.empty-state,
.history-callout {
  margin-top: 18px;
  padding: 22px 24px;
  border: 1px solid rgba(61, 45, 36, 0.08);
  border-radius: 22px;
  background: rgba(255, 250, 242, 0.84);
  box-shadow: var(--shadow);
}

.empty-state h2,
.history-callout h2 {
  margin: 0;
  font-size: 28px;
}

.empty-state p,
.history-callout p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.history-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.district-nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(61, 45, 36, 0.12);
  border-radius: 999px;
  color: var(--deep);
  text-decoration: none;
  background: rgba(255, 250, 242, 0.72);
}

.district-nav span {
  min-width: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  text-align: center;
}

.district-section {
  margin-top: 16px;
}

.district-section.is-collapsible.is-collapsed > .card-grid {
  display: none;
}

.district-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: end;
  margin-bottom: 12px;
}

.district-header-toggle {
  cursor: pointer;
  padding: 14px 18px;
  border: 1px solid rgba(61, 45, 36, 0.08);
  border-radius: 18px;
  background: rgba(255, 250, 242, 0.82);
  transition: background 160ms ease, box-shadow 160ms ease;
  align-items: center;
}

.district-header-toggle:hover,
.district-header-toggle:focus-visible {
  background: rgba(255, 250, 242, 1);
  box-shadow: 0 8px 20px rgba(61, 45, 36, 0.08);
  outline: none;
}

.is-collapsed .district-header-toggle {
  margin-bottom: 0;
}

.district-header-main {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: baseline;
  flex: 1;
  min-width: 0;
}

.district-inline-stats {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.district-toggle-icon {
  font-size: 14px;
  color: var(--muted);
  transition: transform 200ms ease;
  flex-shrink: 0;
}

.is-collapsed .district-toggle-icon {
  transform: rotate(-90deg);
}

.district-kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.is-collapsible .district-kicker {
  margin: 0;
  font-size: 12px;
}

.is-collapsible .district-header h2 {
  font-size: 22px;
}

.district-header h2 {
  margin: 0;
  font-size: 28px;
}

.district-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(82px, 1fr));
  gap: 8px;
}

.district-stats div {
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 250, 242, 0.72);
  border: 1px solid rgba(61, 45, 36, 0.08);
}

.district-stats span,
.price-label,
.timestamp,
.data-list dt,
.update-box p {
  color: var(--muted);
  font-size: 12px;
}

.district-stats strong {
  display: block;
  margin-top: 4px;
  font-size: 20px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 100%;
}

.listing-card,
.decision-focus-listing-card {
  overflow: hidden;
  border: 1px solid rgba(61, 45, 36, 0.08);
  border-radius: 18px;
  background: #f1efee;
  box-shadow: 0 12px 36px rgba(61, 45, 36, 0.12);
  transition: transform 180ms ease, box-shadow 180ms ease;
  cursor: pointer;
}

.listing-card:hover,
.listing-card:focus-visible,
.decision-focus-listing-card:hover,
.decision-focus-listing-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(61, 45, 36, 0.16);
}

.listing-card:focus-visible,
.decision-focus-listing-card:focus-visible {
  border-color: rgba(165, 63, 43, 0.35);
  outline: none;
}

.status-card-upcoming {
  box-shadow: inset 0 0 0 1px rgba(111, 122, 60, 0.18);
}

.status-card-live {
  box-shadow: inset 0 0 0 1px rgba(242, 109, 51, 0.22);
}

.image-wrap {
  position: relative;
  aspect-ratio: 1 / 0.76;
  overflow: hidden;
  background: #ddd0c0;
}

.image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
}

.image-fade {
  position: absolute;
  inset: auto 0 0 0;
  height: 42%;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(20, 19, 18, 0.78) 100%);
}

.status-pill {
  position: absolute;
  top: 0;
  left: 0;
  padding: 12px 22px;
  border-radius: 0 0 18px 0;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(8px) saturate(1.15);
  -webkit-backdrop-filter: blur(8px) saturate(1.15);
}

.status-upcoming {
  background: transparent;
}

.status-live {
  background: transparent;
}

.stage-pill-upcoming-first {
  background: linear-gradient(135deg, rgba(111, 122, 60, 0.92), rgba(135, 149, 65, 0.96));
}

.stage-pill-upcoming-second {
  background: linear-gradient(135deg, rgba(74, 109, 140, 0.92), rgba(102, 137, 168, 0.96));
}

.stage-pill-upcoming-sale {
  background: linear-gradient(135deg, rgba(181, 107, 47, 0.92), rgba(217, 139, 69, 0.96));
}

.stage-pill-live-first {
  background: linear-gradient(135deg, rgba(82, 114, 40, 0.94), rgba(120, 155, 53, 0.98));
}

.stage-pill-live-second {
  background: linear-gradient(135deg, rgba(36, 91, 142, 0.94), rgba(63, 121, 175, 0.98));
}

.stage-pill-live-sale {
  background: linear-gradient(135deg, rgba(217, 84, 31, 0.94), rgba(255, 123, 61, 0.98));
}

.stage-pill-live-default,
.stage-pill-upcoming-default {
  background: linear-gradient(135deg, rgba(108, 102, 94, 0.92), rgba(139, 132, 122, 0.96));
}

.image-meta {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  z-index: 2;
}

.time-overlay {
  color: #fff;
}

.time-overlay strong {
  display: block;
  margin-top: 4px;
  font-size: 21px;
  line-height: 1.15;
}

.time-label {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.86);
}

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

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.update-tag {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
}

.update-tag:nth-child(3n + 1) {
  background: rgba(111, 122, 60, 0.12);
  color: #556127;
}

.update-tag:nth-child(3n + 2) {
  background: rgba(74, 109, 140, 0.12);
  color: #31597a;
}

.update-tag:nth-child(3n) {
  background: rgba(242, 109, 51, 0.12);
  color: #b64918;
}

.meta-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid rgba(61, 45, 36, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--deep);
  font-size: 11px;
  line-height: 1.2;
}

.meta-tag-stage {
  border-width: 1px;
  border-style: solid;
}

.title-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
}

.discount-badge {
  padding: 4px 8px;
  border-radius: 6px;
  background: #ff8b35;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.listing-card h3,
.decision-focus-listing-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  min-height: calc(1.25em * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin-top: 8px;
  color: #85807c;
  font-size: 14px;
}

.info-row span {
  position: relative;
  padding-right: 10px;
  margin-right: 10px;
}

.info-row span:not(:last-child)::after {
  content: "|";
  position: absolute;
  right: -2px;
  color: #b5afaa;
}

.price-stack {
  margin-top: 10px;
}

.price-line {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: baseline;
  gap: 8px;
  margin-top: 6px;
}

.price-name {
  color: #43403d;
  font-size: 15px;
}

.market-price,
.start-price {
  font-size: 24px;
  line-height: 1;
}

.market-price {
  color: #2f2b28;
}

.start-price {
  color: #e3421d;
}

.price-line em {
  color: #8f8b87;
  font-style: normal;
  font-size: 12px;
  text-align: left;
}

.card-tags {
  margin-top: 8px;
}

.update-tag-strong {
  background: #a53f2b;
  color: #fff;
}

.source-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 13px;
}

.source-label {
  color: #8f8b87;
}

.source-link,
.source-text {
  color: #2f2b28;
}

.source-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.source-link:hover,
.source-link:focus-visible {
  text-decoration: underline;
}

.school-row,
.map-school-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(111, 122, 60, 0.14);
  border-radius: 14px;
  background: rgba(111, 122, 60, 0.06);
}

.school-label,
.school-value {
  color: #556127;
}

.school-label {
  font-weight: 500;
}

.school-value {
  font-weight: 700;
}

.school-note {
  width: 100%;
  color: #6f7464;
  font-size: 11px;
  line-height: 1.45;
}

.school-route-link {
  border-color: rgba(111, 122, 60, 0.18);
  background: rgba(111, 122, 60, 0.06);
}

.school-route-link:hover,
.school-route-link:focus-visible {
  color: #43511c;
  border-color: rgba(67, 81, 28, 0.24);
  box-shadow: 0 8px 18px rgba(111, 122, 60, 0.08);
}

.school-route-link:hover .school-label,
.school-route-link:hover .school-value,
.school-route-link:hover .school-note,
.school-route-link:focus-visible .school-label,
.school-route-link:focus-visible .school-value,
.school-route-link:focus-visible .school-note,
.school-route-link:hover .map-source-label,
.school-route-link:hover .map-source-value,
.school-route-link:focus-visible .map-source-label,
.school-route-link:focus-visible .map-source-value {
  color: #43511c;
}

.commute-row,
.map-commute-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 13px;
  width: 100%;
}

.commute-label,
.commute-value {
  color: #31597a;
}

.commute-label {
  font-weight: 500;
}

.commute-value {
  font-weight: 700;
}

.commute-note {
  width: 100%;
  color: #6d7680;
  font-size: 11px;
  line-height: 1.45;
}

.commute-link {
  appearance: none;
  text-align: left;
  font: inherit;
  text-decoration: none;
  border: 1px solid rgba(49, 89, 122, 0.14);
  border-radius: 14px;
  width: 100%;
  padding: 10px 12px;
  background: rgba(49, 89, 122, 0.05);
  cursor: pointer;
}

.commute-link:hover,
.commute-link:focus-visible {
  color: #173d56;
  border-color: rgba(23, 61, 86, 0.26);
  box-shadow: 0 8px 18px rgba(49, 89, 122, 0.08);
  outline: none;
}

.commute-link:hover .commute-label,
.commute-link:hover .commute-value,
.commute-link:focus-visible .commute-label,
.commute-link:focus-visible .commute-value,
.commute-link:hover .map-source-label,
.commute-link:hover .map-source-value,
.commute-link:focus-visible .map-source-label,
.commute-link:focus-visible .map-source-value,
.commute-link:hover .commute-note,
.commute-link:focus-visible .commute-note {
  color: #173d56;
}

.commute-link.is-disabled {
  color: #8c8883;
  border-color: rgba(61, 45, 36, 0.08);
  background: rgba(61, 45, 36, 0.04);
  cursor: default;
  box-shadow: none;
}

.commute-link.is-disabled .commute-label,
.commute-link.is-disabled .commute-value,
.commute-link.is-disabled .commute-note,
.commute-link.is-disabled .map-source-label,
.commute-link.is-disabled .map-source-value {
  color: #8c8883;
}

.commute-popover {
  position: fixed;
  z-index: 120;
  inset: 0;
  pointer-events: none;
}

.commute-popover[hidden] {
  display: none !important;
}

.commute-popover-card {
  position: absolute;
  width: min(680px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 16px;
  border: 1px solid rgba(49, 89, 122, 0.14);
  border-radius: 24px;
  background: rgba(255, 250, 242, 0.98);
  box-shadow: 0 28px 64px rgba(31, 26, 23, 0.22);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: auto;
  pointer-events: auto;
}

.commute-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.commute-popover-head strong {
  font-size: 15px;
  color: var(--deep);
}

.commute-popover-close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  background: rgba(61, 45, 36, 0.08);
  color: var(--deep);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.commute-popover-close:hover,
.commute-popover-close:focus-visible {
  background: rgba(49, 89, 122, 0.12);
  color: #173d56;
  outline: none;
}

.commute-popover-route {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.commute-popover-route span:first-child,
.commute-popover-route span:last-child {
  max-width: 42%;
}

.commute-popover-route span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commute-popover-map {
  position: relative;
  margin-top: 12px;
  height: 420px;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(49, 89, 122, 0.08), rgba(49, 89, 122, 0.03));
  border: 1px solid rgba(49, 89, 122, 0.12);
}

.commute-popover-map[data-state="loading"]::after,
.commute-popover-map[data-state="error"]::after {
  content: attr(data-message);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  text-align: center;
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  background: rgba(255, 250, 242, 0.86);
  z-index: 2;
}

.commute-popover-map[data-state="error"]::after {
  color: #9a4f1d;
}

.commute-popover-arrow {
  flex: 0 0 auto;
  color: #245b8e;
}

.commute-popover-metrics {
  margin-top: 10px;
  color: #245b8e;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}

.commute-popover-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.commute-popover-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.commute-popover-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2f5f89, #4f7fad);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.commute-popover-link:hover,
.commute-popover-link:focus-visible {
  box-shadow: 0 10px 22px rgba(47, 95, 137, 0.18);
  transform: translateY(-1px);
  outline: none;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(61, 45, 36, 0.08);
}

.card-link-text {
  color: var(--accent);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.01em;
}

.timestamp {
  color: #8f8b87;
  font-size: 11px;
}

.empty-state {
  margin-top: 20px;
  padding: 56px 28px;
  border: 1px solid rgba(61, 45, 36, 0.08);
  border-radius: 28px;
  text-align: center;
  background: rgba(255, 250, 242, 0.82);
  box-shadow: var(--shadow);
}

.empty-state h2 {
  margin: 0 0 10px;
  font-size: 36px;
}

.empty-state p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 900px) {
  .hero,
  .district-header:not(.district-header-toggle) {
    grid-template-columns: 1fr;
    display: block;
  }

  .all-active-head {
    flex-direction: column;
    align-items: stretch;
  }

  .district-header-main {
    flex-direction: column;
    gap: 4px;
  }

  .district-inline-stats {
    white-space: normal;
    font-size: 13px;
  }

  .commute-panel {
    grid-template-columns: 1fr;
  }

  .commute-panel-main,
  .commute-panel-side {
    flex-direction: column;
    align-items: stretch;
  }

  .commute-actions {
    flex-direction: column;
  }

  .decision-toolbar-head,
  .decision-focus-head,
  .decision-group {
    grid-template-columns: 1fr;
    display: block;
  }

  .decision-helper,
  .decision-focus-helper {
    margin-top: 10px;
    max-width: none;
  }

  .decision-group-label {
    display: inline-block;
    margin-bottom: 10px;
    padding-top: 0;
  }

  .decision-soon-text {
    grid-column: auto;
    display: block;
    margin-top: 8px;
  }

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

  .decision-focus-list {
    grid-template-columns: 1fr;
  }

  .map-list-item {
    grid-template-columns: 100px 1fr;
  }

  .summary-panel,
  .district-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .summary-panel {
    margin-top: 16px;
  }

  .district-stats {
    margin-top: 16px;
  }

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

@media (max-width: 640px) {
  .page {
    width: min(100% - 20px, 1180px);
    padding-top: 14px;
  }

  .hero,
  .listing-card,
  .decision-focus-listing-card,
  .empty-state,
  .map-section,
  .beijing-map {
    border-radius: 18px;
  }

  .hero {
    padding: 18px;
  }

  .map-list-item {
    grid-template-columns: 1fr;
  }

  .map-card-thumb {
    min-height: 180px;
  }

  .price-row,
  .summary-panel,
  .district-stats {
    grid-template-columns: 1fr;
  }

  .image-meta {
    left: 14px;
    right: 14px;
    bottom: 12px;
  }

  .time-overlay strong {
    font-size: 17px;
  }

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

  .title-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .listing-card h3,
  .decision-focus-listing-card h3 {
    white-space: normal;
  }

  .price-line {
    grid-template-columns: auto auto;
  }

  .price-line em {
    grid-column: 1 / -1;
  }

  .card-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .commute-popover {
    inset: 0;
  }

  .commute-popover-card {
    width: 100%;
    max-height: min(82vh, 760px);
    border-radius: 22px;
  }

  .commute-popover-map {
    height: 300px;
  }
}
