:root {
  --brand: #003399;
  --brand-deep: #000f2e;
  --accent: #06379b;
  --panel: #faf6ed;
  --panel-border: #d3a556;
  --row-border: #385791;
  --row-fill: #fffdf9;
  --ink: #222222;
  --ink-soft: #6b6b6b;
  --dot-idle: #dddddd;
  --page-bg: #ffffff;
  --fastest: #12a150;
  --title-dark: #333333;
  --title-navy: #0c186c;
  --sub-grey: #9f9f9f;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--page-bg);
  color: var(--ink);
  font-family:
    "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial,
    sans-serif;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

button {
  font-family: inherit;
}

.page {
  position: relative;
  max-width: 750px;
  margin: 0 auto;
  overflow-x: hidden;
}

.install-hint {
  width: 100%;
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}

/* ---------- customer service ---------- */

.dropdown-wrapper {
  position: absolute;
  top: 2.6%;
  left: 4.2%;
  z-index: 30;
}

.dropdown-toggle-btn {
  width: 46px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: #000000;
  cursor: pointer;
  line-height: 0;
}

.cs-icon {
  width: 100%;
  height: 100%;
  display: block;
}

.dropdown-menu-custom {
  display: none;
  position: absolute;
  top: 56px;
  left: 0;
  min-width: 172px;
  padding: 6px 0;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
}

.dropdown-menu-custom a {
  display: block;
  padding: 10px 18px;
  color: var(--brand-deep);
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
}

.dropdown-menu-custom a:hover {
  background: rgba(0, 51, 153, 0.07);
}

/* ---------- header ---------- */

.site-header {
  padding: 2.4% 0 0;
  text-align: center;
}

.site-logo {
  width: 34.6%;
  max-width: 260px;
  height: auto;
  display: inline-block;
}

/* ---------- promo carousel (vertical) ---------- */

.promo {
  margin-top: 1.2%;
}

.promo-viewport {
  aspect-ratio: 598 / 871;
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
}

.promo-viewport:active {
  cursor: grabbing;
}

.promo-track {
  display: flex;
  flex-direction: row;
  transition: transform 0.55s ease;
  will-change: transform;
}

.promo-slide {
  flex: 0 0 100%;
  max-width: 100%;
}

.promo-slide img {
  width: 100%;
  height: auto;
  display: block;
  -webkit-user-drag: none;
  pointer-events: none;
}

.promo-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 2.4%;
}

.promo-dots .dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--dot-idle);
  cursor: pointer;
}

.promo-dots .dot.is-active {
  width: 30px;
  border-radius: 5px;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px var(--dot-idle);
}

/* ---------- desktop hero copy ---------- */

.hero-copy {
  display: none;
}

.hero-title {
  margin: 0;
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: 0.01em;
}

.t-dark {
  color: var(--title-dark);
}

.t-navy {
  color: var(--title-navy);
}

.hero-sub {
  margin: 0;
  color: var(--sub-grey);
  font-weight: 400;
}

/* ---------- CTAs ---------- */

.actions {
  margin-top: 6.6%;
  padding: 0 8.2%;
}

/* Above .page-overlay (900) so the CTA stays clickable while a panel is open —
   that's what makes the same-button close and the one-tap switch to the other
   panel work. This is a stacking context, so .route-panel's z-index now orders
   it against the button inside the block, not against the scrim. */
.action-block {
  position: relative;
  z-index: 950;
}

.action-block + .action-block {
  margin-top: 3.2%;
}

.cta-btn {
  display: block;
  width: 100%;
  padding: 5.4% 0;
  border: 0;
  border-radius: 12px;
  background: var(--brand);
  color: #ffffff;
  font-size: 26px;
  font-weight: 500;
  letter-spacing: 0.06em;
  cursor: pointer;
}

/* the scrim sits above the page but below the CTAs and the open panel */
.page-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 900;
}

.route-panel {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  width: 95%;
  min-width: 300px;
  padding: 2.8%;
  background: var(--panel);
  border: 1.5px solid var(--panel-border);
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.route-panel::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  width: 15px;
  height: 15px;
  margin-left: -7.5px;
  background: var(--panel);
  border-right: 1.5px solid var(--panel-border);
  border-bottom: 1.5px solid var(--panel-border);
  transform: rotate(45deg);
}

/* The 线路 cell and the field form ONE bordered box with a divider between
   them (design), so the row carries NO gap — the spacing sits on the button
   alone. `gap` would apply between every child and split the two cells. */
.route-row {
  display: flex;
  align-items: stretch;
}

.route-row + .route-row {
  margin-top: 4%;
}

.route-label,
.route-field {
  display: flex;
  align-items: center;
  min-height: 43px;
  padding: 0 3%;
  border: 1px solid var(--row-border);
  background: var(--row-fill);
  color: var(--brand-deep);
  font-size: 17px;
}

.route-field {
  flex: 0 0 21.4%;
  min-width: 0;
  border-right: 0;
  border-radius: 4px 0 0 4px;
  justify-content: center;
  white-space: nowrap;
  font-size: clamp(16px, 1.9vw, 17px);
  padding: 0 1.5%;
  color: var(--ink-soft);
}

.route-label {
  flex: 1 1 auto;
  border-radius: 0 4px 4px 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-row.is-fastest .route-field {
  color: var(--fastest);
  font-weight: 600;
}

.route-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 23.6%;
  margin-left: 1.8%;
  padding: 10px;
  min-height: 43px;
  border-radius: 4px;
  background: var(--brand);
  color: #ffffff;
  font-size: 17px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

/* ---------- install hint ---------- */

.install-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 6% 0;
  color: var(--accent);
}

.install-hint-text {
  font-size: 24px;
}

.chevron {
  position: relative;
  width: 26px;
  height: 22px;
}

.chevron::before,
.chevron::after {
  content: "";
  position: absolute;
  left: 4px;
  width: 17px;
  height: 17px;
  border-left: 3px solid var(--accent);
  border-top: 3px solid var(--accent);
  transform: rotate(45deg);
}

.chevron::before {
  top: 9px;
}

.chevron::after {
  top: 0;
}

.chevron--down {
  transform: rotate(180deg);
}

/* ---------- desktop: two columns, white ground ---------- */

@media (min-width: 1024px) {
  .page {
    max-width: none;
    min-height: 100vh;
    padding: 0;
    display: grid;
    grid-template-columns: 52.6% 47.4%;
    grid-template-rows: auto auto;
    align-content: center;
  }

  .dropdown-wrapper {
    display: none;
  }

  .site-header {
    grid-column: 1;
    grid-row: 1;
    align-self: end;
    padding: 0 0 0 18.2%;
    text-align: left;
  }

  .site-logo {
    width: 25%;
    max-width: 250px;
  }

  .content {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    padding: 0 0 0 18.2%;
  }

  .promo {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    position: relative;
    margin: 0;
    padding: 0 9% 0 0;
  }

  .promo-viewport {
    width: 77.3%;
    touch-action: pan-x;
  }

  .promo-track {
    flex-direction: column;
  }

  .promo-slide {
    flex: 0 0 auto;
  }

  .promo-dots {
    position: absolute;
    top: 55%;
    right: 19.8%;
    transform: translateY(-50%);
    flex-direction: column;
    gap: 14px;
    margin: 0;
  }

  .promo-dots .dot.is-active {
    width: 9px;
    height: 30px;
    border-radius: 5px;
  }

  .hero-copy {
    display: block;
    margin-top: 14.4%;
  }

  .hero-title {
    font-size: 58px;
  }

  .hero-sub {
    margin-top: 2.2%;
    font-size: 26px;
  }

  .actions {
    margin-top: 8.2%;
    padding: 0;
    max-width: 61.4%;
  }

  .cta-btn {
    padding: 20px 0;
    font-size: 22px;
    border-radius: 10px;
  }

  .route-label,
  .route-field,
  .route-btn {
    font-size: 16px;
  }

  .install-hint {
    display: none;
  }

  .panel-tutorial {
    display: none;
  }

  .panel-main {
    display: contents;
  }
}

@media (max-width: 1023px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  .page {
    height: 100vh;
    height: 100dvh;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .page::-webkit-scrollbar {
    display: none;
  }

  .panel {
    position: relative;
    height: 100vh;
    height: 100dvh;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .panel-main .content {
    flex: 0 0 auto;
    margin-top: auto;
    will-change: transform, opacity;
  }

  .site-header {
    flex: 0 0 auto;
  }

  .promo {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin-top: 0;
    will-change: transform;
  }

  .promo-viewport {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    aspect-ratio: auto;
  }

  .promo-track,
  .promo-slide {
    height: 100%;
  }

  .promo-slide img {
    height: 100%;
    object-fit: contain;
  }

  .promo-dots {
    flex: 0 0 auto;
  }

  .cta-btn {
    font-size: 18px;
  }

  .route-panel {
    width: 92vw;
    padding: 3%;
  }

  .route-field {
    flex: 0 0 24%;
  }

  /* ---- tutorial panel ---- */
  .panel-tutorial {
    justify-content: center;
    background: #ffffff;
  }

  .tutorial-art {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow: hidden;
    will-change: transform;
  }

  .tutorial-art img {
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    height: auto;
    object-fit: contain;
    display: block;
  }

  .install-hint--back {
    flex: 0 0 auto;
    margin: 6% 0;
  }
}
