:root {
  --bg: #f3ecdf;
  --bg-2: #eadfcb;
  --ink: #1d1812;
  --muted: #5c5349;
  --paper: #fffaf2;
  --line: #d9cdb8;
  --line-strong: #c4b49a;
  --seal: #b4332a;
  --seal-deep: #8c221c;
  --jade: #1b6a55;
  --jade-deep: #0f4b3c;
  --gold: #b8862a;
  --chip: #efe4d0;
  --shadow: 0 10px 30px rgba(29, 24, 18, 0.08);
  --radius: 18px;
  --font: "Noto Sans", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --display: "Fraunces", "Noto Serif SC", Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); }
body {
  min-height: 100dvh;
  background-image:
    radial-gradient(circle at 12% -10%, #fff8ea 0, transparent 42%),
    radial-gradient(circle at 110% 0, #e7d3b0 0, transparent 36%);
}
a { color: var(--seal-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--seal); }
img, canvas { max-width: 100%; height: auto; }
.wrap { width: min(1100px, calc(100% - 32px)); margin: 0 auto; }
.site-header {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(12px);
  background: color-mix(in srgb, var(--bg) 86%, white);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--seal); color: #fffaf2;
  display: grid; place-items: center;
  font-family: var(--display); font-weight: 700; font-size: 18px;
}
.brand-name { display: grid; line-height: 1.1; }
.brand-name strong { font-family: var(--display); font-size: 18px; font-weight: 600; }
.brand-name span { font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.lang-switch, .icon-link, .btn, select, input[type="text"], input[type="number"], input[type="color"] {
  font: inherit;
}
.lang-switch {
  display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden;
  background: var(--paper);
}
.lang-switch button {
  border: 0; background: transparent; color: var(--muted);
  padding: 6px 10px; cursor: pointer; font: inherit; font-size: 13px;
}
.lang-switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 11px 16px; cursor: pointer;
  background: var(--ink); color: var(--paper); font-weight: 600;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.secondary { background: var(--paper); color: var(--ink); border: 1px solid var(--line-strong); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.seal { background: var(--seal); color: #fff; }
.btn.jade { background: var(--jade); color: #fff; }
.hero { padding: 36px 0 12px; }
.hero h1 {
  font-family: var(--display); font-weight: 600; font-size: clamp(34px, 7vw, 64px);
  line-height: 0.98; letter-spacing: -0.03em; margin: 0 0 12px;
}
.hero p.lede { font-size: 17px; line-height: 1.55; color: var(--muted); max-width: 42rem; margin: 0; }
.kicker {
  display: inline-block; font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--seal); font-weight: 700; margin-bottom: 10px;
}
.grid-tools { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin: 28px 0; }
.tool-card, .panel, .ad-slot, .note, .result-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.tool-card { padding: 18px; text-decoration: none; color: inherit; display: grid; gap: 8px; transition: transform 0.15s ease, border-color 0.15s; }
.tool-card:hover { transform: translateY(-2px); border-color: var(--seal); color: inherit; }
.tool-card h2 { margin: 0; font-family: var(--display); font-size: 26px; line-height: 1.1; }
.tool-card p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.tool-card .tag { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--jade-deep); font-weight: 700; }
.layout { display: grid; gap: 16px; grid-template-columns: 1fr; padding-bottom: 40px; }
@media (min-width: 900px) {
  .layout.work { grid-template-columns: 340px 1fr; align-items: start; }
}
.panel { padding: 16px; }
.panel h2 { margin: 0 0 10px; font-size: 18px; font-family: var(--display); }
.drop {
  border: 1.5px dashed var(--line-strong); border-radius: 14px; padding: 22px 16px;
  text-align: center; background: var(--chip); cursor: pointer;
}
.drop.dragover { border-color: var(--seal); background: #f8e3c8; }
.drop input { display: none; }
.drop strong { display: block; margin-bottom: 4px; }
.drop span { color: var(--muted); font-size: 13px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.field { display: grid; gap: 6px; margin: 12px 0; font-size: 14px; }
.field label { font-weight: 600; }
.field .hint { color: var(--muted); font-size: 12px; font-weight: 400; }
.field input, .field select, .ctrl {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 10px 12px; background: #fff; color: var(--ink);
}
.preview-box, .compare {
  min-height: 280px; border-radius: 14px; overflow: hidden; position: relative;
  background:
    linear-gradient(45deg, #e6e0d4 25%, transparent 25%),
    linear-gradient(-45deg, #e6e0d4 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e6e0d4 75%),
    linear-gradient(-45deg, transparent 75%, #e6e0d4 75%);
  background-size: 22px 22px;
  background-position: 0 0, 0 11px, 11px -11px, -11px 0;
  background-color: #f7f3ea;
  display: grid; place-items: center;
}
.preview-box img, .preview-box canvas, .compare img, .compare canvas { display: block; max-height: 70vh; width: auto; }
.status { font-size: 13px; color: var(--muted); min-height: 1.3em; margin-top: 8px; }
.status.error { color: var(--seal-deep); }
.progress {
  height: 8px; background: var(--chip); border-radius: 99px; overflow: hidden; margin-top: 8px;
}
.progress > span { display: block; height: 100%; width: 0; background: var(--jade); transition: width 0.2s; }
.file-list { display: grid; gap: 8px; margin-top: 12px; }
.file-row {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center;
  padding: 8px; border: 1px solid var(--line); border-radius: 12px;
}
.file-row img, .file-row canvas { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: #eee; }
.file-row .meta { font-size: 13px; }
.file-row .meta b { display: block; word-break: break-all; }
.ad-slot {
  padding: 14px 16px; background: repeating-linear-gradient(-45deg, #fffaf2, #fffaf2 12px, #f7efe2 12px, #f7efe2 24px);
  border-style: dashed;
}
.ad-slot .ad-kicker { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.ad-slot h3 { margin: 4px 0; font-family: var(--display); font-size: 22px; }
.ad-slot p { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.prices { display: grid; gap: 6px; margin: 8px 0; padding: 0; list-style: none; font-size: 13px; }
.prices li { display: flex; justify-content: space-between; gap: 8px; }
.note { padding: 14px 16px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; margin-top: 12px; }
.footer-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.site-footer h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; }
.site-footer a { display: block; color: var(--ink); text-decoration: none; margin: 4px 0; }
.site-footer a:hover { color: var(--seal); }
.fine { color: var(--muted); font-size: 12px; margin-top: 18px; line-height: 1.5; }
.nav-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 18px; }
.nav-pills a {
  text-decoration: none; color: var(--ink); border: 1px solid var(--line);
  background: var(--paper); border-radius: 999px; padding: 6px 11px; font-size: 13px;
}
.nav-pills a[aria-current="page"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
  width: 36px; height: 36px; border-radius: 50%; border: 2px solid #fff; outline: 1px solid var(--line-strong);
  cursor: pointer; padding: 0;
}
.swatch[aria-pressed="true"] { outline: 2px solid var(--ink); }
.crop-stage { position: relative; width: min(100%, 420px); margin: 0 auto; touch-action: none; }
.crop-stage canvas { width: 100%; height: auto; display: block; cursor: grab; }
.crop-frame {
  pointer-events: none; position: absolute; inset: 0; border: 2px solid var(--seal);
  box-shadow: 0 0 0 999px rgba(29,24,18,0.28);
}
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
