:root{
  --bg:#f7f8fb;
  --surface:#ffffff;
  --surface-2:#f1f3f8;
  --border:#e2e5ec;
  --text:#171a21;
  --text-muted:#5b6270;
  --brand:#2f6feb;
  --brand-dark:#1f52bf;
  --brand-tint:#eaf1ff;
  --success:#1f9d55;
  --shadow: 0 1px 2px rgba(20,20,30,.04), 0 8px 24px rgba(20,20,30,.06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark){
  :root{
    --bg:#0f1218;
    --surface:#171b23;
    --surface-2:#1e232d;
    --border:#2b313d;
    --text:#eef0f4;
    --text-muted:#9aa2b1;
    --brand:#5b8def;
    --brand-dark:#7ea6f4;
    --brand-tint:#182541;
    --success:#3fbd74;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  background:var(--bg);
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
.wrap{max-width:1080px;margin:0 auto;padding:0 20px}
a{color:var(--brand)}
h1,h2,h3{line-height:1.2;margin:0 0 .4em}

/* header */
.site-header{
  position:sticky;top:0;z-index:20;
  background:var(--surface);
  border-bottom:1px solid var(--border);
}
.header-inner{display:flex;align-items:center;gap:24px;height:60px}
.brand{display:flex;align-items:center;gap:8px;font-weight:700;font-size:18px;color:var(--text);text-decoration:none}
.brand-mark{display:inline-flex;color:var(--brand)}
.brand-tld{color:var(--text-muted);font-weight:600}
.site-nav{display:flex;gap:20px;margin-left:auto}
.site-nav a{color:var(--text-muted);text-decoration:none;font-size:14px;font-weight:500}
.site-nav a:hover{color:var(--text)}
.badge{
  font-size:12px;font-weight:600;color:var(--success);
  background:color-mix(in srgb, var(--success) 14%, transparent);
  padding:5px 10px;border-radius:999px;white-space:nowrap;
}
@media (max-width:720px){ .site-nav{display:none} .badge{display:none} }

/* hero */
.hero{padding:56px 0 40px;text-align:center}
.hero h1{font-size:clamp(28px,4vw,42px);max-width:780px;margin:0 auto .5em}
.hero-sub{color:var(--text-muted);max-width:620px;margin:0 auto 24px;font-size:16px}
.hero-points{list-style:none;display:flex;gap:22px;justify-content:center;flex-wrap:wrap;margin:22px 0 0;padding:0;color:var(--text-muted);font-size:14px}

.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  border-radius:10px;border:1px solid transparent;font-weight:600;font-size:14px;
  padding:10px 16px;cursor:pointer;text-decoration:none;transition:transform .05s ease, background .15s ease;
}
.btn:active{transform:translateY(1px)}
.btn-primary{background:var(--brand);color:#fff}
.btn-primary:hover{background:var(--brand-dark)}
.btn-ghost{background:var(--surface-2);color:var(--text);border-color:var(--border)}
.btn-ghost:hover{background:var(--border)}
.btn-lg{padding:13px 26px;font-size:15px;border-radius:12px}
.btn-row{display:flex;gap:10px;flex-wrap:wrap}

/* steps strip */
.steps-strip{padding:8px 0 48px}
.steps-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:16px}
@media (max-width:820px){ .steps-grid{grid-template-columns:repeat(2,1fr)} }
@media (max-width:520px){ .steps-grid{grid-template-columns:1fr} }
.step-card{
  background:var(--surface);border:1px solid var(--border);border-radius:14px;
  padding:18px;box-shadow:var(--shadow);
}
.step-num{
  display:inline-flex;align-items:center;justify-content:center;
  width:26px;height:26px;border-radius:50%;background:var(--brand-tint);color:var(--brand);
  font-weight:700;font-size:13px;margin-bottom:10px;
}
.step-card h3{font-size:15px}
.step-card p{color:var(--text-muted);font-size:13.5px;margin:0}

/* tool section */
.tool-section{padding:8px 0 60px}
.panel{
  background:var(--surface);border:1px solid var(--border);border-radius:16px;
  box-shadow:var(--shadow); margin-bottom:20px; overflow:hidden;
}
.panel-head{
  display:flex;align-items:center;gap:10px;
  padding:16px 22px;border-bottom:1px solid var(--border);background:var(--surface-2);
}
.panel-num{
  width:24px;height:24px;border-radius:50%;background:var(--brand);color:#fff;
  display:inline-flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;flex:none;
}
.panel-head h2{font-size:16px;margin:0}
.panel-body{padding:22px}

.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:18px}
@media (max-width:640px){ .grid-2{grid-template-columns:1fr} }

.field label{display:block;font-size:13px;font-weight:600;color:var(--text-muted);margin-bottom:6px}
select, input[type=number], input[type=text]{
  width:100%;padding:10px 12px;border-radius:9px;border:1px solid var(--border);
  background:var(--surface);color:var(--text);font-size:14px;
}
select:focus, input:focus{outline:2px solid var(--brand);outline-offset:1px}
.inline-inputs{display:flex;align-items:center;gap:8px}
.inline-inputs input{width:90px}
.readout{
  font-size:20px;font-weight:700;color:var(--brand);
  background:var(--brand-tint);border-radius:9px;padding:9px 12px;
}

/* dropzone */
.dropzone{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;
  border:2px dashed var(--border);border-radius:14px;padding:36px 20px;text-align:center;
  cursor:pointer;color:var(--text-muted);transition:border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.dragover{border-color:var(--brand);background:var(--brand-tint)}
.dropzone svg{color:var(--brand)}
.dz-title{font-weight:600;color:var(--text)}
.dz-sub{font-size:13px}

/* crop */
.crop-layout{display:grid;grid-template-columns:1fr 260px;gap:24px}
@media (max-width:800px){ .crop-layout{grid-template-columns:1fr} }
.crop-stage-wrap{display:flex;flex-direction:column;gap:10px;align-items:center}
#cropCanvas{
  max-width:100%;background:var(--surface-2);border-radius:12px;border:1px solid var(--border);
  touch-action:none;cursor:grab;
}
.hint{font-size:12.5px;color:var(--text-muted);text-align:center;max-width:480px;margin:0}
.hint-left{text-align:left;max-width:none}
.crop-controls{display:flex;flex-direction:column;gap:16px}
input[type=range]{width:100%}
.checkbox-row{display:flex;align-items:center;gap:8px;font-size:13.5px;color:var(--text-muted)}

.bg-field{display:flex;flex-direction:column;gap:10px}
.btn-sm{padding:7px 12px;font-size:13px;align-self:flex-start}
#smartBgBtn:disabled{opacity:.6;cursor:wait}
#smartBgStatus{color:var(--brand)}

/* result */
.result-layout{display:grid;grid-template-columns:1fr 260px;gap:24px;align-items:start}
@media (max-width:800px){ .result-layout{grid-template-columns:1fr} }
.result-preview{
  background:var(--surface-2);border:1px solid var(--border);border-radius:12px;
  padding:14px;display:flex;justify-content:center;
}
#sheetCanvas{max-width:100%;height:auto;background:#fff;box-shadow:0 2px 10px rgba(0,0,0,.15)}
.result-side{display:flex;flex-direction:column;gap:14px}
.sheet-info{font-size:13.5px;color:var(--text-muted);margin:0}

/* faq */
.faq-section{padding:10px 0 60px}
.faq-section h2{font-size:22px;margin-bottom:16px}
details{
  background:var(--surface);border:1px solid var(--border);border-radius:12px;
  padding:14px 18px;margin-bottom:10px;
}
summary{cursor:pointer;font-weight:600;font-size:14.5px}
details p{color:var(--text-muted);font-size:14px;margin:10px 0 0}

.site-footer{border-top:1px solid var(--border);padding:26px 0;color:var(--text-muted);font-size:13px}
