:root {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #23475d;
  background: #edf7fc;
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input {
  font: inherit;
}
button,
a,
input {
  touch-action: manipulation;
}
button {
  border: 1px solid #aac4d2;
  background: transparent;
  color: #23475d;
  border-radius: 24px;
  padding: 12px 22px;
  cursor: pointer;
}
button:hover {
  background: #dceef6;
}
button:disabled {
  opacity: 0.42;
  cursor: default;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid #cc8527;
  outline-offset: 4px;
}
header {
  max-width: 1260px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  padding: 26px 40px;
  font-size: 12px;
  letter-spacing: 1px;
  color: #567586;
}
header a {
  color: inherit;
  text-decoration: none;
}
main {
  max-width: 1260px;
  margin: auto;
}
.intro {
  text-align: center;
  margin: 20px 20px 0;
}
.route-symbol {
  display: block;
  font-size: 28px;
  color: #d09338;
}
.intro h1 {
  font-size: clamp(25px, 3vw, 38px);
  font-weight: 600;
  letter-spacing: 3px;
  margin: 10px 0;
}
.intro p {
  font-size: 14px;
  color: #5b7889;
  letter-spacing: 1px;
}
.clock {
  text-align: center;
  margin: 36px 15px 10px;
}
#status {
  font-size: 13px;
  letter-spacing: 3px;
  color: #536e80;
}
#digits {
  font:
    500 clamp(80px, 10vw, 140px)/1.2 Consolas,
    "Courier New",
    monospace;
  letter-spacing: -7px;
  margin: 8px 0 4px;
  font-variant-numeric: tabular-nums;
}
#message {
  font-size: 15px;
  color: #536e80;
  min-height: 24px;
}
.actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 22px auto;
}
.primary {
  background: #23475d;
  color: #fff;
  border-color: #23475d;
  padding-inline: 30px;
}
.primary:hover {
  background: #365f74;
}
.journey {
  margin: 0 55px;
}
.landscape {
  height: 126px;
  position: relative;
  overflow: hidden;
}
.hill {
  position: absolute;
  bottom: -95px;
  border-radius: 50%;
  background: #dbece9;
  width: 400px;
  height: 170px;
  z-index: 0;
}
.h1 {
  left: 11%;
}
.h2 {
  right: 12%;
  width: 300px;
  height: 140px;
  background: #dcecf3;
}
.station {
  position: absolute;
  bottom: 8px;
  font-size: 12px;
  display: flex;
  gap: 9px;
  align-items: center;
  z-index: 2;
}
.station i {
  height: 31px;
  width: 2px;
  background: #476477;
  position: relative;
}
.station i:before {
  content: "";
  width: 9px;
  height: 9px;
  background: #edf7fc;
  border: 2px solid #476477;
  border-radius: 50%;
  position: absolute;
  left: -5px;
  top: -7px;
}
.start-station {
  left: 0;
}
.end-station {
  right: 0;
  flex-direction: row-reverse;
}
.train-track {
  position: absolute;
  left: 45px;
  right: 45px;
  bottom: 0;
  height: 80px;
}
#train {
  width: 130px;
  position: absolute;
  left: 0;
  bottom: -1px;
  transform: translateX(0);
  transition: left 0.3s linear;
}
#train svg {
  width: 100%;
  display: block;
}
.rails {
  height: 11px;
  border-block: 2px solid #58788a;
  background: repeating-linear-gradient(
    90deg,
    transparent 0 15px,
    #58788a 15px 18px
  );
}
.route-caption {
  display: flex;
  justify-content: space-between;
  color: #6a8796;
  font-size: 11px;
  margin-top: 12px;
}
.settings {
  max-width: 940px;
  margin: 40px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 25px 18px;
  border-top: 1px solid #c4dbe5;
}
#duration-form > label {
  font-size: 13px;
  display: block;
  margin-bottom: 10px;
}
#duration-form > div {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
input[type="number"] {
  background: #f9fdff;
  border: 1px solid #a7c3d1;
  border-radius: 8px;
  padding: 10px;
  width: 75px;
  color: #23475d;
}
#duration-form button {
  padding: 9px 18px;
}
.demo {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.demo button {
  border-style: dashed;
  padding: 10px 30px;
}
.demo span,
.sound span {
  font-size: 11px;
  color: #617d8d;
}
.sound {
  font-size: 13px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 7px;
  align-items: center;
}
.sound span {
  grid-column: 2;
}
input[type="checkbox"] {
  accent-color: #23475d;
  width: 17px;
  height: 17px;
}
footer {
  text-align: center;
  margin: 6px 16px 24px;
  color: #647d8a;
  font-size: 11px;
}
footer button {
  border: 0;
  text-decoration: underline;
  padding: 8px;
  font-size: 11px;
}
#notice {
  min-height: 20px;
  text-align: center;
  font-size: 13px;
  color: #815519;
  margin: 0 20px;
}
body.arrived {
  background: #f4f8ee;
}
.arrived #status,
.arrived #message {
  color: #53713b;
}
.arrived .primary {
  background: #54744b;
  border-color: #54744b;
}
@media (max-width: 650px) {
  header {
    padding: 20px;
  }
  .intro {
    margin-top: 20px;
  }
  .intro h1 {
    letter-spacing: 1px;
  }
  .clock {
    margin-top: 28px;
  }
  #digits {
    letter-spacing: -4px;
    font-size: 90px;
  }
  .actions {
    gap: 8px;
    flex-wrap: wrap;
  }
  button {
    padding: 11px 16px;
    font-size: 14px;
  }
  .journey {
    margin: 0 24px;
  }
  .landscape {
    height: 105px;
  }
  #train {
    width: 93px;
  }
  .route-caption span:nth-child(2) {
    display: none;
  }
  .route-caption {
    font-size: 10px;
  }
  .settings {
    margin: 28px 24px 0;
    padding: 22px 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px 12px;
  }
  .demo span {
    line-height: 1.6;
  }
  .sound {
    grid-column: 1/-1;
    display: flex;
    justify-content: center;
  }
  .demo button {
    padding: 10px 20px;
  }
  footer {
    line-height: 1.8;
  }
}
@media (prefers-reduced-motion: reduce) {
  #train {
    transition: none;
  }
}
:root #duration-form > div > span {
  white-space: nowrap;
}
:root #duration-form button {
  white-space: nowrap;
  flex-shrink: 0;
}
@media (max-width: 650px) {
  .settings {
    grid-template-columns: 1fr;
    gap: 23px;
  }
  .settings #duration-form {
    text-align: center;
  }
  .settings #duration-form > div {
    justify-content: center;
  }
  .settings .demo {
    padding-top: 4px;
  }
  .settings .sound {
    grid-column: auto;
  }
}
