/**
 * 智能衣橱 - 主样式（C 端 index/share + 协议页）
 * 视觉体系来自 PRD 原型：--accent:#C2497B / --accent2:#6F5CE8 / --bg:#FBF8F6，
 * 圆角 12-18px，移动优先；桌面访问时居中手机版式（max-width 430px 卡片式）。
 * 禁止 CDN/远程字体：Outfit 通过本地 @font-face 引入，中文回退 PingFang SC / Noto Sans CJK SC。
 */

/* ---------- 本地字体（英文/数字用 Outfit，中文走系统回退） ---------- */
@font-face {
  font-family: 'Outfit';
  src: url('../assets/fonts/Outfit-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Outfit';
  src: url('../assets/fonts/Outfit-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- 设计变量 ---------- */
:root {
  --accent: #C2497B;
  --accent2: #6F5CE8;
  --bg: #FBF8F6;
  --ink: #26222B;          /* 主文字 */
  --ink-2: #7A7280;        /* 次要文字 */
  --line: #EAE2E8;         /* 分隔线/边框 */
  --card: #FFFFFF;
  --danger: #C0392B;
  --ok: #2E9E6B;
  --tint: #F9E9F1;         /* accent 浅底（提示条/选中底） */
  --tint2: #EFEBFC;        /* accent2 浅底 */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --tabbar-h: 56px;
  --shadow-card: 0 2px 10px rgba(86, 54, 76, 0.06);
}

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

html, body { height: 100%; }

body {
  font-family: 'Outfit', 'PingFang SC', 'Noto Sans CJK SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: #EDE6EA;     /* 桌面访问时手机卡片外的衬底 */
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

/* ---------- 手机版式框架：桌面居中 430px 卡片 ---------- */
.phone {
  position: relative;
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  margin: 0 auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* 桌面（宽屏）时给手机卡片阴影与圆角，明确"移动优先居中版式" */
@media (min-width: 500px) and (min-height: 700px) {
  body { display: flex; align-items: center; justify-content: center; }
  .phone {
    height: min(92dvh, 900px);
    border-radius: 28px;
    box-shadow: 0 24px 64px rgba(60, 34, 54, 0.22);
  }
}

#view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
/* 编辑器画布态禁用滚动，避免拖拽画布时页面跟手滚动 */
body.editing #view { overflow: hidden; }

/* ---------- 底部 Tab ---------- */
.tabbar {
  flex: none;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  background: var(--card);
  border-top: 1px solid var(--line);
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--ink-2);
  font-size: 11px;
}
.tab-item .tab-ico { width: 23px; height: 23px; }
.tab-item.on { color: var(--accent); font-weight: 700; }
/* 登录页 / 衣橱管理模式 / 编辑器画布态隐藏 Tab，避免误触 */
body.no-tab .tabbar,
body.managing .tabbar,
body.editing .tabbar { display: none; }

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 44px;
  padding: 0 22px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
  transition: opacity 0.15s ease;
}
.btn:active { opacity: 0.85; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.ghost {
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line);
  font-weight: 400;
}
.btn.danger { background: var(--danger); }
.btn.sm { height: 32px; padding: 0 14px; font-size: 13px; border-radius: var(--r-sm); font-weight: 400; }
.btn.block { display: flex; width: 100%; }
.btn-row { display: flex; gap: 10px; align-items: center; }
.danger-text { color: var(--danger) !important; }

/* ---------- 表单 ---------- */
.field {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s ease;
}
.field:focus { border-color: var(--accent); }
.field.sm { height: 36px; font-size: 13px; border-radius: var(--r-sm); }
select.field { appearance: none; }
.f-lbl { display: block; margin: 14px 0 6px; font-size: 13px; font-weight: 700; color: var(--ink); }
.f-tip { font-size: 12px; color: var(--ink-2); font-weight: 400; }
.f-err {
  display: none;
  margin-top: 6px;
  font-size: 12px;
  color: var(--danger);
}
.f-err.show { display: block; }

/* ---------- 标签 / Chip ---------- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
/* 分类筛选横向滚动条：分类多一行放不下，滑屏浏览 */
.chip-row.cat-row,
.chip-row.ed-cats {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.chip-row.cat-row::-webkit-scrollbar,
.chip-row.ed-cats::-webkit-scrollbar { display: none; }

/* 小标签（Pro / 免费版 / 商品图等） */
.tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  background: #F1ECEF;
  color: var(--ink-2);
  vertical-align: middle;
}
.tag.pro { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; }
.tag.free { background: #F1ECEF; color: var(--ink-2); }

/* ---------- 卡片 / 列表 ---------- */
.card {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card);
}
.card-title { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; border: none; }

.list-card { padding: 4px 0; }
.list-row {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px;
  border: none;
  background: none;
  font-size: 15px;
  color: var(--ink);
  text-align: left;
}
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-arrow { color: var(--ink-2); font-size: 13px; }

/* 权益列表：accent 对勾，比默认 disc 更贴合品牌 */
.benefit-list { list-style: none; }
.benefit-list li {
  position: relative;
  padding-left: 24px;
  margin: 8px 0;
  font-size: 14px;
}
.benefit-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 700;
}

/* ---------- 提示条 ---------- */
.notice-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--tint);
  border-radius: var(--r-md);
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--accent);
}
.notice-bar.soft { background: #F4EFF5; color: var(--ink-2); }

/* ---------- 页面骨架 ---------- */
.vnav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 16px;
  background: rgba(251, 248, 246, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.vnav-title { font-size: 18px; font-weight: 700; }
.vnav-act {
  border: none;
  background: none;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  padding: 6px 0;
}
.page-pad { padding: 4px 16px 28px; }

/* ---------- 空状态 / 骨架屏 ---------- */
.empty { text-align: center; padding: 56px 24px; color: var(--ink-2); }
.empty-icon { font-size: 44px; margin-bottom: 10px; color: var(--line); }
.empty-text { font-size: 14px; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }

.sk {
  border-radius: var(--r-md);
  background: linear-gradient(90deg, #F1EBEF 25%, #F9F4F7 50%, #F1EBEF 75%);
  background-size: 200% 100%;
  animation: sk-move 1.3s infinite linear;
}
@keyframes sk-move { to { background-position: -200% 0; } }
.sk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sk-card { aspect-ratio: 3 / 4; }
.sk-col { display: flex; flex-direction: column; gap: 12px; }
.sk-row { height: 84px; }

/* ---------- 浮层：遮罩 / 底部面板 / 模态框 / Toast（锚定在手机卡片内） ---------- */
.mask {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(38, 28, 36, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.mask.show { opacity: 1; pointer-events: auto; }

.sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  max-height: 88%;
  overflow-y: auto;
  background: var(--card);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 20px 16px calc(18px + env(safe-area-inset-bottom));
  transform: translateY(105%);
  transition: transform 0.24s ease;
}
.sheet.show { transform: translateY(0); }
.sheet-title { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.sheet-sub { font-size: 13px; color: var(--ink-2); margin-bottom: 8px; }
.sheet-scroll { /* 属性编辑等内容较长时可滚动，最大高度交给 .sheet 的 max-height */ }

.modal-root { position: absolute; inset: 0; z-index: 60; display: none; }
.modal-root.show { display: block; }
.modal-mask { position: absolute; inset: 0; background: rgba(38, 28, 36, 0.45); }
.modal-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(86%, 340px);
  max-height: 80%;
  overflow-y: auto;
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 20px;
}
.modal-title { font-size: 16px; font-weight: 700; }
.modal-text { font-size: 13px; color: var(--ink-2); margin-top: 8px; }

.toast {
  position: absolute;
  left: 50%;
  bottom: 96px;
  z-index: 70;
  transform: translate(-50%, 12px);
  max-width: 82%;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(38, 34, 43, 0.92);
  color: #fff;
  font-size: 13px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: rgba(192, 57, 43, 0.94); }
.toast.ok { background: rgba(46, 158, 107, 0.94); }

/* 签名 URL 重试一次仍失败的图片：弱化显示，避免破图图标影响视觉 */
.img-broken { opacity: 0.25; filter: grayscale(1); }

.version-tip { text-align: center; font-size: 11px; color: var(--ink-2); padding: 18px 0 8px; }

/* ================= 登录 / 注册 ================= */
.auth-wrap { padding: 64px 28px 32px; }
.auth-brand { text-align: center; margin-bottom: 30px; }
.auth-logo {
  width: 68px;
  height: 68px;
  margin: 0 auto 14px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-size: 32px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(194, 73, 123, 0.3);
}
.auth-name { font-size: 22px; font-weight: 700; }
.auth-slogan { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.auth-tabs { justify-content: center; margin-bottom: 20px; }
.agree-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--ink-2);
}
.agree-row input { margin-top: 2px; accent-color: var(--accent); }

/* ================= 衣橱 ================= */
.cloth-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.cloth-card { position: relative; cursor: pointer; }
.cloth-img {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--r-md);
  overflow: hidden;
  background: linear-gradient(160deg, #F7F1F4, #F1EBF0);
}
.cloth-img img { width: 100%; height: 100%; object-fit: contain; }
.cloth-name {
  margin-top: 5px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 多选勾：管理模式下半透明显示，选中后实心 accent */
.cloth-card .check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid var(--line);
  color: transparent;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
}
body.managing .cloth-card .check { opacity: 0.6; }
.cloth-card.sel .check { opacity: 1; background: var(--accent); border-color: var(--accent); color: #fff; }
.cloth-card.sel .cloth-img { outline: 2px solid var(--accent); }
.pimg-tag {
  position: absolute;
  left: 6px;
  top: 6px;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(38, 34, 43, 0.6);
  color: #fff;
  font-size: 10px;
  display: flex;
  align-items: center;
}
/* 管理模式底部操作条 */
.selbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--card);
  border-top: 1px solid var(--line);
  transform: translateY(105%);
  transition: transform 0.22s ease;
}
.selbar.show { transform: translateY(0); }

/* 详情抽屉 */
.detail-head { display: flex; gap: 14px; }
.detail-img {
  flex: none;
  width: 104px;
  height: 104px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: linear-gradient(160deg, #F7F1F4, #F1EBF0);
}
.detail-img img { width: 100%; height: 100%; object-fit: contain; }
.detail-meta { flex: 1; min-width: 0; }
.detail-name { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.detail-sub { font-size: 12px; color: var(--ink-2); margin-top: 3px; }
.product-status { min-height: 16px; }

/* ================= 智能录入 ================= */
.step-dots { display: flex; justify-content: center; gap: 8px; padding: 6px 0 14px; }
.step-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--line);
  transition: background 0.2s ease;
}
.step-dots i.on { background: var(--accent); }

.pick-drop {
  border: 1.5px dashed #D9C6D2;
  border-radius: var(--r-lg);
  background: var(--card);
  padding: 44px 20px;
  text-align: center;
  font-size: 15px;
  color: var(--ink);
  cursor: pointer;
}
.pick-drop.sm { padding: 20px; font-size: 13px; color: var(--ink-2); }
.pick-plus { font-size: 34px; color: var(--accent); line-height: 1.2; margin-bottom: 6px; }
.copyright-tip { font-size: 11px; color: var(--ink-2); text-align: center; margin-top: 10px; }

/* AI 处理中：原图 + bbox 叠框 */
.ai-img-wrap {
  position: relative;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: #F1EBF0;
  min-height: 220px;
}
.ai-img { width: 100%; }
.ai-img-placeholder { padding: 90px 0; text-align: center; color: var(--ink-2); font-size: 13px; }
.bbox {
  position: absolute;
  border: 1.5px dashed var(--accent);
  border-radius: 6px;
  background: rgba(194, 73, 123, 0.06);
}
.bbox-tag {
  position: absolute;
  left: -1.5px;
  top: -20px;
  height: 18px;
  padding: 0 7px;
  border-radius: 6px 6px 6px 0;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  display: flex;
  align-items: center;
  white-space: nowrap;
}
.ai-steps { margin-top: 14px; }
.ai-steps .kv {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 2px;
  font-size: 13px;
  color: var(--ink-2);
}
.ai-steps .kv b { color: var(--accent); font-weight: 700; }

.ai-error-box {
  margin-top: 14px;
  background: #FBEEEC;
  border-radius: var(--r-md);
  padding: 14px;
  text-align: center;
}
.ai-error-msg { font-size: 13px; color: var(--danger); }

/* 结果确认网格 */
.confirm-grid { display: flex; flex-direction: column; gap: 10px; }
.confirm-card {
  display: flex;
  gap: 12px;
  background: var(--card);
  border: 1.5px solid transparent;
  border-radius: var(--r-md);
  padding: 10px;
  box-shadow: var(--shadow-card);
}
.confirm-card.sel { border-color: var(--accent); }
.confirm-card.failed { background: #FBF6F4; }
.confirm-img {
  position: relative;
  flex: none;
  width: 96px;
  height: 96px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: linear-gradient(160deg, #F7F1F4, #F1EBF0);
  cursor: pointer;
}
.confirm-card .check {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  border: 1.5px solid var(--line);
  color: transparent;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.confirm-card.sel .check { background: var(--accent); border-color: var(--accent); color: #fff; }
.seg-fail-tag {
  position: absolute;
  left: 5px;
  bottom: 5px;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(192, 57, 43, 0.85);
  color: #fff;
  font-size: 10px;
  display: flex;
  align-items: center;
}
/* bbox 区域预览：原图按比例偏移裁剪，容器正方形隐藏溢出 */
.crop-view { position: absolute; inset: 0; overflow: hidden; }
.crop-view img { position: absolute; max-width: none; }
.confirm-info { flex: 1; min-width: 0; }
.confirm-attrs { font-size: 12px; color: var(--ink-2); margin-top: 5px; }

/* 手动裁剪编辑器 */
.crop-editor {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #F1EBF0;
  touch-action: none; /* 指针拖框时禁止浏览器滚动手势抢事件 */
  user-select: none;
}
.crop-editor img { width: 100%; pointer-events: none; }
.crop-rect {
  position: absolute;
  border: 2px solid var(--accent);
  background: rgba(194, 73, 123, 0.12);
  border-radius: 4px;
}

/* 成功页 */
.done-wrap { text-align: center; padding: 48px 24px; }
.done-check {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-size: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.done-title { font-size: 18px; font-weight: 700; }

/* ================= 搭配编辑器 ================= */
.ed-wrap { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.ed-top {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 12px;
}
.ed-back {
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  font-size: 26px;
  color: var(--ink);
  line-height: 1;
}
.ed-title { font-size: 16px; font-weight: 700; }
.ed-save {
  border: none;
  background: none;
  color: var(--accent);
  font-size: 15px;
  font-weight: 700;
  padding: 6px 4px;
}
/* 画布宽度按视口高度反推：保证 750:1050 画布 + 工具区整体不溢出小屏 */
.ed-canvas {
  flex: none;
  position: relative;
  width: min(100%, calc((100dvh - 258px) / 1.4));
  margin: 0 auto;
  background: #fff;
  box-shadow: var(--shadow-card);
  border-radius: 4px;
  overflow: hidden;
}
.ed-loading { padding: 120px 0; text-align: center; color: var(--ink-2); font-size: 13px; }
/* 浮动工具条：选中图层时出现 */
.ed-toolbar {
  flex: none;
  display: none;
  justify-content: center;
  gap: 4px;
  margin: 8px auto 0;
  width: fit-content;
  background: rgba(38, 34, 43, 0.88);
  border-radius: 999px;
  padding: 5px 8px;
}
.ed-toolbar.show { display: flex; }
.ed-toolbar button {
  border: none;
  background: none;
  color: #fff;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
}
.ed-toolbar button:active { background: rgba(255, 255, 255, 0.15); }
.ed-bg-row {
  flex: none;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 16px 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
.ed-bg-row::-webkit-scrollbar { display: none; }
.bg-chip {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
}
.ed-rail-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-top: 1px solid var(--line);
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
}
.ed-cats { padding: 0 12px; }
.ed-rail {
  flex: 1;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 12px;
  align-items: center;
}
.rail-item {
  flex: none;
  width: 64px;
  height: 64px;
  border-radius: var(--r-sm);
  background: linear-gradient(160deg, #F7F1F4, #F1EBF0);
  overflow: hidden;
  cursor: pointer;
}
.rail-item img { width: 100%; height: 100%; object-fit: contain; }

/* 穿搭卡片（列表 / 日历选择器共用） */
.outfit-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.outfit-grid.pick { max-height: 52dvh; overflow-y: auto; }
.outfit-card { cursor: pointer; }
.outfit-cover {
  position: relative;
  aspect-ratio: 5 / 7;
  border-radius: var(--r-md);
  overflow: hidden;
  background: linear-gradient(160deg, #F7F1F4, #EFE9F6);
}
.outfit-cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  color: var(--line);
}
.outfit-name { font-size: 13px; font-weight: 700; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.outfit-sub { font-size: 11px; color: var(--ink-2); margin-top: 2px; }

/* 分享链接盒与历史 */
.link-box {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px;
  background: #FBF7F9;
}
.link-text {
  font-size: 12px;
  color: var(--ink);
  word-break: break-all;
  margin: 6px 0 10px;
  user-select: all;
}
.share-list { max-height: 200px; overflow-y: auto; }
.share-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.share-row:last-child { border-bottom: none; }
.share-row-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

/* ================= 日历 ================= */
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px 12px;
  font-size: 16px;
}
.cal-nav {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--card);
  font-size: 20px;
  color: var(--ink);
  box-shadow: var(--shadow-card);
}
.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  color: var(--ink-2);
  padding-bottom: 6px;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-cell {
  position: relative;
  aspect-ratio: 0.82;
  border-radius: var(--r-sm);
  background: var(--card);
  overflow: hidden;
}
.cal-cell.blank { background: transparent; }
.cal-cell[data-date] { cursor: pointer; }
.cal-cell.has { box-shadow: 0 0 0 1.5px var(--accent) inset; }
.cal-num {
  position: absolute;
  left: 5px;
  top: 3px;
  z-index: 2;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  text-shadow: 0 0 4px #fff, 0 0 4px #fff;
}
.cal-cell.today .cal-num {
  left: 4px;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  text-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}
.cal-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cal-weather {
  position: absolute;
  left: 4px;
  bottom: 4px;
  z-index: 2;
  max-width: calc(100% - 8px);
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  font-size: 9px;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
}
.day-cover {
  width: min(70%, 260px);
  margin: 4px auto 0;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #F1EBF0;
}

/* ================= 数据统计 ================= */
.stat-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 12px; }
.metric {
  background: var(--card);
  border-radius: var(--r-lg);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow-card);
}
.metric .num {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.metric .lbl { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.chart { width: 100%; }
.dormant-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.dormant-row:last-child { border-bottom: none; }
.dormant-img {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: linear-gradient(160deg, #F7F1F4, #F1EBF0);
}
.dormant-img img { width: 100%; height: 100%; object-fit: contain; }
.dormant-info { flex: 1; min-width: 0; }
.dormant-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ================= 我的 ================= */
.me-profile { display: flex; align-items: center; gap: 14px; }
.me-avatar {
  flex: none;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.me-info { flex: 1; min-width: 0; }
.me-name { font-size: 17px; font-weight: 700; }
.me-sub { font-size: 12px; color: var(--ink-2); margin-top: 3px; }

.quota-row { margin-bottom: 12px; }
.quota-row:last-child { margin-bottom: 0; }
.quota-lbl { font-size: 13px; margin-bottom: 6px; }
.quota-lbl b { font-variant-numeric: tabular-nums; }
.progress {
  height: 8px;
  border-radius: 999px;
  background: #F1E7EE;
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  transition: width 0.3s ease;
}

/* Pro 会员卡（渐变）与权益卡 */
.pro-card {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
}
.pro-card-head { display: flex; align-items: center; justify-content: space-between; font-size: 17px; }
.pro-badge {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  font-size: 11px;
  font-weight: 700;
}
.pro-expire { font-size: 12px; opacity: 0.85; margin-top: 8px; }
.pro-upsell { border: 1px solid #F0D4E1; }

.redeem-row { display: flex; gap: 8px; }
.redeem-row .field { flex: 1; }
.redeem-row .btn { flex: none; height: 44px; }

.pay-row { display: flex; gap: 14px; align-items: flex-start; }
.pay-qr {
  flex: none;
  width: 128px;
  height: 128px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  object-fit: cover;
}

.invite-code-row { display: flex; align-items: center; gap: 10px; }
.invite-code {
  flex: 1;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  background: #F6F0F4;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-align: center;
}

/* ================= 分享公开页 ================= */
.share-body .phone { background: var(--bg); }
.share-view { padding: 0 16px calc(24px + env(safe-area-inset-bottom)); }
.share-loading { text-align: center; color: var(--ink-2); padding: 120px 0; }
.share-head {
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.3em;
  color: var(--ink-2);
  padding: 18px 0 12px;
}
.share-preview-wrap {
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(86, 54, 76, 0.14);
}
.share-preview { display: block; width: 100%; height: auto; }
.share-title { font-size: 20px; font-weight: 700; text-align: center; margin-top: 16px; }
.share-sub { font-size: 12px; color: var(--ink-2); text-align: center; margin-top: 5px; }
.share-sec { font-size: 15px; font-weight: 700; margin: 20px 0 10px; }
.share-items { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.share-item-img {
  aspect-ratio: 1;
  border-radius: var(--r-md);
  overflow: hidden;
  background: linear-gradient(160deg, #F7F1F4, #F1EBF0);
}
.share-item-img img { width: 100%; height: 100%; object-fit: contain; }
.share-item-name { font-size: 12px; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share-item-cat { font-size: 10px; color: var(--ink-2); }
.share-actions { margin-top: 22px; }
.share-note { font-size: 11px; color: var(--ink-2); text-align: center; margin-top: 16px; }
.share-dead { text-align: center; padding: 130px 30px 0; }
.share-dead-ico { font-size: 46px; color: var(--line); margin-bottom: 12px; }
.share-dead-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.share-dead-sub { font-size: 13px; color: var(--ink-2); margin-bottom: 18px; }

/* ================= 协议页（terms / privacy） ================= */
.doc-body { background: var(--bg); }
.doc {
  max-width: 430px;
  margin: 0 auto;
  padding: 30px 22px 60px;
}
.doc h1 { font-size: 20px; margin-bottom: 6px; }
.doc h2 { font-size: 15px; margin: 22px 0 8px; }
.doc p { font-size: 13px; color: #3A3440; margin: 7px 0; line-height: 1.8; }
.doc-meta { font-size: 12px !important; color: var(--ink-2) !important; }

/* ================= 确认页商品图 ================= */
.confirm-img .product-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.product-tag {
  position: absolute;
  left: 5px;
  top: 5px;
  height: 18px;
  padding: 0 7px;
  border-radius: 999px;
  background: rgba(194, 73, 123, 0.82);
  color: #fff;
  font-size: 10px;
  display: flex;
  align-items: center;
}

/* ================= OOTD 试穿预览 ================= */
.ootd-badge {
  position: absolute;
  right: 6px;
  top: 6px;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  letter-spacing: 0.05em;
}
.ootd-wrap { display: flex; flex-direction: column; gap: 14px; }
.ootd-preview {
  border-radius: var(--r-lg);
  overflow: hidden;
  background: linear-gradient(160deg, #F7F1F4, #EFE9F6);
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ootd-main-img { width: 100%; height: 100%; object-fit: cover; }
.ootd-placeholder { text-align: center; padding: 30px; color: var(--ink-2); }
.ootd-placeholder-ico { font-size: 44px; margin-bottom: 12px; }
.ootd-placeholder p { font-size: 13px; line-height: 1.6; }

.ootd-items-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.ootd-items-row::-webkit-scrollbar { display: none; }
.ootd-item { flex: none; width: 76px; text-align: center; }
.ootd-item-img {
  width: 76px;
  height: 76px;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: linear-gradient(160deg, #F7F1F4, #F1EBF0);
}
.ootd-item-img img { width: 100%; height: 100%; object-fit: contain; }
.ootd-item-name {
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ootd-item-cat { font-size: 10px; color: var(--ink-2); }

.ootd-controls { display: flex; flex-direction: column; gap: 8px; }
.ootd-loading { text-align: center; padding: 50px 20px; color: var(--ink-2); }
.ootd-loading p { font-size: 14px; font-weight: 600; margin-top: 14px; }
.ootd-loading .f-tip { font-size: 12px; margin-top: 4px; }
.ootd-spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ootd-spin 0.8s linear infinite;
}
@keyframes ootd-spin { to { transform: rotate(360deg); } }
