/* 愈*考拉 官网首页 —— 宫崎骏风格 · 温暖疗愈 · 极简单屏 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  height: 100dvh; /* 动态视口，iOS 15.4+ / Chrome 108+ 地址栏收起跟随 */
  height: 100svh; /* 静态视口兜底 */
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  /* 安全区：避开 iPhone 刘海与底部主屏指示器 / 微信吸顶 */
  padding-top: env(safe-area-inset-top);
  padding-right: env(safe-area-inset-right);
  padding-bottom: env(safe-area-inset-bottom);
  padding-left: env(safe-area-inset-left);
  overflow: hidden; /* 单屏呈现，不做长滚动 */
  background-color: #faf8f5;
  color: #5c4a3a;
  font-family: "Yuanti SC", "YouYuan", "Kaiti SC", "KaiTi", "DFKai-SB", sans-serif;
  display: flex;
  flex-direction: column;
  /* 阻止下拉刷新触发整页刷新（移动浏览器默认手势） */
  overscroll-behavior-y: contain;
  /* iOS Safari 滚动加速 */
  -webkit-overflow-scrolling: touch;
}

/* ---------- 全屏治愈场景背景 ---------- */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url("../images/bg-scene.webp") center / cover no-repeat;
  animation: fade-in 1.5s ease-out both;
}

/* 中央文字区叠加极淡暖白晕染，保证标语可读性 */
.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 60% 55% at 50% 42%,
    rgba(250, 248, 245, 0.55),
    rgba(250, 248, 245, 0) 70%
  );
}

/* ---------- 站名（左上角，低调） ---------- */
.brand {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 22px 32px;
  animation: fade-in 1.2s ease-out both;
}

.brand-cn {
  font-size: 20px;
  letter-spacing: 2px;
  color: #7a6450;
  white-space: nowrap; /* 中文连写不折行 */
}

.brand-en {
  font-size: 12px;
  letter-spacing: 1px;
  color: #a08c76;
}

/* ---------- 背景音乐开关（右上角旋转音符） ---------- */
.bgm-btn {
  position: fixed;
  top: 20px;
  right: 26px;
  z-index: 3;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(250, 248, 245, 0.78);
  color: #7a6450;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(122, 100, 80, 0.16);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: fade-in 1.2s ease-out both;
}

.bgm-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(122, 100, 80, 0.24);
}

.bgm-btn svg {
  animation: note-spin 3.2s linear infinite; /* 播放中：音符持续旋转 */
}

.bgm-btn.is-muted svg {
  animation-play-state: paused; /* 关闭后：音符停转、变淡 */
  opacity: 0.5;
}

@keyframes note-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- 首屏主体 ---------- */
.hero {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 0 24px 24px;
  animation: fade-in 1.4s ease-out both;
}

.slogan {
  text-align: center;
  font-weight: 500;
  font-size: clamp(26px, 3.6vw, 46px);
  line-height: 1.55;
  letter-spacing: 3px;
  color: #5a4632;
  text-shadow: 0 1px 12px rgba(250, 248, 245, 0.85);
}

.slogan span {
  display: block; /* 长句拆两行居中 */
}

.koala {
  width: clamp(160px, 24vh, 260px);
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 24px;
  box-shadow: 0 10px 30px rgba(122, 100, 80, 0.18);
}

/* ---------- 唯一入口按钮 ---------- */
.enter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  min-height: 56px;
  padding: 0 56px;
  border-radius: 999px;
  background: #e8875a; /* 暖橙强调色，与背景强对比 */
  color: #fff8f2;
  font-size: 20px;
  letter-spacing: 6px;
  text-indent: 6px;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(232, 135, 90, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.enter:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 26px rgba(232, 135, 90, 0.5), 0 0 0 6px rgba(232, 135, 90, 0.12);
}

/* 按压态：移动端提供触觉反馈（translateZ 独立合成层避免 iOS 重绘闪烁） */
.enter:active {
  transform: scale(0.97) translateZ(0);
  box-shadow: 0 3px 10px rgba(232, 135, 90, 0.4);
  transition-duration: 60ms;
}

/* ---------- 页脚合规声明（一行小字，低调） ---------- */
.notice {
  position: relative;
  z-index: 1;
  padding: 12px 24px 16px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: rgba(92, 74, 58, 0.62);
}

/* ---------- 移动端竖屏适配 ---------- */
@media (max-width: 768px) {
  .hero {
    gap: 20px;
    padding: 0 16px 20px;
  }

  .koala {
    width: clamp(140px, 30vw, 200px);
  }

  .slogan {
    font-size: clamp(22px, 6.4vw, 32px);
    letter-spacing: 2px;
  }

  .enter {
    min-height: 48px; /* 触控区域不小于 48px */
    font-size: 18px;
    padding: 0 44px;
    letter-spacing: 4px;
  }

  .notice {
    font-size: 11px;
    padding: 10px 16px 12px;
  }

  .bgm-btn {
    top: calc(16px + env(safe-area-inset-top));
    right: calc(20px + env(safe-area-inset-right));
  }
}

/* ---------- 超窄屏（≤480px）进一步压缩：slogan 不折行难看，考拉图与按钮更紧凑 ---------- */
@media (max-width: 480px) {
  .brand {
    padding: 16px 20px;
  }
  .brand-cn {
    font-size: 18px;
  }
  .brand-en {
    font-size: 11px;
  }
  .slogan {
    font-size: clamp(20px, 5.6vw, 26px);
    letter-spacing: 1.5px;
    line-height: 1.5;
  }
  .koala {
    width: clamp(120px, 36vw, 160px);
  }
  .enter {
    min-width: 160px;
    font-size: 17px;
    padding: 0 32px;
  }
}

/* ---------- 横屏：内容区压缩，安全区生效 ---------- */
@media (max-height: 480px) and (orientation: landscape) {
  .hero {
    gap: 14px;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-content: center;
    padding: 12px 20px;
  }
  .slogan {
    flex: 1 1 100%;
    font-size: clamp(18px, 3.4vw, 24px);
    margin-bottom: 4px;
  }
  .koala {
    width: clamp(80px, 16vh, 120px);
  }
  .enter {
    min-height: 44px;
    font-size: 16px;
    padding: 0 28px;
  }
  .notice {
    font-size: 10px;
    padding: 6px 16px 8px;
  }
}

/* ---------- 载入淡入（≤1.5s） ---------- */
@keyframes fade-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- 微信内置浏览器（X5）兜底：禁用 backdrop-filter，提升响应为吸顶 ---------- */
.wechat-x5 .bgm-btn {
  background: rgba(250, 248, 245, 0.95);
  box-shadow: 0 4px 12px rgba(122, 100, 80, 0.22);
}

@media (prefers-reduced-motion: reduce) {
  .scene,
  .brand,
  .hero,
  .bgm-btn {
    animation: none;
  }

  .bgm-btn svg {
    animation: none;
  }
}
