:root {
  --bg: #fff3e4;
  --paper: rgba(255, 248, 237, 0.9);
  --paper-solid: #fff8ef;
  --paper-strong: #fff0dc;
  --red: #df1e1b;
  --red-dark: #9f1113;
  --red-soft: #f45a3f;
  --orange: #f47d28;
  --gold: #d79a44;
  --blue: #1f78c8;
  --green: #4f9d4c;
  --purple: #7660c9;
  --ink: #681615;
  --muted: #9c5a46;
  --line: rgba(216, 89, 42, 0.28);
  --line-strong: rgba(208, 51, 31, 0.45);
  --shadow: 0 10px 24px rgba(159, 39, 16, 0.12);
  --inner: inset 0 1px 0 rgba(255, 255, 255, 0.88);
  --radius: 8px;
  --gap: 10px;
  --font-display: "Songti SC", "STSong", "SimSun", serif;
  --font-ui: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  min-width: 0;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-ui);
  background: #edd8c9 url("./assets/refs/stage-bg.png") center / cover no-repeat;
  overflow: hidden;
  display: block;
}

.app-shell.is-scaled-canvas {
  flex: none;
  transform-origin: top left;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(210, 31, 24, 0.52);
  outline-offset: 2px;
}

.app-shell {
  width: 100vw;
  height: 100dvh;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: url("./assets/refs/stage-bg.png") center / 100% 100% no-repeat;
}

.app-shell::before,
.app-shell::after {
  display: none;
}

.hero-header,
.main-nav,
.page-root,
.footer-slogan {
  position: relative;
  z-index: 1;
}

.hero-header {
  height: 11.2vh;
  flex: 0 0 11.2vh;
  min-height: 82px;
  max-height: 128px;
  position: relative;
  padding: 0;
  border: 0;
  background: transparent;
}

.hero-art {
  display: none;
}

.flag-wave {
  position: absolute;
  left: -24px;
  top: -20px;
  width: 270px;
  height: 108px;
  background:
    radial-gradient(ellipse at 62% 68%, rgba(255, 240, 220, 0.52), transparent 38%),
    linear-gradient(135deg, #ec1c17 0%, #c91416 48%, #ff6b3c 100%);
  clip-path: polygon(0 0, 100% 0, 86% 20%, 100% 43%, 82% 63%, 93% 90%, 42% 74%, 0 94%);
  box-shadow: 0 16px 30px rgba(156, 16, 16, 0.16);
}

.monument-shape {
  position: absolute;
  left: 78px;
  top: 34px;
  width: 190px;
  height: 72px;
  opacity: 0.78;
  background:
    linear-gradient(90deg, transparent 0 7%, rgba(112, 42, 23, 0.6) 7% 10%, transparent 10% 22%, rgba(112, 42, 23, 0.58) 22% 25%, transparent 25% 39%, rgba(112, 42, 23, 0.58) 39% 42%, transparent 42% 55%, rgba(112, 42, 23, 0.58) 55% 58%, transparent 58%),
    radial-gradient(ellipse at 52% 70%, rgba(107, 47, 26, 0.7), transparent 56%);
  border-bottom: 7px solid rgba(112, 42, 23, 0.5);
  filter: drop-shadow(0 7px 8px rgba(141, 35, 21, 0.14));
}

.slogan-brush {
  position: absolute;
  right: 12px;
  top: 26px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 26px;
  line-height: 1.12;
  color: #d51d19;
  transform: rotate(-4deg);
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.72);
}

.title-lockup {
  display: none;
}

.title-lockup h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(38px, 3.2vw, 56px);
  line-height: 1;
  color: var(--red-dark);
  font-weight: 900;
  text-shadow: 0 3px 0 rgba(255, 255, 255, 0.88), 0 9px 18px rgba(176, 32, 18, 0.13);
}

.title-lockup p {
  margin: 14px 0 0;
  color: var(--red);
  font-size: 17px;
  font-weight: 700;
}

.title-lines {
  width: 100%;
  height: 18px;
  margin-bottom: 4px;
  background:
    linear-gradient(90deg, transparent, rgba(214, 76, 35, 0.55), transparent) left 50% / 38% 1px no-repeat,
    linear-gradient(90deg, transparent, rgba(214, 76, 35, 0.55), transparent) right 50% / 38% 1px no-repeat;
}

.hero-art-right {
  display: none;
}

.line-landscape {
  width: min(100%, 430px);
  height: 108px;
  opacity: 0.8;
}

.line-landscape path {
  fill: none;
  stroke: rgba(222, 53, 29, 0.58);
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.line-landscape path:nth-child(2),
.line-landscape path:nth-child(3) {
  fill: rgba(232, 76, 41, 0.07);
}

.status-strip {
  position: absolute;
  left: 28px;
  bottom: 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 7px 11px;
  border: 1px solid rgba(212, 72, 36, 0.18);
  border-radius: 7px;
  background: rgba(255, 246, 234, 0.66);
  box-shadow: var(--inner);
  color: #66201a;
  font-size: 13px;
  font-weight: 600;
}

.status-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.status-item::before {
  content: "";
  width: 18px;
  height: 18px;
  display: inline-block;
  background: currentColor;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
}

.status-item[data-icon="clock"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 7v5l3 2M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20Z' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.status-item[data-icon="cloud"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M17.5 19H8a5 5 0 0 1-.7-10A6.5 6.5 0 0 1 20 10.8 4.1 4.1 0 0 1 17.5 19Z' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.status-item[data-icon="pin"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 21s7-5.2 7-12a7 7 0 1 0-14 0c0 6.8 7 12 7 12Z' fill='none' stroke='black' stroke-width='2'/%3E%3Ccircle cx='12' cy='9' r='2.5' fill='black'/%3E%3C/svg%3E");
}

.main-nav {
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  width: min(1390px, calc(100vw - 360px));
  min-width: 740px;
  margin: 0 auto 8px;
  padding: 5px;
  border: 1px solid rgba(216, 80, 39, 0.28);
  border-radius: 8px;
  background: rgba(255, 246, 234, 0.78);
  box-shadow: var(--inner), 0 10px 24px rgba(180, 72, 26, 0.1);
}

.nav-item {
  min-width: 0;
  height: 36px;
  position: relative;
  background: transparent;
  border-radius: 6px;
  color: #a81413;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item + .nav-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 1px;
  background: rgba(213, 72, 34, 0.34);
}

.nav-item.is-active {
  color: #fff;
  background: linear-gradient(180deg, #ff4d36 0%, #dd1818 56%, #bc1013 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.46), 0 5px 14px rgba(191, 27, 19, 0.24);
}

.nav-item:focus-visible {
  outline: 2px solid rgba(255, 219, 150, 0.72);
  outline-offset: -3px;
}

.page-root {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 clamp(18px, 1.55vw, 30px) clamp(30px, 4.4vh, 48px);
}

.page {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1vh, var(--gap));
}

.metric-row {
  flex: 0 0 clamp(56px, 6.75vh, 76px);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(260px, 1.55fr);
  gap: var(--gap);
}

.metric-row.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card,
.panel,
.mini-card,
.tag,
.phase-card,
.route-node,
.detail-badge,
.person-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--inner), 0 7px 18px rgba(173, 69, 26, 0.08);
}

.metric-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 62px 1fr;
  align-items: center;
  padding: 7px 12px;
  overflow: hidden;
}

.metric-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: var(--red);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.95), rgba(255, 226, 198, 0.42));
  border: 1px solid rgba(223, 82, 42, 0.22);
}

.metric-icon svg {
  width: 29px;
  height: 29px;
}

.metric-label {
  color: #b3201b;
  font-weight: 800;
  font-size: 14px;
  line-height: 1.2;
}

.metric-value {
  margin-top: 2px;
  color: var(--red);
  font-size: 30px;
  line-height: 1;
  font-weight: 900;
}

.metric-unit {
  padding-left: 5px;
  font-size: 14px;
  color: #b32d21;
}

.metric-wide {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  align-items: center;
  padding: 10px 16px;
}

.metric-wide .wide-title {
  grid-column: 1 / -1;
  margin-bottom: 4px;
  color: #b41b17;
  font-size: 15px;
  font-weight: 900;
}

.wide-item {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-left: 1px solid rgba(213, 90, 45, 0.24);
}

.wide-item:first-of-type {
  border-left: 0;
}

.wide-item svg {
  width: 30px;
  height: 30px;
  color: var(--red);
}

.wide-item strong {
  color: var(--red);
  font-size: 20px;
}

.wide-item span {
  color: #a64935;
  font-size: 13px;
  font-weight: 700;
}

.panel {
  min-width: 0;
  min-height: 0;
  position: relative;
  padding: clamp(10px, 1.2vh, 14px);
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 8% 12%, rgba(255, 255, 255, 0.72), transparent 28%),
    linear-gradient(135deg, rgba(251, 213, 179, 0.12), transparent 55%);
  pointer-events: none;
}

.panel > * {
  position: relative;
  z-index: 1;
}

.panel-title {
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #b31916;
  font-size: 16px;
  line-height: 1.2;
  font-weight: 900;
}

.panel-title .star {
  margin-right: 6px;
  color: var(--red);
}

.panel-title small {
  color: #c44c31;
  font-size: 12px;
  font-weight: 800;
}

.section-subtitle {
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.footer-slogan {
  height: 4.8vh;
  flex: 0 0 4.8vh;
  min-height: 36px;
  max-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  color: var(--red);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  text-align: center;
  background: transparent;
  opacity: 0;
  pointer-events: none;
}

.footer-slogan span {
  width: 140px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(206, 34, 28, 0.82));
}

.footer-slogan span:last-child {
  transform: scaleX(-1);
}

/* shared data widgets */
.overview-main,
.data-grid,
.timeline-grid,
.network-grid,
.detail-grid {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  gap: var(--gap);
}

.overview-main {
  grid-template-columns: clamp(235px, 15.4vw, 295px) minmax(430px, 1fr) clamp(390px, 27.6vw, 530px);
  grid-template-rows: minmax(0, 1fr) clamp(168px, 20.2vh, 218px);
}

.filter-panel {
  grid-row: 1 / 2;
}

.home-map {
  grid-column: 2;
  grid-row: 1;
}

.home-right {
  grid-column: 3;
  grid-row: 1;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(116px, 0.45fr) minmax(126px, 0.55fr);
  gap: var(--gap);
  min-height: 0;
}

.type-panel {
  grid-column: 1;
  grid-row: 2;
}

.timeline-panel-home {
  grid-column: 2;
  grid-row: 2;
}

.routes-panel-home {
  grid-column: 3;
  grid-row: 2;
}

.field-stack {
  display: grid;
  gap: 10px;
}

.field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #be221a;
  font-size: 13px;
  font-weight: 900;
}

.select-control,
.search-control {
  width: 100%;
  height: 32px;
  border: 1px solid rgba(213, 77, 38, 0.28);
  border-radius: 6px;
  padding: 0 12px;
  color: #8b2b20;
  background: rgba(255, 250, 242, 0.94);
  outline: none;
}

.search-combobox {
  position: relative;
  width: 100%;
  min-width: 0;
}

.search-combobox.is-open {
  z-index: 80;
}

.search-combobox-input-wrap {
  position: relative;
}

.search-select-input {
  padding-right: 34px;
  text-overflow: ellipsis;
}

.search-select-input:focus {
  border-color: rgba(202, 41, 29, 0.72);
  box-shadow: 0 0 0 2px rgba(226, 58, 35, 0.12);
}

.search-combobox-toggle {
  position: absolute;
  top: 50%;
  right: 3px;
  width: 28px;
  height: 26px;
  transform: translateY(-50%);
  color: #b62a20;
  font-size: 18px;
  line-height: 1;
  background: transparent;
}

.search-combobox-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 90;
  max-height: min(240px, 34vh);
  overflow-y: auto;
  padding: 5px;
  border: 1px solid rgba(190, 49, 29, 0.3);
  border-radius: 6px;
  background: #fff9f0;
  box-shadow: 0 12px 24px rgba(112, 39, 24, 0.2);
}

.search-combobox-list[hidden] {
  display: none;
}

.search-combobox-option {
  display: block;
  width: 100%;
  min-height: 30px;
  padding: 6px 9px;
  overflow: hidden;
  color: #74261f;
  font-size: 12px;
  line-height: 1.25;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 4px;
  background: transparent;
}

.search-combobox-option:hover,
.search-combobox-option.is-active {
  color: #bd211b;
  background: #ffe5d2;
}

.search-combobox-option.is-selected {
  color: #fff;
  background: #cf2b20;
}

.search-combobox-empty {
  display: block;
  padding: 9px;
  color: #9b6b5e;
  font-size: 12px;
  text-align: center;
}

.filter-panel,
.node-filter-panel,
.site-media-panel {
  overflow: visible;
  z-index: 8;
}

.filter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.primary-btn,
.ghost-btn {
  height: 38px;
  border-radius: 6px;
  font-weight: 900;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(180deg, #f64c31, #d91417);
  box-shadow: 0 6px 12px rgba(199, 24, 18, 0.18);
}

.ghost-btn {
  color: #9d2e20;
  border: 1px solid rgba(214, 82, 40, 0.28);
  background: rgba(255, 242, 224, 0.86);
}

.primary-btn:hover,
.ghost-btn:hover,
.nav-item:hover,
.phase-card:hover,
.node-chip:hover,
.route-node:hover {
  transform: translateY(-1px);
}

.map-wrap {
  width: 100%;
  height: calc(100% - 28px);
  min-height: 300px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
}

.map-wrap.compact {
  height: 100%;
  min-height: 0;
}

.map-wrap.compact .map-tools,
.map-wrap.compact .map-legend,
.map-wrap.compact .mini-map-card {
  display: none;
}

.map-wrap::before {
  content: "";
  position: absolute;
  inset: 2px;
  border-radius: 6px;
  background:
    radial-gradient(circle at 68% 44%, rgba(223, 30, 27, 0.14), transparent 18%),
    radial-gradient(circle at 48% 58%, rgba(244, 125, 40, 0.1), transparent 28%),
    linear-gradient(135deg, rgba(255, 250, 244, 0.74), rgba(255, 231, 208, 0.34));
  opacity: 1;
}

.map-image-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(790px, calc(100% - 190px));
  height: calc(100% - 16px);
  transform: translate(-50%, -50%);
}

.home-map .map-image-frame {
  height: calc(100% - 6px);
}

.map-wrap.compact .map-image-frame {
  width: calc(100% - 18px);
  height: 108%;
  max-width: calc(100% - 20px);
  opacity: 0.72;
}

.drawn-map-svg {
  position: relative;
  z-index: 2;
  width: min(84%, 820px);
  height: calc(100% - 12px);
  overflow: visible;
  filter: drop-shadow(0 8px 14px rgba(159, 52, 24, 0.12));
}

.home-map .drawn-map-svg {
  width: min(88%, 880px);
}

.map-wrap.compact .drawn-map-svg {
  width: calc(100% - 12px);
  height: 100%;
  opacity: 0.96;
}

.prefecture-shape {
  fill: rgba(214, 32, 27, var(--heat, 0.34));
  stroke: rgba(174, 36, 24, 0.58);
  stroke-width: 0.22;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: fill 0.16s ease, stroke 0.16s ease, filter 0.16s ease;
}

.prefecture-shape:nth-child(2n) {
  fill: rgba(238, 103, 50, calc(var(--heat, 0.34) * 0.9));
}

.prefecture-shape:nth-child(3n) {
  fill: rgba(187, 24, 23, calc(var(--heat, 0.34) * 0.92));
}

.prefecture-shape:hover,
.prefecture-shape.is-selected {
  fill: rgba(223, 30, 27, 0.82);
  stroke: rgba(255, 247, 226, 0.92);
  stroke-width: 0.55;
  filter: url("#mapGlow");
}

.prefecture-shape.fallback {
  fill: rgba(223, 30, 27, 0.34);
}

.map-link-layer,
.route-layer {
  pointer-events: none;
}

.city-marker {
  cursor: pointer;
  transition: opacity 0.16s ease, filter 0.16s ease;
}

.city-marker:hover,
.city-marker.is-hot {
  filter: drop-shadow(0 0 2px rgba(223, 30, 27, 0.5));
}

.city-marker.is-empty {
  opacity: 0.35;
}

.marker-halo {
  fill: rgba(255, 235, 199, 0.52);
  stroke: rgba(255, 255, 255, 0.72);
  stroke-width: 0.3;
}

.marker-core,
.city-marker > circle:not(.marker-halo) {
  fill: #fff8df;
  stroke: #d51618;
  stroke-width: 0.58;
  paint-order: stroke;
}

.city-marker.is-hot .marker-core,
.city-marker:hover .marker-core {
  fill: #d7191c;
  stroke: #fff6d7;
}

.city-marker text {
  fill: #72241d;
  stroke: rgba(255, 249, 236, 0.98);
  stroke-width: 0.75;
  paint-order: stroke;
  font-size: 3.5px;
  font-weight: 900;
  text-anchor: middle;
  pointer-events: none;
}

.admin-map-base,
.map-overlay-svg,
.map-node-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.admin-map-base {
  object-fit: fill;
  border-radius: 7px;
  opacity: 0.86;
  filter: saturate(0.9) contrast(1.02);
  box-shadow: 0 10px 20px rgba(159, 52, 24, 0.12);
}

.map-image-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 7px;
  background:
    radial-gradient(circle at 72% 42%, rgba(223, 30, 27, 0.18), transparent 14%),
    linear-gradient(180deg, rgba(255, 248, 236, 0.06), rgba(255, 231, 204, 0.16));
  pointer-events: none;
}

.map-overlay-svg {
  z-index: 2;
  pointer-events: none;
}

.map-link {
  stroke: rgba(223, 30, 27, 0.42);
  stroke-width: 0.42;
  stroke-dasharray: 1.4 1.2;
  stroke-linecap: round;
}

.map-node-layer {
  z-index: 3;
}

.site-node {
  --size: 18px;
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: var(--size);
  height: var(--size);
  margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2);
  border-radius: 50%;
  border: 2px solid #fffaf0;
  background: radial-gradient(circle at 35% 32%, #fff4d7 0 28%, #ff4c33 30% 62%, #b91014 100%);
  box-shadow: 0 0 0 4px rgba(223, 30, 27, 0.14), 0 5px 10px rgba(117, 34, 19, 0.2);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.site-node::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 44%;
  height: 44%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 249, 229, 0.95);
}

.site-node.hot,
.site-node:hover {
  transform: scale(1.24);
  box-shadow: 0 0 0 6px rgba(255, 204, 103, 0.24), 0 0 18px rgba(223, 30, 27, 0.36);
}

.site-node span {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  transform: translateX(-50%);
  color: #7d251d;
  font-size: 12px;
  line-height: 1;
  font-weight: 900;
  white-space: nowrap;
  text-shadow: 0 1px 0 #fff8ec, 0 -1px 0 #fff8ec, 1px 0 0 #fff8ec, -1px 0 0 #fff8ec;
}

.home-map .site-node span {
  font-size: 13px;
}

.map-tools {
  position: absolute;
  right: 12px;
  top: 42px;
  display: grid;
  gap: 8px;
}

.map-tool {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid rgba(213, 77, 38, 0.26);
  color: var(--red);
  background: rgba(255, 248, 238, 0.9);
  font-weight: 900;
}

.map-legend,
.route-legend,
.mini-map-card {
  position: absolute;
  padding: 10px;
  border: 1px solid rgba(215, 87, 39, 0.24);
  border-radius: 7px;
  background: rgba(255, 246, 234, 0.88);
  box-shadow: var(--inner);
}

.map-legend {
  left: 14px;
  bottom: 14px;
  display: grid;
  gap: 7px;
  font-size: 12px;
  color: #8d3527;
  font-weight: 700;
}

.legend-title {
  color: #b81e17;
  font-weight: 900;
}

.legend-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 7px;
  background: var(--red);
}

.mini-map-card {
  right: 14px;
  bottom: 14px;
  width: 120px;
  text-align: center;
  color: #b13c28;
  font-size: 12px;
  font-weight: 800;
}

.mini-hunan {
  width: 72px;
  height: 52px;
  margin: 2px auto 4px;
  background: rgba(235, 106, 54, 0.22);
  clip-path: polygon(29% 2%, 67% 9%, 89% 35%, 82% 66%, 57% 95%, 28% 87%, 5% 57%, 15% 22%);
  position: relative;
}

.mini-hunan::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: 12px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 5px rgba(223, 30, 27, 0.15);
}

.rank-list {
  display: grid;
  gap: 7px;
  height: calc(100% - 30px);
  overflow: auto;
  align-content: start;
}

.rank-row {
  display: grid;
  grid-template-columns: 24px minmax(42px, 66px) 1fr 42px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  text-align: left;
  color: #7f2f24;
  font-size: 12px;
  font-weight: 800;
  background: transparent;
}

.rank-row:hover .rank-bar {
  filter: brightness(1.07);
}

.rank-index {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 4px;
  background: linear-gradient(180deg, #ff593c, #d91818);
  font-size: 11px;
}

.rank-bar {
  height: 10px;
  border-radius: 2px;
  background: linear-gradient(90deg, #e81818, #ff9b6b);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.rank-value {
  text-align: right;
  color: #a2261d;
}

.table-list {
  height: calc(100% - 28px);
  display: grid;
  grid-template-rows: auto repeat(3, minmax(19px, 1fr));
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(215, 88, 39, 0.16);
}

.table-row {
  display: grid;
  grid-template-columns: 34px 1.3fr 0.8fr 0.9fr 0.8fr;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 0;
  padding: 0 9px;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  text-align: left;
  color: #843024;
  font-size: 12px;
  font-weight: 700;
  border-top: 1px solid rgba(221, 100, 47, 0.13);
  background: rgba(255, 250, 243, 0.3);
}

.table-row:first-child {
  border-top: 0;
  color: #b21e18;
  background: rgba(245, 113, 43, 0.12);
  font-weight: 900;
  pointer-events: none;
}

button.table-row:hover {
  background: rgba(255, 229, 207, 0.52);
}

.empty-state {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 18px;
  color: #9d4c3d;
  font-size: 13px;
  line-height: 1.45;
  text-align: center;
  font-weight: 800;
}

.empty-state.compact {
  min-height: auto;
  padding: 8px;
  justify-items: start;
  text-align: left;
}

.empty-table {
  display: grid;
  grid-template-rows: 1fr;
}

.table-row .serial {
  color: var(--red);
  font-weight: 900;
}

.donut-wrap {
  height: calc(100% - 28px);
  display: grid;
  grid-template-columns: minmax(130px, 0.9fr) minmax(130px, 1fr);
  align-items: center;
  gap: 8px;
}

.donut {
  width: min(148px, 100%);
  aspect-ratio: 1;
  justify-self: center;
  border-radius: 50%;
  position: relative;
  background: conic-gradient(var(--red) 0 31%, var(--orange) 31% 51%, #efb34e 51% 65%, var(--green) 65% 80%, #3aaac3 80% 92%, var(--purple) 92% 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.58), 0 10px 18px rgba(160, 60, 32, 0.13);
}

.donut::after {
  content: attr(data-total) "\A总数";
  white-space: pre;
  position: absolute;
  inset: 24%;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: 50%;
  background: var(--paper-solid);
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
  box-shadow: 0 0 0 1px rgba(215, 88, 39, 0.1);
}

.donut::first-line {
  font-size: 28px;
}

.legend-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.legend-row {
  display: grid;
  grid-template-columns: 14px minmax(70px, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: #7f3125;
  font-size: 12px;
  font-weight: 800;
}

.color-square {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: var(--red);
}

.phase-strip,
.route-list,
.compare-row,
.tag-cloud,
.person-row,
.route-flow {
  display: grid;
  gap: 10px;
}

.phase-strip {
  height: calc(100% - 28px);
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.phase-card {
  min-width: 0;
  padding: 10px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 7px;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.phase-card.is-active {
  border-color: rgba(222, 32, 25, 0.72);
  background: linear-gradient(180deg, rgba(255, 246, 233, 0.98), rgba(255, 229, 206, 0.95));
  box-shadow: inset 0 0 0 1px rgba(222, 32, 25, 0.18), 0 9px 18px rgba(170, 48, 21, 0.14);
}

.phase-no {
  color: var(--red);
  font-size: 22px;
  font-weight: 900;
}

.phase-title {
  color: #8f231d;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 900;
}

.phase-years {
  color: #b44c37;
  font-size: 11px;
  font-weight: 800;
}

.phase-image {
  min-height: 46px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  color: #c51d18;
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.9), rgba(255, 236, 212, 0.48) 48%, rgba(255, 207, 176, 0.38)),
    linear-gradient(135deg, rgba(223, 30, 27, 0.14), rgba(244, 125, 40, 0.16));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.phase-image svg {
  width: 36px;
  height: 36px;
  filter: drop-shadow(0 2px 0 rgba(255, 255, 255, 0.68));
}

.phase-count {
  color: #ad2a20;
  font-size: 12px;
  font-weight: 800;
}

.route-list {
  height: calc(100% - 28px);
  grid-template-rows: repeat(3, 1fr);
  gap: 7px;
}

.route-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 172px;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(217, 85, 42, 0.14);
  border-radius: 7px;
  background: rgba(255, 247, 237, 0.58);
}

.routes-panel-home .route-item,
.route-panel-home .route-item {
  grid-template-columns: 42px minmax(0, 1fr) 144px;
  padding: 5px 8px;
}

.routes-panel-home .route-thumb,
.route-panel-home .route-thumb {
  width: 38px;
  height: 38px;
}

.routes-panel-home .route-line,
.route-panel-home .route-line {
  height: 28px;
}

.routes-panel-home .route-text strong,
.route-panel-home .route-text strong {
  font-size: 13px;
}

.route-thumb.is-missing {
  display: grid;
  place-items: center;
  background-image: none !important;
  background: rgba(217, 81, 47, 0.12);
  color: #a84b3a;
  font-size: 9px;
  font-weight: 850;
}

.routes-panel-home .route-text span,
.route-panel-home .route-text span {
  margin-top: 2px;
}

.route-thumb {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  background: url("./assets/refs/detail.jpg") 34% 54% / 300% auto;
  border: 2px solid rgba(255, 255, 255, 0.88);
  box-shadow: 0 3px 8px rgba(154, 49, 26, 0.15);
}

.route-item:nth-child(2) .route-thumb { background-position: 48% 44%; }
.route-item:nth-child(3) .route-thumb { background-position: 62% 42%; }

.route-text {
  min-width: 0;
}

.route-text strong {
  display: block;
  color: #b51e17;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-text span {
  display: block;
  margin-top: 4px;
  color: #9d5241;
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-line {
  height: 36px;
  position: relative;
  overflow: hidden;
}

.route-line::before {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  top: 18px;
  border-top: 2px dashed currentColor;
  opacity: 0.72;
}

.route-line i {
  position: absolute;
  top: 10px;
  width: 17px;
  height: 17px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 3px solid currentColor;
  background: var(--paper-solid);
}

.route-line i:nth-child(1) { left: 2%; }
.route-line i:nth-child(2) { left: 39%; }
.route-line i:nth-child(3) { left: 76%; }

/* page 02 */
.data-grid {
  grid-template-columns: clamp(250px, 16.4vw, 315px) clamp(240px, 15.9vw, 305px) minmax(430px, 1fr) clamp(310px, 21vw, 405px);
  grid-template-rows: minmax(0, 1fr) clamp(160px, 18.7vh, 202px);
}

.data-grid .category-card { grid-column: 1; grid-row: 1; }
.data-grid .city-rank-card { grid-column: 2; grid-row: 1; }
.data-grid .matrix-card { grid-column: 3; grid-row: 1; }
.data-grid .right-data-stack {
  grid-column: 4;
  grid-row: 1;
  display: grid;
  grid-template-rows: 1fr clamp(130px, 14.8vh, 160px);
  gap: var(--gap);
  min-height: 0;
}
.data-grid .compare-panel {
  grid-column: 1 / -1;
  grid-row: 2;
}

.matrix-wrap {
  height: calc(100% - 30px);
  display: grid;
  grid-template-rows: minmax(0, 1fr) 24px;
  gap: 9px;
}

.matrix-table {
  width: 100%;
  height: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: 6px;
  font-size: 12px;
  color: #7f2d22;
}

.matrix-table th,
.matrix-table td {
  text-align: center;
  padding: 5px 6px;
  border-right: 1px solid rgba(255, 246, 232, 0.72);
  border-bottom: 1px solid rgba(255, 246, 232, 0.72);
}

.matrix-table th {
  color: #9e251d;
  background: rgba(239, 110, 54, 0.13);
  font-weight: 900;
}

.matrix-table td:first-child,
.matrix-table th:first-child {
  text-align: left;
  font-weight: 900;
  color: #8a2d22;
  background: rgba(255, 248, 238, 0.7);
}

.heat-1 { background: rgba(255, 215, 184, 0.62); }
.heat-2 { background: rgba(255, 174, 126, 0.62); }
.heat-3 { background: rgba(255, 128, 80, 0.68); }
.heat-4 { background: rgba(225, 35, 28, 0.78); color: #fff; }

.heat-scale {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  color: #8d3b2e;
  font-size: 12px;
  font-weight: 800;
}

.heat-bar {
  height: 18px;
  border-radius: 3px;
  background: linear-gradient(90deg, #fff0de, #ffb082, #e81518);
  border: 1px solid rgba(217, 82, 39, 0.18);
}

.tag-cloud {
  height: calc(100% - 30px);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  align-content: start;
}

.tag {
  min-width: 0;
  height: 27px;
  display: grid;
  place-items: center;
  color: #b8291e;
  font-weight: 900;
  font-size: 12px;
  background: rgba(255, 239, 217, 0.82);
  transition: background 0.16s ease, color 0.16s ease;
}

.tag.is-active {
  color: #fff;
  background: linear-gradient(180deg, #f25937, #d7191c);
}

.compare-row {
  height: calc(100% - 28px);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compare-card {
  min-width: 0;
  padding: 9px 12px;
  border: 1px solid rgba(217, 85, 42, 0.18);
  border-radius: 8px;
  background: rgba(255, 248, 239, 0.7);
}

.compare-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #a8241b;
  font-size: 16px;
  font-weight: 900;
}

.small-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: url("./assets/refs/detail.jpg") 38% 50% / 420% auto;
  border: 2px solid #fff;
}

.mini-bars {
  height: 100px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 7px;
  padding-top: 6px;
}

.mini-bar {
  min-width: 0;
  display: grid;
  gap: 5px;
  justify-items: center;
  color: #742d24;
  font-size: 10px;
  font-weight: 800;
}

.mini-bar i {
  width: 100%;
  min-height: 5px;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, var(--red), #ff9d69);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

/* page 03 */
.timeline-grid {
  grid-template-columns: clamp(260px, 15.9vw, 305px) minmax(520px, 1fr) clamp(330px, 20.3vw, 390px);
  grid-template-rows: clamp(176px, 20.9vh, 226px) minmax(0, 1fr) clamp(134px, 15.4vh, 166px);
}

.event-list-panel { grid-column: 1; grid-row: 1 / 3; }
.period-main-panel { grid-column: 2; grid-row: 1; }
.period-detail-panel { grid-column: 3; grid-row: 1 / 3; }
.route-map-panel { grid-column: 2; grid-row: 2; }
.route-nodes-panel { grid-column: 1 / -1; grid-row: 3; }

.event-list {
  height: calc(100% - 28px);
  display: grid;
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}

.event-card {
  display: grid;
  grid-template-columns: 28px 78px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 74px;
  padding: 8px;
  border: 1px solid rgba(217, 85, 42, 0.14);
  border-radius: 7px;
  background: rgba(255, 247, 238, 0.64);
}

.event-index {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--red);
  font-weight: 900;
}

.event-image {
  height: 58px;
  border-radius: 5px;
  display: grid;
  place-items: center;
  color: #d6251e;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.92), rgba(255, 233, 209, 0.6)),
    linear-gradient(135deg, rgba(223, 30, 27, 0.12), rgba(244, 125, 40, 0.12));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
}

.event-image svg {
  width: 32px;
  height: 32px;
}

.event-text {
  min-width: 0;
}

.event-text strong {
  display: block;
  color: #a82119;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-text span,
.event-text p {
  margin: 3px 0 0;
  color: #7d3a2e;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 700;
}

.timeline-grid .phase-strip {
  grid-template-columns: repeat(5, minmax(118px, 1fr));
}

.route-map-wrap {
  height: calc(100% - 28px);
  position: relative;
  overflow: hidden;
  border-radius: 7px;
}

.route-map-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 7px;
  background: rgba(255, 246, 235, 0.48);
}

.route-map-image-frame {
  width: min(760px, calc(100% - 260px));
  height: calc(100% - 6px);
}

.route-map-svg {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
}

.route-path {
  fill: none;
  stroke-width: 0.8;
  stroke-dasharray: 1.5 1.1;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 0 rgba(255, 249, 233, 0.85));
}

.route-node-dot {
  fill: var(--paper-solid);
  stroke-width: 0.65;
  filter: drop-shadow(0 1px 1px rgba(132, 43, 22, 0.34));
}

.route-label-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.route-label {
  position: absolute;
  left: var(--x);
  top: var(--y);
  transform: translate(8px, -18px);
  color: #7e2c22;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  text-shadow: 0 1px 0 #fff8ec, 0 -1px 0 #fff8ec, 1px 0 0 #fff8ec, -1px 0 0 #fff8ec;
}

.period-detail {
  height: calc(100% - 28px);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 10px;
}

.period-hero {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 10px;
  align-items: center;
  padding: 9px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(222, 31, 27, 0.12), rgba(244, 125, 40, 0.08));
}

.period-emblem {
  height: 58px;
  display: grid;
  place-items: center;
  color: var(--red);
  border-radius: 8px;
  border: 1px solid rgba(221, 68, 35, 0.2);
  background: rgba(255, 250, 244, 0.78);
}

.period-emblem svg {
  width: 40px;
  height: 40px;
}

.period-detail h3 {
  margin: 0;
  color: #a61917;
  font-size: 19px;
}

.period-detail .years {
  margin-top: 4px;
  color: #b95842;
  font-weight: 800;
  font-size: 13px;
}

.period-detail p {
  margin: 0;
  color: #753327;
  font-size: 13px;
  line-height: 1.55;
  font-weight: 650;
}

.period-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.period-kpi {
  padding: 7px;
  border-radius: 7px;
  background: rgba(255, 243, 226, 0.8);
  border: 1px solid rgba(217, 85, 42, 0.16);
}

.period-kpi strong {
  display: block;
  color: var(--red);
  font-size: 18px;
}

.period-kpi span {
  color: #905040;
  font-size: 11px;
  font-weight: 800;
}

.period-sites {
  display: grid;
  gap: 6px;
  align-content: start;
}

.period-site {
  padding: 7px;
  border-radius: 7px;
  background: rgba(255, 248, 240, 0.72);
  border: 1px solid rgba(217, 85, 42, 0.14);
}

.period-site strong {
  color: #a91f18;
  font-size: 13px;
}

.period-site span {
  display: block;
  margin-top: 1px;
  color: #8c4638;
  font-size: 11px;
  font-weight: 700;
}

.route-flow {
  height: calc(100% - 28px);
  grid-template-columns: repeat(11, minmax(86px, 1fr));
  align-items: center;
}

.route-nodes-panel .route-flow {
  height: calc(100% - 38px);
}

.route-nodes-panel .route-node {
  padding: 5px 4px;
}

.route-nodes-panel .route-node span {
  font-size: 10px;
}

.route-nodes-panel .route-node em {
  font-size: 10px;
}

.route-node {
  min-width: 0;
  position: relative;
  padding: 8px 8px 7px;
  text-align: center;
  background: rgba(255, 247, 238, 0.78);
}

.route-node.is-active {
  color: #fff;
  border-color: rgba(220, 28, 25, 0.62);
  background: linear-gradient(180deg, #ff5638, #d7191c);
  box-shadow: 0 8px 16px rgba(192, 31, 18, 0.18);
}

.route-node.is-active strong,
.route-node.is-active span,
.route-node.is-active em {
  color: #fff8ef;
}

.route-node:not(:last-child)::after {
  content: "";
  position: absolute;
  left: calc(100% + 1px);
  top: 50%;
  width: 10px;
  border-top: 2px dashed var(--red);
}

.route-node strong {
  display: block;
  color: #bf2119;
  font-size: 14px;
}

.route-node span {
  display: block;
  margin-top: 2px;
  color: #7e3429;
  font-size: 11px;
  line-height: 1.25;
  font-weight: 800;
}

.route-node em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
}

@media (max-height: 900px) {
  :root {
    --gap: 8px;
  }

  .panel-title {
    margin-bottom: 7px;
  }

  .metric-label,
  .metric-unit,
  .field-label,
  .legend-row,
  .rank-row,
  .table-row {
    font-size: 11px;
  }

  .metric-value {
    font-size: 25px;
  }

  .metric-icon {
    width: 44px;
    height: 44px;
  }

  .metric-icon svg {
    width: 28px;
    height: 28px;
  }

  .filter-panel .field-stack,
  .node-filter-body {
    gap: 6px;
  }

  .select-control,
  .search-control {
    height: 28px;
    padding: 0 10px;
  }

  .filter-actions {
    margin-top: 6px;
  }

  .primary-btn,
  .ghost-btn {
    height: 32px;
  }

  .event-card {
    min-height: 52px;
    grid-template-columns: 24px 42px minmax(0, 1fr);
  }

  .event-image {
    height: 38px;
  }

  .event-text p {
    display: none;
  }

  .event-text strong {
    font-size: 12px;
  }

  .data-grid {
    grid-template-rows: minmax(0, 1fr) 118px;
  }

  .data-grid .right-data-stack {
    grid-template-rows: 1fr 150px;
  }

  .matrix-table {
    font-size: 10px;
  }

  .matrix-table th,
  .matrix-table td {
    padding: 2px 3px;
  }

  .compare-card {
    padding: 6px 8px;
  }

  .compare-head {
    font-size: 12px;
    gap: 6px;
  }

  .mini-bars {
    height: 32px;
    gap: 4px;
    padding-top: 2px;
  }

  .mini-bar {
    gap: 2px;
    font-size: 9px;
  }

  .mini-bar em {
    display: none;
  }

  .small-avatar {
    width: 20px;
    height: 20px;
  }

  .tag {
    height: 23px;
    font-size: 10px;
  }

  .tag-cloud {
    gap: 5px;
  }

  .phase-card {
    padding: 8px;
    gap: 5px;
  }

  .timeline-panel-home .phase-strip {
    gap: 7px;
  }

  .timeline-panel-home .phase-card {
    padding: 6px;
    gap: 3px;
  }

  .timeline-panel-home .phase-no {
    font-size: 18px;
  }

  .timeline-panel-home .phase-title {
    font-size: 11px;
  }

  .timeline-panel-home .phase-years,
  .timeline-panel-home .phase-count {
    font-size: 10px;
  }

  .timeline-panel-home .phase-image {
    min-height: 26px;
  }

  .timeline-panel-home .phase-image svg {
    width: 22px;
    height: 22px;
  }

  .phase-image {
    min-height: 38px;
  }

  .phase-image svg {
    width: 30px;
    height: 30px;
  }

  .person-face {
    width: 58px;
    height: 58px;
  }
}

/* page 04 */
.network-grid {
  grid-template-columns: clamp(270px, 16.6vw, 318px) minmax(540px, 1fr) clamp(360px, 23.4vw, 450px);
  grid-template-rows: minmax(0, 1fr) clamp(176px, 21.1vh, 228px);
}

.node-filter-panel { grid-column: 1; grid-row: 1; }
.graph-panel { grid-column: 2; grid-row: 1; }
.node-detail-panel { grid-column: 3; grid-row: 1 / 3; }
.influence-panel { grid-column: 1; grid-row: 2; }
.spatial-panel { grid-column: 2; grid-row: 2; }

.node-filter-body {
  height: calc(100% - 28px);
  display: grid;
  grid-auto-rows: min-content;
  align-content: start;
  gap: 9px;
  overflow: auto;
  padding-right: 2px;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.relation-chip-group {
  gap: 6px;
}

.node-chip {
  min-height: 30px;
  min-width: 62px;
  padding: 0 10px;
  border-radius: 6px;
  color: #a72b20;
  background: rgba(255, 239, 218, 0.88);
  border: 1px solid rgba(215, 86, 43, 0.24);
  font-size: 12px;
  font-weight: 900;
}

.node-chip.is-active {
  color: #fff;
  background: linear-gradient(180deg, #ff5638, #d7191c);
}

.filter-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.summary-cell {
  padding: 9px 6px;
  text-align: center;
  border-radius: 7px;
  background: rgba(255, 248, 239, 0.8);
  border: 1px solid rgba(217, 85, 42, 0.14);
}

.summary-cell strong {
  display: block;
  color: var(--red);
  font-size: 22px;
}

.summary-cell span {
  color: #8d4536;
  font-size: 11px;
  font-weight: 800;
}

.graph-canvas {
  height: calc(100% - 28px);
  position: relative;
  overflow: hidden;
  border-radius: 7px;
  background:
    radial-gradient(circle at 50% 46%, rgba(223, 30, 27, 0.1), transparent 26%),
    radial-gradient(circle at 25% 25%, rgba(244, 125, 40, 0.09), transparent 20%),
    linear-gradient(135deg, rgba(255, 250, 244, 0.5), rgba(255, 231, 206, 0.22));
}

.network-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.network-edge {
  stroke: rgba(143, 62, 45, 0.34);
  stroke-width: 1.35;
  stroke-dasharray: 0;
  opacity: 0.62;
  vector-effect: non-scaling-stroke;
}

.network-edge.core {
  stroke: rgba(223, 31, 27, 0.72);
  stroke-width: 2.15;
  opacity: 0.92;
}

.network-edge[data-relation="人物-人物"],
.network-edge[data-relation="遗址-遗址"] {
  stroke-dasharray: 4 4;
}

.network-edge[data-relation="事件-事件"],
.network-edge[data-relation="遗址-事件"],
.network-edge[data-relation="事件-遗址"] {
  stroke: rgba(244, 125, 40, 0.58);
}

.graph-node {
  position: absolute;
  width: 86px;
  min-height: 70px;
  margin: -35px 0 0 -43px;
  display: grid;
  grid-template-rows: 30px auto auto;
  justify-items: center;
  gap: 3px;
  padding: 8px 8px 7px;
  border: 1px solid rgba(255, 244, 225, 0.88);
  border-radius: 8px;
  color: #fff8ec;
  font-size: 12px;
  line-height: 1.12;
  text-align: center;
  font-weight: 900;
  background:
    radial-gradient(circle at 50% 6%, rgba(255, 247, 221, 0.46), transparent 34%),
    linear-gradient(180deg, #ff593a, #ce1518);
  box-shadow: 0 10px 18px rgba(157, 40, 22, 0.2), 0 0 0 4px rgba(255, 238, 218, 0.66);
  transition: transform 0.16s ease, opacity 0.16s ease, filter 0.16s ease, box-shadow 0.16s ease;
}

.graph-node.event {
  background: linear-gradient(180deg, #ff903e, #ef5b24);
}

.graph-node.site {
  background: linear-gradient(180deg, #2b86d7, #1557a7);
}

.graph-node.core {
  width: 110px;
  min-height: 92px;
  margin: -46px 0 0 -55px;
  grid-template-rows: 42px auto auto;
  font-size: 16px;
  box-shadow: 0 14px 26px rgba(163, 31, 19, 0.24), 0 0 0 7px rgba(255, 220, 196, 0.82), 0 0 28px rgba(223, 30, 27, 0.22);
}

.graph-node.is-selected {
  transform: scale(1.08);
  outline: 3px solid rgba(255, 209, 104, 0.92);
  z-index: 4;
}

.graph-node-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: currentColor;
  background: rgba(255, 248, 235, 0.16);
}

.graph-node.core .graph-node-icon {
  width: 42px;
  height: 42px;
}

.graph-node-icon svg {
  width: 22px;
  height: 22px;
}

.graph-node.core .graph-node-icon svg {
  width: 30px;
  height: 30px;
}

.graph-node-label,
.graph-node-meta {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.graph-node-meta {
  color: rgba(255, 248, 235, 0.82);
  font-size: 10px;
  font-weight: 800;
}

.graph-empty {
  position: absolute;
  inset: 0;
}

.influence-list {
  height: calc(100% - 28px);
  display: grid;
  gap: 7px;
}

.influence-row {
  display: grid;
  grid-template-columns: 25px 56px 1fr 34px;
  align-items: center;
  gap: 8px;
  color: #7a3025;
  font-size: 12px;
  font-weight: 800;
}

.person-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 28%, #fff4db 0 22%, #ad3a26 23% 100%);
}

.spatial-map {
  height: calc(100% - 28px);
  position: relative;
  display: grid;
  place-items: center;
}

.detail-card-body {
  height: calc(100% - 28px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 12px;
}

.node-portrait {
  height: 154px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background:
    radial-gradient(circle, rgba(255, 242, 218, 0.94), rgba(255, 207, 179, 0.35)),
    linear-gradient(135deg, rgba(223, 30, 27, 0.08), rgba(244, 125, 40, 0.1));
  border: 1px solid rgba(217, 85, 42, 0.16);
}

.node-portrait span {
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 34px;
  font-family: var(--font-display);
  font-weight: 900;
  background: radial-gradient(circle at 35% 25%, #ffddc2, #d7191c 72%);
  border: 4px solid rgba(255, 255, 255, 0.9);
}

.node-portrait.event span,
.node-portrait.site span {
  color: var(--red);
  background: rgba(255, 247, 236, 0.88);
}

.node-portrait span svg {
  width: 52px;
  height: 52px;
}

.node-detail-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.node-detail-title h3 {
  margin: 0;
  color: var(--red);
  font-size: 30px;
  font-family: var(--font-display);
  line-height: 1;
}

.node-detail-title span {
  padding: 5px 12px;
  border-radius: 16px;
  color: #fff;
  background: var(--red);
  font-size: 13px;
  font-weight: 900;
}

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

.info-row {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 10px;
  color: #743227;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 700;
}

.info-row strong {
  color: #b12118;
}

.relation-list {
  display: grid;
  gap: 7px;
}

.relation-row {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 8px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(217, 85, 42, 0.12);
  color: #7b352a;
  font-size: 12px;
  font-weight: 800;
}

.relation-row strong {
  color: #b32119;
}

/* page 05 */
.detail-grid {
  grid-template-columns: minmax(620px, 1fr) clamp(430px, 29.2vw, 560px);
  grid-template-rows: minmax(0, 1fr) clamp(172px, 20vh, 216px);
}

.site-media-panel { grid-column: 1; grid-row: 1; }
.site-side { grid-column: 2; grid-row: 1 / 3; display: grid; gap: var(--gap); grid-template-rows: clamp(222px, 25vh, 270px) clamp(135px, 15.3vh, 165px) minmax(120px, 1fr); min-height: 0; }
.site-location-panel { grid-column: 1; grid-row: 2; display: grid; grid-template-columns: clamp(290px, 18.8vw, 360px) 1fr; gap: var(--gap); padding: 0; border: 0; background: transparent; box-shadow: none; }

.site-titlebar {
  flex: 0 0 50px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}

.site-titlebar h2 {
  margin: 0;
  color: #a71212;
  font-family: var(--font-display);
  font-size: clamp(30px, 2.6vw, 44px);
  line-height: 1;
}

.detail-badges {
  margin-left: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.detail-badge {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  color: #a92b20;
  font-size: 13px;
  font-weight: 900;
  background: rgba(255, 238, 218, 0.84);
}

.video-stage {
  height: calc(100% - 88px);
  min-height: 0;
  position: relative;
  overflow: hidden;
  border-radius: 7px;
  border: 1px solid rgba(217, 85, 42, 0.2);
  background: #3c241e;
  box-shadow: 0 10px 20px rgba(117, 41, 22, 0.14);
}

.detail-crop {
  position: absolute;
  width: 156%;
  left: -3%;
  top: -80%;
  max-width: none;
  filter: saturate(1.03) contrast(1.02);
}

.video-stage::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 118px;
  background: linear-gradient(180deg, transparent, rgba(29, 17, 12, 0.82));
}

.media-source-badge {
  position: absolute;
  left: 18px;
  top: 16px;
  z-index: 2;
  max-width: min(460px, 70%);
  padding: 7px 10px;
  border-radius: 6px;
  color: #fff7e8;
  font-size: 12px;
  font-weight: 800;
  background: rgba(96, 31, 22, 0.62);
  backdrop-filter: blur(4px);
}

.play-button {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 90px;
  height: 90px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 2px solid rgba(255, 242, 206, 0.82);
  background: radial-gradient(circle at 42% 34%, rgba(255, 234, 196, 0.96), rgba(223, 30, 27, 0.88) 68%, rgba(130, 18, 18, 0.82));
  box-shadow: 0 0 0 9px rgba(255, 229, 183, 0.18), 0 10px 26px rgba(98, 29, 21, 0.3);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.play-button svg {
  width: 42px;
  height: 42px;
  color: #fff;
  transform: translateX(3px);
  opacity: 0.92;
}

.video-stage.is-playing .play-button {
  opacity: 0.42;
  transform: translate(-50%, -50%) scale(0.94);
}

.video-controls {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 22px;
  z-index: 2;
  display: grid;
  grid-template-columns: 38px 38px 42px 120px 1fr 34px 34px;
  align-items: center;
  gap: 12px;
  color: #fff;
}

.control-icon {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #fff;
  background: transparent;
}

.time-label {
  font-size: 13px;
  font-weight: 700;
}

.progress-track {
  height: 7px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.35);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 34%;
  background: linear-gradient(90deg, #ff2722, #ffb15b);
}

.basic-info {
  height: calc(100% - 30px);
  display: grid;
  gap: 8px;
  overflow: auto;
  padding-right: 2px;
}

.site-side .panel {
  padding: 14px 16px;
}

.summary-text {
  color: #733126;
  font-size: 14px;
  line-height: 1.85;
  font-weight: 700;
  margin: 0;
}

.source-link {
  display: inline-flex;
  margin-top: 8px;
  color: #bf2119;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
  border-bottom: 1px solid rgba(191, 33, 25, 0.28);
}

.person-row {
  height: calc(100% - 28px);
  grid-template-columns: repeat(3, 1fr) 30px;
  align-items: center;
  align-content: center;
}

.person-card {
  min-width: 0;
  height: 100%;
  min-height: 124px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  background: rgba(255, 245, 232, 0.7);
}

.person-face {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 28%, #fff0ce 0 23%, #7b3427 24% 100%);
  border: 2px solid #fff;
  color: #fff8ed;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  object-fit: cover;
}

.person-card strong {
  color: #8f2b21;
  font-size: 13px;
}

.person-card span {
  color: #966052;
  font-size: 11px;
  font-weight: 800;
}

.carousel-next {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: var(--red);
  border-radius: 50%;
  border: 1px solid rgba(217, 85, 42, 0.24);
  background: rgba(255, 246, 235, 0.82);
}

.location-card,
.visit-route-card {
  padding: 14px;
}

.location-body {
  height: calc(100% - 28px);
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;
  gap: 14px;
}

.location-map {
  width: 132px;
  height: 100px;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 7px;
  border: 1px solid rgba(217, 85, 42, 0.22);
  background:
    radial-gradient(circle at 72% 42%, rgba(223, 30, 27, 0.15), transparent 20%),
    linear-gradient(180deg, rgba(255, 248, 238, 0.42), rgba(255, 222, 196, 0.24));
  box-shadow: var(--inner), 0 4px 10px rgba(148, 44, 20, 0.12);
}

.location-map::after {
  display: none;
}

.mini-location-svg {
  width: 118px;
  height: 92px;
}

.mini-location-svg .city-marker text,
.mini-location-svg .map-link-layer {
  display: none;
}

.location-copy {
  display: grid;
  gap: 10px;
  color: #733126;
  font-size: 14px;
  font-weight: 800;
}

.map-button {
  width: 150px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  border-radius: 6px;
  background: linear-gradient(180deg, #ff5637, #d7191c);
  font-weight: 900;
}

.map-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.detail-badge svg,
.control-icon svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.visit-route-card .route-flow {
  grid-template-columns: repeat(6, minmax(86px, 1fr));
  grid-template-rows: auto auto;
  align-content: center;
  row-gap: 12px;
  height: calc(100% - 28px);
}

.visit-route-card .route-node:not(:last-child)::after {
  width: 8px;
}

.route-meta {
  grid-column: 1 / -1;
  align-self: end;
  color: #9f4938;
  font-size: 13px;
  font-weight: 900;
}

.is-clickable {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

@media (max-width: 0px) {
  .hero-header {
    grid-template-columns: 230px 1fr 220px;
  }

  .main-nav {
    width: calc(100% - 36px);
  }

  .metric-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    flex-basis: auto;
  }

  .metric-wide {
    grid-column: 1 / -1;
  }

  .overview-main,
  .data-grid,
  .timeline-grid,
  .network-grid,
  .detail-grid {
    grid-template-columns: 1fr;
    grid-template-rows: none;
    height: auto;
  }

  .overview-main > *,
  .data-grid > *,
  .timeline-grid > *,
  .network-grid > *,
  .detail-grid > *,
  .site-side,
  .site-location-panel {
    grid-column: auto !important;
    grid-row: auto !important;
  }

  .page-root {
    overflow: visible;
  }

  .page {
    height: auto;
  }

  .panel {
    min-height: 220px;
  }

  .home-right,
  .data-grid .right-data-stack,
  .site-side,
  .site-location-panel {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .compare-row,
  .phase-strip,
  .route-flow,
  .visit-route-card .route-flow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .route-node:not(:last-child)::after {
    display: none;
  }
}

@media (max-width: 0px) {
  .app-shell {
    min-height: auto;
    overflow: visible;
  }

  .hero-header {
    height: auto;
    min-height: 146px;
    grid-template-columns: 1fr;
    padding: 16px;
  }

  .hero-art {
    display: none;
  }

  .title-lockup {
    padding: 10px 0 50px;
  }

  .title-lockup h1 {
    font-size: 34px;
    line-height: 1.15;
  }

  .status-strip {
    left: 16px;
    right: 16px;
    bottom: 14px;
    justify-content: center;
    gap: 10px;
    font-size: 12px;
  }

  .main-nav {
    height: auto;
    grid-template-columns: 1fr;
    gap: 6px;
    margin: 8px 16px;
  }

  .nav-item + .nav-item::before {
    display: none;
  }

  .page-root {
    padding: 0 12px;
  }

  .metric-row,
  .metric-row.four,
  .detail-grid,
  .site-location-panel {
    grid-template-columns: 1fr;
  }

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

  .metric-wide {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .wide-item {
    border-left: 0;
    justify-content: flex-start;
  }

  .donut-wrap,
  .route-item,
  .location-body {
    grid-template-columns: 1fr;
  }

  .table-row {
    grid-template-columns: 30px 1fr 0.8fr;
  }

  .table-row span:nth-child(4),
  .table-row span:nth-child(5) {
    display: none;
  }

  .matrix-table {
    min-width: 560px;
  }

  .matrix-wrap {
    overflow-x: auto;
  }

  .footer-slogan {
    height: auto;
    min-height: 48px;
    padding: 10px;
    gap: 12px;
    font-size: 18px;
  }

  .footer-slogan span {
    display: none;
  }
}

/* final responsive/interaction polish */
.app-shell {
  min-width: 0;
  min-height: 0;
}

.hero-header {
  flex-basis: clamp(86px, 10.8vh, 118px);
  height: clamp(86px, 10.8vh, 118px);
  min-height: 0;
}

.main-nav {
  flex-basis: clamp(38px, 4.4vh, 46px);
  height: clamp(38px, 4.4vh, 46px);
  margin-bottom: clamp(6px, 0.8vh, 8px);
}

.nav-item {
  height: 100%;
  font-size: clamp(14px, 1.02vw, 18px);
}

.page-root {
  padding: 0 clamp(12px, 1.35vw, 26px);
}

.page {
  gap: clamp(6px, 0.9vh, 10px);
}

.panel {
  padding: clamp(8px, 1vh, 12px);
}

.panel-title {
  height: 20px;
  margin-bottom: 7px;
  font-size: clamp(13px, 0.9vw, 16px);
  line-height: 1;
}

.panel-title small {
  white-space: nowrap;
}

.metric-row {
  flex-basis: clamp(54px, 6.15vh, 70px);
  grid-template-columns: repeat(4, minmax(118px, 0.74fr)) minmax(390px, 1.52fr);
  gap: clamp(6px, 0.8vh, 10px);
}

.metric-row.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card {
  grid-template-columns: clamp(40px, 3.2vw, 56px) minmax(0, 1fr);
  padding: 6px 10px;
}

.metric-icon {
  width: clamp(36px, 3.3vw, 46px);
  height: clamp(36px, 3.3vw, 46px);
}

.metric-icon svg {
  width: 66%;
  height: 66%;
}

.metric-label {
  font-size: clamp(11px, 0.75vw, 14px);
  white-space: nowrap;
}

.metric-value {
  font-size: clamp(22px, 1.75vw, 30px);
}

.metric-unit {
  font-size: clamp(10px, 0.75vw, 14px);
  white-space: nowrap;
}

.metric-wide {
  grid-template-columns: minmax(92px, 0.95fr) repeat(3, minmax(74px, 1fr));
  gap: 6px;
  padding: 8px 12px;
}

.metric-wide .wide-title {
  grid-column: auto;
  margin: 0;
  min-width: 0;
  font-size: clamp(12px, 0.8vw, 15px);
  white-space: nowrap;
}

.wide-item {
  gap: 4px;
  border-left: 1px solid rgba(213, 90, 45, 0.24);
}

.wide-item svg {
  width: clamp(19px, 1.55vw, 26px);
  height: clamp(19px, 1.55vw, 26px);
  flex: 0 0 auto;
}

.wide-item strong {
  font-size: clamp(16px, 1.2vw, 20px);
}

.wide-item span {
  font-size: clamp(9px, 0.68vw, 11px);
  white-space: nowrap;
}

.overview-main {
  grid-template-columns: minmax(218px, 0.9fr) minmax(440px, 2.25fr) minmax(330px, 1.22fr);
  grid-template-rows: minmax(0, 1fr) clamp(150px, 18vh, 198px);
  gap: clamp(6px, 0.8vh, 10px);
}

.home-right {
  grid-template-rows: minmax(0, 0.44fr) minmax(0, 0.56fr);
}

.field-stack {
  gap: clamp(6px, 0.9vh, 10px);
}

.select-control,
.search-control {
  height: clamp(27px, 3.15vh, 32px);
  font-size: clamp(11px, 0.78vw, 13px);
}

.filter-actions {
  gap: 8px;
  margin-top: 8px;
}

.primary-btn,
.ghost-btn {
  height: clamp(30px, 3.4vh, 38px);
  font-size: clamp(11px, 0.8vw, 14px);
}

.map-wrap {
  min-height: 0;
  height: calc(100% - 28px);
}

.drawn-map-stage {
  position: relative;
  z-index: 2;
  width: min(80%, 760px);
  height: calc(100% - 8px);
  min-height: 0;
}

.home-map .drawn-map-stage {
  width: min(86%, 860px);
}

.route-map-panel .drawn-map-stage {
  width: min(88%, 920px);
}

.map-wrap.compact .drawn-map-stage,
.mini-map-card .drawn-map-stage,
.location-map .drawn-map-stage,
.spatial-mini-map .drawn-map-stage {
  width: 100%;
  height: 100%;
}

.drawn-map-stage > .drawn-map-svg,
.drawn-map-svg {
  width: 100%;
  height: 100%;
  max-width: none;
  overflow: visible;
}

.china-context-layer {
  opacity: 0.56;
  pointer-events: none;
}

.china-context-shape {
  fill: rgba(242, 122, 72, 0.12);
  stroke: rgba(161, 52, 34, 0.36);
  stroke-width: 0.42;
  vector-effect: non-scaling-stroke;
}

.china-context-river {
  fill: none;
  stroke: rgba(55, 135, 184, 0.36);
  stroke-width: 0.35;
  stroke-dasharray: 1.2 1.1;
}

.china-context-layer text {
  fill: rgba(127, 52, 40, 0.8);
  font-size: 2.8px;
  font-weight: 800;
}

.prefecture-shape {
  stroke-width: 0.18;
}

.prefecture-shape:hover,
.prefecture-shape.is-selected {
  stroke-width: 0.42;
}

.city-marker {
  transition: opacity 0.16s ease, filter 0.16s ease;
}

.city-marker:hover,
.city-marker.is-hot {
  filter: drop-shadow(0 0 2px rgba(223, 30, 27, 0.5));
}

.city-marker text {
  font-size: clamp(2.8px, 0.22vw, 3.4px);
}

.map-link {
  stroke-width: 0.28;
}

.site-dot {
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  z-index: 4;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid rgba(255, 250, 235, 0.94);
  background: rgba(181, 24, 22, 0.82);
  box-shadow: 0 0 0 2px rgba(255, 205, 150, 0.24);
  transition: opacity 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.site-dot span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: radial-gradient(circle at 35% 30%, #fff7df 0 24%, transparent 25%);
  pointer-events: none;
}

.site-dot:hover,
.site-dot.is-selected {
  z-index: 5;
  background: #e81818;
  box-shadow: 0 0 0 4px rgba(255, 203, 105, 0.34), 0 0 12px rgba(223, 30, 27, 0.36);
}

.site-dot.is-highlighted {
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  background: #e91619;
  box-shadow: 0 0 0 4px rgba(255, 202, 90, 0.36), 0 0 14px rgba(223, 30, 27, 0.46);
}

.site-dot.is-muted {
  opacity: 0.22;
}

.map-tools {
  right: 10px;
  top: 34px;
  gap: 6px;
}

.map-tool {
  width: 28px;
  height: 28px;
  font-size: 15px;
  line-height: 1;
}

.map-legend {
  left: 10px;
  bottom: 10px;
  gap: 5px;
  padding: 8px;
  font-size: 11px;
}

.legend-dot.big {
  width: 13px;
  height: 13px;
}

.legend-dot.pale {
  background: #fff0c9;
  border: 1px solid #df1e1b;
}

.period-highlight-note {
  color: #c01816;
  font-weight: 900;
  white-space: nowrap;
}

.map-attribution {
  color: #9a5b4e;
  font-size: 9px;
  line-height: 1.25;
  text-decoration: none;
}

.map-attribution:hover {
  color: var(--red);
  text-decoration: underline;
}

.mini-map-card {
  right: 10px;
  bottom: 10px;
  width: 118px;
  height: 82px;
  display: grid;
  grid-template-rows: 1fr auto;
  align-items: center;
  padding: 5px 7px;
  font-size: 10px;
}

.mini-map-card .drawn-map-stage {
  min-height: 0;
}

.mini-context-svg .city-marker text,
.mini-context-svg .map-link-layer,
.mini-context-svg .route-layer {
  display: none;
}

.mini-context-svg .marker-core {
  fill: #d7191c;
  stroke-width: 0.4;
}

.mini-map-card .site-dot,
.location-map .site-dot,
.spatial-mini-map .site-dot {
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  box-shadow: 0 0 0 2px rgba(255, 205, 150, 0.24);
}

.mini-context-svg .prefecture-shape {
  stroke-width: 0.12;
}

.rank-list,
.table-list,
.basic-info,
.event-list,
.period-detail,
.influence-list,
.relation-list,
.route-list,
.city-chip-list,
.route-modal-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(202, 51, 29, 0.42) rgba(255, 242, 224, 0.64);
}

.rank-list::-webkit-scrollbar,
.table-list::-webkit-scrollbar,
.basic-info::-webkit-scrollbar,
.event-list::-webkit-scrollbar,
.period-detail::-webkit-scrollbar,
.influence-list::-webkit-scrollbar,
.relation-list::-webkit-scrollbar,
.route-list::-webkit-scrollbar,
.city-chip-list::-webkit-scrollbar,
.route-modal-list::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.rank-list::-webkit-scrollbar-thumb,
.table-list::-webkit-scrollbar-thumb,
.basic-info::-webkit-scrollbar-thumb,
.event-list::-webkit-scrollbar-thumb,
.period-detail::-webkit-scrollbar-thumb,
.influence-list::-webkit-scrollbar-thumb,
.relation-list::-webkit-scrollbar-thumb,
.route-list::-webkit-scrollbar-thumb,
.city-chip-list::-webkit-scrollbar-thumb,
.route-modal-list::-webkit-scrollbar-thumb {
  background: rgba(202, 51, 29, 0.42);
  border-radius: 8px;
}

.donut-wrap {
  grid-template-columns: minmax(102px, 0.8fr) minmax(128px, 1.2fr);
  gap: 6px;
}

.type-panel .donut-wrap {
  grid-template-columns: 104px minmax(0, 1fr);
  height: calc(100% - 27px);
  overflow-y: auto;
  padding-right: 2px;
}

.donut {
  width: min(122px, 100%);
}

.legend-list {
  gap: 5px;
}

.legend-row {
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 6px;
  font-size: clamp(10px, 0.72vw, 12px);
}

.legend-row span:nth-child(2) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.route-toolbar {
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -2px 0 5px;
  color: #9b3f31;
  font-size: 11px;
  font-weight: 900;
}

.link-btn {
  height: 22px;
  padding: 0 9px;
  border-radius: 5px;
  color: #fff;
  background: linear-gradient(180deg, #ef5032, #d7191c);
  font-size: 11px;
  font-weight: 900;
}

.routes-panel-home .route-list {
  height: calc(100% - 50px);
  grid-template-rows: none;
  grid-auto-rows: minmax(42px, max-content);
  overflow-y: auto;
  padding-right: 3px;
}

.route-item:nth-child(1) .route-thumb { background-image: url("./assets/media/sites/hunan-first-normal.jpg"); background-size: cover; background-position: center; }
.route-item:nth-child(2) .route-thumb { background-image: url("./assets/media/sites/hunan-first-normal.jpg"); background-size: cover; background-position: 52% 45%; }
.route-item:nth-child(3) .route-thumb { background-image: url("./assets/refs/detail.jpg"); background-size: cover; background-position: center; }
.route-item:nth-child(4) .route-thumb { background-image: url("./assets/media/video/hunan-firstnormal-poster.jpg"); background-size: cover; background-position: center; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 28px;
  background: rgba(89, 25, 17, 0.28);
  backdrop-filter: blur(5px);
}

.route-modal {
  width: min(980px, 92vw);
  max-height: min(760px, 86vh);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid rgba(215, 87, 39, 0.28);
  border-radius: 8px;
  background: rgba(255, 247, 236, 0.97);
  box-shadow: 0 20px 50px rgba(91, 28, 18, 0.26);
  overflow: hidden;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px 10px;
  color: #a51615;
}

.modal-head h3 {
  margin: 0;
  font-size: 20px;
}

.close-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  color: #fff;
  background: #d7191c;
  font-size: 22px;
  line-height: 1;
}

.route-modal-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  overflow: auto;
  padding: 8px 18px 18px;
}

.route-modal-card {
  min-width: 0;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid color-mix(in srgb, var(--route-color) 34%, transparent);
  background: rgba(255, 251, 244, 0.78);
}

.route-modal-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: var(--route-color);
}

.route-modal-title strong {
  font-size: 16px;
}

.route-modal-title span,
.route-modal-cities,
.route-modal-card p,
.route-modal-card li {
  color: #7e3429;
  font-size: 12px;
  line-height: 1.55;
  font-weight: 750;
}

.route-modal-cities {
  margin-top: 5px;
  color: #a54835;
}

.route-modal-card ol {
  margin: 8px 0 0;
  padding-left: 20px;
}

.route-modal-card p {
  margin: 8px 0 0;
}

.tag-summary {
  height: 22px;
  color: #8b4033;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-panel .tag-cloud {
  height: calc(100% - 52px);
  overflow-y: auto;
  padding-right: 2px;
}

.tag {
  height: 25px;
  font-size: 11px;
}

.timeline-grid {
  grid-template-columns: minmax(230px, 0.75fr) minmax(520px, 1.8fr) minmax(300px, 0.95fr);
  grid-template-rows: minmax(0, 1fr) clamp(124px, 14.2vh, 158px);
  gap: clamp(6px, 0.8vh, 10px);
}

.event-list-panel { grid-column: 1; grid-row: 1 / 3; }
.period-main-panel { display: none; }
.route-map-panel { grid-column: 2; grid-row: 1; }
.period-detail-panel { grid-column: 3; grid-row: 1; }
.route-nodes-panel { grid-column: 2 / 4; grid-row: 2; }

.event-list {
  height: calc(100% - 27px);
  overflow-y: auto;
}

.event-card {
  grid-template-columns: 24px 48px minmax(0, 1fr);
  min-height: 62px;
  width: 100%;
  text-align: left;
}

.event-text strong {
  font-size: 12px;
}

.event-text span,
.event-text p {
  font-size: 10px;
}

.event-text p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.route-map-wrap {
  height: calc(100% - 27px);
}

.route-map-wrap .mini-map-card {
  width: 126px;
  height: 86px;
}

.period-detail {
  height: calc(100% - 27px);
  overflow-y: auto;
  grid-template-rows: auto auto auto auto;
  padding-right: 3px;
}

.period-hero {
  grid-template-columns: 48px minmax(0, 1fr);
  padding: 8px;
}

.period-emblem {
  height: 46px;
}

.period-emblem svg {
  width: 30px;
  height: 30px;
}

.period-detail h3 {
  font-size: 15px;
}

.period-detail .years,
.period-detail p,
.period-site strong,
.period-site span {
  font-size: 11px;
}

.period-kpis {
  gap: 5px;
}

.period-kpi {
  padding: 5px;
}

.route-nodes-panel .route-flow {
  height: calc(100% - 27px);
  grid-template-columns: repeat(11, minmax(78px, 1fr));
  overflow-x: auto;
  padding: 0 3px 4px;
}

.route-nodes-panel .route-node {
  min-width: 78px;
}

.network-grid {
  grid-template-columns: minmax(240px, 0.78fr) minmax(520px, 1.72fr) minmax(300px, 0.95fr);
  grid-template-rows: minmax(0, 1fr) clamp(168px, 19vh, 222px);
  gap: clamp(6px, 0.8vh, 10px);
}

.node-filter-panel { grid-column: 1; grid-row: 1; }
.graph-panel { grid-column: 2; grid-row: 1; }
.node-detail-panel { grid-column: 3; grid-row: 1 / 3; }
.influence-panel { grid-column: 1; grid-row: 2; }
.spatial-panel { grid-column: 2; grid-row: 2; }

.node-filter-body {
  height: calc(100% - 27px);
  gap: 7px;
  overflow-y: auto;
}

.chip-group {
  gap: 5px;
}

.node-chip {
  min-height: 26px;
  min-width: 52px;
  padding: 0 8px;
  font-size: 11px;
}

.filter-summary {
  gap: 5px;
}

.summary-cell {
  padding: 6px 4px;
}

.summary-cell strong {
  font-size: 18px;
}

.graph-canvas {
  height: calc(100% - 27px);
  overflow: hidden;
}

.graph-node {
  width: 46px;
  min-height: 39px;
  margin: -19.5px 0 0 -23px;
  grid-template-rows: 17px auto;
  gap: 2px;
  padding: 3px 3px 2px;
  border-radius: 6px;
  font-size: 8.5px;
  box-shadow: 0 5px 10px rgba(157, 40, 22, 0.14), 0 0 0 2px rgba(255, 238, 218, 0.62);
}

.graph-node.core {
  width: 66px;
  min-height: 56px;
  margin: -28px 0 0 -33px;
  grid-template-rows: 27px auto;
  font-size: 11px;
  box-shadow: 0 9px 18px rgba(163, 31, 19, 0.2), 0 0 0 4px rgba(255, 220, 196, 0.72);
}

.graph-node.is-selected {
  transform: scale(1.04);
}

.graph-node-icon {
  width: 17px;
  height: 17px;
  overflow: hidden;
}

.graph-node.core .graph-node-icon {
  width: 27px;
  height: 27px;
}

.graph-node-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.graph-node-icon svg {
  width: 13px;
  height: 13px;
}

.graph-node.core .graph-node-icon svg {
  width: 18px;
  height: 18px;
}

.graph-node-label {
  max-width: 100%;
  line-height: 1.08;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.graph-node-meta {
  display: none;
  font-size: 8px;
}

.influence-list {
  height: calc(100% - 27px);
  overflow-y: auto;
  align-content: start;
  padding-right: 3px;
}

.influence-row {
  min-height: 20px;
  grid-template-columns: 22px 58px minmax(0, 1fr) 30px;
  gap: 6px;
}

.detail-card-body {
  height: calc(100% - 27px);
  grid-template-rows: auto auto minmax(118px, auto) minmax(0, 1fr);
  gap: 8px;
  overflow-y: auto;
  padding-right: 3px;
}

.node-portrait {
  height: clamp(98px, 16vh, 142px);
  overflow: hidden;
}

.node-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 26%;
}

.node-portrait span {
  width: 82px;
  height: 82px;
  font-size: 28px;
}

.node-detail-title h3 {
  font-family: var(--font-ui);
  font-size: clamp(20px, 1.65vw, 28px);
}

.info-grid {
  gap: 6px;
}

.info-row {
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 8px;
  font-size: clamp(11px, 0.78vw, 13px);
}

.info-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.relation-list {
  overflow-y: auto;
  align-content: start;
}

.relation-row {
  width: 100%;
  text-align: left;
  background: transparent;
  grid-template-columns: 70px minmax(0, 1fr);
}

.spatial-linkage {
  height: calc(100% - 27px);
  display: grid;
  grid-template-columns: minmax(160px, 0.72fr) minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
}

.spatial-mini-map {
  min-height: 0;
  border-radius: 7px;
  border: 1px solid rgba(215, 87, 39, 0.2);
  background: rgba(255, 247, 236, 0.62);
  overflow: hidden;
}

.spatial-mini-svg .city-marker text,
.spatial-mini-svg .map-link-layer {
  display: none;
}

.city-chip-list {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  overflow-y: auto;
  align-content: start;
}

.city-chip {
  min-width: 0;
  min-height: 42px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 7px;
  border: 1px solid rgba(215, 87, 39, 0.18);
  background: rgba(255, 248, 239, 0.74);
  text-align: left;
}

.city-chip strong {
  color: #a21f18;
  font-size: 13px;
}

.city-chip span {
  color: #8b4739;
  font-size: 10px;
  font-weight: 800;
}

.detail-grid {
  grid-template-columns: minmax(470px, 1.3fr) minmax(270px, 0.75fr) minmax(300px, 0.82fr);
  grid-template-rows: minmax(0, 1fr) clamp(160px, 19vh, 208px);
  gap: clamp(6px, 0.8vh, 10px);
}

.site-media-panel { grid-column: 1 / 3; grid-row: 1; }
.site-info-panel { grid-column: 3; grid-row: 1; }
.location-card { grid-column: 1; grid-row: 2; }
.visit-route-card { grid-column: 2; grid-row: 2; }
.related-people-panel { grid-column: 3; grid-row: 2; }
.site-side,
.site-location-panel { display: contents; }

.site-titlebar {
  height: 44px;
  flex-basis: 44px;
  margin-bottom: 7px;
  gap: 10px;
}

.site-titlebar h2 {
  min-width: 0;
  font-family: var(--font-ui);
  font-size: clamp(20px, 1.8vw, 34px);
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-select {
  width: min(310px, 28vw);
  flex: 0 0 auto;
}

.detail-badges {
  flex: 0 1 auto;
  gap: 6px;
}

.detail-badge {
  min-height: 28px;
  padding: 0 9px;
  font-size: 11px;
  white-space: nowrap;
}

.video-stage {
  height: calc(100% - 51px);
}

.video-frame {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  border: 0;
  background: #2c1b16;
}

.video-element {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: block;
  background: #211310;
  object-fit: contain;
}

.video-poster {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.36;
}

.video-stage::after {
  height: 56px;
  z-index: 2;
  pointer-events: none;
}

.video-stage:has(.video-element)::after {
  display: none;
}

.detail-crop {
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  object-position: center;
  position: absolute;
  background: #2d1a16;
}

.media-source-badge {
  z-index: 3;
  max-width: calc(100% - 34px);
  font-size: 11px;
  pointer-events: none;
}

.video-stage.has-gallery .detail-crop,
.video-stage.has-gallery .video-element {
  bottom: 52px;
  height: calc(100% - 52px);
}

.video-stage.has-gallery .media-source-badge {
  bottom: auto;
}

.media-thumb-strip {
  position: absolute;
  z-index: 4;
  right: 8px;
  bottom: 7px;
  left: 8px;
  height: 39px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px;
  background: rgba(37, 20, 16, 0.72);
  border-radius: 5px;
}

.media-thumb {
  width: 48px;
  height: 33px;
  flex: 0 0 48px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 240, 218, 0.7);
  border-radius: 3px;
  background: #2d1a16;
}

.media-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.media-thumb-video {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 14px 1fr;
  place-items: center;
  gap: 2px;
  padding: 0 4px;
  color: #fff7e8;
  background: linear-gradient(145deg, #7f1715, #d52b24);
}

.media-thumb-video svg {
  width: 13px;
  height: 13px;
}

.media-thumb-video b {
  font-size: 9px;
  letter-spacing: 0;
}

.media-thumb.is-active {
  border-color: #ffb15b;
  box-shadow: 0 0 0 2px rgba(207, 31, 25, 0.85);
}

.site-info-panel .merged-info {
  height: calc(100% - 27px);
  grid-auto-rows: min-content;
  overflow-y: auto;
}

.summary-row {
  align-items: start;
}

.summary-row span {
  line-height: 1.55;
}

.source-link {
  font-size: 11px;
}

.location-body {
  height: calc(100% - 27px);
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 10px;
  min-height: 0;
}

.location-map {
  width: 112px;
  height: 92px;
}

.mini-location-svg {
  width: 100%;
  height: 100%;
}

.location-copy {
  min-width: 0;
  gap: 7px;
  font-size: clamp(11px, 0.78vw, 13px);
}

.location-copy span {
  overflow-wrap: anywhere;
}

.map-button {
  width: 128px;
  height: 32px;
  font-size: 12px;
}

.visit-route-card {
  overflow: hidden;
}

.detail-route-head {
  height: 30px;
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: #a52119;
  font-size: 12px;
  font-weight: 900;
}

.detail-route-head span {
  color: #8c493a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.visit-route-card .route-flow {
  height: calc(100% - 58px);
  grid-template-columns: repeat(4, minmax(88px, 1fr));
  grid-auto-rows: minmax(48px, auto);
  overflow: auto;
  align-content: start;
  padding-right: 3px;
}

.visit-route-card .route-node {
  min-width: 88px;
  padding: 6px 5px;
}

.visit-route-card .route-node:not(:last-child)::after {
  display: none;
}

.route-meta {
  font-size: 11px;
  line-height: 1.35;
}

.related-people-panel .person-row {
  height: calc(100% - 27px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  overflow-x: auto;
}

.related-people-panel .person-card {
  min-width: 78px;
  min-height: 0;
  height: 100%;
  gap: 4px;
  padding: 6px 4px;
}

.related-people-panel .person-face {
  width: clamp(42px, 3.3vw, 56px);
  height: clamp(42px, 3.3vw, 56px);
  font-size: 18px;
}

.related-people-panel .person-card strong {
  font-size: 12px;
  white-space: nowrap;
}

.related-people-panel .person-card span {
  max-width: 100%;
  font-size: 10px;
  line-height: 1.25;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-height: 760px) {
  :root {
    --gap: 6px;
  }

  .hero-header {
    flex-basis: 70px;
    height: 70px;
    min-height: 70px;
  }

  .main-nav {
    flex-basis: 34px;
    height: 34px;
    padding: 4px;
    margin-bottom: 6px;
  }

  .nav-item {
    height: 26px;
    font-size: 13px;
  }

  .status-strip {
    left: 28px;
    bottom: 6px;
    padding: 5px 8px;
    font-size: 10px;
    gap: 7px;
  }

  .footer-slogan {
    flex-basis: 0;
    height: 0;
    min-height: 0;
    max-height: 0;
    overflow: hidden;
  }

  .page-root {
    padding-bottom: 24px;
  }

  .metric-row {
    flex-basis: 48px;
  }

  .metric-card {
    padding: 5px 8px;
  }

  .metric-icon {
    width: 34px;
    height: 34px;
  }

  .metric-value {
    font-size: 20px;
  }

  .overview-main {
    grid-template-rows: minmax(0, 1fr) 146px;
  }

  .home-map .drawn-map-stage {
    width: min(76%, 760px);
  }

  .type-panel .donut-wrap {
    grid-template-columns: 86px minmax(0, 1fr);
  }

  .type-panel .donut {
    width: 86px;
  }

  .type-panel .legend-row {
    font-size: 10px;
    gap: 5px;
  }

  .timeline-panel-home .phase-strip {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
  }

  .timeline-panel-home .phase-card {
    min-width: 112px;
    grid-template-rows: auto auto auto;
    align-content: center;
  }

  .timeline-panel-home .phase-image {
    display: none;
  }

  .timeline-grid {
    grid-template-rows: minmax(0, 1fr) 120px;
  }

  .detail-grid {
    grid-template-rows: minmax(0, 1fr) 148px;
  }

  .route-line {
    display: none;
  }

  .routes-panel-home .route-item {
    grid-template-columns: 36px minmax(0, 1fr);
  }
}

/* 2026-08-30 interaction and map accuracy pass */
.metric-row.equal-five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric-row.equal-five .metric-card {
  min-width: 0;
}

.home-map .drawn-map-stage,
.route-map-panel .drawn-map-stage {
  width: 100%;
  height: 100%;
}

.drawn-map-svg {
  overflow: hidden;
}

.site-marker {
  cursor: pointer;
  outline: none;
  transition: opacity 0.16s ease, filter 0.16s ease;
}

.site-marker-core {
  fill: rgba(190, 28, 24, 0.92);
  stroke: rgba(255, 250, 235, 0.98);
  stroke-width: 0.18;
  vector-effect: non-scaling-stroke;
}

.site-marker-halo {
  fill: rgba(255, 189, 105, 0.22);
  stroke: rgba(220, 42, 27, 0.26);
  stroke-width: 0.12;
  vector-effect: non-scaling-stroke;
}

.site-marker:hover,
.site-marker:focus-visible,
.site-marker.is-selected {
  filter: drop-shadow(0 0 1.6px rgba(210, 25, 21, 0.72));
}

.site-marker:hover .site-marker-core,
.site-marker:focus-visible .site-marker-core,
.site-marker.is-selected .site-marker-core {
  fill: #f01919;
  stroke-width: 0.3;
}

.site-marker.is-highlighted .site-marker-core {
  fill: #e91619;
  stroke: #fff4bf;
  stroke-width: 0.36;
}

.site-marker.is-muted {
  opacity: 0.18;
}

.site-marker text {
  fill: #7e251e;
  font-family: var(--font-ui);
  font-weight: 900;
  paint-order: stroke;
  stroke: rgba(255, 246, 231, 0.96);
  stroke-width: 0.24px;
  stroke-linejoin: round;
  pointer-events: none;
}

.is-city-view .prefecture-shape:not(.is-selected) {
  opacity: 0.2;
}

.county-layer,
.county-label-layer {
  pointer-events: none;
}

.county-shape {
  fill: rgba(255, 243, 221, 0.08);
  stroke: rgba(112, 35, 29, 0.58);
  stroke-width: 0.28;
  vector-effect: non-scaling-stroke;
}

.county-label-layer text {
  fill: #70251f;
  font-family: var(--font-ui);
  font-weight: 800;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(255, 247, 231, 0.92);
  stroke-width: 0.2px;
}

.china-map-stage {
  width: 100%;
  height: 100%;
}

.china-province {
  fill: rgba(235, 91, 47, 0.16);
  stroke: rgba(164, 48, 32, 0.54);
  stroke-width: 0.24;
  vector-effect: non-scaling-stroke;
  transition: fill 0.16s ease, stroke 0.16s ease;
}

.china-province:hover {
  fill: rgba(231, 71, 35, 0.28);
  stroke: #b92c20;
}

.china-province.is-hunan {
  fill: rgba(211, 24, 22, 0.84);
  stroke: #9e1714;
  stroke-width: 0.58;
}

.china-province-label {
  fill: #7d3028;
  font-family: var(--font-ui);
  font-size: 2.05px;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: middle;
  paint-order: stroke;
  stroke: rgba(255, 247, 233, 0.92);
  stroke-width: 0.22px;
  pointer-events: none;
}

.china-view-note {
  position: absolute;
  left: 12px;
  bottom: 10px;
  z-index: 6;
  padding: 7px 10px;
  border: 1px solid rgba(202, 68, 39, 0.24);
  border-radius: 6px;
  color: #8f2e25;
  background: rgba(255, 248, 237, 0.9);
  font-size: 11px;
  font-weight: 850;
}

.map-wrap.is-expanded,
.route-map-wrap.is-expanded {
  position: fixed;
  inset: clamp(78px, 11.2vh, 128px) 12px 34px;
  z-index: 80;
  height: auto;
  padding: 8px;
  border: 1px solid rgba(204, 66, 34, 0.38);
  border-radius: 8px;
  background: rgba(255, 246, 232, 0.98);
  box-shadow: 0 18px 48px rgba(106, 24, 18, 0.24);
}

.map-wrap.is-expanded .drawn-map-stage,
.route-map-wrap.is-expanded .drawn-map-stage {
  width: 100%;
  height: 100%;
}

.map-loading {
  height: 100%;
  display: grid;
  place-items: center;
  color: #963a2e;
  font-size: 12px;
  font-weight: 800;
}

.site-table-panel .table-list {
  height: calc(100% - 27px);
  display: block;
  overflow-y: auto;
}

.site-table-panel .table-row {
  height: 25px;
  min-height: 25px;
  display: grid;
}

.site-table-panel .table-row > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-table-panel .table-row:first-child {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(255, 240, 220, 0.98);
}

.type-panel .donut-wrap {
  height: calc(100% - 27px);
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  padding: 1px 4px;
  overflow: hidden;
}

.type-panel .donut {
  width: 68px;
  height: 68px;
}

.type-panel .legend-list {
  gap: 2px;
}

.type-panel .legend-row {
  min-height: 12px;
  gap: 5px;
  font-size: 9px;
  line-height: 1.15;
}

.map-tools {
  position: absolute;
  z-index: 12;
}

.map-legend,
.mini-map-card,
.route-legend,
.china-view-note {
  z-index: 10;
}

.routes-panel-home .route-item {
  min-height: 54px;
  padding: 7px 9px;
  gap: 8px;
  overflow: hidden;
}

.routes-panel-home .route-text {
  min-width: 0;
  padding-right: 4px;
}

.routes-panel-home .route-text strong,
.routes-panel-home .route-text span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-panel .tag-cloud {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: 6px;
}

.tag-panel .tag {
  width: auto;
  min-width: 0;
  flex: 0 0 auto;
  padding: 0 10px;
  white-space: nowrap;
}

.event-card {
  grid-template-columns: 22px 38px minmax(0, 1fr);
  min-height: 74px;
  align-items: center;
  gap: 6px;
  padding: 6px 7px;
  overflow: hidden;
}

.event-image {
  width: 36px;
  height: 36px;
}

.event-text {
  min-width: 0;
  align-self: stretch;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  align-content: center;
  gap: 1px;
  overflow: hidden;
}

.event-text strong,
.event-text span,
.event-text p {
  min-width: 0;
  max-width: 100%;
}

.event-text strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-text p {
  margin: 0;
  line-height: 1.35;
}

.route-map-wrap .route-legend {
  left: 10px;
  top: auto;
  bottom: 10px;
  min-width: 122px;
  max-width: 150px;
  padding: 7px 8px;
  gap: 3px;
  border-radius: 6px;
  font-size: 9px;
  line-height: 1.2;
}

.route-map-wrap .route-legend .legend-title {
  margin-bottom: 1px;
  font-size: 10px;
}

.route-map-wrap .route-legend .legend-dot {
  width: 8px;
  height: 3px;
  margin-right: 5px;
  border-radius: 0;
}

.route-mini-map {
  width: 112px !important;
  height: 76px !important;
}

.route-nodes-panel .route-node {
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: 27px 3px 3px;
}

.route-nodes-panel .route-node strong {
  font-size: 11px;
  line-height: 1.1;
}

.route-nodes-panel .route-node > span:not(.route-stage) {
  margin-top: 0;
  overflow: hidden;
  font-size: 7px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-nodes-panel .route-node em {
  margin-top: 0;
  font-size: 8px;
  line-height: 1.1;
}

.route-stage {
  position: absolute;
  inset: 4px 4px auto;
  height: 21px;
  overflow: hidden;
  color: #a22c22;
  background: rgba(239, 125, 74, 0.12);
  border-radius: 3px;
  font-size: 7px !important;
  font-weight: 850;
  line-height: 9px;
  white-space: normal;
  display: grid !important;
  place-items: center;
}

.node-portrait {
  position: relative;
  display: grid;
  place-items: center;
  padding: 5px;
  background: rgba(255, 243, 226, 0.82);
}

.node-portrait.person {
  width: min(100%, clamp(126px, 13vw, 176px));
  height: auto;
  aspect-ratio: 3 / 4;
  justify-self: center;
}

.node-portrait.person img {
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  height: calc(100% - 10px);
  max-width: 100%;
  max-height: calc(100% - 10px);
  aspect-ratio: 3 / 4;
  object-fit: contain;
  object-position: center;
}

.node-portrait.event,
.node-portrait.site {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
}

.node-portrait.site img,
.node-portrait.event img {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  object-position: center;
}

.node-detail-panel {
  overflow-y: auto;
}

.node-detail-panel .detail-card-body {
  height: auto;
  min-height: 100%;
  grid-template-rows: auto auto auto auto;
}

.site-titlebar {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(220px, 310px) max-content;
  align-items: center;
}

.site-titlebar h2 {
  max-height: 2.15em;
  white-space: normal;
  line-height: 1.05;
  overflow: hidden;
}

.site-titlebar.has-long-title h2 {
  font-size: clamp(16px, 1.25vw, 23px);
}

.site-titlebar.has-very-long-title h2 {
  font-size: clamp(13px, 1vw, 18px);
}

.site-titlebar .site-select {
  width: 100%;
  min-width: 0;
}

.site-titlebar .detail-badges {
  min-width: max-content;
  flex-wrap: nowrap;
  justify-content: flex-end;
}

.city-focus-card {
  grid-column: 1 / -1;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(207, 66, 35, 0.24);
  border-radius: 7px;
  background: rgba(255, 248, 238, 0.82);
}

.city-focus-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.city-focus-head strong {
  color: #a11f18;
  font-size: 17px;
}

.city-focus-head button {
  padding: 4px 7px;
  border: 1px solid rgba(205, 55, 31, 0.28);
  border-radius: 5px;
  color: #a62b20;
  background: rgba(255, 244, 229, 0.9);
  font-size: 10px;
  font-weight: 800;
}

.city-focus-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.city-focus-kpis span {
  display: grid;
  place-items: center;
  padding: 5px 2px;
  border-radius: 5px;
  background: rgba(232, 87, 48, 0.1);
  color: #8d4438;
  font-size: 9px;
  font-weight: 800;
}

.city-focus-kpis b {
  color: #c32b20;
  font-size: 15px;
}

.city-focus-card p {
  margin: 0;
  color: #855044;
  font-size: 10px;
  line-height: 1.45;
  font-weight: 700;
}

.detail-grid {
  grid-template-columns: minmax(290px, 0.72fr) minmax(500px, 1.5fr) minmax(280px, 0.82fr);
}

.media-missing-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 24px;
  color: #9a493b;
  background: linear-gradient(145deg, rgba(255, 242, 222, 0.86), rgba(248, 210, 182, 0.48));
  text-align: center;
}

.media-missing-state svg {
  width: 52px;
  height: 52px;
  color: #cd4b35;
}

.media-missing-state strong {
  font-size: 16px;
}

.media-missing-state span {
  font-size: 11px;
  line-height: 1.5;
}

.video-play-overlay {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 4;
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  border: 1px solid rgba(255, 240, 215, 0.8);
  border-radius: 50%;
  color: #fff;
  background: rgba(169, 37, 25, 0.82);
  box-shadow: 0 10px 26px rgba(66, 18, 14, 0.26);
  font-size: 11px;
  font-weight: 800;
  backdrop-filter: blur(3px);
}

.video-play-overlay[hidden] {
  display: none !important;
}

.video-play-overlay svg {
  width: 28px;
  height: 28px;
}

.video-play-overlay.is-error {
  width: min(260px, 70%);
  height: auto;
  min-height: 64px;
  padding: 10px;
  border-radius: 7px;
}

.location-body {
  grid-template-columns: 102px minmax(0, 1fr);
}

.location-map {
  width: 98px;
  height: 82px;
}

.visit-route-card {
  overflow: hidden;
}

.detail-route-list {
  height: calc(100% - 27px);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(330px, 0.92fr);
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 1px 3px 4px 0;
}

.detail-route-option {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 5px;
  padding: 7px 8px;
  border: 1px solid color-mix(in srgb, var(--route-color) 30%, transparent);
  border-radius: 6px;
  background: rgba(255, 249, 239, 0.76);
  overflow: hidden;
}

.detail-route-option .detail-route-head {
  height: 22px;
  color: var(--route-color);
}

.detail-route-stops {
  min-height: 0;
  display: flex;
  gap: 5px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.detail-route-stops button {
  min-width: 92px;
  max-width: 112px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 5px;
  border: 1px solid rgba(205, 73, 42, 0.18);
  border-radius: 5px;
  background: rgba(255, 246, 233, 0.9);
  text-align: center;
}

.detail-route-stops b {
  color: var(--route-color);
  font-size: 10px;
}

.detail-route-stops span {
  color: #7d372e;
  font-size: 9px;
  line-height: 1.25;
  font-weight: 800;
}

.detail-route-option p {
  margin: 0;
  color: #855044;
  font-size: 9px;
  line-height: 1.35;
  font-weight: 700;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

@media (max-width: 1050px) {
  .detail-grid {
    grid-template-columns: minmax(250px, 0.72fr) minmax(430px, 1.45fr) minmax(250px, 0.8fr);
  }
}
