/* =========================================================
   酷玩街机秀官网 · 框架层 layout.css
   页头 / 导航 / 子页面 Hero / 页脚 / 悬浮下载 / 抽屉 / 弹窗
   各页面共用，需与 base.css 一起引入
   ========================================================= */

main { min-height: 70vh; padding-top: var(--header-h); }

/* ---------------- Header ---------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 1000;
  height: var(--header-h);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  transition: box-shadow 0.25s ease, background 0.25s ease;
}
.site-header.is-scrolled { background: rgba(255, 255, 255, 0.97); box-shadow: 0 6px 24px rgba(20, 30, 60, 0.08); }

.header-inner {
  height: 100%;
  max-width: var(--content);
  margin: 0 auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-img {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(145deg, #6b3bff, #5a1df0);
  box-shadow: 0 6px 14px rgba(90, 29, 240, 0.28);
}
.logo-img img { width: 40px; height: 40px; object-fit: contain; }
.logo-content { display: flex; flex-direction: column; line-height: 1.15; }
.logo-title { font-size: 16px; font-weight: 700; letter-spacing: 0.04em; color: var(--ink); }
.logo-description { font-size: 9px; letter-spacing: 0.16em; color: var(--ink-3); }

.desktop-nav { display: none; }

.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.header-login {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.header-login:hover { color: var(--primary-2); border-color: var(--primary-soft); }
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ffb327;
  box-shadow: 0 0 0 3px rgba(255, 179, 39, 0.14);
}

.menu-button {
  width: 38px;
  height: 38px;
  display: grid;
  place-content: center;
  gap: 4px;
  border: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #6b3bff, var(--primary));
  cursor: pointer;
}
.menu-button span { display: block; width: 17px; height: 2px; border-radius: 2px; background: #fff; }

@media (min-width: 768px) {
  .logo-img { width: 40px; height: 40px; }
  .logo-img img { width: 46px; height: 46px; }
  .logo-title { font-size: 18px; }
  .desktop-nav { display: flex; align-items: center; gap: 2px; margin-left: 26px; }
  .nav-link {
    padding: 0 14px;
    min-height: 40px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
  }
  .nav-link:hover { color: var(--primary-2); background: var(--primary-softer); }
  .nav-link.is-active { color: var(--primary-2); background: var(--primary-softer); }
  .menu-button { display: none; }
}

/* ---------------- Subpage hero ---------------- */
.subpage-hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 220px;
  padding: 30px 0;
  color: #fff;
  overflow: hidden;
  background: linear-gradient(120deg, #2a1b8f, var(--primary) 55%, var(--primary-3));
}
.subpage-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 75% 40%, #000, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 75% 40%, #000, transparent 70%);
}
.subpage-hero--products { background: linear-gradient(120deg, #241a86, #4d2ce0 55%, #6d63ff); }
.subpage-hero--download { background: linear-gradient(120deg, #1c1a6e, #4b2bd8 55%, #5c56ff); }
.subpage-hero--guides { background: linear-gradient(120deg, #352a8f, #5a1df0 55%, #8a5bff); }
.subpage-hero--news { background: linear-gradient(120deg, #2b1f7a, #5929e8 55%, #6d6bff); }
.subpage-hero--welfare { background: linear-gradient(120deg, #43247f, #6b34e6 55%, #8f6bff); }

.subpage-hero-inner { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.subpage-title-row { position: relative; z-index: 2; max-width: 100%; }
.subpage-title { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.subpage-desc { margin-top: 8px; font-size: 14px; color: rgba(255, 255, 255, 0.72); }
.subpage-hero-img { position: absolute; right: -20px; bottom: -30px; width: 170px; opacity: 0.4; filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.3)); object-fit: contain; }

@media (min-width: 768px) {
  .subpage-hero { min-height: 280px; }
  .subpage-title { font-size: 40px; }
  .subpage-desc { font-size: 16px; }
  .subpage-hero-img { width: 250px; right: 20px; opacity: 0.7; }
}

@media (min-width: 1200px) {
  .subpage-title { font-size: 52px; }
  .subpage-hero { min-height: 320px; }
  .subpage-hero-img { width: 300px; right: 40px; opacity: 1; }
}

/* ---------------- Section ---------------- */
.section { padding: 30px 0; }
.section--subpage { min-height: 420px; }

@media (min-width: 768px) {
  .section { padding: 44px 0; }
}

/* ---------------- Footer ---------------- */
.site-footer { color: var(--ink-2); background: #fff; border-top: 1px solid var(--line); }
.footer-inner { display: grid; gap: 28px; padding-block: 32px 24px; }
.logo-box--footer .logo-title { color: var(--ink); }
.footer-brand > p { margin-top: 12px; max-width: 320px; font-size: 12px; color: var(--ink-3); }
.footer-links { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.footer-links div { display: flex; flex-direction: column; align-items: flex-start; }
.footer-links h3, .footer-contact h3 { margin-bottom: 10px; font-size: 11px; letter-spacing: 0.12em; color: var(--ink-3); }
.footer-links button { margin: 4px 0; padding: 0; border: 0; background: none; color: var(--ink-2); font-size: 13px; cursor: pointer; }
.footer-links a { margin: 4px 0; color: var(--ink-2); font-size: 13px; text-decoration: none; }
.footer-links button:hover, .footer-links a:hover { color: var(--primary-2); }
.footer-contact p { margin: 2px 0; font-size: 12px; color: var(--ink-3); }
.footer-contact .btn { margin-top: 12px; }
.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-block: 16px 26px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-3);
}
.footer-bottom a { color: inherit; text-decoration: none; }

@media (min-width: 768px) {
  .footer-inner { grid-template-columns: 1.2fr 1fr 0.9fr; gap: 40px; padding-block: 48px 32px; }
  .footer-bottom { flex-direction: row; justify-content: space-between; align-items: center; padding-block: 18px; }
}

/* ---------------- Floating dock ---------------- */
.download-block {
  position: fixed;
  z-index: 900;
  right: 0;
  top: 50%;
  width: 150px;
  padding: 12px 12px 12px 0;
  background: linear-gradient(180deg, #ffffff, var(--primary-softer));
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
  transform: translate(100%, -50%);
  transition: transform 0.3s ease;
}
.download-block.is-open { transform: translate(0, -50%); }
.download-top {
  position: absolute;
  left: -34px;
  top: 12px;
  width: 34px;
  height: 104px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  background: linear-gradient(135deg, #6b3bff, var(--primary));
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: -6px 6px 20px rgba(90, 29, 240, 0.28);
}
.download-top span { writing-mode: vertical-rl; letter-spacing: 2px; }
.download-top .toggle-icon { writing-mode: horizontal-tb; background: rgba(255, 255, 255, 0.2); color: #fff; }
.download-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px;
}
.qr-code { width: 110px; height: 110px; padding: 8px; border-radius: var(--radius-sm); background: #fff; box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18); }
.qr-grid { display: grid; grid-template-columns: repeat(21, 1fr); width: 100%; height: 100%; }
.qr-grid i { display: block; aspect-ratio: 1; }
.qr-grid i.on { background: #1a1338; }
.content-title { margin: 10px 0 12px; font-size: 11px; color: var(--ink-2); text-align: center; }
.download-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  margin-bottom: 8px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #6b3bff, var(--primary-3));
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 5px 8px rgba(0, 0, 0, 0.18);
  transition: transform 0.3s;
}
.download-item:hover { transform: scale(1.05); }
.download-item-icon { font-size: 11px; }
.welfare-entry { background: linear-gradient(135deg, #ffc845, #ff9b23); color: #2a1a00; margin-bottom: 0; }

.back-to-top {
  position: fixed;
  z-index: 900;
  right: 12px;
  bottom: 16px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: linear-gradient(0deg, #ffffff, #eff2f9) padding-box, linear-gradient(160deg, #f2f2f2, #ffffff) border-box;
  color: var(--ink);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  transition: transform 0.3s ease, opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}
.back-to-top.is-visible { opacity: 1; pointer-events: auto; }
.back-to-top:hover { transform: translateY(-4px); }

@media (min-width: 768px) {
  .download-block { width: 200px; }
  .download-top { display: none; }
  .download-content { padding: 6px; }
  .qr-code { width: 130px; height: 130px; }
  .download-item { min-height: 46px; font-size: 14px; }
  .download-block:hover { transform: translate(0, -50%); }

  .back-to-top { right: 24px; bottom: 32px; width: 56px; height: 56px; font-size: 12px; }
}

@media (min-width: 1200px) {
  .download-block { width: 230px; }
}

/* ---------------- Drawer ---------------- */
.drawer-backdrop, .modal-backdrop { position: fixed; inset: 0; z-index: 1400; background: rgba(4, 12, 23, 0.5); backdrop-filter: blur(4px); opacity: 0; transition: opacity 0.3s; }
.drawer-backdrop.is-visible, .modal-backdrop.is-visible { opacity: 1; }
.menu-drawer {
  position: fixed;
  z-index: 1500;
  top: 0;
  right: 0;
  width: min(320px, 88vw);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: linear-gradient(180deg, #2a1b8f, #4b2bd8 60%, #5c56ff);
  color: #fff;
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.28);
  transform: translateX(105%);
  transition: transform 0.36s cubic-bezier(0.22, 0.8, 0.22, 1);
  overflow-y: auto;
}
.menu-drawer.is-open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; }
.drawer-brand { display: inline-flex; align-items: center; gap: 8px; }
.drawer-brand .logo-img { background: rgba(255, 255, 255, 0.16); }
.drawer-brand .logo-title { color: #fff; }
.drawer-brand .logo-description { color: rgba(255, 255, 255, 0.6); }
.drawer-close, .modal-close { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 50%; background: transparent; color: #fff; font-size: 22px; cursor: pointer; }
.menu-drawer nav { display: grid; margin-top: 26px; border-top: 1px solid rgba(255, 255, 255, 0.14); }
.menu-drawer nav a, .menu-drawer nav button {
  min-height: 52px;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  text-align: left;
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.menu-drawer nav a span, .menu-drawer nav button span { font-size: 10px; color: rgba(255, 255, 255, 0.35); }
.menu-drawer nav a:hover, .menu-drawer nav a.is-active,
.menu-drawer nav button:hover, .menu-drawer nav button.is-active { color: #fff; }
.drawer-actions { display: grid; gap: 10px; margin-top: auto; padding-top: 24px; }
.drawer-actions .btn--ghost { background: rgba(255, 255, 255, 0.14); color: #fff; border-color: rgba(255, 255, 255, 0.22); }

/* ---------------- Modal ---------------- */
.modal {
  position: fixed;
  z-index: 1600;
  left: 50%;
  top: 50%;
  width: min(400px, calc(100% - 32px));
  max-height: calc(100dvh - 30px);
  padding: 26px 20px;
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: 0 30px 80px rgba(7, 20, 38, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -46%) scale(0.97);
  transition: opacity 0.25s, transform 0.3s;
  overflow-y: auto;
}
.modal.is-open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.modal .modal-close { position: absolute; right: 14px; top: 14px; width: 32px; height: 32px; border-color: var(--line); color: var(--ink); font-size: 20px; }
.modal-brand { width: 62px; height: 62px; margin: 0 auto 12px; border-radius: 16px; overflow: hidden; background: #2a1b8f; }
.modal-brand img { width: 100%; height: 100%; object-fit: contain; }
.modal-kicker { text-align: center; font-size: 9px; font-weight: 800; letter-spacing: 0.18em; color: var(--primary-2); }
.login-modal h2, .message-modal h2, .event-modal h2 { margin: 4px 0 2px; text-align: center; font-size: 24px; font-weight: 700; }
.login-modal > p, .message-modal > p, .event-modal > p { margin-bottom: 18px; text-align: center; font-size: 13px; color: var(--ink-3); }
.login-modal form > .btn { margin-top: 20px; }
.login-modal label { display: block; margin: 14px 0 6px; font-size: 12px; font-weight: 600; color: var(--ink-2); }
.sms-row { display: grid; grid-template-columns: 1fr 120px; gap: 10px; }
.sms-button { border: 1px solid #e2e7f0; border-radius: var(--radius-md); background: var(--primary-softer); color: var(--primary-deep); font-size: 13px; font-weight: 800; letter-spacing: 0; cursor: pointer; }
.demo-hint { display: block; margin-top: 12px; padding: 8px; border-radius: 8px; background: var(--primary-softer); color: var(--primary-deep); font-size: 11px; text-align: center; }
.modal-footnote { margin-top: 10px; font-size: 11px; color: var(--ink-3); text-align: center; }
.message-icon { width: 56px; height: 56px; display: grid; place-items: center; margin: 0 auto 14px; border-radius: 50%; background: linear-gradient(135deg, #ffb43c, #ff7945); color: #fff; font-size: 26px; font-weight: 800; }
.message-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.message-actions--single { grid-template-columns: 1fr; }
.event-modal-art { height: 150px; margin: -8px -8px 18px; border-radius: var(--radius-md); background: linear-gradient(145deg, #141a3a, #2b2f6b); overflow: hidden; }
.event-modal-art img { width: 100%; height: 100%; object-fit: contain; }
.event-modal .event-status { display: table; margin: 0 auto; }

.toast {
  position: fixed;
  z-index: 1800;
  left: 50%;
  bottom: 24px;
  max-width: min(420px, calc(100% - 32px));
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  background: rgba(20, 24, 54, 0.92);
  color: #fff;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(12px);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 0.25s, transform 0.25s;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 768px) {
  .sms-row { grid-template-columns: 1fr 150px; }
}
