/* ============================================================
   8x8x Landing Page A - Mobile First
   Palette: #FFCC00 / #FFD700 (Highlight) x #111111 (Base)
   ============================================================ */

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

html {
  -webkit-tap-highlight-color: transparent;
}

:root {
  --yellow: #ffcc00;
  --yellow-2: #ffd700;
  --bg: #111111;
  --bg-2: #181818;
  --bg-3: #1f1f1f;
  --text: #f5f5f2;
  --text-dim: rgba(245, 245, 242, 0.55);
  --line: rgba(255, 204, 0, 0.16);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --font-stack: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "Noto Sans SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

body {
  font-family: var(--font-stack);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  background-image:
    radial-gradient(ellipse 120% 46% at 50% -8%, rgba(255, 204, 0, 0.09), transparent 62%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.014) 0 2px, transparent 2px 7px);
  -webkit-font-smoothing: antialiased;
}

body.modal-open {
  overflow: hidden;
}

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

button {
  font-family: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
}

a {
  touch-action: manipulation;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(17, 17, 17, 0.88);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}

.header-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

/* 黄色 Logo 牌 */
.logo-plate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--yellow-2), var(--yellow) 55%, #f0b800);
  color: #111;
  border-radius: var(--radius-sm);
  padding: 7px 16px;
  transform: skewX(-7deg);
  box-shadow:
    0 0 0 1.5px rgba(17, 17, 17, 0.85) inset,
    0 4px 20px rgba(255, 204, 0, 0.38);
  flex-shrink: 0;
}

.logo-plate span {
  display: inline-block;
  transform: skewX(7deg);
  font-size: 21px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 1.5px;
  line-height: 1;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* 动态提示标签 */
.live-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  border: 1px solid rgba(255, 204, 0, 0.35);
  background: rgba(255, 204, 0, 0.06);
  border-radius: 999px;
  padding: 6px 12px 6px 9px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 8px rgba(255, 204, 0, 0.9);
  animation: liveBlink 1.4s ease-in-out infinite;
  flex-shrink: 0;
}

.live-text {
  position: relative;
  height: 16px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.live-item {
  position: absolute;
  inset: 0;
  white-space: nowrap;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: var(--yellow);
  opacity: 0;
  animation: liveSwitch 4.4s steps(1) infinite;
}

.live-item:first-child {
  animation-delay: 0s;
}

.live-item:last-child {
  animation-delay: 2.2s;
}

/* ---------- Main / Grid ---------- */
.page-main {
  max-width: 640px;
  margin: 0 auto;
  padding: 14px 12px calc(110px + env(safe-area-inset-bottom, 0px));
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 2px 12px;
}

.section-title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 1px;
}

.section-title .flame {
  font-style: normal;
  margin-right: 2px;
}

.section-count {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 3px 9px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 10px;
}

/* 图片卡片 */
.pic-card {
  min-width: 0;
  cursor: pointer;
  outline: none;
}

.pic-frame {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-2);
  border: 1px solid rgba(255, 255, 255, 0.07);
  transform: translateZ(0);
}

.pic-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.001);
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.3, 1), filter 0.45s ease;
}

/* hover 微距放大 */
.pic-card:hover .pic-frame img {
  transform: scale(1.08);
  filter: brightness(1.06);
}

.pic-card:active .pic-frame img,
.pic-card:focus-visible .pic-frame img {
  transform: scale(1.05);
}

.pic-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, transparent 62%, rgba(17, 17, 17, 0.55));
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.pic-card:hover .pic-frame::after,
.pic-card:active .pic-frame::after {
  opacity: 1;
}

/* 素材缺失占位 */
.pic-placeholder {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background:
    repeating-linear-gradient(135deg, rgba(255, 204, 0, 0.05) 0 10px, transparent 10px 20px),
    var(--bg-2);
  color: var(--yellow);
}

.pic-frame.img-broken .pic-placeholder {
  display: flex;
}

.pic-placeholder b {
  font-size: 22px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 1px;
  opacity: 0.85;
}

.pic-placeholder small {
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--text-dim);
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: 26px;
  text-align: center;
}

.site-footer p {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--text-dim);
}

.site-footer .footer-sub {
  margin-top: 4px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 2px;
  opacity: 0.6;
}

/* ---------- Floating Badge（左下角常驻入口） ---------- */
.floating-badge {
  position: fixed;
  left: 12px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100vw - 24px);
  background: linear-gradient(160deg, var(--yellow-2), var(--yellow) 60%, #f2ba00);
  color: #111;
  text-decoration: none;
  border-radius: 999px;
  padding: 9px 16px 9px 12px;
  box-shadow:
    0 8px 26px rgba(255, 204, 0, 0.4),
    0 2px 8px rgba(0, 0, 0, 0.5);
  animation: badgeBob 2.6s ease-in-out infinite;
}

.floating-badge:active {
  transform: scale(0.95);
}

.fb-emoji {
  font-size: 18px;
  line-height: 1;
}

.fb-text {
  display: block;
  line-height: 1.22;
}

.fb-text strong {
  display: block;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.fb-text em {
  display: block;
  font-style: normal;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 3px;
  opacity: 0.72;
}

.fb-pulse {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid rgba(255, 204, 0, 0.75);
  animation: badgePulse 1.8s ease-out infinite;
  pointer-events: none;
}

/* ---------- Modal（通道验证 / 解锁中） ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.modal.is-open {
  opacity: 1;
  visibility: visible;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 8, 0.82);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.modal-card {
  position: relative;
  width: min(320px, 88vw);
  background: var(--bg-2);
  border: 1px solid rgba(255, 204, 0, 0.28);
  border-radius: var(--radius-lg);
  padding: 26px 22px 24px;
  text-align: center;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6), 0 0 40px rgba(255, 204, 0, 0.08);
  transform: translateY(14px) scale(0.96);
  transition: transform 0.28s cubic-bezier(0.2, 0.7, 0.3, 1);
  overflow: hidden;
}

.modal.is-open .modal-card {
  transform: translateY(0) scale(1);
}

.modal-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 130px;
  height: 3px;
  transform: translateX(-50%);
  background: var(--yellow);
  border-radius: 0 0 4px 4px;
}

.modal-logo {
  display: inline-block;
  background: linear-gradient(160deg, var(--yellow-2), var(--yellow));
  color: #111;
  font-size: 17px;
  font-weight: 900;
  font-style: italic;
  letter-spacing: 1.5px;
  border-radius: var(--radius-sm);
  padding: 5px 14px;
  transform: skewX(-7deg);
  box-shadow: 0 4px 16px rgba(255, 204, 0, 0.35);
  margin-bottom: 14px;
}

.modal-status {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  min-height: 20px;
}

/* Loading 脉冲 */
.modal-loading {
  margin-top: 18px;
}

.pulse-wrap {
  position: relative;
  width: 62px;
  height: 62px;
  margin: 0 auto 14px;
}

.pulse-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 204, 0, 0.65);
  animation: ringPulse 1.3s ease-out infinite;
}

.pulse-ring.delay {
  animation-delay: 0.65s;
}

.pulse-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 16px rgba(255, 204, 0, 0.9);
  animation: coreBlink 1.3s ease-in-out infinite;
}

.loading-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-bottom: 16px;
}

.loading-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--yellow);
  animation: dotBounce 1s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

.progress-track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--yellow), var(--yellow-2));
  animation: progressFill 2s linear forwards;
}

/* 解锁成功态 */
.modal-success {
  margin-top: 18px;
  animation: successIn 0.35s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.success-line {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

.success-line .check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--yellow);
  color: #111;
  font-size: 12px;
  font-weight: 900;
}

.btn-go {
  display: block;
  width: 100%;
  background: linear-gradient(160deg, var(--yellow-2), var(--yellow) 55%, #f0b800);
  color: #111;
  font-size: 15.5px;
  font-weight: 900;
  letter-spacing: 1px;
  text-decoration: none;
  border-radius: var(--radius-md);
  padding: 14px 10px;
  animation: goGlow 1.5s ease-in-out infinite;
}

.btn-go:active {
  transform: scale(0.96);
}

.success-tip {
  margin-top: 10px;
  font-size: 10.5px;
  letter-spacing: 2px;
  color: var(--text-dim);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--text-dim);
  font-size: 20px;
  line-height: 1;
  transition: color 0.2s ease, transform 0.2s ease;
}

.modal-close:active {
  transform: scale(0.85);
  color: var(--text);
}

/* ---------- Animations ---------- */
@keyframes liveBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

@keyframes liveSwitch {
  0%, 47% { opacity: 1; }
  48%, 97% { opacity: 0; }
  98%, 100% { opacity: 1; }
}

@keyframes badgeBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

@keyframes badgePulse {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.28); opacity: 0; }
}

@keyframes ringPulse {
  0% { transform: scale(0.55); opacity: 1; }
  100% { transform: scale(1.45); opacity: 0; }
}

@keyframes coreBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

@keyframes dotBounce {
  0%, 100% { transform: translateY(0); opacity: 0.45; }
  50% { transform: translateY(-5px); opacity: 1; }
}

@keyframes progressFill {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes goGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 204, 0, 0.5); }
  50% { box-shadow: 0 0 26px 5px rgba(255, 204, 0, 0.42); }
}

@keyframes successIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- 桌面端微调 ---------- */
@media (min-width: 640px) {
  .header-inner {
    padding: 14px 16px;
  }

  .grid {
    gap: 18px 14px;
  }

  .page-main {
    padding: 20px 16px calc(120px + env(safe-area-inset-bottom, 0px));
  }

  .pic-frame {
    border-radius: var(--radius-lg);
  }
}
