/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* 主容器样式 */
body {
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", SimHei, Arial, Helvetica, sans-serif;
  background-color: #f9f6f0;
  color: #666666;
  line-height: 1.6;
}

/* 头部样式 */
.header {
  max-width: 1920px;
  margin: 0 auto;
  padding: 20px 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* 头部右侧操作区:立即登录 + 立即下载 */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 立即登录:次要操作,用描边区别于下载的实心按钮,避免两个同权重按钮打架 */
.login-link {
  display: inline-block;
  background-color: transparent;
  color: #9e7742;
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", SimHei, Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 24px;
  padding: 8px 23px 7px;
  border: 1px solid #9e7742;
  border-radius: 9999px;
  text-decoration: none;
  transition: all 0.3s ease;
}

.login-link:hover {
  background-color: rgba(158, 119, 66, 0.08);
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.login-link:active {
  transform: translateY(0);
}

.download-link {
  display: inline-block;
  background-color: #9e7742;
  color: #ffffff;
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", SimHei, Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 24px;
  padding: 9px 24px 8px;
  border-radius: 9999px;
  box-shadow: 0px 2px 4px -2px rgba(0, 0, 0, 0.1), 0px 4px 6px -1px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  transition: all 0.3s ease;
}

.download-link:hover {
  background-color: #8a6635;
  box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.15);
  transform: translateY(-1px);
}

.download-link:active {
  transform: translateY(0);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo img {
  width: 40px;
  height: 40px;
}

.logo-text {
  font-family: "Noto Serif SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", SimHei, Arial, Helvetica, sans-serif;
  font-size: 24px;
  font-weight: 700;
  color: #9e7742;
}

/* 英雄区域样式 */
.hero {
  max-width: 1920px;
  margin: 0 auto;
  padding: 64px 50px 0;
  text-align: center;
}

.hero-title {
  font-family: "Noto Serif SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", SimHei, Arial, Helvetica, sans-serif;
  font-size: 48px;
  font-weight: 700;
  color: #9e7742;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
  margin-bottom: 15px;
  line-height: 1.3;
}

.hero-subtitle {
  font-size: 20px;
  color: #666666;
  margin-bottom: 100px;
}

/* 应用展示区域 —— 一屏固定显示 4 张,左右切换查看全部 7 张
   支持鼠标拖拽 / 触屏滑动 / 箭头点击 / 键盘左右键 */
.app-showcase {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  /* 一屏显示几张 + 图间距,JS 也读这两个变量算滚动步长 */
  --showcase-visible: 4;
  --showcase-gap: 40px;
  /* 底部留白单独抽成变量:箭头垂直居中要减掉它 */
  --showcase-pad-bottom: 100px;
  padding: 0 60px var(--showcase-pad-bottom);
}

.showcase-track {
  display: flex;
  gap: var(--showcase-gap);
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  /* 隐藏滚动条但保留滚动能力 */
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 0;
  /* 触屏惯性滚动 */
  -webkit-overflow-scrolling: touch;
  cursor: grab;
}

.showcase-track::-webkit-scrollbar {
  display: none;
}

.showcase-track.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
  scroll-snap-type: none;
}

.app-screenshot {
  /* 宽度 = (容器宽 - 间距总和) / 可见张数,使一屏正好排满 N 张。
     <img> 有固有尺寸,只写 flex-basis 不够 —— 必须同时写 width,
     否则图片会按自身像素宽渲染,撑破每屏 N 张的布局。 */
  --showcase-item-width: calc(
    (100% - var(--showcase-gap) * (var(--showcase-visible) - 1))
    / var(--showcase-visible)
  );
  flex: 0 0 var(--showcase-item-width);
  width: var(--showcase-item-width);
  /* 比例取自截图原始尺寸 470x894,必须与实际图一致 ——
     若沿用别的比例,配合 object-fit 会裁掉画面内容。 */
  aspect-ratio: 470 / 894;
  height: auto;
  /* contain 保证整张截图完整可见(不裁切);图与容器比例已一致,不会留白 */
  object-fit: contain;
  border: 1px solid #9e7742;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  scroll-snap-align: start;
  user-select: none;
  -webkit-user-drag: none;
}

/* 左右箭头:与图片轨道垂直居中。
   注意不能直接用 top:50% —— .app-showcase 有 padding-bottom,
   50% 会算进 padding 导致箭头偏下。这里用轨道自身高度定位。 */
.showcase-arrow {
  position: absolute;
  top: calc((100% - var(--showcase-pad-bottom)) / 2);
  transform: translateY(-50%);
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 1px solid #9e7742;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #9e7742;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 4px;
  transition: background 0.2s, opacity 0.2s;
}

.showcase-arrow:hover {
  background: #9e7742;
  color: #fff;
}

.showcase-arrow[disabled] {
  opacity: 0.3;
  cursor: default;
}

.showcase-arrow[disabled]:hover {
  background: rgba(255, 255, 255, 0.92);
  color: #9e7742;
}

.showcase-arrow-prev {
  left: 8px;
}

.showcase-arrow-next {
  right: 8px;
}

/* 触屏设备隐藏箭头,直接滑动 */
@media (hover: none) and (pointer: coarse) {
  .showcase-arrow {
    display: none;
  }
}

/* 分页小点 —— 放在图片下方留白区内。
   .app-showcase 有 padding-bottom(--showcase-pad-bottom),小点绝对定位到
   那块留白里,这样不会把整段撑高、也不影响箭头的垂直居中计算。 */
.showcase-dots {
  position: absolute;
  left: 0;
  right: 0;
  /* 距底部留白的中间偏上位置,视觉上贴着图片下沿 */
  bottom: calc(var(--showcase-pad-bottom) / 2 - 5px);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.showcase-dot {
  /* 命中区域按可点击控件给足 —— 视觉上是 10px 圆点,
     但用透明 padding 把实际可点/可触区域扩到约 26px,
     否则手机上很难点中(移动端无障碍最小触控目标 24px)。 */
  width: 10px;
  height: 10px;
  padding: 8px;
  box-sizing: content-box;
  background: transparent;
  border: none;
  cursor: pointer;
  /* 用背景色画圆点,避免再套一层元素 */
  background-clip: content-box;
  background-color: #d8c9ae;
  border-radius: 50%;
  transition: background-color 0.25s ease, transform 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}

.showcase-dot:hover {
  background-color: #b99a63;
}

.showcase-dot.is-active {
  background-color: #9e7742;
  transform: scale(1.25);
}

/* 键盘可见焦点(鼠标点击不显示,仅键盘导航时出现) */
.showcase-dot:focus-visible {
  outline: 2px solid #9e7742;
  outline-offset: 3px;
}

/* 用户开启"减少动效"时去掉缩放与过渡 */
@media (prefers-reduced-motion: reduce) {
  .showcase-dot {
    transition: none;
  }
  .showcase-dot.is-active {
    transform: none;
  }
}

/* 功能特点区域 */
.features {
  max-width: 1920px;
  margin: 0 auto;
  padding: 0 50px 100px;
  display: flex;
  justify-content: center;
  gap: 149px;
  flex-wrap: wrap;
}

.feature-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 56px 35px;
  text-align: center;
  max-width: 320px;
  backdrop-filter: blur(2px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.feature-title {
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", SimHei, Arial, Helvetica, sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: #9e7742;
  margin-bottom: 24px;
  line-height: 1.2;
}

.feature-description {
  font-size: 20px;
  color: #666666;
  line-height: 1.4;
}

/* 页脚样式 */
.footer {
  max-width: 1920px;
  margin: 0 auto;
  padding: 40px 50px 36px;
  border-top: 1px solid rgba(249, 246, 240, 0.8);
  text-align: center;
}

.qr-code-section {
  margin-bottom: 40px;
}

.qr-code-container {
  display: inline-block;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 8px;
  margin-bottom: 8px;
}

.qr-code {
  width: 112px;
  height: 112px;
  border-radius: 8px;
}

.qr-code-text {
  font-size: 14px;
  color: #666666;
  margin-top: 8px;
}

.footer-disclaimer {
  font-size: 14px;
  color: #666666;
  margin-bottom: 28px;
  line-height: 1.4;
}

.footer-copyright {
  font-size: 12px;
  color: #666666;
}

.a {
  color: #666666;
  text-decoration: none;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .app-showcase {
    --showcase-gap: 30px;
  }
  
  .features {
    gap: 80px;
  }
  
  .hero-title {
    font-size: 40px;
  }
  
  .feature-title {
    font-size: 30px;
  }
}

@media (max-width: 768px) {
  .header {
    padding: 20px 20px;
  }
  
  /* 两个按钮 + logo 在窄屏容易挤,收紧间距与内边距 */
  .header-actions {
    gap: 8px;
  }

  .login-link,
  .download-link {
    font-size: 15px;
    padding: 8px 16px 7px;
  }

  .login-link {
    padding: 7px 15px 6px;
  }
  
  .hero {
    padding: 40px 20px 0;
  }
  
  .hero-title {
    font-size: 32px;
  }
  
  .hero-subtitle {
    font-size: 18px;
    margin-bottom: 60px;
  }
  
  /* 平板:一屏 3 张,4 张会太窄看不清 */
  .app-showcase {
    --showcase-visible: 3;
    --showcase-gap: 20px;
    --showcase-pad-bottom: 60px;
    padding: 0 44px var(--showcase-pad-bottom);
  }
  
  .features {
    padding: 0 20px 60px;
    gap: 40px;
  }
  
  .feature-card {
    padding: 40px 25px;
    max-width: 240px;
  }
  
  .feature-title {
    font-size: 28px;
  }
  
  .feature-description {
    font-size: 18px;
  }
  
  .footer {
    padding: 30px 20px 26px;
  }
}

@media (max-width: 480px) {
  /* 手机窄屏:进一步压缩按钮,保证 logo 与两个按钮同行不换行 */
  .header {
    padding: 16px 14px;
  }

  .header-actions {
    gap: 6px;
  }

  .login-link,
  .download-link {
    font-size: 13px;
    padding: 7px 12px 6px;
    white-space: nowrap;
  }

  .login-link {
    padding: 6px 11px 5px;
  }
  
  .hero-title {
    font-size: 28px;
  }
  
  .hero-subtitle {
    font-size: 16px;
  }
  
  /* 手机:一屏 2 张,横向滑动查看其余(不纵向堆叠,否则首页被撑很长) */
  .app-showcase {
    --showcase-visible: 2;
    --showcase-gap: 16px;
    --showcase-pad-bottom: 60px;
    padding: 0 20px var(--showcase-pad-bottom);
  }
  
  .features {
    flex-direction: column;
    align-items: center;
    gap: 30px;
  }
  
  .feature-card {
    max-width: 280px;
  }
  
  .feature-title {
    font-size: 24px;
  }
  
  .feature-description {
    font-size: 16px;
  }
}
