/* ================================================================
   maidian.me 占位首页 — 严格还原 Ardot 设计稿「炫酷占位首页」
   设计基准: 1440px · 极简高级留白 · 单一靛蓝信号色
   ================================================================ */

:root {
  /* 配色 — 与设计稿逐一对应 */
  --bg: #FAFAF8;            /* 页面底 r.980 g.980 b.973 */
  --card: #FFFFFF;
  --ink: #14151A;           /* 主文字 */
  --secondary: #6B6F76;     /* 次要文字 */
  --muted: #9AA0A8;         /* 辅助文字 */
  --faint: #B7BAC1;         /* 版权文字 */
  --eyebrow-gray: #8A8F98;  /* Hero 眉标 */
  --accent: #5B5BD6;        /* 靛蓝信号色 */
  --accent-10: rgba(91, 91, 214, 0.10);
  --input-border: #E6E3DE;
  --card-border: #ECEAE6;
  --preview-bg: #F5F4FA;

  /* 圆角 */
  --r-card: 16px;
  --r-preview: 12px;
  --r-input: 14px;
  --r-input-sm: 12px;
  --r-panel: 28px;

  /* 阴影 */
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.05);
  --shadow-input: 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-btn: 0 8px 20px rgba(91, 91, 214, 0.35);

  /* 字体 */
  --serif: 'Noto Serif SC', 'Songti SC', serif;
  --sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;

  --page-pad: 100px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

button { font-family: var(--sans); cursor: pointer; }
a { text-decoration: none; }

/* ============ Header — 80px 高 / 左右 100px / 透明 ============ */
.site-header {
  height: 80px;
  padding: 0 var(--page-pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: 10px; }
.logo-mark { width: 28px; height: 28px; }
.wordmark { font-size: 18px; font-weight: 500; color: var(--ink); }

.nav-right { display: flex; align-items: center; gap: 28px; }
.nav-link { font-size: 15px; color: var(--secondary); transition: color .2s; }
.nav-link:hover { color: var(--ink); }
.nav-pill {
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  transition: transform .2s, box-shadow .2s;
}
.nav-pill:hover { transform: translateY(-1px); box-shadow: var(--shadow-btn); }

/* ============ Hero — 800px 固定高 / 内容居中 ============ */
.hero {
  position: relative;
  height: 800px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#starfield {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 45%,
              rgba(91, 91, 214, 0.20) 0%,
              rgba(91, 91, 214, 0) 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 720px;
  max-width: 92vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  text-align: center;
  pointer-events: none;
}
.hero-content a, .hero-content button, .hero-content input, .hero-content label { pointer-events: auto; }

.eyebrow {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 3px;
  color: var(--eyebrow-gray);
}
.eyebrow.accent { color: var(--accent); }

.hero-headline {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 60px;
  line-height: 72px;
  color: var(--ink);
}

.hero-subhead {
  width: 560px;
  max-width: 100%;
  font-size: 18px;
  line-height: 30px;
  color: var(--secondary);
}

/* CTA 行 — 输入框 320×56 r14 + 按钮 56 r14 */
.cta-row { display: flex; align-items: center; gap: 12px; }

.email-input {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 320px;
  height: 56px;
  padding: 0 18px;
  background: var(--card);
  border: 1px solid var(--input-border);
  border-radius: var(--r-input);
  box-shadow: var(--shadow-input);
  transition: border-color .2s, box-shadow .2s;
}
.email-input:focus-within {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(91, 91, 214, 0.12);
}
.email-input svg { width: 18px; height: 18px; flex: none; }
.email-input input {
  border: none;
  outline: none;
  background: transparent;
  width: 100%;
  font-size: 15px;
  font-family: var(--sans);
  color: var(--ink);
}
.email-input input::placeholder { color: var(--muted); }

.notify-btn {
  height: 56px;
  padding: 0 28px;
  border: none;
  border-radius: var(--r-input);
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  box-shadow: var(--shadow-btn);
  transition: transform .2s, filter .2s;
}
.notify-btn:hover { transform: translateY(-2px); filter: brightness(1.06); }
.notify-btn:active { transform: translateY(0); }

.hero-reassure { font-size: 13px; color: var(--muted); }
.hero-counter { font-size: 14px; font-weight: 500; color: var(--ink); }
.hero-hint {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--accent);
  animation: hintPulse 3s ease-in-out infinite;
}
@keyframes hintPulse { 0%,100% { opacity: .65; } 50% { opacity: 1; } }

/* ============ Games Section — padding 120/100 · gap 48 ============ */
.games-section {
  padding: 120px var(--page-pad);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 48px;
}

.games-head {
  width: 720px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.games-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 40px;
  color: var(--ink);
}

.games-sub { width: 560px; max-width: 100%; font-size: 16px; color: var(--secondary); }

/* Bento 网格 — 宽 796 / 窄 420 交替, gap 24 */
.games-grid {
  width: 100%;
  max-width: 1240px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.game-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 28px;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  transition: transform .25s ease, box-shadow .25s ease;
}
.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.08);
}
/* 796 : 420 = 设计稿宽窄比例, 用 flex 比例保持响应式 */
.game-card.wide   { flex: 796 1 480px; }
.game-card.narrow { flex: 420 1 300px; }

.card-top { display: flex; align-items: center; justify-content: space-between; }
.card-icon { width: 24px; height: 24px; }

.chip {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent-10);
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
}

.card-preview {
  height: 180px;
  border-radius: var(--r-preview);
  background: var(--preview-bg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-preview svg { width: 100%; height: 100%; }

.card-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 22px;
  color: var(--ink);
}

.card-desc { font-size: 14px; line-height: 22px; color: var(--secondary); }

.card-play {
  align-self: flex-start;
  border: none;
  background: none;
  padding: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  transition: letter-spacing .2s;
}
.card-play:hover { letter-spacing: 1px; }

/* ============ Final CTA — 面板 r28 · 渐变 #E8E6FA→#F5F5FC ============ */
.final-cta { padding: 40px var(--page-pad); }

.final-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  padding: 72px 40px;
  border-radius: var(--r-panel);
  background: linear-gradient(to right, #E8E6FA 0%, #F5F5FC 100%);
  text-align: center;
}

.final-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 34px;
  color: var(--ink);
}

.final-sub { width: 460px; max-width: 100%; font-size: 16px; color: var(--secondary); }

.email-input.small { width: 300px; height: 52px; border-radius: var(--r-input-sm); }
.notify-btn.small  { height: 52px; padding: 0 26px; border-radius: var(--r-input-sm); }

/* ============ Footer ============ */
.footer-divider { height: 1px; background: var(--card-border); }

.site-footer {
  padding: 36px var(--page-pad) 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer-left { display: flex; flex-direction: column; gap: 8px; }
.footer-brand { display: flex; align-items: center; gap: 8px; }
.footer-logo { width: 20px; height: 20px; }
.footer-wordmark { font-size: 15px; font-weight: 500; color: var(--ink); }
.footer-tag { font-size: 13px; color: var(--muted); }
.footer-copy { font-size: 12px; color: var(--faint); }

.footer-right { display: flex; align-items: center; gap: 24px; }
.footer-right a { font-size: 14px; color: var(--secondary); transition: color .2s; }
.footer-right a:hover { color: var(--ink); }

/* ============ 游戏弹窗 ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(20, 21, 26, 0.55);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay[hidden] { display: none; }

.modal-panel {
  background: var(--card);
  border-radius: var(--r-card);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  padding: 24px 28px 20px;
  width: min(520px, 100%);
  animation: modalIn .25s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

.modal-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.modal-title { font-family: var(--serif); font-weight: 600; font-size: 20px; }
.modal-meta { flex: 1; font-size: 13px; font-weight: 500; color: var(--accent); }
.modal-close {
  border: none;
  background: var(--preview-bg);
  color: var(--secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 14px;
  transition: background .2s, color .2s;
}
.modal-close:hover { background: var(--accent-10); color: var(--accent); }

.modal-body {
  border-radius: var(--r-preview);
  background: var(--preview-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 320px;
  overflow: hidden;
}
.modal-body canvas { display: block; border-radius: var(--r-preview); }

.modal-hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* 记忆翻牌棋盘 */
.memory-board {
  display: grid;
  grid-template-columns: repeat(4, 72px);
  gap: 10px;
  padding: 20px;
}
.memory-card {
  width: 72px;
  height: 72px;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  font-size: 28px;
  color: transparent;
  transition: transform .2s, background .2s;
}
.memory-card:hover { transform: scale(1.04); }
.memory-card.open { background: #fff; border: 2px solid var(--accent); color: var(--ink); }
.memory-card.done { background: var(--accent-10); border: none; color: var(--accent); cursor: default; }

/* 2048 棋盘 */
.g2048-board {
  display: grid;
  grid-template-columns: repeat(4, 80px);
  grid-template-rows: repeat(4, 80px);
  gap: 8px;
  padding: 20px;
}
.g2048-cell {
  border-radius: 10px;
  background: rgba(91, 91, 214, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 700;
  color: var(--accent);
  transition: background .12s;
}

/* 弹窗内重开按钮 */
.game-restart {
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 22px;
  box-shadow: var(--shadow-btn);
}

.game-over-layer {
  position: absolute;
  inset: 0;
  background: rgba(250, 250, 248, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-radius: var(--r-preview);
}
.game-over-layer .go-title { font-family: var(--serif); font-size: 24px; font-weight: 600; }
.game-over-layer .go-sub { font-size: 14px; color: var(--secondary); }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  z-index: 200;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  padding: 12px 24px;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  animation: modalIn .25s ease;
}

/* ============ 响应式 ============ */
@media (max-width: 1200px) {
  :root { --page-pad: 48px; }
}

@media (max-width: 900px) {
  :root { --page-pad: 24px; }
  .hero { height: auto; padding: 100px 0 90px; }
  .hero-headline { font-size: 42px; line-height: 54px; }
  .games-section { padding: 80px var(--page-pad); }
  .games-title { font-size: 30px; }
  .game-card.wide, .game-card.narrow { flex: 1 1 100%; }
  .final-title { font-size: 26px; }
  .site-footer { flex-direction: column; align-items: flex-start; gap: 20px; }
}

@media (max-width: 560px) {
  .nav-link { display: none; }
  .cta-row { flex-direction: column; width: 100%; }
  .email-input, .email-input.small { width: 100%; }
  .notify-btn, .notify-btn.small { width: 100%; }
  .hero-headline { font-size: 34px; line-height: 46px; }
  .memory-board { grid-template-columns: repeat(4, 60px); }
  .memory-card { width: 60px; height: 60px; font-size: 24px; }
  .g2048-board { grid-template-columns: repeat(4, 64px); grid-template-rows: repeat(4, 64px); }
}
