/* ============================================================
   少儿西语点读 H5 —— 阅读端样式
   视觉基准：客户提供的 UI 参考图（奶油底 + 粉色主色 + 圆角卡片）
   ============================================================ */
:root{
  --cream:#FBF3E7;
  --cream-2:#F6E9D8;
  --card:#FFFFFF;
  --pink:#FF7FA8;
  --pink-2:#FFA1C0;
  --pink-deep:#E8628F;
  --orange:#FF9F45;
  --orange-2:#FFB86B;
  --ink:#4C3A32;
  --ink-2:#6E584C;
  --muted:#A8968A;
  --line:#F0E2D2;
  --shadow:0 6px 20px rgba(206,152,112,.16);
  --shadow-lg:0 10px 30px rgba(206,152,112,.24);
  --r:20px;
  --safe-b:env(safe-area-inset-bottom,0px);
  --safe-t:env(safe-area-inset-top,0px);
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent;}
html,body{margin:0;padding:0;height:100%;}
body{
  background:var(--cream);
  color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",system-ui,sans-serif;
  font-size:15px;line-height:1.45;
  overscroll-behavior:none;
  -webkit-font-smoothing:antialiased;
}
button{font-family:inherit;border:0;background:none;padding:0;color:inherit;cursor:pointer;}
img{display:block;}
.shell{height:100dvh;display:flex;flex-direction:column;overflow:hidden;position:relative;}

/* ---------------------------------------------------------- 顶部栏 */
.topbar{
  flex:0 0 auto;display:flex;align-items:center;gap:8px;
  padding:calc(var(--safe-t) + 10px) 14px 8px;
}
.topbar h1{
  flex:1;margin:0;font-size:17px;font-weight:800;text-align:center;
  letter-spacing:.2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.topbar .sub{display:block;font-size:11px;font-weight:600;color:var(--muted);letter-spacing:.4px;}
/* 标题音频：有音频时可点，喇叭小图标 */
.topbar h1.has-audio{cursor:pointer;-webkit-tap-highlight-color:transparent;}
.topbar h1.has-audio:active{opacity:.7;}
.topbar h1 .ta-ic{display:inline-block;width:15px;height:15px;margin-left:3px;vertical-align:-1.5px;color:#C2571B;}
.topbar h1 .ta-ic svg{width:100%;height:100%;}
.icon-btn{
  width:36px;height:36px;flex:0 0 36px;display:grid;place-items:center;
  border-radius:50%;background:#fff;box-shadow:0 2px 8px rgba(206,152,112,.18);
  color:var(--ink-2);transition:transform .15s;
}
.icon-btn:active{transform:scale(.92);}
.icon-btn.ghost{background:transparent;box-shadow:none;}
.icon-btn svg{width:19px;height:19px;}

/* ---------------------------------------------------------- 书架 */
.shelf-scroll{flex:1;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;padding-bottom:calc(var(--safe-b) + 24px);}
.stage-tabs{display:flex;gap:8px;padding:4px 14px 12px;}
.stage-tab{
  flex:1;height:34px;border-radius:999px;background:#fff;color:var(--ink-2);
  font-size:14px;font-weight:800;box-shadow:0 2px 8px rgba(206,152,112,.14);
  transition:.2s;
}
.stage-tab.on{background:linear-gradient(135deg,var(--pink-2),var(--pink));color:#fff;box-shadow:0 6px 16px rgba(255,127,168,.36);}

.hero{
  margin:0 14px 16px;padding:16px 18px;border-radius:24px;position:relative;overflow:hidden;
  background:linear-gradient(120deg,#FFF4E2,#FFE7D6 60%,#FFDDE8);
  box-shadow:var(--shadow);
}
.hero:after{
  content:"";position:absolute;right:-40px;bottom:-50px;width:150px;height:150px;
  border-radius:50%;background:rgba(255,255,255,.45);
}
.hero-badge{
  display:inline-flex;align-items:center;gap:6px;height:24px;padding:0 12px;border-radius:999px;
  background:linear-gradient(135deg,var(--pink-2),var(--pink));color:#fff;
  font-size:12px;font-weight:800;letter-spacing:.5px;
}
.hero h2{margin:8px 0 4px;font-size:21px;font-weight:900;letter-spacing:.5px;}
.hero p{margin:0;font-size:12.5px;color:#9A7F6C;max-width:66%;}
.hero-art{
  position:absolute;right:14px;bottom:8px;width:92px;height:92px;border-radius:50%;
  background:radial-gradient(circle at 40% 35%,#fff,#FFE3C6);
  display:grid;place-items:center;font-size:46px;box-shadow:0 6px 18px rgba(214,160,120,.24);
  animation:float 3.4s ease-in-out infinite;
}
@keyframes float{0%,100%{transform:translateY(0)}50%{transform:translateY(-6px)}}

/* 阶段横幅：后台上传的图铺满卡片，左侧叠白色渐变保证文字可读 */
.hero-inner{position:relative;z-index:2;}
.hero.has-banner{min-height:112px;display:flex;flex-direction:column;justify-content:center;background:#FFEFE0;}
.hero.has-banner .hero-bg{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center right;z-index:0;}
.hero.has-banner:before{
  content:"";position:absolute;inset:0;z-index:1;
  background:linear-gradient(90deg,rgba(255,255,255,.97) 0%,rgba(255,255,255,.94) 40%,
    rgba(255,255,255,.66) 62%,rgba(255,255,255,.12) 90%);
}
.hero.has-banner .hero-inner{padding-right:38%;}
.hero.has-banner h2{text-shadow:0 1px 0 rgba(255,255,255,.8);}
.hero.has-banner:after{display:none;}

.sec-title{display:flex;align-items:center;gap:8px;margin:0 18px 10px;font-size:13px;font-weight:800;color:var(--ink-2);}
.sec-title:before{content:"";width:4px;height:14px;border-radius:2px;background:linear-gradient(var(--pink),var(--orange));}

.book-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:14px 12px;padding:0 14px;}
.book{position:relative;text-align:center;transition:transform .16s;}
.book:active{transform:scale(.96);}
.book .cover{
  position:relative;aspect-ratio:1/1;border-radius:14px;overflow:hidden;background:#fff;
  box-shadow:0 4px 14px rgba(206,152,112,.2);
}
.book .cover img{width:100%;height:100%;object-fit:cover;}
.book .cover.ph{
  display:grid;place-items:center;
  background:linear-gradient(160deg,#FDF0E2,#F7E3D3);
  border:1.5px dashed #E9D2BC;
}
.book .cover.ph .ph-ico{opacity:.55;font-size:26px;}
.book .lock{
  position:absolute;inset:0;display:grid;place-items:center;background:rgba(255,255,255,.55);
  backdrop-filter:blur(1px);font-size:22px;
}
.book .name{
  margin-top:6px;font-size:11.5px;font-weight:700;color:var(--ink-2);
}
.book .name small{display:block;font-size:10px;font-weight:600;color:var(--muted);margin-top:1px;}
.book .badge-new{
  position:absolute;left:6px;top:6px;height:18px;padding:0 7px;border-radius:999px;
  background:linear-gradient(135deg,var(--orange),#FF8A3D);color:#fff;font-size:10px;font-weight:800;
  display:grid;place-items:center;box-shadow:0 2px 6px rgba(255,159,69,.4);
}
.tip{
  margin:18px 20px 0;text-align:center;font-size:11.5px;color:var(--muted);
}
.icp{
  margin:10px 20px 4px;text-align:center;font-size:11px;color:var(--muted);
}
.icp a{color:inherit;text-decoration:none;}

/* ---------------------------------------------------------- 场景目录 */
.book-head{
  margin:0 14px 14px;padding:14px 16px;border-radius:22px;display:flex;align-items:center;gap:12px;
  background:linear-gradient(120deg,#fff,#FFF6EA);box-shadow:var(--shadow);
}
.book-head .bh-cover{width:52px;height:52px;border-radius:10px;object-fit:cover;box-shadow:0 3px 10px rgba(206,152,112,.24);flex:0 0 auto;background:#F7E6D6;}
.book-head .bh-txt{flex:1;min-width:0;}
.book-head .bh-txt b{display:block;font-size:16px;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.book-head .bh-txt span{font-size:12px;color:var(--muted);font-weight:600;}
.book-head .bh-art{font-size:34px;flex:0 0 auto;}

.scene-list{padding:0 14px;display:flex;flex-direction:column;gap:9px;}
.scene-row{
  display:flex;align-items:center;gap:12px;padding:10px 12px;border-radius:16px;
  background:#fff;box-shadow:0 3px 10px rgba(206,152,112,.12);transition:transform .15s;
}
.scene-row:active{transform:scale(.985);}
.scene-row .no{
  width:30px;height:30px;flex:0 0 30px;border-radius:10px;display:grid;place-items:center;
  font-size:12.5px;font-weight:900;color:var(--pink-deep);background:#FFF0F5;
}
.scene-row:nth-child(2n) .no{color:#E08A2E;background:#FFF5E8;}
.scene-row .st{flex:1;min-width:0;}
.scene-row .st b{display:block;font-size:14.5px;font-weight:800;letter-spacing:.2px;}
.scene-row .st span{font-size:11.5px;color:var(--muted);}
.scene-row .thumb{
  width:46px;height:46px;flex:0 0 46px;border-radius:11px;overflow:hidden;background:#F7E6D6;
  display:grid;place-items:center;font-size:18px;
}
.scene-row .thumb img{width:100%;height:100%;object-fit:cover;}
.scene-row .chev{color:#D9C6B6;font-size:18px;font-weight:700;}

/* ---------------------------------------------------------- 阅读页 */
.reader{flex:1;min-height:0;display:flex;flex-direction:column;position:relative;}
.modes{
  flex:0 0 auto;display:flex;gap:6px;justify-content:center;padding:2px 8px 7px;flex-wrap:nowrap;
}
.seg{display:flex;background:#fff;border-radius:999px;padding:3px;box-shadow:0 3px 10px rgba(206,152,112,.16);flex:0 1 auto;min-width:0;}
.seg button{
  display:flex;align-items:center;gap:4px;height:29px;padding:0 9px;border-radius:999px;
  font-size:11.5px;font-weight:800;color:#A08D82;transition:.2s;white-space:nowrap;
}
.seg button svg{width:13px;height:13px;flex:0 0 13px;}
.seg button.on{color:#fff;}
.seg.pink button.on{background:linear-gradient(135deg,var(--pink-2),var(--pink));box-shadow:0 3px 10px rgba(255,127,168,.4);}
.seg.amber button.on{background:linear-gradient(135deg,var(--orange-2),var(--orange));box-shadow:0 3px 10px rgba(255,159,69,.4);}

.stage-wrap{flex:1;min-height:0;display:flex;padding:0 10px;}
.stage{
  --s:4px;
  position:relative;margin:auto;background:#F3E6D7;border-radius:16px;overflow:hidden;
  box-shadow:0 8px 26px rgba(180,133,98,.22);
}
.stage .bg{width:100%;height:100%;object-fit:contain;user-select:none;-webkit-user-drag:none;}
.stage .hotspots{position:absolute;inset:0;}
.stage .empty{
  position:absolute;inset:0;z-index:3;display:grid;place-items:center;text-align:center;
  color:#B49B87;font-size:13px;padding:24px;line-height:1.7;
}
.stage .empty b{display:block;font-size:15px;color:#8E7565;margin-bottom:6px;}
.leaders{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible;z-index:3;}

/* 热区通用 */
.hs{position:absolute;cursor:pointer;}
.hs .dot{
  position:absolute;border-radius:50%;display:grid;place-items:center;color:#fff;
  box-shadow:0 3px 10px rgba(0,0,0,.18);
}
.hs .dot svg{width:60%;height:60%;}
/* 句子喇叭：粉；词汇喇叭：橙 */
.hs .dot.pink{background:linear-gradient(135deg,#FF87B1,#ED4B80);}
.hs .dot.orange{background:linear-gradient(135deg,#FFB65C,#F07C0C);}
.hs .dot:after{
  content:"";position:absolute;inset:-3px;border-radius:50%;border:2px solid rgba(255,255,255,.85);
}
.hs.playing .dot{animation:pulse .9s ease-out infinite;}
@keyframes pulse{
  0%{box-shadow:0 3px 10px rgba(0,0,0,.18),0 0 0 0 rgba(255,127,168,.55)}
  100%{box-shadow:0 3px 10px rgba(0,0,0,.18),0 0 0 12px rgba(255,127,168,0)}
}

/* 对话气泡：浅色半透明、按文字收缩，尽量不挡人物 */
.hs-bubble .bubble{
  position:absolute;left:0;bottom:0;width:100%;height:auto;
  background:rgba(255,255,255,.9);
  -webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);
  /* 椭圆气泡：内边距按比例留够，文字落在椭圆的内接矩形里，四角不会被弧线裁掉 */
  border-radius:50%;padding:.68em 12%;
  display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;
  text-align:center;text-overflow:ellipsis;
  font-size:calc(var(--s) * 2.6);font-weight:800;line-height:1.18;color:#2E2823;
  box-shadow:0 4px 14px rgba(150,100,80,.16);
  /* 描边色由后台配置：--hs-stroke 在打开场景时写到 .stage 上；
     没设置时回落到原来的浅杏色。改颜色不用改代码。 */
  border:1.5px solid var(--hs-stroke, rgba(228,180,128,.8));
  transform-origin:50% 100%;
  transition:opacity .18s, transform .18s;
}
.hs-bubble .bubble.long{font-size:calc(var(--s) * 2.4);}
.hs-bubble .dot{width:calc(var(--s) * 5.4);height:calc(var(--s) * 5.4);right:calc(var(--s) * -2.2);bottom:calc(var(--s) * -2.2);}
.hs-bubble:active .bubble{transform:scale(.97);}

/* 纯听力：隐藏气泡与文字，只留喇叭 */
.mode-listen .hs-bubble .bubble{opacity:0;pointer-events:none;}
.mode-listen .hs-bubble .dot{right:0;bottom:0;}

/* 词汇喇叭（尺寸与句子喇叭一致：5.4） */
.hs-vocab .dot{width:calc(var(--s) * 5.4);height:calc(var(--s) * 5.4);left:0;top:50%;transform:translateY(-50%);}
.hs-vocab .hit{position:absolute;inset:0;border-radius:12px;}

/* 词卡 */
.wordcard{
  position:absolute;z-index:6;min-width:86px;padding:9px 13px;border-radius:14px;
  background:#FFFDF8;
  /* 词汇气泡（词卡）描边：与对话气泡同一个 --hs-stroke，后台改色两边一起变 */
  border:1.5px solid var(--hs-stroke, rgba(228,180,128,.8));
  box-shadow:0 8px 22px rgba(200,140,90,.28);
  animation:pop .18s ease-out;
}
@keyframes pop{from{transform:scale(.86);opacity:0}to{transform:scale(1);opacity:1}}
.wordcard b{display:block;font-size:calc(var(--s) * 3.8);font-weight:900;color:#2E2823;line-height:1.2;}
.wordcard span{display:block;font-size:calc(var(--s) * 2.8);color:#7C6B5C;margin-top:1px;}
.wordcard .wc-dot{
  position:absolute;left:-9px;top:50%;transform:translateY(-50%);
  width:calc(var(--s) * 6);height:calc(var(--s) * 6);border-radius:50%;
  background:linear-gradient(135deg,#FFC078,#FF922E);display:grid;place-items:center;color:#fff;
  box-shadow:0 2px 8px rgba(255,146,46,.5);
}
.wordcard .wc-dot svg{width:62%;height:62%;}

/* 字幕条 */
.subtitle{
  position:absolute;left:10px;right:10px;bottom:calc(64px + var(--safe-b));z-index:22;
  margin:0;padding:8px 10px;border-radius:18px;background:#fff;
  box-shadow:0 8px 24px rgba(150,100,75,.26);display:flex;align-items:center;gap:9px;
  transition:opacity .2s, transform .2s;
}
.subtitle.hide{opacity:0;transform:translateY(10px);pointer-events:none;}
.subtitle .avatar{
  width:34px;height:34px;flex:0 0 34px;border-radius:50%;overflow:hidden;background:#FFF0F5;
  display:grid;place-items:center;font-size:18px;
}
/* 角色头像图（后台角色管理上传）；容器已是圆形裁切 */
.subtitle .avatar img{width:100%;height:100%;object-fit:cover;}
.subtitle .txt{flex:1;min-width:0;}
.subtitle .who{font-size:11px;font-weight:900;color:var(--pink-deep);}
.subtitle .es{font-size:14px;font-weight:800;color:var(--ink);line-height:1.25;}
.subtitle .zh{font-size:11.5px;color:var(--muted);margin-top:1px;}
.subtitle .play{
  width:34px;height:34px;flex:0 0 34px;border-radius:50%;display:grid;place-items:center;color:#fff;
  background:linear-gradient(135deg,var(--pink-2),var(--pink));box-shadow:0 4px 12px rgba(255,127,168,.42);
}
.subtitle .play svg{width:16px;height:16px;}
.subtitle .hint{font-size:10.5px;color:#C9A98E;margin-top:2px;}

/* 底栏 */
.bottombar{
  flex:0 0 auto;display:flex;align-items:center;gap:4px;
  padding:7px 8px calc(7px + var(--safe-b));
  background:linear-gradient(#FFFFFF,#FFFCF7);
  box-shadow:0 -3px 16px rgba(206,152,112,.16);
  border-radius:20px 20px 0 0;
}
.bb{
  flex:0 0 auto;display:flex;flex-direction:column;align-items:center;gap:1px;
  padding:4px 7px;border-radius:12px;color:#8E7A6C;font-size:10px;font-weight:700;
  min-width:44px;transition:.15s;
}
.bb svg{width:19px;height:19px;}
.bb:disabled{opacity:.32;}
.bb:active:not(:disabled){background:#FFF3F7;}
.bb-main{
  flex:1 1 auto;min-width:0;height:42px;border-radius:999px;display:flex;align-items:center;justify-content:center;gap:6px;
  color:#fff;font-size:14px;font-weight:900;letter-spacing:.5px;padding:0 10px;
  background:linear-gradient(135deg,var(--pink-2),var(--pink));
  box-shadow:0 6px 16px rgba(255,127,168,.4);transition:.15s;
}
.bb-main svg{width:17px;height:17px;flex:0 0 auto;}
.bb-main.amber{background:linear-gradient(135deg,var(--orange-2),var(--orange));box-shadow:0 6px 16px rgba(255,159,69,.4);}
.bb-main:active{transform:scale(.97);}
.bb-main.play > span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}

/* ---------------------------------------------------------- 弹层 */
.mask{
  position:fixed;inset:0;background:rgba(60,40,30,.42);z-index:50;
  opacity:0;transition:opacity .22s;backdrop-filter:blur(2px);
}
.mask.on{opacity:1;}
.sheet{
  position:fixed;left:0;right:0;bottom:0;z-index:51;max-height:78dvh;
  background:var(--cream);border-radius:26px 26px 0 0;display:flex;flex-direction:column;
  transform:translateY(102%);transition:transform .28s cubic-bezier(.3,.9,.3,1);
  padding-bottom:var(--safe-b);box-shadow:0 -8px 30px rgba(120,80,60,.24);
}
.sheet.on{transform:translateY(0);}
.sheet-head{flex:0 0 auto;padding:14px 18px 8px;display:flex;align-items:center;justify-content:space-between;}
.sheet-head h3{margin:0;font-size:16px;font-weight:900;}
.sheet-body{flex:1;min-height:0;overflow-y:auto;padding:0 14px 18px;}
.sheet .grab{width:38px;height:4px;border-radius:2px;background:#E4D2C0;margin:8px auto 0;}

.toc-row{
  display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:14px;background:#fff;margin-bottom:8px;
}
.toc-row.cur{background:linear-gradient(135deg,#FFF0F5,#FFE7F0);box-shadow:inset 0 0 0 1.5px var(--pink-2);}
.toc-row .no{width:26px;height:26px;border-radius:9px;display:grid;place-items:center;font-size:12px;font-weight:900;color:#B98C74;background:#FBF0E6;}
.toc-row.cur .no{color:#fff;background:linear-gradient(135deg,var(--pink-2),var(--pink));}
.toc-row b{flex:1;font-size:14px;font-weight:800;}
.toc-row span{font-size:11px;color:var(--muted);}

.setting-row{
  display:flex;align-items:center;gap:12px;padding:14px 16px;background:#fff;border-radius:16px;margin-bottom:10px;
}
.setting-row .sr-txt{flex:1;}
.setting-row b{display:block;font-size:14px;font-weight:800;}
.setting-row span{font-size:11.5px;color:var(--muted);}
.switch{width:48px;height:28px;border-radius:999px;background:#E6D5C6;position:relative;transition:.2s;flex:0 0 48px;}
.switch:after{content:"";position:absolute;left:3px;top:3px;width:22px;height:22px;border-radius:50%;background:#fff;box-shadow:0 2px 6px rgba(0,0,0,.16);transition:.2s;}
.switch.on{background:linear-gradient(135deg,var(--pink-2),var(--pink));}
.switch.on:after{left:23px;}

.search-box{display:flex;gap:8px;padding:0 4px 12px;}
.search-box input{
  flex:1;height:42px;border-radius:14px;border:1.5px solid #EEDCC9;background:#fff;
  padding:0 14px;font-size:14px;color:var(--ink);outline:none;font-family:inherit;
}
.search-box input:focus{border-color:var(--pink-2);}

/* ---------------------------------------------------------- 本页词汇表 */
.vb-count{padding:0 6px 10px;font-size:11.5px;color:var(--muted);}
.vb-count b{color:var(--orange);font-size:13px;}
.vb-list{display:flex;flex-direction:column;gap:8px;}
.vb-row{
  display:flex;align-items:center;gap:10px;padding:9px 12px;border-radius:16px;background:#fff;
  box-shadow:0 3px 12px rgba(206,152,112,.12);transition:.18s;
}
.vb-row:active{background:#FFF7EE;transform:scale(.99);}
.vb-row.playing{background:linear-gradient(135deg,#FFF6EC,#FFF0E0);box-shadow:inset 0 0 0 1.8px var(--orange);}
.vb-no{
  width:24px;height:24px;flex:0 0 24px;border-radius:8px;display:grid;place-items:center;
  font-size:11.5px;font-weight:900;color:#B98C74;background:#FBF0E6;
}
.vb-row.playing .vb-no{color:#fff;background:linear-gradient(135deg,var(--orange-2),var(--orange));}
.vb-txt{flex:1;min-width:0;}
.vb-txt b{display:block;font-size:15px;font-weight:900;color:#2E2823;line-height:1.25;}
.vb-txt span{display:block;font-size:11.5px;color:var(--muted);margin-top:1px;}
.vb-tag{
  flex:0 0 auto;font-style:normal;font-size:9.5px;font-weight:800;color:#B98C74;
  background:#FBF0E6;border-radius:7px;padding:2px 6px;
}
.vb-play{
  width:34px;height:34px;flex:0 0 34px;border-radius:50%;display:grid;place-items:center;color:#fff;
  background:linear-gradient(135deg,#FFB65C,#F07C0C);box-shadow:0 3px 10px rgba(240,124,12,.34);
}
.vb-play svg{width:17px;height:17px;}
.vb-row.playing .vb-play{animation:pulse 1s ease-out infinite;}
.vb-empty{
  padding:16px 14px 20px;font-size:12.5px;color:#9C8B7C;line-height:1.85;text-align:center;
}
.vb-empty b{display:block;font-size:14.5px;color:#7A6455;margin-bottom:6px;}

/* ---------------------------------------------------------- 全屏 / 沉浸模式 */
body.fs{background:#0F0B09;}
body.fs .topbar,
body.fs .modes,
body.fs .bottombar,
body.fs .admin-bar{display:none;}
body.fs .stage-wrap{padding:0;background:#0F0B09;}
body.fs .stage{border-radius:0;box-shadow:none;}
body.fs .subtitle{bottom:calc(16px + var(--safe-b));box-shadow:0 8px 28px rgba(0,0,0,.4);}
.fs-exit{
  position:fixed;right:12px;top:calc(12px + var(--safe-t));z-index:45;
  display:flex;align-items:center;gap:5px;height:32px;padding:0 12px;border-radius:999px;
  background:rgba(30,22,18,.6);color:#fff;font-size:11.5px;font-weight:800;
  -webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);
  box-shadow:0 4px 14px rgba(0,0,0,.28);opacity:.9;
}
.fs-exit svg{width:15px;height:15px;}
.fs-exit:active{transform:scale(.95);}

/* 激活 / 通用弹窗 */
.modal{
  position:fixed;z-index:60;left:50%;top:50%;transform:translate(-50%,-46%) scale(.96);
  width:min(88vw,360px);background:var(--cream);border-radius:26px;padding:22px 20px 18px;
  box-shadow:0 20px 60px rgba(80,50,35,.3);opacity:0;transition:.24s;
}
.modal.on{opacity:1;transform:translate(-50%,-50%) scale(1);}
.modal h3{margin:0 0 6px;font-size:18px;font-weight:900;text-align:center;}
.modal p{margin:0 0 16px;font-size:12.5px;color:var(--muted);text-align:center;line-height:1.6;}
.modal .field{
  width:100%;height:50px;border-radius:15px;border:1.5px solid #EEDCC9;background:#fff;
  text-align:center;font-size:18px;font-weight:800;letter-spacing:2px;color:var(--ink);
  outline:none;font-family:inherit;text-transform:uppercase;
}
.modal .field:focus{border-color:var(--pink-2);}
.modal .primary{
  width:100%;height:48px;margin-top:14px;border-radius:15px;color:#fff;font-size:15px;font-weight:900;
  background:linear-gradient(135deg,var(--pink-2),var(--pink));box-shadow:0 8px 20px rgba(255,127,168,.4);
}
.modal .primary:disabled{opacity:.6;}
.modal .err{min-height:16px;margin-top:8px;font-size:12px;color:#E8574F;text-align:center;}
.auth-tabs{display:flex;gap:6px;margin-bottom:14px;background:#F7EBDD;border-radius:13px;padding:4px;}
.auth-tabs button{flex:1;height:38px;border-radius:10px;font-size:14px;font-weight:800;color:#B49B87;}
.auth-tabs button.on{background:#fff;color:var(--ink);box-shadow:0 2px 8px rgba(80,50,35,.12);}
.modal .field{letter-spacing:1px;font-size:16px;text-align:left;padding:0 16px;margin-top:8px;}
.modal .field + .field{margin-top:10px;}
.auth-tip{margin:12px 0 0;font-size:11.5px;color:#C1AC9C;text-align:center;line-height:1.6;}
/* 注册成功后的账号信息卡片 */
.pwd-note{background:#FFF6E9;border:1.5px solid #F3DFC4;border-radius:14px;padding:10px 14px;}
.pwd-note .pn-row{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:5px 0;font-size:12.5px;color:#A98D74;}
.pwd-note .pn-row + .pn-row{border-top:1px dashed #F0DCC2;}
.pwd-note .pn-row b{color:#5A4232;font-size:14px;font-weight:900;letter-spacing:.4px;text-align:right;}
.pwd-note .pn-row b small{font-size:11.5px;font-weight:700;letter-spacing:0;color:#8A6F58;}
/* 管理员预览入口 / 预览条 */
.modal .admin-pv{
  width:100%;height:34px;margin-top:10px;border-radius:12px;border:1.5px dashed #E3CFB8;
  background:#FFFDF8;color:#A97C4E;font-size:12px;font-weight:800;
}
.modal .admin-pv:hover{border-color:#E8B07A;background:#FFF6EA;color:#8A5F2E;}
.admin-bar{
  flex:0 0 auto;display:flex;align-items:center;gap:8px;margin:0 10px 6px;padding:6px 11px;
  border-radius:12px;background:#FFF6E5;border:1px solid #F6DFAE;color:#9A6B1E;
  font-size:11.5px;font-weight:800;
}
.admin-bar b{margin-left:auto;color:#C0692E;font-weight:900;cursor:pointer;white-space:nowrap;}
.link-btn{font-size:12.5px;font-weight:800;color:#D8477B;background:none;padding:6px 2px;}

/* toast */
.toast{
  position:fixed;left:50%;bottom:22%;transform:translate(-50%,10px);z-index:80;
  background:rgba(60,42,32,.9);color:#fff;font-size:13px;font-weight:600;
  padding:9px 16px;border-radius:999px;opacity:0;transition:.24s;pointer-events:none;max-width:80vw;
}
.toast.on{opacity:1;transform:translate(-50%,0);}

/* 加载 */
.loading{display:grid;place-items:center;padding:60px 0;color:var(--muted);font-size:13px;}
.spin{width:26px;height:26px;border-radius:50%;border:2.5px solid #EEDCC9;border-top-color:var(--pink);animation:sp .8s linear infinite;margin-bottom:10px;}
@keyframes sp{to{transform:rotate(360deg)}}

/* 横屏提示 */
@media (orientation:landscape) and (max-height:520px){
  .shelf-scroll{display:none;}
  .shell:after{content:"请竖屏使用，阅读体验更佳";display:grid;place-items:center;height:100%;color:var(--muted);font-size:14px;}
}

/* 词卡防溢出 */
.wordcard{max-width:58%;}

/* 登录设备：选择移除的旧设备 */
.dev-row{
  display:flex;align-items:center;gap:10px;padding:10px 12px;margin-bottom:8px;
  border:1.5px solid #EADCC9;border-radius:12px;background:#FFFDF8;cursor:pointer;
}
.dev-row:has(input:checked){border-color:var(--orange,#FF9F45);background:#FFF7EE;}
.dev-row input{accent-color:#FF9F45;margin:0;}
.dev-row .dv-t{display:flex;flex-direction:column;gap:2px;min-width:0;}
.dev-row .dv-t b{font-size:13.5px;color:#2E2823;}
.dev-row .dv-t small{font-size:11px;color:#B49B87;}
