/* HarmonyOS Sans 为可变字体（字重 100–900），文件未做任何修改，许可见 fonts/LICENSE.txt */
@font-face {
  font-family: "HarmonyOS Sans";
  src: url("./fonts/HarmonyOS_Sans.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-024F, U+0259, U+02B0-02FF, U+0300-036F, U+1E00-1EFF, U+2000-206F, U+20A0-20CF, U+2100-218F, U+2190-21FF, U+2200-22FF;
}
@font-face {
  font-family: "HarmonyOS Sans SC";
  src: url("./fonts/HarmonyOS_Sans_SC.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  /* 鸿蒙蓝 */
  --blue: #0a59f7;
  --blue-hover: #0047e0;
  --blue-soft: #ebf2ff;
  --blue-line: rgba(10, 89, 247, .28);
  /* 苹果白 */
  --white: #ffffff;
  --gray-bg: #f5f5f7;
  --gray-fill: #e8e8ed;
  --line: #d2d2d7;
  --hairline: rgba(0, 0, 0, .08);
  --ink: #1d1d1f;
  --ink-2: #424245;
  --muted: #6e6e73;
  --faint: #86868b;
  /* 取样色 */
  --orange: #ff7d1a;
  --violet: #7b61ff;
  --green: #34c759;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow-hover: 0 8px 28px rgba(0, 0, 0, .08);
  --font: "HarmonyOS Sans", "HarmonyOS Sans SC", -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 64px; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--white);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: .005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
button, input { font: inherit; }
button { color: inherit; }
a { color: var(--blue); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.hidden { display: none !important; }
.shell { width: min(1120px, calc(100% - 44px)); margin: 0 auto; }
.band-gray { background: var(--gray-bg); }

/* 顶部导航：毛玻璃 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, .8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
}
.topbar-inner { width: min(1120px, calc(100% - 44px)); height: 56px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; min-width: 0; }
.brand-logo { height: 20px; width: auto; display: block; }
.brand-divider { width: 1px; height: 16px; background: var(--line); }
.brand-name { font-size: 15px; font-weight: 500; color: var(--ink); white-space: nowrap; }
.topnav { display: flex; align-items: center; gap: 26px; font-size: 13px; }
.topnav a { color: var(--ink-2); text-decoration: none; transition: color .2s; }
.topnav a:hover { color: var(--blue); }
.privacy-pill { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--gray-bg); color: var(--muted); font-size: 12px; }
.privacy-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

/* 首屏 */
.hero { padding: 96px 0 72px; text-align: center; }
.eyebrow { margin: 0 0 10px; color: var(--blue); font-size: 15px; font-weight: 500; letter-spacing: .02em; }
.hero .eyebrow { font-size: 17px; }
.hero h1 { margin: 0; font-size: clamp(40px, 6.2vw, 72px); line-height: 1.1; font-weight: 700; letter-spacing: -.015em; }
.hero-lead { max-width: 680px; margin: 22px auto 0; color: var(--muted); font-size: clamp(17px, 1.6vw, 21px); line-height: 1.6; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 28px; margin-top: 34px; }
.pill-button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 26px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 17px; font-weight: 500; text-decoration: none; transition: background .2s; }
.pill-button:hover { background: var(--blue-hover); }
.link-arrow { color: var(--blue); font-size: 17px; text-decoration: none; }
.link-arrow::after { content: " ›"; }
.link-arrow:hover { text-decoration: underline; }
.hero-points { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 30px; }
.hero-points span { display: flex; align-items: center; gap: 8px; padding: 7px 14px 7px 8px; border-radius: 999px; background: var(--gray-bg); color: var(--ink-2); font-size: 13px; }
.hero-points b { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--blue); font-size: 11px; font-weight: 600; }
.hero-visual { display: flex; align-items: center; justify-content: center; gap: 28px; max-width: 760px; margin: 56px auto 0; padding: 44px 24px; border-radius: 28px; background: var(--gray-bg); }
.swatch-card { width: 210px; padding: 14px; border-radius: var(--radius); background: var(--white); }
.swatch-card > span { display: block; margin-bottom: 12px; color: var(--muted); font-size: 13px; font-weight: 500; text-align: left; }
.swatch-card small { display: block; margin-top: 12px; color: var(--faint); font-size: 13px; }
.fabric { height: 200px; border-radius: 12px; background-color: #f3eee0; background-image: radial-gradient(#e7bc66 1.2px, transparent 1.2px), radial-gradient(#7da4b7 1.5px, transparent 1.5px); background-position: 0 0, 13px 13px; background-size: 26px 26px; box-shadow: inset 0 0 40px rgba(204, 157, 91, .14); }
.cool .fabric { background-color: #f7f9fb; background-image: radial-gradient(#d9a441 1.2px, transparent 1.2px), radial-gradient(#4f86c6 1.5px, transparent 1.5px); box-shadow: none; }
.match-arrow { width: 52px; height: 52px; flex: 0 0 52px; display: grid; place-items: center; border-radius: 50%; background: var(--blue); }
.match-arrow svg { width: 30px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.product-tags { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin-top: 28px; color: var(--faint); font-size: 13px; }
.product-tags small { margin-right: 4px; font-size: 13px; }
.product-tags span { padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); }

/* 工作台 */
.workspace { padding: 88px 0 96px; }
.section-heading { display: flex; gap: 16px; align-items: flex-start; margin: 0 0 28px; }
.section-heading .eyebrow { margin-bottom: 4px; font-size: 14px; }
.section-heading h2 { margin: 0; font-size: clamp(26px, 3.4vw, 40px); line-height: 1.15; font-weight: 700; letter-spacing: -.01em; }
.section-heading p:not(.eyebrow) { max-width: 720px; margin: 12px 0 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.step-number { flex: 0 0 auto; padding-top: 1px; color: var(--blue); font-size: 14px; font-weight: 600; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.step-number::after { content: ""; display: block; width: 20px; height: 2px; margin-top: 8px; border-radius: 2px; background: var(--blue); }
.section-heading.compact { margin: 0 0 20px; }
.section-heading.compact h2 { font-size: 26px; }
.selection-heading { margin-top: 80px; }

.card { border-radius: var(--radius); background: var(--white); transition: box-shadow .3s; }
.upload-grid, .selection-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.upload-card { padding: 22px; }
.card-label { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.card-label strong, .card-label small { display: block; }
.card-label strong { font-size: 17px; font-weight: 600; }
.card-label small { margin-top: 2px; color: var(--muted); font-size: 13px; }
.label-dot { width: 10px; height: 10px; flex: 0 0 10px; border-radius: 50%; }
.label-dot.coral { background: var(--orange); }
.label-dot.blue { background: var(--blue); }
.dropzone { position: relative; min-height: 184px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 1.5px dashed var(--line); border-radius: 16px; background: var(--white); cursor: pointer; transition: border-color .2s, background .2s; }
.dropzone:hover, .dropzone.dragging { border-color: var(--blue); background: var(--blue-soft); }
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dropzone strong { font-size: 15px; font-weight: 600; }
.dropzone small { color: var(--muted); font-size: 13px; }
.upload-icon { width: 46px; height: 46px; display: grid; place-items: center; margin-bottom: 4px; border-radius: 50%; background: var(--blue-soft); }
.upload-icon svg { width: 24px; fill: none; stroke: var(--blue); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.file-summary { min-height: 184px; display: grid; grid-template-columns: 105px minmax(0,1fr) 34px; align-items: center; gap: 16px; padding: 12px; border-radius: 16px; background: var(--gray-bg); }
.thumb { width: 105px; height: 145px; display: block; overflow: hidden; border-radius: 10px; background: var(--gray-fill); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-summary strong, .file-summary small { display: block; word-break: break-all; }
.file-summary strong { font-size: 15px; font-weight: 600; }
.file-summary small { margin-top: 6px; color: var(--muted); font-size: 13px; }
.icon-button { width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--white); color: var(--faint); font-size: 22px; line-height: 1; cursor: pointer; transition: color .2s; }
.icon-button:hover { color: var(--ink); }

.canvas-card { padding: 22px; min-width: 0; }
.canvas-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 16px; }
.micro-label { color: var(--blue); font-size: 13px; font-weight: 500; }
.canvas-card h3 { margin: 2px 0 0; font-size: 19px; font-weight: 600; }
.status-chip { flex: 0 0 auto; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.status-chip.waiting { background: var(--gray-bg); color: var(--faint); }
.status-chip.ready { background: var(--blue-soft); color: var(--blue); }
.tool-switch { display: flex; gap: 4px; padding: 4px; margin-bottom: 14px; border-radius: 12px; background: var(--gray-bg); }
.tool-button { flex: 1; padding: 9px 8px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; transition: background .2s, color .2s, box-shadow .2s; }
.tool-button:hover { color: var(--ink); }
.tool-button.active { background: var(--white); color: var(--ink); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.tool-color { width: 8px; height: 8px; display: inline-block; margin-right: 6px; border-radius: 50%; vertical-align: 1px; }
.tool-color.sample, .legend-box.sample, .explain-grid b.sample { background: var(--orange); }
.tool-color.apply, .legend-box.apply, .explain-grid b.apply { background: var(--blue); }
.tool-color.reference, .legend-box.reference, .explain-grid b.reference { background: var(--violet); }
.tool-color.erase { background: transparent; box-shadow: inset 0 0 0 1.5px var(--faint); }
.brush-bar { display: flex; align-items: center; gap: 8px; margin: -4px 0 14px; }
.brush-size { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 10px; background: var(--gray-bg); color: var(--ink-2); font-size: 12px; white-space: nowrap; }
.brush-size input { flex: 1; min-width: 60px; margin: 0; }
.brush-size output { min-width: 26px; color: var(--blue); font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.mini-button { flex: 0 0 auto; padding: 7px 12px; border: 0; border-radius: 10px; background: var(--gray-bg); color: var(--ink-2); font-size: 12px; font-weight: 500; cursor: pointer; transition: background .2s, color .2s; }
.mini-button:hover:not(:disabled) { background: var(--gray-fill); color: var(--ink); }
.mini-button:disabled { color: var(--faint); opacity: .55; cursor: not-allowed; }
.shortcut-tip { color: var(--faint); }
.reference-tip { min-height: 43px; display: flex; align-items: center; padding: 9px 13px; margin-bottom: 14px; border-radius: 12px; background: var(--gray-bg); color: var(--ink-2); font-size: 13px; }
.canvas-stage { position: relative; min-height: 420px; display: grid; place-items: center; overflow: hidden; border-radius: 14px; background-color: #f0f0f2; background-image: linear-gradient(45deg,#e6e6ea 25%,transparent 25%),linear-gradient(-45deg,#e6e6ea 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#e6e6ea 75%),linear-gradient(-45deg,transparent 75%,#e6e6ea 75%); background-size: 20px 20px; background-position: 0 0,0 10px,10px -10px,-10px 0; }
.canvas-stage canvas { display: block; max-width: 100%; max-height: 540px; touch-action: none; cursor: crosshair; box-shadow: 0 4px 20px rgba(0,0,0,.1); }
.canvas-stage canvas.brush-mode { cursor: none; }
.canvas-stage.empty canvas { display: none; }
.empty-canvas-message { display: none; flex-direction: column; gap: 6px; align-items: center; color: var(--faint); }
.empty-canvas-message span { font-size: 26px; }
.empty-canvas-message strong { font-size: 14px; font-weight: 500; }
.canvas-stage.empty .empty-canvas-message { display: flex; }
.legend-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 14px; color: var(--muted); font-size: 12px; }
.legend-row span { display: flex; align-items: center; gap: 6px; }
.legend-box { width: 10px; height: 10px; display: inline-block; border-radius: 3px; }
.text-button { margin-left: auto; padding: 0; border: 0; background: transparent; color: var(--blue); font-size: 13px; cursor: pointer; }
.text-button:hover { text-decoration: underline; }

.control-result-grid { display: grid; grid-template-columns: .82fr 1.18fr; gap: 20px; align-items: stretch; margin-top: 80px; }
.controls-card, .result-card { padding: 28px; }
.range-control { display: block; padding: 16px 0; border-top: 1px solid var(--hairline); }
.range-control > span { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.range-control b { font-size: 15px; font-weight: 500; }
.range-control output { min-width: 54px; padding: 3px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 13px; font-weight: 600; text-align: center; font-variant-numeric: tabular-nums; }
.range-control small { display: block; color: var(--muted); font-size: 12px; line-height: 1.5; }
input[type="range"] { width: 100%; accent-color: var(--blue); cursor: pointer; }
.range-control input { margin: 12px 0 8px; }
.range-control.control-disabled { opacity: .4; }
.range-control.control-disabled input { pointer-events: none; }
.range-ends { display: flex !important; justify-content: space-between; }
.range-ends em { font-style: normal; }
.manual-group { border-top: 1px solid var(--hairline); padding-top: 16px; }
.manual-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 4px; }
.manual-head b, .manual-head small { display: block; }
.manual-head b { font-size: 15px; font-weight: 500; }
.manual-head small { margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.manual-head .text-button { margin-left: 0; flex: 0 0 auto; padding-top: 2px; }
.manual-group .range-control { padding: 12px 0; border-top: 0; }
.manual-group .range-control input { margin: 8px 0 4px; }
.toggle-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px 0; border-top: 1px solid var(--hairline); cursor: pointer; }
.wb-toggle { border-top: 0; padding-top: 4px; }
.toggle-row b, .toggle-row small { display: block; }
.toggle-row b { font-size: 15px; font-weight: 500; }
.toggle-row small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.toggle-row input { position: absolute; opacity: 0; }
.toggle-row i { position: relative; width: 51px; height: 31px; flex: 0 0 51px; border-radius: 999px; background: var(--gray-fill); transition: background .25s; }
.toggle-row i::after { content: ""; position: absolute; width: 27px; height: 27px; top: 2px; left: 2px; border-radius: 50%; background: #fff; box-shadow: 0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.06); transition: transform .25s; }
.toggle-row input:checked + i { background: var(--blue); }
.toggle-row input:checked + i::after { transform: translateX(20px); }
.toggle-row input:focus-visible + i { outline: 2px solid var(--blue); outline-offset: 2px; }
.advanced-box { margin: 8px 0 22px; padding: 13px 16px; border-radius: 12px; background: var(--gray-bg); }
.advanced-box summary { cursor: pointer; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.advanced-box p, .mask-status { color: var(--muted); font-size: 12px; line-height: 1.55; }
.mask-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mask-inputs label { display: block; padding: 10px; border-radius: 10px; background: var(--white); font-size: 12px; }
.mask-inputs span { display: block; margin-bottom: 6px; }
.mask-inputs input { width: 100%; font-size: 11px; }
.primary-button, .download-button { width: 100%; min-height: 50px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; background: var(--blue); color: #fff; font-size: 17px; font-weight: 500; cursor: pointer; transition: background .2s; }
.primary-button:hover:not(:disabled), .download-button:hover { background: var(--blue-hover); }
.primary-button:disabled { background: var(--gray-fill); color: var(--faint); cursor: not-allowed; }
.primary-button svg, .download-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.button-loading { display: none; }
.primary-button.loading .button-ready { display: none; }
.primary-button.loading .button-loading { display: flex; align-items: center; gap: 9px; }
.button-loading i { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: spin .75s linear infinite; }
.button-ready { display: flex; align-items: center; gap: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
.button-hint { margin: 10px 0 0; color: var(--faint); font-size: 12px; text-align: center; }

.result-card { min-height: 650px; position: sticky; top: 72px; align-self: start; }
.live-pill { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; padding: 3px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 12px; font-weight: 500; letter-spacing: 0; vertical-align: 5px; }
.live-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.result-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.result-toolbar .view-switch { flex: 1; margin-bottom: 0; }
.zoom-check { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; color: var(--ink-2); font-size: 13px; cursor: pointer; }
.zoom-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--blue); }
.reference-view { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ref-pane { position: relative; height: min(460px, 56vh); margin: 0; overflow: hidden; border-radius: 14px; background: var(--gray-bg); }
.ref-pane canvas { display: block; width: 100%; height: 100%; object-fit: contain; }
.swatch-row { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 14px; border-radius: 14px; background: var(--gray-bg); }
.swatch-item { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 12px; white-space: nowrap; }
.swatch-item i { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 8px; background: var(--gray-fill); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.swatch-arrow { color: var(--faint); font-size: 13px; }
.swatch-de { margin-left: auto; text-align: right; }
.swatch-de small, .swatch-de strong { display: block; }
.swatch-de small { color: var(--faint); font-size: 11px; }
.swatch-de strong { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.result-empty { height: 510px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--faint); }
.result-empty strong { margin: 22px 0 6px; font-size: 17px; font-weight: 600; color: var(--ink-2); }
.result-empty small { max-width: 300px; font-size: 13px; line-height: 1.5; text-align: center; }
.result-placeholder { position: relative; width: 200px; height: 150px; border-radius: 18px; overflow: hidden; background: var(--gray-bg); }
.result-placeholder span { position: absolute; inset: 0; }
.mini-before { background: linear-gradient(145deg,#f6e6ce,#efe1cf 45%,#e4d2ba); clip-path: inset(0 50% 0 0); }
.mini-after { background: linear-gradient(145deg,#eef3ff,#f9fbff 45%,#dfe9fd); clip-path: inset(0 0 0 50%); }
.result-placeholder i { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: #fff; }
.compare-wrap { position: relative; width: 100%; max-height: min(520px, 60vh); aspect-ratio: 4 / 5; overflow: hidden; border-radius: 14px; background: var(--gray-bg); }
.compare-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--gray-bg); user-select: none; pointer-events: none; }
.after-layer { position: absolute; inset: 0; overflow: hidden; clip-path: inset(0 0 0 50%); }
.after-layer .compare-image { width: 100%; max-width: none; }
.compare-label { position: absolute; top: 12px; z-index: 3; padding: 5px 11px; border-radius: 999px; background: rgba(29,29,31,.6); color: #fff; font-size: 12px; font-weight: 500; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.compare-label.before { left: 12px; }
.compare-label.after { right: 12px; }
.compare-line { position: absolute; z-index: 3; left: 50%; top: 0; bottom: 0; width: 2px; background: #fff; pointer-events: none; }
.compare-line i { position: absolute; left: 50%; top: 50%; width: 38px; height: 38px; display: grid; place-items: center; transform: translate(-50%,-50%); border-radius: 50%; background: #fff; color: var(--blue); font-style: normal; font-size: 16px; box-shadow: 0 4px 16px rgba(0,0,0,.18); }
.compare-range { position: absolute; z-index: 5; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; }
.delta-panel { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 14px; }
.delta-card { padding: 12px; border-radius: 14px; background: var(--gray-bg); text-align: center; }
.delta-card span, .delta-card strong, .delta-card small { display: block; }
.delta-card span { color: var(--faint); font-size: 12px; font-weight: 500; }
.delta-card strong { margin: 2px 0; font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.delta-card small { color: var(--muted); font-size: 11px; }
.result-note { min-height: 32px; margin: 12px 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.export-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 14px; }
.export-select { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.export-select select { appearance: none; -webkit-appearance: none; padding: 7px 32px 7px 12px; border: 0; border-radius: 10px; background: var(--gray-bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236e6e73' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.export-select select:hover { background-color: var(--gray-fill); }
.output-meta { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.download-button { min-height: 46px; }
.download-button:disabled { background: var(--gray-fill); color: var(--muted); cursor: progress; }

/* 说明 */
.how-it-works { padding: 96px 0; text-align: center; }
.how-it-works h2 { margin: 0 0 44px; font-size: clamp(28px, 3.6vw, 44px); line-height: 1.15; font-weight: 700; letter-spacing: -.01em; }
.explain-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 20px; text-align: left; }
.explain-grid > div { padding: 28px; border-radius: var(--radius); background: var(--gray-bg); }
.explain-grid b { width: 32px; height: 32px; display: grid; place-items: center; margin-bottom: 18px; border-radius: 50%; color: #fff; font-size: 14px; font-weight: 600; }
.explain-grid strong { display: block; font-size: 19px; font-weight: 600; }
.explain-grid p { margin: 8px 0 0; color: var(--muted); font-size: 15px; line-height: 1.6; }

.footer { background: var(--gray-bg); color: var(--muted); font-size: 12px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding: 22px 0 18px; border-top: 1px solid var(--line); }
.footer-brand { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-weight: 500; }
.footer-brand img { height: 14px; width: auto; display: block; opacity: .85; }
.footer p { margin: 0; }
.footer-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 20px; padding: 14px 0 22px; border-top: 1px solid var(--hairline); color: var(--faint); }
.footer .footer-legal a { color: var(--faint); }
.footer .footer-legal a:hover { color: var(--ink-2); }
.footer a { color: var(--blue); text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 50; max-width: calc(100% - 32px); padding: 11px 18px; border-radius: 999px; background: rgba(29,29,31,.88); color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.2); font-size: 14px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); opacity: 0; transform: translate(-50%,18px); pointer-events: none; transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (max-width: 900px) {
  .control-result-grid { grid-template-columns: 1fr; }
  .result-card { min-height: 0; position: static; }
  .result-empty { height: 360px; }
  .topnav a { display: none; }
}
@media (max-width: 700px) {
  .shell, .topbar-inner { width: calc(100% - 32px); }
  .topbar-inner { height: 52px; }
  .brand { gap: 9px; }
  .brand-logo { height: 15px; }
  .brand-name { font-size: 14px; }
  .privacy-pill { padding: 0; background: transparent; font-size: 0; gap: 0; }
  .hero { padding: 60px 0 52px; }
  .hero h1 { font-size: 38px; }
  .hero-visual { gap: 12px; margin-top: 40px; padding: 22px 14px; border-radius: 22px; }
  .swatch-card { width: auto; flex: 1 1 0; min-width: 0; padding: 10px; }
  .fabric { height: 130px; }
  .match-arrow { width: 38px; height: 38px; flex-basis: 38px; }
  .match-arrow svg { width: 22px; }
  .workspace { padding: 60px 0 64px; }
  .upload-grid, .selection-grid, .explain-grid { grid-template-columns: 1fr; }
  .selection-heading, .control-result-grid { margin-top: 56px; }
  .section-heading { flex-direction: column; gap: 6px; }
  .step-number::after { display: none; }
  .canvas-stage { min-height: 320px; }
  .canvas-stage canvas { max-height: 430px; }
  .tool-button { font-size: 12px; }
  .controls-card, .result-card, .canvas-card, .upload-card { padding: 18px; }
  .mask-inputs { grid-template-columns: 1fr; }
  .brush-bar { flex-wrap: wrap; }
  .brush-size { flex-basis: 100%; }
  .shortcut-tip { display: none !important; }
  .result-toolbar { flex-direction: column; align-items: stretch; }
  .ref-pane { height: 300px; }
  .swatch-row { flex-wrap: wrap; }
  .swatch-de { flex-basis: 100%; margin-left: 0; text-align: left; }
  .how-it-works { padding: 64px 0; }
  .how-it-works h2 { margin-bottom: 30px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* 首页链向教程 */
.section-heading p .link-arrow { margin-left: 6px; font-size: 15px; white-space: nowrap; }
.guide-link { display: inline-block; margin-top: 6px; font-size: 14px; }
.how-guide-link { display: inline-block; margin-top: 32px; }

/* 使用教程页 */
.guide-hero { padding: 80px 0 56px; text-align: center; }
.guide-hero h1 { margin: 0; font-size: clamp(34px, 5vw, 56px); line-height: 1.12; font-weight: 700; letter-spacing: -.015em; }
.guide-toc { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 34px; }
.guide-toc a { display: flex; align-items: center; gap: 8px; padding: 8px 16px 8px 8px; border-radius: 999px; background: var(--gray-bg); color: var(--ink-2); font-size: 14px; text-decoration: none; transition: background .2s, color .2s; }
.guide-toc a:hover { background: var(--blue-soft); color: var(--blue); }
.guide-toc b { min-width: 26px; height: 26px; padding: 0 7px; display: grid; place-items: center; border-radius: 999px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 600; }
.guide-body { max-width: 880px; padding: 80px 0 96px; }
.guide-section + .guide-section { margin-top: 88px; }
.guide-section .section-heading .step-number { min-width: 28px; }
.guide-card, .guide-param { margin-top: 16px; padding: 26px 28px; border-radius: var(--radius); background: var(--white); color: var(--ink-2); font-size: 15px; line-height: 1.7; }
.guide-card h3, .guide-param h3 { display: flex; align-items: center; margin: 0 0 12px; color: var(--ink); font-size: 19px; font-weight: 600; }
.guide-card h3 .tool-color { width: 10px; height: 10px; margin-right: 10px; }
.guide-card p, .guide-param p { margin: 10px 0 0; }
.guide-card > p:first-of-type, .guide-param header + p { margin-top: 0; }
.guide-list, .guide-steps { margin: 0; padding-left: 1.3em; }
.guide-list li, .guide-steps li { margin: 6px 0; padding-left: 4px; }
.guide-steps li::marker { color: var(--blue); font-weight: 600; }
.guide b, .guide strong { color: var(--ink); font-weight: 600; }
.guide kbd { display: inline-block; min-width: 22px; padding: 0 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: var(--white); color: var(--ink); font: 600 12px/20px var(--font); text-align: center; }
.guide-tip, .guide-note, .guide-suggest { padding: 12px 16px; border-radius: 12px; background: var(--gray-bg); color: var(--ink-2); font-size: 14px; }
.guide-tip { margin-top: 16px !important; background: var(--blue-soft); }
.guide-tip > b:first-child { margin-right: 8px; color: var(--blue); }
.guide-note, .guide-suggest { margin-top: 16px !important; }
.guide-suggest > b:first-child { margin-right: 8px; color: var(--blue); }
.guide-do-dont { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.guide-do-dont > div { padding: 14px 18px; border-radius: 14px; font-size: 14px; }
.guide-do-dont .do { background: rgba(52, 199, 89, .1); }
.guide-do-dont .dont { background: rgba(255, 125, 26, .1); }
.guide-do-dont strong { display: block; margin-bottom: 4px; }
.guide-do-dont .do strong { color: #248a3d; }
.guide-do-dont .dont strong { color: #c45a00; }
.guide-do-dont ul { margin: 0; padding-left: 1.2em; }
.guide-do-dont li { margin: 3px 0; }
.guide-check { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; padding: 16px 20px; border-radius: var(--radius); background: var(--white); font-size: 14px; }
.guide-check strong { margin-right: 6px; }
.guide-check span { padding: 4px 12px 4px 10px; border-radius: 999px; background: var(--gray-bg); color: var(--ink-2); }
.guide-check span::before { content: "✓ "; color: var(--green); font-weight: 700; }
.guide-param header { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 12px; }
.guide-param header h3 { margin: 0; }
.guide-default { padding: 3px 12px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 13px; font-weight: 500; }
.guide-what { color: var(--ink) !important; }
.guide-what > b:first-child, .guide-effects strong { display: block; margin-bottom: 2px; color: var(--blue) !important; font-size: 13px; font-weight: 600; }
.guide-effects { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 16px; }
.guide-effects > div { padding: 14px 16px; border: 1px solid var(--hairline); border-radius: 14px; font-size: 14px; line-height: 1.6; }
.guide-effects strong { color: var(--ink) !important; font-size: 14px; }
.guide-table { margin: 16px 0 0; overflow-x: auto; }
.guide-table figcaption { margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.guide-table table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.guide-table th, .guide-table td { padding: 9px 12px; border-bottom: 1px solid var(--hairline); text-align: center; white-space: nowrap; }
.guide-table th { color: var(--ink-2); font-weight: 500; text-align: left; }
.guide-table thead td { color: var(--muted); font-size: 13px; }
.guide-table tbody td { color: var(--ink); font-weight: 600; }
.guide-flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 4px; counter-reset: flow; }
.guide-flow > div { position: relative; padding: 16px 14px; border-radius: 16px; background: var(--white); }
.guide-flow b { width: 24px; height: 24px; display: grid; place-items: center; margin-bottom: 10px; border-radius: 50%; background: var(--blue); color: #fff; font-size: 12px; }
.guide-flow strong, .guide-flow small { display: block; }
.guide-flow strong { font-size: 15px; }
.guide-flow small { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.guide-lab { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.guide-lab > div { padding: 14px; border-radius: 14px; background: var(--gray-bg); text-align: center; }
.guide-lab b, .guide-lab span, .guide-lab small { display: block; }
.guide-lab b { color: var(--blue); font-size: 24px; line-height: 1.2; }
.guide-lab span { color: var(--ink); font-weight: 500; }
.guide-lab small { color: var(--muted); font-size: 12px; }
.guide-formula { padding: 14px 18px; border-left: 3px solid var(--blue); border-radius: 0 12px 12px 0; background: var(--blue-soft); color: var(--ink) !important; font-weight: 500; }
.guide-faq { display: grid; gap: 10px; }
.guide-faq details { padding: 16px 22px; border-radius: 16px; background: var(--white); }
.guide-faq summary { color: var(--ink); font-size: 16px; font-weight: 500; cursor: pointer; }
.guide-faq p { margin: 10px 0 0; color: var(--ink-2); font-size: 15px; line-height: 1.7; }
.guide-cta { margin-top: 40px; text-align: center; }
.topnav a[aria-current="page"] { color: var(--blue); }

@media (max-width: 700px) {
  .guide-hero { padding: 56px 0 40px; }
  .guide-body { padding: 56px 0 64px; }
  .guide-section + .guide-section { margin-top: 64px; }
  .guide-card, .guide-param { padding: 20px 18px; }
  .guide-do-dont, .guide-lab { grid-template-columns: 1fr; }
  .guide-flow { grid-template-columns: 1fr 1fr; }
  .guide-table table { font-size: 13px; }
  .guide-table th, .guide-table td { padding: 8px 5px; }
  .guide-table thead td { font-size: 12px; }
}
