/* 奇宝盒 · 1-3岁启蒙工作台 — 浅蓝儿童趣味风（对齐叶子配色铁律：明亮浅色系） */
:root {
  --blue-1: #eaf6ff;
  --blue-2: #d6eeff;
  --blue-3: #b8e2ff;
  --accent: #4aa3e8;
  --accent-deep: #2d7fc4;
  --green: #6fce9c;
  --orange: #ffb45e;
  --red: #ff8a8a;
  --text: #2c4a63;
  --text-light: #6b8aa6;
  --card: #ffffff;
  --shadow: 0 4px 16px rgba(74, 163, 232, 0.14);
  --radius: 18px;
  --nav-w: 84px;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Source Han Sans SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(160deg, var(--blue-1), var(--blue-2) 60%, var(--blue-3));
  color: var(--text);
  min-height: 100vh;
}
.hide { display: none !important; }

/* ===== 年龄选择门 ===== */
.age-gate {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.gate-card {
  background: linear-gradient(150deg, #fff, #f0f9ff);
  border-radius: 28px; box-shadow: var(--shadow);
  padding: 36px 26px 26px; text-align: center; width: 100%; max-width: 420px;
  position: relative; overflow: hidden;
}
.gate-bubbles, .cover-bubbles { position: absolute; inset: 0; pointer-events: none; }
.gate-bubbles span, .cover-bubbles span {
  position: absolute; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.9), rgba(184,226,255,.5));
}
.gate-bubbles span:nth-child(1) { width: 70px; height: 70px; top: -18px; left: -14px; }
.gate-bubbles span:nth-child(2) { width: 36px; height: 36px; top: 60px; right: -8px; }
.gate-bubbles span:nth-child(3) { width: 22px; height: 22px; bottom: 40px; left: 24px; }
.gate-bubbles span:nth-child(4) { width: 50px; height: 50px; bottom: -20px; right: 40px; }
.cover-bubbles span:nth-child(1) { width: 90px; height: 90px; top: -24px; left: -20px; }
.cover-bubbles span:nth-child(2) { width: 40px; height: 40px; top: 30px; right: -10px; }
.cover-bubbles span:nth-child(3) { width: 26px; height: 26px; bottom: 30px; left: 30px; }
.cover-bubbles span:nth-child(4) { width: 60px; height: 60px; bottom: -25px; right: 50px; }
.cover-bubbles span:nth-child(5) { width: 18px; height: 18px; top: 80px; left: 42%; }
.gate-card h1 { font-size: 30px; margin-bottom: 4px; position: relative; }
.gate-sub { color: var(--text-light); font-size: 14px; margin-bottom: 22px; position: relative; }
.gate-ask { font-size: 17px; font-weight: 600; margin-bottom: 14px; position: relative; }
.age-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; position: relative; }
.age-opt {
  background: #fff; border: 2px solid var(--blue-3); border-radius: 16px;
  padding: 16px 8px; cursor: pointer; transition: all .15s;
  font-size: 15px; font-weight: 600; color: var(--text);
}
.age-opt em { display: block; font-style: normal; font-size: 20px; margin-bottom: 4px; }
.age-opt small { display: block; font-weight: 400; color: var(--text-light); font-size: 11px; margin-top: 3px; }
.age-opt:active, .age-opt.sel { border-color: var(--accent); background: #eaf5ff; transform: scale(.97); }
.gate-note { font-size: 12px; color: var(--text-light); margin-top: 18px; line-height: 1.7; position: relative; }

/* ===== 主布局 ===== */
.app { display: flex; min-height: 100vh; }
.nav {
  width: var(--nav-w); flex-shrink: 0;
  background: linear-gradient(180deg, #2c4a63, #24405a);
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 0; gap: 2px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav-item {
  width: 100%; padding: 8px 0 6px; text-align: center; cursor: pointer;
  color: #9fc2de; border-radius: 12px; transition: background .15s;
  user-select: none;
}
.nav-item em { display: block; font-size: 21px; font-style: normal; line-height: 1.2; }
.nav-item span { font-size: 10px; display: block; margin-top: 2px; }
.nav-item.active { background: rgba(255,255,255,.12); color: #fff; }
.nav-item:active { background: rgba(255,255,255,.08); }

.main { flex: 1; padding: 14px 14px 30px; max-width: 720px; margin: 0 auto; width: 100%; }

/* ===== 封面 ===== */
.page-cover {
  background: linear-gradient(140deg, #fff 20%, var(--blue-2));
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px 22px; margin-bottom: 14px; position: relative; overflow: hidden;
}
.cover-title { font-size: 21px; font-weight: 700; position: relative; }
.cover-sub { font-size: 13px; color: var(--text-light); margin-top: 6px; position: relative; }
.cover-meta { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; position: relative; }
.cover-meta .tag {
  background: #fff; border-radius: 20px; padding: 5px 12px;
  font-size: 12px; color: var(--accent-deep); box-shadow: 0 2px 6px rgba(74,163,232,.12);
}

/* ===== 通用卡片/按钮 ===== */
.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 16px; margin-bottom: 14px;
}
.card h2 { font-size: 17px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.card h3 { font-size: 15px; margin: 12px 0 8px; }
.card p { font-size: 14px; line-height: 1.8; color: var(--text); }
.muted { color: var(--text-light); font-size: 12.5px; }
.btn {
  display: inline-block; background: var(--accent); color: #fff;
  border: none; border-radius: 14px; padding: 12px 22px;
  font-size: 15px; font-weight: 600; cursor: pointer; box-shadow: 0 4px 10px rgba(74,163,232,.3);
  transition: transform .1s;
}
.btn:active { transform: scale(.96); }
.btn.ghost { background: #fff; color: var(--accent-deep); border: 1.5px solid var(--blue-3); box-shadow: none; }
.btn.small { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.btn.warn { background: var(--orange); }
.btn:disabled { opacity: .5; }

/* 标签切换 */
.tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom 4px; margin-bottom: 12px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0; padding: 8px 16px; border-radius: 20px;
  background: #fff; border: 1.5px solid var(--blue-3); color: var(--text-light);
  font-size: 13px; cursor: pointer; white-space: nowrap;
}
.tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* 进度条 */
.bar { background: var(--blue-2); border-radius: 10px; height: 10px; overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--green)); border-radius: 10px; transition: width .3s; }

/* 网格 */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* 列表项 */
.li {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border-radius: 14px; padding: 12px 14px; margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(74,163,232,.08); cursor: pointer;
}
.li em { font-style: normal; font-size: 24px; }
.li .grow { flex: 1; min-width: 0; }
.li b { font-size: 14.5px; display: block; }
.li small { font-size: 12px; color: var(--text-light); }
.li .done { color: var(--green); font-weight: 700; }

/* 模态 */
.modal {
  position: fixed; inset: 0; background: rgba(30,50,70,.45); z-index: 90;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-card {
  background: #fff; border-radius: 22px; padding: 22px 20px;
  width: 100%; max-width: 400px; max-height: 82vh; overflow-y: auto;
}

/* toast */
.toast {
  position: fixed; bottom: 70px; left: 50%; transform: translateX(-50%);
  background: rgba(44,74,99,.92); color: #fff; border-radius: 24px;
  padding: 10px 22px; font-size: 14px; z-index: 95; white-space: nowrap;
}

/* 磨耳朵音频（保可见性，防B站判不可见暂停） */
.audio-only { opacity: 0; pointer-events: none; position: absolute; width: 1px; height: 1px; }

/* B站iframe */
.bili-wrap { position: relative; width: 100%; padding-top: 62%; border-radius: 14px; overflow: hidden; background: #000; }
.bili-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* 撒花 */
.confetti-bit { position: fixed; top: -12px; z-index: 99; font-size: 20px; animation: drop 2.4s ease-in forwards; pointer-events: none; }
@keyframes drop { to { transform: translateY(105vh) rotate(720deg); opacity: .4; } }

/* 宠物 */
.pet-stage { text-align: center; padding: 10px 0 4px; }
.pet-status { display: flex; justify-content: center; gap: 14px; margin: 10px 0; flex-wrap: wrap; }
.pet-stat { background: #fff; border-radius: 14px; padding: 8px 14px; box-shadow: 0 2px 8px rgba(74,163,232,.1); font-size: 13px; }
.pet-stat b { display: block; font-size: 15px; margin-top: 2px; }

@media (max-width: 480px) {
  :root { --nav-w: 76px; }
  .grid3 { grid-template-columns: 1fr 1fr; }
}
