* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  min-height: 100%;
  background-color: #1a1a1a;
  /* 禁止任何滚动条出现；弹层用绝对定位超出 page 不需要 body 滚 */
  overflow: hidden;
}

/* 页面容器：PC 端以视口宽高为基准，避免百分比高度失控 */
.page {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background-color: #1a1a1a;
  background-image: url("../img/bj.png");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}

.page:has(.ditu-popup.is-open) {
  overflow: visible;
}

@media (min-width: 769px) {
  .page {
    background-attachment: fixed;
  }
}

/* ============ 左侧堆叠区域 ============ */
.layer-left-stack {
  position: absolute;
  left: clamp(24px, 8vw, 180px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(12px, 2vh, 24px);
  /* 用宽度控制整个堆叠列的规模，而不是让各子项自己算百分比 */
  width: clamp(260px, 28vw, 460px);
}

/* Logo 519x128：按宽度自适应，高度自动 */
.layer-left-stack .layer-logo {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  object-fit: contain;
}

/* 三个按钮图（saishi 312x48 / app 399x56 / web 399x56）：统一用宽度控制 */
.layer-left-stack .layer-left-thumb {
  display: block;
  width: 85%;
  max-width: 320px;
  height: auto;
  object-fit: contain;
}

.layer-thumb-link {
  display: block;
  width: 100%;
  text-align: center;
  line-height: 0;
  text-decoration: none;
  color: inherit;
}

.layer-thumb-link .layer-left-thumb {
  margin: 0 auto;
}

.layer-thumb-link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
  border-radius: 2px;
}

/* ============ WEB 按钮 + 弹出地图 ============ */
.layer-web-slot {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.web-thumb-btn {
  padding: 0;
  margin: 0 auto;
  border: none;
  background: none;
  cursor: pointer;
  display: block;
  line-height: 0;
  width: 85%;
  max-width: 320px;
}

.web-thumb-btn .layer-left-thumb {
  width: 100%;
}

.web-thumb-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.ditu-popup {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: none;
  pointer-events: auto;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.4));
  /* 避免弹层向上溢出视口顶部：最大高度约束 */
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  /* 避免弹层宽度超出视口 */
  max-width: calc(100vw - 16px);
}

.ditu-popup.is-open {
  display: block;
}

.ditu-popup-panel {
  position: relative;
  display: block;
  /* 窄屏保持保守，不让 translateX(-50%) 撞左边缘 */
  width: clamp(180px, 24vw, 360px);
  max-width: calc(100vw - 32px);
  /* 高度不超视口，兜底裁剪 */
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  line-height: 0;
}

/* 中等屏（1200~1439）放大 */
@media (min-width: 1200px) and (max-width: 1439px) {
  .ditu-popup-panel {
    width: clamp(300px, 30vw, 400px);
  }
}

/* 大屏（>=1440）放得更开 */
@media (min-width: 1440px) {
  .ditu-popup-panel {
    width: clamp(400px, 32vw, 560px);
  }
}

.ditu-map-img {
  display: block;
  width: 100%;
  height: auto;
  /* 高度兜底：窗口矮的时候地图也不会超出视口 */
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  object-fit: contain;
}

.ditu-popup-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 1.2%;
  padding: 3.5% 5%;
  pointer-events: none;
  box-sizing: border-box;
  /* 关键：不让内容超出地图背景图的范围 */
  overflow: hidden;
}

.ditu-popup-overlay .ditu-tishi-img {
  pointer-events: auto;
}

.ditu-tishi-img {
  display: block;
  flex-shrink: 0;
  width: 72%;
  max-width: 440px;
  height: auto;
  object-fit: contain;
  margin-bottom: 2%;
}

/* ============ 线路列表：纯 CSS 胶囊样式 ============ */
.ditu-line-rows {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  justify-content: space-around;
  gap: clamp(3px, 0.6vw, 10px);
  box-sizing: border-box;
  pointer-events: auto;
}

.ditu-line {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: clamp(4px, 0.7vw, 12px);
  width: 100%;
  box-sizing: border-box;
  padding: 0 clamp(3px, 0.5vw, 8px);
  min-height: 0;
}

/* 左侧蓝色圆角胶囊：延迟 */
.ditu-line__delay {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: clamp(38px, 4.2vw, 70px);
  height: clamp(22px, 2.2vw, 36px);
  padding: 0 clamp(6px, 0.7vw, 12px);
  border-radius: 999px;
  background: linear-gradient(180deg, #4aa7ff 0%, #1f7ef2 100%);
  color: #fff;
  font-weight: 700;
  font-size: clamp(10px, 0.9vw, 15px);
  line-height: 1;
  box-shadow: 0 2px 6px rgba(31, 126, 242, 0.28);
  white-space: nowrap;
}

/* 中间白色圆角长条：域名 */
.ditu-line__domain {
  flex: 1 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: clamp(22px, 2.2vw, 36px);
  padding: 0 clamp(6px, 0.7vw, 12px);
  border-radius: 999px;
  background: #ffffff;
  color: #222;
  font-weight: 600;
  font-size: clamp(10px, 0.9vw, 15px);
  line-height: 1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 右侧蓝色圆角胶囊：点击进入 */
.ditu-line__btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: clamp(52px, 5.4vw, 88px);
  height: clamp(22px, 2.2vw, 36px);
  padding: 0 clamp(8px, 0.9vw, 14px);
  border-radius: 999px;
  background: linear-gradient(180deg, #4aa7ff 0%, #1f7ef2 100%);
  color: #fff;
  font-weight: 700;
  font-size: clamp(10px, 0.9vw, 15px);
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(31, 126, 242, 0.28);
  white-space: nowrap;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.ditu-line__btn:hover {
  box-shadow: 0 3px 10px rgba(31, 126, 242, 0.36);
}

.ditu-line__btn:active {
  transform: scale(0.97);
  box-shadow: 0 1px 3px rgba(31, 126, 242, 0.24);
}

.ditu-line__btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
  border-radius: 999px;
}

/* ============ 右侧主视觉图 1.png (1092x866) ============ */
.layer-right {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
  /* 默认（窄屏居多）：高度不超出视口，宽度留足左侧空间 */
  height: auto;
  width: auto;
  max-height: 92vh;
  max-width: 60vw;
  object-fit: contain;
  pointer-events: none;
}

/* ============ 右上客服按钮 kefu (67x89) ============ */
.layer-kefu-wrap {
  position: absolute;
  top: max(1.5%, 14px);
  right: max(1.5%, 14px);
  z-index: 2;
  display: block;
  line-height: 0;
  text-decoration: none;
  color: inherit;
}

.layer-kefu-wrap:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
  border-radius: 2px;
}

/* 客服图是小图，不该被放太大 */
.layer-kefu-wrap .layer-kefu {
  display: block;
  width: clamp(32px, 3.2vw, 56px);
  height: auto;
  object-fit: contain;
}

/* ============ 窄屏 PC / 半屏（769~1199px）============ */
/* 这个范围下右图必须收紧，给左侧 logo+按钮区留出真正的空间 */
@media (min-width: 769px) and (max-width: 1199px) {
  .layer-left-stack {
    left: clamp(20px, 4vw, 80px);
    width: clamp(220px, 30vw, 320px);
    gap: clamp(8px, 1.4vh, 16px);
  }

  .layer-left-stack .layer-logo {
    max-width: 280px;
  }

  .layer-left-stack .layer-left-thumb,
  .web-thumb-btn {
    max-width: 260px;
  }

  .layer-right {
    /* 窄屏右图更收敛：高度不超屏，宽度最多占一半多一点 */
    max-height: 88vh;
    max-width: 55vw;
  }

  .layer-kefu-wrap .layer-kefu {
    width: clamp(28px, 3.8vw, 44px);
  }
}

/* ============ 超窄 PC 窗口（769~949px，半屏或拖到 2/3 屏）============ */
/* 这档是最容易出问题的：宽度不够、右图即便只占 55vw 也会压到左侧 */
@media (min-width: 769px) and (max-width: 949px) {
  .layer-left-stack {
    left: clamp(16px, 3vw, 40px);
    width: clamp(200px, 32vw, 260px);
  }

  .layer-left-stack .layer-logo {
    max-width: 220px;
  }

  .layer-left-stack .layer-left-thumb,
  .web-thumb-btn {
    max-width: 210px;
  }

  .layer-right {
    /* 进一步收紧，高度也更保守，确保绝不超屏 */
    max-height: 82vh;
    max-width: 48vw;
  }
}

/* ============ PC 大屏 >=1200px ============ */
@media (min-width: 1200px) {
  .layer-left-stack {
    left: clamp(32px, 6vw, 180px);
    width: clamp(280px, 22vw, 420px);
  }

  .layer-right {
    max-height: 96vh;
    max-width: 62vw;
  }
}

/* ============ 中宽屏 1200~1599 额外保护 ============ */
/* 1366/1440/1600 这档笔记本分辨率最容易重叠，再收一档 */
@media (min-width: 1200px) and (max-width: 1599px) {
  .layer-right {
    max-width: 58vw;
  }
}

/* ============ 超宽屏 >=1600px ============ */
@media (min-width: 1600px) {
  .layer-left-stack {
    width: 440px;
    gap: 22px;
  }

  .layer-right {
    max-height: 1100px;
    max-width: 1380px;
  }

  .layer-kefu-wrap .layer-kefu {
    width: 52px;
  }
}

/* ============ 矮屏保护（PC 但高度很小）============ */
@media (min-width: 769px) and (max-height: 700px) {
  .layer-left-stack {
    width: clamp(240px, 24vw, 360px);
    gap: 10px;
  }

  .layer-left-stack .layer-logo {
    max-width: 320px;
  }

  .layer-right {
    max-height: 88vh;
  }
}