/* ==========================================
   双图 · sntfct —— 沿用主页黑白灰设计系统
   ========================================== */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --bg: #ffffff; --bg-card: #fafafa; --bg-soft: #f2f2f2;
  --text-1: #171717; --text-2: #525252; --text-3: #737373; --text-4: #a3a3a3;
  --line: rgba(0,0,0,.08); --line-2: rgba(0,0,0,.15);
  --accent: #171717;
}
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-1);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(0,0,0,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,0,0,.035) 1px, transparent 1px);
  background-size: 80px 80px;
  background-position: -1px -1px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--text-1); color: #fff; }
img { display: block; }
[hidden] { display: none; }  /* 覆盖上面的 img{display:block}，否则 hidden 的 img 会露出 alt 文字 */

/* ---------- 顶栏 ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
  padding: calc(12px + env(safe-area-inset-top)) 18px 12px;
  display: flex; align-items: center; gap: 14px;
}
.nav .back {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 10px; border-radius: 8px;
  font-size: 13px; color: var(--text-2);
  text-decoration: none; transition: all .2s;
}
.nav .back:hover { background: var(--bg-soft); color: var(--text-1); }
.nav .back svg { width: 14px; height: 14px; }
.nav .brand { flex: 1; font-size: 14px; letter-spacing: 1.5px; font-weight: 600; }
.nav .brand span { color: var(--text-3); font-weight: 400; margin-left: 6px; font-size: 12px; }

/* ---------- 布局 ---------- */
.wrap { max-width: 760px; margin: 0 auto; padding: 0 18px 64px; }
.hero { padding: 44px 0 10px; text-align: center; }
.hero .label { font-size: 11px; letter-spacing: 4px; color: var(--text-4); }
.hero h1 { font-size: 30px; font-weight: 800; letter-spacing: 1px; margin: 12px 0 10px; }
.hero p { font-size: 13px; line-height: 1.9; color: var(--text-3); }
.hero p b { color: var(--text-1); font-weight: 600; }

/* ---------- 三步说明 ---------- */
.steps {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin: 28px 0 4px;
}
.step {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px;
}
.step .num {
  flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--text-1); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 20px; text-align: center;
}
.step b { display: block; font-size: 13px; font-weight: 600; }
.step em { display: block; font-style: normal; font-size: 11px; color: var(--text-4); margin-top: 3px; line-height: 1.5; }

/* ---------- 上传区 ---------- */
.upload { margin-top: 26px; }
.slots { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.slot {
  position: relative;
  display: flex; flex-direction: column;
  border: 2px dashed var(--line-2);
  border-radius: 16px;
  background: var(--bg-card);
  padding: 14px;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .1s;
  outline: none;
}
.slot:hover, .slot.drag { border-color: var(--text-1); background: var(--bg-soft); }
.slot.filled { border-style: solid; border-color: var(--line-2); }
.slot-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tag {
  background: var(--text-1); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  padding: 3px 9px; border-radius: 999px;
}
.slot-sub { font-size: 11px; color: var(--text-4); }
.slot-body {
  flex: 1; min-height: 132px;
  display: flex; align-items: center; justify-content: center;
  margin: 12px 0 10px;
}
.placeholder { text-align: center; }
.ph-ico { font-size: 26px; }
.ph-main { font-size: 13px; margin-top: 8px; }
.ph-sub { font-size: 11px; color: var(--text-4); margin-top: 4px; }
.thumb {
  max-width: 100%; max-height: 190px;
  border-radius: 10px; object-fit: contain;
  background:
    repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 50% / 16px 16px;
}
.thumb-list {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 6px;
  align-content: center;
  max-height: 190px;
  overflow: auto;
}
.thumb-list[hidden] { display: none; }
.thumb-item { position: relative; }
.thumb-item img {
  width: 100%; height: 76px; object-fit: cover; display: block;
  border-radius: 8px; border: 1px solid var(--line);
  background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 50% / 16px 16px;
}
.thumb-item .order {
  position: absolute; left: 4px; top: 4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 999px; background: rgba(0,0,0,.6); color: #fff;
  font-size: 10px; line-height: 16px; text-align: center;
}
.thumb-item .rm {
  position: absolute; right: 3px; top: 3px;
  width: 18px; height: 18px; border-radius: 50%; padding: 0;
  border: none; background: rgba(0,0,0,.55); color: #fff;
  font-size: 12px; line-height: 1; cursor: pointer;
}
.thumb-item .rm:hover { background: #c0392b; }
.slot-meta { font-size: 11px; color: var(--text-3); text-align: center; font-variant-numeric: tabular-nums; }
.slot-clear {
  position: absolute; top: 8px; right: 8px;
  width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--bg); color: var(--text-3);
  font-size: 15px; line-height: 1; cursor: pointer; display: none;
}
.slot.filled .slot-clear { display: block; }
.slot-clear:hover { background: var(--text-1); color: #fff; border-color: var(--text-1); }

.ratio-warn {
  margin-top: 12px; padding: 10px 12px;
  background: #fff8e6; border: 1px solid #f0d489;
  border-radius: 10px; color: #8a6d1a; font-size: 12px; line-height: 1.7;
}
.row-btns { display: flex; gap: 10px; margin-top: 12px; }
.row-btns .btn { flex: 1; }

/* ---------- 高级设置 ---------- */
.adv {
  margin-top: 18px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--bg-card); overflow: hidden;
}
.adv > summary {
  list-style: none; cursor: pointer;
  padding: 13px 16px; font-size: 13px; color: var(--text-2);
  display: flex; align-items: center; justify-content: space-between;
}
.adv > summary::-webkit-details-marker { display: none; }
.adv > summary::after { content: "＋"; color: var(--text-4); font-size: 13px; }
.adv[open] > summary::after { content: "－"; }
.adv-body { padding: 0 16px 16px; display: grid; gap: 12px; }
.field { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.field > span { font-size: 13px; color: var(--text-2); }
.field em { display: block; font-style: normal; font-size: 11px; color: var(--text-4); margin-top: 2px; }
.field select {
  font-family: inherit; font-size: 13px; color: var(--text-1);
  padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--bg); cursor: pointer; flex: 0 0 auto;
}
.field select:focus { outline: none; border-color: var(--text-1); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line-2);
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 20px;
  font-family: inherit; font-size: 14px; color: var(--text-1);
  text-decoration: none; cursor: pointer;
  transition: background .15s, opacity .15s, transform .1s;
}
.btn:hover { background: var(--bg-soft); }
.btn:active { transform: scale(.99); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.primary { background: var(--text-1); color: #fff; border-color: var(--text-1); font-weight: 600; }
.btn.primary:hover { background: #000; }
.btn.big { width: 100%; padding: 14px; font-size: 15px; margin-top: 20px; }
#goBtn { margin-top: 20px; }

.status { margin-top: 12px; font-size: 12px; color: var(--text-4); text-align: center; line-height: 1.7; }
.status.busy { color: var(--text-2); }
.status.busy::before {
  content: ""; display: inline-block; vertical-align: -2px;
  width: 11px; height: 11px; margin-right: 7px;
  border: 2px solid var(--line-2); border-top-color: var(--text-1);
  border-radius: 50%; animation: spin .8s linear infinite;
}
.status.err { color: #c0392b; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 结果 ---------- */
.result { margin-top: 26px; }
.result-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.result-head h2 { font-size: 16px; font-weight: 700; letter-spacing: .5px; }
.badge {
  background: var(--text-1); color: #fff; font-size: 11px;
  padding: 3px 8px; border-radius: 999px; letter-spacing: .5px;
  font-variant-numeric: tabular-nums;
}
.result-box {
  background: var(--bg-card); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px;
  display: flex; justify-content: center;
}
.result-box img {
  max-width: 100%; max-height: 380px; border-radius: 10px; object-fit: contain;
  background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 50% / 16px 16px;
}
.result-note { margin-top: 8px; font-size: 11px; color: var(--text-4); text-align: center; }
.meta { margin-top: 10px; font-size: 12px; color: var(--text-3); text-align: center; line-height: 1.9; font-variant-numeric: tabular-nums; }
.mini-note { margin-top: 8px; font-size: 11px; color: var(--text-4); text-align: center; }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.pair figure { text-align: center; }
.pair img {
  width: 100%; height: 130px; object-fit: cover;
  border-radius: 10px; border: 1px solid var(--line);
  background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 50% / 16px 16px;
}
.pair figcaption { font-size: 11px; color: var(--text-4); margin-top: 7px; }
.pair figcaption b { color: var(--text-2); }
.pair-b-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px; margin-top: 12px;
}
.pair-b-list[hidden] { display: none; }
.pair-b-list figure { margin: 0; text-align: center; }
.pair-b-list img {
  width: 100%; height: 110px; object-fit: cover; display: block;
  border-radius: 10px; border: 1px solid var(--line);
  background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 50% / 16px 16px;
}
.pair-b-list figcaption { font-size: 11px; color: var(--text-4); margin-top: 6px; }
.pair-b-list figcaption b { color: var(--text-2); }

/* ---------- 说明 / FAQ ---------- */
.tips { margin-top: 40px; }
.tips h2 {
  font-size: 12px; letter-spacing: 3px; color: var(--text-4); font-weight: 500;
  text-transform: uppercase; display: flex; align-items: center; gap: 12px;
}
.tips h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.tips ol { margin-top: 16px; padding-left: 0; list-style: none; counter-reset: tip; }
.tips li {
  position: relative; padding: 12px 0 12px 34px;
  border-bottom: 1px solid var(--line);
  font-size: 13px; line-height: 1.85; color: var(--text-2);
}
.tips li:last-child { border-bottom: 0; }
.tips li::before {
  counter-increment: tip; content: counter(tip);
  position: absolute; left: 0; top: 13px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--bg-soft); color: var(--text-2);
  font-size: 11px; font-weight: 700; line-height: 20px; text-align: center;
}
.tips li b { color: var(--text-1); }

.faq { margin-top: 34px; }
.faq details {
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg-card); margin-bottom: 10px; overflow: hidden;
}
.faq summary {
  list-style: none; cursor: pointer;
  padding: 14px 16px; font-size: 13px; font-weight: 500;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "＋"; color: var(--text-4); }
.faq details[open] summary::after { content: "－"; }
.faq p { padding: 0 16px 14px; font-size: 12.5px; line-height: 1.9; color: var(--text-2); }

footer {
  border-top: 1px solid var(--line);
  padding: 26px 18px calc(26px + env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 12px; color: var(--text-4);
}
footer a { color: var(--text-3); text-decoration: none; }
footer a:hover { color: var(--text-1); }

.hide { display: none !important; }

@media (max-width: 620px) {
  /* 手机端压缩顶栏，避免占掉太多首屏高度 */
  .nav {
    padding: calc(6px + env(safe-area-inset-top)) 14px 6px;
    gap: 8px;
  }
  .nav .back { padding: 4px 6px; font-size: 12px; }
  .nav .back svg { width: 12px; height: 12px; }
  .nav .brand { font-size: 13px; letter-spacing: 1px; }
  .nav .brand span { font-size: 11px; margin-left: 4px; }
  .hero { padding-top: 14px; }
  .hero h1 { font-size: 22px; margin: 8px 0 6px; }
  .steps { grid-template-columns: 1fr; }
  .step em { display: inline; margin-left: 6px; }
  .slots { grid-template-columns: 1fr; }
  .slot-body { min-height: 110px; }
  .thumb { max-height: 160px; }
  .field { align-items: flex-start; flex-direction: column; gap: 8px; }
  .field select { width: 100%; }
  .result-box img { max-height: 300px; }
}

@media (max-width: 360px) {
  .nav .brand span { display: none; }
}
