/* PhotoUnfade — mobile-first, warm archival palette, large tap targets for 45+ audience */
:root {
  --paper: #faf6f0;
  --card: #ffffff;
  --ink: #2b2118;
  --ink-soft: #6b5d4f;
  --line: #e7ddd0;
  --amber: #b45309;
  --amber-dark: #92400e;
  --amber-soft: #fef3e2;
  --green: #166534;
  --red: #991b1b;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(43, 33, 24, .08), 0 8px 24px rgba(43, 33, 24, .06);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px; line-height: 1.65; color: var(--ink); background: var(--paper);
}
img { max-width: 100%; display: block; }
a { color: var(--amber-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, .serif { font-family: Georgia, "Times New Roman", serif; font-weight: 700; line-height: 1.2; color: var(--ink); }
h1 { font-size: clamp(30px, 6vw, 52px); }
h2 { font-size: clamp(24px, 4.5vw, 36px); margin-bottom: 16px; }
h3 { font-size: 20px; margin-bottom: 8px; }
p { margin-bottom: 14px; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; }
.center { text-align: center; }
.muted { color: var(--ink-soft); }
.small { font-size: 14px; }

/* ── header ─────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 246, 240, .92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; max-width: 1100px; margin: 0 auto; }
.logo { display: flex; align-items: center; gap: 9px; font-family: Georgia, serif; font-size: 21px; font-weight: 700; color: var(--ink); text-decoration: none; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--amber), #d97706); display: grid; place-items: center; color: #fff; font-size: 17px; flex: none; }
.nav-links { display: none; gap: 22px; align-items: center; }
.nav-links a { color: var(--ink-soft); font-size: 15px; font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: var(--amber-dark); text-decoration: none; }
.nav-right { display: flex; align-items: center; gap: 10px; }
.credit-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--amber-soft); border: 1px solid #f3ddb8; color: var(--amber-dark); font-size: 14px; font-weight: 600; padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
@media (min-width: 820px) { .nav-links { display: flex; } }

/* ── buttons ────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 17px; font-weight: 600; padding: 14px 26px; border-radius: 12px;
  border: 1px solid transparent; cursor: pointer; text-decoration: none !important;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  min-height: 50px; touch-action: manipulation;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: linear-gradient(180deg, #d97706, var(--amber)); color: #fff; box-shadow: 0 4px 14px rgba(180, 83, 9, .35); }
.btn-primary:hover { background: linear-gradient(180deg, #c2680a, var(--amber-dark)); }
.btn-primary:disabled { background: #d6c9b8; box-shadow: none; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--amber); color: var(--amber-dark); }
.btn-lg { font-size: 19px; padding: 17px 34px; min-height: 58px; border-radius: 14px; }
.btn-sm { font-size: 14px; padding: 8px 14px; min-height: 38px; border-radius: 9px; }
.btn-block { width: 100%; }

/* ── hero ───────────────────────────────── */
.hero { padding: 52px 0 40px; }
.hero-inner { display: grid; gap: 36px; align-items: center; }
@media (min-width: 900px) { .hero-inner { grid-template-columns: 1.05fr .95fr; } }
.hero-badge { display: inline-flex; align-items: center; gap: 7px; background: var(--amber-soft); border: 1px solid #f3ddb8; color: var(--amber-dark); font-size: 13.5px; font-weight: 600; padding: 6px 14px; border-radius: 999px; margin-bottom: 18px; }
.hero h1 { margin-bottom: 16px; }
.hero h1 em { font-style: normal; color: var(--amber-dark); }
.hero-sub { font-size: 19px; color: var(--ink-soft); margin-bottom: 26px; max-width: 34em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--ink-soft); }
.hero-trust span::before { content: "✓"; color: var(--green); font-weight: 700; margin-right: 5px; }

/* ── before/after slider ────────────────── */
.ba { position: relative; overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--card); user-select: none; touch-action: none; max-height: 620px; }
.ba img { width: 100%; display: block; pointer-events: none; max-height: 620px; object-fit: cover; object-position: center top; }
.ba-after { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; clip-path: inset(0 0 0 50%); }
/* 移动端：竖幅照片不得超过大半屏，避免撑爆首屏 */
@media (max-width: 899px) {
  .ba, .ba img { max-height: 56vh; max-height: min(56svh, 430px); }
}
.ba-handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 3px; background: #fff; box-shadow: 0 0 8px rgba(0,0,0,.4); cursor: ew-resize; }
.ba-handle::after {
  content: "◀ ▶"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 46px; height: 46px; border-radius: 50%; background: #fff; color: var(--amber-dark);
  display: grid; place-items: center; font-size: 11px; letter-spacing: 1px; box-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.ba-label { position: absolute; bottom: 10px; background: rgba(20, 14, 8, .72); color: #fff; font-size: 12px; font-weight: 600; letter-spacing: .06em; padding: 4px 12px; border-radius: 999px; text-transform: uppercase; }
.ba-label.before { left: 10px; }
.ba-label.after { right: 10px; }

/* ── sections & cards ───────────────────── */
.section { padding: 56px 0; }
.section-tight { padding: 36px 0; }
.section-alt { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.grid-3 { display: grid; gap: 20px; }
@media (min-width: 760px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.grid-2 { display: grid; gap: 20px; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.feature-icon { width: 46px; height: 46px; border-radius: 12px; background: var(--amber-soft); display: grid; place-items: center; font-size: 22px; margin-bottom: 14px; }
.steps { counter-reset: step; display: grid; gap: 18px; }
.step { display: flex; gap: 16px; align-items: flex-start; }
.step-num { counter-increment: step; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--amber); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 17px; }
.step-num::before { content: counter(step); }

/* ── pricing ────────────────────────────── */
.price-grid { display: grid; gap: 20px; max-width: 860px; margin: 0 auto; }
@media (min-width: 760px) { .price-grid { grid-template-columns: repeat(3, 1fr); } }
.price-card { position: relative; background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 28px 24px; text-align: center; display: flex; flex-direction: column; }
.price-card.featured { border-color: var(--amber); box-shadow: 0 8px 30px rgba(180, 83, 9, .18); }
.price-tag { position: absolute; top: -13px; left: 50%; transform: translateX(-50%); background: var(--amber); color: #fff; font-size: 12.5px; font-weight: 700; padding: 4px 14px; border-radius: 999px; letter-spacing: .04em; white-space: nowrap; }
.price-amount { font-family: Georgia, serif; font-size: 44px; font-weight: 700; color: var(--ink); margin: 10px 0 2px; }
.price-amount small { font-size: 16px; color: var(--ink-soft); font-family: inherit; }
.price-feat { list-style: none; text-align: left; margin: 18px 0 22px; font-size: 15.5px; flex: 1; }
.price-feat li { padding: 6px 0 6px 26px; position: relative; }
.price-feat li::before { content: "✓"; position: absolute; left: 2px; color: var(--green); font-weight: 700; }

/* ── restore tool ───────────────────────── */
.tool-wrap { max-width: 880px; margin: 0 auto; padding: 32px 20px 64px; }
.dropzone {
  border: 2.5px dashed #d9c8ae; border-radius: var(--radius); background: var(--card);
  padding: 52px 24px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--amber); background: var(--amber-soft); }
.dropzone-icon { font-size: 44px; margin-bottom: 10px; }
.dropzone strong { font-size: 19px; display: block; margin-bottom: 4px; }
.mode-picker { display: flex; gap: 12px; margin: 20px 0; }
.mode-opt { flex: 1; border: 1.5px solid var(--line); border-radius: 12px; background: var(--card); padding: 14px 16px; cursor: pointer; text-align: left; font: inherit; }
.mode-opt.selected { border-color: var(--amber); background: var(--amber-soft); box-shadow: 0 0 0 1px var(--amber); }
.mode-opt b { display: block; font-size: 16px; margin-bottom: 2px; }
.mode-opt span { font-size: 13.5px; color: var(--ink-soft); line-height: 1.45; display: block; }
.progress-panel { display: none; text-align: center; padding: 40px 20px; }
.progress-panel.on { display: block; }
.spinner { width: 54px; height: 54px; margin: 0 auto 18px; border-radius: 50%; border: 5px solid var(--line); border-top-color: var(--amber); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress-steps { list-style: none; max-width: 340px; margin: 16px auto 0; text-align: left; font-size: 15px; color: var(--ink-soft); }
.progress-steps li { padding: 5px 0 5px 28px; position: relative; }
.progress-steps li::before { content: "○"; position: absolute; left: 4px; }
.progress-steps li.done { color: var(--green); }
.progress-steps li.done::before { content: "✓"; }
.progress-steps li.active { color: var(--amber-dark); font-weight: 600; }
.progress-steps li.active::before { content: "●"; }
.result-panel { display: none; }
.result-panel.on { display: block; }
.result-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 20px; }
.alert { border-radius: 12px; padding: 14px 18px; margin: 16px 0; font-size: 15.5px; display: none; }
.alert.on { display: block; }
.alert-error { background: #fdecec; border: 1px solid #f3c1c1; color: var(--red); }
.alert-ok { background: #ecf7ef; border: 1px solid #bfe3c8; color: var(--green); }

/* ── forms ──────────────────────────────── */
.form-card { max-width: 440px; margin: 40px auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 26px; box-shadow: var(--shadow); }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14.5px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border: 1.5px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--ink);
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--amber); box-shadow: 0 0 0 3px rgba(180, 83, 9, .12); }
.form-switch { text-align: center; margin-top: 16px; font-size: 15px; color: var(--ink-soft); }

/* ── blog ───────────────────────────────── */
.post-list { display: grid; gap: 18px; }
.post-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.post-card h3 { margin-bottom: 6px; }
.post-meta { font-size: 13.5px; color: var(--ink-soft); margin-bottom: 8px; }
.post-body { max-width: 720px; margin: 0 auto; padding: 36px 20px 72px; }
.post-body h2 { margin: 34px 0 12px; font-size: 25px; }
.post-body ul, .post-body ol { margin: 0 0 16px 24px; }
.post-body li { margin-bottom: 7px; }
.post-body table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 15.5px; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.post-body th { background: var(--amber-soft); }

/* ── footer ─────────────────────────────── */
.site-footer { border-top: 1px solid var(--line); background: var(--card); padding: 40px 0 30px; margin-top: 40px; }
.footer-grid { display: grid; gap: 26px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.site-footer h4 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); margin-bottom: 10px; font-family: inherit; }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 7px; }
.site-footer a { color: var(--ink); font-size: 15px; }
.footer-bottom { border-top: 1px solid var(--line); margin-top: 28px; padding-top: 18px; font-size: 13.5px; color: var(--ink-soft); display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }

/* ── faq ────────────────────────────────── */
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; margin-bottom: 10px; }
.faq summary { font-weight: 600; font-size: 16.5px; cursor: pointer; list-style: none; position: relative; padding-right: 28px; }
.faq summary::after { content: "+"; position: absolute; right: 2px; top: -1px; font-size: 21px; color: var(--amber); }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin-top: 10px; color: var(--ink-soft); font-size: 15.5px; }

/* ── comparison table (home) ────────────── */
.cmp-wrap { max-width: 860px; margin-left: auto; margin-right: auto; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cmp-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 15px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.cmp-table th, .cmp-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.cmp-table thead th { background: var(--amber-soft); font-family: Georgia, serif; font-size: 15.5px; }
.cmp-table thead th.cmp-us, .cmp-table td.cmp-us { background: #fdf9f2; }
.cmp-table thead th.cmp-us { color: var(--amber-dark); }
.cmp-table tbody th { font-weight: 600; font-size: 14px; color: var(--ink); white-space: nowrap; }
.cmp-table tbody td { color: var(--ink-soft); }
.cmp-table tbody td.cmp-us { color: var(--ink); font-weight: 500; }
.cmp-table tbody tr:last-child th, .cmp-table tbody tr:last-child td { border-bottom: none; }

/* ── admin ──────────────────────────────── */
.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--card); }
.admin-table th, .admin-table td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.admin-table th { background: var(--amber-soft); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; text-align: center; }
.stat-card .num { font-size: 30px; font-weight: 700; font-family: Georgia, serif; color: var(--amber-dark); }
.stat-card .lab { font-size: 12.5px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.badge-done { background: #ecf7ef; color: var(--green); }
.badge-failed { background: #fdecec; color: var(--red); }
.badge-processing { background: var(--amber-soft); color: var(--amber-dark); }

/* ── utility ────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
.mt-0 { margin-top: 0; } .mt-2 { margin-top: 16px; } .mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 16px; } .mb-4 { margin-bottom: 32px; }
