:root {
  --bg: #000000;
  --panel: #1c1c1e;
  --panel2: #2c2c2e;
  --text: #f2f2f7;
  --text-dim: #8e8e93;
  --accent: #ff3b30;
  --accent-hi: #ff6961;
  --green: #34c759;
  --blue: #0a84ff;
  --radius: 14px;
  /* 底部三层控件（变焦条 / 定时排 / 三入口排）之间的统一间距：
     三者严格等距，取 22px（要求区间 18~24px，比改造前的 12px 明显更宽松） */
  --ui-gap: 22px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  /* 软键盘遮挡高度（含 12px 余量），由 JS 按 visualViewport 实测写入；
     供预设 / 计划两个浮层做底部避让，未弹键盘时恒为 0 */
  --kb-h: 0px;

  /* ---------- 动效设计令牌：全站统一节奏 ----------
     曲线统一为「快起慢收」，进入 300ms、退出 220ms，微反馈 140ms。
     所有过渡只驱动 transform / opacity，保证走 iOS 合成层、不触发重排。 */
  --ease: cubic-bezier(.32, .72, 0, 1);
  --ease-soft: cubic-bezier(.4, 0, .2, 1);
  --dur-enter: 300ms;   /* 进入：260~320ms */
  --dur-exit: 220ms;    /* 退出：200~240ms */
  --dur-base: 240ms;    /* 通用状态切换 */
  --dur-fast: 140ms;    /* 按压 / 微反馈 */
  --lift: 12px;         /* 弹层上浮距离 */

  /* ---------- 播放器纵向手势（上滑回相册 / 下滑回录像） ----------
     iOS 手感曲线：起步快、尾巴长，飞出 300ms、回弹 220ms。 */
  --ease-fluent: cubic-bezier(.22, 1, .36, 1);
  --dur-fly: 300ms;
  --dur-snap: 220ms;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent;
    /* v126：全局禁掉长按选中/长按菜单，避免长按画面或列表弹出「复制/查询」气泡 */
    -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* 只有真正需要输入/选中的地方放开 */
input, textarea, [contenteditable="true"] {
  -webkit-user-select: text; user-select: text; -webkit-touch-callout: default;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body { padding-bottom: 0; }

/* 拍摄页：整屏一屏布局，不滚动 */
.camera-screen {
  /* 改为显式 left/top + 像素宽高：inset:0 的宽度完全取决于 iOS 报的视口宽，
     浮层/键盘过场里一旦报出窄宽，整块取景区会跟着变窄、右侧露出黑列（v93 回归）。
     --app-w 由 lockScreenWidth() 锁定「已确认的整屏宽」，只有转屏/分屏才更新。 */
  position: fixed; top: 0; left: 0;
  width: 100vw; width: var(--app-w, 100vw);
  /* 高度优先使用 JS 现场锁定的像素值：iOS 从后台切回时 100dvh 会重算成更小值，
     整块取景画面会跟着缩小；--app-h 由 lockScreenHeight() 在切回/旋转/缩放时写入 */
  height: 100vh; height: 100dvh; height: var(--app-h, 100dvh);
  display: block;                 /* 分层绝对定位：取景框铺满整屏，控制面板悬浮在画面之上 */
  overflow: hidden;
  background: var(--bg);
  padding: 0;
}

.hidden { display: none !important; }

/* ---------- 顶部 ---------- */
/* ---------- 预览 ---------- */
.preview-wrap {
  /* 取景框铺满整屏，录像画面无留白。
     v93：宽度跟 --app-w（已确认整屏宽）而非常见的 inset:0 —— 父级若被 iOS 在
     浮层/键盘过场里压窄，取景框仍按整屏宽铺满，视频不会缩出一列右侧黑边。 */
  position: absolute; top: 0; left: 0;
  width: 100%; width: var(--app-w, 100%);
  height: 100%;
  margin: 0; border-radius: 0; aspect-ratio: auto;
  background: #000;
  overflow: hidden;
  /* v94：不再用 flex 居中。iOS 上 <video> 一旦成为 flex 子项，
     百分比宽高解析会退化成「按视频固有宽高比自适应」，画面缩成 9:16 的小块居中、四周留黑。
     这里改回普通块级容器，video 绝对定位铺满，布局不再受 flex 计算影响。 */
  display: block;
  /* v171：画面区要支持「长按 500ms 打开设置」，必须先关掉 iOS 长按的系统行为
     （弹出图片/链接菜单、选中文字、放大镜），否则长按到一半就跳出系统气泡。 */
  -webkit-touch-callout: none;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
}
/* 预览画面铺满取景框。
   v94：去掉 transform: scale(1.06) —— iOS Safari 里 transform 会把 <video> 的绘制
   拆到独立合成层，并按视频固有宽高比绘制，于是元素盒明明是整屏、实际画面却缩在中间
   四周露黑。铺满交给 object-fit: cover 就够了，不再用 scale 制造放大。
   同时显式写死 min/max，避免 Safari 的固有比例把 100% 覆盖掉。 */
/* v98：video 自身相对视口 fixed 铺满（宽高由 JS 用整屏像素钉死）。
   起因：真机上「点允许录像后」iOS 会把 .camera-screen / .preview-wrap 在过场里压窄，
   video 作为 absolute 子项跟着缩，画面就只剩中间一块、四周全黑。改为相对视口后，
   容器怎么抖都不影响取景盒；离开拍摄页时 .camera-screen 是 display:none，video 也不会外露。 */
#preview { position: fixed; top: 0; left: 0; right: auto; bottom: auto;
  width: 100%; height: 100%; min-width: 100%; min-height: 100%;
  max-width: none; max-height: none; display: block;
  object-fit: cover; object-position: 50% 50%; background: #000; pointer-events: none;
  transform: none; -webkit-transform: none; }

/* v167：取景自绘画布。位置/尺寸由 JS 按整屏像素写死（与 #preview 同一基准），
   铺满靠 canvas 自己 drawImage 裁切，不再依赖 object-fit 与视频合成层。 */
.preview-canvas {
  position: fixed; top: 0; left: 0;
  width: var(--app-w, 100vw); height: var(--app-h, 100dvh);
  display: block; pointer-events: none;
  transform-origin: 50% 50%;
  z-index: 3; visibility: hidden;   /* 未起绘前不可见，避免黑块盖住取景 */
}
/* 画布出帧后盖在 <video> 之上：即便 iOS 把视频按固有比例缩在中间，
   屏幕上看到的仍是画布按 cover 规则画出来的整屏画面。
   注意不能给 #preview 设 visibility:hidden —— 隐藏的视频会被部分 iOS 版本
   停止解码，拿不到帧就画不出来，反而全黑。视频保持可见、只作被覆盖的背景。 */

/* 真正画出第一帧之后才把画布显形：此时它已把整屏填满，不会出现黑块盖住取景 */
html.preview-painting .preview-canvas { visibility: visible; }

/* 录制状态容器：左上角一行横排「红点 + 计时」，水平左对齐、垂直居中 */
.rec-status {
  position: absolute; z-index: 8;
  /* 与回放页视频上边框同一水平（safe-top + 40，行高 24 → 中心 safe-top + 52），
     本版只改水平方向，top 与改前完全一致 */
  top: calc(var(--safe-top) + 40px);
  /* 左侧贴安全区让位，横屏 / 圆角屏也不会贴边或被遮挡 */
  left: calc(16px + var(--safe-left, 0px));
  right: auto;
  display: flex; align-items: center; justify-content: flex-start;
  gap: 7px;                       /* 红点与计时间距 7px（要求 6~8px） */
  pointer-events: none;
}

.rec-dot {
  /* 不再单独定位：作为 rec-status 的 flex 子项，永远紧贴计时数字左侧 */
  position: static; flex: 0 0 auto;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent);
  /* v103：出现瞬间弹一下（transform），之后接原有闪烁（opacity），两条动画各管一个属性不打架 */
  animation: blink 1s steps(2, start) infinite, recDotPop .3s cubic-bezier(.2, 1.5, .4, 1);
}
@keyframes blink { 50% { opacity: 0.15; } }
@keyframes recDotPop { 0% { transform: scale(.2); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* ---------- v103 录制起停反馈层 ----------
   参考 iOS 原生相机（起录白闪）+ GoPro/Insta360 点屏录制（四周红边点亮并呼吸）。
   原则：只改 opacity / box-shadow，不缩放取景画面，绝不引入掉帧。
   层级压在取景画面之上、文字叠加层之下（7~8）。 */
.rec-fx {
  position: absolute; inset: 0; z-index: 6;
  pointer-events: none;
}
/* 四周红边：录中常亮并缓慢呼吸 */
.rec-fx::before {
  content: ''; position: absolute; inset: 0;
  box-shadow: inset 0 0 0 3px rgba(255, 69, 58, .92);
  opacity: 0;
  transition: opacity .3s var(--ease, ease);
}
.rec-fx.live::before {
  opacity: 1;
  animation: recRingBreath 2.6s ease-in-out infinite;
}
@keyframes recRingBreath { 0%, 100% { opacity: .45; } 50% { opacity: .95; } }

/* 瞬时白闪：起录 260ms、停录 180ms（停录更短更轻，只做"已收工"的确认感） */
.rec-fx::after {
  content: ''; position: absolute; inset: 0;
  background: #fff; opacity: 0;
}
.rec-fx.flash-start::after { animation: recFlashStart .26s ease-out; }
.rec-fx.flash-stop::after { animation: recFlashStop .18s ease-out; }
@keyframes recFlashStart {
  0% { opacity: 0; } 16% { opacity: .55; } 100% { opacity: 0; }
}
@keyframes recFlashStop {
  0% { opacity: 0; } 22% { opacity: .3; } 100% { opacity: 0; }
}

/* 无障碍：系统开了"减弱动态效果"就把动画降级为纯静态红边 */
@media (prefers-reduced-motion: reduce) {
  .rec-fx.live::before { animation: none; opacity: .8; }
  .rec-fx.flash-start::after, .rec-fx.flash-stop::after { animation: none; }
  /* v104：点画面反馈不做淡出动画，直接静态显示后由脚本移除 */
  .player-tap-fx.show { animation: none; opacity: .92; }
  .player-tap-fx { transition: opacity .18s linear; }
  .rec-dot { animation: blink 1s steps(2, start) infinite; }
}


.timer-overlay {
  /* 录制计时：与红点同在右上角 .rec-status 横排容器内，随容器垂直居中
     （红点 12px、计时行高 24px，align-items:center 后两者中心线完全对齐） */
  position: static;
  font-size: 20px; line-height: 24px; font-weight: 600; letter-spacing: .5px;
  font-variant-numeric: tabular-nums;
  color: rgba(255,255,255,.94); text-shadow: 0 1px 5px rgba(0,0,0,.75);
  pointer-events: none;
  /* v100：让计时文字独占一个合成层。它每秒变一次，若和取景 <video> 共用合成层，
     每次刷新都会连带重绘视频区，肉眼就是「顿一下」。 */
  transform: translateZ(0);
  will-change: transform;
}
.countdown-overlay {
  position: absolute; inset: 0;
  /* v170：取景已在 <canvas> 自绘（z-index:3）上，倒计时原为 auto 会被画布整块盖住。
     倒计时是功能显示，必须显式压到画布之上、hint(8)/toast(300) 之下。 */
  z-index: 6; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  /* v172：数字中心从正中(50%)再上移到画面高度 42% 处 ——
     给底部留出更多取景空间，视觉上压在画面偏上的位置。
     做法：box-sizing:border-box + 底部内边距 16%，flex 居中落点即 (100%-16%)/2 = 42%，
     不靠固定像素，任何屏高/键盘态都保持同一比例。
     z-index:6 与 pointer-events:none 是 v170 的修复，必须保留：
     取景 canvas 在 z-index:3，倒计时没有显式层级就会被整块盖住（数字看不见）。 */
  /* 注意：padding 的百分比相对「宽度」而非高度，不能用 %；
     要落在 42% 高度 = 2*(50%-42%)=16% 屏高，所以用 vh。 */
  padding: 0 0 16vh; box-sizing: border-box;
  font-size: 96px; font-weight: 800; color: #fff;
  background: rgba(0,0,0,.45);
  font-variant-numeric: tabular-nums;
}

/* ---------- 变焦控制 ---------- */
.zoom-control {
  /* 悬浮在控制面板正上方：始终落在取景框内，录像中也能直接拖动焦距 */
  position: absolute; left: 50%; bottom: calc(var(--panel-h, 140px) + var(--ui-gap));
  /* 键盘弹出时与控制面板同步上抬同样的距离，保持「变焦条—定时排」的固有间距 */
  transform: translateX(-50%) translate3d(0, calc(-1 * var(--kb, 0px)), 0);
  transition: transform var(--dur-base) var(--ease);
  will-change: transform;
  pointer-events: auto;
  display: flex; align-items: center; gap: 8px;
  background: rgba(0,0,0,.55);
  border-radius: 999px; padding: 8px 13px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  max-width: calc(100% - 24px); z-index: 5; touch-action: none;
  /* v172：不再常驻。待机/录制默认隐去（只管看不吃点击），
     在画面上左右滑动调焦时临时浮现，松手后约 2s 自动淡出。
     visibility 一起收，避免透明层仍占据无障碍焦点。 */
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity var(--dur-base) var(--ease), visibility 0s linear var(--dur-base),
              transform var(--dur-base) var(--ease);
}
.zoom-control.zoom-revealed {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity var(--dur-base) var(--ease), visibility 0s linear 0s,
              transform var(--dur-base) var(--ease);
}
.zoom-seg { display: flex; align-items: center; gap: 5px; flex: 0 0 auto; }
.zoom-chip {
  background: rgba(255,255,255,.16); color: #fff; border: none;
  border-radius: 999px; font-size: 12px; font-weight: 800;
  /* v99：0.5x / 1x / 2.5x 三档并排，芯片略收紧，仍保证手指可点 */
  min-width: 40px; padding: 5px 8px; cursor: pointer; white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  font-variant-numeric: tabular-nums;
}
.zoom-chip.on { background: #0a84ff; color: #fff; }
/* 切换焦段时短暂压暗，掩盖重新开流造成的一帧冻结。
   v98：这层效果原来直接作用在 <video> 上（filter + opacity 过渡）。
   iOS 只要给 video 挂 filter 就会把它拉进独立合成层、按视频固有比例绘制，
   元素盒明明是整屏、画面却缩成中间一小块四周露黑；过渡结束后合成层也不会立刻归位。
   现在改挂到外层遮罩（::after），video 本身不再有任何 filter / opacity 过渡。 */
#preview { transition: none !important; }
.preview-wrap::after {
  content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none;
  background: rgba(0,0,0,.18); opacity: 0;
  transition: opacity var(--dur-base) var(--ease);
}
.preview-wrap.switching::after { opacity: 1; }
/* v178：焦距跨 1x 边界要换采集档（用户档 ↔ 最高档），这条流必须重开。
   重开期间画面会有一次跳变，加一层更明显的柔化把它藏起来；
   backdrop-filter 挂在遮罩伪元素上，绝不给 <video> 自己加 filter
   （iOS 会给 video 建独立合成层，画面直接缩成中间一块）。 */
.preview-wrap.softening::after {
  opacity: 1;
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.zoom-value {
  font-size: 13px; font-weight: 700; color: #fff;
  font-variant-numeric: tabular-nums; min-width: 34px; text-align: center;
}
#zoomSlider {
  -webkit-appearance: none; appearance: none;
  width: 118px; height: 4px; border-radius: 2px;
  background: rgba(255,255,255,.35); outline: none;
}
#zoomSlider::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff; border: none;
  box-shadow: 0 1px 4px rgba(0,0,0,.4);
  cursor: pointer;
}

/* ---------- 控制区 ---------- */
.control-panel {
  /* 悬浮在取景画面之上：画面本身铺满整屏，控件全部落在框内 */
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 9;
  /* padding-bottom = 底部横条安全区 + 版本号独占的一行（8px 底距 + 13px 行高 + 27px 与入口排的间隔）
     版本号用绝对定位钉在整页最底部水平居中，不占流式布局，三入口排因此成为面板最底部的一行。
     V84：底行留白从 31px 加到 48px，版本号与入口排之间的视觉间隔由 10px 拉到 27px（明显拉开），
     版本号自身仍贴底 8px + 安全区，不裁切、不越出安全区；面板是绝对定位悬浮层，
     加大 padding 只会让内容整体上移（变焦条经 --panel-h 联动同步上移），取景画面高度不受影响。 */
  padding: 74px 14px calc(48px + var(--safe-bottom));
  background: linear-gradient(to top,
    rgba(0,0,0,.90) 42%, rgba(0,0,0,.62) 70%, rgba(0,0,0,0) 100%);
  border-top: none;
  /* 键盘弹出时整块面板（定时排 + 入口排 + 版本号）平滑抬到键盘上方：
     只动 transform，走合成层，不触发整页滚动、不改变取景框尺寸 */
  transform: translate3d(0, calc(-1 * var(--kb, 0px)), 0);
  transition: transform var(--dur-base) var(--ease);
  will-change: transform;
  /* 面板本体（含顶部 74px 透明渐变区）不吃触摸：透明区绝不能拦截变焦条的点击/拖动，
     实际交互只交给下面的 .timer-settings / .entry-dock / .app-version */
  pointer-events: none;
}
/* 面板内真正的交互元素恢复接收触摸 */
.timer-settings, .entry-dock, .app-version { pointer-events: auto; }

/* ---------- v142：定时设置改为居中遮罩面板 ----------
   与预设/计划面板同款：#timerMask 复用 .preset-mask（fixed 全屏遮罩 + 居中面板），
   点遮罩空白处关闭；遮罩铺满全屏，点画面只会关面板，不会误触开始录像。
   面板内的 .timer-settings 仍是 2×2 四项，只是不再自带背板（背板由 .preset-panel 提供）。 */

/* 画面里的可编辑一句话：固定停在「练习计划浮层预留上沿」之上
   （浮层上沿 = 24%，与 JS 常量 PLAN_OVERLAY_TOP_RATIO 一致），浮层显隐、
   计划内容增减都不会带动它。用 bottom 锚定：编辑展开成多行时向上生长，
   不会往下压住浮层。z-index 6 高于浮层(4)、低于录制计时(8)，点击优先命中自己。 */
.motto-line {
  position: absolute; left: 50%; top: auto;
  bottom: calc(76% + 34px);        /* 100% - 24%(浮层上沿) + 10px 间距 + 24px 整体上抬（与 app.js MOTTO_LIFT 一致） */
  transform: translateX(-50%);
  z-index: 6;
  pointer-events: auto;
  max-width: 88%;
  text-align: center; font-size: 15px; font-weight: 600; color: #fff;
  padding: 7px 16px; line-height: 1.4;
  background: rgba(0,0,0,.45);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  outline: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  /* 录制/倒计时隐藏只做透明度过渡，绝不做位移（位置由 positionMotto 固定） */
  transition: opacity var(--dur-exit) var(--ease);
}
.motto-line:empty::before {
  content: attr(data-placeholder);
  color: rgba(255,255,255,.42); font-weight: 400; font-size: 13px;
}
.motto-line.editing {
  background: rgba(20,20,22,.92); border-color: var(--blue);
  border-radius: 14px; white-space: normal; word-break: break-all;
  -webkit-user-select: text; user-select: text;
  max-height: 26vh; overflow-y: auto;   /* 长句向上生长时封顶，别顶到顶部录制指示 */
}
.motto-line.editing:empty::before { content: none; }   /* 编辑时不显示占位，避免和光标重叠 */
/* 非待机（倒计时/预热/录像）放开触摸，避免抢倒计时浮层的点击；
   真正的隐藏由下方 .motto-hidden 负责 */
.motto-line.locked { pointer-events: none; }
/* 倒计时/预热/录像中：淡出隐藏（不再显示），停录回到 idle 后恢复。
   只用 opacity + visibility，位置/尺寸完全不变；visibility 延迟到淡出结束才生效，
   恢复时立即可见，因此不会出现「闪一下」或位置跳动。 */
.motto-line.motto-hidden {
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity var(--dur-exit) var(--ease), visibility 0s linear var(--dur-exit);
}
/* v156：总设置里关掉「录制页显示」时整行不占位（与状态用的 motto-hidden 分开） */
.motto-line.motto-off { display: none; }

.timer-settings {
  /* v120：四项固定 2×2；v168 只剩定时开始 / 录像时长（默认焦距与默认播放已删除）。
     每个 label 占半行，数字框宽度稳定在 ~100px，三位数也放得下 */
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  column-gap: 14px; row-gap: 14px;      /* 列间距比行间距略大，两块参数分得开又不散 */
  /* v142：本排已放进居中面板 .preset-panel 内，背板与圆角由面板提供，这里不再自带 */
  background: transparent; border-radius: 0;
  padding: 0; margin-bottom: 0;
}
.timer-settings label {
  /* 每个 label 内部也是横排：文字标签 + 输入控件同行，两列各自成组 */
  min-width: 0; display: flex; flex-direction: row;
  align-items: center; gap: 7px;
  font-size: 13px; color: var(--text-dim);
  white-space: nowrap;
  cursor: text;
}
/* 标签文字：不参与收缩（空间不足时由输入框先让位），文字本身不换行不截断 */
.timer-settings .timer-label {
  flex: 0 0 auto; min-width: 0;
  white-space: nowrap;
  font-size: 13px; line-height: 1.15;
  letter-spacing: -.2px;
}
.timer-settings .picker-wrap {
  /* 输入框容器承担收缩：min-width:0 才能在 nowrap 行内真正被压缩而不撑破行宽 */
  flex: 1 1 auto; min-width: 0;
}
.timer-settings input {
  background: var(--panel2); border: none; border-radius: 8px;
  /* 字号 17px ≥ 16px：iOS 聚焦输入框时不会自动放大页面 */
  color: var(--text); font-size: 17px; font-weight: 600;
  /* 右侧内边距给 ▾ 按钮让位（按钮已缩到 34px 宽） */
  padding: 6px 30px 6px 9px; width: 100%; min-width: 0; box-sizing: border-box;
  height: 34px; line-height: 22px;
  font-variant-numeric: tabular-nums;
  -webkit-appearance: none; appearance: none;
}
/* 聚焦只改描边（outline 不占布局），因此不会引起字号/尺寸跳动 */
.timer-settings input:focus { outline: 2px solid var(--blue); }

/* 窄屏（≤360px）兜底：先压标签字号与左右间隙，输入框字号仍保持 ≥16px 不被 iOS 放大 */
@media (max-width: 360px) {
  .timer-settings { column-gap: 10px; row-gap: 8px; padding: 10px 10px; }
  .timer-settings label { gap: 5px; }
  .timer-settings .timer-label { font-size: 12px; letter-spacing: -.3px; }
  .timer-settings input { font-size: 16px; padding: 5px 26px 5px 6px; }
  .pick-btn { width: 26px; height: 26px; font-size: 16px; }
}

/* v142：定时面板已改为居中遮罩（.preset-mask），键盘避让走 sheet 策略
   （遮罩让出底部 + 面板内部滚动 + scrollIntoView），不再需要底部面板的停靠位移。 */

/* 右下角三入口（相册 / 预设 / 计划）：整行水平居中，是底部控制区最下面的一层。
   纵向自下而上依次为：三入口排 → 定时排 → 变焦条，相邻间距一律取 --ui-gap（22px）等距；
   底部安全区（iPhone 底部横条 34px）与版本号所占的一行由 .control-panel 的 padding-bottom 预留，
   本排稳定落在安全区之上，不与一句话、版本号、顶部红点/计时重叠。
   图标化、无文字，单个触控区 48×48（≥44×44）。 */
.entry-dock {
  display: flex; justify-content: center; align-items: center;
  /* v171：总设置按钮撤走后本排由五格变四格 —— 单个触控区仍 48px，
     间距略放宽（10px → 12px），整行在屏宽内的观感与原来五格一致，不往中间挤成一小团 */
  gap: 12px; margin-top: 0;
  /* v114：位于浮层遮罩（z-index 2）之上，浮层打开时五个入口仍可点 */
  position: relative; z-index: 3;
  transition: opacity var(--dur-base) var(--ease);
}
/* 录制 / 倒计时 / 预热中：淡出到 35% 且屏蔽触摸。
   理由：此时用户唯一该做的交互是「点画面停录」，四个入口一旦可点，误触会离开取景页
   （相册/预设/计划都是全屏浮层），导致录制画面中断或录到黑屏；停录回到待机后自动恢复。 */
.entry-dock.dim { opacity: .35; }
.entry-dock.dim .library-entry { pointer-events: none; }

.library-entry {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px;
  background: var(--panel); border: 1px solid #3a3a3c; border-radius: 50%;
  color: var(--text); cursor: pointer;
  -webkit-appearance: none; appearance: none;
  -webkit-tap-highlight-color: transparent;
}
.library-entry:active { opacity: .8; }
.library-entry svg { width: 23px; height: 23px; fill: var(--blue); }
/* 播放最新一条：与另外三入口同尺寸同底，仅用颜色区分语义（黄=播放） */
.latest-entry svg { fill: #ffd60a; }
.preset-entry svg { fill: var(--accent); }
.plan-entry svg { fill: var(--green); }

/* ---------- v114：第 5 入口「定时设置」 ---------- */
.library-entry.timer-entry { position: relative; }
.timer-entry svg { fill: #5ac8fa; }
/* 打开态：底色与描边提亮，明确「这一格正被展开」 */
.timer-entry.on {
  background: #2c2c2e;
  border-color: #5ac8fa;
  box-shadow: 0 0 0 1px rgba(90, 200, 250, .35), 0 6px 18px rgba(0, 0, 0, .45);
}
/* ---------- 相机页计划浮层 ---------- */
.plan-overlay {
  /* 上沿钉死在 24%（与 JS 常量 PLAN_OVERLAY_TOP_RATIO 一致）：内容多少只影响向下延伸，
     上边界恒定，上面留出的那一行位置就是「给自己的一句话」的固定落脚点 */
  position: absolute; left: 50%; top: 24%;
  transform: translateX(-50%);
  max-height: 38vh; overflow-y: auto;
  pointer-events: auto;
  max-width: 84%; min-width: 56%; padding: 18px 22px;
  background: rgba(0,0,0,.42);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 16px;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  color: #fff; text-align: center; pointer-events: auto; z-index: 4;
  cursor: pointer;
}
.plan-overlay:active { transform: translateX(-50%) scale(.97); }
.plan-overlay-title {
  font-size: 18px; font-weight: 700; letter-spacing: 1.2px; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.plan-overlay-notes {
  list-style: none; margin: 12px 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.plan-overlay-notes li {
  font-size: 15px; line-height: 1.6; letter-spacing: .6px;
  color: rgba(255,255,255,.9); white-space: normal;
}
.plan-overlay-count { margin-left: 8px; color: #ffd60a; font-weight: 700; font-variant-numeric: tabular-nums; }
.plan-overlay-stat {
  margin-top: 14px; padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.14);
  font-size: 13px; line-height: 1.6; letter-spacing: .5px; color: rgba(255,255,255,.72);
  font-variant-numeric: tabular-nums;
}


/* v163：画面操作提示统一落在画面正中央，做「弱提醒」——半透明毛玻璃、淡字、不抢画面。
   与底部面板脱钩成 fixed（.camera-screen 本身也是 fixed 全屏，两者严格重合），
   面板高度就不再随提示文案变化抖动。 */
.hint {
  position: fixed; left: 50%; top: 50%;
  transform: translate3d(-50%, -50%, 0);
  margin: 0; max-width: 74vw;
  padding: 7px 14px; border-radius: 13px;
  background: rgba(0, 0, 0, .26);
  -webkit-backdrop-filter: blur(10px) saturate(115%);
  backdrop-filter: blur(10px) saturate(115%);
  color: rgba(255, 255, 255, .66);
  font-size: 13px; line-height: 1.45; letter-spacing: .2px;
  text-align: center; pointer-events: none; z-index: 8;
  transition: opacity var(--dur-exit) var(--ease);
}

/* ---------- 相册视图 ---------- */
.album-mask {
  position: fixed; inset: 0; z-index: 80;
  height: 100vh; height: 100dvh;
  background: var(--bg);
  display: flex; flex-direction: column;
  overflow: hidden;
  /* 相机页 -> 相册页：整层淡入（不硬切）；只想动 opacity，避免合成层重建 */
  opacity: 0;
  transition: opacity var(--dur-exit) var(--ease);
  will-change: opacity;
}
.album-mask.is-open { opacity: 1; transition-duration: var(--dur-enter); }
.album-mask.hidden { will-change: auto; }
.album {
  /* min-height:0 必须加：否则 flex 子项默认 min-height:auto 会被列表撑高，
     导致 .video-list 永远等于内容高度、内层滚动失效（列表无法上下滑动） */
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
  /* 同上：安全区 + 38px 纯黑缓冲，让相册标题与列表顶边避开 iOS 状态栏柔化带 */
  /* 底部只留极窄安全距，列表一直铺到屏幕下沿，不再露出空白 */
  padding: calc(var(--safe-top) + 38px) 16px calc(6px + var(--safe-bottom));
  max-width: 640px; width: 100%; margin: 0 auto;
  /* 位移由变量驱动：进场上浮 10px，右滑跟手时由 JS 写 --album-x（同一条 transform 通道） */
  transform: translate3d(var(--album-x, 0px), var(--album-y, 0px), 0);
  transition: transform var(--dur-exit) var(--ease);
  will-change: transform;
}
.album-mask:not(.is-open) .album { --album-y: 10px; }
/* 右滑跟手期间关闭过渡，保证 1:1 跟手不掉帧 */
.album-mask.dragging,
.album-mask.dragging .album { transition: none; }
/* 判定关闭：整层向右滑出屏幕（承接手指位移，不再跳回原处） */
.album-mask.out-right .album { --album-x: 110vw; }
.app-version {
  /* 钉在整页最底部、水平居中：绝对定位脱离流式布局，
     既不顶高入口排，也不会和居中的入口排/定时排叠在一起。
     底距保持 8px + 安全区不变（贴底、不裁切），与入口排的留白由 .control-panel 的
     padding-bottom(48px) 提供，V84 起视觉间隔 27px，明显拉开但仍同属底部控制区。 */
  position: absolute; left: 50%; right: auto;
  transform: translateX(-50%);
  bottom: calc(8px + var(--safe-bottom));
  margin: 0; padding: 0;
  text-align: center; font-size: 10px; line-height: 1.3; letter-spacing: .4px;
  color: rgba(255,255,255,.4);
  font-variant-numeric: tabular-nums;
  -webkit-user-select: none; user-select: none;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.app-version.warn { color: rgba(255,168,76,.8); }

.album-top {
  position: relative;
  flex: 0 0 auto;      /* v115：不参与 flex 压缩，标题行高度恒定 */
  display: flex; align-items: flex-start; justify-content: center;
  padding: 0 0 14px;   /* 标题顶边与拍摄页预览框顶边齐平 */
}
/* v116：相册左上角「返回录制」按钮。绝对定位，不参与 flex 排布，
   标题行高度与居中不变，也不会把 v115 修好的列表起点（listTop 181px）带偏 */
.album-back {
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .1); color: var(--text);
  -webkit-tap-highlight-color: transparent;
  transition: background-color .16s ease, transform .16s ease;
}
.album-back svg { display: block; }
.album-back:active { background: rgba(255, 255, 255, .22); transform: translateY(-50%) scale(.94); }
.album-top h2 {
  font-size: 17px; font-weight: 700; line-height: 1.1;
  text-align: center; letter-spacing: .3px;
}
.album-count {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  font-size: 12px; color: var(--text-dim); font-variant-numeric: tabular-nums;
}
.album .video-list {
  flex: 1 1 auto; min-height: 0; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;   /* 列表滑到底不再带动整页回弹 */
  padding-bottom: 10px;
}

.album-tools {
  flex: 0 0 auto;      /* v115：同上，按钮行不被压缩 */
  display: flex; gap: 8px;
  padding: 0 0 12px;
}
.tool-btn {
  flex: 1; min-width: 0;
  background: var(--panel2); color: #fff; border: none;
  border-radius: 10px; font-size: 13px; font-weight: 600;
  padding: 10px 6px; cursor: pointer; white-space: nowrap;
}
.tool-btn:active { opacity: .8; }
.tool-btn.primary { background: var(--blue); }
.tool-btn.danger { color: var(--accent-hi); }
/* 无录像 / 无收藏：视觉上明确不可用（仍可点击，点了给出原因提示） */
.tool-btn.is-disabled { opacity: .42; }
/* 合成进行中：批量下载入口置灰，避免重复点击 */
.tool-btn.busy, .tool-btn:disabled { opacity: .42; pointer-events: none; }

/* ---------- 相册计划筛选 ---------- */
.album-filter {
  /* v115：固定 34px 行高、间距改用 margin-bottom。
     原来用 padding-bottom:26px 撑间距，作为 flex 子项会被压缩（实测被压到 41.7px，
     胶囊下方 26px 间距被裁掉大半），且切换筛选后会突然回弹到 60px，
     列表起点随之上下跳 19px —— 现在高度恒定，列表起点稳定在 181px。 */
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 8px;
  min-height: 34px; margin: 0 0 26px; padding: 0 14px 0 0;   /* 高度由胶囊撑开，避免真机字体渲染差异被裁 */
  overflow-x: auto; overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; scroll-padding-right: 14px;
}
.album-filter::-webkit-scrollbar { display: none; }
.album-filter:empty { display: none; margin: 0; padding: 0; }
.filter-chip {
  flex: 0 0 auto; flex-shrink: 0;
  /* 用 inline-flex + 固定行高撑出胶囊，宽度由文字决定，避免文字跑到标签外面 */
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 0; max-width: none; height: 34px;
  background: var(--panel2); color: var(--text-dim);
  border: none; border-radius: 999px;
  font-size: 14px; line-height: 1; padding: 0 16px; cursor: pointer;
  white-space: nowrap; overflow: visible; text-overflow: clip;
  -webkit-appearance: none; appearance: none;
  box-sizing: border-box; vertical-align: middle;
}
.filter-chip.active { background: var(--blue); color: #fff; font-weight: 600; }
.filter-chip:active { opacity: .8; }

.plan-tag {
  display: inline-flex; align-items: center; justify-content: center;
  height: 20px; line-height: 1; margin-left: 6px; padding: 0 8px;
  border-radius: 6px; font-size: 11px; font-weight: 600;
  background: rgba(52,199,89,.18); color: #5ee07a;
  max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  vertical-align: 1px; box-sizing: border-box;
}
.plan-tag.gone { background: rgba(255,255,255,.10); color: var(--text-dim); }
.plan-tag.none { display: none; }

.video-item.selected { outline: 2px solid var(--blue); }

/* ---- 上次观看标记：主色描边 + 浅色底 + 角标，仅视觉变化，不影响点击热区 ---- */
.video-item.last-played {
  outline: 2px solid rgba(10,132,255,.85);
  outline-offset: -2px;
  background: rgba(10,132,255,.14);
}
.video-item.last-played:active { background: #22262e; }
.video-item.last-played.flash { animation: lastPlayedFlash .9s ease-out 1; }
@keyframes lastPlayedFlash {
  0%   { background: rgba(10,132,255,.46); box-shadow: 0 0 0 0 rgba(10,132,255,.6); }
  60%  { background: rgba(10,132,255,.22); box-shadow: 0 0 0 8px rgba(10,132,255,0); }
  100% { background: rgba(10,132,255,.14); box-shadow: none; }
}
.last-watch-badge {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  border-radius: 6px; font-size: 10px; font-weight: 700; line-height: 1.5;
  background: rgba(10,132,255,.22); color: #6cb6ff;
  vertical-align: 1px; white-space: nowrap; pointer-events: none;
  -webkit-user-select: none; user-select: none;
}

.video-list { display: flex; flex-direction: column; gap: 10px; }
.empty { color: var(--text-dim); text-align: center; padding: 30px 0; font-size: 14px; }

.video-item {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px; row-gap: 8px;
  background: var(--panel); border-radius: var(--radius); padding: 10px;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.video-item:active { background: #232326; }
.video-list.selecting .video-item { cursor: default; }
.video-check {
  display: none; width: 22px; height: 22px; flex-shrink: 0;
  accent-color: var(--blue);
}
.video-list.selecting .video-check { display: block; }

.thumb {
  display: block;
  width: 84px; height: 63px; border-radius: 8px;
  /* 无封面时是灰色占位图；底色也改成灰，绝不再出现纯黑块 */
  background: #3a3a3c; object-fit: cover; flex-shrink: 0;
  -webkit-user-drag: none;
}
.meta { flex: 1; min-width: 0; }
.meta .title { font-size: 14px; font-weight: 600; }
.meta .sub { font-size: 12px; color: var(--text-dim); margin-top: 3px; font-variant-numeric: tabular-nums; }

/* 四个动作按钮（收藏/播放/保存/删除）：换行到整行，grid 四等分，等宽等距等热区 */
.actions {
  flex: 0 0 100%;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px;
  margin-top: 2px;
}
.actions button.act-btn {
  width: 100%; height: 34px; min-width: 0;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border: none; border-radius: 9px;
  background: var(--panel2); color: var(--text);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.actions button.act-btn svg {
  width: 18px; height: 18px; display: block;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
/* 收藏按钮高亮：必须带上 .actions button.act-btn 前缀，
   否则会被上面「.actions button.act-btn / ... svg」的规则按特异性压掉（color 永远不变黄、fill 永远 none） */
.actions button.act-btn.btn-fav { color: var(--text-dim); }
.actions button.act-btn.btn-fav.on { color: #ffd60a; }
.actions button.act-btn.btn-fav.on svg { fill: rgba(255, 214, 10, .95); stroke: #ffd60a; }
.btn-play { color: var(--blue); }
/* 播放三角改为实心，与其余线性图标同一 24 网格、同一视觉重量 */
.btn-play svg { fill: currentColor; stroke-width: 1.2; }
.btn-save { color: var(--green); }
.btn-del { color: var(--accent-hi); }
.actions button.act-btn:active { background: #34343a; }

.batch-bar {
  display: flex; align-items: center; gap: 10px;
  padding-top: 12px; margin-top: 12px;
  border-top: 1px solid #3a3a3c;
  animation: barRiseIn var(--dur-base) var(--ease);
}
.batch-count { flex: 1; font-size: 13px; color: var(--text-dim); }
.batch-bar .tool-btn { flex: 0 0 auto; padding: 10px 14px; }

/* ---------- 播放器（全屏 + 悬浮控件） ---------- */
.player-mask {
  position: fixed; inset: 0; z-index: 100;
  background: #000; overflow: hidden;
  /* 打开：黑底 + 画面一起淡入；关闭：淡出（视频同时下移，见 #playerVideo） */
  opacity: 0;
  /* transform 参与过渡：手势回弹 / 复位时才有缓动，跟手拖拽期间由 .dragging 关掉过渡 */
  transform-origin: center center;
  transition: opacity var(--dur-exit) var(--ease), transform var(--dur-exit) var(--ease);
  will-change: opacity, transform;
  /* v112：新增长按手势后必须关掉 iOS 长按放大镜/系统菜单，否则长按画面会先弹系统 UI */
  -webkit-touch-callout: none;
  -webkit-user-select: none; user-select: none;
}
.player-mask.is-open { opacity: 1; transition-duration: var(--dur-enter); }
.player-mask.hidden { will-change: auto; }
.player-mask.dragging { transition: none; }
/* 跟手拖动时整层轻微收小并压暗，做出「卡片浮起」的层次感 */
.player-mask.dragging { border-radius: 16px; }
#playerVideo {
  /* v111：回放画面改为整屏铺满 —— 取消原先「顶边下压 safe-top + 38px」的让位，
     那条让位在真机上表现为顶部一条黑带（上下都显得有黑边）。控件仍悬浮在画面上，布局不变。 */
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; background: #000;   /* 铺满整屏，多余部分按中心裁切 */
  transform-origin: center center;
  transition: transform var(--dur-exit) var(--ease);   /* 与遮罩淡出同节奏，退场不脱节 */
  touch-action: none;           /* 交给脚本处理缩放/平移，禁用浏览器整页缩放 */
  will-change: transform;
}
/* 进场：画面自下方 44px 上滑淡入；退场：画面下移 44px 随遮罩淡出（与入场对称，不再瞬切） */
.player-mask.is-open #playerVideo { animation: playerVideoIn var(--dur-enter) var(--ease) 1; }
.player-mask:not(.is-open) #playerVideo { transform: translate3d(0, 44px, 0); }
@keyframes playerVideoIn {
  from { opacity: .4; transform: translate3d(0, 44px, 0); }
  to   { opacity: 1;  transform: translate3d(0, 0, 0); }
}
.player-mask.zoomed #playerVideo { transition: none; }  /* 拖动/捏合时不要过渡延迟 */
/* v153：左右切换视频时只推画面 —— 跟手期间关掉画面过渡，播放器整层保持不动 */
.player-mask.swiping #playerVideo { transition: none; }

/* v172：v171 的常驻暂停徽标已撤（用户要回 v104「点画面才闪」的反馈），此处样式一并删除。 */

/* v154：相册式左右切换的「相邻画面」层。
   与 #playerVideo 完全同尺寸同裁切，跟手时两张一起平移，松手后它滑到正中、
   视频换源复位，视觉上就是相册里翻到下一张。默认隐藏，只在跟手/收尾期间显示。 */
.player-peek {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; background: #000;
  transform-origin: center center;
  display: none;
  pointer-events: none;
  will-change: transform, opacity;
}
.player-peek.on { display: block; }
.player-mask.swiping .player-peek { transition: none; }

/* v101：暂停不再给任何文字/图标提示 —— 用户要求暂停时画面干净，
   只靠画面静止本身传达状态（不放按钮、不放「已暂停」胶囊）。 */

/* v104：点画面暂停/播放的即时反馈。
   中央浮现一个半透明圆形图标（暂停=双竖线，播放=三角），700ms 内自行淡出。
   只动 opacity，不缩放/不位移视频画面，避免 iOS 合成层重绘掉帧；
   图标层 pointer-events:none，不参与手势判定，也不拦截双击放大。 */
.player-tap-fx {
  position: absolute; inset: 0; z-index: 4;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; opacity: 0;
}
.player-tap-fx .ptf-ico {
  position: absolute;
  width: 78px; height: 78px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(16,16,18,.5);
  box-shadow: 0 2px 18px rgba(0,0,0,.35);
  opacity: 0;
}
.player-tap-fx .ptf-ico svg {
  width: 34px; height: 34px;
  stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
  fill: none;
}
.player-tap-fx .ptf-play svg { fill: #fff; stroke: none; }
.player-tap-fx .ptf-ico.on { display: flex; }

/* 浮现节奏：快速亮起 → 短暂停留 → 尾部淡出，整体 700ms，不拖沓也不至于看不见 */
.player-tap-fx.show { animation: playerTapFxFade .7s ease-out; }
.player-tap-fx.show .ptf-ico.on { opacity: 1; }
@keyframes playerTapFxFade {
  0%   { opacity: 0; }
  12%  { opacity: 1; }
  58%  { opacity: 1; }
  100% { opacity: 0; }
}

/* v112：手势读数（长按 2x / 拖动预览时间 / 双指调速倍速）。
   固定在画面上方偏中位置，纯展示层：pointer-events:none，不参与也不打断手势判定。 */
.player-gesture-hud {
  position: absolute; z-index: 5;
  top: calc(96px + var(--safe-top)); left: 50%;
  transform: translate3d(-50%, -6px, 0);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 16px; border-radius: 14px;
  background: rgba(16,16,18,.62);
  box-shadow: 0 2px 16px rgba(0,0,0,.32);
  opacity: 0; pointer-events: none;
  transition: opacity .16s linear, transform .16s var(--ease);
}
.player-gesture-hud.on { opacity: 1; transform: translate3d(-50%, 0, 0); }
.player-gesture-hud .pgh-main {
  font-size: 19px; font-weight: 700; color: #fff; letter-spacing: .4px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 3px rgba(0,0,0,.5);
  white-space: nowrap;
}
.player-gesture-hud .pgh-sub {
  display: none;
  font-size: 11.5px; color: rgba(255,255,255,.72); letter-spacing: .3px;
  white-space: nowrap;
}
.player-gesture-hud .pgh-sub.on { display: block; }

/* 顶部：左侧时间标题，右侧按钮，压在视频上 */
.player-top {
  position: absolute; z-index: 3;
  top: 0; left: 0; right: 0;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: calc(46px + var(--safe-top)) 14px 30px;
  background: linear-gradient(to bottom, rgba(0,0,0,.8) 0%, rgba(0,0,0,.5) 55%, rgba(0,0,0,0) 100%);
  pointer-events: none;
  /* 控件层跟随播放器淡入淡出，并与画面上滑错开一点节奏，观感更松弛 */
  transition: opacity var(--dur-base) var(--ease), transform var(--dur-enter) var(--ease);
}
.player-mask:not(.is-open) .player-top { opacity: 0; transform: translate3d(0, -10px, 0); }
.player-title-wrap {
  pointer-events: auto;
  display: flex; flex-direction: column; gap: 2px;
  max-width: 40%;
  text-shadow: 0 1px 3px rgba(0,0,0,.7);
}
.player-title-label { font-size: 11px; font-weight: 700; color: rgba(255,255,255,.75); letter-spacing: .5px; }
.player-title-time { font-size: 12px; font-weight: 700; color: #fff; font-variant-numeric: tabular-nums; }
.player-top-actions { display: flex; align-items: center; gap: 6px; pointer-events: auto; }
/* 右上角统一为圆形图标按钮：收藏 / 删除 / 相机 / 关闭 */
.player-icon-btn {
  width: 36px; height: 36px; flex: 0 0 36px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; border: none; border-radius: 50%;
  background: rgba(255,255,255,.18); color: #fff; cursor: pointer;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  -webkit-tap-highlight-color: transparent;
}
.player-icon-btn svg {
  width: 19px; height: 19px; display: block;
  fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}
.player-icon-btn:active { background: rgba(255,255,255,.34); }
.player-del { color: #ff6b63; }
.player-fav.on { color: #ffd60a; }
.player-fav.on svg { fill: rgba(255,214,10,.95); }

/* v124：语音控制按钮（回放页最左）与识别文字条 */
.player-voice { color: #fff; }
.player-voice.unsupported { opacity: .45; }
.player-voice.listening {
  color: #4ade80;
  background: rgba(74,222,128,.22);
  animation: voiceBreath 1.6s ease-in-out infinite;
}
@keyframes voiceBreath {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74,222,128,.55); }
  50%      { box-shadow: 0 0 0 7px rgba(74,222,128,0); }
}
.voice-hint {
  position: absolute; z-index: 4;
  left: 50%; bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(6px);
  display: inline-flex; align-items: center; gap: 7px;
  max-width: 78vw; padding: 7px 13px;
  border-radius: 999px;
  background: rgba(0,0,0,.62);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: #fff; font-size: 13px; line-height: 1.3;
  opacity: 0; visibility: hidden;
  transition: opacity .18s ease, transform .18s ease, background .18s ease;
  pointer-events: none;
}
.voice-hint.show {
  opacity: 1; visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.voice-hint.hit { background: rgba(74,222,128,.92); color: #06240f; }
.vh-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #4ade80; flex: 0 0 7px;
  animation: vhDot 1.1s ease-in-out infinite;
}
.voice-hint.hit .vh-dot { background: #06240f; animation: none; }
@keyframes vhDot { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.vh-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* v143：语音控制入口移入下方入口排（定时之后、总设置之前），与其它入口同尺寸同底。
   图标是描边风格，需覆盖 .library-entry svg 的 fill 规则。 */
.cam-voice-entry svg {
  fill: none;
  stroke: #4ade80;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* 环境不支持语音识别：半透明常显，便于诊断 */
.cam-voice-entry.unsupported { opacity: .45; }
/* 正在听：底色提亮 + 呼吸光圈，与回放页语音按钮同一套视觉语言 */
.cam-voice-entry.listening {
  background: rgba(74,222,128,.22);
  border-color: #4ade80;
  animation: voiceBreath 1.6s ease-in-out infinite;
}
.cam-voice-hint { bottom: 18px; }

/* 右侧：竖排倍速 */
.speed-bar {
  position: absolute; z-index: 3;
  right: 8px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 6px;
  max-height: 60vh; overflow-y: auto; padding: 2px;
  -webkit-overflow-scrolling: touch;
  transition: opacity var(--dur-base) var(--ease);
}
.player-mask:not(.is-open) .speed-bar { opacity: 0; }
.speed-btn {
  background: rgba(255,255,255,.16); color: #fff; border: none;
  border-radius: 10px; font-size: 12px; font-weight: 700;
  padding: 8px 6px; min-width: 52px; cursor: pointer;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  -webkit-tap-highlight-color: transparent;
}
.speed-btn.active { background: var(--blue); color: #fff; }
.speed-btn:active { opacity: .8; }

/* 底部：进度条 + 播放控制，压在视频上 */
.player-controls {
  position: absolute; z-index: 3;
  left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; gap: 10px;
  padding: 30px 16px calc(12px + var(--safe-bottom));
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.5) 55%, rgba(0,0,0,0) 100%);
  transition: opacity var(--dur-base) var(--ease), transform var(--dur-enter) var(--ease);
}
/* v113：控制栏整体下移、离进度条更远 —— 只动「进度条↔按钮」间距与底部留白，
   按钮尺寸（44×34）、按钮间距（12）、居中方式一律不变。 */
.player-controls { gap: 22px; padding-bottom: calc(5px + var(--safe-bottom)); }
.player-mask:not(.is-open) .player-controls { opacity: 0; transform: translate3d(0, 12px, 0); }
.seek-row { display: flex; align-items: center; gap: 10px; }
/* v109 重排：6 个控件（重播/-3s/-1s/+1s/+3s/声音）等宽等高、均匀铺满整行。
   原先 #btnMute 绝对定位靠右、其余居中，导致重播与声音大小不一、间距不匀。
   v110：整体缩小并改为「固定小尺寸 + 等间距居中」，不再撑满整行。 */
.ctrl-row { display: flex; align-items: center; justify-content: center; gap: 12px; position: relative; }
.ctrl-row .ctrl-btn {
  flex: 0 0 auto; width: 44px; height: 34px; min-width: 0;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; font-size: 12px; line-height: 1; box-sizing: border-box;
}
.ctrl-row .ctrl-icon svg { width: 18px; height: 18px; }
.ctrl-btn {
  background: rgba(255,255,255,.16); color: #fff; border: none;
  border-radius: 999px; font-size: 13px; font-weight: 600;
  padding: 9px 14px; cursor: pointer; white-space: nowrap;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  -webkit-tap-highlight-color: transparent;
}
.ctrl-btn:active { opacity: .8; }
.ctrl-btn.on { background: rgba(10, 132, 255, .45); }
.ctrl-main {
  background: rgba(255,255,255,.22); color: #fff;
  min-width: 64px; font-size: 16px; padding: 10px 18px;
}
/* 控制栏图标化：播放/暂停与声音开关只用图标，不再显示文字 */
.ctrl-btn svg { display: block; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ctrl-main { min-width: 54px; padding: 10px 16px; }
.ctrl-main svg { width: 20px; height: 20px; }
.ctrl-main .ico-play { fill: currentColor; stroke: none; }
.ctrl-main .ico-pause { stroke-width: 2.6; display: none; }
.ctrl-main:not(.is-paused) .ico-play { display: none; }
.ctrl-main:not(.is-paused) .ico-pause { display: block; }
.ctrl-icon { padding: 9px 11px; }
.ctrl-icon svg { width: 20px; height: 20px; }
#btnMute .ico-wave { opacity: 1; transition: opacity var(--dur-fast) var(--ease); }
#btnMute .ico-slash { opacity: 0; transition: opacity var(--dur-fast) var(--ease); }
#btnMute.muted { background: rgba(255,255,255,.1); color: rgba(255,255,255,.62); }
#btnMute.muted .ico-wave { opacity: 0; }
#btnMute.muted .ico-slash { opacity: 1; }
.seek-bar {
  flex: 1; min-width: 0;
  -webkit-appearance: none; appearance: none;
  height: 6px; border-radius: 3px;
  background: rgba(255,255,255,.34); outline: none;
}
.seek-bar::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: none;
  box-shadow: 0 1px 5px rgba(0,0,0,.5);
  cursor: pointer;
}
.time-display {
  font-size: 12px; color: rgba(255,255,255,.85); white-space: nowrap;
  font-variant-numeric: tabular-nums; flex-shrink: 0;
}

/* ---------- 预设面板 / 练习计划面板 ---------- */
.preset-mask {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0,0,0,.65);
  display: flex; align-items: center; justify-content: center;
  padding: calc(20px + var(--safe-top)) 20px calc(20px + var(--safe-bottom));
  /* 遮罩淡入 + 面板上浮，统一节奏（planMask 复用同一套 class） */
  opacity: 0;
  transition: opacity var(--dur-exit) var(--ease);
  will-change: opacity;
}
.preset-mask.is-open { opacity: 1; transition-duration: var(--dur-enter); }
.preset-mask.hidden { will-change: auto; }
.preset-panel {
  width: 100%; max-width: 420px; max-height: 82vh;
  background: var(--panel); border-radius: 18px;
  padding: 18px; display: flex; flex-direction: column;
  /* 面板本身就是滚动容器：键盘弹起时可视高度被压缩，靠它把表单滚进可视区
     （scrollIntoView 才有效；不滚外层遮罩，避免整块面板被系统推走） */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
  transform: translate3d(0, var(--lift), 0) scale(.985);
  transition: transform var(--dur-exit) var(--ease);
  will-change: transform;
}
.preset-mask.is-open .preset-panel { transform: translate3d(0, 0, 0) scale(1); transition-duration: var(--dur-enter); }
.preset-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.preset-top h2 { font-size: 18px; font-weight: 700; }
.preset-list { overflow-y: auto; display: flex; flex-direction: column; gap: 8px; max-height: 40vh; }
.preset-empty { color: var(--text-dim); text-align: center; padding: 24px 0; font-size: 14px; }
.preset-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel2); border-radius: 10px; padding: 10px 12px;
  cursor: pointer;
}
.preset-item:active { opacity: .8; }
.preset-info { flex: 1; min-width: 0; }
.preset-name { font-size: 15px; font-weight: 600; }
.preset-default {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  font-size: 11px; font-weight: 600; border-radius: 6px;
  background: rgba(10, 132, 255, .22); color: #64b5ff; vertical-align: 1px;
}
.preset-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; font-variant-numeric: tabular-nums; }
.preset-edit, .preset-del {
  border: none; border-radius: 8px; font-size: 12px; font-weight: 600;
  padding: 7px 10px; cursor: pointer; flex-shrink: 0;
}
.preset-edit { background: var(--blue); color: #fff; }
.preset-del { background: var(--panel2); color: var(--accent-hi); }

/* 预设 / 计划列表的上下移动：横排双箭头，固定宽度不挤压文字 */
.order-switch {
  display: flex; align-items: center; gap: 2px;
  flex: 0 0 auto; -webkit-tap-highlight-color: transparent;
}
.order-btn {
  width: 28px; height: 44px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 8px;
  background: var(--panel); color: var(--text-dim);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.order-btn svg {
  width: 15px; height: 15px; display: block;
  fill: none; stroke: currentColor; stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
}
.order-btn:active { background: #3a3a3c; color: var(--text); }
.order-btn.is-off { opacity: .26; }
.preset-item .preset-info, .plan-item .preset-info { overflow: hidden; }
/* 名字过长时省略，不把右侧按钮挤变形 */
.preset-item .preset-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-item .preset-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.plan-name-text { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-item .plan-badge { flex: 0 0 auto; }
.preset-form {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid #3a3a3c;
}
.preset-name-input {
  background: var(--panel2); border: none; border-radius: 8px;
  color: var(--text); font-size: 16px; padding: 10px 12px; width: 100%;
}
.preset-name-input:focus { outline: 2px solid var(--blue); }
.preset-fields { display: flex; gap: 10px; }
.preset-fields label {
  flex: 1; display: flex; flex-direction: column;
  font-size: 12px; color: var(--text-dim); gap: 6px;
}
.preset-fields input {
  background: var(--panel2); border: none; border-radius: 8px;
  color: var(--text); font-size: 20px; font-weight: 600;
  padding: 8px 10px; width: 100%;
  font-variant-numeric: tabular-nums;
}
.preset-fields input:focus { outline: 2px solid var(--blue); }
.preset-form-actions { display: flex; gap: 8px; }

/* ---------- 练习计划面板 ---------- */
.plan-panel { max-height: 88vh; }
.plan-scroll {
  flex: 1; min-height: 0; overflow-y: auto;
  touch-action: pan-y;   /* v150：同上，避免横向手势被滚动接管 */
  display: flex; flex-direction: column; gap: 10px;
  -webkit-overflow-scrolling: touch;
}
.plan-panel.detail .plan-scroll { gap: 12px; }

/* ---------- 预设 / 计划浮层的软键盘避让 ----------
   iOS 主屏 PWA 弹键盘时不会改布局视口高度，fixed inset:0 的遮罩仍是整屏，
   居中面板的下半截（表单输入框）就被输入法直接盖住。JS 实测出键盘高度写进 --kb-h，
   这里把遮罩底部让出「键盘 + 安全区」，面板贴底上移，放不下的部分由面板自己滚动。
   只改 padding / max-height，不动 transform —— 入场动画与 --lift 都占用 transform，
   混用会互相覆盖（出现"抬一半"或"抖一下"）。 */
.preset-mask.kb-open {
  align-items: flex-end;
  padding-top: calc(10px + var(--safe-top));
  padding-bottom: calc(10px + var(--safe-bottom) + var(--kb-h, 0px));
  /* 仅弹起时补过渡，让面板随键盘平滑上移；收起时基类没有 padding 过渡，立刻复位不留空隙 */
  transition: padding-bottom 160ms var(--ease);
}
.preset-mask.kb-open > .preset-panel {
  max-height: 100%;
}
/* 键盘态只留面板这一个滚动容器：内部列表取消自身滚动，
   否则内外两层抢手势，出现"滚了没反应 / 抖一下" */
.preset-mask.kb-open .preset-list,
.preset-mask.kb-open .plan-notes-wrap { max-height: none; overflow: visible; }
.preset-mask.kb-open .plan-scroll { flex: 0 0 auto; min-height: 0; overflow: visible; }

.plan-current-bar { font-size: 12px; color: var(--text-dim); }
.plan-current-bar b { color: #5ee07a; }

.plan-item {
  display: flex; align-items: center; gap: 6px; flex-wrap: nowrap;
  background: var(--panel2); border-radius: 10px; padding: 10px 12px;
  cursor: pointer;
}

/* 计划操作区：纯图标、统一 44×44 热区、同排不换行，绝不挤压左侧文字 */
.plan-acts {
  display: flex; align-items: center; gap: 4px;
  flex: 0 0 auto; flex-wrap: nowrap;
}
.plan-act {
  width: 44px; height: 44px; min-width: 44px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 10px;
  background: var(--panel); color: var(--text-dim);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.plan-act svg {
  width: 20px; height: 20px; display: block;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.plan-act:active { background: #3a3a3c; }
.plan-act-copy { color: var(--blue); }
.plan-act-del { color: var(--accent-hi); }
.plan-item.flash { animation: lastPlayedFlash .9s ease-out 1; }

/* 复制态提示：明确告知这是新建而非改原计划 */
.plan-copy-hint {
  font-size: 12px; color: #64b5ff;
  background: rgba(10,132,255,.14); border-radius: 8px;
  padding: 6px 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.plan-item:active { opacity: .8; }
.plan-item .preset-name { display: flex; align-items: center; gap: 6px; }
.plan-item .preset-name .plan-name-text {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.plan-badge {
  background: rgba(52,199,89,.2); color: #5ee07a;
  font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 6px;
  flex-shrink: 0;
}

.plan-notes-wrap {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 24vh; overflow-y: auto;
}
.plan-note-row {
  display: flex; gap: 8px; align-items: center;
  border-radius: 10px;
  transition: background var(--dur-fast) var(--ease);
}
.plan-note-row.dragging {
  background: #2c2c2e; outline: 1px solid var(--blue);
  opacity: .92; position: relative; z-index: 2;
}
.note-drag {
  flex-shrink: 0; width: 30px; height: 38px;
  background: transparent; border: none; color: var(--text-dim);
  font-size: 17px; line-height: 1; cursor: grab;
  touch-action: none;            /* 拖动时不触发页面滚动 */
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none;
}
.note-drag:active { color: var(--blue); cursor: grabbing; }
.plan-note-row .note-title {
  flex: 1; min-width: 0;
  background: var(--panel2); border: none; border-radius: 8px;
  color: var(--text); font-size: 14px; padding: 9px 10px;
}
.plan-note-row .note-count {
  width: 60px; flex-shrink: 0;
  background: var(--panel2); border: none; border-radius: 8px;
  color: var(--text); font-size: 14px; font-weight: 600;
  padding: 9px 4px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.plan-note-row input:focus { outline: 2px solid var(--blue); }
.plan-note-row .note-del {
  background: var(--panel2); color: var(--accent-hi); border: none;
  border-radius: 8px; font-size: 18px; line-height: 1;
  width: 36px; height: 38px; flex-shrink: 0; cursor: pointer;
}
.plan-add-note { flex: none !important; margin-top: 12px; }

.plan-back {
  align-self: flex-start;
  background: var(--panel2); color: #fff; border: none;
  border-radius: 8px; font-size: 13px; font-weight: 600;
  padding: 8px 12px; cursor: pointer;
}
.plan-back:active { opacity: .8; }
.plan-detail-title { font-size: 18px; font-weight: 700; }
.plan-detail-notes { display: flex; flex-direction: column; gap: 6px; }
.plan-detail-note {
  display: flex; justify-content: space-between; gap: 10px;
  background: var(--panel2); border-radius: 8px;
  padding: 9px 12px; font-size: 14px;
}
.plan-detail-note span:last-child {
  color: #ffd60a; font-weight: 700; flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.plan-stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.plan-stat {
  background: var(--panel2); border-radius: 10px;
  padding: 10px; text-align: center;
}
.plan-stat .k { font-size: 11px; color: var(--text-dim); }
.plan-stat .v {
  font-size: 18px; font-weight: 700; margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.plan-goto { width: 100%; margin: 4px 0 10px; }
.plan-detail-actions { display: flex; gap: 8px; }

.picker-wrap { position: relative; display: flex; align-items: center; }
.picker-wrap input { padding-right: 30px; }
.pick-btn {
  position: absolute; right: 0; top: 50%; transform: translateY(-50%);
  background: transparent; border: none; color: var(--text);
  font-size: 18px; font-weight: 700;
  /* 定时排改为四项一行后，▾ 按钮收窄以把宽度让给数字输入框 */
  width: 28px; height: 28px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; line-height: 1; border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
}
.pick-btn:active { color: var(--blue); background: rgba(255,255,255,.10); }
/* 按钮视觉尺寸收窄后，用伪元素把可点区域外扩到约 42px，手指仍然好按 */
.pick-btn::after { content: ''; position: absolute; inset: -7px; border-radius: 14px; }

.time-picker-mask {
  position: fixed; inset: 0; z-index: 95;
  background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  padding: calc(20px + var(--safe-top)) 20px calc(20px + var(--safe-bottom));
  opacity: 0;
  transition: opacity var(--dur-exit) var(--ease);
  will-change: opacity;
}
.time-picker-mask.is-open { opacity: 1; transition-duration: var(--dur-enter); }
.time-picker-mask.hidden { will-change: auto; }
.time-picker-panel {
  width: 260px; max-height: 70vh;
  background: var(--panel); border-radius: 16px;
  padding: 14px; display: flex; flex-direction: column;
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
  transform: translate3d(0, var(--lift), 0) scale(.985);
  transition: transform var(--dur-exit) var(--ease);
}
.time-picker-mask.is-open .time-picker-panel { transform: translate3d(0, 0, 0) scale(1); transition-duration: var(--dur-enter); }
.time-picker-title {
  font-size: 15px; font-weight: 700; text-align: center;
  padding-bottom: 10px; border-bottom: 1px solid #3a3a3c; margin-bottom: 10px;
}
.time-picker-list {
  display: flex; flex-wrap: wrap; gap: 8px;
  overflow-y: auto; max-height: 50vh; justify-content: center;
}
.time-picker-list button {
  background: var(--panel2); color: var(--text); border: none;
  border-radius: 999px; font-size: 15px; font-weight: 600;
  padding: 10px 16px; cursor: pointer;
}
.time-picker-list button:active { background: var(--blue); color: #fff; }

/* ---------- Toast ---------- */
.confirm-mask {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.55); padding: 24px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity var(--dur-exit) var(--ease);
  will-change: opacity;
}
.confirm-mask.is-open { opacity: 1; transition-duration: var(--dur-enter); }
.confirm-mask.hidden { will-change: auto; }
.confirm-panel {
  width: 100%; max-width: 300px;
  background: var(--panel); border: 1px solid #3a3a3c; border-radius: 18px;
  padding: 20px 18px 16px; box-shadow: 0 12px 40px rgba(0,0,0,.5);
  transform: translate3d(0, var(--lift), 0) scale(.97);
  transition: transform var(--dur-exit) var(--ease);
}
.confirm-mask.is-open .confirm-panel { transform: translate3d(0, 0, 0) scale(1); transition-duration: var(--dur-enter); }
.confirm-msg {
  font-size: 15px; line-height: 1.55; letter-spacing: .3px;
  color: var(--text); text-align: center; white-space: pre-line;
}
.confirm-actions { display: flex; gap: 10px; margin-top: 18px; }
.confirm-actions .tool-btn { flex: 1; }
.tool-btn.danger { background: #3a1f1f; color: #ff6b63; border-color: #5a2a2a; }

/* v163：浮层提示（toast）同样居中弱化——玻璃底、淡字、无重投影，与 .hint 纵向错开一小段，
   两者同时出现也不会压在一起。 */
.toast {
  position: fixed; left: 50%; top: 50%;
  transform: translate3d(-50%, 8px, 0);
  background: rgba(0, 0, 0, .34); color: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: blur(12px) saturate(115%);
  backdrop-filter: blur(12px) saturate(115%);
  padding: 8px 16px; border-radius: 14px; font-size: 13px; line-height: 1.45;
  z-index: 200; box-shadow: 0 6px 22px rgba(0, 0, 0, .20);
  white-space: nowrap;
  opacity: 0;
  transition: opacity var(--dur-exit) var(--ease), transform var(--dur-exit) var(--ease);
  will-change: opacity, transform;
}
.toast.is-open { opacity: 1; transform: translate3d(-50%, 0, 0); transition-duration: var(--dur-enter); }
/* 画面中央已有提示语时，toast 下沉一档（由 showToast 判断是否加 .below），避免两行字叠在一起 */
.toast.below { top: calc(50% + 46px); }
/* 长提示（失败原因、替代路径）换行显示，别让关键信息被 nowrap 挤出屏幕 */
.toast.wrap {
  white-space: normal; text-align: center; line-height: 1.4;
  max-width: min(86vw, 520px); border-radius: 14px;
  padding: 12px 18px;
}
.toast.hidden { will-change: auto; }
/* ---------- 出入场微动画：列表条 / 倒数层 / 面板内视图切换 ----------
   这三个容器用 hidden 直接切换，改用 CSS 动画让 display 由 none -> 可见时自动重播 */
@keyframes barRiseIn {
  from { opacity: 0; transform: translate3d(0, 12px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes viewFadeIn {
  from { opacity: 0; transform: translate3d(0, 6px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
/* v171：倒计时改为纯透明度进场，去掉 6px 上移 —— 否则每跳一个数字都从下方 6px 推上来，
   视觉上「不是正中」，也让几何居中难以稳定（进场动画期间的中心会偏 3~6px）。 */
@keyframes countdownFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.countdown-overlay { animation: countdownFadeIn var(--dur-base) var(--ease); }
.plan-scroll { animation: viewFadeIn var(--dur-base) var(--ease); }

/* ---------- 统一按压反馈：列表项与按钮同节奏（只动 transform/opacity） ---------- */
.video-item, .preset-item, .plan-item, .filter-chip,
.tool-btn, .preset-edit, .preset-del,
.ctrl-btn, .player-icon-btn, .speed-btn, .plan-back,
.pick-btn, .time-picker-list button, .plan-goto {
  transition: transform var(--dur-fast) var(--ease),
              background-color var(--dur-base) var(--ease),
              color var(--dur-base) var(--ease),
              opacity var(--dur-fast) linear,
              border-color var(--dur-base) var(--ease);
}
.video-item:active, .preset-item:active, .plan-item:active, .filter-chip:active,
.tool-btn:active, .preset-edit:active, .preset-del:active,
.ctrl-btn:active, .player-icon-btn:active, .speed-btn:active, .plan-back:active,
.time-picker-list button:active, .plan-goto:active {
  transform: scale(.975);
}
/* 整行列表项按压更克制，避免大块内容缩放产生模糊 */
.video-item:active, .preset-item:active, .plan-item:active { transform: scale(.992); }
/* 自带位移的元素按压时保留原位移，只叠加缩放，避免跳位 */
.pick-btn:active { transform: translateY(-50%) scale(.97); }
/* 选中态需要保留自身 transform 的元素，按压不改形变，只降透明度 */
.speed-btn.active:active, .filter-chip.active:active { transform: none; opacity: .85; }

/* ---------- 无障碍：尊重系统「减弱动态效果」 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }
  .album, .preset-panel, .time-picker-panel, .confirm-panel, #playerVideo,
  .player-top, .player-controls { transform: none !important; }
}

/* ============================================================
   v121 口令门
   全屏覆盖在应用之上，z-index 高于所有浮层（含 99999 的诊断面板之外的一切）。
   通过后 JS 直接 remove 该节点，不做 display:none —— 避免残留层拦截手势。
   ============================================================ */
.gate {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 0 32px calc(var(--safe-bottom) + 24px) 32px;
  transition: opacity var(--dur-exit) var(--ease);
}
.gate.leaving {
  opacity: 0;
  pointer-events: none;
}
.gate.shake .gate-panel {
  animation: gateShake 320ms var(--ease-soft);
}
@keyframes gateShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}
.gate-panel {
  width: 100%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}
.gate-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  letter-spacing: .5px;
}
.gate-hint {
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
  margin-top: -6px;
  margin-bottom: 6px;
}
.gate-input {
  height: 52px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, .14);
  background: var(--panel);
  color: var(--text);
  font-size: 19px;
  letter-spacing: 6px;
  text-align: center;
  padding: 0 12px;
  outline: none;
  -webkit-appearance: none;
  transition: border-color var(--dur-base) var(--ease-soft);
}
.gate-input:focus {
  border-color: rgba(255, 255, 255, .34);
}
.gate-btn {
  height: 50px;
  border-radius: var(--radius);
  border: none;
  background: var(--panel2);
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--dur-enter) var(--ease), background var(--dur-base) var(--ease-soft);
}
.gate-btn:active {
  transform: scale(.97);
  background: #3a3a3c;
}
.gate-msg {
  min-height: 18px;
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
}

/* ================= v140：总设置页 ================= */
/* 第 4 入口：总设置。图标用滑块语义，与预设的齿轮区分开 */
/* v171：总设置入口已从本排删除（改为长按取景画面打开设置），
   对应的 .settings-entry 图标着色规则一并删掉，避免留下死样式。 */

/* 整页覆盖：z-index 85 低于预设/计划浮层(90)，从总设置打开面板时面板在上层 */
.settings-mask {
  position: fixed; inset: 0; z-index: 85;
  touch-action: pan-y;   /* v150：纵向滚动交给浏览器，横向留给右滑返回手势 */
  height: 100vh; height: 100dvh;
  background: var(--bg);
  display: flex; flex-direction: column;
  overflow: hidden;
  opacity: 0; transition: opacity var(--dur-exit) var(--ease); will-change: opacity;
}
.settings-mask.is-open { opacity: 1; transition-duration: var(--dur-enter); }
.settings-mask.hidden { will-change: auto; }

.settings-page {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
  padding-top: calc(var(--safe-top) + 6px);
  padding-bottom: calc(var(--safe-bottom) + 12px);
}
/* v143：顶部改三栏（1fr auto 1fr），标题真正居中；返回按钮复用相册页的圆形图标按钮 */
.settings-top {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 6px 16px 12px;
  border-bottom: 1px solid #2c2c2e;
}
.settings-top h2 {
  font-size: 17px; font-weight: 700; line-height: 1.1;
  text-align: center; letter-spacing: .3px;
}
/* 覆盖 .album-back 的绝对定位，改为栅格左列 */
.settings-top .album-back {
  position: static; transform: none;
  justify-self: start;
}
.settings-top .album-back:active { transform: scale(.94); }
.settings-top-spacer { justify-self: end; }

.settings-body {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 16px;
  display: flex; flex-direction: column; gap: 20px;
  touch-action: pan-y;   /* v148：滚动容器自身声明，iOS 才会把横向手势留给脚本 */
}
.settings-group { display: flex; flex-direction: column; }
.settings-group-title {
  font-size: 12px; color: var(--text-dim); font-weight: 600;
  padding: 0 4px 8px; letter-spacing: .02em;
}
.settings-row {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-height: 52px;
  background: var(--panel); border: none; border-radius: 12px;
  padding: 12px 14px; margin-bottom: 8px;
  color: var(--text); font-size: 15px; text-align: left;
  cursor: pointer; -webkit-appearance: none; appearance: none;
  -webkit-tap-highlight-color: transparent;
}
.settings-row:last-child { margin-bottom: 0; }
.settings-row:active { background: #2c2c2e; }
.settings-row.static { cursor: default; }
.settings-row.static:active { background: var(--panel); }
.settings-row-label { flex: 1; min-width: 0; }
.settings-row-sub {
  font-size: 13px; color: var(--text-dim);
  font-variant-numeric: tabular-nums; flex: 0 0 auto;
}
.settings-arrow { color: #5a5a5e; font-size: 18px; line-height: 1; flex: 0 0 auto; }
.settings-row.danger .settings-row-label { color: var(--accent-hi); }

/* v145：手势说明页 —— 设置页里只留一个入口小框，点进去看录制/播放两段手势。
   层级压在设置页(85)之上、预设/计划浮层(90)之下，关掉即回设置页。 */
.gesture-mask { z-index: 86; }
.gesture-mask .settings-body { gap: 22px; }
.gesture-mask .settings-row.static { min-height: 46px; padding: 10px 14px; }
.gesture-mask .settings-row-sub { text-align: right; }

/* v155：切换缝隙设置页 —— iOS 风格开关 + 宽度滑块 + 两卡预览 */
.settings-switch {
  position: relative; flex: 0 0 auto; width: 51px; height: 31px; padding: 0;
  border: none; border-radius: 16px; background: #39393d; cursor: pointer;
  -webkit-appearance: none; appearance: none; -webkit-tap-highlight-color: transparent;
  transition: background .2s var(--ease);
}
.settings-switch.on { background: #34c759; }
/* v159：默认设置里上层项关掉时，下两项只弱化不 disable（仍可先把默认值设好） */
.settings-switch.dim { opacity: .4; }
.settings-switch-knob {
  position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,.35);
  transition: transform .2s var(--ease);
}
.settings-switch.on .settings-switch-knob { transform: translateX(20px); }
/* v162：滑轨本体只有 4px 高，手柄是 26px 圆点（上下各溢出 11px），
   原来只留 2px 上内边距 → 手柄下沿被下面那一行盖住。按手柄尺寸留足上下留白。 */
.gap-slider-wrap { padding: 13px 12px 15px; }
.gap-slider {
  width: 100%; height: 4px; margin: 0; border-radius: 2px; background: #3a3a3c;
  -webkit-appearance: none; appearance: none; outline: none;
  /* v161：外层 .settings-mask / .settings-body 声明了 touch-action: pan-y（横向留给右滑返回），
     滑块继承后浏览器不再处理横向拖动 → 只能点按。这里单独放开横向，恢复原生拖拽。 */
  touch-action: pan-x;
}
.gap-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); cursor: pointer;
}
.gap-slider:disabled { opacity: .35; }
.gap-preview {
  display: flex; align-items: center; justify-content: center; gap: 0;
  height: 96px; padding: 0 14px; border-radius: 12px; background: #000;
}
.gap-preview-card {
  flex: 1 1 0; height: 64px; border-radius: 6px;
  background: linear-gradient(135deg, #4a4a4f, #2a2a2e);
}
.gap-preview-gap { flex: 0 0 auto; width: 8px; height: 64px; background: #000; }

/* v150：右滑返回跟手拖拽（与相册右滑同一套：拖拽期间关过渡，位移实时联动） */
.settings-mask.swipe-dragging,
.plan-scroll.swipe-dragging {
  transition: none !important;
  transform: translateX(var(--swipe-x, 0px));
}
/* v150：松手未达阈值 —— 回弹原位（与相册同一套缓动节奏） */
.settings-mask.swipe-return,
.plan-scroll.swipe-return {
  transition: transform var(--dur-exit) var(--ease), opacity var(--dur-exit) var(--ease);
  transform: translateX(0px);
}
/* v150：判定返回 —— 承接手指位移继续向右滑出屏幕，不再跳回原处 */
.settings-mask.swipe-out,
.plan-scroll.swipe-out {
  transition: transform var(--dur-enter) var(--ease), opacity var(--dur-enter) var(--ease);
  transform: translateX(110vw);
  opacity: 0;
}

/* ---------- 面板模式：列表选择 vs 总设置管理 ---------- */
/* 默认（录制页进入）只做列表选择：表单与编辑/删除按钮全部收起 */
#presetMask #presetForm { display: none; }
#presetMask .preset-edit, #presetMask .preset-del { display: none; }
#planMask .plan-act-copy, #planMask .plan-act-del { display: none; }
#planMask .plan-new-btn { display: none; }

/* 管理模式（总设置进入）：全部展开 */
#presetMask.manage-mode #presetForm { display: flex; }
#presetMask.manage-mode .preset-edit,
#presetMask.manage-mode .preset-del { display: inline-flex; }
#planMask.manage-mode .plan-act-copy,
#planMask.manage-mode .plan-act-del { display: inline-flex; }
#planMask.manage-mode .plan-new-btn { display: flex; }

/* 排序箭头也属于管理动作：选择模式下收起，避免列表里堆满控件 */
#presetMask .order-switch, #planMask .order-switch { display: none; }
#presetMask.manage-mode .order-switch,
#planMask.manage-mode .order-switch { display: flex; }

/* ================= v147 ================= */
/* 1) 录制页不再显示版本号：元素保留（renderVersion / 连点强制刷新 / 长按诊断仍挂在上面），
      只是不占位不显示；版本与检查更新入口统一收进总设置页的「版本」行。 */
.app-version { display: none !important; }

/* 2) 相册页整体版式对齐总设置页：同一套顶部三栏（返回 / 居中标题 / 右侧计数）+ 分隔线，
      同一套页面内边距与卡片化工具条，让两页切换时视觉不跳。 */
.album {
  padding: calc(var(--safe-top) + 6px) 16px calc(var(--safe-bottom) + 12px);
}
.album-top {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 6px 0 12px;
  border-bottom: 1px solid #2c2c2e;
}
.album-top .album-back {
  position: static; transform: none; justify-self: start;
}
.album-top .album-back:active { transform: scale(.94); }
.album-count {
  position: static; transform: none; justify-self: end;
}
/* 工具条收进一张卡片，与设置页的分组卡片同一视觉语言 */
.album-tools {
  background: var(--panel); border-radius: 12px;
  padding: 8px; gap: 8px; margin-top: 14px;
}
.album-tools .tool-btn { border-radius: 9px; }
.album-filter { margin-top: 12px; }
.album .video-list { padding-top: 12px; }

/* v156：总设置 → 今日一句话（录制页那句的编辑入口，录制页只展示不再就地编辑） */
.motto-edit-wrap { padding: 2px 4px 0; }
.motto-input {
  width: 100%; box-sizing: border-box; resize: none;
  background: var(--panel); color: var(--text);
  border: 1px solid rgba(255,255,255,.10); border-radius: 12px;
  padding: 12px 14px; font-size: 15px; line-height: 1.5;
  font-family: inherit; outline: none; -webkit-appearance: none;
}
.motto-input::placeholder { color: var(--text-dim); }
.motto-input:focus { border-color: rgba(255,255,255,.28); }
.motto-edit-meta { margin-top: 6px; padding-right: 4px; text-align: right; font-size: 12px; color: var(--text-dim); }

/* ================= v157 ================= */
/* 练习计划的新建 / 编辑 / 复制改为独立整页子页（对齐 v156「今日一句话」）。
   层级：计划面板 90 < 本子页 95，子页整页不透明覆盖，返回即回列表，列表状态不丢。 */
.plan-edit-mask { z-index: 95; }
.plan-edit-form {
  flex: 1; min-height: 0; display: flex; flex-direction: column;
}
/* 表单主体沿用设置页的滚动容器，底部保存条独立成行，键盘弹起只压缩滚动区 */
.plan-edit-form .settings-body { padding-bottom: 12px; }
.plan-edit-form .preset-name-input { box-sizing: border-box; }
.plan-edit-form .plan-notes-wrap { max-height: none; }
.plan-edit-actions {
  flex: 0 0 auto;
  display: flex; gap: 10px;
  padding: 10px 16px calc(var(--safe-bottom) + 12px);
  border-top: 1px solid #2c2c2e;
  background: var(--bg);
}
.plan-edit-actions .tool-btn { padding: 12px 6px; font-size: 15px; }
/* 列表底部的「+ 新建计划」入口（仅管理模式显示） */
.plan-new-btn { flex: 0 0 auto; margin-top: 4px; padding: 12px 6px; font-size: 14px; }

/* ================= v158：总设置 → 练习计划改为整页子页 =================
   录制页的 #btnPlan 仍走底部弹层（select 模式）；只有从总设置进入（manage 模式）
   才加 .page-mode：遮罩铺满整屏、面板取消圆角与上浮动画，列表 / 详情 / 编辑子页逻辑全部复用。 */
.preset-mask.page-mode {
  z-index: 90;
  display: block;
  padding: 0;
  background: var(--bg);
}
.preset-mask.page-mode .preset-panel {
  width: 100%; max-width: none; max-height: none;
  height: 100%;
  padding: calc(var(--safe-top) + 6px) 16px calc(var(--safe-bottom) + 12px);
  border-radius: 0;
  background: var(--bg);
  box-shadow: none;
  overflow: hidden;          /* 滚动交给 .plan-scroll，避免内外两层抢手势 */
}
.preset-mask.page-mode.is-open .preset-panel { transform: none; }
/* 顶部改三栏：返回按钮在左、标题居中，与总设置页同一套版式 */
.preset-mask.page-mode .preset-top {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 6px 0 12px;
  margin-bottom: 0;
  border-bottom: 1px solid #2c2c2e;
}
.preset-mask.page-mode .preset-top h2 { font-size: 17px; text-align: center; letter-spacing: .3px; }
.preset-mask.page-mode .plan-page-back {
  position: static; transform: none;
  justify-self: start;
}
.preset-mask.page-mode .plan-page-back:active { transform: scale(.94); }
.preset-mask.page-mode .preset-top .settings-top-spacer { display: block; }
.preset-mask.page-mode .plan-scroll { padding-top: 14px; }
/* 弹层模式（录制页）不显示返回按钮与右侧占位，标题仍靠左 */
.plan-page-back, .preset-top .settings-top-spacer { display: none; }
.preset-mask.page-mode .plan-page-back { display: flex; }
