/* 美工 megong.com — 自托管样式，零外部依赖 */
:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #1b2330;
  --muted: #6b7787;
  --line: #e4e8ee;
  --brand: #4f46e5;
  --brand-soft: #eef0ff;
  --accent: #f59e0b;
  --ok: #0f9d76;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 30, 55, .04), 0 8px 24px rgba(20, 30, 55, .05);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- 导航 ---------- */
.site-head {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.head-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; align-items: baseline; gap: 9px; color: var(--ink); font-weight: 800; font-size: 21px; letter-spacing: .5px; }
.brand:hover { text-decoration: none; }
.brand em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--muted); letter-spacing: 1px; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--brand); color: #fff; font-size: 15px; font-weight: 800;
  margin-right: 2px; align-self: center;
}
.nav { display: flex; gap: 22px; align-items: center; }
.nav a { color: var(--muted); font-size: 14px; font-weight: 600; }
.nav a:hover, .nav a.on { color: var(--brand); text-decoration: none; }
.nav .nav-cta {
  background: var(--brand); color: #fff; padding: 7px 14px; border-radius: 9px; font-size: 13px;
}
.nav .nav-cta:hover { background: #4239d0; color: #fff; text-decoration: none; }

/* 页头「收藏本站」按钮与指引弹层 */
.bm-wrap { position: relative; display: inline-flex; flex: none; }
.nav .nav-bookmark {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 9px; padding: 6px 11px; min-height: 36px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.nav .nav-bookmark:hover,
.nav .nav-bookmark[aria-expanded="true"] { color: var(--brand); border-color: #c9c6f8; background: #f7f6ff; }
.nav .nav-bookmark:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.nav-bookmark svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; flex: none; }
.bm-pop {
  position: absolute; top: calc(100% + 12px); right: 0; z-index: 30;
  width: 274px; padding: 15px 16px 13px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(40, 36, 100, .16); text-align: left;
}
.bm-pop[hidden] { display: none; }
.bm-pop strong { display: block; font-size: 14px; color: var(--ink); margin-bottom: 9px; }
.bm-pop p { margin: 0 0 9px; font-size: 12.5px; line-height: 1.65; color: var(--muted); }
.bm-pop .bm-tip { color: #8a90a0; font-size: 12px; margin-bottom: 12px; }
.bm-pop kbd {
  display: inline-block; padding: 1px 5px; margin: 0 1px; border: 1px solid var(--line);
  border-bottom-width: 2px; border-radius: 5px; background: #f7f7fb;
  font-family: inherit; font-size: 12px; color: var(--ink);
}
.bm-pop button {
  border: 1px solid var(--line); background: var(--brand-soft); color: var(--brand);
  border-radius: 8px; padding: 6px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.bm-pop button:hover { border-color: #c9c6f8; }
.bm-mobile { display: none; }
/* 手机端规则统一放在本文件末尾，避免被后面的基础样式覆盖 */

/* ---------- 首页 ---------- */
.hero { padding-top: 68px; padding-bottom: 42px; }
.hero-kicker {
  display: inline-block; background: var(--brand-soft); color: var(--brand);
  padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .5px;
}
.hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.25; margin: 18px 0 14px; letter-spacing: -.5px; }
.hero h1 span { color: var(--brand); }
.hero p.lead { font-size: 17px; color: var(--muted); max-width: 680px; margin: 0 0 24px; }
.hero-points { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-bottom: 30px; }
.hero-points span { font-size: 14px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.hero-points i {
  width: 18px; height: 18px; border-radius: 50%; background: var(--ok); color: #fff;
  font-style: normal; font-size: 11px; line-height: 18px; text-align: center; flex: none;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--brand); color: #fff; border: 1px solid var(--brand);
  padding: 10px 20px; border-radius: 10px; font-size: 14px; font-weight: 700;
  cursor: pointer; font-family: inherit; transition: .15s;
}
.btn:hover { background: #4239d0; color: #fff; text-decoration: none; }
.btn:disabled { background: #b9bde0; border-color: #b9bde0; cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: #fafbff; border-color: var(--brand); color: var(--brand); }
.btn-mini { padding: 5px 12px; font-size: 12px; border-radius: 8px; }
.hero-rule {
  margin-top: 46px; height: 1px;
  background: linear-gradient(90deg, var(--brand), #8b8bf0 40%, var(--accent) 75%, transparent);
  opacity: .55;
}

/* ---------- 区块 ---------- */
.section { padding-top: 44px; padding-bottom: 44px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head h2 { font-size: 24px; margin: 0 0 4px; letter-spacing: -.3px; }
.section-head p { margin: 0; color: var(--muted); font-size: 14px; }
.section-head a { font-size: 13px; font-weight: 600; white-space: nowrap; }

.grid-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-cards.cards-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) {
  .grid-cards, .grid-cards.cards-2, .grid-cards.cards-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .grid-cards, .grid-cards.cards-2, .grid-cards.cards-3 { grid-template-columns: 1fr; }
}
.card {
  display: block; position: relative; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  color: var(--ink); transition: .16s;
}
.card:hover { transform: translateY(-3px); border-color: #c9c6f8; text-decoration: none; box-shadow: 0 10px 28px rgba(60, 55, 160, .10); }
.card .ico {
  width: 56px; height: 56px; border-radius: 16px;
  background: linear-gradient(145deg, var(--ico-bg, var(--brand-soft)), #fff 145%);
  box-shadow: inset 0 0 0 1px rgba(60, 55, 160, .07), 0 3px 10px rgba(60, 55, 160, .07);
  display: flex; align-items: center; justify-content: center;
  color: var(--ico-fg, var(--brand)); margin-bottom: 16px; flex: none;
}
.card .ico svg { width: 30px; height: 30px; transition: transform .18s; }
.card:hover .ico svg { transform: scale(1.09); }
.card h3 { margin: 0 0 6px; font-size: 17px; }
.card p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.65; }
.card .tag { display: inline-block; margin-top: 12px; font-size: 11.5px; color: var(--brand); font-weight: 700; }

/* 首页工具区：图标放大成主视觉，文字只留一行能力标签、卡片等高。
   详细介绍仍在各自工具页（desc 全文 + 怎么用 + FAQ），首页不重复长文案。 */
#tools .grid-cards .card { display: flex; flex-direction: column; min-height: 188px; }
#tools .grid-cards .card .ico {
  width: 64px; height: 64px; border-radius: 18px; margin-bottom: 14px;
  background: linear-gradient(145deg, var(--ico-bg, var(--brand-soft)), rgba(255, 255, 255, .32) 190%);
}
#tools .grid-cards .card .ico svg { width: 40px; height: 40px; }
#tools .grid-cards .card p {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
#tools .grid-cards .card .tag {
  margin-top: auto; padding-top: 8px; align-self: flex-end;
  font-size: 17px; line-height: 1; font-weight: 400;
}
@media (max-width: 560px) {
  #tools .grid-cards .card { min-height: 0; }
}

/* 首页：星标收藏 */
.star {
  position: absolute; top: 11px; right: 11px; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px; font-size: 18px; line-height: 1; color: #b9c0cb;
  cursor: pointer; user-select: none; -webkit-user-select: none; transition: .15s;
}
.star:hover, .star:focus-visible { color: var(--accent); background: #fff7e6; outline: none; }
.star.on { color: var(--accent); }

/* 首页：我常用的（只加一行快捷入口，不重排下方宫格） */
.my-tools {
  margin: 0 0 18px; padding: 13px 16px; border: 1px solid #ddd9fb;
  background: linear-gradient(180deg, #f7f6ff, #fdfdff); border-radius: var(--radius);
}
.my-tools[hidden] { display: none; }
.my-tools-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.my-tools-head strong { font-size: 14px; color: var(--ink); }
.my-tools-head .hint { font-size: 12px; color: var(--muted); flex: 1; min-width: 130px; }
.my-tools-head #my-tools-hint { flex: 0 0 auto; color: var(--ok); }
.my-tools-head button {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 8px; padding: 5px 10px; font-size: 12px; cursor: pointer;
}
.my-tools-head button:hover { color: var(--brand); border-color: #c9c6f8; }
.my-tools-row { display: flex; flex-wrap: wrap; gap: 8px; }
.my-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  font-size: 13px; color: var(--ink); text-decoration: none;
}
.my-chip:hover { border-color: #c9c6f8; color: var(--brand); }
.my-chip em { font-style: normal; font-size: 11px; color: var(--muted); }
.my-chip .chip-star { color: var(--accent); font-size: 12px; }
@media (max-width: 600px) {
  .my-tools-head strong { order: 0; }
  .my-tools-head button { order: 1; margin-left: auto; }
  .my-tools-head .hint { order: 2; flex: 1 1 100%; min-width: 0; }  /* 说明独占第二行 */
  .my-tools-head #my-tools-hint { flex: 0 0 auto; }
  .star { top: 8px; right: 8px; }
}

/* ---------- 通用页面 ---------- */
.page { padding-top: 30px; padding-bottom: 56px; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.crumb a { color: var(--muted); }
.crumb span { margin: 0 7px; color: #b8c0cc; }
.page-title h1 { font-size: 30px; margin: 0 0 8px; letter-spacing: -.4px; }
.page-title p { color: var(--muted); margin: 0 0 26px; font-size: 15.5px; max-width: 760px; }
/* 工具页标题也带上该工具自己的图标 */
.title-row { display: flex; align-items: center; gap: 13px; }
.title-row h1 { margin: 0; }
.title-row .ico {
  width: 58px; height: 58px; border-radius: 16px; flex: none;
  background: linear-gradient(145deg, var(--ico-bg, var(--brand-soft)), #fff 145%);
  box-shadow: inset 0 0 0 1px rgba(60, 55, 160, .07), 0 3px 10px rgba(60, 55, 160, .07);
  color: var(--ico-fg, var(--brand));
  display: flex; align-items: center; justify-content: center;
}
.title-row .ico svg { width: 32px; height: 32px; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-pad { padding: 24px; }
.panel h2 { font-size: 18px; margin: 0 0 14px; }
.panel h3 { font-size: 15px; margin: 22px 0 8px; }

/* ---------- 工具页 ---------- */
.tool-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 860px) { .tool-layout { grid-template-columns: minmax(0, 1fr); } }
.tool-controls { padding: 22px; }
.tool-preview { padding: 18px; }
[hidden] { display: none !important; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 7px; }
.field label small { font-weight: 500; color: var(--muted); }
.field input[type="text"], .field input[type="number"], .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 14px; font-family: inherit; color: var(--ink); background: #fff;
}
.field textarea { resize: vertical; min-height: 96px; line-height: 1.6; font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
/* 色值 / 盒子阴影输出有 7~8 行，默认高度会把后半截藏起来 */
.tool[data-tool="colors"] #cssOut, .tool[data-tool="css-box"] #cssOut { min-height: 178px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.field input[type="range"] { width: 100%; accent-color: var(--brand); }
.field input[type="color"] { width: 100%; height: 38px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: #fff; cursor: pointer; }
.field .inline { display: flex; align-items: center; gap: 9px; }
.field .inline input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand); }
.field .inline label { margin: 0; font-weight: 500; font-size: 13px; }
.field .val { font-size: 12px; color: var(--muted); min-width: 42px; text-align: right; }
.uploader input[type="file"] { display: none; }
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 108px; padding: 16px; text-align: center; cursor: pointer;
  border: 2px dashed #cfd5e2; border-radius: 11px; background: #fbfcff;
  font-size: 14px; font-weight: 600; color: var(--brand); transition: .15s;
}
.drop span { display: block; font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 5px; }
.drop:hover, .drop.is-over { border-color: var(--brand); background: var(--brand-soft); }
.preview-stage {
  min-height: 260px; border-radius: 10px; border: 1px solid var(--line);
  background: #fafbfd; display: flex; align-items: center; justify-content: center;
  padding: 16px; overflow: hidden;
}
.preview-empty { color: var(--muted); font-size: 13.5px; text-align: center; }
.preview-canvas { max-width: 100%; height: auto; display: block; border-radius: 6px; box-shadow: 0 2px 12px rgba(0, 0, 0, .08); }
.preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
#status { font-size: 12.5px; color: var(--muted); min-height: 20px; flex: 1; }

/* ---------- 拍报机：预览跟随滚动 + 照片风格缩略图 ---------- */
@media (min-width: 861px) {
  .tool[data-tool="newspaper"] .tool-preview { position: sticky; top: 14px; }
  .np-canvas { max-height: calc(100vh - 120px); width: auto; }
}
@media (max-width: 860px) {
  .tool[data-tool="newspaper"] .tool-preview { order: -1; }
  .np-canvas { max-height: 62vh; width: auto; margin: 0 auto; }
}
/* 两个按钮 + 长状态文字在窄屏会互相挤，改成上下两行 */
@media (max-width: 560px) {
  .tool[data-tool="newspaper"] .preview-bar,
  .tool[data-tool="album"] .preview-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .tool[data-tool="newspaper"] .preview-bar .btn,
  .tool[data-tool="album"] .preview-bar .btn { width: 100%; }
  .tool[data-tool="newspaper"] #status,
  .tool[data-tool="album"] #status { flex: none; }
}
.tone-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tone-cards.is-disabled { opacity: .45; pointer-events: none; }
.tone-card {
  border: 1.5px solid var(--line); border-radius: 9px; background: #fff;
  padding: 5px 5px 7px; cursor: pointer; font: inherit; text-align: center;
  display: flex; flex-direction: column; gap: 5px;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}
.tone-card:hover { border-color: var(--brand); }
.tone-card:active { transform: scale(.96); }
.tone-card.on { border-color: #2a2620; box-shadow: 0 0 0 2px rgba(42, 38, 32, .16); }
.tone-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.tone-thumb {
  width: 100%; aspect-ratio: 4 / 3; border-radius: 6px; display: block;
  background-size: cover; background-position: center;
}
/* 没传照片时的占位效果：四种风格各画一种示意 */
.tone-thumb[data-tone="newsprint"] { background-color: #f4eedf; background-image: radial-gradient(#2a2620 1.4px, transparent 1.5px); background-size: 6px 6px; }
.tone-thumb[data-tone="bw"] { background-image: linear-gradient(155deg, #f7f7f7 20%, #9a9a9a 85%); }
.tone-thumb[data-tone="sepia"] { background-image: linear-gradient(155deg, #f3e2c2 20%, #a4744a 85%); }
.tone-thumb[data-tone="normal"] { background-image: linear-gradient(150deg, #7fb2e5 25%, #e5a1b8 60%, #f0d08a 95%); }
.tone-name { font-size: 11.5px; color: var(--ink); line-height: 1.2; }
.tone-card.on .tone-name { font-weight: 700; }
@media (max-width: 420px) { .tone-cards { grid-template-columns: repeat(2, 1fr); } }

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  padding: 6px 11px; border-radius: 8px; font-size: 12.5px; cursor: pointer; font-family: inherit;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
/* 抠图换底色：常用底色色板 + HEX 直输 */
.cut-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.cut-swatch {
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
  border: 1px solid rgba(0, 0, 0, .14); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
  transition: transform .12s ease;
}
.cut-swatch:hover { transform: scale(1.12); }
.cut-swatch.on { outline: 2px solid var(--brand); outline-offset: 2px; }
.color-row { display: flex; gap: 8px; align-items: center; }
.color-row input[type="color"] {
  width: 46px; height: 34px; padding: 2px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; cursor: pointer; flex: none;
}
.color-row input[type="text"] { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; }
.color-row input[type="text"].bad { border-color: #d9001b; color: #d9001b; }
.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-top: 16px; }
@media (max-width: 560px) { .swatches { grid-template-columns: repeat(2, 1fr); } }
.swatch {
  border: 1px solid var(--line); border-radius: 10px; min-height: 96px; cursor: pointer;
  display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start;
  padding: 9px; font-family: inherit; color: #fff; text-align: left;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
}
.swatch span { font-size: 13px; font-weight: 800; }
.swatch small { font-size: 10.5px; opacity: .85; }
.grid-cells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.grid-cell { text-align: center; font-size: 12px; color: var(--muted); }
.grid-thumb { width: 100%; height: auto; border-radius: 7px; border: 1px solid var(--line); display: block; }
.grid-cell button { margin-top: 6px; }
#gradPreview { height: 240px; border-radius: 10px; border: 1px solid var(--line); }
#boxStage {
  min-height: 300px; border-radius: 10px; border: 1px solid var(--line);
  background: #f1f3f8; display: flex; align-items: center; justify-content: center; padding: 24px;
}
#boxPreview { transition: .12s; }

/* ---------- 颜色转换 / 证件照排版 ---------- */
#colorStage { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
#colorDemo { padding: 26px 22px; min-height: 170px; }
#colorDemo h3 { margin: 0 0 10px; font-size: 20px; }
#colorDemo p { margin: 0; font-size: 14px; }
#contrastOut {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 14px 18px; background: #f8f9fc; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted);
}
#contrastOut .ratio { font-size: 20px; font-weight: 800; color: var(--ink); }
#contrastOut .badge {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700; background: var(--line); color: var(--ink);
}
#contrastOut .badge.pass { background: #dff5ec; color: #0b7a5b; }
#contrastOut .badge.fail { background: #fde8e5; color: #b13a2c; }
.field input:disabled { background: #f2f4f8; color: var(--muted); cursor: not-allowed; }

/* ---------- 文章 / 速查 ---------- */
.prose { max-width: 760px; }
.prose h2 { font-size: 20px; margin: 30px 0 10px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.prose p { margin: 0 0 14px; color: #33404f; }
.prose .note { background: var(--brand-soft); border-left: 3px solid var(--brand); padding: 12px 15px; border-radius: 0 8px 8px 0; font-size: 13.5px; color: #3a3f6b; margin: 14px 0; }
table { width: 100%; border-collapse: collapse; margin: 14px 0 18px; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
th { background: #f8f9fc; font-size: 12.5px; color: var(--muted); font-weight: 700; }
td:first-child { font-weight: 600; }
.related-list { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; }
.related-list a { background: #fff; border: 1px solid var(--line); padding: 7px 13px; border-radius: 8px; font-size: 13px; font-weight: 600; }
.related-list a:hover { border-color: var(--brand); text-decoration: none; }
.verify-note { font-size: 12.5px; color: var(--muted); background: #fff8ea; border: 1px solid #f4e2bb; border-radius: 9px; padding: 10px 14px; margin: 22px 0; }

/* ---------- 引流 / 变现位 ---------- */
.cta-band {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin: 12px 0 0;
}
@media (max-width: 700px) { .cta-band { grid-template-columns: 1fr; } }
.cta-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.cta-card h3 { margin: 0 0 8px; font-size: 18px; }
.cta-card p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.ad-slot { margin: 26px 0 0; }

/* ---------- 页脚 ---------- */
.site-foot { border-top: 1px solid var(--line); background: #fff; margin-top: 40px; padding: 30px 0 36px; }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 24px; }
@media (max-width: 700px) { .foot-grid { grid-template-columns: 1fr; } }
.foot-grid h4 { font-size: 13px; margin: 0 0 10px; }
.foot-grid a { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.foot-grid a:hover { color: var(--brand); }
.foot-note { font-size: 12.5px; color: var(--muted); margin: 22px 0 0; line-height: 1.8; }
.foot-note strong { color: var(--ink); }

/* ---------- 手机端适配（≤720px）----------
   放在文件末尾以保证层叠顺序：导航不换行成竖排、触摸目标 ≥40px、
   表格可横滚、首屏更早看到工具卡。 */
@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  /* .hero/.section/.page 的 padding 简写会把 .wrap 左右留白清零，这里单独补回来 */
  .hero.wrap, .section.wrap, .page.wrap { padding-left: 16px; padding-right: 16px; }

  /* 导航：收起次要入口（其余在页脚都有），可见项一律禁止换行 */
  .head-inner { height: 56px; }
  /* 手机隐藏 <em> 后，baseline 对齐会把「美工」顶到方块上方，改为整体居中 */
  .brand { white-space: nowrap; flex: none; font-size: 19px; align-items: center; line-height: 1; }
  .nav { gap: 8px; flex: none; }
  .nav a {
    white-space: nowrap; flex: none; font-size: 13px; padding: 0 8px;
    display: inline-flex; align-items: center; min-height: 44px;
  }
  .nav .nav-cta { padding: 0 14px; min-height: 40px; }
  .brand em { display: none; }
  .nav .hide-sm,
  .nav a[href$="templates.html"],
  .nav a[href$="hire.html"]:not(.nav-cta) { display: none; }

  /* 首屏与区块留白收紧，让工具卡更早出现 */
  .hero { padding: 32px 0 26px; }
  .hero h1 { font-size: clamp(28px, 8vw, 36px); margin: 14px 0 12px; }
  .hero p.lead { font-size: 15.5px; margin-bottom: 20px; }
  .hero-points { gap: 8px 18px; margin-bottom: 22px; }
  .hero-points span { font-size: 13px; }
  .hero-actions { gap: 10px; }
  .hero-actions .btn { min-height: 44px; padding: 10px 18px; }
  .hero-rule { margin-top: 30px; }
  .section { padding: 30px 0; }
  .page { padding: 22px 0 44px; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 6px; }
  .section-head h2 { font-size: 21px; }
  .page-title h1 { font-size: 26px; }

  /* 正文最小字号 12px */
  .card .tag { font-size: 12.5px; }
  .swatch small { font-size: 12px; }

  /* 表格：独立滚动容器 + 滑动提示，保持三列不再挤成多行 */
  .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-scroll::after {
    content: "← 左右滑动查看完整表格 →";
    display: block; margin: 0 0 4px; font-size: 12px;
    color: var(--muted); text-align: center;
  }
  table { min-width: 480px; }
  th, td { padding: 10px 12px; }

  /* 触摸目标：控件不小于 40px，输入框 16px 防 iOS 聚焦缩放 */
  .btn { min-height: 44px; }
  .field input[type="text"], .field input[type="number"],
  .field select, .field textarea { padding: 11px 12px; font-size: 16px; }
  .field textarea { font-size: 14px; }
  .field input[type="color"] { height: 44px; }
  .field .inline label { min-height: 40px; display: inline-flex; align-items: center; }
  .field input[type="range"] {
    height: 40px; margin: 0; cursor: pointer;
    -webkit-appearance: none; appearance: none; background: transparent;
  }
  .field input[type="range"]::-webkit-slider-runnable-track {
    height: 6px; border-radius: 999px; background: var(--line);
  }
  .field input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 24px; height: 24px; border-radius: 50%; margin-top: -9px;
    background: var(--brand); border: 2px solid #fff;
    box-shadow: 0 1px 5px rgba(20, 30, 55, .28);
  }
  .field input[type="range"]::-moz-range-track {
    height: 6px; border-radius: 999px; background: var(--line);
  }
  .field input[type="range"]::-moz-range-thumb {
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--brand); border: 2px solid #fff;
    box-shadow: 0 1px 5px rgba(20, 30, 55, .28);
  }
  .chip, .btn-mini { min-height: 40px; padding: 8px 14px; }
  .crumb a { display: inline-block; padding: 8px 2px; }
  .related-list a { min-height: 40px; display: inline-flex; align-items: center; padding: 8px 13px; }
  .foot-grid a { min-height: 40px; display: flex; align-items: center; padding: 6px 0; }
  .drop { min-height: 96px; }
  .brand { min-height: 44px; }
  .field label small { font-size: 12px; }
  .field input[type="checkbox"] { width: 20px; height: 20px; }
  .crumb a { padding: 10px 4px; }
  .section-head a { display: inline-flex; align-items: center; min-height: 40px; }
  .foot-note a { display: inline-block; padding: 10px 0; }

  /* 单栏时预览区不必占满一屏 */
  .preview-stage { min-height: 200px; }
  .tool-controls { padding: 18px; }
  .tool-preview { padding: 16px; }

}

/* ---------- 证件照上传前自检：逐项实测值 ---------- */
.check-report {
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); overflow: hidden; min-height: 220px;
}
.check-report .preview-empty { padding: 40px 16px; }
.ck-head {
  padding: 10px 14px; background: var(--brand-soft); color: #3730a3;
  font-size: 12.5px; font-weight: 600; letter-spacing: .2px;
}
.ck-row {
  display: grid; grid-template-columns: 165px minmax(0, 1fr);
  gap: 2px 14px; padding: 9px 14px;
  border-bottom: 1px solid var(--line); font-size: 13.5px;
}
.ck-row:last-of-type { border-bottom: 0; }
.ck-k { font-weight: 600; color: var(--ink); }
.ck-v {
  font-weight: 600; color: var(--brand);
  font-variant-numeric: tabular-nums; word-break: break-all;
}
.ck-n { grid-column: 2; font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.ck-row.warn { background: #fff8ec; }
.ck-row.warn .ck-v { color: #b45309; }
.ck-foot {
  padding: 11px 14px; background: #fafbfd; color: var(--muted);
  font-size: 12.5px; line-height: 1.6; border-top: 1px solid var(--line);
}

/* 单栏时把「逐项实测值」提到参数前面，并改成单列阅读 */
@media (max-width: 860px) {
  .tool[data-tool="idcheck"] .tool-preview { order: -1; }
  .ck-row { grid-template-columns: 1fr; gap: 1px; padding: 10px 12px; }
  .ck-n { grid-column: 1; }
  .ck-k { font-size: 12.5px; }
  .ck-v { font-size: 14.5px; word-break: break-word; }
}

/* ---------- 城市头版拍报机 ---------- */
.np-canvas { cursor: grab; touch-action: none; }
.np-canvas.is-dragging { cursor: grabbing; }
.np-recenter-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.np-hint { font-size: 12px; color: var(--muted); line-height: 1.5; }
.np-hint strong { color: var(--ink); }
#npCustomBox {
  border-left: 3px solid var(--brand-soft); padding-left: 12px;
  margin: -4px 0 18px;
}
#npCustomBox .field:last-child { margin-bottom: 4px; }
.tool[data-tool="newspaper"] #npBody {
  min-height: 148px; font-family: inherit; font-size: 13px; line-height: 1.7;
}

/* ---------- 电子相册 ---------- */
.album-stage {
  min-height: 280px; border-radius: 10px; border: 1px solid var(--line);
  background: #fafbfd; display: flex; align-items: center; justify-content: center;
  padding: 12px; overflow: hidden;
}
.album-frame {
  width: 100%; height: 430px; border: 0; border-radius: 8px;
  background: #fff; display: block;
}
.album-list-head {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 12.5px; color: var(--muted); margin: 16px 0 8px;
}
.album-list-head span:last-child { font-weight: 700; color: var(--brand); }
.album-list { display: grid; gap: 9px; max-height: 420px; overflow-y: auto; padding-right: 4px; }
.album-empty {
  color: var(--muted); font-size: 13px; text-align: center; padding: 18px;
  border: 1px dashed var(--line); border-radius: 10px;
}
.album-item {
  display: grid; grid-template-columns: 26px 62px minmax(0, 1fr) auto;
  align-items: center; gap: 10px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff;
}
.album-num {
  font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; text-align: center;
}
.album-thumb {
  width: 62px; height: 52px; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--line); display: block;
}
.album-item-main { min-width: 0; }
.album-fname {
  font-size: 11.5px; color: var(--muted);
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.album-cap {
  width: 100%; margin-top: 4px; padding: 5px 8px; font-size: 12.5px;
  font-family: inherit; color: var(--ink); background: #fbfcff;
  border: 1px solid var(--line); border-radius: 7px;
}
.album-cap:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.album-item-btns { display: flex; gap: 4px; }
.album-item-btns button {
  width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 7px;
  background: #fff; color: var(--muted); font-size: 14px; cursor: pointer; font-family: inherit;
}
.album-item-btns button:hover { border-color: var(--brand); color: var(--brand); }
.album-item-btns button[data-act="del"]:hover { border-color: #d1435b; color: #d1435b; }

@media (max-width: 560px) {
  .title-row { gap: 10px; }
  .title-row .ico { width: 50px; height: 50px; border-radius: 14px; }
  .title-row .ico svg { width: 28px; height: 28px; }
  .card .ico { width: 52px; height: 52px; border-radius: 15px; }
  .card .ico svg { width: 28px; height: 28px; }
  .album-stage { min-height: 220px; padding: 8px; }
  .album-frame { height: 320px; }
  .album-list { max-height: 340px; }
  .album-item { grid-template-columns: 20px 50px minmax(0, 1fr) auto; gap: 7px; padding: 7px; }
  .album-thumb { width: 50px; height: 44px; }
  .album-item-btns { flex-direction: column; }
  .album-item-btns button { width: 27px; height: 27px; font-size: 12px; }
  .album-cap { font-size: 16px; padding: 7px 8px; }
  #npCustomBox { padding-left: 9px; }
}

/* 页头收藏按钮：手机端只留星形图标，弹层向左让开屏幕边缘 */
@media (max-width: 720px) {
  .nav .bm-label { display: none; }
  .nav .nav-bookmark { padding: 0 9px; min-height: 40px; }
  .bm-desktop { display: none; }
  .bm-mobile { display: block; }
  /* 手机上按钮位置会随导航收起而左移，改为贴视口两侧，任何宽度都不越界 */
  .bm-pop {
    position: fixed; top: 62px; left: 16px; right: 16px;
    width: auto; max-width: none;
  }
}
/* 320px 级窄屏：收掉次要导航项，保证「找人做图」和收藏按钮都不被挤出视口 */
@media (max-width: 360px) {
  .nav { gap: 6px; }
  .nav a[href$="#guides"] { display: none; }
}

/* 预览查看缩放：只改显示尺寸，导出画布像素不变 */
.zoom-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  min-width: 0; max-width: 100%;
  margin-top: 10px; font-size: 12.5px; color: var(--muted);
}
.zoom-bar[hidden] { display: none; }
.zoom-btn {
  min-width: 30px; height: 28px; padding: 0 9px;
  border: 1px solid var(--line); border-radius: 6px;
  background: #fff; color: var(--ink); font: inherit; font-size: 12.5px;
  line-height: 1; white-space: nowrap; cursor: pointer;
}
.zoom-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.zoom-btn:disabled { opacity: .45; cursor: not-allowed; }
.zoom-btn[aria-pressed="true"] {
  background: var(--brand-soft); border-color: var(--brand); color: var(--brand);
}
.zoom-pct {
  min-width: 46px; text-align: center; color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.zoom-note { margin-left: auto; font-size: 12px; color: var(--muted); }
.preview-stage.zoom-on {
  display: block; overflow: auto; max-height: 70vh; text-align: center;
}
.preview-stage.zoom-on canvas.preview-canvas { display: block; margin: 0 auto; }
.preview-stage.zoom-active {
  cursor: zoom-in; border-color: var(--brand); background: var(--brand-soft);
}
@media (max-width: 560px) {
  .zoom-bar { gap: 6px; }
  .zoom-note { flex-basis: 100%; margin-left: 0; }
}
