/* ============ PlayHub — Apple-style (Wallpaper Edition) ============ */
:root {
  --bg: #ffffff;
  --bg-gray: #f5f5f7;
  --text: #1d1d1f;
  --text-sub: #6e6e73;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --radius-l: 28px;
  --radius-m: 18px;
  --nav-h: 48px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; }

.container { max-width: 1080px; margin: 0 auto; padding: 0 22px; }
.container-wide { max-width: 1280px; margin: 0 auto; padding: 0 22px; }

/* ---------- 顶栏 ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(251, 251, 253, .82);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, .08);
}
.nav-inner {
  max-width: 1024px; height: 100%; margin: 0 auto; padding: 0 22px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.nav-links { display: flex; gap: 30px; align-items: center; }
.nav-links > a { font-size: 12.5px; color: rgba(29,29,31,.82); transition: color .2s; }
.nav-links > a:hover { color: var(--text); }

/* 下拉菜单（小游戏） */
.nav-drop { position: relative; }
.nav-drop-btn {
  background: none; border: 0; cursor: pointer;
  font-size: 12.5px; color: rgba(29,29,31,.82); padding: 6px 2px;
}
.nav-drop-btn:hover { color: var(--text); }
.nav-drop-btn .caret { font-size: 10px; transition: transform .25s; display: inline-block; }
.nav-drop.open .caret { transform: rotate(180deg); }
.drop-menu {
  position: absolute; top: calc(100% + 10px); right: -8px; min-width: 208px;
  background: rgba(255,255,255,.92);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  border-radius: 14px; padding: 6px;
  box-shadow: 0 18px 50px rgba(0,0,0,.16), inset 0 0 0 1px rgba(0,0,0,.05);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98);
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
}
.nav-drop.open .drop-menu,
.nav-drop:hover .drop-menu { opacity: 1; visibility: visible; transform: none; }
.drop-menu a {
  display: block; padding: 10px 14px; border-radius: 9px;
  font-size: 13.5px; font-weight: 500; transition: background .15s;
}
.drop-menu a:hover { background: rgba(0,113,227,.09); color: var(--blue); }

.nav-menu-btn { display: none; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-menu-btn span { display: block; width: 18px; height: 1.5px; background: var(--text); margin: 4px 0; }
.mobile-menu {
  position: fixed; top: var(--nav-h); left: 0; right: 0; bottom: 0; z-index: 99;
  background: rgba(251, 251, 253, .97);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  display: none; flex-direction: column; padding: 10px 30px 40px; overflow-y: auto;
}
.mobile-menu a { padding: 14px 0; font-size: 17px; font-weight: 500; border-bottom: 1px solid rgba(0,0,0,.06); }
.mobile-menu .mm-group {
  margin-top: 18px; padding-bottom: 4px; font-size: 12px; letter-spacing: .1em;
  color: var(--text-sub); text-transform: uppercase;
}
.mobile-menu.open { display: flex; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; color: #fff; text-align: center;
  background: linear-gradient(160deg, #0a0a0f 0%, #101828 55%, #1b1035 100%);
}
.hero-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0; transform: scale(1.06);
  transition: opacity 1.4s ease, transform 8s ease-out;
}
.hero-bg.loaded { opacity: .92; transform: scale(1); }
.hero-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,.42) 0%, rgba(0,0,0,.18) 40%, rgba(0,0,0,.62) 100%);
}
.hero-content { position: relative; z-index: 2; padding: 90px 22px 60px; max-width: 900px; }
.hero-eyebrow {
  font-size: 15px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255,255,255,.75); margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(46px, 8vw, 96px); font-weight: 700; letter-spacing: -.025em;
  line-height: 1.08; margin-bottom: 22px;
  text-shadow: 0 4px 40px rgba(0,0,0,.45);
}
.hero-sub {
  font-size: clamp(16px, 2.2vw, 21px); color: rgba(255,255,255,.88);
  margin-bottom: 38px; font-weight: 500; line-height: 1.65;
  text-shadow: 0 2px 18px rgba(0,0,0,.5);
}
.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

.btn {
  display: inline-block; padding: 13px 30px; border-radius: 980px;
  font-size: 16px; font-weight: 500; transition: .25s;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); transform: translateY(-1px); }
.btn-ghost {
  color: #fff; border: 1.5px solid rgba(255,255,255,.75);
  background: rgba(255,255,255,.08);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.btn-ghost:hover { background: rgba(255,255,255,.18); }

.hero-scroll-hint {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 2; display: flex; flex-direction: column; align-items: center;
}
.hero-scroll-hint span {
  width: 1px; height: 34px; background: rgba(255,255,255,.55);
  animation: drop 1.8s ease-in-out infinite;
}
@keyframes drop {
  0% { transform: scaleY(0); transform-origin: top; }
  45% { transform: scaleY(1); transform-origin: top; }
  55% { transform: scaleY(1); transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

/* ---------- Section ---------- */
.section { padding: 100px 0 80px; }
.section-gray { background: var(--bg-gray); }
.section-title {
  font-size: clamp(32px, 5.2vw, 56px); font-weight: 700; letter-spacing: -.02em;
  line-height: 1.12; text-align: center; margin-bottom: 16px;
}
.grad-text {
  background: linear-gradient(92deg, #2997ff, #a259ff 55%, #ff5fa2);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.section-desc {
  text-align: center; font-size: clamp(15px, 2vw, 19px);
  color: var(--text-sub); margin-bottom: 52px; max-width: 720px; margin-left: auto; margin-right: auto;
  line-height: 1.7;
}

/* ---------- 壁纸无限网格 ---------- */
.wall-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
}
.wall-card {
  position: relative; border-radius: var(--radius-m); overflow: hidden;
  cursor: zoom-in; background: linear-gradient(110deg, #e4e4ea 30%, #f2f2f6 45%, #e4e4ea 60%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite linear;
  aspect-ratio: 16 / 10.5;
  box-shadow: 0 6px 24px rgba(0,0,0,.08);
  transition: transform .35s cubic-bezier(.2,.7,.3,1), box-shadow .35s;
}
.wall-card img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.04);
  transition: opacity .7s ease, transform .7s ease;
}
.wall-card img.loaded { opacity: 1; transform: scale(1); }
.wall-card:hover { transform: translateY(-5px); box-shadow: 0 22px 48px rgba(0,0,0,.18); animation: none; background: #e4e4ea; }
.wall-meta {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 11px;
  background: linear-gradient(to top, rgba(0,0,0,.62), transparent);
  color: #fff; opacity: 0; transform: translateY(6px); transition: .28s;
  pointer-events: none;
}
.wall-card:hover .wall-meta { opacity: 1; transform: none; }
.wall-meta strong { display: block; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wall-meta span { font-size: 11px; opacity: .82; }
.wall-date {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  font-size: 10.5px; font-weight: 600; letter-spacing: .04em;
  color: #fff; background: rgba(0,0,0,.4);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  padding: 3px 9px; border-radius: 99px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.load-sentinel {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 34px 0 6px; color: var(--text-sub); font-size: 13.5px;
}
.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid rgba(0,0,0,.12); border-top-color: var(--blue);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.load-sentinel.done .spinner { display: none; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity .28s ease, visibility .28s;
}
.lightbox.open { opacity: 1; visibility: visible; }
.lb-backdrop {
  position: absolute; inset: 0;
  background: rgba(6, 8, 14, .88);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.lb-stage {
  position: relative; z-index: 2; max-width: min(1200px, 94vw);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  max-height: 86vh;
}
#lbImg {
  max-width: 100%; max-height: 74vh; object-fit: contain;
  border-radius: 12px; box-shadow: 0 34px 90px rgba(0,0,0,.6);
  transition: max-height .2s;
}
.lightbox.zoomed .lb-stage { overflow: auto; max-width: 94vw; width: 94vw; }
.lightbox.zoomed #lbImg { max-width: none; max-height: none; width: max-content; height: auto; cursor: zoom-out; }
.lb-caption { text-align: center; color: #fff; }
.lb-caption strong { display: block; font-size: 16px; font-weight: 600; margin-bottom: 3px; }
.lb-caption span { font-size: 12.5px; color: rgba(255,255,255,.66); }

.lb-toolbar {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 3; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
  padding: 0 16px; width: max-content; max-width: 96vw;
}
.lb-btn {
  border: 1px solid rgba(255,255,255,.28); background: rgba(255,255,255,.1);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: #fff; border-radius: 99px; padding: 11px 22px;
  font-size: 14px; font-weight: 500; cursor: pointer; transition: .2s;
}
.lb-btn:hover { background: rgba(255,255,255,.2); }
.lb-btn.primary { background: var(--blue); border-color: var(--blue); }
.lb-btn.primary:hover { background: var(--blue-hover); }

.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.1); color: #fff; font-size: 30px; line-height: 1;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: background .2s;
}
.lb-nav:hover { background: rgba(255,255,255,.25); }
.lb-prev { left: 18px; }
.lb-next { right: 18px; }
.lb-close {
  position: absolute; top: 18px; right: 22px; z-index: 3;
  width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(255,255,255,.1); color: #fff; font-size: 26px;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.lb-close:hover { background: rgba(255,255,255,.25); }

@media (max-width: 760px) {
  .lb-toolbar { bottom: 16px; }
  .lb-btn { padding: 10px 16px; font-size: 13px; }
  .lb-nav { width: 42px; height: 42px; font-size: 24px; }
}

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed; top: calc(var(--nav-h) + 14px); left: 50%; transform: translateX(-50%);
  z-index: 300; display: flex; flex-direction: column; gap: 10px; align-items: center;
  width: max-content; max-width: 92vw; pointer-events: none;
}
.toast {
  background: rgba(28, 28, 32, .92);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  color: #fff; font-size: 13.5px; line-height: 1.6;
  border-radius: 14px; padding: 12px 20px;
  box-shadow: 0 16px 44px rgba(0,0,0,.3), inset 0 0 0 1px rgba(255,255,255,.09);
  opacity: 0; transform: translateY(-10px);
  transition: opacity .3s ease, transform .3s ease;
  text-align: center;
}
.toast.show { opacity: 1; transform: none; }

/* ---------- 页脚 ---------- */
.footer { background: var(--bg-gray); padding: 34px 0; text-align: center; }
.footer p { font-size: 12.5px; color: var(--text-sub); line-height: 1.9; }

/* ---------- 滚动入场 ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .8s ease, transform .8s cubic-bezier(.2,.7,.3,1); }
.reveal.visible { opacity: 1; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) { .wall-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-menu-btn { display: block; }
  .section { padding: 70px 0 56px; }
  .wall-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .wall-meta strong { font-size: 12px; }
}
@media (max-width: 420px) {
  .wall-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
