/* ════════════════════════════════════════════════════════════
   你相信光吗 — 界面样式
   设计取向:界面必须退到光后面。所有 chrome 都是半透明、低对比、
   会自动消失的。任何时候画面主角只能是那团光。
   ════════════════════════════════════════════════════════════ */

:root{
  --ink:        rgba(255,255,255,.92);
  --ink-2:      rgba(255,255,255,.58);
  --ink-3:      rgba(255,255,255,.34);
  --line:       rgba(255,255,255,.12);
  --line-2:     rgba(255,255,255,.07);
  --glass:      rgba(14,14,18,.62);
  --glass-2:    rgba(22,22,28,.72);
  --accent:     #ffb27a;
  --radius:     14px;
  --ease:       cubic-bezier(.22,.61,.36,1);
  --safe-b:     env(safe-area-inset-bottom, 0px);
  --safe-t:     env(safe-area-inset-top, 0px);
}

*{ margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }

html,body{
  height:100%;
  overflow:hidden;
  background:#000;
  color:var(--ink);
  font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB",
              "Microsoft YaHei","Segoe UI",Roboto,"Helvetica Neue",sans-serif;
  font-weight:300;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  overscroll-behavior:none;
  touch-action:manipulation;
}

button,input{ font:inherit; color:inherit; background:none; border:none; cursor:pointer; }
svg{ width:100%; height:100%; fill:none; stroke:currentColor; stroke-width:1.4;
     stroke-linecap:round; stroke-linejoin:round; }
[hidden]{ display:none !important; }

/* ── 画布 ────────────────────────────────────────────────── */
#stage{
  position:fixed; inset:0; width:100%; height:100%;
  display:block; z-index:0;
}
/* 超暗模式:叠一层可调的半透明黑,能压到比系统最低亮度还暗 */
#dimmer{
  position:fixed; inset:0; z-index:1; pointer-events:none;
  background:#000; opacity:0;
  transition:opacity .5s var(--ease);
}

/* ════ 加载层 ═══════════════════════════════════════════════ */
.boot{
  position:fixed; inset:0; z-index:60;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:0; background:#000;
  transition:opacity .9s var(--ease);
}
.boot.is-gone{ opacity:0; pointer-events:none; }

.boot__orb{
  width:132px; height:132px; margin-bottom:34px;
  border-radius:50%;
  background:radial-gradient(circle at 50% 50%,
    rgba(255,255,255,.95) 0%,
    rgba(255,214,160,.75) 18%,
    rgba(255,140,60,.34) 42%,
    rgba(255,90,40,.08) 66%,
    transparent 76%);
  filter:blur(3px);
  animation:orbBreathe 6.4s var(--ease) infinite;
}
@keyframes orbBreathe{
  0%,100%{ transform:scale(.82); opacity:.55; }
  46%    { transform:scale(1.1);  opacity:1;   }
}

.boot__title{
  font-size:clamp(23px,5.6vw,32px); font-weight:250;
  letter-spacing:.42em; text-indent:.42em;
  color:var(--ink);
}
.boot__sub{
  margin-top:14px; font-size:12.5px; font-weight:300;
  letter-spacing:.3em; text-indent:.3em; color:var(--ink-3);
}
.boot__bar{
  width:min(190px,42vw); height:1px; margin-top:44px;
  background:var(--line-2); overflow:hidden;
}
.boot__bar i{
  display:block; height:100%; width:0;
  background:linear-gradient(90deg,rgba(255,178,122,.25),var(--accent));
  box-shadow:0 0 12px rgba(255,178,122,.75);
  transition:width .35s var(--ease);
}
.boot__hint{
  margin-top:16px; font-size:11px; letter-spacing:.22em;
  color:var(--ink-3); font-variant-numeric:tabular-nums;
  min-height:1.2em;
}
@keyframes fadeUp{ from{ opacity:0; transform:translateY(10px);} to{ opacity:1; transform:none;} }

/* ════ WebGL 降级层 ════════════════════════════════════════ */
.fallback{
  position:fixed; inset:0; z-index:70;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:16px; padding:32px; text-align:center; background:#000;
}
.fallback__orb{
  width:150px; height:150px; border-radius:50%; margin-bottom:12px;
  background:radial-gradient(circle,rgba(255,255,255,.9),rgba(255,170,90,.4) 35%,transparent 70%);
  filter:blur(6px); animation:orbBreathe 7s var(--ease) infinite;
}
.fallback h2{ font-size:17px; font-weight:300; letter-spacing:.12em; }
.fallback p{ font-size:13px; line-height:1.9; color:var(--ink-2); max-width:30em; }

/* ════ 主界面壳 ════════════════════════════════════════════ */
.ui{
  position:fixed; inset:0; z-index:10; pointer-events:none;
  transition:opacity .6s var(--ease);
}
.ui > *{ pointer-events:auto; }
/* 静置数秒后整个界面淡出,只留光。
   注意:淡出时绝不能关 pointer-events —— 关了的话空闲后的第一次点击
   会被吞掉(只用于唤醒界面),用户感知就是"点了没反应"。 */
.ui.is-idle{ opacity:0; }

/* ── 顶栏 ────────────────────────────────────────────────── */
.topbar{
  position:absolute; top:0; left:0; right:0;
  display:flex; align-items:center; justify-content:space-between;
  padding:calc(16px + var(--safe-t)) 18px 16px;
  pointer-events:none;
}
.topbar > *{ pointer-events:auto; }
.brand{ display:flex; align-items:center; gap:9px; }
.brand__dot{
  width:6px; height:6px; border-radius:50%; background:var(--accent);
  box-shadow:0 0 10px var(--accent); animation:orbBreathe 6.4s var(--ease) infinite;
}
.brand__name{
  font-size:12px; letter-spacing:.28em; color:var(--ink-2); white-space:nowrap;
}
.topbar__right{ display:flex; align-items:center; gap:6px; }
.stat{
  font-size:10.5px; letter-spacing:.1em; color:var(--ink-3);
  font-variant-numeric:tabular-nums; margin-right:4px; white-space:nowrap;
}

.iconbtn{
  width:38px; height:38px; padding:10px; border-radius:50%;
  color:var(--ink-2);
  transition:background .25s var(--ease), color .25s var(--ease), transform .25s var(--ease);
}
.iconbtn:hover{ background:rgba(255,255,255,.08); color:var(--ink); }
.iconbtn:active{ transform:scale(.92); }
.iconbtn--sm{ width:30px; height:30px; padding:7px; }

/* ── 模式切换 ────────────────────────────────────────────── */
.modes{
  position:absolute; left:50%; bottom:calc(26px + var(--safe-b));
  transform:translateX(-50%);
  display:flex; gap:6px; padding:5px;
  background:var(--glass); backdrop-filter:blur(22px) saturate(1.5);
  -webkit-backdrop-filter:blur(22px) saturate(1.5);
  border:1px solid var(--line-2); border-radius:100px;
}
.mode{
  display:flex; align-items:center; gap:7px;
  padding:10px 20px; border-radius:100px;
  font-size:12.5px; letter-spacing:.18em; color:var(--ink-3);
  transition:background .3s var(--ease), color .3s var(--ease);
}
.mode__ico{ font-size:12px; opacity:.8; }
.mode:hover{ color:var(--ink-2); }
.mode.is-on{
  color:#1a1208; background:linear-gradient(180deg,#ffd6ad,#ffb27a);
  box-shadow:0 0 22px rgba(255,178,122,.34);
}
.mode.is-busy{ opacity:.5; pointer-events:none; }

/* ── 声控电平表 ──────────────────────────────────────────── */
.meter{
  position:absolute; left:18px; bottom:calc(96px + var(--safe-b));
  width:150px; padding:13px 14px;
  background:var(--glass); backdrop-filter:blur(22px);
  -webkit-backdrop-filter:blur(22px);
  border:1px solid var(--line-2); border-radius:var(--radius);
  animation:fadeUp .5s var(--ease) both;
}
.meter__row{
  display:flex; align-items:center; gap:9px; margin-bottom:8px;
  font-size:10px; letter-spacing:.14em; color:var(--ink-3);
}
.meter__row span{ width:26px; flex:none; }
.meter__bar{ flex:1; height:2px; background:rgba(255,255,255,.09); border-radius:2px; overflow:hidden; }
.meter__bar b{
  display:block; height:100%; width:0; border-radius:2px;
  background:var(--accent); box-shadow:0 0 8px var(--accent);
  transition:width .06s linear;
}
.meter__row:nth-child(1) b{ background:#ff9f6b; box-shadow:0 0 8px #ff9f6b; }
.meter__row:nth-child(2) b{ background:#8fd8ff; box-shadow:0 0 8px #8fd8ff; }
.meter__row:nth-child(3) b{ background:#cfa8ff; box-shadow:0 0 8px #cfa8ff; }
.meter__tip{
  margin-top:2px; font-size:10px; line-height:1.7; letter-spacing:.06em; color:var(--ink-3);
}

/* ── 常驻信息层(不参与界面的自动隐藏) ─────────────────── */
.hud{ position:fixed; inset:0; z-index:12; pointer-events:none; }

/* ── 呼吸引导 ────────────────────────────────────────────── */
/* 居中用 left/right:0 + margin:auto,不能用 transform ——
   fadeUp 的关键帧末尾是 transform:none,会把居中的位移一起抹掉 */
.breath{
  position:absolute; left:0; right:0; bottom:calc(108px + var(--safe-b));
  margin:0 auto; width:min(260px,66vw); text-align:center;
  animation:fadeUp .6s var(--ease) both;
}
/* 引导文字会压在光上,给一层看不见边界的暗底保证可读 */
.breath::before{
  content:''; position:absolute; inset:-28px -52px -20px;
  background:radial-gradient(ellipse at center,rgba(0,0,0,.4),rgba(0,0,0,.17) 48%,transparent 88%);
  z-index:-1; pointer-events:none;
}
.breath__word{
  font-size:19px; font-weight:250;
  letter-spacing:.6em; text-indent:.6em; color:var(--ink);
  text-shadow:0 0 6px rgba(0,0,0,.9), 0 0 22px rgba(0,0,0,.8), 0 1px 2px rgba(0,0,0,.9);
}
.breath__bar{
  height:1px; margin:15px auto 10px; background:rgba(255,255,255,.13);
  border-radius:1px; overflow:hidden;
}
.breath__bar i{
  display:block; height:100%; width:0; background:var(--ink);
  box-shadow:0 0 10px rgba(255,255,255,.6);
}
.breath__meta{
  display:flex; justify-content:center; gap:12px;
  font-size:10px; letter-spacing:.16em; color:var(--ink-2);
  font-variant-numeric:tabular-nums;
  text-shadow:0 0 5px rgba(0,0,0,.95), 0 0 14px rgba(0,0,0,.85);
}

/* ── 剧本播放条 ──────────────────────────────────────────── */
.script{
  position:absolute; left:0; right:0; bottom:calc(104px + var(--safe-b));
  margin:0 auto; width:min(340px,84vw); text-align:center;
  pointer-events:auto; animation:fadeUp .5s var(--ease) both;
}
.script::before{
  content:''; position:absolute; inset:-24px -46px -16px;
  background:radial-gradient(ellipse at center,rgba(0,0,0,.45),rgba(0,0,0,.2) 50%,transparent 86%);
  z-index:-1; pointer-events:none;
}
.script__label{
  min-height:1.5em; font-size:14px; font-weight:300;
  letter-spacing:.34em; text-indent:.34em; color:var(--ink);
  text-shadow:0 0 6px rgba(0,0,0,.9), 0 0 20px rgba(0,0,0,.8);
}
.script__bar{ height:1px; margin:13px 0 11px; background:rgba(255,255,255,.14); overflow:hidden; }
.script__bar i{ display:block; height:100%; width:0; background:var(--accent); box-shadow:0 0 9px var(--accent); }
.script__row{ display:flex; align-items:center; justify-content:center; gap:10px; }
.script__btn{
  display:flex; align-items:center; justify-content:center;
  width:28px; height:28px; padding:7px; border-radius:50%;
  border:1px solid var(--line); color:var(--ink-2);
  transition:background .25s var(--ease), color .25s var(--ease);
}
.script__btn--wide{
  width:auto; height:auto; padding:6px 13px; border-radius:100px;
  font-size:10.5px; letter-spacing:.14em;
}
.script__btn:hover{ background:rgba(255,255,255,.09); color:var(--ink); }
.script__title{
  flex:1; font-size:11px; letter-spacing:.2em; color:var(--ink-2);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  text-shadow:0 0 6px rgba(0,0,0,.9);
}

/* 一句话生成 */
.modal__sub{ font-size:10px; font-weight:300; letter-spacing:.3em; color:var(--ink-3); margin:20px 0 11px; }
.promptbox{ display:flex; gap:8px; margin:6px 0 12px; }
.promptbox input{
  flex:1; min-width:0; padding:11px 14px;
  background:rgba(255,255,255,.05); border:1px solid var(--line);
  border-radius:11px; font-size:12.5px; letter-spacing:.04em; color:var(--ink);
  outline:none; transition:border-color .25s var(--ease);
}
.promptbox input:focus{ border-color:rgba(255,255,255,.3); }
.promptbox input::placeholder{ color:rgba(255,255,255,.26); }
.promptbox button{
  flex:none; padding:0 18px; border-radius:11px;
  background:linear-gradient(180deg,#ffd6ad,#ffb27a); color:#1a1208;
  font-size:12px; letter-spacing:.14em;
  transition:filter .2s var(--ease), opacity .2s var(--ease);
}
.promptbox button:hover{ filter:brightness(1.06); }
.promptbox button:disabled{ opacity:.45; cursor:default; }
.chips{ display:flex; flex-wrap:wrap; gap:7px; }
.chip{
  padding:8px 14px; border-radius:100px;
  border:1px solid var(--line); font-size:11.5px; letter-spacing:.1em; color:var(--ink-2);
  transition:background .25s var(--ease), color .25s var(--ease);
}
.chip:hover{ background:rgba(255,255,255,.08); color:var(--ink); }
.chip.is-on{ background:linear-gradient(180deg,#ffd6ad,#ffb27a); color:#1a1208; border-color:transparent; }

/* 睡眠定时剩余 */
.sleeptip{
  position:absolute; left:50%; top:calc(56px + var(--safe-t));
  transform:translateX(-50%);
  font-size:10px; letter-spacing:.2em; color:var(--ink-3);
  font-variant-numeric:tabular-nums; white-space:nowrap;
}

/* ── 摄像头预览 ──────────────────────────────────────────── */
.cam{
  position:absolute; right:18px; bottom:calc(96px + var(--safe-b));
  width:232px; animation:fadeUp .5s var(--ease) both;
  /* 不在 .ui 里 —— 界面静置淡出时预览要留着。手势模式下它是操作反馈,
     看不见摄像头就不知道自己的手有没有被认到 */
  z-index:6; pointer-events:none;
}
.cam__frame{
  position:relative; width:100%; aspect-ratio:4/3; overflow:hidden;
  border-radius:12px; border:1px solid var(--line);
  background:rgba(0,0,0,.5);
}
/* 画面和骨架必须用同一个镜像变换,否则骨架会和手反着走 */
.cam__frame video,
.cam__skel{
  position:absolute; inset:0; width:100%; height:100%; display:block;
  transform:scaleX(-1);     /* 自拍画面必须镜像,否则手往左动画面往右动 */
}
/* z-index 是必须的:video 是运行时 appendChild 进来的,在 DOM 里排在
   canvas 后面,两个都 absolute 又都不设层级的话,后来的那个赢 ——
   结果就是摄像头画面整个盖住骨架和暗罩,看上去像"骨架没画出来"。
   假手测试时没有 video,所以这条一直没暴露 */
.cam__frame video{ z-index:1; }
.cam__skel{ z-index:2; }
/* 摄像头画面**完全不显示** —— 只留手的骨架。
   脸、房间、身后的人都不该出现在屏幕上,这既是隐私也是观感:
   一副悬浮在暗底上的骨架比一段带人脸的监控画面干净得多。
   注意不能 display:none 或 visibility:hidden —— 那样部分浏览器会停止解码,
   MediaPipe 就读不到帧了。opacity:0 是唯一安全的做法,元素仍在渲染树里 */
.cam__frame video{ object-fit:cover; opacity:0; }
.cam__frame{ background:radial-gradient(circle at 50% 45%, #14110f, #08070a 78%); }
.cam__skel{ pointer-events:none; }
.cam__tip{
  margin-top:7px; font-size:10px; line-height:1.6; letter-spacing:.08em;
  color:var(--ink-3); text-align:center;
}
.cam__read{
  margin-top:3px; font-size:9.5px; line-height:1.6; letter-spacing:.04em;
  color:rgba(255,255,255,.28); text-align:center;
  font-variant-numeric:tabular-nums; min-height:1.4em;
}

/* ── 大资源加载进度 ──────────────────────────────────────── */
.modal__card--slim{ width:min(100%,360px); text-align:center; }
.modal__card--slim h2{ margin-bottom:12px; }
.loadbar{ height:2px; margin:20px 0 10px; background:rgba(255,255,255,.1); border-radius:2px; overflow:hidden; }
.loadbar i{
  display:block; height:100%; width:0; border-radius:2px;
  background:linear-gradient(90deg,rgba(255,178,122,.35),var(--accent));
  box-shadow:0 0 12px rgba(255,178,122,.7);
  transition:width .3s var(--ease);
}
.loadbar__pct{
  font-size:11px; letter-spacing:.14em; color:var(--ink-3);
  font-variant-numeric:tabular-nums;
}

/* ── 设置面板 ────────────────────────────────────────────── */
.panel{
  position:absolute; top:calc(62px + var(--safe-t)); right:14px;
  width:280px; max-height:calc(100% - 96px - var(--safe-t) - var(--safe-b));
  overflow-y:auto; overscroll-behavior:contain;
  padding:18px; border-radius:18px;
  background:var(--glass-2); backdrop-filter:blur(30px) saturate(1.6);
  -webkit-backdrop-filter:blur(30px) saturate(1.6);
  border:1px solid var(--line);
  box-shadow:0 24px 70px rgba(0,0,0,.6);
  animation:panelIn .38s var(--ease) both;
}
@keyframes panelIn{ from{ opacity:0; transform:translateY(-8px) scale(.98);} to{ opacity:1; transform:none;} }
.panel::-webkit-scrollbar{ width:0; }

.panel__head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.panel__head h2{ font-size:12px; font-weight:300; letter-spacing:.34em; color:var(--ink-2); }
.panel__sec{ padding-bottom:16px; margin-bottom:16px; border-bottom:1px solid var(--line-2); }
.panel__sec:last-of-type{ border-bottom:none; margin-bottom:6px; padding-bottom:0; }
.panel__sec h3{
  font-size:10px; font-weight:300; letter-spacing:.3em; color:var(--ink-3); margin-bottom:12px;
}
.panel__note{ font-size:10px; line-height:1.7; color:var(--ink-3); margin-top:9px; }
.panel__foot{ font-size:9.5px; line-height:1.8; color:rgba(255,255,255,.24); margin:14px 0 4px; }

/* 色卡 */
.swatches{ display:grid; grid-template-columns:repeat(5,1fr); gap:8px; }
.swatch{
  aspect-ratio:1; border-radius:50%; position:relative;
  border:1px solid rgba(255,255,255,.14);
  transition:transform .28s var(--ease);
}
.swatch:hover{ transform:scale(1.12); }
.swatch.is-on{ transform:scale(1.12); }
.swatch.is-on::after{
  content:''; position:absolute; inset:-5px; border-radius:50%;
  border:1px solid rgba(255,255,255,.7);
}

/* 滑块 */
.slider{ display:block; margin-bottom:15px; }
.slider:last-child{ margin-bottom:0; }
.slider > span{
  display:flex; justify-content:space-between; align-items:baseline;
  font-size:11px; letter-spacing:.16em; color:var(--ink-2); margin-bottom:9px;
}
.slider i{ font-style:normal; font-size:10px; color:var(--ink-3); font-variant-numeric:tabular-nums; }
input[type=range]{
  -webkit-appearance:none; appearance:none;
  width:100%; height:2px; border-radius:2px;
  background:rgba(255,255,255,.14); cursor:pointer;
}
input[type=range]::-webkit-slider-thumb{
  -webkit-appearance:none; appearance:none;
  width:13px; height:13px; border-radius:50%;
  background:#fff; box-shadow:0 0 10px rgba(255,255,255,.55);
  transition:transform .2s var(--ease);
}
input[type=range]::-webkit-slider-thumb:active{ transform:scale(1.28); }
input[type=range]::-moz-range-thumb{
  width:13px; height:13px; border:none; border-radius:50%;
  background:#fff; box-shadow:0 0 10px rgba(255,255,255,.55);
}

/* 分段选择 */
.segs{ display:flex; gap:4px; padding:3px; background:rgba(255,255,255,.05); border-radius:10px; }
.segs button{
  flex:1; padding:8px 0; border-radius:8px;
  font-size:11px; letter-spacing:.12em; color:var(--ink-3);
  transition:background .25s var(--ease), color .25s var(--ease);
}
.segs button:hover{ color:var(--ink-2); }
.segs button.is-on{ background:rgba(255,255,255,.12); color:var(--ink); }
/* 形态:图标在上、名字在下 */
.segs--form button{ display:flex; flex-direction:column; align-items:center; gap:4px; padding:9px 0; }
.segs--form i{ font-style:normal; font-size:13px; line-height:1; opacity:.85; }

/* 光幕有 16 项,一行放不下。flex nowrap 会把它们挤成一坨甚至溢出面板,
   改成自动换行的网格:每格最小 52px,放得下几列就几列 */
.segs--grid{
  display:grid; grid-template-columns:repeat(auto-fit, minmax(52px, 1fr));
  gap:4px; padding:3px; background:rgba(255,255,255,.05); border-radius:10px;
}
.segs--grid button{
  display:flex; flex-direction:column; align-items:center; gap:4px;
  padding:8px 2px; border-radius:8px; min-width:0;
  font-size:10.5px; letter-spacing:.06em; color:var(--ink-3);
  transition:background .25s var(--ease), color .25s var(--ease);
}
.segs--grid button i{ font-style:normal; font-size:13px; line-height:1; opacity:.85; }
.segs--grid button span{ white-space:nowrap; }
.segs--grid button:hover{ color:var(--ink-2); }
.segs--grid button.is-on{ background:rgba(255,255,255,.12); color:var(--ink); }

/* 开关 */
.toggle{ display:flex; align-items:center; gap:10px; font-size:11.5px; letter-spacing:.14em; color:var(--ink-2); cursor:pointer; }
.toggle input{ -webkit-appearance:none; appearance:none; position:relative;
  width:34px; height:19px; border-radius:100px; background:rgba(255,255,255,.13);
  transition:background .3s var(--ease); cursor:pointer; flex:none; }
.toggle input::after{
  content:''; position:absolute; top:2.5px; left:2.5px;
  width:14px; height:14px; border-radius:50%; background:#fff;
  transition:transform .3s var(--ease);
}
.toggle input:checked{ background:rgba(255,178,122,.72); }
.toggle input:checked::after{ transform:translateX(15px); }

/* 面板里的整行按钮 */
.rowbtn{
  display:flex; align-items:center; gap:10px; width:100%;
  margin-top:14px; padding:11px 13px;
  border:1px solid var(--line); border-radius:11px;
  font-size:11.5px; letter-spacing:.12em; color:var(--ink-2);
  transition:background .25s var(--ease), color .25s var(--ease);
}
.rowbtn svg{ width:15px; height:15px; flex:none; }
.rowbtn:hover{ background:rgba(255,255,255,.07); color:var(--ink); }

/* ── 锁屏遮罩 ────────────────────────────────────────────── */
.lockmask{
  position:fixed; inset:0; z-index:40;
  display:flex; align-items:flex-end; justify-content:center;
  /* 贴到模式栏的位置 —— 锁定时模式栏是藏着的,这块正好空出来,
     也就不会和呼吸引导(bottom:108px)撞上 */
  padding-bottom:calc(22px + var(--safe-b));
  background:transparent;   /* 只拦事件,不遮光 */
  animation:fade .4s var(--ease) both;
}
/* 单行胶囊 —— 必须够矮,否则会和呼吸引导撞上 */
.lockmask__inner{
  position:relative; overflow:hidden;
  display:flex; align-items:center; gap:9px;
  padding:10px 20px; border-radius:100px;
  background:var(--glass); backdrop-filter:blur(20px);
  -webkit-backdrop-filter:blur(20px);
  border:1px solid var(--line-2);
  transition:opacity .8s var(--ease);
}
.lockmask.is-quiet .lockmask__inner{ opacity:.18; }
.lockmask__ico{ width:14px; height:14px; flex:none; color:var(--ink-3); }
.lockmask__inner p{ font-size:11px; letter-spacing:.14em; color:var(--ink-2); white-space:nowrap; }
.lockmask__inner strong{ color:var(--ink); font-weight:400; }
/* 长按进度做成胶囊的底边 */
.lockmask__bar{ position:absolute; left:0; right:0; bottom:0; height:2px; }
.lockmask__bar i{
  display:block; height:100%; width:0; background:var(--accent);
  box-shadow:0 0 10px var(--accent);
}

/* ── 定时结束 ────────────────────────────────────────────── */
.slept{
  position:fixed; inset:0; z-index:50;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:34px; background:#000;
  animation:fade 1.6s var(--ease) both;
}
.slept__word{
  font-size:17px; font-weight:250; letter-spacing:.7em; text-indent:.7em;
  color:rgba(255,255,255,.5);
}
.slept .btn{ flex:none; padding:12px 32px; }

/* ── 提示条 ──────────────────────────────────────────────── */
.toast{
  position:absolute; left:0; right:0; bottom:calc(100px + var(--safe-b));
  margin:0 auto; width:max-content;
  max-width:min(88vw,440px); padding:12px 22px;
  background:var(--glass-2); backdrop-filter:blur(22px);
  -webkit-backdrop-filter:blur(22px);
  border:1px solid var(--line); border-radius:18px;
  font-size:12px; line-height:1.75; letter-spacing:.06em; color:var(--ink);
  text-align:center;   /* 不能 nowrap:权限失败的提示都比较长,截断了等于没提示 */
  animation:fadeUp .4s var(--ease) both;
}

/* ── 模态 ────────────────────────────────────────────────── */
.modal{
  position:fixed; inset:0; z-index:80;
  display:flex; align-items:center; justify-content:center; padding:24px;
  background:rgba(0,0,0,.72); backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  animation:fade .3s var(--ease) both;
}
@keyframes fade{ from{opacity:0} to{opacity:1} }
.modal__card{
  width:min(100%,430px); padding:28px;
  background:var(--glass-2); border:1px solid var(--line);
  border-radius:20px; box-shadow:0 30px 90px rgba(0,0,0,.7);
  animation:panelIn .4s var(--ease) both;
}
.modal__ico{ font-size:22px; color:#ffcf8a; margin-bottom:14px; }
.modal__card h2{ font-size:16px; font-weight:300; letter-spacing:.2em; margin-bottom:16px; }
.modal__card p{ font-size:12.5px; line-height:2; color:var(--ink-2); margin-bottom:12px; }
.modal__card strong{ color:var(--ink); font-weight:400; }
.modal__minor{ font-size:11.5px !important; color:var(--ink-3) !important; }
.modal__acts{ display:flex; gap:9px; margin-top:22px; }
.btn{
  flex:1; padding:13px 10px; border-radius:100px;
  font-size:12.5px; letter-spacing:.12em; text-align:center;
  transition:transform .22s var(--ease), background .25s var(--ease);
}
.btn:active{ transform:scale(.97); }
.btn--ghost{ border:1px solid var(--line); color:var(--ink-2); }
.btn--ghost:hover{ background:rgba(255,255,255,.06); }
.btn--go{ background:linear-gradient(180deg,#ffd6ad,#ffb27a); color:#1a1208; }
.btn--go:hover{ filter:brightness(1.06); }

/* ── 窄屏 ────────────────────────────────────────────────── */
@media (max-width:560px){
  .panel{
    top:auto; bottom:0; right:0; left:0; width:100%;
    max-height:74vh; border-radius:20px 20px 0 0;
    padding:20px 18px calc(24px + var(--safe-b));
  }
  @keyframes panelIn{ from{opacity:0; transform:translateY(24px);} to{opacity:1; transform:none;} }
  .meter{ left:12px; width:132px; bottom:calc(92px + var(--safe-b)); }
  .mode{ padding:10px 17px; }
  .brand__name{ font-size:11px; letter-spacing:.2em; }
}
@media (max-height:460px){
  .meter{ display:none; }
}

@media (prefers-reduced-motion:reduce){
  .boot__orb,.brand__dot,.fallback__orb{ animation:none; }
}


/* ── 使用说明 ────────────────────────────────────────────────
   给第一次打开的人(尤其是评委)一条最短路径。信息密度要高但能扫读:
   三条编号 + 一行安全提示,15 秒内看完 */
.guide__card{ width:min(100%,520px); text-align:left; }
.guide__card h2{ margin-bottom:6px; }
.guide__sub{
  margin-bottom:16px; font-size:12.5px; line-height:1.7; color:var(--ink-2);
}
.guide__list{ margin:0 0 14px; padding:0; list-style:none; counter-reset:g; }
.guide__list li{
  position:relative; margin-bottom:12px; padding-left:26px;
  font-size:13px; line-height:1.7; color:var(--ink-1); counter-increment:g;
}
.guide__list li::before{
  content:counter(g); position:absolute; left:0; top:1px;
  width:17px; height:17px; border-radius:50%; border:1px solid var(--line);
  font-size:10px; line-height:16px; text-align:center; color:var(--ink-3);
}
.guide__list span{
  display:block; margin-top:3px; font-size:11.5px; line-height:1.75;
  color:var(--ink-3); letter-spacing:.01em;
}
.guide__list b{ color:var(--ink-1); font-weight:500; }
.guide__note{
  margin-bottom:16px; padding:10px 12px; border-radius:9px;
  background:rgba(255,255,255,.035); border:1px solid var(--line);
  font-size:11px; line-height:1.8; color:var(--ink-3);
}
.guide__note b{ color:var(--ink-2); }


/* ── 新手引导 ────────────────────────────────────────────────
   三条硬要求:① 永远不挡点击(pointer-events:none);② 不跟着界面淡出
   —— 它是信息不是装饰;③ 只说一句话,说完自己走。
   位置在模式条上方:那儿是视线自然会扫到的地方,又不压住画面主体 */
.coach{
  position:absolute; left:0; right:0; margin:0 auto;
  bottom:calc(112px + var(--safe-b));
  width:max-content; max-width:min(88vw, 460px);
  display:flex; align-items:center; gap:9px;
  padding:9px 16px 9px 13px; border-radius:100px;
  background:rgba(20,16,14,.72); backdrop-filter:blur(14px);
  border:1px solid rgba(255,255,255,.09);
  font-size:12px; line-height:1.5; letter-spacing:.05em; color:var(--ink-1);
  pointer-events:none;          /* 绝不拦操作 */
  z-index:7;
  animation:coachIn .42s var(--ease) both;
}
.coach.is-out{ animation:coachOut .5s var(--ease) both; }
.coach__ico{
  font-style:normal; font-size:13px; line-height:1; flex:none;
  color:rgba(255,196,140,.92);
}
.coach__txt b{ color:#fff; font-weight:500; }
@keyframes coachIn{
  from{ opacity:0; transform:translateY(9px) scale(.97); }
  to  { opacity:1; transform:none; }
}
@keyframes coachOut{
  from{ opacity:1; transform:none; }
  to  { opacity:0; transform:translateY(-6px); }
}
@media (prefers-reduced-motion:reduce){
  .coach, .coach.is-out{ animation:none; }
}
