/* ===== 前台公共样式：卡通、圆润、明亮 ===== */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

:root {
  --g-primary: #3d7cf5;
  --g-primary-dark: #2b62d9;
  --g-primary-light: #eaf2ff;
  --g-orange: #ff9f1c;
  --g-green: #2fc37a;
  --g-pink: #ff6fa5;
  --g-purple: #8b5cf6;
  --g-yellow: #ffd23f;
  --g-text: #1f2a44;
  --g-text-muted: #7a869e;
  --g-border: #e3eaf6;
  --g-bg: #f2f6fd;
  --g-card: #fff;
  --g-radius: 22px;
  --g-shadow: 0 6px 24px rgba(61, 124, 245, .08);
  --g-shadow-hover: 0 12px 32px rgba(61, 124, 245, .16);
  --g-font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
:where(.gm-body, .gm-page) {   /* 合并后：只管游戏内容区和上课页，不碰资料站外壳 */
  font-family: var(--g-font);
  color: var(--g-text);
  font-size: 15px;
  line-height: 1.6;
  /* 浅蓝底 + 淡淡的方格纸，像作业本 */
  background-color: var(--g-bg);
  background-image:
    linear-gradient(rgba(61, 124, 245, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 124, 245, .045) 1px, transparent 1px);
  background-size: 28px 28px;
  min-height: 100vh;
}
:where(.gm-body, .gm-page) a { color: var(--g-primary); text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
[v-cloak] { display: none !important; }

.hg-container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* ===== 页头 ===== */
.home-shell {
  max-width: 1320px;
  margin: 18px auto 30px;
  background: rgba(255, 255, 255, .85);
  border-radius: 32px;
  box-shadow: 0 10px 40px rgba(61, 124, 245, .08);
  border: 1px solid #fff;
  overflow: hidden;
}
.hg-header {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--g-border);
  background: #fff;
}
.hg-nav { display: flex; gap: 6px; flex: 1; justify-content: center; }
.hg-nav a {
  position: relative;
  white-space: nowrap;
  padding: 8px 16px;
  border-radius: 14px;
  color: var(--g-text);
  font-weight: 600;
  font-size: 16px;
  transition: background .2s, color .2s;
}
.hg-nav a:hover { background: var(--g-primary-light); color: var(--g-primary); }
.hg-nav a.active { color: var(--g-primary); }
.hg-nav a.active::after {
  content: "";
  position: absolute; left: 50%; bottom: 0;
  width: 22px; height: 4px; margin-left: -11px;
  border-radius: 4px;
  background: var(--g-primary);
}
.home-header-right { display: flex; align-items: center; gap: 12px; }
.home-user {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 14px 4px 4px;
  border-radius: 999px;
  color: var(--g-text);
  font-weight: 600;
  transition: background .2s;
}
.home-user:hover { background: var(--g-primary-light); }
.home-user img { width: 38px; height: 38px; }

/* 卡通 Logo：吉祥物 + 彩色描边字 */
.hg-logo { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.hg-logo img.mascot { width: 50px; height: 50px; animation: home-bob 3s ease-in-out infinite; }
.hg-logo img.custom { height: 52px; width: auto; }
.hg-logo-text {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 1px;
  background: linear-gradient(90deg, #ff8a3d, #ffbf1f 30%, #2fc37a 55%, #3d7cf5 80%, #8b5cf6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 #fff) drop-shadow(0 3px 0 rgba(61, 124, 245, .25));
  white-space: nowrap;
}

@keyframes home-bob {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-4px) rotate(3deg); }
}

/* ===== 按钮 ===== */
.home-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px;
  border-radius: 14px;
  font-size: 15px; font-weight: 700;
  color: #fff;
  background: var(--g-primary);
  box-shadow: 0 4px 0 var(--g-primary-dark);
  transition: transform .15s, box-shadow .15s, filter .15s;
  white-space: nowrap;
}
.home-btn:hover { filter: brightness(1.06); color: #fff; }
.home-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--g-primary-dark); }
.home-btn:disabled { opacity: .6; cursor: not-allowed; }
.home-btn--green { background: var(--g-green); box-shadow: 0 4px 0 #22a061; }
.home-btn--orange { background: var(--g-orange); box-shadow: 0 4px 0 #e08300; }
.home-btn--ghost {
  background: #fff; color: var(--g-primary);
  box-shadow: 0 0 0 2px var(--g-primary-light) inset, 0 3px 0 #d5e3fb;
}
.home-btn--ghost:hover { color: var(--g-primary); background: var(--g-primary-light); }
.home-btn--sm { height: 36px; padding: 0 16px; font-size: 14px; border-radius: 12px; }
.home-btn--block { width: 100%; }

/* ===== 徽标 ===== */
.home-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 10px;
  border-radius: 999px;
  font-size: 12px; font-weight: 600;
  line-height: 22px;
  white-space: nowrap;
}
.home-tag--open { background: #e6f8ee; color: #1a9b5b; }
.home-tag--lock { background: #f0f3f8; color: var(--g-text-muted); }
.home-tag--words { background: #fff3df; color: #e07b00; border: 1px solid #ffd59a; }
.home-tag--partial { background: #f1ebff; color: var(--g-purple); }
.home-tag--dev { background: #fff0f5; color: var(--g-pink); }

/* ===== 表单 ===== */
.home-field { margin-bottom: 18px; }
.home-field label { display: block; font-weight: 700; margin-bottom: 8px; }
.home-input-wrap { position: relative; }
.home-input {
  width: 100%;
  height: 52px;
  padding: 0 18px;
  border: 2px solid var(--g-border);
  border-radius: 16px;
  font-size: 16px;
  font-family: inherit;
  color: var(--g-text);
  background: #fbfcff;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.home-input:focus { border-color: var(--g-primary); background: #fff; box-shadow: 0 0 0 4px rgba(61, 124, 245, .12); }
.home-input-eye {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 10px;
  color: var(--g-text-muted); font-size: 17px;
}
.home-input-eye:hover { background: var(--g-primary-light); color: var(--g-primary); }
textarea.home-input { height: auto; padding: 14px 18px; line-height: 1.7; resize: vertical; }

/* ===== 卡片 & 空状态 ===== */
.home-card {
  background: var(--g-card);
  border-radius: var(--g-radius);
  border: 1px solid var(--g-border);
  box-shadow: var(--g-shadow);
}
.hg-empty { text-align: center; padding: 50px 20px; color: var(--g-text-muted); }
.hg-empty img { width: 110px; opacity: .9; margin-bottom: 10px; }

/* ===== 弹窗 ===== */
.home-modal-mask {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(20, 35, 70, .45);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  animation: home-fade .2s;
}
.home-modal {
  position: relative;
  width: 480px; max-width: 100%;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: #fff;
  border-radius: 28px;
  padding: 34px 32px 28px;
  box-shadow: 0 24px 60px rgba(20, 35, 70, .25);
  animation: home-pop .28s cubic-bezier(.34, 1.56, .64, 1);
}
.home-modal-close {
  position: absolute; right: 16px; top: 16px;
  width: 38px; height: 38px; border-radius: 50%;
  color: var(--g-text-muted); font-size: 20px;
}
.home-modal-close:hover { background: #f2f5fa; color: var(--g-text); }
.home-modal-head { text-align: center; margin-bottom: 22px; }
.home-modal-head .emoji { font-size: 44px; line-height: 1; }
.home-modal-head h3 { font-size: 24px; margin-top: 8px; }
.home-modal-head p { color: var(--g-text-muted); }

@keyframes home-fade { from { opacity: 0; } }
@keyframes home-pop { from { opacity: 0; transform: scale(.85) translateY(20px); } }

/* ===== 页脚 ===== */
.hg-footer { text-align: center; color: var(--g-text-muted); font-size: 13px; padding: 20px 0 30px; }

/* ===== SweetAlert2 卡通化 ===== */
.swal2-popup { border-radius: 26px !important; font-family: var(--g-font) !important; }
.swal2-styled.swal2-confirm { border-radius: 14px !important; font-weight: 700 !important; }
.swal2-styled.swal2-cancel { border-radius: 14px !important; }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .home-shell { margin: 0; border-radius: 0; border: none; }
  .hg-header { padding: 12px 16px; gap: 12px; flex-wrap: wrap; }
  /* 导航单独占满一行，不跟 Logo 抢宽度；链接不换行，放不下就横向滑动 */
  .hg-nav { order: 3; flex: 0 0 100%; justify-content: flex-start; overflow-x: auto; }
  .hg-nav a { font-size: 15px; padding: 6px 12px; white-space: nowrap; flex-shrink: 0; }
  .home-header-right { margin-left: auto; }
  .home-user span { display: none; }
  .hg-logo-text { font-size: 21px; }
  .hg-logo img.mascot { width: 40px; height: 40px; }
  .hg-container { padding: 0 16px; }
}

/* iOS 聚焦输入框会放大页面：移动端输入控件不低于 16px */
@media (max-width: 768px) {
  input, textarea, select, .home-input { font-size: 16px; }
  .home-modal { padding: 28px 20px 22px; border-radius: 24px; }
}

/* ===== 兑换激活码弹窗 ===== */
.redeem-tip { background: #fff8e8; border: 1px dashed #ffcf7a; color: #a2620b; border-radius: 14px; padding: 10px 14px; margin-bottom: 18px; font-size: 14px; }
.redeem-input { text-align: center; letter-spacing: 2px; font-family: ui-monospace, Menlo, monospace; font-weight: 700; text-transform: uppercase; }

/* 全站不显示滚动条：只隐藏外观，滚轮/触摸滚动照常 */
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* 2026 illustrated identity: quieter chrome makes the game art stand out. */
:root { --g-primary:#3869df; --g-primary-dark:#2c53b1; --g-primary-light:#edf3ff; --g-orange:#f4b65a; --g-green:#279474; --g-text:#24334d; --g-text-muted:#78869c; --g-border:#e7ecf4; --g-bg:#f4f7fc; --g-shadow:0 4px 18px #23437208; --g-shadow-hover:0 12px 28px #23437212; }
:where(.gm-body, .gm-page) { background-image:none; background-color:var(--g-bg); }
.home-shell { max-width:1380px; margin:22px auto 12px; border-radius:26px; background:#fff; border:1px solid #e8edf5; box-shadow:0 12px 50px #2e528a06; }
.hg-header { padding:18px 32px; gap:22px; min-height:88px; }
.hg-nav { gap:3px; }.hg-nav a { font-size:14px; font-weight:600; padding:9px 13px; border-radius:10px; color:#6d7990; }.hg-nav a.active { color:var(--g-primary); background:#f0f5ff; }.hg-nav a.active::after { display:none; }
.hg-logo { gap:10px; color:var(--g-text); }.hg-logo img.mascot { width:48px; height:48px; border-radius:14px; object-fit:cover; animation:none; }.hg-logo-text { font-size:21px; letter-spacing:0; color:#273d69; filter:none; background:none; font-weight:800; line-height:1.3; }.hg-logo-text small { display:block; font-size:8px; letter-spacing:2px; color:#8b9bb4; font-weight:700; margin-top:3px; }
.hg-logo img.custom { max-width:210px; height:48px; object-fit:contain; }
.home-header-right { gap:9px; }.home-header-right .home-btn { height:36px; font-size:12px; padding:0 14px; border-radius:9px; }.home-user { font-size:12px; padding-right:8px; max-width:160px; }.home-user span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }.home-user img { width:30px; height:30px; object-fit:cover; border-radius:50%; }
.home-btn { border-radius:11px; box-shadow:0 3px 0 var(--g-primary-dark); font-weight:650; }.home-btn--orange { background:#ffce7b; color:#684719; box-shadow:0 3px 0 #d5a65c; }.home-btn--orange:hover { color:#684719; }.home-btn--ghost { box-shadow:none; border:1px solid #dce5f4; background:#fff; }.home-btn--ghost:active { box-shadow:none; }.home-btn--green { box-shadow:0 3px 0 #1d7259; }
.home-tag { font-size:10px; padding:0 7px; line-height:20px; font-weight:600; }.home-tag--open { color:#238565; background:#edf8f2; }.home-tag--dev { color:#97795d; background:#f6f0e9; }
.hg-footer { padding:16px 20px 25px; font-size:11px; color:#8c99ae; }
.hg-empty img { border-radius:22px; width:130px; }.hg-empty p { color:#7b8ba4; }
.home-modal { border:1px solid #e8edf5; box-shadow:0 25px 90px #1d355837; }.home-modal-head .emoji { color:var(--g-primary); }.home-input { border-width:1px; border-radius:12px; font-size:15px; }.home-input:focus { box-shadow:0 0 0 3px #3869df12; }
:focus-visible { outline:3px solid #6596ed; outline-offset:4px; }
button:disabled { cursor:not-allowed; opacity:.5; }
@media(max-width:1430px) { .home-shell { margin:14px 24px 8px; } }
@media(max-width:1100px) { .hg-header { padding:16px 24px; gap:12px; }.hg-nav a { padding:8px 9px; font-size:12px; }.hg-logo-text { font-size:18px; }.hg-logo img.mascot { width:42px; height:42px; }.hg-logo { gap:7px; } }
@media(max-width:900px) { .home-shell { margin:0; border-radius:0; border:0; }.hg-header { padding:13px 16px 10px; gap:12px; }.hg-nav { gap:8px; }.hg-nav a { font-size:12px; padding:7px 10px; }.hg-logo-text { font-size:18px; }.home-header-right .home-btn { height:33px; padding:0 11px; }.hg-logo img.mascot { width:39px; height:39px; }.home-header-right { gap:7px; } }
/* 系统开了「减弱动态效果」时压掉装饰动画；游戏舞台里的动画是答题反馈（地鼠钻出、切开、砸中），不压 */

/* 导航：左侧游戏大厅/教学工具，右侧工具商城 */
.hg-nav { justify-content: flex-start; margin-left: 18px; }
.home-shop-link { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 10px; font-size: 14px; font-weight: 700; color: #c26a12; background: #fff4e6; border: 1px solid #ffe0bc; white-space: nowrap; }
.home-shop-link:hover, .home-shop-link.active { color: #fff; background: linear-gradient(135deg, #ffb24d, #ff8a3d); border-color: transparent; }
/* 常见问题：工具商城左边，同高同圆角，颜色更素一点；窄屏只留图标 */
.home-faq-link { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 10px; font-size: 14px; font-weight: 700; color: #5b6b86; background: #fff; border: 1px solid #e3e9f3; white-space: nowrap; }
.home-faq-link:hover, .home-faq-link.active { color: var(--g-primary); border-color: #c9d8f3; background: var(--g-primary-light); }
@media (max-width: 1100px) {
  .home-faq-link { width: 36px; padding: 0; justify-content: center; }
  .home-faq-link__text { display: none; }
}
@media (max-width: 900px) {
  .hg-nav { margin-left: 0; }
  .home-shop-link { height: 33px; padding: 0 10px; font-size: 12px; }
  .home-faq-link { width: 33px; height: 33px; font-size: 13px; flex-shrink: 0; }
}

/* 通栏布局：导航铺满整个浏览器宽度并吸顶，内容不再装在居中圆角卡片里 */
.home-shell { max-width: none; margin: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: visible; }
.hg-header { position: sticky; top: 0; z-index: 60; min-height: 64px; padding: 0 28px; gap: 18px; background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); border-bottom: 1px solid #e6ebf3; box-shadow: 0 2px 12px #2343720a; }
.hg-logo img.mascot { width: 40px; height: 40px; border-radius: 12px; }
.hg-logo-text { font-size: 19px; }
.hg-nav { margin-left: 10px; padding-left: 18px; border-left: 1px solid #e6ebf3; }
.hg-nav a { font-size: 15px; padding: 8px 14px; }
.hg-main { max-width: 1680px; margin: 0 auto; }
@media (max-width: 1430px) { .home-shell { margin: 0; } }
@media (max-width: 1100px) { .hg-header { padding: 0 20px; } .hg-nav a { font-size: 13px; padding: 7px 10px; } }
@media (max-width: 900px) {
  .hg-header { position: static; padding: 10px 16px 8px; min-height: 0; }
  .hg-nav { padding-left: 0; border-left: 0; margin-left: 0; }
  .hg-logo img.mascot { width: 36px; height: 36px; }
}

/* ---------- 统一下拉框 <home-select>（home-select.js）：全站不用原生 select ---------- */
.hs { position: relative; display: inline-flex; min-width: 0; vertical-align: middle; }
.hs--block { display: flex; width: 100%; }
.hs-trigger {
  position: relative; display: flex; align-items: center; width: 100%; height: 40px; padding: 0 34px 0 14px;
  border: 1.5px solid var(--g-border); border-radius: 12px; background: #fff; color: var(--g-text);
  font-size: 14px; font-weight: 600; text-align: left; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.hs-trigger:hover { border-color: #c6d6f2; }
.hs-trigger:focus-visible, .hs.is-open .hs-trigger { outline: none; border-color: var(--g-primary); box-shadow: 0 0 0 3px rgba(61, 124, 245, .14); }
.hs-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hs-label.is-placeholder { color: var(--g-text-muted); font-weight: 500; }
.hs-arrow { position: absolute; right: 12px; top: 50%; margin-top: -5px; font-size: 10px; color: #9aa7bd; transition: transform .2s; }
.hs.is-open .hs-arrow { transform: rotate(180deg); color: var(--g-primary); }
.hs.is-disabled .hs-trigger { cursor: not-allowed; opacity: .55; background: #f6f8fc; }
.hs--sm .hs-trigger { height: 34px; padding: 0 30px 0 11px; border-radius: 10px; font-size: 13px; }
.hs--sm .hs-arrow { right: 10px; }
.hs--lg .hs-trigger { height: 50px; padding: 0 40px 0 18px; border-radius: 14px; font-size: 15px; }
.hs--lg .hs-arrow { right: 16px; }

.hs-menu {
  position: fixed; z-index: 3000; max-height: 280px; overflow-y: auto; padding: 6px;
  background: #fff; border: 1px solid var(--g-border); border-radius: 14px;
  box-shadow: 0 14px 34px rgba(31, 42, 68, .16); animation: hs-in .12s ease-out;
}
@keyframes hs-in { from { opacity: 0; transform: translateY(-4px); } }
.hs-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 12px; border-radius: 9px;
  color: var(--g-text); font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer;
}
.hs-opt.is-active { background: #f2f6fd; }
.hs-opt.is-selected { color: var(--g-primary); font-weight: 700; }
.hs-opt.is-selected i { font-size: 12px; }
.hs-opt.is-disabled { color: #c3cad7; cursor: not-allowed; background: none; }
.hs-empty { padding: 10px 12px; color: var(--g-text-muted); font-size: 13px; }

/* ===== 顶部「上课班级」切换（两个及以上班级才显示）：和「工具商城」同款胶囊 ===== */
.home-class-switch { position: relative; display: flex; align-items: center; }
.home-class-switch__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); z-index: 1; font-size: 14px; color: var(--g-primary); pointer-events: none; }
.home-class-switch .hs { max-width: 180px; }
.home-class-switch .hs-trigger {
  height: 36px; padding: 0 30px 0 34px; border-radius: 10px; border: 1px solid #d7e4fb;
  background: #eef4ff; color: var(--g-primary); font-size: 14px; font-weight: 700;
}
.home-class-switch .hs-trigger:hover { background: #e2ecff; border-color: #c2d5f8; }
.home-class-switch .hs-arrow { color: #7d9bd6; }
@media (max-width: 900px) {
  .home-class-switch .hs { max-width: 130px; }
  .home-class-switch .hs-trigger { height: 33px; padding: 0 26px 0 30px; font-size: 12px; }
  .home-class-switch__icon { left: 10px; font-size: 12px; }
}


/* ===== 导航栏全屏按钮：和「工具商城」同高同圆角 ===== */
.home-fs-btn { width: 36px; height: 36px; flex-shrink: 0; border-radius: 10px; display: grid; place-items: center; border: 1px solid #e3e9f3; background: #fff; color: #5b6b86; font-size: 15px; }
.home-fs-btn:hover { color: var(--g-primary); border-color: #c9d8f3; background: var(--g-primary-light); }
@media (max-width: 900px) { .home-fs-btn { width: 33px; height: 33px; font-size: 13px; } }

/* ===== 我的设置：导航栏放在底部（个子矮的老师在大屏上够得到） ===== */
.nav-bottom .hg-header {
  position: fixed; top: auto; bottom: 0; left: 0; right: 0; z-index: 60;
  border-bottom: 0; border-top: 1px solid #e6ebf3; box-shadow: 0 -4px 16px #2343720f;
  padding-bottom: env(safe-area-inset-bottom);
}
body.nav-bottom { padding-bottom: 88px; }   /* 页脚也要露出来，留白加在 body 上 */
@media (max-width: 900px) { body.nav-bottom { padding-bottom: 116px; } }

/* ===== 课堂快捷入口：主按钮和展开后的图标统一为书院青色系 ===== */
.hq { position: fixed; bottom: calc(22px + env(safe-area-inset-bottom)); z-index: 80; display: flex; flex-direction: column; gap: 12px; pointer-events: none; }   /* 容器本身透明区域不挡点击，只有按钮和展开的菜单可点 */
.hq--right { right: 22px; align-items: flex-end; }
.hq--left { left: 22px; align-items: flex-start; }
.nav-bottom .hq { bottom: calc(100px + env(safe-area-inset-bottom)); }
.hq-fab {
  pointer-events: auto;
  width: 62px; height: 62px; border: 2px solid #fff; border-radius: 21px; display: grid; place-items: center;
  background: linear-gradient(145deg, #309c89, #246981); color: #fff; font-size: 25px;
  box-shadow: 0 11px 26px #155d6070, inset 0 1px 0 #ffffff55; transition: transform .22s, background .22s, box-shadow .22s;
}
.hq-fab:hover { transform: translateY(-3px); box-shadow: 0 15px 30px #155d6070, inset 0 1px 0 #ffffff55; }
.hq-fab-art { width: 47px; height: 47px; display: block; object-fit: contain; filter: drop-shadow(0 3px 2px #174c5166); }
.hq-fab:active { transform: translateY(1px) scale(.96); }
.hq.is-open .hq-fab { background: linear-gradient(145deg, #365b65, #254a59); border-radius: 19px; animation: hq-fab-pop .3s ease-out; }
.hq-fab:focus-visible,.hq-item:focus-visible { outline: 3px solid #e2a963; outline-offset: 3px; }
.hq-list {
  width: min(266px, calc(100vw - 24px)); max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px - env(safe-area-inset-bottom)); overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; gap: 9px; padding: 8px 6px;
  scrollbar-width: none; pointer-events: none;   /* 快捷项多时仍可滚动，但不显示滚动条 */
}
.hq-list::-webkit-scrollbar { display: none; }
.hq--right .hq-list { align-items: flex-end; }
.hq--left .hq-list { align-items: flex-start; }
.nav-bottom .hq-list { max-height: calc(100dvh - 190px - env(safe-area-inset-bottom)); }
.hq.is-open .hq-list { pointer-events: auto; }
.hq-item {
  width: max-content; min-width: 164px; max-width: 252px; min-height: 55px; display: flex; align-items: center; gap: 10px; padding: 6px 13px 6px 6px;
  border: 1px solid #dce9e3; border-radius: 17px; background: #fffdfaf5; box-shadow: 0 7px 17px #244f4b22, 0 2px 5px #244f4b0d; backdrop-filter: blur(12px);
  color: #31544e; font-size: 14px; font-weight: 750; text-align: left; text-decoration: none; white-space: nowrap;
  opacity: 0; transform: translateY(20px) scale(.82); transition: opacity .16s, transform .18s, background .16s;
}
.hq--right .hq-item { transform-origin: right bottom; }
.hq--left .hq-item { transform-origin: left bottom; }
.hq.is-open .hq-item { opacity: 1; transform: none; pointer-events: auto; animation: hq-item-pop .32s ease-out backwards; animation-delay: calc(var(--hq-step, 0) * 40ms); }
.hq-item:hover { background: #f4fbf7; color: #1e6e65; transform: translateY(-2px); text-decoration: none; }
.hq-item:active { transform: scale(.98); }
.hq-ico { width: 41px; height: 41px; flex: 0 0 41px; border-radius: 13px; display: grid; place-items: center; overflow: hidden; background: #e6f3ee; color: #237d6e; font-size: 17px; }
.hq-ico--tools { background: #fff0e3; color: #be7442; }
.hq-ico--classes { background: #e5f0fa; color: #4985af; }
.hq-ico--fullscreen { background: #eeeaf8; color: #7f68a3; }
.hq-ico--back { background: #edf0f2; color: #657884; }
.hq-ico--recent { background: #fff0d8; }
.hq-ico--game { background: #e8f3ee; }
.hq-ico img { width: 100%; height: 100%; display: block; object-fit: cover; }
.hq-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.hq-item em { flex-shrink: 0; padding: 3px 7px; border-radius: 7px; background: #fff0d8; color: #aa712b; font-size: 10px; font-weight: 800; font-style: normal; }
@keyframes hq-fab-pop {
  0% { transform: scale(.84) rotate(-10deg); }
  48% { transform: scale(1.13) rotate(4deg); }
  72% { transform: scale(.95) rotate(-2deg); }
  100% { transform: none; }
}
@keyframes hq-item-pop {
  0% { opacity: 0; transform: translateY(26px) scale(.66); }
  52% { opacity: 1; transform: translateY(-7px) scale(1.075); }
  75% { transform: translateY(3px) scale(.97); }
  90% { transform: translateY(-2px) scale(1.015); }
  100% { opacity: 1; transform: none; }
}
@media (max-width: 900px) {
  .hq { bottom: calc(16px + env(safe-area-inset-bottom)); }
  .hq--right { right: 16px; } .hq--left { left: 16px; }
  .nav-bottom .hq { bottom: calc(128px + env(safe-area-inset-bottom)); }
  .hq-fab { width: 54px; height: 54px; border-radius: 18px; font-size: 21px; }
  .hq-fab-art { width: 42px; height: 42px; }
  .hq-list { max-height: calc(100dvh - 118px - env(safe-area-inset-bottom)); }
  .nav-bottom .hq-list { max-height: calc(100dvh - 210px - env(safe-area-inset-bottom)); }
}

/* ===== 开通弹窗：在线购买 + 激活码（home-redeem.js） ===== */
.home-modal.pay-modal { width: 420px; padding: 0; overflow-x: hidden; }
.pay-modal .home-modal-close { z-index: 1; }
/* 顶部：商品名 + 价格 */
.pay-head { padding: 30px 28px 24px; text-align: center; background: linear-gradient(180deg, #eef4ff 0%, #f7faff 70%, #fff 100%); border-bottom: 1px solid #edf1f8; }
.pay-kind { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; background: #fff; border: 1px solid #dbe6fb; color: var(--g-primary); font-size: 12px; font-weight: 700; }
.pay-head h3 { margin-top: 12px; font-size: 22px; font-weight: 800; line-height: 1.35; color: var(--g-text); word-break: break-all; }
.pay-sub { margin-top: 8px; color: var(--g-text-muted); font-size: 14px; }
.pay-price { display: flex; align-items: baseline; justify-content: center; flex-wrap: wrap; gap: 4px 10px; margin-top: 12px; }
.pay-gifts { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 4px 12px; border-radius: 14px; background: #fff1f2; color: #d23c4e; font-size: 13px; font-weight: 600; }
.pay-price-now { color: #e5484d; font-weight: 900; line-height: 1; }
.pay-price-now small { font-size: 18px; margin-right: 2px; }
.pay-price-now b { display: inline-block; min-width: 4ch; font-size: 40px; letter-spacing: -.5px; }
.pay-price s { color: #a3afc2; font-size: 14px; }
.pay-price em { align-self: center; padding: 3px 10px; border-radius: 999px; background: #e9f8ef; color: #23874a; font-size: 12px; font-style: normal; font-weight: 700; }
.pay-body { padding: 22px 28px 26px; }
/* 付款方式 */
.pay-label { margin-bottom: 10px; color: var(--g-text-muted); font-size: 13px; font-weight: 600; }
.pay-channels { display: grid; gap: 10px; }
.pay-channels:empty { display: none; }
.pay-channel { display: flex; align-items: center; gap: 12px; width: 100%; height: 56px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--g-border); background: #fff; color: var(--g-text); font-size: 16px; font-weight: 700; text-align: left; transition: border-color .15s, background .15s; }
.pay-channel > i:first-child { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 19px; }
.pay-channel span { flex: 1; }
.pay-channel .pay-go { color: #b6c0d1; font-size: 13px; }
.pay-channel.alipay > i:first-child { background: #1677ff; }
.pay-channel.wechat > i:first-child { background: #07c160; }
.pay-channel.alipay:hover { border-color: #1677ff; background: #f3f8ff; }
.pay-channel.wechat:hover { border-color: #07c160; background: #f1fbf5; }
.pay-mock { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 44px; margin-top: 10px; border-radius: 12px; border: 1px dashed #c9b8f0; background: #faf7ff; color: #7a5bd0; font-size: 14px; font-weight: 700; }
.pay-mock:hover { background: #f3edff; }
.pay-owned, .pay-off { text-align: center; color: #23874a; font-weight: 700; }
.pay-off { color: var(--g-text-muted); font-weight: 600; }
.pay-loading { text-align: center; padding: 14px 0; color: var(--g-text-muted); font-size: 20px; }
/* 激活码 */
.pay-code { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--g-border); text-align: center; }
.pay-code-toggle { padding: 6px 12px; border-radius: 10px; color: var(--g-text-muted); font-size: 14px; font-weight: 600; }
.pay-code-toggle:hover { background: #fff6e6; color: #c27100; }
.pay-code-row { display: flex; gap: 8px; }
.pay-code-row .home-input { flex: 1; min-width: 0; height: 46px; }
.pay-code-row .home-btn { flex: none; height: 46px; padding: 0 20px; box-shadow: none; }
/* 扫码 */
.pay-qr-box { text-align: center; }
.pay-qr { width: 208px; height: 208px; margin: 0 auto 14px; padding: 8px; border-radius: 16px; background: #fff; border: 1px solid var(--g-border); box-shadow: 0 6px 20px rgba(31, 42, 68, .06); }
.pay-qr svg { width: 100%; height: 100%; display: block; }
.pay-qr-tip { font-size: 16px; font-weight: 800; color: var(--g-text); }
.pay-qr-tip i { margin-right: 4px; }
.pay-wait { width: 96px; height: 96px; margin: 6px auto 12px; border-radius: 28px; display: grid; place-items: center; background: #eef5ff; font-size: 48px; color: #1677ff; animation: pay-wait 1.6s ease-in-out infinite; }
@keyframes pay-wait { 50% { transform: scale(1.06); } }
.pay-qr-tip.alipay i { color: #1677ff; }
.pay-qr-tip.wechat i { color: #07c160; }
.pay-qr-tip.mock i { color: #7a5bd0; }
.pay-qr-sub { margin-top: 4px; font-size: 12px; color: var(--g-text-muted); }
.pay-count { display: inline-block; min-width: 3.4em; text-align: center; font-weight: 800; color: var(--g-text); }   /* 倒计时变化不挤动 */
.pay-mock-ok { width: 100%; height: 46px; margin-top: 14px; border-radius: 12px; background: #7a5bd0; color: #fff; font-size: 15px; font-weight: 700; }
.pay-qr-box .home-btn { margin-top: 12px; }
.pay-back { margin-top: 10px; padding: 6px 12px; border-radius: 10px; color: var(--g-text-muted); font-size: 13px; }
.pay-back:hover { background: #f2f5fa; color: var(--g-primary); }
.pay-expired { padding: 20px 0 6px; font-size: 16px; font-weight: 800; color: var(--g-text-muted); }
/* 商城卡片上的价格 */
.shop-price { color: #e5484d; font-weight: 900; white-space: nowrap; }
.shop-price small { font-size: .75em; margin-right: 1px; }
@media (max-width: 768px) {
  .home-modal.pay-modal { width: auto; padding: 0; }
  .pay-head { padding: 26px 20px 20px; }
  .pay-body { padding: 18px 20px 22px; }
  .pay-qr { width: 196px; height: 196px; }
}

/* ===== 手机顶栏：Logo 和按钮固定在一行，导航单独一行，不再把按钮挤到第二行 ===== */
@media (max-width: 600px) {
  .hg-logo-text small { display: none; }          /* 英文副标题字距大，手机上最占地方 */
  .home-fs-btn { display: none; }                    /* 手机上全屏用处不大，iPhone 也不支持 */
  .home-logout { display: none; }                    /* 点头像进个人中心退出 */
  .home-header-right { flex: 1 1 0; min-width: 0; justify-content: flex-end; gap: 10px; }
  .home-shop-link__pre { display: none; }
  .home-shop-link, .home-user, .home-header-right .home-btn { flex-shrink: 0; }   /* 空间不够时只让班级切换框缩短 */
  .home-class-switch { min-width: 0; flex-shrink: 1; }
  .home-class-switch .hs { max-width: 120px; }
}
@media (max-width: 400px) {
  .home-header-right { gap: 8px; }
  .home-shop-link { padding: 0; width: 33px; justify-content: center; }
  .home-shop-link__text { display: none; }
}
@media (max-width: 340px) {
  .hg-logo-text { display: none; }   /* 320 宽的小手机：把位置让给班级名称 */
}

/* ===== 激活码 / 小红书订单号兑换：输入框下方的一行引导（三处兑换入口共用，始终单行） ===== */
.redeem-guide { display: flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 12px; color: #8a9bb5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.redeem-guide i { flex-shrink: 0; color: #b0bdd3; }
.redeem-guide span { overflow: hidden; text-overflow: ellipsis; }
.redeem-guide b { color: #5d7395; font-weight: 700; }
.redeem-input::placeholder { letter-spacing: 0; font-family: inherit; font-weight: 500; text-transform: none; }   /* 中文提示别用激活码的等宽粗体 */
.pay-modal .redeem-guide { justify-content: center; }
