/* 心血管科药物游戏化学习平台 · 门户公共样式（深色医疗学习风）
 * 断点体系（移动优先）：
 *   默认      <640px   手机（全宽）
 *   ≥640px    平板（容器 max-width 720px）
 *   ≥1024px   桌面（容器 max-width 1080px 居中）
 * 触摸友好：按钮/链接 ≥44px 高；表单输入 ≥48px 高、字号 ≥16px（防 iOS 聚焦缩放）
 * 表格：<640px 转卡片式（td 用 data-label 显示字段名）；640-1023px 容器横向滚动
 */
:root {
  --bg: #0f1420;
  --bg-2: #141b2c;
  --card: #1a2236;
  --card-2: #1f2940;
  --border: #2a3550;
  --text: #e8edf7;
  --text-dim: #94a0b8;
  --primary: #2dd4bf;
  --primary-dark: #14b8a6;
  --blue: #38bdf8;
  --amber: #f5b544;
  --red: #f87171;
  --green: #34d399;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  /* 主题引擎接入点：--cd-body-bg 由 /shared/theme/theme-engine.js 按主题注入；
     未引入引擎时回退为下方原暗色背景，视觉保持不变 */
  background: var(--cd-body-bg,
    radial-gradient(1200px 600px at 80% -10%, rgba(45, 212, 191, 0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(56, 189, 248, 0.07), transparent 60%),
    linear-gradient(160deg, #141b2c 0%, #0f1420 100%));
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 15px;
}

/* ============================================================
 * 全屏氛围底图（v1.4）· 门户 12 个页面统一走这里
 * ------------------------------------------------------------
 * 变量 --cd-bg-img / --cd-bg-img-alpha 由主题引擎按主题注入；
 * **缺图或加载失败时变量为 none ⇒ 这一层什么都不画**，页面自动回退到上面那层
 * 纯 CSS 渐变 —— 与改造前逐像素一致，永不破相。
 *
 * 为什么挂在 body::before 而不是 body 自身：
 *   ① 它能叠在基底渐变之上、又落在 .hall-aurora(-1) 与全部内容之下；
 *   ② 不动 body 的 background 栈，任何既有页面无需改动；
 *   ③ position:fixed + 自身铺满视口 ⇒ 无需 background-attachment:fixed（避开 iOS 渲染坑）。
 * ============================================================ */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image: var(--cd-bg-img, none);
  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  opacity: var(--cd-bg-img-alpha, 1);
  transition: opacity 0.45s var(--cd-ease, ease);
}
@media (prefers-reduced-motion: reduce) { body::before { transition: none; } }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 布局容器（移动优先：手机全宽 → 平板 720px → 桌面 1080px） */
.page { width: 100%; margin: 0 auto; padding: 20px 14px 64px; }
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 14px;
}
.auth-card { width: 100%; max-width: 420px; }
.card {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
}

/* 品牌头 */
.brand { text-align: center; margin-bottom: 22px; }
.brand .logo {
  width: 56px; height: 56px; margin: 0 auto 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--blue));
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700; color: #06251f;
  box-shadow: 0 6px 18px rgba(45, 212, 191, 0.35);
}
.brand h1 { font-size: 20px; font-weight: 600; letter-spacing: 0.5px; }
.brand p { color: var(--text-dim); font-size: 13px; margin-top: 4px; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 13px; color: var(--text-dim);
  margin-bottom: 6px; font-weight: 500;
}
.form-group label .req { color: var(--red); margin-left: 2px; }
input[type="text"], input[type="password"], input[type="file"], select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.15);
}
input::placeholder, textarea::placeholder { color: #5b6780; }
textarea { resize: vertical; min-height: 90px; }
.field-err { color: var(--red); font-size: 12.5px; margin-top: 5px; min-height: 1em; }
.field-hint { color: var(--text-dim); font-size: 12px; margin-top: 5px; }

/* 密码强度条 */
.pw-meter { height: 6px; border-radius: 3px; background: var(--bg-2); margin-top: 8px; overflow: hidden; }
.pw-meter > i { display: block; height: 100%; width: 0; border-radius: 3px; transition: width 0.25s, background 0.25s; }
.pw-meter-label { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.pw-weak > i { width: 33%; background: var(--red); }
.pw-mid > i { width: 66%; background: var(--amber); }
.pw-strong > i { width: 100%; background: var(--green); }

/* 图片预览 */
.proof-preview { margin-top: 10px; display: none; }
.proof-preview img {
  max-width: 100%; max-height: 180px; border-radius: 10px;
  border: 1px solid var(--border); display: block;
}
.proof-preview .meta { font-size: 12px; color: var(--text-dim); margin-top: 4px; }

/* 按钮（触摸目标 ≥44px） */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px;
  padding: 11px 20px;
  border: none; border-radius: 10px;
  font-size: 15px; font-weight: 600; font-family: inherit;
  cursor: pointer; transition: transform 0.1s, filter 0.15s, opacity 0.15s;
  color: #06251f;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }
.btn-secondary { background: var(--card-2); color: var(--text); border: 1px solid var(--border); }
.btn-danger { background: linear-gradient(135deg, #f87171, #dc2626); color: #fff; }
.btn-amber { background: linear-gradient(135deg, var(--amber), #d97706); color: #2a1a00; }
.btn-sm { min-height: 44px; padding: 8px 14px; font-size: 13.5px; border-radius: 8px; }
.btn .spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(0, 0, 0, 0.25); border-top-color: currentColor;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 徽标 */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.badge-pending { background: rgba(245, 181, 68, 0.15); color: var(--amber); border: 1px solid rgba(245, 181, 68, 0.4); }
.badge-active { background: rgba(52, 211, 153, 0.15); color: var(--green); border: 1px solid rgba(52, 211, 153, 0.4); }
.badge-rejected { background: rgba(248, 113, 113, 0.15); color: var(--red); border: 1px solid rgba(248, 113, 113, 0.4); }
.badge-suspended { background: rgba(148, 160, 184, 0.15); color: var(--text-dim); border: 1px solid var(--border); }
.badge-role { background: rgba(56, 189, 248, 0.15); color: var(--blue); border: 1px solid rgba(56, 189, 248, 0.4); }
.badge-admin { background: rgba(245, 181, 68, 0.15); color: var(--amber); border: 1px solid rgba(245, 181, 68, 0.4); }

/* 提示条 */
.alert {
  padding: 12px 14px; border-radius: 10px;
  font-size: 13.5px; margin-bottom: 16px;
  border: 1px solid;
}
.alert-error { background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.35); color: #fca5a5; }
.alert-info { background: rgba(56, 189, 248, 0.1); border-color: rgba(56, 189, 248, 0.35); color: #7dd3fc; }
.alert-warn { background: rgba(245, 181, 68, 0.1); border-color: rgba(245, 181, 68, 0.35); color: #fcd34d; }
.alert-success { background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.35); color: #6ee7b7; }

/* 顶部用户栏（小屏可换行堆叠，退出按钮不挤压昵称） */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
  padding: 14px 18px; margin-bottom: 24px;
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.topbar .who { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 200px; }
.topbar .avatar {
  width: 38px; height: 38px; flex: none; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--blue));
  color: #06251f; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.topbar .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar > .btn, .topbar > .row { flex: none; }

/* 游戏卡片（手机 1 列 → 平板 2 列 → 桌面 3 列，见底部断点） */
.game-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 24px; }
.game-card {
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px;
}
.game-card .gicon { font-size: 34px; }
.game-card h3 { font-size: 17px; }
.game-card p { color: var(--text-dim); font-size: 13.5px; flex: 1; }
.nav-links { display: flex; flex-wrap: wrap; gap: 10px; }
.nav-links a {
  min-height: 44px;
  display: inline-flex; align-items: center;
  padding: 10px 16px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); font-size: 14px;
}
.nav-links a:hover { border-color: var(--primary); text-decoration: none; }

/* 表格（<640px 卡片式；≥640px 容器可横向滚动） */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { color: var(--text-dim); font-weight: 600; background: var(--bg-2); font-size: 12.5px; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(45, 212, 191, 0.04); }

/* Tabs（可横向滑动，窄空间也能完整展示全部项）
 * v1.7：不再藏滚动条 —— 藏起来用户根本不知道右边还有内容（26 款游戏时必然溢出）。
 * 改为「可见细滚动条 + 两端箭头（JS 挂 .xarrow）+ 滚轮横滚」，见下方 .xscroll 通用件。 */
.tabs {
  display: flex; gap: 8px; margin-bottom: 18px;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tab-btn {
  flex: none;
  min-height: 44px;
  padding: 9px 18px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text-dim); font-size: 14px; font-weight: 600;
  white-space: nowrap;
  cursor: pointer; font-family: inherit;
}
.tab-btn.active { color: #06251f; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); border-color: transparent; }

/* ===== 横向滚动容器通用件（v1.7）
 * 用途：任何「一行放不下、又必须完整可达」的横向列表（游戏页签条、宽表格…）。
 * 用法：<div class="xscroll-wrap"><div class="xscroll" id="x">…</div></div>
 *       Portal.xScroll(document.getElementById("x"), { arrows: true });
 * 组成：① 可见细滚动条（自带"还有内容"的进度提示，触屏自动隐藏、直接滑动）；
 *       ② 两端箭头（JS 注入 .xarrow，与滚动区**并排**而不是浮在上面，避免挡住内容；
 *          到头自动置灰；窄屏隐藏，触屏手势比按钮自然）；
 *       ③ 滚轮直接横滚（桌面鼠标没有横向滚轮，否则只能去拖滚动条）。
 * 注：箭头只在确实溢出时出现（.can-x）。因为箭头出现只会让滚动区变窄，
 *     不会反过来让内容变得不溢出，所以不存在「显隐互相触发」的抖动。 */
.xscroll {
  overflow-x: auto; overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.xscroll::-webkit-scrollbar { height: 7px; }
.xscroll::-webkit-scrollbar-track { background: transparent; }
.xscroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }
.xscroll::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
.xscroll-wrap { display: flex; align-items: center; gap: 6px; }
.xscroll-wrap > .xscroll { flex: 1 1 auto; min-width: 0; }
.xarrow {
  flex: none; width: 30px; padding: 0;
  display: none; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--card); color: var(--text);
  font-size: 18px; line-height: 1; cursor: pointer; font-family: inherit;
}
.xscroll-wrap.can-x > .xarrow { display: flex; }
.xarrow[disabled] { opacity: .32; cursor: default; }
/* 触屏：滑动比按钮自然，箭头只会挤占空间 */
@media (max-width: 767px) { .xarrow { display: none !important; } }

/* 抽屉 */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(6, 10, 18, 0.6);
  backdrop-filter: blur(2px); z-index: 40;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 41;
  width: min(480px, 92vw);
  background: var(--card); border-left: 1px solid var(--border);
  transform: translateX(100%); transition: transform 0.25s;
  overflow-y: auto; padding: 22px;
}
.drawer-mask.open { opacity: 1; pointer-events: auto; }
.drawer.open { transform: translateX(0); }
.drawer h3 { margin-bottom: 14px; }
.detail-row { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.detail-row .k { color: var(--text-dim); width: 84px; flex: none; }
.detail-row .v { flex: 1; word-break: break-all; }
.drawer .proof-img { max-width: 100%; border-radius: 10px; border: 1px solid var(--border); margin-top: 10px; }
.drawer-actions { display: flex; gap: 10px; margin-top: 20px; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(6, 10, 18, 0.65); backdrop-filter: blur(2px);
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.modal-mask.open { display: flex; }
.modal {
  width: 100%; max-width: 440px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.modal h3 { margin-bottom: 14px; font-size: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }

/* Toast */
.toast-box { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); }
.toast {
  padding: 11px 16px; border-radius: 10px;
  background: var(--card-2); border: 1px solid var(--border);
  box-shadow: var(--shadow); font-size: 14px;
  animation: toast-in 0.25s ease;
}
.toast-success { border-color: rgba(52, 211, 153, 0.5); color: var(--green); }
.toast-error { border-color: rgba(248, 113, 113, 0.5); color: #fca5a5; }
.toast-info { border-color: rgba(56, 189, 248, 0.5); color: #7dd3fc; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* 开关（游戏管理上线/下线） */
.switch { position: relative; display: inline-block; width: 46px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--card-2); border: 1px solid var(--border); border-radius: 999px; transition: .2s;
}
.switch .slider:before {
  content: ""; position: absolute; height: 20px; width: 20px; left: 2px; top: 2px;
  background: #cbd5e1; border-radius: 50%; transition: .2s;
}
.switch input:checked + .slider { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); border-color: transparent; }
.switch input:checked + .slider:before { transform: translateX(20px); background: #fff; }
.switch input:disabled + .slider { opacity: .55; cursor: not-allowed; }
.badge-bypass { background: rgba(45, 212, 191, 0.15); color: var(--primary); border: 1px solid rgba(45, 212, 191, 0.4); }

/* 注册模式单选（药丸式） */
.radio-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); cursor: pointer; font-size: 14px; }
.radio-pill input { width: 16px; height: 16px; accent-color: var(--primary); }
.radio-pill:has(input:checked) { border-color: var(--primary); background: rgba(45, 212, 191, 0.1); color: var(--primary); }
.modal-list { margin: 10px 0 4px 18px; color: var(--text-dim); font-size: 13.5px; line-height: 1.9; }

/* 游客试玩横幅 */
.trial-banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 20px;
  background: rgba(245, 181, 68, 0.1); border: 1px solid rgba(245, 181, 68, 0.35);
  border-radius: var(--radius); font-size: 13.5px; color: #fcd34d;
}
.trial-banner .spacer { flex: 1; }

/* 状态页（pending/rejected） */
.status-hero { text-align: center; padding: 12px 0 4px; }
.status-hero .big { font-size: 52px; margin-bottom: 8px; }
.status-hero h2 { font-size: 19px; margin-bottom: 8px; }
.status-hero p { color: var(--text-dim); font-size: 14px; }
.status-meta {
  margin: 18px 0; padding: 14px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 10px; font-size: 13.5px; color: var(--text-dim);
}
.celebrate {
  text-align: center; padding: 26px 18px;
  border-radius: var(--radius); margin: 18px 0;
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.15), rgba(45, 212, 191, 0.08));
  border: 1px solid rgba(52, 211, 153, 0.4);
}
.celebrate h2 { color: var(--green); font-size: 20px; margin-bottom: 8px; }

/* 工具 */
.muted { color: var(--text-dim); }
.center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.row { display: flex; gap: 10px; align-items: center; }
.row-wrap { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }
.empty { text-align: center; color: var(--text-dim); padding: 36px 0; font-size: 14px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 16px; font-size: 13.5px; color: var(--text-dim); }

/* ===== 断点：<640px 手机 ===== */
@media (max-width: 639px) {
  /* 表格转卡片式：每行变独立卡片，td 用 data-label 显示字段名 */
  .table-wrap { overflow-x: visible; border: none; border-radius: 0; }
  .table-wrap table { min-width: 0; font-size: 14px; }
  .table-wrap thead { display: none; }
  .table-wrap tbody tr {
    display: block;
    background: linear-gradient(180deg, var(--card), var(--card-2));
    border: 1px solid var(--border); border-radius: 12px;
    margin-bottom: 12px; padding: 4px 0;
  }
  .table-wrap tbody tr:hover { background: linear-gradient(180deg, var(--card), var(--card-2)); }
  .table-wrap td {
    display: flex; justify-content: space-between; align-items: center; gap: 12px;
    white-space: normal; text-align: right;
    padding: 10px 14px; border-bottom: 1px dashed var(--border);
  }
  .table-wrap td::before {
    content: attr(data-label);
    color: var(--text-dim); font-size: 12.5px; font-weight: 600;
    text-align: left; flex: none;
  }
  .table-wrap td:last-child { border-bottom: none; }
  /* 空态/加载行（无 data-label 的整行单元格）保持居中块级 */
  .table-wrap td.empty { display: block; text-align: center; padding: 28px 14px; }
  .table-wrap td.empty::before { content: none; }
  /* 卡片内操作按钮组允许换行 */
  .table-wrap td .btn { margin: 2px 0; }
  /* 当前用户高亮行在卡片模式下的左边条 */
  .table-wrap tr.me-row td { background: transparent; border-top: none; }
  .table-wrap tr.me-row td:first-child { border-left: none; }
  .table-wrap tr.me-row { border-color: var(--primary); box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.35); }
}

/* ===== 断点：≥640px 平板 ===== */
@media (min-width: 640px) {
  .page { max-width: 720px; padding: 24px 16px 64px; }
  .game-grid { grid-template-columns: 1fr 1fr; }
  .auth-card { max-width: 420px; }
  .card { padding: 32px; }
}

/* ===== 断点：≥1024px 桌面 ===== */
@media (min-width: 1024px) {
  .page { max-width: 1080px; }
  .game-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ===== 带教中心 teaching.html ===== */
.teach-page { padding-bottom: 0; }            /* 移动端底部留白交给 .tab-content 承担 */
.teach-topbar { align-items: center; }
.brand-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.logo-sm { width: 40px; height: 40px; font-size: 20px; border-radius: 12px; margin: 0; box-shadow: 0 4px 12px rgba(45, 212, 191, 0.3); }
.brand-name { font-weight: 600; font-size: 16px; white-space: nowrap; }
.user-area { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.user-area .nick { font-weight: 600; }
.link-sm { font-size: 13.5px; color: var(--text-dim); cursor: pointer; }
.link-sm:hover { color: var(--primary); text-decoration: none; }
.nav-sep { width: 1px; height: 18px; background: var(--border); }

/* 顶部 Tab 导航：手机隐藏（由底部导航替代），≥768px 显示 */
.tabbar { display: none; gap: 10px; margin-bottom: 18px; }
.tabbar .tab-btn { flex: 1; }

/* 内容区：移动端底部留出空间防遮挡固定底栏 */
.tab-content { padding-bottom: 80px; }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* 分组标题 */
.group-title { font-size: 14px; font-weight: 700; color: var(--text-dim); margin: 18px 4px 10px; letter-spacing: 0.5px; }
.group-title:first-child { margin-top: 0; }

/* 网格：手机 1 列 / ≥768px 2 列 */
.teach-grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-bottom: 8px; }

/* 带教卡片（整卡可点） */
.teach-card {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
  color: var(--text); text-decoration: none; min-height: 84px;
  transition: border-color 0.15s, transform 0.1s;
}
.teach-card:hover { border-color: var(--primary); text-decoration: none; transform: translateY(-1px); }
.teach-card .tc-icon { font-size: 30px; flex: none; }
.teach-card .tc-body { flex: 1; min-width: 0; }
.teach-card .tc-title { font-weight: 600; font-size: 15.5px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.teach-card .tc-sub { font-size: 12px; color: var(--primary); font-weight: 500; }
.teach-card .tc-desc {
  font-size: 12.5px; color: var(--text-dim); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.teach-card .tc-arrow { font-size: 22px; color: var(--text-dim); flex: none; }

/* 游戏卡片（迷你，触摸高 ≥88px） */
.game-card-mini {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  background: linear-gradient(180deg, var(--card), var(--card-2));
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; min-height: 96px;
  color: var(--text); text-decoration: none;
  transition: border-color 0.15s, transform 0.1s;
}
.game-card-mini:hover { border-color: var(--primary); text-decoration: none; transform: translateY(-1px); }
.game-card-mini .gm-icon { font-size: 30px; }
.game-card-mini .gm-title { font-weight: 600; font-size: 15px; }
.game-type-badge {
  display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600;
  background: rgba(56, 189, 248, 0.15); color: var(--blue); border: 1px solid rgba(56, 189, 248, 0.35);
}

/* 即将上线卡片（置灰 / 不可点） */
.soon-card {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  background: var(--bg-2); border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 16px; min-height: 96px; color: var(--text-dim); cursor: not-allowed; opacity: 0.7;
}
.soon-card .gm-icon { font-size: 30px; filter: grayscale(1); }
.soon-card .gm-title { font-weight: 600; font-size: 15px; }
.soon-badge {
  position: absolute; top: 10px; right: 10px;
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: rgba(148, 160, 184, 0.18); color: var(--text-dim); border: 1px solid var(--border);
}
.soon-card.placeholder { align-items: center; justify-content: center; text-align: center; font-size: 14px; }

/* 底部固定导航（仅手机 <768px） */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex;
  height: calc(56px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(20, 27, 44, 0.96); backdrop-filter: blur(8px);
  border-top: 1px solid var(--border);
}
.bottom-nav .bn-btn {
  flex: 1; border: none; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--text-dim); font-size: 12px; font-family: inherit;
}
.bottom-nav .bn-btn .bn-ico { font-size: 20px; line-height: 1; transition: transform 0.12s; }
.bottom-nav .bn-btn.active { color: var(--primary); }
.bottom-nav .bn-btn.active .bn-ico { transform: scale(1.12); }

/* 响应式：手机 <768px 用底部导航；≥768px 用顶部 Tab */
@media (max-width: 767px) {
  .tabbar { display: none; }
  .bottom-nav { display: flex; }
}
@media (min-width: 768px) {
  .teach-page { padding-bottom: 24px; }
  .tab-content { padding-bottom: 0; }
  .tabbar { display: flex; }
  .bottom-nav { display: none; }
  .teach-grid { grid-template-columns: 1fr 1fr; }
}
