:root {
  /* ---- 配色：冷白基底 + 燕麦中性 + 哑光黄铜唯一强调 ---- */
  --paper: #fbfaf8;
  --paper-2: #f4f2ee;
  --mist: #eceae4;
  --line: #e0ddd6;
  --line-soft: #eae7e1;
  --ink: #2e2d2a;
  --ink-2: #6b6a66;
  --ink-3: #9a9892;
  --oat: #e8dfce;
  --oat-deep: #d8caae;
  --brass: #a8875a;
  --brass-soft: #c4a878;
  --brass-wash: #f6f1e7;
  --danger: #b4553f;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;

  --shadow-card: 0 1px 2px rgba(46, 45, 42, .04), 0 8px 24px rgba(46, 45, 42, .05);
  --shadow-float: 0 4px 12px rgba(46, 45, 42, .1), 0 16px 40px rgba(46, 45, 42, .12);

  --nav-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);

  --font-display: "Songti SC", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body { overscroll-behavior-y: none; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 15px; color: var(--ink); }
img { display: block; max-width: 100%; }

#app { min-height: 100%; position: relative; }

/* ============ 通用页面骨架 ============ */
.page { display: none; min-height: 100vh; padding-bottom: calc(var(--nav-h) + var(--safe-b) + 16px); }
.page.is-active { display: block; animation: pageIn .32s cubic-bezier(.22,.61,.36,1); }
.page--plain { padding-bottom: 32px; }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.wrap { padding: 0 20px; }

/* ---- 顶栏 ---- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px 12px;
  background: rgba(251, 250, 248, .92);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar__back {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 17px; color: var(--ink-2);
}
.topbar__back:active { background: var(--mist); }
.topbar__title { font-family: var(--font-display); font-size: 19px; letter-spacing: 1px; }
.topbar__sub { font-size: 12px; color: var(--ink-3); margin-top: -2px; }
.topbar__spacer { flex: 1; }
.topbar__action { font-size: 13px; color: var(--brass); padding: 6px 2px; }

/* ---- 页头（品牌区）---- */
.pagehead {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 26px 20px 18px;
}
.pagehead__copy { min-width: 0; }
.pagehead__eyebrow {
  font-size: 11px; letter-spacing: 3px; color: var(--brass);
  text-transform: uppercase; margin-bottom: 8px;
}
.pagehead__title { font-family: var(--font-display); font-size: 27px; letter-spacing: 2px; margin: 0; }
.pagehead__desc { font-size: 13px; color: var(--ink-3); margin-top: 6px; }

/* ============ 签名元素：衣杆 + 吊牌 ============ */
/* 衣杆：细黄铜横线 + 两端挂钩，用于分区标题 */
.rail {
  position: relative;
  height: 1.5px;
  background: linear-gradient(90deg, transparent, var(--brass-soft) 12%, var(--brass-soft) 88%, transparent);
  margin: 0 20px 0;
}
.rail::before, .rail::after {
  content: ""; position: absolute; top: -3px;
  width: 7px; height: 7px; border-radius: 50%;
  border: 1.5px solid var(--brass-soft); background: var(--paper);
}
.rail::before { left: 10%; }
.rail::after { right: 10%; }

/* 吊牌：衣物卡片上的纸质标签 */
.hangtag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px 3px 7px;
  background: var(--brass-wash);
  border: 1px solid var(--oat-deep);
  border-radius: 3px 9px 9px 3px;
  font-size: 11px; color: #8a6d40;
  line-height: 1.4;
  position: relative;
}
.hangtag::before {
  content: ""; width: 4px; height: 4px; border-radius: 50%;
  background: var(--paper); border: 1px solid var(--oat-deep); flex: none;
}

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 15px; font-weight: 500;
  transition: transform .12s ease, opacity .16s ease, background .16s ease;
}
.btn:active { transform: scale(.975); }
.btn--primary { background: var(--ink); color: #fff; }
.btn--brass { background: var(--brass); color: #fff; }
.btn--ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn--soft { background: var(--mist); color: var(--ink-2); }
.btn--block { width: 100%; }
.btn--sm { padding: 9px 15px; font-size: 13px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn--danger { background: #fff; border: 1px solid #e4c9c1; color: var(--danger); }

/* ============ 卡片 / 表单 ============ */
.card {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
}

.field { margin-bottom: 15px; }
.field__label { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 7px; letter-spacing: .4px; }
.field__input {
  width: 100%; padding: 13px 15px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  outline: none;
  transition: border-color .16s ease;
}
.field__input:focus { border-color: var(--brass-soft); }
.field__input::placeholder { color: var(--ink-3); }
.field__hint { font-size: 11px; color: var(--ink-3); margin-top: 6px; }
textarea.field__input { resize: vertical; min-height: 96px; line-height: 1.65; }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* ============ 登录 / 注册 ============ */
.auth {
  min-height: 100vh;
  display: flex; flex-direction: column;
  padding: 0 26px 34px;
  background:
    radial-gradient(120% 62% at 78% 0%, #fff 0%, rgba(255,255,255,0) 58%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
}
.auth__hero { padding-top: 68px; flex: none; text-align: center; }
.auth__mark {
  width: 60px; height: 60px; margin: 0 auto 20px;
  border-radius: 50%;
  border: 1.5px solid var(--brass-soft);
  display: grid; place-items: center;
  background: #fff;
}
/* 品牌标记内部：衣架轮廓（黄铜细线） */
.auth__mark svg {
  width: 30px; height: 24px; display: block;
}
.auth__mark svg path {
  stroke: var(--brass);
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth__title { font-family: var(--font-display); font-size: 34px; letter-spacing: 6px; margin: 0; }
.auth__slogan { font-size: 13px; color: var(--ink-3); margin-top: 10px; letter-spacing: 1px; }

.auth__body { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 34px 0 0; }
.auth__tabs { display: flex; gap: 26px; margin-bottom: 22px; }
.auth__tab {
  font-size: 15px; color: var(--ink-3); padding: 4px 0;
  position: relative; letter-spacing: 1px;
}
.auth__tab.is-on { color: var(--ink); font-weight: 600; }
.auth__tab.is-on::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -5px;
  height: 2px; background: var(--brass); border-radius: 2px;
}
.auth__foot { text-align: center; font-size: 11px; color: var(--ink-3); margin-top: 20px; line-height: 1.7; }

/* ============ 底部导航 ============ */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: none;
  padding: 8px 8px calc(6px + var(--safe-b));
  background: rgba(251, 250, 248, .95);
  backdrop-filter: saturate(160%) blur(14px);
  border-top: 1px solid var(--line-soft);
}
.tabbar.is-visible { display: flex; }
.tabbar__item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0; font-size: 11px; color: var(--ink-3);
  transition: color .16s ease;
}
.tabbar__item.is-on { color: var(--ink); }
.tabbar__icon { width: 22px; height: 22px; display: block; }
.tabbar__item.is-on .tabbar__icon { stroke: var(--brass); }
.tabbar__icon { stroke: var(--ink-3); fill: none; stroke-width: 1.6; }

/* ============ 衣柜 ============ */
.chips {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 16px 20px 14px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 13px; color: var(--ink-2);
  white-space: nowrap;
  transition: all .16s ease;
}
.chip.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip__n { font-size: 11px; opacity: .6; margin-left: 3px; }

.grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 13px;
  padding: 6px 20px 20px;
}

.clothcard {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform .14s ease;
}
.clothcard:active { transform: scale(.985); }
.clothcard__figure {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--paper-2);
  overflow: hidden;
}
.clothcard__figure img { width: 100%; height: 100%; object-fit: cover; }
.clothcard__cat {
  position: absolute; top: 8px; left: 8px;
  padding: 3px 8px;
  background: rgba(255,255,255,.92);
  border-radius: 999px;
  font-size: 10px; color: var(--ink-2);
  letter-spacing: .5px;
}
.clothcard__body { padding: 10px 11px 12px; }
.clothcard__name {
  font-size: 13.5px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.clothcard__meta { font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.clothcard__tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.minitag {
  padding: 2px 7px;
  background: var(--paper-2);
  border-radius: 4px;
  font-size: 10px; color: var(--ink-2);
}

/* 悬浮拍照按钮 */
.fab {
  position: fixed; z-index: 45;
  left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 18px);
  display: none;
  align-items: center; gap: 8px;
  min-height: 48px; padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid rgba(168, 135, 90, .58);
  background: #18181b; color: #fff;
  font-size: 13px; font-weight: 600;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .14) inset,
    0 8px 26px rgba(24, 24, 27, .24);
  backdrop-filter: saturate(140%) blur(12px);
  transform: translateX(-50%);
  transition: transform .14s ease, box-shadow .18s ease, background .18s ease;
}
.fab.is-visible { display: inline-flex; }
.fab__icon {
  width: 19px; height: 19px;
  fill: none; stroke: var(--brass);
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.fab:active {
  background: #27272a;
  transform: translateX(-50%) scale(.96);
}

/* 试衣间入口固定在衣柜页头和搭配页顶栏，不遮挡页面内容。 */
.tryroom-entry {
  position: relative; flex: none;
  display: grid; place-items: center;
  border: 1px solid rgba(168, 135, 90, .52);
  border-radius: 50%;
  background: rgba(255, 255, 255, .94); color: var(--ink);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .9) inset,
    0 8px 22px rgba(92, 66, 42, .13);
  transition: transform .14s ease, border-color .18s ease, color .18s ease;
}
.tryroom-entry--wardrobe { width: 48px; height: 48px; }
.tryroom-entry--topbar { width: 36px; height: 36px; }
.tryroom-entry__icon {
  width: 21px; height: 21px;
  fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.tryroom-entry--topbar .tryroom-entry__icon { width: 18px; height: 18px; }
.tryroom-entry__count {
  position: absolute; top: -4px; right: -4px;
  min-width: 19px; height: 19px; padding: 0 4px;
  display: grid; place-items: center;
  border: 2px solid var(--paper);
  border-radius: 999px;
  background: var(--ink); color: #fff;
  font-size: 9px; font-weight: 700; line-height: 1;
}
.tryroom-entry.has-items {
  border-color: var(--brass);
  color: #805f3e;
}
.tryroom-entry:active { transform: scale(.95); }

/* ============ 空态 ============ */
.empty { padding: 62px 34px; text-align: center; }
.empty__art {
  width: 74px; height: 74px; margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--paper-2);
  border: 1px dashed var(--oat-deep);
  display: grid; place-items: center;
  font-size: 26px; color: var(--oat-deep);
}
.empty__title { font-family: var(--font-display); font-size: 18px; letter-spacing: 1px; }
.empty__desc { font-size: 13px; color: var(--ink-3); margin-top: 8px; line-height: 1.75; }
.empty__act { margin-top: 22px; }

/* ============ 上传 ============ */
.uploader { padding: 18px 20px 0; }
.dropzone {
  position: relative;
  border: 1.5px dashed var(--oat-deep);
  border-radius: var(--r-lg);
  background: var(--brass-wash);
  padding: 40px 20px;
  text-align: center;
  overflow: hidden;
}
.dropzone__icon { font-size: 30px; color: var(--brass); }
.dropzone__title { font-size: 15px; margin-top: 12px; font-weight: 500; }
.dropzone__desc { font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.dropzone input[type=file] {
  position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%;
}
.preview {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper-2);
}
.preview img { width: 100%; max-height: 340px; object-fit: contain; }
.preview__change {
  position: absolute; right: 10px; bottom: 10px;
  padding: 7px 14px; border-radius: 999px;
  background: rgba(46,45,42,.82); color: #fff; font-size: 12px;
}

/* AI 识别结果 */
.airesult { padding: 16px 20px 0; }
.airesult__head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.airesult__badge {
  padding: 3px 9px; border-radius: 999px;
  background: var(--brass-wash); border: 1px solid var(--oat-deep);
  font-size: 11px; color: #8a6d40;
}
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); }
.kv:last-child { border-bottom: none; }
.kv__k { font-size: 12.5px; color: var(--ink-3); flex: none; }
.kv__v { font-size: 13px; text-align: right; }
.notice {
  padding: 11px 14px;
  border-radius: var(--r-md);
  background: #fdf6ec;
  border: 1px solid #f0dfc0;
  font-size: 12.5px; color: #8a6d40;
  line-height: 1.65;
}

/* ============ 单品只读详情 ============ */
.item-hero {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 8px;
  background: var(--paper-2);
  border: 1px solid var(--line);
}
.item-hero img { width: 100%; height: 100%; object-fit: contain; }
.item-hero__group {
  position: absolute; left: 10px; bottom: 10px;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(24, 24, 27, .88); color: #fff;
  font-size: 11px;
}
.item-heading {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 17px 1px 12px;
}
.item-heading h3 { margin: 0; font-size: 20px; line-height: 1.35; }
.item-heading span { flex: none; font-size: 10.5px; color: var(--ink-3); }
.detail-tags {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
}
.detail-tag {
  min-width: 0; min-height: 64px;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 10px 11px;
  border-radius: 8px;
  border: 1px solid transparent;
}
.detail-tag__label { font-size: 10px; opacity: .64; }
.detail-tag strong {
  overflow-wrap: anywhere;
  font-size: 14px; line-height: 1.35;
}
.detail-tag--cyan { background: #dffaf8; border-color: #a9eee9; color: #075e5a; }
.detail-tag--coral { background: #fff0eb; border-color: #ffd1c2; color: #91462f; }
.detail-tag--blue { background: #eaf2ff; border-color: #c8dcff; color: #315d9b; }
.detail-tag--gold { background: #fff7df; border-color: #efdca0; color: #80651d; }
.detail-tag--green { background: #eaf7ed; border-color: #c8e7ce; color: #356940; }
.detail-tag--violet { background: #f4efff; border-color: #ded0fa; color: #674b98; }
.detail-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.detail-chip {
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11px;
  background: #f0f0f0;
}
.detail-chip--0 { background: #18181b; color: #fff; }
.detail-chip--1 { background: #dffaf8; color: #075e5a; }
.detail-chip--2 { background: #fff0eb; color: #91462f; }
.detail-chip--3 { background: #eaf2ff; color: #315d9b; }
.detail-chip--4 { background: #fff7df; color: #80651d; }
.item-description {
  margin-top: 14px; padding: 13px 14px;
  border-left: 3px solid #35e4dc;
  background: #fff;
  font-size: 13px; line-height: 1.75; color: var(--ink-2);
}
.item-usage { padding: 12px 2px 0; font-size: 11.5px; color: var(--ink-3); }
.item-actions { display: grid; grid-template-columns: 1fr 1.35fr; gap: 9px; padding: 14px 0 24px; }
.item-actions .btn { min-width: 0; padding-inline: 12px; border-radius: 8px; }
.btn--tryroom { background: #18181b; color: #fff; }
.btn--tryroom.is-added { background: #35e4dc; color: #102b2a; }

/* ============ 自主试衣间 ============ */
#page-tryroom {
  position: relative;
  min-height: 100vh;
  overflow-x: clip;
  padding-bottom: calc(86px + var(--safe-b));
  background: var(--paper);
}
.tryroom-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  margin: 12px 20px 4px; padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--paper-2);
}
.tryroom-tab {
  min-height: 38px;
  border-radius: 6px;
  color: var(--ink-2);
  font-size: 13px; font-weight: 500;
}
.tryroom-tab.is-on {
  background: #fff; color: var(--ink);
  box-shadow: 0 1px 3px rgba(46, 45, 42, .09);
}
.tryroom-panel { display: none; }
.tryroom-panel.is-on { display: block; }
.tryroom-list {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px;
  padding: 12px 20px 20px;
}
.tryroom-item {
  position: relative; overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  box-shadow: var(--shadow-card);
}
.tryroom-item img {
  width: 100%; aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--paper-2);
}
.tryroom-item__index {
  position: absolute; left: 7px; top: 7px; z-index: 1;
  min-width: 23px; height: 23px; padding: 0 5px;
  display: grid; place-items: center;
  border-radius: 5px;
  background: rgba(24, 24, 27, .8);
  color: #fff;
  font-family: var(--font-display); font-size: 10px;
  backdrop-filter: blur(5px);
}
.tryroom-item__body { min-width: 0; padding: 9px 10px 11px; display: flex; flex-direction: column; gap: 2px; }
.tryroom-item__body strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.tryroom-item__body span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9.5px; color: var(--ink-3); }
.tryroom-item__remove {
  position: absolute; top: 7px; right: 7px;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: #fff; background: rgba(24, 24, 27, .74);
  font-size: 17px; line-height: 1;
  backdrop-filter: blur(5px);
}
.tryroom-item__remove:active { transform: scale(.9); }
.tryroom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 38;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 68px;
  padding: 10px 20px calc(10px + var(--safe-b));
  background: rgba(251, 250, 248, .96);
  border-top: 1px solid var(--line-soft);
  backdrop-filter: blur(12px);
}
.tryroom-bar[hidden] { display: none; }
.tryroom-bar__count { font-size: 12px; color: var(--ink-2); }
.tryroom-bar__count strong { color: var(--ink); font-size: 20px; margin-right: 3px; }
.tryroom-bar .btn {
  min-width: 148px; border-radius: 8px; padding: 11px 18px;
  background: var(--ink);
}
.tryroom-history-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 10px;
  padding: 10px 20px 22px;
}
.record-filters {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 12px 20px 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.record-filters::-webkit-scrollbar { display: none; }
.record-filter {
  min-height: 30px;
  flex: none;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-2);
  font-size: 11px;
  white-space: nowrap;
}
.record-filter.is-on {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}
.tryroom-history-tile {
  width: 100%;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-card);
  cursor: pointer;
}
.tryroom-history-tile:active { transform: scale(.985); }
.tryroom-history-tile__image {
  width: 100%;
  padding: 0;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--paper-2);
  cursor: pointer;
}
.tryroom-history-tile__image img { width: 100%; height: 100%; object-fit: cover; }
.tryroom-history-tile__body { padding: 8px 9px 9px; }
.record-title-row {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.record-heart {
  width: 25px; height: 25px;
  flex: none;
  display: grid; place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink-3);
  box-shadow: 0 1px 2px rgba(46, 45, 42, .05);
}
.record-heart svg {
  width: 13px; height: 13px;
  fill: transparent;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.record-heart.is-on {
  border-color: #e5a9af;
  color: #c84f5d;
}
.record-heart.is-on svg { fill: currentColor; }
.record-heart:disabled { opacity: .55; }
.tryroom-history-tile__title {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px; font-weight: 600; line-height: 1.4;
}
.tryroom-history-tile__meta {
  display: block;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-top: 5px;
  color: var(--ink-3); font-size: 9px;
}
.tryroom-history-tile[hidden] { display: none; }

/* ============ 搭配对话 ============ */
.chat {
  display: flex; flex-direction: column;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + var(--safe-b) + 96px);
}
.chat__stream { flex: 1; padding: 14px 20px 8px; }

.bubble { max-width: 84%; margin-bottom: 16px; }
.bubble--me { margin-left: auto; }
.bubble__text {
  padding: 11px 15px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.68;
  white-space: pre-wrap;
  word-break: break-word;
}
.bubble--me .bubble__text { background: var(--ink); color: #fff; border-bottom-right-radius: 5px; }
.bubble--ai .bubble__text { background: #fff; border: 1px solid var(--line-soft); border-bottom-left-radius: 5px; }
.bubble__voice {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; color: rgba(255,255,255,.7); margin-bottom: 4px;
}
.bubble--me .bubble__voice { justify-content: flex-end; }

/* 套装卡片：纵向排列 */
.outfits { margin-top: 12px; display: flex; flex-direction: column; gap: 14px; }
.outfit {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.outfit__top {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 14px 15px 11px;
}
.outfit__idx {
  font-family: var(--font-display);
  font-size: 24px; line-height: 1;
  color: var(--oat-deep);
  flex: none; width: 30px;
}
.outfit__titlewrap { flex: 1; min-width: 0; }
.outfit__title { font-size: 15px; font-weight: 600; letter-spacing: .3px; }
.outfit__style { font-size: 11px; color: var(--brass); margin-top: 3px; }
.outfit__items {
  display: flex; gap: 9px; overflow-x: auto;
  padding: 0 15px 12px;
  scrollbar-width: none;
}
.outfit__items::-webkit-scrollbar { display: none; }
.oitem { flex: none; width: 68px; text-align: center; }
.oitem__fig {
  width: 68px; height: 68px;
  border-radius: 9px;
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
}
.oitem__fig img { width: 100%; height: 100%; object-fit: cover; }
.oitem__cat { font-size: 10px; color: var(--ink-3); margin-top: 5px; }
.oitem__name {
  font-size: 10.5px; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.outfit__reason {
  margin: 0 15px 13px;
  padding: 10px 12px;
  background: var(--paper-2);
  border-radius: var(--r-sm);
  font-size: 12.5px; color: var(--ink-2);
  line-height: 1.7;
}
.outfit__acts {
  display: flex; gap: 9px;
  padding: 0 15px 15px;
}
.outfit__acts .btn { flex: 1; }
.outfit__adopted {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--brass);
}

/* 输入区：语音优先 */
.composer {
  position: fixed; left: 0; right: 0;
  bottom: calc(var(--nav-h) + var(--safe-b));
  z-index: 35;
  display: none;
  padding: 11px 16px 13px;
  background: rgba(251,250,248,.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line-soft);
}
.composer.is-visible { display: block; }
.composer__row { display: flex; align-items: center; gap: 10px; }
.composer__mic {
  width: 50px; height: 50px; flex: none;
  border-radius: 50%;
  background: var(--ink); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(46,45,42,.2);
  transition: all .18s ease;
  touch-action: none;
  user-select: none;
}
.composer__mic.is-rec {
  background: var(--danger);
  animation: micPulse 1.15s ease-in-out infinite;
}
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(180,85,63,.4); }
  50% { box-shadow: 0 0 0 11px rgba(180,85,63,0); }
}
.composer__mic svg { width: 21px; height: 21px; stroke: #fff; fill: none; stroke-width: 1.7; }
.composer__input {
  flex: 1;
  padding: 13px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  outline: none;
}
.composer__input:focus { border-color: var(--brass-soft); }
.composer__send {
  width: 46px; height: 46px; flex: none;
  border-radius: 50%;
  background: var(--brass); color: #fff;
  display: grid; place-items: center;
}
.composer__send[disabled] { opacity: .35; }
.composer__tip { font-size: 11px; color: var(--ink-3); text-align: center; margin-top: 8px; }
.composer__tip.is-rec { color: var(--danger); }

.quickrow { display: flex; gap: 7px; overflow-x: auto; padding: 0 0 10px; scrollbar-width: none; }
.quickrow::-webkit-scrollbar { display: none; }
.quick {
  flex: none; padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 12px; color: var(--ink-2);
  white-space: nowrap;
}

/* 加载中的三点 */
.typing { display: inline-flex; gap: 4px; align-items: center; padding: 4px 0; }
.typing i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--oat-deep);
  animation: typing 1.1s ease-in-out infinite;
}
.typing i:nth-child(2) { animation-delay: .16s; }
.typing i:nth-child(3) { animation-delay: .32s; }
@keyframes typing {
  0%, 100% { opacity: .3; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

/* ============ 异步试穿：等待态（AI 消息内） ============ */
/* 任务气泡占满可用宽度，方便展示合成大图 */
.bubble--task { max-width: 100%; }
.trywait {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: 16px;
  box-shadow: var(--shadow-card);
}
.trywait__main { display: flex; align-items: center; gap: 12px; }
.trywait__main .spinner {
  width: 30px; height: 30px; margin: 0; flex: none;
  border-width: 2px;
}
.trywait__t { font-size: 14px; font-weight: 600; }
.trywait__s { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.6; }
.trywait__list {
  margin-top: 13px; padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 9px;
}
.trywait__item {
  display: flex; align-items: center; gap: 9px;
  font-size: 12.5px; color: var(--ink-2);
}
/* 等待清单左侧的呼吸圆点 */
.trywait__dot {
  width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--brass-soft);
  animation: waitPulse 1.2s ease-in-out infinite;
}
@keyframes waitPulse {
  0%, 100% { opacity: .35; transform: scale(.85); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* ============ 异步试穿：合成结果卡片 ============ */
.trycards { margin-top: 12px; display: flex; flex-direction: column; gap: 14px; }
.trycard {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.trycard__img {
  width: min(70%, 248px);
  aspect-ratio: 3 / 4;
  margin: 14px auto 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--paper-2);
  cursor: zoom-in;
  /* 合成图淡入，减少轮询刷新的突兀感 */
  animation: cardFade .35s ease;
}
@keyframes cardFade { from { opacity: .35; } to { opacity: 1; } }
.trycard__img img {
  width: 100%; height: 100%;
  object-fit: contain;
}
.trycard__body { padding: 13px 14px 14px; }
.trycard__title { font-size: 14.5px; font-weight: 600; letter-spacing: .3px; }
.trycard__scene { font-size: 11.5px; color: var(--brass); margin-top: 3px; }
.trycard__items { padding: 10px 0 0; }
.trycard__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.trycard__tip { font-size: 11px; color: var(--ink-3); line-height: 1.5; }

/* 失败卡片 */
.trycard--fail {
  padding: 24px 16px;
  text-align: center;
  background: #fdf8f6;
  border-color: #ecd8d1;
}
.trycard__failart {
  width: 40px; height: 40px; margin: 0 auto 10px;
  border-radius: 50%;
  background: #f3e2dd; color: var(--danger);
  display: grid; place-items: center;
  font-size: 20px; font-weight: 600;
}
.trycard__failt { font-size: 13.5px; font-weight: 500; }
.trycard__fails { font-size: 11.5px; color: var(--ink-3); margin: 5px 0 13px; line-height: 1.6; }
.trycard--fail .btn { margin: 0 auto; }

/* 一键全部试穿按钮 */
.tryall-btn { margin-top: 0; }

/* ============ 我的 ============ */
.mehead {
  display: flex; align-items: center; gap: 14px;
  padding: 24px 20px 20px;
}
.avatar {
  width: 58px; height: 58px; flex: none;
  border-radius: 50%;
  background: var(--oat);
  border: 1px solid var(--oat-deep);
  overflow: hidden;
  display: grid; place-items: center;
  font-family: var(--font-display);
  font-size: 21px; color: #8a6d40;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.mehead__name { font-family: var(--font-display); font-size: 21px; letter-spacing: 1px; }
.mehead__phone { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

.stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin: 0 20px 18px;
  padding: 16px 0;
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
}
.stat { text-align: center; position: relative; }
.stat + .stat::before {
  content: ""; position: absolute; left: 0; top: 12%; height: 76%;
  width: 1px; background: var(--line-soft);
}
.stat__n { font-family: var(--font-display); font-size: 22px; line-height: 1.2; }
.stat__l { font-size: 11px; color: var(--ink-3); margin-top: 3px; }

.menu { margin: 0 20px 16px; background: #fff; border: 1px solid var(--line-soft); border-radius: var(--r-lg); overflow: hidden; }
.menu__item {
  display: flex; align-items: center; gap: 12px;
  width: 100%;
  padding: 15px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
}
.menu__item:last-child { border-bottom: none; }
.menu__item:active { background: var(--paper-2); }
.menu__ico {
  width: 34px; height: 34px; flex: none;
  border-radius: 10px;
  background: var(--brass-wash);
  display: grid; place-items: center;
  font-size: 15px;
}
.menu__ico svg {
  width: 19px; height: 19px;
  fill: none;
  stroke: var(--brass);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.menu__body { flex: 1; min-width: 0; }
.menu__t { font-size: 14.5px; }
.menu__d { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.menu__arrow { color: var(--ink-3); font-size: 15px; flex: none; }
.menu__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); flex: none;
}

/* ============ 偏好画像 ============ */
.portrait-slot {
  display: flex; align-items: center; gap: 14px;
  padding: 15px;
}
.portrait-slot__fig {
  width: 84px; height: 112px; flex: none;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--paper-2);
  border: 1px dashed var(--oat-deep);
  display: grid; place-items: center;
  position: relative;
  font-size: 11px; color: var(--ink-3); text-align: center;
}
.portrait-slot__fig img { width: 100%; height: 100%; object-fit: cover; }
.portrait-slot__fig input[type=file] { position: absolute; inset: 0; opacity: 0; }
.portrait-slot__body { flex: 1; min-width: 0; }

.tagcloud { display: flex; flex-wrap: wrap; gap: 8px; }
.wtag {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--brass-wash);
  border: 1px solid var(--oat-deep);
  font-size: 12.5px; color: #7d6236;
}
.wtag__w { font-size: 10px; opacity: .65; }
.wtag--plain { background: var(--paper-2); border-color: var(--line); color: var(--ink-2); }

.summary-box {
  padding: 15px;
  background: var(--paper-2);
  border-radius: var(--r-md);
  font-size: 13.5px;
  line-height: 1.85;
  color: var(--ink-2);
}

.section-title {
  display: flex; align-items: center; gap: 8px;
  padding: 22px 20px 10px;
}
.section-title__t { font-family: var(--font-display); font-size: 16px; letter-spacing: 1px; }
.section-title__d { font-size: 11.5px; color: var(--ink-3); }

/* ============ 试穿弹层 ============ */
.sheet {
  position: fixed; inset: 0; z-index: 60;
  display: none;
}
.sheet.is-open { display: block; }
.sheet__mask {
  position: absolute; inset: 0;
  background: rgba(30, 29, 27, .5);
  backdrop-filter: blur(3px);
  animation: fadeIn .22s ease;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.sheet__panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 92vh;
  display: flex; flex-direction: column;
  background: var(--paper);
  border-radius: 22px 22px 0 0;
  animation: sheetUp .3s cubic-bezier(.22,.61,.36,1);
  padding-bottom: var(--safe-b);
}
@keyframes sheetUp { from { transform: translateY(100%) } to { transform: none } }
.sheet__bar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--line-soft);
  flex: none;
}
.sheet__title { font-family: var(--font-display); font-size: 17px; letter-spacing: 1px; flex: 1; }
.sheet__close { font-size: 21px; color: var(--ink-3); padding: 0 4px; line-height: 1; }
.sheet__scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 18px 20px; }
.sheet__foot { flex: none; padding: 12px 18px 16px; border-top: 1px solid var(--line-soft); display: flex; gap: 10px; }
.sheet__foot .btn { flex: 1; }

.tryon-img {
  width: min(74%, 280px);
  margin: 14px auto 0;
  padding: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  cursor: zoom-in;
}
.tryon-img img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
}
.tryon-loading { padding: 60px 20px; text-align: center; }
.spinner {
  width: 34px; height: 34px; margin: 0 auto 16px;
  border: 2px solid var(--line);
  border-top-color: var(--brass);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

/* ============ 试穿详情与大图预览 ============ */
.tryon-detail { padding: 14px 18px calc(28px + var(--safe-b)); }
.tryon-detail__figure {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #e9e9e7;
  box-shadow: 0 18px 44px rgba(22, 22, 24, .12);
  cursor: zoom-in;
}
.tryon-detail__figure img {
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
}
.tryon-detail__zoom {
  position: absolute; right: 10px; bottom: 10px;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(24, 24, 27, .72);
  backdrop-filter: blur(8px);
}
.tryon-detail__zoom svg,
.tryon-detail__actions svg,
.image-viewer__download svg {
  width: 18px; height: 18px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.tryon-detail__heading { padding: 18px 2px 12px; }
.tryon-detail__heading h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0;
}
.tryon-detail__meta { margin-top: 4px; color: var(--ink-3); font-size: 11.5px; }
.tryon-detail__reason {
  padding: 12px 14px;
  border-left: 3px solid #35e4dc;
  background: #fff;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.7;
}
.tryon-detail__section-title {
  margin: 18px 0 9px;
  font-size: 11px;
  color: var(--ink-3);
}
.tryon-detail__items {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.tryon-detail__item {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: #fff;
  text-align: left;
}
.tryon-detail__item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--paper-2);
}
.tryon-detail__item span {
  display: block;
  overflow: hidden;
  padding: 6px 7px 7px;
  color: var(--ink-2);
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tryon-detail__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 18px;
}
.tryon-detail__actions .btn { min-width: 0; border-radius: 8px; padding: 11px 12px; font-size: 13px; }

body.has-image-viewer { overflow: hidden; }
.image-viewer[hidden] { display: none; }
.image-viewer {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center;
  padding: max(48px, env(safe-area-inset-top)) 14px max(28px, env(safe-area-inset-bottom));
}
.image-viewer__mask {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  background: rgba(10, 10, 12, .94);
}
.image-viewer__stage {
  position: relative;
  z-index: 1;
  width: min(100%, 720px);
  max-height: 100%;
  display: grid;
  place-items: center;
}
.image-viewer__stage img {
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 132px);
  object-fit: contain;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .4);
}
.image-viewer__close {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, calc((100vw - 720px) / 2));
  z-index: 2;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 25px;
  backdrop-filter: blur(10px);
}
.image-viewer__download {
  min-width: 132px;
  margin-top: 14px;
  padding: 10px 15px;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 8px;
  background: #fff;
  color: #18181b;
  font-size: 13px;
}

/* ============ Toast ============ */
.toast {
  position: fixed; left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(.94);
  z-index: 80;
  max-width: 78vw;
  padding: 13px 20px;
  background: rgba(38, 37, 35, .93);
  color: #fff;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.6;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.toast.is-show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* 全屏加载 */
.loading-mask {
  position: fixed; inset: 0; z-index: 70;
  display: none;
  place-items: center;
  background: rgba(251, 250, 248, .74);
  backdrop-filter: blur(2px);
}
.loading-mask.is-on { display: grid; }

/* 骨架屏 */
.skeleton { padding: 6px 20px 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.sk {
  border-radius: var(--r-md);
  background: linear-gradient(90deg, var(--paper-2) 25%, var(--mist) 37%, var(--paper-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease-in-out infinite;
}
.sk--card { aspect-ratio: 3 / 4; }
@keyframes shimmer { 0% { background-position: 100% 0 } 100% { background-position: 0 0 } }

/* 可访问性：尊重减少动效 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* 焦点可见 */
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

/* 大屏居中（H5 在桌面浏览器预览时） */
@media (min-width: 600px) {
  #app {
    max-width: 430px;
    margin: 0 auto;
    box-shadow: 0 0 0 1px var(--line-soft);
    min-height: 100vh;
    background: var(--paper);
  }
  .tabbar, .composer, .tryroom-bar { max-width: 430px; margin: 0 auto; }
  .tabbar, .composer { left: 50%; right: auto; transform: translateX(-50%); width: 100%; }
  .tryroom-bar { left: 50%; right: auto; transform: translateX(-50%); width: 100%; }
  .sheet__panel { max-width: 430px; left: 50%; transform: translateX(-50%); right: auto; width: 100%; }
  @keyframes sheetUp {
    from { transform: translateX(-50%) translateY(100%) }
    to { transform: translateX(-50%) }
  }
}
