  * { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
  html, body {
    margin: 0; padding: 0; height: 100%; overflow: hidden;
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, sans-serif;
    background: #EAF4FF;
    color: #2F4157;
    user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
    overscroll-behavior: contain;
  }
  body {
    background-image:
      radial-gradient(circle at 10% 14%, rgba(255, 210, 90, 0.38) 0 46px, transparent 47px),
      radial-gradient(circle at 90% 10%, rgba(62, 198, 176, 0.22) 0 58px, transparent 59px),
      radial-gradient(circle at 86% 86%, rgba(255, 138, 61, 0.16) 0 66px, transparent 67px),
      radial-gradient(circle at 8% 84%, rgba(89, 168, 255, 0.22) 0 52px, transparent 53px);
    background-attachment: fixed;
  }
  /* 定高弹性布局：适配微信内置浏览器（页头/底部菜单压缩可视高度），避免出现滚动条 */
  #app {
    max-width: 520px; margin: 0 auto;
    height: 100vh; height: 100dvh;
    display: flex; flex-direction: column; overflow: hidden;
    padding: 10px 14px calc(8px + env(safe-area-inset-bottom, 0px));
  }
  .screen {
    flex: 1; min-height: 0; display: flex; flex-direction: column;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; -ms-overflow-style: none;
  }
  .screen::-webkit-scrollbar { display: none; }
  .screen.hidden { display: none; }

  /* ---------- 贴纸卡片 ---------- */
  .card {
    background: #FFFFFF; border-radius: 22px;
    box-shadow: 0 5px 0 rgba(47, 65, 87, 0.07), 0 16px 30px -16px rgba(47, 65, 87, 0.20);
  }

  /* ---------- 首页 ---------- */
  .hero { text-align: center; padding: 6px 0 10px; flex: none; }
  .mascot {
    display: block; margin: 0 auto; width: 66px; height: 74px;
    animation: bob 3s ease-in-out infinite;
  }
  @keyframes bob {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50%      { transform: translateY(-6px) rotate(2deg); }
  }
  .hero h1 {
    margin: 8px 0 7px; font-size: 25px; font-weight: 800; letter-spacing: 1px;
    color: #2F4157;
  }
  .hero h1 .hl { color: #FF8A3D; }
  .hero .sub {
    display: inline-block; margin: 0; padding: 5px 13px; border-radius: 999px;
    background: #FFF3DF; color: #E8722A; font-size: 11.5px; font-weight: 700; letter-spacing: 2px;
  }

  /* 游戏入口：2 列网格卡片（游戏多了纵向平铺放不下） */
  .game-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 9px;
    margin-top: 9px; flex: 0 1 auto; min-height: 0;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; -ms-overflow-style: none;
    padding: 2px 1px 6px;
  }
  .game-grid::-webkit-scrollbar { display: none; }
  .game-card {
    display: flex; flex-direction: column; align-items: center; gap: 5px;
    border: none; border-radius: 18px; padding: 11px 8px 10px;
    cursor: pointer; text-align: center; color: #fff;
    box-shadow: 0 4px 0 var(--edge), 0 12px 22px -12px rgba(47, 65, 87, 0.3);
    transition: transform .1s ease, box-shadow .1s ease;
  }
  .game-card:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge), 0 6px 12px -8px rgba(47, 65, 87, 0.3); }
  .game-card.orange { background: #FF8A3D; --edge: #E06E24; }
  .game-card.teal   { background: #3EC6B0; --edge: #2AA491; }
  .game-card.blue   { background: #59A8FF; --edge: #3E86D8; }
  .game-card.violet { background: #9B7BFF; --edge: #7C5CE0; }
  .game-card.pink   { background: #FF7A9C; --edge: #E85D82; }
  .game-card.amber  { background: #FFB020; --edge: #E09A00; }
  .game-card.coral  { background: #F26D5B; --edge: #D8513F; }
  .game-card.wide {
    grid-column: span 2; flex-direction: row; text-align: left;
    gap: 12px; padding: 10px 14px;
  }
  .game-icon {
    width: 42px; height: 42px; border-radius: 13px; background: rgba(255, 255, 255, 0.22);
    display: flex; align-items: center; justify-content: center; flex: none;
  }
  .game-text { display: flex; flex-direction: column; gap: 3px; }
  .game-title { display: block; font-size: 14.5px; font-weight: 800; letter-spacing: 1px; }
  .game-desc  { display: block; font-size: 9.5px; opacity: .95; letter-spacing: .3px; line-height: 1.35; }

  .diff-row {
    display: flex; align-items: center; gap: 10px; margin-top: 10px; flex: none;
    background: #FFFFFF; border-radius: 18px; padding: 7px 8px 7px 15px;
    box-shadow: 0 4px 0 rgba(47, 65, 87, 0.07);
  }
  .diff-label { font-size: 12px; font-weight: 800; color: #7C90AA; letter-spacing: 2px; }
  .diff-group { display: flex; gap: 6px; margin-left: auto; }
  .diff-btn {
    border: none; border-radius: 12px; padding: 8px 13px;
    font-size: 13px; font-weight: 800; letter-spacing: 1px;
    background: #EDF3FA; color: #7C90AA; cursor: pointer;
    transition: transform .1s ease, background .15s ease, color .15s ease;
  }
  .diff-btn:active { transform: scale(0.94); }
  .diff-btn.active { background: #FF8A3D; color: #fff; box-shadow: 0 3px 0 #E06E24; }
  .mode-go {
    margin-left: auto; width: 30px; height: 30px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.25); display: flex; align-items: center;
    justify-content: center; font-size: 15px; font-weight: 800; flex: none;
  }
  .foot {
    margin-top: 10px; text-align: center; flex: none;
    font-size: 10px; color: #8CA0B8; letter-spacing: 1px;
  }

  /* ---------- 游戏页 ---------- */
  .topbar { display: flex; align-items: center; gap: 8px; flex: none; }
  .round-btn {
    width: 38px; height: 38px; border: none; border-radius: 13px;
    background: #FFFFFF; box-shadow: 0 3px 0 rgba(47, 65, 87, 0.10);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    transition: transform .1s ease, box-shadow .1s ease; flex: none;
  }
  .round-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(47, 65, 87, 0.10); }
  .stats { flex: 1; display: flex; justify-content: center; gap: 8px; }
  .pill {
    display: flex; align-items: center; gap: 5px;
    background: #FFFFFF; border-radius: 999px; padding: 6px 12px;
    box-shadow: 0 3px 0 rgba(47, 65, 87, 0.08);
    font-size: 13.5px; font-weight: 800; color: #2F4157;
    font-variant-numeric: tabular-nums;
  }
  .pill .lbl { font-size: 10px; font-weight: 700; color: #8CA0B8; letter-spacing: 1px; }

  .question { padding: 8px 4px 5px; flex: 0 1 auto; min-height: 0; overflow: hidden; }
  .q-tag {
    display: inline-block; background: #FF8A3D; color: #fff;
    border-radius: 999px; padding: 3px 11px; font-size: 11px; font-weight: 800;
    letter-spacing: 2px; box-shadow: 0 2px 0 #E06E24;
  }
  .q-tag.teal { background: #3EC6B0; box-shadow: 0 2px 0 #2AA491; }
  .q-tag.blue { background: #59A8FF; box-shadow: 0 2px 0 #3E86D8; }
  .q-tag.violet { background: #9B7BFF; box-shadow: 0 2px 0 #7C5CE0; }
  .q-tag.amber { background: #FFB020; box-shadow: 0 2px 0 #E09A00; }
  .q-index { font-size: 10.5px; color: #8CA0B8; margin-left: 8px; letter-spacing: 1px; }
  .question h2 {
    margin: 5px 0 0; font-size: 16px; font-weight: 800;
    line-height: 1.4; color: #2F4157; letter-spacing: .5px;
  }
  .q-sub { margin: 3px 0 0; font-size: 11px; color: #7C90AA; letter-spacing: .5px; }

  .stage {
    position: relative; overflow: hidden;
    flex: 1 1 auto; min-height: 90px;
    display: flex;
  }
  #cube-canvas {
    display: block; width: 100%; flex: 1 1 auto; min-height: 0;
    touch-action: none;
  }
  .stage-hint {
    position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9); border-radius: 999px;
    padding: 5px 12px; font-size: 10px; font-weight: 700; color: #7C90AA;
    letter-spacing: 1px; pointer-events: none; white-space: nowrap;
    box-shadow: 0 3px 10px rgba(47, 65, 87, 0.10);
  }
  #btn-reset-view {
    position: absolute; top: 8px; right: 8px;
    width: auto; padding: 0 12px; height: 30px; border-radius: 999px;
    font-size: 11px; font-weight: 800; color: #5B7A93; letter-spacing: 1px;
  }
  #btn-fold {
    position: absolute; top: 8px; left: 8px;
    width: auto; padding: 0 12px; height: 30px; border-radius: 999px;
    font-size: 11px; font-weight: 800; color: #7C5CE0; letter-spacing: 1px;
  }
  #btn-fold:disabled { opacity: 0.5; }

  .options {
    display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 9px; flex: none;
  }
  .option {
    background: #FFFFFF; border: 3px solid #E4EEFA; border-radius: 17px;
    padding: 4px; cursor: pointer;
    box-shadow: 0 4px 0 rgba(47, 65, 87, 0.07);
    transition: transform .1s ease, border-color .15s ease, background .15s ease;
  }
  .option:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(47, 65, 87, 0.07); }
  .option canvas { display: block; width: 100%; height: 82px; }
  .option.num {
    display: flex; align-items: center; justify-content: center;
    height: 64px; font-size: 25px; font-weight: 800; color: #2F4157;
    font-variant-numeric: tabular-nums;
  }
  .option.correct { border-color: #35B98A; background: #EAF9F2; }
  .option.wrong   { border-color: #FF6B6B; background: #FFEFEE; }

  /* ---------- 反馈 ---------- */
  .feedback {
    position: fixed; inset: 0; z-index: 50;
    background: rgba(47, 65, 87, 0.38);
    display: flex; align-items: center; justify-content: center; padding: 18px;
  }
  .feedback.hidden { display: none; }
  .feedback-card {
    background: #FFFFFF; border-radius: 26px; padding: 22px 20px 18px;
    width: 100%; max-width: 310px; text-align: center;
    box-shadow: 0 8px 0 rgba(47, 65, 87, 0.10), 0 26px 50px -18px rgba(30, 42, 60, 0.45);
    animation: pop .3s cubic-bezier(.2, .9, .3, 1.25);
    position: relative; overflow: hidden;
  }
  @keyframes pop {
    from { transform: scale(0.86) translateY(12px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
  }
  .feedback-icon { display: flex; justify-content: center; }
  .feedback-icon svg { width: 50px; height: 50px; }
  .feedback-text { font-size: 20px; font-weight: 800; color: #2F4157; margin: 10px 0 4px; letter-spacing: 1px; }
  .feedback-sub  { font-size: 11.5px; color: #7C90AA; margin-bottom: 14px; letter-spacing: 1px; }
  .btn-primary {
    display: block; width: 100%; border: none; cursor: pointer;
    background: #FF8A3D; color: #fff; border-radius: 16px; padding: 12px 18px;
    font-size: 15px; font-weight: 800; letter-spacing: 2px;
    box-shadow: 0 5px 0 #E06E24;
    transition: transform .1s ease, box-shadow .1s ease;
  }
  .btn-primary:active { transform: translateY(3px); box-shadow: 0 2px 0 #E06E24; }
  .btn-secondary {
    display: block; width: 100%; border: 2px solid #E4EEFA; background: #fff;
    color: #5B7A93; border-radius: 16px; padding: 10px 18px; margin-top: 8px;
    font-size: 14px; font-weight: 800; letter-spacing: 2px; cursor: pointer;
    transition: transform .1s ease;
  }
  .btn-secondary:active { transform: scale(0.97); }
  .btn-secondary.hidden { display: none; }
  .float-next {
    position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
    z-index: 40; border: none; border-radius: 999px; padding: 12px 24px;
    background: #FF8A3D; color: #fff; font-size: 14px; font-weight: 800;
    letter-spacing: 2px; box-shadow: 0 5px 0 #E06E24, 0 14px 26px -12px rgba(47, 65, 87, 0.35);
    cursor: pointer;
  }
  .float-next:active { transform: translateX(-50%) translateY(3px); box-shadow: 0 2px 0 #E06E24; }
  .float-next.hidden { display: none; }

  /* 彩带 */
  .confetti-piece {
    position: fixed; top: -24px; width: 9px; height: 13px; border-radius: 3px;
    pointer-events: none; z-index: 60;
    animation: confetti-fall linear forwards;
  }
  @keyframes confetti-fall {
    0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(108vh) rotate(540deg); opacity: .55; }
  }

  /* ---------- 舒尔特方格 ---------- */
  .sch-bar {
    display: flex; align-items: center; justify-content: space-between; flex: none;
    background: #FFFFFF; border-radius: 18px; padding: 10px 18px; margin-top: 10px;
    box-shadow: 0 4px 0 rgba(47, 65, 87, 0.07);
  }
  .sch-next { font-size: 13px; font-weight: 800; color: #7C90AA; letter-spacing: 2px; }
  .sch-next b {
    font-size: 24px; color: #FF7A9C; margin-left: 8px;
    font-variant-numeric: tabular-nums;
  }
  .sch-mistakes { font-size: 11px; font-weight: 700; color: #8CA0B8; letter-spacing: 1px; }
  .sch-mistakes b { font-size: 16px; color: #2F4157; }
  .sch-board {
    --n: 3;
    display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 8px;
    width: min(100%, 62vh, 420px); aspect-ratio: 1 / 1;
    margin: 12px auto 0; flex: none;
  }
  .sch-cell {
    border: none; border-radius: 16px; background: #FFFFFF; color: #2F4157;
    font-weight: 800; cursor: pointer; padding: 0;
    font-size: calc(min(100vw - 72px, 62vh) / var(--n) * 0.38);
    box-shadow: 0 4px 0 rgba(47, 65, 87, 0.08);
    transition: transform .1s ease, background .25s ease, color .25s ease;
    font-variant-numeric: tabular-nums;
  }
  .sch-cell:active { transform: translateY(2px); }
  .sch-cell.found { background: #EAF9F2; color: #BCE7D3; box-shadow: none; }
  .sch-cell.bad { background: #FFEFEE; animation: sch-shake .32s ease; }
  @keyframes sch-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
  }
  #sch-restart { margin-top: auto; }

  /* ---------- 拼一拼 ---------- */
  .pin-bar {
    display: flex; align-items: center; flex: none;
    background: #FFFFFF; border-radius: 16px; padding: 8px 16px; margin-top: 8px;
    box-shadow: 0 4px 0 rgba(47, 65, 87, 0.07);
  }
  .pin-tip { font-size: 11.5px; font-weight: 700; color: #7C90AA; letter-spacing: 1px; }
  .pin-toolbar {
    display: flex; gap: 9px; margin-top: 9px; flex: none;
  }
  .pin-tool {
    flex: 1; margin-top: 0; padding: 11px 10px; font-size: 13.5px;
  }
  #pin-canvas {
    display: block; width: 100%; flex: 1 1 auto; min-height: 0;
    touch-action: none;
  }