/* 手机传 · 共用样式
   方向：暗房接触印相 —— 暖灰纸底、无光晕、素材是唯一的颜色。
   全站只有一束高饱和（琥珀 --accent）：待办=琥珀，实况=白色空心环，失败=--err，抖音=--douyin。
   三级规则：一束光 / 素材优先于容器 / 密度即功能。

   目录
   0  重置与 token
   1  字号阶梯 T0–T8
   2  基础件：按钮 / 卡 / chip / 进度 / 状态灯 / 输入
   3  实况符号（同心空心环，永久白，0 动效）
   4  缩略格（手机网格 / 电脑缩略流共用）
   5  电脑操作台
   6  手机端（顶栏 / 网格 / FAB / 选中条 / 预览层 / 上传 sheet）
   7  实况工作台
   8  浮层 / 空态 / 杂项
   9  无障碍与动效降级
*/

/* ---------------------------------------------------------------- 0 重置与 token */
*, *::before, *::after { box-sizing: border-box; }

:root {
  /* 纸 / 面 */
  --bg:        #131211;
  --surface-1: #1B1917;
  --surface-2: #232120;
  --surface-3: #2C2926;
  --line:      #302C29;
  --line-soft: #221F1D;

  /* 墨 */
  --text-1: #F5F1EC;
  --text-2: #B5ADA4;
  --text-3: #8A8379;
  --text-4: #5C5651;

  /* 灯：待办 / 可动手 */
  --accent:     #FFA827;
  --accent-ink: #1A1206;
  --accent-dim: rgba(255, 168, 39, .14);

  /* 非语义品牌色 */
  --douyin: #D81B45;

  /* 素材上的符号：永远白，与皮肤无关 */
  --mark:       rgba(255, 255, 255, .92);
  --mark-ghost: rgba(255, 255, 255, .55);

  /* 状态 */
  --ok:   #3FD08A;
  --warn: #E8C177;
  --err:  #FF5A5F;
  --qr-bg: #FFFFFF;  /* 全站唯一允许纯白的表面 */

  /* 字 */
  --font: -apple-system, "PingFang SC", "HarmonyOS Sans SC", "MiSans",
          "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;

  /* 圆角只有 5 档 */
  --r-1: 3px;   /* 缩略格 */
  --r-2: 6px;   /* 小控件 / chip */
  --r-3: 8px;   /* 按钮 / 输入 */
  --r-4: 12px;  /* 卡片 */
  --r-5: 16px;  /* 弹层 / sheet */
  --r-pill: 999px;

  /* 唯一的浮层阴影 */
  --pop: 0 8px 24px rgba(0, 0, 0, .45);
}

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text-1);
  font: 400 15px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

img, video { display: block; max-width: 100%; }

/* .btn / .chip / .empty 都带 display，[hidden] 会被它们压掉，这里统一兜住 */
[hidden] { display: none !important; }

button, input, select, textarea { font: inherit; color: inherit; }

a { color: inherit; text-decoration: none; }

::selection { background: var(--accent-dim); color: var(--text-1); }

.mut  { color: var(--text-2); }
.dim  { color: var(--text-3); }
.faint{ color: var(--text-4); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.ell  { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row  { display: flex; align-items: center; gap: 8px; min-width: 0; }
.col  { display: flex; flex-direction: column; min-width: 0; }
.hr   { height: 1px; background: var(--line-soft); border: 0; margin: 12px 0; }

/* ---------------------------------------------------------------- 1 字号阶梯 */
.t0 { font: 700 56px/1 var(--mono);      letter-spacing: -1px;   font-variant-numeric: tabular-nums; }
.t1 { font: 700 28px/1.2 var(--font);    letter-spacing: -.3px; }
.t2 { font: 600 20px/1.3 var(--font);    letter-spacing: -.2px; }
.t3 { font: 600 16px/1.4 var(--font); }
.t4 { font: 400 15px/1.5 var(--font); }
.t5 { font: 500 13px/1.45 var(--font); }
.t6 { font: 600 12px/1.4 var(--font);    letter-spacing: .2px; }
.t7 { font: 600 11px/1.3 var(--mono);    letter-spacing: .2px; font-variant-numeric: tabular-nums; }
.t8 { font: 700 10px/1.2 var(--font);    letter-spacing: .3px; }

/* ---------------------------------------------------------------- 2 基础件 */

/* 按钮：实底（琥珀）/ 幽灵 / 次要 */
.btn {
  --h: 36px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--h); padding: 0 14px;
  border: 1px solid transparent; border-radius: var(--r-3);
  background: var(--surface-2); color: var(--text-1);
  font: 600 14px/1 var(--font);
  white-space: nowrap; cursor: pointer;
  transition: background 150ms ease-out, color 150ms ease-out, border-color 150ms ease-out;
}
.btn:active { background: var(--surface-3); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: default; }

.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:active { background: #E8951C; }

.btn.ghost { background: transparent; border-color: var(--line); color: var(--text-2); }
.btn.ghost:active { background: var(--surface-2); color: var(--text-1); }

.btn.sm  { --h: 28px; padding: 0 10px; font-size: 13px; border-radius: var(--r-2); }
.btn.xs  { --h: 24px; padding: 0 8px;  font-size: 12px; border-radius: var(--r-2); }
.btn.lg  { --h: 48px; font-size: 15px; border-radius: 11px; width: 100%; }
.btn.block { width: 100%; }

/* 卡片：无投影，只有 1px 线与面色差 */
.card {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r-4);
  padding: 20px;
  min-width: 0;
}

/* chip */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px;
  border-radius: var(--r-2); background: var(--surface-2); color: var(--text-2);
  font: 600 12px/1 var(--font); letter-spacing: .2px; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.chip.ok   { color: var(--ok);   background: rgba(63, 208, 138, .12); }
.chip.warn { color: var(--warn); background: rgba(232, 193, 119, .12); }
.chip.acc  { color: var(--accent); background: var(--accent-dim); }
.chip.off  { color: var(--text-4); }
.chip.douyin { color: #fff; background: var(--douyin); border-radius: var(--r-2); }

/* 进度条：槽 --surface-3，进行中琥珀，完成绿，失败红且停住不回零 */
.prog { height: 3px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.prog > i {
  display: block; height: 100%; width: 0; border-radius: 2px;
  background: var(--accent); transition: width 180ms linear;
}
.prog > i.ok  { background: var(--ok); }
.prog > i.err { background: var(--err); }
.prog.thick { height: 6px; border-radius: var(--r-1); }
.prog.thick > i { border-radius: var(--r-1); }

/* 不确定进度（电脑端只知道「在收」，不给假百分比） */
.prog.indet > i { width: 34%; animation: indet 1400ms ease-in-out infinite; }
@keyframes indet {
  0%   { margin-left: -34%; }
  100% { margin-left: 100%; }
}

/* 状态灯：8px，颜色只表示「已连 / 待办」，连接中用呼吸不用暖色 */
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot.ok   { background: var(--ok); }
.dot.acc  { background: var(--accent); }
.dot.live { background: var(--accent); }
.dot.off  { background: var(--text-4); }
.dot.breath { animation: breathe 1600ms ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: .32; } 50% { opacity: 1; } }

/* 待办红点：6px，永远配动词短语（文字在 DOM 里，不靠颜色） */
.todo { display: inline-flex; align-items: center; gap: 5px; color: var(--accent); }
.todo::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }

/* 地址条：当作「打出来的字」 */
.addr {
  display: flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 10px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-3);
  color: var(--warn); font: 600 11px/1.3 var(--mono);
  user-select: all; overflow: hidden;
}
.addr > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 提示条 */
.note {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px; border-radius: var(--r-2);
  background: var(--accent-dim); color: var(--text-2);
  font: 500 13px/1.45 var(--font);
}
.note.warn { background: rgba(232, 193, 119, .10); color: var(--warn); }
.note.err  { background: transparent; border-left: 3px solid var(--err); color: var(--text-2); }
.note b { color: var(--text-1); font-weight: 600; }

/* 视觉隐藏但可被点（Safari 里 display:none 的 input 点不动） */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------------------------------------------------------------- 3 实况符号
   空心同心环，白色，0 动效。环必须空心：实心圆 = 录像，空心 = 实况。
   位置恒为左上内缩 5px；右下归时长，右上归勾选/已导出。 */
.livemark {
  --m: 14px;
  position: absolute; left: 5px; top: 5px;
  width: var(--m); height: var(--m);
  border-radius: calc(var(--m) * .28);
  background: rgba(0, 0, 0, .55);
  display: grid; place-items: center;
  pointer-events: none;
}
.livemark::before, .livemark::after {
  content: ""; position: absolute; border-radius: 50%;
  border: 1.5px solid var(--mark);
}
.livemark::before { width: calc(var(--m) * .64); height: calc(var(--m) * .64); }
.livemark::after  {
  width: calc(var(--m) * .28); height: calc(var(--m) * .28);
  border-color: var(--mark-ghost);
}
.livemark.s96  { --m: 20px; }
.livemark.s128 { --m: 22px; }
/* 行内形态（上传组头、详情行） */
.livemark.i {
  position: static; left: auto; top: auto; flex: none;
}
/* 表头用：苹果实况 / 安卓动态 */
.kind { display: inline-flex; align-items: center; gap: 5px; color: var(--text-3); }

/* ---------------------------------------------------------------- 4 缩略格 */
.tile {
  position: relative; display: block; width: 100%;
  aspect-ratio: 1 / 1; padding: 0; border: 0;
  background: var(--surface-2); border-radius: var(--r-1);
  overflow: hidden; cursor: pointer;
  transition: opacity 150ms ease-out;
}
.tile > img { width: 100%; height: 100%; object-fit: cover; }
.tile:active { opacity: .82; }

/* 兜底占位：HEIC 缩略失败时不留白格 */
.tile .fallback {
  position: absolute; inset: 0; display: grid; place-items: center; gap: 4px;
  color: var(--text-4); text-align: center; padding: 6px;
}
.tile .nm {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 16px 6px 4px;
  font: 700 10px/1.2 var(--font); letter-spacing: .3px; color: #fff;
  background: linear-gradient(transparent, rgba(0, 0, 0, .78));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
}
.tile.hasdur .nm { padding-right: 40px; }

/* 普通视频时长 chip：右下 5px */
.tile .dur {
  position: absolute; right: 5px; bottom: 5px;
  height: 16px; padding: 0 4px; border-radius: var(--r-1);
  background: rgba(0, 0, 0, .62); color: #fff;
  font: 600 11px/16px var(--mono); letter-spacing: .2px;
  pointer-events: none;
}

/* 勾选圈：右上，视觉 22 命中 44 */
.selc {
  position: absolute; right: 5px; top: 5px;
  width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid var(--mark); background: rgba(0, 0, 0, .38);
  display: grid; place-items: center;
  color: transparent; font: 700 12px/1 var(--font);
  cursor: pointer;
  transition: background 150ms ease-out, border-color 150ms ease-out;
}
.selc::after { content: ""; position: absolute; inset: -11px; }
.tile.sel .selc { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tile.sel::after {
  content: ""; position: absolute; inset: 0;
  box-shadow: inset 0 0 0 2px var(--accent); border-radius: var(--r-1);
  pointer-events: none;
}

/* 单选下载：右下（视频放时长之上），视觉 22 命中 44 */
.tile .dl {
  position: absolute; right: 5px; bottom: 5px;
  width: 22px; height: 22px; border-radius: var(--r-2);
  background: rgba(0, 0, 0, .55); color: var(--mark);
  display: grid; place-items: center;
  font: 600 13px/1 var(--font);
}
.tile.hasdur .dl { bottom: 26px; }
.tile .dl::after { content: ""; position: absolute; inset: -11px; }
.tile .dl:active { background: rgba(0, 0, 0, .8); }

/* 已导出勾：右上，绿底深勾 */
.tickmark {
  position: absolute; right: 5px; top: 5px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--ok); color: var(--accent-ink);
  display: grid; place-items: center;
  font: 700 10px/1 var(--font);
  pointer-events: none;
}

/* ---------------------------------------------------------------- 5 电脑操作台 */
.console { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }

.console .top {
  flex: none; height: 56px; padding: 0 24px;
  display: flex; align-items: center; gap: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.console .top .brand { display: flex; align-items: baseline; gap: 8px; }
.console .top .brand b { font: 600 16px/1 var(--font); letter-spacing: 0; }
.console .top .sep { width: 1px; height: 16px; background: var(--line); flex: none; }

.console .main {
  flex: 1; min-height: 0; display: grid;
  grid-template-columns: 420px minmax(0, 1fr) 340px;
  gap: 20px; padding: 20px 40px;
}
.console .c1, .console .c2, .console .c3 {
  min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 20px;
}

/* 连接卡 */
.conn {
  display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 0; padding: 24px;
  overflow-y: auto; scrollbar-width: thin;      /* 窗口矮到放不下时内部滚动，不再无声裁掉最后几行 */
}
.conn .lead { color: var(--text-3); font: 500 13px/1.45 var(--font); }

/* 236 是设计值（离桌也能扫），窗口矮时按 31vh 收，最低 150 保证可扫 */
.qrbox {
  width: min(236px, 31vh); height: min(236px, 31vh);
  min-width: 150px; min-height: 150px;
  flex: none; padding: 10px;
  background: var(--qr-bg); border-radius: var(--r-4); align-self: center;
}
.qrbox img { width: 100%; height: 100%; image-rendering: pixelated; }

/* 三链路表：每行 h42 */
.links { display: flex; flex-direction: column; gap: 6px; }
.linkrow {
  display: grid; grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center; gap: 10px;
  height: 42px; padding: 0 10px; border-radius: var(--r-2);
  background: transparent; border: 1px solid transparent;
  cursor: pointer; text-align: left; width: 100%;
  transition: background 150ms ease-out, border-color 150ms ease-out;
}
.linkrow:hover { background: var(--surface-2); }
.linkrow[aria-disabled="true"] { cursor: not-allowed; opacity: .5; }
.linkrow.on {
  background: var(--surface-2); border-color: var(--line);
  box-shadow: inset 3px 0 0 var(--accent);
}
.linkrow .lname { display: flex; align-items: baseline; gap: 6px; }
.linkrow .lurl { color: var(--text-3); font: 600 11px/1.3 var(--mono); }
.linkrow .use { color: var(--accent); font: 600 11px/1 var(--mono); }

/* 底·传输状态条 */
.statbar {
  flex: none; height: 64px; padding: 0 24px;
  display: flex; align-items: center; gap: 16px;
  background: var(--surface-1); border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.statbar .mid { flex: 1; min-width: 0; max-width: 320px; display: flex; flex-direction: column; gap: 6px; }

/* 入口卡 */
.entries { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; flex: 1 1 auto; min-height: 132px; }
.entry {
  display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
  padding: 16px; min-height: 132px; overflow: hidden;
  background: var(--surface-1); border: 1px solid var(--line); border-radius: var(--r-4);
  cursor: pointer; text-align: left;
  transition: background 150ms ease-out, border-color 150ms ease-out;
}
.entry:hover { background: var(--surface-2); }
.entry:active { background: var(--surface-3); }
.entry .big { font: 700 34px/1 var(--mono); letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.entry .big.acc { color: var(--accent); }
.entry .big.mut { color: var(--text-3); }
.entry .cap { color: var(--text-3); font: 500 13px/1.45 var(--font); }

/* 中列的高度预算：缩略区按视口高度定住，绝不被方图撑高。
   原来 .strip.big 的 tile 是 1:1，窗口一宽 tile 就长到 276px（1766 宽时整张卡 650px 高），
   把三张入口卡压成 0 高、被 .console 的 overflow:hidden 裁掉——宽屏下入口直接消失。
   现在：缩略区 clamp(150,28vh,320) 可缩；入口行 flex-grow 吃剩余；「＋ 交一篇」固定 32px。 */
.console .c2 > .card { flex: 0 1 auto; min-height: 0; overflow: hidden; }
.console .c2 .strip.big {
  flex: 0 1 auto; min-height: 0;
  height: clamp(150px, 28vh, 320px);
  grid-auto-rows: minmax(0, 1fr);
}
.console .c2 .strip.big .tile { aspect-ratio: auto; }

/* 补充入口行：不做成第四张入口卡，免得跟三张主卡抢视线。
   虚线边 = 「这是补充路径」，不占用琥珀（琥珀只给「要你现在动手」）。 */
.newline {
  flex: none; width: 100%; height: 32px; padding: 0 12px;
  justify-content: flex-start; gap: 8px;
  border-style: dashed; text-decoration: none; white-space: nowrap;
}
.newline:hover { background: var(--surface-1); border-color: var(--line); }
.newline:active { background: var(--surface-2); }

/* 电脑缩略流：6 列 gap 8 圆角 6；中间区用 3 列大格（一眼看清是哪些文件） */
.strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.strip .tile { border-radius: var(--r-2); }
.strip.big { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* 列表行 */
.lrow {
  display: flex; align-items: center; gap: 10px;
  height: 28px; color: var(--text-2); font: 500 13px/1.4 var(--font);
}
.lrow .sz { color: var(--text-3); font: 600 11px/1 var(--mono); flex: none; }

/* 空态：口语，不写「暂无数据」 */
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 20px 12px; text-align: center; color: var(--text-3);
  font: 500 13px/1.5 var(--font); flex: 1;
}
.empty b { color: var(--text-2); font: 600 15px/1.4 var(--font); }

/* ---------------------------------------------------------------- 6 手机端 */
.hand {
  height: 100vh; height: 100dvh;
  display: flex; flex-direction: column;
  overflow: hidden;
}

.hand .top {
  position: sticky; top: 0; z-index: 30; flex: none;
  height: 52px; padding: env(safe-area-inset-top) 6px 0 6px;
  display: flex; align-items: center; gap: 4px;
  background: var(--bg); border-bottom: 1px solid var(--line);
  padding-top: calc(env(safe-area-inset-top));
  box-sizing: content-box;
}
.hand .top .ibtn {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  background: transparent; border: 0; border-radius: var(--r-2);
  color: var(--text-2); cursor: pointer; position: relative;
}
.hand .top .ibtn::after { content: ""; position: absolute; inset: -5px; }
.hand .top .ibtn:active { background: var(--surface-2); }
.hand .top .ibtn[disabled] { color: var(--text-4); }
/* 顶栏右侧「＋ 交一篇」：补投稿箱入口，不是主按钮，所以只给描边 */
.hand .top .subbtn {
  flex: none; height: 30px; padding: 0 10px; margin-right: 4px;
  display: inline-flex; align-items: center;
  border: 1px solid var(--line); border-radius: var(--r-2);
  background: transparent; color: var(--text-2);
  font: 600 12px/1 var(--font); letter-spacing: 0;
  text-decoration: none; white-space: nowrap;
}
.hand .top .subbtn:active { background: var(--surface-2); color: var(--text-1); }
.crumbs {
  display: flex; align-items: center; gap: 2px;
  flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none;
}
.crumbs::-webkit-scrollbar { display: none; }
.crumbs button {
  flex: none; background: transparent; border: 0; padding: 4px 6px;
  color: var(--text-3); font: 500 13px/1.45 var(--font);
  border-radius: var(--r-2); cursor: pointer; max-width: 42vw;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.crumbs button:last-child { color: var(--text-1); }
.crumbs .sl { color: var(--text-4); flex: none; font-size: 12px; }

/* 首屏一行提示，滚过即收 */
.hint {
  flex: none; height: 28px; display: flex; align-items: center; padding: 0 14px;
  background: var(--surface-1); color: var(--text-3);
  font: 700 10px/1.2 var(--font); letter-spacing: .3px;
  overflow: hidden;
}
.hint.gone { height: 0; opacity: 0; transition: height 160ms ease-out, opacity 120ms ease-out; }

/* 网格：满宽 3 列 gap 3，620px 以上 5 列 */
.scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; }
@media (min-width: 620px) { .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.grid > * { min-width: 0; }
/* 网格不做左右留白（更密），但底部要给 FAB / 选中条留出位置 */
.pad { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

.hand .empty { padding: 60px 24px; }

/* FAB：琥珀，右下，落拇指区 */
.fab {
  position: fixed; right: 14px; bottom: calc(96px + env(safe-area-inset-bottom));
  z-index: 40; height: 52px; min-width: 52px; padding: 0 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  border: 0; border-radius: var(--r-pill);
  background: var(--accent); color: var(--accent-ink);
  font: 600 15px/1 var(--font);
  cursor: pointer; transition: background 150ms ease-out, opacity 150ms ease-out;
}
.fab:active { background: #E8951C; }
.fab.hide { display: none; }
.fab .n { font: 700 12px/1 var(--mono); }
.fab .todo::before { background: var(--accent); }
/* 有没传上的：事后仍可见的唯一待办提示（宽胶囊 + 红点 + 文字，不做裸点） */
.fab.pending {
  background: var(--surface-2); color: var(--text-1);
  border: 1px solid var(--line); font-size: 13px;
}
.fab.pending:active { background: var(--surface-3); }

/* 选中底栏 */
.selbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  height: calc(72px + env(safe-area-inset-bottom));
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-1); border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
  transform: translateY(110%); transition: transform 200ms cubic-bezier(.2, .8, .2, 1);
}
.selbar.on { transform: none; }
.selbar .btn { --h: 44px; }

/* 预览层 */
.veil {
  position: fixed; inset: 0; z-index: 60;
  display: none; flex-direction: column;
  background: rgba(8, 7, 6, .95);
}
.veil.on { display: flex; }
.veil .vhead {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 10px) 14px 10px;
}
.veil .vstage {
  flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 8px;
}
.veil .vstage img, .veil .vstage video { max-width: 100%; max-height: 100%; object-fit: contain; }
.veil .vfoot {
  flex: none; display: flex; gap: 10px;
  padding: 12px 14px calc(16px + env(safe-area-inset-bottom));
}
.veil .vfoot .btn { flex: 1; --h: 48px; border-radius: 11px; }
.veil .vfoot .btn.ghost { flex: 0 0 auto; padding: 0 18px; }
.veil .verr { padding: 0 20px 12px; }

/* 上传 sheet（永不全屏：76vh / 完成态 88vh） */
.sheetwrap {
  position: fixed; inset: 0; z-index: 70; display: none;
  background: rgba(8, 7, 6, .55);
}
.sheetwrap.on { display: block; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 76vh; max-height: 76vh;
  display: flex; flex-direction: column;
  background: var(--surface-1); border-radius: var(--r-5) var(--r-5) 0 0;
  border-top: 1px solid var(--line);
  box-shadow: var(--pop);
  padding-bottom: env(safe-area-inset-bottom);
  animation: sheetin 200ms cubic-bezier(.2, .8, .2, 1);
}
.sheet.tall { height: 88vh; max-height: 88vh; }
@keyframes sheetin { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

.sheet .grab {
  flex: none; height: 18px; display: grid; place-items: center;
  touch-action: none;
}
.sheet .grab::before {
  content: ""; width: 36px; height: 4px; border-radius: var(--r-pill); background: var(--surface-3);
}
.sheet .shead {
  flex: none; padding: 2px 16px 10px;
  display: flex; align-items: baseline; gap: 8px;
}
/* 打开时焦点进标题（读屏念出来），但标题不是控件，不画焦点框 */
.sheet .shead > :focus, .sheet .shead > :focus-visible { outline: none; }
.sheet .sbody {
  flex: 1; min-height: 0; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 14px;
}
.sheet .sfoot {
  flex: none; padding: 10px 14px 12px;
  border-top: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 8px;
}

/* 上传项 */
.up { padding: 8px 0 10px; border-bottom: 1px solid var(--line-soft); }
.up:last-child { border-bottom: 0; }
.up.fail { border-left: 3px solid var(--err); padding-left: 10px; margin-left: -13px; }
.up .uphead {
  display: flex; align-items: center; gap: 6px; height: 24px; margin-bottom: 4px;
}
.up .uphead .st { margin-left: auto; color: var(--text-3); }
.up .filerow {
  display: flex; align-items: center; gap: 10px; padding: 6px 0;
}
.up .filerow.nested { padding-left: 12px; margin-left: 6px; border-left: 1px solid var(--line-soft); }
.up .thumb {
  position: relative; width: 40px; height: 40px; flex: none;
  border-radius: 4px; overflow: hidden; background: var(--surface-2);
  display: grid; place-items: center; color: var(--text-4);
}
.up .thumb img { width: 100%; height: 100%; object-fit: cover; }
.up .thumb .ext {
  position: absolute; left: 2px; bottom: 2px;
  padding: 0 2px; border-radius: 2px;
  background: rgba(0, 0, 0, .6); color: #fff;
  font: 700 10px/1.2 var(--font); letter-spacing: .3px;
}
.up .meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.up .meta .fn { font: 500 13px/1.35 var(--font); color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up .st { flex: none; min-width: 44px; text-align: right; color: var(--text-3); }
.up .st.ok  { color: var(--ok); }
.up .st.err { color: var(--err); }
.up .st.warn{ color: var(--warn); }

/* 完成态汇总 */
.done { padding: 12px 0 0; }
.done .sum { color: var(--text-2); font: 500 13px/1.45 var(--font); }

/* ---------------------------------------------------------------- 7 实况工作台 */
.livepage { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.livepage .top {
  position: sticky; top: 0; z-index: 20; flex: none;
  min-height: 64px; padding: 12px 40px;
  display: flex; align-items: center; gap: 14px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.livepage .wrap { flex: 1; padding: 24px 40px 60px; }

.lgrid { display: grid; gap: 8px; grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1279px) { .lgrid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 860px)  { .lgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 520px)  { .lgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; } }

.lcard {
  position: relative; padding: 0; border: 1px solid var(--line);
  background: var(--surface-1); border-radius: var(--r-3);
  overflow: hidden; cursor: pointer; text-align: left;
  transition: border-color 150ms ease-out;
}
.lcard .shot { position: relative; aspect-ratio: 1 / 1; background: var(--surface-2); }
.lcard .shot img { width: 100%; height: 100%; object-fit: cover; transition: opacity 150ms ease-out; }
.lcard .foot {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 8px 9px; min-height: 34px;
}
.lcard.done .shot img { opacity: .55; }
.lcard.done .dot-live { display: none; }
.lcard.bad { border-left: 3px solid var(--err); }
.lcard:active { border-color: var(--text-4); }

/* 卡右上：待办红点（未导出）/ 绿勾（已导出） */
.lcard .dot-live {
  position: absolute; right: 5px; top: 5px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  pointer-events: none;
}
.lcard .st-txt { color: var(--text-3); }

/* 播放层 */
.lover {
  position: fixed; inset: 0; z-index: 80;
  display: none; flex-direction: column;
  background: rgba(8, 7, 6, .96);
}
.lover.on { display: flex; }
.lover .lhead { flex: none; display: flex; align-items: center; gap: 10px; padding: 18px 24px 8px; }
.lover .lbody { flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 24px; }
.lover .lbody video, .lover .lbody img { max-width: min(1100px, 100%); max-height: 100%; border-radius: var(--r-2); }
.lover .lfoot { flex: none; display: flex; align-items: center; gap: 12px; padding: 16px 24px 24px; }
.lover .lfoot .btn { --h: 44px; }
.lover .nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: var(--r-pill);
  display: grid; place-items: center;
  background: rgba(0, 0, 0, .5); border: 1px solid var(--line); color: var(--text-1);
  cursor: pointer;
}
.lover .nav.prev { left: 16px; }
.lover .nav.next { right: 16px; }
.lover .nav[disabled] { opacity: .3; cursor: default; }

/* 落单折叠区 */
details.pairbox { margin-top: 28px; border-top: 1px solid var(--line-soft); padding-top: 16px; }
details.pairbox > summary {
  cursor: pointer; list-style: none; color: var(--text-2); font: 600 13px/1.45 var(--font);
  display: flex; align-items: center; gap: 8px;
}
details.pairbox > summary::-webkit-details-marker { display: none; }
details.pairbox > summary::before { content: "+"; color: var(--text-3); font: 600 15px/1 var(--mono); }
details.pairbox[open] > summary::before { content: "−"; }
.pickrow { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
.picklist { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.picklist .tile { border-radius: var(--r-1); }
.picklist .tile.on { box-shadow: inset 0 0 0 2px var(--accent); }

/* ---------------------------------------------------------------- 8 浮层 / 杂项 */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px); z-index: 90;
  padding: 10px 16px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text-1); font: 500 13px/1.4 var(--font);
  opacity: 0; pointer-events: none;
  transition: opacity 150ms ease-out, transform 150ms ease-out;
  max-width: 80vw;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.console .toast { bottom: 84px; left: 40px; transform: none; }
.console .toast.on { transform: none; }

.byebye {
  display: grid; place-items: center; height: 100vh; text-align: center;
  color: var(--text-2); font: 400 15px/2 var(--font);
}
.byebye b { display: block; color: var(--text-1); font: 600 20px/1.4 var(--font); margin-bottom: 6px; }

/* ---------------------------------------------------------------- 9 无障碍 / 降级 */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .dot.breath { opacity: .85; }
  .prog > i { transition: width 180ms linear !important; }
  .prog.indet > i { margin-left: 0; width: 40%; }
}
