/* ============================================================
   锐晴 · 儿童弱视视觉训练系统  —  样式表
   设计基调：明亮、亲和、低刺激，适配平板触摸与大屏
   ============================================================ */

:root{
  --bg:#eef2f8;
  --bg2:#ffffff;
  --ink:#1c2c44;
  --ink-soft:#5a6b82;
  --line:#e1e8f2;
  --brand:#1f5cc4;
  --brand2:#38bdf8;
  --accent:#f59e0b;
  --good:#16a36a;
  --warn:#e08a00;
  --danger:#e23b3b;
  --shadow:0 10px 30px rgba(18,38,74,.10);
  --radius:18px;
  --safe-bottom:env(safe-area-inset-bottom,0px);
  /* 天空素材：6 种形态的矢量云 + 卡通太阳（内联 SVG，不依赖字体与图片，所有浏览器 / 安卓可渲染）
     云：轮廓由多个不规则云球打散 + 边缘细碎云絮（两层不同模糊）→ 边缘自然、与天空融合
     太阳：卡通亮黄圆盘（高光 + 白圈）+ 8 道圆头光芒 + 暖光晕 */
  --rq-cloud1:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 104'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='rgb(255,255,255)'/%3E%3Cstop offset='.45' stop-color='rgb(250,253,255)'/%3E%3Cstop offset='1' stop-color='rgb(198,219,245)'/%3E%3C/linearGradient%3E%3Cfilter id='fm' x='-25%' y='-25%' width='150%' height='150%'%3E%3CfeGaussianBlur stdDeviation='0.7'/%3E%3C/filter%3E%3Cfilter id='fw' x='-40%' y='-40%' width='180%' height='180%'%3E%3CfeGaussianBlur stdDeviation='1.8'/%3E%3C/filter%3E%3C/defs%3E%3Cg fill='url(%23g)' filter='url(%23fw)' opacity='.55'%3E%3Cellipse cx='44' cy='74' rx='12' ry='8'/%3E%3Cellipse cx='216' cy='72' rx='10' ry='7'/%3E%3Cellipse cx='124' cy='28' rx='18' ry='9'/%3E%3C/g%3E%3Cg fill='url(%23g)' filter='url(%23fm)' opacity='.97'%3E%3Crect x='42' y='58' width='156' height='36' rx='18'/%3E%3Cellipse cx='72' cy='60' rx='34' ry='30'/%3E%3Cellipse cx='110' cy='46' rx='40' ry='36'/%3E%3Cellipse cx='148' cy='44' rx='38' ry='34'/%3E%3Cellipse cx='182' cy='60' rx='30' ry='25'/%3E%3Cellipse cx='58' cy='68' rx='20' ry='16'/%3E%3Cellipse cx='204' cy='68' rx='16' ry='12'/%3E%3C/g%3E%3C/svg%3E");
  --rq-cloud2:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 260 92'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='rgb(255,255,255)'/%3E%3Cstop offset='.45' stop-color='rgb(250,253,255)'/%3E%3Cstop offset='1' stop-color='rgb(202,222,246)'/%3E%3C/linearGradient%3E%3Cfilter id='fm' x='-25%' y='-25%' width='150%' height='150%'%3E%3CfeGaussianBlur stdDeviation='0.8'/%3E%3C/filter%3E%3Cfilter id='fw' x='-40%' y='-40%' width='180%' height='180%'%3E%3CfeGaussianBlur stdDeviation='1.9'/%3E%3C/filter%3E%3C/defs%3E%3Cg fill='url(%23g)' filter='url(%23fw)' opacity='.55'%3E%3Cellipse cx='34' cy='66' rx='12' ry='7'/%3E%3Cellipse cx='240' cy='64' rx='11' ry='6'/%3E%3Cellipse cx='140' cy='24' rx='20' ry='8'/%3E%3C/g%3E%3Cg fill='url(%23g)' filter='url(%23fm)' opacity='.97'%3E%3Crect x='28' y='50' width='204' height='32' rx='16'/%3E%3Cellipse cx='70' cy='52' rx='36' ry='26'/%3E%3Cellipse cx='112' cy='42' rx='42' ry='30'/%3E%3Cellipse cx='158' cy='40' rx='44' ry='28'/%3E%3Cellipse cx='200' cy='52' rx='32' ry='22'/%3E%3Cellipse cx='46' cy='60' rx='22' ry='15'/%3E%3Cellipse cx='228' cy='58' rx='18' ry='12'/%3E%3C/g%3E%3C/svg%3E");
  --rq-cloud3:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 96'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='rgb(255,255,255)'/%3E%3Cstop offset='.45' stop-color='rgb(250,253,255)'/%3E%3Cstop offset='1' stop-color='rgb(204,224,247)'/%3E%3C/linearGradient%3E%3Cfilter id='fm' x='-25%' y='-25%' width='150%' height='150%'%3E%3CfeGaussianBlur stdDeviation='0.7'/%3E%3C/filter%3E%3Cfilter id='fw' x='-40%' y='-40%' width='180%' height='180%'%3E%3CfeGaussianBlur stdDeviation='1.7'/%3E%3C/filter%3E%3C/defs%3E%3Cg fill='url(%23g)' filter='url(%23fw)' opacity='.55'%3E%3Cellipse cx='36' cy='68' rx='10' ry='6'/%3E%3Cellipse cx='146' cy='66' rx='9' ry='6'/%3E%3C/g%3E%3Cg fill='url(%23g)' filter='url(%23fm)' opacity='.97'%3E%3Crect x='34' y='54' width='112' height='32' rx='16'/%3E%3Cellipse cx='62' cy='56' rx='28' ry='26'/%3E%3Cellipse cx='98' cy='46' rx='32' ry='29'/%3E%3Cellipse cx='128' cy='52' rx='24' ry='20'/%3E%3Cellipse cx='50' cy='64' rx='18' ry='13'/%3E%3C/g%3E%3C/svg%3E");
  --rq-cloud4:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 280 72'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='rgb(255,255,255)'/%3E%3Cstop offset='.45' stop-color='rgb(250,253,255)'/%3E%3Cstop offset='1' stop-color='rgb(208,227,248)'/%3E%3C/linearGradient%3E%3Cfilter id='fm' x='-25%' y='-25%' width='150%' height='150%'%3E%3CfeGaussianBlur stdDeviation='0.9'/%3E%3C/filter%3E%3Cfilter id='fw' x='-40%' y='-40%' width='180%' height='180%'%3E%3CfeGaussianBlur stdDeviation='2.1'/%3E%3C/filter%3E%3C/defs%3E%3Cg fill='url(%23g)' filter='url(%23fw)' opacity='.55'%3E%3Cellipse cx='30' cy='44' rx='14' ry='6'/%3E%3Cellipse cx='252' cy='42' rx='12' ry='5'/%3E%3Cellipse cx='120' cy='22' rx='24' ry='7'/%3E%3C/g%3E%3Cg fill='url(%23g)' filter='url(%23fm)' opacity='.97'%3E%3Crect x='40' y='36' width='200' height='22' rx='11'/%3E%3Cellipse cx='86' cy='38' rx='40' ry='17'/%3E%3Cellipse cx='140' cy='32' rx='36' ry='18'/%3E%3Cellipse cx='188' cy='36' rx='30' ry='15'/%3E%3Cellipse cx='226' cy='40' rx='22' ry='11'/%3E%3Cellipse cx='58' cy='42' rx='22' ry='12'/%3E%3C/g%3E%3C/svg%3E");
  --rq-cloud5:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 130'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='rgb(255,255,255)'/%3E%3Cstop offset='.45' stop-color='rgb(250,253,255)'/%3E%3Cstop offset='1' stop-color='rgb(196,218,245)'/%3E%3C/linearGradient%3E%3Cfilter id='fm' x='-25%' y='-25%' width='150%' height='150%'%3E%3CfeGaussianBlur stdDeviation='0.7'/%3E%3C/filter%3E%3Cfilter id='fw' x='-40%' y='-40%' width='180%' height='180%'%3E%3CfeGaussianBlur stdDeviation='1.8'/%3E%3C/filter%3E%3C/defs%3E%3Cg fill='url(%23g)' filter='url(%23fw)' opacity='.55'%3E%3Cellipse cx='40' cy='104' rx='11' ry='7'/%3E%3Cellipse cx='168' cy='100' rx='10' ry='6'/%3E%3Cellipse cx='104' cy='22' rx='16' ry='8'/%3E%3C/g%3E%3Cg fill='url(%23g)' filter='url(%23fm)' opacity='.97'%3E%3Crect x='36' y='86' width='128' height='32' rx='16'/%3E%3Cellipse cx='62' cy='88' rx='30' ry='26'/%3E%3Cellipse cx='100' cy='76' rx='34' ry='32'/%3E%3Cellipse cx='126' cy='58' rx='32' ry='30'/%3E%3Cellipse cx='96' cy='44' rx='26' ry='24'/%3E%3Cellipse cx='146' cy='84' rx='24' ry='20'/%3E%3Cellipse cx='48' cy='96' rx='18' ry='14'/%3E%3C/g%3E%3C/svg%3E");
  --rq-cloud6:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 260 100'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='rgb(255,255,255)'/%3E%3Cstop offset='.45' stop-color='rgb(250,253,255)'/%3E%3Cstop offset='1' stop-color='rgb(200,221,246)'/%3E%3C/linearGradient%3E%3Cfilter id='fm' x='-25%' y='-25%' width='150%' height='150%'%3E%3CfeGaussianBlur stdDeviation='0.8'/%3E%3C/filter%3E%3Cfilter id='fw' x='-40%' y='-40%' width='180%' height='180%'%3E%3CfeGaussianBlur stdDeviation='1.9'/%3E%3C/filter%3E%3C/defs%3E%3Cg fill='url(%23g)' filter='url(%23fw)' opacity='.55'%3E%3Cellipse cx='26' cy='74' rx='12' ry='7'/%3E%3Cellipse cx='244' cy='72' rx='11' ry='6'/%3E%3Cellipse cx='96' cy='22' rx='18' ry='8'/%3E%3Cellipse cx='190' cy='20' rx='14' ry='7'/%3E%3C/g%3E%3Cg fill='url(%23g)' filter='url(%23fm)' opacity='.97'%3E%3Crect x='30' y='56' width='200' height='34' rx='17'/%3E%3Cellipse cx='64' cy='60' rx='34' ry='28'/%3E%3Cellipse cx='100' cy='48' rx='36' ry='32'/%3E%3Cellipse cx='140' cy='56' rx='32' ry='26'/%3E%3Cellipse cx='186' cy='46' rx='38' ry='34'/%3E%3Cellipse cx='222' cy='62' rx='26' ry='20'/%3E%3Cellipse cx='46' cy='68' rx='18' ry='13'/%3E%3C/g%3E%3C/svg%3E");
  --rq-sun:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cdefs%3E%3CradialGradient id='gl' cx='50%' cy='50%' r='50%'%3E%3Cstop offset='0' stop-color='rgb(255,226,130)' stop-opacity='.38'/%3E%3Cstop offset='.55' stop-color='rgb(255,226,130)' stop-opacity='.16'/%3E%3Cstop offset='1' stop-color='rgb(255,226,130)' stop-opacity='0'/%3E%3C/radialGradient%3E%3CradialGradient id='d' cx='38%' cy='32%' r='80%'%3E%3Cstop offset='0' stop-color='rgb(255,255,255)'/%3E%3Cstop offset='.26' stop-color='rgb(255,248,196)'/%3E%3Cstop offset='.62' stop-color='rgb(255,216,74)'/%3E%3Cstop offset='1' stop-color='rgb(255,188,32)'/%3E%3C/radialGradient%3E%3C/defs%3E%3Ccircle cx='100' cy='100' r='99' fill='url(%23gl)'/%3E%3Cg fill='rgb(255,197,52)'%3E%3Crect x='95' y='6' width='10' height='34' rx='5' transform='rotate(0 100 100)'/%3E%3Crect x='95' y='6' width='10' height='34' rx='5' transform='rotate(45 100 100)'/%3E%3Crect x='95' y='6' width='10' height='34' rx='5' transform='rotate(90 100 100)'/%3E%3Crect x='95' y='6' width='10' height='34' rx='5' transform='rotate(135 100 100)'/%3E%3Crect x='95' y='6' width='10' height='34' rx='5' transform='rotate(180 100 100)'/%3E%3Crect x='95' y='6' width='10' height='34' rx='5' transform='rotate(225 100 100)'/%3E%3Crect x='95' y='6' width='10' height='34' rx='5' transform='rotate(270 100 100)'/%3E%3Crect x='95' y='6' width='10' height='34' rx='5' transform='rotate(315 100 100)'/%3E%3C/g%3E%3Ccircle cx='100' cy='100' r='52' fill='url(%23d)'/%3E%3Ccircle cx='100' cy='100' r='52' fill='none' stroke='rgb(255,255,255)' stroke-opacity='.6' stroke-width='3'/%3E%3Cellipse cx='82' cy='80' rx='15' ry='10' fill='rgb(255,255,255)' opacity='.55' transform='rotate(-25 82 80)'/%3E%3C/svg%3E");
  /* 大雁：身体 + 上/下两片翅膀（翅膀由 CSS transform 旋转扇动，不用 SMIL，安卓全版本可播放） */
  --rq-goose:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 28'%3E%3Cdefs%3E%3ClinearGradient id='gb' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='rgb(78,98,128)'/%3E%3Cstop offset='1' stop-color='rgb(50,66,92)'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cg fill='url(%23gb)'%3E%3Cellipse cx='26' cy='14' rx='12' ry='5.2'/%3E%3Cpath d='M15 12 L9.5 7.2 L12 5.4 L18.6 10.6 Z'/%3E%3Ccircle cx='10' cy='6.6' r='3.3'/%3E%3Cpath d='M6.9 5.6 L1.2 6.8 L7 8 Z'/%3E%3Cpath d='M37 11.5 L50 7 L49 14 L50 21 L37 16.5 Z'/%3E%3C/g%3E%3C/svg%3E");
  --rq-wing-a:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 32'%3E%3Cdefs%3E%3ClinearGradient id='wa' x1='0' y1='1' x2='1' y2='0'%3E%3Cstop offset='0' stop-color='rgb(56,72,98)'/%3E%3Cstop offset='1' stop-color='rgb(98,118,148)'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23wa)' d='M2 28 Q8 21 20 10 Q30 3.5 37 2.5 Q34 9 26 18 Q15 26 5 29.5 Z'/%3E%3C/svg%3E");
  --rq-wing-b:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 32'%3E%3Cdefs%3E%3ClinearGradient id='wb' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='rgb(70,88,116)'/%3E%3Cstop offset='1' stop-color='rgb(44,58,82)'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath fill='url(%23wb)' d='M2 4 Q8 11 20 22 Q30 28.5 37 29.5 Q34 23 26 14 Q15 6 5 1.5 Z'/%3E%3C/svg%3E");
  --rq-cloud:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 104'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='rgb(255,255,255)'/%3E%3Cstop offset='.45' stop-color='rgb(250,253,255)'/%3E%3Cstop offset='1' stop-color='rgb(198,219,245)'/%3E%3C/linearGradient%3E%3Cfilter id='fm' x='-25%' y='-25%' width='150%' height='150%'%3E%3CfeGaussianBlur stdDeviation='0.7'/%3E%3C/filter%3E%3Cfilter id='fw' x='-40%' y='-40%' width='180%' height='180%'%3E%3CfeGaussianBlur stdDeviation='1.8'/%3E%3C/filter%3E%3C/defs%3E%3Cg fill='url(%23g)' filter='url(%23fw)' opacity='.55'%3E%3Cellipse cx='44' cy='74' rx='12' ry='8'/%3E%3Cellipse cx='216' cy='72' rx='10' ry='7'/%3E%3Cellipse cx='124' cy='28' rx='18' ry='9'/%3E%3C/g%3E%3Cg fill='url(%23g)' filter='url(%23fm)' opacity='.97'%3E%3Crect x='42' y='58' width='156' height='36' rx='18'/%3E%3Cellipse cx='72' cy='60' rx='34' ry='30'/%3E%3Cellipse cx='110' cy='46' rx='40' ry='36'/%3E%3Cellipse cx='148' cy='44' rx='38' ry='34'/%3E%3Cellipse cx='182' cy='60' rx='30' ry='25'/%3E%3Cellipse cx='58' cy='68' rx='20' ry='16'/%3E%3Cellipse cx='204' cy='68' rx='16' ry='12'/%3E%3C/g%3E%3C/svg%3E");
}

*{box-sizing:border-box;-webkit-tap-highlight-color:transparent;}
html,body{height:100%;margin:0;overscroll-behavior:none;}
body{
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",Segoe UI,Roboto,sans-serif;
  background:linear-gradient(180deg,#e9f2fc 0%,#eef4fb 40%,#f6f9fd 100%);
  color:var(--ink);
  -webkit-font-smoothing:antialiased;
  overflow-x:hidden;
  user-select:none;
}
button{font-family:inherit;cursor:pointer;border:none;background:none;color:inherit;}
img{max-width:100%;}

#app{
  max-width:980px;
  margin:0 auto;
  min-height:100%;
  padding-bottom:calc(80px + env(safe-area-inset-bottom,0px)); /* 给底部导航留位（含刘海屏安全区） */
  position:relative;
}

/* ---------- 顶部栏 ---------- */
.topbar{
  position:sticky;top:0;z-index:20;
  display:flex;align-items:center;gap:10px;
  padding:12px 16px;
  background:rgba(255,255,255,.86);
  backdrop-filter:blur(8px);
  border-bottom:1px solid var(--line);
}
.topbar-back{
  width:38px;height:38px;border-radius:50%;
  font-size:26px;line-height:1;color:var(--brand);
  background:#eaf2ff;display:none;align-items:center;justify-content:center;
}
.topbar-back.show{display:flex;}
.topbar-title{font-weight:700;font-size:18px;flex:1;text-align:center;}
.topbar-action{
  width:38px;height:38px;border-radius:50%;font-size:18px;
  background:#eaf2ff;display:flex;align-items:center;justify-content:center;
}

/* ---------- 屏幕切换 ---------- */
.screen{display:none;padding:16px;animation:fade .25s ease;}
.screen.active{display:block;}
@keyframes fade{from{opacity:0;transform:translateY(6px);}to{opacity:1;transform:none;}}

/* ---------- 首页 Hero ---------- */
.hero{
  text-align:center;padding:18px 10px 6px;
}
.hero-logo{font-size:54px;line-height:1;filter:drop-shadow(0 6px 10px rgba(47,128,237,.25));}
.hero h1{font-size:22px;margin:10px 0 4px;letter-spacing:.5px;}
.hero-sub{color:var(--ink-soft);font-size:13px;margin:0;}
.hero-stats{
  display:flex;justify-content:center;gap:10px;margin-top:14px;flex-wrap:wrap;
}
.stat-pill{
  background:var(--bg2);border:1px solid var(--line);border-radius:14px;
  padding:8px 14px;box-shadow:var(--shadow);min-width:84px;
}
.stat-pill b{display:block;font-size:20px;color:var(--brand);}
.stat-pill span{font-size:11px;color:var(--ink-soft);}

/* ---------- 分类导航 ---------- */
/* 分类菜单：自动换行，避免移动端被横向滚动裁切（后面的栏目看不到） */
.cat-nav{display:flex;flex-wrap:wrap;gap:8px;padding:14px 2px 6px;}
.cat-chip{
  flex:0 0 auto;padding:8px 14px;border-radius:20px;font-size:13px;font-weight:600;
  background:#fff;border:1px solid var(--line);color:var(--ink-soft);white-space:nowrap;
}
.cat-chip.active{background:var(--brand);color:#fff;border-color:var(--brand);box-shadow:0 4px 12px rgba(47,128,237,.35);}

/* ---------- 模块卡片网格 ---------- */
.module-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px;margin-top:10px;}
.module-card{
  background:var(--bg2);border-radius:var(--radius);padding:16px;
  box-shadow:var(--shadow);border:1px solid var(--line);
  display:flex;flex-direction:column;gap:6px;position:relative;overflow:hidden;
  transition:transform .12s ease;
}
.module-card:active{transform:scale(.97);}
.module-card .mc-badge{
  position:absolute;top:0;right:0;font-size:11px;color:#fff;padding:4px 10px;
  border-bottom-left-radius:14px;font-weight:600;
}
.module-card .mc-icon{font-size:40px;line-height:1;}
.module-card .mc-name{font-weight:700;font-size:16px;}
.module-card .mc-desc{font-size:12px;color:var(--ink-soft);line-height:1.5;min-height:36px;}
.module-card .mc-go{
  margin-top:4px;align-self:flex-start;font-size:13px;font-weight:700;color:var(--brand);
}
.mc-cat-basic .mc-badge{background:var(--brand);}
.mc-cat-binoc .mc-badge{background:#9b51e0;}
.mc-cat-redblue .mc-badge{background:#e05263;}
.mc-cat-redblue{border-top-color:#e05263;}
.mc-cat-bluered .mc-badge{background:#3a7bd5;}
.mc-cat-bluered{border-top-color:#3a7bd5;}
.mc-cat-fine .mc-badge{background:var(--accent);}
.mc-cat-game .mc-badge{background:#ff7a59;}
.mc-cat-game{border-top-color:#ff7a59;}

.home-footer{display:flex;gap:12px;margin:22px 0 8px;}
.ghost-btn{
  flex:1;background:#fff;border:1px solid var(--line);border-radius:14px;
  padding:14px;font-size:14px;font-weight:600;color:var(--ink);box-shadow:var(--shadow);
}
.ghost-btn:active{transform:scale(.98);}

/* ---------- 底部导航 ---------- */
.bottomnav{
  position:fixed;left:0;right:0;bottom:0;z-index:20;
  max-width:980px;margin:0 auto;
  display:flex;background:rgba(255,255,255,.95);backdrop-filter:blur(8px);
  border-top:1px solid var(--line);padding-bottom:var(--safe-bottom);
  /* 适配手机：按钮更大更易点 */
}
.bn-item{
  flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;
  padding:8px 0 6px;font-size:20px;color:var(--ink-soft);
}
.bn-item span{font-size:11px;}
.bn-item.active{color:var(--brand);}
.bn-item.active span{font-weight:700;}

/* ---------- 面板（设置/记录） ---------- */
.panel{background:var(--bg2);border-radius:var(--radius);box-shadow:var(--shadow);
  border:1px solid var(--line);padding:18px;margin-top:6px;}
.panel h2{font-size:18px;margin:0 0 4px;}
.panel .panel-sub{font-size:12px;color:var(--ink-soft);margin:0 0 16px;}

.field{margin-bottom:16px;}
.field>label{display:block;font-size:13px;font-weight:600;margin-bottom:6px;color:var(--ink);}
.field .hint{font-size:11px;color:var(--ink-soft);margin-top:4px;line-height:1.4;}
.field input[type=text],.field input[type=number],.field select{
  width:100%;padding:11px 12px;border:1px solid var(--line);border-radius:12px;
  font-size:15px;background:#fbfdff;color:var(--ink);
}
.seg{display:flex;gap:8px;flex-wrap:wrap;}
.seg button{
  flex:1;min-width:70px;padding:10px;border-radius:12px;border:1px solid var(--line);
  background:#fbfdff;font-size:14px;font-weight:600;color:var(--ink-soft);
}
.seg button.on{background:var(--brand);color:#fff;border-color:var(--brand);}

.row{display:flex;gap:12px;}
.row>.field{flex:1;}

.primary-btn{
  width:100%;padding:14px;border-radius:14px;background:var(--brand);color:#fff;
  font-size:16px;font-weight:700;box-shadow:0 6px 16px rgba(47,128,237,.35);
}
.primary-btn:active{transform:scale(.99);}
.danger-btn{
  width:100%;padding:12px;border-radius:12px;background:#fff;color:var(--danger);
  border:1px solid #f3c9c9;font-size:14px;margin-top:8px;
}

/* ---------- 训练舞台 ---------- */
.module-stage{position:relative;}
.training-shell{background:#0e1726;border-radius:var(--radius);overflow:hidden;box-shadow:var(--shadow);}
.training-head{
  display:flex;align-items:center;gap:10px;padding:10px 14px;background:#13203a;color:#cfe0ff;
}
.training-head .th-name{font-weight:700;flex:1;font-size:15px;}
.training-head .th-timer{font-variant-numeric:tabular-nums;font-size:15px;font-weight:700;color:#7fd1ff;}
.training-head .th-btn{background:#22335a;color:#cfe0ff;border-radius:10px;padding:6px 12px;font-size:13px;}
.training-canvas-wrap{position:relative;background:#000;}
.training-canvas-wrap canvas{display:block;width:100%;height:auto;touch-action:none;}
.training-controls{padding:12px 14px;background:#0e1726;display:flex;flex-wrap:wrap;gap:8px;align-items:center;}
.training-controls .ctrl-label{color:#9fb6d9;font-size:12px;width:100%;margin-bottom:2px;}
.training-controls input[type=range]{flex:1;min-width:120px;accent-color:var(--brand2);}
.training-controls .ctrl-val{color:#7fd1ff;font-size:12px;min-width:46px;text-align:right;}
.training-controls .ctrl-btn{background:#22335a;color:#cfe0ff;border-radius:10px;padding:8px 12px;font-size:13px;}
.training-controls select{background:#22335a;color:#cfe0ff;border-radius:10px;padding:8px 10px;font-size:13px;}

.training-overlay{
  position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;
  background:rgba(8,14,26,.92);color:#eaf2ff;text-align:center;gap:14px;padding:24px;z-index:5;
}
.training-overlay h3{margin:0;font-size:22px;}
.training-overlay p{margin:0;color:#9fb6d9;font-size:14px;max-width:420px;line-height:1.6;}
.training-overlay .big-btn{background:var(--brand);color:#fff;padding:14px 26px;border-radius:14px;font-size:16px;font-weight:700;}
.training-overlay .score-num{font-size:46px;font-weight:800;color:#7fd1ff;}

/* 红蓝眼镜提示 */
.glasses-hint{
  display:flex;align-items:center;justify-content:center;gap:10px;color:#cfe0ff;
  background:#13203a;padding:10px 14px;font-size:13px;
}
.glasses-hint .lr{display:flex;gap:6px;align-items:center;}
.glasses-hint .eye{display:inline-flex;align-items:center;gap:4px;}
.dot-red{width:16px;height:16px;border-radius:50%;background:#ff3b3b;display:inline-block;box-shadow:0 0 8px #ff3b3b;}
.dot-cyan{width:16px;height:16px;border-radius:50%;background:#19e0e0;display:inline-block;box-shadow:0 0 8px #19e0e0;}

/* 遮盖遮罩（遮蔽好眼，强制弱眼工作） */
.cover-mask{position:absolute;top:0;bottom:0;width:50%;background:#000;z-index:4;display:none;}
.cover-mask.left{left:0;} .cover-mask.right{right:0;}
.cover-mask .cm-tag{position:absolute;bottom:10px;left:0;right:0;text-align:center;color:#ffd23f;font-size:12px;}

/* ---------- 记录统计 ---------- */
.rec-summary{display:flex;gap:12px;margin-bottom:16px;}
.rec-card{flex:1;background:#f6f9fd;border:1px solid var(--line);border-radius:14px;padding:14px;text-align:center;}
.rec-card b{display:block;font-size:24px;color:var(--brand);}
.rec-card span{font-size:11px;color:var(--ink-soft);}
.chart-box{background:#f6f9fd;border:1px solid var(--line);border-radius:14px;padding:12px;margin-bottom:16px;}
.chart-box h3{margin:0 0 8px;font-size:14px;}
.chart-box canvas{width:100%;height:auto;}
.rec-list{max-height:320px;overflow:auto;}
.rec-item{display:flex;align-items:center;gap:10px;padding:10px 4px;border-bottom:1px solid var(--line);font-size:13px;}
.rec-item .ri-dot{width:10px;height:10px;border-radius:50%;background:var(--brand);flex:0 0 auto;}
.rec-item .ri-name{flex:1;font-weight:600;}
.rec-item .ri-meta{color:var(--ink-soft);font-size:12px;}
.empty-tip{color:var(--ink-soft);text-align:center;padding:30px 10px;font-size:13px;}

/* ---------- 医学免责 ---------- */
.disclaimer{
  position:fixed;left:0;right:0;bottom:calc(74px + env(safe-area-inset-bottom,0px));z-index:30;
  max-width:980px;margin:0 auto;
  background:#fff7e6;border:1px solid #ffe2a8;color:#7a5b16;
  padding:10px 14px;display:flex;align-items:center;gap:10px;font-size:12px;line-height:1.5;
  box-shadow:0 -4px 16px rgba(230,162,34,.15);
}
.disclaimer b{color:#a05a00;}
.disclaimer button{background:#ffd23f;color:#5a4500;padding:6px 12px;border-radius:10px;font-size:12px;font-weight:700;flex:0 0 auto;}

/* 通用小工具 */
.hidden{display:none!important;}
.center{text-align:center;}
.muted{color:var(--ink-soft);}
.toast{
  position:fixed;left:50%;top:50%;transform:translate(-50%,-50%);
  background:rgba(14,23,38,.92);color:#fff;padding:14px 22px;border-radius:14px;
  font-size:15px;z-index:50;opacity:0;pointer-events:none;
  transition:opacity .2s,background-color .18s,color .18s;
}
.toast.show{opacity:1;}
/* 得分/扣分/成功：提示文字本身换背景色+文字色，并弹一下，反馈一眼可见 */
.toast.show.tone-plus{
  background:linear-gradient(135deg,#ffe36e,#ffc94d);color:#5a4500;
  font-size:20px;font-weight:800;padding:16px 28px;
  box-shadow:0 8px 30px rgba(255,190,50,.55);animation:toastPop .34s cubic-bezier(.2,1.5,.4,1);
}
.toast.show.tone-minus{
  background:linear-gradient(135deg,#ff8f8f,#f2554f);color:#fff;
  font-size:20px;font-weight:800;padding:16px 28px;
  box-shadow:0 8px 30px rgba(240,70,60,.5);animation:toastPop .34s cubic-bezier(.2,1.5,.4,1);
}
.toast.show.tone-good{
  background:linear-gradient(135deg,#8ce9a8,#4ade80);color:#0c5a2c;
  font-size:20px;font-weight:800;padding:16px 28px;
  box-shadow:0 8px 30px rgba(60,200,120,.5);animation:toastPop .34s cubic-bezier(.2,1.5,.4,1);
}
@keyframes toastPop{
  0%{transform:translate(-50%,-50%) scale(.6);}
  60%{transform:translate(-50%,-50%) scale(1.12);}
  100%{transform:translate(-50%,-50%) scale(1);}
}

/* 轻提示：用于「保存昵称 / 修改密码」这类安静的表单反馈。
   居中的大绿弹窗（tone-good）是给训练得分用的，放在资料页会盖住正在编辑的内容，太扎眼。
   这里改成顶部滑落的小胶囊，深色小字、不抢注意力。 */
.toast.pos-top{
  top:14px;left:50%;
  transform:translate(-50%,-16px);
  padding:9px 18px;border-radius:999px;
  font-size:13.5px;font-weight:600;letter-spacing:.2px;
  background:rgba(14,23,38,.94);color:#fff;
  box-shadow:0 10px 28px rgba(8,14,32,.30);
  z-index:120;
}
.toast.pos-top.show{transform:translate(-50%,0);}

.primary-btn.done{
  background:linear-gradient(135deg,#6ee7a8,#34c76a);
  box-shadow:0 6px 16px rgba(46,180,110,.38);
}

@media(min-width:720px){
  .module-grid{grid-template-columns:repeat(3,1fr);}
  .hero h1{font-size:26px;}
}

/* ---------- 手机竖屏（窄屏）优化 ---------- */
@media(max-width:480px){
  .screen{padding:12px;}
  .hero{padding:14px 6px 4px;}
  .hero-logo{font-size:46px;}
  .hero h1{font-size:19px;}
  /* 窄屏：分类标签缩小 + 自动换行，保证全部栏目都显示出来 */
  .cat-nav{gap:6px;}
  .cat-chip{padding:7px 11px;font-size:12px;}
  .module-grid{gap:10px;}
  .module-card{padding:13px;border-radius:16px;}
  .module-card .mc-icon{font-size:34px;}
  .module-card .mc-name{font-size:15px;}
  .module-card .mc-desc{font-size:11px;min-height:32px;}
  .bn-item{font-size:22px;}
  .bn-item span{font-size:10px;}
  .training-overlay{padding:18px;}
  .training-overlay h3{font-size:20px;}
  .training-overlay .big-btn{padding:13px 22px;font-size:15px;}
  .training-overlay .ov-steps li,.training-overlay .ov-guide{font-size:13px;}
  .panel{padding:15px;}
  .help-card{padding:12px;}
  /* 控件在窄屏一行一个更易操作 */
  .training-controls .ctrl-label{font-size:12px;}
}

/* ---------- 手机横屏：避免画布过高，压缩留白 ---------- */
@media(max-height:480px) and (orientation:landscape){
  .screen{padding:10px 14px;}
  .topbar{padding:8px 14px;}
  .training-controls{flex-wrap:wrap;}
}

/* ---------- 开场说明卡片（更易懂） ---------- */
.training-overlay .ov-icon{font-size:48px;line-height:1;margin-bottom:2px;}
.training-overlay h3{font-size:22px;}
.training-overlay .ov-goal{
  background:rgba(47,128,237,.18);border:1px solid rgba(86,204,242,.45);
  color:#bfe6ff;padding:11px 12px;border-radius:12px;font-size:14px;line-height:1.5;margin:8px 0;
}
.training-overlay .ov-steps{text-align:left;margin:12px auto;padding:0;list-style:none;max-width:380px;}
.training-overlay .ov-steps li{display:flex;gap:10px;align-items:flex-start;margin:9px 0;font-size:14px;line-height:1.5;color:#dbe7ff;}
.training-overlay .ov-num{flex:0 0 auto;width:22px;height:22px;border-radius:50%;background:#56ccf2;color:#06243a;display:flex;align-items:center;justify-content:center;font-weight:800;font-size:12px;}
.training-overlay .ov-guide{color:#9fb6d9;font-size:14px;line-height:1.7;max-width:400px;}

/* ---------- 全屏引导/弹层 ---------- */
.screen-overlay{
  position:fixed;inset:0;z-index:40;display:flex;align-items:center;justify-content:center;
  padding:22px;background:rgba(8,14,26,.94);
}
.so-card{
  background:#13203a;border-radius:20px;padding:24px;max-width:440px;width:100%;
  box-shadow:0 20px 60px rgba(0,0,0,.5);text-align:center;color:#eaf2ff;
}
.so-card h2{margin:0 0 4px;font-size:22px;}
.so-card .so-sub{color:#9fb6d9;font-size:13px;margin:0 0 12px;}
.so-steps{text-align:left;margin:12px 0 6px;padding:0;list-style:none;}
.so-steps li{display:flex;gap:10px;align-items:flex-start;margin:11px 0;font-size:14px;line-height:1.5;color:#cfe0ff;}
.so-num{flex:0 0 auto;width:24px;height:24px;border-radius:50%;background:#2f80ed;color:#fff;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:13px;}
.so-btn{display:block;width:100%;margin-top:10px;padding:14px;border-radius:14px;background:#2f80ed;color:#fff;font-size:16px;font-weight:700;}
.so-btn.ghost{background:#22335a;color:#cfe0ff;}

/* ---------- 激活弹层 ---------- */
.activate-input{
  width:100%;padding:12px 14px;border-radius:12px;border:1px solid var(--line);
  font-size:16px;text-align:center;letter-spacing:3px;background:#fbfdff;color:var(--ink);
  text-transform:uppercase;margin:6px 0;
}
.activate-input:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 3px rgba(47,128,237,.15);}
.activate-msg{min-height:18px;font-size:13px;margin:4px 0;text-align:center;color:var(--ink-soft);}
.activate-msg.err{color:var(--danger);}
.activate-msg.ok{color:var(--good);}
.activate-note{font-size:12px;color:#9fb6d9;margin-top:10px;line-height:1.6;text-align:left;}

/* ---------- 使用说明页 ---------- */
.help-card{background:#f6f9fd;border:1px solid var(--line);border-radius:14px;padding:14px;margin-bottom:12px;}
.help-card h3{margin:0 0 6px;font-size:16px;}
.help-card p,.help-card li{color:var(--ink-soft);font-size:13.5px;line-height:1.65;margin:4px 0;}
.help-card ul{margin:6px 0 0;padding-left:18px;}
.help-card .he{font-size:20px;margin-right:6px;}

/* ---------- 设置页：修改密码内联表单 ---------- */
#pwdBox input[type=password]{
  width:100%;padding:11px 12px;margin-top:8px;border:1px solid var(--line);border-radius:12px;
  font-size:15px;background:#fbfdff;color:var(--ink);
}
#pwdBox input[type=password]:focus{outline:none;border-color:var(--brand);background:#fff;}
#pwdMsg{color:var(--danger);font-size:12px;line-height:1.4;}

/* ================= 全屏适配（兼容所有浏览器与安卓版本） ================= */

/* 视口高度：优先用动态视口 dvh（地址栏收起/展开时自动跟随，不会留白边）；
   iOS 15.4 以下不支持 dvh，用 -webkit-fill-available 兜底；再老的版本吃 100vh。
   只作用于 body：给 html / #app 也加会让部分 Chrome 版本出现高度塌陷
   （子元素高度为 0 → 整页看不见也点不动），这里刻意收窄范围。 */
@supports (min-height: -webkit-fill-available) {
  body { min-height: -webkit-fill-available; }
}
@supports (min-height: 100dvh) {
  body { min-height: 100dvh; }
}

/* 进入 Fullscreen API 后，根元素与 body 必须显式铺满整屏，
   否则部分浏览器会按内容高度收缩，四周露出底色。 */
html:fullscreen, html:-webkit-full-screen, html:-ms-fullscreen,
body:fullscreen, body:-webkit-full-screen, body:-ms-fullscreen {
  width: 100%;
  height: 100%;
  min-height: 100%;
}

/* 全屏按钮：右下角胶囊，避开底部导航与刘海安全区；文字用中文，
   不用 ⛶ 之类的符号（部分安卓字体没有这个字形，会显示成空白方块）。 */
.rq-fs-btn{
  position:fixed;
  right:calc(12px + env(safe-area-inset-right,0px));
  bottom:calc(88px + env(safe-area-inset-bottom,0px));
  z-index:9999;
  padding:8px 15px;
  font:700 12.5px/1 -apple-system,"PingFang SC","Microsoft YaHei",sans-serif;
  color:#22406b;
  background:rgba(255,255,255,.82);
  border:1px solid rgba(37,99,201,.18);
  border-radius:999px;
  box-shadow:0 6px 18px rgba(31,73,150,.18);
  cursor:pointer;
  opacity:.92;
  -webkit-tap-highlight-color:transparent;
  transition:opacity .2s,background .2s;
}
.rq-fs-btn:active{opacity:1;}
.rq-fs-btn.is-on{color:#fff;background:rgba(31,92,196,.88);border-color:transparent;}
/* 训练中低调显示，避免挡住游戏操作；点按/悬停时恢复 */
body.is-training .rq-fs-btn{opacity:.45;}
body.is-training .rq-fs-btn:active{opacity:1;}
/* 训练页整屏都是游戏：按钮挪到左下角、缩到最小并半透明。
   之前它停在右下角 bottom:88px，正好压在底部答案按钮 / 调节控件上方，
   表现就是「全屏之后按钮点不动」。左下角只占极小一块，不干扰任何操作。 */
body.is-training .rq-fs-btn{
  right:auto;
  left:calc(8px + env(safe-area-inset-left,0px));
  bottom:calc(8px + env(safe-area-inset-bottom,0px));
  padding:5px 10px;
  font-size:11.5px;
  opacity:.28;
  box-shadow:none;
  border-color:rgba(255,255,255,.22);
}
body.is-training .rq-fs-btn:active{opacity:.92;}

/* 全屏提示条（不支持全屏 API 时给出可操作建议，而不是静默失败） */
.rq-fs-toast{
  position:fixed;
  left:50%;
  bottom:calc(132px + env(safe-area-inset-bottom,0px));
  transform:translateX(-50%);
  z-index:10000;
  max-width:84vw;
  padding:10px 16px;
  font:700 13px/1.6 -apple-system,"PingFang SC","Microsoft YaHei",sans-serif;
  color:#fff;
  background:rgba(24,44,86,.90);
  border-radius:14px;
  box-shadow:0 10px 30px rgba(15,30,60,.30);
  opacity:0;
  transition:opacity .25s;
  pointer-events:none;
}
.rq-fs-toast.show{opacity:1;}

/* ---- 兜底：整屏浮层绝不能在非训练状态下残留 ----
   开场/结束页 .training-overlay 是 position:fixed; inset:0; z-index:60 的整屏层，
   只要有一次没被清掉（退出全屏、切页、异常中断），它就会盖住整个界面，
   表现正是「全屏之后很多地方点不动，退出全屏也一样」。
   这里加一道保险：不在训练态时，这类整屏层一律不参与显示与点击。 */
body:not(.is-training) .training-overlay{display:none!important;}
body:not(.is-training) .screen-training{position:static!important;inset:auto!important;}
