/* ============================================================
   码上 QR · 共享样式 (Apple HIG 风格)
   主强调色: Apple 蓝 #007AFF
   ============================================================ */

/* 字体自托管（原本走 Google Fonts CDN：国内被墙 + 访客 IP 泄露给第三方，
   且与 CSP 的 font-src 'self' 冲突）。Geist 为可变字体，所有字重共用同一份文件。 */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/geist-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/geist-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/geistmono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geist Mono";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/geistmono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --blue: #007AFF;
  --blue-dark: #0066D6;
  --bg: #FFFFFF;
  --gray-bg: #F5F5F7;
  --text: #1D1D1F;
  --text-2: #6E6E73;
  --text-3: #86868B;
  --border: #D2D2D6;
  --border-light: #E8E8ED;
  --radius-card: 20px;
  --radius-pill: 980px;
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-soft: 0 2px 12px rgba(0, 0, 0, 0.05);
  --maxw: 1200px;
  --font: "Geist", -apple-system, BlinkMacSystemFont, "SF Pro Display",
    "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* [hidden] 统一兜底。
   组件类通常自带 display:flex / grid，优先级高于 UA 的 [hidden]{display:none}，
   只加属性不会隐藏。此前为同一个坑分别补过 4 条（页脚三列、结果卡按钮、摄像头面板、
   扫码弹框），现合并为一条，新增组件不必再补。 */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 600;
  padding: 13px 26px;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.08s ease, box-shadow 0.18s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); }
.btn-secondary {
  background: var(--gray-bg);
  color: var(--text);
}
.btn-secondary:hover { background: #ECECEF; }
.btn-ghost { background: transparent; color: var(--blue); padding: 8px 14px; }
.btn-ghost:hover { background: rgba(0, 122, 255, 0.08); }
.btn-sm { font-size: 13px; padding: 9px 16px; }
/* 按钮内联图标：与文字基线对齐 */
.btn-ico { vertical-align: -3px; margin-right: 6px; }
.btn-block { width: 100%; }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-light);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.brand .logo-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--blue);
  display: grid; place-items: center;
  color: #fff; font-size: 16px; font-weight: 800;
}
.nav-links {
  display: flex;
  gap: 34px;
  font-size: 14px;
  color: var(--text-2);
}
.nav-links a:hover { color: var(--text); }
/* 导航右端容器：「开始使用」在左、汉堡按钮在最右（窄屏才出现汉堡） */
.nav-end {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-actions { display: flex; align-items: center; gap: 14px; }

/* 语言切换：页脚底部栏胶囊分段控件（宽窄屏共用 28px 高触控区） */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-pill);
  background: var(--gray-bg);
}
.lang-btn {
  min-height: 28px;
  padding: 4px 11px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.is-active {
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04);
}
.lang-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
/* 页脚是深色底（#1D1D1F），控件改用半透明白，激活态保持可辨对比 */
.site-footer .lang-switch { border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.08); }
.site-footer .lang-btn { color: #A1A1A6; }
.site-footer .lang-btn:hover { color: #fff; }
.site-footer .lang-btn.is-active {
  background: rgba(255,255,255,.16); color: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.site-footer .lang-btn:focus-visible { outline-color: #fff; }
@media (max-width: 560px) {
  .lang-btn { padding: 4px 8px; font-size: 11px; }
}

/* ============================================================
   窄屏导航（Apple 规范）
   —— 宽屏显示完整链接；窄屏折叠为「汉堡按钮 + 全屏抽屉」。
   设计要点（对齐 Apple HIG）：
   1. 汉堡按钮触控区 44×44pt（Apple 最小可点尺寸），图标 24pt 光学对齐；
   2. 抽屉从右侧滑入，与 iOS/macOS 侧边栏一致；
   3. 背景遮罩半透明毛玻璃，点击关闭；
   4. 展开时锁定 body 滚动（iOS Safari 的 position:fixed 方案）；
   5. 菜单项触控高度 ≥ 44pt，字号 17pt（iOS 列表标准）；
   6. 遵循 prefers-reduced-motion，关闭过渡动画；
   7. 无障碍：aria-expanded / aria-hidden / aria-label + Esc 关闭。
   ============================================================ */

/* 汉堡按钮：宽屏隐藏 */
.nav-toggle {
  display: none;
  position: relative;
  z-index: 62; /* 高于抽屉(61)与遮罩(60)：抽屉展开时按钮仍可点击收起 */
  width: 44px;
  height: 44px;
  margin-right: -10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease, opacity 0.2s ease;
}
.nav-toggle:hover { background: rgba(0, 0, 0, 0.05); }
.nav-toggle:active { background: rgba(0, 0, 0, 0.08); }
.nav-toggle:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
/* 三横线 → 叉号：两条横线旋转 + 中间横线淡出 */
.nav-toggle .bars {
  position: relative;
  display: block;
  width: 20px;
  height: 14px;
  margin: 0 auto;
}
.nav-toggle .bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.8px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.32s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.2s ease, width 0.32s cubic-bezier(0.32, 0.72, 0, 1);
}
.nav-toggle .bars span:nth-child(1) { top: 0; }
.nav-toggle .bars span:nth-child(2) { top: 6.1px; }
.nav-toggle .bars span:nth-child(3) { top: 12.2px; }
body.nav-open .nav-toggle .bars span:nth-child(1) { transform: translateY(6.1px) rotate(45deg); }
body.nav-open .nav-toggle .bars span:nth-child(2) { opacity: 0; transform: scaleX(0.4); }
body.nav-open .nav-toggle .bars span:nth-child(3) { transform: translateY(-6.1px) rotate(-45deg); }
/* 抽屉展开后隐藏汉堡按钮，改由抽屉内的关闭按钮收起（与 iOS 侧边栏一致） */
body.nav-open .nav-toggle { opacity: 0; pointer-events: none; }

/* 遮罩 */
.nav-scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: saturate(80%) blur(8px);
  -webkit-backdrop-filter: saturate(80%) blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.32s cubic-bezier(0.32, 0.72, 0, 1), visibility 0.32s;
}
body.nav-open .nav-scrim { opacity: 1; visibility: visible; }

/* 抽屉面板 */
.nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 61;
  width: min(340px, 86vw);
  height: 100dvh;
  padding: calc(env(safe-area-inset-top, 0px) + 20px) 24px calc(env(safe-area-inset-bottom, 0px) + 32px);
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: saturate(180%) blur(30px);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  border-left: 1px solid var(--border-light);
  box-shadow: -8px 0 40px rgba(0, 0, 0, 0.12);
  transform: translateX(100%);
  visibility: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: transform 0.36s cubic-bezier(0.32, 0.72, 0, 1), visibility 0.36s;
}
body.nav-open .nav-drawer { transform: translateX(0); visibility: visible; }

/* 抽屉头部：标题 + 关闭 */
.nav-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}
.nav-drawer-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}
.nav-drawer-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.2s ease, color 0.2s ease;
}
.nav-drawer-close:hover { background: rgba(0, 0, 0, 0.1); color: var(--text); }
.nav-drawer-close:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* 抽屉内导航项：iOS 列表风格 */
.nav-drawer-links { display: flex; flex-direction: column; }
.nav-drawer-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 12px 2px;
  font-size: 17px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
  transition: color 0.15s ease, opacity 0.15s ease;
}
.nav-drawer-links a:last-child { border-bottom: 0; }
.nav-drawer-links a:hover { color: var(--blue); }
.nav-drawer-links a.active { color: var(--blue); font-weight: 600; }
.nav-drawer-links a:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; border-radius: 6px; }
/* 右侧箭头（chevron），Apple 列表惯用 */
.nav-drawer-links a::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 1.8px solid var(--text-3);
  border-bottom: 1.8px solid var(--text-3);
  transform: rotate(-45deg);
  opacity: 0.55;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-drawer-links a:hover::after { transform: rotate(-45deg) translate(1px, 1px); opacity: 0.9; }

/* 抽屉底部主按钮 */
.nav-drawer-foot { margin-top: 26px; }
.nav-drawer-foot .btn { width: 100%; }

/* 展开时锁定页面滚动。
   抽屉与遮罩已移出 header（.site-header 的 backdrop-filter 会创建包含块，
   破坏内部 fixed 定位），故此处锁 body/html 不会影响 fixed 基准。
   用 overflow:hidden 锁 <html>，可同时避免 iOS Safari 的背景滚动穿透。 */
html.nav-locked {
  overflow: hidden;
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  padding: 92px 0 72px;
}
.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
  background: rgba(0, 122, 255, 0.1);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 22px;
}
.hero h1 {
  font-size: 60px;
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.hero .sub {
  font-size: 21px;
  color: var(--text-2);
  max-width: 560px;
  margin: 0 auto 34px;
}
.hero-cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-bottom: 18px;
}

/* 解析入口（保留原红框按钮，标注即将上线） */
.parse-entry {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 10px 16px 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: #fff;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.parse-entry:hover { border-color: var(--blue); box-shadow: var(--shadow-soft); }
.parse-entry .scan-ico {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--gray-bg); display: grid; place-items: center;
  color: var(--blue);
}
.tag-soon {
  font-size: 11px;
  font-weight: 600;
  color: #C2410C;
  background: #FFEDD5;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

/* Hero 中的二维码预览卡 */
.qr-preview-card {
  margin: 56px auto 0;
  width: 280px;
  background: #fff;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.qr-preview-card .qr-box {
  width: 200px; height: 200px;
  background: var(--gray-bg);
  border-radius: 14px;
  display: grid; place-items: center;
  padding: 14px;
}
.qr-preview-card .qr-box canvas,
.qr-preview-card .qr-box img { width: 100%; height: 100%; border-radius: 6px; }
.qr-preview-card .qr-cap { font-size: 13px; color: var(--text-3); }

/* ---------- Section ---------- */
.section { padding: 72px 0; }
.section-head { max-width: 620px; margin-bottom: 44px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head .label {
  font-size: 13px; font-weight: 600; color: var(--blue);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.section-head h2 {
  font-size: 40px; font-weight: 700; letter-spacing: -0.02em;
  margin: 10px 0 12px;
}
.section-head p { font-size: 18px; color: var(--text-2); }

/* ---------- Bento 功能卡片 ---------- */
.bento {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  padding: 28px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  min-height: 180px;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-card); }
.card.large { grid-column: span 1; grid-row: span 2; min-height: 380px; }
.card .icon-square {
  width: 48px; height: 48px; border-radius: 12px;
  background: #EAF3FF; display: grid; place-items: center;
  color: var(--blue); margin-bottom: 18px;
}
.card .icon-square svg { width: 24px; height: 24px; }
.card h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 8px; }
.card p { font-size: 14px; color: var(--text-2); flex: 1; }

/* 大卡内的二维码插画 */
.card.large .qr-illus {
  margin-top: auto;
  background: var(--gray-bg);
  border-radius: 16px;
  padding: 22px;
  display: grid; place-items: center;
  align-self: stretch;
}
.card.large .qr-illus canvas,
.card.large .qr-illus img { width: 180px; height: 180px; }

/* ---------- 生成器布局 ---------- */
.gen-wrap {
  display: grid;
  grid-template-columns: 520px 1fr;
  gap: 28px;
  align-items: start;
  padding: 28px 0 80px;
}
.gen-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  padding: 28px;
  box-shadow: var(--shadow-soft);
}
.page-head { padding: 40px 0 8px; }
.page-head h1 { font-size: 38px; font-weight: 700; letter-spacing: -0.02em; }
.page-head p { font-size: 17px; color: var(--text-2); margin-top: 8px; }

/* 表单 */
.field { margin-bottom: 22px; }
.field > label {
  display: block;
  font-size: 13px; font-weight: 600; color: var(--text);
  margin-bottom: 10px;
}
.segmented {
  display: flex;
  background: var(--gray-bg);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}
.segmented button {
  flex: 1;
  border: none; background: transparent;
  font-family: var(--font); font-size: 14px; font-weight: 500;
  color: var(--text-2);
  padding: 9px 0; border-radius: 9px; cursor: pointer;
  transition: all 0.15s ease;
}
.segmented button.active {
  background: #fff; color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.12); font-weight: 600;
}
.text-input, .select-input {
  width: 100%;
  font-family: var(--font); font-size: 14px; color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.text-input:focus, .select-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(0,122,255,0.12);
}
textarea.text-input { resize: vertical; min-height: 96px; line-height: 1.5; }
/* 紧凑输入框：用于折叠面板内的单行文字（框架上下文字），比主输入框矮 8px */
.text-input--sm { padding: 10px 14px; }

.swatches { display: flex; gap: 10px; align-items: center; }
.swatch {
  width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--border);
  cursor: pointer; transition: box-shadow 0.15s ease;
}
.swatch.active { box-shadow: 0 0 0 2px var(--blue); }

/* 色板颜色：由 data-color / data-bg 声明，此处集中映射。
   原先 14 个色块各写一条内联 background，是 style-src 去掉 unsafe-inline 的主要障碍之一。 */
.swatch[data-color="#1D1D1F"], .swatch[data-bg="#1D1D1F"] { background: #1D1D1F; }
.swatch[data-color="#007AFF"], .swatch[data-bg="#007AFF"] { background: #007AFF; }
.swatch[data-color="#34C759"], .swatch[data-bg="#34C759"] { background: #34C759; }
.swatch[data-color="#FF3B30"], .swatch[data-bg="#FF3B30"] { background: #FF3B30; }
.swatch[data-color="#FFFFFF"], .swatch[data-bg="#FFFFFF"] { background: #FFFFFF; }
.swatch[data-color="#F5F5F7"], .swatch[data-bg="#F5F5F7"] { background: #F5F5F7; }
.swatch[data-color="#FFF3E0"], .swatch[data-bg="#FFF3E0"] { background: #FFF3E0; }

.swatch-custom {
  position: relative;
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px dashed var(--border); background: #fff;
  cursor: pointer; font-size: 10px; color: var(--text-3);
  display: grid; place-items: center;
}
/* 原生取色器铺满整个圆点（含 1px 描边）并透明，点哪里都能唤起取色面板。
   注意 input 是替换元素，只写 inset 会被固有尺寸顶住（实测 50×27），必须显式给宽高。
   原先用内联 opacity/position/size 实现，同样属于 style 内联。 */
.swatch-custom input[type="color"] {
  position: absolute; top: -1px; left: -1px;
  width: calc(100% + 2px); height: calc(100% + 2px);
  padding: 0; border: 0; opacity: 0; cursor: pointer;
}

/* 格式 chip 组：与色板同为 flex 行，但需要换行且更紧凑 */
.swatches--chips { flex-wrap: wrap; gap: 8px; }
#bcChips button.active { background: var(--blue); color: #fff; }
#bcChips button.active:hover { background: var(--blue-dark); }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border: 1px solid var(--border);
  border-radius: 12px;
}
.toggle-row span { font-size: 14px; }
.switch { position: relative; width: 46px; height: 28px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0; cursor: pointer;
  background: #E3E3E8; border-radius: 980px; transition: 0.2s;
}
.slider::before {
  content: ""; position: absolute; height: 22px; width: 22px;
  left: 3px; top: 3px; background: #fff; border-radius: 50%;
  transition: 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch input:checked + .slider { background: var(--blue); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* 预览区 */
.preview-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-card);
  padding: 32px;
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: 88px;
}
.preview-stage {
  background: var(--gray-bg);
  border-radius: 16px;
  padding: 40px 0;
  display: grid; place-items: center;
  min-height: 300px;
}
.preview-stage .qr-render,
.preview-stage .bc-render {
  background: #fff;
  padding: 16px;
  border-radius: 10px;
  line-height: 0;
}
.preview-stage canvas,
.preview-stage img,
.preview-stage svg { display: block; }
.preview-cap {
  text-align: center; font-size: 13px; color: var(--text-3);
  margin-top: 18px;
}
/* 批量页：结果卡与操作按钮同一行，说明文字不再居中偏离 */
.preview-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.preview-head .preview-cap { margin: 0; }
/* 批量页右侧整块不需要跟随滚动吸顶（结果列表很长） */
.preview-card--static { position: static; }
.preview-actions {
  display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap;
}
.preview-actions .btn { flex: 1; min-width: 90px; }

/* ---------- 二维码页新增控件 ---------- */
.field-divider { height: 1px; background: var(--border-light); margin: 24px 0; }
.toggle-sub { margin-top: 12px; }
.range-row { display: flex; align-items: center; gap: 12px; }
/* 同一个字段里连着两条滑杆（线宽 + 高度）时，中间留 12px */
.field > .range-row:not(:last-child) { margin-bottom: 12px; }
.range-row > label { font-size: 13px; color: var(--text-2); min-width: 32px; }
.range-row input[type="range"] {
  -webkit-appearance: none; appearance: none; flex: 1;
  height: 4px; border-radius: 2px; background: var(--border); outline: none; cursor: pointer;
}
.range-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 1px solid var(--border); box-shadow: 0 1px 4px rgba(0,0,0,0.25); cursor: pointer;
}
.range-row input[type="range"]::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 1px solid var(--border); box-shadow: 0 1px 4px rgba(0,0,0,0.25); cursor: pointer;
}
.range-val { font-size: 12px; color: var(--text-3); min-width: 38px; text-align: right; font-variant-numeric: tabular-nums; }
.color-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.color-input {
  width: 34px; height: 34px; padding: 0; border: 1px solid var(--border);
  border-radius: 8px; background: #fff; cursor: pointer;
}
.color-input::-webkit-color-swatch-wrapper { padding: 2px; }
.color-input::-webkit-color-swatch { border: none; border-radius: 5px; }
/* 颜色行右侧的说明文字（“外圈 / 内点”“边框色 / 文字色”） */
.color-note { font-size: 12px; color: var(--text-3); }

/* 框架设置面板：开关打开后才出现，内部字段比常规更紧凑 */
.frame-panel { margin-top: 16px; }
.frame-panel .field { margin-bottom: 14px; }
.frame-panel .color-row { margin-bottom: 14px; }
/* 两个滑杆之间留 12px，末项不留（否则面板底部会多出一截空白） */
.frame-panel .range-row:not(:last-child) { margin-bottom: 12px; }
.logo-uploader { display: flex; align-items: center; gap: 12px; }
/* 「上传图片」是个 label，需要手型光标；内部 file input 用 hidden 隐藏 */
.btn-file { cursor: pointer; }
/* 条形码预览：透明底用棋盘格示意，避免"预览白底=导出白底"的误解 */
.preview-stage .bc-render svg { max-width: 100%; height: auto; }
.preview-stage .bc-render.is-transparent {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #EDEEF0 25%, transparent 25%),
    linear-gradient(-45deg, #EDEEF0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #EDEEF0 75%),
    linear-gradient(-45deg, transparent 75%, #EDEEF0 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}

/* ---------- 折叠分组（风格 / 颜色 / 框架 / 品牌塑造 / 选项） ---------- */
.acc { display: flex; flex-direction: column; gap: 12px; margin: 6px 0 24px; }
.acc-head {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 44px; padding: 0 44px;
  font-family: var(--font);
  font-size: 15px; font-weight: 500; letter-spacing: -0.01em;
  color: var(--text);
  background: #F1F2F4;
  border: none; border-radius: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}
.acc-head:hover { background: #EAECEF; }
.acc-head:active { background: #E2E4E8; }
.acc-head[aria-expanded="true"] { background: #E4E6EA; }
.acc-head:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.25); }
.acc-icon { width: 15px; height: 15px; margin-right: 7px; flex: none; color: var(--text); opacity: 0.72; }
.acc-icon svg { display: block; width: 100%; height: 100%; }
.acc-hint {
  position: absolute; right: 40px; max-width: 42%;
  font-size: 12px; font-weight: 400; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.acc-chevron {
  position: absolute; right: 14px; width: 13px; height: 13px;
  color: var(--text-3);
  transition: transform 0.24s cubic-bezier(0.32, 0.72, 0, 1);
}
.acc-head[aria-expanded="true"] .acc-chevron { transform: rotate(180deg); }
/* 筛选类折叠头（识别格式）：标题左对齐、右侧常驻状态摘要 + 箭头。
   居中布局放不下 12px 的状态文字，左对齐后窄屏也不会挤在一起。 */
.acc-head--filter { justify-content: flex-start; padding: 0 14px 0 18px; }
.acc-head--filter .acc-hint {
  position: static; margin-left: auto; margin-right: 10px;
  max-width: none; white-space: nowrap;
}
.acc-head--filter .acc-chevron { position: static; flex: none; }
/* 嵌在 .field 里时不需要额外外边距 */
.acc--inline { margin: 0; gap: 0; }
.acc-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}
.acc-item.open .acc-body { grid-template-rows: 1fr; }
.acc-inner { min-height: 0; overflow: hidden; }
.acc-content { padding: 20px 2px 2px; }
.acc-content > .field:last-child { margin-bottom: 0; }
@media (max-width: 520px) {
  .acc-hint { display: none; }
  /* 筛选头例外：收起后必须能看到"当前筛了什么"，否则等于隐藏状态 */
  .acc-head--filter .acc-hint { display: inline; }
  /* 窄屏两个按钮必然换行：等宽堆叠比参差居中更整齐 */
  .drop-zone .btn { min-width: 176px; }
}
@media (prefers-reduced-motion: reduce) {
  .acc-body, .acc-chevron { transition: none; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: #1D1D1F;
  color: #fff;
  padding: 56px 0 32px;
  margin-top: 40px;
}
.footer-top {
  display: flex; justify-content: space-between;
  gap: 40px; flex-wrap: wrap;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.footer-brand .brand { color: #fff; }
.footer-brand p { color: #A1A1A6; font-size: 14px; margin-top: 12px; max-width: 260px; }
.footer-cols { display: flex; gap: 64px; flex-wrap: wrap; }
.footer-col h4 { font-size: 13px; color: #86868B; margin-bottom: 14px; letter-spacing: 0.02em; }
.footer-col a { display: block; color: #D2D2D7; font-size: 14px; margin-bottom: 10px; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 12px;
  padding-top: 24px; font-size: 13px; color: #86868B;
}
.footer-bottom .legal { display: flex; gap: 20px; }
.footer-bottom .legal a:hover { color: #fff; }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  /* minmax(0,1fr)：防止卡片内 min-content（长选项行/输入框）把栅格轨道撑宽 */
  .gen-wrap { grid-template-columns: minmax(0, 1fr); }
  .gen-card, .preview-card { min-width: 0; }
  .preview-card { position: static; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .hero h1 { font-size: 44px; }
  /* 窄屏：链接折叠进抽屉，改由汉堡按钮唤起 */
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-actions { gap: 4px; }
  /* 汉堡占据容器右端，负边距改由外层容器承担：图标与内容右边界光学对齐 */
  .nav-toggle { margin-right: 0; }
  .nav-end { margin-right: -10px; gap: 12px; }
}
@media (max-width: 620px) {
  .bento { grid-template-columns: 1fr; }
  .hero h1 { font-size: 36px; }
  .container { padding: 0 20px; }
}

/* 窄屏抽屉已接管导航，宽屏下这些元素保持隐藏 */
.nav-toggle,
.nav-scrim,
.nav-drawer { display: none; }
@media (max-width: 980px) {
  .nav-toggle { display: block; }
  .nav-scrim,
  .nav-drawer { display: block; }
}

/* 减少动态效果：关闭抽屉滑动与遮罩淡入 */
@media (prefers-reduced-motion: reduce) {
  .nav-toggle .bars span,
  .nav-scrim,
  .nav-drawer { transition: none !important; }
  .nav-drawer { transform: none; visibility: hidden; }
  body.nav-open .nav-drawer { transform: none; visibility: visible; }
}

/* ============================================================
   滚动渐显 (AOS) — 还原 77qr 的顺滑观感
   使用官方 AOS 引擎（assets/vendor/aos.*），与 77qr 同款。
   无障碍兜底：开启「减少动态效果」时直接显示，不隐藏内容
   （无 JS 的兜底见下方 @media (scripting: none)）。
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  [data-aos] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
/* 脚本被禁用时的同款兜底。
   原先 6 个页面各写一段 <noscript><style>，内联 <style> 会强制 CSP 的
   style-src 保留 'unsafe-inline'；改用 Media Queries L5 的 scripting 特性，
   纯外部样式即可判定，CSP 收紧后依然生效。 */
@media (scripting: none) {
  [data-aos] {
    opacity: 1 !important;
    transform: none !important;
  }
}

/* ============================================================
   导出成功微动效（按钮轻弹）— 贴近 77qr「顺滑」质感
   导出/复制成功后触发一次轻弹，配合文案反馈。
   ============================================================ */
@keyframes btnPop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.07); }
  100% { transform: scale(1); }
}
.btn.pop { animation: btnPop 0.34s cubic-bezier(0.22, 1, 0.36, 1); }

/* ============================================================
   解析页 (parse) — 拖放识别 + 结果列表
   ============================================================ */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-card);
  background: var(--gray-bg);
  padding: 56px 24px;
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease;
  cursor: pointer;
}
.drop-zone.dragover {
  border-color: var(--blue);
  background: rgba(0, 122, 255, 0.05);
}
.dz-ico {
  width: 56px; height: 56px;
  display: grid; place-items: center;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #fff;
  color: var(--blue);
  box-shadow: var(--shadow-soft);
}
.dz-title { font-size: 19px; font-weight: 600; margin-bottom: 6px; }
.dz-sub { font-size: 13px; color: var(--text-3); margin-bottom: 22px; }
/* 拖放区底部的「选择图片 / 摄像头扫描」按钮行 */
.dz-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.result-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-top: 28px; padding: 16px 20px;
  background: #fff; border: 1px solid var(--border-light);
  border-radius: 14px; box-shadow: var(--shadow-soft);
}
.result-bar .rc-count { font-size: 14px; color: var(--text-2); font-weight: 500; }
.result-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.results {
  margin-top: 24px;
  display: grid; gap: 16px;
  /* min() 兜底：容器比 340 还窄时按容器宽取值，否则整列会溢出 */
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
}
/* 批量页的结果紧跟在标题行下，留白比单码页更小 */
.results--tight { margin-top: 20px; }
/* 批量页空输入时的占位提示（原先写在内联 style 里，CSP 收紧 style-src 前先去掉） */
.batch-empty { color: var(--text-3); font-size: 13px; padding: 20px 0; }
/* 单码预览区的占位 / 报错文字（同样原先是内联样式） */
.preview-note { color: var(--text-3); font-size: 13px; padding: 40px 0; }
.preview-note.is-error { color: #FF3B30; }
.result-card {
  display: flex; gap: 16px;
  background: #fff; border: 1px solid var(--border-light);
  border-radius: 16px; padding: 18px;
  box-shadow: var(--shadow-soft);
}
.rc-thumb {
  width: 88px; height: 88px; flex: 0 0 88px;
  border-radius: 12px; overflow: hidden;
  background: var(--gray-bg);
  display: grid; place-items: center;
}
.rc-thumb img { width: 100%; height: 100%; object-fit: contain; }
.rc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.rc-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rc-file {
  font-size: 12px; color: var(--text-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.badge {
  font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: var(--radius-pill);
  background: rgba(0, 122, 255, 0.1); color: var(--blue);
}
.badge.b-text { background: rgba(52, 199, 89, 0.12); color: #1a8f3c; }
.badge.b-url  { background: rgba(0, 122, 255, 0.1); color: var(--blue); }
.badge.b-wifi { background: rgba(255, 149, 0, 0.12); color: #c4760a; }
.badge.b-vcard { background: rgba(175, 82, 222, 0.12); color: #8a3bbf; }
.badge.b-none { background: rgba(134, 134, 139, 0.14); color: var(--text-3); }
.rc-content {
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.6; color: var(--text);
  word-break: break-all; white-space: pre-wrap;
  background: var(--gray-bg); border-radius: 10px; padding: 10px 12px;
  max-height: 140px; overflow: auto;
}
.rc-content.empty { color: var(--text-3); }
.rc-actions { display: flex; gap: 8px; margin-top: 2px; }
.rc-actions .btn { padding: 7px 14px; font-size: 13px; }

/* ---------- 批量页：按生成类型显隐 + 成对缩略图 ---------- */
.gen-card[data-mode="qr"] [data-for="bar"],
.gen-card[data-mode="bar"] [data-for="qr"] { display: none; }
/* 表单说明文字：输入框 / 分段控件下方那行灰字 */
.field-hint { display: block; margin-top: 8px; font-size: 12px; color: var(--text-3); }

.rc-thumbs { display: flex; gap: 10px; flex: none; align-items: center; }
.rc-thumb--bar { width: 132px; height: 88px; flex: 0 0 132px; background: #fff; }
.rc-thumb--bar svg { max-width: 100%; max-height: 100%; width: auto; height: auto; display: block; }
.rc-tag { font-size: 11px; font-weight: 600; color: var(--text-3); min-width: 30px; }
.rc-tag--bar { color: #7A4A00; }
.rc-actions { flex-wrap: wrap; align-items: center; }
.rc-err { font-size: 12px; color: #FF3B30; line-height: 1.5; }
.fmt-hint.is-warn { color: #C2410C; }
/* 文件名是 nowrap + 省略号，flex 子项必须允许收缩，否则整张卡被撑宽 */
.rc-meta { min-width: 0; }
.rc-file { min-width: 0; }
.result-card > * { min-width: 0; }

/* 窄屏：缩略图与文字改为上下排列，否则一排放两张码后正文只剩几十像素 */
@media (max-width: 560px) {
  .result-card { flex-direction: column; gap: 12px; }
  .rc-thumbs { width: 100%; }
  .rc-thumb { width: 72px; height: 72px; flex: 0 0 72px; }
  .rc-thumb--bar { width: auto; flex: 1 1 auto; height: 72px; }
}

/* ---------- 当前页导航高亮 ---------- */
.nav-links a.active { color: var(--text); font-weight: 600; }

/* ---------- 解析/解码页：格式选择 chips ---------- */
.fmt-box {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px;
}
.fmt-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-2);
  background: var(--gray-bg); border: 1px solid transparent;
  padding: 7px 12px; border-radius: var(--radius-pill);
  cursor: pointer; transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  user-select: none;
}
.fmt-chip:hover { border-color: var(--border); }
.fmt-chip input { accent-color: var(--blue); width: 15px; height: 15px; cursor: pointer; }
.fmt-chip.on {
  background: rgba(0, 122, 255, 0.08); color: var(--blue);
  border-color: rgba(0, 122, 255, 0.25); font-weight: 600;
}
.fmt-tools { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.fmt-hint { display: block; margin-top: 10px; font-size: 12px; color: var(--text-3); }
.fmt-hint--tight { margin-top: 8px; }
.fmt-hint.is-warn { color: #C2410C; }

/* 摄像头面板 */
.cam-panel { margin-top: 24px; text-align: center; }
/* 取景台：视频 + 取景框（框内即 ZXing 第二路扫描的中央区域） */
.cam-stage {
  position: relative;
  width: 100%; max-width: 480px;
  margin: 0 auto;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.cam-video {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.cam-frame {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 78%; height: 46%;
  border: 2px solid rgba(255, 255, 255, 0.92);
  outline: 1px solid rgba(0, 0, 0, 0.18); /* 浅色画面下也能看清边界 */
  border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.3);
  pointer-events: none;
  transition: border-color 0.2s ease;
}
/* 扫描线：给「正在识别」一个可感知的反馈 */
.cam-frame::after {
  content: "";
  position: absolute;
  left: 6%; right: 6%;
  top: 4%; height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(0, 122, 255, 0), #007AFF, rgba(0, 122, 255, 0));
  opacity: 0;
}
.cam-panel.is-live .cam-frame::after {
  opacity: 1;
  animation: camSweep 2.1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes camSweep {
  0%   { top: 4%;  opacity: 0; }
  15%  { opacity: 1; }
  85%  { opacity: 1; }
  100% { top: 92%; opacity: 0; }
}
/* 命中：取景框闪绿 */
.cam-panel.is-hit .cam-frame { border-color: #34C759; }
.cam-status { font-size: 13px; color: var(--text-2); margin: 12px 0; }
.cam-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) {
  .cam-panel.is-live .cam-frame::after { animation: none; opacity: 0.5; }
}
/* 「摄像头扫描」按钮在扫描中的状态 */
#camBtn.on { background: rgba(0, 122, 255, 0.1); color: var(--blue); }

/* ---------- 摄像头命中结果弹框 ---------- */
.scan-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overscroll-behavior: contain;
}
.scan-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: scanFade 0.18s ease both;
}
.scan-sheet {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 20px;
  padding: 20px 22px 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24), 0 2px 8px rgba(0, 0, 0, 0.08);
  animation: scanIn 0.22s cubic-bezier(0.32, 0.72, 0, 1) both;
}
@keyframes scanFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes scanIn {
  from { opacity: 0; transform: translateY(8px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
.scan-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.scan-x {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%;
  background: var(--gray-bg); color: var(--text-2);
  cursor: pointer; transition: background 0.15s ease, color 0.15s ease;
}
.scan-x:hover { background: #E4E6EA; color: var(--text); }
.scan-x svg { width: 15px; height: 15px; }
.scan-title {
  display: flex; align-items: center; gap: 9px;
  font-size: 19px; font-weight: 650; letter-spacing: -0.01em;
  color: var(--text); margin: 14px 0 6px;
}
.scan-check {
  width: 24px; height: 24px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; background: #34C759; color: #fff;
}
.scan-check svg { width: 14px; height: 14px; }
.scan-hint { font-size: 13px; color: var(--text-2); margin: 0 0 14px; }
.scan-text {
  font-family: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px; line-height: 1.6; color: var(--text);
  word-break: break-all; white-space: pre-wrap;
  background: var(--gray-bg); border-radius: 12px; padding: 12px 14px;
  max-height: min(38vh, 240px); overflow: auto;
  -webkit-overflow-scrolling: touch;
  user-select: text;
}
.scan-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.scan-foot .btn { width: 100%; justify-content: center; }
@media (max-width: 560px) {
  .scan-modal { align-items: flex-end; padding: 0; }
  .scan-sheet {
    max-width: none;
    border-radius: 20px 20px 0 0;
    padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    animation: scanUp 0.26s cubic-bezier(0.32, 0.72, 0, 1) both;
  }
  @keyframes scanUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
  }
  .scan-title { font-size: 17px; margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .scan-backdrop, .scan-sheet { animation: none; }
}

/* ---------- 徽章：条码 / 矩阵码 类型 ---------- */
.badge.b-barcode { background: rgba(0, 122, 255, 0.1); color: var(--blue); }
.badge.b-matrix { background: rgba(175, 82, 222, 0.12); color: #8a3bbf; }

/* ---------- 间距工具 ----------
   只用于选项面板里控件块之间的固定纵向距离（原先是逐元素内联 margin-top）。
   用像素值命名，避免「.mt-md 到底几 px」的猜谜；放在文件末尾以便覆盖组件默认值。 */
.mt-14 { margin-top: 14px; }
