:root {
  --bg: #eef6ff;
  --surface: #ffffff;
  --surface-soft: #f7fbff;
  --line: #dce7f3;
  --line-soft: #edf3f9;
  --text: #213044;
  --muted: #657386;
  --blue: #1976d2;
  --blue-strong: #0b5cad;
  --blue-soft: #e8f3ff;
  --green: #0f8a62;
  --red: #c93838;
  --amber: #a86908;
  --shadow: 0 16px 42px rgba(31, 92, 150, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(220, 231, 243, 0.86);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.header-inner,
.hero-inner,
.section-inner,
.footer-inner {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-weight: 700;
}

.brand-logo {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  object-fit: cover;
  background: #ffffff;
}

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

.top-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.top-nav a {
  min-width: 72px;
  padding: 8px 10px;
  border-radius: 8px;
  text-align: center;
}

.top-nav a:hover {
  background: var(--blue-soft);
  color: var(--blue-strong);
}

.hero-section {
  background: linear-gradient(180deg, #e7f4ff 0%, #f7fbff 100%);
}

.hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 42px;
  align-items: end;
  padding: 52px 0 36px;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 8px;
  color: var(--blue-strong);
  font-size: 13px;
  font-weight: 700;
}

.hero-copy h1,
.section-head h2,
.panel-head h2 {
  margin: 0;
}

.hero-copy h1 {
  font-size: 48px;
  line-height: 1.12;
}

.hero-summary {
  max-width: 720px;
  margin: 18px 0 0;
  color: #40536a;
  font-size: 17px;
  line-height: 1.8;
}

.hero-status {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero-status div {
  min-width: 0;
  padding: 18px 16px;
  border-right: 1px solid var(--line-soft);
}

.hero-status div:last-child {
  border-right: 0;
}

.status-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
}

.hero-status strong {
  display: block;
  overflow: hidden;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tools-section {
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 44px;
}

.tools-grid {
  display: grid;
  grid-template-columns: minmax(620px, 1.1fr) minmax(460px, 0.9fr);
  gap: 20px;
  align-items: start;
}

.tool-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.panel-head h2 {
  font-size: 22px;
  line-height: 1.3;
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.station-select,
.table-action,
.icon-button,
.primary-button,
.chip,
.port-button,
.train-link,
.empty-action,
.station-option {
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.station-select {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 180px;
  min-height: 38px;
  padding: 0 12px;
  color: var(--blue-strong);
  font-weight: 700;
}

.station-select span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.segmented {
  display: inline-flex;
  align-items: center;
  width: 138px;
  height: 38px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.segment.active {
  background: var(--blue);
  color: #ffffff;
}

.notice {
  margin: 0;
  padding: 14px 22px 0;
  color: var(--muted);
  font-size: 14px;
}

.search-row,
.station-toolbar,
.timetable-form,
.recent-row {
  padding-right: 22px;
  padding-left: 22px;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 10px;
  padding-top: 16px;
}

.field {
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.field:focus-within {
  border-color: #8cc3f5;
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.12);
}

.field input,
.status-select select {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.field input {
  height: 40px;
  padding: 0 12px;
}

.field-icon {
  flex: 0 0 38px;
  color: var(--muted);
  text-align: center;
}

.field-label {
  flex: 0 0 auto;
  padding-left: 12px;
  color: var(--muted);
  font-size: 13px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--blue-strong);
  font-size: 18px;
  font-weight: 700;
}

.icon-button:hover,
.station-select:hover,
.table-action:hover,
.chip:hover,
.port-button:hover {
  background: var(--blue-soft);
}

.station-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.table-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 10px;
  color: var(--blue-strong);
  font-weight: 700;
}

.status-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  color: var(--muted);
  font-size: 14px;
}

.status-select select {
  width: 132px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.table-shell {
  position: relative;
  min-height: 390px;
  border-top: 1px solid var(--line-soft);
}

.screen-table {
  width: 100%;
}

.table-row {
  display: grid;
  align-items: center;
  min-height: 50px;
  border-bottom: 1px solid var(--line-soft);
}

.table-header {
  min-height: 46px;
  background: #f8fbff;
  color: #536477;
  font-size: 13px;
  font-weight: 700;
}

.table-body .table-row:nth-child(even) {
  background: #fbfdff;
}

.station-table .table-row {
  grid-template-columns: 96px minmax(92px, 1fr) 76px minmax(132px, 1.2fr) 118px;
}

.cell {
  min-width: 0;
  padding: 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.col-train {
  padding-left: 22px;
}

.col-time,
.col-port {
  text-align: center;
}

.col-status {
  padding-right: 22px;
  text-align: right;
}

.train-link {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 34px;
  padding: 0 8px;
  color: var(--blue-strong);
  font-weight: 800;
  text-align: left;
}

.port-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 34px;
  padding: 0 8px;
  color: var(--text);
}

.status {
  color: #3f4f63;
  font-weight: 700;
}

.status.success {
  color: var(--green);
}

.status.warning {
  color: var(--amber);
}

.status.danger {
  color: var(--red);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  padding: 36px 22px;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

.empty-action {
  min-height: 38px;
  margin-top: 14px;
  padding: 0 16px;
  background: var(--blue);
  color: #ffffff;
  font-weight: 700;
}

.empty-action:hover,
.primary-button:hover {
  background: var(--blue-strong);
}

.timetable-form {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr) 92px;
  gap: 10px;
  padding-top: 18px;
}

.primary-button {
  min-height: 42px;
  padding: 0 18px;
  background: var(--blue);
  color: #ffffff;
  font-weight: 800;
}

.recent-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  padding-top: 14px;
  padding-bottom: 12px;
}

.recent-label {
  flex: 0 0 auto;
  padding-top: 7px;
  color: var(--muted);
  font-size: 13px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.muted {
  color: var(--muted);
}

.chip {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--blue-strong);
  font-weight: 700;
}

.route-summary {
  margin: 0 22px 16px;
  padding: 18px;
  border: 1px solid #cde3f9;
  border-radius: 8px;
  background: #f4faff;
}

.route-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

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

.route-side:last-child {
  text-align: right;
}

.route-station {
  overflow: hidden;
  font-size: 18px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-time {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.route-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--blue);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.route-badge.end {
  background: #475569;
}

.route-middle {
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.route-line {
  position: relative;
  height: 1px;
  margin: 8px 0;
  background: #9dc9ee;
}

.route-line::after {
  position: absolute;
  top: -4px;
  right: 0;
  width: 9px;
  height: 9px;
  border-top: 1px solid #9dc9ee;
  border-right: 1px solid #9dc9ee;
  content: "";
  transform: rotate(45deg);
}

.timetable-table .table-row {
  grid-template-columns: 44px minmax(88px, 1fr) 74px 74px 82px 118px;
}

.timeline-spacer {
  width: 44px;
  height: 1px;
}

.timeline {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
}

.timeline .line {
  position: absolute;
  left: 50%;
  width: 2px;
  margin-left: -1px;
}

.timeline .line.top {
  top: 0;
  height: calc(50% - 7px);
}

.timeline .line.bottom {
  bottom: 0;
  height: calc(50% - 7px);
}

.timeline .line.passed {
  background: var(--blue);
}

.timeline .line.future {
  background: repeating-linear-gradient(to bottom, #c7d2df 0, #c7d2df 4px, transparent 4px, transparent 8px);
}

.timeline .line.hidden {
  display: none;
}

.dot {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  border: 2px solid #aab8c7;
  border-radius: 50%;
  background: #ffffff;
}

.dot.arrived {
  border-color: var(--blue);
  background: var(--blue);
}

.result-station {
  font-weight: 800;
}

.result-time,
.result-stop,
.result-status {
  text-align: center;
}

.result-status {
  padding-right: 12px;
}

.info-section,
.faq-section {
  padding: 28px 0;
  background: #ffffff;
}

.faq-section {
  padding-bottom: 56px;
  background: #f7fbff;
}

.section-head {
  margin-bottom: 18px;
}

.section-head h2 {
  font-size: 28px;
}

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

.step-item {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue);
  color: #ffffff;
  font-weight: 800;
}

.step-item h3 {
  margin: 14px 0 8px;
}

.step-item p,
.faq-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.faq-list {
  display: grid;
  gap: 10px;
}

.faq-list details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.faq-list summary {
  padding: 16px 18px;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.faq-list p {
  padding: 0 18px 18px;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #182536;
  color: #d9e5f2;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 86px;
}

.footer-inner strong,
.footer-inner span {
  display: block;
}

.footer-inner span {
  margin-top: 4px;
  color: #9fb1c6;
  font-size: 13px;
}

.footer-links {
  text-align: right;
}

.footer-links a {
  color: #ffffff;
  font-weight: 700;
}

.footer-links a:hover {
  text-decoration: underline;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 27, 43, 0.48);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  overflow: auto;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 80px rgba(4, 17, 31, 0.28);
}

.info-modal-panel {
  width: min(520px, 100%);
}

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

.modal-head h2 {
  margin: 0;
  font-size: 22px;
}

.modal-search {
  margin: 18px 20px 12px;
}

.station-options {
  padding: 0 20px 22px;
}

.station-section {
  margin-top: 18px;
}

.station-section-title {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.station-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.station-option {
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  font-weight: 700;
}

.station-option:hover {
  border-color: #9dc9ee;
  background: var(--blue-soft);
  color: var(--blue-strong);
}

.station-empty-message {
  padding: 28px 0;
  color: var(--muted);
  text-align: center;
}

.info-content {
  margin: 0;
  padding: 22px;
  color: var(--text);
  line-height: 1.7;
  overflow-wrap: break-word;
}

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

  .tool-panel {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .header-inner,
  .hero-inner,
  .section-inner,
  .footer-inner,
  .tools-section {
    width: min(100% - 28px, 1180px);
  }

  .top-nav {
    display: none;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 34px;
  }

  .hero-copy h1 {
    font-size: 34px;
  }

  .hero-status {
    grid-template-columns: 1fr;
  }

  .hero-status div {
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }

  .hero-status div:last-child {
    border-bottom: 0;
  }

  .panel-head,
  .head-actions,
  .footer-inner {
    align-items: stretch;
    flex-direction: column;
  }

  .head-actions {
    gap: 10px;
  }

  .station-select,
  .segmented {
    width: 100%;
    max-width: none;
  }

  .station-table-shell,
  .timetable-table-shell {
    overflow-x: auto;
  }

  .station-table,
  .timetable-table {
    min-width: 660px;
  }

  .timetable-form,
  .step-grid,
  .route-main {
    grid-template-columns: 1fr;
  }

  .route-side:last-child,
  .footer-links {
    text-align: left;
  }

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