/* =========================================================
   小聚光 · Spotlight
   舒尔特专注力训练 H5 —— 视觉系统
   配色：暖木质米黄底 + 品牌橙红 + 三色功能点缀（蓝/黄/绿）
   ========================================================= */

/* ---------- 1. 设计令牌 ---------- */
:root{
  /* 底色系 */
  --bg:          #FFF9F2;
  --bg-deep:     #FDF0E0;
  --surface:     #FFFFFF;
  --surface-2:   #FFF6EC;
  --surface-3:   #FDEBDC;

  /* 品牌色 */
  --brand:       #FF5A3C;
  --brand-deep:  #E8432E;
  --brand-soft:  #FFE7DF;
  --brand-glow:  rgba(255,90,60,.34);

  /* 功能色 */
  --blue:        #3EA7E8;
  --blue-soft:   #E3F3FD;
  --yellow:      #FFC93C;
  --yellow-soft: #FFF5DA;
  --green:       #63BE3C;
  --green-soft:  #E9F7E0;
  --purple:      #9B6BE8;
  --purple-soft: #F1E9FD;

  /* 文字 */
  --text:        #2E2117;
  --text-2:      #8A7A6D;
  --text-3:      #B6A79A;

  /* 线 & 阴影 */
  --line:        rgba(180,120,80,.14);
  --line-strong: rgba(180,120,80,.26);
  --sh-1: 0 2px 8px rgba(158,96,54,.07);
  --sh-2: 0 8px 24px rgba(158,96,54,.10);
  --sh-3: 0 16px 44px rgba(158,96,54,.16);

  /* 圆角 */
  --r-xl: 26px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --r-pill: 999px;

  /* 尺寸 */
  --tabbar-h: 60px;
  --pad: 18px;

  /* 游戏页里「非游戏区」占掉的总高度：顶部 appbar + 题目标题 + 任务提示条 + 底部安全留白。
     实测值约 205px。网格尺寸要用它来算「高度还剩多少可用」——
     只按宽度算的话，小屏（360×640）会把网格挤出屏幕，大屏又会白白浪费下方空间。 */
  --game-chrome: 210px;
  /* 游戏区左右留白：比常规 --pad 小，把省下的宽度全给卡片（儿童手指需要更大的点击区） */
  --game-pad: 12px;

  --ease: cubic-bezier(.22,.9,.28,1);
  --ease-back: cubic-bezier(.34,1.56,.64,1);
  --ease-out: cubic-bezier(.16,1,.3,1);
}

/* ---------- 2. 重置 ---------- */
*,*::before,*::after{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family:"PingFang SC","HarmonyOS Sans SC","MiSans","Microsoft YaHei",-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  font-size:15px;
  line-height:1.5;
  color:var(--text);
  background:var(--bg-deep);
  -webkit-font-smoothing:antialiased;
  -webkit-tap-highlight-color:transparent;
  overscroll-behavior:none;
}
button{ font-family:inherit; font-size:inherit; color:inherit; border:0; background:none; cursor:pointer; padding:0; }
h1,h2,h3,h4,p{ margin:0; }
ul{ margin:0; padding:0; list-style:none; }
input{ font-family:inherit; }
:focus-visible{ outline:2px solid var(--brand); outline-offset:2px; border-radius:6px; }

/* ---------- 3. 应用外壳 ---------- */
#shell{ height:100%; }
#phone{
  position:relative;
  width:100%;
  height:100%;
  display:flex;
  flex-direction:column;
  background:var(--bg);
  overflow:hidden;
}
#app{
  position:relative;
  flex:1;
  min-height:0;
  display:flex;
  flex-direction:column;
  background:
    radial-gradient(680px 340px at 14% -8%, #FFE8D5 0%, rgba(255,232,213,0) 68%),
    radial-gradient(560px 320px at 96% 4%,  #FFEFD2 0%, rgba(255,239,210,0) 62%),
    radial-gradient(700px 400px at 50% 108%, #FFF1E2 0%, rgba(255,241,226,0) 70%),
    var(--bg);
}
#app::before{ /* 细腻网格纹理 */
  content:''; position:absolute; inset:0; pointer-events:none; opacity:.5;
  background-image:radial-gradient(rgba(190,140,100,.13) 1px, transparent 1.2px);
  background-size:18px 18px;
  mask-image:radial-gradient(120% 90% at 50% 40%, #000 30%, transparent 100%);
}

.view{
  position:relative;
  z-index:1;
  flex:1;
  min-height:0;
  overflow-y:auto;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
  padding-bottom:calc(24px + env(safe-area-inset-bottom,0px));
}
.view.no-tabbar{ padding-bottom:0; }

/* 拟真状态栏（仅桌面手机壳模式显示） */
.fake-status{
  display:none;
  height:44px;
  padding:0 26px;
  flex:0 0 auto;
  align-items:center;
  justify-content:space-between;
  font-size:13px;
  font-weight:600;
  color:var(--text);
  background:transparent;
  position:relative; z-index:3;
}
.fs-notch{
  position:absolute; left:50%; top:8px; transform:translateX(-50%);
  width:98px; height:26px; border-radius:var(--r-pill);
  background:#17110E;
}
.fs-right{ letter-spacing:1px; font-size:11px; }

/* 底部导航显隐：display:flex 会覆盖 UA 的 [hidden]，必须显式声明 */
.tabbar[hidden]{ display:none !important; }

/* ---------- 4. 底部导航 ---------- */
.tabbar{
  position:relative;
  z-index:5;
  flex:0 0 auto;
  height:calc(var(--tabbar-h) + env(safe-area-inset-bottom,0px));
  padding-bottom:env(safe-area-inset-bottom,0px);
  display:flex;
  background:rgba(255,255,255,.9);
  backdrop-filter:blur(16px) saturate(1.4);
  -webkit-backdrop-filter:blur(16px) saturate(1.4);
  border-top:1px solid var(--line);
}
.tab{
  flex:1;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
  color:var(--text-3);
  transition:color .22s var(--ease);
  position:relative;
}
.tab-ico{ display:grid; place-items:center; transition:transform .32s var(--ease-back); }
.tab-txt{ font-size:11px; font-weight:600; letter-spacing:.4px; }
.tab.on{ color:var(--brand); }
.tab.on .tab-ico{ transform:translateY(-2px) scale(1.1); }
.tab.on::before{
  content:''; position:absolute; top:5px; width:28px; height:3px; border-radius:2px;
  background:linear-gradient(90deg,var(--brand),var(--yellow));
  animation:tabIn .34s var(--ease-back) both;
}
@keyframes tabIn{ from{ transform:scaleX(.2); opacity:0 } to{ transform:scaleX(1); opacity:1 } }
.tab:active .tab-ico{ transform:scale(.9); }

/* ---------- 5. 通用组件 ---------- */
.page{ animation:pageIn .38s var(--ease-out) both; }
@keyframes pageIn{ from{ opacity:0; transform:translateY(14px) scale(.985) } to{ opacity:1; transform:none } }

.pad{ padding:0 var(--pad); }

.appbar{
  position:sticky; top:0; z-index:20;
  display:flex; align-items:center; gap:10px;
  padding:14px var(--pad) 12px;
  background:linear-gradient(180deg, rgba(255,249,242,.96) 62%, rgba(255,249,242,0));
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}
.appbar h1{ font-size:17px; font-weight:800; letter-spacing:.3px; }
.appbar .sub{ font-size:11.5px; color:var(--text-2); font-weight:500; }
.appbar-spacer{ flex:1; }

.icon-btn{
  width:38px; height:38px; flex:0 0 auto;
  display:grid; place-items:center;
  border-radius:var(--r-md);
  background:var(--surface);
  box-shadow:var(--sh-1);
  color:var(--text);
  transition:transform .2s var(--ease-back), box-shadow .2s;
}
.icon-btn:active{ transform:scale(.9); box-shadow:none; }

.card{
  background:var(--surface);
  border-radius:var(--r-lg);
  box-shadow:var(--sh-1);
  border:1px solid rgba(255,255,255,.9);
  padding:16px;
}
.card + .card{ margin-top:12px; }

.btn{
  position:relative;
  display:inline-flex; align-items:center; justify-content:center; gap:7px;
  height:50px; padding:0 22px;
  border-radius:var(--r-pill);
  font-weight:700; font-size:15.5px; letter-spacing:.4px;
  transition:transform .18s var(--ease-back), box-shadow .22s, filter .2s;
  overflow:hidden;
  user-select:none;
}
.btn:active{ transform:scale(.965); }
.btn-primary{
  color:#fff;
  background:linear-gradient(135deg,#FF7A4D 0%, var(--brand) 46%, var(--brand-deep) 100%);
  box-shadow:0 8px 20px -4px var(--brand-glow), inset 0 1px 0 rgba(255,255,255,.34);
}
.btn-primary::after{
  content:''; position:absolute; top:0; left:-60%; width:45%; height:100%;
  background:linear-gradient(100deg,rgba(255,255,255,0),rgba(255,255,255,.5),rgba(255,255,255,0));
  transform:skewX(-18deg);
  animation:sheen 3.4s ease-in-out infinite;
}
@keyframes sheen{ 0%,72%{ left:-60% } 92%,100%{ left:130% } }
.btn-ghost{
  color:var(--text); background:var(--surface);
  box-shadow:var(--sh-1); border:1px solid var(--line);
}
.btn-block{ width:100%; }
.btn-sm{ height:38px; padding:0 15px; font-size:13.5px; }

.chip{
  display:inline-flex; align-items:center; gap:4px;
  height:26px; padding:0 10px;
  border-radius:var(--r-pill);
  font-size:11.5px; font-weight:700;
  background:var(--surface-2); color:var(--text-2);
}
.chip.brand{ background:var(--brand-soft); color:var(--brand-deep); }
.chip.blue{ background:var(--blue-soft); color:#1E7DB8; }
.chip.green{ background:var(--green-soft); color:#3E8F22; }
.chip.yellow{ background:var(--yellow-soft); color:#B57900; }

.sec-title{
  display:flex; align-items:baseline; gap:8px;
  margin:22px 0 11px;
  font-size:16px; font-weight:800; letter-spacing:.2px;
}
.sec-title small{ font-size:11.5px; font-weight:600; color:var(--text-3); letter-spacing:0; }

.stars{ display:inline-flex; gap:2px; font-size:12px; color:var(--yellow); }
.stars .off{ color:var(--line-strong); }

.empty{
  padding:44px 20px; text-align:center; color:var(--text-3); font-size:13.5px;
}
.empty-ico{ font-size:38px; display:block; margin-bottom:10px; opacity:.5; }

/* Toast */
.toast{
  position:fixed; left:50%; bottom:calc(84px + env(safe-area-inset-bottom,0px));
  transform:translate(-50%,18px);
  z-index:200;
  padding:10px 18px;
  border-radius:var(--r-pill);
  background:rgba(46,33,23,.92);
  color:#fff; font-size:13.5px; font-weight:600;
  box-shadow:0 10px 28px rgba(0,0,0,.22);
  opacity:0; pointer-events:none;
  transition:opacity .26s, transform .34s var(--ease-back);
  max-width:80vw; text-align:center;
}
.toast.on{ opacity:1; transform:translate(-50%,0); }

/* 底部弹出面板 */
.sheet-mask{
  position:absolute; inset:0; z-index:120;
  background:rgba(46,33,23,.42);
  backdrop-filter:blur(3px);
  -webkit-backdrop-filter:blur(3px);
  opacity:0; transition:opacity .3s;
}
.sheet-mask.on{ opacity:1; }
.sheet{
  position:absolute; left:0; right:0; bottom:0; z-index:121;
  background:var(--surface);
  border-radius:var(--r-xl) var(--r-xl) 0 0;
  padding:10px 18px calc(24px + env(safe-area-inset-bottom,0px));
  box-shadow:0 -12px 40px rgba(120,70,40,.2);
  transform:translateY(102%);
  transition:transform .42s var(--ease-out);
  max-height:88%;
  overflow-y:auto;
}
.sheet.on{ transform:none; }
.sheet-grip{ width:40px; height:4px; border-radius:2px; background:var(--line-strong); margin:2px auto 12px; }
.sheet h3{ font-size:17px; font-weight:800; margin-bottom:4px; }
.sheet .desc{ font-size:12.5px; color:var(--text-2); line-height:1.6; }

/* 难度选择行 */
.lv-row{
  display:flex; align-items:center; gap:12px;
  width:100%; padding:13px 14px; margin-top:10px;
  border-radius:var(--r-md);
  background:var(--surface-2);
  border:1.5px solid transparent;
  transition:transform .18s var(--ease-back), border-color .2s, background .2s;
  text-align:left;
}
.lv-row:active{ transform:scale(.975); }
.lv-row.sel{ border-color:var(--brand); background:var(--brand-soft); }
.lv-badge{
  width:40px; height:40px; flex:0 0 auto; border-radius:12px;
  display:grid; place-items:center;
  font-weight:800; font-size:13px; color:#fff;
  background:linear-gradient(140deg,var(--brand),var(--brand-deep));
}
.lv-row[data-lv="2"] .lv-badge{ background:linear-gradient(140deg,#59B6EC,#2E8FCE); }
.lv-row[data-lv="3"] .lv-badge{ background:linear-gradient(140deg,#9E76EA,#7443D4); }
.lv-row[data-lv="4"] .lv-badge{ background:linear-gradient(140deg,#4E4A8F,#2E2A63); }
.lv-meta{ flex:1; min-width:0; }
.lv-meta b{ display:block; font-size:14.5px; font-weight:700; }
.lv-meta span{ font-size:11.5px; color:var(--text-2); }
.lv-best{ font-size:11px; font-weight:700; color:var(--brand-deep); text-align:right; }

/* ---------- 6. 首页 ---------- */
.hero{
  position:relative;
  margin:6px var(--pad) 0;
  padding:20px;
  border-radius:var(--r-xl);
  color:#fff;
  background:linear-gradient(140deg,#FF8355 0%,var(--brand) 42%,var(--brand-deep) 100%);
  box-shadow:0 16px 36px -12px var(--brand-glow), inset 0 1px 0 rgba(255,255,255,.3);
  overflow:hidden;
}
.hero::before{
  content:''; position:absolute; right:-38px; top:-46px;
  width:150px; height:150px; border-radius:50%;
  background:radial-gradient(circle at 34% 34%, rgba(255,255,255,.42), rgba(255,255,255,.04) 70%);
}
.hero::after{
  content:''; position:absolute; right:34px; bottom:-58px;
  width:104px; height:104px; border-radius:50%;
  border:14px solid rgba(255,255,255,.14);
}
.hero-top{ display:flex; align-items:center; gap:9px; font-size:12px; opacity:.95; font-weight:600; }
.hero h2{ position:relative; margin:12px 0 4px; font-size:23px; font-weight:900; letter-spacing:.4px; line-height:1.24; }
.hero p{ position:relative; font-size:12.5px; opacity:.9; margin-bottom:16px; }
.hero-actions{ position:relative; display:flex; gap:10px; align-items:center; }
.hero-actions .btn{
  background:#fff; color:var(--brand-deep);
  box-shadow:0 8px 18px -6px rgba(120,40,20,.5);
  font-weight:800;
}
.hero-actions .btn.mini{
  background:rgba(255,255,255,.2); color:#fff;
  box-shadow:none; border:1px solid rgba(255,255,255,.42);
  backdrop-filter:blur(4px);
}
.today-ring{
  margin-left:auto; display:grid; place-items:center;
  width:62px; height:62px; border-radius:50%;
  background:conic-gradient(rgba(255,255,255,.95) var(--p,0deg), rgba(255,255,255,.24) 0deg);
  position:relative;
}
.today-ring::before{ content:''; position:absolute; inset:6px; border-radius:50%; background:rgba(232,67,46,.92); }
.today-ring b{ position:relative; font-size:14px; font-weight:900; }
.today-ring i{ position:relative; font-size:8.5px; font-style:normal; opacity:.85; display:block; text-align:center; margin-top:-2px; }

.quick-grid{ display:grid; grid-template-columns:1fr 1fr; gap:11px; }
.q-card{
  position:relative;
  padding:15px 14px 14px;
  border-radius:var(--r-lg);
  background:var(--surface);
  box-shadow:var(--sh-1);
  border:1px solid rgba(255,255,255,.9);
  transition:transform .2s var(--ease-back), box-shadow .22s;
  text-align:left;
  overflow:hidden;
}
.q-card:active{ transform:scale(.97); box-shadow:var(--sh-2); }
.q-card::after{
  content:''; position:absolute; right:-18px; top:-18px;
  width:64px; height:64px; border-radius:50%;
  opacity:.14; background:var(--c,var(--brand));
}
.q-ico{
  width:38px; height:38px; border-radius:13px;
  display:grid; place-items:center;
  font-size:19px; margin-bottom:9px;
  background:var(--cs,var(--brand-soft));
  box-shadow:inset 0 -2px 0 rgba(0,0,0,.05);
}
.q-card b{ display:block; font-size:14.5px; font-weight:800; letter-spacing:.2px; }
.q-card span{ display:block; font-size:11px; color:var(--text-2); margin-top:3px; line-height:1.45; }
.q-card .q-foot{ display:flex; align-items:center; gap:6px; margin-top:9px; }
.q-bar{ flex:1; height:4px; border-radius:2px; background:var(--surface-3); overflow:hidden; }
.q-bar i{ display:block; height:100%; border-radius:2px; background:var(--c,var(--brand)); width:0; transition:width .7s var(--ease-out); }

/* 推荐横滑 */
.hscroll{
  display:flex; gap:11px; overflow-x:auto; padding:2px var(--pad) 6px;
  scroll-snap-type:x mandatory; scrollbar-width:none;
}
.hscroll::-webkit-scrollbar{ display:none; }
.r-card{
  flex:0 0 auto; width:152px; scroll-snap-align:start;
  padding:14px; border-radius:var(--r-lg);
  background:var(--surface); box-shadow:var(--sh-1);
  border:1px solid rgba(255,255,255,.9);
  text-align:left;
  transition:transform .2s var(--ease-back);
}
.r-card:active{ transform:scale(.96); }
.r-card .r-top{ display:flex; align-items:center; justify-content:space-between; margin-bottom:9px; }
.r-ico{ width:32px; height:32px; border-radius:10px; display:grid; place-items:center; font-size:16px; }
.r-card b{ display:block; font-size:13.5px; font-weight:800; }
.r-card p{ font-size:10.5px; color:var(--text-2); margin-top:3px; height:28px; overflow:hidden; line-height:1.4; }

/* ---------- 7. 题型列表页 ---------- */
.dim-head{
  position:relative; margin:6px var(--pad) 4px; padding:18px;
  border-radius:var(--r-xl); color:#fff; overflow:hidden;
  background:linear-gradient(140deg,var(--c1),var(--c2));
  box-shadow:0 14px 30px -14px rgba(120,70,40,.5);
}
.dim-head::after{
  content:''; position:absolute; right:-24px; bottom:-40px;
  width:120px; height:120px; border-radius:50%; background:rgba(255,255,255,.13);
}
.dim-head .dh-ico{ font-size:30px; }
.dim-head h2{ font-size:19px; font-weight:900; margin-top:6px; letter-spacing:.4px; }
.dim-head p{ font-size:12px; opacity:.92; margin-top:5px; line-height:1.6; }
.dim-head .dh-stat{ display:flex; gap:16px; margin-top:13px; font-size:11px; }
.dim-head .dh-stat b{ font-size:16px; font-weight:900; display:block; }

.g-list{ margin-top:12px; }
.g-item{
  display:flex; align-items:center; gap:13px; width:100%;
  padding:14px; margin-bottom:11px;
  border-radius:var(--r-lg); background:var(--surface);
  box-shadow:var(--sh-1); border:1px solid rgba(255,255,255,.9);
  text-align:left;
  transition:transform .2s var(--ease-back), box-shadow .24s;
}
.g-item:active{ transform:scale(.978); box-shadow:var(--sh-2); }
.g-ico{
  width:46px; height:46px; flex:0 0 auto; border-radius:15px;
  display:grid; place-items:center; font-size:22px;
  background:var(--c1); box-shadow:inset 0 -2px 0 rgba(0,0,0,.06);
}
.g-body{ flex:1; min-width:0; }
.g-body b{ display:block; font-size:15px; font-weight:800; letter-spacing:.2px; }
.g-body span{ display:block; font-size:11.5px; color:var(--text-2); margin-top:3px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.g-body .g-tags{ display:flex; gap:5px; margin-top:7px; flex-wrap:wrap; }
.g-arrow{ color:var(--text-3); flex:0 0 auto; }

/* ---------- 8. 游戏页 ---------- */
.game-head{
  position:sticky; top:0; z-index:20;
  padding:12px var(--pad) 10px;
  background:linear-gradient(180deg, rgba(255,249,242,.97) 66%, rgba(255,249,242,0));
  backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px);
}
.gh-row{ display:flex; align-items:center; gap:10px; }
.gh-title{ flex:1; min-width:0; }
.gh-title b{ display:block; font-size:15px; font-weight:800; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.gh-title span{ font-size:11px; color:var(--text-2); }
.timer{
  display:flex; align-items:baseline; gap:2px;
  font-variant-numeric:tabular-nums; font-weight:900;
  padding:5px 11px; border-radius:var(--r-pill);
  background:var(--surface); box-shadow:var(--sh-1);
  font-size:16px; letter-spacing:.4px;
}
.timer.urgent{ color:var(--brand-deep); animation:pulseUrgent .9s ease-in-out infinite; }
.timer i{ font-size:10px; font-weight:700; font-style:normal; color:var(--text-3); }
@keyframes pulseUrgent{ 50%{ transform:scale(1.07) } }

.progress{ height:5px; border-radius:3px; background:var(--surface-3); overflow:hidden; margin-top:9px; }
.progress i{
  display:block; height:100%; width:0; border-radius:3px;
  background:linear-gradient(90deg,var(--brand),var(--yellow));
  transition:width .3s var(--ease-out);
}

.task-bar{
  margin:10px var(--pad) 0;
  padding:12px 15px;
  border-radius:var(--r-lg);
  background:linear-gradient(120deg,#FFF4E9,#FFE9DC);
  border:1px solid rgba(255,90,60,.18);
  display:flex; align-items:center; gap:11px;
}
.task-now{
  flex:0 0 auto; min-width:56px; height:56px; padding:0 10px;
  border-radius:var(--r-md);
  display:grid; place-items:center;
  background:linear-gradient(140deg,var(--brand),var(--brand-deep));
  color:#fff; font-weight:900; font-size:24px; letter-spacing:.5px;
  box-shadow:0 6px 16px -6px var(--brand-glow);
  animation:nowIn .34s var(--ease-back) both;
}
@keyframes nowIn{ from{ transform:scale(.7); opacity:0 } to{ transform:none; opacity:1 } }
.task-now.pop{ animation:popNow .4s var(--ease-back); }
@keyframes popNow{ 0%{ transform:scale(1) } 42%{ transform:scale(1.22) } 100%{ transform:scale(1) } }
.task-txt{ flex:1; min-width:0; }
.task-txt b{ display:block; font-size:13.5px; font-weight:800; }
.task-txt span{ display:block; font-size:11px; color:var(--text-2); margin-top:2px; line-height:1.45; }
.task-live{ font-size:11.5px; font-weight:800; color:var(--brand-deep); font-variant-numeric:tabular-nums; }

/* 舞台 */
.stage{ padding:14px var(--pad) 0; display:flex; flex-direction:column; align-items:center; }

/* 舒尔特网格 */
.grid{
  display:grid;
  gap:var(--gap,7px);
  /* 尺寸同时受「可用宽度」和「可用高度」约束，取较小者：
     - 小屏（如 360×640）：高度成为瓶颈 → 自动缩小，不再溢出屏幕
     - 大屏（如 430×932）：宽度成为瓶颈 → 把剩下的高度留给居中留白
     用 svh 而不是 vh：移动端地址栏收起/展开时 vh 会跳，svh 是稳定的小视口高度。 */
  width:min(calc(100vw - 2 * var(--game-pad)),
            calc(100svh - var(--game-chrome)));
  max-width:406px;
  aspect-ratio:1;
  padding:var(--gap,7px);
  border-radius:var(--r-xl);
  background:linear-gradient(150deg,#FFFFFF,#FFF6EC);
  box-shadow:var(--sh-2), inset 0 0 0 1px rgba(255,255,255,.9);
  user-select:none; touch-action:manipulation;
  /* 剩余空间在左右均分，让网格始终居中 */
  margin-inline:auto;
}
.grid.sm{
  width:min(calc(100vw - 2 * var(--game-pad)),
            calc(100svh - var(--game-chrome) - 40px));
  max-width:330px;
}
/* 字号跟着「网格宽度」等比缩放，而不是写死 px。
   这样窗口变小、或网格因为高度不够被整体缩小时，字会同步缩小，
   不会撑破格子。旧浏览器不认识 cqw，会退回下面的 var(--fs) 兜底。 */
.grid{ container-type:inline-size; }
.grid[data-cols="3"] .cell{ font-size:14cqw; }
.grid[data-cols="4"] .cell{ font-size:11cqw; }
.grid[data-cols="5"] .cell{ font-size:9cqw; }
.grid[data-cols="6"] .cell{ font-size:7.4cqw; }

.cell{
  position:relative;
  display:grid; place-items:center;
  border-radius:var(--r-sm);
  background:var(--surface-2);
  box-shadow:inset 0 -2px 0 rgba(180,130,90,.13), 0 1px 2px rgba(180,130,90,.06);
  font-weight:800;
  font-size:var(--fs,20px);
  color:var(--text);
  letter-spacing:.5px;
  transition:transform .13s var(--ease), background .2s, color .2s, box-shadow .2s, opacity .28s;
  overflow:hidden;
  will-change:transform;
}
.cell:active{ transform:scale(.93); }
.cell.done{
  color:#fff;
  background:linear-gradient(140deg,#7FCF55,var(--green));
  box-shadow:0 3px 10px -3px rgba(99,190,60,.65);
  animation:donePop .38s var(--ease-back);
}
@keyframes donePop{ 0%{ transform:scale(1) } 38%{ transform:scale(1.16) } 100%{ transform:scale(1) } }
.cell.wrong{ animation:shake .4s; background:#FFE2E2; color:#C0392B; }
@keyframes shake{
  0%,100%{ transform:translateX(0) } 18%{ transform:translateX(-5px) } 38%{ transform:translateX(5px) }
  58%{ transform:translateX(-3px) } 78%{ transform:translateX(3px) }
}
.cell.red{ color:var(--brand-deep); }
.cell.blue{ color:#1E7DB8; }
.cell.warn{ background:var(--yellow-soft); color:#9A6A00; }
.cell.hint{ background:#FFF0C2; box-shadow:inset 0 0 0 2px var(--yellow); }

/* 通用块网格（找相同 / 色块） */
.block-grid{ gap:9px; }
.blk{
  border-radius:var(--r-md);
  box-shadow:inset 0 0 0 2px rgba(255,255,255,.5);
  transition:transform .15s var(--ease-back), opacity .3s, box-shadow .2s;
}
.blk:active{ transform:scale(.9); }
.blk.found{ opacity:.28; transform:scale(.86); }
.blk.target-ico{ display:grid; place-items:center; font-size:26px; background:var(--surface-2); }

.stage-title{
  display:flex; align-items:center; justify-content:center; gap:8px;
  margin-bottom:11px; font-size:12.5px; color:var(--text-2); font-weight:600;
}
.stage-title b{ color:var(--brand-deep); }

/* 选择题 */
.quiz-box{ width:min(100%,420px); }
.quiz-stem{
  padding:26px 20px; border-radius:var(--r-xl);
  background:var(--surface); box-shadow:var(--sh-2);
  text-align:center;
}
.quiz-stem .q-small{ font-size:12px; color:var(--text-2); font-weight:600; }
.quiz-stem .q-main{
  font-size:38px; font-weight:900; letter-spacing:1px; margin-top:6px;
  font-variant-numeric:tabular-nums;
  color:var(--text);
}
.quiz-stem .q-main.small{ font-size:26px; }
.opts{ display:grid; grid-template-columns:1fr 1fr; gap:11px; margin-top:14px; }
.opt{
  /* 选项高度跟着屏高走：小屏不挤压、大屏更宽松（儿童点击目标宜大不宜小） */
  height:clamp(56px, 8.4svh, 76px); border-radius:var(--r-lg);
  background:var(--surface); box-shadow:var(--sh-1);
  font-size:22px; font-weight:800;
  display:grid; place-items:center;
  transition:transform .16s var(--ease-back), background .2s, color .2s, box-shadow .2s;
  font-variant-numeric:tabular-nums;
}
.opt:active{ transform:scale(.955); }
.opt.ok{ background:linear-gradient(140deg,#7FCF55,var(--green)); color:#fff; box-shadow:0 8px 20px -8px rgba(99,190,60,.7); }
.opt.no{ background:#FFE2E2; color:#C0392B; animation:shake .4s; }

/* 听觉舞台 */
.audio-stage{
  width:min(100%,420px);
  max-height:calc(100svh - var(--game-chrome));
  padding:clamp(18px, 3.4svh, 26px) 20px;
  margin-inline:auto;
  border-radius:var(--r-xl);
  background:var(--surface); box-shadow:var(--sh-2);
  text-align:center;
}
.audio-orb{
  width:112px; height:112px; margin:0 auto 16px;
  border-radius:50%;
  display:grid; place-items:center;
  font-size:40px;
  background:radial-gradient(circle at 36% 30%, #FFF0E6, #FFD9C6);
  box-shadow:0 12px 30px -12px var(--brand-glow), inset 0 -4px 12px rgba(255,255,255,.7);
  transition:transform .3s var(--ease-back);
}
.audio-orb.playing{ animation:orbBeat .75s ease-in-out infinite; }
@keyframes orbBeat{ 0%,100%{ transform:scale(1) } 46%{ transform:scale(1.1) } }
.audio-orb.hidden-ico{ color:transparent; }
.audio-stage .a-title{ font-size:16px; font-weight:800; }
.audio-stage .a-sub{ font-size:12.5px; color:var(--text-2); margin-top:6px; line-height:1.6; }
.wave{ display:flex; align-items:center; justify-content:center; gap:3px; height:26px; margin:14px 0 4px; }
.wave i{ width:3px; border-radius:2px; background:var(--brand); height:6px; }
.wave.on i{ animation:waveGo .8s ease-in-out infinite; }
.wave i:nth-child(2){ animation-delay:.1s } .wave i:nth-child(3){ animation-delay:.2s }
.wave i:nth-child(4){ animation-delay:.3s } .wave i:nth-child(5){ animation-delay:.4s }
.wave i:nth-child(6){ animation-delay:.5s } .wave i:nth-child(7){ animation-delay:.6s }
@keyframes waveGo{ 0%,100%{ height:6px } 50%{ height:24px } }

/* 闪现记忆 */
.flash-stage{
  width:min(100%,420px);
  max-height:calc(100svh - var(--game-chrome));
  padding:clamp(16px, 2.8svh, 22px);
  margin-inline:auto;
  border-radius:var(--r-xl);
  background:var(--surface); box-shadow:var(--sh-2); text-align:center;
}
.flash-code{
  display:flex; justify-content:center; gap:9px; flex-wrap:wrap;
  font-size:40px; font-weight:900; letter-spacing:2px;
  font-variant-numeric:tabular-nums; color:var(--brand-deep);
  min-height:52px; align-items:center;
}
.flash-code.blur{ filter:blur(6px); opacity:.5; }
.keypad{ display:grid; grid-template-columns:repeat(3,1fr); gap:9px; margin-top:16px; }
.key{
  height:clamp(46px, 7svh, 64px); border-radius:var(--r-md);
  background:var(--surface-2); box-shadow:inset 0 -2px 0 rgba(180,130,90,.14);
  font-size:21px; font-weight:800;
  display:grid; place-items:center;
  transition:transform .14s var(--ease-back), background .18s;
}
.key:active{ transform:scale(.92); background:var(--brand-soft); }
.key.wide{ grid-column:span 3; height:46px; font-size:14px; font-weight:700; color:var(--text-2); }
.entry{
  margin-top:14px; display:flex; justify-content:center; gap:9px;
  font-size:34px; font-weight:900; color:var(--brand-deep);
  font-variant-numeric:tabular-nums; min-height:44px;
}
.entry span{ min-width:26px; border-bottom:3px solid var(--line-strong); }

/* 追踪舞台 */
.track-stage{
  position:relative;
  width:min(calc(100vw - 2 * var(--game-pad)), calc(100svh - var(--game-chrome)));
  max-width:420px; margin-inline:auto; aspect-ratio:1;
  border-radius:var(--r-xl); overflow:hidden;
  background:linear-gradient(150deg,#FFFDFA,#FFF3E6);
  box-shadow:var(--sh-2), inset 0 0 0 1px rgba(255,255,255,.9);
  touch-action:manipulation;
}
.ball{
  position:absolute; border-radius:50%;
  display:grid; place-items:center;
  font-size:15px; font-weight:900; color:#fff;
  box-shadow:inset 0 -3px 8px rgba(0,0,0,.16), 0 4px 10px -4px rgba(120,70,40,.4);
  transition:transform .12s var(--ease);
  will-change:transform;
}
.ball:active{ transform:scale(.88); }
.ball.hit{ animation:hitOut .34s var(--ease-back) forwards; }
@keyframes hitOut{ 30%{ transform:scale(1.3); opacity:.7 } 100%{ transform:scale(.2); opacity:0 } }

/* 记忆翻牌 */
.mem-grid{
  display:grid; gap:clamp(7px, 1.2svh, 10px);
  width:min(calc(100vw - 2 * var(--game-pad)), calc(100svh - var(--game-chrome) - 60px));
  max-width:360px; margin-inline:auto;
}
.mcard{ aspect-ratio:.82; perspective:600px; }
.mcard-in{
  position:relative; width:100%; height:100%;
  transform-style:preserve-3d;
  transition:transform .48s var(--ease-out);
}
.mcard.open .mcard-in, .mcard.done .mcard-in{ transform:rotateY(180deg); }
.mface{
  position:absolute; inset:0; border-radius:var(--r-md);
  display:grid; place-items:center; font-size:26px;
  backface-visibility:hidden; -webkit-backface-visibility:hidden;
}
.mface.front{
  background:linear-gradient(150deg,#FFB08E,var(--brand));
  box-shadow:inset 0 -3px 0 rgba(0,0,0,.12);
  color:#fff; font-size:20px; font-weight:900;
}
.mface.back{
  background:var(--surface); transform:rotateY(180deg);
  box-shadow:var(--sh-1);
}
.mcard.done .mface.back{ background:var(--green-soft); box-shadow:inset 0 0 0 2px var(--green); }

/* 游戏页底部 */
/* 游戏页：撑满视口，让操作按钮贴底 */
.page-game{ display:flex; flex-direction:column; min-height:100%; }
.page-game .stage{ flex:0 0 auto; }
.page-game .game-foot{ margin-top:auto; }

.game-foot{
  position:sticky; bottom:0; z-index:15;
  padding:14px var(--pad) calc(16px + env(safe-area-inset-bottom,0px));
  display:flex; gap:10px;
  background:linear-gradient(0deg, rgba(255,249,242,.98) 62%, rgba(255,249,242,0));
}
.game-foot .btn{ flex:1; }

/* 倒计时开场 */
.countdown{
  position:absolute; inset:0; z-index:90;
  display:grid; place-items:center;
  background:rgba(255,249,242,.92);
  backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px);
}
.cd-num{
  font-size:88px; font-weight:900; color:var(--brand);
  animation:cdPop .85s var(--ease-back) both;
  text-shadow:0 10px 30px var(--brand-glow);
}
@keyframes cdPop{ 0%{ transform:scale(.4); opacity:0 } 40%{ transform:scale(1.1); opacity:1 } 100%{ transform:scale(1); opacity:1 } }

/* ---------- 9. 结果页 ---------- */
.result-wrap{ padding:26px var(--pad) 0; text-align:center; }
.result-badge{
  width:132px; height:132px; margin:0 auto 18px; border-radius:50%;
  display:grid; place-items:center; position:relative;
  background:conic-gradient(var(--brand) var(--deg,360deg), var(--surface-3) 0);
  animation:badgeIn .7s var(--ease-back) both;
}
@keyframes badgeIn{ from{ transform:scale(.5) rotate(-25deg); opacity:0 } to{ transform:none; opacity:1 } }
.result-badge::before{ content:''; position:absolute; inset:9px; border-radius:50%; background:var(--bg); }
.result-badge .rb-in{ position:relative; }
.result-badge .rb-grade{ font-size:44px; font-weight:900; line-height:1; color:var(--brand-deep); }
.result-badge .rb-txt{ font-size:10.5px; color:var(--text-2); font-weight:700; margin-top:3px; }
.result-title{ font-size:21px; font-weight:900; letter-spacing:.4px; }
.result-sub{ font-size:12.5px; color:var(--text-2); margin-top:7px; line-height:1.6; }
.result-stars{ display:flex; justify-content:center; gap:7px; margin:16px 0 4px; }
.result-stars span{
  font-size:30px; color:var(--line-strong);
  animation:starIn .55s var(--ease-back) both;
}
.result-stars span.on{ color:var(--yellow); text-shadow:0 5px 14px rgba(255,201,60,.55); }
.result-stars span:nth-child(1){ animation-delay:.15s }
.result-stars span:nth-child(2){ animation-delay:.32s }
.result-stars span:nth-child(3){ animation-delay:.49s }
@keyframes starIn{ from{ transform:scale(0) rotate(-40deg); opacity:0 } to{ transform:none; opacity:1 } }

.metrics{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:22px; }
.metric{ padding:14px 8px; border-radius:var(--r-lg); background:var(--surface); box-shadow:var(--sh-1); }
.metric b{ display:block; font-size:20px; font-weight:900; font-variant-numeric:tabular-nums; letter-spacing:.3px; }
.metric span{ display:block; font-size:10.5px; color:var(--text-2); margin-top:4px; font-weight:600; }
.metric.good b{ color:var(--green); }
.metric.warn b{ color:var(--brand-deep); }

.advice{
  margin-top:16px; padding:15px; border-radius:var(--r-lg);
  background:linear-gradient(120deg,#FFF6E6,#FFEDE2);
  border:1px solid rgba(255,90,60,.15);
  text-align:left; font-size:12.5px; line-height:1.7; color:#6B4A32;
}
.advice b{ color:var(--brand-deep); }

.result-actions{ display:flex; gap:10px; margin-top:20px; }
.result-actions .btn{ flex:1; }

/* ---------- 10. 数据页 ---------- */
.stat-hero{
  margin:6px var(--pad) 0; padding:20px;
  border-radius:var(--r-xl); color:#fff;
  background:linear-gradient(140deg,#5EB8EC 0%,#2E8FCE 52%,#1E6FA8 100%);
  box-shadow:0 14px 32px -14px rgba(46,143,206,.7);
  display:flex; align-items:center; gap:16px;
}
.stat-hero .sh-l b{ font-size:34px; font-weight:900; line-height:1; font-variant-numeric:tabular-nums; }
.stat-hero .sh-l span{ font-size:11.5px; opacity:.9; display:block; margin-top:5px; }
.stat-hero .sh-r{ margin-left:auto; text-align:right; font-size:11.5px; line-height:1.9; opacity:.95; }

.bars{ display:flex; align-items:flex-end; gap:8px; height:118px; margin-top:6px; }
.bar-col{ flex:1; display:flex; flex-direction:column; align-items:center; gap:6px; height:100%; justify-content:flex-end; }
.bar-track{ width:100%; flex:1; display:flex; align-items:flex-end; }
.bar-fill{
  width:100%; border-radius:7px 7px 3px 3px;
  background:linear-gradient(180deg,#FF9A6E,var(--brand));
  min-height:5px; transition:height .8s var(--ease-out);
}
.bar-col.today .bar-fill{ background:linear-gradient(180deg,var(--yellow),#F2A400); }
.bar-lbl{ font-size:10px; color:var(--text-3); font-weight:600; }
.bar-val{ font-size:9.5px; color:var(--text-2); font-weight:700; }

.radar-wrap{ display:grid; place-items:center; padding:6px 0 2px; }
.legend{ display:flex; flex-wrap:wrap; gap:9px; justify-content:center; margin-top:8px; }
.legend span{ display:inline-flex; align-items:center; gap:5px; font-size:11px; color:var(--text-2); font-weight:600; }
.legend i{ width:9px; height:9px; border-radius:3px; display:block; }

.rec-item{
  display:flex; align-items:center; gap:11px; padding:12px 0;
  border-bottom:1px solid var(--line);
}
.rec-item:last-child{ border-bottom:0; }
.rec-ico{ width:36px; height:36px; border-radius:11px; display:grid; place-items:center; font-size:17px; flex:0 0 auto; }
.rec-body{ flex:1; min-width:0; }
.rec-body b{ display:block; font-size:13.5px; font-weight:700; }
.rec-body span{ font-size:10.5px; color:var(--text-3); }
.rec-val{ text-align:right; font-size:11.5px; color:var(--text-2); font-variant-numeric:tabular-nums; }
.rec-val b{ display:block; font-size:14px; color:var(--brand-deep); font-weight:800; }

/* ---------- 11. 我的 ---------- */
.profile{ margin:6px var(--pad) 0; display:flex; align-items:center; gap:14px; }
.avatar{
  width:64px; height:64px; border-radius:22px; flex:0 0 auto;
  display:grid; place-items:center; font-size:30px;
  background:linear-gradient(140deg,#FFD9A8,#FFB27A);
  box-shadow:0 8px 20px -8px rgba(200,120,60,.6), inset 0 1px 0 rgba(255,255,255,.6);
}
.profile .p-body{ flex:1; min-width:0; }
.profile .p-body b{ font-size:18px; font-weight:900; }
.profile .p-body .p-sub{ font-size:11.5px; color:var(--text-2); margin-top:4px; }
.xp-bar{ height:7px; border-radius:4px; background:var(--surface-3); overflow:hidden; margin-top:8px; }
.xp-bar i{ display:block; height:100%; border-radius:4px; background:linear-gradient(90deg,var(--brand),var(--yellow)); width:0; transition:width .9s var(--ease-out); }

.kpi-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:14px; }
.kpi{ padding:13px 10px; border-radius:var(--r-lg); background:var(--surface); box-shadow:var(--sh-1); text-align:center; }
.kpi b{ display:block; font-size:19px; font-weight:900; color:var(--brand-deep); font-variant-numeric:tabular-nums; }
.kpi span{ font-size:10.5px; color:var(--text-2); font-weight:600; }

.ach-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:10px; }
.ach{
  padding:11px 5px; border-radius:var(--r-md); text-align:center;
  background:var(--surface); box-shadow:var(--sh-1);
  opacity:.42; filter:grayscale(1);
  transition:transform .2s var(--ease-back);
}
.ach.on{ opacity:1; filter:none; box-shadow:0 6px 16px -8px rgba(200,120,60,.5); }
.ach:active{ transform:scale(.94); }
.ach .a-ico{ font-size:24px; }
.ach .a-nm{ font-size:9.5px; font-weight:700; margin-top:5px; color:var(--text-2); }
.ach.on .a-nm{ color:var(--text); }

.set-row{
  display:flex; align-items:center; gap:12px;
  padding:14px 0; border-bottom:1px solid var(--line);
}
.set-row:last-child{ border-bottom:0; }
.set-row .s-ico{ width:32px; height:32px; border-radius:10px; display:grid; place-items:center; font-size:15px; background:var(--surface-2); }
.set-row .s-body{ flex:1; }
.set-row .s-body b{ display:block; font-size:14px; font-weight:700; }
.set-row .s-body span{ font-size:10.5px; color:var(--text-3); }
.switch{
  width:48px; height:28px; border-radius:var(--r-pill); flex:0 0 auto;
  background:var(--line-strong); position:relative; transition:background .26s;
}
.switch::after{
  content:''; position:absolute; top:3px; left:3px; width:22px; height:22px;
  border-radius:50%; background:#fff; box-shadow:0 2px 6px rgba(0,0,0,.2);
  transition:transform .3s var(--ease-back);
}
.switch.on{ background:var(--green); }
.switch.on::after{ transform:translateX(20px); }

/* 孩子档案切换片 */
.chi-chip{
  display:inline-flex; align-items:center; gap:6px;
  padding:8px 14px; border-radius:var(--r-pill);
  background:var(--surface-2); border:1.5px solid transparent;
  font-size:13px; font-weight:700; color:var(--text-2);
  transition:transform .18s var(--ease-back), border-color .2s, background .2s, color .2s;
}
.chi-chip:active{ transform:scale(.94); }
.chi-chip.on{ background:var(--brand-soft); border-color:var(--brand); color:var(--brand-deep); }
.chi-chip.add{ color:var(--text-3); border-style:dashed; border-color:var(--line-strong); background:transparent; }
.chi-dot{ width:6px; height:6px; border-radius:50%; background:var(--brand); display:block; }

/* ---------- 12. 彩带特效 ---------- */
#fx{
  position:fixed; inset:0; z-index:300;
  pointer-events:none; display:block;
  width:100%; height:100%;
  opacity:0; transition:opacity .5s;
}
#fx.on{ opacity:1; }

/* ---------- 13. 响应式 ---------- */

/* 小屏手机：压缩留白 */
@media (max-width:360px){
  :root{ --pad:14px; --gap:6px; }
  .hero h2{ font-size:20px; }
  .quiz-stem .q-main{ font-size:32px; }
  .tab-txt{ font-size:10px; }
}

/* 大屏手机 / 小平板：网格可放大 */
@media (min-width:430px){
  :root{ --pad:22px; }
}

/* 矮屏：收紧纵向间距 */
@media (max-height:680px){
  .hero{ padding:16px; }
  .hero h2{ font-size:20px; }
  .task-now{ height:48px; min-width:48px; font-size:20px; }
  .cell{ --fs:18px; }
}

/* 桌面 / 平板：拟真手机壳居中展示 */
@media (min-width:640px) and (min-height:600px){
  body{
    display:grid; place-items:center; padding:24px 0;
    background:
      radial-gradient(900px 600px at 20% 10%, #F6E3D0 0%, rgba(246,227,208,0) 70%),
      radial-gradient(800px 600px at 84% 88%, #FBEBD8 0%, rgba(251,235,216,0) 70%),
      #EFE0CF;
  }
  #shell{ height:auto; }
  #phone{
    width:404px; height:min(860px, calc(100vh - 48px));
    border-radius:48px;
    border:11px solid #17110E;
    box-shadow:0 40px 90px -30px rgba(70,40,20,.6), 0 0 0 2px #3A2C24, inset 0 0 0 1px rgba(255,255,255,.1);
  }
  .fake-status{ display:flex; }
  .toast{ bottom:110px; }
  #app::before{ background-size:16px 16px; }
}

/* 超宽屏：展示两栏说明留白 */
@media (min-width:1100px){
  body{ padding:32px 0; }
  #phone{ width:410px; height:min(880px, calc(100vh - 64px)); }
}

/* 横屏手机：网格两侧布局 */
@media (orientation:landscape) and (max-height:520px) and (max-width:900px){
  /* 横屏时垂直空间极紧，头尾占用比竖屏小（改成横向排布），单独覆盖这个常量 */
  :root{ --game-chrome:155px; }
  .stage{ padding-top:6px; }
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{ animation-duration:.01ms !important; animation-iteration-count:1 !important; transition-duration:.06s !important; }
}

/* =========================================================
   水墨屏模式（Ink Mode）—— 护眼模式
   ---------------------------------------------------------
   给孩子用的省眼模式：去掉全部色相，改用「墨 + 纸」两级对比，
   并用描边替代阴影（电子墨水屏本来就没有阴影概念）。

   开启：document.documentElement.classList.add('ink')
   关闭：移除 'ink' 类即可完全还原——下面所有规则都是新增的，
         没有修改任何现有样式，回退零风险。

   三个实现要点（都实测踩过）：
   1. 四维图标的底色是**内联样式**（style="background:..."），
      优先级高于类选择器，所以必须 !important 才盖得住；
   2. **不在 html/body 上加 filter** —— filter 会创建新的 containing
      block，会让所有 position:fixed 元素（弹窗 / Toast / 遮罩）跟着页面滚动；
   3. 游戏里的对错反馈**不能只靠变灰**，否则孩子分不清对错 ——
      改成用「明度 + 描边粗细」区分。
   ========================================================= */

html.ink{
  /* 色彩层：墨 + 纸，零色相 */
  --bg:#F4F3EF;
  --bg-deep:#EAE8E2;
  --surface:#FFFFFF;
  --surface-2:#F0EEE8;
  --surface-3:#E1DED6;

  --brand:#1F1F1F;
  --brand-deep:#000000;
  --brand-soft:#E6E4DD;
  --brand-glow:rgba(0,0,0,.05);

  --blue:#585858;   --blue-soft:#EBE9E4;
  --yellow:#8C8C8C; --yellow-soft:#F2F0EA;
  --green:#454545;  --green-soft:#E7E5DF;
  --purple:#6E6E6E; --purple-soft:#EDEBE5;

  --text:#141414;
  --text-2:#4A4A4A;
  --text-3:#7C7C7C;
  --line:#D4D1C9;
  --line-strong:#B4B0A6;

  /* 阴影全部归零 —— 用描边代替 */
  --sh-1:none; --sh-2:none; --sh-3:none;
}

/* ---- 去装饰：渐变、光晕、文字阴影一律干掉 ---- */
html.ink *{
  background-image:none !important;
  text-shadow:none !important;
}

/* ---- 描边分层：用线条表达层级 ---- */
html.ink .card,
html.ink .kpi,
html.ink .g-item,
html.ink .q-card,
html.ink .metric,
html.ink .chip,
html.ink .pill,
html.ink .task-bar,
html.ink .dim-head{
  border:1px solid var(--line-strong) !important;
}

/* ---- 按钮 ---- */
html.ink .btn-primary{ background:#1F1F1F !important; color:#fff !important; }
html.ink .btn-ghost{
  background:#fff !important; color:#1F1F1F !important;
  box-shadow:inset 0 0 0 1px #1F1F1F !important;
}
html.ink .icon-btn{ background:transparent !important; color:#1F1F1F !important; box-shadow:none !important; }

/* ---- Hero 墨块：黑底白字，对比度最高 ---- */
html.ink .hero{ background:#1B1B1B !important; border:1px solid #000 !important; }
html.ink .hero, html.ink .hero *{ color:#fff !important; }
html.ink .hero .btn{ background:#fff !important; color:#1B1B1B !important; }
html.ink .hero .btn + .btn{
  background:transparent !important; color:#fff !important;
  box-shadow:inset 0 0 0 1.5px #fff !important;
}
html.ink .today-ring{ color:#fff !important; }
html.ink .today-ring::before{ background:#fff !important; }
html.ink .today-ring b, html.ink .today-ring i{ color:#fff !important; }

/* ---- 四维卡片：底色是内联样式，必须 !important ---- */
html.ink .q-card{ --c:#1F1F1F !important; --cs:#E8E6E0 !important; }
html.ink .q-ico{ background:#E8E6E0 !important; }
html.ink .q-bar{ background:#DDDBD4 !important; }
html.ink .q-bar i{ background:#1F1F1F !important; }

/* ---- emoji / 头像去色：它们是文字不是图片，必须选到容器 ---- */
html.ink .q-ico,
html.ink .g-ico,
html.ink .s-ico,
html.ink .dim-ico,
html.ink .empty-ico,
html.ink .avatar{
  filter:grayscale(1) contrast(1.2);
}

/* ---- 标签 chip ---- */
html.ink .chip,
html.ink .pill,
html.ink .chip.blue,
html.ink .chip.green,
html.ink .chip.yellow{
  background:#E6E4DD !important;
  color:#1F1F1F !important;
}

/* ---- 难度徽章 ---- */
html.ink .lv-badge{ background:#1F1F1F !important; color:#fff !important; }

/* ---- 底部导航 ---- */
html.ink .tabbar{ background:#fff !important; border-top:1px solid var(--line-strong) !important; }
html.ink .tab{ color:#6E6E6E !important; }
html.ink .tab.on{ color:#000 !important; }
html.ink .tab.on::before{ background:#1F1F1F !important; }

/* ---- 弹层：保持可读、不透明 ---- */
html.ink .sheet-mask{ background:rgba(20,20,20,.45) !important; }
html.ink .sheet{ background:#fff !important; box-shadow:0 -2px 0 rgba(0,0,0,.12) !important; }
html.ink .toast{ background:rgba(20,20,20,.92) !important; color:#fff !important; }
html.ink .consent-mask{ background:rgba(20,20,20,.5) !important; }

/* ---- 训练提示条 ---- */
html.ink .task-bar{ background:#fff !important; }

/* =========================================================
   游戏区：对错反馈改用「明度 + 描边」，不依赖色相
   ---------------------------------------------------------
   正确 → 深墨实心（一眼看出"已确认"）
   错误 → 白底 + 粗黑边（一眼看出"有问题"）
   两者在纯黑白下依然能明确区分。
   ========================================================= */

/* 舒尔特网格 */
html.ink .grid{ background:#EFEDE7 !important; }
html.ink .cell{
  background:#fff !important;
  color:#1F1F1F !important;
  box-shadow:inset 0 0 0 1px #C9C6BE !important;
}
html.ink .cell.done{
  background:#2B2B2B !important;
  color:#fff !important;
  box-shadow:inset 0 0 0 1px #000 !important;
}
html.ink .cell.wrong{
  background:#fff !important;
  color:#000 !important;
  box-shadow:inset 0 0 0 2.5px #000 !important;
}
html.ink .cell.blue{ background:#4A4A4A !important; color:#fff !important; }
html.ink .cell.warn{
  background:#fff !important; color:#000 !important;
  box-shadow:inset 0 0 0 2px #555 !important;
}
html.ink .cell.hint{ background:#DDDBD4 !important; }

/* 选项类题型（对 / 错） */
html.ink .opt.ok{
  background:#2B2B2B !important; color:#fff !important;
  box-shadow:inset 0 0 0 2px #000 !important;
}
html.ink .opt.no{
  background:#fff !important; color:#000 !important;
  box-shadow:inset 0 0 0 2.5px #000 !important;
}

/* 听觉 / 追踪 类题型的舞台 */
html.ink .audio-orb{ background:#F0EEE8 !important; }
html.ink .audio-orb::after{ background:#1F1F1F !important; }
html.ink .track-stage{ background:#FBFAF7 !important; }
html.ink .ball{ background:#1F1F1F !important; }

/* ---- 灰阶下小字更难辨认，略微放宽字距 ---- */
html.ink #app{ letter-spacing:.012em; }

/* ---- 关掉装饰性循环动画（减少视觉刺激 + 省电）---- */
html.ink .pulse,
html.ink .float,
html.ink .fx-ring,
html.ink .glow{
  animation:none !important;
}
