/*
 * 落地页样式
 * ---------------------------------------------------------------------------
 * 品牌按钮基础类为 .brand-btn，由 code.js 动态插入 DOM。
 * 标题颜色在 JS 里按「电脑 / 手机」写入，便于每个品牌单独配色。
 * 若新增第 4 个桌面并排按钮，请把 .brand-row 的 grid 列数一并改掉。
 * ---------------------------------------------------------------------------
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body,
h1,
h2,
ul,
li,
a,
img,
div {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

body {
  line-height: 1;
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.home-con {
  position: fixed;
  width: 100vw;
  height: 100vh;
}

.video-con {
  position: fixed;
  inset: 0;
  z-index: 0;
  line-height: 0;
  background: url(./images/background.jpg) no-repeat center 85%;
  background-size: cover;
}

.btn-con {
  position: fixed;
  width: 100vw;
  height: 100vh;
  /* 默认由子元素绝对居中；窄屏见下方改为可滚动，避免品牌多时顶部图被裁切 */
}

.btn-container {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: min(960px, 94vw);
  padding: clamp(20px, 3vh, 40px) clamp(16px, 2vw, 28px) clamp(28px, 4vh, 52px);
  transform: translate(-50%, -50%);
  border-radius: 10px;
  text-align: center;
}

/* 一排品牌：宽屏三列网格；窄屏改为竖排（由同一容器 + 媒体查询实现，无需两份 HTML） */
.brand-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: clamp(12px, 2.2vw, 32px);
  margin-bottom: clamp(20px, 3.5vh, 44px);
}

.brand-btn {
  --btn-logo-w: 60px;
  --btn-logo-h: 60px;
  --btn-logo-gap: clamp(18px, 2.4vw, 26px);
  display: flex;
  align-items: center;
  justify-content: center;
  column-gap: var(--btn-logo-gap);
  min-width: 0;
  width: 100%;
  height: clamp(74px, 10vh, 82px);
  padding: 0 clamp(10px, 1.6vw, 16px);
  border: 1px solid #fff;
  border-radius: 70px;
  background-color: rgb(25 26 39 / 0.35);
  color: #fff;
  font-size: clamp(15px, 1.55vw, 18px);
  font-weight: bold;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
}

.brand-btn:hover {
  background-color: rgba(255, 255, 255, 0.45);
}

.brand-btn__logo {
  flex-shrink: 0;
  width: var(--btn-logo-w);
  height: var(--btn-logo-h);
  object-fit: contain;
  pointer-events: none;
}

.brand-btn__text {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  padding-inline: clamp(2px, 0.6vw, 8px);
}

.brand-btn span {
  display: block;
  font-size: clamp(13px, 1.28vw, 15px);
  font-style: normal;
  line-height: 1.25;
  letter-spacing: 0.03em;
  text-transform: capitalize;
}

.brand-btn span i {
  position: relative;
  top: 2px;
  left: 6px;
}

.brand-btn span i img {
  height: 12px;
}

.btn-container h2 {
  line-height: 1.15;
  letter-spacing: 0.04em;
}

.logo-con {
  margin-bottom: clamp(28px, 5vh, 56px);
}

.linklist {
  width: 100%;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: clamp(16px, 4vw, 48px);
  margin-top: clamp(8px, 2vh, 20px);
  padding: 0 clamp(8px, 2vw, 16px);
}

.nav-links li {
  margin: 0;
}

.nav-links a {
  display: inline-block;
  padding: 4px 2px;
  color: #fff;
  font-size: clamp(13px, 1.4vw, 16px);
  font-weight: bold;
  text-decoration: none;
  text-shadow: 1px 4px 3px #000;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.nav-links a:hover {
  color: #2495f1;
  text-shadow: 1px 4px 3px #464545;
}

@media screen and (max-width: 767px) {
  /*
   * 窄屏：内容可能高于一屏（例如 6 个品牌）。不要用整块的垂直居中，
   * 否则容器向上“溢出”，顶部的 welcome 图会被裁掉。
   * 改为从上往下排布 + 外层纵向滚动，保证顶部图始终能滚进视口。
   */
  .btn-con {
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
  }

  .btn-container {
    position: relative;
    left: auto;
    top: auto;
    transform: none;
    width: min(420px, 92vw);
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    margin-top: max(10px, env(safe-area-inset-top, 0px));
    margin-bottom: clamp(24px, 6vh, 48px);
    padding: clamp(12px, 3vh, 24px) clamp(12px, 4vw, 20px) clamp(16px, 3vh, 28px);
  }

  .video-con {
    background-image: url(./images/shoujibeijing.jpg);
  }

  .logo-con {
    margin-bottom: clamp(14px, 2.5vh, 32px);
  }

  .brand-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(12px, 2.2vh, 22px);
    margin-bottom: clamp(18px, 3vh, 36px);
  }

  .brand-btn {
    --btn-logo-w: 60px;
    --btn-logo-h: 60px;
    --btn-logo-gap: clamp(16px, 4.2vw, 22px);
    width: min(300px, 90vw);
    height: 76px;
    margin: 0;
    padding: 0 clamp(14px, 3.5vw, 22px);
    font-size: clamp(16px, 4.2vw, 19px);
  }

  .brand-btn span {
    font-size: clamp(13px, 3.4vw, 15px);
  }

  .btn-container h2 {
    font-size: inherit;
  }

  .nav-links {
    gap: clamp(12px, 3.5vw, 28px);
  }
}

@media screen and (max-width: 374px) {
  .logo-con img {
    width: 150px !important;
    height: auto;
  }
}

@media (orientation: landscape) and (max-height: 500px) {
  .video-con {
    background: url(./images/shoujibeijing.jpg) no-repeat center bottom;
    background-size: cover;
  }

  .logo-con {
    margin-top: 12px;
    margin-bottom: 12px;
  }

  .logo-con img {
    width: 160px !important;
    height: auto;
  }

  .nav-links {
    gap: clamp(10px, 2.5vw, 32px);
    margin-top: 8px;
  }

  .nav-links a {
    font-size: 12px;
  }
}

/* 仅桌面：矮横屏仍用整块垂直居中；避免覆盖上面的手机滚动布局 */
@media (orientation: landscape) and (max-height: 500px) and (min-width: 768px) {
  .btn-container {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(900px, 96vw);
    padding: 12px 16px 20px;
  }

  .brand-row {
    gap: clamp(10px, 1.8vw, 24px);
    margin-bottom: 16px;
  }

  .brand-btn {
    height: 72px;
    font-size: 13px;
  }
}
