/* ==========================================================================
   翰墨AI · 版面层 —— 设计师版（韩系柔和 × 设计师高级感）
   功能页版式照源站：居中标题头 → 工作区（左参数/右预览 等）→ 适用场景 → 功能特性。
   首页以韩系节奏重构：大圆角、细腻阴影、温润留白、精致排版。
   ========================================================================== */

/* ---------- 色块面板（color-block）：整幅铺开 + 韩系大留白 ---------- */

.block {
  background: var(--ln-tint);
  border-radius: var(--r-2xl);
  margin: var(--g9) auto;
  padding: var(--g9) var(--g6);
  max-width: var(--wrap-wide);
  position: relative;
  overflow: hidden;
}
/* 色块氛围：一层极淡的色相渐变，让大块色块有呼吸感 */
.block::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, color-mix(in srgb, var(--ln) 8%, transparent) 0%, transparent 60%);
  pointer-events: none;
}
.block > * { position: relative; z-index: 1; }
@media (max-width: 860px) { .block { margin: var(--g7) var(--g4); padding: var(--g7) var(--g5); border-radius: var(--r-xl); } }
.block--legend { background: var(--sunk); }
.block__head { max-width: 62ch; margin-bottom: var(--g7); }
.block__head h2 { font-size: var(--t-h2); margin-bottom: var(--g3); font-weight: 700; }
.block__head p { font-size: var(--t-lead); color: var(--ink-2); }

/* 色块内的白色小卡（韩系风格：大圆角、柔和阴影、温润悬停） */
.blockcard {
  display: grid; gap: var(--g2);
  padding: var(--g5);
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.blockcard__ico {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: var(--r-md);
  background: var(--ln); color: var(--ln-on);
  margin-bottom: var(--g2);
}
.blockcard__ico svg { width: 21px; height: 21px; }
.blockcard__t { font-size: var(--t-body); font-weight: 700; }
.blockcard__d { font-size: var(--t-sm); color: var(--ink-3); }

/* ---------- 色相图例（15 个功能色相，韩系风格色卡） ---------- */

.huegrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--g4); }
@media (max-width: 900px) { .huegrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .huegrid { grid-template-columns: 1fr; } }
.huecell {
  display: grid; gap: 4px;
  padding: var(--g4) var(--g5);
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.huecell__chip {
  width: 34px; height: 34px; border-radius: var(--r-md);
  background: var(--ln);
  box-shadow: 0 0 0 4px var(--ln-tint);
  margin-bottom: var(--g2);
}
.huecell__name { font-size: var(--t-body); font-weight: 700; color: var(--ln-deep); }
.huecell__hex { font-size: var(--t-min); color: var(--ink-3); font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.huecell__tools { font-size: var(--t-xs); color: var(--ink-3); line-height: 1.6; margin-top: 2px; }

/* 色相小圆点：出现在面板标题与卡片上 */
/* 色相点：用该功能色相 → 品牌色的渐变，呼应韩系产品的温润感 */
.huedot { width: 9px; height: 9px; border-radius: var(--r-full); background-color: var(--ln); background-image: linear-gradient(135deg, var(--ln), var(--violet)); flex: none; }
/* 页头 h1 前的大色点：**贴着文字起点左侧**（不占文字流）。
   实现：h1 改 display:inline-block（宽度由内容决定、配合父级 text-align:center 居中），
   色点绝对定位 h1 左外侧 -22px——色点跟着文字走，而不是被甩到 h1 块最左缘或挤压文字流。
   （上一版的"挂 h1 块左缘"在文字居中的 h1 里偏出 200px，比文字起点还远。） */
.huedot--lg {
  display: inline-block; width: 12px; height: 12px;
  position: absolute;
  left: -22px; top: 50%; transform: translateY(-50%);
}

/* ---------- 首页 ---------- */

/* hero：明亮紫罗兰氛围底（紫罗兰 → 蜜桃粉 → 天蓝渐变），下缘渐隐到页面底色。
   色停集中在令牌 --grad-wash 和 --grad-mesh，改色只动 root.css 一处。 */
.opening {
  padding-block: var(--g10) var(--g9);
  background: var(--grad-wash);
  position: relative;
  overflow: hidden;
}
.opening::before {
  content: ""; position: absolute; inset: 0;
  background: var(--grad-mesh);
  opacity: 0.8;
  pointer-events: none;
}
.opening__grid {
  display: grid; grid-template-columns: 1.04fr 1fr;
  gap: var(--g8); align-items: center;
  position: relative; z-index: 1;
}
@media (max-width: 980px) { .opening__grid { grid-template-columns: 1fr; gap: var(--g7); } }
.opening h1 { font-size: var(--t-hero); font-weight: 800; line-height: 1.14; letter-spacing: var(--tr-display); }
/* ---------- 标题里的渐变字（明亮韩系：紫罗兰 → 粉 → 天蓝） ---------- */
.opening h1 em {
  font-style: normal;
  background: var(--grad-title);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--brand-deep); /* 不支持时的回退色 */
}
.opening__sub { margin-top: var(--g5); font-size: var(--t-lead); color: var(--ink-2); max-width: 42ch; }
.opening__acts { display: flex; flex-wrap: wrap; gap: var(--g3); margin-top: var(--g6); }

/* 首页功能总览 */
.catalogsec__group { margin-top: var(--g8); }
.catalogsec__ghead {
  display: flex; align-items: center; gap: var(--g3);
  padding-bottom: var(--g3); margin-bottom: var(--g4);
  border-bottom: 1px solid var(--line);
}
.catalogsec__gname { font-size: var(--t-h3); font-weight: 700; }
.catalogsec__gnote { font-size: var(--t-xs); color: var(--ink-3); margin-left: auto; }

.cardgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--g4); }
@media (max-width: 1100px) { .cardgrid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 820px) { .cardgrid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .cardgrid { grid-template-columns: 1fr; } }

/* 工具卡片（韩系风格：圆角、柔和阴影、温润悬停） */
.toolcard {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform var(--d3) var(--ease-enter), border-color var(--d3) var(--ease);
}
.toolcard:hover { transform: translateY(-2px); border-color: var(--ln-tint); }
.toolcard__media { position: relative; }
.toolcard__media img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.toolcard__hue { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--ln); }
.toolcard__body { padding: var(--g4); }
.toolcard__top { display: flex; align-items: center; gap: var(--g2); margin-bottom: 6px; }
.toolcard__ico { display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-sm); background: var(--ln-tint); color: var(--ln-deep); flex: none; }
.toolcard__ico svg { width: 17px; height: 17px; }
.toolcard__name { font-size: var(--t-body); font-weight: 700; }
.toolcard__desc { font-size: var(--t-xs); color: var(--ink-3); line-height: 1.6; }
.toolcard__meta {
  display: flex; align-items: center; justify-content: space-between; gap: var(--g2);
  margin-top: var(--g3); padding-top: var(--g3); border-top: 1px solid var(--line);
  font-size: var(--t-min); color: var(--ink-3);
}
.toolcard__cost { font-weight: 700; color: var(--ln-deep); font-variant-numeric: tabular-nums; }

/* ---------- 功能页头部（标题居中，韩系风格：柔和圆角、温润色带） ---------- */

.pagehead {
  position: relative;
  padding-block: var(--g6) var(--g5); text-align: center;
  /* 兜底：未指定 --head-hue 的功能页用其色相族本色 */
  --head-hue: var(--ln);
  /* 浓度：顶部 20%、中部 9% —— 保留"一眼能分辨功能"的色相差别，
     同时比原来的 30% / 14% 明显更浅、更透气。
     对比度已逐项复算：标题 ≥8.8:1、副标题 ≥6.2:1，全部达标。 */
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--head-hue) 20%, var(--surface)) 0%,
    color-mix(in srgb, var(--head-hue) 9%, var(--ground)) 52%,
    var(--ground) 100%);
}
/* 顶部色相细带：功能的身份记号（宽 64px，贴顶居中，韩系柔和圆角）。
   渐变调淡后色带同步减轻（不透明度 .85 → .6），避免"淡底 + 重带"的失衡。 */
.pagehead::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 64px; height: 3px; border-radius: 0 0 var(--r-full) var(--r-full);
  background: var(--head-hue); opacity: .6;
}
/* 逐功能的页头色：以色相族为基准做温和偏移（色相 ≤±18°、明度 ≤±0.03）。
   同族内保持"是一家"，跨族明显不同；15 个功能各不相同。对比度已逐项验算达标。 */
body[data-tool="pattern-extract"]    .pagehead { --head-hue: #c2274f; }
body[data-tool="print-post"]         .pagehead { --head-hue: #d61f69; }
body[data-tool="seamless-tile"]      .pagehead { --head-hue: #a03dc0; }
body[data-tool="vector-convert"]     .pagehead { --head-hue: #3b5bdb; }
body[data-tool="image-to-cad"]       .pagehead { --head-hue: #5331bd; }
body[data-tool="superscale"]         .pagehead { --head-hue: #0a8570; }
body[data-tool="photo-restore"]      .pagehead { --head-hue: #0c8557; }
body[data-tool="id-photo"]           .pagehead { --head-hue: #2b8a3e; }
body[data-tool="faceswap"]           .pagehead { --head-hue: #0c8599; }
body[data-tool="enhance"]            .pagehead { --head-hue: #1098ad; }
body[data-tool="image-upscale"]      .pagehead { --head-hue: #c92a0f; }
body[data-tool="remove-bg"]          .pagehead { --head-hue: #d96f04; }
body[data-tool="remove-object"]      .pagehead { --head-hue: #7a2ebe; }
body[data-tool="compress"]           .pagehead { --head-hue: #b032d4; }
body[data-tool="convert"]            .pagehead { --head-hue: #5a3ee0; }
/* 居中后标题容器放宽一些，避免副标题比原来多折一行、把页头撑高 */
.pagehead__title { max-width: 68ch; margin-inline: auto; }
/* h1 用 inline-block：宽度跟随内容（文字），配合父级 text-align:center 让"文字"本身居中；
   给色点 .huedot--lg 提供定位上下文（色点相对文字左缘定位，而非 h1 块左缘）。
   若用 block，h1 撑满 68ch 父容器，绝对定位的色点会被甩到容器最左缘，离文字很远。 */
.pagehead__title h1 { font-size: var(--t-h1); position: relative; display: inline-block; font-weight: 800; }
/* 副标 / 批量入口链接：恢复 margin-inline: auto（reset 里 `p { max-width: 68ch; margin: 0 0 g4 }`
   会把页头里所有 <p> 的 inline 居中清掉，导致副标贴容器左缘、视觉中心偏左 20px） */
.pagehead__title p { margin-top: 6px; margin-inline: auto; font-size: var(--t-sm); color: var(--ink-2); }
/* 页头整体高度上限：窄屏或矮屏时进一步压缩 */
@media (max-height: 860px) {
  .pagehead { padding-block: var(--g4) var(--g3); }
  .pagehead__title h1 { font-size: var(--t-h2); }
}

/* 证件美化（id-photo）版心单独收窄：只影响本页主体内容，其他工具页保持 1240px；
   用 main .wrap 限定，避免把本页顶栏/页脚的 1240px 版心一起收窄导致与全局对不齐。
   宽度对齐源站 max-w-6xl（工具内容 1152px）：.wrap 带 24px 左右内边距（border-box），
   盒宽 1200px → 内容 1152px，与源站工具区等宽。 */
body[data-tool="id-photo"] main .wrap { max-width: 1200px; }

/* 证件美化：对齐源站 max-w-6xl(1152px) 内的 3:2 分栏 + gap-8(32px)。
   源站工具区为 flex-[3]:flex-[2]（预览 60% : 参数 40%），此处覆盖参数在右布局的默认 400–520px 固定栏。
   限定 ≥1001px，窄屏仍走单列折叠（否则 3fr/2fr 会压过 ≤1000px 的单列规则）。 */
@media (min-width: 1001px) {
  body[data-tool="id-photo"] .toolgrid--params-right { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 32px; }
}

/* 证件美化（id-photo）页头再收矮一档：仅普通高度屏生效，
   矮屏/单列紧凑模式（≤860px）保留其更激进的 8px/6px 压缩，不冲突 */
@media (min-height: 861px) {
  body[data-tool="id-photo"] .pagehead { padding-block: var(--g3) var(--g2); }
}

/* ---------- 工作区栅格（参数栏 + 预览） ---------- */

.toolgrid { display: grid; gap: var(--g5); align-items: start; }
.toolgrid--params-left { grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); }
.toolgrid--params-right { grid-template-columns: minmax(0, 1fr) minmax(400px, 520px); }
.toolgrid--wide-left { grid-template-columns: minmax(320px, 380px) minmax(0, 1fr); }
.toolgrid--narrow { grid-template-columns: 240px minmax(0, 1fr) 210px; }
/* 四方连续：右侧历史记录收窄，把空间让给中间的接缝预览 */
.toolgrid--seamless { grid-template-columns: minmax(240px, 280px) minmax(0, 1fr) minmax(200px, 240px); }
/* 双栏下限压到 1000px：1048 宽的小展示屏仍保持「参数在左、预览在右」，
   不会因为退化成单列而把预览挤到屏外（见「矮屏紧凑模式」）。
   单列用 minmax(0, 1fr)：否则面板内元素的最小内容宽度会把栅格项撑破视口（390 窄屏曾因此横向溢出）。 */
/* 参数在右（上传/预览在左）：DOM 仍按「参数在前、预览在后」，仅双栏时用 order 对调视觉顺序；
   单列（≤1000px）保持 DOM 顺序，让含上传框的参数面板在预览上方。 */
@media (min-width: 1001px) {
  .toolgrid--params-right > :first-child { order: 2; }
  .toolgrid--params-right > :last-child { order: 1; }
}
@media (max-width: 1000px) {
  .toolgrid--params-left, .toolgrid--params-right, .toolgrid--wide-left { grid-template-columns: minmax(0, 1fr); }
  .toolgrid--narrow, .toolgrid--seamless { grid-template-columns: minmax(0, 1fr); }
}

/* 图案提取的三栏：整体等高，右栏「处理后将显示结果」与中间的两张对照图齐高，
   避免右栏空盒子比左边的图矮一截。 */
@media (min-width: 1001px) {
  .toolgrid--narrow { align-items: stretch; }
  .toolgrid--narrow > div:last-child { display: flex; flex-direction: column; }
  .toolgrid--narrow > div:last-child > .panel { flex: 1 1 auto; height: 100%; min-height: 0; }
  /* 中间列高度即基准：参数栏与右栏都跟着它，三栏底部对齐 */
  .toolgrid--narrow > div > .sidepanel { height: 100%; }
  /* 上传框吃掉参数栏剩余高度，与右侧图片对齐（下拉等控件保持自然高度）。
     body 也必须 flex:1 且 min-height:0，否则 body 会按内容撑高、上传框吃不到剩余空间；
     field 的上下内边距也收掉，让上传框真正顶到面板可用区的上下两端。 */
  .toolgrid--narrow .sidepanel__body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  .toolgrid--narrow .field--upload { flex: 1 1 auto; display: flex; flex-direction: column; padding-block: 0; }
  .toolgrid--narrow .field--upload .dropzone { flex: 1 1 auto; min-height: 120px; align-content: center; }
  .toolgrid--narrow .field--upload .dropzone__body { align-self: center; }
}

/* 上传拖拽区铺满参数栏的空余位置（所有功能页）：
   参数栏与右侧栏等高（栅格 stretch），参数区用 flex 列，上传字段 flex:1 吸收剩余高度，
   其余控件保持自然高度。此前上传框只有 60–100px 高、下方留一大片空白，面板显得单薄。 */
@media (min-width: 1001px) {
  .toolgrid { align-items: stretch; }
  .toolgrid > div:first-child,
  .toolcenter > div:first-child { display: flex; flex-direction: column; }
  .toolgrid > div:first-child > .sidepanel,
  .toolcenter > .sidepanel { flex: 1 1 auto; display: flex; flex-direction: column; }
  .sidepanel__body { flex: 1 1 auto; display: flex; flex-direction: column; }
  .sidepanel .field--upload { flex: 1 1 auto; display: flex; flex-direction: column; }
  .sidepanel .field--upload .dropzone { flex: 1 1 auto; min-height: 96px}
  .sidepanel .field--upload .dropzone__body { align-self: center; }
  .sidepanel--upload-only .dropzone__ico { width: 48px; height: 48px; }
  .sidepanel--upload-only .dropzone__ico svg { width: 24px; height: 24px; }
  /* 参数在右布局：左列上传框填满整列高度，与右侧参数面板等高 */
  .toolgrid--params-right > :last-child { display: flex; flex-direction: column; }
  .toolgrid--params-right .field--upload { flex: 1 1 auto; display: flex; flex-direction: column; }
  .toolgrid--params-right .field--upload .dropzone { flex: 1 1 auto; }
}

/* ---------- 矮屏紧凑模式 ----------
   面向 1048×580 这类「宽但矮」的展示屏：参数块与预览块必须在第一屏内完整可见。
   只在够宽能双栏时启用（窄屏仍是单列自然滚动，不强行塞进一屏）。
   做法：页头压到一行、参数控件的说明性副行让位、内边距整体再收一档。 */
@media (min-width: 1001px) and (max-height: 680px) {
  /* 顶栏一并压矮：--topbar-h 同时被参数面板与预览块的最小高度引用，改一处全局生效 */
  :root { --topbar-h: 54px; }
  .brand__glyph { width: 32px; height: 32px; }
  .pagehead { padding-block: 8px 6px; }
  .pagehead__title h1 { font-size: var(--t-h3); }
  .pagehead__title p { font-size: var(--t-min); margin-top: 2px; }
  /* 参数面板整体再压一档 */
  .sidepanel__head { padding: 8px var(--g4) 0; }
  .sidepanel__body { padding: 4px var(--g4) 4px; }
  .sidepanel__foot { padding: 8px var(--g4) 10px; }
  .sidepanel .field { padding-block: 6px; }
  .sidepanel .field--upload { padding-block: 0 6px; }
  /* 展示屏（1048×580 一类）余量极小：再收一点字段与脚部的纵向间距，
     否则印花后期／证件美化的提交按钮会差几像素落到首屏外。 */
  .sidepanel .field { padding-block: 4px; }
  .sidepanel .field--upload { padding-block: 0 4px; }
  .sidepanel__foot { padding: 6px var(--g4) 8px; }
  /* 标签与控件并排：省下每个字段独立的一行标签（约 28px/字段），控件仍完整可点 */
  .sidepanel .field {
    display: grid; grid-template-columns: minmax(60px, auto) minmax(0, 1fr);
    align-items: center; column-gap: 10px;
  }
  .sidepanel .field:not(:has(.field__top)) { grid-template-columns: minmax(0, 1fr); }
  .sidepanel .field__top { margin-bottom: 0; align-items: center; }
  .sidepanel .field__hint { display: none; }
  .sidepanel .field__label { font-size: var(--t-min); line-height: 1.3; }
  /* 证件美的换装卡：矮屏下缩到一行 34px、名称让位，靠横向滚动访问其余 */
  .sidepanel .cardpick__grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 34px; }
  .sidepanel .cardpick__tabs { margin-bottom: 3px; }
  .sidepanel .cardpick__tab { padding: 2px 10px; font-size: 10px; }
  .sidepanel .cardpick__name { display: none; }
  /* 色块：矮屏下只留色点 + 名称，压缩到一行 */
  .sidepanel .swatchbtn { padding: 3px 8px 3px 5px; }
  .sidepanel .swatchbtn__dot { width: 14px; height: 14px; }
  /* 滑杆：标签+数值挤成窄列（不折行），滑块占主宽，刻度与说明让位（每根约 34px） */
  .sidepanel .field--slider { padding-block: 3px; display: block; }
  .sidepanel .field--slider .slider-field { display: flex; align-items: center; gap: 10px; }
  .sidepanel .field--slider .slider-field__top {
    flex: none; width: auto; max-width: 108px; flex-direction: column;
    align-items: flex-start; gap: 0; margin-bottom: 0;
  }
  .sidepanel .field--slider .field__label { white-space: nowrap; }
  .sidepanel .field--slider .slider-field__out { margin-left: 0; font-size: var(--t-min); }
  .sidepanel .field--slider .slider-field__foot { display: none; }
  .sidepanel .field--slider .slider { flex: 1 1 auto; min-width: 0; }
  .sidepanel .slider-field__scale { display: none; }
  /* 分段：说明性副行让位，标签与积分并成一行，控件从约 120px 收到约 46px */
  .sidepanel .seg__btn { flex-direction: row; align-items: center; gap: var(--g2); padding: 5px 8px; border-radius: var(--r-md); }
  .sidepanel .seg__b, .sidepanel .seg__d { display: none; }
  .sidepanel .seg__badge { position: static; order: 3; }
  .sidepanel .seg__l { font-size: var(--t-min); }
  .sidepanel .seg__time { margin-left: auto; }
  /* 例外：并列「分辨率 + 积分 + 耗时」三段的（超清放大的目标分辨率）在矮屏也保持
     **上中下三行**——横排会把「15 积分」压成十几像素并折行，比竖排更难读。 */
  .sidepanel .seg__btn:has(.seg__cost):has(.seg__time) {
    flex-direction: column; align-items: stretch; gap: 1px; padding: 7px 10px 6px;
  }
  .sidepanel .seg__btn:has(.seg__cost):has(.seg__time) .seg__l { font-size: var(--t-body); }
  .sidepanel .seg__btn:has(.seg__cost):has(.seg__time) .seg__time { margin-left: 0; }
  .sidepanel .dropzone { padding: 7px 12px; }
  .sidepanel .dropzone__ico { width: 28px; height: 28px; }
  .sidepanel .dropzone__h { display: none; }
  .sidepanel .pickbtn { min-height: 32px; }
  .sidepanel .slider { height: 16px; }
  .sidepanel .area { height: 32px; }
  .sidepanel .readout__total { padding: 5px 10px; }
  .sidepanel .btn { min-height: 38px; }
  /* 预览块：按矮屏剩余高度定上限，和参数块一起落在第一屏 */
  .toolgrid .panel--out { min-height: min(420px, calc(100vh - var(--topbar-h) - 96px - var(--g5))); }
}

/* ---------- 单列紧凑模式（≤1000px，参数与预览上下堆叠） ----------
   单列时「参数块 + 预览块」纵向排开，参数多的页（印花后期 5 个字段等）提交按钮会落到首屏外
   （1000×700 实测：印花后期面板 596px，超 72px）。但单列的面板是**全宽**（约 950px），
   横向空间很充裕，因此复用双栏矮屏那套「标签在左、控件在右」——每个字段省掉一整行标签
   （约 22px/字段），并把分段/滑杆的说明副行让位。只在视口**较矮**时启用（≤820px），
   高视口保留舒展的堆叠排版，不无谓压缩。 */
@media (max-width: 1000px) and (max-height: 820px) {
  .pagehead { padding-block: 8px 6px; }
  .pagehead__title h1 { font-size: var(--t-h2); }
  .pagehead__title p { font-size: var(--t-min); margin-top: 2px; }
  .sidepanel__head { padding: 8px var(--g4) 0; }
  .sidepanel__body { padding: 4px var(--g4) 4px; }
  .sidepanel__foot { padding: 8px var(--g4) 10px; }
  .sidepanel .field { padding-block: 6px; }
  .sidepanel .field--upload { padding-block: 0 6px; }
  /* 标签与控件并排：省下每个字段独立的一行标签 */
  .sidepanel .field {
    display: grid; grid-template-columns: minmax(72px, auto) minmax(0, 1fr);
    align-items: center; column-gap: 12px;
  }
  .sidepanel .field:not(:has(.field__top)) { grid-template-columns: minmax(0, 1fr); }
  .sidepanel .field__top { margin-bottom: 0; align-items: center; }
  .sidepanel .field__label { font-size: var(--t-min); line-height: 1.3; }
  .sidepanel .field__hint { display: none; }
  /* 长文本字段（局部去除、滑杆刻度说明）让位，仍可交互 */
  .sidepanel .field--slider { padding-block: 3px; display: block; }
  .sidepanel .field--slider .slider-field { display: flex; align-items: center; gap: 10px; }
  .sidepanel .field--slider .slider-field__top {
    flex: none; width: auto; max-width: 118px; flex-direction: column;
    align-items: flex-start; gap: 0; margin-bottom: 0;
  }
  .sidepanel .field--slider .field__label { white-space: nowrap; }
  .sidepanel .field--slider .slider-field__out { margin-left: 0; font-size: var(--t-min); }
  .sidepanel .field--slider .slider-field__foot { display: none; }
  .sidepanel .field--slider .slider { flex: 1 1 auto; min-width: 0; }
  .sidepanel .slider-field__scale { display: none; }
  /* 分段：说明性副行让位（与双栏矮屏同一套），但「分辨率+积分+耗时」保持竖排三行 */
  .sidepanel .seg__btn { flex-direction: row; align-items: center; gap: var(--g2); padding: 6px 10px; border-radius: var(--r-md); }
  .sidepanel .seg__b, .sidepanel .seg__d { display: none; }
  .sidepanel .seg__badge { position: static; order: 3; }
  .sidepanel .seg__time { margin-left: auto; }
  .sidepanel .seg__btn:has(.seg__cost):has(.seg__time) {
    flex-direction: column; align-items: stretch; gap: 1px; padding: 7px 10px 6px;
  }
  .sidepanel .seg__btn:has(.seg__cost):has(.seg__time) .seg__time { margin-left: 0; }
  /* 证件的换装卡、色块压缩到一行 */
  .sidepanel .cardpick__grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 40px; }
  .sidepanel .cardpick__name { display: none; }
  .sidepanel .swatchbtn { padding: 4px 10px 4px 6px; }
  .sidepanel .dropzone { padding: 8px 12px; }
  .sidepanel .dropzone__h { display: none; }
  .sidepanel .pickbtn { min-height: 34px; }
  .sidepanel .readout__total { padding: 6px 10px; }
  /* 半宽字段仍两两并排，纵向更省 */
  .sidepanel .fieldrow > .field { padding-block: 6px; }
}

/* 主输出面板（预览 / 结果 / 接缝预览，标 .panel--out）给一个「首屏内可见高度」的最小高度：
   参数多的页面里预览不会缩成一小块、右下角留下大片空白；任务栏等后续面板保持自然高度。
   （不要用 :first-of-type —— 两个面板同为 <section>，会把任务栏一起撑高并叠加。） */
.toolgrid .panel--out {
  min-height: min(600px, calc(100vh - var(--topbar-h) - 140px - var(--g5)));
  display: flex; flex-direction: column;
}
.toolgrid .panel--out > .panel__body {
  flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0;
}
/* 预览画面填满面板（覆盖式，避免拉高后上下留白）；用直接子选择器，不波及候选缩略图与其它内嵌图 */
.toolgrid .compare,
.toolgrid .comparewrap,
.toolgrid .seampreview { flex: 1 1 auto; min-height: 0; }
.toolgrid .emptybox { flex: 1 1 auto; align-content: center; }
.toolgrid .compare__stage { flex: 1 1 auto; aspect-ratio: 16 / 10; min-height: 240px; }
/* 只作用于并排预览的主图（直接子选择器）；候选缩略图 .picks__row .pick img（56px）不受影响 */
.toolgrid .comparewrap__side > img { aspect-ratio: auto; height: 100%; min-height: 240px; }
.toolgrid .seampreview__side > img { aspect-ratio: auto; height: 100%; min-height: 240px; }
/* 窄屏：min-height 与 aspect-ratio 的组合会强制推出一个大于视口的最小宽度（390 视口下溢出），
   此时回到自然比例、去掉最小高度 */
@media (max-width: 700px) {
  .toolgrid .compare__stage { aspect-ratio: auto; min-height: 0; }
  .toolgrid .compare__stage > img,
  .toolgrid .compare__after img { height: auto; }
  .toolgrid .comparewrap__side > img,
  .toolgrid .seampreview__side > img { min-height: 0; height: auto; }
}

/* ---------- 参数面板：紧凑排版，整块随页面滚动（韩系风格：大圆角、细腻阴影） ----------
   增强视觉突出性：功能色相边框 + 渐变背景 + 光晕，让操作区成为页面视觉焦点。 */

/* 两版走过的弯路，记录在此以免回退：
   ① 视口内滚动容器（max-height + overflow:hidden）：下拉弹层被裁（"选不动"），矮视口可见区只剩
      约 200px（"不直观"）；
   ② 提交栏 sticky 浮在视口底部：浮层压住参数，用户以为下面没有参数了（"无法知道下面还有参数"）。
   现在的做法是**把面板本身压缩到能在首屏看全**，提交按钮就在面板自然底部，不浮、不遮。 */
.sidepanel {
  display: flex; flex-direction: column;
  min-width: 0;   /* 防止面板内控件的最小内容宽度把面板/栅格项撑破视口 */
  background: var(--surface);
  /* 功能色相左边框：该功能的主色相作为视觉锚点 */
  border: 1px solid var(--line);
  border-left: 4px solid var(--ln);
  border-radius: var(--r-xl);
  /* 多层阴影：底层柔和扩散 + 表层功能色相光晕 */
  box-shadow: var(--sh-3), 0 0 20px -4px color-mix(in srgb, var(--ln) 25%, transparent);
  /* 参数区是密集功能区，字号整体收一档（正文 15→14、说明 13→12）；--t-min 保持 12px 标签下限 */
  --t-body: 0.875rem;
  --t-sm: 0.8125rem;
  --t-xs: 0.75rem;
  --t-min: 0.75rem;
}
/* 参数面板头部：极淡的功能色相渐变背景，与边框呼应 */
.sidepanel__head {
  display: flex; align-items: baseline; gap: var(--g3);
  padding: var(--g3) var(--g4) var(--g2);
  background: linear-gradient(135deg, color-mix(in srgb, var(--ln) 8%, transparent) 0%, transparent 100%);
  border-bottom: 1px solid var(--line);
  border-radius: calc(var(--r-xl) - 1px) calc(var(--r-xl) - 1px) 0 0;
}
/* 视觉顺序：**标题 → 灰色提示 → 使用教程链接**（CSS 重排，DOM 不动）。
   此前 DOM 是「title → tut → hint」，"使用教程"夹在标题与提示之间、切断了
   标题与它的说明之间的语义连续性。CSS order 不动 HTML，15 页全站生效，
   无 hint 的页（8 页）顺序保持不变（order 只在存在元素间起作用）。 */
.sidepanel__title { order: 1; font-size: var(--t-body); font-weight: 700; color: var(--ink); }
.sidepanel__hint  { order: 2; font-size: var(--t-min); color: var(--ink-3); text-align: right; }
/* 参数面板头部右侧的「使用教程」入口：与标题同行（head 已是 flex 行），
   **不增加垂直高度**——避免页头再叠一行把矮屏的提交按钮挤出首屏。
   order:3 + 上一项 hint 缺 margin-left:auto、本项带 margin-left:auto ——
   「使用教程」永远是这一行**最右**那枚，"操作"与"说明"分离。 */
.sidepanel__tut {
  order: 3; margin-left: auto; flex: none;
  font-size: var(--t-min); font-weight: 600;
  color: var(--ln-deep); white-space: nowrap;
  padding: 4px 10px; border-radius: var(--r-full);
  background: var(--ln-tint);
}
.sidepanel__tut:hover { text-decoration: none; background: var(--ln); color: #fff; }
.sidepanel__tut span { font-weight: 400; }
.sidepanel__body { padding: var(--g3) var(--g4) var(--g4); }
/* 脚部：一行消耗 + 提交按钮，整块不浮动（浮层会压住参数、让用户以为下面没有内容）。
   **与上方内容区之间要有留白**：此前 body 底 6px + foot 顶 10px，靠一条 hairline 分隔，
   上传大框与下面的消耗/按钮看起来像贴在一起（实测 body→foot 间隙 0px）。
   这里把 foot 顶部内边距加到 16px，并让分隔线与内容拉开距离。 */
.sidepanel__foot {
  padding: 16px var(--g4) var(--g3);
  border-top: 1px solid var(--line);
  background: var(--surface);
  border-radius: 0 0 calc(var(--r-xl) - 1px) calc(var(--r-xl) - 1px);
}
.sidepanel__act { display: grid; gap: var(--g2); }
.sidepanel__act .sidepanel__cost { flex: none; }
.sidepanel__act .readout { border-radius: var(--r-sm); }
.sidepanel__act .readout__total { padding: 7px 11px; }
.sidepanel__flow { margin-top: var(--g2); }
.sidepanel--wide .sidepanel__body { padding: var(--g2) var(--g4) var(--g3); }

/* 面板内的密度：字段与控件的纵向留白收紧（只作用于参数面板，不影响其他页面的同名构件） */
.sidepanel .field { padding-block: 10px; }
.sidepanel .field--upload { padding-block: 2px 10px;border:0px}
/* 上传框与紧随其后的说明（「本功能无需选择参数…」）之间要有空隙：
   此前紧贴（实测 0px），上传大框下方直接顶着一行小字，观感像同一块。 */
.sidepanel__body > .note { margin-top: var(--g3); }

.sidepanel .field__top { margin-bottom: 6px; }
.sidepanel .field__hint { max-width: 30ch; }
.sidepanel .seg__btn { padding: 8px 11px; gap: 1px; }
/* 并排半宽里的 3/4 列分段：只放短标签（如「2 张」），左右内边距再收一点 */
.sidepanel .fieldrow .seg--3 .seg__btn,
.sidepanel .fieldrow .seg--4 .seg__btn { padding: 8px 9px; }
.sidepanel .seg__b, .sidepanel .seg__d { line-height: 1.35; }
.sidepanel .pickbtn { min-height: 36px; padding: 0 12px; }
.sidepanel .swatchbtn { padding: 4px 10px 4px 6px; }
.sidepanel .swatchbtn__dot { width: 16px; height: 16px; }
.sidepanel .cardpick__tabs { margin-bottom: 6px; }
.sidepanel .cardpick__tab { padding: 4px 14px; }
/* 换装卡在参数面板内改为多行网格：示例图不再单行横向滚动，
   15 张卡按 5 列铺成 3 行，一眼可见更多款式（对齐源站小门道） */
.sidepanel .cardpick__grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px;
}
.sidepanel .cardpick__item img,
.sidepanel .cardpick__none { aspect-ratio: 3/4; }
.sidepanel .cardpick__name { padding: 2px 3px; font-size: 10px; }
/* 单列布局时参数面板变宽，仍 5 列铺排 */
@media (max-width: 1000px) {
  .sidepanel .cardpick__grid { grid-template-columns: repeat(5, 1fr); }
}
.sidepanel .dropzone { padding: 10px var(--g4); gap: 5px; grid-template-columns: auto minmax(0, 1fr); text-align: left; }
.sidepanel .dropzone__ico { width: 34px; height: 34px; grid-row: span 1; }
.sidepanel .dropzone__ico svg { width: 17px; height: 17px; }
.sidepanel .dropzone__body { display: grid; gap: 2px; min-width: 0; }
/* 格式限制是长文本，收成 10px 一行，避免把上传框撑成三四行 */
.sidepanel .dropzone__h { max-width: none; font-size: 10px; line-height: 1.45; }
.sidepanel .dropzone--square, .sidepanel .dropzone--tall { grid-template-columns: 1fr; text-align: center; }
.sidepanel .dropzone--square .dropzone__body, .sidepanel .dropzone--tall .dropzone__body { justify-items: center; }
.sidepanel .note { font-size: var(--t-min); }
.sidepanel .area { min-height: 0; height: 40px; }

/* 滑杆：标签与数值同一行，刻度与说明同一行 —— 每个滑杆从 143px 收到约 88px */
.sidepanel .field--slider { padding-block: 6px; }
.sidepanel .slider-field__top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--g3); margin-bottom: 1px; }
.sidepanel .slider-field__out { margin-left: auto; font-size: var(--t-sm); }
.sidepanel .slider-field__foot { display: flex; align-items: baseline; justify-content: space-between; gap: var(--g3); margin-top: 0; }
.sidepanel .slider-field__scale { display: flex; gap: var(--g3); flex: none; font-size: 10px; }
.sidepanel .slider-field__hint { margin-top: 0; font-size: 10px; text-align: right; }
.sidepanel .slider { height: 18px; }
/* 半宽字段并排（证件美的尺寸 + 美颜强度；印花后期的分辨率 + 出图数量） */
.sidepanel .fieldrow { display: flex; gap: var(--g3); align-items: flex-start; }
.sidepanel .fieldrow > .field { flex: 1 1 0; min-width: 0; padding-block: 10px; }
/* 并排时按分段列数分配宽度：3 列的分段比 2 列的需要更多横向空间，
   否则 3 列那组被压到每个按钮仅约 50px、右边缘顶到面板边框（印花后期的「出图数量」）。 */
.sidepanel .fieldrow > .field:has(.seg--3) { flex: 3 1 0; }
.sidepanel .fieldrow > .field:has(.seg--2) { flex: 2 1 0; }

/* 参数很少（只有上传区）的功能：上传框横向占满参数栏、纵向拉伸到与右侧预览块等高，
   否则左侧只有一个小方框、右侧一张大图，比例失衡。
   左右留白取 --g2（8px）：上传框是一种"表面"（well），按本站的 Figma color-block 传统
   可比文字内容列更外扩一点——贴着面板边框（0px）会局促、没有呼吸，与文字同列（16px）又显得收窄。
   8px 既有明确的呼吸，又保持"占满参数栏"的体量。 */
@media (min-width: 1001px) {
  .sidepanel--upload-only { height: 100%; }
  .sidepanel--upload-only .sidepanel__body {
    flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
    align-items: stretch;   /* 覆盖矮屏紧凑模式给 .field 设的 align-items:center，否则上传框按内容宽收缩 */
    padding-inline: var(--g2);   /* 面板边框之外留 8px 呼吸 */
  }
  .sidepanel--upload-only .field--upload {
    flex: 1 1 auto; align-items: stretch; width: 100%;
    display: flex; flex-direction: column; padding: 0;
  }
  .sidepanel--upload-only .field--upload .dropzone { flex: 1 1 auto; width: 100%; min-height: 200px; align-content: center; }
  .sidepanel--upload-only .field--upload .dropzone__body { align-self: center; }
  .sidepanel--upload-only .dropzone__ico { width: 48px; height: 48px; }
  .sidepanel--upload-only .dropzone__ico svg { width: 24px; height: 24px; }
}
/* 居中单栏的同类页面（抠图 / 魔法抹除 / 压缩）：上传框也给足高度，不要压成一条 */
.toolcenter .sidepanel--upload-only .dropzone { min-height: 260px; }

/* 上传字段的纵向内边距在「面板内 flex 列」里必须归零：
   否则上传框吃不到这 12px，下方留出一条空白（图案提取尤其明显）。
   放在此处（文件后段）以覆盖前面 .sidepanel .field--upload 的 padding-block。 */
@media (min-width: 1001px) {
  .sidepanel .field--upload:has(.dropzone) { padding-block: 0; }
  /* 上传字段在纵向 flex 里横向撑满：矮屏紧凑模式给 .field 设了 align-items:center
     （为「标签+控件并排」而设），会让上传框按内容宽收缩、左右留白。 */
  .sidepanel .field--upload { align-items: stretch; }
  /* 上传框后的文件行容器：空时不占高，避免在等高的面板里留出 8px 空档 */
  .sidepanel .field--upload .mt-2:empty { display: none; }
}

/* ---------- 预览（处理前 / 处理后，韩系风格：圆角、柔和阴影） ---------- */

.preview .panel__body { padding: var(--g4); }
.comparewrap { display: grid; grid-template-columns: 1fr 1fr; gap: var(--g3); }
@media (max-width: 620px) { .comparewrap { grid-template-columns: 1fr; } }
.comparewrap__side { position: relative; border-radius: var(--r-lg); overflow: hidden; background: var(--well); }
.comparewrap__side img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.comparewrap__tag {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  padding: 4px 10px; border-radius: var(--r-full);
  background: var(--scrim); color: #fff;
  font-size: var(--t-min); font-weight: 600;
  backdrop-filter: blur(4px);
}
.comparewrap__tag--r { left: auto; right: 10px; }
.comparewrap__acts {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  display: flex; gap: var(--g2);
}
.comparewrap__acts .btn { background: rgba(255,255,255,.92); }

/* 预览区的三个操作按钮：**浮动在对比块右上角**（不占额外高度、不挤压布局）。
   舞台宽度已撑满面板内容区（见下）；`right/top` 需叠加面板内边距，
   才能与舞台右缘、上缘对齐（否则会偏出 6px）。 */
.preview .panel__body,
.panel__body:has(> [data-local-results] > .previewacts) { position: relative; }
.previewacts {
  position: absolute; z-index: 3;
  top: calc(var(--g4) + 10px); right: calc(var(--g4) + 10px);
  display: flex; align-items: center; gap: var(--g2); flex-wrap: wrap;
  justify-content: flex-end;
}
.previewacts .btn { background: rgba(255, 255, 255, .92); backdrop-filter: blur(4px); }
/* 魔法抹除：按钮在 [data-local-results] 内（该层无内边距），偏移量回落到 10px */
.panel__body > [data-local-results] > .previewacts {
  top: 10px; right: 10px;
}
/* 拖动预览块：与面板同宽、铺满面板内容区的可用高度。
   历史：用 aspect-ratio 时 `max-height` 会把宽度一起压窄（16:10 × 420px → 宽只剩 672px），
   按钮相对面板定位就会超出图片右缘。
   现在：面板 `min-height` 保证首屏可见 → body flex 列 → compare `flex:1` 吃掉剩余高度
   → stage 再撑满 compare，compare 内部不留空白带。
   矮屏保护：compare 的 `max-height` 用视口推算，保证提交按钮仍在首屏内
   （不设上限时实测 FOLD_FAILS 25）。 */
.preview .panel__body { display: flex; flex-direction: column; }
.preview .compare {
  border-radius: var(--r-lg); width: 100%;
  flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0;
  max-height: calc(100vh - var(--topbar-h) - 60px);
}
.preview .compare__stage {
  width: 100%; aspect-ratio: auto;
  flex: 1 1 auto; min-height: 240px;
  max-height: none;
}
/* 对比块本身的定位上下文：按钮相对它定位后，right:10px 即贴着图片右缘 */
.preview .compare,
.panel__body > [data-local-results] { position: relative; }

.picks--float {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  padding: 10px;
  background: rgba(255,255,255,.95);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  backdrop-filter: blur(6px);
}
.picks__row { display: flex; gap: var(--g2); justify-content: center; }
/* 候选：圆角方形缩略图（不是长条） */
.picks__row .pick {
  flex: none; width: 56px; height: 56px;
  border-radius: var(--r-md); overflow: hidden;
  border: 1px solid var(--line); background: var(--well); cursor: pointer; padding: 0;
}
@media (max-width: 1048px) {.picks__row .pick {flex: none; width: 40px!important;height: 40px!important}}
.picks__row .pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.picks__row .pick.is-on { border-color: var(--brand-deep); box-shadow: 0 0 0 2px var(--brand-tint); }

/* 静态候选（特色元素内） */
.picks { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--g3); }
.picks .pick { border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); background: var(--well); }
.picks .pick img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.picks .pick.is-on { border-color: var(--brand-deep); box-shadow: 0 0 0 2px var(--brand-tint); }
.pick__cap { display: flex; justify-content: space-between; padding: 7px 10px; font-size: var(--t-min); color: var(--ink-3); background: var(--surface); }

/* 接缝预览（四方连续）
   编辑模式只显示「原图接缝预览」一张，对比模式才并排两张。
   **编辑模式下单图铺满整个容器**（原先它只占两列网格的一半、右边留空）：
   用 :has() 判断可见张数，只有一张时切成单列；对比模式仍是两列。
   高度沿用上面 `.toolgrid .seampreview__side > img { height:100% }` 的填满规则。 */
.seampreview { display: grid; grid-template-columns: 1fr 1fr; gap: var(--g3); }
.seampreview:not(:has(.seampreview__side:not([hidden]) + .seampreview__side:not([hidden]))) {
  grid-template-columns: minmax(0, 1fr);
}
.seampreview__side { position: relative; border-radius: var(--r-md); overflow: hidden; background: var(--well); }
.seampreview__side img { width: 100%; aspect-ratio: 4/3; object-fit: contain; }
/* 编辑模式单图：对齐 mengxinsvg 源站形态——整张接缝图完整显示（contain，两侧留井色空白，
   不裁切、能看到完整接缝），高度跟容器走并封顶，避免 1:1 素材把面板撑到 700px+ 导致
   矮屏下提交按钮掉出首屏。上限给容器比给 img 的 max-height 更可靠。 */
.seampreview:not(:has(.seampreview__side:not([hidden]) + .seampreview__side:not([hidden])))
  .seampreview__side:not([hidden]) {
  max-height: min(558px, calc(100vh - var(--topbar-h) - 240px));
}
.seampreview:not(:has(.seampreview__side:not([hidden]) + .seampreview__side:not([hidden])))
  .seampreview__side:not([hidden]) img {
  aspect-ratio: auto;
  object-fit: contain;
}

/* ---------- 四方连续 · 右侧历史记录列表 ----------
   服务端渲染（image_record 最近 20 条），刷新后仍在；转换成功时前端把新结果
   prepend 到列表顶部（renderSeamless）。面板头部「全部」链到 /record/all 完整列表。 */
.panel__more {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--t-xs); font-weight: 600; color: var(--ink-3); text-decoration: none;
}
.panel__more:hover { color: var(--brand-deep); }
.panel__more span { transition: transform var(--d2) var(--ease); }
.panel__more:hover span { transform: translateX(2px); }

/* 状态徽章补充（成功/中性在 blocks.css，这里补失败/处理中两档，与 record/all_new 一致） */
.badge--fail { background: #FEE2E2; color: var(--danger-deep); }
.badge--wait { background: #FEF3C7; color: #B45309; }

.histlist {
  display: flex; flex-direction: column;
  max-height: min(620px, calc(100vh - var(--topbar-h) - 220px));
  overflow-y: auto;
}
.hist {
  display: flex; align-items: center; gap: var(--g3);
  padding: var(--g2) var(--g3);
  border-radius: var(--r-md);
}
.hist:hover { background: var(--sunk); }
.hist + .hist { border-top: 1px dashed var(--line); }
.hist__thumb {
  flex: none; width: 44px; height: 44px; border-radius: var(--r-sm);
  overflow: hidden; background: var(--well);
  display: flex; align-items: center; justify-content: center; color: var(--ink-3);
}
.hist__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hist__thumb svg { width: 20px; height: 20px; }
.hist__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hist__t {
  font-size: var(--t-sm); font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hist__meta { display: flex; align-items: center; flex-wrap: wrap; gap: var(--g2); font-size: var(--t-min); color: var(--ink-3); }
.hist__meta .badge { padding: 2px 8px; font-size: 10px; }
.hist__time { font-variant-numeric: tabular-nums; }
.hist__dl {
  flex: none; font-size: var(--t-xs); font-weight: 700; color: var(--brand-deep);
  text-decoration: none; padding: 5px 10px; border-radius: var(--r-sm); background: var(--brand-tint);
}
.hist__dl:hover { background: var(--well); }
/* 刚转换完成、前端 prepend 的新条目：高亮淡入，让用户一眼看到最新结果 */
.hist.is-new { animation: hist-in var(--d4) var(--ease-enter) both; background: var(--brand-tint); }
@keyframes hist-in { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- 空结果区（韩系风格：功能色相提示） ---------- */

.emptybox {
  display: grid; place-items: center; gap: var(--g3); padding: var(--g9) var(--g5); text-align: center;
  background: var(--ln-tint);
  border-radius: var(--r-lg);
  border: 1px solid color-mix(in srgb, var(--ln) 20%, transparent);
}
.emptybox__ico {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: var(--r-lg);
  background: var(--ln-tint); color: var(--ln-deep);
  border: 2px solid color-mix(in srgb, var(--ln) 30%, transparent);
}
.emptybox__ico svg { width: 26px; height: 26px; }
.emptybox p { margin: 0; font-size: var(--t-sm); color: var(--ink-3); }

/* ---------- 上传即处理类（抠图 / 魔法抹除 / 压缩 / 格式转换） ----------
   与其它功能页同宽（不再限 900px）：宽屏时上传区与结果区左右并排，
   窄屏回落单列 —— 这样整页各元素块的左右边界与其它页一致。
   **左右等高（第二十七轮）**：与 .toolgrid 一样用 stretch，让左参数框与右结果框
   底边对齐；右列纵向 flex、结果面板 `flex:1` 吸收空余高度（此前 align-items:start
   使两列各按内容高排列，右侧比左侧矮 60–190px、下方留空）。 */
.toolcenter {
  display: grid; gap: var(--g5);
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
  align-items: stretch;
}
/* 「上传即处理」页的右列：结果面板 + 下方一排特性卡。
   两者之间默认只有 24px（stack-lg 的间距），在整宽面板下显得偏紧——
   加大到 32px，让两个圆角框之间有清晰的呼吸间隙。 */
.toolcenter > .stack-lg > .grid-3 { margin-top: var(--g7); }
@media (max-width: 1000px) { .toolcenter { grid-template-columns: minmax(0, 1fr); } }
.toolcenter .sidepanel { max-width: none; }
/* 「上传即处理」类页（抠图 / 压缩 / 转换）：工作区两栏下面紧跟一排特性小卡（.grid-3）。
   两者是兄弟节点，此前**完全贴在一起**——两个圆角框边缘紧挨，视觉上像一整块。
   这里补上与栅格一致的留白，让两个面板之间有清晰的呼吸间隙。 */
.toolcenter + .grid-3 { margin-top: var(--g5); }/* 宽屏：右列纵向拉伸，结果面板吃掉空余高度，与左栏齐底。
   **空态提示要跟着居中**：panel__body 做成 flex 列、emptybox 取 `flex:1 + align-content:center`，
   否则面板被撑高后，提示会贴在顶部、下方空一大片（与 .toolgrid 的同款配套，见文件前段）。 */
@media (min-width: 1001px) {
  .toolcenter > .stack-lg { display: flex; flex-direction: column; }
  .toolcenter > .stack-lg > .panel { flex: 1 1 auto; display: flex; flex-direction: column; }
  .toolcenter > .stack-lg > .panel > .panel__body { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
  .toolcenter > .stack-lg > .panel > .panel__body > div { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
  .toolcenter .emptybox { flex: 1 1 auto; align-content: center; }
}
.featcell {
  display: grid; gap: 3px;
  padding: var(--g4);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  text-align: center;
}
.featcell__t { font-size: var(--t-body); font-weight: 600; }
.featcell__d { font-size: var(--t-xs); color: var(--ink-3); }

/* ---------- 三宫格（人脸融合） ---------- */

.triple { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: stretch; gap: var(--g4); }
.triple__h { font-size: var(--t-body); font-weight: 700; margin-bottom: var(--g3); }
/* 人脸融合（.triple 版式）没有 .sidepanel，教程入口改挂在第一列标题行：
   标题行做 flex、链接靠右——与标题同行，**不增加垂直高度**（同 .sidepanel__tut 的思路）。 */
.triple__col:first-child .triple__h {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--g2);
}
.triple__col:first-child .triple__h .sidepanel__tut { margin-left: 0; }
/* +/= 相对整行上下居中（align-self 跟随最高列，而不是写死的 padding-top 猜测值） */
.triple__op {
  align-self: center;
  display: grid; place-items: center;
  font-size: 1.6rem; font-weight: 700; color: var(--brand-deep);
}
.triple__out {
  display: grid; place-items: center; gap: var(--g2);
  aspect-ratio: 1; padding: var(--g5);
  border: 1.5px dashed var(--line-2); border-radius: var(--r-lg);
  background: var(--sunk); text-align: center;
}
/* 单列（≤1000px）时三宫格变宽，aspect-ratio:1 会让上传槽与输出块随全宽放大成巨块
   （900 视口下 852px 高）——限高见上方 ≤980px 块（.triple .dropzone--square / .triple__out）。 */
.triple__out p { margin: 0; font-size: var(--t-sm); color: var(--ink-3); }
.triple__acts { display: flex; justify-content: center; gap: var(--g4); margin-top: var(--g6); }
.dropzone--square { aspect-ratio: 1; align-content: center; }

/* 中窄屏（≤980px）：三宫格改为「脸 + 身」两列在上、结果整行在下（+ / = 让位），
   上传槽与输出块限高——否则 aspect-ratio:1 会随全宽放大成巨块
   （900 视口下上传槽 852px、输出块 932px），提交按钮被推到首屏外。
   放在基础规则**之后**：同特异性时靠位置取胜（先前放在前面被覆盖过）。 */
@media (max-width: 980px) {
  .triple { grid-template-columns: 1fr 1fr; gap: var(--g3); }
  .triple__op { display: none; }
  .triple__col:last-child { grid-column: 1 / -1; }
  .triple__h { margin-bottom: var(--g2); }
  .triple .dropzone--square { aspect-ratio: auto; height: 132px; }
  .triple__out { aspect-ratio: auto; min-height: 0; padding: var(--g4); }
}

/* ---------- 特色元素区块 ---------- */

.hallmark {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.hallmark__head { padding: var(--g5) var(--g5) 0; }
.hallmark__title { font-size: var(--t-h3); font-weight: 700; }
.hallmark__body { padding: var(--g5); }
.hallmark__cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--g5); }
.hallmark__cols--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 860px) { .hallmark__cols, .hallmark__cols--2 { grid-template-columns: 1fr; } }
.hallmark__cell h4 { display: flex; align-items: baseline; gap: var(--g2); font-size: var(--t-body); font-weight: 700; margin-bottom: var(--g2); }
.hallmark__tag {
  font-size: var(--t-min); font-weight: 600; color: var(--brand-deep);
  background: var(--brand-tint); padding: 2px 8px; border-radius: var(--r-full);
}
.hallmark__cell p { font-size: var(--t-xs); color: var(--ink-3); line-height: 1.6; }
.hallmark__cell figure { border-radius: var(--r-md); overflow: hidden; }
.hallmark__cell figure img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.hallmark__foot { padding: var(--g4) var(--g5) var(--g5); border-top: 1px solid var(--line); font-size: var(--t-xs); color: var(--ink-3); }
.hallmark__foot-block { padding: var(--g5); border-top: 1px solid var(--line); }
.hallmark__foot-block img { width: 100%; border-radius: var(--r-md); }
.hallmark__steps { display: grid; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 760px) { .hallmark__steps { grid-template-columns: repeat(2, 1fr); } }
.hallmark__step { padding: var(--g4) var(--g4) var(--g4) 0; border-right: 1px solid var(--line); }
.hallmark__step:last-child { border-right: 0; }
.hallmark__step + .hallmark__step { padding-left: var(--g4); }
@media (max-width: 760px) {
  .hallmark__step:nth-child(2n) { border-right: 0; }
  .hallmark__step:nth-child(n+3) { border-top: 1px solid var(--line); }
}
.hallmark__step h4 { font-size: var(--t-body); font-weight: 700; }
.hallmark__step p { font-size: var(--t-xs); color: var(--ink-3); }
.hallmark__list { display: grid; gap: var(--g2); }
.hallmark__list li { font-size: var(--t-xs); color: var(--ink-2); line-height: 1.6; padding-left: var(--g4); position: relative; }
.hallmark__list li::before { content: ""; position: absolute; left: 0; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-deep); }
.hallmark__ladder { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--g4); }
@media (max-width: 700px) { .hallmark__ladder { grid-template-columns: 1fr; } }
.ladder__tier { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.03em; color: var(--brand-deep); }
.ladder__rows { margin-top: var(--g3); border-top: 1px solid var(--line); }
.ladder__row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: var(--t-xs); }
.ladder__row:last-child { border-bottom: 0; }
.ladder__row b { font-variant-numeric: tabular-nums; color: var(--brand-deep); }

.mapgrid { display: grid; grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .mapgrid { grid-template-columns: repeat(2, 1fr); } }
.mapgrid__cell { padding: var(--g4); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.mapgrid__cell:nth-child(4n) { border-right: 0; }
.mapgrid__cell h4 { font-size: var(--t-sm); font-weight: 700; margin-bottom: 4px; }
.mapgrid__cell p { font-size: var(--t-xs); color: var(--ink-3); }

.verify { display: grid; grid-template-columns: 1fr 1fr; gap: var(--g5); }
@media (max-width: 720px) { .verify { grid-template-columns: 1fr; } }
.verify figure img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--r-md); }
.verify figcaption { margin-top: var(--g2); font-size: var(--t-xs); color: var(--ink-3); }
/* 「一图 + 一列文字」型的 verify：右栏文字量通常远少于 4:3 图高，
   若图按 4:3 撑满，右栏下方会空出大片（第二十八轮 judge 指出）。
   这类布局给图位**限高并居中**，让两侧视觉重心相当。 */
.verify--tall-media { align-items: center; }
.verify--tall-media figure img { aspect-ratio: auto; max-height: 190px; object-fit: contain; }
.verify--tall-media figure { align-self: center; }

/* 效果展示：每组是「原图 | 处理后」并排对照。
   图位固定 4:3，图用 contain 完整显示、不裁切——本站展示素材多为竖图（手机拍摄比例），
   用 cover 会把它们裁成横条；contain 则完整入框，两侧留白（井色打底）。
   图位铺满所在格子（对照图与单图同基准），块高由 4:3 比例自然决定。 */
.gallery-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.gallery-side { position: relative; background: var(--well); overflow: hidden; }
.gallery-side img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; display: block; }
.gallery-tag {
  position: absolute; left: 8px; bottom: 8px;
  padding: 2px 9px; border-radius: var(--r-full);
  background: var(--scrim); color: #fff;
  font-size: 10px; font-weight: 600;
  backdrop-filter: blur(4px);
}
.gallery-tag--r { left: auto; right: 8px; }
/* 单图（本功能没有真实前后对照时，只放一张示意）：与对照图同基准，图位仍 4:3 */
.gallery-single { position: relative; background: var(--well); overflow: hidden; }
.gallery-single img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; display: block; }

/* ==========================================================================
   效果展示 · 多样前后对比（第二十二轮）
   同一个「前后对比」按 **5 种交互**呈现，避免全站千篇一律：
     compare  拖动竖直分割线（左右）
     swipe    拖动水平分割线（上下）
     peek     悬停放大镜（指针处圆形揭示）
     hold     按住查看（默认显示处理前，按住显示处理后）
     scan     扫描线揭示（自动来回扫，指针按下可接管拖动）
   组件由 JS 挂载（core.js 的 mountPair），只读元素的 data-* 属性。
   图位沿用 4:3 + contain（竖图完整入框、两侧以井色留白）。
   ========================================================================== */
.pair { position: relative; background: var(--well); overflow: hidden; }
.pair__stage { position: relative; aspect-ratio: 4 / 3; user-select: none; }
.pair__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.pair__rev { will-change: clip-path, opacity; }
.pair__tag {
  position: absolute; bottom: 8px; padding: 2px 9px; border-radius: var(--r-full);
  background: var(--scrim); color: #fff; font-size: 10px; font-weight: 600;
  backdrop-filter: blur(4px); pointer-events: none;
}
.pair__tag--l { left: 8px; }
.pair__tag--r { right: 8px; }
.pair__hint {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  padding: 3px 10px; border-radius: var(--r-full);
  background: var(--scrim); color: #fff; font-size: 10px; font-weight: 600;
  backdrop-filter: blur(4px); pointer-events: none; white-space: nowrap;
}
.pair__seam { position: absolute; background: var(--surface); box-shadow: 0 0 0 1px var(--hairline); pointer-events: none; }
.pair__handle {
  position: absolute; display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: var(--r-full);
  background: var(--surface); color: var(--ink); box-shadow: var(--sh-3);
  transition: scale var(--d2) var(--ease-enter);
}
.pair__handle:hover { scale: 1.06; }
.pair__handle svg { width: 17px; height: 17px; }
.pair__range { position: absolute; inset: 0; opacity: 0; pointer-events: none; }

/* —— compare：竖直分割线，左右拖 —— */
.pair[data-mode="compare"] .pair__rev { clip-path: inset(0 0 0 var(--p, 50%)); }
.pair[data-mode="compare"] .pair__seam { top: 0; bottom: 0; left: var(--p, 50%); width: 2px; margin-left: -1px; }
.pair[data-mode="compare"] .pair__handle { top: 50%; left: var(--p, 50%); transform: translate(-50%, -50%); cursor: ew-resize; }

/* —— swipe：水平分割线，上下拖（下半揭示处理后） —— */
.pair[data-mode="swipe"] .pair__rev { clip-path: inset(var(--p, 50%) 0 0 0); }
.pair[data-mode="swipe"] .pair__seam { left: 0; right: 0; top: var(--p, 50%); height: 2px; margin-top: -1px; }
.pair[data-mode="swipe"] .pair__handle { left: 50%; top: var(--p, 50%); transform: translate(-50%, -50%); cursor: ns-resize; }

/* —— peek：悬停放大镜（指针处圆形揭示） ——
   **未悬停时不裁切**：直接显示完整的「处理后」图，避免默认在中心挖一个圆、
   而圆心恰好落在浅色区域时看起来像"空白镜片"。悬停才启用圆形揭示。 */
.pair[data-mode="peek"] .pair__stage { cursor: crosshair; }
.pair[data-mode="peek"] .pair__rev { clip-path: none; }
.pair[data-mode="peek"]:hover .pair__rev { clip-path: circle(86px at var(--mx, 50%) var(--my, 50%)); }
.pair[data-mode="peek"] .pair__stage::after {
  content: ""; position: absolute; left: var(--mx, 50%); top: var(--my, 50%);
  width: 172px; height: 172px; margin: -86px 0 0 -86px; border-radius: var(--r-full);
  border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--hairline), var(--sh-2);
  pointer-events: none; opacity: 0; transition: opacity var(--d2) var(--ease);
}
.pair[data-mode="peek"]:hover .pair__stage::after { opacity: 1; }

/* —— hold：按住查看（默认处理前，按住显示处理后） —— */
.pair[data-mode="hold"] .pair__rev { opacity: 0; transition: opacity var(--d2) var(--ease); }
.pair[data-mode="hold"].is-holding .pair__rev { opacity: 1; }
.pair[data-mode="hold"] .pair__stage { cursor: pointer; }

/* —— scan：扫描线揭示（JS 驱动 --p 来回扫） —— */
.pair[data-mode="scan"] .pair__rev { clip-path: inset(0 0 0 var(--p, 50%)); }
.pair[data-mode="scan"] .pair__seam {
  top: 0; bottom: 0; left: var(--p, 50%); width: 2px; margin-left: -1px;
  background: var(--ln); box-shadow: 0 0 0 1px var(--hairline), 0 0 14px 2px var(--ln-tint);
}
.pair[data-mode="scan"] .pair__handle { top: 50%; left: var(--p, 50%); transform: translate(-50%, -50%); cursor: ew-resize; }

@media (prefers-reduced-motion: reduce) {
  .pair[data-mode="hold"] .pair__rev { transition: none; }
}

.duo { display: grid; grid-template-columns: 1fr 1fr; gap: var(--g2); }
.duo figure { position: relative; border-radius: var(--r-md); overflow: hidden; background: var(--well); }
.duo img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.duo figcaption {
  position: absolute; left: 6px; bottom: 6px;
  padding: 2px 8px; border-radius: var(--r-full);
  background: var(--scrim); color: #fff; font-size: 10px; font-weight: 600;
}

/* ---------- 适用场景 / 特性 ---------- */

.sect { padding-block: var(--g10); }
@media (max-width: 860px) { .sect { padding-block: var(--g8); } }
/* 交替分区：整宽淡底（不是纯白），让长页有节奏 */
.sect--alt { background: var(--grad-wash-2); border-block: 1px solid var(--line); }
/* 色块式分区：整幅浅色面板，承载该功能的色相。
   骨架层（大面积）保持**清透**——白底 + 一层很淡的色相/紫渐变色，
   只做"这块属于哪一类"的气场暗示，不变成一块浓色（大面积高饱和底会让内容显脏、阅读疲劳）。
   颜色浓度由**重点构件**（按钮/选中态/上传框/读数）承担，而非背景。
   注意：**不用 multiply**——它会把两层淡色相乘压暗压灰（整站偏灰的根因之一）。 */
.sect--block {
  background-color: #fff;
  background-image:
    radial-gradient(120% 135% at 100% 0%, color-mix(in srgb, var(--violet) 5%, transparent) 0%, transparent 48%),
    linear-gradient(140deg, color-mix(in srgb, var(--ln) 5%, transparent) 0%, transparent 52%);
  border-radius: var(--r-2xl);
  margin-block: var(--g8);
  padding: var(--g8) var(--g6);
}
@media (max-width: 860px) { .sect--block { border-radius: var(--r-xl); margin-inline: var(--g4); padding: var(--g7) var(--g5); } }
.sect__title { font-size: var(--t-h2); margin-bottom: var(--g6); }

/* ---------- 效果展示标签组（矢量转换，照源站形态：一排标签 + 一张大图） ---------- */

.gtabs {
  display: flex; flex-wrap: wrap; gap: var(--g2);
  margin-bottom: var(--g5);
}
.gtab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  border-radius: var(--r-full);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: var(--t-sm); font-weight: 600; color: var(--ink-2);
  cursor: pointer;
  transition: color var(--d2) var(--ease), border-color var(--d2) var(--ease),
              background-color var(--d2) var(--ease), box-shadow var(--d2) var(--ease);
}
.gtab:hover { color: var(--ln-deep); border-color: var(--ln-line); }
.gtab.is-on {
  color: var(--on-brand); border-color: transparent;
  background-color: var(--ln); background-image: var(--grad-brand);
  box-shadow: var(--sh-2);
}
.gtab__body {
  position: relative; margin: 0;
  border-radius: var(--r-xl); overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--sh-2);
  display: grid; grid-template-columns: 1fr;
}
/* 有"处理后"图时才并排两张（前 / 后）；单图标签下第二张被 [hidden] 隐藏，用 :not([hidden]) 精确判定。
   并排与单图分别限宽（4:3 下高度随之收敛，避免铺满整幅时块高过大），居中；说明行同宽同中保持对齐。 */
.gtab__body:has(.gtab__img:not([hidden]) + .gtab__img:not([hidden])) {
  grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line);
  max-width: 960px; margin-inline: auto;
}
.gtab__body:has(.gtab__img:not([hidden]) + .gtab__img:not([hidden])) + .gtab__cap {
  max-width: 960px; margin-inline: auto;
}
/* 图位统一 4:3，图用 contain 完整显示、不裁切；竖图两侧以井色留白 */
.gtab__img {
  width: 100%; aspect-ratio: 4 / 3;
  object-fit: contain; display: block;
  background: var(--well);
}
/* 单图标签：一张铺满 1200px 时 4:3 会到 900px 高，过高。收窄居中控高 */
.gtab__body:not(:has(.gtab__img:not([hidden]) + .gtab__img:not([hidden]))) {
  max-width: 620px; margin-inline: auto;
}
.gtab__body:not(:has(.gtab__img:not([hidden]) + .gtab__img:not([hidden]))) + .gtab__cap {
  max-width: 620px; margin-inline: auto;
}
/* `display: block` 会覆盖 [hidden] 的默认 display:none，这里显式声明，
   否则「单图」标签下右侧那张图仍会显示出来。 */
.gtab__img[hidden] { display: none; }
.gtab__cap {
  margin-top: var(--g3); font-size: var(--t-sm); color: var(--ink-3);
}
.gtab__cap b { color: var(--ink); }
/* 每个效果选项的示意稿下载入口：压在展示图右上角。
   底用深色半透明 + 模糊（与 .gallery-tag 同法），保证落在任何画面上都读得清；
   悬停转品牌渐变，作为"可点"的强调。 */
.gtab__demo {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: var(--r-full);
  background: var(--scrim); color: #fff;
  font-size: var(--t-xs); font-weight: 600; white-space: nowrap;
  text-decoration: none; backdrop-filter: blur(6px);
  box-shadow: var(--sh-2);
  transition: background-color var(--d2) var(--ease), box-shadow var(--d2) var(--ease);
}
.gtab__demo svg { width: 15px; height: 15px; flex: none; }
.frame .gallery-compare,
.frame .pair,
.frame .pairwrap { position: relative; }
.frame .gallery-compare .gtab__demo,
.frame .pair .gtab__demo,
.frame .pairwrap .gtab__demo { top: 10px; right: 10px; }
/* 互动块的下载按钮挂在包裹层内（.pair 本身由 JS 渲染成 stage，直接塞子节点会破坏结构） */
.frame .pairwrap { aspect-ratio: 8 / 3; }
.frame .pairwrap > .pair { position: absolute; inset: 0; }

/* ---------- 效果展示：4 块统一高度 ----------
   第一排是「并排两图」（每图 4:3，各占半栏），第二排是「整幅拖动对比」（整栏 4:3）。
   若都按 4:3，第二排高度会是第一排的两倍（实测 493px vs 267px），2×2 网格两行明显不齐。
   做法：互动块改用 **8:3**（= 整栏宽 × 3/8，正好等于并排块里单张图的 4:3 高度），
   两排自然等高；窄屏单列时并排块也变单列，仍保持同一比例关系。 */
.frame:has(> .pair) > .pair { aspect-ratio: 8 / 3; }
.frame:has(> .pair) .pair__stage {
  position: absolute; inset: 0;
  aspect-ratio: auto; height: 100%;
}
.gtab__demo:hover, .gtab__demo:focus-visible {
  background-color: var(--brand); background-image: var(--grad-brand);
  color: var(--on-brand);
  box-shadow: var(--sh-3);
}
@media (max-width: 620px) {
  .gtab__body:has(.gtab__img:not([hidden]) + .gtab__img:not([hidden])) { grid-template-columns: 1fr; }
  .gtab__demo { top: 8px; right: 8px; padding: 6px 11px; }
}
.sect__head { max-width: 62ch; margin-bottom: var(--g6); }
.sect__head h2 { font-size: var(--t-h2); margin-bottom: var(--g3); }
.sect__head p { font-size: var(--t-lead); color: var(--ink-2); }

/* 页头的色相标识与规格 chip */
.pagehead__chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--g2); margin-top: var(--g4); }
.huechip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--r-full);
  background: var(--ln-tint); color: var(--ln-deep);
  font-size: var(--t-min); font-weight: 700;
}
.huechip--ghost { background: var(--sunk); color: var(--ink-2); font-weight: 600; }

/* 适用场景：三组上下排列，每组左右分栏、图文交替——
   第 1 组图左文右、第 2 组文左图右、第 3 组图左文右（偶数组整体镜像）。
   场景之间是并列的用法，不是序列，因此不加序号。 */
.scenelist { display: grid; gap: var(--g9); }
.scene {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center; gap: var(--g8);
}
.scene:nth-child(even) .scene__media { order: 2; }
.scene__body { max-width: 40ch; }
.scene:nth-child(even) .scene__body { margin-left: auto; }
@media (max-width: 820px) {
  .scene, .scene:nth-child(even) { grid-template-columns: minmax(0, 1fr); gap: var(--g4); }
  .scene:nth-child(even) .scene__media { order: 0; }
  .scene__body { max-width: none; margin-left: 0; }
}
/* 场景图：图位统一 4:3、`contain` 完整显示——本站场景素材全是竖图（手机拍摄比例），
   用 cover 会把它们裁成横条；contain 则完整入框、两侧以井色留白。
   图位不必铺满整栏（4:3 铺满 576px 会到 432px 高，反而更高），限宽控高；
   图贴版心外缘（奇数组贴左、偶数组贴右），与文字栏的外边界对齐。 */
.scene__media { display: flex; }
.scene:nth-child(odd) .scene__media { justify-content: flex-start; }
.scene:nth-child(even) .scene__media { justify-content: flex-end; }
.scene__media img {
  width: 100%; max-width: 340px; aspect-ratio: 4 / 3;
  object-fit: cover; display: block;
  background: var(--well); border-radius: var(--r-lg); box-shadow: var(--sh-2);
}
.sm2 img{aspect-ratio:auto!important}
.scene__media .duo { display: grid; grid-template-columns: 1fr 1fr; gap: var(--g2); width: 100%; }
.scene__media .duo img { aspect-ratio: 4 / 3; max-width: none; }
.scene__body h3 { display: flex; align-items: center; gap: var(--g2); font-size: var(--t-h3); margin-bottom: var(--g3); }
.scene__body p { font-size: var(--t-sm); color: var(--ink-2); }

/* 「能做什么」：每条做成带功能色相的小卡片——
   浅色底（该功能色相的 tint）+ 顶部一条色相→紫的渐变条 + 左上序号徽章。
   原先只有一条纯黑上边框，整块偏素（用户反馈）。 */
.deflist { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--g4); counter-reset: defn; }
@media (max-width: 760px) { .deflist { grid-template-columns: 1fr; } }
.deflist__item {
  counter-increment: defn;
  position: relative;
  padding: var(--g5) var(--g5) var(--g4);
  border-radius: var(--r-lg);
  background-color: var(--ln-tint);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: border-color var(--d2) var(--ease), box-shadow var(--d2) var(--ease), transform var(--d2) var(--ease-enter);
}
/* 顶部渐变条：色相 → 紫，宽 56px，靠左 */
.deflist__item::before {
  content: ""; position: absolute; left: 0; top: 0;
  width: 56px; height: 3px;
  background-image: linear-gradient(90deg, var(--ln), var(--violet));
  border-radius: 0 var(--r-full) var(--r-full) 0;
}
.deflist__item:hover { border-color: var(--ln-line); box-shadow: var(--sh-2); transform: translateY(-2px); }
.deflist__item h3 {
  font-size: var(--t-h3); margin-bottom: var(--g2); color: var(--ln-deep);
  display: flex; align-items: baseline; gap: var(--g2);
}
/* 序号：等宽数字，弱化显示（只作阅读锚点，不是视觉主角）。
   用 deep 档而非本色——功能本色作文字偏浅，deep 在浅底上稳过 4.5。 */
.deflist__item h3::before {
  content: counter(defn, decimal-leading-zero);
  font-family: var(--face-code); font-size: var(--t-min); font-weight: 700;
  color: var(--ln-deep); opacity: .85; flex: none;
}
.deflist__item p { font-size: var(--t-sm); color: var(--ink-2); max-width: 52ch; }

/* ---------- 使用条款 ---------- */

.termslist { display: grid; gap: var(--g5); max-width: 78ch; margin-top: var(--g7); }
/* 条款项：白卡片 + 左上角一小段品牌色条（顶部起 44px）——与全站「能做什么」卡片同法，
   不用卡片侧边的粗彩边（AI 生成界面的典型痕迹，craft floor 明确拒绝）。 */
.termsitem {
  position: relative;
  padding: var(--g5);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  overflow: hidden;
}
.termsitem::before {
  content: ""; position: absolute; left: 0; top: 0; width: 44px; height: 3px;
  background: var(--grad-brand);
}
.termsitem h2 {
  display: flex; align-items: baseline; gap: var(--g3);
  font-size: var(--t-h3); margin-bottom: var(--g2);
}
.termsitem__no {
  font-family: var(--face-code); font-size: var(--t-sm); font-weight: 700;
  color: var(--brand-deep); flex: none;
}
.termsitem p { font-size: var(--t-sm); color: var(--ink-2); margin: 0; }

/* ---------- 定价 ---------- */
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--g5); }
@media (max-width: 900px) { .plans { grid-template-columns: 1fr; } }
.plan {
  display: flex; flex-direction: column;
  padding: var(--g6);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-1);
}
.plan[data-featured="true"] { border-color: var(--brand-deep); box-shadow: var(--sh-3), 0 0 0 1px var(--brand-deep); }
.plan__tag { font-size: var(--t-min); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand-deep); }
.plan__name { font-size: var(--t-h3); margin-top: var(--g2); }
.plan__price { display: flex; align-items: baseline; gap: 6px; margin-top: var(--g3); }
.plan__price b { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.plan__price span { font-size: var(--t-sm); color: var(--ink-3); }
.plan__list { margin-top: var(--g5); padding-top: var(--g5); border-top: 1px solid var(--line); flex: 1 1 auto; }
.plan__list li { display: flex; align-items: flex-start; gap: var(--g2); padding: 6px 0; font-size: var(--t-sm); color: var(--ink-2); }
.plan__list svg { width: 17px; height: 17px; flex: none; color: var(--brand-deep); margin-top: 3px; }
.plan__cta { margin-top: var(--g5); }

/* ---------- API ---------- */

.endpoint { padding: var(--g5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.endpoint__top { display: flex; align-items: center; gap: var(--g3); flex-wrap: wrap; }
.endpoint__method { padding: 4px 10px; border-radius: var(--r-sm); background: var(--brand-tint); color: var(--brand-deep); font-size: var(--t-min); font-weight: 700; letter-spacing: 0.04em; }
.endpoint__path { font-family: var(--face-code); font-size: var(--t-sm); font-weight: 600; }
.endpoint__desc { margin-top: var(--g3); font-size: var(--t-sm); color: var(--ink-2); }
.endpoint__rows { margin-top: var(--g4); padding-top: var(--g4); border-top: 1px solid var(--line); }
.endpoint__row { display: flex; gap: var(--g4); padding: 5px 0; font-size: var(--t-xs); }
.endpoint__row dt { width: 88px; flex: none; color: var(--ink-3); }
.endpoint__row dd { margin: 0; color: var(--ink-2); }

.codeblock {
  padding: var(--g5);
  background: var(--dark);
  border-radius: var(--r-lg);
  overflow-x: auto;
  font-family: var(--face-code); font-size: var(--t-xs); line-height: 1.75;
  color: var(--on-dark);
}
.codeblock .k { color: var(--code-key); }
.codeblock .s { color: var(--code-str); }
.codeblock .c { color: var(--on-dark-2); }

/* ---------- 登录注册 ---------- */

.authwrap { display: grid; place-items: center; padding-block: var(--g10); }
.authcard {
  width: min(460px, 100%);
  padding: var(--g8);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-2xl);
  box-shadow: var(--sh-3);
}
.authcard__head { text-align: center; margin-bottom: var(--g6); }
.authcard__head h1 { font-size: var(--t-h2); }
.authcard__head p { margin-top: var(--g2); font-size: var(--t-sm); color: var(--ink-3); }
.authfield { margin-bottom: var(--g4); }
.authfield label { display: block; margin-bottom: 7px; font-size: var(--t-sm); font-weight: 600; }
.helper { margin-top: 6px; font-size: var(--t-xs); color: var(--ink-3); }
.helper[data-bad="true"] { color: var(--danger-deep); }
.authswitch { margin-top: var(--g5); text-align: center; font-size: var(--t-sm); color: var(--ink-3); }
.authswitch a { color: var(--brand-deep); font-weight: 600; }

/* ---------- 收束区 ---------- */

.closing { background: var(--dark); color: var(--on-dark); border-radius: var(--r-2xl); padding: var(--g9); }
.closing h2 { color: var(--on-dark); }
.closing p { color: var(--on-dark-2); }
.closing__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--g8); align-items: center; }
@media (max-width: 860px) { .closing__grid { grid-template-columns: 1fr; gap: var(--g6); } }
.closing__quick { display: grid; grid-template-columns: 1fr 1fr; gap: var(--g3); }
@media (max-width: 520px) { .closing__quick { grid-template-columns: 1fr; } }
.closing__quick a { display: block; padding: var(--g4); border-radius: var(--r-lg); background: rgba(255,255,255,.06); transition: background-color var(--d2) var(--ease); }
.closing__quick a:hover { background: rgba(255,255,255,.12); }
.closing__quick b { display: block; font-size: var(--t-sm); font-weight: 600; }
.closing__quick small { font-size: var(--t-xs); color: var(--on-dark-2); }

/* ---------- 通用 ---------- */

.crumb { display: flex; align-items: center; gap: var(--g2); flex-wrap: wrap; font-size: var(--t-xs); color: var(--ink-3); }
.crumb a:hover { color: var(--brand-deep); }
.crumb__sep {` color: var(--ink-3); }
.crumb__cur { color: var(--ink); font-weight: 600; }

.rise { opacity: 0; transform: translateY(12px); }
.rise.is-in { opacity: 1; transform: none; transition: opacity var(--d5) var(--ease-enter), transform var(--d5) var(--ease-enter); }
@media (prefers-reduced-motion: reduce) { .rise { opacity: 1; transform: none; } }

/* ==========================================================================
   紧凑断点的间距修正（放在文件末尾，确保覆盖前文同特异性的面板密度规则）
   前文「面板内的密度」那组 `.sidepanel .field { padding-block: 10px }` /
   `.sidepanel .field--upload { padding-block: 2px 10px }` 位于文件后段，
   会覆盖前面紧凑模式块里的收紧设置，导致矮屏下参数面板偏高、提交按钮落到首屏外。
   此处按断点统一收紧（含 1048×580 这类展示屏）。
   ========================================================================== */

@media (min-width: 1001px) and (max-height: 680px) {
  .sidepanel .field { padding-block: 4px; }
  .sidepanel .field--upload { padding-block: 0 4px; }
  .sidepanel__foot { padding: 6px var(--g4) 8px; }
}

@media (max-width: 1000px) and (max-height: 820px) {
  .sidepanel .field { padding-block: 4px; }
  .sidepanel .field--upload { padding-block: 0 4px; }
}

/* ==========================================================================
   翰墨AI · 批量处理页（batch）
   页头「批量」入口链接 + 结果区的「汇总 + 打包下载」卡。追加于文件末尾。
   ========================================================================== */

/* 页头副标题下的入口链接行（单图页 → 批量页；批量页 → 单图页） */
.pagehead__alt { margin-top: 8px; font-size: var(--t-sm); }
.pagehead__alt .u-link { color: var(--brand-deep); }
.pagehead__alt .u-link:hover { text-decoration-thickness: 2px; }

/* 批量结果汇总卡 */
.batchsum { display: grid; gap: var(--g3); }
.batchsum__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--g3); flex-wrap: wrap;
}
.batchsum__title { font-size: var(--t-h3); font-weight: 700; }
.batchrows { display: grid; gap: var(--g2); }
.batchrow {
  display: flex; align-items: center; gap: var(--g3);
  padding: var(--g3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.batchrow__no {
  flex: none; width: 26px;
  font-family: var(--face-code); font-size: var(--t-min);
  color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.batchrow__thumb {
  flex: none; width: 44px; height: 44px;
  object-fit: cover; border-radius: var(--r-xs);
  background: var(--well); box-shadow: inset 0 0 0 1px var(--hairline);
}
.batchrow__name {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: var(--t-sm);
}
.batchrow .btn { flex: none; }

/* 结果面板头部的「最多 10 张」徽标与计数并排时，间距收紧 */
.panel__head .badge .dot { width: 6px; height: 6px; }

/* ==========================================================================
   使用教程（文章）
   · 列表页 tutorials.html：顶部快速跳转 + 按功能分组的教程卡片
   · 详情页 tutorial-*.html：正文（左）+ 目录与相关教程（右，宽屏 sticky）
   · 正文排版 .prose：段落 / 标题 / 列表 / 步骤 / 提示 / 表格 / 插图
   色相：列表页的分组头与卡片、详情页的页头都用 data-hue="<功能 slug>"，
   构件随该功能变色（与功能页同一套 --ln 别名机制，见 root.css）。**不新增色相令牌**。
   ========================================================================== */

/* ---------- 列表页：顶部快速跳转 ---------- */
.tutnav { display: flex; flex-wrap: wrap; gap: var(--g2); }
.tutnav a {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: var(--r-full);
  background: var(--surface); border: 1px solid var(--line);
  font-size: var(--t-xs); color: var(--ink-2);
  transition: border-color var(--d2) var(--ease), background var(--d2) var(--ease), color var(--d2) var(--ease);
}
.tutnav a:hover { border-color: var(--ln-line); background: var(--ln-tint); color: var(--ln-deep); }
.tutnav .huedot { width: 7px; height: 7px; }

/* ---------- 列表页：按功能分组 ---------- */
.tutgroup { display: grid; gap: var(--g8); scroll-margin-top: calc(var(--topbar-h) + 20px); }
.tutgroup + .tutgroup { margin-top: var(--g10); }
.tutgroup__head {
  display: flex; align-items: baseline; gap: var(--g3); flex-wrap: wrap;
  padding-bottom: var(--g3); border-bottom: 1px solid var(--line);
}
.tutgroup__name { font-size: var(--t-h2); font-weight: 700; }
.tutgroup__note { font-size: var(--t-xs); color: var(--ink-3); }

/* 组内的「某个功能的全部教程」 */
.tutfun { display: grid; gap: var(--g4); scroll-margin-top: calc(var(--topbar-h) + 20px); }
.tutfun__head {
  display: flex; align-items: center; gap: var(--g3); flex-wrap: wrap;
}
.tutfun__ico {
  display: grid; place-items: center; flex: none;
  width: 32px; height: 32px; border-radius: var(--r-sm);
  background: var(--ln-tint); border: 1px solid var(--ln-line); color: var(--ln-deep);
}
.tutfun__ico svg { width: 17px; height: 17px; }
.tutfun__name { font-size: var(--t-h3); font-weight: 700; }
.tutfun__note { font-size: var(--t-xs); color: var(--ink-3); }
.tutfun__go { margin-left: auto; font-size: var(--t-xs); color: var(--ln-deep); }
.tutfun__go:hover { text-decoration: underline; text-underline-offset: 3px; }
.tutfun__more { align-self: start; font-size: var(--t-sm); color: var(--ln-deep); }
.tutfun__more:hover { text-decoration: underline; text-underline-offset: 3px; }

/* 顶部跳转的分类计数 */
.tutnav a b {
  font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}

/* ---------- 分页控件（功能分类页） ---------- */
.tutpager {
  margin-top: var(--g8);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--g4); flex-wrap: wrap;
}
.tutpager__info { font-size: var(--t-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tutpager__links { display: flex; align-items: center; gap: var(--g2); flex-wrap: wrap; }
.tutpager__link {
  display: inline-flex; align-items: center; gap: 6px;
  min-width: 38px; padding: 7px 12px; justify-content: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-full);
  font-size: var(--t-sm); color: var(--ink-2); font-variant-numeric: tabular-nums;
  transition: border-color var(--d2) var(--ease), background var(--d2) var(--ease), color var(--d2) var(--ease);
}
.tutpager__link:hover { border-color: var(--ln-line); background: var(--ln-tint); color: var(--ln-deep); }
.tutpager__link.is-on { background: var(--ln); border-color: var(--ln); color: var(--ln-on); font-weight: 700; }
.tutpager__link.is-off { opacity: .45; }
.tutpager__link svg { width: 15px; height: 15px; }

.tutgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--g5); }
@media (max-width: 900px) { .tutgrid { grid-template-columns: 1fr; } }

.tutcard {
  display: grid; grid-template-columns: 152px minmax(0, 1fr);
  gap: var(--g4); padding: var(--g4);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-1);
  transition: border-color var(--d2) var(--ease), box-shadow var(--d3) var(--ease), transform var(--d2) var(--ease);
}
.tutcard:hover { border-color: var(--ln-line); box-shadow: var(--sh-2); transform: translateY(-2px); }
.tutcard__media {
  position: relative; overflow: hidden; aspect-ratio: 4 / 3;
  border-radius: var(--r-md); background: var(--well);
}
.tutcard__media img { width: 100%; height: 100%; object-fit: cover; }
.tutcard__body { display: flex; flex-direction: column; min-width: 0; }
.tutcard__meta { display: flex; align-items: center; gap: var(--g2); flex-wrap: wrap; margin-bottom: 7px; }
.tutcard__t { font-size: var(--t-body); font-weight: 700; line-height: var(--lh-h); }
.tutcard:hover .tutcard__t { color: var(--ln-deep); }
.tutcard__d { margin-top: 7px; font-size: var(--t-sm); color: var(--ink-2); }
.tutcard__foot {
  margin-top: auto; padding-top: var(--g3);
  display: flex; align-items: center; gap: var(--g3); flex-wrap: wrap;
  font-size: var(--t-min); color: var(--ink-3);
}
@media (max-width: 560px) {
  .tutcard { grid-template-columns: minmax(0, 1fr); }
  .tutcard__media { aspect-ratio: 16 / 9; }
}

/* ---------- 详情页：正文 + 侧栏 ---------- */
.tutlayout { display: grid; grid-template-columns: minmax(0, 1fr) 264px; gap: var(--g9); align-items: start; }
@media (max-width: 1000px) { .tutlayout { grid-template-columns: minmax(0, 1fr); gap: var(--g7); } }
.tutmain { min-width: 0; }
.tutside { position: sticky; top: calc(var(--topbar-h) + 24px); display: grid; gap: var(--g4); }
@media (max-width: 1000px) { .tutside { position: static; } }

.toc, .tutrel { padding: var(--g4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.toc__t, .tutrel__t {
  font-size: var(--t-min); font-weight: 700; letter-spacing: var(--tr-tag);
  color: var(--ink-3);
}
.toc__list { margin-top: var(--g3); display: grid; gap: 1px; border-left: 2px solid var(--line); }
.toc__list a {
  display: block; padding: 6px 11px; margin-left: -2px;
  border-left: 2px solid transparent;
  font-size: var(--t-sm); color: var(--ink-2); line-height: 1.45;
  transition: color var(--d2) var(--ease), border-color var(--d2) var(--ease);
}
.toc__list a:hover { color: var(--ln-deep); }
.toc__list a.is-on { border-left-color: var(--ln); color: var(--ln-deep); font-weight: 600; }

.tutrel__list { margin-top: var(--g3); display: grid; gap: 2px; }
.tutrel__list a { display: grid; gap: 3px; padding: 8px 10px; border-radius: var(--r-sm); transition: background var(--d2) var(--ease); }
.tutrel__list a:hover { background: var(--ln-tint); }
.tutrel__list b { font-size: var(--t-sm); font-weight: 600; line-height: 1.4; }
.tutrel__list small { font-size: var(--t-min); color: var(--ink-3); }

/* 详情页页头：面包屑居中 + 标题 + 元信息行 */
.pagehead .crumb { justify-content: center; margin-bottom: var(--g3); }
.pagehead__meta {
  margin-top: var(--g3);
  display: flex; align-items: center; justify-content: center; gap: var(--g2) var(--g4); flex-wrap: wrap;
  font-size: var(--t-xs); color: var(--ink-3);
}
.pagehead__meta .dot-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-4); }
.pagehead__meta .badge { font-size: var(--t-min); }

/* 详情页右栏顶部的「本功能」卡（原在右栏底部，按用户要求移到顶部）；
   它取代了原来的「本篇目录」位置。 */
.tutfun-box { padding: var(--g4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.tutfun-box__link {
  margin-top: var(--g3); display: grid; grid-template-columns: auto minmax(0, 1fr);
  gap: var(--g3); align-items: center;
  padding: var(--g3); border-radius: var(--r-md);
  transition: background var(--d2) var(--ease);
}
.tutfun-box__link:hover { background: var(--ln-tint); }
.tutfun-box__link > span:last-child { display: grid; gap: 3px; min-width: 0; }
.tutfun-box__link b { font-size: var(--t-sm); font-weight: 700; }
.tutfun-box__link small { font-size: var(--t-min); color: var(--ink-3); line-height: 1.5; }

/* 阅读进度条（详情页顶部） */
.readbar {
  position: fixed; top: 0; left: 0; z-index: 95;
  height: 3px; width: var(--rp, 0%);
  background: var(--ln); border-radius: 0 var(--r-full) var(--r-full) 0;
}

/* ---------- 正文排版 ---------- */
.prose { max-width: 76ch; }
.prose > * + * { margin-top: var(--g5); }
.prose > h2 { margin-top: var(--g9); }
.prose > h2:first-child { margin-top: 0; }
.prose > h3 { margin-top: var(--g7); }
.prose h2 { font-size: var(--t-h2); }
.prose h3 { font-size: var(--t-h3); }
.prose p { font-size: var(--t-body); color: var(--ink-2); margin: 0; max-width: 76ch; }
.prose h2 + *, .prose h3 + * { margin-top: var(--g4); }
.prose ul, .prose ol { display: grid; gap: 9px; }
.prose li { position: relative; padding-left: 24px; font-size: var(--t-body); color: var(--ink-2); }
.prose ul > li::before {
  content: ""; position: absolute; left: 7px; top: 0.66em;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ln); opacity: .8;
}
.prose ol { counter-reset: prose; }
.prose ol > li { counter-increment: prose; }
.prose ol > li::before {
  content: counter(prose); position: absolute; left: 0; top: 0.06em;
  width: 19px; height: 19px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: var(--t-min); font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--ln-tint); color: var(--ln-deep);
}
.prose blockquote {
  padding: var(--g4) var(--g5);
  border-left: 3px solid var(--ln); border-radius: 0 var(--r-md) var(--r-md) 0;
  background: var(--ln-tint);
}
.prose blockquote p { font-size: var(--t-sm); }
.prose figure img { width: 100%; border: 1px solid var(--line); border-radius: var(--r-md); }
.prose figcaption { margin-top: var(--g2); font-size: var(--t-xs); color: var(--ink-3); }
.prose code {
  padding: 2px 6px; border-radius: var(--r-xs);
  background: var(--sunk); border: 1px solid var(--line);
  font-family: var(--face-code); font-size: 0.9em; color: var(--ink);
}
.prose .tbl__wrap { border: 1px solid var(--line); border-radius: var(--r-md); }
.prose .tbl__wrap .tbl { font-size: var(--t-sm); }

/* 步骤清单 */
.tutsteps { display: grid; gap: var(--g5); counter-reset: tutstep; }
.tutsteps__item { position: relative; padding-left: 48px; counter-increment: tutstep; }
.tutsteps__item::before {
  content: counter(tutstep, decimal-leading-zero);
  position: absolute; left: 0; top: 0;
  width: 32px; height: 32px; border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: var(--ln-tint); border: 1px solid var(--ln-line); color: var(--ln-deep);
  font-family: var(--face-code); font-size: var(--t-min); font-weight: 700;
}
.tutsteps__t { font-size: var(--t-body); font-weight: 700; }
.tutsteps__d { margin-top: 5px; font-size: var(--t-sm); color: var(--ink-2); }
.tutsteps__d p + p { margin-top: 6px; }

/* 提示块 */
.tutnote {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--g3);
  padding: var(--g4); border-radius: var(--r-md);
  background: var(--sunk); border: 1px solid var(--line);
}
.tutnote__ico { color: var(--ln-deep); }
.tutnote__ico svg { width: 18px; height: 18px; }
.tutnote__t { font-size: var(--t-sm); font-weight: 700; }
.tutnote p { margin-top: 4px; font-size: var(--t-sm); color: var(--ink-2); }
.tutnote--warn { background: var(--brand-tint); border-color: var(--brand-line); }

/* 详情页收尾（返回列表 / 下一篇） */
.tutfoot {
  margin-top: var(--g9); padding-top: var(--g5);
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: var(--g4); flex-wrap: wrap;
}
.tutfoot__next { display: grid; gap: 3px; text-align: right; }
.tutfoot__next b { font-size: var(--t-sm); font-weight: 600; }
.tutfoot__next small { font-size: var(--t-min); color: var(--ink-3); }

/* ==========================================================================
   矢量转换页 · 补充区块（照源站首页的三块内容）
   ① 多平台支持：四个插件工具形态   ② 选择适合您的订阅计划（两组切换）
   ③ 矢量图转换方法：相关文章链接清单
   说明：内容取自源站，**价格与权益数值照录**
   ========================================================================== */

/* ---------- ① 多平台支持 ---------- */
.platform { display: grid; gap: var(--g6); }
.platform__intro {display: grid; gap: var(--g3)}
.platform__badge {
  justify-self: start;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 13px; border-radius: var(--r-full);
  background: var(--ln-tint); border: 1px solid var(--ln-line);
  font-size: var(--t-min); font-weight: 700; color: var(--ln-deep);
  letter-spacing: var(--tr-tag);
}
.platform__title { font-size: var(--t-h2); }
.platform__title em { font-style: normal; color: var(--ln-deep); }
.platform__desc { font-size: var(--t-body); color: var(--ink-2); }
.platform__desc b { font-weight: 700; color: var(--ink); }

.platform__grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--g4); }
@media (max-width: 760px) { .platform__grid { grid-template-columns: 1fr; } }

.platform__card {
  display: flex; align-items: center; gap: var(--g3);
  padding: var(--g4);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  transition: border-color var(--d2) var(--ease), box-shadow var(--d2) var(--ease), transform var(--d2) var(--ease);
}
.platform__card:hover { border-color: var(--ln-line); box-shadow: var(--sh-2); transform: translateY(-2px); }
.platform__ico {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; border-radius: var(--r-sm);
  background: var(--ln-tint); border: 1px solid var(--ln-line); color: var(--ln-deep);
  font-family: var(--face-code); font-size: var(--t-min); font-weight: 700;
}
.platform__ico svg { width: 20px; height: 20px; }
.platform__body { display: grid; gap: 3px; min-width: 0; }
.platform__name { font-size: var(--t-sm); font-weight: 700; }
.platform__note { font-size: var(--t-min); color: var(--ink-3); line-height: 1.5; }
.platform__act {
  margin-left: auto; flex: none;
  padding: 7px 14px; border-radius: var(--r-full);
  background: var(--ln-tint); border: 1px solid var(--ln-line);
  font-size: var(--t-min); font-weight: 700; color: var(--ln-deep);
  white-space: nowrap;
  transition: background var(--d2) var(--ease), color var(--d2) var(--ease);
}
.platform__act:hover { background: var(--ln); color: var(--ln-on); }

/* ---------- ② 订阅计划 ---------- */
.subswitch {
  display: inline-flex; gap: 4px; padding: 5px;
  background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-full);
}
.subswitch__btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: var(--r-full);
  font-size: var(--t-sm); font-weight: 600; color: var(--ink-3);
  transition: background var(--d2) var(--ease), color var(--d2) var(--ease), box-shadow var(--d2) var(--ease);
}
.subswitch__btn:hover { color: var(--ink); }
.subswitch__btn[aria-selected="true"] {
  background: var(--surface); color: var(--ink);
  box-shadow: var(--sh-1), 0 0 0 1px var(--line);
}
.subswitch__btn svg { width: 15px; height: 15px; }
.subswitch__btn[aria-selected="true"] svg { color: var(--ln-deep); }

.subset { margin-top: var(--g6); }
.subset[hidden] { display: none; }

.subplans { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--g5); }
@media (max-width: 960px) { .subplans { grid-template-columns: 1fr; } }

.subplan {
  position: relative;
  display: flex; flex-direction: column;
  padding: var(--g6);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
  box-shadow: var(--sh-1);
}
.subplan[data-featured="true"] {
  border-color: var(--ln-line);
  box-shadow: var(--sh-3), 0 0 0 1px var(--ln-line);
}
.subplan__flag {
  position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%);
  padding: 4px 14px; border-radius: var(--r-full);
  background: var(--ln); color: var(--ln-on);
  font-size: var(--t-min); font-weight: 700; letter-spacing: var(--tr-tag);
  white-space: nowrap;
}
.subplan__name { font-size: var(--t-h3); font-weight: 700; }
.subplan__price {
  margin-top: var(--g3); display: flex; align-items: baseline; gap: 6px;
}
.subplan__price b { font-size: 2rem; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.subplan__price span { font-size: var(--t-sm); color: var(--ink-3); }
.subplan__credits { margin-top: 2px; font-size: var(--t-sm); font-weight: 600; color: var(--ln-deep); }
.subplan__lede { margin-top: var(--g2); font-size: var(--t-xs); color: var(--ink-3); }
.subplan__list {
  margin-top: var(--g5); padding-top: var(--g5);
  border-top: 1px solid var(--line);
  flex: 1 1 auto; display: grid; gap: 7px; align-content: start;
}
.subplan__list li {
  display: flex; align-items: flex-start; gap: var(--g2);
  font-size: var(--t-xs); color: var(--ink-2); line-height: 1.55;
}
.subplan__list svg { width: 15px; height: 15px; flex: none; color: var(--ln-deep); margin-top: 3px; }
.subplan__cta { margin-top: var(--g5); }
.subplan__note { margin-top: var(--g3); font-size: var(--t-min); color: var(--ink-3); }

.subfoot {
  margin-top: var(--g6);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--g4); flex-wrap: wrap;
  padding-top: var(--g5); border-top: 1px solid var(--line);
  font-size: var(--t-xs); color: var(--ink-3);
}
.subfoot__trust { display: flex; align-items: center; gap: var(--g5); flex-wrap: wrap; }
.subfoot__trust span { display: inline-flex; align-items: center; gap: 6px; }
.subfoot__trust svg { width: 15px; height: 15px; color: var(--ok-deep); }

/* ---------- ②b 订阅卡底部的信任横栏（照源站：左头像堆叠+用户数，右三项横向） ---------- */
.subtrust {
  margin-top: var(--g5);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--g5); flex-wrap: wrap;
  padding: var(--g5) var(--g6);
  background: var(--sunk); border: 1px solid var(--line); border-radius: var(--r-xl);
}
.subtrust__who { display: flex; align-items: center; gap: var(--g3); flex-wrap: wrap; }
.subtrust__faces { display: flex; align-items: center; }
.subtrust__face {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--f, var(--sunk));
  border: 2px solid var(--surface);
  font-size: var(--t-min); font-weight: 700; color: var(--ink-2);
}
.subtrust__face + .subtrust__face { margin-left: -10px; }
.subtrust__join { font-size: var(--t-xs); font-weight: 700; color: var(--ink); white-space: nowrap; }

.subtrust__items { display: flex; align-items: center; gap: var(--g6); flex-wrap: wrap; }
.subtrust__item { display: flex; align-items: center; gap: var(--g3); }
.subtrust__ico {
  display: grid; place-items: center; flex: none;
  width: 36px; height: 36px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line); color: var(--ln-deep);
}
.subtrust__ico svg { width: 18px; height: 18px; }
.subtrust__txt { display: grid; gap: 2px; }
.subtrust__txt b { font-size: var(--t-sm); font-weight: 700; }
.subtrust__txt small { font-size: var(--t-min); color: var(--ink-3); line-height: 1.45; }
@media (max-width: 900px) {
  .subtrust { flex-direction: column; align-items: flex-start; }
  .subtrust__items { gap: var(--g4); }
}

/* ---------- ③ 相关文章清单 ---------- */
.artlist { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--g3); }
@media (max-width: 900px) { .artlist { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .artlist { grid-template-columns: 1fr; } }
.artlink {
  display: flex; align-items: flex-start; gap: var(--g2);
  padding: 12px var(--g4);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  font-size: var(--t-sm); color: var(--ink-2); line-height: 1.55;
  transition: border-color var(--d2) var(--ease), background var(--d2) var(--ease), color var(--d2) var(--ease);
}
.artlink:hover { border-color: var(--ln-line); background: var(--ln-tint); color: var(--ln-deep); }
.artlink::before {
  content: ""; flex: none; width: 6px; height: 6px; margin-top: 7px;
  border-radius: 50%; background: var(--ln); opacity: .7;
}
.xgw{display:flex;flex-wrap:wrap;justify-content:center;max-width:830px;margin:0 auto}
.xg{position:relative;max-width:350px}
.xg img{max-width:350px!important;max-height:350px}

/* ==========================================================================
   预览区转换遮罩（real.js 提交后挂到 .stack-lg / .triple）
   阻止转换期间点击/拖动预览区（对比滑块、候选图等），提示可稍后到历史记录查看。
   ========================================================================== */
.convert-mask {
  position: absolute; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center;
  padding: var(--g5);
  background: rgba(255, 255, 255, 0.68);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  border-radius: inherit;
  cursor: wait;
}
.convert-mask__card {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 28px 36px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  text-align: center;
}
.convert-mask__spinner {
  width: 32px; height: 32px; flex: none;
  border: 3px solid var(--brand-tint);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: convert-spin 0.8s linear infinite;
}
.convert-mask__title {
  font-size: var(--t-body); font-weight: 700; color: var(--ink);
}
.convert-mask__hint {
  font-size: var(--t-sm); color: var(--ink-3);
}
.convert-mask__hint a {
  color: var(--brand-deep); font-weight: 600; text-decoration: underline;
  text-underline-offset: 2px;
}
.convert-mask__hint a:hover { color: var(--brand-press); }
@keyframes convert-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .convert-mask__spinner { animation-duration: 1.6s; }
}

/* ==========================================================================
   证件美化页（id_photo?theme=new）— 对齐 mengxinsvg 的 1:1 等宽 + 首屏一屏展示
   实测 1440x900：顶栏 53 + 页头 73 + 工具区 714 = 840px < 900，按钮完整可见
   ========================================================================== */

/* A. 比例对齐：工具区两列 1:1 等宽，内容宽 1024px（.wrap 左右各 24px 内边距 → 1024+48=1072） */
body[data-tool="id-photo"] main .wrap { max-width: 1072px; }
@media (min-width: 1001px) {
  body[data-tool="id-photo"] .toolgrid--params-right {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 32px;
    align-items: stretch;
  }
}

/* B. 顶栏与页头压缩：68+99 → 53+73 */
body[data-tool="id-photo"] .topbar__in { min-height: 52px; }
body[data-tool="id-photo"] .pagehead { padding-block: 8px 6px !important; }
body[data-tool="id-photo"] .pagehead__title h1 { font-size: var(--t-h2); }
body[data-tool="id-photo"] .pagehead__title p { margin-top: 3px; font-size: 13px; }

/* C. 参数面板紧凑：服装大图改 5 列缩略图、字段标签左置，面板 828 → 714px */
@media (min-width: 1001px) {
  body[data-tool="id-photo"] .sidepanel__head { padding: 6px var(--g4) 0; }
  body[data-tool="id-photo"] .sidepanel__body { padding: 4px var(--g4); }
  body[data-tool="id-photo"] .sidepanel__foot { padding: 6px var(--g4) 8px; }
  body[data-tool="id-photo"] .sidepanel .field { padding-block: 5px; }

  body[data-tool="id-photo"] .sidepanel .cardpick__grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
  }
  body[data-tool="id-photo"] .sidepanel .cardpick__item img,
  body[data-tool="id-photo"] .sidepanel .cardpick__none { aspect-ratio: 3/4; }
  body[data-tool="id-photo"] .sidepanel .cardpick__name {
    padding: 1px 2px;
    font-size: 9px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  body[data-tool="id-photo"] .sidepanel .cardpick__tabs { margin-bottom: 4px; }

  body[data-tool="id-photo"] .sidepanel .field:not(.field--upload):not(.field--slider) {
    display: grid;
    grid-template-columns: minmax(60px, auto) minmax(0, 1fr);
    align-items: center;
    column-gap: 10px;
  }
  body[data-tool="id-photo"] .sidepanel .field__top { margin-bottom: 0; }
  body[data-tool="id-photo"] .sidepanel .field__hint { display: none; }
  body[data-tool="id-photo"] .sidepanel .field__label { font-size: var(--t-min); line-height: 1.3; }
}

/* D. 上传区内联 min-height:420px 覆盖（HTML 写死，须 !important） */
body[data-tool="id-photo"] .field--upload .dropzone { min-height: 0 !important; }

/* 注：本方案只作用于 id_photo 页；窄屏 <=1000px 仍走原单列折叠，不生效上述媒体查询。 */

/* E. 下方默认展示「单张照 / 排版照」并使左右两列底部对齐 */
/* 上传生成结果后，real.js 的 host.innerHTML 会整体覆盖默认卡片，不影响正常流程 */
@media (min-width: 1001px) {
  body[data-tool="id-photo"] .field--upload { padding-bottom: 4px !important; }
  body[data-tool="id-photo"] .dropzone { height: 452px !important; }
  body[data-tool="id-photo"] [data-idphoto-results] { margin-top: 8px !important; }
}
body[data-tool="id-photo"] .idphoto-demo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
body[data-tool="id-photo"] .idphoto-demo .demo-card { margin: 0; }
body[data-tool="id-photo"] .idphoto-demo .demo-media {
  height: 150px; background: var(--well);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
body[data-tool="id-photo"] .idphoto-demo .demo-media > img { width: auto; height: 100%; object-fit: contain; display: block; }
body[data-tool="id-photo"] .idphoto-demo .demo-layout { padding: 10px; }
body[data-tool="id-photo"] .idphoto-demo .layout-grid {
  width: 100%; height: 100%;
  display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, 1fr);
  gap: 2px; background: var(--well);
}
body[data-tool="id-photo"] .idphoto-demo .layout-grid .lc { overflow: hidden; background: #fff; }
body[data-tool="id-photo"] .idphoto-demo .layout-grid .lc img { width: 100%; height: 100%; object-fit: cover; display: block; }
body[data-tool="id-photo"] .idphoto-demo .demo-tip { color: var(--ink-3); }

/* F. 预览卡片：外框缩小、图片放大并居中（11-25） */
/* 根因：全局 .frame img{width:100%;aspect-ratio:16/11} 把竖版照拉成 218×150 的 contain 框，
   实际照片只 112px 宽、两侧灰边很大。改为按图片自身比例显示 + 媒体区加高 + 卡片收窄居中。
   同时上传区减 50px 补偿，保持左右底部对齐、工具区总高仍 714px。 */
@media (min-width: 1001px) {
  body[data-tool="id-photo"] .dropzone { height: 402px !important; }
}
body[data-tool="id-photo"] .idphoto-demo { grid-template-columns: repeat(2, 240px); justify-content: center; }
body[data-tool="id-photo"] .idphoto-demo .demo-card .demo-media { height: 200px !important; }
body[data-tool="id-photo"] .idphoto-demo .demo-card .demo-media > img {
  width: auto !important; max-width: 100% !important; height: 100% !important;
  aspect-ratio: auto !important; object-fit: contain !important;
  display: block; margin: 0 auto;
}
body[data-tool="id-photo"] .idphoto-demo .demo-layout { padding: 5px; }

/* G. 预览卡片标题条（单张照 / 排版照）行距压缩（11-25） */
/* 标题条 47→30px（padding 12→6、行高 1.68→1.3）；省下的 17px 补给图片区（200→217），
   保持卡片总高 249px、左右底部对齐 841px、工具区 714px 不变，图片顺带更大。 */
body[data-tool="id-photo"] .idphoto-demo .demo-card .frame__cap {
  padding: 6px 16px !important;
  line-height: 1.3 !important;
}
body[data-tool="id-photo"] .idphoto-demo .demo-card .demo-media { height: 217px !important; }

/* H. 排版照默认展示改为 5 列 × 2 行（10张），与实际生成规格一致（11-25） */
/* 模板已把格子从 12 个减到 10 个；这里改网格列行数并按 5:2.1 比例居中，避免格子被拉变形。 */
body[data-tool="id-photo"] .idphoto-demo .layout-grid {
  grid-template-columns: repeat(5, 1fr) !important;
  grid-template-rows: repeat(2, 1fr) !important;
  width: 100% !important; height: auto !important;
  max-width: none !important; margin: 0 auto !important;
  aspect-ratio: 5 / 2.1 !important;
}

/* I. 两卡不等宽：单张照收窄、空间让给排版照（11-25） */
/* 单张照 240→200px（照片仍 152×217，只是两侧留白减少）；排版照 240→280px（5×2 图更大）。
   总宽仍 480px + 12px gap = 492px，居中在 496px 容器内，左右底部对齐 841px 不变。 */
body[data-tool="id-photo"] .idphoto-demo { grid-template-columns: 200px 280px !important; }

/* J. 排版照默认展示改为单张真实排版图 pbpthoto.png（11-25） */
/* 模板已把 CSS 拼的 10 格 grid 换成一张 <img>；这里按原比例 contain 居中，
   用 aspect-ratio:auto 解除全局 .frame img 的比例锁定。旧的 layout-grid 规则留在上面但已无对应 DOM，不影响。 */
body[data-tool="id-photo"] .idphoto-demo .demo-layout { padding: 6px !important; }
body[data-tool="id-photo"] .idphoto-demo .layout-img {
  width: 100% !important; height: 100% !important;
  aspect-ratio: auto !important; object-fit: contain !important;
  display: block; margin: 0 auto;
}

/* ---------- 图片转CAD：DXF 在线预览器（11-27） ----------
   转换成功后在结果区直接展示可缩放 / 平移的 DXF 图纸（与竞品展示方式一致）。
   全部限定在 body[data-tool="image-to-cad"] 下，其他工具页不受影响。 */
body[data-tool="image-to-cad"] .compare__stage { background: #fff; }
body[data-tool="image-to-cad"] .dxf-viewer {
  position: absolute; inset: 0; z-index: 2;
  background: #fff; cursor: grab; touch-action: none; user-select: none;
}
body[data-tool="image-to-cad"] .dxf-viewer.is-dragging { cursor: grabbing; }
body[data-tool="image-to-cad"] .dxf-viewer__canvas { display: block; width: 100%; height: 100%; }
body[data-tool="image-to-cad"] .dxf-viewer__host { position: absolute; inset: 0; }
body[data-tool="image-to-cad"] .dxf-viewer__host canvas { display: block; }
body[data-tool="image-to-cad"] .dxf-viewer__label {
  min-width: 34px; text-align: center; font-size: 12px; font-weight: 600; color: var(--ink-2);
}
body[data-tool="image-to-cad"] .dxf-viewer__tip {
  position: absolute; top: 12px; left: 12px; z-index: 3;
  padding: 5px 10px; border-radius: var(--r-full);
  background: rgba(255, 255, 255, .9); border: 1px solid var(--line);
  color: var(--ink-3); font-size: 12px; line-height: 1.4; pointer-events: none;
}
body[data-tool="image-to-cad"] .dxf-viewer__bar {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 3;
  display: flex; align-items: center; gap: 3px;
  padding: 5px 7px; border-radius: var(--r-full);
  background: rgba(255, 255, 255, .96); border: 1px solid var(--line); box-shadow: var(--sh-2);
}
body[data-tool="image-to-cad"] .dxf-viewer__btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px;
  border: 0; border-radius: var(--r-full); background: transparent;
  color: var(--ink-2); cursor: pointer;
}
body[data-tool="image-to-cad"] .dxf-viewer__btn:hover { background: var(--well); color: var(--ln-deep); }
body[data-tool="image-to-cad"] .dxf-viewer__btn svg { width: 18px; height: 18px; }
body[data-tool="image-to-cad"] .dxf-viewer__pct {
  min-width: 46px; text-align: center; font-size: 12px; font-weight: 600;
  color: var(--ink-2); font-variant-numeric: tabular-nums;
}
body[data-tool="image-to-cad"] .dxf-viewer__sep { width: 1px; height: 18px; background: var(--line); margin: 0 3px; }
body[data-tool="image-to-cad"] .dxf-viewer__overlay {
  position: fixed; inset: 0; z-index: 9999;
  padding: 24px; background: rgba(15, 23, 42, .82);
  display: flex;
}
body[data-tool="image-to-cad"] .dxf-viewer__overlay .dxf-viewer {
  position: relative; inset: auto; width: 100%; height: 100%;
  border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-2);
}
body[data-tool="image-to-cad"] .dxf-viewer__close {
  position: absolute; top: 14px; right: 18px; z-index: 4;
  width: 38px; height: 38px; border: 0; border-radius: var(--r-full);
  background: rgba(255, 255, 255, .92); color: var(--ink);
  font-size: 26px; line-height: 1; cursor: pointer;
}
@media (max-width: 640px) {
  body[data-tool="image-to-cad"] .dxf-viewer__tip { display: none; }
  body[data-tool="image-to-cad"] .dxf-viewer__overlay { padding: 8px; }
}

/* ---------- 图片转CAD：转换成功结果页（覆盖上传界面，点「继续转换」返回） ---------- */
body[data-tool="image-to-cad"] .cad-result {
  position: fixed; inset: 0; z-index: 9998;
  overflow: auto; padding: 32px 24px 48px;
  background: var(--bg, #fff);
}
body[data-tool="image-to-cad"] .cad-result__inner { max-width: 1180px; margin: 0 auto; }
body[data-tool="image-to-cad"] .cad-result__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 24px;
}
body[data-tool="image-to-cad"] .cad-result__title {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 20px; color: var(--ink);
}
body[data-tool="image-to-cad"] .cad-result__title svg { width: 26px; height: 26px; color: #16a34a; }
body[data-tool="image-to-cad"] .cad-result__again {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border: 1px solid var(--line);
  border-radius: var(--r-md, 10px); background: var(--surface);
  color: var(--ink-2); font-size: var(--t-sm); font-weight: 600; cursor: pointer;
}
body[data-tool="image-to-cad"] .cad-result__again:hover { border-color: var(--ln-line); color: var(--ln-deep); }
body[data-tool="image-to-cad"] .cad-result__again svg { width: 16px; height: 16px; }
body[data-tool="image-to-cad"] .cad-result__cols {
  display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px;
}
body[data-tool="image-to-cad"] .cad-result__label {
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
  color: var(--ink-2); font-size: var(--t-sm); font-weight: 600;
}
body[data-tool="image-to-cad"] .cad-result__label svg { width: 16px; height: 16px; }
body[data-tool="image-to-cad"] .cad-result__stage {
  position: relative; height: 500px; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff;
}
body[data-tool="image-to-cad"] .cad-result__stage > img {
  display: block; width: 100%; height: 100%; object-fit: contain;
}
body[data-tool="image-to-cad"] .cad-result__side h3 {
  margin: 0 0 12px; font-size: var(--t-sm); color: var(--ink); font-weight: 600;
}
body[data-tool="image-to-cad"] .cad-result__file {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; margin-bottom: 10px;
  border: 2px solid var(--line); border-radius: 14px;
  background: var(--surface); color: var(--ink); text-decoration: none;
  transition: border-color var(--d2) var(--ease);
}
body[data-tool="image-to-cad"] .cad-result__file:hover { border-color: var(--ln-line); }
body[data-tool="image-to-cad"] .cad-result__file > svg:first-child {
  width: 40px; height: 40px; padding: 9px; border-radius: 10px; flex: none;
}
body[data-tool="image-to-cad"] .cad-result__file.is-dxf > svg:first-child { background: #e0f2fe; color: #0284c7; }
body[data-tool="image-to-cad"] .cad-result__file.is-dwg > svg:first-child { background: #fee2e2; color: #dc2626; }
body[data-tool="image-to-cad"] .cad-result__file-info {
  flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px;
}
body[data-tool="image-to-cad"] .cad-result__file-info b { font-size: var(--t-sm); font-weight: 600; }
body[data-tool="image-to-cad"] .cad-result__file-info small { font-size: 12px; color: var(--ink-3); }
body[data-tool="image-to-cad"] .cad-result__file > svg:last-child { width: 20px; height: 20px; flex: none; color: var(--ink-2); }
body[data-tool="image-to-cad"] .dxf-viewer__err {
  display: grid; place-items: center; height: 100%; color: var(--ink-3); font-size: 14px;
}
@media (max-width: 900px) {
  body[data-tool="image-to-cad"] .cad-result { padding: 20px 14px 32px; }
  body[data-tool="image-to-cad"] .cad-result__cols { grid-template-columns: 1fr; }
  body[data-tool="image-to-cad"] .cad-result__stage { height: 420px; }
}

/* 本地压缩 / 转换：处理中的按钮禁用反馈（仅这两页，其他功能页不受影响） */
body[data-tool="compress"] .btn:disabled,
body[data-tool="convert"] .btn:disabled { opacity: .62; cursor: not-allowed; }
body[data-tool="compress"] .btn.is-busy,
body[data-tool="convert"] .btn.is-busy { cursor: progress; }

/* 四方连续：接口固定出 2 张结果图，结果区两张并排展示 */
body[data-tool="seamless-tile"] .tile-results {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--g3);
}
body[data-tool="seamless-tile"] .tile-result {
  border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden;
  background: var(--well); display: flex; flex-direction: column;
}
body[data-tool="seamless-tile"] .tile-result__thumb {
  display: block; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; background: var(--well);
}
body[data-tool="seamless-tile"] .tile-result__thumb img {
  width: 100%; height: 100%; object-fit: contain; display: block;
}
body[data-tool="seamless-tile"] .tile-result__foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--g2);
  padding: 8px 10px; background: var(--panel, #fff);
}
body[data-tool="seamless-tile"] .tile-result__label { font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); }
/* 历史记录 2 张结果：两个下载按钮上下排列，间距收窄 */
body[data-tool="seamless-tile"] .hist { gap: 6px; padding: 4px 6px; }
body[data-tool="seamless-tile"] .hist__dls { display: flex; flex-direction: column; flex: none; gap: 3px; }
body[data-tool="seamless-tile"] .hist__dls .hist__dl { padding: 3px 6px; }
/* 对比模式：隐藏右侧历史记录，中间预览占满剩余宽度 */
body[data-tool="seamless-tile"].seam-compare-mode .toolgrid--seamless > :nth-child(3) { display: none; }
@media (min-width: 1001px) {
  body[data-tool="seamless-tile"].seam-compare-mode .toolgrid--seamless {
    grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
  }
}
@media (max-width: 900px) {
  body[data-tool="seamless-tile"] .tile-results { grid-template-columns: 1fr; }
}
