/* 落间 — 视觉参考暖色家具 App：淡紫灰底 + 白色大圆角软阴影卡片、橙红主按钮、深靛蓝只做选中；
   玻璃只留在浮层（顶栏、菜单、提示框、照片上的标签）。色卡见 palette.html */
@font-face { font-family: "Noto Latin"; font-weight: 400; font-display: swap; src: url(vendor/fonts/noto-sans-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2212; }
@font-face { font-family: "Noto Latin"; font-weight: 600; font-display: swap; src: url(vendor/fonts/noto-sans-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2212; }
@font-face { font-family: "Noto Latin"; font-weight: 800; font-display: swap; src: url(vendor/fonts/noto-sans-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2212; }
:root {
  /* 字体：英文数字用打包的 Noto Sans（宜家字体 Noto IKEA 的原型，不授权）；中文不加载网页字体（几 MB），优先系统里的思源黑体 */
  --font: "Noto Latin", "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --bg: #d1d4e5; --card: #ffffff; --ink: #1c1b24; --muted: #55545f; --faint: #85848f; --line: #e2e1e8;
  --fill: #f5f5f5; --fill2: #e9e8ee; --accent: #d4401a; --accent-hover: #b83514; --accent-ink: #fff; /* 橙红：主按钮、描边强调 */
  --navy: #34345a; --navy-ink: #fff; /* 深靛蓝：选中的胶囊/分段、滑块、勾选（变量名沿用 navy） */
  --blush: #f3e5df; --price-tag: var(--fill); --price-ink: var(--ink); /* 结算页价格底块 */
  --ok: #0a8a00; --ok-ink: #067000; --bad: #e00751; --bar: rgba(255, 255, 255, .78);
  --shadow: 0 8px 24px rgba(52, 52, 90, .08); --glow: none;
  /* 圆角从手机屏幕往里同心递减（里层 = 外层 − 间距）：屏幕约 48 − 卡片离屏幕 s4(16) = 卡片 xl 32；
     xl 32 − 应用页卡片内边距 s3(12) = 舞台/转盘 lg 20；输入框/小卡片 md 12；里面的小件 sm 8；按钮胶囊 pill */
  --r-xl: 32px; --r-lg: 20px; --r-md: 12px; --r-sm: 8px; --r-pill: 980px;
  --glass-float: rgba(255, 255, 255, .72); --rim: inset 0 0 0 1px rgba(28, 27, 36, .06);
  --blobs: none; --dot-rim: rgba(0, 0, 0, .12); /* 色点描边：深色模式下换浅色，黑色杆色点才看得见 */
  /* 字号 6 档（参考 iOS 字号阶梯；输入框 ≥16px，否则 iPhone 聚焦时页面会放大）；字重只用 400 / 600 / 800 */
  /* 间距 6 档：标题与说明 s2、按钮之间 s3；不要写死 px（scripts/lint-style.mjs 会查） */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  /* 版式总纲只有两个值（CLAUDE.md「版式总纲」）：
     a = 卡片离屏幕 = 卡片内容离卡片边 = 步骤条到内容 = 块与块；b = 取景角线离步骤条 / 屏幕侧边 / 下方卡片。
     角线都画在图片区里，内缩 b − a */
  --a: var(--s4); --b: var(--s5); --frame-in: calc(var(--b) - var(--a));
  /* 组内（标题↔它的控件、同组选项之间）只用 s2。按钮只有两种高：大 48（操作条、拍照、首页），小 40（胶囊条里、标题行右侧） */
  --h-lg: 48px; --h-sm: 40px;
  --fs-display: 40px; --fs-title: 24px; --fs-sub: 18px; --fs-body: 16px; --fs-aux: 14px; --fs-note: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121217; --card: #1e1e26; --ink: #f5f5f8; --muted: #bbbbc4; --faint: #8c8c96; --line: #34343e;
    --blush: #2b2326; --fill: #26262f; --fill2: #30303a; --accent: #ff7a52; --accent-hover: #ff9370; --accent-ink: #111111;
    --navy: #a0a0e0; --navy-ink: #0e0e14; --ok: #3fb950; --ok-ink: #3fb950; --bad: #ff4d7d; --bar: rgba(14, 14, 14, .78);
    --shadow: none; --dot-rim: rgba(255, 255, 255, .24); --glass-float: rgba(28, 28, 28, .72); --rim: inset 0 0 0 1px rgba(255, 255, 255, .08);
  }
}
:root[data-theme="dark"] {
  --bg: #121217; --card: #1e1e26; --ink: #f5f5f8; --muted: #bbbbc4; --faint: #8c8c96; --line: #34343e;
  --blush: #2b2326; --fill: #26262f; --fill2: #30303a; --accent: #ff7a52; --accent-hover: #ff9370; --accent-ink: #111111;
  --navy: #a0a0e0; --navy-ink: #0e0e14; --ok: #3fb950; --ok-ink: #3fb950; --bad: #ff4d7d; --bar: rgba(14, 14, 14, .78);
  --shadow: none; --dot-rim: rgba(255, 255, 255, .24); --glass-float: rgba(28, 28, 28, .72); --rim: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--blobs), var(--bg); background-attachment: fixed; color: var(--ink);
  font: 16px/1.5 var(--font);
  letter-spacing: -.01em; -webkit-font-smoothing: antialiased;
}
main { max-width: 680px; margin: 0 auto; padding: var(--a) var(--a) 0; }
/* --chrome = 页面上下被占掉的高度（流程页：步骤条 24 + main 上留白 a；首页/我的方案：上下留白） */
:root { --chrome: 29px; } /* lint-ok 步骤条 13 + 上留白 a */
:root:has(body.hub) { --chrome: 32px; } /* lint-ok main 上 16 + 下 16 */
body.hub main { padding-top: var(--a); }

/* 后台标签：只在 ?admin 显示，不占版面 */
.badge { position: fixed; z-index: 6; top: var(--s1); right: var(--s2); font-size: var(--fs-note); padding: var(--s1) var(--s3); border-radius: var(--r-pill); background: var(--fill2); color: var(--muted); }
.badge.live { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok-ink); }

/* 页面骨架：没有顶栏、没有整页大白卡；图放粉米圆角底块，白卡只给成组内容 */
.page { display: flex; flex-direction: column; gap: var(--a); height: calc(100vh - var(--chrome)); height: calc(100dvh - var(--chrome)); min-height: 440px; position: relative; } /* lint-ok 最小高度 */
.page[hidden] { display: none; }
/* 我的方案：标题和 logo 按钮落在首页大卡片里的同一位置，切换时不跳；列表在页面内部滚动 */
#s-saved .head { padding: var(--a) var(--a) 0; }
#s-saved .hubbtn { top: var(--a); right: var(--a); }
.head h1 { display: flex; align-items: center; gap: var(--s3); margin: 0; font-size: var(--fs-display); line-height: 1.1; font-weight: 800; letter-spacing: -.035em; }
.head .lead { margin: var(--s2) 0 0; }
.rec-note { margin: var(--s2) 0 0; font-size: var(--fs-note); color: var(--muted); }
.row-head { display: flex; align-items: center; gap: var(--s3); }
.back { flex: none; width: 44px; height: 44px; padding: 0; display: grid; place-items: center; background: none; box-shadow: none; } /* lint-ok 透明热区 */
.back svg { margin: 0 !important; vertical-align: baseline !important; }
.media { position: relative; flex: 1 1 0; min-height: 0; display: flex; align-items: center; justify-content: center; padding: var(--s3); border-radius: var(--r-xl); background: var(--blush); overflow: hidden; }
.sheet { position: relative; flex: none; margin: 0 0 var(--a); padding: var(--a) var(--a) 0; background: var(--card); border-radius: var(--r-xl); box-shadow: var(--shadow); overflow: hidden; }
h2 { font-size: var(--fs-title); line-height: 1.25; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.hint { color: var(--muted); font-size: var(--fs-aux); line-height: 1.5; margin: var(--s2) 0; }
.label { font-size: var(--fs-body); font-weight: 600; margin: var(--s4) 0 var(--s2); letter-spacing: -.01em; }
.label .hint { font-weight: 400; font-size: var(--fs-aux); }

/* 首页 */
.hero .media { flex: 1 1 0; background: none; }
.page.hero { padding: var(--a); border-radius: var(--r-xl); background: color-mix(in srgb, var(--card) 87%, transparent); box-shadow: var(--shadow), var(--rim); }
.hero .big { width: auto; align-self: center; padding: var(--s3) var(--s6); }
#s-photo .media { background: none; border-radius: 0; }
.hero-art { width: min(40vw, 160px); max-height: 100%; height: auto; }
.hero-art path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.hero-art .rods path { stroke: var(--ink); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; animation: art-draw .6s ease-out forwards; animation-delay: calc(var(--i) * .08s); }
.hero-art .rods path:nth-child(n+5) { animation-duration: .5s; animation-delay: calc(.6s + (var(--i) - 4) * .2s); }
.hero-art .items circle { fill: var(--accent); stroke: none; opacity: 0; animation: art-drop .45s cubic-bezier(.5, 0, 1, .6) forwards; animation-delay: calc(1.5s + var(--i) * .2s); } /* lint-ok 落下 */
@keyframes art-draw { to { stroke-dashoffset: 0; } }
@keyframes art-drop { from { opacity: 0; transform: translateY(-28px); } 30% { opacity: 1; } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .hero-art .rods path, .hero-art .items circle { animation: none; stroke-dashoffset: 0; opacity: 1; } }
.lead { color: var(--muted); font-size: var(--fs-sub); line-height: 1.42; text-wrap: pretty; }

/* 按钮：胶囊 */
.row { display: flex; flex-wrap: wrap; gap: var(--s3); margin-top: var(--s4); }
.row.end { justify-content: flex-end; }
button, .btn {
  font: inherit; font-size: var(--fs-aux); font-weight: 600; border: 0; background: var(--fill2); color: var(--ink); border-radius: var(--r-pill);
  padding: var(--s3) var(--s4); cursor: pointer; display: inline-block; transition: background .2s, transform .1s, opacity .2s;
}
button:hover, .btn:hover { background: color-mix(in srgb, var(--fill2) 80%, var(--ink) 8%); }
button:active, .btn:active { transform: scale(.97); }
button:disabled { opacity: .4; cursor: default; transform: none; }
.primary, .primary:hover { background: var(--accent); color: var(--accent-ink); box-shadow: var(--glow); }
.primary:hover { background: var(--accent-hover); }
.big, .dock button, #s-photo > .row > .btn { height: var(--h-lg); padding-top: 0; padding-bottom: 0; display: inline-flex; align-items: center; justify-content: center; }
.size-row button, .mhd button, .rec button, .seg button, .chips.sm button, .row.tight button, .fit-msg button, .pane .row button { height: var(--h-sm); padding-top: 0; padding-bottom: 0; }
.primary:disabled { box-shadow: none; }
.ghost { background: transparent; color: var(--ink); padding-left: var(--s3); padding-right: var(--s3); }
.ghost:hover { background: transparent; text-decoration: underline; }
.big { padding: var(--s4) var(--s6); font-size: var(--fs-body); width: 100%; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

/* 输入 */
textarea, input[type=number], input:not([type]), select {
  width: 100%; font: inherit; font-size: var(--fs-body); color: var(--ink); background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: var(--s3) var(--s4); transition: border-color .2s, background .2s; -webkit-appearance: none; appearance: none;
}
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--accent); background: var(--card); }
textarea { resize: vertical; }
input[type=range] { accent-color: var(--navy); width: 100%; }
input[type=checkbox] { accent-color: var(--navy); width: 20px; height: 20px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); margin-top: var(--s4); }
.grid3 label { font-size: var(--fs-note); color: var(--muted); display: block; }
.grid3 input { margin-top: var(--s1); }

/* 胶囊选项 / 方案切换 */
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chips button { padding: var(--s2) var(--s4); font-size: var(--fs-aux); background: var(--fill); color: var(--muted); }
.chips button.on, .chips button.on:hover { background: var(--navy); color: var(--navy-ink); font-weight: 600; }
.tabs { display: flex; gap: var(--s1); padding: var(--s1); background: var(--fill); border-radius: var(--r-pill); overflow-x: auto; margin-bottom: var(--s4); }
.tabs button { flex: 1 0 auto; background: transparent; padding: var(--s3) var(--s4); font-size: var(--fs-aux); color: var(--muted); }
.tabs button.on, .tabs button.on:hover { background: var(--navy); color: var(--navy-ink); font-weight: 600; }

/* 合成舞台 */


/* 零件表 */
.table-wrap { overflow-x: auto; margin-top: var(--s4); }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-aux); }
th { font-size: var(--fs-note); font-weight: 600; color: var(--muted); text-align: left; padding: var(--s2) var(--s2); border-bottom: 1px solid var(--line); }
td { border-bottom: 1px solid var(--fill2); padding: var(--s3) var(--s2); text-align: left; vertical-align: top; }
td.n { white-space: nowrap; }
td input { width: 64px; padding: var(--s1) var(--s2); font-size: var(--fs-aux); border-radius: var(--r-sm); }
.total { text-align: right; font-size: var(--fs-body); margin-top: var(--s4); }
.total b { font-size: var(--fs-title); font-weight: 800; letter-spacing: -.02em; }

.toast {
  position: fixed; left: 50%; bottom: var(--b); transform: translateX(-50%); z-index: 9; max-width: min(90vw, 440px);
  background: rgba(17, 17, 17, .82); color: #fff; padding: var(--s3) var(--s4); border-radius: var(--r-lg); font-size: var(--fs-aux);
  backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 8px 30px rgba(0,0,0,.2);
}
.loading { opacity: .6; pointer-events: none; }

/* ① 拍照页：取景示意图/照片占上半的粉米底块，需求和生成压底 */
#s-photo h2 { font-size: var(--fs-sub); }
#s-photo .row { margin-top: 0; }
#s-photo > .row { gap: var(--a); padding: var(--a); border-radius: var(--r-xl); background: var(--card); box-shadow: var(--shadow); }
#s-photo > .row > .btn { flex: 1 1 0; justify-content: center; text-align: center; }
#s-photo > .row > .btn.primary { flex-grow: 1.618; } /* lint-ok 黄金比例 */
#s-photo > .row > .btn:not(.primary) { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
#s-photo:has(.photos:not(:empty)) .row > .btn.primary { background: var(--fill); color: var(--ink); }
#s-photo:has(.photos:not(:empty)) .guide-tip { display: none; }
.guide { position: absolute; inset: 0; cursor: pointer; }
#s-photo:has(.photos:not(:empty)) .guide { display: none; }
.sketch { position: absolute; inset: calc(var(--s4) + var(--s5)); background: var(--ink); -webkit-mask: url(sketch.png) center / contain no-repeat; mask: url(sketch.png) center / contain no-repeat; }
.live { position: absolute; inset: calc(var(--frame-in) + var(--s3)); width: calc(100% - 2 * (var(--frame-in) + var(--s3))); height: calc(100% - 2 * (var(--frame-in) + var(--s3))); object-fit: cover; border-radius: var(--r-lg); background: var(--ink); } /* 和方案页一样：画面离角线 s3，圆角 32 - 12 = 20 */
.guide:has(.live:not([hidden])) .sketch { display: none; }
.g-ln, .g-acc { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.g-ln { stroke: var(--ink); stroke-width: 1.6; } .g-ln .g-fine { stroke-width: 1; opacity: .55; }
.g-acc { stroke: var(--accent); stroke-width: 2.4; }
.g-mark { fill: none; stroke: var(--navy); stroke-width: 3.6; stroke-linecap: round; stroke-linejoin: round; }
.guide-tip { flex: 1 0 100%; margin: 0; font-size: var(--fs-note); color: var(--muted); text-align: center; }

/* ① 照片：占满底块；多张时横向滑动；检测结果是照片上的小胶囊 */
.photos { position: absolute; inset: 0; display: flex; gap: var(--s2); padding: var(--s3); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.photos::-webkit-scrollbar { display: none; }
.photos:empty { display: none; }
.ph { position: relative; flex: 0 0 100%; scroll-snap-align: center; border-radius: var(--r-lg); overflow: hidden; background: var(--fill); }
.photos:has(.ph:nth-child(2)) .ph { flex-basis: 88%; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph .x { position: absolute; top: var(--s2); right: var(--s2); width: 32px; height: 32px; padding: 0; border-radius: 50%; background: var(--glass-float); box-shadow: var(--rim); color: var(--ink); font-size: var(--fs-aux); line-height: 32px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.ph .tags { position: absolute; left: var(--s2); right: var(--s2); bottom: var(--s2); display: flex; flex-wrap: wrap; gap: var(--s2); }
.q { display: inline-block; padding: var(--s1) var(--s3); border-radius: var(--r-pill); background: var(--glass-float); box-shadow: var(--rim); font-size: var(--fs-note); line-height: 1.4; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.q.ok { color: var(--ok-ink); } .q.bad { color: var(--bad); font-weight: 600; } .q.wait { color: var(--muted); }
.ph.best { box-shadow: 0 0 0 3px var(--accent); }
.ph .pin { position: absolute; width: 32px; height: 32px; color: var(--accent); pointer-events: none; transform: translate(-50%, -100%); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)); } /* lint-ok 图钉尺寸 */
.ph .pin.drop { animation: pin-drop .28s cubic-bezier(.2, .8, .3, 1.2); }
.ph .pin svg { display: block; width: 100%; height: 100%; fill: var(--card); }
@keyframes pin-drop { from { opacity: 0; transform: translate(-50%, -100%) translateY(-16px); } } /* lint-ok 落下距离 */
@media (prefers-reduced-motion: reduce) { .ph .pin { animation: none; } }
.ph .redo { padding: var(--s1) var(--s3); font-size: var(--fs-note); background: var(--navy); color: var(--navy-ink); }

/* 拍照页：可选需求输入 */
/* 需求框和「生成方案」放进相册/拍照同一张卡片，间距同为 a */
#after { display: contents; }
#after > * { flex: 1 0 100%; }
#s-photo textarea { height: 48px; resize: none; overflow: hidden; }
#s-photo { padding-bottom: var(--a); }

.hint.check { color: var(--ok); font-weight: 600; }

@media (max-width: 420px) {
  h2 { font-size: var(--fs-title); }
  .lead { font-size: var(--fs-body); }
  .row.end > * { flex: 1 1 auto; }
}


/* 方案页 / 结算页：上半粉米底块（照片或旋转展示），下半白面板，底部浮着白色操作条 */
body.appmode main { padding-bottom: 0; }
body.appmode .toast { bottom: 104px; } /* lint-ok 操作条之上 */
.flow .sheet { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; gap: var(--a); padding-bottom: 0; }
.flow .media { flex: none; background: none; border-radius: 0; }
/* 四角黑色取景框（和拍照页同款），不要底色卡片 */
.flow .media::after, .guide::after, #s-design .stage-box::after { content: ''; position: absolute; inset: 0; background: var(--navy); pointer-events: none; -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'><path d='M3 47V35C3 15 15 3 35 3H47' fill='none' stroke='%23000' stroke-width='5' stroke-linecap='round'/></svg>") 0 0 / 50px 50px no-repeat, url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'><path d='M3 3H15C35 3 47 15 47 35V47' fill='none' stroke='%23000' stroke-width='5' stroke-linecap='round'/></svg>") 100% 0 / 50px 50px no-repeat, url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'><path d='M3 3V15C3 35 15 47 35 47H47' fill='none' stroke='%23000' stroke-width='5' stroke-linecap='round'/></svg>") 0 100% / 50px 50px no-repeat, url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'><path d='M47 3V15C47 35 35 47 15 47H3' fill='none' stroke='%23000' stroke-width='5' stroke-linecap='round'/></svg>") 100% 100% / 50px 50px no-repeat; mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'><path d='M3 47V35C3 15 15 3 35 3H47' fill='none' stroke='%23000' stroke-width='5' stroke-linecap='round'/></svg>") 0 0 / 50px 50px no-repeat, url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'><path d='M3 3H15C35 3 47 15 47 35V47' fill='none' stroke='%23000' stroke-width='5' stroke-linecap='round'/></svg>") 100% 0 / 50px 50px no-repeat, url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'><path d='M3 3V15C3 35 15 47 35 47H47' fill='none' stroke='%23000' stroke-width='5' stroke-linecap='round'/></svg>") 0 100% / 50px 50px no-repeat, url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 50 50'><path d='M47 3V15C47 35 35 47 15 47H3' fill='none' stroke='%23000' stroke-width='5' stroke-linecap='round'/></svg>") 100% 100% / 50px 50px no-repeat; } /* lint-ok 取景角线：圆角直角、线宽 5、臂长 50、圆角约 32 = --r-xl，三次贝塞尔近似苹果连续圆角 */
.guide::after { inset: var(--frame-in); }
.pay .media { flex: 1 1 0; }
.flow .panes { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; margin: 0 calc(-1 * var(--s1)); padding: 0 var(--s1) 104px; scrollbar-width: none; } /* lint-ok 给浮动操作条留位；左右负边距抵掉 s1，内容离卡片边正好 a */
/* 面板里：块与块 a，组内 s2，子元素自己不带外边距 */
.panes, .pane, .grp { display: flex; flex-direction: column; gap: var(--a); }
.grp { gap: var(--s2); }
.panes > *, .pane > *, .grp > * { margin: 0; }
.pane[hidden], .panes > [hidden], .pane > [hidden] { display: none; }
/* 舞台宽高都显式算出来：iOS Safari 在 shrink-to-fit 容器里不按 aspect-ratio 推宽度（内容全是绝对定位 → 宽 0） */
.stage-box { --h: min(52dvh, max(220px, 100dvh - 360px), calc(min(100vw - 56px, 640px) / var(--ar, .75))); position: relative; flex: none; height: var(--h); width: calc(var(--h) * var(--ar, .75)); max-width: 100%; } /* lint-ok 舞台尺寸 */
.stage { position: relative; width: 100%; height: 100%; border-radius: var(--r-lg); overflow: hidden; background: linear-gradient(var(--fill2) 62%, var(--line) 62%); }
.stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.stage img:not([src]) { display: none; }
.stage canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.pane.tips { display: flex; flex-direction: column; gap: var(--s2); }
.pane.tips[hidden] { display: none; }
.pane.tips .pill { background: var(--fill); }
.pill { margin: 0; font-size: var(--fs-aux); line-height: 1.35; padding: var(--s2) var(--s3); border-radius: var(--r-md); background: var(--glass-float); box-shadow: var(--rim); pointer-events: auto; }
.pill.fit-msg { margin: 0; }
.seg { flex: none; display: flex; gap: var(--s1); }
.seg[hidden] { display: none; }
#s-design .media { align-self: stretch; padding: calc(var(--frame-in) + var(--s3)); } /* 角线在照片外 s3，离四周 b */
#s-design .media::after { content: none; }
#s-design .stage-box::after { inset: calc(-1 * var(--s3)); } /* 角线跟着照片走，照片圆角 20 + 间隙 12 = 角线圆角 32，同心 */
#s-design .stage-box { --h: min(calc(100dvh - 280px), calc(min(100vw - 2 * (var(--b) + var(--s3)), 600px) / var(--ar, .75))); } /* lint-ok 照片尽量放大 */
/* 调整时白卡片长高，上面的照片和角线框跟着缩小 */
#s-design.editing .stage-box { --h: max(120px, calc(100dvh - 470px)); } /* lint-ok 调整面板高度 */
#s-design.editing .dock #another, #s-design.editing .dock #choose { display: none; }
#s-design.editing .dock #adjust { flex: 1; }
#s-design .panes { padding-bottom: 85px; } /* lint-ok 刚好留给操作条，行和按钮之间不留空 */
.dock #choose { flex: 1; }
.seg button { flex: 1; padding-left: var(--s1); padding-right: var(--s1); font-size: var(--fs-aux); border-radius: var(--r-pill); background: transparent; color: var(--muted); }
.seg button.on, .seg button.on:hover { background: var(--navy); color: var(--navy-ink); font-weight: 600; }
.dock { position: absolute; z-index: 3; left: 0; right: 0; bottom: calc(var(--a) + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: var(--a); padding: var(--a); border-radius: 0 0 var(--r-xl) var(--r-xl); background: linear-gradient(to bottom, transparent, var(--card) var(--s4)); } /* lint-ok 只圆下角，和面板底部重合 */
.dock #another, .dock #adjust:not(.primary) { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.dock .dims { flex: 1; margin: 0; font-size: var(--fs-note); line-height: 1.35; text-align: center; min-width: 0; }
.dock .dims b { font-size: var(--fs-sub); font-weight: 800; color: var(--ink); }
.dock .primary { padding-left: var(--s5); padding-right: var(--s5); }
.dock #another, .dock #adjust { padding-left: var(--s4); padding-right: var(--s4); white-space: nowrap; }
.dock .price { flex: 1; min-width: 0; }
.dock .price b { display: block; font-size: var(--fs-display); font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.dock .price small:not(.cur) { display: block; font-size: var(--fs-note); color: var(--muted); }
.dims { font-size: var(--fs-aux); color: var(--muted); line-height: 1.5; }
.dial { display: flex; align-items: center; gap: var(--s2); min-height: 38px; } /* lint-ok 触控高度 */
.dial > span, .opt-row > span, .stepper > span { flex: none; width: 2.2em; font-size: var(--fs-aux); color: var(--muted); }
.dial input[type=range] { flex: 1; min-width: 0; margin: 0; height: 30px; } /* lint-ok 触控高度 */
.dial output { flex: none; width: 4.2em; text-align: right; font-size: var(--fs-aux); font-weight: 600; font-variant-numeric: tabular-nums; }
.step { flex: none; width: 44px; height: 44px; padding: 0; font-size: var(--fs-sub); line-height: 44px; text-align: center; } /* lint-ok 步进键 */
.steppers { display: flex; gap: var(--s4); min-height: 40px; align-items: center; flex-wrap: wrap; } /* lint-ok 触控高度 */
.stepper { display: flex; align-items: center; gap: var(--s2); }
.stepper b { min-width: 1.6em; text-align: center; font-size: var(--fs-sub); font-variant-numeric: tabular-nums; }
/* 面板里的块不带外边距，间隔全由 .pane 的 gap 决定 */
.opt-row { display: flex; align-items: center; gap: var(--s2); }
.chips.sm { gap: var(--s2); }
.chips.sm button { padding-left: var(--s3); padding-right: var(--s3); font-size: var(--fs-aux); }
.row.tight { gap: var(--s2); }
.row.tight button { font-size: var(--fs-aux); }
.intro { font-size: var(--fs-body); }
.toggle { display: flex; align-items: center; gap: var(--s2); font-size: var(--fs-aux); flex-wrap: wrap; }
.toggle .hint { margin: 0; font-size: var(--fs-note); }
.fit-msg { font-size: var(--fs-aux); color: var(--ink); background: var(--fill); border-radius: var(--r-md); padding: var(--s3); display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; }
.fit-msg.warn { color: var(--bad); }
.fit-msg button { font-size: var(--fs-aux); }
.pane .row { margin: 0; }
.pane > input { height: var(--h-lg); }
/* 照片上的尺寸手柄 */
.handles { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.handles[hidden] { display: none; }
.hd { position: absolute; width: 40px; height: 40px; margin: -20px 0 0 -20px; /* lint-ok 手柄中心对准点 */ pointer-events: auto; touch-action: none; cursor: grab; display: grid; place-items: center; }
.hd::before { content: ''; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 3px var(--accent), 0 2px 8px rgba(0,0,0,.35); }
.hd.on::before { background: var(--accent); }
.hd i { position: absolute; left: 34px; top: 10px; font: 600 12px/1 var(--font); font-style: normal; color: #fff; background: rgba(0,0,0,.55); padding: var(--s1) var(--s2); border-radius: var(--r-sm); white-space: nowrap; pointer-events: none; } /* lint-ok 标签贴在 40px 手柄旁 */
.hd.l i { left: auto; right: 34px; } /* lint-ok 同上 */
.hd i { display: none; }
.hd.on i { display: block; }
.versions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.versions:empty { display: none; }
.versions button { padding: var(--s1) var(--s3); font-size: var(--fs-aux); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); }
.versions button.on { background: var(--navy); color: var(--navy-ink); box-shadow: none; }

/* 结算页：旋转展示 + 椭圆底座；白面板里名称、AI 推荐胶囊、材质缩略图卡片、杆色点、确认尺寸 */
.media.tt { padding: var(--s2); } /* 模型可以伸进角线框，只有四角有线 */
.pay .media::after { inset: var(--frame-in); }
.turntable { position: relative; width: 100%; height: 100%; touch-action: none; cursor: grab; overflow: hidden; }
.turntable canvas { display: block; width: 100% !important; height: 100% !important; }
.shoe-tog { position: absolute; right: var(--b); bottom: var(--b); width: var(--h-sm); height: var(--h-sm); padding: 0; display: grid; place-items: center; border-radius: var(--r-pill); background: var(--glass-float); box-shadow: var(--rim); color: var(--ink); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.shoe-tog::before { content: ''; position: absolute; inset: -2px; } /* lint-ok 点击区补到 44 */
.shoe-tog[aria-pressed="false"] { color: var(--muted); }
.shoe-tog[aria-pressed="false"] svg { opacity: .5; }
.mhd { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: var(--h-sm); }
.mhd .label { margin: 0; }
.mhd button { flex: none; padding: var(--s2) var(--s3); font-size: var(--fs-note); background: var(--fill); }
.rec { display: flex; align-items: center; gap: var(--s2); margin-top: var(--s2); padding: var(--s1) var(--s1) var(--s1) var(--s4); border-radius: var(--r-pill); background: var(--fill); font-size: var(--fs-aux); }
.rec[hidden] { display: none; }
.rec span { flex: 1; min-width: 0; }
.rec button { flex: none; padding: var(--s2) var(--s4); background: var(--navy); color: var(--navy-ink); }
.rec button:disabled { background: var(--fill2); color: var(--muted); opacity: 1; }
.chips.cards { display: grid; grid-template-columns: repeat(4, 1fr); } /* 4 种隔板平分整行，左右贴齐卡片内边 */
.chips.cards button { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: var(--s1); padding: var(--s2); border-radius: var(--r-lg); background: var(--blush); color: var(--ink); font-size: var(--fs-note); } /* lint-ok 卡片宽 */
.chips.cards button.on, .chips.cards button.on:hover { background: var(--blush); color: var(--ink); box-shadow: 0 0 0 2px var(--navy); }
.chips.cards .sw { width: 100%; height: 28px; border-radius: var(--r-md); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); } /* lint-ok 材质缩略图 */
.chips.swatch .dot { width: 32px; height: 32px; } /* lint-ok 杆色点 */
.chips.swatch[data-dots] button { padding: var(--s1); background: none; }
.grp > .chips.swatch[data-dots] { margin-left: calc(-1 * var(--s1)); } /* 抵掉点外的 s1，第一个点贴齐左边 */
.chips.swatch[data-dots] button.on { box-shadow: 0 0 0 2px var(--navy); }
.size-row { display: flex; align-items: center; gap: var(--s2); padding: var(--s1) var(--s1) var(--s1) var(--s4); border-radius: var(--r-pill); background: var(--fill); font-size: var(--fs-aux); }
.size-row span { flex: 1; min-width: 0; }
.size-row.nudge { box-shadow: 0 0 0 2px var(--accent); animation: nudge .4s; }
@keyframes nudge { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } } /* lint-ok 抖动幅度 */
.size-row b { font-weight: 600; }
.size-row button { flex: none; padding: var(--s2) var(--s4); }
.pay .sheet { flex: none; }
.pay .panes { padding-bottom: 112px; } /* lint-ok 给浮动操作条留位 */
.snap-view { position: fixed; inset: 0; z-index: 9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s4); padding: var(--s4); background: var(--bg); }
.snap-view button { width: 100%; max-width: 440px; height: var(--h-lg); padding-top: 0; padding-bottom: 0; } /* lint-ok 弹层按钮整宽，手机上和图片同宽 */
.snap-view[hidden] { display: none; }
.snap-view img { max-width: 100%; max-height: 68dvh; border-radius: var(--r-lg); }
.snap-view p { margin: 0; font-size: var(--fs-aux); color: var(--muted); }
/* 系统开了「减少透明度」或浏览器不支持模糊：退回不透明 */
@media (prefers-reduced-transparency: reduce) {
  .stepbar, .pill { background: var(--card); backdrop-filter: none; -webkit-backdrop-filter: none; }
  body { background: var(--bg); }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .pill { background: var(--bar); }
}
.cur { font-size: .5em; font-weight: 600; vertical-align: .55em; margin-right: .08em; }
/* 步骤条：页面最顶上三段细条，走到过的可点回去 */
.stepbar { position: sticky; top: 0; z-index: 4; display: flex; align-items: stretch; gap: var(--s2); height: calc(var(--s2) + 5px); padding: 0 max(var(--s4), calc((100% - 680px) / 2 + var(--s4))); } /* lint-ok 盒子底边 = 细线底边，量间距才准 */
.stepbar button { position: relative; flex: 1; padding: 0; background: none; border-radius: 0; }
.stepbar button::before { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: calc(44px - 100%); } /* lint-ok 点击区向下伸到 44px（会盖住下方图片顶部约 15px） */
.stepbar button::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; border-radius: var(--r-pill); background: var(--fill2); transition: background .3s; } /* lint-ok 细线贴底 */
.stepbar button.on::after { background: var(--navy); }
.stepbar button:disabled { opacity: 1; cursor: default; }

/* 生成进度：分步（等待 / 进行中转圈 + 秒数 / 完成打勾）+ 底部来回滑的细条 */
.progress { position: absolute; left: var(--s3); right: var(--s3); bottom: var(--s3); z-index: 2; overflow: hidden; list-style: none; margin: 0; padding: var(--s3) var(--s4); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: var(--s2); font-size: var(--fs-aux); color: var(--faint); }
.progress li { display: flex; align-items: center; gap: var(--s2); }
.progress li::before { content: ''; flex: none; box-sizing: border-box; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--line); }
.progress li.doing { color: var(--ink); font-weight: 600; }
.progress li.doing::before { border: 2px solid var(--fill2); border-top-color: var(--navy); animation: spin .8s linear infinite; }
.progress li.done { color: var(--muted); }
.progress li.done::before { content: '✓'; border: 0; color: var(--ok); font-weight: 800; font-size: var(--fs-note); line-height: 16px; text-align: center; }
.progress li[data-sec]::after { content: attr(data-sec); margin-left: auto; font-weight: 400; color: var(--faint); font-variant-numeric: tabular-nums; }
.progress::after { content: ''; position: absolute; left: 0; bottom: 0; width: 30%; height: 2px; background: var(--navy); animation: slide 1.4s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(340%); } }
@media (prefers-reduced-motion: reduce) { .progress::after, .progress li.doing::before { animation: none; } }

/* 材质 / 杆色：色点 + 名字，一行横向滑动不换行（宜家选色样式） */
.chips.swatch { flex: 1; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.chips.swatch::-webkit-scrollbar { display: none; }
.chips.swatch button { flex: none; display: inline-flex; align-items: center; gap: var(--s2); padding-left: var(--s2); }
.dot { flex: none; width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--dot-rim); }
.chips.swatch button.on .dot { box-shadow: 0 0 0 1.5px var(--navy-ink); }
.btn > svg, button > svg:not(:only-child) { vertical-align: -4px; margin-right: var(--s2); }
[hidden] { display: none !important; }

/* 首页 / 我的方案：标题在左，右上角 logo 按钮 = 在两页之间切换 */
.head { position: relative; }
.hubbtn { position: absolute; top: 0; right: 0; display: grid; place-items: center; width: 44px; height: 44px; background: none; color: var(--ink); } /* lint-ok 按钮尺寸，透明热区 */
.hubbtn svg { width: 32px; height: 32px; }
body.hub main { padding-bottom: calc(var(--s4) + env(safe-area-inset-bottom)); }

/* 我的方案列表：左粉米缩略图，右名称 / 规格 / 价格 + 小深色「查看」 */
.saved { flex: 1 1 0; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: var(--s3); margin: 0 calc(-1 * var(--a)); padding: 0 var(--a) var(--a); scrollbar-width: none; } /* 负边距让阴影不被滚动区裁掉 */
.saved::-webkit-scrollbar { display: none; }
.saved:empty { justify-content: center; }
.saved:empty::after { content: '保存后的方案会出现在这里'; padding: var(--s6) 0; font-size: var(--fs-aux); color: var(--muted); text-align: center; }
.saved-item { position: relative; display: flex; gap: var(--s3); align-items: center; padding: var(--s3); border-radius: var(--r-xl); background: var(--card); box-shadow: var(--shadow); cursor: pointer; }
.saved-item img { flex: none; width: 96px; height: 96px; object-fit: cover; border-radius: var(--r-lg); background: var(--blush); } /* lint-ok 缩略图尺寸 */
.saved-item div { flex: 1; min-width: 0; }
.saved-item b { display: block; font-size: var(--fs-body); font-weight: 800; }
.saved-item .meta { margin: var(--s1) 0 var(--s2); font-size: var(--fs-aux); color: var(--muted); }
.saved-item .amt { font-size: var(--fs-sub); font-weight: 800; }
.saved-item .view { position: absolute; right: var(--s3); bottom: var(--s3); height: var(--h-sm); padding: 0 var(--s4); background: var(--navy); color: var(--navy-ink); }
.saved-item .x.arm { width: auto; padding: 0 var(--s3); border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); font-size: var(--fs-note); font-weight: 600; }
.saved-item .x { position: absolute; top: var(--s3); right: var(--s3); width: 32px; height: 32px; padding: 0; border-radius: 50%; background: var(--fill); color: var(--muted); font-size: var(--fs-body); line-height: 1; } /* lint-ok 删除钮 */

/* 结算页确认尺寸：没确认时用主色描边提醒 */
#dims-ok.todo { background: var(--card); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

/* 小控件看起来不变，点击区补到 44（透明热区，照 hubbtn 的做法） */
.ph .redo, #fins button, .versions button { position: relative; } /* .ph .x 和「查看」本来就是 absolute */
.ph .x::before, .saved-item .x::before, .ph .redo::before, #fins button::before, .versions button::before, .saved-item .view::before { content: ''; position: absolute; top: 50%; left: 50%; width: max(100%, 44px); height: max(100%, 44px); transform: translate(-50%, -50%); } /* lint-ok 最小点击区 44 */
.toggle { min-height: 44px; } /* lint-ok 最小点击区 44 */
