:root {
    --bg:#0c0c0d; --panel:#161618; --panel2:#222226; --line:rgba(255,255,255,.09);
    --fg:#f4f4f2; --mute:#a1a1a6; --dim:#7c7c82; --acc:#d8ff3d; --err:#ff8a7a;
  }
  * { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
  html,body { margin:0; background:var(--bg); color:var(--fg);
    font:16px/1.5 -apple-system,BlinkMacSystemFont,"PingFang SC","Helvetica Neue","Microsoft YaHei",sans-serif;
    -webkit-font-smoothing:antialiased; }
  main { max-width:480px; margin:0 auto; min-height:100dvh; display:flex; flex-direction:column;
    padding:calc(10px + env(safe-area-inset-top)) 16px calc(28px + env(safe-area-inset-bottom)); }

  /* 顶栏：名字 + 四步进度 */
  header { display:flex; align-items:center; justify-content:space-between; height:48px; margin-bottom:14px; }
  .brand { font-weight:700; font-size:17px; letter-spacing:.02em; }
  .brand::before { content:""; display:inline-block; width:8px; height:8px; border-radius:50%; background:var(--acc); margin-right:8px; vertical-align:2px; }
  .steps { display:flex; gap:5px; }
  .steps i { width:16px; height:4px; border-radius:2px; background:var(--panel2); transition:background .3s, width .3s; }
  body[data-n="1"] .steps i:nth-child(-n+1), body[data-n="2"] .steps i:nth-child(-n+2),
  body[data-n="3"] .steps i:nth-child(-n+3), body[data-n="4"] .steps i:nth-child(-n+4) { background:var(--dim); }
  body[data-n="1"] .steps i:nth-child(1), body[data-n="2"] .steps i:nth-child(2),
  body[data-n="3"] .steps i:nth-child(3), body[data-n="4"] .steps i:nth-child(4) { background:var(--fg); width:26px; }

  body[data-n="1"] .steps { visibility:hidden; }
  .step { display:none; flex:1; flex-direction:column; }
  .step.on { display:flex; animation:in .32s ease both; }
  @keyframes in { from { opacity:0; transform:translateY(6px); } }
  @media (prefers-reduced-motion:reduce) { .step.on { animation:none; } }

  h1.hero { font-size:34px; line-height:1.18; font-weight:700; letter-spacing:-.01em; margin:18px 0 12px; }
  h1.hero em { font-style:normal; color:var(--acc); }
  .lead { color:var(--mute); font-size:15px; margin:0 0 26px; text-wrap:pretty; }
  .title { font-size:22px; font-weight:700; margin:4px 0 4px; }
  .hint { font-size:14px; color:var(--mute); margin:0 0 14px; min-height:21px; }

  /* 选视频 */
  .drop { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:4px;
    flex:1; min-height:200px; max-height:300px; border-radius:20px; background:var(--panel); border:1px solid var(--line); cursor:pointer;
    transition:background .2s, transform .15s; }
  .drop:active { transform:scale(.985); background:var(--panel2); }
  .drop .plus { width:56px; height:56px; border-radius:50%; background:var(--acc); position:relative; margin-bottom:12px; }
  .drop .plus::before, .drop .plus::after { content:""; position:absolute; left:50%; top:50%; background:var(--bg); border-radius:2px; transform:translate(-50%,-50%); }
  .drop .plus::before { width:22px; height:3px; } .drop .plus::after { width:3px; height:22px; }
  .drop b { font-size:17px; font-weight:600; }
  .drop small { color:var(--mute); font-size:13px; }
  .flow { display:flex; justify-content:space-between; margin:22px 4px 0; padding:0; list-style:none; font-size:13px; color:var(--mute); }
  .flow li { display:flex; align-items:center; gap:6px; }
  .flow b { display:inline-grid; place-items:center; width:20px; height:20px; border-radius:50%; background:var(--panel2); color:var(--fg); font-size:11px; font-weight:600; }

  /* 点选自己 */
  .stageWrap { display:flex; justify-content:center; background:#000; border-radius:16px; overflow:hidden; }
  .stage { position:relative; line-height:0; }
  .stage canvas { display:block; max-width:100%; max-height:60vh; width:auto; height:auto; }
  .box { position:absolute; border:1.5px solid rgba(255,255,255,.6); border-radius:10px; cursor:pointer; z-index:1; }
  .box.me { border:2.5px solid var(--acc); z-index:2; box-shadow:0 0 0 9999px rgba(0,0,0,.38); }
  .box span { position:absolute; left:50%; top:0; transform:translate(-50%,-115%); white-space:nowrap; line-height:1.5;
    font-size:12px; padding:2px 9px; border-radius:99px; background:rgba(20,20,22,.8); color:#fff; backdrop-filter:blur(6px); }
  .box.me span { background:var(--acc); color:#111; font-weight:700; }

  /* 滑块 */
  input[type=range] { -webkit-appearance:none; appearance:none; width:100%; height:32px; margin:0; background:transparent; cursor:pointer; }
  input[type=range]::-webkit-slider-runnable-track { height:4px; border-radius:2px; background:#3a3a40; }
  input[type=range]::-moz-range-track { height:4px; border-radius:2px; background:#3a3a40; }
  input[type=range]::-webkit-slider-thumb { -webkit-appearance:none; width:22px; height:22px; margin-top:-9px; border-radius:50%; background:var(--fg); box-shadow:0 1px 6px rgba(0,0,0,.5); }
  input[type=range]::-moz-range-thumb { width:22px; height:22px; border:0; border-radius:50%; background:var(--fg); }
  input[type=range]:focus-visible { outline:2px solid var(--acc); outline-offset:2px; border-radius:6px; }
  .scrub { margin-top:14px; }
  .time { display:flex; justify-content:space-between; font-size:12px; color:var(--mute); font-variant-numeric:tabular-nums; }

  /* 按钮 */
  .actions { margin-top:auto; padding-top:22px; display:flex; flex-direction:column; gap:10px; }
  #s2 .actions { margin-top:0; }
  #s2 .scrub { margin-bottom:auto; }
  #s4 .actions { position:sticky; bottom:0; margin:0 -16px; padding:28px 16px calc(14px + env(safe-area-inset-bottom)); background:linear-gradient(to top, var(--bg) 62%, rgba(12,12,13,0)); z-index:5; }
  #s4 .panel { margin-bottom:4px; }
  #s4 .actions .ghost { display:none; }
  .back { align-self:flex-start; border:0; background:transparent; color:var(--mute); font:inherit; font-size:14px; padding:6px 0; min-height:44px; cursor:pointer; }
  .btn { display:block; width:100%; min-height:54px; padding:14px; border:0; border-radius:16px; background:var(--acc); color:#111;
    font:inherit; font-size:17px; font-weight:700; cursor:pointer; transition:transform .12s, opacity .2s; }
  .btn:active:not(:disabled) { transform:scale(.985); }
  .btn:disabled { opacity:.25; cursor:default; }
  .btn.ghost { background:transparent; color:var(--fg); border:1px solid rgba(255,255,255,.16); font-weight:500; min-height:50px; }
  .btn:focus-visible, .seg button:focus-visible, .drop:focus-within { outline:2px solid var(--acc); outline-offset:2px; }

  /* 处理中 */
  .busy { margin:auto 0; text-align:center; padding-bottom:6vh; }
  .busy .title { font-size:17px; font-weight:600; color:var(--mute); }
  .big { font-size:64px; font-weight:700; letter-spacing:-.02em; font-variant-numeric:tabular-nums; line-height:1.1; margin:10px 0 18px; }
  .bar { height:6px; background:var(--panel2); border-radius:99px; overflow:hidden; }
  .bar i { display:block; height:100%; width:0; background:var(--acc); transition:width .25s; }
  .stat { display:flex; justify-content:space-between; font-size:13px; color:var(--mute); margin-top:10px; font-variant-numeric:tabular-nums; }
  .busy .hint { margin-top:22px; }

  /* 调镜头 */
  .preview { display:flex; justify-content:center; }
  .preview canvas { display:block; max-width:100%; max-height:44vh; border-radius:16px; background:#000; cursor:pointer; }
  .play { display:flex; align-items:center; gap:12px; margin:10px 0 2px; }
  .play button { flex:none; width:44px; height:44px; border-radius:50%; border:0; background:var(--panel2); color:var(--fg); font-size:14px; cursor:pointer; }
  .play input { flex:1; }
  .panel { background:var(--panel); border-radius:18px; padding:4px 16px; margin-top:6px; }
  .field { padding:14px 0; border-bottom:1px solid var(--line); }
  .field:last-child { border-bottom:0; }
  .label { display:flex; justify-content:space-between; align-items:baseline; font-size:15px; font-weight:600; margin:0 0 10px; }
  .label output, .label .v { font-size:13px; font-weight:500; color:var(--mute); }
  .seg { display:flex; background:var(--bg); border-radius:12px; padding:3px; gap:3px; }
  .seg button { flex:1; border:0; background:transparent; min-height:40px; border-radius:9px; font:inherit; font-size:14px; color:var(--mute); cursor:pointer; }
  .seg button.on { background:var(--panel2); color:var(--fg); font-weight:600; }
  .ends { display:flex; justify-content:space-between; font-size:12px; color:var(--mute); margin-top:2px; }
  .switch { display:flex; align-items:center; justify-content:space-between; gap:14px; cursor:pointer; }
  .switch b { display:block; font-size:15px; font-weight:600; }
  .switch small { display:block; color:var(--mute); font-size:13px; }
  .switch input { -webkit-appearance:none; appearance:none; flex:none; width:50px; height:30px; border-radius:99px; background:#3a3a40;
    position:relative; cursor:pointer; transition:background .2s; margin:0; }
  .switch input::before { content:""; position:absolute; left:3px; top:3px; width:24px; height:24px; border-radius:50%; background:#fff; transition:transform .2s; }
  .switch input:checked { background:var(--acc); }
  .switch input:checked::before { transform:translateX(20px); background:#111; }
  .switch input:disabled { opacity:.35; }
  .switch input:focus-visible { outline:2px solid var(--acc); outline-offset:2px; }
  .note { font-size:12px; color:var(--mute); margin:8px 0 0; }
  .note:empty { display:none; }

  /* 完成 */
  video.result { display:block; margin:0 auto; max-width:100%; max-height:60vh; border-radius:16px; background:#000; }

  .wx { display:none; background:#2a2412; border:1px solid #4a3f1c; color:#f1d98a; border-radius:14px; padding:10px 12px; font-size:13px; margin-bottom:14px; }
  .err { color:var(--err); font-size:14px; margin:12px 0 0; white-space:pre-wrap; }
  .err:empty { display:none; }
  .foot { color:var(--mute); font-size:12px; margin-top:26px; text-align:center; }

  a.brand { color:var(--fg); text-decoration:none; }
  .crumb { font-size:14px; color:var(--mute); }
  body[data-n="0"] .steps { display:none; }

  /* 底部固定按钮不挡住上面的卡片 */
  .step.on > .panel:last-of-type { margin-bottom:12px; }
  main { padding-bottom:calc(120px + env(safe-area-inset-bottom)); }

  /* 横屏时屏幕矮，全屏底栏收窄一点，留更多高度给视频 */
  @media (orientation:landscape) and (max-height:500px) {
    .fsbar { padding-top:6px; padding-bottom:calc(6px + env(safe-area-inset-bottom)); }
    .fsbar .round { width:40px; height:40px; font-size:16px; }
    .fsbar .chip { min-height:38px; }
    .player.fs, .duo.fs { padding-bottom:calc(54px + env(safe-area-inset-bottom)) !important; }
    .player.fs .count { bottom:calc(54px + env(safe-area-inset-bottom)); }
  }

  /* ============ 电脑网页版（宽屏） ============
     原则：画面占大头，操作收在右侧一栏；文字只留必要的。 */
  .tabs { display:none; }
  .step > .m, .step > .side { display:contents; }
  .drop.over { border-color:var(--acc); background:var(--panel2); }
  @media (min-width:1000px) {
    main { max-width:1240px; padding:0 40px 40px; }
    header { height:64px; margin-bottom:28px; border-bottom:1px solid var(--line); gap:24px; }
    header .crumb, header .steps { display:none; }
    .tabs { display:flex; gap:4px; margin-left:auto; }
    .tabs a { color:var(--mute); text-decoration:none; font-size:14px; padding:8px 14px; border-radius:10px; }
    .tabs a:hover { color:var(--fg); background:var(--panel); }
    .tabs a[aria-current] { color:var(--fg); background:var(--panel2); }
    .foot { margin-top:40px; }

    /* 左右分栏 */
    .step[data-split].on { display:grid; grid-template-columns:minmax(0,1fr) 340px; gap:32px; align-items:start; }
    .step[data-split] > .m, .step[data-split] > .side { display:flex; flex-direction:column; min-width:0; }
    .step[data-split] > .side { position:sticky; top:24px; }
    .side .actions, #s4 .side .actions { position:static; margin:0; padding:22px 0 0; background:none; }
    #s4 .actions .ghost { display:block; }
    .side .title { margin-top:0; }

    /* 画面放大 */
    .stage canvas { max-height:72vh; }
    .preview canvas { max-height:74vh; }
    video.result { max-height:74vh; }
    .player video { max-height:74vh; }
    .busy { max-width:520px; margin:8vh auto 0; }

    /* 选视频：一块大拖放区 */
    #s1 .drop, .step > .drop { min-height:360px; max-height:none; flex:none; }
    h1.hero { font-size:44px; margin:12px 0 10px; }
    h1.hero br { display:none; }
    .lead { font-size:16px; margin-bottom:28px; }

    /* 首页：四个工具横排 */
    .tools { display:grid !important; grid-template-columns:repeat(4,1fr); gap:14px !important; }
    .tool { min-height:200px; align-content:space-between; }

    /* 悬停反馈 */
    .btn:hover:not(:disabled) { filter:brightness(1.06); }
    .btn.ghost:hover { background:var(--panel); }
    .drop:hover { background:var(--panel2); }
    .chip:hover, .seg button:hover { color:var(--fg); }
    .box:hover { border-color:#fff; }
  }

  @media (min-width:1000px) {
    html { scrollbar-gutter:stable; }
    /* 页面内容整体在屏幕中间偏上，不要全挤在顶上、下面一大片空 */
    main { min-height:100vh; }
    .step:not([data-split]).on { justify-content:flex-start; }
    #s1.step.on { min-height:calc(100vh - 200px); justify-content:center; }
    h1.hero { margin:0 0 28px; }
    /* 首页：2×2 大卡片，垂直居中 */
    .home { flex:1; display:flex; flex-direction:column; justify-content:center; padding-bottom:6vh; }
    .tools { grid-template-columns:repeat(2,1fr) !important; }
    .tool { min-height:170px; grid-template-columns:1fr; align-content:end; padding:28px !important; }
    .tool i { grid-row:1 !important; grid-column:1 !important; justify-self:end; align-self:start; opacity:0; transition:opacity .2s; }
    .tool:hover i { opacity:1; }
    .tool b { font-size:22px; }
    .tool span { font-size:15px; }
    .tool.main { background:var(--panel); border-color:var(--line); color:var(--fg); }
    .tool.main span { color:var(--mute); }
    .tool.main i { background:var(--panel2); color:var(--fg); }
    .tool:hover { border-color:rgba(255,255,255,.28); }
    /* 工具页：大拖放区占满中间 */
    #s1 .drop, #s1 .pickrow .slot { min-height:420px; }
    /* 右栏首行和画面顶对齐 */
    .step[data-split] > .side > :first-child { margin-top:0; }
    /* 播放条和画面一样宽 */
    .preview { flex-direction:column; align-items:center; }
    .foot { margin-top:auto; padding-top:32px; }
  }

  @media (min-width:1000px) {
    /* 所有工具页标题统一：同样大小、同样位置 */
    h1.hero, h1.hero[style] { font-size:36px !important; margin:8vh 0 28px !important; }
    .home h1.hero { margin-top:0 !important; }
    #s1.step.on { min-height:0; justify-content:flex-start; }
    /* 首页卡片：标题和说明叠在左下，一处看完 */
    .tool { display:flex !important; flex-direction:column; justify-content:flex-end; gap:6px; position:relative; }
    .tool i { position:absolute; right:22px; top:22px; }
    .tool.main { background:var(--panel); }
    .tools { gap:12px !important; }
    /* 换原声的两个格子：和别的页一样的「+」样式 */
    .pickrow { gap:12px !important; }
    .slot { align-items:center; text-align:center; }
    .slot::before { content:""; width:48px; height:48px; border-radius:50%; background:var(--panel2); margin-bottom:10px;
      background-image:linear-gradient(var(--fg),var(--fg)),linear-gradient(var(--fg),var(--fg));
      background-size:18px 2px,2px 18px; background-position:center; background-repeat:no-repeat; }
    .slot.ok::before { background-color:var(--acc); background-image:linear-gradient(#111,#111),linear-gradient(#111,#111); }
    .slot b { margin-top:0; }
    .slot .n { top:16px; left:18px; }
    #s1 .actions { margin-top:0; padding-top:20px; }
    /* 次要文字稍微亮一点 */
    :root { --mute:#b0b0b5; }
    .foot { position:fixed; left:0; right:0; bottom:16px; margin:0; padding:0; pointer-events:none; }
    main { padding-bottom:64px; }
  }

  @media (min-width:1000px) {
    .slot::before { background-color:var(--acc); background-image:linear-gradient(#111,#111),linear-gradient(#111,#111); }
    .slot .n { display:none; }
    .slot { min-height:300px !important; }
    #s1 .note, .alt { text-align:center; }
    .btn:disabled { background:var(--panel2) !important; color:var(--mute) !important; }
    .tabs a[aria-current] { color:#111; background:var(--acc); }
    .tool span, .drop small, .slot small, .hint, .note { font-size:14px; }
  }

  @media (min-width:1000px) {
    /* 竖屏视频别塞进宽黑框：画面框跟着视频比例走，限制高度 */
    .player { width:fit-content; max-width:100%; margin:0 auto; }
    .player video, video.result, #pv { height:min(72vh, 760px); width:auto; max-width:100%; display:block; }
    .step[data-split] > .m { align-items:stretch; }
    .step[data-split] > .m > .tl, .step[data-split] > .m > .time { width:100%; }
    .legend span { font-size:13px; }
    /* 右栏竖向居中于画面旁，不再顶着上面一截空 */
    .step[data-split].on { align-items:center; min-height:calc(100vh - 180px); }
  }

  @media (min-width:1000px) {
    /* 画面列只占视频需要的宽度，和右栏贴在一起居中 */
    .step[data-split].on { grid-template-columns:auto 340px; justify-content:center; gap:40px; }
    .step[data-split] > .m { max-width:820px; }
    .step[data-split] > .m > .tl, .step[data-split] > .m > .time { width:auto; }
    .player video, video.result, #pv { height:min(70vh, 740px); }
  }


/* AI 消除任务列表（首页） */
.jobs{margin-top:22px}
.jobs .job{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 0;border-top:1px solid var(--line,#2a2a2a)}
.jobs .job .n{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.jobs .job .s{flex:none;opacity:.75;font-size:14px}
.btn.small{padding:8px 16px;min-height:0;font-size:14px;width:auto}

/* 跟错人了：轻量文字按钮，不抢导出的风头 */
.linkBtn{flex:none;background:none;border:0;padding:10px 0 10px 12px;min-height:44px;color:var(--mute);font:inherit;font-size:14px;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.linkBtn:active{color:var(--fg)}

/* 挡脸：emoji 按钮字号大一点；大小三档用小一号 */
#face button { font-size:18px; }
#face button[data-v="none"], #face button[data-v="blur"] { font-size:14px; }
.seg.small button { min-height:34px; font-size:13px; }

/* 识别结果 + 跟错人了 同一行 */
.foundRow{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 6px;min-height:44px}
.foundRow .hint{margin:0;min-height:0}
/* 分组小标题 */
.group{font-size:12px;letter-spacing:.08em;color:var(--dim);margin:14px 2px 6px}
.panel + .panel{margin-top:12px}
/* 挡多大：小标签 + 三档 */
.subRow{display:flex;align-items:center;gap:10px;margin-top:8px}
.subLabel{flex:none;font-size:13px;color:var(--mute)}
.subRow .seg{flex:1}

/* 保存结果提示 */
#saveNote{position:fixed;left:50%;top:calc(16px + env(safe-area-inset-top));transform:translate(-50%,-20px);z-index:60;
  max-width:calc(100vw - 32px);padding:12px 16px;border-radius:14px;background:var(--acc,#e8ff3a);color:#111;font-size:15px;font-weight:600;
  line-height:1.4;text-align:center;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s}
#saveNote.on{opacity:1;transform:translate(-50%,0)}
#saveNote{width:max-content}
#saveNote.bad{background:#2a2a2e;color:#fff}

/* 微调四个按钮：文字不折行 */
.nudge button{white-space:nowrap;font-size:14px;padding-left:4px;padding-right:4px}
