/* ============================================================
   小学英语游戏屋 · 卡通设计系统 (cartoon.css)
   三个页面共用：大厅 / 学习资料 / 教师助手
   风格：明亮糖果色 + 大圆角 + 实心底部阴影（卡通立体感）+ 简洁留白
   ============================================================ */

:root {
  --ink:   #2b3a4a;   /* 主文字 */
  --ink2:  #6b7f93;   /* 次文字 */
  --ink3:  #9aa9b8;   /* 弱文字 */
  --paper: #ffffff;
  --line:  #e9eff7;

  --orange: #ff8a3d;  --orange-d: #e0700f;
  --blue:   #4c9ef5;  --blue-d:   #2b7fd8;
  --purple: #8b6ee1;  --purple-d: #6a4fd0;
  --green:  #3fbf7f;  --green-d:  #26a065;
  --pink:   #ff7aa8;  --yellow:   #ffc93c;

  /* 页面主题色，子页面用 body 上的 class 覆盖 */
  --theme: var(--blue);
  --theme-d: var(--blue-d);

  --r-lg: 26px;
  --r-md: 18px;
  --r-sm: 12px;
  /* 卡通立体：底部实心阴影 */
  --lift: 0 5px 0 rgba(43, 58, 74, .08);
  --lift-hi: 0 8px 0 rgba(43, 58, 74, .10);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  background: #dff1ff;
  background-image:
    radial-gradient(circle at 12% 6%, #fff6d6 0 90px, transparent 91px),
    radial-gradient(circle at 88% 12%, #ffffff 0 46px, transparent 47px),
    linear-gradient(180deg, #bfe8ff 0%, #e3f4ff 42%, #eefaf3 100%);
  background-repeat: no-repeat, no-repeat, no-repeat;
  background-attachment: fixed;
  padding-bottom: 8px;
}

/* 页面容器 */
.wrap { max-width: 1000px; margin: 0 auto; padding: 26px 16px 56px; }

/* ---------------- 顶部标题区 ---------------- */
.hero { text-align: center; margin-bottom: 22px; }
.hero h1 {
  font-size: 32px; font-weight: 900; letter-spacing: 1.5px; line-height: 1.35;
  text-shadow: 0 3px 0 #fff, 0 5px 12px rgba(60, 120, 180, .18);
}
.hero .sub { color: #5b7a99; font-size: 15px; margin-top: 6px; font-weight: 600; }
.hero .count {
  display: inline-block; margin-top: 12px; padding: 6px 18px;
  background: var(--paper); border-radius: 999px; font-size: 13px;
  color: var(--orange-d); font-weight: 800; box-shadow: var(--lift);
}

/* 返回胶囊 */
.back {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 12px;
  color: var(--theme-d); text-decoration: none; font-size: 13.5px; font-weight: 800;
  background: rgba(255, 255, 255, .9); padding: 7px 18px; border-radius: 999px;
  box-shadow: var(--lift); transition: transform .15s, box-shadow .15s;
}
.back:hover { background: #fff; transform: translateY(-2px); box-shadow: var(--lift-hi); }

/* ---------------- 大厅入口（三大板块） ---------------- */
.entry-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 26px;
}
.entry {
  position: relative; display: block; text-decoration: none; color: inherit;
  background: var(--paper); border-radius: var(--r-lg); padding: 20px 18px 18px;
  border: 3px solid #fff; box-shadow: var(--lift);
  transition: transform .18s, box-shadow .18s;
}
.entry:hover { transform: translateY(-4px); box-shadow: var(--lift-hi); }
.entry:active { transform: translateY(1px); }
.entry .eicon {
  width: 66px; height: 66px; border-radius: 22px; font-size: 34px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 12px;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .07);
}
.entry .etitle { font-size: 17.5px; font-weight: 900; }
.entry .esub { font-size: 12.5px; color: var(--ink2); margin-top: 4px; }
.entry .earrow {
  position: absolute; right: 16px; top: 18px; font-size: 14px; font-weight: 900;
  color: #c8d6e5;
}
.entry.go-game  .eicon { background: linear-gradient(135deg, #a9e7ff, #5cbdf5); }
.entry.go-data  .eicon { background: linear-gradient(135deg, #ffe08a, #ffc93c); }
.entry.go-teach .eicon { background: linear-gradient(135deg, #cdb9ff, #8b6ee1); }

/* 大字报式主入口（大厅第一个，跨两列） */
.entry.main {
  grid-column: span 2; display: flex; align-items: center; gap: 18px; padding: 22px 24px;
  background: linear-gradient(120deg, #fff2e3 0%, #fff9f2 60%, #ffffff 100%);
  border: 3px solid #ffe2c6;
}
.entry.main .eicon {
  width: 78px; height: 78px; font-size: 40px; margin-bottom: 0; flex: none;
  background: linear-gradient(135deg, #ffcb8a, #ff8a3d);
}
.entry.main .etitle { font-size: 21px; }
.entry.main .esub { font-size: 13.5px; }
.entry.main .ebtn {
  margin-left: auto; flex: none; display: inline-block; background: var(--orange);
  color: #fff; font-weight: 900; font-size: 15px; padding: 12px 22px; border-radius: 999px;
  box-shadow: 0 4px 0 var(--orange-d); white-space: nowrap;
}

/* ---------------- 分区标题 ---------------- */
.sectiontitle {
  display: flex; align-items: center; gap: 10px; margin: 26px 0 14px;
  font-size: 19px; font-weight: 900;
}
.sectiontitle .st-emoji {
  width: 38px; height: 38px; border-radius: 13px; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  background: var(--paper); box-shadow: var(--lift);
}
.sectiontitle .st-sub { margin-left: auto; font-size: 12.5px; color: var(--ink3); font-weight: 700; }

/* ---------------- 板块快捷导航（子页面顶部大按钮） ---------------- */
.navhead { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 10px 4px; }
.navhead .flabel { font-size: 14.5px; color: var(--ink); font-weight: 900; }
.navhead .navhint { font-size: 12px; color: var(--ink3); font-weight: 600; }
.navrow {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 12px; margin-bottom: 20px;
}
.navbtn {
  display: flex; flex-direction: column; gap: 1px; text-align: left; cursor: pointer;
  background: var(--paper); border: 3px solid #fff; border-radius: 20px; padding: 13px 16px;
  font-family: inherit; color: inherit; box-shadow: var(--lift);
  transition: transform .15s, box-shadow .15s, background .15s;
}
.navbtn:hover { transform: translateY(-3px); box-shadow: var(--lift-hi); }
.navbtn .nb-ic { font-size: 24px; line-height: 1.3; }
.navbtn .nb-t { font-weight: 900; font-size: 15px; }
.navbtn .nb-c { font-size: 12px; color: var(--ink3); font-weight: 800; }
.navbtn.on { background: var(--theme); box-shadow: 0 5px 0 var(--theme-d); }
.navbtn.on .nb-t { color: #fff; }
.navbtn.on .nb-c { color: rgba(255, 255, 255, .88); }

/* ---------------- 搜索与筛选 ---------------- */
.toolbar { margin-bottom: 18px; }
.search {
  width: 100%; padding: 14px 20px; font-size: 16px; font-family: inherit;
  border: 3px solid #fff; border-radius: var(--r-md); background: var(--paper);
  box-shadow: var(--lift); outline: none; color: var(--ink); font-weight: 600;
}
.search::placeholder { color: #a9b8c9; font-weight: 500; }
.search:focus { border-color: #b9dcff; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; }
.flabel { font-size: 13px; color: var(--ink3); margin-right: 2px; font-weight: 700; }
.chip {
  padding: 7px 16px; border-radius: 999px; border: none; cursor: pointer;
  background: rgba(255, 255, 255, .9); color: #5b7a99; font-size: 13px;
  font-family: inherit; font-weight: 800; transition: all .15s;
  box-shadow: 0 3px 0 rgba(43, 58, 74, .07);
}
.chip:hover { background: #fff; transform: translateY(-1px); }
.chip.on {
  background: var(--theme); color: #fff; box-shadow: 0 3px 0 var(--theme-d);
}

/* ---------------- 列表：分组 / 单元 ---------------- */
.gradesec { margin-bottom: 28px; }
.gradehead {
  display: flex; align-items: center; gap: 9px; margin-bottom: 14px;
  padding: 12px 18px; background: var(--paper); border-radius: var(--r-md);
  box-shadow: var(--lift);
}
.gradehead .g { font-size: 19px; font-weight: 900; }
.gradehead .gc { margin-left: auto; font-size: 12.5px; color: var(--ink3); font-weight: 800; }

.unitsec { margin-bottom: 24px; }
.unithead { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; padding-left: 4px; }
.unithead .u { font-size: 18px; font-weight: 900; }
.unithead .un { color: var(--ink2); font-size: 13.5px; font-weight: 600; }

/* 列表条目 */
.item {
  display: flex; align-items: center; gap: 14px; background: var(--paper);
  border-radius: var(--r-md); padding: 13px 16px; margin-bottom: 11px;
  box-shadow: var(--lift); text-decoration: none; color: inherit; cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.item:hover { transform: translateY(-3px); box-shadow: var(--lift-hi); }
.item:active { transform: translateY(0); }
.icon {
  flex: none; width: 50px; height: 50px; border-radius: 15px;
  display: flex; align-items: center; justify-content: center; font-size: 25px;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .06);
}
.meta { flex: 1; min-width: 0; }
.meta .t { font-weight: 900; font-size: 15.5px; margin-bottom: 2px; }
.meta .d { font-size: 12.5px; color: var(--ink2); }
.meta .x { font-size: 11.5px; color: var(--ink3); margin-top: 3px; }
.tag {
  flex: none; font-size: 12px; padding: 4px 11px; border-radius: 10px;
  background: #f1ecff; color: var(--purple-d); font-weight: 900;
}
.theme-data .tag { background: #e8f2fe; color: #1f6fd0; }
.theme-teach .tag { background: #f1ecff; color: var(--purple-d); }
.act {
  flex: none; padding: 10px 17px; border-radius: 13px; color: #fff;
  font-weight: 900; font-size: 13.5px; background: var(--theme); white-space: nowrap;
  box-shadow: 0 3px 0 var(--theme-d);
}
.item:active .act { transform: translateY(2px); box-shadow: 0 1px 0 var(--theme-d); }

/* ---------------- 空状态 / 工具类 ---------------- */
.empty { text-align: center; padding: 48px 20px; color: var(--ink3); }
.empty b { display: block; font-size: 17px; margin-bottom: 6px; color: var(--ink2); }
.hidden { display: none !important; }

/* ---------------- 页脚 ---------------- */
footer {
  margin-top: 34px; padding: 20px 22px; background: rgba(255, 255, 255, .8);
  border-radius: var(--r-lg); font-size: 13px; color: var(--ink2); box-shadow: var(--lift);
}
footer h3 { font-size: 14.5px; color: var(--ink); margin-bottom: 8px; font-weight: 900; }
footer p { margin-bottom: 6px; }
footer code { background: #eef4f9; padding: 2px 7px; border-radius: 7px; font-size: 12px; }

/* ---------------- 视频 / 音频 弹窗 ---------------- */
.mask {
  position: fixed; inset: 0; background: rgba(20, 35, 50, .55); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.player {
  background: #fff; border-radius: var(--r-lg); width: 100%; max-width: 720px;
  overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, .32);
}
.player .pt {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 18px; font-weight: 900; font-size: 15px;
}
.player .pt button {
  border: none; background: #f1f5fb; color: var(--ink2); width: 32px; height: 32px;
  border-radius: 50%; font-size: 15px; cursor: pointer; font-family: inherit; font-weight: 900;
}
.player video, .player audio { display: block; width: 100%; }
.player video { background: #000; max-height: 70vh; }
.player .pa { padding: 18px; }

/* ---------------- 阅读分级徽章 ---------------- */
.lv {
  display: inline-block; font-size: 11.5px; font-weight: 900; line-height: 1.55;
  padding: 1px 9px; border-radius: 999px; margin-right: 6px; vertical-align: 2px;
  white-space: nowrap;
}
.lv1 { background: #e6f7ec; color: #1f8a4c; }
.lv2 { background: #e7f0ff; color: #1f63d6; }
.lv3 { background: #fff0e0; color: #d2681a; }
.lvlegend {
  display: flex; flex-wrap: wrap; gap: 8px 14px; margin: -4px 0 14px; padding: 12px 16px;
  background: rgba(255, 255, 255, .85); border-radius: var(--r-md);
  font-size: 12.5px; color: #5f5980; box-shadow: var(--lift);
}
.lvlegend b { color: var(--ink); }

/* ---------------- 子页面主题（body 上加 class） ---------------- */
.theme-data  { --theme: var(--blue);   --theme-d: var(--blue-d); }
.theme-teach { --theme: var(--purple); --theme-d: var(--purple-d); }
.theme-teach {
  background-image:
    radial-gradient(circle at 12% 6%, #fff6d6 0 90px, transparent 91px),
    radial-gradient(circle at 88% 12%, #ffffff 0 46px, transparent 47px),
    linear-gradient(180deg, #ded3ff 0%, #ece6ff 42%, #f3fbff 100%);
}
.theme-data {
  background-image:
    radial-gradient(circle at 12% 6%, #fff6d6 0 90px, transparent 91px),
    radial-gradient(circle at 88% 12%, #ffffff 0 46px, transparent 47px),
    linear-gradient(180deg, #c6ecff 0%, #e6f6ff 42%, #eefaf3 100%);
}

/* ---------------- 手机 ---------------- */
@media (max-width: 640px) {
  .wrap { padding: 20px 12px 44px; }
  .hero h1 { font-size: 25px; }
  .hero .sub { font-size: 13.5px; }
  .entry-grid { grid-template-columns: 1fr; gap: 12px; }
  .entry { padding: 16px 16px 15px; }
  .entry .eicon { width: 54px; height: 54px; font-size: 28px; border-radius: 18px; margin-bottom: 10px; }
  .entry .etitle { font-size: 16.5px; }
  .entry.main { grid-column: span 1; flex-wrap: wrap; padding: 18px; gap: 14px; }
  .entry.main .eicon { width: 60px; height: 60px; font-size: 32px; }
  .entry.main .ebtn { margin-left: 0; width: 100%; text-align: center; margin-top: 4px; }
  .navrow { gap: 10px; }
  .act { padding: 9px 13px; font-size: 12.5px; }
  .item { gap: 11px; padding: 12px; }
  .icon { width: 44px; height: 44px; font-size: 21px; border-radius: 13px; }
  .sectiontitle { font-size: 17px; }
}

/* 版本号小标（帮老师一眼确认是不是最新版） */
.ver {
  display: inline-block; margin-left: 8px; padding: 2px 9px; border-radius: 999px;
  background: #fff; border: 2px solid var(--purple, #7a5cc4); color: var(--purple-d, #5b3fa8);
  font-size: 11px; font-weight: 900; vertical-align: middle;
}
