/* 签证照片助手 — 全局样式 */
:root {
  --brand: #1a56db;
  --brand-dark: #1447b8;
  --ink: #1f2937;
  --ink-2: #4b5563;
  --ink-3: #9ca3af;
  --line: #e5e7eb;
  --bg: #f7f8fa;
  --card: #ffffff;
  --ok: #059669;
  --warn: #d97706;
  --radius: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--ink); background: var(--bg); line-height: 1.7;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ===== 布局 ===== */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.site-header {
  background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.site-header .wrap { display: flex; align-items: center; gap: 12px; height: 56px; }
.logo { font-size: 18px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.logo:hover { text-decoration: none; }
.logo .badge-free {
  font-size: 11px; font-weight: 600; color: var(--ok);
  border: 1px solid var(--ok); border-radius: 99px; padding: 1px 8px;
}
.nav { margin-left: auto; display: flex; gap: 18px; font-size: 14px; }
.nav a { color: var(--ink-2); }

.hero { padding: 34px 0 8px; text-align: center; }
.hero h1 { font-size: 30px; font-weight: 800; letter-spacing: .5px; }
.hero p.sub { margin-top: 10px; color: var(--ink-2); font-size: 15px; }
.hero .trust {
  margin: 14px auto 0; display: inline-flex; flex-wrap: wrap; gap: 8px; justify-content: center;
}
.trust span {
  font-size: 12px; color: var(--ok); background: #ecfdf5;
  border: 1px solid #a7f3d0; border-radius: 99px; padding: 3px 10px;
}

/* ===== 工具区 ===== */
.tool { display: grid; grid-template-columns: 1fr 380px; gap: 20px; margin: 26px 0 40px; }
@media (max-width: 900px) { .tool { grid-template-columns: 1fr; } }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel h2 { font-size: 15px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff;
  font-size: 12px; font-weight: 700;
}

/* 上传 */
.drop {
  border: 2px dashed #cbd5e1; border-radius: var(--radius);
  padding: 34px 16px; text-align: center; cursor: pointer;
  transition: border-color .2s, background .2s;
}
.drop:hover, .drop.over { border-color: var(--brand); background: #eff6ff; }
.drop .big { font-size: 15px; font-weight: 600; }
.drop .small { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.drop input { display: none; }

.progress { display: none; margin-top: 12px; }
.progress.show { display: block; }
.progress .bar { height: 8px; background: #e5e7eb; border-radius: 99px; overflow: hidden; }
.progress .bar i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.progress .txt { font-size: 12px; color: var(--ink-2); margin-top: 6px; }

/* 画布 */
.stage-wrap { display: none; flex-direction: column; align-items: center; gap: 14px; }
.stage-wrap.show { display: flex; }
#cv {
  border-radius: 8px; box-shadow: 0 4px 24px rgba(0,0,0,.12);
  touch-action: none; cursor: grab; max-width: 100%; background: #fff;
}
#cv:active { cursor: grabbing; }
.canvas-hint { font-size: 12px; color: var(--ink-3); }

/* 规格卡 */
.spec-card { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; font-size: 13px; }
.spec-card table { width: 100%; border-collapse: collapse; }
.spec-card td { padding: 4px 0; vertical-align: top; }
.spec-card td:first-child { color: var(--ink-3); width: 76px; white-space: nowrap; }
.verify-warn {
  margin-top: 8px; font-size: 12px; color: var(--warn);
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px; padding: 6px 10px;
}
select, .btn {
  font-family: inherit; font-size: 14px; border-radius: 8px;
}
select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); background: #fff; color: var(--ink);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 18px; border: none; cursor: pointer; font-weight: 600;
  transition: background .15s, transform .1s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--brand); color: #fff; width: 100%; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); width: 100%; }
.btn-ghost:hover { background: #f3f4f6; }
.btn-row { display: flex; gap: 10px; margin-top: 10px; }

/* 背景色 */
.swatches { display: flex; gap: 10px; margin-top: 6px; }
.swatch {
  width: 40px; height: 40px; border-radius: 8px; cursor: pointer;
  border: 2px solid var(--line); position: relative;
}
.swatch.sel { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(26,86,219,.2); }
.swatch .nm { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); font-size: 10px; color: var(--ink-3); white-space: nowrap; }
.swatches-wrap { margin-bottom: 22px; }

/* 缩放 */
.zoom-row { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.zoom-row input[type=range] { flex: 1; accent-color: var(--brand); }
.zoom-row .val { font-size: 12px; color: var(--ink-2); width: 42px; text-align: right; }

.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }

/* ===== 内容区（SEO） ===== */
.content { background: var(--card); border-top: 1px solid var(--line); padding: 36px 0 50px; }
.content h2 { font-size: 22px; font-weight: 800; margin: 28px 0 12px; }
.content h3 { font-size: 17px; font-weight: 700; margin: 20px 0 8px; }
.content p, .content li { color: var(--ink-2); font-size: 14.5px; }
.content ul, .content ol { padding-left: 22px; margin: 8px 0; }
.spec-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
.spec-table th, .spec-table td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.spec-table th { background: #f8fafc; font-weight: 700; white-space: nowrap; }
.faq-item { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.faq-item summary { padding: 12px 16px; cursor: pointer; font-weight: 600; font-size: 14.5px; list-style: none; }
.faq-item summary::before { content: "＋"; color: var(--brand); margin-right: 8px; font-weight: 700; }
.faq-item[open] summary::before { content: "－"; }
.faq-item .a { padding: 0 16px 14px; font-size: 14px; color: var(--ink-2); }
.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 12px 0; }
.spec-grid a {
  display: block; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  color: var(--ink); font-size: 13.5px; background: #fff; transition: border-color .15s;
}
.spec-grid a:hover { border-color: var(--brand); text-decoration: none; }
.spec-grid a b { display: block; font-size: 14px; }
.spec-grid a span { color: var(--ink-3); font-size: 12px; }

.notice {
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
  border-radius: 10px; padding: 12px 16px; font-size: 13px; margin: 16px 0;
}

/* ===== 页脚 ===== */
.site-footer { border-top: 1px solid var(--line); background: var(--card); padding: 24px 0; margin-top: 20px; }
.site-footer p { font-size: 12.5px; color: var(--ink-3); text-align: center; }

/* 吐司 */
#toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(20px);
  background: #111827; color: #fff; font-size: 13.5px; padding: 10px 18px; border-radius: 99px;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 99; max-width: 86vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
