/* 电子衣橱 · 样式
   设计原则：白底等大网格、一眼扫全；移动端优先，桌面居中。 */

:root {
  --bg: #F7F6F2;
  --surface: #FFFFFF;
  --surface-2: #F1EFE8;
  --border: #E3E0D6;
  --text: #23221F;
  --text-2: #6B6862;
  --text-3: #97948B;
  --brand: #185FA5;
  --brand-soft: #E6F1FB;
  --brand-ink: #0C447C;
  --teal: #0F6E56;
  --teal-soft: #E1F5EE;
  --danger: #A32D2D;
  --danger-soft: #FCEBEB;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --tab-h: 60px;
  --shadow: 0 4px 20px rgba(35, 34, 31, .10);
}

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

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
               "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button { font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
.hidden { display: none !important; }

/* ---------- 应用骨架 ---------- */

#app {
  height: 100vh;
  height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  position: relative;
}

main {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 14px calc(var(--tab-h) + 32px + env(safe-area-inset-bottom, 0px));
}

.view { animation: fade .18s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } }

/* ---------- 顶栏 ---------- */

.topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: var(--bg);
}

.topbar-title { display: flex; align-items: baseline; gap: 10px; }
.topbar-title h1 { font-size: 20px; font-weight: 500; margin: 0; letter-spacing: -.01em; }
.count { font-size: 13px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.topbar-actions { display: flex; gap: 6px; }

.icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  transition: background .15s;
}
.icon-btn:active { background: var(--surface-2); }

/* ---------- 搜索 ---------- */

.searchbar {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 10px;
  padding: 0 16px 10px;
}
.searchbar input {
  flex: 1;
  height: 38px;
  padding: 0 14px;
  border: 0.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  outline: none;
}
.searchbar input:focus { border-color: var(--brand); }

/* ---------- 分类筛选 ---------- */

.chips {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 16px 10px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
  transition: all .15s;
}
.chip.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 500;
}

/* ---------- 网格 ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
}

.tile {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #fff;
  border: 0.5px solid var(--border);
  cursor: pointer;
  transition: transform .12s ease;
}
.tile:active { transform: scale(.97); }

.tile img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
  background: #fff;
}
.tile img.placeholder { opacity: 0; }

.tile-meta {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 14px 8px 6px;
  background: linear-gradient(to top, rgba(255,255,255,.96) 40%, rgba(255,255,255,0));
  font-size: 11px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tile-dot {
  position: absolute;
  top: 7px; right: 7px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--border);
}
.tile-dot.stored { background: #C9C5B8; }
.tile-dot.retired { background: var(--danger-soft); border: 1px solid #E5B4B4; }

/* ---------- 空状态 ---------- */

.empty { text-align: center; padding: 72px 24px; }
.empty-art { color: var(--text-3); opacity: .5; margin-bottom: 12px; }
.empty-title { font-size: 16px; font-weight: 500; margin: 0 0 4px; }
.empty-desc { font-size: 13px; color: var(--text-3); margin: 0 0 22px; }

/* ---------- 按钮 ---------- */

.primary-btn {
  height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  transition: opacity .15s;
}
.primary-btn:active { opacity: .85; }

.ghost-btn {
  height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  border: 0.5px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 15px;
}

.ghost-danger-btn {
  height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  border: 0.5px solid #E5B4B4;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 15px;
}

.danger-btn {
  height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
}

.small-btn {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  border: 0.5px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  color: var(--text-2);
  flex-shrink: 0;
}

.text-btn { font-size: 14px; color: var(--brand); padding: 6px 8px; }

/* ---------- 底部导航 & FAB ---------- */

.tabbar {
  flex-shrink: 0;
  display: flex;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--surface);
  border-top: 0.5px solid var(--border);
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-3);
  font-size: 11px;
  transition: color .15s;
}
.tab.active { color: var(--brand); }

.fab {
  position: fixed;
  right: 16px;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 18px);
  width: 54px; height: 54px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
  z-index: 20;
  transition: transform .15s ease;
}
.fab:active { transform: scale(.92); }

@media (min-width: 592px) {
  .fab { right: calc(50% - 280px + 16px); }
}

/* ---------- 弹层 ---------- */

.sheet {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.sheet-backdrop {
  position: absolute; inset: 0;
  background: rgba(20, 20, 18, .38);
  animation: fade .2s ease;
}

.sheet-panel {
  position: relative;
  background: var(--surface);
  border-radius: 18px 18px 0 0;
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
  padding: 8px 20px calc(22px + env(safe-area-inset-bottom, 0px));
  animation: up .22s cubic-bezier(.2, .8, .2, 1);
}
@keyframes up { from { transform: translateY(40px); opacity: .6; } }

.sheet-grip {
  width: 36px; height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin: 4px auto 14px;
}

.sheet-title { font-size: 17px; font-weight: 500; margin-bottom: 14px; }

@media (min-width: 640px) {
  .sheet-panel { max-width: 560px; margin: 0 auto; }
}

/* ---------- 表单 ---------- */

.editor-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  overflow: hidden;
  margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center;
}
.editor-photo img { max-width: 100%; max-height: 100%; object-fit: contain; }

.badge {
  position: absolute;
  top: 8px; left: 8px;
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
}

.field { display: block; margin-bottom: 16px; }
.field-label {
  display: block;
  font-size: 12px;
  color: var(--text-3);
  margin-bottom: 7px;
}
.field input[type="text"],
.field input[type="number"],
.field input[type="date"] {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 0.5px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  outline: none;
}
.field input:focus { border-color: var(--brand); }

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip-row .chip { height: 30px; font-size: 12.5px; }

.editor-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.editor-actions > button { flex: 1; }

.confirm-text { font-size: 14px; color: var(--text-2); margin: 0 0 18px; }

/* ---------- 设置 ---------- */

.card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 4px 16px;
  margin-bottom: 14px;
}
.card-title {
  font-size: 12px;
  color: var(--text-3);
  padding: 12px 0 4px;
  letter-spacing: .04em;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 0.5px solid var(--surface-2);
  cursor: pointer;
}
.row:last-child { border-bottom: none; }
.row-main { font-size: 15px; }
.row-sub { font-size: 12.5px; color: var(--text-3); line-height: 1.55; }

.row-btn {
  display: flex;
  width: 100%;
  text-align: left;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 0.5px solid var(--surface-2);
}
.row-btn:last-child { border-bottom: none; }
.row-btn:active { opacity: .6; }
.row-btn.danger .row-main { color: var(--danger); }

.switch {
  appearance: none;
  width: 44px; height: 26px;
  border-radius: 999px;
  background: var(--border);
  position: relative;
  transition: background .18s;
  flex-shrink: 0;
  cursor: pointer;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform .18s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.switch:checked { background: var(--teal); }
.switch:checked::after { transform: translateX(18px); }

.footnote {
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  padding: 10px 0 0;
}

/* ---------- 统计 ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.stat-card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
}
.stat-label { font-size: 12px; color: var(--text-3); }
.stat-num { font-size: 22px; font-weight: 500; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat-unit { font-size: 12px; color: var(--text-3); margin-left: 3px; }

.bar-row { display: flex; align-items: center; gap: 10px; margin: 9px 0; }
.bar-name { flex: 0 0 52px; font-size: 12.5px; color: var(--text-2); }
.bar-track { flex: 1; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: var(--brand); }
.bar-val { flex: 0 0 34px; text-align: right; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ---------- 进度 ---------- */

.overlay {
  position: fixed; inset: 0;
  z-index: 80;
  background: rgba(20, 20, 18, .45);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.progress-box {
  width: 100%; max-width: 320px;
  background: var(--surface);
  border-radius: var(--r-lg);
  padding: 22px 20px;
  text-align: center;
}
.progress-title { font-size: 15px; font-weight: 500; }
.progress-detail { font-size: 12.5px; color: var(--text-3); margin: 6px 0 14px; min-height: 1.4em; }
.progress-track { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.progress-bar {
  height: 100%; width: 0%;
  border-radius: 3px;
  background: var(--brand);
  transition: width .25s ease;
}
#pg-skip { margin-top: 12px; }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 88px);
  transform: translateX(-50%) translateY(8px);
  background: rgba(35, 34, 31, .92);
  color: #fff;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 90;
  max-width: 86vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   v0.2 新增：今日横幅 / 搭配画布 / 穿搭日历
   ============================================================ */

/* ---------- 今日穿搭横幅 ---------- */

.today-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 11px 14px;
  margin-bottom: 12px;
  border-radius: var(--r-md);
  background: var(--brand-soft);
  border: 0.5px solid #CFE2F5;
  color: var(--brand-ink);
  font-size: 13.5px;
}
.today-banner:active { opacity: .8; }
.today-banner.done { background: var(--teal-soft); border-color: #C6E9DC; color: var(--teal); }

.tb-icon {
  flex: 0 0 auto;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  line-height: 20px;
  text-align: center;
}
.today-banner.done .tb-icon { background: var(--teal); }
.tb-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-go { flex-shrink: 0; font-size: 12.5px; opacity: .78; }

/* ---------- 通用小件 ---------- */

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-title { font-size: 15px; font-weight: 500; }

.small-btn.strong {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 500;
}

.card.pad { padding-bottom: 14px; }

/* 弹层与画布内的分类条：不吸边、自带下边距 */
.chips.inline { padding: 0 0 8px; }

.sheet-sub {
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: .04em;
  margin: 16px 0 8px;
}

/* ---------- 搭配：列表 ---------- */

.of-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.of-card {
  position: relative;
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform .12s ease;
}
.of-card:active { transform: scale(.98); }

/* 预览与真实画布共用同一套百分比定位，只是整体缩小 */
.of-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #fff;
  overflow: hidden;
}
.of-piece {
  position: absolute;
  height: auto;
  transform-origin: center center;
}
.of-preview-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-3);
}

.of-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-top: 0.5px solid var(--surface-2);
}
.of-card-name {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.of-card-count { flex-shrink: 0; font-size: 11px; color: var(--text-3); }

.of-card-del {
  position: absolute;
  top: 6px; right: 6px;
  width: 24px; height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--text-3);
  font-size: 16px;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}

/* ---------- 搭配：编辑器 ---------- */

.of-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.of-name {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 13px;
  border: 0.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  outline: none;
  font-size: 14px;
}
.of-name:focus { border-color: var(--brand); }

.cv-stage {
  position: relative;
  /* 宽度跟着视高走，保证 3:4 绝不变形（预览靠的就是这个比例） */
  width: min(100%, 34vh);
  aspect-ratio: 3 / 4;
  margin: 0 auto 10px;
  background: #fff;
  border: 0.5px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  touch-action: pan-y;   /* 空白处仍可上下滚页，衣服上则是拖拽 */
  user-select: none;
  -webkit-user-select: none;
}

.cv-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-3);
  pointer-events: none;
}

.piece {
  position: absolute;
  transform-origin: center center;
  touch-action: none;
  cursor: grab;
}
.piece img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;   /* 命中一律落在 .piece 上，判断更简单 */
}
.piece.selected { outline: 1.5px dashed var(--brand); outline-offset: 2px; }

.ph {
  position: absolute;
  display: none;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #fff;
  border: 1.5px solid var(--brand);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
  font-size: 14px;
  line-height: 1;
  color: var(--brand);
}
.piece.selected .ph { display: flex; }

.ph-rot { top: -34px; left: 50%; transform: translateX(-50%); }
.ph-scale { right: -13px; bottom: -13px; background: var(--brand); border-color: #fff; }
.ph-del {
  right: -13px; top: -13px;
  background: var(--danger);
  border-color: #fff;
  color: #fff;
  font-size: 15px;
}

.cv-tools {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-width: none;
}
.cv-tools::-webkit-scrollbar { display: none; }

.tool-btn {
  flex: 0 0 auto;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
}
.tool-btn:active { background: var(--surface-2); }
.tool-btn.danger {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #E5B4B4;
}

.cv-pick-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0 8px;
  font-size: 12px;
  color: var(--text-3);
}
.cv-tip { font-size: 11px; }

.cv-picker {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.cv-picker::-webkit-scrollbar { display: none; }

.cv-pick {
  flex: 0 0 auto;
  width: 64px;
  text-align: center;
}
.cv-pick img {
  display: block;
  width: 64px; height: 82px;
  object-fit: contain;
  background: #fff;
  border: 0.5px solid var(--border);
  border-radius: var(--r-sm);
}
.cv-pick.on img {
  border-color: var(--brand);
  box-shadow: 0 0 0 1.5px var(--brand-soft);
}
.cv-pick span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cv-pick-empty { padding: 14px 4px; font-size: 12.5px; color: var(--text-3); }

/* ---------- 穿搭日历 ---------- */

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.cal-head-mid {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}
.cal-title { font-size: 16px; font-weight: 500; }
.cal-today {
  padding: 2px 9px;
  border: 0.5px solid var(--brand);
  border-radius: 999px;
  font-size: 12px;
  color: var(--brand);
}

.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  color: var(--text-3);
  padding-bottom: 6px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-cell {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--surface);
  border: 0.5px solid var(--border);
  overflow: hidden;
}
.cal-cell.blank { background: none; border: none; }
.cal-cell.has { border-color: #CBD9E8; }
.cal-cell.today { border-color: var(--brand); border-width: 1.4px; }

.cal-day {
  font-size: 12.5px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
/* 有缩略图时日期压在图左上角，要描边才看得清 */
.cal-day.on-img {
  position: absolute;
  top: 1px; left: 3px;
  font-size: 11px;
  font-weight: 500;
  color: #fff;
  text-shadow: 0 0 4px rgba(0, 0, 0, .75), 0 0 2px rgba(0, 0, 0, .8);
}

.cal-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cal-dot {
  position: absolute;
  bottom: 4px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--brand);
}

.cal-note {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 0.5px solid var(--border);
  font-size: 12.5px;
  color: var(--text-2);
}
.cal-note b { font-weight: 500; color: var(--text); }
.cal-note-dim { color: var(--text-3); }

.cal-footnote {
  padding: 14px 10px 0;
  text-align: center;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-3);
}

/* ---------- 某天记录弹层 ---------- */

.day-selected {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 62px;
  padding: 6px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  overflow-x: auto;
  scrollbar-width: none;
}
.day-selected::-webkit-scrollbar { display: none; }
.day-selected.dim { justify-content: center; }
.day-sel {
  flex: 0 0 auto;
  width: 50px; height: 62px;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
}
.day-sel-empty { font-size: 12.5px; color: var(--text-3); }

.day-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.day-strip::-webkit-scrollbar { display: none; }
.day-strip.tall { min-height: 104px; }
.day-empty { padding: 26px 4px; font-size: 12.5px; color: var(--text-3); }

.day-of {
  flex: 0 0 auto;
  width: 78px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface);
}
.day-of.on { border-color: var(--brand); }
.day-of-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #fff;
  overflow: hidden;
}
.day-of-name {
  display: block;
  padding: 3px 4px;
  font-size: 11px;
  color: var(--text-2);
  background: var(--surface);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.day-item {
  position: relative;
  flex: 0 0 auto;
  width: 62px;
  text-align: center;
}
.day-item img {
  display: block;
  width: 62px; height: 78px;
  object-fit: contain;
  background: #fff;
  border: 0.5px solid var(--border);
  border-radius: var(--r-sm);
}
.day-item.on img {
  border-color: var(--brand);
  box-shadow: 0 0 0 1.5px var(--brand-soft);
}
.day-item.on::after {
  content: '✓';
  position: absolute;
  top: 3px; right: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
}
.day-item span {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 统计：排行 ---------- */

.rank-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 0.5px solid var(--surface-2);
}
.rank-row:last-child { border-bottom: none; }
.rank-row img {
  flex-shrink: 0;
  width: 40px; height: 50px;
  object-fit: contain;
  background: var(--surface-2);
  border-radius: 6px;
}
.rank-main { flex: 1; min-width: 0; }
.rank-name {
  font-size: 13.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-sub { font-size: 11.5px; color: var(--text-3); }
.rank-val {
  flex-shrink: 0;
  font-size: 13px;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

/* ---------- 单品编辑器：穿着信息 ---------- */

.ed-wear {
  margin: -6px 0 16px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-2);
}
