/* build: oom-v12b */
:root {
  color-scheme: light dark;
  --bg: #eef1f7;
  --bg-glow:
    radial-gradient(900px 420px at 12% -8%, rgba(99, 122, 255, .16), transparent 55%),
    radial-gradient(700px 380px at 92% 8%, rgba(168, 120, 255, .12), transparent 50%),
    radial-gradient(600px 300px at 50% 100%, rgba(80, 140, 255, .06), transparent 60%);
  --card: rgba(255, 255, 255, .82);
  --card-solid: #ffffff;
  --text: #121826;
  --muted: #667085;
  --line: rgba(16, 24, 40, .08);
  --field: #f5f7fb;
  --primary: #5b6cff;
  --primary-hover: #4556f0;
  --on-primary: #ffffff;
  --primary-soft: #ecefff;
  --ok: #0f9a61;
  --ok-soft: #e4f8ee;
  --warn: #9a6700;
  --warn-soft: #fff5dc;
  --danger: #c0352b;
  --danger-soft: #fdecea;
  --stage: #e6eaf3;
  --handle-a: #6a7cff;
  --handle-b: #b16dff;
  --handle-c: #56c2ff;
  --glass: rgba(255, 255, 255, .55);
  --glass-border: rgba(255, 255, 255, .65);
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 14px 36px rgba(16, 24, 40, .07);
  --shadow-soft: 0 1px 2px rgba(16, 24, 40, .03), 0 6px 18px rgba(16, 24, 40, .05);
  --radius: 22px;
  --focus: #4556f0;
  --ease: cubic-bezier(.22, .8, .28, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #090c14;
    --bg-glow:
      radial-gradient(900px 420px at 10% -10%, rgba(90, 120, 255, .22), transparent 55%),
      radial-gradient(700px 380px at 95% 0%, rgba(160, 100, 255, .16), transparent 50%),
      radial-gradient(600px 280px at 40% 100%, rgba(60, 100, 220, .1), transparent 60%);
    --card: rgba(22, 28, 40, .78);
    --card-solid: #161c28;
    --text: #e9eef7;
    --muted: #9aa6b8;
    --line: rgba(255, 255, 255, .08);
    --field: #1a2230;
    --primary: #8ea2ff;
    --primary-hover: #a8b8ff;
    --on-primary: #0b1224;
    --primary-soft: #1d2744;
    --ok: #6ed9a0;
    --ok-soft: #143024;
    --warn: #f0c56d;
    --warn-soft: #352a12;
    --danger: #ff9a90;
    --danger-soft: #3b1d1b;
    --stage: #080b12;
    --handle-a: #9eb0ff;
    --handle-b: #d4a0ff;
    --handle-c: #7ad7ff;
    --glass: rgba(18, 24, 38, .55);
    --glass-border: rgba(255, 255, 255, .1);
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 16px 40px rgba(0, 0, 0, .32);
    --shadow-soft: 0 1px 2px rgba(0, 0, 0, .25), 0 8px 20px rgba(0, 0, 0, .22);
    --focus: #b7c8ff;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image: var(--bg-glow);
  background-attachment: fixed;
  color: var(--text);
  font: 16px/1.6 "PingFang SC", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  -webkit-font-smoothing: antialiased;
  letter-spacing: .01em;
}

/* 全屏流星层：在内容背后，不挡操作 */
.meteor-layer {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

h1, h2, p, fieldset, legend { margin: 0; padding: 0; }
fieldset.plain { border: 0; min-width: 0; }

.sr {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 1120px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}

.muted { color: var(--muted); }

.ico {
  width: 1.25em; height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- 顶部 ---------- */
.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 14px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-icon {
  border-radius: 15px;
  flex: none;
  box-shadow: var(--shadow-soft);
}
h1 {
  font-size: clamp(1.2rem, 3.8vw, 1.45rem);
  line-height: 1.25;
  font-weight: 720;
  letter-spacing: -.02em;
}
.tagline { color: var(--muted); font-size: .875rem; margin-top: 2px; }
.top-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.privacy-chip,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  font-size: .8125rem;
  font-weight: 600;
  white-space: nowrap;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.privacy-chip {
  background: color-mix(in srgb, var(--primary-soft) 80%, transparent);
  color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent);
}
.privacy-chip .ico { width: 1em; height: 1em; }
.pill {
  background: var(--ok-soft);
  color: var(--ok);
}

/* ---------- 品牌署名（玻璃卡片，静态用户名） ---------- */
.brand-hero {
  margin: 0 0 16px;
  border-radius: 24px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--glass) 88%, #7a8cff), var(--glass));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(1.25);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  overflow: hidden;
}
.brand-hero-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 22px 24px;
}
.brand-kicker {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.brand-handle {
  text-decoration: none;
  display: inline-block;
  border-radius: 10px;
  transition: transform .18s var(--ease), filter .18s var(--ease);
}
.brand-handle:hover { transform: translateY(-1px); filter: brightness(1.05); }
.brand-handle:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.brand-handle-text {
  display: inline-block;
  font-size: clamp(1.7rem, 5.5vw, 2.35rem);
  font-weight: 780;
  letter-spacing: -.01em;
  line-height: 1.15;
  background: linear-gradient(120deg, var(--handle-a) 0%, var(--handle-b) 48%, var(--handle-c) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 8px 22px color-mix(in srgb, var(--handle-b) 35%, transparent));
}
@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .brand-handle-text {
    color: var(--primary);
    background: none;
  }
}
.brand-sub {
  color: var(--muted);
  font-size: .875rem;
}

.privacy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 18px;
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: .9375rem;
}
.privacy-text { display: flex; align-items: flex-start; gap: 8px; }
.privacy-text .ico { color: var(--primary); margin-top: .15em; }

.chip { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .875rem; }
.chip .spinner { width: 14px; height: 14px; border-width: 2px; border-color: color-mix(in srgb, var(--primary) 25%, transparent); border-top-color: var(--primary); }
.chip[data-state="ready"] { color: var(--ok); }
.chip[data-state="idle"] .spinner,
.chip[data-state="ready"] .spinner,
.chip:not([data-state="ready"]) .chip-ok,
.chip[data-state="error"] { display: none; }

.banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--card-solid);
  font-size: .9375rem;
}
.banner.error { border-color: transparent; background: var(--danger-soft); color: var(--danger); }
.banner .btn { margin-left: auto; color: var(--text); }

.spinner {
  width: 18px; height: 18px;
  flex: none;
  border-radius: 50%;
  border: 2.5px solid var(--line);
  border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 布局 ---------- */
main { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 18px;
  min-width: 0;
}

@media (min-width: 900px) {
  main { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
  .s1 { grid-column: 1 / -1; }
  main.has-file {
    grid-template-columns: minmax(0, 1fr) 360px;
    grid-template-areas: "s1 s1" "pv s2" "pv s3";
    grid-template-rows: auto auto 1fr;
    align-items: start;
  }
  main.has-file .s1 { grid-area: s1; }
  main.has-file .pv { grid-area: pv; position: sticky; top: 14px; }
  main.has-file .s2 { grid-area: s2; }
  main.has-file .s3 { grid-area: s3; }
  .card { padding: 22px 24px; }

  main.has-file .s1 { display: flex; align-items: center; gap: 12px 28px; }
  main.has-file .s1 h2 { margin-bottom: 0; flex: none; }
  main.has-file .filebar { flex: 1 1 0; min-width: 0; }
}

@media (min-width: 1180px) {
  main.has-file {
    grid-template-columns: minmax(0, 1fr) 330px 310px;
    grid-template-areas: "s1 s1 s1" "pv s2 s3";
    grid-template-rows: auto auto;
  }
  main.has-file .s3 { position: sticky; top: 14px; }
}

.step h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  line-height: 1.3;
  margin-bottom: 14px;
  letter-spacing: -.01em;
}
.num {
  display: inline-grid;
  place-items: center;
  width: 28px; height: 28px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--primary), color-mix(in srgb, var(--handle-b) 70%, var(--primary)));
  color: var(--on-primary);
  font-size: .9rem;
  font-weight: 700;
  box-shadow: 0 6px 14px color-mix(in srgb, var(--primary) 30%, transparent);
}
.small-title { font-size: .95rem; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.empty { color: var(--muted); }

main.has-file .s1 { padding-top: 14px; padding-bottom: 14px; }
main.has-file .s1 h2 { margin-bottom: 10px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 46px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card-solid);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .08s ease, box-shadow .15s var(--ease);
}
.btn:hover { background: var(--field); border-color: color-mix(in srgb, var(--muted) 30%, var(--line)); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(145deg, var(--primary), color-mix(in srgb, var(--handle-b) 55%, var(--primary)));
  border-color: transparent;
  color: var(--on-primary);
  box-shadow: 0 10px 22px color-mix(in srgb, var(--primary) 28%, transparent);
}
.btn.primary:hover { filter: brightness(1.04); }
.btn.big { min-height: 54px; padding: 12px 24px; font-size: 1.0625rem; border-radius: 16px; }
.btn.small { min-height: 38px; padding: 4px 12px; font-size: .875rem; }
.btn.wide { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; filter: none; }
.btn.busy::before {
  content: "";
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2.5px solid currentColor;
  border-top-color: transparent;
  animation: spin .8s linear infinite;
}

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 0 .35em;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  background: var(--field);
  font: inherit;
  font-size: .875em;
  text-align: center;
}

/* ---------- 第一步 ---------- */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 34px 16px 28px;
  border: 1.5px dashed color-mix(in srgb, var(--primary) 32%, var(--line));
  border-radius: 20px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--primary-soft) 70%, transparent), var(--field));
  text-align: center;
  cursor: pointer;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.dropzone:hover {
  border-color: color-mix(in srgb, var(--primary) 50%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 12%, transparent);
}
.dz-ico {
  width: 52px; height: 52px;
  fill: none;
  stroke: var(--primary);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.dz-title { font-size: 1.12rem; font-weight: 680; letter-spacing: -.01em; }
.dz-or { color: var(--muted); font-size: .9rem; }
.dropzone .hint { margin-top: 6px; }

.filebar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.file-ico { width: 28px; height: 28px; color: var(--primary); stroke-width: 1.6; }
.file-text { flex: 1 1 180px; min-width: 0; display: flex; flex-direction: column; line-height: 1.4; }
.file-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-text .muted { font-size: .875rem; }

.hint { color: var(--muted); font-size: .875rem; line-height: 1.55; }

.notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--text);
  font-size: .9375rem;
  line-height: 1.55;
}
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.danger { background: var(--danger-soft); color: var(--danger); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice .btn { margin-left: auto; }
.notice.top { margin: 0 0 14px; }
#saveMsg, #fileName { overflow-wrap: anywhere; }

/* ---------- 预览 ---------- */
.stage {
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--stage);
  overflow: hidden;
  border: 1px solid var(--line);
}
.shot {
  grid-area: 1 / 1;
  display: block;
  max-width: 100%;
  max-height: min(640px, max(260px, 100vh - 360px));
  width: auto;
  height: auto;
}
video.shot { width: 100%; background: #000; }
.orig { z-index: 1; }
.tag {
  position: absolute;
  z-index: 2;
  top: 10px; left: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .65);
  color: #fff;
  font-size: .8125rem;
  font-weight: 600;
}
.stage-msg {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 200px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.pv-tools { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 18px; margin-top: 12px; }
.pv-tools:empty { display: none; }
#compareBtn { user-select: none; -webkit-user-select: none; touch-action: none; }
#compareBtn[aria-pressed="true"] { background: var(--primary-soft); border-color: var(--primary); }
.time-row { flex: 1 1 240px; min-width: 0; }
.time-row label { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }

/* ---------- 第二步 ---------- */
.field { margin-bottom: 16px; }
.field > label, .field > legend {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  width: 100%;
  margin-bottom: 4px;
  font-weight: 600;
}
.field > legend { margin-bottom: 8px; }
output { color: var(--primary); font-variant-numeric: tabular-nums; font-weight: 700; }

input[type="range"] {
  display: block;
  width: 100%;
  height: 40px;
  margin: 0;
  accent-color: var(--primary);
  background: transparent;
  cursor: pointer;
}
input[type="range"]:disabled { cursor: not-allowed; opacity: .5; }

.seg { display: flex; gap: 6px; padding: 4px; border-radius: 14px; background: var(--field); border: 1px solid var(--line); }
.seg label { flex: 1 1 0; min-width: 0; position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg span {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 6px 8px;
  border-radius: 10px;
  text-align: center;
  font-weight: 600;
  line-height: 1.25;
  color: var(--muted);
  transition: background-color .12s, color .12s;
}
.seg label:hover span { color: var(--text); }
.field-title { display: block; font-weight: 600; margin-bottom: 8px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card-solid); color: var(--text);
  font: inherit; font-weight: 600; cursor: pointer;
}
.swatch::before { content: ''; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--muted); }
.swatch[data-color='#000000']::before { background: #000000; }
.swatch[data-color='#ffffff']::before { background: #ffffff; }
.swatch[data-color='#808080']::before { background: #808080; }
.swatch[data-color='#00b140']::before { background: #00b140; }
.swatch[aria-pressed='true'] { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary); }
.swatch:focus-visible, .swatch.pick:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.swatch.pick::before { display: none; }
.swatch.pick input { width: 28px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; }
fieldset:disabled .swatch { opacity: .55; cursor: not-allowed; }
.seg input:checked + span { background: var(--primary); color: var(--on-primary); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.seg input:disabled { cursor: not-allowed; }
.seg input:disabled + span { opacity: .55; }

fieldset:disabled .field > label,
fieldset:disabled .field > legend { opacity: .6; }

.more { margin: 4px 0 16px; border-top: 1px solid var(--line); }
.more summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 4px 0;
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
  list-style: none;
  border-radius: 8px;
}
.more summary::-webkit-details-marker { display: none; }
.more summary::before {
  content: "";
  width: 8px; height: 8px;
  margin: 0 4px 0 2px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform .15s;
}
.more[open] summary::before { transform: rotate(45deg); }
.more .field { margin: 6px 0 4px; }
.more .hint { margin-top: 8px; }

/* ---------- 第三步 ---------- */
.s3 .hint { margin-top: 10px; }
.s3 .field .hint { margin-top: 8px; }
.s3 .btn + .btn { margin-top: 12px; }

progress {
  display: block;
  width: 100%;
  height: 14px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--field);
  accent-color: var(--primary);
  -webkit-appearance: none;
  appearance: none;
}
progress::-webkit-progress-bar { background: var(--field); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--primary); border-radius: 999px; transition: width .25s linear; }
progress::-moz-progress-bar { background: var(--primary); border-radius: 999px; }
.prog-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 8px 0 14px; }
.prog-line strong { font-size: 1.5rem; font-variant-numeric: tabular-nums; }

.done-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.0625rem; color: var(--ok); }
#vInfo { margin: 4px 0 14px; font-size: .9375rem; }

.foot {
  margin-top: 26px;
  color: var(--muted);
  font-size: .8125rem;
  text-align: center;
  line-height: 1.7;
}
.foot-handle {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
}
.foot-handle:hover { text-decoration: underline; }

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 18, 40, .58);
  pointer-events: none;
  backdrop-filter: blur(3px);
}
.drop-box {
  padding: 28px 40px;
  border: 2px dashed #fff;
  border-radius: 20px;
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  background: rgba(255, 255, 255, .06);
}

.dlg {
  width: min(420px, calc(100vw - 32px));
  padding: 22px;
  border: 0;
  border-radius: 18px;
  background: var(--card-solid);
  color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}
.dlg::backdrop { background: rgba(10, 16, 28, .5); }
.dlg p { font-size: 1.0625rem; }
.dlg-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.dlg-actions .btn { flex: 1 1 140px; }

@media (max-width: 640px) {
  .wrap { padding-top: max(12px, env(safe-area-inset-top)); }
  .card { padding: 15px 14px; border-radius: 18px; }
  .brand-hero { border-radius: 20px; margin-bottom: 12px; }
  .brand-hero-inner { padding: 18px 18px; }
  .privacy { padding: 10px 12px; margin-bottom: 12px; font-size: .875rem; }
  .btn.big { width: 100%; min-height: 52px; }
  .filebar .btn { flex: 1 1 100%; }
  .pv-tools > .btn { flex: 1 1 100%; }
  .shot { max-height: 58vh; }
  .top-actions { width: 100%; }
  .seg { flex-wrap: wrap; }
  .seg label { flex: 1 1 calc(50% - 6px); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
  .spinner, .btn.busy::before { animation-duration: 2s; }
  .brand-handle-text { filter: none; }
}


/* ---------- 设备类：JS 加 is-phone / is-desktop ---------- */
html.is-phone .wrap {
  padding-left: max(12px, env(safe-area-inset-left));
  padding-right: max(12px, env(safe-area-inset-right));
  padding-bottom: max(28px, env(safe-area-inset-bottom));
}
html.is-phone h1 { font-size: 1.18rem; }
html.is-phone .tagline { font-size: .8125rem; }
html.is-phone .brand-hero-inner { padding: 16px 16px; gap: 4px; }
html.is-phone .brand-handle-text { font-size: clamp(1.55rem, 8vw, 2rem); }
html.is-phone .brand-sub { font-size: .8125rem; }
html.is-phone .privacy { gap: 6px; }
html.is-phone .chip { width: 100%; }
html.is-phone .btn { min-height: 48px; }
html.is-phone .btn.big { min-height: 54px; font-size: 1.05rem; }
html.is-phone .dropzone { padding: 28px 14px 24px; }
html.is-phone .dz-title { font-size: 1.05rem; }
html.is-phone .card { padding: 14px 13px; border-radius: 18px; }
html.is-phone .step h2 { font-size: 1.05rem; margin-bottom: 12px; }
html.is-phone .seg span { min-height: 46px; font-size: .9rem; }
html.is-phone .foot { margin-top: 20px; padding-bottom: env(safe-area-inset-bottom); }

html.is-desktop .wrap { max-width: 1180px; }
html.is-desktop .brand-hero-inner { padding: 26px 28px; }
html.is-desktop .brand-handle-text { font-size: clamp(1.9rem, 3.2vw, 2.5rem); }
html.is-desktop .card { padding: 22px 24px; }
html.is-desktop .dropzone { padding: 40px 20px 34px; }


/* ---- Auth gate ---- */
.auth-gate {
  display: flex; justify-content: center; align-items: flex-start;
  padding: 28px 16px 48px; min-height: 60vh;
}
.auth-card { width: min(420px, 100%); padding: 28px 22px 24px; }
.auth-brand { text-align: center; margin-bottom: 18px; }
.auth-title { margin: 6px 0 4px; font-size: 1.35rem; font-weight: 700; letter-spacing: .02em; }
.auth-sub { margin: 0; color: var(--muted); font-size: .9rem; }
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 16px;
  background: var(--field); border-radius: 14px; padding: 4px;
}
.auth-tab {
  border: 0; background: transparent; color: var(--muted);
  padding: 10px 8px; border-radius: 11px; font: inherit; cursor: pointer;
}
.auth-tab.active {
  background: var(--card-solid); color: var(--text);
  box-shadow: var(--shadow-soft); font-weight: 600;
}
.auth-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; font-size: .9rem; color: var(--muted); }
.auth-field input {
  font: inherit; color: var(--text); background: var(--field);
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; outline: none;
}
.auth-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent);
}
.auth-msg { margin: 10px 0 0; font-size: .9rem; color: var(--muted); }
.auth-msg.danger { color: var(--danger); }
.auth-msg.ok { color: var(--ok); }
.auth-user-bar { display: inline-flex; align-items: center; gap: 8px; }
.auth-user-label { font-size: .85rem; color: var(--muted); }
.auth-gate .hint a { color: var(--primary); }
html:not(.authed) .brand-hero { display: none; }


/* ---- PWA install banner (very obvious) ---- */
.install-banner {
  margin: 0 0 16px;
  border-radius: 20px;
  padding: 2px;
  background: linear-gradient(135deg, #4f6ef7, #7c5cff 45%, #22c55e);
  box-shadow: 0 12px 36px color-mix(in srgb, #4f6ef7 35%, transparent);
  animation: installPulse 2.4s ease-in-out infinite;
}
@keyframes installPulse {
  0%, 100% { box-shadow: 0 12px 36px color-mix(in srgb, #4f6ef7 30%, transparent); }
  50% { box-shadow: 0 16px 44px color-mix(in srgb, #22c55e 40%, transparent); }
}
.install-banner[hidden] { display: none !important; }
.install-banner-inner {
  display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: center;
  background: var(--card-solid, #fff); border-radius: 18px; padding: 16px 16px 14px;
}
.install-banner-icon { font-size: 2.2rem; line-height: 1; }
.install-banner-copy { flex: 1 1 220px; min-width: 0; }
.install-banner-title {
  margin: 0 0 4px; font-size: 1.15rem; font-weight: 800; letter-spacing: .01em;
  color: var(--text);
}
.install-banner-hint { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.45; }
.install-steps {
  margin: 10px 0 0; padding-left: 1.2em; color: var(--text);
  font-size: .95rem; line-height: 1.55; font-weight: 600;
}
.install-steps li { margin: 4px 0; }
.install-steps em { font-style: normal; color: #4f6ef7; }
.install-banner-actions {
  display: flex; flex-direction: column; gap: 8px; align-items: stretch;
  flex: 0 0 auto; min-width: min(220px, 100%);
}
.install-banner-actions .btn.big { min-height: 52px; font-size: 1.05rem; font-weight: 800; }
.install-dismiss { opacity: .75; }
.install-auth-tip {
  margin: 16px auto 0; width: min(420px, 100%);
  padding: 14px 16px; border-radius: 16px;
  background: color-mix(in srgb, #4f6ef7 12%, var(--card-solid, #fff));
  border: 1px solid color-mix(in srgb, #4f6ef7 35%, transparent);
}
.install-auth-tip-title { margin: 0 0 4px; font-weight: 700; }
.install-auth-tip-body { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.45; }
html.is-phone .install-banner { margin-bottom: 14px; }
html.is-phone .install-banner-inner { padding: 14px 12px; }
html.is-phone .install-banner-title { font-size: 1.08rem; }
html.is-phone .install-banner-actions { width: 100%; }
@media (prefers-reduced-motion: reduce) {
  .install-banner { animation: none; }
}


/* 卡退后恢复原片 */
.restore-banner {
  margin: 12px 16px 0;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--ok-soft), var(--primary-soft));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
}
.restore-banner-inner {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  flex-wrap: wrap;
}
.restore-banner-icon { font-size: 28px; line-height: 1; }
.restore-banner-copy { flex: 1; min-width: 180px; }
.restore-banner-title {
  margin: 0 0 4px;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
.restore-banner-hint {
  margin: 0;
  color: var(--muted);
  font-size: .92rem;
}
.restore-banner-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
