/* ─── BFST Design Tokens (v3 — Playful Education) ────────────────
   Visual tone: Warm & playful, premium feel, friendly.
   Palette: soft purple gradient hero, clean white cards, colorful icon tiles.
   Radius: rounded 20px cards.
   ──────────────────────────────────────────────────────────────── */

:root {
  /* ── Surfaces & base ─────────────────────────────── */
  --bg:       oklch(98% 0.008 300);   /* near-white with warm purple tint */
  --surface:  oklch(100% 0 0);        /* pure white cards */
  --fg:       oklch(14% 0.015 260);   /* deep slate */
  --muted:    oklch(52% 0.012 260);   /* muted labels */
  --border:   oklch(92% 0.012 290);   /* soft purple border */

  /* ── Brand purple ─────────────────────────────── */
  --accent:       oklch(62% 0.22 290);   /* #8B5CF6 主紫 */
  --accent-soft:  oklch(95% 0.04 290);   /* #EEF2FF 柔和紫 */
  --accent-deep:  oklch(45% 0.18 280);   /* 深紫强调 */

  /* ── Hero gradient: soft lavender → white ─────── */
  --hero-top:    oklch(92% 0.08 300);   /* 浅紫 #D8B4FE 色调 */
  --hero-bottom: oklch(98% 0.005 300);   /* 近白 */

  /* ── Icon tile colors (one per category) ──────── */
  --tile-coral:  #FF7A45;
  --tile-coral-soft: #FFE8DC;

  --tile-sky:    #22D3EE;
  --tile-sky-soft: #CCFBF7;

  --tile-mint:   #34D399;
  --tile-mint-soft: #D1FAE5;

  --tile-blue:   #3B82F6;
  --tile-blue-soft: #DBEAFE;

  --tile-violet: #A78BFA;
  --tile-violet-soft: #EDE9FE;

  --tile-lime:   #84CC16;
  --tile-lime-soft: #ECFCCB;

  --tile-teal:   #14B8A6;
  --tile-teal-soft: #CCFBF1;

  --tile-amber:  #F59E0B;
  --tile-amber-soft: #FEF3C7;

  /* ── Feedback status ──────────────────────────── */
  --success:      oklch(58% 0.18 145);
  --warning:      oklch(68% 0.16 75);
  --danger:       oklch(55% 0.20 28);

  --success-soft: color-mix(in oklch, var(--success) 14%, transparent);
  --warning-soft: color-mix(in oklch, var(--warning) 14%, transparent);
  --fg-soft:      color-mix(in oklch, var(--fg) 6%, transparent);

  /* ── Typography ───────────────────────────────── */
  --font-display: -apple-system, BlinkMacSystemFont, 'PingFang SC',
                  'Noto Sans SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-body:    -apple-system, BlinkMacSystemFont, 'PingFang SC',
                  'Microsoft YaHei', system-ui, sans-serif;

  /* Scale */
  --fs-display:  26px;   /* 专项训练 大标题 */
  --fs-h2:       20px;
  --fs-h3:       17px;   /* 卡片标题 */
  --fs-lead:     14px;
  --fs-body:     13px;   /* 卡片副标题 */
  --fs-meta:     12px;

  /* Spacing (4-point grid) */
  --gap-xs: 4px;
  --gap-sm: 8px;
  --gap-md: 16px;
  --gap-lg: 20px;
  --gap-xl: 24px;
  --gap-2xl: 32px;

  /* Radius — 圆润是这套设计的灵魂 */
  --radius:    14px;
  --radius-lg: 20px;   /* 卡片主圆角 */
  --radius-xl: 28px;

  /* Shadows — 柔和、轻，接近参考图的细腻感 */
  --shadow-soft:  0 4px 18px rgba(139, 92, 246, 0.08);
  --shadow-card:  0 2px 12px rgba(15, 23, 42, 0.04);
  --shadow-float: 0 12px 32px rgba(139, 92, 246, 0.18);
}

/* ─── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.01em; }
p { text-wrap: pretty; }

/* ─── App shell ─────────────────────────────────────────────── */
.app-screen {
  width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* Hero 渐变区（页面顶部的柔和紫→白） */
.hero-gradient {
  background: linear-gradient(180deg,
              var(--hero-top) 0%,
              color-mix(in oklch, var(--hero-top) 60%, var(--hero-bottom)) 55%,
              var(--hero-bottom) 100%);
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 20px 16px;
}

/* ─── Top bar ─────────────────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0 8px;
  position: relative;
  z-index: 2;
}
.app-header-back {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: var(--fg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  transition: transform 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.app-header-back:active { transform: scale(0.94); }
.app-header-back svg { width: 20px; height: 20px; }
.app-header-title {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--fg);
  text-align: center;
  flex: 1;
}

/* ─── Page title block ──────────────────────────────────── */
.page-title-block {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 8px 0 20px;
}
.page-title-text {
  flex: 1;
  min-width: 0;
}
.page-title {
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-weight: 800;
  color: var(--fg);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 6px;
}
.page-subtitle {
  font-size: var(--fs-body);
  color: var(--muted);
  font-weight: 500;
}

/* 右侧的装饰人物（参考图：睡觉的太阳） */
.mascot {
  width: 72px; height: 72px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(180deg, #FFE4B0 0%, #FFB84D 100%);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-float);
  position: relative;
  font-size: 36px;
}

/* ─── Cards grid ─────────────────────────────────────── */
.content-pad {
  padding: 8px 20px 32px;
  flex: 1;
}
.tile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* 单个卡片 */
.tile {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: left;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  color: inherit;
  border: 1px solid transparent;
}
.tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}
.tile:active {
  transform: scale(0.98);
}

/* 彩色图标方块 */
.tile-icon {
  width: 44px; height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}
.tile-icon svg { width: 22px; height: 22px; }

.tile-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  color: var(--fg);
  line-height: 1.25;
}
.tile-desc {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.4;
}

/* 各类别图标配色 */
.icon-coral  { background: var(--tile-coral-soft);  color: var(--tile-coral); }
.icon-sky    { background: var(--tile-sky-soft);    color: var(--tile-sky);   }
.icon-mint   { background: var(--tile-mint-soft);   color: var(--tile-mint);  }
.icon-blue   { background: var(--tile-blue-soft);   color: var(--tile-blue);  }
.icon-violet { background: var(--tile-violet-soft); color: var(--tile-violet);}
.icon-lime   { background: var(--tile-lime-soft);   color: var(--tile-lime);  }
.icon-teal   { background: var(--tile-teal-soft);   color: var(--tile-teal);  }
.icon-amber  { background: var(--tile-amber-soft);  color: var(--tile-amber); }

/* 标签（例如 "即将开放"） */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--accent-soft);
  color: var(--accent-deep);
  align-self: flex-start;
}

/* "更多内容敬请期待" 底注 */
.footer-hint {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 24px 0 8px;
  font-weight: 500;
}

/* ─── Buttons ─────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.1s, background 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.3);
}
.btn-primary:hover {
  background: color-mix(in oklch, var(--accent) 92%, black);
}
.btn-secondary {
  background: var(--surface);
  color: var(--fg);
  box-shadow: var(--shadow-card);
}

/* ─── Bottom navigation ─────────────────────────────── */
.app-bottom-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px var(--gap-md) calc(8px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
  position: sticky;
  bottom: 0;
  z-index: 10;
}
.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  transition: color 0.15s;
  border-radius: var(--radius);
}
.nav-item.active { color: var(--accent); }
.nav-item svg { width: 24px; height: 24px; }

/* ─── Transition helpers ─────────────────────────────── */
.fade-in { animation: fadeIn 0.3s ease both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
