:root {
  --primary: #4263EB;
  --bg: #F6F7FA;
  --card: #FFFFFF;
  --border: #ECEDF2;
  --text: #1A1D24;
  --gray: #8B909A;
  --gray2: #6B7280;
  --green-bg: #E7F4EC;
  --green-tx: #2E8B57;
  --amber-bg: #FCF1DD;
  --amber-tx: #9A6B12;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 16px rgba(16, 24, 40, .06);
  --shadow-hover: 0 2px 6px rgba(16, 24, 40, .06), 0 12px 30px rgba(66, 99, 235, .14);
  --primary-grad: linear-gradient(135deg, #4263EB 0%, #5B7CFA 100%);
  --radius: 14px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Sarasa Gothic SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

/* 真机：顶部留出系统状态栏/刘海安全区，内容整体下移，避免被半透明状态栏压住（视觉像虚化）。
   用 max(env, 52px) 兜底：即便设备不回报安全区，也至少下移 52px，确保标题行完全避开状态栏。 */
#view { padding: calc(max(env(safe-area-inset-top, 0px), 52px) + 6px) 16px 16px; }

/* 状态栏：仅桌面手机外壳内显示（真机有自己的系统状态栏） */
.statusbar { display: none; }

.screen-title { font-size: 21px; font-weight: 700; letter-spacing: .2px; }

.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); transition: box-shadow .18s ease, transform .18s ease; }

/* 按钮：高保真为胶囊形 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--primary-grad); color: #fff; border: none; border-radius: 999px;
  padding: 13px 18px; font-size: 15px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 12px rgba(66, 99, 235, .28);
  transition: transform .12s ease, box-shadow .18s ease;
}
.btn:active { transform: translateY(1px); box-shadow: 0 2px 8px rgba(66, 99, 235, .24); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-outline { background: #fff; color: var(--primary); border: 1.5px solid var(--primary); box-shadow: none; }
.btn-soft { background: #F1F2F6; color: var(--text); border: none; box-shadow: none; }
.btn-block { width: 100%; margin-top: 12px; }

/* 底部导航：高度含底部安全区，避免有 home indicator 的机器上被内边距挤扁导致文字溢出白框 */
.nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: calc(62px + env(safe-area-inset-bottom));
  background: #fff; border-top: 1px solid var(--border);
  display: flex; align-items: center;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-btn {
  flex: 1; background: none; border: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--gray); font-size: 11px; cursor: pointer;
}
.nav-btn.active { color: var(--primary); font-weight: 600; }
.nav-ico { line-height: 1; }
.nav-ico svg { width: 22px; height: 22px; display: block; }

/* 徽章 */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; align-self: flex-start; }
.badge-clean { background: var(--green-bg); color: var(--green-tx); }
.badge-wash { background: var(--amber-bg); color: var(--amber-tx); }

/* chips */
.chip {
  padding: 7px 13px; border-radius: 999px; background: #fff;
  border: 1px solid var(--border); font-size: 13px; color: var(--gray2); cursor: pointer;
  transition: all .15s ease;
}
.chip.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 600; }
.chip-weather.active { background: #EAF0FF; color: var(--primary); border-color: #C9D6FF; }
.chip-amber { background: var(--amber-bg); color: var(--amber-tx); border-color: transparent; }
.chip-amber.active { background: #F0A93C; color: #fff; border-color: #F0A93C; }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }

/* 衣橱网格 */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 14px; }
.cloth-card { padding: 10px; display: flex; flex-direction: column; }
.thumb-wrap { width: 100%; aspect-ratio: 4/3; border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #E8ECFA; }
.thumb-inner { width: 100%; height: 100%; object-fit: cover; display: block; }
div.thumb-inner { display: flex; align-items: center; justify-content: center; color: #7A8194; }
div.thumb-inner .ico { width: 34px; height: 34px; }
.cloth-name { font-size: 14px; font-weight: 600; margin: 8px 0 6px; }

.row { display: flex; gap: 10px; align-items: center; }
.wrap { display: flex; flex-wrap: wrap; gap: 6px; }

/* 表单 */
.field { display: block; margin: 14px 0; }
.field > label { font-size: 13px; color: var(--gray2); display: block; margin-bottom: 7px; }
.field input[type="text"], .field input:not([type]) {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border);
  border-radius: 12px; font-size: 15px; background: #fff; color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(66, 99, 235, .12);
}
.check-field { display: flex; align-items: center; gap: 8px; }
.check-field input[type="checkbox"] { accent-color: var(--primary); width: 18px; height: 18px; margin: 0; }
.check-field label { margin: 0; font-size: 14px; color: var(--text); }

.note {
  background: var(--amber-bg); color: var(--amber-tx);
  border-radius: 12px; padding: 11px 14px; font-size: 13px; margin: 10px 0;
  line-height: 1.5;
}
.note-local { font-size: 12px; color: var(--gray); text-align: center; margin-top: 12px; }

/* 上传区：高保真为浅灰实底（非虚线框） */
.upload {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: #F1F2F6; border: 1px solid #E7E9F0; border-radius: 16px;
  padding: 36px; color: var(--gray2); font-size: 14px; cursor: pointer;
}
.upload-ico { color: #A6ACBC; display: flex; }
.upload-ico .ico { width: 30px; height: 30px; }

/* 形象照：浅紫蓝柔和渐变 */
.person-area {
  width: 100%; aspect-ratio: 3/4;
  background: linear-gradient(170deg, #A9B5EC 0%, #C4CDF4 60%, #D4DAF8 100%);
  border-radius: 16px; display: flex; align-items: center; justify-content: center;
  color: #fff; cursor: pointer; overflow: hidden; position: relative;
}
.person-area img { width: 100%; height: 100%; object-fit: cover; }
.person-ph { display: flex; flex-direction: column; align-items: center; gap: 10px; font-size: 13px; opacity: .95; }
.person-ico { opacity: .95; }
.person-ico .ico { width: 44px; height: 44px; }

/* 今日搭配：并列示意 */
.today-split { display: flex; gap: 12px; align-items: stretch; margin-top: 12px; }
.person-col { width: 142px; flex: none; }
.outfit-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.today-split .person-area { height: 100%; aspect-ratio: auto; }
.col-label { font-size: 13px; color: var(--gray); margin-bottom: 8px; }

/* 提示条 / AI 说明卡 */
.tipbar {
  display: flex; gap: 8px; align-items: flex-start;
  background: var(--amber-bg); color: #8A6A1F;
  border-radius: 12px; padding: 11px 13px; font-size: 13px; line-height: 1.5; margin-top: 12px;
}
.tipbar .ico { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.ai-note {
  background: #EEF1FC; border-radius: 12px; padding: 12px 14px;
  font-size: 13px; color: #4A5060; line-height: 1.55; margin-top: 14px;
}
.ai-note-t { color: var(--primary); font-weight: 600; font-size: 13px; margin-bottom: 4px; }

/* 标题行右侧 */
.title-row { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 2px; min-height: 30px; }
.title-row .screen-title { margin: 0; }
.title-meta { color: var(--gray); font-size: 13px; margin-right: 10px; }
.title-link { color: var(--primary); font-size: 14px; font-weight: 500; cursor: pointer; }
.title-link-muted { color: var(--gray); font-size: 14px; cursor: pointer; }

/* 单品卡（今日搭配右列） */
.outfit-card {
  display: flex; gap: 10px; align-items: center; padding: 10px;
  background: #fff; border: 1px solid var(--border); border-radius: 14px; margin-bottom: 8px;
  box-shadow: var(--shadow);
}
.outfit-thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; flex: none; }
div.outfit-thumb.ph { display: flex; align-items: center; justify-content: center; color: #7A8194; }
div.outfit-thumb.ph .ico { width: 24px; height: 24px; }
.oc-txt { flex: 1; min-width: 0; }
.oc-name { font-size: 14px; font-weight: 600; }
.oc-sub { font-size: 12px; color: var(--gray); margin-top: 2px; }
.oc-sub.amber { color: var(--amber-tx); }

/* 实心勾选圆（高保真样式） */
.dot-check {
  width: 24px; height: 24px; border-radius: 50%;
  background: #E4E8F1; flex: none; cursor: pointer;
  transition: background .15s ease, transform .12s ease;
}
.dot-check:active { transform: scale(.92); }
.dot-check.on { background: var(--primary); position: relative; }
.dot-check.on::after {
  content: ''; position: absolute; left: 8px; top: 4.5px;
  width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2.5px 2.5px 0;
  transform: rotate(42deg);
}

/* 推荐搭配卡 */
.match-card { padding: 14px; margin-bottom: 14px; }
.match-h { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.slot-row { display: flex; gap: 8px; }
.slot {
  flex: 1; aspect-ratio: 74/110; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: #8A90A2; overflow: hidden;
}
.slot img { width: 100%; height: 100%; object-fit: cover; }
.slot .ico { width: 26px; height: 30px; }
.match-reason { font-size: 13px; color: #4A5060; line-height: 1.55; margin: 12px 0 2px; }
.match-actions { display: flex; gap: 10px; margin-top: 12px; }
.match-actions .btn { flex: 1; margin-top: 0; padding: 11px 0; }
.match-actions .btn-soft .ico { width: 16px; height: 16px; }

/* 衣橱搜索 + 洗衣状态行 */
.search-wrap { position: relative; margin-top: 12px; }
.search-wrap #search {
  width: 100%; padding: 11px 14px 11px 40px; border: 1px solid var(--border);
  border-radius: 999px; font-size: 15px; background: #fff; color: var(--text);
}
.search-ico { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--gray); display: flex; }
.search-ico .ico { width: 18px; height: 18px; }
.wash-row { display: flex; align-items: center; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.wash-label { font-size: 13px; color: var(--gray2); margin-right: 2px; }

/* 我的 */
.me-card { display: flex; align-items: center; gap: 14px; padding: 16px; cursor: pointer; }
.me-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; }
.me-avatar.ph {
  background: linear-gradient(170deg, #A9B5EC, #CBD3F7);
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.me-avatar.ph .ico { width: 26px; height: 26px; }
.me-name { font-size: 16px; font-weight: 700; }
.me-sub { font-size: 12px; color: var(--gray); margin-top: 3px; }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.modal-box { background: #fff; width: 100%; max-width: 480px; border-radius: 20px 20px 0 0; padding: 18px; max-height: 90vh; overflow: auto; }

.hidden { display: none !important; }
.gen-tip { font-size: 12px; color: var(--green-tx); background: var(--green-bg); border-radius: 8px; padding: 7px 11px; margin-top: 10px; }
.ico { width: 1.25em; height: 1.25em; display: inline-block; vertical-align: -0.15em; }

/* 小屏堆叠 */
@media (max-width: 360px) {
  .today-split { flex-direction: column; }
  .person-col { width: 100%; }
  .today-split .person-area { aspect-ratio: 3/4; height: auto; }
}

/* 桌面预览：手机外壳 + 状态栏，宽屏上像一部手机 */
@media (min-width: 600px) {
  html, body {
    height: 100%;
    background: linear-gradient(160deg, #EBEEF5, #D7DCE8);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
  }
  body { margin: 0; }
  #app {
    display: flex; flex-direction: column;
    width: 390px;
    height: min(100%, 844px);
    max-width: none;
    margin: 0;
    border-radius: 46px;
    border: 12px solid #15171D;
    box-shadow: 0 24px 70px rgba(20, 24, 40, .30), inset 0 0 0 2px rgba(255, 255, 255, .05);
    overflow: hidden;
    padding-bottom: 0;
  }
  .statusbar {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 26px 4px; font-size: 15px; font-weight: 600;
    background: var(--bg); position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  }
  .sb-right { display: flex; gap: 6px; align-items: center; }
  .sb-right svg { height: 12px; width: auto; display: block; }
  #view {
    flex: 1 1 auto; min-height: 0;
    overflow-y: auto;
    padding: 44px 16px 90px;
    -webkit-overflow-scrolling: touch;
  }
  .nav {
    position: static; flex: none;
    transform: none;
    width: 100%;
    max-width: none;
  }
  .modal { position: absolute; }
  .modal-box { max-width: none; }
  .cloth-card:hover, .outfit-card:hover, .match-card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
}
