@charset "utf-8";
/* ==== MINIGAMES MODULE ==== */
/* =============================================================
 * 沪儿睿 · 专项训练  —— 漫画手绘风（Comic / Hand-drawn）
 * 纸感底 + 粗墨描边 + 硬投影 + 网点 + 楷体大标题 + 贴纸倾斜
 * 换皮：只改 :root 变量与 .mg-* 视觉规则
 * ============================================================= */
.mg {
  --ink: #1E1B3A;
  --paper: #F7F6FD;
  --red: #5358AC;
  --blue: #3B82F6;
  --yellow: #FFE033;
  --green: #22B573;
  --purple: #7C5CFC;
  --muted: #645F88;
  --gc: var(--mg-gc, #5358AC);
  --gc-soft: var(--mg-soft, #ECEEFF);
  --ok: #1F9D55;
  --bad: #E0453A;
  --r: 20px;
  --bd: 1.5px solid #DBD9E6;
  --hard: 0 2px 0 #E5E0F4;
  --hard-sm: 0 2px 0 #E5E0F4;
  --f-disp: "KaiTi", "STKaiti", "Kaiti SC", "FangSong", "SimSun", serif;
  --f-body: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;

  position: relative;
  overflow: hidden;
  font-family: var(--f-body);
  color: var(--ink);
  background:
    radial-gradient(1200px 420px at 106% -10%, rgba(83, 88, 172, .18) 0%, rgba(83, 88, 172, 0) 60%),
    radial-gradient(900px 380px at -10% 106%, rgba(255, 224, 51, .20) 0%, rgba(255, 224, 51, 0) 58%),
    var(--paper);
  border: var(--bd);
  border-radius: 26px;
  padding: 22px 24px 24px;
  max-width: 1140px;
  margin: 0 auto;
  box-shadow: 0 3px 0 #E7E3F4, 0 18px 30px -20px rgba(58, 52, 140, .34);
}

/* 纸纹 + 网点 */
.mg::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image: radial-gradient(rgba(104, 97, 148, .28) 1px, transparent 1.3px);
  background-size: 9px 9px; opacity: .07;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .35) 45%, transparent 82%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, .35) 45%, transparent 82%);
}
.mg > * { position: relative; z-index: 1; }
.mg * { box-sizing: border-box; }
.mg button { -webkit-tap-highlight-color: transparent; }

/* ================= 顶栏 ================= */
.mg-bar { display: flex; align-items: center; gap: 12px; }
.mg-hd { flex: 1; min-width: 0; }
.mg-title {
  font-family: var(--f-disp); font-size: 27px; font-weight: 900; letter-spacing: .04em;
  color: #2A2450;
  -webkit-font-smoothing: antialiased;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .95), 0 3px 8px rgba(83, 88, 172, .14);
}
.mg-sub { font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 4px; letter-spacing: .04em; }
.mg-stat {
  position: relative; display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 800; color: var(--ink);
  background: var(--yellow); border: var(--bd); border-radius: 99px;
  padding: 4px 13px; box-shadow: var(--hard-sm); transform: rotate(-2deg);
}
.mg-stat b { font-size: 17px; }
.mg-stat .star { color: #A9541B; }

.mg-progress { display: none; }
.mg-dots { display: flex; gap: 7px; margin: 16px 0 18px; }
.mg-dots i {
  flex: 1; height: 9px; border-radius: 99px; background: #fff;
  border: 1.5px solid #DBD9E6; box-shadow: 0 2px 0 #E7E3F4;
  transition: background .25s ease, transform .25s ease;
}
.mg-dots i.done { background: var(--gc); }
.mg-dots i.now { background: var(--yellow); transform: scaleY(1.45); }

/* ================= 按钮 ================= */
.mg-btn {
  font: inherit; font-family: var(--f-body); font-size: 14px; font-weight: 800;
  padding: 10px 20px; border-radius: 14px; cursor: pointer;
  border: var(--bd); background: #fff; color: var(--ink); box-shadow: var(--hard-sm);
  transition: transform .1s ease, box-shadow .1s ease, background .15s ease;
}
.mg-btn:hover { background: #FFF3DC; }
.mg-btn:active { transform: translate(4px, 4px); box-shadow: none; }
.mg-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: var(--hard-sm); }
.mg-primary { background: var(--ink); color: var(--paper); }
.mg-primary:hover { background: #3A2E27; filter: none; }
.mg-primary:disabled { opacity: 1; background: #D9D7E8; color: #6B6688; border-color: #CBC7DD; box-shadow: var(--hard-sm); }
.mg-ghost { width: 42px; height: 42px; padding: 0; border-radius: 12px; font-size: 17px; background: #fff; }

/* ================= Hub ================= */
.mg-hub { position: relative; }
.mg-hero {
  position: relative; border-radius: 22px; overflow: hidden; min-height: 236px;
  border: var(--bd); box-shadow: var(--hard);
  background-image: url("data:image/webp;base64,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"); background-size: cover; background-position: center 52%;
  display: flex; align-items: center;
}
.mg-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(94deg, rgba(255, 246, 228, .96) 0%, rgba(255, 246, 228, .84) 36%, rgba(255, 246, 228, .06) 64%, rgba(255, 246, 228, 0) 100%);
}
.mg-hero-in { position: relative; z-index: 2; padding: 20px 24px; max-width: 52%; }
.mg-hero-k {
  display: inline-block; font-size: 11px; font-weight: 900; letter-spacing: .14em;
  color: var(--ink); background: var(--yellow); border: 1.5px solid #DBD9E6;
  border-radius: 99px; padding: 3px 12px; transform: rotate(-2deg);
  box-shadow: 0 2px 0 #E7E3F4;
}
.mg-hero-t {
  font-family: var(--f-disp); font-size: 40px; font-weight: 900; line-height: 1.2;
  margin-top: 12px; color: #2A2450;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .92), 0 6px 14px rgba(83, 88, 172, .26);
}
.mg-hero-t em { font-style: normal; color: var(--yellow); }
.mg-hero-s { font-size: 13px; font-weight: 600; color: #6B5546; margin-top: 10px; line-height: 1.8; max-width: 360px; }
.mg-hero-chips { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.mg-hero-chips span {
  font-size: 11px; font-weight: 800; padding: 4px 11px; border-radius: 99px;
  background: #fff; border: 1.5px solid #DBD9E6; box-shadow: 0 2px 0 #E7E3F4;
}
.mg-resume {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px;
  font: inherit; font-size: 14px; font-weight: 900; cursor: pointer;
  padding: 10px 20px; border-radius: 99px; color: #fff;
  background: var(--red); border: var(--bd); box-shadow: var(--hard-sm);
  transition: transform .1s ease, box-shadow .1s ease;
}
.mg-resume:hover { filter: brightness(1.05); }
.mg-resume:active { transform: translate(4px, 4px); box-shadow: none; }

.mg-cat { margin-top: 30px; }
.mg-cat-t {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
  font-family: var(--f-disp); font-size: 23px; font-weight: 900; letter-spacing: .08em; color: var(--ink);
}
.mg-cat-t::before {
  content: ""; width: 14px; height: 14px; background: var(--gc); border: 1.5px solid #DBD9E6;
  transform: rotate(-8deg); box-shadow: 0 2px 0 #E7E3F4;
}
.mg-cat-t small { font-family: var(--f-body); font-size: 10.5px; font-weight: 700; color: var(--muted); letter-spacing: .06em; }
.mg-cat-art {
  width: 40px; height: 40px; border-radius: 12px; display: inline-block;
  background-size: cover; background-position: center;
  border: 1.5px solid #DBD9E6; box-shadow: 0 2px 0 #E7E3F4;
  transform: rotate(-4deg);
}
.mg-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(206px, 1fr)); gap: 16px; }

.mg-card {
  position: relative; text-align: left; font: inherit; cursor: pointer;
  background: #fff; border: var(--bd); border-radius: var(--r);
  padding: 15px 15px 14px; display: flex; flex-direction: column; gap: 5px;
  box-shadow: var(--hard); transform: rotate(-.8deg);
  transition: transform .14s cubic-bezier(.2, 1.2, .4, 1), box-shadow .14s ease, background .14s ease;
}
.mg-card:nth-child(2n) { transform: rotate(.9deg); }
.mg-card:nth-child(3n) { transform: rotate(-.4deg); }
.mg-card:hover { transform: rotate(0); box-shadow: 0 3px 0 #E7E3F4, 0 18px 30px -20px rgba(58, 52, 140, .34); background: #FFFCF3; }
.mg-card:active { transform: translate(3px, 3px); box-shadow: 0 2px 0 #E7E3F4; }
.mg-ico {
  width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center;
  font-size: 28px; background: var(--gc-soft); border: 1.5px solid #DBD9E6;
  box-shadow: 0 2px 0 #E7E3F4; margin-bottom: 4px;
}
.mg-card-t { font-family: var(--f-disp); font-size: 21px; font-weight: 900; letter-spacing: .04em; color: var(--ink); }
.mg-card-d { font-size: 12.5px; font-weight: 600; color: var(--muted); line-height: 1.7; min-height: 42px; }
.mg-card-n {
  align-self: flex-start; font-size: 10px; font-weight: 900; letter-spacing: .04em;
  padding: 3px 9px; border-radius: 99px; background: var(--yellow);
  border: 1.5px solid #DBD9E6; margin-top: 2px;
}

/* ================= 题面 ================= */
.mg-stage {
  min-height: 340px; position: relative;
  background: #fff; border: var(--bd); border-radius: 20px;
  padding: 20px 20px 22px; box-shadow: var(--hard);
}
.mg-q { position: relative; display: flex; flex-direction: column; gap: 16px; animation: mg-in .28s ease both; }
@keyframes mg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.mg-prompt {
  position: relative; align-self: flex-start; max-width: 94%;
  font-family: var(--f-disp); font-size: 18px; font-weight: 900; line-height: 1.5;
  color: var(--ink); background: #FFFDF6; border: var(--bd); border-radius: 16px;
  padding: 8px 16px; box-shadow: var(--hard-sm);
}
.mg-prompt::after {
  content: ""; position: absolute; left: 20px; bottom: -11px; width: 16px; height: 16px;
  background: #FFFDF6; border-right: var(--bd); border-bottom: var(--bd); transform: rotate(45deg);
}

.mg-word { font-family: var(--f-disp); font-size: 54px; font-weight: 900; letter-spacing: .08em; display: flex; gap: 8px; align-items: baseline; }
.mg-word em {
  font-style: normal; color: var(--gc); min-width: 56px; text-align: center;
  border-bottom: 5px solid var(--ink); border-radius: 4px;
}
.mg-parts { display: flex; align-items: center; gap: 12px; font-family: var(--f-disp); font-size: 32px; font-weight: 900; }
.mg-parts s { text-decoration: none; color: var(--muted); font-size: 18px; }
.mg-part {
  position: relative; min-width: 60px; height: 64px; display: grid; place-items: center;
  background: #fff; border: 2.5px dashed #CFC9E6; border-radius: 14px;
  font-family: var(--f-disp); font-size: 28px; font-weight: 900;
}
.mg-part.blank { border-color: var(--gc); color: var(--gc); background: var(--gc-soft); }
.mg-part.fixed { background: #E4F8EC; border: 2.5px solid var(--ok); color: var(--ok); animation: mg-pop .35s ease; }

.mg-compose { display: flex; align-items: center; gap: 14px; font-family: var(--f-disp); }
.mg-compose s { text-decoration: none; color: var(--muted); font-size: 22px; }
.mg-big { font-size: 58px; font-weight: 900; line-height: 1.05; }
.mg-big.q { color: var(--gc); border-bottom: 5px solid var(--ink); min-width: 62px; text-align: center; }
.mg-target {
  display: inline-flex; align-items: center; gap: 14px; align-self: flex-start;
  background: #fff; padding: 8px 18px 8px 12px; border-radius: 18px;
  border: var(--bd); box-shadow: var(--hard-sm);
}
.mg-py { font-size: 15px; font-weight: 800; color: var(--muted); letter-spacing: .08em; }
.mg-audio { align-self: flex-start; }

/* ================= 选项 ================= */
.mg-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 148px)); justify-content: center; gap: 14px; }
.mg-opts.parts { grid-template-columns: repeat(auto-fit, minmax(76px, 96px)); }
.mg-opt {
  position: relative; font: inherit; cursor: pointer; padding: 18px 10px; min-height: 84px;
  background: #fff; border: var(--bd); border-radius: 16px;
  font-family: var(--f-disp); font-size: 34px; font-weight: 900; color: var(--ink);
  box-shadow: var(--hard-sm);
  transition: transform .1s ease, box-shadow .1s ease, background .15s ease;
}
.mg-opt.part { font-size: 27px; }
.mg-opt:hover { background: #FFFBF0; border-color: #A8A1E6; box-shadow: 0 2px 0 #E5E0F4; }
.mg-opt:active { transform: translate(3px, 3px); box-shadow: 0 1px 0 #EDEAF7; }
.mg-opt.ok { background: #E4F8EC; border-color: var(--ok); color: var(--ok); animation: mg-pop .35s ease; }
.mg-opt.ok::after {
  content: "✓"; position: absolute; right: -10px; top: -12px; width: 30px; height: 30px;
  display: grid; place-items: center; background: var(--ok); color: #fff;
  border: 1.5px solid #DBD9E6; border-radius: 50%; font-size: 15px; transform: rotate(-12deg);
}
.mg-opt.bad { background: #FDE7E4; border-color: var(--bad); color: var(--bad); animation: mg-shake .35s ease; }
.mg-opt.used { opacity: .3; }

@keyframes mg-pop { 0% { transform: scale(1); } 45% { transform: scale(1.06); } 100% { transform: scale(1); } }
@keyframes mg-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ================= 组字槽位 ================= */
.mg-slots { display: flex; gap: 10px; }
.mg-slot {
  width: 66px; height: 70px; display: grid; place-items: center; cursor: pointer;
  border: 2.5px dashed #CFC9E6; border-radius: 14px; background: #FFFDF6;
  font-family: var(--f-disp); font-size: 30px; font-weight: 900; transition: all .18s ease;
}
.mg-slot.filled { border: 1.5px solid #DBD9E6; background: #fff; box-shadow: 0 2px 0 #E7E3F4; }
.mg-slot.filled:hover { border-color: var(--bad); }

/* ================= 拼音 / 选项行 ================= */
.mg-row { display: flex; align-items: center; gap: 14px; }
.mg-row-n { flex: 0 0 118px; font-size: 11.5px; font-weight: 800; color: var(--muted); }
.mg-chips { display: flex; flex-wrap: wrap; gap: 9px; }
.mg-chip {
  font: inherit; font-family: var(--f-disp); font-size: 20px; font-weight: 900;
  padding: 9px 16px; border-radius: 12px; cursor: pointer;
  background: #fff; border: 1.5px solid #DBD9E6; box-shadow: 0 2px 0 #E7E3F4;
  transition: all .1s ease;
}
.mg-chip:hover { background: #FFF7E6; transform: translate(-1px, -1px); }
.mg-chip.on { background: var(--gc); color: #fff; transform: translate(1px, 1px); box-shadow: 0 1px 0 #EDEAF7; }

/* ================= 找字 / 找词 ================= */
.mg-grid { display: grid; gap: 11px; }
.mg-grid.chars { grid-template-columns: repeat(4, 1fr); }
.mg-grid.words { grid-template-columns: repeat(3, 1fr); }
.mg-cell {
  font: inherit; cursor: pointer; background: #fff; border: var(--bd);
  border-radius: 14px; font-family: var(--f-disp); font-weight: 900;
  box-shadow: 0 2px 0 #E7E3F4; transition: all .1s ease;
}
.mg-grid.chars .mg-cell { font-size: 36px; padding: 14px 0; }
.mg-grid.words .mg-cell { font-size: 18px; padding: 14px 8px; }
.mg-cell:hover { background: #FFFBF0; border-color: #A8A1E6; }
.mg-cell.on { background: var(--yellow); transform: translate(1px, 1px); box-shadow: 0 1px 0 #EDEAF7; }
.mg-cell.ok { background: #E4F8EC; border-color: var(--ok); color: var(--ok); animation: mg-pop .35s ease; }
.mg-cell.bad { background: #FDE7E4; border-color: var(--bad); animation: mg-shake .35s ease; }

.mg-li.py, .mg-chip.py, .mg-opt.py, .mg-syl {
  font-family: var(--f-body); font-weight: 800; letter-spacing: 0;
}
.mg-actions { display: flex; align-items: center; gap: 14px; }
.mg-count { font-size: 12px; font-weight: 800; color: var(--muted); }

/* ================= 连线 ================= */
.mg-link { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; position: relative; }
.mg-col-t { font-family: var(--f-disp); font-size: 15px; font-weight: 900; letter-spacing: .1em; text-align: center; margin-bottom: 8px; }
.mg-li {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 54px; margin-bottom: 10px; padding: 8px 10px; cursor: pointer;
  font: inherit; font-family: var(--f-disp); font-size: 18px; font-weight: 900; text-align: center;
  background: #fff; border: var(--bd); border-radius: 14px;
  box-shadow: 0 2px 0 #E7E3F4; transition: all .1s ease;
}
.mg-li.big { font-size: 26px; }
.mg-li:hover { background: #FFF7E6; transform: translate(-1px, -1px); }
.mg-li.on { background: var(--yellow); }
.mg-li.ok { background: #E4F8EC; border-color: var(--ok); color: var(--ok); }
.mg-li.bad { background: #FDE7E4; border-color: var(--bad); animation: mg-shake .35s ease; }

/* ================= 排序 ================= */
.mg-order-ans {
  display: flex; gap: 9px; flex-wrap: wrap; min-height: 82px; padding: 9px;
  background: #FFFDF6; border: 2.5px dashed #CFC9E6; border-radius: 18px;
}
.mg-order-ans .mg-slot { width: 58px; height: 60px; }
.mg-order-pool { display: flex; gap: 11px; flex-wrap: wrap; }
.mg-stroke {
  position: relative; width: 76px; height: 82px; cursor: pointer;
  background: #fff; border: var(--bd); border-radius: 16px;
  display: grid; place-items: center; padding: 4px;
  box-shadow: 0 2px 0 #E7E3F4; transition: all .1s ease;
}
.mg-stroke:hover { background: #FFF7E6; transform: translate(-2px, -2px) rotate(-2deg); }
.mg-stroke svg { width: 52px; height: 52px; }
.mg-stroke path { fill: var(--ink); }
.mg-stroke-n { position: absolute; bottom: 4px; font-size: 10.5px; font-weight: 900; color: var(--muted); }
.mg-stroke.used { opacity: .25; }
.mg-slot svg { width: 44px; height: 44px; }
.mg-slot path { fill: var(--ink); }

/* ================= 画线 ================= */
.mg-canvas-wrap { border-radius: 18px; overflow: hidden; border: var(--bd); box-shadow: var(--hard-sm); }
.mg-canvas { display: block; width: 100%; height: auto; touch-action: none; cursor: crosshair; }

/* ================= 反馈 ================= */
.mg-feedback {
  margin-top: 16px; min-height: 26px; font-family: var(--f-disp); font-size: 17px; font-weight: 900;
  opacity: 0; transform: translateY(6px); transition: opacity .18s ease, transform .18s ease;
  display: flex; align-items: center; gap: 9px;
}
.mg-feedback.show { opacity: 1; transform: none; }
.mg-feedback.ok { color: var(--ok); }
.mg-feedback.bad { color: var(--bad); }
.mg-fb-i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; color: #fff; border: 1.5px solid #DBD9E6; }
.mg-feedback.ok .mg-fb-i { background: var(--ok); }
.mg-feedback.bad .mg-fb-i { background: var(--bad); }

/* ================= 结算 ================= */
.mg-done { display: grid; place-items: center; min-height: 440px; position: relative; overflow: hidden; padding: 16px 0 6px; }
.mg-done-in { text-align: center; position: relative; z-index: 2; }
.mg-done-art {
  width: 190px; height: 180px; margin: 0 auto 4px;
  background-size: contain; background-repeat: no-repeat; background-position: center;
  animation: mg-bounce 2.8s ease-in-out infinite;
}
.mg-done-ico {
  width: 84px; height: 84px; margin: 0 auto; border-radius: 24px; display: grid; place-items: center;
  font-size: 42px; background: var(--gc-soft); border: var(--bd); box-shadow: var(--hard-sm);
  animation: mg-bounce 1.8s ease-in-out infinite;
}
@keyframes mg-bounce { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-9px) rotate(3deg); } }
.mg-done-t {
  font-family: var(--f-disp); font-size: 34px; font-weight: 900; margin-top: 8px; letter-spacing: .04em;
  color: #2A2450;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .95), 0 8px 18px rgba(83, 88, 172, .20);
}
.mg-done-stars { font-size: 38px; margin: 10px 0 16px; letter-spacing: .08em; }
.mg-done-stars span { display: inline-block; margin: 0 3px; animation: mg-starpop .55s cubic-bezier(.2, 1.5, .4, 1) both; }
.mg-done-stars span:nth-child(2) { animation-delay: .12s; }
.mg-done-stars span:nth-child(3) { animation-delay: .24s; }
@keyframes mg-starpop { 0% { transform: scale(.2) rotate(-40deg); opacity: 0; } 70% { transform: scale(1.18) rotate(6deg); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }

.mg-done-best, .mg-done-new {
  display: inline-block; font-size: 12px; font-weight: 900; letter-spacing: .04em;
  padding: 4px 14px; border-radius: 99px; margin-bottom: 14px;
  border: 1.5px solid #DBD9E6; box-shadow: 0 2px 0 #E7E3F4;
}
.mg-done-best { background: #FFF3D6; color: #8C6A2F; }
.mg-done-new { background: var(--yellow); color: var(--ink); animation: mg-firepop .4s ease; }

.mg-done-grid { display: flex; gap: 12px; justify-content: center; margin-bottom: 20px; flex-wrap: wrap; }
.mg-done-grid div {
  display: flex; flex-direction: column; gap: 2px; min-width: 84px; padding: 10px 16px;
  background: #fff; border: var(--bd); border-radius: 16px; box-shadow: var(--hard-sm);
}
.mg-done-grid b { font-family: var(--f-disp); font-size: 27px; font-weight: 900; color: var(--gc); }
.mg-done-grid span { font-size: 10.5px; font-weight: 800; color: var(--muted); letter-spacing: .08em; }
.mg-done-btns { display: flex; gap: 12px; justify-content: center; }

.mg-done-wrong { margin: 2px auto 18px; max-width: 460px; }
.mg-done-wrong-t { font-family: var(--f-disp); font-size: 15px; font-weight: 900; margin-bottom: 9px; }
.mg-done-wrong-list { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.mg-wrong-chip {
  font: inherit; font-family: var(--f-disp); font-size: 22px; font-weight: 900; cursor: pointer;
  width: 50px; height: 50px; border-radius: 12px; color: var(--ink);
  background: #fff; border: 1.5px solid #DBD9E6; box-shadow: 0 2px 0 #E7E3F4;
  transition: transform .1s ease;
}
.mg-wrong-chip:hover { background: #FFF7E6; transform: translate(-1px, -1px); }
.mg-done-wrong-s { font-size: 11px; font-weight: 600; color: var(--muted); margin-top: 8px; }

.mg-confetti { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.mg-confetti i { position: absolute; top: -14px; width: 9px; height: 15px; border-radius: 2px; animation: mg-fall linear infinite; }
@keyframes mg-fall {
  0% { transform: translateY(-20px) rotate(0); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translateY(520px) rotate(720deg); opacity: 0; }
}

/* ================= 插画 ================= */
.mg-corner-art {
  position: absolute; right: -46px; bottom: -38px; width: 300px; height: 300px;
  background-size: contain; background-repeat: no-repeat; background-position: center;
  opacity: .12; pointer-events: none;
}
.mg > .mg-corner-art { position: absolute; z-index: 0; }
.mg-thumb {
  flex: 0 0 46px; width: 46px; height: 46px; border-radius: 12px;
  background-size: cover; background-position: center;
  border: 1.5px solid #DBD9E6; box-shadow: 0 2px 0 #E7E3F4;
  transform: rotate(-3deg);
}

/* ================= 连击 / 飘分 / 飞星 ================= */
.mg-fire {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 900;
  padding: 3px 9px; border-radius: 99px; color: var(--ink); background: var(--yellow);
  border: 1.5px solid #DBD9E6; box-shadow: 0 2px 0 #E7E3F4;
  transform: rotate(2deg); animation: mg-firepop .3s cubic-bezier(.2, 1.4, .4, 1);
}
.mg-fire b { font-size: 13px; }
.mg-fire em { font-style: normal; font-size: 11px; font-weight: 900; margin-left: 2px; padding: 0 5px; border-radius: 6px; background: rgba(83, 88, 172, .13); }
.mg-fire.hot { background: var(--red); color: #fff; }
.mg-fire.hot em { background: rgba(255, 255, 255, .3); }
@keyframes mg-firepop { from { transform: scale(.7) rotate(8deg); opacity: .4; } to { transform: scale(1) rotate(2deg); opacity: 1; } }

.mg-float-score {
  position: absolute; right: 18px; top: 12px; font-family: var(--f-disp);
  font-size: 22px; font-weight: 900; color: var(--ok); pointer-events: none;
  text-shadow: 2px 0 #fff, -2px 0 #fff, 0 2px #fff, 0 -2px #fff, 0 2px 0 #E7E3F4;
  animation: mg-floatup .9s ease-out forwards;
}
@keyframes mg-floatup {
  0% { transform: translateY(8px) scale(.7); opacity: 0; }
  25% { transform: translateY(0) scale(1.1); opacity: 1; }
  100% { transform: translateY(-18px) scale(1); opacity: 0; }
}
.mg-flystar {
  position: fixed; z-index: 9999; font-size: 26px; color: var(--yellow); pointer-events: none;
  text-shadow: 0 2px 6px rgba(83, 88, 172, .30);
  transition: transform .55s cubic-bezier(.3, .75, .2, 1), opacity .55s ease;
}
.mg-break {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%) rotate(-2deg); z-index: 8;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 8px 22px; border-radius: 14px; pointer-events: none;
  background: var(--yellow); color: var(--ink); border: var(--bd); box-shadow: var(--hard-sm);
  animation: mg-breakin .3s cubic-bezier(.2, 1.3, .4, 1) both;
}
.mg-break b { font-family: var(--f-disp); font-size: 17px; font-weight: 900; }
.mg-break span { font-size: 10.5px; font-weight: 700; }
@keyframes mg-breakin { from { opacity: 0; transform: translate(-50%, -16px) rotate(-6deg); } to { opacity: 1; transform: translate(-50%, 0) rotate(-2deg); } }

.mg-countdown {
  position: absolute; inset: 0; z-index: 9; display: grid; place-items: center;
  background: rgba(255, 246, 228, .9); border-radius: 18px; pointer-events: none;
  transition: opacity .25s ease;
}
.mg-countdown.out { opacity: 0; }
.mg-countdown span {
  font-family: var(--f-disp); font-size: 104px; font-weight: 900; color: #4B3F8C;
  text-shadow: 0 3px 0 rgba(255, 255, 255, .95), 0 14px 30px rgba(83, 88, 172, .26);
  animation: mg-countpop .2s ease-out;
}
@keyframes mg-countpop { from { transform: scale(.4) rotate(-8deg); opacity: .2; } to { transform: scale(1) rotate(-3deg); opacity: 1; } }

.mg-lens {
  position: absolute; width: 112px; height: 112px; margin: -56px 0 0 -56px;
  border-radius: 50%; pointer-events: none; opacity: 0; z-index: 3;
  border: 4px solid rgba(255, 255, 255, .95);
  box-shadow: 0 3px 0 #E7E3F4, 0 18px 30px -20px rgba(58, 52, 140, .34);
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .5), rgba(255, 255, 255, .05) 60%);
  transition: opacity .16s ease;
}
.mg-lens::after {
  content: ""; position: absolute; right: -18px; bottom: -18px; width: 30px; height: 12px;
  border-radius: 6px; background: #C08A4A; border: 1.5px solid #DBD9E6; transform: rotate(45deg);
}

/* ================= 声调滑梯 ================= */
.mg-tone-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mg-tone-char {
  font-family: var(--f-disp); font-size: 48px; font-weight: 900; line-height: 1;
  background: #fff; border: var(--bd); border-radius: 16px; padding: 6px 18px; box-shadow: var(--hard-sm);
}
.mg-tone-word { font-family: var(--f-disp); font-size: 20px; font-weight: 900; color: var(--muted); letter-spacing: .1em; }
.mg-slide-wrap {
  background: #FFFDF6; border: var(--bd); border-radius: 18px; padding: 6px 4px; box-shadow: var(--hard-sm);
}
.mg-slide { display: block; width: 100%; max-width: 560px; margin: 0 auto; }
.mg-slide .rail-bg { fill: none; stroke: #EADCC6; stroke-width: 10; stroke-linecap: round; }
.mg-slide .rail { fill: none; stroke-width: 4; stroke-linecap: round; opacity: .9; }
.mg-slide .lane { cursor: pointer; }
.mg-slide .lane.disabled { pointer-events: none; }
.mg-slide .lane.disabled:not(.ok) { opacity: .42; }
.mg-slide .lane:hover .rail-bg { stroke: #FFD9A8; }
.mg-slide .lane.ok .rail { stroke-width: 5.4; }
.mg-slide .lane.ok .rail-bg { stroke: #CBEBD8; }
.mg-slide .ball { fill: #fff; stroke: var(--ink); stroke-width: 2; }
.mg-slide .lane.ok .ball { fill: var(--yellow); }
.mg-slide .ball.pulse { animation: mg-ballpop .45s ease; }
.mg-slide .lane.bad { animation: mg-shake .4s ease; }
.mg-slide .lane-n { font-family: var(--f-body); font-size: 5.4px; font-weight: 800; fill: var(--ink); letter-spacing: 0; }
.mg-slide .lane-m { font-family: var(--f-body); font-size: 4px; font-weight: 700; fill: var(--muted); }
.mg-slide .hit { fill: transparent; }
@keyframes mg-ballpop { 0%, 100% { r: 4; } 45% { r: 6.4; } }
.mg-slide-hint { font-family: var(--f-disp); font-size: 15px; font-weight: 900; color: var(--muted); text-align: center; }

/* ================= 修理站 ================= */
.mg-repair {
  display: flex; flex-direction: column; gap: 14px;
  background: #FFFDF6; border: var(--bd); border-radius: 18px; padding: 16px; box-shadow: var(--hard-sm);
}
.mg-repair-word { font-family: var(--f-disp); font-size: 40px; font-weight: 900; letter-spacing: .1em; display: flex; gap: 6px; }
.mg-repair-word em { font-style: normal; color: var(--gc); }
.mg-repair-bench { display: flex; align-items: center; gap: 14px; }
.mg-wrench { font-size: 30px; transform: rotate(-18deg); }
.mg-repair-parts { display: flex; align-items: center; gap: 10px; font-family: var(--f-disp); font-size: 26px; font-weight: 900; }
.mg-repair-parts s { text-decoration: none; color: var(--muted); font-size: 17px; }
.mg-crack { font-style: normal; font-family: var(--f-body); color: var(--gc); }
.mg-wrench-badge {
  position: absolute; right: -10px; top: -10px; font-size: 17px; font-style: normal;
  transform: rotate(-20deg); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .15));
}

/* ================= 听词选字 ================= */
.mg-listen { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.mg-ear {
  position: relative; width: 68px; height: 68px; border-radius: 50%;
  background: #fff; border: var(--bd); box-shadow: var(--hard-sm);
  display: grid; place-items: center; font-size: 30px;
}
.mg-ear i { position: absolute; inset: -4px; border-radius: 50%; border: 3px solid var(--gc); opacity: 0; }
.mg-ear.ring i { animation: mg-ripple 1.2s ease-out; }
.mg-ear.ring i:nth-child(2) { animation-delay: .25s; }
.mg-ear.ring i:nth-child(3) { animation-delay: .5s; }
@keyframes mg-ripple { 0% { transform: scale(.9); opacity: .6; } 100% { transform: scale(2.1); opacity: 0; } }
.mg-listen-word { font-family: var(--f-disp); font-size: 46px; font-weight: 900; letter-spacing: .08em; display: flex; gap: 8px; }
.mg-listen-word em {
  font-style: normal; color: var(--gc); min-width: 56px; text-align: center;
  border-bottom: 5px solid var(--ink); border-radius: 4px;
}

/* ================= 变声 ================= */
.mg-swap-listen { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mg-swap-replay {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 46px; padding: 9px 17px; touch-action: manipulation;
  background: #F4F1FC; border-color: #DCD4EE; color: #514A88;
}
.mg-swap-replay:hover { background: #ECE7F8; }
.mg-swap-replay .ico3d { flex: 0 0 auto; }
.mg-swap-listen-hint { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.mg-swap {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: #FFFDF6; border: var(--bd); border-radius: 18px; padding: 14px 18px; box-shadow: var(--hard-sm);
}
.mg-swap-side { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.mg-swap-side b { font-family: var(--f-disp); font-size: 28px; font-weight: 900; }
.mg-swap-side b.q { color: var(--gc); }
.mg-wave { display: flex; align-items: center; gap: 3px; height: 44px; }
.mg-wave i { width: 5px; border-radius: 3px; background: #C3B29B; }
.mg-wave.b i { background: var(--gc); opacity: .55; }
.mg-wave.b.morph i { animation: mg-waveform .7s ease; }
.mg-wave.b.morph i:nth-child(2n) { animation-delay: .06s; }
.mg-wave.b.morph i:nth-child(3n) { animation-delay: .12s; }
@keyframes mg-waveform { 0% { transform: scaleY(.35); } 55% { transform: scaleY(1.35); } 100% { transform: scaleY(1); } }
.mg-swap-arrow { font-family: var(--f-disp); font-size: 26px; font-weight: 900; }

/* ================= 词语工厂 ================= */
.mg-factory {
  position: relative; background: #FFFDF6; border: var(--bd); border-radius: 18px;
  padding: 16px 16px 20px; overflow: hidden; box-shadow: var(--hard-sm);
}
.mg-conveyor { display: flex; align-items: center; gap: 10px; justify-content: center; }
.mg-crate {
  width: 62px; height: 62px; border-radius: 14px; background: #fff;
  display: grid; place-items: center; font-family: var(--f-disp);
  font-size: 30px; font-weight: 900; border: 1.5px solid #DBD9E6;
  box-shadow: 0 2px 0 #E7E3F4;
}
.mg-crate.q { color: var(--gc); border-style: dashed; }
.mg-crate.out { background: var(--gc-soft); color: var(--gc); }
.mg-factory-op { font-family: var(--f-disp); font-size: 20px; font-weight: 900; color: var(--muted); }
.mg-machine-box {
  width: 58px; height: 62px; border-radius: 13px; background: #F6E7CF;
  border: 1.5px solid #DBD9E6; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px; box-shadow: 0 2px 0 #E7E3F4;
}
.mg-machine-box i { font-style: normal; font-size: 20px; animation: mg-gear 3s linear infinite; }
.mg-machine-box em { font-style: normal; font-size: 9px; font-weight: 800; color: var(--muted); }
@keyframes mg-gear { to { transform: rotate(360deg); } }
.mg-belt {
  display: flex; gap: 14px; justify-content: center; align-items: center;
  margin: 16px auto 0; height: 14px; width: 76%; border-radius: 99px;
  background: #EFE3D2; border: 1.5px solid #DBD9E6; padding: 0 12px; overflow: hidden;
}
.mg-belt i { width: 10px; height: 6px; border-radius: 2px; background: #B9A48B; animation: mg-belt .9s linear infinite; }
@keyframes mg-belt { from { transform: translateX(0); opacity: .4; } 50% { opacity: 1; } to { transform: translateX(24px); opacity: .4; } }
.mg-factory.done .mg-crate.out { animation: mg-pop .45s ease; }

/* ================= 组字工作台 ================= */
.mg-bench {
  display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center;
  background: #FFFDF6; border: var(--bd); border-radius: 18px; padding: 14px 16px; box-shadow: var(--hard-sm);
}
.mg-bench-lab { font-family: var(--f-disp); font-size: 12px; font-weight: 900; color: var(--muted); margin-bottom: 7px; }
.mg-product {
  width: 72px; height: 72px; border-radius: 16px; background: #fff;
  display: grid; place-items: center; font-family: var(--f-disp);
  font-size: 34px; font-weight: 900; color: var(--gc);
  border: 2.5px dashed #CFC9E6; box-shadow: 0 2px 0 #E7E3F4;
}
.mg-bench.done .mg-product { border: 2.5px solid var(--ok); color: var(--ok); background: #E4F8EC; animation: mg-pop .4s ease; }

/* ================= 拼音火车 ================= */
.mg-rail-scene {
  position: relative; height: 150px; border-radius: 18px; overflow: hidden;
  background: linear-gradient(180deg, #DCEEFF, #FFF6E4);
  border: var(--bd); box-shadow: var(--hard-sm);
}
.mg-rail {
  position: absolute; left: 0; right: 0; bottom: 24px; height: 5px;
  background: var(--ink); box-shadow: 0 6px 0 #B9A48B;
}
.mg-rail::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: -12px; height: 8px;
  background: repeating-linear-gradient(90deg, #C9B79F 0 6px, transparent 6px 18px);
}
.mg-train {
  position: absolute; left: 22px; bottom: 30px; display: flex; align-items: flex-end; gap: 3px;
  transition: transform .62s cubic-bezier(.3, .8, .3, 1);
}
.mg-train.go { transform: translateX(320px); }
.mg-train.stall { animation: mg-shake .4s ease; }
.mg-loco {
  position: relative; width: 76px; height: 52px; color: #fff;
  background: var(--red); border: 1.5px solid #DBD9E6;
  border-radius: 10px 16px 4px 4px; display: grid; place-items: center;
  font-family: var(--f-disp); font-size: 24px; font-weight: 900;
  box-shadow: 0 2px 0 #E7E3F4;
}
.mg-stack {
  position: absolute; left: 10px; top: -14px; width: 13px; height: 15px;
  background: var(--red); border: 1.5px solid #DBD9E6; border-bottom: none; border-radius: 4px 4px 0 0;
}
.mg-coupler { width: 14px; height: 7px; background: #B9A48B; border: 1.5px solid #DBD9E6; border-radius: 3px; margin-bottom: 16px; }
.mg-carriage {
  width: 90px; height: 46px; background: #fff; border: 1.5px solid #DBD9E6;
  border-radius: 8px 12px 4px 4px; display: grid; place-items: center;
  font-family: var(--f-disp); font-size: 22px; font-weight: 900;
  box-shadow: 0 2px 0 #E7E3F4;
}
.mg-train.coupled .mg-coupler { background: var(--yellow); }
.mg-wheel {
  position: absolute; bottom: -7px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 1.5px solid #DBD9E6;
}
.mg-loco .w1 { left: 11px; }
.mg-loco .w2 { right: 11px; }
.mg-carriage .w3 { left: 13px; }
.mg-carriage .w4 { right: 13px; }
.mg-smoke {
  position: absolute; left: 13px; top: -26px; width: 10px; height: 10px; border-radius: 50%;
  background: #fff; border: 1.5px solid #DBD9E6; opacity: 0;
}
.mg-train.go .mg-smoke { animation: mg-puff .7s ease-out infinite; }
@keyframes mg-puff {
  0% { opacity: .9; transform: translate(0, 0) scale(.6); }
  100% { opacity: 0; transform: translate(-16px, -28px) scale(1.6); }
}
.mg-cloud { position: absolute; border-radius: 99px; background: #fff; border: 1.5px solid #DBD9E6; opacity: .9; }
.mg-cloud.c1 { width: 46px; height: 18px; right: 60px; top: 22px; }
.mg-cloud.c2 { width: 30px; height: 14px; right: 30px; top: 44px; opacity: .7; }
.mg-sun {
  position: absolute; right: 26px; top: 16px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--yellow); border: 1.5px solid #DBD9E6;
  box-shadow: 0 0 0 6px rgba(255, 201, 60, .25);
}
.mg-station {
  position: absolute; left: 20px; top: 14px; font-family: var(--f-disp);
  font-size: 11px; font-weight: 900; letter-spacing: .18em; color: var(--ink);
  padding: 2px 10px; background: #fff; border: 1.5px solid #DBD9E6;
  border-radius: 99px; transform: rotate(-2deg);
}

/* ================= 响应式 ================= */
@media (max-width: 760px) {
  .mg { padding: 16px; border-radius: 20px; box-shadow: 0 3px 0 #E7E3F4, 0 18px 30px -20px rgba(58, 52, 140, .34); }
  .mg-bar { gap: 8px; }
  .mg-title { font-size: 20px; }
  .mg-sub { display: none; }
  .mg-fire { font-size: 11px; padding: 3px 8px; }
  .mg-ghost { width: 38px; height: 38px; }
  .mg-stat { padding: 4px 10px; font-size: 12px; }
  .mg-corner-art { display: none; }
  .mg-thumb { flex: 0 0 38px; width: 38px; height: 38px; }
  .mg-hero { min-height: 194px; }
  .mg-hero-in { max-width: 82%; padding: 18px; }
  .mg-hero-t { font-size: 27px; }
  .mg-hero-s { font-size: 12px; }
  .mg-cards { grid-template-columns: repeat(2, 1fr); gap: 11px; }
  .mg-card { padding: 12px 11px 11px; gap: 4px; transform: rotate(-.5deg); }
  .mg-ico { width: 40px; height: 40px; font-size: 21px; }
  .mg-card-t { font-size: 17px; }
  .mg-card-d { font-size: 10.5px; min-height: 30px; }
  .mg-card-n { font-size: 9px; padding: 2px 7px; }
  .mg-word { font-size: 42px; }
  .mg-big { font-size: 46px; }
  .mg-grid.chars { grid-template-columns: repeat(4, 1fr); }
  .mg-grid.chars .mg-cell { font-size: 28px; padding: 11px 0; }
  .mg-grid.words { grid-template-columns: repeat(2, 1fr); }
  .mg-link { grid-template-columns: 1fr; }
  .mg-bench { grid-template-columns: 1fr; gap: 10px; }
  .mg-tone-char { font-size: 38px; }
  .mg-listen-word, .mg-repair-word { font-size: 34px; }
  .mg-rail-scene { height: 138px; }
  .mg-done-art { width: 150px; height: 142px; }
  .mg-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .mg-row-n { flex: none; }
}

/* ================= 连线画线层 ================= */
.mg-wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.mg-wires path {
  fill: none; stroke: var(--ink); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1000; stroke-dashoffset: 1000;
  animation: mg-draw .5s ease forwards;
}
.mg-wires path.alt { stroke: var(--gc); stroke-width: 2.5; stroke-dasharray: 8 7; animation: none; stroke-dashoffset: 0; }
@keyframes mg-draw { to { stroke-dashoffset: 0; } }

/* ================= 版面精修：四页重排 ================= */
.mg-stage { min-height: 300px; }

/* 笔顺排队：目标字 + 站台 + 候车厅 */
.mg-order { display: grid; grid-template-columns: 140px 1fr; gap: 20px; align-items: start; }
.mg-order-side { text-align: center; }
.mg-order-char {
  font-family: var(--f-disp); font-size: 62px; font-weight: 900; line-height: 1.1;
  background: #fff; border: var(--bd); border-radius: 20px;
  box-shadow: var(--hard-sm); padding: 10px 0 8px;
}
.mg-order-char span {
  display: block; font-family: var(--f-body); font-size: 12px; font-weight: 800;
  letter-spacing: .12em; color: var(--muted); margin-top: 2px;
}
.mg-order-lab {
  font-size: 11px; font-weight: 800; letter-spacing: .1em;
  color: var(--muted); margin: 0 0 8px 2px;
}
.mg-order-main { display: flex; flex-direction: column; gap: 14px; }
.mg-order-ans {
  display: flex; gap: 10px; flex-wrap: wrap; min-height: 96px; padding: 10px;
  background: #FFFDF6; border: 2.5px dashed #CFC9E6; border-radius: 18px;
}
.mg-order-ans .mg-slot { width: 66px; height: 74px; position: relative; }
.mg-order-no {
  position: absolute; right: 4px; top: 2px; font-size: 10px; font-weight: 900;
  color: var(--muted);
}
.mg-order-ans .mg-slot.filled .mg-order-no { color: var(--ok); }
.mg-order-pool {
  display: flex; gap: 12px; flex-wrap: wrap; padding: 12px;
  background: #FFF6E4; border: 2.5px dashed #CFC9E6; border-radius: 18px;
  min-height: 108px; align-items: center;
}

/* 拼装厂：工作台用弹性布局，槽居中，运算符号分隔 */
.mg-bench {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
}
.mg-bench-l, .mg-bench-r { flex: 0 0 auto; }
.mg-bench-mid { flex: 1; min-width: 0; }
.mg-bench-mid .mg-slots { justify-content: center; }
.mg-bench-op {
  font-family: var(--f-disp); font-size: 30px; font-weight: 900; color: var(--muted);
  flex: 0 0 auto; padding-bottom: 18px;
}
.mg-bench.done .mg-bench-op { color: var(--ok); }

/* 侦探：目标字卡 + 独立朗读按钮 */
.mg-scan-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mg-scan-head .mg-btn { padding: 10px 16px; font-size: 13px; }

/* 火车：场景更高、车更大、提示与选项靠拢 */
.mg-hint { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.mg-rail-scene { height: 186px; }
.mg-train { left: 30px; bottom: 34px; gap: 4px; }
.mg-loco { width: 96px; height: 66px; font-size: 27px; }
.mg-carriage { width: 116px; height: 58px; font-size: 25px; }
.mg-wheel { width: 17px; height: 17px; }
.mg-stack { width: 16px; height: 20px; left: 12px; top: -18px; }
.mg-loco .w1 { left: 16px; } .mg-loco .w2 { right: 16px; }
.mg-carriage .w3 { left: 18px; } .mg-carriage .w4 { right: 18px; }
.mg-station { left: 26px; top: 20px; font-size: 11px; padding: 4px 12px; }
.mg-sun { right: 32px; top: 22px; width: 40px; height: 40px; }
.mg-train.go { transform: translateX(460px); }
.mg-row { gap: 12px; }
.mg-row-n { flex: 0 0 104px; }
.mg-q { gap: 14px; }

@media (max-width: 760px) {
  .mg-order { grid-template-columns: 1fr; }
  .mg-order-side { display: flex; align-items: center; gap: 12px; text-align: left; }
  .mg-order-side .mg-order-lab { display: none; }
  .mg-order-char { font-size: 44px; padding: 6px 14px 4px; }
  .mg-order-char span { font-size: 11px; }
  /* 5 段（目标/冒号/部件槽/等号/成品）必须同排，换行会让"＝成品"掉到下一行。
     390 宽下原始尺寸总和约 353px，超出可用 306px，故整体降一档。 */
  .mg-bench { flex-wrap: nowrap; gap: 6px; padding: 12px 10px; }
  .mg-bench-op { padding: 0; font-size: 20px; }
  .mg-bench-lab { font-size: 10px; white-space: nowrap; letter-spacing: .02em; }
  .mg-bench-mid .mg-bench-lab { text-align: left; padding-left: 2px; }
  .mg-bench-r .mg-bench-lab { text-align: right; }
  .mg-target { padding: 6px 10px 6px 8px; gap: 8px; border-radius: 14px; }
  .mg-target .mg-big { font-size: 34px; }
  .mg-py { font-size: 12px; letter-spacing: 0; }
  .mg-slots { gap: 6px; }
  .mg-slot { width: 46px; height: 54px; font-size: 22px; border-radius: 12px; }
  .mg-product { width: 54px; height: 54px; font-size: 26px; border-radius: 14px; }
}

/* ---------- 细节修正 ---------- */
.mg-scan-head .mg-btn { white-space: nowrap; }
.mg-bench-mid .mg-bench-lab { text-align: center; }
.mg-actions .mg-primary { min-width: 132px; padding: 12px 22px; font-size: 15px; }
.mg-row .mg-chips { flex: 1; justify-content: center; }

/* 火车场景：补远山 / 树 / 云，避免大片空天 */
.mg-rail-scene { height: 200px; }
.mg-rail-scene::before {
  content: ""; position: absolute; left: -6%; right: 46%; bottom: 26px; height: 108px;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  background: #E7F1D2; opacity: .9;
}
.mg-rail-scene::after {
  content: ""; position: absolute; left: 38%; right: -6%; bottom: 26px; height: 74px;
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  background: #EFF5E0; opacity: .85;
}
.mg-train, .mg-rail, .mg-station, .mg-sun, .mg-cloud { z-index: 2; }
.mg-loco { width: 114px; height: 76px; font-size: 30px; border-radius: 14px 22px 8px 8px; }
.mg-carriage { width: 136px; height: 66px; font-size: 28px; }
.mg-stack { width: 18px; height: 22px; left: 14px; top: -20px; }
.mg-wheel { width: 19px; height: 19px; }
.mg-loco .w1 { left: 20px; } .mg-loco .w2 { right: 20px; }
.mg-carriage .w3 { left: 22px; } .mg-carriage .w4 { right: 22px; }
.mg-train { left: 40px; bottom: 38px; }
.mg-train.go { transform: translateX(560px); }
.mg-cloud.c1 { width: 62px; height: 24px; right: 120px; top: 26px; }
.mg-cloud.c2 { width: 40px; height: 18px; right: 74px; top: 54px; }

/* 火车：两行选项居中，标签在上一行 */
.train-row { flex-direction: column; align-items: center; gap: 9px; }
.train-row .mg-row-n { flex: none; text-align: center; font-size: 11.5px; letter-spacing: .08em; }
.train-row .mg-chips { justify-content: center; }
.mg-train { bottom: 33px; }
.mg-cloud.c1 { right: 150px; top: 22px; }
.mg-cloud.c2 { right: 104px; top: 52px; }

/* ================= 每款游戏的专属动效 ================= */
/* 零件飞入（拼装厂） */
.mg-flypart {
  position: fixed; z-index: 9999;
  display: grid; place-items: center;
  font-family: var(--f-disp); font-weight: 900; color: var(--ink);
  background: #fff; border: var(--bd); border-radius: 14px;
  box-shadow: var(--hard-sm); pointer-events: none; padding: 0;
  transition: transform .3s cubic-bezier(.3, .9, .3, 1), opacity .3s ease;
}
.mg-slot.pop { animation: mg-slotpop .32s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes mg-slotpop {
  0% { transform: scale(.94); }
  55% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* 笔顺排队：落笔自绘 + 依次点亮 */
.mg-order-ans .mg-slot.lit { animation: mg-litseq .5s ease both; }
@keyframes mg-litseq {
  0% { background: #FFFDF6; box-shadow: 0 0 0 0 rgba(31, 157, 85, 0); }
  45% { background: #DFF3E4; box-shadow: 0 0 0 6px rgba(31, 157, 85, .22); }
  100% { background: #EAF7EE; box-shadow: 0 0 0 0 rgba(31, 157, 85, 0); }
}
.mg-order-ans .mg-slot path { stroke: var(--ink); }

/* 词语工厂：木箱送进机器 → 成品弹出 */
.mg-factory.run .mg-crate.q { animation: mg-crate-in .42s cubic-bezier(.5, 0, .9, .4) forwards; }
.mg-factory.run .mg-machine-box { animation: mg-machine-shake .18s ease-in-out 2; }
.mg-factory.run .mg-machine-box i { animation: mg-gear .28s linear infinite; }
.mg-factory.run .mg-crate.out { animation: mg-pop .42s cubic-bezier(.2, 1.4, .4, 1) .42s both; }
@keyframes mg-crate-in { to { transform: translateX(18px) scale(.6); opacity: 0; } }
@keyframes mg-machine-shake {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-2px, 2px) rotate(-1deg); }
}

/* 侦探：找到的字盖个戳 */
.mg-cell.found { position: relative; overflow: visible; }
.mg-cell.found::after {
  content: "✓"; position: absolute; right: -7px; top: -9px;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: 14px; font-weight: 900;
  color: #fff; background: var(--ok); border: 1.5px solid #DBD9E6;
  box-shadow: 0 2px 0 #E7E3F4;
  animation: mg-stamp .3s cubic-bezier(.2, 1.6, .4, 1) both;
}
@keyframes mg-stamp {
  from { transform: scale(2.2) rotate(-18deg); opacity: 0; }
  to { transform: scale(1) rotate(-8deg); opacity: 1; }
}

/* 笔顺槽位编号：小白签，始终压在笔画上层 */
.mg-order-no {
  position: absolute; right: 3px; top: 2px; z-index: 2;
  min-width: 15px; height: 15px; padding: 0 3px; border-radius: 99px;
  display: grid; place-items: center;
  font-size: 9.5px; font-weight: 900; line-height: 1;
  color: var(--ink); background: #fff; border: 1.5px solid #DBD9E6;
}
.mg-order-ans .mg-slot.filled .mg-order-no { background: var(--ok); color: #fff; }

/* 顶栏缩略图纯装饰，不拦点击（否则会挡住返回按钮） */
.mg-thumb { pointer-events: none; }
.mg-corner-art { pointer-events: none; }
.mg-bar [data-act="exit"] { position: relative; z-index: 3; }

/* ---------- 完成页主视觉 ----------
   以前这里套了一层"白底圆角卡 + 白边"，因为旧素材是带白底的 jpg。
   现在 art/v9/art_done.png 是透明 PNG，底板只会把物件切出一个方框，
   所以去掉底板，改用 drop-shadow 直接给物件投影。 */
.mg-done-art {
  width: 166px; height: 158px; margin: 0 auto 12px;
  background-size: contain; background-position: center; background-repeat: no-repeat;
  filter: drop-shadow(0 12px 14px rgba(83, 88, 172, .20));
  animation: mg-bounce 2.8s ease-in-out infinite;
}

/* ---------- 手机端主视觉：文字放进纸卡，不再压在插画上 ---------- */
@media (max-width: 760px) {
  .mg-hero {
    min-height: 0; padding: 0; display: block;
    background-position: 70% 26%; background-size: 168%;
  }
  .mg-hero::after { opacity: .04; }
  /* 插画在上、文字纸卡在下，互不压字 */
  .mg-hero-in {
    max-width: 100%; margin-top: 118px;
    background: var(--paper);
    border-top: 1.5px solid #DBD9E6;
    border-radius: 18px 18px 0 0;
    padding: 14px 14px 16px;
    box-shadow: none;
  }
  .mg-hero-t { font-size: 24px; line-height: 1.32; margin-top: 10px; }
  .mg-hero-s { font-size: 12.5px; line-height: 1.72; max-width: none; }
  .mg-hero-chips span { font-size: 10.5px; padding: 3px 9px; }
  .mg-resume { margin-top: 10px; }
  .mg-done-art { width: 132px; height: 132px; border-radius: 26px; }
}

/* ---------- 去点阵，保留沪儿睿品牌紫手绘贴纸质感与修正 ---------- */
.mg::before { display: none !important; }
.mg-primary { background: #5358AC; color: #fff; }
.mg-primary:hover { background: #6469C2; }
.mg-btn:hover { background: #F0F1FF; }
.mg-card:hover { background: #FCFBFF; box-shadow: 0 3px 0 #E7E3F4, 0 18px 30px -20px rgba(58, 52, 140, .34); }
.mg-opt:hover { background: #F4F5FF; transform: translate(-2px, -2px); box-shadow: 0 2px 0 #E5E0F4; }
.mg-hero::after {
  background: linear-gradient(94deg, rgba(247, 246, 253, .96) 0%, rgba(247, 246, 253, .85) 38%, rgba(247, 246, 253, .08) 66%, rgba(247, 246, 253, 0) 100%);
}
.mg-hero-s { color: #4A4570; }
.mg-prompt { background: #FCFBFF; }
.mg-prompt::after { background: #FCFBFF; }
.mg-order-ans { background: #FCFBFF; border-color: #D3CEE9; }
.mg-order-pool { background: #F0F1FA; border-color: #E2DEF2; }
.mg-stroke svg path.fg-stroke, .mg-order-ans .mg-slot svg path.fg-stroke { fill: var(--ink); stroke: var(--ink); }
.mg-stroke svg path.bg-stroke, .mg-order-ans .mg-slot svg path.bg-stroke { fill: #E5E4F3 !important; stroke: none !important; }
.mg-crate.out { width: auto; min-width: 96px; padding: 0 14px; font-size: 32px; letter-spacing: .06em; }
.mg-burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; z-index: 10; }
.mg-burst i {
  position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border-radius: 50%;
  border: 1.5px solid #DBD9E6;
  animation: mg-burst-fly .65s cubic-bezier(.16, 1, .3, 1) forwards;
}
@keyframes mg-burst-fly {
  0% { transform: translate(0, 0) scale(1); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; }
}
@media (max-width: 760px) {
  .mg-link { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .mg-li { padding: 10px 4px; font-size: 15px; }
  .mg-li.big { font-size: 22px; }
}

/* 隐藏属性强制生效 + 大灰狼与小猪画布一屏自适应 */
.mg [hidden] { display: none !important; }
.mg-draw .mg-canvas-wrap { max-width: min(100%, calc(48vh * 10 / 7)); margin: 0 auto; }
.mg-draw .mg-actions { justify-content: center; }

/* ===== v4 图标 + 视觉降噪（专项训练区）=====

   这个模块的视觉原本集中在 :root 的 --bd / --hard 两个变量上，
   所以「去黑影 + 边框转浅」只需要改这两行，不用逐条改 50 多个规则。
*/
.mg {
  --line: #DBD9E6;          /* 默认边框：比墨色浅的灰紫 */
  --line-hover: #A8A1E6;    /* 悬停：淡紫 */
  --bd: 2px solid var(--line);
  --hard: none;
  --hard-sm: none;
  box-shadow: none;         /* 外层那张大黑影一起去掉 */
}

/* 内容框：去阴影、去贴纸倾斜，只留一条浅边 */
.mg-card,
.mg-stage,
.mg-hub,
.mg-panel {
  box-shadow: none;
  border-color: var(--line);
  transform: none;
}
.mg-card:nth-child(2n),
.mg-card:nth-child(3n) { transform: none; }

/* 悬停：只有这一张框的边变淡紫，不位移、不放大 */
.mg-card {
  transition: border-color .18s ease;
}
.mg-card:hover {
  transform: none;
  box-shadow: none;
  background: #fff;
  border-color: var(--line-hover);
}
.mg-card:active {
  transform: none;
  box-shadow: none;
  border-color: var(--line-hover);
  background: #FBFAFF;
}
.mg-card:focus-visible {
  outline: 2px solid var(--line-hover);
  outline-offset: 2px;
}

/* 图标块：浅色圆角块 + 同色线性图标（对齐测评系统的方块语言） */
.mg-ico {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center;
  color: var(--gc);
  background: var(--gc-soft);
  border: 0; box-shadow: none;
  margin-bottom: 7px;
}
.mg-ico svg {
  width: 25px; height: 25px;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.mg-done-ico svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

@media (max-width: 720px) {
  .mg-ico { width: 40px; height: 40px; border-radius: 12px; margin-bottom: 5px; }
  .mg-ico svg { width: 21px; height: 21px; }
}

/* ===== v4 收口（专项训练）===== */
/* 分区标题：去掉旋转小方块与像素风缩略图，改成一根品牌色竖条 */
.mg-cat-t::before {
  width: 4px; height: 18px; border-radius: 2px;
  background: var(--gc); border: 0; box-shadow: none; transform: none;
}
.mg-cat-art { display: none !important; }

/* 题量徽章：饱和黄块 → 游戏色的淡彩底 */
.mg-card-n {
  background: var(--gc-soft);
  color: var(--gc);
  border: 0;
  font-weight: 800;
  letter-spacing: .02em;
  padding: 4px 10px;
}

/* ===== v5 小游戏图标 ===== */
.mg-done-stars span svg { width: 38px; height: 38px; display: block; }
.mg-fire-ico {
  width: 14px; height: 14px; vertical-align: -.16em;
  fill: currentColor; stroke: none;
}
.mg-done-frag .ico3d { width: 15px; height: 15px; }
.mg-btn .ico3d { width: 21px; height: 21px; }

/* ===== v6b 训练大厅质感收口 ===== */

/* ---------- 1. hero 标题：8 向墨线描边 → 深墨紫字 + 白高光 ---------- */
.mg-hero-t {
  color: #2A2450;
  /* 注意：text-shadow 没有 spread 参数，写负值整条声明会被丢弃 */
  text-shadow:
    0 1px 0 rgba(255, 255, 255, .92),
    0 6px 14px rgba(83, 88, 172, .26);
}
.mg-hero-t em { color: #5358AC; }
/* 蒙版加强：右侧插画退成淡纹理，不跟文字抢 */
.mg-hero::after {
  background: linear-gradient(94deg,
    rgba(250, 249, 255, .95) 0%,
    rgba(250, 249, 255, .88) 38%,
    rgba(250, 249, 255, .56) 64%,
    rgba(250, 249, 255, .16) 100%);
}
/* 黄色小标签与能力胶囊的硬影一并收掉 */
.mg-hero-k {
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9), 0 2px 0 #EBD79A;
}
.mg-hero-chips span {
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9), 0 2px 0 var(--sticker-wall, #E7E3F4);
}

/* ---------- 2. 游戏卡图标：同色描边 + 浅色厚度，替掉 2px 纯黑影 ---------- */
.mg-ico {
  border: 1.5px solid #E2DEF2;                 /* 不支持 color-mix 时的回退 */
  border-color: color-mix(in srgb, var(--gc, #5358AC) 26%, #FFFFFF);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .85),
    0 2px 0 #E7E3F4;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .85),
    0 2px 0 color-mix(in srgb, var(--gc, #5358AC) 12%, #FFFFFF);
}

/* ---------- 3. 悬停：只改边色与一层柔影，不位移（客户第 6 条） ---------- */
.mg-card:hover {
  background: #FFFFFF;
  border-color: #A8A1E6;
  transform: rotate(0);
}
.mg-opt:hover {
  background: #F4F5FF;
  border-color: #A8A1E6;
  transform: none;
}

/* ---------- 4. 游戏卡本身：白底 + 贴纸厚度 ---------- */
.mg-card {
  background: #FFFFFF;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .95),
    0 2px 0 #E7E3F4,
    0 14px 26px -18px rgba(58, 52, 140, .32);
}

/* ---------- 5. 分类小标题的品牌色竖条（跟首页一致） ---------- */
.mg-cat-t {
  position: relative;
  padding-left: 12px;
}
.mg-cat-t::before {
  content: "";
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 18px; border-radius: 99px;
  background: #5358AC;
}
/* ===== v6b 收口 ===== */


/* ===== v6c 年级卡按学段标记（左侧细色条 + 图标块加深，不整卡变色）===== */
.grade-card { position: relative; overflow: hidden; }
.grade-card::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px;
  width: 3px; border-radius: 0 99px 99px 0;
  background: var(--tier, #E08A12); opacity: .55;
}
.grade-card.gt-sprout { --tier: #E8A33C; }
.grade-card.gt-book   { --tier: #2BAE79; }
.grade-card.gt-tree   { --tier: #3B8FE0; }
.grade-card.gt-cap    { --tier: #7C5CFC; }
/* 图标块：底色加深一档，跟新徽章语言一致 */
.grade-icon { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 2px 0 rgba(0, 0, 0, .035); }
/* ===== v6c 收口 ===== */

/* ===== v8 hero：装饰纹样取代拼贴插画 =====
   实测容器只露出约 120px 高（白卡从 y=170 上盖），任何大主体都会被横向切断。
   改用「柔光 + 极淡斜纹」的 UI 背景语言：裁到任何位置都成立，且比散落小图标更精致。 */
.mg-hero {
  /* 生成图优先（--gen-bg-hero 由构建注入），没有时用下面这套代码渐变 */
  background-image: var(--gen-bg-hero,
    radial-gradient(120% 160% at 6% -22%, rgba(255, 255, 255, .92) 0%, rgba(255, 255, 255, 0) 58%),
    radial-gradient(88% 130% at 102% 4%, rgba(124, 92, 252, .26) 0%, rgba(124, 92, 252, 0) 64%),
    radial-gradient(76% 120% at 84% 112%, rgba(255, 183, 94, .38) 0%, rgba(255, 183, 94, 0) 62%),
    radial-gradient(62% 100% at 46% 118%, rgba(104, 214, 196, .16) 0%, rgba(104, 214, 196, 0) 60%),
    repeating-linear-gradient(118deg, rgba(124, 92, 252, .05) 0 1.4px, rgba(124, 92, 252, 0) 1.4px 15px),
    linear-gradient(134deg, #FFFCF4 0%, #FFF8EC 44%, #F8F3FF 100%)) !important;
  background-size: cover !important;
  background-position: center !important;
  border: 1.5px solid #E7E2F2 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .9),
    0 10px 26px -20px rgba(58, 52, 140, .34) !important;
}
/* 蒙版减弱：原来左侧 96% 不透明，纹理全被吃掉 */
.mg-hero::after {
  background: linear-gradient(94deg,
    rgba(255, 249, 238, .90) 0%,
    rgba(255, 249, 238, .74) 32%,
    rgba(255, 249, 238, .12) 60%,
    rgba(255, 249, 238, 0) 88%) !important;
}
/* 顶部小标签去掉硬厚度，跟全局语言一致 */
.mg-hero-k {
  border: 0 !important;
  box-shadow: 0 3px 9px -4px rgba(180, 130, 20, .45) !important;
  transform: rotate(-1.5deg);
}
.mg-hero-chips span {
  border: 0 !important;
  box-shadow: 0 2px 7px -3px rgba(83, 88, 172, .26) !important;
  background: rgba(255, 255, 255, .92);
}

/* hero 右角插图：生成图（--gen-art-hero）优先。
   之前这里是一个 168px 的「拼」字水印，属于代码装饰，换成实体插图后更耐看，
   且尺寸固定在露出的那条带子里，不会被白卡切断。 */
.mg-hero::before {
  content: "";
  position: absolute; right: 3%; top: 20px;
  width: 214px; height: 134px;
  background: var(--gen-art-hero, none) center / contain no-repeat;
  z-index: 1; pointer-events: none;
}
.mg-hero::after { z-index: 1 !important; }
.mg-hero-in { z-index: 2; }
@media (max-width: 640px) {
  .mg-hero::before { width: 186px; height: 116px; right: 3%; top: 24px; }
}

/* ===== v8 hero end ===== */

/* 桌面端完成页：宽卡片里 166px 的插图太小，按断点放大 */
@media (min-width: 900px) {
  .mg-done-art { width: 232px; height: 222px; margin-bottom: 16px; }
}

/* ============================================================
   v15 纸墨 —— 专项训练对齐品牌站
   外层白框、紫色 hero、旋转贴纸卡、彩色图标全部收掉。
   ============================================================ */

/* 外层那个把整页包起来的白框去掉，内容直接落在纸底上 */
.mg-shell, .mg-wrap, .mg-panel {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* hero：紫渐变 -> 白卡，标题粗黑 */
.mg-hero {
  background: #FFFFFF !important;
  background-image: none !important;
  border: 1px solid #ECE6DE !important;
  border-radius: 18px !important;
  box-shadow: 0 1px 2px rgba(74, 60, 45, .04),
              0 14px 28px -22px rgba(74, 60, 45, .32) !important;
}
.mg-hero::after { display: none !important; }
.mg-hero-t {
  font-family: var(--f-ui-disp) !important;
  font-weight: 800 !important;
  color: #1C1B1A !important;
  text-shadow: none !important;
  letter-spacing: -.01em;
}
.mg-hero-t em { color: #A8832F !important; font-style: normal; }
.mg-hero-s { color: #6E6862 !important; }
/* 黄色小标签 -> 品牌站的金色小标签 */
.mg-hero-k {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #A8832F !important;
  font-size: 11px !important;
  letter-spacing: .12em !important;
  padding: 0 0 0 24px !important;
  position: relative;
}
.mg-hero-k::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 16px; height: 1.5px;
  background: #A8832F;
  opacity: .65;
}
.mg-hero-chips span {
  background: #F5F1EA !important;
  color: #6E6862 !important;
  border: 0 !important;
}

/* 分类标题：竖线改金色，标题粗黑 */
.mg-cat-t {
  font-family: var(--f-ui-disp) !important;
  font-weight: 800 !important;
  color: #1C1B1A !important;
}
.mg-cat-t::before { background: #A8832F !important; }
.mg-cat-t small { color: #8A8178 !important; }
.mg-cat-art { display: none !important; }

/* 卡片：去掉旋转贴纸，统一白卡 */
.mg-card, .mg-card:nth-child(2n), .mg-card:nth-child(3n) {
  transform: none !important;
  background: #FFFFFF !important;
  border: 1px solid #ECE6DE !important;
  border-radius: 16px !important;
  box-shadow: 0 1px 2px rgba(74, 60, 45, .04),
              0 12px 24px -20px rgba(74, 60, 45, .30) !important;
}
.mg-card:hover {
  transform: translateY(-2px) !important;
  background: #FFFFFF !important;
  border-color: #DCD2F2 !important;
  box-shadow: 0 2px 4px rgba(74, 60, 45, .05),
              0 16px 26px -18px rgba(74, 60, 45, .38) !important;
}
.mg-card:active { transform: translateY(0) !important; }

/* 图标：淡紫 -> 统一暖灰 */
.mg-card .mg-ico, .mg-ico {
  background: #F3EFE8 !important;
  background-image: none !important;
  color: #6B6157 !important;
  border: 1px solid #E8E1D7 !important;
  box-shadow: none !important;
}
.mg-card .mg-ico svg, .mg-ico svg { color: #6B6157 !important; }
/* 题量小胶囊 */
.mg-card .mg-n, .mg-n, .mg-card-n {
  background: #F5F1EA !important;
  color: #8A8178 !important;
  border: 0 !important;
}

/* 外层 .mg 容器：冷紫底 + 大白框，让整页像贴在上面的一层，去掉 */
.mg {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
}
/* hero 右上角那张紫黄配色插画与纸墨语言冲突，撤掉，留白代替 */
.mg-hero::before { display: none !important; }
.mg-hero-in { max-width: 100% !important; }

/* 标题同样回到书写体 */
.mg-hero-t, .mg-cat-t {
  font-family: "KaiTi", "STKaiti", "Kaiti SC", "FangSong", "SimSun", serif !important;
  font-weight: 700 !important;
}

/* 专项训练 hero 右侧：暖陶插图（之前那张紫黄插画撤掉后留下的位置） */
.mg-hero { position: relative; overflow: hidden; }
.mg-hero::before {
  content: "" !important;
  display: block !important;
  position: absolute;
  right: 34px; top: 50%;
  width: 128px; height: 128px;
  transform: translateY(-50%);
  background: var(--gen-art-play, none) center / contain no-repeat !important;
  pointer-events: none;
  opacity: .96;
}
.mg-hero-in { max-width: 62% !important; }
@media (max-width: 640px) {
  .mg-hero::before { width: 84px; height: 84px; right: 12px; opacity: .9; }
  .mg-hero-in {
    max-width: 100% !important; padding-right: 88px !important;
    /* v8 时代「插画在上、纸卡在下」留下的 118px 上边距/纸卡底，
       v15 插画已移到右侧，这里必须清掉，否则手机顶部出现一条空白 */
    margin-top: 0 !important;
    background: transparent !important;
    border-top: 0 !important;
  }
}

/* v17 暖紫：专项训练同步 */
.mg-hero {
  background: #FEFDFF !important;
  border: 1px solid #E7E2F0 !important;
  box-shadow: 0 1px 2px rgba(58, 48, 86, .04),
              0 14px 28px -22px rgba(58, 48, 86, .34) !important;
}
.mg-card, .mg-card:nth-child(2n), .mg-card:nth-child(3n) {
  background: #FEFDFF !important;
  border: 1px solid #E7E2F0 !important;
  box-shadow: 0 1px 2px rgba(58, 48, 86, .04),
              0 12px 24px -20px rgba(58, 48, 86, .32) !important;
}
.mg-card .mg-ico, .mg-ico {
  background: linear-gradient(165deg, #F5F2FB 0%, #EDE8F6 100%) !important;
  border: 1px solid #E2DBEF !important;
  color: #6A6390 !important;
}
.mg-hero-chips span, .mg-card .mg-n, .mg-n { background: #F1EDF8 !important; color: #6B6478 !important; }
.mg-hero-t { color: #232030 !important; }
.mg-cat-t { color: #232030 !important; }

/* =========================================================================
   v18 · 小游戏「题目太小」两处（客户：拼音合成机 / 声音变变变）
   1) 合成机：站台牌从 11px 一行小字改成「站台 + 大字 + 拼音 + 读一读」，
      孩子不认识站台牌上的字时，点喇叭先听一遍再拼；
   2) 变声：dōng 冬 原来拼音和汉字同为 28px，现在拆开——拼音 30 / 汉字 46，
      让「要改的那个字」一眼看得见。
   ========================================================================= */
.mg-prompt { font-size: 20px; }

.mg-station {
  left: 22px; top: 16px;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 5px 8px 5px 12px;
  border-radius: 14px;
  transform: rotate(-2deg);
  white-space: nowrap;
  box-shadow: 0 2px 0 #E7E3F4;
}
.mg-station-lab {
  font-size: 10.5px; font-weight: 900; letter-spacing: .14em; color: var(--muted);
}
.mg-station-char {
  font-family: var(--f-disp); font-size: 36px; font-weight: 900;
  line-height: 1; letter-spacing: 0; color: var(--ink);
}
.mg-station-py {
  font-family: var(--f-disp); font-size: 16px; font-weight: 800;
  letter-spacing: 0; color: var(--ink);
}
.mg-station-play {
  display: grid; place-items: center;
  width: 30px; height: 30px; padding: 0; margin-left: 2px;
  border: 1.5px solid #DBD9E6; border-radius: 9px;
  background: #FFF7DC; color: var(--ink); cursor: pointer;
  box-shadow: 0 2px 0 #E7E3F4;
}
.mg-station-play:active { transform: translateY(1px); box-shadow: none; }
.mg-station-play .ico3d { width: 17px; height: 17px; }

.mg-swap-side b.mg-swap-word {
  display: inline-flex; align-items: baseline; gap: 10px;
  line-height: 1; letter-spacing: 0;
}
.mg-swap-py { font-family: var(--f-disp); font-size: 30px; font-weight: 900; }
.mg-swap-char { font-family: var(--f-disp); font-size: 46px; font-weight: 900; line-height: 1; }
.mg-swap-side b.q { font-size: 42px; }
.mg-wave { height: 52px; }
.mg-wave i { width: 6px; }

@media (max-width: 760px) {
  .mg-prompt { font-size: 17px; }
  .mg-station { left: 14px; top: 12px; padding: 4px 7px 4px 10px; gap: 7px; }
  .mg-station-lab { font-size: 9.5px; letter-spacing: .1em; }
  .mg-station-char { font-size: 30px; }
  .mg-station-py { font-size: 14px; }
  .mg-station-play { width: 26px; height: 26px; }
  .mg-station-play .ico3d { width: 15px; height: 15px; }
  .mg-swap { gap: 12px; padding: 12px 14px; }
  .mg-swap-py { font-size: 22px; }
  .mg-swap-char { font-size: 34px; }
  .mg-swap-side b.q { font-size: 32px; }
  .mg-wave { height: 40px; }
}

/* v21 · 声音变变变：汉字、听音、选择三者一一对应。
   「听读音」只发音，「选这个」才提交；拼音保持作答后揭晓。 */
.mg-opts.sound-opts {
  grid-template-columns: repeat(4, minmax(150px, 180px));
  gap: 14px;
}
.mg-opt.mg-opt-ear.mg-sound-option {
  display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start;
  min-height: 174px; padding: 14px 12px 12px; cursor: default;
  font-family: var(--f-body); text-align: center;
}
.mg-sound-char {
  display: grid; place-items: center; align-self: center;
  width: 68px; height: 68px; border-radius: 18px;
  background: linear-gradient(160deg, #FFFFFF 0%, #F1EDF9 100%);
  border: 1px solid #E4DEEE;
  font-family: var(--f-disp); font-size: 46px; font-weight: 900; line-height: 1;
  color: var(--ink); box-shadow: inset 0 1px 0 #FFF, 0 3px 8px rgba(75, 61, 118, .07);
}
.mg-opt-ear .mg-opt-syl {
  min-height: 25px; margin-top: 7px; opacity: 0;
  font-family: var(--f-body); font-size: 18px; font-weight: 800; line-height: 25px;
  transition: opacity .16s ease;
}
.mg-opt-ear.revealed .mg-opt-syl { opacity: 1; }
.mg-sound-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  width: 100%; margin-top: 9px;
}
.mg-ear-btn, .mg-pick-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
  min-width: 0; min-height: 44px; padding: 8px 6px;
  border-radius: 11px; font: inherit; font-size: 12.5px; font-weight: 800;
  white-space: nowrap; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}
.mg-ear-btn {
  border: 1px solid #DCD5EB; background: #F7F4FC; color: #554B78;
}
.mg-ear-btn .ico3d { flex: 0 0 auto; width: 19px; height: 19px; }
.mg-ear-btn:hover { background: #EEE8F8; border-color: #BDB2D9; }
.mg-pick-btn {
  border: 1px solid #585174; background: #585174; color: #FFF;
  box-shadow: 0 2px 0 #3F3957;
}
.mg-pick-btn:hover { background: #494260; }
.mg-ear-btn:active, .mg-pick-btn:active { transform: translateY(1px); }
.mg-ear-btn:disabled, .mg-pick-btn:disabled { opacity: .5; cursor: default; transform: none; }
.mg-opt.mg-opt-ear.listening {
  background: #F8F5FE; border-color: #A99BC9;
  box-shadow: 0 0 0 3px rgba(107, 88, 158, .10), var(--hard-sm);
}
.mg-opt-ear.listening .mg-ear-btn { background: #E9E1F6; border-color: #A999C7; }
.mg-sound-option.ok .mg-sound-char { background: #EDF9F1; border-color: #A9D9BA; color: var(--ok); }
.mg-sound-option.bad .mg-sound-char { background: #FFF1EF; border-color: #E9B4AE; color: var(--bad); }
.mg-swap-side b.q { display: inline-flex; align-items: baseline; gap: 8px; }
.mg-swap-result-char { font-family: var(--f-disp); font-size: 46px; }
.mg-swap-result-py { font-family: var(--f-body); font-size: 20px; font-weight: 800; }
.mg-pick-hint {
  margin-top: 12px; text-align: center;
  font-size: 13px; font-weight: 700; line-height: 1.6; color: var(--muted);
}
@media (max-width: 900px) {
  .mg-opts.sound-opts { grid-template-columns: repeat(2, minmax(0, 220px)); gap: 12px; }
}
@media (max-width: 480px) {
  .mg-ear-btn { flex-direction: column; gap: 2px; min-height: 50px; }
  .mg-pick-btn { min-height: 50px; }
}
@media (max-width: 380px) {
  .mg-opts.sound-opts { gap: 10px; }
  .mg-opt.mg-opt-ear.mg-sound-option { min-height: 166px; padding: 12px 8px 10px; }
  .mg-sound-char { width: 60px; height: 60px; font-size: 42px; }
  .mg-sound-actions { gap: 6px; }
  .mg-ear-btn, .mg-pick-btn { padding: 7px 3px; font-size: 11.5px; }
  .mg-ear-btn .ico3d { width: 17px; height: 17px; }
  .mg-swap-result-char { font-size: 34px; }
  .mg-swap-result-py { font-size: 16px; }
}

/* v18 · 答对后的字义卡（客户：答对时显示这个字的字义）
   反馈条允许换行：第一行「✓ 答对了」，第二行一张字义卡 + 继续按钮 */
.mg-feedback { flex-wrap: wrap; }
.mg-fb-note {
  flex: 1 1 100%;
  display: flex; align-items: center; gap: 10px;
  margin-top: 4px; padding: 9px 12px;
  background: #FFFDF6; border: 1.5px solid #DBD9E6; border-radius: 14px;
  color: var(--ink); text-align: left;
  box-shadow: 0 2px 0 #E7E3F4;
}
.mg-fb-note b {
  display: inline-flex; align-items: baseline; gap: 6px; flex: 0 0 auto;
  font-family: var(--f-disp); font-size: 26px; font-weight: 900; line-height: 1;
}
.mg-fb-note b i { font-style: normal; font-size: 12px; font-weight: 800; color: var(--muted); }
.mg-fb-note u {
  text-decoration: none; font-size: 13px; font-weight: 900;
  padding: 2px 8px; border-radius: 99px; background: #F1EDF8; color: #6B6478;
  white-space: nowrap;
}
.mg-fb-note em {
  flex: 1 1 auto; min-width: 0;
  font-style: normal; font-size: 13.5px; font-weight: 700; color: var(--ink); line-height: 1.55;
}
.mg-fb-note.multi { align-items: flex-start; }
.mg-fb-note.multi > b { margin-top: 5px; }
.mg-fb-senses { flex: 1 1 auto; min-width: 0; display: grid; gap: 5px; }
.mg-fb-sense { display: flex; align-items: center; gap: 9px; min-width: 0; }
.mg-fb-sense u { flex: 0 0 auto; }
.mg-fb-sense em { line-height: 1.4; }
.mg-fb-cont {
  flex: 0 0 auto; margin-left: auto; padding: 8px 16px;
  border: 1.5px solid #DBD9E6; border-radius: 12px;
  background: var(--yellow); color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 900; cursor: pointer;
  box-shadow: 0 2px 0 #E7E3F4;
}
.mg-fb-cont:active { transform: translateY(1px); box-shadow: none; }

@media (max-width: 760px) {
  .mg-fb-note { flex-wrap: wrap; gap: 6px 8px; padding: 8px 10px; }
  .mg-fb-note b { font-size: 22px; }
  .mg-fb-note em { flex: 1 1 100%; font-size: 12.5px; }
  .mg-fb-note.multi .mg-fb-senses { flex: 1 1 100%; order: 3; }
  .mg-fb-note.multi .mg-fb-cont { order: 2; }
  .mg-fb-sense { align-items: flex-start; gap: 7px; }
  .mg-fb-sense em { flex: 1 1 auto; }
  .mg-fb-cont { margin-left: 0; }
}

/* v18 · 专项训练难度：三档胶囊，和 hero 里其它小标签同一套语言 */
.mg-diff { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.mg-diff-lab {
  font-size: 12px; font-weight: 900; letter-spacing: .12em; color: var(--muted);
}
.mg-diff-btn {
  padding: 6px 14px; border-radius: 99px;
  border: 1.5px solid #DBD9E6; background: #fff; color: var(--ink);
  font-family: var(--f-disp); font-size: 13.5px; font-weight: 900; cursor: pointer;
  box-shadow: 0 2px 0 #E7E3F4;
}
.mg-diff-btn:active { transform: translateY(1px); box-shadow: none; }
.mg-diff-btn.on { background: var(--yellow); border-color: #E4C97E; }
.mg-diff-tip { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }

/* 答对/机会用完后，未选中的控件明确变淡；正确项保持高亮 */
.mg-opt:disabled:not(.ok):not(.bad) { opacity: .55; }
.mg-cell:disabled:not(.ok):not(.bad) { opacity: .55; }
.mg-li:disabled:not(.ok) { opacity: .5; }
.mg-chip:disabled:not(.ok) { opacity: .5; }
.mg-stroke:disabled:not(.used) { opacity: .5; }

/* 自选题库：按年级分组；手机一行一册，桌面七列矩阵 */
.mg-custom {
  margin-top: 12px; padding: 14px 14px 12px;
  border: 1.5px solid #E7E3F4; border-radius: 18px; background: #FBFAFF;
}
.mg-custom-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800; color: var(--muted); }
.mg-custom-head b { color: var(--ink); font-size: 13.5px; }
.mg-custom-head em { font-style: normal; color: #5358AC; font-weight: 900; }
.mg-cv-all {
  margin-left: auto; border: 0; background: none; color: #5358AC;
  font-size: 12px; font-weight: 800; cursor: pointer; padding: 4px 6px;
}
.mg-cv-all:disabled { color: var(--muted); cursor: default; opacity: .62; }
.mg-custom-grades { display: grid; gap: 7px; margin-top: 11px; }
.mg-grade { display: grid; grid-template-columns: 48px minmax(0, 1fr); align-items: center; gap: 8px; }
.mg-grade-lab { font-size: 11.5px; font-weight: 800; color: var(--muted); letter-spacing: .02em; white-space: nowrap; }
.mg-grade-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.mg-cv {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: center;
  min-height: 46px; padding: 7px 12px; border: 1.5px solid #DBD9E6; border-radius: 12px;
  background: #fff; cursor: pointer; font-family: var(--f-body); color: var(--ink);
  transition: background .12s ease, border-color .12s ease, transform .12s ease;
}
.mg-cv b { display: block; font-size: 13px; font-weight: 900; line-height: 1.2; }
.mg-cv span { display: block; font-size: 10.5px; color: var(--muted); margin-top: 1px; }
.mg-cv.on { background: #FFF4C8; border-color: #E4C97E; box-shadow: 0 2px 0 #E9D79B; }
.mg-cv.on span { color: #8A6A1F; }
.mg-cv-tick {
  display: none; position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-style: normal; font-size: 13px; font-weight: 900; color: #B07A12;
}
.mg-cv.on .mg-cv-tick { display: block; }
.mg-cv:active { transform: scale(.985); }
.mg-cv:disabled { opacity: .42; cursor: not-allowed; box-shadow: none; }
.mg-custom-tip { margin-top: 10px; font-size: 11px; line-height: 1.5; color: var(--muted); }

@media (max-width: 760px) {
  .mg-custom { padding: 12px; }
  .mg-grade { grid-template-columns: 44px minmax(0, 1fr); gap: 7px; }
  .mg-grade-lab { font-size: 11px; }
  .mg-cv { min-height: 44px; padding: 6px 10px; }
  .mg-cv b { font-size: 12.5px; }
  .mg-cv span { font-size: 10px; }
  .mg-cv-tick { right: 8px; font-size: 12px; }

  /* 手机 hero 三个标签等宽一行，不再 2+1 折行 */
  .mg-hero-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .mg-hero-chips span { text-align: center; padding: 4px 4px; font-size: 10px; white-space: nowrap; }

  /* 难度：标签一行，四个按钮等宽一行，说明一行 */
  .mg-diff { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; align-items: stretch; }
  .mg-diff-lab { grid-column: 1 / -1; }
  .mg-diff-btn { min-width: 0; padding: 8px 4px; text-align: center; }
  .mg-diff-tip { grid-column: 1 / -1; margin-top: 1px; line-height: 1.5; }

  /* 6上/6下 笔顺题会有 7–8 画：缩小瓦片让 4 个一行，避免第三行掉到导航栏后面 */
  .mg-stroke { width: 64px; height: 72px; }
  .mg-stroke svg { width: 44px; height: 44px; }
  .mg-order-ans .mg-slot { width: 60px; height: 64px; }
  .mg-order-ans .mg-slot svg { width: 40px; height: 40px; }
  /* 压缩纵向间距，保证 8 画时“确认笔顺”仍在底栏上方 */
  .mg-order-main { gap: 10px; }
  .mg-order-lab { margin-bottom: 6px; }
  .mg-order-ans { padding: 8px; gap: 8px; }
  .mg-order-pool { padding: 10px; gap: 10px; }
}

@media (min-width: 761px) {
  .mg-custom-grades { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
  .mg-grade { grid-template-columns: minmax(0, 1fr); gap: 5px; align-items: start; }
  .mg-grade-lab { text-align: center; }
  .mg-grade-chips { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .mg-cv { align-items: center; text-align: center; padding: 6px 8px; }
  .mg-cv-tick { display: none !important; }
}

@media (max-width: 380px) {
  /* 360 宽再缩一档，8 画也能 4 个一行，不把提交按钮推到屏幕外 */
  .mg-stroke { width: 58px; height: 62px; }
  .mg-stroke svg { width: 38px; height: 38px; }
  .mg-order-ans .mg-slot { width: 54px; height: 56px; }
  .mg-order-ans .mg-slot svg { width: 36px; height: 36px; }
  .mg-order-pool { gap: 9px; }
}

.mg-card.is-empty { opacity: .5; }
.mg-card.is-empty:hover { transform: none; box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26); }

