/* ===== 黑白极简风（参考：球鞋电商 App）===== */
:root {
  --bg: #F4F4F4;
  --card: #FFFFFF;
  --text: #0F0F0F;
  --text-2: #2A2A2A;
  --muted: #8A8A8A;
  --muted-2: #B5B5B5;
  --line: #ECECEC;
  --soft: #F7F7F7;
  --primary: #0F0F0F;
  --primary-soft: #1F1F1F;
  --accent: #111111;
  --danger-soft: #EFEFEF;
  --danger: #1A1A1A;
  --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 6px 18px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-fab: 0 8px 24px rgba(0,0,0,0.22);
  --radius: 10px;
  --radius-sm: 14px;
  --tab-h: 68px;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body { padding-bottom: var(--tab-h); }

img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

/* TDesign 图标容器 */
.ticon { display: inline-flex; align-items: center; justify-content: center; width: 1em; height: 1em; vertical-align: middle; }
.ticon svg { width: 100%; height: 100%; display: block; }

/* ===== 顶部栏 ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  padding: 20px 22px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
}
.topbar h1 {
  font-size: 28px;
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  line-height: 1.1;
  white-space: nowrap;
}
.topbar .sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 400;
  white-space: nowrap;
}
/* 标题与计数同行、不换行 */
.topbar .tt {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}
.topbar .tt h1 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar .tt .sub { margin-top: 0; flex: none; }
/* 顶部右侧文字按钮（如尺码对比） */
.top-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  flex: none;
}
.top-link:active { background: var(--soft); }
.top-link .ticon { width: 14px; height: 14px; }
.topbar .icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  border: none; background: var(--card); color: var(--text);
  box-shadow: var(--shadow-sm); font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
/* 详情页 / 尺码对比页：返回按钮在左，标题紧跟，移除右侧两端对齐 */
.topbar.has-back {
  justify-content: flex-start;
  gap: 12px;
}
.topbar.has-back > .icon-btn { flex: none; }
.topbar.has-back > .tt { flex: 1; min-width: 0; }

.page { padding: 8px 20px 32px; max-width: 560px; margin: 0 auto; }

/* ===== 卡片 ===== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 56px; padding: 14px 24px;
  border: none; border-radius: 16px;
  background: var(--primary); color: #fff;
  font-size: 16px; font-weight: 600;
  letter-spacing: -0.01em;
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
}
.btn:active { transform: scale(0.98); background: var(--primary-soft); }
.btn.block { width: 100%; }
.btn.ghost { background: var(--soft); color: var(--text); }
.btn.light { background: var(--card); color: var(--text); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.sm { min-height: 40px; padding: 10px 16px; font-size: 14px; border-radius: 12px; }

/* 文本 */
.muted { color: var(--muted); }
.price { color: var(--text); font-weight: 700; }
.section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 18px;
  font-weight: 700;
  margin: 28px 2px 14px;
  letter-spacing: -0.02em;
}
.section-title .ticon { width: 20px; height: 20px; flex: none; }

/* 数据隔离警告框（黄色警示） */
.warn-box {
  display: flex; gap: 10px; align-items: flex-start;
  background: #FFF8E1;
  border: 1px solid #F5E2A8;
  border-left: 3px solid #E8A800;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  font-size: 13px; line-height: 1.55;
  color: #6B5A00;
}
.warn-box .ticon { flex: none; width: 18px; height: 18px; margin-top: 1px; color: #E8A800; }
.warn-box b { font-weight: 700; color: #4A3D00; }

/* 备份卡片：文本复制 / 粘贴通道（黑白灰主题） */
.bk-divider {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: 12px;
  margin: 16px 0 12px;
}
.bk-divider::before, .bk-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--line);
}
.bk-block { margin-top: 4px; }
.bk-text {
  width: 100%; box-sizing: border-box;
  font: 12px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--text); background: var(--soft);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px; resize: vertical; outline: none;
}
#bk-text { min-height: 64px; opacity: .85; }
#bk-paste { min-height: 72px; }
.bk-actions { display: flex; gap: 10px; margin: 10px 0; }
.bk-actions .btn { flex: 1; }

/* 存储空间进度条 */
.storage-bar {
  height: 10px; border-radius: 6px;
  background: var(--soft);
  overflow: hidden;
}
.storage-bar > span {
  display: block; height: 100%;
  width: 0; border-radius: 6px;
  background: var(--text);
  transition: width .3s ease;
}
.storage-line {
  display: flex; justify-content: space-between;
  margin-top: 10px; font-size: 14px;
}
.storage-line b { font-weight: 700; }

/* ===== 底部导航 ===== */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: var(--tab-h);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  display: flex; z-index: 30;
  max-width: 560px; margin: 0 auto;
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; text-decoration: none; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 11px; gap: 4px; transition: color .15s;
  font-weight: 500;
}
.tabbar a .ti { font-size: 22px; line-height: 1; transition: transform .15s; }
.tabbar a.active { color: var(--text); font-weight: 600; }
.tabbar a.active .ti { transform: scale(1.05); }

/* ===== 缩略图（thumb 助手共用） ===== */
.tl-thumb {
  width: 50px; height: 50px; border-radius: 13px; object-fit: cover;
  background: var(--soft);
}
.tl-thumb.empty { display: flex; align-items: center; justify-content: center; color: var(--muted-2); font-size: 10px; }

/* ===== 衣橱画廊 ===== */
.filter-bar {
  display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 16px;
  position: sticky; top: 64px; background: var(--bg); z-index: 10;
  margin: 0 -4px;
}
.filter-bar::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 10px 18px; border-radius: 24px;
  background: var(--card); color: var(--text);
  border: 1px solid var(--line); font-size: 14px; font-weight: 500;
  transition: all .15s;
}
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.chip-count { font-size: 12px; opacity: .65; margin-left: 4px; font-weight: 500; }
.chip.active .chip-count { opacity: .8; }
.filter-bar.sub { top: 110px; padding-top: 0; padding-bottom: 12px; margin-top: -6px; }
.chip.sm { padding: 7px 13px; font-size: 12.5px; border-radius: 18px; }
.filter-bar.style { top: 64px; }
.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 11px 14px; margin: 8px 0 2px;
}
.search-bar .ticon { font-size: 18px; flex: none; color: var(--muted); }
.search-bar input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font-size: 15px; color: var(--text); font-family: inherit;
}
.search-bar input::placeholder { color: var(--muted); }
/* 隐藏浏览器原生的搜索清除按钮，统一用自定义清除按钮 */
.search-bar input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

/* 搜索框外层（承载建议下拉的定位上下文） */
.search-wrap { position: relative; }
.search-clear {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0; border: none; border-radius: 50%;
  background: var(--line); color: var(--text-2); cursor: pointer; font-size: 14px;
}
.search-clear:active { background: var(--muted-2); }
.search-clear.hidden { display: none; }

/* 最近搜索建议下拉 */
.search-suggest {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.10); padding: 12px 14px;
}
.search-suggest.show { display: block; }
.ss-head { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.ss-clear { border: none; background: none; color: var(--muted); font-size: 13px; cursor: pointer; padding: 2px 4px; }
.ss-clear:active { color: var(--text); }
.ss-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ss-chip {
  padding: 8px 14px; border-radius: 18px; background: var(--soft); color: var(--text);
  border: 1px solid var(--line); font-size: 14px; font-family: inherit; cursor: pointer;
  transition: background .12s ease;
}
.ss-chip:active { background: var(--line); }

/* 搜索结果计数行 */
.search-meta {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13.5px; color: var(--muted); margin: 12px 2px 6px;
}
.search-meta b { color: var(--text); font-weight: 700; }
.link-clear { border: none; background: none; color: var(--muted); font-size: 13.5px; cursor: pointer; padding: 2px 4px; }
.link-clear:active { color: var(--text); }

/* 搜索命中高亮（无彩色，仅灰度强调） */
mark { background: var(--soft); color: var(--primary); font-weight: 700; padding: 0 1px; border-radius: 4px; }

/* 空状态 */
.search-empty { text-align: center; padding: 48px 16px; color: var(--muted); }
.search-empty .ticon { font-size: 40px; color: var(--muted-2); display: block; }
.search-empty .se-t { font-size: 15px; font-weight: 600; color: var(--text-2); margin-top: 12px; }
.search-empty .se-s { font-size: 13px; margin-top: 6px; }
.search-empty .btn { margin-top: 16px; }

/* ===== 风格类型选择 / 标签（黑白灰主题） ===== */
.style-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.style-chip {
  padding: 9px 16px; border-radius: 22px;
  background: var(--card); color: var(--text);
  border: 1px solid var(--line); font-size: 13.5px; font-weight: 500;
  transition: all .15s; cursor: pointer;
}
.style-chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.style-tag {
  flex: none; align-self: center; white-space: nowrap;
  font-size: 11.5px; font-weight: 600; line-height: 1;
  padding: 4px 10px; border-radius: 999px;
  background: var(--soft); color: var(--text);
  border: none; margin-left: 4px;
}

/* 详情页二级分类下拉 */
.mini-select {
  padding: 14px 16px; min-height: 50px; box-sizing: border-box;
  border-radius: 14px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font-size: 15px;
  font-family: inherit; max-width: 55%;
}
.mini-select:focus { outline: none; border-color: var(--primary); }

.gallery {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px;
}
.g-item {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text);
  transition: transform .12s ease;
}
.g-item:active { transform: scale(0.98); }
.g-item .ph {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--soft);
}
.g-item .meta { padding: 12px 14px 14px; }
.g-item .nm {
  font-weight: 600;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.g-item .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 12px;
}
.g-item .cnt { color: var(--muted); }
.g-del {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 26px; height: 26px; border-radius: 50%;
  border: none; background: rgba(17, 17, 17, 0.55); color: #fff;
  font-size: 17px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease;
}
.g-del:hover, .g-del:active { background: var(--danger); }

.fab {
  position: fixed; right: 20px; bottom: calc(var(--tab-h) + 20px);
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--primary); color: #fff; border: none;
  font-size: 24px;
  box-shadow: var(--shadow-fab);
  z-index: 25;
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s;
}
.fab:active { transform: scale(0.92); }

/* ===== 详情页 ===== */
.detail-hero {
  width: 100%;
  aspect-ratio: 3/4;
  max-height: 440px;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--soft);
}
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.detail-grid.triple { grid-template-columns: repeat(3, 1fr); }
.detail-grid.triple .stat-box { padding: 14px 10px; text-align: center; }
.detail-grid.triple .stat-box .k { font-size: 10px; letter-spacing: 0; }
.detail-grid.triple .stat-box .v { font-size: 18px; }
.stat-box {
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.stat-box .k {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat-box .v {
  font-size: 22px;
  font-weight: 800;
  margin-top: 6px;
  letter-spacing: -0.02em;
  line-height: 1.1;
}
/* 详情页购买价格：22px 大字、居中、隐形可编辑 */
.price-input {
  width: 100%;
  text-align: center;
  border: none;
  background: transparent;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  font-family: inherit;
  letter-spacing: -0.02em;
  padding: 0;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}
.price-input::-webkit-outer-spin-button,
.price-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.price-input:focus { color: var(--primary); }
.kv { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: none; padding-bottom: 4px; }
.kv:first-child { padding-top: 4px; }
.kv .k { color: var(--muted); font-size: 14px; }
.kv .v-input {
  width: 90px; text-align: right; border: none; background: transparent;
  font-size: 15px; color: var(--text); font-weight: 500; outline: none;
  padding: 4px 0;
}
.kv .v-input:focus { color: var(--primary); }

.empty-hint { color: var(--muted); text-align: center; padding: 32px 0; font-size: 14px; }

/* ===== 穿搭方案 / 详情页所属穿搭（一行: 3 缩略图 + 删） ===== */
.dy-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.dy-row:last-child { border-bottom: none; padding-bottom: 2px; }
.dy-row:first-child { padding-top: 2px; }
.dy-actions { display: flex; gap: 4px; flex: none; align-items: center; }
.dy-thumbs { display: flex; gap: 3px; flex: 1; align-items: center; min-width: 0; }
.dy-thumbs img { width: 50px; height: 50px; border-radius: 13px; object-fit: cover; background: var(--soft); display: block; flex: none; }
.dy-thumb-link { display: block; line-height: 0; text-decoration: none; }
.dy-thumb-link:active { opacity: .7; }
.dy-ib {
  width: 32px; height: 32px; border-radius: 9px; padding: 0;
  border: none; background: transparent; color: var(--text-2);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; cursor: pointer; flex: none;
  transition: transform .1s, background .15s;
}
.dy-ib:active { transform: scale(0.94); background: var(--soft); }

/* ===== 分析页 ===== */
.cat-list .cl-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.cat-list .cl-name { width: 56px; flex: none; font-weight: 500; font-size: 14px; }
.cat-list .cl-bar { flex: 1; height: 8px; background: var(--soft); border-radius: 4px; overflow: hidden; }
.cat-list .cl-bar > span { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.cat-list .cl-num { width: 30px; text-align: right; color: var(--muted); font-size: 13px; font-weight: 500; }

.rank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.rank-item:last-child { border-bottom: none; padding-bottom: 4px; }
.rank-item:first-child { padding-top: 4px; }
.rank-item img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--soft);
  flex: none;
}
.rank-item .ri-name { font-weight: 600; font-size: 14px; letter-spacing: -0.01em; }
.rank-item .ri-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.rank-item .ri-val { margin-left: auto; color: var(--text); font-weight: 700; font-size: 14px; }

.badge {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ===== 弹窗 ===== */
.overlay {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5);
  display: flex; align-items: flex-end; justify-content: center; z-index: 50;
  animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  background: var(--bg); width: 100%; max-width: 560px;
  border-radius: 24px 24px 0 0; padding: 22px 22px 32px;
  max-height: 90vh; overflow-y: auto;
  animation: slideup .22s ease;
}
@keyframes slideup { from { transform: translateY(40px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.sheet-head h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.sheet-head .x {
  border: none;
  background: var(--soft);
  font-size: 16px;
  color: var(--text);
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* ===== 图片编辑器 ===== */
.ie-layer { z-index: 60; } /* 叠在添加衣物等弹窗之上 */
.ie-stage {
  position: relative;
  width: 100%;
  height: 300px;
  background: var(--soft);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 14px;
  touch-action: none;
}
.ie-canvas { position: absolute; }
.ie-crop {
  position: absolute;
  border: 2px solid #fff;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.45);
  box-sizing: border-box;
  cursor: move;
  touch-action: none;
}
.ie-crop .handle {
  position: absolute; right: -8px; bottom: -8px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; border: 2px solid var(--text);
  cursor: nwse-resize; touch-action: none;
}
.ie-ratios { display: flex; gap: 8px; margin-bottom: 12px; }
.ie-ratio {
  flex: 1; min-height: 40px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  font-size: 14px; cursor: pointer;
}
.ie-ratio.on { background: var(--text); color: #fff; border-color: var(--text); }
/* 图片编辑工具按钮（4 个旋转/翻转）：统一尺寸、统一 SVG 图标，保证 UI 一致 */
.ie-tools { display: flex; gap: 10px; justify-content: center; margin-bottom: 12px; }
.ie-tool-btn {
  width: 40px; height: 40px; border-radius: 12px; padding: 0;
  border: 1px solid var(--line); background: var(--card); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; line-height: 1; cursor: pointer; flex: none;
  transition: transform .1s ease, background .15s ease;
}
.ie-tool-btn .ticon { font-size: 18px; line-height: 1; display: inline-flex; }
.ie-tool-btn:active { transform: scale(0.94); background: var(--soft); }
.ie-zoom { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.ie-zoom span { font-size: 14px; color: var(--muted); }
.ie-zoom input[type=range] { flex: 1; accent-color: var(--text); }

.steps { display: flex; gap: 6px; margin: 16px 0 20px; }
.steps .dot { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.steps .dot.on { background: var(--primary); }

.pick-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pick {
  border: 2px solid transparent; border-radius: 16px; overflow: hidden;
  background: var(--card); box-shadow: var(--shadow-sm); padding: 0;
  cursor: pointer; transition: border-color .12s;
}
.pick img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.pick .pn {
  font-size: 12px;
  padding: 8px 6px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.pick.sel { border-color: var(--primary); }
.pick-empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 14px; }

/* 表单 */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 600;  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.field label .req { color: var(--danger); margin-left: 2px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 14px 16px;
  min-height: 50px; box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 14px; background: var(--card);
  font-size: 15px; color: var(--text);
  font-family: inherit;
  transition: border-color .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
}
/* 添加衣物弹窗里的尺码输入框：浅灰填充，明确为可输入控件 */
.field input.sz-in {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--text);
}
.field input.sz-in:focus { border-color: var(--primary); background: var(--card); }
.img-pick {
  width: 100%; aspect-ratio: 1/1; border-radius: 16px;
  border: 2px dashed var(--line);
  display: flex; align-items: center; justify-content: center; color: var(--muted);
  background: var(--card); overflow: hidden; position: relative;
  cursor: pointer; transition: border-color .15s;
}
.img-pick:hover { border-color: var(--muted); }
.img-pick img { width: 100%; height: 100%; object-fit: cover; }
.img-pick .ticon { font-size: 32px; }

/* Toast */
#toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%) translateY(8px);
  background: var(--text); color: #fff; padding: 12px 20px;
  border-radius: 24px; font-size: 14px; font-weight: 500;
  z-index: 100; opacity: 0;
  transition: opacity .2s, transform .2s; pointer-events: none; max-width: 80%;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 尺码对比 ===== */
.size-tabs {
  display: flex; gap: 8px; margin: 8px 0 16px;
}
.size-tab {
  flex: 1; padding: 13px 8px; text-align: center;
  border-radius: 14px; background: var(--card);
  border: 1px solid var(--line); font-weight: 600; font-size: 15px;
  color: var(--text); transition: all .15s;
}
.size-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.ref-panel {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  margin-bottom: 16px;
}
.ref-panel .rp-title {
  font-size: 11px; color: var(--muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px;
}
.ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
  gap: 10px;
}
.ref-grid .rf { display: flex; flex-direction: column; gap: 5px; }
.ref-grid .rf label { font-size: 11px; color: var(--muted); font-weight: 600; }
.ref-grid .rf input {
  width: 100%; padding: 10px 6px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--soft); font-size: 14px;
  text-align: center; color: var(--text); font-family: inherit;
  transition: border-color .15s;
}
.ref-grid .rf input:focus { outline: none; border-color: var(--primary); }
.ref-hint { font-size: 12px; color: var(--muted); margin-top: 12px; line-height: 1.5; }

/* ===== 尺码对比列表（flex + grid 重写，弃用 table） ===== */
.size-list {
  display: block;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* ---- 表头 ---- */
.size-list-head {
  display: flex;
  align-items: center;
  background: var(--soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}
.size-himg  { width: 54px; flex: none; padding: 9px 0 9px 14px; box-sizing: border-box; }
.size-hname { flex: 0 0 132px; width: 132px; padding: 9px 8px; box-sizing: border-box; }
.size-hcols { display: grid; flex: 1 1 0; min-width: 0; }
.size-hcols > div {
  text-align: center;
  padding: 9px 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.size-list-head .sortable { cursor: pointer; user-select: none; }
.size-list-head .sortable:active { background: #e8e6e4; }
.size-list-head .arr {
  font-size: 10px; margin-left: 2px;
  color: var(--primary); font-weight: 800;
}

/* ---- 数据行 ---- */
.size-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .12s;
}
.size-row:last-child { border-bottom: none; }
.size-row:active { background: var(--soft); }

.size-rmg {
  width: 54px; flex: none;
  padding: 10px 0 10px 14px; box-sizing: border-box;
}
.size-rmg img {
  width: 30px; height: 30px;
  border-radius: 8px; object-fit: cover;
  background: var(--soft); display: block;
}

.size-rname {
  flex: 0 0 132px; width: 132px;
  padding: 10px 8px; box-sizing: border-box;
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.size-rname .nm-txt {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
  flex: 1 1 0;
}

.size-rcols {
  display: grid;
  flex: 1 1 0; min-width: 0;
}
.size-rcols .cell {
  text-align: center;
  font-size: 13px;
  padding: 10px 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.size-rcols .cell.empty-cell { color: var(--muted-2); }

/* ---- 高亮行 ---- */
.size-row.match { background: rgba(0, 0, 0, 0.04); box-shadow: inset 3px 0 0 var(--accent); }
.size-row.match .nm-txt { font-weight: 700; }
.match-badge {
  display: inline-block; background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 600; padding: 1px 6px;
  border-radius: 6px; flex: none;
}
