/* ============================================================
   搭搭 · AI 智能衣橱 — 设计系统
   配色：海盐葡萄（浅底紫调）——薰衣草白底 + 主紫 + 暖橙点缀
   ============================================================ */
:root {
  --bg: #f7f5fb;
  --bg-deep: #ece7f5;
  --surface: #ffffff;
  --surface-2: #faf8fd;
  --ink: #2c2743;
  --ink-2: #514a6d;
  --muted: #928cab;
  --line: #eae5f4;
  --line-strong: #d8d1e8;
  --brand: #9078ac;
  --brand-2: #a992c6;
  --brand-deep: #7b619c;
  --brand-soft: #efeaf8;
  --accent: #c9905e;
  --accent-soft: #f9efe2;
  --danger: #b1556a;
  --danger-soft: #fbeaee;
  --grad: linear-gradient(152deg, #9b87c4 0%, #ab97cd 52%, #c0afd9 100%);
  --grad-soft: linear-gradient(150deg, #f2edfa 0%, #e9e2f6 100%);
  --radius-l: 22px;
  --radius-m: 16px;
  --radius-s: 11px;
  --shadow-s: 0 1px 2px rgba(60, 46, 92, 0.05);
  --shadow-m: 0 8px 24px -16px rgba(60, 46, 92, 0.38);
  --shadow-l: 0 24px 54px -28px rgba(60, 46, 92, 0.42);
  --nav-h: 62px;
  --shell-pad: 0px;
  --serif: "Songti SC", "Source Han Serif SC", "Noto Serif SC", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(1200px 600px at 12% -12%, #fdfbff 0%, transparent 62%),
    radial-gradient(900px 520px at 96% 108%, #e9e1f6 0%, transparent 58%),
    var(--bg);
}

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

/* ---------------- 应用外壳 ---------------- */
.app-shell {
  position: relative;
  width: 100%;
  max-width: min(468px, 100%);
  height: 100dvh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (min-width: 720px) {
  body { padding: 24px 0; }
  :root { --shell-pad: 24px; }
  .app-shell {
    min-height: calc(100dvh - 48px);
    height: calc(100dvh - 48px);
    border-radius: 30px;
    box-shadow: var(--shadow-l);
    border: 1px solid var(--line);
  }
}

.boot {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
}
.boot__mark {
  width: 56px; height: 56px;
  border-radius: 18px;
  background: var(--brand);
  color: #fbf9ff;
  font-family: var(--serif);
  font-size: 26px;
  display: grid;
  place-items: center;
  animation: pulse 1.6s ease-in-out infinite;
}
.boot__text { font-size: 13px; letter-spacing: 0.06em; }
@keyframes pulse { 0%,100% { opacity: .55; transform: scale(.97); } 50% { opacity: 1; transform: scale(1); } }

/* ---------------- 屏幕 ---------------- */
.screen {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 18px calc(var(--nav-h) + 40px);
  scrollbar-width: none;
  animation: fade-up .32s cubic-bezier(.2,.7,.3,1) both;
}
.screen::-webkit-scrollbar { display: none; }
.screen--flush { padding-left: 0; padding-right: 0; }
.screen--nopad { padding-bottom: 24px; }
/* 生成搭配图后，底部固定「保存」条需要额外留白，避免遮挡我的方案列表末行 */
.screen.has-savebar { padding-bottom: calc(var(--nav-h) + 78px); }

@keyframes fade-up {
  from { opacity: 0; }
  to { opacity: 1; }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px 10px;
  background: linear-gradient(var(--bg) 72%, rgba(247, 244, 239, 0));
  backdrop-filter: blur(6px);
}
.topbar__title {
  font-family: var(--serif);
  font-size: 21px;
  letter-spacing: 0.02em;
  font-weight: 600;
}
.topbar__sub { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.topbar__spacer { flex: 1; }
.icon-btn {
  width: 38px; height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.7);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-s);
  transition: transform .18s ease, background .18s ease;
}
.icon-btn:active { transform: scale(.92); background: var(--brand-soft); }
.icon-btn--plain { background: transparent; border-color: transparent; box-shadow: none; }

/* ---------------- 通用块 ---------------- */
.section { margin-top: 22px; }
.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 11px;
}
.section__title { font-size: 15px; font-weight: 600; letter-spacing: .02em; }
.section__link { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 3px; }

.card {
  background: var(--surface);
  border: 1px solid rgba(234, 229, 244, .9);
  border-radius: 20px;
  box-shadow: var(--shadow-m);
}
.card--pad { padding: 15px; }
.card--warm { background: linear-gradient(160deg, #fffdf9, #f8f2e9); }
.card--brand { background: var(--grad); color: #fbf9ff; border-color: transparent; }

.muted { color: var(--muted); }
.tiny { font-size: 11.5px; }
.small { font-size: 13px; }
.serif { font-family: var(--serif); }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

.row { display: flex; align-items: center; gap: 10px; }
.row > * { min-width: 0; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.between > * { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: .02em;
  transition: transform .16s ease, opacity .16s ease, background .16s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .45; pointer-events: none; }
.btn--primary { background: var(--brand); color: #fbf9ff; box-shadow: 0 12px 24px -14px rgba(144,120,172,.85); }
.btn--accent { background: var(--accent); color: #fff8f2; box-shadow: 0 10px 22px -14px rgba(192,131,86,.9); }
.btn--ghost { background: transparent; border: 1px solid var(--line-strong); color: var(--ink-2); }
.btn--soft { background: var(--brand-soft); color: var(--brand); }
.btn--block { width: 100%; }
.btn--sm { height: 36px; padding: 0 14px; font-size: 12.5px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  white-space: nowrap;
  transition: all .16s ease;
}
.chip--on { background: var(--brand); border-color: var(--brand); color: #fbf9ff; }
.chip--ghost { background: transparent; }
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 4px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }

.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 11px;
  background: var(--brand-soft);
  color: var(--brand);
  letter-spacing: .02em;
}
.tag--accent { background: var(--accent-soft); color: #96552d; }
.tag--plain { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

/* ---------------- 底部导航 ---------------- */
.tabbar {
  position: absolute;
  left: 12px; right: 12px;
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  height: var(--nav-h);
  display: flex;
  padding: 0 6px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 14px 34px -20px rgba(60, 46, 92, .5);
  z-index: 30;
}
.tabbar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: .04em;
  position: relative;
  transition: color .18s ease;
  border-radius: 14px;
}
.tabbar__item svg { width: 21px; height: 21px; position: relative; z-index: 1; }
.tabbar__item span { position: relative; z-index: 1; }
.tabbar__item.is-active { color: var(--brand); }
.tabbar__item.is-active::before {
  content: "";
  position: absolute;
  top: 7px;
  width: 38px; height: 24px;
  border-radius: 9px;
  background: var(--brand-soft);
  opacity: 1;
}

/* ---------------- 首页 ---------------- */
.hero {
  position: relative;
  border-radius: var(--radius-l);
  overflow: hidden;
  background: var(--grad);
  color: #f6f3ea;
  padding: 20px 18px 18px;
  box-shadow: var(--shadow-m);
}
.hero::after {
  content: "";
  position: absolute;
  right: -40px; top: -50px;
  width: 190px; height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.22), transparent 65%);
}
.hero__eyebrow {
  font-size: 11px;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: .72;
}
.hero__title {
  font-family: var(--serif);
  font-size: 27px;
  line-height: 1.24;
  margin: 7px 0 4px;
  letter-spacing: .02em;
}
.hero__desc { font-size: 12.5px; opacity: .78; line-height: 1.6; }
.hero__score {
  position: absolute;
  right: 16px; bottom: 16px;
  text-align: center;
}
.hero__score b { font-family: var(--serif); font-size: 30px; line-height: 1; }
.hero__score span { display: block; font-size: 10px; opacity: .7; letter-spacing: .1em; margin-top: 2px; }

.quick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.quick__item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 13px 8px 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--ink-2);
  box-shadow: var(--shadow-s);
  transition: transform .18s ease;
}
.quick__item:active { transform: translateY(2px); }
.quick__icon {
  width: 34px; height: 34px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
}
.quick__item:nth-child(2) .quick__icon { background: var(--accent-soft); color: #a8683c; }
.quick__item:nth-child(3) .quick__icon { background: #eef0f6; color: #566a8a; }

.look-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.look-card {
  position: relative;
  border-radius: var(--radius-m);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-s);
  text-align: left;
}
.look-card__media {
  aspect-ratio: 3 / 4;
  background: var(--surface-2);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  padding: 10px;
  align-content: center;
}
.look-card__media img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; background: #fff; }
.look-card__meta { padding: 9px 11px 11px; }
.look-card__title { font-size: 12.5px; font-weight: 600; }
.look-card__sub { font-size: 10.5px; color: var(--muted); margin-top: 3px; }

/* ---------------- 单品 ---------------- */
.searchbar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.searchbar input {
  border: 0;
  background: none;
  outline: none;
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  color: var(--ink);
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}
.item-tile {
  position: relative;
  border-radius: 13px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  aspect-ratio: 1;
  transition: transform .18s ease, box-shadow .18s ease;
}
.item-tile:active { transform: scale(.97); }
.item-tile img { width: 100%; height: 100%; object-fit: cover; }
.item-tile__badge {
  position: absolute;
  left: 6px; bottom: 6px;
  font-size: 9.5px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255,255,255,.86);
  color: var(--ink-2);
  backdrop-filter: blur(4px);
}
.item-tile__worn {
  position: absolute;
  right: 6px; bottom: 6px;
  font-size: 9.5px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(44,39,67,.62);
  color: #fff;
}

.filters { display: flex; gap: 7px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filter-btn {
  display: inline-flex; align-items: center; gap: 4px;
  height: 30px; padding: 0 11px;
  border-radius: 9px;
  font-size: 12px;
  color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.filter-btn.is-on { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }

/* ---------------- 空状态 / 骨架 ---------------- */
.empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
}
.empty__art {
  width: 64px; height: 64px;
  margin: 0 auto 14px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  display: grid;
  place-items: center;
  color: var(--line-strong);
}
.empty__title { font-size: 14px; color: var(--ink-2); margin-bottom: 5px; }
.empty__desc { font-size: 12px; line-height: 1.7; margin-bottom: 16px; }

.skeleton {
  border-radius: 12px;
  background: linear-gradient(100deg, #efeae1 20%, #f7f4ee 40%, #efeae1 60%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}
@keyframes shimmer { from { background-position: 120% 0; } to { background-position: -60% 0; } }

/* ---------------- 底部弹层 ---------------- */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(27, 26, 24, .34);
  backdrop-filter: blur(2px);
  z-index: 60;
  animation: fade .2s ease both;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 61;
  max-width: 468px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 8px 18px calc(22px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -12px 40px -18px rgba(0,0,0,.3);
  animation: sheet-up .28s cubic-bezier(.2,.8,.3,1) both;
  max-height: 82dvh;
  overflow-y: auto;
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.sheet__handle { width: 38px; height: 4px; border-radius: 3px; background: var(--line-strong); margin: 4px auto 14px; }
.sheet__title { font-family: var(--serif); font-size: 17px; margin-bottom: 12px; }

/* ---------------- 表单 ---------------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field__label { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.input {
  height: 48px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: var(--surface);
  padding: 0 14px;
  outline: none;
  font-size: 15px;
  transition: border-color .18s ease, background .18s ease;
}
.input:focus { border-color: var(--brand); background: #fff; }
textarea.input { height: auto; padding: 12px 14px; resize: vertical; min-height: 76px; line-height: 1.6; }
.field__error { font-size: 11.5px; color: var(--danger); }
.form-error {
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 12.5px;
  padding: 10px 12px;
  border-radius: 11px;
  margin-bottom: 12px;
}

/* ---------------- 图表 ---------------- */
.chart-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 16px 14px 12px;
  box-shadow: var(--shadow-s);
}
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 4px; }
.chart-title { font-size: 14px; font-weight: 600; }
.chart-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }
.chart-badge {
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 7px;
  background: var(--brand-soft);
  color: var(--brand);
  white-space: nowrap;
}
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-tip {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 11px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-2);
}
.chart-tip b { font-family: var(--serif); font-size: 15px; color: var(--brand); }
.chart-note { font-size: 11px; color: var(--muted); line-height: 1.65; margin-top: 8px; }

.radar-axis { font-size: 10px; fill: var(--muted); }
.radar-value { font-size: 10px; fill: var(--brand); font-weight: 600; }
.radar-shape { animation: radar-in .7s cubic-bezier(.2,.8,.3,1) both; transform-origin: center; }
@keyframes radar-in { from { opacity: 0; transform: scale(.72); } to { opacity: 1; transform: none; } }
.line-path { stroke-dasharray: 1200; stroke-dashoffset: 1200; animation: draw 1.1s cubic-bezier(.3,.8,.3,1) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: 11px;
  background: var(--bg-deep);
  gap: 2px;
}
.segmented button {
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 11.5px;
  color: var(--muted);
  transition: all .18s ease;
}
.segmented button.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-s); }

/* ---------------- 日历 ---------------- */
.cal-head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 6px; }
.cal-head span { text-align: center; font-size: 10px; color: var(--muted); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-day {
  position: relative;
  aspect-ratio: 1 / 1.16;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  color: var(--ink-2);
  overflow: hidden;
  transition: transform .16s ease;
}
.cal-day:active { transform: scale(.94); }
.cal-day--blank { background: transparent; border-color: transparent; }
.cal-day--logged { background: var(--brand); border-color: var(--brand); color: #f6f3ea; }
.cal-day--today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-day--future { opacity: .45; }
.cal-day__dot { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: .6; }

/* ---------------- 档案 / 列表 ---------------- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); overflow: hidden; }
.list__row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  width: 100%;
  text-align: left;
}
.list__row:last-child { border-bottom: 0; }
.list__row:active { background: var(--surface-2); }
.list__chev { color: var(--line-strong); margin-left: auto; }

.profile-hero { display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--grad);
  color: #fbf9ff;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: .02em;
  flex: none;
}
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); text-align: center; }
.stat-grid b { font-family: var(--serif); font-size: 20px; display: block; line-height: 1.2; }
.stat-grid span { font-size: 10px; color: var(--muted); white-space: nowrap; }

.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kv__cell {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 9px 11px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.kv__cell em { display: block; font-size: 10px; color: var(--muted); font-style: normal; margin-bottom: 2px; }

/* ---------------- 编辑器槽位 ---------------- */
.slots { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.slot {
  position: relative;
  aspect-ratio: 1;
  border-radius: 13px;
  border: 1px dashed var(--line-strong);
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
}
.slot--filled { border-style: solid; border-color: var(--line); background: var(--surface); }
.slot img { width: 100%; height: 100%; object-fit: cover; }
.slot__label {
  position: absolute;
  left: 6px; bottom: 6px;
  font-size: 9.5px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255,255,255,.9);
  color: var(--ink-2);
}
.slot__clear {
  position: absolute;
  right: 5px; top: 5px;
  width: 19px; height: 19px;
  border-radius: 50%;
  background: rgba(44,39,67,.55);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
}

/* ---------------- 结果页 ---------------- */
.look-stage {
  position: relative;
  border-radius: var(--radius-l);
  overflow: hidden;
  background: linear-gradient(165deg, #f3eee5, #e8e2d6);
  border: 1px solid var(--line);
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.look-stage__item { position: relative; border-radius: 12px; overflow: hidden; background: #fff; aspect-ratio: 1; }
.look-stage__item img { width: 100%; height: 100%; object-fit: cover; }
.look-stage__item span {
  position: absolute; left: 6px; bottom: 6px;
  font-size: 9.5px; padding: 1px 6px; border-radius: 6px;
  background: rgba(255,255,255,.88); color: var(--ink-2);
}
.look-stage--single { grid-template-columns: 1fr; }

.reason {
  display: flex;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px dashed var(--line);
}
.reason:last-child { border-bottom: 0; }
.reason__score {
  flex: none;
  width: 38px; height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 15px;
  background: var(--brand-soft);
  color: var(--brand);
}
.reason__score.is-low { background: var(--accent-soft); color: #a8613a; }
.reason__label { font-size: 12.5px; font-weight: 600; margin-bottom: 2px; }
.reason__text { font-size: 11.5px; color: var(--muted); line-height: 1.6; }

.score-ring {
  position: relative;
  width: 76px; height: 76px;
  flex: none;
}
.score-ring b {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--serif);
  font-size: 24px;
}

/* ---------------- Toast ---------------- */
.toast-root {
  position: fixed;
  left: 0; right: 0; bottom: calc(var(--nav-h) + 22px);
  z-index: 90;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  max-width: 82%;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(44, 39, 67, .92);
  color: #f8f6f0;
  font-size: 12.5px;
  box-shadow: var(--shadow-m);
  animation: toast-in .26s cubic-bezier(.2,.8,.3,1) both;
}
.toast--error { background: rgba(177, 85, 106, .95); }
.toast--ok { background: rgba(144, 120, 172, .95); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------------- 上传页 ---------------- */
.capture {
  position: relative;
  border-radius: var(--radius-l);
  overflow: hidden;
  aspect-ratio: 1;
  background: radial-gradient(circle at 50% 40%, #34322e, #201f1c);
  color: #f2efe7;
  display: grid;
  place-items: center;
  border: 1px solid #2a2825;
}
.capture__frame {
  position: absolute;
  inset: 18px;
  border: 1.5px dashed rgba(255, 255, 255, .28);
  border-radius: 16px;
}
.capture__frame::before, .capture__frame::after {
  content: "";
  position: absolute;
  width: 22px; height: 22px;
  border: 2px solid rgba(255,255,255,.7);
}
.capture__frame::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.capture__frame::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }
.capture__inner { text-align: center; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.capture__inner p { font-size: 11.5px; opacity: .7; }
.capture img { width: 100%; height: 100%; object-fit: cover; }
.capture__hint {
  position: absolute; left: 0; right: 0; bottom: 14px;
  text-align: center; font-size: 11px; opacity: .6;
}

.analyze {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-m);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12.5px;
}
.spinner {
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(144,120,172,.28);
  border-top-color: var(--brand);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.pill-row { display: flex; flex-wrap: wrap; gap: 7px; }
.pill {
  font-size: 11.5px;
  padding: 6px 11px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
}
.pill.is-on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); font-weight: 600; }

.divider { height: 1px; background: var(--line); margin: 14px 0; }

.mono-note {
  font-size: 11px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px dashed var(--line-strong);
  border-radius: 11px;
  padding: 10px 12px;
  line-height: 1.7;
}
.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---------------- 装衣篓拖拽 ---------------- */
body.is-dragging { user-select: none; cursor: grabbing; }
body.is-dragging .item-tile { cursor: grabbing; }
.drag-ghost {
  position: fixed;
  z-index: 999;
  width: 64px; height: 64px;
  border-radius: 16px;
  overflow: hidden;
  pointer-events: none;
  background: var(--surface);
  box-shadow: 0 18px 34px -14px rgba(60, 46, 92, .55);
  transform: rotate(-5deg);
  opacity: .95;
}
.drag-ghost__img { width: 100%; height: 100%; object-fit: cover; }

/* ---------------- 搭配图 ---------------- */
.render-stage {
  margin-top: 12px;
  border-radius: 18px;
  overflow: hidden;
  background: var(--grad-soft);
  border: 1px solid var(--line);
  position: relative;
}
.render-stage img { display: block; width: 100%; }
.render-stage__loading {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; min-height: 210px; color: var(--muted); font-size: 12px;
}
.render-stage__meta {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 9px 12px; background: rgba(255, 255, 255, .86);
  font-size: 10.5px; color: var(--muted);
}
.render-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--brand);
  font-size: 10px; font-weight: 600;
}
