/* 一隅 · AI 角落优化 Demo */
:root {
  --bg: #f5efe6;
  --bg-2: #ede3d5;
  --surface: #fffdf9;
  --surface-2: #faf5ee;
  --ink: #2a2420;
  --ink-2: #594f47;
  --muted: #958a7f;
  --line: #ebe1d4;
  --line-2: #dccfbe;
  --accent: #c4623a;
  --accent-d: #a84f2b;
  --accent-l: #f7e4d9;
  --accent-ll: #fcf2ec;
  --sage: #6c8a6c;
  --sage-l: #e4ece1;
  --gold: #b8873a;
  --gold-l: #f6ecd8;
  --danger: #c2453d;
  --danger-l: #f9e7e4;
  --radius: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(70, 45, 20, 0.04), 0 10px 30px rgba(70, 45, 20, 0.06);
  --shadow-lg: 0 24px 60px rgba(60, 38, 18, 0.18);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --checker: repeating-conic-gradient(#efe8de 0% 25%, #fbf8f3 0% 50%) 50% / 16px 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
body.no-scroll { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
img { display: block; max-width: 100%; }
a { color: var(--accent-d); }
h1, h2, h3, h4 { margin: 0; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::placeholder { color: #b5aa9e; opacity: 1; }

.ic { width: 1.15em; height: 1.15em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.spin { animation: spin 1.2s linear infinite; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; line-height: 1.55; }
.warn-text { color: var(--gold); display: flex; gap: 5px; align-items: flex-start; }
.warn-text .ic { margin-top: 2px; }
.spacer { flex: 1; }
.pad { padding: 12px; }

.bg-glow {
  position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background:
    radial-gradient(60vw 40vw at 85% -10%, rgba(196, 98, 58, 0.10), transparent 60%),
    radial-gradient(50vw 40vw at -10% 30%, rgba(108, 138, 108, 0.10), transparent 60%),
    linear-gradient(180deg, #f8f3ec 0%, var(--bg) 40%, #f2eadf 100%);
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px clamp(16px, 4vw, 40px);
  background: rgba(245, 239, 230, 0.8);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid rgba(220, 207, 190, 0.6);
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; box-shadow: 0 4px 12px rgba(196, 98, 58, 0.3); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-family: var(--serif); font-size: 19px; letter-spacing: 0.08em; }
.brand-text small { font-size: 11.5px; color: var(--muted); letter-spacing: 0.04em; }
.brand-tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; color: var(--accent-d); background: var(--accent-l); }
.top-actions { display: flex; gap: 4px; }
.ghost-btn {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 13px; border: 1px solid transparent; border-radius: 999px;
  background: transparent; color: var(--ink-2); font-size: 14px;
  transition: background 0.2s, border-color 0.2s;
}
.ghost-btn:hover { background: var(--surface); border-color: var(--line); }

/* ---------- 页面 ---------- */
.page { max-width: 1380px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 40px; min-height: 70vh; }
.boot { display: grid; place-items: center; min-height: 60vh; }
.footer { max-width: 1380px; margin: 0 auto; padding: 8px clamp(16px, 4vw, 40px) 40px; font-size: 12.5px; color: var(--muted); text-align: center; }
.footer p { margin: 2px 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.fade-in { animation: fadeUp 0.45s var(--ease); }
.eyebrow { margin: 0 0 6px; font-size: 12.5px; font-weight: 600; letter-spacing: 0.12em; color: var(--accent); }
.hl { background: linear-gradient(transparent 62%, rgba(196, 98, 58, 0.22) 62%); padding: 0 2px; }
.lead { margin-top: 14px; color: var(--ink-2); font-size: clamp(14.5px, 1.6vw, 16.5px); max-width: 620px; }
.empty-page { max-width: 520px; margin: 60px auto; padding: 40px 28px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.empty-page h2 { font-family: var(--serif); }

/* ---------- 按钮与表单 ---------- */
.primary-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 18px; border: 0; border-radius: 999px;
  font-weight: 600; font-size: 14px; color: #fff; text-decoration: none; white-space: nowrap;
  background: linear-gradient(135deg, #cf6d43 0%, var(--accent) 45%, var(--accent-d) 100%);
  box-shadow: 0 6px 18px rgba(196, 98, 58, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}
.primary-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(196, 98, 58, 0.36); }
.primary-btn:disabled { filter: grayscale(0.4); opacity: 0.55; box-shadow: none; }
.primary-btn.big { width: 100%; padding: 15px 20px; font-size: 16px; letter-spacing: 0.04em; }
.primary-btn.big .ic { font-size: 19px; }
.primary-btn.sm, .soft-btn.sm { padding: 6px 13px; font-size: 13px; }
.soft-btn, .danger-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); font-size: 13.5px; font-weight: 500; color: var(--ink); text-decoration: none; white-space: nowrap;
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.soft-btn:hover:not(:disabled) { border-color: var(--line-2); background: #fff; transform: translateY(-1px); }
.soft-btn:disabled { opacity: 0.5; }
.soft-btn.danger { color: var(--danger); }
.danger-btn { background: var(--danger); border-color: var(--danger); color: #fff; font-weight: 600; }
.icon-only { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); font-size: 18px; flex: none; }
.icon-only:hover { background: var(--surface-2); }
.icon-only.sm { width: 28px; height: 28px; font-size: 15px; }
.link-btn { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; padding: 0; color: var(--accent-d); font-size: 13px; font-weight: 600; text-decoration: none; }
.link-btn:disabled { opacity: 0.45; }
.chip-btn {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 11px; border: 0; border-radius: 999px;
  font-size: 12.5px; font-weight: 500; color: var(--ink); background: rgba(255, 253, 249, 0.92);
  box-shadow: 0 2px 8px rgba(40, 25, 10, 0.12);
}
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 11px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: 12.5px; color: var(--ink-2); text-decoration: none; white-space: nowrap;
  transition: all 0.16s;
}
.chip:hover:not(:disabled) { border-color: var(--line-2); color: var(--ink); }
.chip.on { border-color: var(--accent); background: var(--accent-ll); color: var(--accent-d); font-weight: 600; }
.chip:disabled { opacity: 0.5; }
.chip small { font-size: 10.5px; color: var(--muted); margin-left: 2px; }
.chip .ic { font-size: 13px; }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 6px; }
.only-touch { display: none; }
@media (hover: none), (pointer: coarse) { .only-touch { display: inline-flex; } }

.tag {
  display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; line-height: 1.7; white-space: nowrap; vertical-align: middle;
  color: var(--ink-2); background: var(--bg-2); border: 0;
}
.tag .ic { font-size: 12px; }
.tag.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); font-weight: 500; }
.tag.accent { background: var(--accent-l); color: var(--accent-d); }
.tag.sage { background: var(--sage-l); color: var(--sage); }
.tag.gold, .tag.warn { background: var(--gold-l); color: var(--gold); }
.tag.link { cursor: pointer; background: var(--accent-ll); color: var(--accent-d); }
.tag.check-shown { background: var(--sage-l); color: var(--sage); }
.tag.check-partial { background: var(--gold-l); color: var(--gold); }
.tag.check-missing { background: var(--danger-l); color: var(--danger); }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 12px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); white-space: nowrap; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13.5px; color: var(--ink-2); transition: all 0.18s; }
.seg button:hover { border-color: var(--line-2); color: var(--ink); }
.seg button.is-active { border-color: var(--ink); background: var(--ink); color: #fff; }
.seg-sm button { padding: 4px 12px; font-size: 13px; }
.seg-xs { gap: 4px; }
.seg-xs button { padding: 3px 10px; font-size: 12.5px; }
.seg.inline { display: inline-flex; vertical-align: middle; }

.input, .drawer input, .drawer select, .drawer textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); font-size: 14px; line-height: 1.5; resize: vertical;
  transition: border-color 0.2s, background 0.2s;
}
.input:focus, .drawer input:focus, .drawer select:focus, .drawer textarea:focus { outline: none; border-color: var(--accent); background: #fff; }
select.input, .drawer select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.field { display: grid; gap: 7px; margin-top: 14px; font-size: 13px; color: var(--ink-2); }
.field > span, .field-label { font-weight: 600; font-size: 13px; color: var(--ink-2); }
.field-label small { font-weight: 400; }
.size-row { display: flex; align-items: center; gap: 6px; }
.size-row i { color: var(--muted); font-style: normal; }
.range-row { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.range-row input { flex: 1; accent-color: var(--accent); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

.switch-row { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 11px 14px; border-radius: var(--radius-sm); background: var(--surface-2); cursor: pointer; }
.switch-text { display: grid; flex: 1; line-height: 1.35; }
.switch-text b { font-size: 14px; font-weight: 600; }
.switch-text small { font-size: 12.5px; color: var(--muted); }
.switch-row input, .mini-switch input, .check input, .radio-card input, .cand input { position: absolute; opacity: 0; pointer-events: none; }
.switch { position: relative; width: 44px; height: 26px; border-radius: 999px; background: var(--line-2); transition: background 0.2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18); transition: transform 0.22s var(--ease); }
.switch-row input:checked + .switch { background: var(--sage); }
.switch-row input:checked + .switch::after { transform: translateX(18px); }
.mini-switch { position: relative; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.mini-switch i { position: relative; width: 34px; height: 20px; border-radius: 999px; background: var(--line-2); transition: background 0.2s; flex: none; }
.mini-switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.2s var(--ease); }
.mini-switch input:checked + i { background: var(--sage); }
.mini-switch input:checked + i::after { transform: translateX(14px); }
.check { position: relative; display: inline-flex; flex: none; margin-top: 2px; cursor: pointer; }
.check i { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-2); background: #fff; transition: all 0.15s; }
.check input:checked + i { background: var(--sage); border-color: var(--sage); }
.check input:checked + i::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.radio-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.radio-card { position: relative; display: block; cursor: pointer; margin-bottom: 8px; }
.radio-row .radio-card { margin: 0; }
.radio-card span { display: grid; gap: 1px; padding: 11px 13px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); transition: all 0.16s; line-height: 1.4; }
.radio-card b { font-size: 14px; font-weight: 600; }
.radio-card small { font-size: 12px; color: var(--muted); }
.radio-card input:checked + span { border-color: var(--accent); background: var(--accent-ll); }
.radio-card input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.note { display: flex; gap: 8px; align-items: flex-start; padding: 10px 13px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; color: var(--ink-2); margin: 8px 0; }
.note .ic { margin-top: 2px; color: var(--sage); }
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); margin-bottom: 12px; }
.notice.warn { background: var(--gold-l); }
.notice.warn > .ic { color: var(--gold); font-size: 20px; }
.notice b { display: block; font-size: 14px; }
.notice p { font-size: 13px; color: var(--ink-2); }
.add-row {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 10px; padding: 10px;
  border: 1.5px dashed var(--line-2); border-radius: var(--radius-sm); background: transparent; color: var(--ink-2); font-size: 13.5px;
  transition: all 0.16s;
}
.add-row:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-d); background: var(--accent-ll); }
.add-row-group { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.empty-box { display: grid; justify-items: center; gap: 6px; padding: 40px 16px; text-align: center; color: var(--ink-2); }
.empty-box > .ic { font-size: 30px; color: var(--muted); }
.fold { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13px; }
.fold summary { display: flex; align-items: center; gap: 6px; padding: 10px 13px; cursor: pointer; color: var(--ink-2); list-style: none; }
.fold summary::-webkit-details-marker { display: none; }
.fold > p, .fold > div { padding: 0 13px 12px; }
.plain { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
.plain li { display: flex; gap: 8px; align-items: center; }
.plain .ic { color: var(--accent); }
.sk-line { height: 12px; border-radius: 6px; margin: 10px 0; background: linear-gradient(90deg, var(--bg-2), var(--surface-2), var(--bg-2)); background-size: 200% 100%; animation: shimmer 1.6s linear infinite; }
.sk-line.w50 { width: 50%; } .sk-line.w60 { width: 60%; } .sk-line.w80 { width: 80%; } .sk-line.w90 { width: 90%; }
.checker { background: var(--checker); }
.tips-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 5px; font-size: 13px; color: var(--ink-2); text-align: left; }
.tips-list li { display: flex; gap: 6px; align-items: center; }
.tips-list .ic { color: var(--sage); }
.quick-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.quick-tags button { padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; background: transparent; font-size: 12.5px; color: var(--ink-2); }
.quick-tags button:hover { border-color: var(--accent); color: var(--accent-d); }
.spinner { display: inline-block; width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--accent); animation: spin 0.9s linear infinite; flex: none; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; }

/* ---------- 首页 ---------- */
.home-hero { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr); gap: clamp(20px, 4vw, 56px); align-items: center; padding: clamp(28px, 5vw, 64px) 0 clamp(20px, 3vw, 40px); }
.hh-text h1 { font-family: var(--serif); font-weight: 700; font-size: clamp(30px, 4.6vw, 50px); line-height: 1.2; letter-spacing: 0.02em; }
.flow { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 6px; padding: 0; margin: 22px 0 0; }
.flow li { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px 6px 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; color: var(--ink-2); }
.flow li b { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; }
.flow li small { color: var(--muted); font-size: 11.5px; }
.upload-card { padding: 14px; }
.dropzone {
  position: relative; display: grid; justify-items: center; gap: 12px; padding: 30px 18px 24px;
  border: 1.5px dashed var(--line-2); border-radius: var(--radius-md); text-align: center; cursor: pointer;
  background: linear-gradient(135deg, rgba(247, 228, 217, 0.5), rgba(228, 236, 225, 0.5)), var(--surface-2);
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}
.dropzone.is-over { border-color: var(--accent); background: var(--accent-ll); transform: scale(1.01); }
.dz-illus { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; font-size: 30px; color: #fff; background: linear-gradient(135deg, #d77850, var(--accent-d)); box-shadow: 0 8px 20px rgba(196, 98, 58, 0.28); }
.dz-illus .ic { stroke-width: 1.7; }
.dz-text { display: grid; gap: 2px; }
.dz-text b { font-size: 16px; }
.dz-text span { font-size: 13px; color: var(--muted); }
.dz-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.dz-tips { margin: 2px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; font-size: 12px; color: var(--muted); }
.dz-tips li::before { content: "·"; margin-right: 4px; color: var(--accent); font-weight: 700; }
.home-sec { margin-top: clamp(24px, 4vw, 40px); }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.sec-head h2 { font-size: 18px; font-weight: 650; }
.samples { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.sample-card { position: relative; display: grid; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); text-align: left; box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s; }
.sample-card:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(70, 45, 20, 0.12); }
.sample-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.sample-card.is-loading { opacity: 0.6; pointer-events: none; }
.sample-info { display: grid; gap: 3px; padding: 12px 14px 14px; align-content: center; }
.sample-info .tag { justify-self: start; align-self: start; }
.sample-info b { font-size: 15px; }
.sample-info small { font-size: 12.5px; color: var(--muted); }
.scheme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.scheme-card { display: grid; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; background: var(--surface); color: inherit; text-decoration: none; transition: transform 0.2s; }
.scheme-card:hover { transform: translateY(-2px); }
.scheme-card img, .sg-ph { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--bg-2); }
.sg-info { display: grid; padding: 10px 12px; line-height: 1.4; }
.sg-info b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-info small { font-size: 12px; color: var(--muted); }
.how { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.how-item { padding: 18px; border-radius: var(--radius-md); background: rgba(255, 253, 249, 0.6); border: 1px solid var(--line); }
.how-item > .ic { font-size: 22px; color: var(--accent); }
.how-item b { display: block; margin: 8px 0 4px; font-size: 15px; }
.how-item p { font-size: 13px; color: var(--ink-2); }

/* ---------- 通用页头 ---------- */
.ws-head { display: flex; align-items: flex-start; gap: 16px; padding: clamp(18px, 3vw, 30px) 0 16px; }
.back-link { display: inline-flex; align-items: center; gap: 2px; padding: 6px 10px 6px 4px; border-radius: 999px; color: var(--ink-2); font-size: 13.5px; text-decoration: none; margin-top: 22px; flex: none; }
.back-link:hover { background: var(--surface); }
.ws-title { min-width: 0; }
.ws-title h1 { font-family: var(--serif); font-size: clamp(22px, 3vw, 30px); line-height: 1.25; }
.ws-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.frame { position: relative; width: min(100%, calc(68vh * var(--ar))); aspect-ratio: var(--ar); margin: 0 auto; overflow: hidden; border-radius: var(--radius-md); background: #e9e0d3; }
.frame-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.frame-img[data-act="zoom"] { cursor: zoom-in; }
.frame-img.dim { filter: blur(6px) brightness(0.9); transform: scale(1.04); }
.frame.mini { width: 132px; border-radius: 10px; flex: none; align-self: flex-start; }

/* ---------- 准备页 ---------- */
.setup-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 520px); gap: clamp(16px, 2.4vw, 28px); align-items: start; }
.setup-photo { position: sticky; top: 76px; display: grid; gap: 14px; }
.photo-card { padding: 12px; }
.photo-frame { width: min(100%, calc(46vh * var(--ar))); }
.cand-box { position: absolute; border: 2px solid var(--accent); border-radius: 8px; background: rgba(196, 98, 58, 0.1); transition: all 0.2s; pointer-events: none; }
.cand-box i { position: absolute; top: -11px; left: -11px; display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: var(--accent); color: #fff; font-size: 12px; font-style: normal; font-weight: 700; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2); }
.cand-box.off { border-style: dashed; border-color: rgba(255, 255, 255, 0.85); background: transparent; }
.cand-box.off i { background: #998e84; }
.cand-box.manual { border-color: var(--sage); background: rgba(108, 138, 108, 0.14); }
.cand-box.manual i { background: var(--sage); }
.cand-box.hover { box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.7), 0 0 0 9999px rgba(20, 14, 8, 0.35); z-index: 2; }
.scan-line { position: absolute; left: 0; right: 0; height: 30%; background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.35), transparent); animation: scan 2.2s ease-in-out infinite; }
.photo-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.an-chip { display: flex; align-items: flex-start; gap: 10px; margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.an-chip > div { flex: 1; display: grid; gap: 1px; line-height: 1.45; }
.an-chip b { font-size: 13.5px; }
.an-chip small { font-size: 12px; color: var(--muted); }
.an-chip > .ic { font-size: 18px; margin-top: 1px; }
.an-chip.ok > .ic { color: var(--sage); }
.an-chip.warn { background: var(--gold-l); }
.an-chip.warn > .ic, .an-chip.error > .ic { color: var(--gold); }
.an-chip.running .spinner { margin-top: 2px; }
.setup-form { display: grid; gap: 14px; }
.block { padding: 18px 18px 16px; }
.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.block-head h3 { font-size: 15.5px; font-weight: 650; }
.block > .input { margin-top: 8px; }
.intent-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.intent-card { display: grid; gap: 1px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); text-align: left; transition: all 0.16s; line-height: 1.4; }
.intent-card:hover { border-color: var(--line-2); }
.intent-card.is-active { border-color: var(--accent); background: var(--accent-ll); }
.intent-card b { font-size: 14px; font-weight: 600; }
.intent-card b em { font-style: normal; font-size: 10.5px; padding: 1px 6px; border-radius: 6px; background: var(--gold-l); color: var(--gold); margin-left: 4px; vertical-align: 1px; }
.intent-card small { font-size: 12px; color: var(--muted); }
.hint-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.hint-line .ic { color: var(--accent); }
.feel-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.feel-grid.compact { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); margin-top: 14px; }
.feel-card { display: grid; gap: 6px; padding: 7px 7px 9px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); transition: all 0.16s; }
.feel-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.feel-card.is-active { border-color: var(--accent); background: var(--accent-ll); box-shadow: 0 6px 16px rgba(196, 98, 58, 0.12); }
.feel-card b { font-size: 12.5px; font-weight: 600; }
.feel-swatch { display: grid; grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; height: 46px; border-radius: 8px; overflow: hidden; }
.feel-swatch i:first-child { grid-row: span 2; }
.mine-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mine-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 4px 3px 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 12.5px; }
.mine-chip img { width: 26px; height: 26px; border-radius: 50%; object-fit: contain; background: var(--checker); }
.mine-chip button { border: 0; border-radius: 999px; padding: 1px 8px; font-size: 11.5px; background: var(--bg-2); color: var(--ink-2); }
.mine-chip button.on { background: var(--accent-l); color: var(--accent-d); font-weight: 600; }
.mine-chip button.x { padding: 2px; background: none; color: var(--muted); display: grid; }
.cand-list { display: grid; gap: 8px; margin-top: 8px; }
.cand { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; transition: all 0.16s; }
.cand.on { border-color: rgba(196, 98, 58, 0.55); background: var(--accent-ll); }
.cand.manual { border-color: rgba(108, 138, 108, 0.5); background: var(--sage-l); cursor: default; margin-top: 8px; }
.cbox { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-2); background: #fff; color: transparent; font-size: 13px; flex: none; }
.cand.on .cbox { background: var(--accent); border-color: var(--accent); color: #fff; }
.cbox .ic { stroke-width: 3; }
.cand-n { display: grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; background: var(--ink); color: #fff; font-size: 11.5px; font-weight: 700; flex: none; }
.cand.manual .cand-n { background: var(--sage); }
.cand-main { flex: 1; display: grid; line-height: 1.4; min-width: 0; }
.cand-main b { font-size: 14px; font-weight: 600; }
.cand-main small { font-size: 12px; color: var(--muted); }
.gen-card { padding: 16px 18px 18px; display: grid; gap: 12px; }
.summary { display: grid; gap: 6px; }
.summary-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.schip { display: inline-flex; align-items: center; gap: 2px; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 12.5px; }
.schip.fixed { padding-right: 10px; background: var(--sage); }
.schip.ghost { padding-right: 10px; background: transparent; color: var(--muted); border: 1px dashed var(--line-2); }
.schip button { display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.18); color: #fff; font-size: 11px; }
.clarify { display: grid; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--gold-l); font-size: 13px; }
.clarify > .ic { display: none; }
.clarify div { display: flex; gap: 6px; flex-wrap: wrap; }
.tier-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gen-note { text-align: center; font-size: 12.5px; color: var(--muted); }

/* ---------- 方案工作台 ---------- */
.ws-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); gap: clamp(16px, 2.2vw, 26px); align-items: start; }
.ws-left { min-width: 0; position: sticky; top: 76px; }
.viewer-card { padding: 12px; }
.viewer-tabs { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 2px 10px; flex-wrap: wrap; }
.vt-right { display: flex; align-items: center; gap: 8px; }
.viewer { position: relative; }
.ai-badge { position: absolute; right: 12px; bottom: 12px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 500; color: #fff; background: rgba(25, 18, 12, 0.5); backdrop-filter: blur(6px); pointer-events: none; z-index: 3; }
.ai-badge.real { background: rgba(108, 138, 108, 0.85); }
.obj-box { position: absolute; z-index: 2; padding: 0; border: 2px solid rgba(255, 255, 255, 0.95); border-radius: 8px; background: rgba(196, 98, 58, 0.12); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15); transition: all 0.2s; }
.obj-box span { position: absolute; left: -2px; top: -24px; padding: 1px 8px; border-radius: 6px; background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 600; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.obj-box.mine { background: rgba(108, 138, 108, 0.16); }
.obj-box.mine span { background: var(--sage); }
.obj-box.is-sel { border-color: #fff; background: rgba(196, 98, 58, 0.2); box-shadow: 0 0 0 3px var(--accent), 0 0 0 9999px rgba(20, 14, 8, 0.32); z-index: 3; }
.pick-layer { position: absolute; inset: 0; z-index: 4; cursor: crosshair; background: rgba(20, 14, 8, 0.12); }
.pick-tip { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 999px; background: rgba(36, 28, 22, 0.88); color: #fff; font-size: 13px; white-space: nowrap; }
.job-card { position: absolute; left: 12px; right: 12px; top: 12px; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: rgba(255, 253, 249, 0.94); box-shadow: 0 10px 30px rgba(40, 25, 10, 0.18); backdrop-filter: blur(8px); animation: fadeUp 0.3s var(--ease); }
.job-card > div { flex: 1; display: grid; line-height: 1.4; }
.job-card b { font-size: 14px; }
.job-card p { font-size: 12.5px; color: var(--ink-2); }
.job-card.error { background: rgba(249, 231, 228, 0.97); }
.job-card.error > .ic { color: var(--danger); font-size: 20px; }
.lb-bg { position: absolute; inset: -20px; width: calc(100% + 40px); height: calc(100% + 40px); object-fit: cover; filter: blur(18px) saturate(1.1); opacity: 0.6; }
.gen-loading { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 10px; padding: 20px; text-align: center; background: linear-gradient(135deg, rgba(243, 233, 220, 0.55), rgba(236, 227, 212, 0.4)); }
.gen-loading::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.3) 50%, transparent 70%); background-size: 250% 100%; animation: shimmer 2.4s linear infinite; pointer-events: none; }
.gl-steps { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 999px; background: rgba(255, 253, 249, 0.85); box-shadow: var(--shadow); }
.gl-steps span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 5px; border-radius: 999px; font-size: 13px; color: var(--muted); }
.gl-steps span b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--bg-2); font-size: 12px; }
.gl-steps span .ic { width: 22px; height: 22px; padding: 4px; border-radius: 50%; background: var(--sage); color: #fff; stroke-width: 3; }
.gl-steps span.active { background: var(--ink); color: #fff; }
.gl-steps span.active b { background: var(--accent); color: #fff; }
.gl-steps span.done { color: var(--sage); }
.gl-steps > i { width: 14px; height: 1.5px; background: var(--line-2); }
.gl-title { font-size: 17px; font-weight: 650; position: relative; }
.gl-sub { font-size: 13px; color: var(--ink-2); max-width: 440px; position: relative; }
.lb-bar { width: min(280px, 70%); height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.6); overflow: hidden; position: relative; }
.lb-bar i { display: block; width: 36%; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--gold)); animation: indeterminate 1.8s var(--ease) infinite; }
.gen-error { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 8px; padding: 20px; text-align: center; background: rgba(249, 231, 228, 0.7); }
.gen-error > .ic { font-size: 30px; color: var(--danger); }
.gen-error p { font-size: 13px; color: var(--ink-2); max-width: 420px; }
.compare { position: absolute; inset: 0; user-select: none; -webkit-user-select: none; touch-action: pan-y; --pos: 50%; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.cmp-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.cmp-line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: rgba(255, 255, 255, 0.95); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 0 16px rgba(0, 0, 0, 0.25); pointer-events: none; }
.cmp-knob { position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 50%; background: #fff; color: var(--accent-d); font-size: 18px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25); }
.cmp-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none; }
.cmp-tag { position: absolute; top: 12px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff; background: rgba(25, 18, 12, 0.5); backdrop-filter: blur(6px); pointer-events: none; }
.cmp-tag.left { left: 12px; }
.cmp-tag.right { right: 12px; background: rgba(196, 98, 58, 0.88); }
.version-strip { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding: 2px 2px 4px; }
.vthumb { position: relative; flex: none; width: 70px; height: 54px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: var(--bg-2); transition: border-color 0.2s, transform 0.15s; }
.vthumb:hover { transform: translateY(-1px); }
.vthumb.is-active { border-color: var(--accent); }
.vthumb img { width: 100%; height: 100%; object-fit: cover; }
.vthumb span { position: absolute; left: 3px; bottom: 3px; padding: 0 5px; border-radius: 5px; background: rgba(25, 18, 12, 0.6); color: #fff; font-size: 10.5px; font-weight: 700; }
.vthumb.real span { background: var(--sage); }
.action-bar { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.act { display: grid; justify-items: center; gap: 3px; padding: 10px 4px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font-size: 12.5px; font-weight: 500; text-decoration: none; transition: all 0.16s; }
.act .ic { font-size: 20px; color: var(--accent); }
.act:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-ll); transform: translateY(-1px); }
.act:disabled { opacity: 0.45; }
.act.primary { background: linear-gradient(135deg, #cf6d43, var(--accent-d)); border-color: transparent; color: #fff; }
.act.primary .ic { color: #fff; }
.action-sub { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 4px 2px; }
.ws-right { display: flex; flex-direction: column; max-height: calc(100vh - 96px); position: sticky; top: 76px; overflow: hidden; }
.ws-tabs { display: flex; gap: 4px; padding: 10px 10px 0; border-bottom: 1px solid var(--line); flex: none; }
.ws-tabs button { position: relative; padding: 9px 12px 11px; border: 0; background: none; font-size: 14px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.ws-tabs button.is-active { color: var(--ink); font-weight: 650; border-bottom-color: var(--accent); }
.ws-tabs em { font-style: normal; font-size: 11.5px; padding: 0 6px; border-radius: 8px; background: var(--bg-2); color: var(--ink-2); }
.ws-tabs .dot { position: absolute; top: 8px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.ws-tab-body { flex: 1; overflow-y: auto; padding: 14px 16px 20px; overscroll-behavior: contain; }
.skeleton-plan { padding: 6px 2px; }
.concept { padding: 14px; border-radius: var(--radius-md); background: linear-gradient(135deg, var(--accent-ll), var(--surface-2)); display: grid; gap: 8px; }
.concept-head { display: flex; align-items: center; gap: 10px; }
.concept-head > div { display: grid; line-height: 1.35; }
.concept-head b { font-size: 16px; }
.concept-head span.muted { font-size: 12.5px; }
.concept > p { font-size: 13.5px; color: var(--ink-2); }
.swatch { display: inline-flex; }
.swatch i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--surface); margin-left: -5px; box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.08); }
.swatch i:first-child { margin-left: 0; }
.swatch.lg i { width: 22px; height: 22px; margin-left: -7px; }
.budget-line { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; font-size: 13px; }
.budget-line .ic { color: var(--accent); }
.verify-card { display: flex; gap: 10px; margin-top: 10px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--sage-l); font-size: 13px; }
.verify-card > .ic { color: var(--sage); font-size: 18px; margin-top: 1px; }
.verify-card.fair { background: var(--gold-l); }
.verify-card.fair > .ic { color: var(--gold); }
.verify-card.poor { background: var(--danger-l); }
.verify-card.poor > .ic { color: var(--danger); }
.verify-card p { color: var(--ink-2); font-size: 12.5px; }
.stale-banner, .change-banner { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; margin: 12px 0 4px; padding: 12px; border-radius: var(--radius-sm); background: var(--gold-l); }
.stale-banner > .ic, .change-banner > .ic { color: var(--gold); font-size: 18px; margin-top: 1px; }
.stale-banner > div, .change-banner > div:not(.cb-actions) { flex: 1; min-width: 180px; }
.stale-banner b, .change-banner b { font-size: 13.5px; }
.stale-banner p, .change-banner p { font-size: 12.5px; color: var(--ink-2); }
.cb-actions { display: flex; gap: 6px; width: 100%; justify-content: flex-end; }
.group { margin-top: 16px; }
.group.off .steps, .group.off .item-list { opacity: 0.45; }
.group-head { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.group-head > .ic { color: var(--accent); font-size: 17px; }
.group-head h4 { font-size: 14.5px; font-weight: 650; }
.group-head .muted { font-size: 12px; flex: 1; }
.group-head .mini-switch { margin-left: auto; }
.group.safety .group-head > .ic { color: var(--gold); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.step { display: flex; gap: 10px; padding: 10px 11px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid transparent; transition: all 0.16s; }
.step.off { opacity: 0.5; }
.step.off .step-action { text-decoration: line-through; }
.step-id { flex: none; font-size: 11px; font-weight: 700; color: var(--muted); padding-top: 2px; }
.step-main { flex: 1; min-width: 0; display: grid; gap: 3px; }
.step-action { font-size: 13.5px; font-weight: 600; line-height: 1.45; }
.step-action .muted { font-weight: 400; font-size: 12px; }
.step-detail { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.step-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.step-meta:empty { display: none; }
.pending-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pending-list li { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.pending-list li > .ic { color: var(--muted); margin-top: 3px; flex: none; }
.pending-list li em { font-style: normal; font-size: 11px; font-weight: 700; padding: 0 6px; margin-right: 6px; border-radius: 5px; background: var(--bg-2); color: var(--ink-2); }
.pending-list li.auto { background: var(--gold-l); }
.item-list { display: grid; gap: 8px; }
.item-card { display: flex; gap: 11px; padding: 10px; border: 1.5px solid var(--line); border-radius: var(--radius-md); background: var(--surface); transition: all 0.2s; }
.item-card.is-sel { border-color: var(--accent); box-shadow: 0 6px 18px rgba(196, 98, 58, 0.14); }
.item-card.off { opacity: 0.55; }
.item-card.pending-add { border-style: dashed; margin-top: 8px; }
.ic-thumb { position: relative; flex: none; display: grid; place-items: center; width: 74px; height: 74px; padding: 4px; border: 0; border-radius: 12px; background: var(--surface-2); color: var(--muted); font-size: 24px; }
.ic-thumb img { width: 100%; height: 100%; object-fit: contain; }
.ic-thumb.checker { background: var(--checker); }
.ic-id { position: absolute; left: 4px; top: 4px; padding: 0 5px; border-radius: 5px; background: var(--accent); color: #fff; font-size: 10.5px; font-weight: 700; }
.ic-main { flex: 1; min-width: 0; display: grid; gap: 2px; align-content: start; }
.ic-name { font-size: 14px; font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.ic-sub { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.ic-spec { font-size: 11.5px; color: var(--muted); line-height: 1.45; }
.ic-actions { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; align-items: center; }
.ver-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ver-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.ver-list li { display: flex; gap: 10px; padding: 8px; border-radius: var(--radius-md); border: 1.5px solid var(--line); background: var(--surface); }
.ver-list li.is-cur { border-color: var(--accent); background: var(--accent-ll); }
.ver-thumb { flex: none; width: 86px; height: 64px; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: var(--bg-2); }
.ver-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ver-main { flex: 1; min-width: 0; display: grid; gap: 1px; align-content: start; font-size: 13.5px; }
.fb-row { display: flex; gap: 10px; padding: 8px; border-radius: var(--radius-sm); background: var(--sage-l); margin-top: 6px; font-size: 13px; }
.prompt-pre { white-space: pre-wrap; word-break: break-word; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12px; line-height: 1.6; color: var(--ink-2); background: var(--surface-2); padding: 12px; border-radius: 12px; margin: 0; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(30, 21, 14, 0.5); backdrop-filter: blur(4px); animation: fade 0.2s ease; }
.modal-card { width: min(640px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-lg); overflow: hidden; animation: pop 0.28s var(--ease); }
.modal-card.small { width: min(400px, 100%); }
.modal-card.large { width: min(980px, 100%); }
.modal-card.full { width: min(1500px, 100%); height: calc(100vh - 32px); max-height: none; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 10px; flex: none; }
.modal-head h3 { font-size: 17px; }
.modal-head p { margin-top: 2px; font-size: 13px; color: var(--muted); }
.modal-body { flex: 1; overflow-y: auto; padding: 6px 20px 16px; min-height: 0; }
.modal-body h3 { font-size: 17px; margin-bottom: 6px; }
.modal-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line); flex: none; }
.modal-foot > .muted { margin-right: auto; display: inline-flex; align-items: center; gap: 4px; }
.confirm-text { font-size: 14.5px; line-height: 1.7; padding-top: 12px; }
.modal-card.small .modal-body { padding-top: 16px; display: grid; gap: 10px; }

.draw-wrap { display: grid; place-items: center; }
.draw-stage { position: relative; border-radius: 12px; overflow: hidden; background: #ddd; touch-action: none; }
.draw-stage canvas { position: absolute; inset: 0; display: block; }
#drawMask { cursor: crosshair; touch-action: none; }
.draw-tools { display: flex; align-items: center; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.brush-size { display: flex; align-items: center; gap: 8px; margin-right: auto; font-size: 13px; color: var(--ink-2); }
.brush-size input { width: 140px; accent-color: var(--accent); }
.edit-input .input { font-size: 15px; }

.lib-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; position: sticky; top: -6px; background: var(--surface); padding: 6px 0; z-index: 1; }
.lib-cats button { padding: 5px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13px; color: var(--ink-2); }
.lib-cats button.is-active { background: var(--ink); color: #fff; border-color: var(--ink); }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.lib-grid.small { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
.lib-card { display: grid; gap: 2px; padding: 8px 8px 10px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); text-align: left; transition: all 0.16s; }
.lib-card:not(.static):hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(70, 45, 20, 0.08); }
.lib-img { display: grid; place-items: center; aspect-ratio: 1; padding: 8px; border-radius: 10px; background: linear-gradient(160deg, #fbf7f1, #f1e9de); margin-bottom: 4px; font-size: 26px; color: var(--muted); }
.lib-img img { width: 100%; height: 100%; object-fit: contain; }
.lib-card b { font-size: 13px; font-weight: 600; line-height: 1.35; }
.lib-card small { font-size: 11px; color: var(--muted); line-height: 1.4; }
.lib-tags { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.lib-tags i { font-style: normal; font-size: 10.5px; padding: 0 5px; border-radius: 5px; background: var(--bg-2); color: var(--ink-2); }
.mine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.mine-card { position: relative; display: grid; min-width: 0; gap: 2px; padding: 8px 8px 10px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); text-align: left; }
.mine-card > span.checker { display: grid; place-items: center; aspect-ratio: 1; min-width: 0; overflow: hidden; padding: 6px; border-radius: 10px; margin-bottom: 4px; }
.mine-card img { width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; }
.mine-card b { font-size: 13px; }
.mine-card small { font-size: 11px; color: var(--muted); }
.mine-card.is-sel { border-color: var(--accent); background: var(--accent-ll); }
.mine-card .tick { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, 0.9); color: transparent; border: 1.5px solid var(--line-2); font-size: 13px; }
.mine-card.is-sel .tick { background: var(--accent); border-color: var(--accent); color: #fff; }
.mc-actions { display: flex; gap: 4px; margin-top: 6px; }

.cut-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cut-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.crop-stage { position: relative; border-radius: 12px; overflow: hidden; background: #ddd; touch-action: none; user-select: none; cursor: crosshair; }
.crop-stage img { width: 100%; display: block; pointer-events: none; }
.crop-stage.big { max-width: 100%; width: fit-content; margin: 0 auto; }
.crop-stage.big img { max-height: calc(100vh - 300px); width: auto; max-width: 100%; }
.crop-box { position: absolute; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(20, 14, 8, 0.45), 0 0 0 1px rgba(0, 0, 0, 0.3) inset; border-radius: 4px; cursor: move; }
.crop-box.sel { box-shadow: 0 0 0 9999px rgba(20, 14, 8, 0.35); border-color: var(--sage); border-width: 2.5px; background: rgba(108, 138, 108, 0.15); }
.crop-box .h { position: absolute; width: 14px; height: 14px; background: #fff; border-radius: 4px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); }
.crop-box .tl { left: -7px; top: -7px; } .crop-box .tr { right: -7px; top: -7px; } .crop-box .bl { left: -7px; bottom: -7px; } .crop-box .br { right: -7px; bottom: -7px; }
.obj-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.cut-preview { display: grid; place-items: center; min-height: 220px; border-radius: 12px; padding: 4px; }
.cut-preview canvas { max-width: 100%; touch-action: none; cursor: crosshair; }
.cut-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.cut-tools .range-row { flex-basis: 100%; }
.cut-alt { margin-top: 10px; }
.info-grid { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: start; }
.info-thumb { display: grid; place-items: center; aspect-ratio: 1; padding: 10px; border-radius: var(--radius-md); }
.info-thumb img { max-height: 100%; object-fit: contain; }
.form-col .field:first-child { margin-top: 0; }
.fb-photo { display: grid; place-items: center; gap: 6px; min-height: 140px; border: 1.5px dashed var(--line-2); border-radius: var(--radius-md); background: var(--surface-2); color: var(--muted); cursor: pointer; overflow: hidden; }
.fb-photo .ic { font-size: 26px; }
.fb-photo.has { border-style: solid; padding: 0; }
.fb-photo img { max-height: 260px; }
.export-list { display: grid; gap: 8px; padding-top: 6px; }
.export-opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.export-opt.sub { margin-left: 28px; padding: 9px 12px; }
.export-opt input { margin-top: 4px; accent-color: var(--accent); width: 16px; height: 16px; }
.export-opt span { display: grid; line-height: 1.4; }
.export-opt b { font-size: 14px; }
.export-opt small { font-size: 12px; color: var(--muted); }

/* ---------- 摆放编辑器 ---------- */
.place-modal .modal-body { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.place-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.place-head h3 { font-size: 17px; margin: 0 0 2px; }
.place-actions { display: flex; gap: 6px; }
.place-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 280px; }
/* 用容器尺寸算底图大小：宽、高都不超出，比例不变（手机上竖屏也不会被裁掉） */
.pstage-wrap { display: grid; place-items: center; padding: 14px; min-height: 0; min-width: 0; overflow: hidden; background: #efe7dc; container-type: size; }
.pstage { position: relative; width: min(100cqw, calc(100cqh * var(--ar))); aspect-ratio: var(--ar); touch-action: none; user-select: none; -webkit-user-select: none; }
@supports not (width: 1cqw) { .pstage { width: auto; height: 100%; max-width: 100%; } }
.pbase { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 10px; pointer-events: none; }
.surf { position: absolute; border: 1.5px dashed rgba(255, 255, 255, 0.75); border-radius: 6px; background: rgba(255, 255, 255, 0.04); transition: background 0.15s, border-color 0.15s; pointer-events: none; }
.surf-label { position: absolute; left: 4px; bottom: 4px; padding: 0 6px; border-radius: 5px; background: rgba(36, 28, 22, 0.6); color: #fff; font-size: 11px; white-space: nowrap; }
.surf.hl { border: 2px solid var(--sage); background: rgba(108, 138, 108, 0.24); }
.surf.hl .surf-label { background: var(--sage); }
.drop-line { position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--sage); box-shadow: 0 0 10px var(--sage); }
.surf.editing { pointer-events: auto; cursor: move; border-color: #fff; background: rgba(255, 255, 255, 0.1); }
.surf.editing.sel { border: 2px solid var(--accent); background: rgba(196, 98, 58, 0.15); }
.surf.drawing { border: 2px solid var(--accent); background: rgba(196, 98, 58, 0.15); }
.sh { position: absolute; background: #fff; border-radius: 3px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); }
.sh.l, .sh.r { top: 50%; width: 8px; height: 28px; margin-top: -14px; cursor: ew-resize; }
.sh.l { left: -5px; } .sh.r { right: -5px; }
.sh.t, .sh.b { left: 50%; width: 28px; height: 8px; margin-left: -14px; cursor: ns-resize; }
.sh.t { top: -5px; } .sh.b { bottom: -5px; background: var(--accent); }
.placed { position: absolute; cursor: grab; }
.placed img { position: relative; z-index: 1; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.placed .shadow { position: absolute; left: 8%; right: 8%; bottom: -5%; height: 12%; border-radius: 50%; background: radial-gradient(closest-side, rgba(20, 14, 8, 0.35), transparent); }
.placed.sel { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.placed.warn { outline: 2px dashed var(--danger); outline-offset: 2px; }
.rh { position: absolute; right: -8px; top: -8px; z-index: 2; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--accent); cursor: nesw-resize; }
.pstage-busy { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; background: rgba(255, 253, 249, 0.6); font-size: 14px; border-radius: 10px; }
.draw-hint { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); padding: 5px 12px; border-radius: 999px; background: rgba(36, 28, 22, 0.85); color: #fff; font-size: 13px; pointer-events: none; }
.pside { border-left: 1px solid var(--line); overflow-y: auto; padding: 14px; }
.pside-card { display: grid; gap: 10px; }
.ps-title { font-size: 15px; font-weight: 650; }
.ps-actions { display: flex; gap: 6px; }
.howto { margin: 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); display: grid; gap: 4px; }
.pbar { border-top: 1px solid var(--line); background: var(--surface); flex: none; }
.pbar-tabs { display: flex; gap: 4px; padding: 8px 12px 0; overflow-x: auto; }
.pbar-tabs button { padding: 5px 12px; border: 0; border-radius: 999px; background: none; font-size: 13px; color: var(--muted); white-space: nowrap; }
.pbar-tabs button.is-active { background: var(--ink); color: #fff; }
.pbar-tiles { display: flex; gap: 8px; padding: 10px 12px 14px; overflow-x: auto; min-height: 112px; }
.ptile { flex: none; display: grid; justify-items: center; gap: 3px; width: 84px; padding: 6px; border: 1.5px solid var(--line); border-radius: 12px; background: linear-gradient(160deg, #fbf7f1, #f1e9de); cursor: grab; touch-action: none; user-select: none; transition: border-color 0.15s, transform 0.15s; }
.ptile:hover { border-color: var(--accent); transform: translateY(-2px); }
.ptile img { width: 64px; height: 64px; object-fit: contain; pointer-events: none; }
.ptile span { font-size: 11px; color: var(--ink-2); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ptile.mine { background: var(--checker); }
.ptile.add { cursor: pointer; place-content: center; color: var(--muted); border-style: dashed; background: var(--surface); }
.ptile.add .ic { font-size: 22px; }
.drag-ghost { position: fixed; z-index: 100; width: 90px; height: 90px; object-fit: contain; transform: translate(-50%, -100%); pointer-events: none; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, 0.3)); }

/* ---------- 照着布置 ---------- */
.layout-steps { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.layout-steps button { display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px 6px 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: 13.5px; color: var(--muted); }
.layout-steps button b { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--bg-2); font-size: 12px; }
.layout-steps button.is-active { color: #fff; background: var(--ink); border-color: var(--ink); }
.layout-steps button.is-active b { background: var(--accent); color: #fff; }
.layout-steps button.done { color: var(--sage); }
.layout-steps button.done b { background: var(--sage); color: #fff; }
.layout-steps button b .ic { stroke-width: 3; font-size: 13px; }
.layout-steps > i { width: 18px; height: 1.5px; background: var(--line-2); }
.layout-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.layout-main { padding: clamp(16px, 2.4vw, 26px); }
.layout-side { padding: 12px; position: sticky; top: 76px; display: grid; gap: 10px; }
.layout-side .frame { width: 100%; }
.step-intro { display: grid; gap: 6px; margin-bottom: 14px; }
.step-intro h2 { font-size: 19px; }
.size-list { display: grid; gap: 10px; }
.size-card { display: flex; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-2); }
.sc-body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.sc-title { font-size: 14.5px; font-weight: 650; }
.dims { display: flex; flex-wrap: wrap; gap: 8px; }
.dim { display: grid; gap: 3px; width: 110px; font-size: 12px; color: var(--ink-2); position: relative; }
.dims.sm .dim { width: 76px; }
.dim .input { padding: 7px 9px; font-size: 14px; background: #fff; }
.dim em { position: absolute; right: 6px; top: 26px; font-size: 10px; }
.sc-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.hl-box { position: absolute; border: 2px solid var(--accent); background: rgba(196, 98, 58, 0.2); border-radius: 4px; box-shadow: 0 0 0 999px rgba(20, 14, 8, 0.3); }
.sub-h { margin: 22px 0 10px; font-size: 15px; }
.sub-h small { font-weight: 400; font-size: 12px; }
.isize-list { display: grid; gap: 8px; }
.isize-row { display: flex; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.isize-thumb { flex: none; display: grid; place-items: center; width: 56px; height: 56px; padding: 4px; border-radius: 10px; background: linear-gradient(160deg, #fbf7f1, #f1e9de); }
.isize-thumb img { width: 100%; height: 100%; object-fit: contain; }
.isize-thumb.checker { background: var(--checker); }
.isize-main { flex: 1; display: grid; gap: 4px; font-size: 13.5px; }
.step-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.nav-right { display: flex; gap: 8px; flex-wrap: wrap; }
.check-sum { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.check-sum span { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.check-sum .ok { background: var(--sage-l); color: var(--sage); }
.check-sum .bad { background: var(--danger-l); color: var(--danger); }
.check-sum .unk { background: var(--bg-2); color: var(--ink-2); }
.check-card { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md); margin-top: 12px; background: var(--surface-2); }
.check-card h3 { font-size: 15px; margin-bottom: 8px; }
.check-card h3 small { font-weight: 400; font-size: 12.5px; }
.scale-svg { width: 100%; height: auto; background: #fff; border-radius: 12px; }
.scale-svg rect.add { fill: #f7e4d9; stroke: var(--accent); stroke-width: 1.5; }
.scale-svg rect.mine { fill: #e4ece1; stroke: var(--sage); stroke-width: 1.5; }
.scale-svg rect.bad { fill: #f9e1dd; stroke: var(--danger); stroke-width: 2; }
.scale-svg rect.space { fill: #faf5ee; stroke: #dccfbe; stroke-dasharray: 4 4; }
.scale-svg rect.overflow { fill: rgba(194, 69, 61, 0.1); }
.scale-svg line.surface { stroke: var(--ink); stroke-width: 3; }
.scale-svg text { font-size: 12px; fill: var(--ink); font-family: var(--font); }
.scale-svg text.dim-t { fill: var(--muted); font-size: 11px; }
.check-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.check-list li { display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-start; }
.check-list li > .ic { margin-top: 3px; }
.check-list li > span:first-of-type { flex: 1; min-width: 200px; }
.check-list .ok { color: var(--sage); }
.check-list .bad { color: var(--danger); }
.check-list .unk { color: var(--ink-2); }
.check-list .fix { display: flex; gap: 5px; flex-wrap: wrap; width: 100%; padding-left: 22px; }
.order-list { list-style: none; margin: 0; padding: 0; counter-reset: ord; display: grid; gap: 8px; }
.order-list li { counter-increment: ord; display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 13.5px; }
.order-list li::before { content: counter(ord); display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; font-weight: 700; }
.order-list .tag { flex: none; margin-top: 1px; }
.buy-list { display: grid; gap: 8px; }
.buy-row { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.buy-row.off { opacity: 0.5; }
.buy-main { flex: 1; display: grid; gap: 2px; font-size: 13.5px; min-width: 0; }
.budget-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 8px; }
.budget-grid div { display: grid; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.budget-grid b { font-size: 17px; }
.calib-tools { display: flex; flex-wrap: wrap; gap: 10px; }
.calib-tools .field { margin: 0; min-width: 180px; flex: 1; }
.calib-step { margin: 12px 0 8px; font-size: 14px; }
.calib-stage { position: relative; width: min(100%, calc((100vh - 360px) * var(--ar))); aspect-ratio: var(--ar); margin: 0 auto; border-radius: 12px; overflow: hidden; touch-action: none; cursor: crosshair; user-select: none; }
.calib-stage img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.calib-stage svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.calib-stage line { stroke-width: 6; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.calib-stage line.ref { stroke: var(--sage); }
.calib-stage line.tgt { stroke: var(--accent); }

/* ---------- 抽屉 ---------- */
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(34, 24, 16, 0.32); backdrop-filter: blur(2px); animation: fade 0.2s ease; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(460px, 100vw); display: flex; flex-direction: column; background: var(--surface); box-shadow: var(--shadow-lg); transform: translateX(104%); transition: transform 0.32s var(--ease); }
.drawer.is-open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 14px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { font-size: 17px; }
.drawer-head p { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.drawer-tabs { display: flex; gap: 4px; padding: 10px 16px 0; border-bottom: 1px solid var(--line); }
.drawer-tabs button { padding: 7px 12px 9px; border: 0; background: none; color: var(--muted); font-size: 14px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.drawer-tabs button.is-active { color: var(--ink); font-weight: 650; border-bottom-color: var(--accent); }
.drawer-tabs em { font-style: normal; font-size: 11.5px; padding: 0 6px; border-radius: 8px; background: var(--bg-2); }
.drawer-body { flex: 1; overflow-y: auto; padding: 10px 20px 28px; }
.drawer-foot { padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; justify-content: flex-end; }
.drawer-grid { padding-top: 10px; }
.set-group { padding: 16px 0; border-bottom: 1px dashed var(--line); display: grid; gap: 10px; }
.set-group:last-of-type { border-bottom: 0; }
.set-group h4 { font-size: 14px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.set-group h4 small { font-weight: 400; color: var(--muted); font-size: 12px; }
.set-field { display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); }
.set-field > span { font-weight: 600; }
.set-field small, .set-note { font-size: 12px; color: var(--muted); line-height: 1.6; }
.set-group .switch-row { margin-top: 0; }
.hist-list { display: grid; gap: 10px; padding-top: 12px; }
.hist-item { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.hist-open { flex: 1; display: flex; align-items: center; gap: 12px; padding: 8px; text-decoration: none; color: inherit; min-width: 0; }
.hist-open img, .hist-ph { width: 72px; height: 56px; border-radius: 10px; object-fit: cover; flex: none; background: var(--bg-2); }
.hist-info { display: grid; min-width: 0; line-height: 1.4; }
.hist-info b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-info span { font-size: 12px; color: var(--muted); }
.hist-del { border: 0; background: none; padding: 0 14px; color: var(--muted); font-size: 16px; }
.hist-del:hover { color: var(--danger); }
.hist-empty { padding: 48px 12px; text-align: center; color: var(--muted); font-size: 14px; }
.hist-empty .ic { font-size: 28px; }

/* ---------- 引导、大图、提示 ---------- */
.coach { position: fixed; z-index: 90; width: min(300px, calc(100vw - 20px)); padding: 13px 14px 11px; border-radius: 14px; background: var(--ink); color: #fff; box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28); animation: pop 0.3s var(--ease); --arrow-x: 50%; }
.coach::before { content: ""; position: absolute; left: var(--arrow-x); width: 12px; height: 12px; margin-left: -6px; background: var(--ink); transform: rotate(45deg); }
.coach-bottom::before { top: -5px; }
.coach-top::before { bottom: -5px; }
.coach b { display: block; font-size: 14px; margin-bottom: 3px; }
.coach p { font-size: 13px; line-height: 1.6; color: rgba(255, 255, 255, 0.88); }
.coach-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 10px; }
.coach .link-btn { color: rgba(255, 255, 255, 0.6); font-weight: 500; }
.coach-target { position: relative; z-index: 1; box-shadow: 0 0 0 3px rgba(196, 98, 58, 0.45); border-radius: 12px; }
.lightbox { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px; background: rgba(16, 12, 9, 0.9); animation: fade 0.2s ease; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
.lightbox-close { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; color: #fff; background: rgba(255, 255, 255, 0.14); font-size: 20px; }
.toast-root { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 95; display: grid; gap: 8px; justify-items: center; transform: translateX(-50%); pointer-events: none; width: min(92vw, 480px); }
.toast { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 14px; font-size: 13.5px; color: #fff; background: rgba(36, 28, 22, 0.94); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); animation: toastIn 0.3s var(--ease); pointer-events: auto; }
.toast.success .ic { color: #a8d5a2; }
.toast.error { background: rgba(150, 44, 36, 0.96); }
.toast.leave { animation: toastOut 0.25s ease forwards; }

/* ---------- 动画 ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } }
@keyframes pop { from { opacity: 0; transform: scale(0.96) translateY(8px); } }
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -100% 0; } }
@keyframes indeterminate { 0% { transform: translateX(-110%); } 100% { transform: translateX(290%); } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }
@keyframes scan { 0% { top: -30%; } 100% { top: 100%; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .ws-grid { grid-template-columns: minmax(0, 1fr) 380px; }
  .layout-grid { grid-template-columns: minmax(0, 1fr) 280px; }
}
@media (max-width: 980px) {
  .home-hero { grid-template-columns: 1fr; }
  .setup-grid, .ws-grid, .layout-grid { grid-template-columns: 1fr; }
  .setup-photo, .ws-left, .layout-side { position: static; }
  .ws-right { position: static; max-height: none; }
  .ws-tab-body { overflow: visible; }
  .layout-side { order: -1; }
  .layout-side .frame { width: min(100%, 420px); }
  .place-main { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .pside { border-left: 0; border-top: 1px solid var(--line); max-height: 34vh; }
  .setup-photo { display: contents; }
  .photo-card { order: 0; }
  .setup-form { order: 1; }
  .gen-card { order: 2; position: sticky; bottom: 0; z-index: 5; gap: 9px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom)); border-radius: var(--radius) var(--radius) 0 0; margin: 0 calc(-1 * clamp(12px, 4vw, 40px)); box-shadow: 0 -8px 30px rgba(70, 45, 20, 0.12); }
  .gen-card .summary > .muted, .gen-card .gen-note { display: none; }
  .gen-card .summary-chips { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
  .gen-card .schip { flex: none; }
  .photo-frame { width: 100%; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  .topbar { padding: 9px 12px; }
  .brand-text small { display: none; }
  .ghost-btn { padding: 8px 10px; }
  .ghost-btn span { display: none; }
  .page { padding: 0 12px 28px; }
  .samples, .how { grid-template-columns: 1fr; }
  .sample-card { grid-template-columns: 120px 1fr; }
  .sample-card img { height: 100%; aspect-ratio: auto; }
  .ws-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .feel-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .radio-row { grid-template-columns: 1fr; }
  .action-bar { grid-template-columns: repeat(5, minmax(58px, 1fr)); overflow-x: auto; gap: 6px; }
  .act { font-size: 11.5px; padding: 8px 2px; }
  .cut-grid, .info-grid { grid-template-columns: 1fr; }
  .info-thumb { max-width: 200px; }
  .modal { padding: 0; align-items: end; }
  .modal-card { width: 100% !important; max-height: 94vh; border-radius: var(--radius) var(--radius) 0 0; }
  .modal-card.full { height: 100vh; max-height: 100vh; border-radius: 0; }
  .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .size-card { flex-direction: column; }
  .frame.mini { width: 100%; }
  .gl-steps span { padding-right: 8px; font-size: 12px; }
  .add-row-group { grid-template-columns: 1fr; }
  .place-actions .soft-btn span { display: none; }
}

/* 摆放：效果图里已有的方案物品 */
.ptile { position: relative; }
.ptile.in-image img { opacity: 0.55; }
.ptile-tag { position: absolute; top: 5px; left: 5px; padding: 1px 6px; border-radius: 999px; background: rgba(34, 26, 18, 0.72); color: #fff; font-size: 10.5px; font-style: normal; line-height: 1.6; }
@media (max-width: 600px) {
  .layout-steps { flex-wrap: nowrap; gap: 4px; }
  .layout-steps > i { display: none; }
  .layout-steps button { flex: 1 1 0; min-width: 0; justify-content: center; padding: 5px 6px; gap: 5px; font-size: 12.5px; white-space: nowrap; }
  .layout-steps button b { width: 20px; height: 20px; flex: none; }
}
