
/* mobile-fix.css · 折叠屏外屏 / 小屏手机适配补丁 */

/* ---------- 折叠屏外屏（约 320–390px） ---------- */
@media (max-width: 390px) {
  html {
    font-size: 14px;
  }

  /* 顶部 Header 极简模式 */
  header [class~="h-16"] {
    height: 2.75rem !important;
    padding-left: 0.6rem !important;
    padding-right: 0.6rem !important;
  }
  header > div > button {
    gap: 0.45rem !important;
  }
  header [class~="h-9"] {
    height: 1.65rem !important;
  }
  header [class~="text-base"] {
    font-size: 0.8rem !important;
    line-height: 1.1 !important;
  }
  /* 副标题直接隐藏，给登录按钮留空间 */
  header span[class*="text-wt-gold"],
  header span[class*="tracking-wider"] {
    display: none !important;
  }
  /* 登录按钮 */
  [class~="bg-wt-green"][class~="rounded-full"][class~="text-xs"] {
    padding: 0.25rem 0.55rem !important;
    font-size: 0.65rem !important;
    white-space: nowrap !important;
  }

  /* 导航 Tab */
  nav[class~="py-3"] {
    padding-top: 0.3rem !important;
    padding-bottom: 0.3rem !important;
  }
  nav [class~="rounded-full"] {
    padding: 0.2rem !important;
    gap: 0.1rem !important;
  }
  nav [class~="rounded-full"] [class~="text-[13px]"] {
    font-size: 10px !important;
    padding: 0.25rem 0.4rem !important;
  }
  nav [class~="rounded-full"] [class~="text-[13px]"] span {
    margin-left: 0.1rem !important;
    font-size: 8px !important;
  }

  /* 轮播图：压扁 + 文字紧凑 */
  [class~="aspect-[16/9]"] {
    aspect-ratio: 21 / 9 !important;
    max-height: 120px !important;
  }
  [class~="aspect-[16/9]"] + div [class~="text-xl"],
  [class~="aspect-[16/9]"] ~ div [class~="text-xl"] {
    font-size: 0.85rem !important;
    line-height: 1.2 !important;
  }
  [class~="aspect-[16/9]"] + div [class~="text-xs"],
  [class~="aspect-[16/9]"] ~ div [class~="text-xs"] {
    font-size: 0.6rem !important;
    margin-top: 0.05rem !important;
  }
  [class~="aspect-[16/9]"] + div,
  [class~="aspect-[16/9]"] ~ div [class~="p-5"] {
    padding: 0.35rem 0.55rem !important;
  }

  /* 音乐按钮 */
  [aria-label="播放背景音乐"],
  [title^="背景音乐"] {
    top: 4rem !important;
    right: 0.45rem !important;
    width: 1.75rem !important;
    height: 1.75rem !important;
  }

  /* 课程分类卡片 */
  [class*="grid"] > a,
  [class*="grid"] > div[class*="rounded"] {
    padding: 0.4rem !important;
    border-radius: 0.6rem !important;
  }
  [class*="grid"] h3,
  [class*="grid"] [class~="font-display"] {
    font-size: 0.8rem !important;
  }
  [class*="grid"] [class~="text-[10px]"],
  [class*="grid"] [class~="text-xs"] {
    font-size: 0.55rem !important;
  }
  [class*="grid"] [class*="text-3xl"] {
    font-size: 1.25rem !important;
  }

  /* 首页区块标题 */
  h2[class~="text-lg"] {
    font-size: 0.9rem !important;
  }
}

/* ---------- 小屏手机（391–420px） ---------- */
@media (min-width: 391px) and (max-width: 420px) {
  header [class~="h-16"] {
    height: 3rem !important;
    padding-left: 0.65rem !important;
    padding-right: 0.65rem !important;
  }
  header [class~="h-9"] {
    height: 1.75rem !important;
  }
  header [class~="text-base"] {
    font-size: 0.85rem !important;
  }
  header span[class*="text-wt-gold"] {
    font-size: 8px !important;
  }
  [class~="bg-wt-green"][class~="rounded-full"][class~="text-xs"] {
    padding: 0.3rem 0.65rem !important;
    font-size: 0.7rem !important;
  }
  nav [class~="rounded-full"] [class~="text-[13px]"] {
    font-size: 10.5px !important;
    padding: 0.3rem 0.45rem !important;
  }
  [class~="aspect-[16/9]"] {
    max-height: 145px !important;
  }
}

/* ---------- 普通手机竖屏（421–640px）轻量优化 ---------- */
@media (min-width: 421px) and (max-width: 640px) {
  [class~="aspect-[16/9]"] {
    max-height: 220px !important;
  }
  header [class~="h-16"] {
    height: 3.75rem !important;
  }
}

/* ---------- 底部安全区通用 ---------- */
@media (max-width: 640px) {
  .paper-bg,
  body > div {
    padding-bottom: env(safe-area-inset-bottom, 1rem) !important;
  }
}
    