/* ============================================================================
   衣橱 · 设计系统 v6「编辑部」
   方向：时装杂志编辑部。近黑白，超大衬线标题，干净无衬线正文，
   编号 / 栏目 / 页码当版面元素。颜色只给衣服本身，界面只留一个信号色。
   规范说明见 REDESIGN.md
   ============================================================================ */

/* ---------- 1. 字体与尺度（与主题无关） ---------- */
:root {
  --f-serif: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif CJK SC", "Noto Serif SC", "SimSun", serif;
  --f-display: "Didot", "Bodoni 72", "Bodoni MT", "Playfair Display", "Times New Roman", var(--f-serif);
  --f-sans: "SF Pro Text", "Helvetica Neue", Inter, Arial, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --f-num: "SF Pro Display", "Helvetica Neue", Inter, Arial, "PingFang SC", sans-serif;

  /* 字号阶梯：hero / h1 / h2 / h3 / body / small / micro */
  --t-hero: clamp(46px, 13.5vw, 84px);
  --t-h1: clamp(32px, 8.6vw, 44px);
  --t-h2: 23px;
  --t-h3: 17px;
  --t-body: 15px;
  --t-small: 13px;
  --t-micro: 11px;
  --t-num: clamp(88px, 26vw, 132px);

  /* 4 的倍数间距 */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px;
  --gutter: 20px;

  --nav-h: 64px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);

  --ease: cubic-bezier(.2, .7, .1, 1);
  --ease-sheet: cubic-bezier(.32, .72, 0, 1);
  --spring: cubic-bezier(.34, 1.4, .64, 1);
  --dur: 260ms;

  color-scheme: light;
}

/* ---------- 2. 主题 ----------
   不只换底色：每套主题同时改圆角、标题字重/字距、图片底托与信号色。
   atelier 编辑部（默认，锐利）/ noir 夜刊（黑底，信号橙红）/ linen 亚麻（静奢，圆润） */
:root, [data-theme="atelier"] {
  --bg: #f6f6f3;
  --bg-2: #ffffff;
  --bg-3: #ededea;
  --plate: #ecebe7;
  --plate-2: #e3e2dd;
  --ink: #0d0d0c;
  --ink-2: #57564f;
  --ink-3: #9a9891;
  --line: rgba(13, 13, 12, .14);
  --line-2: rgba(13, 13, 12, .07);
  --accent: #e2391b;
  --accent-ink: #ffffff;
  --ok: #1d7a4b;
  --scrim: rgba(12, 12, 10, .42);
  --glass: rgba(246, 246, 243, .82);
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 12px 40px rgba(0, 0, 0, .08);

  --r-btn: 2px;
  --r-chip: 999px;
  --r-card: 0px;
  --r-plate: 0px;
  --r-sheet: 18px;
  --r-field: 2px;
  --display-weight: 700;
  --display-track: -.035em;
  --kicker-color: var(--ink);
  --index-color: var(--ink-3);
}

[data-theme="noir"] {
  color-scheme: dark;
  --bg: #0b0b0b;
  --bg-2: #151514;
  --bg-3: #1d1d1b;
  --plate: #1c1c1a;
  --plate-2: #252522;
  --ink: #f3f1ec;
  --ink-2: #a7a39b;
  --ink-3: #6c6963;
  --line: rgba(243, 241, 236, .16);
  --line-2: rgba(243, 241, 236, .08);
  --accent: #ff5a32;
  --accent-ink: #0b0b0b;
  --ok: #5fd39a;
  --scrim: rgba(0, 0, 0, .62);
  --glass: rgba(11, 11, 11, .78);
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 60px rgba(0, 0, 0, .5);

  --r-btn: 0px;
  --r-chip: 0px;
  --r-card: 0px;
  --r-plate: 0px;
  --r-sheet: 0px;
  --r-field: 0px;
  --display-weight: 400;
  --display-track: -.02em;
  --kicker-color: var(--accent);
  --index-color: var(--accent);
}

[data-theme="linen"] {
  --bg: #e9e4da;
  --bg-2: #f4f0e9;
  --bg-3: #ded8cc;
  --plate: #ddd6c9;
  --plate-2: #d3cbbd;
  --ink: #24201b;
  --ink-2: #6a6359;
  --ink-3: #9b9387;
  --line: rgba(36, 32, 27, .15);
  --line-2: rgba(36, 32, 27, .07);
  --accent: #6d2b1f;
  --accent-ink: #f4f0e9;
  --ok: #4c6b3c;
  --scrim: rgba(36, 32, 27, .38);
  --glass: rgba(233, 228, 218, .84);
  --shadow: 0 1px 2px rgba(36, 32, 27, .05), 0 16px 44px rgba(36, 32, 27, .10);

  --r-btn: 999px;
  --r-chip: 999px;
  --r-card: 20px;
  --r-plate: 20px;
  --r-sheet: 28px;
  --r-field: 14px;
  --display-weight: 400;
  --display-track: -.01em;
  --kicker-color: var(--ink-2);
  --index-color: var(--ink-3);
}

/* ---------- 3. 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
html.theming, html.theming * { transition: background-color .45s var(--ease), color .45s var(--ease), border-color .45s var(--ease) !important; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 var(--t-body)/1.6 var(--f-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
body.locked { overflow: hidden; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
::selection { background: var(--ink); color: var(--bg); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 22px; height: 22px; flex: 0 0 auto; display: block; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 18px; height: 18px; }
.ico.lg { width: 28px; height: 28px; }
.ico .fill { fill: currentColor; stroke: none; }

/* 主题切换的圆形揭开（View Transitions） */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* ---------- 4. 排版元件 ---------- */
.kicker {
  font: 600 var(--t-micro)/1 var(--f-sans);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--kicker-color);
  display: flex; align-items: center; gap: var(--s2);
}
.kicker .no { font-family: var(--f-display); font-style: italic; font-weight: 400; letter-spacing: 0; text-transform: none; font-size: 13px; }
.kicker .rule { flex: 1; height: 1px; background: var(--line); }
.hero-title {
  margin: 0;
  font: var(--display-weight) var(--t-hero)/1.02 var(--f-serif);
  letter-spacing: var(--display-track);
}
.h1 { margin: 0; font: var(--display-weight) var(--t-h1)/1.1 var(--f-serif); letter-spacing: var(--display-track); }
.h2 { margin: 0; font: var(--display-weight) var(--t-h2)/1.25 var(--f-serif); letter-spacing: -.01em; }
.h3 { margin: 0; font: 600 var(--t-h3)/1.35 var(--f-sans); letter-spacing: -.005em; }
.lede { margin: 0; font: 400 var(--t-body)/1.65 var(--f-sans); color: var(--ink-2); max-width: 34em; }
.small { font-size: var(--t-small); line-height: 1.5; color: var(--ink-2); }
.micro { font-size: var(--t-micro); line-height: 1.4; letter-spacing: .06em; color: var(--ink-3); }
.num { font-family: var(--f-num); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.serif { font-family: var(--f-serif); }
.italic-num { font-family: var(--f-display); font-style: italic; }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.accent { color: var(--accent); }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

.sec { margin-top: var(--s12); }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); padding-bottom: var(--s3); border-bottom: 1px solid var(--ink); margin-bottom: var(--s5); }
.sec-head .h2 { display: flex; align-items: baseline; gap: var(--s3); }
.sec-head .idx { font: italic 400 15px/1 var(--f-display); color: var(--index-color); }
.sec-head .link { font-size: var(--t-small); color: var(--ink-2); display: inline-flex; align-items: center; gap: 2px; min-height: 44px; }

/* ---------- 5. 按钮系统 ----------
   .btn 基础 + 变体 primary / secondary / ghost / danger / icon
   尺寸：默认 48，.sm 40（触控区靠 ::before 外扩到 44），.lg 56
   状态：:active 按下 / :disabled 禁用 / [aria-busy="true"] 加载 */
.btn {
  --h: 48px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  height: var(--h); min-width: var(--h);
  padding: 0 var(--s5);
  border-radius: var(--r-btn);
  font: 600 15px/1 var(--f-sans);
  letter-spacing: .01em;
  white-space: nowrap;
  user-select: none;
  transition: transform 160ms var(--ease), opacity 160ms var(--ease), background-color 200ms, color 200ms, box-shadow 200ms;
  touch-action: manipulation;
}
.btn::before { content: ""; position: absolute; inset: min(0px, calc((var(--h) - 44px) / 2)); }
.btn:active:not(:disabled) { transform: scale(.965); }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn .ico { width: 20px; height: 20px; }
.btn.sm { --h: 40px; padding: 0 var(--s4); font-size: 14px; }
.btn.sm .ico { width: 18px; height: 18px; }
.btn.lg { --h: 56px; padding: 0 var(--s6); font-size: 16px; }
.btn.block { width: 100%; }

.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover:not(:disabled) { opacity: .9; }
.btn-secondary { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.btn-secondary:hover:not(:disabled) { background: var(--line-2); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover:not(:disabled) { background: var(--line-2); }
.btn-danger { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1px currentColor; }
.btn-danger.solid { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.btn-accent { background: var(--accent); color: var(--accent-ink); }

.btn-icon { --h: 44px; padding: 0; width: var(--h); flex: 0 0 auto; border-radius: 999px; color: var(--ink); background: transparent; }
.btn-icon:hover:not(:disabled) { background: var(--line-2); }
.btn-icon.filled { background: var(--ink); color: var(--bg); }
.btn-icon.outline { box-shadow: inset 0 0 0 1px var(--line); }
.btn-icon.on { color: var(--accent); }

.btn[aria-busy="true"] { color: transparent !important; pointer-events: none; }
.btn[aria-busy="true"] > * { opacity: 0; }
.btn[aria-busy="true"]::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  color: var(--bg); animation: spin .7s linear infinite;
}
.btn-secondary[aria-busy="true"]::after, .btn-ghost[aria-busy="true"]::after, .btn-icon[aria-busy="true"]::after { color: var(--ink); }
.btn-danger[aria-busy="true"]::after { color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }

.btn-row { display: flex; gap: var(--s2); }
.btn-row > .btn { flex: 1; }
.btn-row > .btn-icon, .btn-row > .btn.fit { flex: 0 0 auto; }

/* 文字链按钮 */
.tlink { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-size: var(--t-small); color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

/* ---------- 6. 筛选胶囊 / 分段 ---------- */
.chips { display: flex; gap: var(--s2); overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 2px var(--gutter); scroll-padding: var(--gutter); }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
.chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px; position: relative;
  border-radius: var(--r-chip);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 14px; color: var(--ink-2);
  transition: background-color 200ms, color 200ms, box-shadow 200ms, transform 160ms var(--ease);
}
.chip::before { content: ""; position: absolute; inset: -4px 0; }
.chip:active { transform: scale(.96); }
.chip .n { font-family: var(--f-num); font-size: 11px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.chip.on { background: var(--ink); color: var(--bg); box-shadow: none; }
.chip.on .n { color: inherit; opacity: .6; }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line); }

.seg { display: flex; padding: 3px; gap: 2px; border-radius: calc(var(--r-btn) + 3px); background: var(--bg-3); }
.seg button { flex: 1; height: 38px; border-radius: var(--r-btn); font-size: 14px; color: var(--ink-2); transition: background-color 200ms, color 200ms; position: relative; }
.seg button::before { content: ""; position: absolute; inset: -3px 0; }
.seg button.on { background: var(--bg-2); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
[data-theme="noir"] .seg button.on { background: var(--ink); color: var(--bg); }

.tabs-u { display: flex; gap: var(--s5); border-bottom: 1px solid var(--line); }
.tabs-u button { height: 44px; font-size: 15px; color: var(--ink-3); position: relative; }
.tabs-u button.on { color: var(--ink); font-weight: 600; }
.tabs-u button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); }

/* ---------- 7. 表单 ---------- */
.field { display: block; margin-bottom: var(--s4); }
.field > .lbl { display: block; font: 600 var(--t-micro)/1 var(--f-sans); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: var(--s2); }
.input, .select, .textarea {
  width: 100%; height: 52px; padding: 0 var(--s4);
  background: var(--bg-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-field);
  font-size: 16px; outline: none; appearance: none; -webkit-appearance: none;
  transition: border-color 200ms, box-shadow 200ms;
}
.textarea { height: auto; min-height: 96px; padding: 14px var(--s4); line-height: 1.55; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px var(--line-2); }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.select { background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(-45deg, transparent 50%, var(--ink-2) 50%); background-size: 5px 5px; background-position: calc(100% - 22px) 23px, calc(100% - 17px) 23px; background-repeat: no-repeat; padding-right: 40px; }
.input-row { display: flex; gap: var(--s2); }
.input-row .input { flex: 1; }
.searchbox { position: relative; }
.searchbox .ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.searchbox .input { padding-left: 44px; height: 46px; background: var(--bg-3); border-color: transparent; }
.searchbox .input:focus { background: var(--bg-2); }
.searchbox .clear { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); }
.name-input {
  width: 100%; border: 0; background: transparent; outline: none; padding: 0;
  font: var(--display-weight) var(--t-h1)/1.15 var(--f-serif); letter-spacing: var(--display-track); color: var(--ink);
  border-bottom: 1px dashed transparent;
}
.name-input:focus { border-bottom-color: var(--line); }
.scale { display: flex; gap: 4px; }
.scale button { flex: 1; height: 40px; border-radius: var(--r-btn); box-shadow: inset 0 0 0 1px var(--line); font: 500 14px/1 var(--f-num); color: var(--ink-2); }
.scale button.on { background: var(--ink); color: var(--bg); box-shadow: none; }
.color-input { width: 52px; height: 52px; padding: 0; border: 1px solid var(--line); border-radius: var(--r-field); background: none; flex: 0 0 auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--s3); }

/* ---------- 8. 外壳 ---------- */
#app { min-height: 100dvh; }
.shell { min-height: 100dvh; }
.topbar { display: none; }
.main {
  padding: calc(var(--safe-t) + var(--s6)) calc(var(--gutter) + var(--safe-r)) calc(var(--nav-h) + var(--safe-b) + 96px) calc(var(--gutter) + var(--safe-l));
  max-width: 640px; margin: 0 auto;
}
.view { animation: viewIn 420ms var(--ease) both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.mast { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s8); min-height: 44px; }
.brand { font: 700 22px/1 var(--f-serif); letter-spacing: -.02em; display: inline-flex; align-items: baseline; gap: 6px; }
.brand i { font: italic 400 14px/1 var(--f-display); color: var(--accent); }

/* 底栏：四个去处 + 中间一个「存衣服」 */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  padding: 0 var(--safe-r) var(--safe-b) var(--safe-l);
  background: var(--glass);
  -webkit-backdrop-filter: saturate(1.6) blur(22px); backdrop-filter: saturate(1.6) blur(22px);
  border-top: 1px solid var(--line);
}
.tabbar-in { display: grid; grid-template-columns: 1fr 1fr 76px 1fr 1fr; height: var(--nav-h); max-width: 560px; margin: 0 auto; align-items: center; }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 100%; color: var(--ink-3); font-size: 10.5px; letter-spacing: .04em; transition: color 200ms; position: relative; }
.tab .ico { transition: transform 260ms var(--spring); }
.tab:active .ico { transform: scale(.86); }
.tab.on { color: var(--ink); }
.tab.on::after { content: ""; position: absolute; top: 0; left: 50%; width: 18px; height: 2px; margin-left: -9px; background: var(--ink); }
.tab .badge { position: absolute; top: 9px; left: calc(50% + 6px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font: 700 10px/16px var(--f-num); text-align: center; }
.fab {
  justify-self: center; width: 58px; height: 58px; border-radius: 50%;
  background: var(--ink); color: var(--bg);
  display: grid; place-items: center; transform: translateY(-14px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
  transition: transform 240ms var(--spring);
}
.fab:active { transform: translateY(-14px) scale(.9); }
.fab .ico { width: 26px; height: 26px; stroke-width: 1.8; }

/* ---------- 9. 骨架 / 空状态 / 进度 ---------- */
.skel { position: relative; overflow: hidden; background: var(--plate); }
.skel::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .45) 50%, transparent 80%);
  transform: translateX(-100%); animation: shimmer 1.4s var(--ease) infinite;
}
[data-theme="noir"] .skel::after { background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .06) 50%, transparent 80%); }
@keyframes shimmer { to { transform: translateX(100%); } }
.skel-line { height: 12px; border-radius: 2px; margin-top: 10px; }
.skel-line.w60 { width: 60%; } .skel-line.w40 { width: 40%; } .skel-line.w80 { width: 80%; }

.empty { padding: var(--s10) 0 var(--s8); text-align: left; }
.empty .art { width: 132px; height: 132px; color: var(--ink); margin-bottom: var(--s6); }
.empty .art .ico { width: 100%; height: 100%; stroke-width: .9; }
.empty .h1 { margin-bottom: var(--s3); }
.empty .lede { margin-bottom: var(--s6); }
.empty.center { text-align: center; }
.empty.center .art { margin-left: auto; margin-right: auto; }
.empty.center .lede { margin-left: auto; margin-right: auto; }
.empty.compact { padding: var(--s6) 0; }
.empty.compact .art { width: 72px; height: 72px; margin-bottom: var(--s4); }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.steps i { height: 3px; background: var(--line); position: relative; overflow: hidden; }
.steps i.done { background: var(--ink); }
.steps i.now { background: var(--line); }
.steps i.now::after { content: ""; position: absolute; inset: 0; background: var(--ink); transform-origin: left; animation: stepfill 1.8s var(--ease) infinite; }
.steps i.fail { background: var(--accent); }
@keyframes stepfill { 0% { transform: scaleX(0); opacity: 1; } 70% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
.steps-lbl { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 6px; font-size: 10.5px; color: var(--ink-3); letter-spacing: .04em; }
.steps-lbl .on { color: var(--ink); font-weight: 600; }

.pulse-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; transform: scale(.7); } }

/* ---------- 10. 衣柜 ---------- */
.closet-tools { position: sticky; top: 0; z-index: 10; margin: calc((var(--safe-t) + var(--s6)) * -1) calc(var(--gutter) * -1) 0; padding: calc(var(--safe-t) + 12px) var(--gutter) 12px; background: var(--glass); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.closet-tools .row { display: flex; gap: var(--s2); align-items: center; }
.closet-tools .searchbox { flex: 1; }
.closet-tools .chips { margin-top: var(--s3); }
.count-line { display: flex; justify-content: space-between; align-items: center; margin: var(--s4) 0 var(--s3); }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s6) var(--s3); }
.card {
  position: relative; display: block; text-align: left; width: 100%;
  animation: cardIn 480ms var(--ease) both;
  animation-delay: calc(var(--i, 0) * 34ms);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.plate {
  position: relative; aspect-ratio: 4 / 5; overflow: hidden;
  background: var(--plate); border-radius: var(--r-plate);
  transition: transform 260ms var(--ease);
}
.plate img { width: 100%; height: 100%; object-fit: contain; padding: 9%; transition: opacity 400ms var(--ease), transform 500ms var(--ease); }
.plate img.cover { object-fit: cover; padding: 0; }
.plate img[data-loading] { opacity: 0; }
.card:active .plate { transform: scale(.975); }
.plate .idx { position: absolute; left: 10px; top: 9px; font: italic 400 13px/1 var(--f-display); color: var(--index-color); }
.plate .fav { position: absolute; right: 8px; top: 7px; color: var(--accent); }
.plate .fav .ico { width: 16px; height: 16px; }
.plate .state { position: absolute; left: 10px; right: 10px; bottom: 10px; }
.plate .state .tag { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; background: var(--bg-2); font-size: 11px; letter-spacing: .04em; border-radius: var(--r-btn); }
.plate .state .tag.fail { background: var(--accent); color: var(--accent-ink); }
.card .meta { padding-top: var(--s3); }
.card .nm { font: 400 15px/1.35 var(--f-serif); color: var(--ink); display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.card .sub { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; color: var(--ink-3); }
.card .sub .dot { width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line); }
.card .check {
  position: absolute; right: 8px; top: 8px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--bg-2); box-shadow: inset 0 0 0 1.5px var(--line); display: grid; place-items: center;
  opacity: 0; transform: scale(.6); transition: opacity 200ms, transform 240ms var(--spring);
}
.card .check .ico { width: 15px; height: 15px; stroke-width: 2.4; opacity: 0; color: var(--bg); }
.selecting .card .check { opacity: 1; transform: none; }
.selecting .card .fav { display: none; }
.card.picked .check { background: var(--ink); box-shadow: none; }
.card.picked .check .ico { opacity: 1; }
.card.picked .plate { transform: scale(.94); }
.sentinel { height: 1px; }

/* 套装 */
.outfit-list { display: grid; gap: var(--s8); }
.collage { display: grid; gap: 3px; aspect-ratio: 5 / 4; background: var(--bg); border-radius: var(--r-plate); overflow: hidden; }
.collage .c { background: var(--plate); position: relative; overflow: hidden; }
.collage .c img { width: 100%; height: 100%; object-fit: contain; padding: 10%; }
.collage[data-n="1"] { grid-template-columns: 1fr; }
.collage[data-n="2"] { grid-template-columns: 1fr 1fr; }
.collage[data-n="3"] { grid-template-columns: 1.3fr 1fr; grid-template-rows: 1fr 1fr; }
.collage[data-n="3"] .c:first-child { grid-row: span 2; }
.collage[data-n="4"] { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.collage[data-n="5"], .collage[data-n="6"] { grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr 1fr; }
.collage[data-n="5"] .c:first-child { grid-row: span 2; }

/* 多选操作条 */
.selbar {
  position: fixed; left: 12px; right: 12px; z-index: 45;
  bottom: calc(var(--safe-b) + 12px);
  max-width: 560px; margin: 0 auto;
  background: var(--ink); color: var(--bg); border-radius: calc(var(--r-btn) + 12px);
  padding: 10px 10px 10px 18px; display: flex; align-items: center; gap: 4px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .3);
  transform: translateY(calc(100% + 60px)); visibility: hidden; transition: transform 380ms var(--ease-sheet), visibility 0s 380ms;
}
[data-theme="atelier"] .selbar, [data-theme="noir"] .selbar { border-radius: 4px; }
.selbar.on { transform: none; visibility: visible; transition: transform 380ms var(--ease-sheet); }
.selbar .cnt { flex: 1; font-size: 14px; }
.selbar .cnt b { font: 600 20px/1 var(--f-num); margin-right: 4px; }
.selbar .btn-icon { color: var(--bg); flex-direction: column; width: 56px; height: 52px; border-radius: 8px; gap: 2px; font-size: 10px; }
.selbar .btn-icon:hover { background: rgba(127, 127, 127, .18); }
.selbar .btn-icon.danger { color: var(--accent); }
.selecting-mode .tabbar { transform: translateY(110%); }
.tabbar { transition: transform 320ms var(--ease-sheet), background-color .45s; }

/* ---------- 11. 上传托盘 ---------- */
.tray {
  position: fixed; left: 12px; right: 12px; z-index: 42;
  bottom: calc(var(--nav-h) + var(--safe-b) + 10px);
  max-width: 560px; margin: 0 auto;
  background: var(--bg-2); color: var(--ink);
  border-radius: calc(var(--r-card) + 6px); box-shadow: var(--shadow), 0 0 0 1px var(--line-2);
  transform: translateY(calc(100% + 120px)); opacity: 0; visibility: hidden;
  transition: transform 420ms var(--ease-sheet), opacity 300ms, visibility 0s 420ms;
  overflow: hidden;
}
[data-theme="atelier"] .tray, [data-theme="noir"] .tray { border-radius: 4px; }
.tray.on { transform: none; opacity: 1; visibility: visible; transition: transform 420ms var(--ease-sheet), opacity 300ms; }
.tray-head { display: flex; align-items: center; gap: var(--s3); padding: 6px 6px 6px var(--s4); min-height: 56px; width: 100%; text-align: left; }
.tray-head .t { flex: 1; min-width: 0; }
.tray-head .t b { display: block; font-size: 14px; font-weight: 600; }
.tray-head .t span { display: block; font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tray-head .chev { transition: transform 300ms var(--ease); }
.tray.open .tray-head .chev { transform: rotate(180deg); }
.tray-thumbs { display: flex; }
.tray-thumbs img, .tray-thumbs span { width: 34px; height: 34px; object-fit: cover; border-radius: 50%; border: 2px solid var(--bg-2); margin-left: -10px; background: var(--plate); }
.tray-thumbs :first-child { margin-left: 0; }
.tray-list { max-height: 0; overflow-y: auto; transition: max-height 380ms var(--ease-sheet); }
.tray.open .tray-list { max-height: min(56dvh, 440px); }
.task { display: grid; grid-template-columns: 64px 1fr; gap: var(--s3); padding: var(--s3) var(--s4); border-top: 1px solid var(--line-2); }
.task .pv { width: 64px; height: 80px; background: var(--plate); overflow: hidden; border-radius: var(--r-plate); }
.task .pv img { width: 100%; height: 100%; object-fit: cover; }
.task .pv img.done { object-fit: contain; padding: 6px; }
.task .bd { min-width: 0; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.task .row1 { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); font-size: 14px; }
.task .row1 b { font-weight: 600; }
.task .err { font-size: 12.5px; line-height: 1.5; color: var(--accent); }
.task .acts { display: flex; gap: var(--s2); flex-wrap: wrap; }
.task .name-row { display: flex; gap: var(--s2); }
.task .name-row .input { height: 40px; font-size: 15px; }

/* ---------- 12. 抽屉 / 对话框 / 提示 ---------- */
.scrim { position: fixed; inset: 0; z-index: 60; background: var(--scrim); opacity: 0; transition: opacity 360ms var(--ease); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.scrim.on { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61;
  max-height: calc(100dvh - var(--safe-t) - 28px);
  background: var(--bg); color: var(--ink);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform 460ms var(--ease-sheet);
  box-shadow: 0 -10px 60px rgba(0, 0, 0, .18);
  will-change: transform;
}
.sheet.on { transform: none; }
.sheet.dragging { transition: none; }
.sheet.full { height: calc(100dvh - var(--safe-t) - 12px); max-height: none; }
.sheet-grab { flex: 0 0 auto; height: 22px; display: grid; place-items: center; touch-action: none; cursor: grab; }
.sheet-grab::before { content: ""; width: 38px; height: 4px; border-radius: 2px; background: var(--line); }
.sheet-bar { flex: 0 0 auto; display: flex; align-items: center; gap: var(--s2); padding: 0 var(--s3) var(--s2) var(--gutter); touch-action: none; }
.sheet-bar .ttl { flex: 1; min-width: 0; font: 600 var(--t-micro)/1 var(--f-sans); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 0 var(--gutter) calc(var(--safe-b) + var(--s8)); }
.sheet-foot { flex: 0 0 auto; padding: var(--s3) var(--gutter) calc(var(--safe-b) + var(--s3)); border-top: 1px solid var(--line-2); background: var(--bg); }

.dialog-wrap { position: fixed; inset: 0; z-index: 80; display: grid; place-items: end center; padding: 12px 12px calc(var(--safe-b) + 12px); pointer-events: none; }
.dialog {
  width: 100%; max-width: 420px; pointer-events: auto;
  background: var(--bg-2); color: var(--ink); border-radius: calc(var(--r-card) + 8px); padding: var(--s6) var(--s5) var(--s5);
  box-shadow: var(--shadow);
  transform: translateY(24px) scale(.98); opacity: 0; transition: transform 340ms var(--ease-sheet), opacity 240ms;
}
[data-theme="atelier"] .dialog, [data-theme="noir"] .dialog { border-radius: 6px; }
.dialog.on { transform: none; opacity: 1; }
.dialog .h2 { margin-bottom: var(--s2); }
.dialog .lede { margin-bottom: var(--s5); font-size: 14px; }
.dialog .input { margin-bottom: var(--s3); }
.dialog .chips { margin-bottom: var(--s5); }

.toast {
  position: fixed; left: 50%; z-index: 90;
  bottom: calc(var(--nav-h) + var(--safe-b) + 14px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: var(--s3);
  max-width: calc(100vw - 24px); width: max-content;
  padding: 0 6px 0 var(--s4); min-height: 48px;
  background: var(--ink); color: var(--bg);
  border-radius: calc(var(--r-btn) + 6px);
  font-size: 14px; box-shadow: 0 12px 34px rgba(0, 0, 0, .24);
  transition: transform 340ms var(--spring), opacity 220ms;
}
[data-theme="atelier"] .toast, [data-theme="noir"] .toast { border-radius: 3px; }
.toast.noact { padding-right: var(--s4); }
.toast.on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast .act { height: 40px; padding: 0 var(--s3); font-weight: 700; color: var(--accent); letter-spacing: .02em; position: relative; }
.toast .act::before { content: ""; position: absolute; inset: -4px 0; }
[data-theme="atelier"] .toast .act { color: #ff8a6e; }
[data-theme="linen"] .toast .act { color: #e9b9a6; }
.toast .bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--accent); transform-origin: left; }
.tray-open .toast { bottom: auto; top: calc(var(--safe-t) + 12px); transform: translate(-50%, -20px); }
.tray-open .toast.on { transform: translate(-50%, 0); }
.has-tray .toast { bottom: calc(var(--nav-h) + var(--safe-b) + 84px); }
.selecting-mode .toast { bottom: calc(var(--safe-b) + 90px); }

/* ---------- 13. 单品详情 ---------- */
.detail-hero { position: relative; margin: 0 calc(var(--gutter) * -1); aspect-ratio: 1 / 1; background: var(--plate); overflow: hidden; }
.detail-hero img { width: 100%; height: 100%; object-fit: contain; padding: 8%; animation: fadeIn 500ms var(--ease) both; }
.detail-hero img.cover { object-fit: cover; padding: 0; }
.detail-hero .flip { position: absolute; right: 12px; bottom: 12px; }
.detail-hero .flip .seg { background: var(--glass); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.detail-hero .flip .seg button { height: 32px; padding: 0 12px; font-size: 12.5px; }
.detail-hero .busy { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: var(--s6); }
.detail-hero .busy .box { width: min(280px, 80%); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.detail-head { padding: var(--s6) 0 var(--s4); }
.detail-head .metaline { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: var(--s3); font-size: 13px; color: var(--ink-2); }
.detail-head .metaline .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; vertical-align: -1px; margin-right: 4px; box-shadow: inset 0 0 0 1px var(--line); }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: var(--s2) 0 var(--s6); }
.quick button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 76px; font-size: 12px; color: var(--ink-2); transition: background-color 200ms; }
.quick button + button { box-shadow: -1px 0 0 var(--line); }
.quick button:active { background: var(--line-2); }
.quick button .ico { color: var(--ink); }
.quick button.on .ico { color: var(--accent); }
.kv { margin: 0; }
.kv .row { display: flex; justify-content: space-between; gap: var(--s4); padding: 13px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; text-align: right; }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--s3) var(--s2); margin-bottom: var(--s4); }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; color: var(--ink-2); min-height: 44px; }
.swatch i { width: 40px; height: 40px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--line); transition: transform 240ms var(--spring); }
.swatch.on i { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }
.swatch:active i { transform: scale(.88); }
.gen-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s4) var(--s3); }
.gen .plate { aspect-ratio: 1; }
.gen .cap { font-size: 13px; margin-top: 8px; line-height: 1.4; }
.gen .cap .faint { display: block; font-size: 11.5px; }
.gen .acts { margin-top: 8px; }
.danger-zone { margin-top: var(--s10); padding-top: var(--s5); border-top: 1px solid var(--line); display: grid; gap: var(--s2); }

/* ---------- 14. 今天 ---------- */
.today-top { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
.city-btn { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-size: 14px; color: var(--ink); }
.city-btn .ico { width: 18px; height: 18px; }
.wx { margin-top: var(--s4); }
.wx-main { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); }
.wx-temp { font: 200 var(--t-num)/.84 var(--f-num); letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.wx-temp sup { font-size: .36em; vertical-align: top; position: relative; top: .14em; letter-spacing: 0; font-weight: 300; margin-left: 2px; }
.wx-side { text-align: right; padding-bottom: 8px; }
.wx-side .ico { width: 44px; height: 44px; margin-left: auto; stroke-width: 1.2; }
.wx-side .d { font: 400 var(--t-h2)/1.2 var(--f-serif); margin-top: 6px; }
.wx-side .r { font-size: 13px; color: var(--ink-2); margin-top: 2px; font-family: var(--f-num); }
.wx-facts { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: var(--s6); border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.wx-facts div { padding: 12px 0; }
.wx-facts div + div { padding-left: 12px; box-shadow: -1px 0 0 var(--line-2); }
.wx-facts span { display: block; font-size: 10.5px; letter-spacing: .12em; color: var(--ink-3); text-transform: uppercase; }
.wx-facts b { display: block; font: 500 17px/1.3 var(--f-num); margin-top: 4px; font-variant-numeric: tabular-nums; }
.wx-days { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 2px; }
.wx-days div { padding: 10px 0; font-size: 12px; color: var(--ink-3); }
.wx-days div + div { padding-left: 12px; }
.wx-days b { display: block; font: 500 13px/1.3 var(--f-num); color: var(--ink-2); margin-top: 2px; }
.wx-tip { margin-top: var(--s3); font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.wx-tip b { color: var(--ink); font-weight: 600; margin-right: 6px; }
.wx-skel .wx-temp { width: 180px; height: 104px; }

.ask { margin-top: var(--s12); }
.ask .hero-title { margin-top: var(--s3); }
.ask .chips { margin-top: var(--s5); }

.looks3 { display: grid; gap: var(--s12); margin-top: var(--s8); }
.oc { animation: cardIn 560ms var(--ease) both; animation-delay: calc(var(--i, 0) * 90ms); }
.oc-head { display: flex; align-items: baseline; gap: var(--s3); margin-bottom: var(--s3); }
.oc-head .no { font: italic 400 44px/.9 var(--f-display); color: var(--index-color); }
.oc-head .h2 { flex: 1; }
.oc-head .vibe { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.oc .collage { cursor: pointer; }
.oc-why { margin: var(--s4) 0 var(--s4); padding-left: var(--s4); border-left: 2px solid var(--accent); font: 400 17px/1.6 var(--f-serif); color: var(--ink); }
.oc-names { font-size: 12.5px; color: var(--ink-3); margin-bottom: var(--s4); line-height: 1.7; }
.oc.worn .collage { opacity: .55; }
.oc .stamp { display: none; }
.oc.worn .stamp { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--accent); letter-spacing: .06em; }
.oc-skel .collage { background: var(--plate); }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.week .d { text-align: center; }
.week .d .p { aspect-ratio: 3 / 4; background: var(--plate); border-radius: var(--r-plate); overflow: hidden; position: relative; }
.week .d .p img { width: 100%; height: 100%; object-fit: contain; padding: 10%; }
.week .d .p .more { position: absolute; right: 3px; bottom: 3px; font: 600 9px/1 var(--f-num); background: var(--bg-2); padding: 2px 4px; border-radius: 3px; }
.week .d .p.none { background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.week .d span { display: block; font: 500 11px/1 var(--f-num); color: var(--ink-3); margin-top: 6px; }
.week .d.today span { color: var(--accent); font-weight: 700; }

.rail { display: flex; gap: var(--s3); overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 0 var(--gutter); scroll-snap-type: x mandatory; scroll-padding: var(--gutter); }
.rail::-webkit-scrollbar { display: none; }
.rail > * { flex: 0 0 auto; scroll-snap-align: start; }
.rail .card { width: 132px; }
.rail .oc-mini { width: 220px; text-align: left; }
.oc-mini .nm { font: 400 15px/1.35 var(--f-serif); margin-top: 8px; }

/* ---------- 15. 试衣间 ---------- */
.avatars { display: flex; gap: var(--s3); overflow-x: auto; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); padding: 4px var(--gutter); }
.avatars::-webkit-scrollbar { display: none; }
.av { flex: 0 0 auto; width: 76px; text-align: center; font-size: 11px; color: var(--ink-3); }
.av .p { width: 76px; height: 100px; background: var(--plate); border-radius: var(--r-plate); overflow: hidden; position: relative; transition: transform 240ms var(--spring), box-shadow 200ms; }
[data-theme="linen"] .av .p { border-radius: 14px; }
.av .p img { width: 100%; height: 100%; object-fit: cover; }
.av.on .p { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }
.av.on { color: var(--ink); font-weight: 600; }
.av:active .p { transform: scale(.94); }
.av span { display: block; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.av.add .p { display: grid; place-items: center; background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-2); }
.av .x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%; background: var(--bg-2); color: var(--ink); display: grid; place-items: center; }
.av .x .ico { width: 14px; height: 14px; stroke-width: 2; }

.studio { margin-top: var(--s6); padding: var(--s5); background: var(--bg-2); border-radius: var(--r-card); box-shadow: 0 0 0 1px var(--line-2); }
[data-theme="noir"] .studio { box-shadow: 0 0 0 1px var(--line); }
.studio .seg { margin-bottom: var(--s5); }
.drop { display: grid; place-items: center; text-align: center; aspect-ratio: 16 / 10; background: var(--plate); border-radius: var(--r-plate); color: var(--ink-2); font-size: 14px; gap: 8px; padding: var(--s5); position: relative; overflow: hidden; width: 100%; }
.drop .ico { margin: 0 auto 8px; width: 32px; height: 32px; color: var(--ink); stroke-width: 1.2; }
.drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 6%; }
.drop .re { position: absolute; right: 10px; bottom: 10px; background: var(--bg-2); padding: 6px 10px; font-size: 12px; border-radius: var(--r-btn); }
.picked-row { display: flex; gap: var(--s2); overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.picked-row .pi { flex: 0 0 auto; width: 72px; height: 90px; background: var(--plate); border-radius: var(--r-plate); position: relative; }
.picked-row .pi img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.picked-row .pi .x { position: absolute; top: 2px; right: 2px; width: 24px; height: 24px; border-radius: 50%; background: var(--bg-2); display: grid; place-items: center; }
.picked-row .pi .x .ico { width: 12px; height: 12px; stroke-width: 2.2; }
.picked-row .add { flex: 0 0 auto; width: 72px; height: 90px; display: grid; place-items: center; box-shadow: inset 0 0 0 1px var(--line); border-radius: var(--r-plate); color: var(--ink-2); }
.base-note { display: flex; align-items: center; gap: var(--s3); padding: var(--s2); background: var(--bg-3); border-radius: var(--r-field); margin-bottom: var(--s3); font-size: 13px; }
.base-note img { width: 40px; height: 52px; object-fit: cover; border-radius: var(--r-plate); }
.base-note span { flex: 1; }
.studio .hint-line { font-size: 12px; color: var(--ink-3); text-align: center; margin-top: var(--s3); }

.tool-card { display: flex; align-items: center; gap: var(--s4); width: 100%; text-align: left; padding: var(--s4) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-top: var(--s6); min-height: 76px; }
.tool-card .ic { width: 48px; height: 48px; display: grid; place-items: center; background: var(--plate); border-radius: var(--r-plate); flex: 0 0 auto; }
.tool-card .t { flex: 1; }
.tool-card .t b { display: block; font: 400 17px/1.3 var(--f-serif); }
.tool-card .t span { font-size: 13px; color: var(--ink-3); }

.looks-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s5) var(--s3); }
.looks-grid .plate { aspect-ratio: 3 / 4; }
.look-run { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 12px; gap: 6px; font-size: 12px; }
.look-run .t { font: 500 13px/1 var(--f-num); color: var(--ink-2); }
.look-fail { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; padding: var(--s4); text-align: center; font-size: 12.5px; color: var(--ink-2); }
.look-fail .ico { color: var(--accent); }

.angle-bar { display: flex; gap: var(--s2); overflow-x: auto; scrollbar-width: none; margin-top: var(--s3); }
.angle-bar button.thumb { flex: 0 0 auto; width: 56px; height: 72px; overflow: hidden; border-radius: var(--r-plate); background: var(--plate); opacity: .6; transition: opacity 200ms, box-shadow 200ms; }
.angle-bar button.thumb.on { opacity: 1; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--ink); }
.angle-bar button.thumb img { width: 100%; height: 100%; object-fit: cover; }
.angle-bar .lbls { display: flex; gap: var(--s2); }
.look-hero { position: relative; margin: 0 calc(var(--gutter) * -1); background: var(--plate); aspect-ratio: 3 / 4; overflow: hidden; }
.look-hero img { width: 100%; height: 100%; object-fit: cover; animation: fadeIn 400ms var(--ease) both; }
.look-hero .lbl { position: absolute; left: 12px; top: 12px; background: var(--glass); padding: 5px 10px; font-size: 12px; border-radius: var(--r-btn); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.look-acts { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: var(--s5) 0; }
.look-acts > * { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; height: 76px; font-size: 12px; color: var(--ink-2); text-decoration: none; }
.look-acts > * + * { box-shadow: -1px 0 0 var(--line); }
.look-acts > * .ico { color: var(--ink); }
.look-acts > *:disabled { opacity: .35; }

.analysis { margin-top: var(--s5); }
.analysis .pal { display: flex; gap: 0; height: 44px; margin: var(--s3) 0 var(--s5); }
.analysis .pal i { flex: 1; }
.analysis ul { list-style: none; padding: 0; margin: 0; }
.analysis li { display: flex; gap: var(--s4); padding: 12px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.analysis li span { width: 3.5em; flex: 0 0 auto; color: var(--ink-3); font-size: 12px; padding-top: 2px; }
.analysis blockquote { margin: var(--s5) 0 0; padding-left: var(--s4); border-left: 2px solid var(--accent); font: 400 17px/1.6 var(--f-serif); }

/* 挑衣服抽屉 */
.pick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3) var(--s2); }
.pick-grid .card .meta { padding-top: 6px; }
.pick-grid .card .nm { font-size: 13px; }

/* ---------- 16. 我的 ---------- */
.me-head { display: flex; align-items: flex-end; gap: var(--s4); }
.mono { width: 72px; height: 72px; border-radius: 50%; background: var(--ink); color: var(--bg); display: grid; place-items: center; font: 400 32px/1 var(--f-serif); flex: 0 0 auto; }
[data-theme="noir"] .mono { background: var(--accent); color: var(--accent-ink); }
.me-head .who { flex: 1; min-width: 0; }
.me-head .who .h1 { word-break: break-all; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: var(--s8); border-top: 1px solid var(--ink); }
.stats div { padding: var(--s4) 0 var(--s2); }
.stats div + div { padding-left: 12px; box-shadow: -1px 0 0 var(--line-2); }
.stats b { display: block; font: 300 34px/1 var(--f-num); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.stats span { display: block; font-size: 11px; color: var(--ink-3); margin-top: 8px; letter-spacing: .06em; }
.bars { display: grid; gap: 10px; }
.bars .b { display: grid; grid-template-columns: 4em 1fr 2.4em; align-items: center; gap: var(--s3); font-size: 13px; }
.bars .b .track { height: 6px; background: var(--line-2); overflow: hidden; border-radius: 3px; }
.bars .b .track i { display: block; height: 100%; background: var(--ink); transform-origin: left; animation: grow 900ms var(--ease) both; }
.bars .b .n { text-align: right; font-family: var(--f-num); color: var(--ink-2); }
@keyframes grow { from { transform: scaleX(0); } }
.heat { display: grid; grid-template-columns: repeat(15, 1fr); gap: 3px; }
.heat i { aspect-ratio: 1; background: var(--line-2); border-radius: 2px; }
.heat i.on { background: var(--ink); }
.heat i.t { box-shadow: 0 0 0 1.5px var(--accent); }

.themes { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); }
.theme-card {
  position: relative; text-align: left; padding: var(--s4); min-height: 148px;
  background: var(--bg); color: var(--ink); border-radius: var(--r-card);
  box-shadow: inset 0 0 0 1px var(--line); overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  transition: transform 220ms var(--ease), box-shadow 200ms;
}
.theme-card:active { transform: scale(.97); }
.theme-card.on { box-shadow: inset 0 0 0 2px var(--ink); }
.theme-card .spec { font: var(--display-weight) 40px/1 var(--f-serif); letter-spacing: var(--display-track); display: flex; align-items: baseline; gap: 6px; }
.theme-card .spec i { font: italic 400 22px/1 var(--f-display); color: var(--accent); }
.theme-card .nm { display: block; font-size: 14px; font-weight: 600; }
.theme-card .ds { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 2px; line-height: 1.4; }
.theme-card .tick { position: absolute; right: 12px; top: 12px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: var(--bg); display: none; place-items: center; }
.theme-card .tick .ico { width: 13px; height: 13px; stroke-width: 2.6; }
.theme-card.on .tick { display: grid; }
.theme-card .strip { display: flex; height: 6px; margin-top: 12px; width: 100%; }
.theme-card .strip i { flex: 1; }
.theme-card.auto { background: linear-gradient(135deg, #f6f6f3 0 50%, #0b0b0b 50% 100%); }
.theme-card.auto .spec { color: transparent; background: linear-gradient(135deg, #0d0d0c 0 50%, #f3f1ec 50% 100%); -webkit-background-clip: text; background-clip: text; }
.theme-card.auto .nm, .theme-card.auto .ds { color: #0d0d0c; }
.theme-card.auto .ds { opacity: .6; }
.theme-card.auto .spec i { color: #e2391b; -webkit-text-fill-color: #e2391b; }

.list { border-top: 1px solid var(--line); }
.li { display: flex; align-items: center; gap: var(--s3); min-height: 56px; padding: 6px 0; border-bottom: 1px solid var(--line-2); width: 100%; text-align: left; text-decoration: none; color: var(--ink); font-size: 15px; }
.li .ico.lead { color: var(--ink-2); }
.li .l { flex: 1; min-width: 0; }
.li .l small { display: block; font-size: 12px; color: var(--ink-3); }
.li .v { color: var(--ink-2); font-size: 14px; display: inline-flex; align-items: center; gap: 4px; text-align: right; }
.li .v .ico { color: var(--ink-3); width: 18px; height: 18px; }
.li.danger { color: var(--accent); }
.li.danger .ico.lead { color: var(--accent); }
.li:active { background: var(--line-2); }
.banner { display: flex; gap: var(--s3); padding: var(--s4); background: var(--bg-3); border-radius: var(--r-card); font-size: 13px; line-height: 1.6; margin-top: var(--s6); }
.banner .ico { color: var(--accent); }
.foot-note { margin-top: var(--s10); text-align: center; font-size: 11px; color: var(--ink-3); letter-spacing: .12em; }

.city-list .li { min-height: 52px; }

/* ---------- 17. 登录 ---------- */
.auth { min-height: 100dvh; display: flex; flex-direction: column; padding: calc(var(--safe-t) + var(--s8)) calc(var(--gutter) + var(--safe-r)) calc(var(--safe-b) + var(--s8)) calc(var(--gutter) + var(--safe-l)); max-width: 480px; margin: 0 auto; }
.auth .cover { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: var(--s10); min-height: 38dvh; }
.auth .big { font: 700 clamp(96px, 34vw, 168px)/.9 var(--f-serif); letter-spacing: -.06em; margin: var(--s6) 0 var(--s4); animation: viewIn 700ms var(--ease) both; }
[data-theme="noir"] .auth .big, [data-theme="linen"] .auth .big { font-weight: 400; }
.auth .big i { font: italic 400 .32em/1 var(--f-display); color: var(--accent); letter-spacing: 0; margin-left: 6px; }
.auth .tabs-u { margin-bottom: var(--s6); }
.auth form { animation: viewIn 600ms 120ms var(--ease) both; }
.auth .note { margin-top: var(--s5); font-size: 13px; color: var(--ink-3); line-height: 1.6; }
.auth .pw { position: relative; }
.auth .pw .btn-icon { position: absolute; right: 4px; top: 4px; color: var(--ink-3); }

.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot .brand { font-size: 40px; animation: pulse 1.6s ease-in-out infinite; }

/* ---------- 18. 桌面：居中容器 + 双栏，不把手机布局拉满 ---------- */
@media (min-width: 960px) {
  :root { --gutter: 40px; --t-hero: 88px; --t-h1: 46px; }
  .tabbar { display: none; }
  .topbar {
    display: block; position: sticky; top: 0; z-index: 40;
    background: var(--glass); -webkit-backdrop-filter: saturate(1.6) blur(22px); backdrop-filter: saturate(1.6) blur(22px);
    border-bottom: 1px solid var(--line);
  }
  .topbar-in { max-width: 1200px; margin: 0 auto; height: 72px; padding: 0 40px; display: flex; align-items: center; gap: var(--s8); }
  .topbar nav { display: flex; gap: var(--s6); flex: 1; }
  .topbar nav button { height: 72px; font-size: 15px; color: var(--ink-3); position: relative; }
  .topbar nav button.on { color: var(--ink); font-weight: 600; }
  .topbar nav button.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--ink); }
  .main { max-width: 1200px; padding: var(--s10) 40px 120px; }
  .mast { display: none; }
  .closet-tools { top: 72px; margin-top: calc(var(--s10) * -1); padding-top: 16px; }
  .grid { grid-template-columns: repeat(4, 1fr); gap: var(--s8) var(--s5); }
  .looks-grid { grid-template-columns: repeat(4, 1fr); }
  .outfit-list { grid-template-columns: repeat(3, 1fr); gap: var(--s8); }
  .today-grid { display: grid; grid-template-columns: 380px 1fr; gap: 72px; align-items: start; }
  .today-grid .wxcol { position: sticky; top: 112px; }
  .today-grid .ask { margin-top: 0; }
  .looks3 { grid-template-columns: repeat(3, 1fr); gap: var(--s6); }
  .looks3 .oc-head .no { font-size: 34px; }
  .fit-grid { display: grid; grid-template-columns: 440px 1fr; gap: 64px; align-items: start; }
  .fit-grid .fitcol { position: sticky; top: 112px; }
  .fit-grid .sec:first-child { margin-top: 0; }
  .me-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 72px; }
  .selbar, .tray { bottom: 24px; left: auto; right: 24px; width: 440px; margin: 0; }
  .tray { bottom: 24px; }
  .selecting-mode .tray { bottom: 104px; }
  .toast, .has-tray .toast, .selecting-mode .toast, .tray-open .toast { top: auto; bottom: 28px; left: 40px; transform: translate(0, 20px); }
  .toast.on, .tray-open .toast.on { transform: none; }
  .sheet {
    left: auto; top: 0; bottom: 0; right: 0; width: 540px; max-height: none; height: 100dvh;
    border-radius: 0; transform: translateX(100%); box-shadow: -20px 0 60px rgba(0, 0, 0, .14);
  }
  .sheet.full { height: 100dvh; }
  .sheet-grab { display: none; }
  .sheet-bar { padding-top: var(--s4); padding-bottom: var(--s4); }
  .dialog-wrap { place-items: center; }
  .pick-grid { grid-template-columns: repeat(4, 1fr); }
  .detail-hero, .look-hero { margin: 0; }
  .auth { max-width: 1100px; flex-direction: row; align-items: center; gap: 96px; }
  .auth .cover { padding-bottom: 0; }
  .auth form, .auth .formcol { width: 380px; flex: 0 0 auto; }
}
@media (min-width: 960px) and (hover: hover) {
  .card:hover .plate img { transform: scale(1.035); }
}
@media (min-width: 600px) and (max-width: 959px) {
  .main { max-width: 760px; }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .looks-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
}

/* ============================================================================
   19. 本地补充：生图素材 · 宽屏尺度 · 上身视频
   ============================================================================ */

/* 空状态：换成实拍静物 */
.empty .art--photo { width: min(100%, 460px); height: auto; aspect-ratio: 3 / 2; overflow: hidden; background: var(--plate); }
.empty .art--photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.empty.compact .art--photo { width: min(100%, 340px); }

/* 登录页：桌面端左侧整幅时装静物 */
@media (min-width: 960px) {
  .auth .cover {
    position: relative; overflow: hidden; padding: 56px; min-height: 640px;
    justify-content: flex-end; color: #fff;
    background: #14130f url(/art/hero.webp?v=2) center / cover no-repeat;
  }
  .auth .cover::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(10,10,8,.08) 0%, rgba(10,10,8,.26) 45%, rgba(10,10,8,.74) 100%);
  }
  .auth .cover > * { position: relative; z-index: 1; }
  .auth .cover .kicker, .auth .cover .kicker .no, .auth .cover .lede { color: rgba(255,255,255,.88); }
  .auth .cover .kicker .rule { background: rgba(255,255,255,.55); }
  .auth .cover .big { color: #fff; }
  .auth .cover .big i { color: #ff5f3d; }
  .auth .cover .lede { max-width: 32ch; }
}

/* 宽屏：把版心放大 */
@media (min-width: 1500px) {
  :root { --t-hero: 108px; --t-h1: 56px; }
  .topbar-in, .main { max-width: 1480px; }
  .auth { max-width: 1240px; }
  .today-grid { grid-template-columns: 420px 1fr; gap: 96px; }
  .grid, .looks-grid { grid-template-columns: repeat(5, 1fr); }
  .outfit-list { grid-template-columns: repeat(4, 1fr); }
}

/* 上身视频 */
.look-video { position: relative; margin-top: 16px; background: #0b0b0b; overflow: hidden; }
.look-video video { width: 100%; display: block; }
.look-video.skel { aspect-ratio: 3 / 4; display: grid; place-items: center; }
.look-video .vid-run { display: flex; align-items: center; gap: 10px; color: #e9e7e1; font-size: 13px; letter-spacing: .04em; }
.look-video .vid-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: #0b0b0b; color: #b9b6ae; }
.video-cta { margin-top: 20px; padding: 18px; border: 1px solid var(--line); background: var(--bg-2); }
.video-cta .note { margin-top: 10px; font-size: 12px; color: var(--ink-3); line-height: 1.6; }
