:root {
  --paper: #f7f2e9;
  --paper-deep: #efe7d9;
  --card: #fffdf8;
  --card-soft: #fbf7f0;
  --ink: #26332f;
  --ink-soft: #46534d;
  --muted: #7d7b70;
  --muted-light: #9a978b;
  --line: #e4dbcc;
  --line-strong: #d6c9b6;
  --accent: #d95d45;
  --accent-deep: #b84731;
  --accent-soft: #f8e5de;
  --sage: #7e9a83;
  --sage-deep: #40594a;
  --butter: #e7bd57;
  --butter-soft: #f6e8bd;
  --forest: #26332f;
  --shadow-lg: 0 34px 90px -46px rgba(67, 51, 30, 0.5), 0 2px 0 rgba(255, 255, 255, 0.8) inset;
  --shadow-md: 0 14px 34px -22px rgba(65, 50, 30, 0.45);
  --font-sans: "Noto Sans CJK SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-serif: "Noto Serif CJK SC", "Noto Serif SC", "Songti SC", "SimSun", serif;
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 14px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

section[id] { scroll-margin-top: 88px; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  font-family: var(--font-sans);
  background:
    radial-gradient(1000px 620px at 92% -8%, rgba(240, 206, 143, 0.42), transparent 62%),
    radial-gradient(860px 540px at -6% 26%, rgba(202, 219, 195, 0.44), transparent 58%),
    var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

.noscript { position: relative; z-index: 50; padding: 12px 20px; background: #d95d45; color: #fffdf8; text-align: center; font-size: 13px; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.34;
  background-image: radial-gradient(rgba(84, 67, 44, 0.18) 0.7px, transparent 0.8px);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.45) 55%, transparent 100%);
}

::selection { background: rgba(217, 93, 69, 0.22); }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: 0.42; cursor: not-allowed; transform: none !important; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
svg { display: block; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 18px;
  top: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}
.skip-link:focus-visible { transform: translateY(0); }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 242, 233, 0.82);
  border-bottom: 1px solid rgba(213, 201, 183, 0.6);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
}

.header-inner {
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: 15px 40px;
  display: flex;
  align-items: center;
  gap: 36px;
}

.brand { display: inline-flex; align-items: center; gap: 11px; flex: none; }

.brand-mark {
  width: 39px;
  height: 39px;
  padding: 5px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  border-radius: 12px;
  border: 1px solid var(--line-strong);
  background: #fffaf1;
  box-shadow: 0 5px 12px -8px rgba(67, 51, 30, 0.5), inset 0 1px 0 #fff;
  transform: rotate(-3deg);
}

.brand-mark i,
.mini-heart i {
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 250, 240, 0.92) 0 16%, transparent 18%),
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.5), transparent 42%),
    var(--bead);
  box-shadow: inset 0 0 0 1px rgba(47, 35, 20, 0.13);
}

.brand-word { display: flex; flex-direction: column; line-height: 1; }
.brand-word strong { font-size: 20px; font-weight: 800; letter-spacing: 0.04em; }
.brand-word em {
  margin-top: 5px;
  font-style: normal;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.21em;
  color: var(--muted);
}

.main-nav { display: flex; align-items: center; gap: 30px; margin-left: 18px; }
.main-nav a {
  position: relative;
  padding: 6px 0;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-soft);
}
.main-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.22s ease;
}
.main-nav a:hover::after { transform: scaleX(1); }

.header-tail { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.local-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #66756c;
  background: rgba(255, 253, 248, 0.6);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
}
.local-badge svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fffaf1;
  font-size: 12.5px;
  font-weight: 600;
  box-shadow: 0 8px 18px -12px rgba(35, 49, 45, 0.7);
  transition: background 0.2s ease, transform 0.2s ease;
}
.header-cta svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.header-cta:hover { background: var(--accent); transform: translateY(-1px); }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  z-index: 1;
  width: min(100%, 1480px);
  margin: 0 auto;
  padding: 56px 40px 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  align-items: center;
  gap: 60px;
}

.hero-copy { max-width: 850px; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.eyebrow i {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 2px;
  background: var(--accent);
  transform: rotate(12deg);
}
.eyebrow span { color: var(--muted-light); font-weight: 600; letter-spacing: 0.12em; }

.hero h1 {
  margin: 0;
  max-width: 900px;
  font-size: clamp(42px, 5.25vw, 76px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.045em;
}
.hero h1 span {
  color: var(--accent);
  background: linear-gradient(180deg, transparent 67%, rgba(231, 189, 87, 0.42) 67%, rgba(231, 189, 87, 0.42) 93%, transparent 93%);
  padding: 0 0.04em 0.04em;
}

.hero-copy > p {
  max-width: 625px;
  margin: 22px 0 0;
  color: var(--ink-soft);
  font-size: 15.5px;
  line-height: 1.9;
}

.hero-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 24px;
  margin-top: 27px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}
.hero-facts span { display: inline-flex; align-items: center; gap: 8px; }
.fact-dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
.fact-dot.coral { background: var(--accent); }
.fact-dot.sage { background: var(--sage); }
.fact-dot.butter { background: var(--butter); }

.hero-card {
  position: relative;
  align-self: center;
  justify-self: end;
  width: 310px;
  padding: 17px;
  border: 1px solid #e3d5bd;
  border-radius: 16px 20px 14px 18px;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.96), rgba(253, 247, 235, 0.96));
  box-shadow: 0 28px 55px -34px rgba(75, 54, 28, 0.6), 0 1px 0 #fff inset;
  transform: rotate(2.2deg);
}
.hero-card .tape {
  position: absolute;
  top: -12px;
  left: 50%;
  width: 92px;
  height: 24px;
  transform: translateX(-50%) rotate(-3deg);
  background: rgba(231, 189, 87, 0.46);
  border-left: 1px dashed rgba(128, 96, 38, 0.2);
  border-right: 1px dashed rgba(128, 96, 38, 0.2);
  box-shadow: 0 2px 5px rgba(80, 60, 30, 0.08);
  backdrop-filter: blur(1px);
}
.hero-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2px 2px 12px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.15em;
}
.hero-card-head span:last-child { color: var(--accent); }

.mini-heart {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 3px;
  padding: 13px;
  border: 1px solid #e9decc;
  border-radius: 9px;
  background:
    radial-gradient(circle at 1px 1px, rgba(111, 87, 55, 0.12) 1px, transparent 1.2px) 0 0 / 12px 12px,
    #f6eddd;
}
.mini-heart i { aspect-ratio: 1; }
.mini-heart i.empty { opacity: 0; }

.hero-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
  padding: 12px 2px 0;
  border-top: 1px dashed #ddd0bb;
}
.hero-card-foot div { display: flex; flex-direction: column; gap: 4px; }
.hero-card-foot strong { font-family: var(--font-serif); font-size: 15px; font-weight: 700; }
.hero-card-foot span { color: var(--muted); font-size: 10px; }
.hero-card-stamp {
  display: grid !important;
  place-items: center;
  width: 36px;
  height: 36px;
  flex: none;
  border: 1px solid rgba(217, 93, 69, 0.55);
  border-radius: 50%;
  color: var(--accent) !important;
  font-family: var(--font-serif);
  font-size: 10px !important;
  letter-spacing: 0.08em;
  transform: rotate(-9deg);
  box-shadow: inset 0 0 0 2px rgba(217, 93, 69, 0.08);
}

/* ---------- Studio shell ---------- */

.studio {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 80px), 1400px);
  margin: 0 auto 74px;
  border: 1px solid rgba(210, 196, 175, 0.82);
  border-radius: var(--radius-xl);
  background: rgba(255, 253, 248, 0.94);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.studio::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0 22%, var(--butter) 42%, var(--sage) 70%, var(--ink) 100%);
  opacity: 0.82;
}

.studio-head {
  min-height: 76px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.86);
}
.studio-head-left { display: flex; align-items: center; gap: 13px; }
.step-chip {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  box-shadow: 0 8px 16px -10px rgba(217, 93, 69, 0.8);
}
.studio-head h2 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: 0.01em; }
.studio-head p { margin: 4px 0 0; color: var(--muted); font-size: 11.5px; }
.studio-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #6e9c79; box-shadow: 0 0 0 4px rgba(110, 156, 121, 0.14); }

.studio-body {
  display: grid;
  grid-template-columns: 306px minmax(0, 1fr) 296px;
  min-height: 800px;
  height: auto;
}

.panel { min-width: 0; background: var(--card); }
.controls-panel {
  padding: 20px;
  border-right: 1px solid var(--line);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: #d9cdbb transparent;
}
.control-section, .controls-panel > .rule { flex: none; }
.controls-panel::-webkit-scrollbar { width: 5px; }
.controls-panel::-webkit-scrollbar-thumb { background: #d9cdbb; border-radius: 5px; }

.control-section { min-width: 0; }
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.section-heading .mini-note { color: var(--muted-light); font-size: 9.5px; font-weight: 500; letter-spacing: 0.02em; text-transform: none; }
.value-badge {
  min-width: 64px;
  padding: 4px 8px;
  border: 1px solid #e7dac6;
  border-radius: 7px;
  background: #fbf4e6;
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.02em;
  text-transform: none;
}
.text-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 10.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: #d5c7b4;
}
.text-btn:hover { color: var(--accent); }

.rule { height: 1px; margin: 19px 0; background: linear-gradient(90deg, transparent, var(--line) 12%, var(--line) 88%, transparent); }

/* ---------- Upload ---------- */

.dropzone {
  position: relative;
  min-height: 122px;
  padding: 17px;
  display: grid;
  place-items: center;
  border: 1.5px dashed #d9cbb8;
  border-radius: 16px;
  background:
    radial-gradient(circle at 1px 1px, rgba(120, 93, 56, 0.08) 1px, transparent 1.2px) 0 0 / 14px 14px,
    #fcf8f1;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
  cursor: pointer;
  overflow: hidden;
}
.dropzone:hover { border-color: rgba(217, 93, 69, 0.62); background-color: #fdf5ed; }
.dropzone.is-dragging { border-color: var(--accent); background-color: #fcece6; transform: scale(1.008); }

.drop-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.upload-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 2px;
  border: 1px solid #e4d6c2;
  border-radius: 50%;
  background: #fffdf8;
  color: var(--accent);
  box-shadow: 0 7px 15px -11px rgba(91, 64, 32, 0.5);
}
.upload-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.drop-empty strong { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.drop-empty > span:last-child { color: var(--muted-light); font-size: 10px; }

.drop-loaded { display: flex; align-items: center; gap: 11px; width: 100%; }
.thumb-checker {
  width: 48px;
  height: 48px;
  flex: none;
  padding: 3px;
  border: 1px solid #e3d7c6;
  border-radius: 10px;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #f0e9dd 25%, transparent 25%),
    linear-gradient(-45deg, #f0e9dd 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f0e9dd 75%),
    linear-gradient(-45deg, transparent 75%, #f0e9dd 75%);
  background-size: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 0;
  overflow: hidden;
}
.thumb-checker img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }
.thumb-checker.small { width: 37px; height: 37px; border-radius: 9px; }
.file-copy { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.file-copy strong { max-width: 138px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; font-weight: 600; }
.file-copy span { color: var(--muted-light); font-size: 9.5px; }
.replace-badge {
  margin-left: auto;
  padding: 4px 7px;
  flex: none;
  border: 1px solid #e5d9c8;
  border-radius: 6px;
  background: #fffdf8;
  color: var(--muted);
  font-size: 9.5px;
}
.drop-overlay {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(252, 235, 226, 0.94);
  color: var(--accent-deep);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.dropzone.is-dragging .drop-overlay { display: grid; }

.sample-row { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.sample-row > span { margin-right: 2px; color: var(--muted-light); font-size: 9.5px; }
.sample-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 25px;
  padding: 0 8px 0 5px;
  border: 1px solid #e5dac9;
  border-radius: 999px;
  background: #fffdf8;
  color: var(--ink-soft);
  font-size: 9.5px;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}
.sample-chip i {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #fffaf1 0 19%, transparent 21%),
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.4), transparent 43%),
    var(--c);
  box-shadow: inset 0 0 0 1px rgba(50, 35, 18, 0.12);
}
.sample-chip:hover { border-color: rgba(217, 93, 69, 0.5); background: #fdf5ed; transform: translateY(-1px); }
.sample-chip.active { border-color: rgba(217, 93, 69, 0.52); background: #fcece6; color: var(--accent-deep); }

/* ---------- Fields ---------- */

.field-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
}
.field-label span { color: var(--muted-light); font-size: 9px; font-weight: 500; }
.field-label output { color: var(--accent-deep); font-size: 10px; font-variant-numeric: tabular-nums; }
.field-label.spaced { margin-top: 14px; }

.range {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 18px;
  margin: 0;
  background: transparent;
  cursor: pointer;
}
.range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, #e9c6b8, #e8d8c4);
  box-shadow: inset 0 1px 2px rgba(92, 67, 40, 0.09);
}
.range::-moz-range-track {
  height: 4px;
  border-radius: 99px;
  background: #e8d8c4;
}
.range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 17px;
  height: 17px;
  margin-top: -6.5px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: #fffdf8;
  box-shadow: 0 3px 8px rgba(92, 67, 40, 0.2), inset 0 0 0 2px #fff;
  transition: transform 0.15s ease;
}
.range:hover::-webkit-slider-thumb { transform: scale(1.12); }
.range::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: #fffdf8;
  box-shadow: 0 3px 8px rgba(92, 67, 40, 0.2);
}
.range-sm { height: 16px; }
.range-sm::-webkit-slider-thumb { width: 14px; height: 14px; margin-top: -5px; }

.range-ticks {
  display: flex;
  justify-content: space-between;
  padding: 0 2px;
  color: var(--muted-light);
  font-size: 8.5px;
  font-variant-numeric: tabular-nums;
}

.preset-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin: 9px 0 2px; }
.preset-row button {
  height: 29px;
  border: 1px solid #e6dbc9;
  border-radius: 7px;
  background: #fffdf8;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: all 0.18s ease;
}
.preset-row button:hover { border-color: #d9a897; background: #fdf5ef; }
.preset-row button.active { border-color: var(--ink); background: var(--ink); color: #fffaf1; }

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 3px;
  border: 1px solid #e7dcca;
  border-radius: 9px;
  background: #f5efe4;
}
.segmented button {
  height: 29px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.segmented button:hover { color: var(--ink); }
.segmented button.active { background: #fffdf8; color: var(--ink); box-shadow: 0 2px 6px -3px rgba(65, 48, 28, 0.4); }
.control-hint { margin: 8px 1px 0; color: var(--muted-light); font-size: 8.5px; line-height: 1.55; }
.segmented.small { width: 196px; background: #fffdf8; border-color: #e4d9c9; }
.segmented.small button { height: 27px; font-size: 10.5px; }
.segmented.small button.active { background: var(--ink); color: #fffaf1; box-shadow: none; }

.switch-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 13px;
  padding: 10px 0 2px;
  cursor: pointer;
}
.switch-row > span { display: flex; flex-direction: column; gap: 3px; }
.switch-row strong { font-size: 11px; font-weight: 600; }
.switch-row small { color: var(--muted-light); font-size: 9px; line-height: 1.4; }
.switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.switch-track {
  position: relative;
  width: 36px;
  height: 21px;
  flex: none;
  border-radius: 999px;
  background: #ddd3c4;
  transition: background 0.2s ease;
  box-shadow: inset 0 1px 2px rgba(65, 48, 28, 0.14);
}
.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fffdf8;
  box-shadow: 0 1px 3px rgba(60, 42, 22, 0.28);
  transition: transform 0.2s ease;
}
.switch-row input:checked + .switch-track { background: var(--sage); }
.switch-row input:checked + .switch-track::after { transform: translateX(15px); }
.switch-row input:focus-visible + .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-row.compact { margin-top: 9px; padding-top: 8px; border-top: 1px dashed #ece2d3; }

.tolerance-wrap {
  margin-top: 4px;
  padding: 9px 10px 6px;
  border: 1px solid #e8ddcc;
  border-radius: 9px;
  background: #fbf6ee;
}
.tolerance-wrap .field-label { margin-bottom: 2px; font-size: 10px; }
.tolerance-wrap .field-label output { font-size: 9.5px; }

.palette-list { display: flex; flex-direction: column; gap: 6px; }
.palette-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 7px 9px;
  border: 1px solid #e8ddcc;
  border-radius: 10px;
  background: #fffdf8;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.palette-card:hover { border-color: #d9b8a8; }
.palette-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.palette-card:has(input:checked) { border-color: rgba(217, 93, 69, 0.65); background: #fdf5ef; box-shadow: inset 0 0 0 1px rgba(217, 93, 69, 0.1); }
.palette-card input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.palette-dots { display: flex; flex: none; padding-left: 2px; }
.palette-dots i {
  width: 17px;
  height: 17px;
  margin-left: -4px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #fffaf1 0 18%, transparent 20%),
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.5), transparent 44%),
    var(--c);
  box-shadow: inset 0 0 0 1px rgba(50, 35, 18, 0.13), 0 0 0 1.5px #fffdf8;
}
.palette-dots i:first-child { margin-left: 0; }
.palette-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.palette-copy strong { font-size: 10.5px; font-weight: 600; }
.palette-copy em { margin-left: 3px; color: var(--muted-light); font-style: normal; font-size: 9px; font-weight: 500; }
.palette-copy small { color: var(--muted-light); font-size: 8.5px; }
.radio-mark {
  position: relative;
  width: 14px;
  height: 14px;
  margin-left: auto;
  flex: none;
  border: 1.5px solid #d4c7b4;
  border-radius: 50%;
  background: #fff;
}
.palette-card input:checked ~ .radio-mark { border-color: var(--accent); }
.palette-card input:checked ~ .radio-mark::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--accent);
}

.control-tip {
  flex: none;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 18px;
  padding: 10px;
  border: 1px solid #e7dccb;
  border-radius: 10px;
  background: #faf5ec;
}
.control-tip-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  background: #edf2e9;
  color: var(--sage-deep);
}
.control-tip-icon svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.control-tip p { margin: 0; display: flex; flex-direction: column; gap: 3px; }
.control-tip strong { color: var(--ink-soft); font-size: 9.5px; font-weight: 600; }
.control-tip span { color: var(--muted-light); font-size: 8.5px; line-height: 1.45; }

.advanced { margin-top: 9px; border-top: 1px dashed #ece2d3; }
.advanced summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0 2px;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary span { color: var(--muted-light); font-size: 8.5px; font-weight: 400; }
.advanced summary::after {
  content: "+";
  order: 3;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border: 1px solid #e3d7c6;
  border-radius: 50%;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}
.advanced[open] summary::after { content: "−"; }
.adv-body { padding: 9px 0 2px; }
.adv-body .field-label { margin-top: 8px; margin-bottom: 2px; font-size: 10px; }
.adv-body .field-label:first-child { margin-top: 0; }
.adv-body .text-btn { margin-top: 9px; }

/* ---------- Stage ---------- */

.stage {
  min-width: 0;
  padding: 15px;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 1px 1px, rgba(91, 70, 43, 0.1) 1px, transparent 1.2px) 0 0 / 19px 19px,
    linear-gradient(160deg, #f1e9dc, #ece2d3 75%, #eee6d8);
  border-right: 1px solid var(--line);
}

.stage-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.stage-actions { display: flex; align-items: center; gap: 6px; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  padding: 0;
  border: 1px solid #e4d9c9;
  border-radius: 9px;
  background: rgba(255, 253, 248, 0.75);
  color: var(--muted);
  transition: all 0.18s ease;
}
.icon-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { border-color: #d1b9a4; color: var(--ink); background: #fffdf8; }
.icon-btn.active { border-color: var(--ink); background: var(--ink); color: #fffaf1; }

.soft-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid #e4d9c9;
  border-radius: 9px;
  background: rgba(255, 253, 248, 0.75);
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
  transition: all 0.18s ease;
}
.soft-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.soft-btn:hover { border-color: #d1b9a4; color: var(--ink); background: #fffdf8; }
.compare-btn.is-active { border-color: var(--accent); background: #fff3ec; color: var(--accent-deep); }

.canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 53px 22px 40px;
  border: 1px solid rgba(122, 97, 63, 0.15);
  border-radius: 20px;
  background: rgba(255, 252, 246, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 -20px 40px rgba(122, 97, 63, 0.03);
  overflow: hidden;
}
.canvas-center { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 0; }
#previewCanvas {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 620px;
  border-radius: 8px;
  box-shadow: 0 20px 38px -26px rgba(68, 49, 26, 0.55), 0 0 0 1px rgba(90, 68, 40, 0.12);
  transition: opacity 0.2s ease;
}
.canvas-wrap.is-empty #previewCanvas { visibility: hidden; }
.canvas-wrap.is-dragging { border-color: var(--accent); }

.board-meta {
  position: absolute;
  top: 15px;
  left: 17px;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 25px;
  padding: 0 10px;
  border: 1px solid rgba(216, 203, 184, 0.9);
  border-radius: 999px;
  background: rgba(255, 252, 247, 0.85);
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(6px);
}
.board-meta i { color: #c1b09a; font-style: normal; }

.canvas-help {
  position: absolute;
  bottom: 13px;
  left: 50%;
  transform: translateX(-50%);
  color: #a39b8c;
  font-size: 9.5px;
  white-space: nowrap;
}

.highlight-pill {
  position: absolute;
  top: 13px;
  right: 15px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 29px;
  padding: 0 6px 0 5px;
  border: 1px solid rgba(217, 93, 69, 0.35);
  border-radius: 999px;
  background: rgba(255, 248, 243, 0.94);
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(8px);
}
.highlight-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #fffaf1 0 18%, transparent 20%),
    var(--c, #ccc);
  box-shadow: inset 0 0 0 1px rgba(40, 28, 14, 0.15);
}
.highlight-pill button { width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%; background: #f6e4da; color: var(--accent-deep); font-size: 14px; line-height: 1; }

.compare-flag {
  position: absolute;
  top: 14px;
  right: 16px;
  padding: 6px 11px;
  border-radius: 999px;
  background: var(--ink);
  color: #fffaf1;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.empty-stage {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 30px;
  text-align: center;
  background: rgba(248, 243, 234, 0.65);
}
.empty-stage strong { margin-top: 9px; font-family: var(--font-serif); font-size: 17px; }
.empty-stage p { margin: 0; color: var(--muted); font-size: 11px; }
.empty-orbit { position: relative; width: 64px; height: 64px; }
.empty-orbit i {
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #f3ecdf 0 19%, transparent 21%),
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.45), transparent 44%),
    var(--c);
  box-shadow: inset 0 0 0 1px rgba(50, 35, 18, 0.12);
}
.empty-orbit i:nth-child(1) { --c: var(--accent); top: 6px; left: 6px; }
.empty-orbit i:nth-child(2) { --c: var(--butter); top: 19px; right: 4px; width: 22px; height: 22px; }
.empty-orbit i:nth-child(3) { --c: var(--sage); bottom: 2px; left: 24px; width: 16px; height: 16px; }

.stage-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 4px 1px;
}
.source-card { display: flex; align-items: center; gap: 9px; min-width: 0; }
.source-card > span:last-child { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.source-card small { color: var(--muted-light); font-size: 8.5px; }
.source-card strong { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-soft); font-size: 10.5px; font-weight: 600; }
.stats { display: flex; align-items: center; gap: 0; }
.stat { min-width: 78px; padding: 0 15px; border-left: 1px solid rgba(123, 98, 64, 0.16); text-align: right; }
.stat:first-child { border-left: 0; }
.stat strong { display: block; color: var(--ink); font-size: 15px; font-weight: 700; line-height: 1.1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { display: block; margin-top: 3px; color: var(--muted); font-size: 8.5px; white-space: nowrap; }

/* ---------- Legend ---------- */

.legend-panel { padding: 18px; display: flex; flex-direction: column; min-height: 0; }
.legend-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 1px 2px 13px; border-bottom: 1px solid var(--line); }
.legend-head h3 { margin: 0; font-size: 14px; font-weight: 700; }
.legend-head p { margin: 4px 0 0; color: var(--muted-light); font-size: 9.5px; }
.legend-head .icon-btn { width: 30px; height: 30px; }
.legend-head .icon-btn svg { width: 14px; height: 14px; }

.legend-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 0 6px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #dbcfbd transparent;
}
.legend-list::-webkit-scrollbar { width: 5px; }
.legend-list::-webkit-scrollbar-thumb { background: #dbcfbd; border-radius: 5px; }

.legend-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 39px;
  padding: 5px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  transition: background 0.16s ease, box-shadow 0.16s ease;
}
.legend-item:hover { background: #faf3e9; }
.legend-item.active { background: #fbece5; box-shadow: inset 0 0 0 1px rgba(217, 93, 69, 0.32); }
.legend-item[aria-pressed="true"] .legend-swatch { box-shadow: inset 0 0 0 1px rgba(45, 32, 18, 0.14), 0 0 0 2px #fffdf8, 0 0 0 3.5px var(--accent); }
.legend-swatch {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #fffaf1 0 16%, rgba(45, 33, 20, 0.22) 17%, transparent 19%),
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.48), transparent 43%),
    var(--c);
  box-shadow: inset 0 0 0 1px rgba(45, 32, 18, 0.14), 0 1px 2px rgba(60, 42, 22, 0.12);
}
.legend-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.legend-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10.5px; font-weight: 600; }
.legend-copy span { color: var(--muted-light); font-size: 8.5px; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; letter-spacing: 0.02em; }
.legend-count { margin-left: auto; display: flex; align-items: baseline; gap: 2px; color: var(--ink-soft); font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.legend-count em { color: var(--muted-light); font-style: normal; font-size: 8px; font-weight: 400; }
.legend-bar { position: absolute; left: 41px; right: 8px; bottom: 3px; height: 2px; border-radius: 2px; background: #f1e9dd; overflow: hidden; }
.legend-bar i { display: block; height: 100%; border-radius: 2px; background: var(--c); opacity: 0.55; }

.legend-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 20px; text-align: center; color: var(--muted); }
.legend-empty > span { font-size: 28px; color: #c8bba8; }
.legend-empty p { max-width: 180px; margin: 0; font-size: 10.5px; line-height: 1.7; }

.export-box { margin-top: auto; padding-top: 13px; border-top: 1px solid var(--line); }
.btn-primary {
  width: 100%;
  min-height: 48px;
  padding: 9px 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 11px;
  background: var(--accent);
  color: #fffdf8;
  box-shadow: 0 12px 22px -14px rgba(185, 68, 47, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.btn-primary:hover { background: var(--accent-deep); transform: translateY(-1px); box-shadow: 0 16px 26px -15px rgba(185, 68, 47, 0.8); }
.btn-primary:active { transform: translateY(0); }
.btn-primary svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary > span { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; font-size: 11.5px; font-weight: 600; }
.btn-primary small { color: rgba(255, 253, 248, 0.68); font-size: 8.5px; font-weight: 400; }
.btn-primary.is-loading { opacity: 0.72; pointer-events: none; }
.export-secondary { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 7px; }
.export-secondary button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 31px;
  border: 1px solid #e6dbc9;
  border-radius: 8px;
  background: #fffdf8;
  color: var(--muted);
  font-size: 9.5px;
  transition: all 0.18s ease;
}
.export-secondary button:hover { border-color: #d8b7a5; color: var(--ink); background: #fdf7f0; }
.export-secondary svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.export-note { margin: 8px 0 0; color: var(--muted-light); font-size: 9px; text-align: center; }
.export-note strong { color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* ---------- Guide ---------- */

.guide {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 80px), 1400px);
  margin: 0 auto 74px;
}
.section-lead { max-width: 620px; margin-bottom: 29px; }
.section-lead .eyebrow { margin-bottom: 14px; }
.section-lead h2 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(28px, 3.1vw, 42px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.035em;
}
.section-lead p { margin: 12px 0 0; color: var(--muted); font-size: 13px; line-height: 1.8; }

.step-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.step-card {
  position: relative;
  padding: 20px;
  border: 1px solid rgba(214, 201, 182, 0.92);
  border-radius: 20px;
  background: rgba(255, 252, 247, 0.78);
  box-shadow: 0 1px 0 #fff inset;
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}
.step-card:hover { transform: translateY(-3px); background: #fffdf8; box-shadow: var(--shadow-md); }
.step-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.step-number { color: var(--muted-light); font-family: var(--font-serif); font-size: 14px; font-style: italic; letter-spacing: 0.04em; }
.step-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid #e4d8c6;
  border-radius: 50%;
  background: #fbf4e8;
  color: var(--accent);
}
.step-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.step-card h3 { margin: 0 0 8px; font-size: 16px; font-weight: 700; }
.step-card p { margin: 0; min-height: 58px; color: var(--muted); font-size: 11.5px; line-height: 1.75; }
.step-visual { position: relative; height: 84px; margin-top: 16px; border-radius: 12px; background: #f8f1e6; overflow: hidden; }
.step-visual::before { content: ""; position: absolute; inset: 0; opacity: 0.5; background-image: radial-gradient(rgba(100, 76, 45, 0.18) 0.7px, transparent 0.8px); background-size: 12px 12px; }

.upload-visual span { position: absolute; border: 1px solid #ddcfbb; border-radius: 50%; background: #fffaf2; }
.upload-visual span:nth-child(1) { width: 44px; height: 44px; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.upload-visual span:nth-child(2) { width: 12px; height: 12px; left: calc(50% - 6px); top: calc(50% - 6px); border: 0; background: var(--accent); box-shadow: 0 0 0 5px rgba(217, 93, 69, 0.12); }
.upload-visual span:nth-child(3) { width: 18px; height: 18px; left: calc(50% - 9px); top: calc(50% - 22px); border: 0; border-radius: 3px 3px 0 0; background: var(--accent); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.upload-visual span:nth-child(2) { display: none; }

.grid-visual { display: grid; grid-template-columns: repeat(4, 1fr); place-items: center; padding: 17px 30px; gap: 7px; }
.grid-visual i {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #f8f1e6 0 17%, transparent 19%),
    radial-gradient(circle at 34% 28%, rgba(255, 255, 255, 0.45), transparent 43%),
    var(--c);
  box-shadow: inset 0 0 0 1px rgba(45, 32, 18, 0.13);
}
.grid-visual i:nth-child(1) { transform: translateY(-5px); }
.grid-visual i:nth-child(2) { transform: translateY(5px); }
.grid-visual i:nth-child(3) { transform: translateY(-2px); }
.grid-visual i:nth-child(4) { transform: translateY(6px); }

.sheet-visual span { position: absolute; left: 50%; height: 3px; border-radius: 3px; background: #d8c9b5; transform: translateX(-50%); }
.sheet-visual span:nth-child(1) { width: 72px; top: 26px; background: var(--accent); opacity: 0.55; }
.sheet-visual span:nth-child(2) { width: 96px; top: 39px; }
.sheet-visual span:nth-child(3) { width: 60px; top: 52px; }
.sheet-visual::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 18px;
  width: 120px;
  height: 50px;
  transform: translateX(-50%);
  border: 1px solid #ddcfbb;
  border-radius: 5px;
  background: rgba(255, 252, 245, 0.68);
}

/* ---------- Palette band ---------- */

.palette-section {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 80px), 1400px);
  margin: 0 auto 74px;
  padding: 42px 44px;
  display: grid;
  grid-template-columns: 355px minmax(0, 1fr);
  gap: 50px;
  align-items: center;
  border-radius: var(--radius-xl);
  background:
    radial-gradient(650px 380px at 92% 8%, rgba(217, 93, 69, 0.17), transparent 65%),
    radial-gradient(500px 340px at 4% 100%, rgba(126, 154, 131, 0.2), transparent 60%),
    var(--forest);
  color: #f9f3e7;
  box-shadow: 0 30px 70px -45px rgba(24, 35, 31, 0.85);
  overflow: hidden;
}
.palette-section::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image: radial-gradient(rgba(255, 247, 233, 0.5) 0.7px, transparent 0.8px);
  background-size: 26px 26px;
  mask-image: linear-gradient(110deg, transparent 20%, #000 80%);
}
.palette-copy { position: relative; z-index: 1; }
.palette-copy .eyebrow { color: #b8c1b4; margin-bottom: 14px; }
.palette-copy .eyebrow span { color: #89988d; }
.palette-copy .eyebrow i { background: var(--butter); }
.palette-copy h2 { margin: 0; font-family: var(--font-serif); font-size: clamp(28px, 3.1vw, 42px); font-weight: 700; line-height: 1.24; letter-spacing: -0.035em; color: #fff9ec; }
.palette-copy p { margin: 14px 0 0; max-width: 315px; color: #b6c0b6; font-size: 12px; line-height: 1.8; }
.text-link { display: inline-flex; align-items: center; gap: 7px; margin-top: 19px; color: var(--butter); font-size: 11.5px; font-weight: 600; border-bottom: 1px solid rgba(231, 189, 87, 0.4); padding-bottom: 3px; }
.text-link span { transition: transform 0.18s ease; }
.text-link:hover span { transform: translateX(3px); }

.swatch-wall {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  align-content: center;
}
.swatch-wall button {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(38, 51, 47, 0.88) 0 15%, transparent 17%),
    radial-gradient(circle at 33% 27%, rgba(255, 255, 255, 0.55), transparent 43%),
    var(--c);
  box-shadow: inset 0 0 0 1px rgba(20, 24, 20, 0.2), 0 2px 5px rgba(12, 20, 16, 0.18);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.swatch-wall button:hover { transform: translateY(-3px) scale(1.12); box-shadow: inset 0 0 0 1px rgba(20, 24, 20, 0.2), 0 8px 14px rgba(8, 14, 11, 0.28); z-index: 2; }
.swatch-wall button:active { transform: scale(0.96); }

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  z-index: 1;
  width: min(calc(100% - 80px), 1400px);
  margin: 0 auto;
  padding: 28px 0 42px;
  border-top: 1px solid var(--line);
}
.footer-brand { display: flex; align-items: center; gap: 11px; }
.brand-mark.small { width: 31px; height: 31px; padding: 4px; border-radius: 9px; gap: 2px; }
.footer-brand > span:last-child { display: flex; flex-direction: column; gap: 3px; }
.footer-brand strong { font-size: 14px; font-weight: 800; letter-spacing: 0.04em; }
.footer-brand small { color: var(--muted); font-size: 9px; }
.footer-line { margin: 26px 0 30px; font-family: var(--font-serif); font-size: clamp(20px, 2.2vw, 30px); font-weight: 700; letter-spacing: -0.03em; color: var(--ink-soft); }
.footer-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; color: var(--muted); font-size: 9.5px; }
.footer-meta a { transition: color 0.18s ease; }
.footer-meta a:hover { color: var(--accent); }
.footer-meta span { margin-left: auto; color: var(--muted-light); }

/* ---------- Dialog / Toast ---------- */

.preview-dialog {
  width: min(92vw, 920px);
  max-width: 920px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 40px 100px -30px rgba(24, 34, 29, 0.6);
}
.preview-dialog::backdrop { background: rgba(30, 40, 35, 0.55); backdrop-filter: blur(4px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.dialog-head > div { display: flex; align-items: baseline; gap: 10px; }
.dialog-head strong { font-size: 13px; }
.dialog-head span { color: var(--muted); font-size: 10px; }
.dialog-canvas-wrap { display: flex; align-items: center; justify-content: center; padding: 18px; max-height: 76vh; overflow: auto; background: #f2ebdf; }
#dialogCanvas { max-width: 100%; height: auto; border-radius: 6px; box-shadow: 0 15px 30px -20px rgba(60, 44, 24, 0.5); }
.dialog-hint { margin: 0; padding: 0 16px 13px; color: var(--muted-light); font-size: 9.5px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 90;
  max-width: calc(100vw - 36px);
  padding: 11px 17px;
  border-radius: 999px;
  background: var(--ink);
  color: #fffaf1;
  font-size: 11.5px;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 16px 30px -14px rgba(30, 40, 35, 0.65);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */

@media (max-width: 1240px) {
  .header-inner { padding-inline: 28px; }
  .hero { padding-inline: 28px; gap: 38px; grid-template-columns: minmax(0, 1fr) 300px; }
  .studio, .guide, .palette-section, .site-footer { width: calc(100% - 48px); }
  .studio-body { grid-template-columns: 292px minmax(0, 1fr) 280px; min-height: 790px; height: auto; }
  .controls-panel { padding: 18px; }
  .legend-panel { padding: 16px; }
  .stage { padding: 13px; }
  .stat { min-width: 70px; padding-inline: 12px; }
  .section-lead { margin-bottom: 24px; }
}

@media (max-width: 1080px) {
  .main-nav { gap: 22px; margin-left: 0; }
  .hero { grid-template-columns: minmax(0, 1fr) 286px; gap: 28px; }
  .hero-card { width: 286px; }
  .studio-body {
    height: auto;
    grid-template-columns: 292px minmax(0, 1fr);
  }
  .legend-panel {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 17px 20px;
    min-height: 0;
  }
  .legend-list {
    flex: none;
    height: auto;
    max-height: 245px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0 10px;
    padding-block: 7px;
  }
  .legend-item { min-height: 37px; }
  .legend-empty { min-height: 130px; flex: none; }
  .export-box { display: grid; grid-template-columns: minmax(220px, 1.15fr) minmax(190px, 1fr); align-items: stretch; gap: 8px 10px; margin-top: 4px; padding-top: 12px; }
  .btn-primary { grid-column: 1; grid-row: 1 / span 2; }
  .btn-publish { grid-column: 2; grid-row: 1; margin-top: 0; }
  .export-secondary { grid-column: 2; grid-row: 2; margin-top: 0; }
  .export-note { grid-column: 1 / -1; grid-row: 3; margin: 0; text-align: center; }
  .stage { min-height: 720px; border-right: 0; }
  .canvas-wrap { min-height: 540px; }
  .step-card p { min-height: 0; }
}

@media (max-width: 860px) {
  .noscript { position: relative; z-index: 50; padding: 12px 20px; background: #d95d45; color: #fffdf8; text-align: center; font-size: 13px; }

body::before { opacity: 0.25; }
  .header-inner { padding: 13px 20px; gap: 14px; }
  .main-nav { display: none; }
  .local-badge { padding: 0 10px; }
  .header-cta { height: 36px; padding: 0 13px; }
  .brand-mark { width: 36px; height: 36px; }
  .brand-word strong { font-size: 18px; }

  .hero { padding: 42px 20px 30px; display: block; }
  .hero h1 { font-size: clamp(38px, 8.8vw, 58px); }
  .hero-copy > p { font-size: 14px; line-height: 1.85; margin-top: 18px; }
  .hero-card { display: none; }
  .hero-facts { gap: 9px 18px; margin-top: 21px; font-size: 11px; }

  .studio, .guide, .palette-section, .site-footer { width: calc(100% - 28px); }
  .studio { border-radius: 24px; margin-bottom: 52px; }
  .studio-head { min-height: 68px; padding: 14px 16px; }
  .studio-head-right { display: none; }
  .studio-body { display: flex; flex-direction: column; height: auto; }
  .controls-panel { border-right: 0; padding: 17px 16px 20px; overflow: visible; }
  .stage { border-right: 0; border-top: 1px solid var(--line); padding: 12px; min-height: 0; }
  .legend-panel { border-top: 1px solid var(--line); padding: 16px; }
  .canvas-wrap { min-height: 0; height: min(68vw, 470px); padding: 50px 12px 36px; }
  .stage-footer { flex-wrap: wrap; gap: 10px; padding: 12px 3px 2px; }
  .source-card { display: none; }
  .stats { width: 100%; justify-content: space-between; }
  .stat { flex: 1; padding: 0 8px; text-align: left; }
  .stat:first-child { padding-left: 0; }
  .stat:last-child { padding-right: 0; }
  .stat strong { font-size: 14px; }
  .stat span { font-size: 8px; }
  .stage-toolbar { flex-wrap: wrap; gap: 7px; }
  .segmented.small { width: 174px; }
  .segmented button { height: 36px; font-size: 11px; }
  .segmented.small button { height: 32px; font-size: 10.5px; }
  .preset-row button { height: 37px; font-size: 11px; }
  .sample-chip { height: 31px; padding-right: 10px; font-size: 10.5px; }
  .sample-chip i { width: 16px; height: 16px; }
  .icon-btn { width: 38px; height: 38px; }
  .soft-btn { height: 38px; }
  .range { height: 24px; }
  .range::-webkit-slider-thumb { width: 20px; height: 20px; margin-top: -8px; }
  .range-sm { height: 22px; }
  .range-sm::-webkit-slider-thumb { width: 17px; height: 17px; margin-top: -6.5px; }
  .field-label { font-size: 11.5px; }

  .switch-row strong { font-size: 12px; }
  .switch-row small { font-size: 10px; }
  .palette-copy strong { font-size: 11.5px; }
  .palette-copy small { font-size: 9.5px; }
  .legend-item { min-height: 42px; }
  .legend-copy strong { font-size: 11px; }
  .legend-copy span { font-size: 9px; }
  .legend-count { font-size: 11px; }
  .export-secondary button { height: 36px; font-size: 10.5px; }
  .stat span { font-size: 9px; }
  .compare-btn { padding-inline: 8px; }
  .compare-btn span { display: none; }
  .compare-btn::after { content: "原图"; font-size: 10px; }
  .canvas-help { display: none; }
  .board-meta { top: 12px; left: 12px; }
  .highlight-pill, .compare-flag { top: 11px; right: 12px; }
  .legend-list { max-height: 270px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legend-head { padding-bottom: 10px; }
  .export-box { display: block; margin-top: 0; }
  .export-secondary { margin-top: 7px; }
  .export-note { margin-top: 8px; text-align: center; }
  .btn-primary { min-height: 46px; }

  .guide { margin-bottom: 52px; }
  .section-lead { margin-bottom: 20px; }
  .step-grid { grid-template-columns: 1fr; gap: 10px; }
  .step-card { padding: 17px; }
  .step-card-top { margin-bottom: 12px; }
  .step-card p { min-height: 0; }
  .step-visual { height: 70px; margin-top: 13px; }

  .palette-section { display: block; padding: 28px 20px 30px; margin-bottom: 52px; border-radius: 24px; }
  .palette-copy h2 { font-size: clamp(27px, 7vw, 36px); }
  .palette-copy p { font-size: 11.5px; }
  .swatch-wall { margin-top: 24px; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 8px; }

  .site-footer { padding-bottom: 32px; }
  .footer-line { margin: 22px 0 24px; }
  .footer-meta { gap: 8px 16px; }
  .footer-meta span { width: 100%; margin-left: 0; }
}

@media (max-width: 480px) {
  .header-inner { padding: 12px 15px; }
  .local-badge { font-size: 10px; height: 30px; }
  .local-badge svg { width: 12px; height: 12px; }
  .header-cta { display: none; }
  .hero { padding: 36px 16px 25px; }
  .eyebrow { font-size: 9.5px; }
  .hero h1 { font-size: 38px; }
  .hero-copy > p { font-size: 13.5px; }
  .hero-facts { gap: 8px 13px; font-size: 10.5px; }
  .studio, .guide, .palette-section, .site-footer { width: calc(100% - 20px); }
  .studio-head { padding: 13px 14px; }
  .step-chip { width: 30px; height: 30px; border-radius: 8px; font-size: 10px; }
  .studio-head h2 { font-size: 15px; }
  .studio-head p { font-size: 10.5px; }
  .controls-panel { padding: 16px 13px 18px; }
  .stage { padding: 9px; }
  .legend-panel { padding: 14px 13px; }
  .canvas-wrap { height: min(74vw, 420px); padding: 47px 9px 32px; border-radius: 16px; }
  .segmented.small { width: 158px; }
  .segmented.small button { font-size: 10px; padding: 0 4px; }
  .stage-actions { gap: 4px; }
  .icon-btn { width: 38px; height: 38px; border-radius: 9px; }
  .soft-btn { height: 38px; }
  .stat { padding: 0 7px; }
  .stat strong { font-size: 13px; }
  .legend-list { max-height: 280px; gap: 0 5px; }
  .legend-item { gap: 7px; padding-inline: 4px; }
  .legend-swatch { width: 23px; height: 23px; }
  .legend-copy strong { font-size: 10px; }
  .legend-bar { left: 34px; }
  .palette-section { padding: 24px 16px 26px; }
  .swatch-wall { gap: 6px; }
  .dialog-canvas-wrap { padding: 10px; }
  .toast { bottom: 18px; font-size: 11px; }
}

@media (max-width: 360px) {
  .stats { flex-wrap: wrap; gap: 6px 0; }
  .stat { min-width: 33%; }
  .header-tail .local-badge { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- 上传入口与成品库发布 ---------- */

.cta-short { display: none; }

.hero-gallery-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent-deep);
  font-size: 11.5px;
  font-weight: 600;
  border-bottom: 1px solid rgba(217, 93, 69, 0.3);
  padding-bottom: 2px;
  margin-left: 4px;
}
.hero-gallery-link span { transition: transform 0.18s ease; }
.hero-gallery-link:hover span { transform: translateX(3px); }

.stage-upload {
  border-color: rgba(217, 93, 69, 0.38);
  background: #fff7f1;
  color: var(--accent-deep);
  font-weight: 600;
}
.stage-upload:hover { border-color: var(--accent); color: var(--accent-deep); background: #fdf0e9; }
.stage-upload svg { width: 14px; height: 14px; }

.btn-publish {
  width: 100%;
  min-height: 42px;
  margin-top: 7px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid #cdd9c9;
  border-radius: 10px;
  background: #f2f6ef;
  color: var(--sage-deep);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.btn-publish:hover { background: #e9f0e5; border-color: var(--sage); transform: translateY(-1px); }
.btn-publish svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-publish > span { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; font-size: 10.5px; font-weight: 600; }
.btn-publish small { color: #8d9b8e; font-size: 8px; font-weight: 400; }

.publish-dialog {
  width: min(94vw, 900px);
  max-width: 900px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 40px 100px -30px rgba(24, 34, 29, 0.62);
}
.publish-dialog::backdrop { background: rgba(30, 40, 35, 0.56); backdrop-filter: blur(4px); }
.publish-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}
.publish-head > div { display: flex; align-items: baseline; gap: 10px; }
.publish-head strong { font-size: 13px; }
.publish-head span { color: var(--muted); font-size: 9.5px; }
.publish-body { display: grid; grid-template-columns: minmax(0, 0.95fr) minmax(340px, 1.05fr); }
.publish-preview-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background:
    radial-gradient(circle at 1px 1px, rgba(98, 75, 46, 0.11) 1px, transparent 1.2px) 0 0 / 16px 16px,
    #f1e9dc;
  border-radius: 0 0 0 22px;
}
.publish-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 220px;
}
#publishCanvas {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 54vh;
  border-radius: 8px;
  box-shadow: 0 18px 30px -24px rgba(55, 38, 17, 0.65), 0 0 0 1px rgba(85, 63, 35, 0.1);
}
.publish-preview-wrap > p {
  margin: 15px 0 0;
  max-width: 330px;
  color: #7d7466;
  font-size: 9px;
  line-height: 1.65;
  text-align: center;
}
.privacy-mark {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  margin-right: 3px;
  border-radius: 50%;
  background: #dce8d8;
  color: var(--sage-deep);
  font-size: 8px;
}
.publish-form-wrap { padding: 22px 22px 20px; min-width: 0; }
.publish-form-title h2 { margin: 0; font-family: var(--font-serif); font-size: 26px; font-weight: 700; letter-spacing: -0.035em; }
.publish-form-title p { margin: 5px 0 0; color: var(--muted); font-size: 9.5px; }
.publish-field { position: relative; display: block; margin-top: 14px; }
.publish-field > span { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; color: var(--ink-soft); font-size: 10.5px; font-weight: 600; }
.publish-field em { color: var(--muted-light); font-style: normal; font-size: 8px; font-weight: 400; }
.publish-field input,
.publish-field textarea {
  width: 100%;
  border: 1px solid #e0d5c5;
  border-radius: 9px;
  background: #fffdf9;
  color: var(--ink);
  font-size: 11.5px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.publish-field input { height: 36px; padding: 0 10px; }
.publish-field textarea { min-height: 66px; padding: 9px 10px; resize: vertical; line-height: 1.6; }
.publish-field input:focus,
.publish-field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(217, 93, 69, 0.09); }
.publish-field input::placeholder,
.publish-field textarea::placeholder { color: #b5ac9d; }
.publish-count { position: absolute; right: 8px; bottom: 7px; color: #aaa294; font-size: 8px; background: rgba(255, 253, 249, 0.88); padding-left: 4px; }
.publish-submit {
  width: 100%;
  height: 42px;
  margin-top: 16px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fffdf8;
  font-size: 11.5px;
  font-weight: 600;
  box-shadow: 0 12px 22px -15px rgba(185, 68, 47, 0.75);
  transition: background 0.18s ease, transform 0.18s ease;
}
.publish-submit:hover { background: var(--accent-deep); transform: translateY(-1px); }
.publish-submit:disabled { opacity: 0.55; transform: none; cursor: wait; }
.publish-policy { margin: 9px 0 0; color: var(--muted-light); font-size: 8px; line-height: 1.55; text-align: center; }
.publish-error { margin: 8px 0 0; color: #b8442e; font-size: 9px; line-height: 1.5; text-align: center; }
.publish-success { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 380px; padding: 16px 6px; text-align: center; }
.publish-success-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; background: #e6f0e1; color: var(--sage-deep); font-size: 24px; box-shadow: inset 0 0 0 1px rgba(126, 154, 131, 0.25); }
.publish-success h2 { margin: 17px 0 0; font-family: var(--font-serif); font-size: 25px; font-weight: 700; letter-spacing: -0.03em; }
.publish-success p { max-width: 310px; margin: 8px 0 0; color: var(--muted); font-size: 10px; line-height: 1.75; }
.publish-success-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; color: var(--accent-deep); font-size: 11.5px; font-weight: 600; border-bottom: 1px solid rgba(217, 93, 69, 0.35); padding-bottom: 3px; }
.publish-copy-link, .publish-close-text { margin-top: 13px; height: 32px; padding: 0 13px; border: 1px solid #e2d6c5; border-radius: 999px; background: #fffdf8; color: var(--muted); font-size: 9.5px; }
.publish-copy-link:hover, .publish-close-text:hover { border-color: var(--accent); color: var(--accent-deep); }
.publish-close-text { margin-top: 8px; border-color: transparent; background: transparent; text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 860px) {
  .cta-full { display: none; }
  .cta-short { display: inline; }
  .header-cta { height: 35px; padding: 0 11px; font-size: 11px; gap: 5px; }
  .stage-upload span { display: none; }
  .stage-upload { width: 38px; padding: 0; }
  .publish-dialog { width: 94vw; }
  .publish-body { display: block; max-height: 82vh; overflow-y: auto; }
  .publish-preview-wrap { padding: 14px; border-radius: 0; }
  #publishCanvas { max-height: 34vh; }
  .publish-preview-wrap > p { margin-top: 10px; }
  .publish-form-wrap { padding: 17px 16px 18px; }
  .publish-form-title h2 { font-size: 23px; }
  .publish-success { min-height: 300px; }
}

@media (max-width: 480px) {
  .header-cta { display: inline-flex; height: 33px; padding: 0 9px; font-size: 10px; }
  .header-tail { gap: 7px; }
  .local-badge { font-size: 9.5px; padding-inline: 8px; }
  .hero-gallery-link { font-size: 10.5px; }
  .publish-dialog { border-radius: 18px; }
  .publish-head { padding: 11px 12px; }
  .publish-head span { display: none; }
  .publish-field input { height: 37px; font-size: 12px; }
  .publish-field textarea { font-size: 12px; }
  .publish-submit { height: 43px; font-size: 12px; }
}

@media (max-width: 860px) {
  .publish-dialog[open] {
    display: flex;
    flex-direction: column;
    max-height: 92vh;
  }
  .publish-head { flex: none; }
  .publish-body {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .publish-preview-wrap { flex: none; padding: 12px 12px 10px; }
  .publish-preview { min-height: 0; }
  #publishCanvas { max-height: 24vh; }
  .publish-preview-wrap > p { margin-top: 8px; }
  .publish-form-wrap { padding: 14px 15px 16px; }
  .publish-form-title h2 { font-size: 22px; }
  .publish-field { margin-top: 11px; }
  .publish-submit { margin-top: 13px; }
  .publish-success { min-height: 260px; }
}
