/* 脑力训练中心：沿用智慧树学习网的绿色教育视觉，并保持模块独立。 */
:root {
  --brand-900: #06382a;
  --brand-800: #0a5c40;
  --brand-700: #0c7a52;
  --brand-600: #0f9d63;
  --brand-500: #16b877;
  --brand-400: #3fd08f;
  --brand-300: #8ee3b8;
  --brand-200: #c2f0da;
  --brand-100: #e0f7ec;
  --brand-50: #f1fbf6;
  --ink-900: #0f1a15;
  --ink-700: #31423a;
  --ink-600: #4c5d54;
  --ink-500: #6c7c74;
  --ink-400: #95a29b;
  --line: #e4e9e4;
  --line-2: #d5ddd6;
  --bg: #f2f6f3;
  --surface: #fff;
  --blue: #2563eb;
  --violet: #7c3aed;
  --amber: #d97706;
  --red: #dc2626;
  --shadow: 0 18px 45px -28px rgba(15, 26, 21, .38);
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --font-num: "SF Mono", "DIN Alternate", ui-monospace, "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body { margin: 0; overflow-x: clip; color: var(--ink-700); background: var(--bg); font: 15px/1.65 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { color: var(--ink-900); line-height: 1.3; letter-spacing: -.02em; }
:focus-visible { outline: 3px solid rgba(22, 184, 119, .42); outline-offset: 3px; }
[hidden] { display: none !important; }
.bt-container { width: 100%; max-width: var(--container, 1320px); margin-inline: auto; padding-inline: 24px; }
.bt-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
/* 正文宽度与课程页面通用模板保持一致 */

/* 首屏 */
.bt-hero { position: relative; overflow: hidden; padding: 62px 0 44px; color: #fff; background: radial-gradient(circle at 82% 18%, rgba(62, 215, 148, .26), transparent 26%), radial-gradient(circle at 8% 100%, rgba(37, 99, 235, .18), transparent 30%), linear-gradient(125deg, var(--brand-900), var(--brand-800) 58%, var(--brand-700)); }
.bt-hero::before { content: ""; position: absolute; inset: 0; opacity: .13; background-image: linear-gradient(rgba(255,255,255,.3) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.3) 1px, transparent 1px); background-size: 44px 44px; mask-image: linear-gradient(to right, transparent, #000 45%, #000); }
.bt-hero__grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, .65fr); align-items: center; gap: 60px; }
.bt-eyebrow { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 16px; color: #9ce8c4; font-size: 12px; font-weight: 800; letter-spacing: .1em; }
.bt-eyebrow::before { content: ""; width: 28px; height: 2px; background: #55d69a; }
.bt-hero h1 { color: #fff; font-size: clamp(38px, 5vw, 58px); line-height: 1.13; }
.bt-hero h1 em { color: #8ff0bf; font-style: normal; }
.bt-hero__desc { max-width: 690px; margin-top: 18px; color: rgba(255, 255, 255, .76); font-size: 16px; line-height: 1.85; }
.bt-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.bt-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border: 1px solid transparent; border-radius: 10px; font-weight: 800; transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease; }
.bt-button:hover:not(:disabled) { transform: translateY(-1px); }
.bt-button--primary { color: #fff; background: var(--brand-700); box-shadow: 0 10px 24px -14px rgba(12, 122, 82, .8); }
.bt-button--primary:hover:not(:disabled) { background: var(--brand-800); }
.bt-button--ghost { border-color: var(--line); color: var(--ink-700); background: #fff; }
.bt-button--ghost:hover:not(:disabled) { border-color: var(--brand-200); background: var(--brand-50); }
.bt-hero .bt-button--ghost { border-color: rgba(255, 255, 255, .28); color: #fff; background: rgba(255, 255, 255, .1); }
.bt-hero .bt-button--ghost:hover { background: rgba(255, 255, 255, .18); }
.bt-hero__note { margin-top: 16px; color: rgba(255, 255, 255, .56); font-size: 12px; }
.bt-hero__visual { position: relative; width: min(100%, 330px); aspect-ratio: 1; margin-inline: auto; display: grid; place-items: center; }
.bt-brain-orbit { position: absolute; border: 1px solid rgba(143, 240, 191, .25); border-radius: 50%; }
.bt-brain-orbit--outer { inset: 4%; animation: bt-spin 26s linear infinite; }
.bt-brain-orbit--inner { inset: 21%; border-style: dashed; animation: bt-spin 18s linear infinite reverse; }
.bt-brain-core { width: 46%; aspect-ratio: 1; display: grid; place-items: center; border-radius: 30px; color: #fff; background: linear-gradient(145deg, var(--brand-400), var(--brand-800)); box-shadow: 0 28px 60px -24px rgba(0, 0, 0, .55); transform: rotate(-7deg); }
.bt-brain-core svg { width: 54%; height: 54%; transform: rotate(7deg); }
.bt-float-chip { position: absolute; padding: 8px 15px; border: 1px solid rgba(255,255,255,.24); border-radius: 999px; color: #fff; background: rgba(255,255,255,.12); box-shadow: 0 10px 28px rgba(0,0,0,.13); font-size: 12px; font-weight: 800; backdrop-filter: blur(8px); }
.bt-float-chip--one { top: 7%; left: 2%; }
.bt-float-chip--two { top: 28%; right: -2%; }
.bt-float-chip--three { bottom: 14%; left: -2%; }
.bt-float-chip--four { right: 8%; bottom: 3%; }
@keyframes bt-spin { to { transform: rotate(360deg); } }
.bt-stats { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; overflow: hidden; margin-top: 40px; border: 1px solid rgba(255,255,255,.15); border-radius: 14px; background: rgba(255,255,255,.15); }
.bt-stats div { padding: 17px 22px; background: rgba(255,255,255,.08); }
.bt-stats strong { display: block; color: #fff; font-family: var(--font-num); font-size: 24px; line-height: 1.2; }
.bt-stats span { color: rgba(255,255,255,.62); font-size: 12px; }

/* 游戏中心 */
.bt-section { padding: 38px 0 60px; }
.bt-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.bt-section-head h2 { font-size: 28px; }
.bt-section-head p { margin-top: 7px; color: var(--ink-500); font-size: 13px; }
.bt-section-head__meta { color: var(--ink-500); font-size: 13px; white-space: nowrap; }
.bt-category-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
.bt-category { min-width: 0; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-600); background: #fff; font-size: 13px; font-weight: 800; transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease; }
.bt-category svg { width: 18px; height: 18px; flex: none; color: var(--category-color, var(--brand-700)); }
.bt-category:hover { transform: translateY(-1px); border-color: var(--brand-200); color: var(--brand-700); }
.bt-category[aria-pressed="true"] { border-color: var(--brand-700); color: #fff; background: var(--brand-700); }
.bt-category[aria-pressed="true"] svg { color: #fff; }
.bt-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.bt-search { position: relative; flex: 1; max-width: 480px; }
.bt-search input { width: 100%; height: 44px; padding: 0 16px 0 42px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-900); background: #fff; outline: none; }
.bt-search input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(22,184,119,.1); }
.bt-search input::placeholder { color: var(--ink-400); }
.bt-search svg { position: absolute; top: 50%; left: 14px; width: 18px; height: 18px; color: var(--ink-500); transform: translateY(-50%); pointer-events: none; }
.bt-reset { padding: 6px 2px; border: 0; color: var(--brand-700); background: none; font-weight: 800; }
.bt-game-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.bt-game-card { position: relative; min-width: 0; overflow: hidden; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 17px; background: #fff; box-shadow: 0 2px 5px rgba(15,45,29,.025); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.bt-game-card:hover { transform: translateY(-4px); border-color: var(--brand-200); box-shadow: var(--shadow); }
.bt-game-card__visual { position: relative; min-height: 150px; display: grid; place-items: center; overflow: hidden; color: #fff; background: linear-gradient(135deg, var(--card-color), var(--brand-900)); }
.bt-game-card__visual::before, .bt-game-card__visual::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; }
.bt-game-card__visual::before { width: 190px; height: 190px; top: -95px; right: -45px; }
.bt-game-card__visual::after { width: 120px; height: 120px; bottom: -72px; left: -30px; }
.bt-game-card__icon { position: relative; z-index: 1; width: 68px; height: 68px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.25); border-radius: 20px; background: rgba(255,255,255,.13); box-shadow: 0 18px 34px rgba(0,0,0,.14); transform: rotate(-5deg); }
.bt-game-card__icon svg { width: 38px; height: 38px; transform: rotate(5deg); }
.bt-game-card__badge { position: absolute; z-index: 2; top: 13px; left: 13px; padding: 4px 9px; border-radius: 999px; color: var(--card-color); background: rgba(255,255,255,.94); font-size: 11px; font-weight: 800; }
.bt-game-card__record { position: absolute; z-index: 2; right: 13px; bottom: 12px; max-width: 55%; overflow: hidden; color: rgba(255,255,255,.78); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.bt-game-card__body { flex: 1; display: flex; flex-direction: column; padding: 18px 19px 16px; }
.bt-game-card h3 { font-size: 18px; }
.bt-game-card__subtitle { margin-top: 3px; color: var(--card-color); font-size: 12px; font-weight: 700; }
.bt-game-card__desc { display: -webkit-box; overflow: hidden; min-height: 45px; margin-top: 10px; color: var(--ink-600); font-size: 13px; line-height: 1.75; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; }
.bt-game-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line); }
.bt-game-card__time { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-500); font-size: 11px; }
.bt-game-card__time svg { width: 14px; height: 14px; }
.bt-game-card__open { display: inline-flex; align-items: center; gap: 5px; color: var(--brand-700); font-size: 12px; font-weight: 800; }
.bt-game-card__open svg { width: 15px; height: 15px; transition: transform .16s ease; }
.bt-game-card:hover .bt-game-card__open svg { transform: translateX(3px); }
.bt-empty { grid-column: 1 / -1; padding: 65px 20px; border: 1px dashed var(--line-2); border-radius: 16px; background: rgba(255,255,255,.65); text-align: center; }
.bt-empty svg { width: 42px; height: 42px; color: var(--brand-400); }
.bt-empty h3 { margin-top: 12px; font-size: 20px; }
.bt-empty p { margin-top: 7px; color: var(--ink-500); }
.bt-empty .bt-button { margin-top: 18px; }
.bt-guide-section { padding: 34px 0 52px; border-top: 1px solid var(--line); background: #fff; }
.bt-guide-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.bt-guide-grid article { padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--brand-50); }
.bt-guide-grid article > span { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; color: var(--brand-700); background: var(--brand-100); font-family: var(--font-num); font-weight: 800; }
.bt-guide-grid h3 { margin-top: 13px; font-size: 16px; }
.bt-guide-grid p { margin-top: 7px; color: var(--ink-500); font-size: 13px; }
.bt-disclaimer { padding: 18px 0; border-top: 1px solid var(--line); background: var(--brand-50); }
.bt-disclaimer p { max-width: 960px; color: var(--ink-500); font-size: 12px; line-height: 1.8; }
.bt-toast { position: fixed; z-index: 80; left: 50%; bottom: 28px; max-width: calc(100% - 32px); padding: 11px 18px; border-radius: 10px; color: #fff; background: var(--ink-900); box-shadow: var(--shadow); opacity: 0; transform: translate(-50%, 12px); transition: opacity .2s ease, transform .2s ease; pointer-events: none; }
.bt-toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* 通用游戏页 */
.bt-game-main { padding: 26px 0 50px; }
.bt-game-layout { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 16px; }
.bt-game-intro { min-width: 0; }
.bt-detail-bar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.bt-back { display: inline-flex; align-items: center; gap: 10px; padding: 7px 15px 7px 8px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink-700); background: var(--surface); box-shadow: 0 3px 10px -7px rgba(15,45,29,.35); transition: border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease; }
.bt-back__icon { width: 36px; height: 36px; display: grid; place-items: center; flex: none; border-radius: 9px; color: var(--brand-700); background: var(--brand-50); transition: background .16s ease, transform .16s ease; }
.bt-back__icon svg { width: 18px; height: 18px; }
.bt-back__copy { display: grid; gap: 1px; line-height: 1.25; text-align: left; }
.bt-back__copy > span { color: var(--ink-500); font-size: 10px; font-weight: 700; letter-spacing: .08em; }
.bt-back__copy strong { color: var(--ink-800); font-size: 13px; font-weight: 800; }
.bt-back:hover { border-color: var(--brand-200); background: var(--brand-50); box-shadow: 0 7px 16px -12px rgba(12,122,82,.55); transform: translateY(-1px); }
.bt-back:hover .bt-back__icon { background: var(--brand-100); transform: translateX(-2px); }
.bt-back:active { transform: none; }
.bt-detail-crumb { min-width: 0; justify-content: flex-end; }
.bt-detail-crumb .u-crumb__current { max-width: min(42vw, 420px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bt-game-heading { display: flex; align-items: center; gap: 18px; }
.bt-game-heading__copy { min-width: 0; flex: 1; }
.bt-game-heading__actions { flex: none; margin-left: auto; }
.bt-theme-toggle { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-600); background: var(--surface); font-size: 12px; font-weight: 800; white-space: nowrap; transition: border-color .16s ease, background .16s ease, color .16s ease; }
.bt-theme-toggle:hover { border-color: var(--brand-400); color: var(--brand-700); background: var(--brand-50); }
.bt-theme-toggle svg { width: 17px; height: 17px; flex: none; }
.bt-theme-toggle__sun { display: none; }
.bt-game-heading__icon { width: 64px; height: 64px; display: grid; place-items: center; flex: none; border-radius: 18px; color: #fff; background: linear-gradient(135deg, var(--card-color, var(--brand-700)), var(--brand-900)); box-shadow: var(--shadow); }
.bt-game-heading__icon svg { width: 34px; height: 34px; }
.bt-game-heading__tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 5px; }
.bt-game-heading__tags span { padding: 2px 8px; border-radius: 999px; color: var(--brand-700); background: var(--brand-100); font-size: 11px; font-weight: 800; }
.bt-game-heading h1 { font-size: clamp(26px, 4vw, 34px); }
.bt-game-heading p { margin-top: 6px; color: var(--ink-600); font-size: 13px; }
.bt-record-bar { display: flex; align-items: center; gap: 9px; margin-top: 18px; padding: 10px 14px; border: 1px solid var(--brand-100); border-radius: 10px; color: var(--ink-500); background: var(--brand-50); font-size: 12px; }
.bt-record-bar strong { color: var(--brand-700); }
.bt-record-bar__tip { margin-left: auto; color: var(--ink-400); font-size: 11px; }
.bt-game-panel { width: 100%; min-height: 300px; margin: 0; padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 3px 8px rgba(15,45,29,.025); }
.bt-game-tip { padding: 19px 20px; border: 1px solid var(--line); border-top: 3px solid var(--brand-500); border-radius: 12px; color: var(--ink-600); background: var(--surface); box-shadow: 0 8px 26px -22px rgba(15,45,29,.45); font-size: 13px; line-height: 1.9; }
.bt-game-tip strong { display: block; margin-bottom: 6px; color: var(--ink-900); font-size: 14px; }
.bt-game-layout > noscript { grid-column: 1 / -1; }
@media (min-width: 1024px) {
  .bt-game-layout { grid-template-columns: minmax(0, 1fr) 300px; grid-template-areas: "intro intro" "panel tip"; gap: 18px 24px; }
  .bt-game-intro { grid-area: intro; }
  .bt-game-panel { grid-area: panel; }
  .bt-game-tip { grid-area: tip; position: sticky; top: calc(var(--header-h, 66px) + 20px); }
}
.bt-loading { min-height: 240px; display: grid; place-content: center; justify-items: center; gap: 12px; color: var(--ink-500); }
.bt-loading__spinner { width: 30px; height: 30px; border: 3px solid var(--brand-100); border-top-color: var(--brand-700); border-radius: 50%; animation: bt-spin .8s linear infinite; }
.bt-game-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.bt-game-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.bt-game-controls label { color: var(--ink-500); font-size: 12px; font-weight: 700; }
.bt-select, .bt-segment { min-height: 40px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-700); background: #fff; }
.bt-select:focus { border-color: var(--brand-500); outline: none; box-shadow: 0 0 0 3px rgba(22,184,119,.1); }
.bt-segment-group { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.bt-segment { min-height: 32px; padding: 5px 11px; border: 0; border-radius: 7px; background: transparent; font-size: 12px; font-weight: 700; }
.bt-segment[aria-pressed="true"] { color: var(--brand-700); background: #fff; box-shadow: 0 2px 8px rgba(15,26,21,.08); }
.bt-metrics { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 20px; }
.bt-metric { min-width: 112px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--brand-50); }
.bt-metric__label { display: block; color: var(--ink-500); font-size: 11px; }
.bt-metric__value { display: block; margin-top: 1px; color: var(--ink-900); font-family: var(--font-num); font-size: 20px; line-height: 1.3; }
.bt-status { min-height: 26px; margin-bottom: 14px; color: var(--ink-600); font-size: 13px; text-align: center; }
.bt-result { max-width: 480px; margin: 22px auto 0; padding: 22px; border: 1px solid var(--brand-200); border-radius: 14px; background: var(--brand-50); text-align: center; }
.bt-result__icon { width: 48px; height: 48px; display: grid; place-items: center; margin: 0 auto 10px; border-radius: 50%; color: var(--brand-700); background: var(--brand-100); }
.bt-result__icon svg { width: 26px; height: 26px; }
.bt-result h2 { font-size: 22px; }
.bt-result p { margin-top: 7px; color: var(--ink-600); font-size: 13px; }
.bt-result .bt-button { margin-top: 16px; }
.bt-result .bt-button + .bt-button { margin-left: 8px; }

/* 数独 */
.bt-sudoku-layout { display: grid; grid-template-columns: minmax(280px, 480px) 180px; justify-content: center; align-items: start; gap: 24px; }
.bt-sudoku-board { display: grid; grid-template-columns: repeat(9, 1fr); aspect-ratio: 1; overflow: hidden; border: 2px solid var(--ink-700); border-radius: 8px; background: var(--ink-700); gap: 1px; }
.bt-sudoku-cell { position: relative; min-width: 0; display: grid; place-items: center; padding: 0; border: 0; color: var(--brand-700); background: #fff; font-family: var(--font-num); font-size: clamp(20px, 4vw, 29px); font-weight: 700; }
.bt-sudoku-cell--given { color: var(--ink-900); background: #f5f7f5; }
.bt-sudoku-cell--related { background: #f0faf5; }
.bt-sudoku-cell--related.bt-sudoku-cell--same { background: #dff4e9; }
.bt-sudoku-cell--selected { background: #dff4e9; box-shadow: inset 0 0 0 2px var(--brand-500); }
.bt-sudoku-cell:focus-visible { outline: 3px solid rgba(12,122,82,.28); outline-offset: -3px; }
.bt-sudoku-cell--error { color: var(--red); background: #fff0f0; }
.bt-sudoku-cell--box-right { border-right: 2px solid var(--ink-700); }
.bt-sudoku-cell--box-bottom { border-bottom: 2px solid var(--ink-700); }
.bt-sudoku-notes { position: absolute; inset: 3px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); color: var(--ink-500); font-size: clamp(8px, 1.2vw, 11px); font-weight: 500; line-height: 1; }
.bt-sudoku-notes span { display: grid; place-items: center; }
.bt-sudoku-side { display: flex; flex-direction: column; gap: 14px; }
.bt-numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.bt-numpad button { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 9px; color: var(--brand-700); background: var(--brand-50); font-family: var(--font-num); font-size: 21px; font-weight: 800; }
.bt-numpad button:hover { border-color: var(--brand-500); background: var(--brand-100); }
.bt-tool-stack { display: grid; gap: 7px; }
.bt-tool-stack .bt-button { min-height: 38px; padding: 7px 10px; font-size: 12px; }
.bt-sudoku-help { color: var(--ink-500); font-size: 11px; line-height: 1.8; }
.bt-sudoku-tabs { margin-bottom: 20px; }
.bt-sudoku-tabs .bt-segment { min-height: 38px; padding-inline: 22px; font-size: 13px; }
.bt-sudoku-preview { min-height: 240px; display: grid; place-items: center; overflow: hidden; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fafcf9; }
.bt-sudoku-preview[aria-busy="true"] { background: linear-gradient(135deg, var(--brand-50), #fff, var(--brand-50)); }
.bt-sudoku-placeholder { max-width: 360px; color: var(--ink-500); font-size: 13px; line-height: 1.8; text-align: center; }
.bt-sudoku-worksheet { display: block; width: 100%; height: auto; background: #fff; }
.bt-sudoku-worksheet[hidden] { display: none; }
.bt-sudoku-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }
.bt-sudoku-solver { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); width: min(100%, 486px); aspect-ratio: 1; gap: 1px; overflow: hidden; margin: 18px auto; padding: 3px; border: 2px solid var(--ink-700); border-radius: 8px; background: var(--ink-700); }
.bt-sudoku-solver__cell { min-width: 0; padding: 0; border: 0; border-radius: 0; outline: none; color: var(--ink-900); background: #fff; font-family: var(--font-num); font-size: clamp(18px, 4vw, 27px); font-weight: 700; text-align: center; caret-color: var(--brand-600); }
.bt-sudoku-solver__cell:nth-child(3n):not(:nth-child(9n)) { border-right: 2px solid var(--ink-700); }
.bt-sudoku-solver__cell:nth-child(n+19):nth-child(-n+27),
.bt-sudoku-solver__cell:nth-child(n+46):nth-child(-n+54) { border-bottom: 2px solid var(--ink-700); }
.bt-sudoku-solver__cell:focus { background: var(--brand-50); box-shadow: inset 0 0 0 2px var(--brand-500); }
.bt-sudoku-solver__cell.is-result { color: var(--brand-700); background: #f0faf5; }
.bt-sudoku-solver__cell.is-error { color: var(--red); background: #fff0f0; }
.bt-sudoku-solver-help { margin-top: 14px; text-align: center; }
.bt-sudoku-print { display: none; }

@media print {
  body * { visibility: hidden !important; }
  .bt-sudoku-print, .bt-sudoku-print * { visibility: visible !important; }
  .bt-sudoku-print { position: absolute; inset: 0; display: block; width: 100%; }
  .bt-sudoku-print .bt-sudoku-worksheet { width: 100%; max-height: none; }
}


/* 舒尔特方格 */
.bt-schulte-board { display: grid; width: min(100%, 480px); aspect-ratio: 1; margin-inline: auto; gap: 7px; }
.bt-schulte-cell { display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-900); background: #fff; font-family: var(--font-num); font-size: clamp(23px, 5vw, 34px); font-weight: 800; box-shadow: 0 3px 10px rgba(15,26,21,.04); transition: background .12s ease, color .12s ease, transform .12s ease; }
.bt-schulte-cell:hover:not(:disabled) { border-color: var(--brand-400); background: var(--brand-50); transform: scale(.97); }
.bt-schulte-board[data-size="8"] { gap: 6px; }
.bt-schulte-board[data-size="9"] { gap: 5px; }
.bt-schulte-board[data-size="8"] .bt-schulte-cell { border-radius: 8px; font-size: clamp(16px, 3.4vw, 26px); }
.bt-schulte-board[data-size="9"] .bt-schulte-cell { border-radius: 7px; font-size: clamp(14px, 3vw, 22px); }
.bt-schulte-cell--done { color: #fff; background: var(--brand-500); border-color: var(--brand-500); }
.bt-schulte-cell--wrong { color: #fff; background: var(--red); border-color: var(--red); animation: bt-shake .25s ease; }
@keyframes bt-shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

/* 翻牌记忆 */
.bt-memory-board { display: grid; width: min(100%, 620px); margin-inline: auto; gap: 10px; }
.bt-memory-card { position: relative; aspect-ratio: 4 / 3; padding: 0; border: 0; border-radius: 12px; color: var(--card-color); background: transparent; perspective: 700px; }
.bt-memory-card__inner { position: absolute; inset: 0; border-radius: inherit; transition: transform .35s ease; transform-style: preserve-3d; }
.bt-memory-card--flipped .bt-memory-card__inner, .bt-memory-card--matched .bt-memory-card__inner { transform: rotateY(180deg); }
.bt-memory-card__face { position: absolute; inset: 0; display: grid; place-items: center; border-radius: inherit; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.bt-memory-card__back { border: 1px solid var(--brand-200); color: #fff; background: linear-gradient(145deg, var(--brand-500), var(--brand-800)); box-shadow: 0 5px 14px rgba(15,26,21,.12); }
.bt-memory-card__back svg { width: 30%; height: 30%; opacity: .85; }
.bt-memory-card__front { border: 1px solid var(--line); background: #fff; transform: rotateY(180deg); font-size: clamp(28px, 6vw, 43px); }
.bt-memory-card--matched .bt-memory-card__front { border-color: var(--brand-300); background: var(--brand-50); }
.bt-memory-card--matched::after { content: "✓"; position: absolute; z-index: 2; top: 6px; right: 8px; color: var(--brand-700); font-size: 12px; font-weight: 900; }

/* 序列记忆 */
.bt-sequence-wrap { max-width: 520px; margin-inline: auto; }
.bt-sequence-board { display: grid; grid-template-columns: repeat(3, 1fr); width: min(100%, 420px); aspect-ratio: 1; margin-inline: auto; gap: 10px; }
.bt-sequence-cell { display: grid; place-items: center; border: 1px solid var(--line); border-radius: 15px; color: var(--brand-700); background: var(--brand-50); transition: background .12s ease, transform .12s ease, box-shadow .12s ease; }
.bt-sequence-cell::after { content: ""; width: 14px; height: 14px; border-radius: 50%; background: var(--brand-200); }
.bt-sequence-cell--active { background: var(--brand-500); border-color: var(--brand-500); box-shadow: 0 0 0 6px rgba(22,184,119,.14); transform: scale(.96); }
.bt-sequence-cell--active::after { background: #fff; }
.bt-sequence-cell--wrong { background: #fee2e2; border-color: #fca5a5; }
.bt-lives { display: flex; justify-content: center; gap: 5px; margin-top: 14px; color: var(--red); font-size: 18px; }
.bt-lives .is-lost { color: var(--line-2); }

/* Stroop */
.bt-stroop-wrap { max-width: 620px; margin-inline: auto; text-align: center; }
.bt-stroop-prompt { margin-bottom: 12px; color: var(--ink-500); font-size: 13px; }
.bt-stroop-word { min-height: 150px; display: grid; place-items: center; margin-bottom: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fafcf9; font-size: clamp(48px, 9vw, 76px); font-weight: 900; letter-spacing: .08em; }
.bt-stroop-answers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.bt-stroop-answer { min-height: 52px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink-700); background: #fff; font-weight: 800; }
.bt-stroop-answer:hover:not(:disabled) { border-color: var(--brand-400); background: var(--brand-50); }
.bt-stroop-answer--correct { color: #fff; background: var(--brand-700); border-color: var(--brand-700); }
.bt-stroop-answer--wrong { color: #fff; background: var(--red); border-color: var(--red); }
.bt-progress { height: 6px; overflow: hidden; margin: 16px 0; border-radius: 999px; background: var(--line); }
.bt-progress__bar { height: 100%; width: 0; border-radius: inherit; background: var(--brand-500); transition: width .2s ease; }

/* 反应测试 */
.bt-reaction-pad { width: min(100%, 560px); min-height: 320px; display: grid; place-content: center; justify-items: center; gap: 12px; margin-inline: auto; border: 1px solid var(--line); border-radius: 16px; color: var(--ink-600); background: #f1f5f2; text-align: center; user-select: none; -webkit-user-select: none; transition: background .08s ease, color .08s ease; }
.bt-reaction-pad svg { width: 44px; height: 44px; color: var(--brand-500); }
.bt-reaction-pad strong { color: var(--ink-900); font-size: 24px; }
.bt-reaction-pad span { font-size: 12px; }
.bt-reaction-pad--waiting { color: #92400e; background: #fff7e6; }
.bt-reaction-pad--ready { color: #fff; background: var(--brand-600); border-color: var(--brand-600); }
.bt-reaction-pad--ready svg, .bt-reaction-pad--ready strong { color: #fff; }
.bt-reaction-pad--early { color: #fff; background: var(--red); border-color: var(--red); }
.bt-reaction-pad--early svg, .bt-reaction-pad--early strong { color: #fff; }
.bt-reaction-pad--result { color: #fff; background: var(--brand-800); border-color: var(--brand-800); }
.bt-reaction-pad--result svg, .bt-reaction-pad--result strong { color: #fff; }
.bt-reaction-dots { display: flex; justify-content: center; gap: 7px; margin-top: 16px; }
.bt-reaction-dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.bt-reaction-dots span.is-done { background: var(--brand-500); }

/* 黑夜模式：覆盖页面变量与课程通用模板的固定浅色 */
html[data-theme="dark"] {
  color-scheme: dark;
  --brand-900: #04140e;
  --brand-800: #082b1e;
  --brand-700: #4ade80;
  --brand-600: #22c55e;
  --brand-500: #16a34a;
  --brand-400: #86efac;
  --brand-300: #bbf7d0;
  --brand-200: #166534;
  --brand-100: #14532d;
  --brand-50: #10291c;
  --ink-900: #f3f7f5;
  --ink-800: #e2e8e5;
  --ink-700: #cbd5d0;
  --ink-600: #aab8b0;
  --ink-500: #8f9e96;
  --ink-400: #6f7e76;
  --line: #2a3831;
  --line-2: #3a4a41;
  --bg: #0b120f;
  --surface: #131d18;
  --blue: #60a5fa;
  --violet: #a78bfa;
  --amber: #fbbf24;
  --red: #f87171;
  --shadow: 0 18px 45px -28px rgba(0, 0, 0, .75);
}
html[data-theme="dark"] body { color: var(--ink-700); background: var(--bg); }
html[data-theme="dark"] .bt-button--primary,
html[data-theme="dark"] .bt-game-page .u-btn--primary { color: #fff; background: #15803d; }
html[data-theme="dark"] .bt-button--primary:hover:not(:disabled),
html[data-theme="dark"] .bt-game-page .u-btn--primary:hover { background: #166534; }
html[data-theme="dark"] .bt-button--ghost,
html[data-theme="dark"] .bt-select,
html[data-theme="dark"] .bt-game-panel,
html[data-theme="dark"] .bt-empty,
html[data-theme="dark"] .bt-stroop-answer { color: var(--ink-700); background: var(--surface); }
html[data-theme="dark"] .bt-sudoku-cell,
html[data-theme="dark"] .bt-sudoku-cell--given,
html[data-theme="dark"] .bt-schulte-cell,
html[data-theme="dark"] .bt-memory-card__front { color: var(--ink-900); background: #18241e; }
html[data-theme="dark"] .bt-sudoku-cell--related { background: #142b1f; }
html[data-theme="dark"] .bt-sudoku-cell--error,
html[data-theme="dark"] .bt-sudoku-solver__cell.is-error { background: #451a1a; }
html[data-theme="dark"] .bt-sudoku-solver__cell { color: var(--ink-900); background: #18241e; }
html[data-theme="dark"] .bt-segment[aria-pressed="true"] { color: var(--brand-400); background: #18241e; }
html[data-theme="dark"] .bt-sudoku-cell--same,
html[data-theme="dark"] .bt-sudoku-cell--selected { background: #1d4d32; }
html[data-theme="dark"] .bt-sudoku-preview { border-color: var(--line); background: #101a15; }
html[data-theme="dark"] .bt-reaction-pad { border-color: var(--line); color: var(--ink-600); background: #111b16; }
html[data-theme="dark"] .bt-reaction-pad--waiting { color: #fcd34d; background: #2b2410; }
html[data-theme="dark"] .bt-theme-toggle__moon { display: none; }
html[data-theme="dark"] .bt-theme-toggle__sun { display: block; }
html[data-theme="dark"] .bt-game-page .u-header { border-bottom-color: var(--line); background: rgba(11, 18, 15, .94); }
html[data-theme="dark"] .bt-game-page .u-nav__link { color: var(--ink-700); }
html[data-theme="dark"] .bt-game-page .u-nav__link:hover,
html[data-theme="dark"] .bt-game-page .u-nav__link.is-hoverstate { color: var(--brand-400); background: var(--brand-50); }
html[data-theme="dark"] .bt-game-page .u-nav__icon { color: var(--ink-500); }
html[data-theme="dark"] .bt-game-page .u-nav__link--accent { color: #fbbf24; }
html[data-theme="dark"] .bt-game-page .u-nav__link--cta { color: var(--brand-400); }
html[data-theme="dark"] .bt-game-page .u-hsearch__field,
html[data-theme="dark"] .bt-game-page .u-hsearch__field:focus-within { border-color: var(--line); background: var(--surface); }
html[data-theme="dark"] .bt-game-page .u-hsearch__input { color: var(--ink-900); }
html[data-theme="dark"] .bt-game-page .u-hsearch__input::placeholder { color: var(--ink-500); }
html[data-theme="dark"] .bt-game-page .u-hsearch__btn { color: #fff; background: #15803d; }
html[data-theme="dark"] .bt-game-page .u-histbtn,
html[data-theme="dark"] .bt-game-page .u-iconbtn { border-color: var(--line); color: var(--ink-600); background: var(--surface); }
html[data-theme="dark"] .bt-game-page .u-mega { border-color: var(--line); background: var(--surface); box-shadow: var(--shadow); }
html[data-theme="dark"] .bt-game-page .u-mega__item { color: var(--ink-700); }
html[data-theme="dark"] .bt-game-page .u-mega__item:hover { color: var(--brand-400); background: var(--brand-50); }
html[data-theme="dark"] .bt-game-page .u-mega__foot { border-color: var(--line); color: var(--ink-500); background: #101a15; }
html[data-theme="dark"] .bt-game-page .u-mega__foot a { color: var(--ink-600); background: #18241e; }
html[data-theme="dark"] .bt-game-page .u-mega__foot a.u-quicklink--featured,
html[data-theme="dark"] .bt-game-page .u-drawer__links a.u-quicklink--featured { border-color: #715c24; color: #fde68a; background: linear-gradient(135deg, #3b3117, #143326); }
html[data-theme="dark"] .bt-game-page .u-mega__foot a.u-quicklink--featured::after,
html[data-theme="dark"] .bt-game-page .u-drawer__links a.u-quicklink--featured::after { color: #fde68a; background: rgba(0, 0, 0, .28); }
html[data-theme="dark"] .bt-game-page .u-drawer { color: var(--ink-700); background: var(--surface); }
html[data-theme="dark"] .bt-game-page .u-drawer__title,
html[data-theme="dark"] .bt-game-page .u-drawer__label { color: var(--ink-800); }
html[data-theme="dark"] .bt-game-page .u-drawer__cat,
html[data-theme="dark"] .bt-game-page .u-drawer__links a,
html[data-theme="dark"] .bt-game-page .u-drawer__links button { color: var(--ink-600); }
html[data-theme="dark"] .bt-game-page .u-drawer__cat:hover,
html[data-theme="dark"] .bt-game-page .u-drawer__links a:hover,
html[data-theme="dark"] .bt-game-page .u-drawer__links button:hover { color: var(--brand-400); background: var(--brand-50); }
html[data-theme="dark"] .bt-game-page .u-footer { border-top-color: var(--line); background: #070d0a; }
html[data-theme="dark"] .bt-game-page .u-top { border-color: var(--line); color: var(--ink-700); background: var(--surface); }
html[data-theme="dark"] .bt-back { box-shadow: 0 3px 10px -7px rgba(0,0,0,.55); }
html[data-theme="dark"] .bt-back:hover { box-shadow: 0 7px 16px -12px rgba(0,0,0,.7); }
html[data-theme="dark"] .bt-game-tip { box-shadow: 0 8px 26px -22px rgba(0,0,0,.75); }
html[data-theme="dark"] .bt-toast { color: #f8fafc; background: #1f2937; }
html[data-theme="dark"] .bt-game-page .modal-card { color: var(--ink-700); background: var(--surface); }
html[data-theme="dark"] .bt-game-page .modal-head { border-bottom-color: var(--line); }
html[data-theme="dark"] .bt-game-page .modal-title { color: var(--ink-900); }
html[data-theme="dark"] .bt-game-page .modal-close { color: var(--ink-600); background: #18241e; }

@media (max-width: 1023px) {
  .bt-game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bt-category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bt-sudoku-layout { grid-template-columns: minmax(280px, 480px); }
  .bt-sudoku-side { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .bt-numpad { grid-template-columns: repeat(9, 1fr); }
  .bt-sudoku-help { display: none; }
}
@media (max-width: 719px) {
  .bt-container { padding-inline: 16px; }
  .bt-hero { padding: 40px 0 32px; }
  .bt-hero__grid { grid-template-columns: 1fr; gap: 24px; }
  .bt-hero h1 { font-size: clamp(34px, 10vw, 46px); }
  .bt-hero__desc { font-size: 14px; }
  .bt-hero__visual { display: none; }
  .bt-stats { grid-template-columns: repeat(2, 1fr); margin-top: 28px; }
  .bt-stats div { padding: 14px 16px; }
  .bt-section { padding: 28px 0 44px; }
  .bt-section-head { align-items: flex-start; flex-direction: column; gap: 7px; }
  .bt-section-head h2 { font-size: 24px; }
  .bt-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .bt-category { min-height: 43px; padding: 7px 9px; font-size: 12px; }
  .bt-category:first-child { grid-column: 1 / -1; }
  .bt-game-grid { grid-template-columns: 1fr; gap: 15px; }
  .bt-game-card__visual { min-height: 135px; }
  .bt-game-card__desc { min-height: auto; }
  .bt-guide-grid { grid-template-columns: 1fr; }
  .bt-guide-section { padding: 28px 0 40px; }
  .bt-disclaimer { padding: 14px 0; }
  .bt-game-main { padding: 18px 0 38px; }
  .bt-detail-bar { flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 18px; }
  .bt-back { width: 100%; }
  .bt-detail-crumb { justify-content: flex-start; width: 100%; overflow: hidden; }
  .bt-detail-crumb .u-crumb__current { max-width: 100%; }
  .bt-game-heading { flex-wrap: wrap; align-items: flex-start; gap: 12px; }
  .bt-game-heading__actions { width: 100%; margin-left: 0; }
  .bt-theme-toggle { width: 100%; }
  .bt-game-heading__icon { width: 48px; height: 48px; border-radius: 14px; }
  .bt-game-heading__icon svg { width: 26px; height: 26px; }
  .bt-game-heading p { font-size: 12px; }
  .bt-record-bar { flex-wrap: wrap; }
  .bt-record-bar__tip { width: 100%; margin-left: 0; }
  .bt-game-panel { padding: 17px 12px; border-radius: 14px; }
  .bt-game-toolbar { align-items: flex-start; flex-direction: column; }
  .bt-game-controls { width: 100%; }
  .bt-game-controls .bt-button { flex: 1; }
  .bt-metrics { gap: 7px; }
  .bt-metric { min-width: 0; flex: 1; padding: 8px 10px; }
  .bt-metric__value { font-size: 17px; }
  .bt-sudoku-layout { grid-template-columns: minmax(0, 480px); }
  .bt-sudoku-side { min-width: 0; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .bt-numpad { min-width: 0; gap: 3px; }
  .bt-numpad button { min-width: 0; padding: 2px; border-radius: 6px; font-size: 17px; }
  .bt-tool-stack { min-width: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bt-tool-stack .bt-button { min-width: 0; padding-inline: 6px; }
  .bt-sudoku-cell { font-size: clamp(18px, 5.5vw, 25px); }
  .bt-sudoku-tabs { display: flex; width: 100%; }
  .bt-sudoku-tabs .bt-segment { flex: 1; min-width: 0; padding-inline: 8px; }
  .bt-sudoku-preview { min-height: 180px; padding: 8px; }
  .bt-sudoku-notes { font-size: 8px; }
  .bt-schulte-board { gap: 5px; }
  .bt-schulte-cell { border-radius: 8px; }
  .bt-memory-board { gap: 7px; }
  .bt-stroop-answers { grid-template-columns: repeat(2, 1fr); }
  .bt-stroop-word { min-height: 125px; }
  .bt-reaction-pad { min-height: 280px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
