:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --ink: #14213d;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --brand-soft: #eff6ff;
  --shadow: 0 10px 30px rgba(15, 23, 42, .08);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { font-weight: 800; font-size: 20px; color: var(--ink); text-decoration: none; display: flex; align-items: center; gap: 9px; }
.brand-mark { background: var(--brand); color: #fff; border-radius: 7px; padding: 2px 8px; font-size: 15px; letter-spacing: -.5px; }
.trust { color: var(--muted); font-size: 13px; }
.hero { text-align: center; padding: 46px 0 30px; }
h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.15; margin: 0 0 14px; letter-spacing: -1px; }
.hero .sub { max-width: 660px; margin: 0 auto; color: #475569; font-size: 17px; }
.hero strong { color: var(--ink); }
.privacy-note { display: inline-flex; align-items: center; gap: 6px; margin: 16px 0 0; font-size: 13px; color: #0f766e; }
.tool-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 24px; }
.tool-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(260px, .85fr); gap: 26px; }
.dropzone {
  border: 2px dashed #cbd5e1; border-radius: 12px; min-height: 330px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; color: var(--muted); text-align: center; cursor: pointer;
  background: #fbfcfe; transition: .15s; padding: 20px;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.dropzone strong { color: var(--ink); font-size: 17px; }
.dropzone.dragover strong { color: var(--brand); }
.muted { font-size: 13px; }
.linkish { color: var(--brand); text-decoration: underline; }
.stage-wrap { text-align: center; }
.stage {
  position: relative; display: inline-block; max-width: 100%; line-height: 0;
  border-radius: 8px; overflow: hidden; background: #0f172a; touch-action: none;
}
.stage img { display: block; max-width: 100%; max-height: 520px; user-select: none; -webkit-user-drag: none; }
.shade { position: absolute; background: rgba(8, 15, 30, .55); pointer-events: none; }
.crop-box {
  position: absolute; border: 2px solid #fff; cursor: move;
  box-shadow: 0 0 0 1px rgba(0,0,0,.35), 0 2px 10px rgba(0,0,0,.25);
  touch-action: none;
}
.crop-box.circle { border-radius: 50%; }
.crop-box.circle .grid-line { display: none; }
.grid-line { position: absolute; background: rgba(255,255,255,.5); pointer-events: none; }
.grid-line.v1 { left: 33.33%; top: 0; bottom: 0; width: 1px; }
.grid-line.v2 { left: 66.66%; top: 0; bottom: 0; width: 1px; }
.grid-line.h1 { top: 33.33%; left: 0; right: 0; height: 1px; }
.grid-line.h2 { top: 66.66%; left: 0; right: 0; height: 1px; }
.handle { position: absolute; width: 14px; height: 14px; background: #fff; border: 2px solid var(--brand); border-radius: 3px; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.handle.nw { left: 2px; top: 2px; cursor: nwse-resize; }
.handle.ne { right: 2px; top: 2px; cursor: nesw-resize; }
.handle.sw { left: 2px; bottom: 2px; cursor: nesw-resize; }
.handle.se { right: 2px; bottom: 2px; cursor: nwse-resize; }
.stage-hint { color: var(--muted); font-size: 12px; margin: 10px 0 0; line-height: 1.5; }
.settings-col { background: #fbfcfe; border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.settings-col h2 { margin: 0 0 16px; font-size: 19px; }
.settings-col h3 { margin: 22px 0 10px; font-size: 14px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.field { margin-bottom: 13px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.field input[type=number], .field select {
  width: 100%; padding: 10px 11px; border: 1px solid #cbd5e1; border-radius: 8px;
  background: #fff; font: inherit; font-size: 15px; color: var(--ink);
}
.field input:focus, .field select:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
.pixel-readout { background: var(--brand-soft); color: #1e40af; border-radius: 8px; padding: 9px 12px; font-size: 13px; margin: 4px 0 6px; }
.presets { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { border: 1px solid #cbd5e1; background: #fff; color: #475569; border-radius: 999px; padding: 6px 11px; font: inherit; font-size: 12.5px; cursor: pointer; }
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.radio-row { display: flex; gap: 20px; }
.radio-row label { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.btn { display: block; width: 100%; border: 0; border-radius: 9px; padding: 12px 16px; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; }
.btn.big { margin-top: 18px; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.primary:disabled { background: #cbd5e1; cursor: not-allowed; }
.btn.ghost { margin-top: 9px; background: transparent; color: var(--brand); border: 1px solid #cbd5e1; }
.btn.ghost:hover { border-color: var(--brand); }
.tiny { color: var(--muted); font-size: 11.5px; line-height: 1.5; margin: 12px 0 0; text-align: center; }
.result { text-align: center; border-top: 1px solid var(--line); margin-top: 20px; padding-top: 18px; }
.result h3 { margin: 0 0 4px; }
.result-meta { display: flex; justify-content: center; gap: 16px; color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.result img { max-width: 100%; max-height: 380px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.result img.checker { background-image: linear-gradient(45deg, #e2e8f0 25%, transparent 25%), linear-gradient(-45deg, #e2e8f0 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e2e8f0 75%), linear-gradient(-45deg, transparent 75%, #e2e8f0 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; }
.content-section { max-width: 800px; margin: 0 auto; padding: 52px 20px; color: #334155; }
.content-section h2 { color: var(--ink); font-size: 24px; margin: 0 0 14px; }
.content-section ol { padding-left: 22px; }
.content-section li { margin-bottom: 9px; }
.faq { margin-top: 8px; }
.faq details { border-bottom: 1px solid var(--line); padding: 11px 0; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.faq p { margin: 9px 0 2px; font-size: 14.5px; }
.more-tools { max-width: 800px; margin: 8px auto 0; }
.more-tools h2 { font-size: 19px; color: var(--ink); margin: 0 0 12px; }
.tool-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.tool-links a { display: block; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 13px 15px; text-decoration: none; transition: .15s; }
.tool-links a:hover { border-color: var(--brand); box-shadow: 0 4px 14px rgba(37, 99, 235, .1); transform: translateY(-1px); }
.tool-links strong { display: block; color: var(--brand); font-size: 14px; margin-bottom: 3px; }
.tool-links span { color: var(--muted); font-size: 12.5px; }
.notice { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; border-radius: 9px; padding: 10px 13px; font-size: 12.5px; line-height: 1.5; margin: 12px 0 0; }
#previewImage { max-width: 100%; max-height: 380px; border: 1px solid var(--line); border-radius: 8px; }
.progress { font-size: 13px; margin: 12px 0 0; min-height: 20px; color: var(--muted); }
.progress.ok { color: #0f766e; }
.progress.warn { color: #b45309; }
[hidden] { display: none !important; }
.site-footer { background: #fff; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; text-align: center; padding: 24px 0; margin-top: 20px; }
@media (max-width: 860px) {
  .tool-grid { grid-template-columns: 1fr; }
  .trust { display: none; }
  .hero { padding: 34px 0 24px; }
  .tool-card { padding: 16px; }
}
