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

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

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  /* 浅蓝底 + 淡淡的方格纸，像作业本 */
  background-color: var(--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;
}
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
[v-cloak] { display: none !important; }

.home-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;
}
.home-header {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.home-nav { display: flex; gap: 6px; flex: 1; justify-content: center; }
.home-nav a {
  position: relative;
  white-space: nowrap;
  padding: 8px 16px;
  border-radius: 14px;
  color: var(--text);
  font-weight: 600;
  font-size: 16px;
  transition: background .2s, color .2s;
}
.home-nav a:hover { background: var(--primary-light); color: var(--primary); }
.home-nav a.active { color: var(--primary); }
.home-nav a.active::after {
  content: "";
  position: absolute; left: 50%; bottom: 0;
  width: 22px; height: 4px; margin-left: -11px;
  border-radius: 4px;
  background: var(--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(--text);
  font-weight: 600;
  transition: background .2s;
}
.home-user:hover { background: var(--primary-light); }
.home-user img { width: 38px; height: 38px; }

/* 卡通 Logo：吉祥物 + 彩色描边字 */
.home-logo { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.home-logo img.mascot { width: 50px; height: 50px; animation: home-bob 3s ease-in-out infinite; }
.home-logo img.custom { height: 52px; width: auto; }
.home-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(--primary);
  box-shadow: 0 4px 0 var(--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(--primary-dark); }
.home-btn:disabled { opacity: .6; cursor: not-allowed; }
.home-btn--green { background: var(--green); box-shadow: 0 4px 0 #22a061; }
.home-btn--orange { background: var(--orange); box-shadow: 0 4px 0 #e08300; }
.home-btn--ghost {
  background: #fff; color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-light) inset, 0 3px 0 #d5e3fb;
}
.home-btn--ghost:hover { color: var(--primary); background: var(--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(--text-muted); }
.home-tag--words { background: #fff3df; color: #e07b00; border: 1px solid #ffd59a; }
.home-tag--partial { background: #f1ebff; color: var(--purple); }
.home-tag--dev { background: #fff0f5; color: var(--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(--border);
  border-radius: 16px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  background: #fbfcff;
  outline: none;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.home-input:focus { border-color: var(--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(--text-muted); font-size: 17px;
}
.home-input-eye:hover { background: var(--primary-light); color: var(--primary); }
textarea.home-input { height: auto; padding: 14px 18px; line-height: 1.7; resize: vertical; }

/* ===== 卡片 & 空状态 ===== */
.home-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.home-empty { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.home-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(--text-muted); font-size: 20px;
}
.home-modal-close:hover { background: #f2f5fa; color: var(--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(--text-muted); }

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

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

/* ===== SweetAlert2 卡通化 ===== */
.swal2-popup { border-radius: 26px !important; font-family: var(--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; }
  .home-header { padding: 12px 16px; gap: 12px; flex-wrap: wrap; }
  /* 导航单独占满一行，不跟 Logo 抢宽度；链接不换行，放不下就横向滑动 */
  .home-nav { order: 3; flex: 0 0 100%; justify-content: flex-start; overflow-x: auto; }
  .home-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; }
  .home-logo-text { font-size: 21px; }
  .home-logo img.mascot { width: 40px; height: 40px; }
  .home-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 { --primary:#3869df; --primary-dark:#2c53b1; --primary-light:#edf3ff; --orange:#f4b65a; --green:#279474; --text:#24334d; --text-muted:#78869c; --border:#e7ecf4; --bg:#f4f7fc; --shadow:0 4px 18px #23437208; --shadow-hover:0 12px 28px #23437212; }
body { background-image:none; background-color:var(--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; }
.home-header { padding:18px 32px; gap:22px; min-height:88px; }
.home-nav { gap:3px; }.home-nav a { font-size:14px; font-weight:600; padding:9px 13px; border-radius:10px; color:#6d7990; }.home-nav a.active { color:var(--primary); background:#f0f5ff; }.home-nav a.active::after { display:none; }
.home-logo { gap:10px; color:var(--text); }.home-logo img.mascot { width:48px; height:48px; border-radius:14px; object-fit:cover; animation:none; }.home-logo-text { font-size:21px; letter-spacing:0; color:#273d69; filter:none; background:none; font-weight:800; line-height:1.3; }.home-logo-text small { display:block; font-size:8px; letter-spacing:2px; color:#8b9bb4; font-weight:700; margin-top:3px; }
.home-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(--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; }
.home-footer { padding:16px 20px 25px; font-size:11px; color:#8c99ae; }
.home-empty img { border-radius:22px; width:130px; }.home-empty p { color:#7b8ba4; }
.home-modal { border:1px solid #e8edf5; box-shadow:0 25px 90px #1d355837; }.home-modal-head .emoji { color:var(--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) { .home-header { padding:16px 24px; gap:12px; }.home-nav a { padding:8px 9px; font-size:12px; }.home-logo-text { font-size:18px; }.home-logo img.mascot { width:42px; height:42px; }.home-logo { gap:7px; } }
@media(max-width:900px) { .home-shell { margin:0; border-radius:0; border:0; }.home-header { padding:13px 16px 10px; gap:12px; }.home-nav { gap:8px; }.home-nav a { font-size:12px; padding:7px 10px; }.home-logo-text { font-size:18px; }.home-header-right .home-btn { height:33px; padding:0 11px; }.home-logo img.mascot { width:39px; height:39px; }.home-header-right { gap:7px; } }
/* 系统开了「减弱动态效果」时压掉装饰动画；游戏舞台里的动画是答题反馈（地鼠钻出、切开、砸中），不压 */
@media(prefers-reduced-motion:reduce) { :not(.gm-stage, .gm-stage *),:not(.gm-stage *)::before,:not(.gm-stage *)::after { animation-duration:.01ms!important; animation-iteration-count:1!important; transition-duration:.01ms!important; scroll-behavior:auto!important; } }

/* 导航：左侧游戏大厅/教学工具，右侧工具商城 */
.home-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; }
@media (max-width: 900px) {
  .home-nav { margin-left: 0; }
  .home-shop-link { height: 33px; padding: 0 10px; font-size: 12px; }
}

/* 通栏布局：导航铺满整个浏览器宽度并吸顶，内容不再装在居中圆角卡片里 */
.home-shell { max-width: none; margin: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: visible; }
.home-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; }
.home-logo img.mascot { width: 40px; height: 40px; border-radius: 12px; }
.home-logo-text { font-size: 19px; }
.home-nav { margin-left: 10px; padding-left: 18px; border-left: 1px solid #e6ebf3; }
.home-nav a { font-size: 15px; padding: 8px 14px; }
.home-main { max-width: 1680px; margin: 0 auto; }
@media (max-width: 1430px) { .home-shell { margin: 0; } }
@media (max-width: 1100px) { .home-header { padding: 0 20px; } .home-nav a { font-size: 13px; padding: 7px 10px; } }
@media (max-width: 900px) {
  .home-header { position: static; padding: 10px 16px 8px; min-height: 0; }
  .home-nav { padding-left: 0; border-left: 0; margin-left: 0; }
  .home-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(--border); border-radius: 12px; background: #fff; color: var(--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(--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(--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(--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(--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(--text); font-size: 14px; font-weight: 500; white-space: nowrap; cursor: pointer;
}
.hs-opt.is-active { background: #f2f6fd; }
.hs-opt.is-selected { color: var(--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(--text-muted); font-size: 13px; }
