/* =========================================================
 *  PDF 转换 · 样式
 *
 *  色板、圆角、缓动全部沿用压缩站与聚合站的一套 iOS 基调，
 *  只有 logo 图标换成 PDF 的红，方便一眼区分站点。
 * ========================================================= */

:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --card-t: rgba(255, 255, 255, .78);
  --fill: rgba(120, 120, 128, .12);
  --fill2: rgba(120, 120, 128, .08);
  --line: rgba(60, 60, 67, .12);
  --line2: rgba(60, 60, 67, .06);

  --tx: #1c1c1e;
  --tx2: rgba(60, 60, 67, .62);
  --tx3: rgba(60, 60, 67, .34);

  --brand: #0a84ff;
  --brand-d: #0071e3;
  --brand-soft: rgba(10, 132, 255, .1);
  --ok: #34c759;
  --err: #ff3b30;
  --gold: #ff9f0a;

  --r: 16px;
  --r-sm: 10px;
  --r-lg: 28px;

  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 28px rgba(0, 0, 0, .06);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .05), 0 20px 50px rgba(0, 0, 0, .12);
  --ease: cubic-bezier(.32, .72, 0, 1);
}

* { box-sizing: border-box; }

/* .mask / .studio 这些自己带了 display，会盖掉 hidden 的默认样式，这里统一兜住 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--tx);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro SC",
        "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -.01em;
  display: flex;
  flex-direction: column;
}

button { font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
input { font: inherit; }
a { color: inherit; text-decoration: none; }

/* 手绘图标统一尺寸，跟着文字颜色走 */
.ic {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -.14em;
  flex: none;
}

/* ---------------- 顶栏 ---------------- */

.top {
  height: 54px;
  padding: 0 20px;
  background: rgba(245, 245, 247, .78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: none;
  position: relative;
  z-index: 10;
}

.logo { display: flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 600; }
.logo-ic {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(160deg, #ff7a6b, #e8402f);
  color: #fff;
  font-size: 18px;
  box-shadow: 0 2px 8px rgba(232, 64, 47, .3);
}

.top-nav { display: flex; align-items: center; gap: 14px; }
.top-nav > a { color: var(--tx2); font-size: 14px; transition: color .2s; }
.top-nav > a:hover { color: var(--brand); }

.btn-primary {
  height: 34px;
  padding: 0 17px;
  border: 0;
  border-radius: 99px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 2px 10px rgba(10, 132, 255, .26);
  transition: transform .25s var(--ease), background .2s, box-shadow .2s;
}
.btn-primary:hover { background: var(--brand-d); }
.btn-primary:active { transform: scale(.96); }
.btn-primary:disabled { background: var(--fill); color: var(--tx3); box-shadow: none; cursor: not-allowed; transform: none; }

.btn-ghost {
  height: 34px;
  padding: 0 15px;
  border: 0;
  border-radius: 99px;
  background: var(--fill);
  color: var(--tx);
  font-size: 14px;
  transition: transform .25s var(--ease), background .2s;
}
.btn-ghost:hover { background: rgba(120, 120, 128, .2); }
.btn-ghost:active { transform: scale(.96); }
.btn-ghost.wide { width: 100%; height: 38px; justify-content: center; }
.btn-ghost:disabled { color: var(--tx3); cursor: not-allowed; transform: none; }

.big { width: 100%; height: 46px; font-size: 16px; border-radius: 15px; }

.link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--brand);
  font-size: inherit;
}
.link:hover { opacity: .7; }
.link.danger { color: var(--err); }

.me { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.me img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.me-ic {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--fill);
  color: var(--tx2);
  font-size: 17px;
}
.me-name { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge {
  padding: 2px 8px;
  border-radius: 99px;
  background: rgba(255, 159, 10, .16);
  color: #b26a00;
  font-size: 12px;
  font-weight: 500;
}

/* 会员功能角标。已是会员就没必要再提示，用 body.is-pro 统一隐藏 */
.vip-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 5px;
  background: linear-gradient(135deg, #ffb340, #ff9f0a);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .04em;
  vertical-align: 1.5px;
}
.vip-tag.sm {
  padding: 0 5px;
  font-size: 9.5px;
  vertical-align: 1px;
}
body.is-pro .vip-tag { display: none; }

/* ---------------- 落地页 ---------------- */

.wrap { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.hero {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
  padding: 76px 20px 60px;
  text-align: center;
}
/* 首屏顶上铺一层很淡的光晕，比纯灰底有空气感 */
.hero::before {
  content: '';
  position: absolute;
  inset: -120px -40px auto;
  height: 420px;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(46rem 24rem at 26% 0%, rgba(255, 122, 107, .13), transparent 62%),
    radial-gradient(36rem 20rem at 82% 12%, rgba(10, 132, 255, .1), transparent 60%);
}
.hero h1 {
  margin: 0 0 14px;
  font-size: 42px;
  line-height: 1.16;
  font-weight: 700;
  letter-spacing: -.028em;
}
.hero .sub { margin: 0 auto 26px; max-width: 560px; color: var(--tx2); font-size: 17px; }

/* 落地页上的方向切换，居中显示 */
.hero-seg { max-width: 320px; margin: 0 auto 18px; }

/* ---------------- 落地页九宫格 ---------------- */

.tools {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 0 20px;
  text-align: left;
}
.tool {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 15px;
  border: 1px solid var(--line2);
  border-radius: var(--r);
  background: var(--card-t);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--tx);
  text-align: left;
  transition: border-color .25s var(--ease), background .25s, transform .25s var(--ease), box-shadow .25s;
}
.tool:hover { border-color: rgba(10, 132, 255, .4); transform: translateY(-2px); box-shadow: var(--shadow); }
.tool:active { transform: scale(.98); }
.tool.on {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 1px var(--brand) inset;
}
.tool-ic {
  width: 32px; height: 32px;
  margin-bottom: 5px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 32px;
}
.tool.on .tool-ic { background: var(--brand); color: #fff; }
.tool-name {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14.5px;
  font-weight: 600;
}
.tool-tip { color: var(--tx3); font-size: 12px; line-height: 1.45; }

.drop {
  padding: 54px 20px;
  border: 1.5px dashed rgba(60, 60, 67, .22);
  border-radius: var(--r-lg);
  background: var(--card-t);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
  transition: border-color .3s var(--ease), background .3s, transform .3s var(--ease), box-shadow .3s;
}
.drop:hover { border-color: rgba(10, 132, 255, .45); }
.drop.over {
  border-color: var(--brand);
  background: rgba(10, 132, 255, .06);
  transform: scale(1.012);
  box-shadow: var(--shadow);
}
.drop-ic {
  width: 62px; height: 62px;
  margin: 0 auto;
  display: grid; place-items: center;
  border-radius: 19px;
  background: linear-gradient(160deg, rgba(10, 132, 255, .16), rgba(10, 132, 255, .06));
  color: var(--brand);
  font-size: 32px;
}
.drop-tx { margin-top: 16px; font-size: 16px; font-weight: 500; }
.drop-hint { margin-top: 6px; color: var(--tx3); font-size: 13px; }

.feats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 34px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}
.feats li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 16px;
  background: var(--card-t);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line2);
  border-radius: var(--r);
  color: var(--tx2);
  font-size: 13px;
  line-height: 1.5;
}
.feat-ic {
  width: 32px; height: 32px;
  padding: 6px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 32px;
}
.feats b { display: block; margin-bottom: 2px; color: var(--tx); font-size: 14px; }

/* ---------------- 常见问题 ---------------- */

.faq {
  margin: 40px 0 0;
  text-align: left;
}
.faq > h2 {
  margin: 0 0 14px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.faq-item {
  padding: 18px 20px;
  margin-bottom: 10px;
  background: var(--card-t);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line2);
  border-radius: var(--r);
}
.faq-item:last-child { margin-bottom: 0; }
.faq-item h3 { margin: 0 0 7px; font-size: 15px; font-weight: 600; }
.faq-item p { margin: 0; color: var(--tx2); font-size: 13.5px; line-height: 1.65; }

/* ---------------- 工作区 ---------------- */

.studio {
  flex: 1;
  display: grid;
  grid-template-columns: 258px 1fr 300px;
  gap: 14px;
  padding: 14px;
  min-height: 0;
}

.files, .panel {
  background: var(--card);
  border: 1px solid var(--line2);
  border-radius: var(--r);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.files-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line2);
  font-size: 13px;
  color: var(--tx2);
}
.files-head > span { flex: 1; font-weight: 500; color: var(--tx); }

.file-list { flex: 1; margin: 0; padding: 6px; list-style: none; overflow-y: auto; }

.file {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 30px 9px 10px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .2s, opacity .2s;
}
.file:hover { background: var(--fill2); }
.file.on { background: var(--brand-soft); }
.file.drag { opacity: .4; }
.file.dragover { box-shadow: inset 0 2px 0 var(--brand); }

/* 缩略图，图片转 PDF 时排序靠它认图 */
.file-thumb {
  width: 34px; height: 42px;
  flex: none;
  border-radius: 5px;
  border: 1px solid var(--line2);
  background: #fff center / cover no-repeat;
  display: grid; place-items: center;
  color: var(--tx3);
  font-size: 16px;
  overflow: hidden;
}
.file-body { flex: 1; min-width: 0; }
.file-name {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-meta {
  margin-top: 2px;
  color: var(--tx3);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 16px;
}
.file-meta b { color: var(--tx); font-weight: 600; }
.file-meta .ok { color: var(--ok); }
.file-x {
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  width: 20px; height: 20px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: none;
  color: var(--tx3);
  font-size: 13px;
  transition: background .2s, color .2s;
}
.file-x:hover { background: rgba(255, 59, 48, .12); color: var(--err); }

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

/* ---------------- 进度 ---------------- */

.prog {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}
.prog-bar {
  flex: 1;
  min-width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--fill);
  overflow: hidden;
}
.prog-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: var(--brand);
  transition: width .25s var(--ease);
}
.prog-n {
  flex: none;
  font-variant-numeric: tabular-nums;
  color: var(--tx2);
}

.stage-prog {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: var(--r-sm);
  background: var(--card-t);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border: 1px solid var(--line2);
  font-size: 13px;
  color: var(--tx2);
}
.stage-prog-bar {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: var(--fill);
  overflow: hidden;
}
.stage-prog-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--brand), #5ac8fa);
  transition: width .25s var(--ease);
}
.stage-prog span { flex: none; font-variant-numeric: tabular-nums; }

/* ---------------- 舞台 ---------------- */

.stage {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* iOS 分段控件 */
.seg {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: 11px;
  background: var(--fill);
}
.seg button {
  padding: 6px 15px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--tx2);
  font-size: 13px;
  transition: background .25s var(--ease), color .2s;
}
.seg button.on {
  background: #fff;
  color: var(--tx);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}
.seg.wide { display: flex; margin-bottom: 6px; }
.seg.wide button { flex: 1; padding: 6px 0; }
/* 纵向分段：一档一行，放得下长文案 */
.seg.col { flex-direction: column; gap: 2px; }
.seg.col button { padding: 8px 12px; text-align: left; }

/* 功能切换胶囊条：窄屏横向滑动，不换行不挤压 */
.chips {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
.chips button {
  flex: none;
  height: 30px;
  padding: 0 13px;
  border: 1px solid var(--line2);
  border-radius: 99px;
  background: var(--card);
  color: var(--tx2);
  font-size: 13px;
  white-space: nowrap;
  transition: background .25s var(--ease), color .2s, border-color .2s;
}
.chips button:hover { color: var(--tx); }
.chips button.on {
  border-color: transparent;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}

.zoom { display: flex; align-items: center; gap: 6px; color: var(--tx2); font-size: 13px; }
.zoom > span { min-width: 52px; text-align: center; font-variant-numeric: tabular-nums; }
.zoom button {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--fill);
  color: var(--tx);
  font-size: 15px;
  transition: background .2s, transform .25s var(--ease);
}
.zoom button:hover { background: rgba(120, 120, 128, .2); }
.zoom button:active { transform: scale(.9); }

.canvas-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  border-radius: var(--r);
  border: 1px solid var(--line2);
  background:
    linear-gradient(45deg, #ececf0 25%, transparent 25%, transparent 75%, #ececf0 75%),
    linear-gradient(45deg, #ececf0 25%, #f9f9fb 25%, #f9f9fb 75%, #ececf0 75%);
  background-size: 18px 18px;
  background-position: 0 0, 9px 9px;
  overflow: auto;
  padding: 16px;
}

/* 预览：一张纸的效果，白底 + 投影 */
.preview { display: grid; place-items: center; }
.preview canvas,
.preview img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 270px);
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .1), 0 12px 34px rgba(0, 0, 0, .14);
}

.stage-empty { position: absolute; color: var(--tx3); font-size: 14px; }

.stat {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 13px 18px;
  background: var(--card);
  border: 1px solid var(--line2);
  border-radius: var(--r);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
.stat-cell label { display: block; color: var(--tx3); font-size: 12px; }
.stat-cell b { font-size: 17px; font-weight: 600; letter-spacing: -.02em; }
.stat-cell.arrow { color: var(--tx3); font-size: 18px; }
.stat-cell.save { margin-left: auto; text-align: right; }

/* ---------------- 参数面板 ---------------- */

.panel { padding: 18px; gap: 22px; overflow-y: auto; }

/* 两个方向各一组参数，切换时整组显隐 */
.mode-box { display: flex; flex-direction: column; gap: 22px; }

.pgroup { display: block; }
.plabel {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 600;
}
.plabel b { margin-left: auto; color: var(--brand); }
.ptip { margin: 7px 0 0; color: var(--tx3); font-size: 12px; line-height: 1.5; }

/* iOS 复选框 */
input[type=checkbox] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px; height: 20px;
  margin: 0;
  border: 1.5px solid rgba(60, 60, 67, .26);
  border-radius: 50%;
  background: transparent;
  transition: background .2s, border-color .2s;
  flex: none;
  cursor: pointer;
}
input[type=checkbox]:checked {
  border-color: var(--brand);
  background: var(--brand)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.7 12.9c1.7 1.4 3.2 2.9 4.4 4.5 2.6-4.6 5.7-8.3 9.4-11.2'/%3E%3C/svg%3E")
    center / 14px no-repeat;
}

/* iOS 滑块 */
input[type=range] {
  width: 100%;
  height: 26px;
  appearance: none;
  -webkit-appearance: none;
  background: none;
}
input[type=range]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: var(--fill);
}
input[type=range]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 22px; height: 22px;
  margin-top: -9px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .12), 0 3px 8px rgba(0, 0, 0, .18);
}
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--fill); }
input[type=range]::-moz-range-thumb {
  width: 22px; height: 22px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .12), 0 3px 8px rgba(0, 0, 0, .18);
}
.range-tick { display: flex; justify-content: space-between; color: var(--tx3); font-size: 11px; }

.row { display: flex; align-items: center; gap: 8px; }
.row.gap { justify-content: flex-end; gap: 14px; margin-top: 8px; }
.row input[type=number],
.row input[type=text],
.pgroup > input[type=text] {
  flex: 1;
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--fill2);
  color: var(--tx);
  transition: box-shadow .2s;
}
.pgroup > input[type=text] + input[type=text] { margin-top: 8px; }
.row input:focus,
.pgroup > input[type=text]:focus { outline: none; box-shadow: 0 0 0 3px var(--brand-soft); }
.unit { color: var(--tx3); font-size: 13px; }

/* 提示条的两种强调形态 */
.ptip.note {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--brand-soft);
  color: var(--tx2);
}
.ptip.warn {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: rgba(255, 59, 48, .1);
  color: #c0271c;
}
.ptip.warn b { color: var(--err); }

/* 颜色小圆点 */
.swatch { display: flex; gap: 10px; }
.swatch button {
  width: 26px; height: 26px;
  border: 0;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 1px var(--line) inset;
  transition: transform .25s var(--ease), box-shadow .2s;
}
.swatch button:hover { transform: scale(1.08); }
.swatch button.on {
  box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--brand);
}

/* 扫描结果勾选列表 */
.checks { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 9px; }
.checks label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--tx2);
  cursor: pointer;
}
.checks input[type=checkbox] { width: 18px; height: 18px; }
.checks .hit {
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(255, 159, 10, .16);
  color: #b26a00;
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
}
.checks .muted { color: var(--tx3); font-size: 12.5px; }

/* 手写签名板 */
.sign-pad {
  position: relative;
  border: 1px dashed rgba(60, 60, 67, .24);
  border-radius: var(--r-sm);
  background: var(--fill2);
  overflow: hidden;
}
#sigPad {
  display: block;
  width: 100%;
  height: auto;
  touch-action: none;
  cursor: crosshair;
}
.sign-hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--tx3);
  font-size: 13px;
  pointer-events: none;
}

/* 上传签名图片：按钮 + 缩略预览 */
.stamp-box {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.stamp-box img {
  max-width: 120px;
  max-height: 80px;
  padding: 4px;
  border: 1px dashed rgba(60, 60, 67, .24);
  border-radius: var(--r-sm);
  background: var(--fill2);
  object-fit: contain;
}

.quota {
  margin-top: auto;
  padding: 11px 13px;
  border-radius: var(--r-sm);
  background: var(--fill2);
  color: var(--tx2);
  font-size: 13px;
}
.quota b { color: var(--tx); }
.quota.pro { background: rgba(255, 159, 10, .12); color: #b26a00; }

/* 签名的「生成 / 下载」两步按钮 */
.acts { display: flex; flex-direction: column; gap: 9px; }
.acts .ptip { margin: 0; }

/* ---------------- 页脚 ---------------- */

.foot {
  padding: 18px;
  border-top: 1px solid var(--line2);
  color: var(--tx3);
  font-size: 13px;
  text-align: center;
  flex: none;
}
.foot p { margin: 2px 0; }
.foot-links a { color: var(--tx2); transition: color .2s; }
.foot-links a:hover { color: var(--brand); }

/* ---------------- 弹窗 ---------------- */

.mask {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, .36);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade .24s var(--ease);
}
@keyframes fade { from { opacity: 0; } }

.modal {
  position: relative;
  width: 100%;
  max-width: 370px;
  padding: 30px 26px;
  border-radius: var(--r-lg);
  background: var(--card);
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: pop .38s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.96); } }

.modal.wide { max-width: 450px; }
.modal h3 { margin: 0 0 6px; font-size: 20px; font-weight: 600; letter-spacing: -.02em; }
.modal-sub { margin: 0 0 20px; color: var(--tx2); font-size: 13.5px; }
.modal-tip { margin: 16px 0 0; color: var(--tx3); font-size: 12.5px; }

.close {
  position: absolute;
  top: 12px; right: 12px;
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border: 0; border-radius: 50%;
  background: var(--fill);
  color: var(--tx2);
  font-size: 16px;
  transition: background .2s;
}
.close:hover { background: rgba(120, 120, 128, .22); }

.qr {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}
.qr img { width: 200px; height: 200px; border-radius: 14px; }

.spin {
  width: 26px; height: 26px;
  border: 2.5px solid rgba(120, 120, 128, .18);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.plan {
  position: relative;
  display: block;
  padding: 17px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  cursor: pointer;
  text-align: left;
  transition: border-color .25s, background .25s, transform .25s var(--ease);
}
.plan:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
}
.plan:active { transform: scale(.98); }
.plan input { position: absolute; opacity: 0; }
.plan-tag {
  position: absolute;
  top: -9px; right: 10px;
  padding: 2px 9px;
  border-radius: 99px;
  background: var(--gold);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
}
.plan-name { display: block; font-size: 14px; font-weight: 600; }
.plan-price { display: block; margin: 7px 0 4px; color: var(--brand); font-size: 13px; }
.plan-price b { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.plan-price i { font-style: normal; font-size: 13px; }
.plan-desc { display: block; color: var(--tx3); font-size: 12px; line-height: 1.4; }

.pay-amt { margin: 12px 0 0; color: var(--tx2); font-size: 13px; }
.pay-amt b { color: var(--tx); font-size: 17px; }

/* ---------------- 提示条 ---------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 44px;
  z-index: 60;
  transform: translateX(-50%);
  padding: 11px 20px;
  border-radius: 99px;
  background: rgba(28, 28, 30, .86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #fff;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  animation: pop .38s var(--ease);
}

/* ---------------- 深色模式 ---------------- */

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --card: #1c1c1e;
    --card-t: rgba(28, 28, 30, .72);
    --fill: rgba(120, 120, 128, .24);
    --fill2: rgba(120, 120, 128, .16);
    --line: rgba(84, 84, 88, .5);
    --line2: rgba(84, 84, 88, .3);
    --tx: #f5f5f7;
    --tx2: rgba(235, 235, 245, .62);
    --tx3: rgba(235, 235, 245, .32);
  }
  .top { background: rgba(0, 0, 0, .68); }
  .seg button.on { background: #48484a; color: #fff; }
  .drop { border-color: rgba(235, 235, 245, .2); }
  .canvas-wrap {
    background:
      linear-gradient(45deg, #2c2c2e 25%, transparent 25%, transparent 75%, #2c2c2e 75%),
      linear-gradient(45deg, #2c2c2e 25%, #1c1c1e 25%, #1c1c1e 75%, #2c2c2e 75%);
    background-size: 18px 18px;
    background-position: 0 0, 9px 9px;
  }
  .file-thumb { background-color: #2c2c2e; }
  input[type=checkbox] { border-color: rgba(235, 235, 245, .3); }
  .toast { background: rgba(58, 58, 60, .92); }
  .tool { background: rgba(28, 28, 30, .72); }
  .chips button { background: #1c1c1e; }
  .chips button.on { background: var(--brand); }
  .sign-pad { border-color: rgba(235, 235, 245, .24); }
  .stamp-box img { border-color: rgba(235, 235, 245, .24); }
  #sigPad { background: #f5f5f7; }
  .ptip.warn { color: #ff8b82; }
  .checks .hit { color: #ffb340; }
  .quota.pro { color: #ffb340; }
}

/* ---------------- 移动端 ---------------- */

@media (max-width: 1000px) {
  /* 单列以后内容比屏幕高，不能再让工作区跟着视口收缩，否则会压到页脚上 */
  html, body { height: auto; }
  .studio { grid-template-columns: 1fr; padding: 12px; flex: none; min-height: auto; }
  .files { max-height: 210px; }
  .preview canvas, .preview img { max-height: 46vh; }
  .panel { overflow: visible; }
  .quota { margin-top: 4px; }
  .tools { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .top { height: 50px; padding: 0 14px; }
  .top-nav { gap: 10px; }
  .hero { padding: 46px 16px 40px; }
  .hero h1 { font-size: 30px; }
  .hero .sub { font-size: 15px; margin-bottom: 22px; }
  .drop { padding: 38px 16px; }
  .feats { grid-template-columns: 1fr; }
  .faq { margin-top: 30px; }
  .faq > h2 { font-size: 18px; }
  .faq-item { padding: 15px 16px; }
  .faq-item h3 { font-size: 14.5px; }
  .plans { grid-template-columns: 1fr; }
  .stage-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .stage-bar .seg { justify-content: center; }
  .zoom { justify-content: center; }
  .stat { gap: 12px; padding: 11px 14px; }
  .stat-cell b { font-size: 15px; }

  /* 九宫格窄屏改成一行一项，图标挪到左边省高度 */
  .tools { grid-template-columns: 1fr; gap: 8px; margin-bottom: 16px; }
  .tool { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 2px 12px; padding: 12px 14px; }
  .tool-ic { margin-bottom: 0; width: 30px; height: 30px; font-size: 30px; }
  .tool-name { flex: 1; min-width: 0; }
  .tool-tip { flex-basis: 100%; padding-left: 42px; }
  .chips { margin: 0 -12px; padding: 0 12px; }
  .seg.col button { font-size: 12.5px; }
  .swatch button { width: 30px; height: 30px; }
}
