/* ============================================================
   证件照在线 · 共享样式
   设计系统：证件蓝主色 + 中性灰，干净工具感
   ============================================================ */

:root {
  --blue-700: #174a8c;
  --blue-600: #1f5fa8;
  --blue-500: #2b6fc4;
  --blue-100: #e8f0fb;
  --blue-50: #f4f8fd;
  --ink-900: #17233b;
  --ink-700: #33415c;
  --ink-500: #5b6b81;
  --ink-400: #8494ab;
  --line: #dfe6f0;
  --bg: #f6f8fc;
  --white: #ffffff;
  --red-600: #c43a32;
  --red-100: #fbe9e8;
  --green-600: #1e7f5b;
  --green-100: #e6f4ee;
  --shadow-sm: 0 1px 2px rgba(23, 35, 59, 0.06);
  --shadow-md: 0 6px 20px rgba(23, 35, 59, 0.08);
  --radius: 12px;
  --radius-sm: 8px;
  --maxw: 1080px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans SC", -apple-system, "Segoe UI", sans-serif;
  color: var(--ink-900);
  background: var(--bg);
  line-height: 1.65;
  font-size: 16px;
}

img { max-width: 100%; display: block; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* ---------- 顶部导航 ---------- */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 20px;
  height: 60px; display: flex; align-items: center; gap: 24px;
}
.nav-brand {
  display: flex; align-items: center; gap: 9px;
  font-weight: 800; font-size: 18px; color: var(--ink-900);
}
.nav-brand:hover { text-decoration: none; }
.nav-brand svg { flex: none; }
.nav-links { display: flex; gap: 4px; margin-left: auto; align-items: center; }
.nav-links a {
  color: var(--ink-700); font-size: 15px; padding: 7px 12px; border-radius: var(--radius-sm);
}
.nav-links a:hover { background: var(--blue-50); color: var(--blue-600); text-decoration: none; }
.nav-cta {
  background: var(--blue-600) !important; color: #fff !important;
  font-weight: 600; margin-left: 8px;
}
.nav-cta:hover { background: var(--blue-700) !important; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; cursor: pointer; font: inherit;
  font-weight: 600; border-radius: var(--radius-sm);
  padding: 11px 22px; font-size: 15px;
  transition: background 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--blue-600); color: #fff; }
.btn-primary:hover { background: var(--blue-700); }
.btn-primary:disabled { background: var(--ink-400); cursor: not-allowed; }
.btn-ghost { background: #fff; color: var(--blue-600); border: 1px solid var(--blue-500); }
.btn-ghost:hover { background: var(--blue-50); }
.btn-success { background: var(--green-600); color: #fff; }
.btn-success:hover { background: #176a4c; }
.btn-block { width: 100%; }

/* ---------- 首页 Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--blue-50) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
  padding: 64px 0 56px;
}
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center;
}
.hero-kicker {
  display: inline-flex; align-items: center; gap: 7px;
  background: #fff; border: 1px solid var(--line); color: var(--blue-600);
  font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: 40px; line-height: 1.25; letter-spacing: -0.5px; font-weight: 800;
  margin-bottom: 16px; color: var(--ink-900);
}
.hero h1 .accent { color: var(--blue-600); }
.hero p.lead { font-size: 17px; color: var(--ink-700); max-width: 30em; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 22px; }
.hero-points { display: flex; gap: 20px; flex-wrap: wrap; color: var(--ink-500); font-size: 14px; }
.hero-points span { display: inline-flex; align-items: center; gap: 6px; }
.hero-points svg { color: var(--green-600); }

/* hero 视觉：一张照片切成三种规格 */
.hero-visual { position: relative; }
.hero-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: 26px;
}
.hero-photo-stack { display: flex; gap: 22px; align-items: flex-end; justify-content: center; }
.hero-photo {
  border-radius: 8px; background: var(--blue-100);
  border: 1px solid #c6d8ef;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.hero-photo .person { position: absolute; border-radius: 50%; background: var(--blue-500); }
.hero-photo.spec-1 { width: 74px; height: 104px; }
.hero-photo.spec-1 .person { width: 40px; height: 40px; top: 26px; }
.hero-photo.spec-2 { width: 96px; height: 134px; }
.hero-photo.spec-2 .person { width: 52px; height: 52px; top: 34px; }
.hero-photo.spec-3 { width: 118px; height: 166px; }
.hero-photo.spec-3 .person { width: 64px; height: 64px; top: 42px; }
.hero-photo-label {
  position: absolute; bottom: 8px; left: 0; right: 0; text-align: center;
  font-size: 11px; color: var(--blue-700); font-weight: 600;
}
.hero-badge {
  position: absolute; top: -14px; right: -8px;
  background: var(--green-600); color: #fff; font-size: 13px; font-weight: 700;
  padding: 6px 14px; border-radius: 999px; box-shadow: var(--shadow-sm);
}
.hero-note { text-align: center; margin-top: 18px; font-size: 13px; color: var(--ink-500); }

/* ---------- 通用区块 ---------- */
.section { padding: 56px 0; }
.section-head { max-width: 640px; margin-bottom: 34px; }
.section-head h2 { font-size: 27px; font-weight: 800; letter-spacing: -0.3px; margin-bottom: 10px; }
.section-head p { color: var(--ink-700); }

/* ---------- 三步说明 ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow-sm);
}
.step-num {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--blue-600); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 15px; margin-bottom: 14px;
}
.step-card h3 { font-size: 17px; margin-bottom: 8px; }
.step-card p { font-size: 14px; color: var(--ink-700); }

/* ---------- 规格速查表 ---------- */
.table-wrap {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
}
table.spec-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.spec-table th, table.spec-table td {
  padding: 12px 16px; text-align: left; font-size: 14px;
  border-bottom: 1px solid var(--line);
  word-break: break-word;
}
table.spec-table thead th { background: var(--blue-50); color: var(--ink-700); font-weight: 700; }
table.spec-table tbody tr:last-child td { border-bottom: none; }
table.spec-table tbody tr:hover { background: var(--blue-50); }
table.spec-table col.c1 { width: 22%; }
table.spec-table col.c2 { width: 22%; }
table.spec-table col.c3 { width: 24%; }
table.spec-table col.c4 { width: 32%; }

/* ---------- 文章卡片 ---------- */
.article-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.article-card {
  display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm); color: var(--ink-900);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.article-card:hover { text-decoration: none; border-color: var(--blue-500); box-shadow: var(--shadow-md); }
.article-card .tag {
  display: inline-block; font-size: 12px; font-weight: 600; color: var(--blue-600);
  background: var(--blue-100); padding: 3px 10px; border-radius: 999px; margin-bottom: 12px;
}
.article-card h3 { font-size: 17px; margin-bottom: 8px; line-height: 1.4; }
.article-card p { font-size: 14px; color: var(--ink-500); }

/* ---------- CTA 条 ---------- */
.cta-band {
  background: var(--blue-700); border-radius: var(--radius); color: #fff;
  padding: 40px; text-align: center;
}
.cta-band h2 { font-size: 26px; font-weight: 800; margin-bottom: 10px; }
.cta-band p { opacity: 0.88; margin-bottom: 22px; }
.cta-band .btn-primary { background: #fff; color: var(--blue-700); }
.cta-band .btn-primary:hover { background: var(--blue-50); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line); background: #fff;
  padding: 32px 0; margin-top: 56px;
}
.footer-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  font-size: 13px; color: var(--ink-500);
}
.footer-inner .sep { color: var(--line); }
.footer-links { display: flex; gap: 14px; }
.footer-links a { color: var(--ink-500); }

/* ============================================================
   工具页
   ============================================================ */
.tool-page { padding: 32px 0 64px; }
.tool-layout { display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: start; }

/* 左侧参数面板 */
.panel {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.panel + .panel { margin-top: 16px; }
.panel h3 {
  font-size: 14px; font-weight: 700; color: var(--ink-700);
  margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between;
}
.panel h3 .hint { font-weight: 400; font-size: 12px; color: var(--ink-400); }

/* 上传区 */
.upload-zone {
  border: 2px dashed var(--blue-300, #b9cff0); border-radius: var(--radius);
  background: var(--blue-50); padding: 22px 16px; text-align: center; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.upload-zone:hover { border-color: var(--blue-600); background: var(--blue-100); }
.upload-zone.dragover { border-color: var(--blue-600); background: var(--blue-100); }
.upload-zone .u-icon { color: var(--blue-600); margin-bottom: 8px; }
.upload-zone .u-main { font-weight: 600; color: var(--ink-900); font-size: 14px; }
.upload-zone .u-sub { font-size: 12px; color: var(--ink-500); margin-top: 4px; }
.upload-zone.has-img .u-main, .upload-zone.has-img .u-sub { display: none; }

/* 规格选择 */
.spec-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.spec-item {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 9px 10px;
  cursor: pointer; font-size: 13px; line-height: 1.35; background: #fff;
  transition: border-color 0.12s, background 0.12s;
}
.spec-item:hover { border-color: var(--blue-500); }
.spec-item.active { border-color: var(--blue-600); background: var(--blue-50); }
.spec-item .s-name { font-weight: 600; color: var(--ink-900); }
.spec-item .s-px { color: var(--ink-400); font-size: 12px; }
.spec-custom { grid-column: 1 / -1; display: none; gap: 8px; }
.spec-custom.show { display: flex; }
.spec-custom input {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 8px 10px; font: inherit; font-size: 13px; width: 100%;
}
.spec-custom input:focus { outline: 2px solid var(--blue-100); border-color: var(--blue-600); }

/* 底色选择 */
.bg-list { display: flex; gap: 10px; flex-wrap: wrap; }
.bg-dot {
  width: 34px; height: 34px; border-radius: 8px; border: 2px solid var(--line);
  cursor: pointer; position: relative; transition: border-color 0.12s, transform 0.05s;
}
.bg-dot:hover { border-color: var(--ink-400); }
.bg-dot.active { border-color: var(--blue-600); box-shadow: 0 0 0 3px var(--blue-100); }
.bg-dot .check {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,0.35);
}
.bg-dot.active .check { display: flex; }
.bg-custom-row { display: flex; gap: 8px; align-items: center; width: 100%; }
.bg-custom-row input[type="color"] {
  width: 40px; height: 34px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 2px; background: #fff; cursor: pointer;
}
.bg-custom-row span { font-size: 13px; color: var(--ink-500); }
.bg-custom-row input[type="text"] {
  flex: 1; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 7px 10px; font: inherit; font-size: 13px;
}

/* 滑块 */
.range-row { margin-top: 4px; }
.range-row label {
  display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-700); margin-bottom: 6px;
}
.range-row label output { font-weight: 600; color: var(--blue-600); }
.range-row input[type="range"] { width: 100%; accent-color: var(--blue-600); }

/* 右侧画布 */
.stage { position: sticky; top: 76px; }
.canvas-shell {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); padding: 16px; margin-bottom: 14px;
}
.canvas-wrap { position: relative; background: #eef2f7; border-radius: var(--radius-sm); overflow: hidden; }
#stageCanvas { width: 100%; height: auto; display: block; touch-action: none; cursor: move; }
.canvas-tip {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: var(--ink-400); gap: 10px; text-align: center;
  background: #eef2f7; padding: 20px;
}
.canvas-tip svg { color: var(--ink-400); }
.canvas-tip p { font-size: 14px; max-width: 18em; }
.empty-hidden .canvas-tip { display: none; }

.stage-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stage-actions .btn { flex: 1; min-width: 130px; }
.result-meta {
  margin-top: 10px; font-size: 13px; color: var(--ink-500);
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--ink-900); color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s;
  z-index: 100; box-shadow: var(--shadow-md);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 隐私横幅 */
.privacy-strip {
  display: flex; gap: 10px; align-items: center;
  background: var(--green-100); color: var(--green-600);
  font-size: 13px; font-weight: 600; border-radius: var(--radius-sm);
  padding: 10px 14px; margin-bottom: 16px;
}

/* ============================================================
   文章页
   ============================================================ */
.article-page { padding: 40px 0 64px; }
.article-main { max-width: 760px; margin: 0 auto; padding: 0 20px; }
.breadcrumb { font-size: 13px; color: var(--ink-500); margin-bottom: 18px; }
.breadcrumb a { color: var(--ink-500); }
.article-title { font-size: 32px; line-height: 1.3; font-weight: 800; letter-spacing: -0.4px; margin-bottom: 14px; }
.article-meta { font-size: 13px; color: var(--ink-400); margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.article-body { font-size: 16px; color: var(--ink-700); }
.article-body h2 { font-size: 22px; color: var(--ink-900); margin: 34px 0 14px; font-weight: 800; }
.article-body h3 { font-size: 18px; color: var(--ink-900); margin: 26px 0 10px; font-weight: 700; }
.article-body p { margin-bottom: 14px; }
.article-body ul, .article-body ol { margin: 0 0 16px 22px; }
.article-body li { margin-bottom: 6px; }
.article-body strong { color: var(--ink-900); }
.article-body table { margin: 18px 0 22px; }
.article-body blockquote {
  border-left: 4px solid var(--blue-500); background: var(--blue-50);
  padding: 12px 16px; margin: 18px 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-700); font-size: 15px;
}
.callout {
  display: flex; gap: 12px; background: var(--green-100); border-radius: var(--radius-sm);
  padding: 14px 16px; margin: 18px 0; font-size: 14px; color: var(--green-600);
}
.callout svg { flex: none; margin-top: 2px; }
.callout.blue { background: var(--blue-100); color: var(--blue-700); }
.article-cta {
  background: var(--blue-50); border: 1px solid var(--blue-100); border-radius: var(--radius);
  padding: 24px; margin: 32px 0; text-align: center;
}
.article-cta p { margin-bottom: 14px; font-weight: 600; color: var(--ink-900); }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero h1 { font-size: 32px; }
  .tool-layout { grid-template-columns: 1fr; }
  .stage { position: static; }
  .article-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .steps { grid-template-columns: 1fr; }
  .nav-links a:not(.nav-cta) { display: none; }
  .hero { padding: 44px 0 40px; }
  .section { padding: 40px 0; }
  .article-title { font-size: 25px; }
  .spec-list { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
