:root {
  --navy-950: #05243d;
  --navy-900: #062f55;
  --navy-800: #0b426f;
  --blue-600: #0875c1;
  --blue-100: #dceef9;
  --teal-600: #17857f;
  --teal-100: #dff4f0;
  --coral-600: #c94b32;
  --coral-100: #fbe7e2;
  --ink-900: #17202a;
  --ink-600: #556370;
  --ink-400: #7a8894;
  --line: #d9e1e7;
  --surface: #ffffff;
  --background: #edf2f5;
  --shadow: 0 18px 48px rgba(4, 36, 61, 0.11);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink-900);
  background: var(--background);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  letter-spacing: 0;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

button,
input[type="time"] {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  position: relative;
  overflow: hidden;
  min-height: 280px;
  color: #ffffff;
  background: var(--navy-900);
  border-bottom: 5px solid var(--teal-600);
}

.site-header::after {
  position: absolute;
  right: -90px;
  bottom: -175px;
  width: 430px;
  height: 260px;
  content: "";
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  transform: rotate(-12deg);
}

.header-inner,
.page-content,
.site-footer {
  width: min(1120px, calc(100% - 48px));
  margin-inline: auto;
}

.header-inner {
  position: relative;
  z-index: 1;
  padding: 48px 0 80px;
}

.header-content,
.route-visual,
.section-heading,
.summary-heading,
.counter-label,
.stepper,
.reset-button,
.fee-row,
.total-panel {
  display: flex;
  align-items: center;
}

.header-content {
  justify-content: space-between;
  gap: 60px;
}

.intro {
  max-width: 690px;
}

.section-number {
  margin: 0 0 10px;
  color: var(--teal-600);
  font-family: "Bahnschrift", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 700px;
  margin-bottom: 16px;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 42px;
  line-height: 1.25;
}

.subtitle {
  margin-bottom: 0;
  color: #d5e5ef;
  font-size: 17px;
  line-height: 1.7;
}

.route-visual {
  min-width: 260px;
  justify-content: center;
}

.route-point {
  position: relative;
  z-index: 1;
}

.route-point span,
.route-point small {
  display: block;
}

.route-point span {
  font-family: "Bahnschrift", sans-serif;
  font-size: 24px;
  font-weight: 700;
}

.route-point small {
  margin-top: 5px;
  color: #a9c8dc;
  font-size: 11px;
  white-space: nowrap;
}

.route-point-end {
  text-align: right;
}

.route-line {
  position: relative;
  width: 110px;
  height: 1px;
  margin: 0 14px;
  background: rgba(255, 255, 255, 0.35);
}

.route-line::before,
.route-line::after {
  position: absolute;
  top: -4px;
  width: 7px;
  height: 7px;
  content: "";
  background: var(--teal-600);
  border: 1px solid #ffffff;
  border-radius: 50%;
}

.route-line::before {
  left: 0;
}

.route-line::after {
  right: 0;
}

.route-car {
  position: absolute;
  top: -10px;
  left: 38px;
  width: 34px;
  height: 16px;
  overflow: visible;
  color: #ffffff;
  transform: scaleX(-1);
  transform-origin: center;
}

.route-car-body {
  fill: currentColor;
}

.route-car-window {
  fill: var(--navy-900);
}

.route-car-detail {
  fill: none;
  stroke-linecap: round;
}

.route-car-detail {
  stroke: rgba(6, 47, 85, 0.55);
  stroke-width: 1.2;
}

.route-car-wheel {
  fill: var(--navy-950);
  stroke: #ffffff;
  stroke-width: 1.6;
}

.route-car-hub {
  fill: #75d2cb;
}

.page-content {
  position: relative;
  z-index: 2;
  margin-top: -48px;
  padding-bottom: 38px;
}

.calculator-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(310px, 0.8fr);
  gap: 22px;
  align-items: start;
}

.input-card,
.summary-card {
  background: var(--surface);
  border: 1px solid rgba(5, 47, 85, 0.08);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.input-card {
  padding: 32px;
}

.summary-card {
  position: sticky;
  top: 22px;
  overflow: hidden;
  padding: 32px 30px 28px;
}

.section-heading,
.summary-heading {
  justify-content: space-between;
  gap: 20px;
}

.section-heading {
  margin-bottom: 30px;
}

.summary-heading {
  margin-bottom: 22px;
}

.section-heading h2,
.summary-heading h2 {
  margin: 0;
  color: var(--navy-950);
  font-size: 23px;
  line-height: 1.25;
}

.section-heading > p {
  margin-bottom: 0;
  color: var(--ink-400);
  font-size: 13px;
}

.section-number {
  margin-bottom: 5px;
}

label {
  color: var(--navy-950);
  font-size: 15px;
  font-weight: 700;
}

.time-field {
  width: min(100%, 360px);
  margin-inline: auto;
}

.time-row {
  display: block;
  width: 100%;
  min-width: 0;
  height: 50px;
  margin-top: 11px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #b9c6cf;
  border-radius: 6px;
}

input[type="time"] {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 100%;
  margin: 0;
  padding: 0 14px;
  color: var(--ink-900);
  background: transparent;
  border: 0;
  border-radius: 0;
  outline: none;
  font-family: "Bahnschrift", "Microsoft YaHei", sans-serif;
  font-size: 17px;
}

.time-row:focus-within,
.stepper:focus-within {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(8, 117, 193, 0.14);
}

.field-note {
  margin: 9px 0 0;
  color: var(--ink-400);
  font-size: 12px;
}

.field-divider {
  height: 1px;
  margin: 28px 0;
  background: var(--line);
}

.counter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.counter-field {
  min-width: 0;
  padding: 15px;
  background: #f7f9fa;
  border: 1px solid #e3e9ed;
  border-radius: 6px;
}

.counter-label {
  margin-bottom: 10px;
}

.counter-note {
  min-height: 38px;
  margin: 9px 0 0;
  color: var(--ink-400);
  font-size: 12px;
  line-height: 1.6;
}

.stepper {
  width: 100%;
  height: 48px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #becad2;
  border-radius: 6px;
}

.stepper-button {
  flex: 0 0 44px;
  height: 100%;
  padding: 0;
  color: var(--navy-800);
  background: #ffffff;
  border: 0;
  cursor: pointer;
  font-family: "Bahnschrift", sans-serif;
  font-size: 23px;
  transition: color 160ms ease, background-color 160ms ease;
}

.stepper-button:hover {
  color: #ffffff;
  background: var(--blue-600);
}

.stepper-button:focus-visible,
.reset-button:focus-visible {
  outline: 3px solid #76c7f2;
  outline-offset: 3px;
}

.stepper input {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 0;
  color: var(--ink-900);
  background: #ffffff;
  border: 0;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  outline: none;
  font-family: "Bahnschrift", sans-serif;
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  appearance: textfield;
}

.stepper input::-webkit-inner-spin-button,
.stepper input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.reset-button {
  gap: 7px;
  min-height: 44px;
  margin-top: 24px;
  padding: 0 13px;
  color: var(--ink-600);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.reset-button:hover {
  color: var(--navy-800);
  background: #edf4f8;
  border-color: #d8e6ee;
}

.reset-button span {
  font-size: 20px;
}

.currency-tag {
  padding: 6px 8px;
  color: var(--navy-800);
  background: var(--blue-100);
  border-radius: 4px;
  font-family: "Bahnschrift", sans-serif;
  font-size: 12px;
  font-weight: 700;
}

.fee-list {
  margin: 0;
}

.fee-row {
  min-height: 48px;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.fee-row dt {
  color: var(--ink-600);
  font-size: 14px;
}

.fee-row dd {
  margin: 0;
  color: var(--navy-950);
  font-family: "Bahnschrift", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  font-weight: 700;
}

.total-panel {
  position: relative;
  min-height: 126px;
  margin: 24px -30px -2px;
  padding: 24px 30px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  color: #ffffff;
  background: var(--navy-900);
  border-left: 5px solid var(--teal-600);
}

.total-panel span {
  color: #bed5e4;
  font-size: 13px;
}

.total-panel strong {
  margin-top: 7px;
  font-family: "Bahnschrift", "Microsoft YaHei", sans-serif;
  font-size: 38px;
  line-height: 1.1;
}

.total-panel.is-updated strong {
  animation: fee-pop 240ms ease-out;
}

.summary-note {
  margin: 18px 0 0;
  color: var(--ink-400);
  font-size: 11px;
  text-align: center;
}

.site-footer {
  padding: 0 0 28px;
  color: var(--ink-400);
  font-size: 12px;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

@keyframes fee-pop {
  0% {
    opacity: 0.5;
    transform: translateY(4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 840px) {
  .site-header {
    min-height: 260px;
  }

  .header-inner {
    padding: 42px 0 70px;
  }

  h1 {
    font-size: 34px;
  }

  .route-visual {
    display: none;
  }

  .calculator-layout {
    grid-template-columns: 1fr;
  }

  .summary-card {
    position: static;
  }
}

@media (max-width: 620px) {
  .header-inner,
  .page-content,
  .site-footer {
    width: min(100% - 28px, 1120px);
  }

  .site-header {
    min-height: 245px;
  }

  .header-inner {
    padding: 36px 0 62px;
  }

  h1 {
    font-size: 30px;
    line-height: 1.3;
  }

  .title-prefix,
  .title-main {
    display: block;
  }

  .subtitle {
    font-size: 15px;
  }

  .page-content {
    margin-top: -42px;
  }

  .input-card,
  .summary-card {
    padding: 24px 20px;
  }

  .section-heading {
    align-items: flex-end;
    margin-bottom: 25px;
  }

  .section-heading h2,
  .summary-heading h2 {
    font-size: 21px;
  }

  .section-heading > p {
    font-size: 11px;
  }

  .counter-grid {
    grid-template-columns: 1fr;
  }

  .counter-note {
    min-height: 0;
  }

  .total-panel {
    margin-right: -20px;
    margin-left: -20px;
    padding-right: 20px;
    padding-left: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
