/* ===== 女王的衣橱 · 奶油粉女性向 UI ===== */
:root {
  --pink: #e8709f;
  --pink-deep: #d94f86;
  --pink-soft: #f3c3d6;
  --pink-bg: #fff6ef;
  --gold: #e8b93d;
  --ink: #43302b;
  --ink-soft: #8d7a72;
  --card: #ffffff;
  --line: #f2e3da;
  --shadow: 0 6px 24px rgba(217, 79, 134, .10);
  --radius: 18px;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
input, textarea { user-select: text; -webkit-user-select: text; }

html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--pink-bg); color: var(--ink);
  overscroll-behavior: none;
}
#app { max-width: 520px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }

/* ---- 顶栏 ---- */
#topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
  background: linear-gradient(180deg, #fff 0%, rgba(255, 246, 239, .96) 100%);
  border-bottom: 1px solid var(--line);
}
#topbar .logo { width: 30px; height: 30px; }
#topbar .title { font-size: 19px; font-weight: 800; letter-spacing: 1px; flex: 1;
  background: linear-gradient(90deg, var(--pink-deep), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
#topbar .icon-btn { font-size: 20px; background: none; border: none; padding: 4px 6px; cursor: pointer; }

/* ---- 主区 ---- */
#page { flex: 1; padding: 14px 16px calc(90px + env(safe-area-inset-bottom, 0px)); }

/* ---- 底部 Tab ---- */
#tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 520px; z-index: 20;
  display: flex; align-items: flex-end;
  padding: 6px 8px calc(env(safe-area-inset-bottom, 0px) + 6px);
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tab-btn { flex: 1; background: none; border: none; cursor: pointer; text-align: center; padding: 4px 0; color: var(--ink-soft); }
.tab-btn .t-ico { font-size: 21px; display: block; filter: grayscale(.7); opacity: .7; }
.tab-btn .t-label { font-size: 10.5px; }
.tab-btn.on { color: var(--pink-deep); }
.tab-btn.on .t-ico { filter: none; opacity: 1; transform: translateY(-2px); }
.tab-btn.plus .t-ico {
  width: 46px; height: 46px; margin: -18px auto 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--pink), var(--gold)); border-radius: 50%;
  color: #fff; font-size: 26px; font-weight: 300; filter: none; opacity: 1;
  box-shadow: 0 8px 20px rgba(217, 79, 134, .38);
}

/* ---- 通用 ---- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin-bottom: 12px; }
.sec-title { font-size: 14px; font-weight: 700; color: var(--ink-soft); margin: 4px 2px 10px; display: flex; align-items: center; justify-content: space-between; }
.row { display: flex; align-items: center; }
.row.gap { gap: 10px; }
.flex1 { flex: 1; }
.muted { color: var(--ink-soft); font-size: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 14px; padding: 11px 18px;
  font-size: 14.5px; font-weight: 600; cursor: pointer;
  background: #f6ebe3; color: var(--ink);
  transition: transform .12s;
}
.btn:active { transform: scale(.96); }
.btn.primary { background: linear-gradient(135deg, var(--pink), var(--pink-deep)); color: #fff; box-shadow: 0 6px 16px rgba(217, 79, 134, .3); }
.btn.gold { background: linear-gradient(135deg, var(--gold), #d9a02b); color: #fff; }
.btn.ghost { background: #fff; border: 1.5px solid var(--line); }
.btn.danger { background: #ffe8e6; color: #d64541; }
.btn.small { padding: 7px 12px; font-size: 12.5px; border-radius: 11px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .45; }

input[type=text], input[type=number], input[type=date], select, textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 11px 12px; font-size: 15px; background: #fffdfb; color: var(--ink); outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--pink-soft); }
.field { margin-bottom: 12px; }
.field > label { display: block; font-size: 12.5px; color: var(--ink-soft); margin-bottom: 5px; font-weight: 600; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 13px; border-radius: 999px; font-size: 13px;
  background: #fff; border: 1.5px solid var(--line); color: var(--ink-soft); cursor: pointer;
}
.chip.on { background: var(--pink); border-color: var(--pink); color: #fff; font-weight: 600; }
.chip.del { opacity: .55; }

/* ---- 天气栏 ---- */
.weather-bar {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(120deg, #ffd9e8 0%, #ffe9d6 55%, #fff3c9 100%);
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.weather-bar .w-icon { font-size: 34px; }
.weather-bar .w-main { flex: 1; }
.weather-bar .w-t { font-size: 24px; font-weight: 800; }
.weather-bar .w-t small { font-size: 12px; font-weight: 500; color: var(--ink-soft); margin-left: 6px; }
.weather-bar .w-city { font-size: 12px; color: var(--ink-soft); }
.weather-bar .w-act { background: rgba(255,255,255,.65); border: none; border-radius: 10px; padding: 7px 10px; font-size: 12px; color: var(--ink); cursor: pointer; }

/* ---- 推荐卡 ---- */
.rec-card { display: flex; gap: 12px; }
.rec-thumbs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px; width: 132px; flex-shrink: 0; }
.rec-thumbs .cloth-thumb { width: 100%; height: 62px; border-radius: 12px; object-fit: cover; }
.cloth-thumb.empty { display: flex; align-items: center; justify-content: center; background: #fdf0f5; font-size: 22px; }
.rec-info { flex: 1; min-width: 0; }
.rec-line { font-size: 13.5px; margin: 3px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.why-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.why-tag { font-size: 11px; background: #fdeef4; color: var(--pink-deep); padding: 3px 8px; border-radius: 999px; }

/* ---- 衣橱 ---- */
.w-filter { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 4px; scrollbar-width: none; }
.w-filter::-webkit-scrollbar { display: none; }
.w-filter .chip { white-space: nowrap; flex-shrink: 0; }
.w-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.w-item { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; cursor: pointer; position: relative; }
.w-item img, .w-item .cloth-thumb { width: 100%; height: 108px; object-fit: cover; border-radius: 0; display: flex; align-items: center; justify-content: center; }
.w-item .w-meta { padding: 7px 9px 9px; }
.w-item .w-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-item .color-dot { width: 11px; height: 11px; display: inline-block; border-radius: 50%; border: 1px solid rgba(0,0,0,.12); vertical-align: -1px; margin-right: 4px; }
.w-item .fav-badge { position: absolute; top: 6px; right: 6px; background: rgba(255,255,255,.9); border-radius: 999px; padding: 1px 6px; font-size: 10.5px; color: var(--pink-deep); font-weight: 700; }
.w-item.dusty::after { content: '吃灰中'; position: absolute; left: 6px; top: 6px; background: rgba(67,48,43,.72); color: #fff; font-size: 10px; padding: 2px 7px; border-radius: 999px; }

/* ---- 照片框 ---- */
.photo-box { position: relative; border-radius: 14px; overflow: hidden; background: #fdf0f5; }
.photo-empty { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--pink-deep); font-size: 13px; cursor: pointer; }
.photo-empty span { font-size: 30px; }
.photo-retake { position: absolute; right: 8px; bottom: 8px; background: rgba(0,0,0,.5); color: #fff; font-size: 11px; padding: 4px 9px; border-radius: 999px; cursor: pointer; }

/* ---- 心 ---- */
.hearts { display: inline-flex; align-items: center; gap: 2px; }
.heart-cell { width: 30px; height: 30px; position: relative; cursor: pointer; }
.heart-half { position: absolute; top: 0; bottom: 0; z-index: 1; }
.fav-label { margin-left: 8px; font-size: 13px; color: var(--pink-deep); font-weight: 700; }

/* ---- 模态/Toast ---- */
.modal-mask { position: fixed; inset: 0; z-index: 50; background: rgba(67, 48, 43, .38); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { width: 100%; max-width: 420px; max-height: 84dvh; overflow-y: auto; background: #fff; border-radius: 22px; padding: 18px 18px 16px; }
.modal-title { font-size: 17px; font-weight: 800; margin-bottom: 12px; text-align: center; }
.toast { position: fixed; left: 50%; bottom: 120px; transform: translate(-50%, 16px); z-index: 99;
  background: rgba(67, 48, 43, .92); color: #fff; font-size: 13.5px; padding: 10px 18px; border-radius: 999px;
  opacity: 0; transition: all .25s; pointer-events: none; max-width: 80vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- 日历 ---- */
.cal-item { display: flex; gap: 12px; align-items: flex-start; }
.cal-date { font-weight: 800; font-size: 15px; min-width: 86px; }
.cal-date small { display: block; font-size: 11px; color: var(--ink-soft); font-weight: 500; }
.cal-thumbs { display: flex; flex-wrap: wrap; gap: 5px; }
.cal-thumbs .cloth-thumb { width: 52px; height: 52px; border-radius: 10px; }

/* ---- 统计 ---- */
.stat-num { font-size: 26px; font-weight: 800; color: var(--pink-deep); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.stat-grid .card { margin: 0; padding: 12px 6px; }
.dusty-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.dusty-row:last-child { border-bottom: none; }
.dusty-days { margin-left: auto; font-size: 12px; color: #d64541; font-weight: 700; white-space: nowrap; }
.bar-wrap { height: 9px; background: #f6e8ee; border-radius: 999px; overflow: hidden; flex: 1; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--pink), var(--gold)); border-radius: 999px; }

/* ---- 空态 ---- */
.empty-tip { text-align: center; padding: 34px 10px; color: var(--ink-soft); font-size: 13.5px; }
.empty-tip .big { font-size: 42px; display: block; margin-bottom: 8px; }

/* ---- AI 卡 ---- */
.ai-reason { background: #fdeef4; border-radius: 12px; padding: 9px 11px; font-size: 12.5px; color: var(--pink-deep); margin-top: 8px; line-height: 1.5; }
