/* Pixora 免费工具站 v2：移动优先设计系统。
 * 原则：白底 + 深灰 + 一个蓝色主色；8px 间距体系；手机 375px 先成立，再扩到桌面。
 * 工具页与首页共用同一套 token，改色只改 :root。 */
:root {
  --bg: #ffffff; --surface: #f6f8fa; --ink: #111827; --muted: #5b6472;
  --line: #e5e9ef; --accent: #2563eb; --accent-hover: #1d4ed8; --accent-soft: #eff4ff;
  --green: #15803d; --green-soft: #edf7f0; --red: #b91c1c; --red-soft: #fdf0ef;
  --radius: 12px; --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* 粘性页脚：内容短时页脚贴视口底，内容长时跟在内容后（不遮挡、不 fixed）。 */
body { margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px; line-height: 1.6;
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body > div.wrap { flex: 1; }
a { color: var(--accent); }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 20px; }
@media (max-width: 480px) { .wrap { padding: 0 16px; } }

/* ---- 顶栏：60px，三个链接在手机上也完整可见，不用汉堡 ---- */
header.top { background: var(--bg); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
header.top .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; letter-spacing: .5px; text-decoration: none; color: var(--ink); }
.logo img { display: block; width: 28px; height: 28px; }
.logo i { color: var(--accent); font-style: normal; }
nav.main { margin-left: auto; display: flex; gap: 20px; }
nav.main a { text-decoration: none; color: var(--ink); font-size: 15px; padding: 8px 0; }
nav.main a:hover { color: var(--accent); }
@media (max-width: 480px) {
  header.top .wrap { gap: 16px; }
  nav.main { gap: 14px; }
  nav.main a { font-size: 14px; }
}

/* ---- 按钮：48px 触摸高度；手机端主按钮通栏 ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px;
  background: var(--accent); color: #fff; border: 0; border-radius: 999px;
  padding: 0 28px; font-size: 16px; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--accent-hover); }
.btn.secondary { background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.btn.secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: .45; cursor: default; }
@media (max-width: 480px) { .hero .btn { width: 100%; } }

/* ---- 首页 hero：一屏只讲一件事，先信任承诺，再主行动 ---- */
.hero { padding: 56px 0 32px; }
@media (max-width: 480px) { .hero { padding: 36px 0 24px; } }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 32px; align-items: center; }
@media (max-width: 720px) { .hero-grid { grid-template-columns: 1fr; } }
.hero-copy p { color: var(--muted); font-size: 17px; margin: 0 0 24px; max-width: 620px; }
@media (max-width: 480px) { .hero-copy p { font-size: 15px; margin: 0 0 20px; } }
.hero-copy .cta-row { display: flex; gap: 12px; flex-wrap: wrap; }
@media (max-width: 480px) { .hero-copy .cta-row { flex-direction: column; } }
.hero-visual { margin: 0; background: var(--bg); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px; box-shadow: var(--shadow); }
.hero-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hero-imgs img { width: 100%; height: auto; border-radius: 8px; display: block; }
.hero-imgs figcaption { font-size: 13px; color: var(--muted); text-align: center; margin-top: 6px; }
.hero-imgs .save { color: var(--green); font-weight: 700; }
.hero-note { font-size: 13px; color: var(--muted); text-align: center; margin-top: 10px; }
.eyebrow { display: inline-block; background: var(--accent-soft); color: var(--accent);
  font-size: 13px; font-weight: 700; padding: 5px 12px; border-radius: 999px; margin-bottom: 16px; }
.hero h1 { font-size: 40px; line-height: 1.25; margin: 0 0 14px; letter-spacing: -.5px; }
@media (max-width: 480px) { .hero h1 { font-size: 29px; } }
.trust { display: flex; justify-content: center; gap: 8px 22px; flex-wrap: wrap;
  color: var(--muted); font-size: 14px; margin-top: 20px; }
.trust b { color: var(--green); font-weight: 700; }

/* ---- 场景入口：桌面三列，手机通栏行，整行可点区域足够大 ---- */
.section { padding: 32px 0; }
.section h2 { font-size: 22px; margin: 0 0 6px; letter-spacing: -.3px; }
.section .sub { color: var(--muted); font-size: 15px; margin: 0 0 18px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 720px) { .cards { grid-template-columns: 1fr; } }
.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.card .kicker { font-size: 12px; font-weight: 700; letter-spacing: 1px; color: var(--accent); margin-bottom: 8px; }
.card h3 { margin: 0 0 6px; font-size: 17px; }
.card p { margin: 0 0 14px; color: var(--muted); font-size: 14px; flex: 1; }
.card a { font-size: 15px; font-weight: 700; text-decoration: none; }
.card a::after { content: " →"; }
.card-links { display: flex; flex-direction: column; gap: 8px; }

/* ---- 对照：同一份内容，桌面四列栅格，手机堆叠 + 品牌小标签 ---- */
.cmp { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cmp-row { display: grid; grid-template-columns: 1.1fr 1fr 1fr; border-bottom: 1px solid var(--line); }
.cmp-row:last-child { border-bottom: 0; }
.cmp-row > div { padding: 12px 14px; font-size: 14px; }
.cmp-row .feat { font-weight: 600; }
.cmp-row.head > div { background: var(--surface); font-weight: 700; color: var(--muted); font-size: 13px; }
.cmp-row .yes { color: var(--green); font-weight: 700; }
.cmp-row .lbl { display: none; }
@media (max-width: 720px) {
  .cmp-row.head { display: none; }
  .cmp-row { grid-template-columns: 1fr; }
  .cmp-row > div { padding: 8px 14px; }
  .cmp-row .feat { padding-top: 14px; font-size: 15px; }
  .cmp-row .val:last-child { padding-bottom: 14px; }
  .cmp-row .lbl { display: inline; color: var(--muted); font-weight: 400; margin-right: 6px; }
}

/* ---- FAQ：原生 details，自定义加减号，整行可点 ---- */
.faq details { border: 1px solid var(--line); border-radius: var(--radius); padding: 0; margin-bottom: 10px; overflow: hidden; }
.faq summary { cursor: pointer; font-weight: 600; font-size: 15px; padding: 14px 18px;
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 20px; font-weight: 400; flex-shrink: 0; }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--muted); font-size: 14px; margin: 0; padding: 0 18px 14px; }

/* ---- 页脚 ---- */
footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 20px 0 32px; color: var(--muted); font-size: 13px; }
footer a { color: var(--muted); margin-right: 14px; text-decoration: none; }

/* ---- 广告位：中性灰框；真实 AdSense 接入后由 ads.js 替换为 ins 标签 ---- */
.ad-slot { background: var(--surface); border: 1px dashed #cbd2dc; border-radius: 8px; color: #8a94a3;
  display: flex; align-items: center; justify-content: center; font-size: 13px; margin: 20px 0; }
.ad-slot.leaderboard { height: 90px; }
.ad-slot.infeed { height: 120px; }
.ad-slot.tool-bottom { height: 90px; }
@media (max-width: 480px) {
  .ad-slot.leaderboard, .ad-slot.tool-bottom { height: 64px; }
  .ad-slot.infeed { height: 100px; }
}

/* ---- 工具页：沿用新 token，布局与交互类名不变 ---- */
.tool { display: grid; grid-template-columns: 1fr 300px; gap: 20px; margin: 24px 0; align-items: start; }
@media (max-width: 820px) { .tool { grid-template-columns: 1fr; } }
.panel { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.dropzone { border: 2px dashed #cbd2dc; border-radius: var(--radius); padding: 30px 16px; text-align: center;
  color: var(--muted); cursor: pointer; }
/* 桌面端传图区放大：宽条变工作区，拖拽目标更大、内容垂直居中；手机端保持紧凑不动。 */
@media (min-width: 821px) {
  .dropzone { min-height: 260px; display: flex; flex-direction: column; justify-content: center; }
}
.dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input { display: none; }
/* 下载按钮的 16px 间隔挂在按钮自己身上：按钮隐藏时不占空间，传图区四边间距才一致。 */
#download { margin-top: 16px; }
.stage { position: relative; margin-top: 16px; background: var(--surface); border-radius: 8px; overflow: hidden; }
.stage canvas, .stage img { display: block; max-width: 100%; margin: 0 auto; }
.cropbox { position: absolute; border: 2px solid var(--accent); box-shadow: 0 0 0 9999px rgba(0,0,0,.35); cursor: move; touch-action: none; }
.cropbox .handle { position: absolute; right: -8px; bottom: -8px; width: 18px; height: 18px;
  background: var(--accent); border-radius: 50%; cursor: nwse-resize; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.field select, .field input[type=number], .field input[type=text] {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; }
.seg-row { display: flex; gap: 8px; flex-wrap: wrap; }
.seg-row button { flex: 1; padding: 9px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); cursor: pointer; font-size: 14px; }
.seg-row button.active { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; color: var(--accent); }
.seg-row button:disabled { opacity: .45; cursor: default; }
/* 模式切换：压缩 / 证件照裁剪换底 / HEIC——主导航用实心蓝底，与底色的浅底 active 区分层级。 */
.mode-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.mode-tabs button { flex: 1; padding: 10px 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); cursor: pointer; font-size: 14px; white-space: nowrap; }
.mode-tabs button.active { border-color: var(--accent); background: var(--accent); font-weight: 700; color: #fff; }
.verdict { border-radius: 8px; padding: 12px 14px; font-size: 15px; margin-top: 14px; }
.verdict.ok { background: var(--green-soft); color: var(--green); }
.verdict.warn { background: var(--red-soft); color: var(--red); }
.verdict.info { background: var(--accent-soft); color: var(--ink); }
#segProgressBar.indeterminate { background-image: repeating-linear-gradient(45deg, var(--accent) 0 10px, var(--accent-hover) 10px 20px); animation: segSlide 0.8s linear infinite; }
@keyframes segSlide { from { background-position: 0 0; } to { background-position: 28px 0; } }
.compare-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.compare-imgs figure { margin: 0; }
.compare-imgs img { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.compare-imgs figcaption { font-size: 13px; color: var(--muted); text-align: center; margin-top: 4px; }
.note { font-size: 13px; color: var(--muted); }
code { background: var(--surface); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
