:root {
  --bg: #0b1020;
  --bg-soft: #11182e;
  --card: #ffffff;
  --ink: #1b2333;
  --muted: #6b7488;
  --line: #e6e9f0;
  --brand: #2563eb;
  --brand-2: #60a5fa;
  --ok: #18b26b;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(20, 25, 50, .08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #f6f7fb;
  line-height: 1.6;
}
a { color: var(--brand); text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ---------- Header ---------- */
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 14px 22px;
  background: rgba(11, 16, 32, .92);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 50;
}
.brand { font-weight: 800; font-size: 18px; color: #fff; letter-spacing: -.2px; white-space: nowrap; }
.brand .dot { color: #8b9bff; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.nav a {
  color: #c9d0e6; padding: 7px 12px; border-radius: 10px; font-size: 14px; font-weight: 600;
}
.nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav a.cur { background: var(--brand); color: #fff; }
.nav a.cur:hover { background: var(--brand); }

/* ---------- Layout ---------- */
.wrap { max-width: 860px; margin: 0 auto; padding: 36px 20px 64px; }
.wrap.narrow { max-width: 720px; }

/* ---------- Hero (home) ---------- */
.hero {
  background: radial-gradient(1200px 500px at 50% -10%, #28335f 0%, var(--bg) 55%);
  color: #fff; text-align: center; padding: 64px 20px 48px;
}
.hero h1 { font-size: 40px; line-height: 1.15; margin: 0 auto 14px; max-width: 720px; letter-spacing: -.5px; }
.hero p { font-size: 18px; color: #c9d0e6; max-width: 620px; margin: 0 auto 8px; }
.hero .privacy { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; font-size: 14px; color: #aab4d4; }

/* feature cards on home */
.tools-main { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin: -28px auto 18px; max-width: 860px; padding: 0 20px; }
.tools-sub { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; max-width: 860px; margin: 0 auto; padding: 0 20px 60px; }
.tool-card {
  display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); transition: transform .12s ease, box-shadow .12s ease;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: 0 16px 38px rgba(20,25,50,.14); }
.tool-card .ic { font-size: 28px; }
.tool-card h3 { margin: 10px 0 6px; font-size: 19px; color: var(--ink); }
.tool-card.feat { border-color: #d7dcfb; background: linear-gradient(180deg, #fbfcff, #fff); }
.tool-card .tag { display: inline-block; font-size: 11px; font-weight: 700; color: var(--brand); background: #eef0ff; padding: 2px 8px; border-radius: 999px; margin-bottom: 6px; }
.tool-card.soon { opacity: .7; }
.tool-card.soon .tag { color: var(--muted); background: #eef0f6; }
.tool-card p { margin: 0; color: var(--muted); font-size: 14px; }
.section-label { max-width: 860px; margin: 26px auto 4px; padding: 0 20px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }

/* ---------- Tool pages ---------- */
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 30px; margin: 0 0 8px; letter-spacing: -.3px; }
.page-head .lede { font-size: 16px; color: var(--muted); margin: 0; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.card h2 { font-size: 18px; margin: 0 0 12px; }

/* drop zone */
.drop {
  display: block; border: 2px dashed #c7cde0; border-radius: 14px; padding: 40px 20px;
  text-align: center; cursor: pointer; background: #fafbff; transition: border-color .12s, background .12s;
}
.drop:hover, .drop.dragover { border-color: var(--brand); background: #eef4ff; }
.drop-icon { font-size: 34px; }
.drop-title { font-weight: 700; margin-top: 8px; }
.drop-hint { color: var(--muted); font-size: 13px; margin-top: 4px; }

/* options */
.opts { display: grid; gap: 16px; margin: 4px 0 16px; }
.opt-row { display: flex; flex-direction: column; gap: 8px; }
.opt-row > .label { font-weight: 700; font-size: 14px; }
.opt-row > .hint { font-size: 13px; color: var(--muted); }
.choices { display: flex; gap: 10px; flex-wrap: wrap; }
.choice {
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; cursor: pointer; font-size: 14px;
  background: #fff; user-select: none; display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
}
.choice input { display: none; }
.choice .fmt-tag { font-size: 11px; color: var(--muted); font-weight: 500; }
.choice.on { border-color: var(--brand); background: #eef4ff; color: #1b357a; font-weight: 700; }
.choice.on .fmt-tag { color: #4757a8; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }

/* range slider */
.slider-row { display: flex; align-items: center; gap: 14px; }
.slider-row input[type=range] { flex: 1; accent-color: var(--brand); height: 6px; }
.slider-val { font-weight: 700; font-size: 14px; min-width: 46px; text-align: right; color: #1b357a; }

/* preview + selection stage */
.preview { max-width: 100%; max-height: 60vh; display: block; border-radius: 10px; background: #0b1020; margin-bottom: 14px; }

/* key/value summary (file sizes etc.) */
.kv { display: flex; flex-wrap: wrap; gap: 10px 26px; margin: 4px 0 14px; }
.kv .kv-item { font-size: 14px; }
.kv .kv-item b { font-weight: 700; }
.kv .kv-item .k { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; display: block; }
.saved { color: var(--ok); font-weight: 800; }

/* toolbar / buttons */
.toolbar { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.spacer { flex: 1; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 11px 20px;
  font-size: 15px; font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: #1d4ed8; }
.btn.primary:disabled { background: #b8bff0; cursor: not-allowed; }
.btn.ghost { background: #eef0f6; color: var(--ink); }
.btn.ghost:hover { background: #e3e6ef; }

/* progress */
.progress { height: 12px; background: #eceff6; border-radius: 999px; overflow: hidden; }
.bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), var(--brand-2)); transition: width .2s; }

/* result */
.result { max-width: 100%; border-radius: 10px; background: #0b1020; max-height: 60vh; display: block; margin-bottom: 4px; }

/* 质量预设按钮 */
.presets { display: flex; gap: 8px; flex-wrap: wrap; }
.preset { border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 14px; background: #fff; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink); }
.preset:hover { border-color: var(--brand); }
.preset.on { border-color: var(--brand); background: #eef4ff; color: #1b357a; }

/* 压缩前后对比（拖动滑块） */
.compare { margin-bottom: 14px; }
.cmp { position: relative; user-select: none; border-radius: 10px; overflow: hidden; background: #0b1020; line-height: 0; max-height: 60vh; }
.cmp img { width: 100%; display: block; }
.cmp-top { position: absolute; inset: 0; clip-path: inset(0 0 0 50%); }
.cmp-line { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); pointer-events: none; }
.cmp-line::after { content: "⇆"; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 30px; height: 30px; border-radius: 50%; background: #fff; color: #1b357a; font-size: 15px; line-height: 30px; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.cmp-tag { position: absolute; top: 8px; font-size: 11px; font-weight: 700; color: #fff; background: rgba(0,0,0,.5); padding: 2px 8px; border-radius: 999px; pointer-events: none; }
.cmp-tag-l { left: 8px; }
.cmp-tag-r { right: 8px; }
.cmp-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; padding: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: ew-resize; }
.cmp-range::-webkit-slider-thumb { -webkit-appearance: none; width: 40px; height: 600px; background: transparent; cursor: ew-resize; }
.cmp-range::-moz-range-thumb { width: 40px; height: 600px; background: transparent; border: none; cursor: ew-resize; }
.cmp-range:focus { outline: none; }
.cmp-single { max-width: 100%; max-height: 60vh; border-radius: 10px; display: block; margin: 0 auto; }

/* 批量逐张结果 */
.batch-list { margin-bottom: 14px; max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.bl-row { display: grid; grid-template-columns: 1fr auto auto auto auto; gap: 6px 12px; align-items: center; padding: 8px 14px; font-size: 13px; border-bottom: 1px solid var(--line); }
.bl-row:last-child { border-bottom: none; }
.bl-head { position: sticky; top: 0; background: #f7f8fc; font-weight: 700; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
.bl-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bl-sz { color: var(--muted); white-space: nowrap; }
.bl-arrow { color: var(--muted); }
.bl-saved { font-weight: 700; color: #18b26b; white-space: nowrap; }

/* notes / faq */
.note { background: #fff8e6; border: 1px solid #ffe7a3; border-radius: 12px; padding: 12px 14px; font-size: 13px; color: #7a5b00; }
.faq { margin-top: 20px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px 16px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 10px 0; }
.faq p { font-size: 14px; color: #46506a; }

/* footer */
.foot { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 20px; border-top: 1px solid var(--line); background: #fff; }
.foot a { color: var(--muted); }

@media (max-width: 680px) {
  .tools-main, .tools-sub { grid-template-columns: 1fr; }
  .hero h1 { font-size: 30px; }
  .nav { display: none; }
}

/* footer extras */
.foot p { margin: 6px 0; }
.foot .foot-legal { max-width: 760px; margin: 0 auto 10px; color: #8a93a8; }
.foot-links { margin-top: 10px; }
.foot-links a { margin: 0 5px; }

/* SEO landing / guide articles */
.article { max-width: 720px; }
.article .lede { font-size: 17px; color: var(--muted); margin: 0 0 6px; }
.article h2 { font-size: 21px; margin: 30px 0 10px; letter-spacing: -.2px; }
.article h3 { font-size: 17px; margin: 18px 0 6px; }
.article p, .article li { font-size: 16px; color: #2c3447; }
.article ol, .article ul { padding-left: 22px; margin: 8px 0; }
.article li { margin: 6px 0; }
.article .cta { margin: 20px 0 6px; }
.related { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 16px; }
.related h2 { font-size: 16px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); margin: 0 0 8px; }
.related ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.related a { font-weight: 600; }

/* resize — wider container + two-column tool layout */
.wrap.rztool { max-width: 980px; }
.rz-layout {
  display: grid; gap: 22px; align-items: stretch;
  grid-template-columns: 320px 1fr;
  grid-template-areas: "controls side";
}
.rz-controls { grid-area: controls; min-width: 0; }
.rz-side { grid-area: side; min-width: 0; display: flex; flex-direction: column; }
@media (max-width: 820px) {
  .rz-layout { grid-template-columns: 1fr; grid-template-areas: "side" "controls"; }
}

/* mode toggle (单图/批量),与 cleanmypix 一致 */
.mode-toggle { display: flex; width: 100%; gap: 4px; background: #eef0f6; border-radius: 10px; padding: 4px; }
.mode-btn { flex: 1; text-align: center; border: 0; background: transparent; font-weight: 700; font-size: 14px; padding: 9px 8px; border-radius: 8px; cursor: pointer; color: #41495c; white-space: nowrap; }
.mode-btn.active { background: #fff; color: var(--brand); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* 右栏拖拽区填满列高 + 居中 */
.rz-side .drop { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 360px; }
.drop-svg { display: block; }

/* 加载后预览区同样撑满整列并垂直居中,图片+说明作为一组居中显示 */
.rz-side #rzPreviewWrap { flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 360px; }
.rz-side #src-info { text-align: center; }

/* 批量缩略排队条(含第1张,完成打勾,可点选/删除) */
.rz-queue { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; margin-top: 14px; }
.rz-th { position: relative; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; cursor: pointer; }
.rz-th.cur { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(37,99,235,.25); }
.rz-th img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.rz-th .bdg { position: absolute; top: 4px; right: 4px; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 99px; background: #eef0f6; color: #6b7488; line-height: 1.4; }
.rz-th .bdg.ok { background: #e3f9ee; color: #18b26b; }
.rz-th .rz-del { position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; padding: 0; line-height: 17px; text-align: center; border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-size: 14px; cursor: pointer; }
.rz-th .rz-del:hover { background: #d23f3f; }

/* resize — live output preview */
.rz-stage { display: flex; justify-content: center; margin-bottom: 6px; }
.rz-frame {
  position: relative; max-width: 100%; line-height: 0;
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 0 0 1px var(--line), var(--shadow);
  /* checkerboard shows through where the output is transparent */
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #e9ecf4 25%, transparent 25%, transparent 75%, #e9ecf4 75%),
    linear-gradient(45deg, #e9ecf4 25%, transparent 25%, transparent 75%, #e9ecf4 75%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
}
.rz-canvas { display: block; max-width: 100%; max-height: 56vh; touch-action: none; }
.rz-frame.grabbable .rz-canvas { cursor: grab; }
.rz-frame.grabbing .rz-canvas { cursor: grabbing; }
.rz-grab {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  background: rgba(11,16,32,.72); color: #fff; font-size: 12px; font-weight: 600;
  padding: 5px 10px; border-radius: 999px; pointer-events: none;
  opacity: 0; transition: opacity .15s; white-space: nowrap;
}
.rz-frame.grabbable .rz-grab { opacity: 1; }
.rz-frame.grabbing .rz-grab { opacity: 0; }
.rz-num {
  width: 110px; padding: 8px 10px; border: 1.5px solid var(--line);
  border-radius: 10px; font-size: 14px; color: var(--ink);
}
.opt-row .hint code {
  background: #eef0f6; border-radius: 5px; padding: 1px 5px;
  font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* resize — marketplace rules guide */
.guide { margin-top: 26px; }
.guide h2 { font-size: 22px; margin: 0 0 8px; letter-spacing: -.2px; }
.guide h3 { font-size: 18px; margin: 28px 0 12px; }
.guide-intro { font-size: 15px; color: #46506a; margin: 0 0 16px; }
.spec-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 12px; }
.spec-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; background: #fff; }
.spec-table th, .spec-table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.spec-table thead th { background: #f4f6fc; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); white-space: nowrap; }
.spec-table tbody th[scope=row] { font-weight: 800; color: var(--ink); white-space: nowrap; }
.spec-table tbody tr:last-child td, .spec-table tbody tr:last-child th { border-bottom: 0; }
.spec-table tbody tr:hover { background: #fafbff; }
.spec-table td:last-child { color: #1b357a; font-weight: 600; }
.tag-req { display: inline-block; font-size: 10px; font-weight: 700; color: var(--muted); background: #eef0f6; padding: 1px 6px; border-radius: 999px; text-transform: uppercase; letter-spacing: .3px; }
.spec-note { font-size: 13px; color: var(--muted); margin: 10px 2px 0; }
.spec-note strong { color: #46506a; }

.name-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.name-card { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; background: #fff; }
.name-card h4 { margin: 0 0 8px; font-size: 15px; color: var(--ink); }
.name-card p { font-size: 13.5px; color: #46506a; margin: 0 0 8px; line-height: 1.55; }
.name-card .do { color: #1b357a; font-weight: 600; background: #eef4ff; border-radius: 8px; padding: 8px 10px; }
.name-card .src { font-size: 12px; color: var(--muted); margin-bottom: 0; }
.name-card code { background: #eef0f6; border-radius: 5px; padding: 1px 5px; font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.guide-priv { font-size: 13.5px; color: var(--muted); margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); }

/* feedback form */
.fb-card h2 { font-size: 19px; }
.fb-form { display: grid; gap: 12px; }
.fb-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.fb-input {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px;
  font-size: 14px; color: var(--ink); font-family: inherit; background: #fff;
}
.fb-input:focus { outline: none; border-color: var(--brand); }
.fb-textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
#fb-status { font-size: 13px; }
.cv-priv { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.cv-priv strong { color: #46506a; }
@media (max-width: 560px) { .fb-row { grid-template-columns: 1fr; } }

/* legal / article pages */
.legal h1 { font-size: 30px; margin: 0 0 6px; }
.legal h2 { font-size: 19px; margin-top: 30px; }
.legal p, .legal li { color: #46506a; font-size: 15px; }
.legal ul { padding-left: 20px; }
.legal .updated { color: var(--muted); font-size: 14px; margin-top: 0; }
.legal a { text-decoration: underline; }
.legal .callout { background: #eef4ff; border: 1px solid #d7dcfb; border-radius: 12px; padding: 14px 16px; color: #1b357a; }
