:root {
  --page: #ffffff;
  --surface: #ffffff;
  --surface-alt: #f5f8fc;
  --text: #17212b;
  --muted: #5e6b76;
  --line: #d7dee3;
  --brand: #165dba;
  --brand-strong: #0e458e;
  --active: #b42318;
  --active-bg: #feeceb;
  --resolved: #18794e;
  --resolved-bg: #e6f6ee;
  --unknown: #8a4b08;
  --unknown-bg: #fff2d8;
  --focus: #f2b84b;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: var(--text);
  background: var(--page);
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--text);
  font-size: 17px;
  line-height: 1.65;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  color: var(--brand-strong);
  text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

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

h1 {
  margin-bottom: 12px;
  font-size: 28px;
  line-height: 1.25;
}

h2 {
  margin-bottom: 12px;
  font-size: 21px;
  line-height: 1.3;
}

h3 {
  margin-bottom: 8px;
  font-size: 17px;
  line-height: 1.4;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.content-width {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.content-width.narrow {
  max-width: 860px;
}

.site-header {
  position: relative;
  z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid #e4e9f2;
}

.header-inner,
.site-nav {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
}

.brand:hover {
  color: var(--brand);
  text-decoration: none;
}

.site-nav {
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 12px;
  border: 1px solid #6f91c2;
  background: #345e9f;
  overflow-x: auto;
  white-space: nowrap;
}

.site-nav a {
  flex: 1 0 130px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border-right: 1px solid #7fa0cc;
  color: #ffffff;
  font-size: 16px;
}

.site-nav a:last-child {
  border-right: 0;
}

.site-nav a:hover {
  color: #ffffff;
  background: #214d8c;
  text-decoration: none;
}

.page-band {
  padding: 10px 0;
  background: var(--surface);
}

.page-band.alternate {
  background: var(--surface);
}

.home-search {
  padding-top: 8px;
  padding-bottom: 8px;
}

.home-search h1 {
  max-width: 720px;
  margin-bottom: 8px;
  color: #0874ff;
  font-size: 28px;
}

.page-context {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 15px;
}

.lead,
.section-heading p,
.search-help,
.result-note {
  color: var(--muted);
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  width: 100%;
  min-height: 42px;
  margin-top: 10px;
}

.search-form input {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 0 16px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid #bfcbd9;
  border-radius: 3px 0 0 3px;
  font: inherit;
}

.search-form button,
.browse-form button {
  min-height: 44px;
  border: 0;
  border-radius: 0 3px 3px 0;
  color: #ffffff;
  background: var(--brand);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.search-form button:hover,
.browse-form button:hover {
  background: var(--brand-strong);
}

.search-help {
  margin: 5px 0 0;
  font-size: 14px;
}

.broadcast {
  --broadcast-row-height: 46px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #d8e2ef;
  background: #f7fbff;
}

.broadcast-title {
  margin-bottom: 5px;
  color: #245c9d;
  font-size: 18px;
  font-weight: 700;
}

.broadcast-list {
  height: var(--broadcast-row-height);
  overflow: hidden;
}

.broadcast-track {
  will-change: transform;
}

.broadcast-count-2 .broadcast-track {
  animation: broadcast-two 10s infinite;
}

.broadcast-count-3 .broadcast-track {
  animation: broadcast-three 15s infinite;
}

.broadcast:hover .broadcast-track {
  animation-play-state: paused;
}

.broadcast-item {
  height: var(--broadcast-row-height);
  display: grid;
  grid-template-columns: 140px 180px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  border-top: 1px dashed #d5e0eb;
  color: #33465f;
  font-size: 15px;
}

.broadcast-item:first-child {
  border-top: 0;
}

.broadcast-item:hover {
  color: #0874ff;
  text-decoration: none;
}

.broadcast-item time {
  color: #0874ff;
  font-weight: 700;
}

.broadcast-item strong {
  color: #245c9d;
}

.broadcast-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.broadcast-empty {
  padding: 8px 0;
  color: var(--muted);
  font-size: 13px;
}

@keyframes broadcast-two {
  0%,
  42% {
    transform: translateY(0);
  }
  50%,
  92% {
    transform: translateY(calc(var(--broadcast-row-height) * -1));
  }
  100% {
    transform: translateY(calc(var(--broadcast-row-height) * -2));
  }
}

@keyframes broadcast-three {
  0%,
  27% {
    transform: translateY(0);
  }
  33%,
  60% {
    transform: translateY(calc(var(--broadcast-row-height) * -1));
  }
  66%,
  93% {
    transform: translateY(calc(var(--broadcast-row-height) * -2));
  }
  100% {
    transform: translateY(calc(var(--broadcast-row-height) * -3));
  }
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 10px;
}

.section-heading h2,
.section-heading p {
  margin-bottom: 0;
}

.section-heading > a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  font-weight: 700;
}

.portal-heading {
  min-height: 44px;
  align-items: center;
  margin-bottom: 0;
  padding: 8px 12px;
  background: #e7ecf4;
}

.portal-heading h2 {
  color: #33465f;
  font-size: 21px;
}

.portal-heading p {
  font-size: 14px;
}

.traffic-list {
  display: grid;
  gap: 8px;
}

.traffic-list.region-waterfall {
  grid-template-columns: 1fr;
  gap: 8px;
}

.traffic-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid #8b98a4;
  border-radius: 3px;
  background: var(--surface);
}

.traffic-card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 5px;
}

.category,
.object-type {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
}

.category {
  color: #23405f;
  background: #e8f0f8;
}

.category-accident,
.category-traffic_control {
  color: #8d2119;
  background: #fde9e7;
}

.category-construction {
  color: #775006;
  background: #fff1c7;
}

.category-weather_road_environment {
  color: #315d5b;
  background: #dff1ef;
}

.category-recovery {
  color: #17633f;
  background: #e1f3e9;
}

.traffic-card h3 {
  margin-bottom: 8px;
}

.traffic-card time {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.object-line {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  margin-top: 5px;
  color: #34414c;
  font-size: 14px;
}

.object-line > span {
  color: var(--muted);
}

.traffic-text {
  margin: 7px 0;
  color: #2d3943;
  word-break: break-word;
}

.traffic-expand {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  color: inherit;
}

.traffic-expand summary {
  order: 2;
  margin-left: 4px;
  color: #1264b6;
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.traffic-expand summary::-webkit-details-marker {
  display: none;
}

.traffic-preview,
.traffic-full {
  order: 1;
}

.traffic-full,
.collapse-label {
  display: none;
}

.traffic-expand[open] .traffic-preview,
.traffic-expand[open] .expand-label {
  display: none;
}

.traffic-expand[open] .traffic-full,
.traffic-expand[open] .collapse-label {
  display: inline;
}

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

.directory-home-section {
  scroll-margin-top: 12px;
}

.legacy-road-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 28px;
  padding: 14px 20px;
  border: 1px solid #e2e7ef;
  border-top: 0;
}

.legacy-road-grid a {
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 3px;
  color: #245c9d;
  font-size: 18px;
}

.legacy-road-grid a:hover {
  color: #0874ff;
}

.legacy-road-grid span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.legacy-road-grid em {
  flex: 0 0 auto;
  color: #245c9d;
  font-style: normal;
}

.navigation-item {
  min-height: 108px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
}

.navigation-item:hover {
  border-color: var(--brand);
  text-decoration: none;
}

.navigation-item strong {
  color: var(--text);
  font-size: 18px;
}

.navigation-item span {
  color: var(--muted);
  font-size: 14px;
}

.object-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 28px;
  padding: 14px 20px;
  border: 1px solid #e2e7ef;
  border-top: 0;
}

.object-item {
  min-width: 0;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-decoration: none;
}

.object-item:hover {
  background: #f2f7fb;
  text-decoration: none;
}

.point-name,
.point-road {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.point-name {
  flex: 0 1 auto;
  color: #245c9d;
  font-size: 18px;
  font-weight: 700;
}

.road-current-count {
  margin-left: 3px;
  color: inherit;
  font-style: normal;
  font-weight: inherit;
}

.point-current-count {
  flex: 0 0 auto;
  margin-left: 3px;
  color: #245c9d;
  font-style: normal;
  font-weight: 700;
}

.point-road {
  flex: 1 1 auto;
  color: var(--muted);
  font-size: 15px;
}

.directory-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.province-road-directory {
  margin-top: 16px;
}

.region-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.region-filter {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid #b9c8d8;
  border-radius: 4px;
  color: #245c9d;
  background: #ffffff;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.region-filter:hover,
.region-filter.is-selected {
  border-color: #245c9d;
  color: #ffffff;
  background: #345e9f;
  text-decoration: none;
}

.object-list > .empty-state {
  grid-column: 1 / -1;
}

.object-type {
  min-height: 22px;
  margin-bottom: 5px;
  color: #3e4c57;
  background: #e7ecef;
}

.link-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.link-cloud a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #34414c;
  background: var(--surface);
}

.link-cloud a:hover {
  border-color: var(--brand);
  color: var(--brand);
  text-decoration: none;
}

.content-slot {
  width: min(1120px, calc(100% - 32px));
  min-height: 52px;
  margin: 16px auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border: 1px solid #e2c679;
  border-radius: 5px;
  color: #594410;
  background: #fff8df;
}

.content-slot strong {
  flex: 0 0 auto;
}

.candidate-list {
  margin-top: 22px;
  border-top: 1px solid var(--line);
}

.candidate-item {
  min-height: 128px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 60px;
  align-items: center;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.candidate-rank {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--brand-strong);
  background: #e7f1ff;
  font-weight: 800;
}

.candidate-main h2,
.candidate-main p {
  margin-bottom: 4px;
}

.candidate-main h2 {
  font-size: 20px;
}

.candidate-main p {
  color: var(--muted);
  font-size: 14px;
}

.candidate-main .match-reason {
  color: #3b596f;
}

.candidate-action {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.empty-state {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  border: 1px dashed #b9c3ca;
  border-radius: 6px;
  color: var(--muted);
  background: #fafbfb;
  text-align: center;
}

.strong-empty {
  min-height: 180px;
  flex-direction: column;
  gap: 9px;
}

.strong-empty strong {
  color: var(--text);
  font-size: 20px;
}

.object-hero {
  padding-bottom: 28px;
}

.object-hero h1 {
  overflow-wrap: anywhere;
}

.object-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  color: var(--muted);
}

.directory-section {
  margin-top: 30px;
}

details {
  border-top: 1px solid var(--line);
}

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

summary {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 4px;
  cursor: pointer;
  font-weight: 700;
}

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

.summary-main {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: var(--text);
  font-size: 15px;
}

.summary-main small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.road-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid #e7ecef;
}

.road-row {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 10px;
  border-bottom: 1px solid #e7ecef;
  color: #2d3943;
}

.road-row:nth-child(odd) {
  border-right: 1px solid #e7ecef;
}

.road-row:hover {
  background: #f2f7fb;
  text-decoration: none;
}

.road-row b {
  display: inline-block;
  min-width: 54px;
  margin-right: 8px;
  color: var(--brand-strong);
}

.road-row em {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.point-directory {
  margin-top: 18px;
}

.point-directory .link-cloud {
  padding: 14px 0 18px;
}

.relation-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 28px;
  margin-top: 24px;
}

.detail-grid > div {
  display: grid;
  gap: 3px;
}

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

.detail-grid strong {
  font-weight: 600;
}

.source-text {
  padding: 18px;
  border-left: 4px solid var(--brand);
  background: #f2f6f9;
  white-space: pre-wrap;
  word-break: break-word;
}

.browse-form {
  display: grid;
  grid-template-columns: 1fr 180px 260px 88px;
  align-items: end;
  gap: 10px;
  margin: 22px 0;
}

.browse-form label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
}

.browse-form input,
.browse-form select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid #b8c2c9;
  border-radius: 5px;
  color: var(--text);
  background: var(--surface);
  font: inherit;
  font-size: 14px;
}

.browse-form button {
  border-radius: 5px;
}

.list-summary {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
}

.pagination {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 18px;
}

.pagination a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.prose h2 {
  margin-top: 28px;
}

.site-footer {
  padding: 24px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--page);
  font-size: 13px;
}

.site-footer > div {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-menu,
.footer-meta,
.version-switch,
.beian-info {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
}

.footer-menu a {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border-right: 1px solid var(--line);
  font-weight: 700;
}

.footer-menu a:first-child {
  padding-left: 0;
}

.footer-menu a:last-child {
  border-right: 0;
}

.footer-meta {
  justify-content: space-between;
  gap: 12px 20px;
}

.version-switch,
.beian-info {
  color: var(--muted);
}

.version-switch span,
.beian-info a {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
}

.version-switch i,
.beian-info i {
  margin: 0 8px;
  font-style: normal;
  color: #9aa6b2;
}

.version-switch em {
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: 3px;
  background: #eef3f8;
  color: #5d6d7e;
  font-size: 12px;
  font-style: normal;
}

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

  .browse-form {
    grid-template-columns: 1fr 1fr;
  }

  .legacy-road-grid,
  .object-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .browse-form button {
    min-height: 44px;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 16px;
  }

  h1,
  .home-search h1 {
    font-size: 23px;
  }

  h2 {
    font-size: 19px;
  }

  .content-width,
  .header-inner,
  .site-nav,
  .content-slot,
  .site-footer > div {
    width: min(100% - 24px, 1120px);
  }

  .header-inner {
    min-height: 54px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 8px 0;
  }

  .site-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    overflow-x: visible;
    white-space: normal;
  }

  .site-nav a {
    flex: none;
    min-width: 0;
    padding: 0 4px;
    font-size: 13px;
  }

  .page-band {
    padding: 8px 0;
  }

  .home-search {
    padding-top: 4px;
  }

  .search-form {
    grid-template-columns: minmax(0, 1fr) 76px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .portal-heading {
    padding: 8px 10px;
  }

  .broadcast-item {
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 0 8px;
    padding: 5px 0;
  }

  .broadcast-item span {
    grid-column: 1 / -1;
    white-space: nowrap;
  }

  .broadcast {
    --broadcast-row-height: 76px;
  }

  .traffic-card {
    padding: 11px 12px;
  }

  .footer-menu a {
    min-height: 36px;
    padding: 0 10px;
  }

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

  .object-line {
    grid-template-columns: 66px minmax(0, 1fr);
  }

  .object-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 12px;
    padding: 10px;
  }

  .object-item {
    min-height: 40px;
  }

  .point-name {
    font-size: 16px;
  }

  .point-road {
    font-size: 14px;
  }

  .legacy-road-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 12px;
    padding: 10px;
  }

  .legacy-road-grid a {
    min-height: 40px;
    font-size: 16px;
  }

  .road-list,
  .detail-grid,
  .browse-form {
    grid-template-columns: 1fr;
  }

  .road-row:nth-child(odd) {
    border-right: 0;
  }

  .road-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .candidate-item {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .candidate-action {
    grid-column: 2;
    justify-content: flex-start;
  }

  .content-slot {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .broadcast-list {
    height: auto;
    overflow: visible;
  }

  .broadcast-track {
    animation: none !important;
  }

  .broadcast-count-2 .broadcast-item:last-child,
  .broadcast-count-3 .broadcast-item:last-child {
    display: none;
  }
}
