/* 风暴之眼 v2 — 设计令牌、字体、重置、全站骨架
   视觉语言取自参考站 fengyan.com：深黑底、纯白正文、米金强调色、120px 顶栏。 */

/* ---------- 自托管字体（阿里普惠体 / 阿里妈妈东方大楷，已按本站字表子集化） ---------- */

@font-face {
  font-family: "AlibabaPuHuiTi";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/AlibabaPuHuiTi-3-55-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "AlibabaPuHuiTi";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/AlibabaPuHuiTi-3-65-Medium.woff2") format("woff2");
}

@font-face {
  font-family: "AlibabaPuHuiTi";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/AlibabaPuHuiTi-3-85-Bold.woff2") format("woff2");
}

@font-face {
  font-family: "AlimamaDongFangDaKai";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/AlimamaDongFangDaKai-Regular.woff2") format("woff2");
}

/* ---------- 令牌 ---------- */

:root {
  --c-bg: #0a0a0a;
  --c-bg-lift: #141414;
  --c-scrim: rgba(0, 0, 0, 0.7);
  --c-scrim-soft: rgba(0, 0, 0, 0.4);

  --c-text: #ffffff;
  --c-text-soft: #d9d9d9;
  --c-text-dim: rgba(255, 255, 255, 0.55);
  --c-text-faint: rgba(255, 255, 255, 0.32);

  --c-accent: #c9b98a;
  --c-accent-bright: #e3d6b0;
  --c-accent-dim: rgba(201, 185, 138, 0.45);

  --c-line: rgba(201, 185, 138, 0.22);
  --c-line-soft: rgba(255, 255, 255, 0.1);

  --font-body: "AlibabaPuHuiTi", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --font-display: "AlimamaDongFangDaKai", "AlibabaPuHuiTi", "Microsoft YaHei", sans-serif;

  --text-xs: 12px;
  --text-sm: 14.25px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-h3: 24px;
  --text-h2: 48px;
  --text-scene: 42px;
  --text-hero: clamp(36px, 4.6vw, 66px);

  --space-xs: 8px;
  --space-sm: 15px;
  --space-md: 22.5px;
  --space-lg: 37.5px;
  --space-xl: 60px;

  --nav-h: 120px;
  --footer-h: 234px;
  --shell: min(1440px, calc(100% - 64px));
  --gutter: 45px;

  --dur-fast: 160ms;
  --dur-base: 280ms;
  --dur-slow: 520ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  --z-nav: 60;
  --z-modal: 90;
}

/* ---------- 重置 ---------- */

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--c-text);
  background: var(--c-bg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* 固定底纹：内页在它上面铺内容，首页面板各自盖住它 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(201, 185, 138, 0.07), transparent 62%),
    radial-gradient(90% 70% at 88% 100%, rgba(255, 255, 255, 0.05), transparent 66%),
    var(--c-bg);
}

body.is-locked {
  overflow: hidden;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 400;
  line-height: 1.1;
}

p {
  margin: 0 0 1em;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--c-accent-bright);
  outline-offset: 3px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 版心 ---------- */

.shell {
  width: var(--shell);
  margin: 0 auto;
}

.page-main {
  min-height: 60vh;
  padding-top: var(--nav-h);
}

/* 区块标题：参考站 48px / 字距 1.92px / 米金 */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.section-head__title {
  font-size: var(--text-h2);
  letter-spacing: 0.04em;
  line-height: 1;
  color: var(--c-accent);
}

.section-head__en {
  display: block;
  margin-bottom: 8px;
  color: var(--c-text-faint);
  font-size: var(--text-xs);
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

.section-head__more {
  flex: none;
  color: var(--c-text-dim);
  font-size: var(--text-sm);
  transition: color var(--dur-fast);
}

.section-head__more:hover {
  color: var(--c-accent-bright);
}

/* ---------- 顶栏 120px（参考站 site-header） ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  padding: 15px 22.5px 37.5px;
  background: linear-gradient(180deg, var(--c-scrim) 0%, rgba(0, 0, 0, 0.3) 50%, transparent 100%);
  transition: background var(--dur-base), backdrop-filter var(--dur-base);
}

/* 首页顶栏整体上移 40px，给 logo 留出完整显示空间 */
body:has(.panel-stack) .site-header {
  padding-top: 55px;
  height: calc(var(--nav-h) + 40px);
}

/* 首页 logo 再向下、向右各移 80px */
body:has(.panel-stack) .site-header__logo {
  margin-top: 80px;
  margin-left: 80px;
}

/* 顶栏加高的 40px 只为 logo 让位，导航不能跟着下沉：脱离文档流后按内页的内容盒
   定位（顶距 15px、高 120 - 15 - 37.5 = 67.5px），导航项居中后与「职业」「玩家中心」
   落在同一坐标 y = 15 + (67.5 - 49) / 2 = 24px。移动端是汉堡下拉，不套用这条。 */
@media (min-width: 901px) {
  body:has(.panel-stack) .site-header__right {
    position: absolute;
    top: 15px;
    right: 22.5px;
    height: calc(var(--nav-h) - 15px - 37.5px);
  }
}

.site-header.is-solid {
  background: rgba(10, 10, 10, 0.94);
  backdrop-filter: blur(14px);
}

.site-header__logo {
  display: block;
  flex: none;
}

/* logo 位图四周留了大片透明边距，实际字形只占中间约一半。
   位图放大 2 倍（360×272），上下各 -76px 负外边距抵消超出 header(120px) 的部分：
   字形视觉高度约 136px（原 68px × 2），溢出的全是透明边距，不会压住页面内容。 */
.site-header__logo {
  overflow: visible;
}

.site-header__logo img {
  display: block;
  width: 360px;
  height: 272px;
  margin: -76px 0;
  object-fit: contain;
  overflow: visible;
}

/* 内页（职业、玩家中心等）不显示顶栏 logo，避免与内容重叠 */
body:not(:has(.panel-stack)) .site-header__logo {
  display: none;
}

/* 导航始终贴右：内页隐藏 logo 后 space-between 只剩一个子元素，
   会被推到最左边（父元素 display:none 时 ::after 占位也失效），
   这里用 auto 外距兜住 */
.site-header__right {
  display: flex;
  align-items: center;
  gap: 22.5px;
  margin-left: auto;
}

.site-header__nav {
  display: flex;
  align-items: center;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  color: var(--c-text);
  font-size: 16px;
  line-height: 1.95;
  letter-spacing: 0.04em;
  white-space: nowrap;
  transition: color var(--dur-fast);
}

.nav-item:hover,
.nav-item[aria-current="page"] {
  color: var(--c-accent-bright);
}

.site-header__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
}

.site-header__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 0 auto;
  background: var(--c-accent);
  transition: transform var(--dur-base) var(--ease-out), opacity var(--dur-fast);
}

.site-header__toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-header__toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.site-header__toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- 页脚：logo 左上，链接+备案号右下。
   高度按内容自适应——234px 是参考站行数（防沉迷/批准文号/联系电话）撑出来的，
   本站页脚只有三行文字，固定 min-height 会在备案下方留一大段空黑。 ---------- */

.site-footer {
  position: relative;
  padding: 30px 0;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.8));
  color: var(--c-text-dim);
  font-size: var(--text-xs);
  line-height: 2;
}

.site-footer__content {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 24px;
  width: 100%;
  padding: 0 var(--gutter);
}

.site-footer__logo {
  width: 72px;
  height: 52px;
  object-fit: contain;
  justify-self: start;
}

.site-footer__info {
  justify-self: end;
  text-align: right;
  min-width: 0;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px 18px;
  margin-bottom: 8px;
}

.site-footer__links a {
  color: var(--c-text-dim);
  transition: color var(--dur-fast);
}

.site-footer__links a:hover {
  color: var(--c-accent-bright);
}

.site-footer__records {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 16px;
}

.site-footer__records a:hover {
  color: var(--c-accent-bright);
}

/* 客服二维码弹层：页脚、首页玩家中心面板、玩家中心页共用同一套样式 */
.service-qr {
  position: relative;
  display: inline-block;
}

.service-qr__pop {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  z-index: var(--z-modal, 60);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--c-line);
  background: var(--c-bg-lift);
  text-align: center;
  white-space: nowrap;
}

.service-qr__pop[hidden] {
  display: none;
}

.service-qr__pop img {
  display: block;
  width: 180px;
  /* 覆盖全局 img 的 max-width: 100%：弹层是绝对定位收缩容器，
     百分比会循环解析把 180px 压到 ~94px，高度反而被文字区撑出空白 */
  max-width: none;
  height: auto;
}

.service-qr__tip {
  color: var(--c-text-dim);
  font-size: var(--text-xs);
  line-height: 1.4;
}

.site-footer__service-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--c-text-dim);
  font: inherit;
  line-height: inherit;
  cursor: pointer;
  transition: color var(--dur-fast);
}

.site-footer__service-btn:hover {
  color: var(--c-accent-bright);
}

.site-footer__service-btn[aria-expanded="true"] {
  color: var(--c-accent-bright);
}

/* 首页第一屏：页脚由 JS 挂进 #hero，absolute 贴面板右下角；
   只出现在第一屏，滚离即随面板滚走（不做全页悬浮，避免遮挡内容） */
#hero .site-footer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: auto;
  z-index: 50;
  min-height: 0;
  padding: 0;
  background: none;
  text-align: right;
  pointer-events: none;
  width: auto;
}

#hero .site-footer__content {
  display: block;
  min-height: 0;
  padding: 0;
  width: auto;
}

#hero .site-footer__logo {
  display: none;
}

#hero .site-footer__info {
  position: absolute;
  top: auto;
  right: 24px;
  bottom: 20px;
  left: auto;
  width: auto;
  padding: 0;
  text-align: right;
  pointer-events: auto;
}


.panel-stack {
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  /* proximity 而不是 mandatory：避免页脚小屏被吸附卡住滚不到 */
  scroll-snap-type: y proximity;
  scroll-behavior: smooth;
}

.page-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  scroll-snap-align: start;
  overflow: hidden;
}

/* 页脚面板不需要强制吸附，允许停在任意位置 */
.page-panel--footer {
  min-height: var(--footer-h);
  justify-content: flex-end;
  scroll-snap-align: none;
}

.page-panel__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

/* 旧站首屏底图不带遮罩，黑色半透明渐变层已按需求移除 */

.page-panel > *:not(.page-panel__bg) {
  position: relative;
  z-index: 1;
}

/* ---------- 通用组件 ---------- */

.panel {
  border: 1px solid var(--c-line-soft);
  background: rgba(20, 20, 20, 0.82);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 26px;
  border: 1px solid var(--c-accent-dim);
  background: rgba(201, 185, 138, 0.12);
  color: var(--c-accent-bright);
  font-size: var(--text-sm);
  letter-spacing: 0.1em;
  transition: border-color var(--dur-fast), background var(--dur-fast), color var(--dur-fast);
}

.btn:hover {
  border-color: var(--c-accent-bright);
  background: rgba(201, 185, 138, 0.22);
  color: #fff;
}

.btn--primary {
  border-color: var(--c-accent-bright);
  background: var(--c-accent-bright);
  color: #1a1408;
  font-weight: 500;
}

.btn--primary:hover {
  background: #fff3d8;
  color: #120d04;
}

.btn--ghost {
  border-color: var(--c-line-soft);
  background: rgba(255, 255, 255, 0.04);
  color: var(--c-text-dim);
}

.btn--ghost:hover {
  border-color: var(--c-accent-dim);
  color: var(--c-accent-bright);
}

.notice {
  margin: 0;
  padding: 12px 16px;
  border-left: 2px solid var(--c-accent);
  background: rgba(201, 185, 138, 0.08);
  color: var(--c-text-dim);
  font-size: var(--text-sm);
}

/* 返回按钮（参考站 back-btn） */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--c-text-dim);
  font-size: var(--text-sm);
  transition: color var(--dur-fast);
}

.back-btn::before {
  content: "";
  width: 7px;
  height: 7px;
  border-left: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
}

.back-btn:hover {
  color: var(--c-accent-bright);
}

@media (prefers-reduced-motion: reduce) {
  html,
  .panel-stack {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- 响应式 ---------- */

@media (max-width: 900px) {
  :root {
    --shell: calc(100% - 32px);
    --nav-h: 68px;
    --footer-h: auto;
    --text-h2: 30px;
    --text-scene: 28px;
    --gutter: 16px;
  }

  .site-header {
    padding: 10px 16px 20px;
  }

  /* 移动端首页顶栏也增加 padding-top，保持 logo 完整 */
  body:has(.panel-stack) .site-header {
    padding-top: 30px;
    height: calc(var(--nav-h) + 20px);
  }

  .site-header__logo img {
    width: 104px;
    height: 80px;
    margin: -22px 0;
  }

  /* 移动端首页 logo 同步下移右移（按桌面 80px 等比缩放） */
  body:has(.panel-stack) .site-header__logo {
    margin-top: 23px;
    margin-left: 23px;
  }

  .site-header__toggle {
    display: flex;
  }

  .site-header__right {
    gap: 12px;
  }

  .site-header__nav {
    position: fixed;
    inset: var(--nav-h) 0 auto;
    flex-direction: column;
    align-items: stretch;
    padding: 8px 0 20px;
    border-bottom: 1px solid var(--c-line-soft);
    background: rgba(10, 10, 10, 0.98);
    transform: translateY(-12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-base), transform var(--dur-base) var(--ease-out);
  }

  .site-header__nav.is-open {
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }

  .nav-item {
    padding: 14px 22.5px;
    font-size: var(--text-base);
  }

  /* 窄屏放弃全屏滚动对齐，回到普通文档流。
     hero 保留 100svh 满屏（由 home.css 控制），其它面板高度自适应。 */
  .panel-stack {
    height: auto;
    overflow: visible;
    scroll-snap-type: none;
  }

  .page-panel {
    min-height: auto;
    scroll-snap-align: none;
  }

  /* 内页版式面板（职业/场景/新闻/玩家中心）保留顶栏间距；
     hero 由 home.css 单独控制，不在此加 padding。 */
  .page-panel:not(#hero) {
    padding: calc(var(--nav-h) + 40px) 0 40px;
  }

  .site-footer__content {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .site-footer__logo {
    justify-self: start;
  }

  .site-footer__info {
    justify-self: end;
    width: 100%;
  }
}
