:root {
  --shell-viewport-pad-top: max(12px, env(safe-area-inset-top, 0px));
  --shell-viewport-pad-right: max(12px, env(safe-area-inset-right, 0px));
}

/* 首页：语言切换离右上角稍远，避免贴边 */
.home-lang-switch {
  top: max(clamp(24px, 3vmin, 40px), env(safe-area-inset-top, 0px));
  right: max(clamp(32px, 4vmin, 56px), env(safe-area-inset-right, 0px));
}

body.lang-zh .home-nav__link {
  font-family: 'GenWanMinF', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-weight: 700;
}

@font-face {
  font-family: 'Lilita One';
  src: url('../../fonts/LilitaOne-Regular.ttf') format('truetype');
  font-display: swap;
  font-weight: 400;
  font-style: normal;
}

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

html,
body {
  margin: 0;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  background: #c8dff5;
}

/* 底图设计稿 5333×3000 */
:root {
  --home-art-w: 5333;
  --home-art-h: 3000;
}

.home-page {
  position: fixed;
  inset: 0;
  overflow: hidden;
  padding:
    env(safe-area-inset-top, 0px)
    env(safe-area-inset-right, 0px)
    env(safe-area-inset-bottom, 0px)
    env(safe-area-inset-left, 0px);
  box-sizing: border-box;
}

.home-page__bg {
  position: absolute;
  top: 50%;
  left: 50%;
  height: 100%;
  width: auto;
  max-width: none;
  transform: translate(-50%, -50%);
  pointer-events: none;
  user-select: none;
}

.home-nav {
  position: absolute;
  left: 0;
  right: 0;
  /* 按设计稿比例：距底约 4.3% */
  bottom: calc((130 / var(--home-art-h) * 100%) + env(safe-area-inset-bottom, 0px));
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(8px, 1.2vw, 16px);
  /* 左右留白约 4.9%，并保证窄屏/刘海屏不贴边 */
  padding: 0 max(calc(100vw * 260 / var(--home-art-w)), clamp(20px, 5vw, 48px));
  box-sizing: border-box;
}

.home-nav__link {
  flex: 1 1 0;
  text-align: center;
  font-family: 'Lilita One', 'Arial Black', Arial, sans-serif;
  font-size: clamp(16px, 2.35vw, 34px);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.1;
  color: #2d7fde;
  text-decoration: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: color 0.15s ease, transform 0.15s ease;
}

.home-nav__link:hover,
.home-nav__link:focus-visible {
  color: #0859b6;
  transform: translateY(-1px);
}

.home-nav__link:focus-visible {
  outline: 2px solid #2d7fde;
  outline-offset: 3px;
}

/* 仅手机横屏：底图 cover 铺满，避免两侧留白；桌面不变 */
@media (orientation: landscape) and (max-width: 1024px) and (hover: none) and (pointer: coarse) {
  .home-page__bg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
  }
}

/* Wix iframe 嵌入：任意桌面/平板尺寸均 cover 铺满，避免两侧与底部露浅蓝底 */
html.shell--embed .home-page__bg,
html[data-embed="1"] .home-page__bg {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  transform: none;
  object-fit: cover;
  object-position: center center;
}

@media (max-width: 640px) {
  .home-nav {
    padding-inline: calc(100vw * 48 / var(--home-art-w));
    gap: 4px;
    bottom: calc((72 / var(--home-art-h) * 100%) + env(safe-area-inset-bottom, 0px));
  }

  .home-nav__link {
    font-size: clamp(12px, 3.4vw, 18px);
    letter-spacing: 0.02em;
  }
}

/* 竖屏横屏提示：盖住首页浅蓝底，避免提示框下方露色 */
@media (orientation: portrait) and (max-width: 1024px) {
  html.shell--portrait-blocked,
  body.shell--portrait-blocked {
    background: #ffffff;
    min-height: 100dvh;
    height: 100dvh;
  }
}

/* iOS 主屏幕引导条区域与底栏对齐，避免横屏时提示下方露浅蓝底 */
@media (orientation: landscape) and (max-width: 1024px) {
  body.shell--ios-hint-visible {
    background: #c8dff5;
  }

  body.shell--ios-hint-visible .shell-ios-hint {
    background: #ffffff;
  }
}
