/* ==========================================================================
  虎宝游戏 HUBO GAMES · 品牌官网样式表
  设计基准：PC 优先（1440 / 1920），向下自适应到手机，向上自适应到超宽屏
  配色：以白色为主，点缀取自品牌 Logo 的金黄 / 青绿 / 宝蓝 / 玫红
  （游戏封面与首屏主视觉上的压暗蒙层属于图片处理，不随主题变化）
   ========================================================================== */

/* ---------- 1. 设计变量 ---------- */
:root {
  --bg: #ffffff;
  --bg-soft: #f6f7fb;
  --bg-elevated: #ffffff;
  --text: #14161d;
  --text-2: rgba(20, 22, 29, 0.66);
  --text-3: rgba(20, 22, 29, 0.44);
  --line: rgba(20, 24, 38, 0.1);
  --line-strong: rgba(20, 24, 38, 0.2);
  --surface: rgba(20, 24, 38, 0.035);
  --surface-hover: rgba(20, 24, 38, 0.07);

  --brand-yellow: #ffd23f;
  --brand-green: #35e0a1;
  --brand-blue: #3d7bff;
  --brand-pink: #ff3d7f;
  --brand-gradient: linear-gradient(115deg, #ffd23f 0%, #35e0a1 36%, #3d7bff 68%, #ff3d7f 100%);
  /* 白底上使用的深色版品牌渐变，保证文字对比度 */
  --brand-gradient-ink: linear-gradient(
    115deg,
    #f0a400 0%,
    #10b981 36%,
    #2f5cf6 68%,
    #f5296e 100%
  );
  --link: #2f5cf6;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --container: 1280px;
  --gutter: clamp(20px, 4vw, 56px);
  --section-y: clamp(80px, 8vw, 148px);
  --header-h: 78px;

  --ease: cubic-bezier(0.22, 0.68, 0.24, 1);
  --shadow-card: 0 22px 54px rgba(19, 24, 44, 0.15);
  --shadow-glow: 0 18px 60px rgba(61, 123, 255, 0.22);
}

/* ---------- 2. 基础重置 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Hiragino Sans GB",
    "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
picture,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
}

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

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

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.18;
}

p {
  margin: 0;
}

ul,
ol,
dl,
dd {
  margin: 0;
  padding: 0;
  list-style: none;
}

:focus-visible {
  outline: 2px solid var(--brand-blue);
  outline-offset: 3px;
  border-radius: 6px;
}

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: 12px 20px;
  background: var(--text);
  color: #fff;
  border-radius: 0 0 12px 0;
  font-weight: 700;
}

.skip-link:focus {
  left: 0;
}

/* ---------- 3. 布局工具 ---------- */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  position: relative;
  padding-block: var(--section-y);
}

/* 首位版块（首屏轮播已移除）：顶部让出固定页头的高度，再留出常规间距 */
#games {
  padding-top: calc(var(--header-h) + clamp(28px, 4vw, 64px));
}

.section-alt {
  background: linear-gradient(180deg, rgba(20, 24, 38, 0.035) 0%, rgba(20, 24, 38, 0) 100%);
  border-block: 1px solid rgba(20, 24, 38, 0.06);
}

.section-head {
  max-width: 760px;
  margin-bottom: clamp(36px, 4vw, 60px);
}

.section-index {
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: transparent;
  background: var(--brand-gradient-ink);
  -webkit-background-clip: text;
  background-clip: text;
}

.section-index span {
  opacity: 0.6;
}

.section-title {
  font-size: clamp(28px, 2.6vw, 46px);
  margin-bottom: 18px;
}

.section-desc {
  font-size: clamp(15px, 1.05vw, 17px);
  color: var(--text-2);
}

.grad-text {
  color: transparent;
  background: var(--brand-gradient-ink);
  -webkit-background-clip: text;
  background-clip: text;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  transition: transform 0.25s var(--ease), background-color 0.25s var(--ease),
    border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), color 0.25s var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-lg {
  padding: 16px 34px;
  font-size: 16px;
}

.btn-primary {
  background: var(--text);
  color: #fff;
  box-shadow: 0 10px 30px rgba(19, 24, 44, 0.22);
}

.btn-primary:hover {
  background: #000;
  box-shadow: 0 16px 40px rgba(19, 24, 44, 0.26);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn-ghost:hover {
  background: var(--surface-hover);
}

.btn-outline {
  border-color: var(--line-strong);
  color: var(--text);
}

.btn-outline:hover {
  background: var(--surface-hover);
  border-color: var(--line-strong);
}

/* ---------- 4. 顶部导航 ---------- */
/* 页头固定悬浮在内容之上，全程保持同一种浅色玻璃底：顶部近乎实白保证文字可读，
   底部柔和淡出，让首屏主视觉自然地从页头下方延伸出去；滚动时不再切换成实心白条。 */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.97) 0%,
    rgba(255, 255, 255, 0.88) 58%,
    rgba(255, 255, 255, 0.46) 100%
  );
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  border-bottom: 1px solid transparent;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 48px);
  width: 100%;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

/* Logo 已裁掉外围光晕、透明底；按实心内容高度渲染 */
.brand-logo,
.footer-logo {
  display: block;
  height: 46px;
  width: auto;
  flex-shrink: 0;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: clamp(18px, 2.2vw, 38px);
  margin-inline-end: auto;
}

.nav-link {
  position: relative;
  padding: 6px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-2);
  transition: color 0.25s var(--ease);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--brand-gradient);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--text);
}

.nav-link:hover::after,
.nav-link.is-active::after {
  transform: scaleX(1);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin-inline: auto;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

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

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

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

/* ---------- 6. 游戏产品 ---------- */
.game-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  /* 卡片整体缩小到原来的一半左右：限宽后两张并排各约 300px 宽，保持 3:4 比例 */
  max-width: min(100%, 620px);
  gap: clamp(16px, 1.4vw, 22px);
  padding-bottom: clamp(28px, 3vw, 44px);
}

.game-card {
  position: relative;
}

.game-card-link {
  position: relative;
  display: block;
  border-radius: var(--radius-lg);
}

.game-card-media {
  position: relative;
  margin: 0;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #eceef4;
  box-shadow: var(--shadow-card);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.game-card-media picture,
.game-card-media img {
  display: block;
  width: 100%;
  height: 100%;
}

.game-card-media img {
  object-fit: cover;
  object-position: center top;
  transition: transform 0.7s var(--ease);
}

.game-card-link:hover .game-card-media {
  transform: translateY(-6px);
  box-shadow: 0 34px 76px rgba(19, 24, 44, 0.22);
}

.game-card-link:hover .game-card-media img {
  transform: scale(1.05);
}

.game-card-caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 0 clamp(12px, 1.4vw, 20px) clamp(32px, 3.2vw, 44px);
  text-align: center;
  background: linear-gradient(
    180deg,
    rgba(6, 7, 11, 0) 0%,
    rgba(6, 7, 11, 0.52) 44%,
    rgba(6, 7, 11, 0.9) 100%
  );
}

.game-card-name {
  font-size: clamp(15px, 1.1vw, 18px);
  color: #fff;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.6);
}

.game-card-tagline {
  margin-top: 6px;
  font-size: clamp(11px, 0.8vw, 12.5px);
  color: rgba(255, 255, 255, 0.78);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.5);
}

/* 游戏图标悬浮在封面底边中央，与封面卡片咬合 */
.game-card-icon {
  position: absolute;
  left: 50%;
  bottom: -15px;
  transform: translateX(-50%);
  width: clamp(40px, 3.4vw, 52px);
  height: clamp(40px, 3.4vw, 52px);
  border-radius: clamp(10px, 0.9vw, 13px);
  overflow: hidden;
  background: #eceef4;
  box-shadow: 0 16px 34px rgba(19, 24, 44, 0.22), 0 0 0 3px #fff;
  transition: transform 0.4s var(--ease);
}

.game-card-link:hover .game-card-icon {
  transform: translateX(-50%) translateY(-4px);
}

.game-card-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.game-card-icon picture {
  display: block;
  width: 100%;
  height: 100%;
}

/* ---------- 7. 新闻资讯 ---------- */
.news-list {
  border-top: 1px solid var(--line);
}

.news-item {
  border-bottom: 1px solid var(--line);
}

/* 整行可点击，悬停整行高亮 */
.news-link {
  display: grid;
  grid-template-columns: 130px 160px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  padding: 24px 12px;
  transition: background-color 0.3s var(--ease), padding-left 0.3s var(--ease);
}

.news-link:hover {
  background: rgba(20, 24, 38, 0.028);
  padding-left: 22px;
}

.news-date {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--text-3);
}

.news-tag {
  justify-self: start;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-2);
}

.news-title {
  font-size: clamp(15px, 1.1vw, 17px);
  font-weight: 600;
}

/* 来源署名：跟在标题后，悬停整行时给出原文出处与跳转提示 */
.news-source {
  margin-inline-start: 10px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-3);
  white-space: nowrap;
}

.news-source::after {
  content: "↗";
  margin-inline-start: 4px;
  font-size: 12px;
}

.news-link:hover .news-title {
  color: var(--link);
}

/* ---------- 8. 页脚（合规资质） ---------- */
.site-footer {
  padding-top: clamp(56px, 5vw, 88px);
  padding-bottom: 36px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f4f5fa 100%);
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: clamp(32px, 4vw, 72px);
  padding-bottom: clamp(32px, 3vw, 48px);
  border-bottom: 1px solid var(--line);
}

.footer-logo {
  height: 44px;
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.footer-col h3 {
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--text);
}

.footer-col a {
  display: block;
  padding: 5px 0;
  font-size: 14px;
  color: var(--text-3);
  word-break: break-all;
  transition: color 0.25s var(--ease), transform 0.25s var(--ease);
}

.footer-col a:hover {
  color: var(--text);
  transform: translateX(3px);
}

.footer-health {
  margin-top: 26px;
  padding: 14px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  line-height: 2;
  letter-spacing: 0.08em;
  color: var(--text-3);
}

.footer-legal {
  margin-top: 26px;
}

.footer-copyright {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 12px;
}

.license-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  font-size: 13px;
  color: var(--text-3);
}

.license-list > li {
  display: inline-flex;
  align-items: center;
  gap: 22px;
}

.license-list > li + li::before {
  content: "";
  width: 1px;
  height: 12px;
  background: rgba(20, 24, 38, 0.18);
  margin-inline-end: -12px;
}

.license-list a {
  color: var(--text-2);
  transition: color 0.25s var(--ease);
}

.license-list a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- 9. 回到顶部 ---------- */
.to-top {
  position: fixed;
  right: clamp(16px, 2vw, 32px);
  bottom: clamp(16px, 2vw, 32px);
  z-index: 90;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  box-shadow: 0 10px 26px rgba(19, 24, 44, 0.16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), background-color 0.3s var(--ease);
}

.to-top svg {
  width: 20px;
  height: 20px;
}

.to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.to-top:hover {
  background: var(--surface);
  border-color: var(--line-strong);
}

/* ---------- 10. 滚动入场 ---------- */
/* 默认可见，仅在 JS 可用时才做入场动画，避免 JS 失效时内容不可见 */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.75s var(--ease), transform 0.75s var(--ease);
  will-change: opacity, transform;
}

html.js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* 列表内元素依次出现 */
.game-list > [data-reveal].is-visible,
.news-list > [data-reveal].is-visible {
  transition-delay: 0.06s;
}

/* ---------- 11. 响应式：逐级切换 ---------- */

/* 超宽屏（1920+）：放大字号与间距 */
@media (min-width: 1680px) {
  :root {
    --container: 1380px;
    --section-y: clamp(120px, 8vw, 168px);
  }
}

@media (min-width: 2100px) {
  :root {
    --container: 1520px;
  }

  body {
    font-size: 17px;
  }
}

/* 平板：页脚改为上下结构 */
@media (max-width: 1024px) {
  .footer-top {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 游戏卡片：窄屏单列 */
@media (max-width: 900px) {
  .game-list {
    grid-template-columns: minmax(0, 1fr);
    max-width: 360px;
    margin-inline: auto;
  }
}

/* 导航收起（≤ 1100） */
@media (max-width: 1100px) {
  .main-nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px var(--gutter) 24px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s var(--ease), transform 0.28s var(--ease), visibility 0.28s;
  }

  .main-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .nav-link {
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    font-size: 16px;
  }

  .nav-link::after {
    display: none;
  }

  .menu-toggle {
    display: flex;
  }

  .header-actions {
    margin-inline-start: auto;
  }
}

/* 手机（≤ 767） */
@media (max-width: 767px) {
  :root {
    --header-h: 66px;
    --section-y: clamp(64px, 12vw, 90px);
  }

  body {
    line-height: 1.66;
  }

  .brand-logo {
    height: 34px;
  }

  .game-card-icon {
    bottom: -15px;
    width: 46px;
    height: 46px;
  }

  .game-card-caption {
    padding-bottom: 36px;
  }

  .news-link {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 20px 4px;
  }

  .news-link:hover {
    padding-left: 4px;
  }

  .footer-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .license-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .license-list > li + li::before {
    display: none;
  }
}

/* ---------- 12. 无障碍与动画偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }

  [data-reveal] {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 13. 法律条款页 / 404 页 ---------- */
.page-legal .legal-main {
  padding-top: calc(var(--header-h) + clamp(48px, 6vw, 96px));
  padding-bottom: clamp(60px, 6vw, 110px);
}

.legal-container {
  max-width: 900px;
}

.legal-title {
  font-size: clamp(26px, 3vw, 44px);
  margin-bottom: 14px;
  text-wrap: balance;
}

.legal-updated {
  padding-bottom: 24px;
  margin-bottom: clamp(32px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--text-3);
}

.legal-section {
  margin-bottom: clamp(40px, 4vw, 64px);
  scroll-margin-top: calc(var(--header-h) + 24px);
}

.legal-section h2 {
  font-size: clamp(21px, 2vw, 30px);
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.legal-section h3 {
  margin: 26px 0 10px;
  font-size: 16.5px;
}

.legal-section p {
  margin-bottom: 12px;
  font-size: 15.5px;
  color: var(--text-2);
}

.legal-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.legal-list li {
  position: relative;
  padding-left: 20px;
  font-size: 15.5px;
  color: var(--text-2);
}

.legal-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-gradient-ink);
}

.legal-link {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legal-back {
  margin-top: 48px;
}

.notfound {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  padding: 120px 0 80px;
  text-align: center;
}

.notfound-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 560px;
}

.notfound-logo {
  height: 64px;
  width: auto;
  margin-bottom: 8px;
}

@media (max-width: 767px) {
  .notfound-logo {
    height: 50px;
  }
}

@media print {
  .site-header,
  .to-top {
    display: none;
  }

  body {
    background: #fff;
    color: #000;
  }
}
