:root {
  color-scheme: light;
  --bg: #f6f3ee;
  --surface: #fffdfa;
  --surface-soft: #ede8e0;
  --ink: #2e2925;
  --muted: #776f68;
  --line: #ded7cf;
  --rose: #b97983;
  --rose-dark: #8f5661;
  --danger: #9e5a55;
  --shadow: 0 18px 46px rgba(54, 45, 38, 0.08);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: radial-gradient(circle at 12% -10%, rgba(185, 121, 131, 0.14), transparent 32rem), var(--bg);
}
button, input, select { font: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 10px max(20px, env(safe-area-inset-left));
  border-bottom: 1px solid rgba(222, 215, 207, 0.8);
  background: rgba(246, 243, 238, 0.9);
  backdrop-filter: blur(16px);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; letter-spacing: .04em; }
.brand-mark { display: grid; width: 36px; height: 36px; place-items: center; border-radius: 50%; color: white; background: var(--rose); font-family: "Songti SC", serif; }
.brand-copy { display: grid; gap: 3px; }
.brand-copy strong { font-family: "Songti SC", "SimSun", serif; font-size: 16px; font-weight: 600; letter-spacing: .16em; line-height: 1; }
.brand-copy small { color: var(--rose-dark); font-size: 7px; font-weight: 700; letter-spacing: .11em; line-height: 1; }
.account-link, .text-button { border: 0; color: var(--muted); background: transparent; text-decoration: none; cursor: pointer; }
.shell { width: min(1120px, calc(100% - 32px)); margin: 0 auto; padding: 44px 0 max(80px, env(safe-area-inset-bottom)); }
.hero { max-width: 680px; margin-bottom: 28px; }
.hero h1 { margin: 7px 0 10px; font-family: "Songti SC", "SimSun", serif; font-size: clamp(2.1rem, 7vw, 4.4rem); font-weight: 500; line-height: 1.08; }
.hero > p:last-child { margin: 0; color: var(--muted); line-height: 1.8; }
.eyebrow { color: var(--rose-dark); font-size: .72rem; font-weight: 700; letter-spacing: .16em; }
.card { border: 1px solid var(--line); border-radius: 24px; background: rgba(255, 253, 250, .88); box-shadow: var(--shadow); }
.profile-card { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 24px; }
.profile-card h2, .blocked-card h2, .section-head h2, .upload-card h2 { margin: 6px 0 5px; font-family: "Songti SC", "SimSun", serif; font-weight: 500; }
.profile-card p, .blocked-card p, .upload-card p { margin: 0; color: var(--muted); }
.profile-select-wrap { display: grid; gap: 7px; min-width: min(300px, 100%); color: var(--muted); font-size: .78rem; }
select, .edit-grid input { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--surface); }
.blocked-card { padding: 30px; text-align: center; }
.inline-button { display: inline-flex; margin-top: 14px; text-decoration: none; }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 26px 0; padding: 6px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255, 253, 250, .72); }
.tab { min-height: 46px; border: 0; border-radius: 13px; color: var(--muted); background: transparent; cursor: pointer; }
.tab.active { color: white; background: var(--ink); }
.panel { min-height: 320px; }
.upload-card { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px; border-radius: 24px; background: linear-gradient(135deg, #eadfd9, #e7e7e1); }
.upload-button, .primary-button, .secondary-button, .danger-button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 0 18px; border: 0; border-radius: 999px; cursor: pointer; }
.upload-button, .primary-button { color: white; background: var(--ink); }
.secondary-button { color: var(--ink); background: var(--surface-soft); }
.danger-button { color: var(--danger); background: #f6e9e6; }
.upload-queue { display: grid; gap: 10px; margin-top: 18px; }
.queue-item { display: grid; grid-template-columns: 60px 1fr auto; align-items: center; gap: 14px; padding: 10px 14px 10px 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.queue-item img { width: 60px; height: 60px; border-radius: 11px; object-fit: cover; }
.queue-name { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.queue-state { margin-top: 4px; color: var(--muted); font-size: .8rem; }
.queue-state.error { color: var(--danger); }
.retry-button { border: 0; color: var(--rose-dark); background: transparent; cursor: pointer; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 34px 2px 16px; }
.section-head h2 { font-size: 1.65rem; }
.category-filter { width: auto; min-width: 130px; }
.garment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.garment-card { overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.garment-photo-wrap { position: relative; aspect-ratio: 4 / 3; background: #e9e5df; }
.garment-photo { width: 100%; height: 100%; object-fit: cover; }
.result-badge, .stale-badge { position: absolute; top: 14px; left: 14px; padding: 7px 11px; border-radius: 999px; font-size: .76rem; font-weight: 700; backdrop-filter: blur(8px); }
.result-badge.recommended { color: #31483a; background: rgba(231, 241, 231, .92); }
.result-badge.caution { color: #714d25; background: rgba(249, 236, 215, .94); }
.result-badge.not_recommended { color: #703e3a; background: rgba(247, 226, 223, .94); }
.stale-badge { right: 14px; left: auto; color: white; background: rgba(46, 41, 37, .78); }
.garment-body { padding: 20px; }
.garment-kicker { color: var(--muted); font-size: .76rem; }
.garment-title { margin: 5px 0 8px; font-size: 1.2rem; }
.garment-summary { min-height: 3.2em; margin: 0; color: var(--muted); line-height: 1.65; }
.color-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 15px 0; }
.color-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 9px; border-radius: 999px; color: var(--muted); background: var(--surface-soft); font-size: .76rem; }
.color-dot { width: 10px; height: 10px; border: 1px solid rgba(0,0,0,.12); border-radius: 50%; background: #b8aaa0; }
.dimension-list { display: grid; gap: 9px; margin: 16px 0; }
.dimension { padding: 12px; border-radius: 14px; background: #f6f3ee; }
.dimension-head { display: flex; justify-content: space-between; gap: 12px; font-size: .82rem; font-weight: 700; }
.dimension p { margin: 6px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.55; }
.limitations { margin: 12px 0; padding: 11px 13px; border-radius: 12px; color: #795c3f; background: #faf0df; font-size: .8rem; line-height: 1.55; }
.edit-details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.edit-details summary { color: var(--muted); cursor: pointer; }
.edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.edit-grid label { display: grid; gap: 5px; color: var(--muted); font-size: .75rem; }
.edit-grid .wide { grid-column: 1 / -1; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.card-actions button { flex: 1 1 auto; }
.empty-state { grid-column: 1 / -1; padding: 54px 24px; border: 1px dashed #cec5bb; border-radius: 24px; color: var(--muted); text-align: center; }
.empty-state strong { display: block; margin-bottom: 8px; color: var(--ink); font-size: 1.1rem; }
.outfit-generator { display: grid; grid-template-columns: minmax(0, .8fr) minmax(360px, 1.2fr); gap: 30px; align-items: end; padding: 30px; border: 1px solid var(--line); border-radius: 24px; background: linear-gradient(135deg, #e9ded8, #e3e7e6); box-shadow: var(--shadow); }
.outfit-generator h2 { margin: 7px 0 8px; font-family: "Songti SC", "SimSun", serif; font-size: 2rem; font-weight: 500; }
.outfit-generator p { margin: 0; color: var(--muted); line-height: 1.7; }
.outfit-report-field { display: grid; gap: 6px; max-width: 360px; margin-top: 16px; color: var(--muted); font-size: .76rem; }
.outfit-form { display: grid; grid-template-columns: .7fr 1.3fr auto; gap: 10px; align-items: end; }
.outfit-form label { display: grid; gap: 6px; color: var(--muted); font-size: .76rem; }
.outfit-form input { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--ink); padding: 0 12px; }
.outfit-form .primary-button { white-space: nowrap; }
.outfit-message { min-height: 22px; margin: 15px 3px; color: var(--muted); font-size: .82rem; line-height: 1.6; }
.outfit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.outfit-card { overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.outfit-photo-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 2px; min-height: 170px; background: #e6e0d9; }
.outfit-photo-row figure { position: relative; min-width: 0; margin: 0; background: #e8e3dd; }
.outfit-photo-row img { display: block; width: 100%; height: 100%; min-height: 170px; object-fit: cover; }
.outfit-photo-row figcaption { position: absolute; right: 6px; bottom: 6px; left: 6px; overflow: hidden; border-radius: 999px; background: rgba(255, 253, 250, .86); color: var(--ink); padding: 5px 8px; font-size: .68rem; text-align: center; text-overflow: ellipsis; white-space: nowrap; backdrop-filter: blur(8px); }
.unavailable-garment { display: grid; min-height: 170px; place-items: center; color: var(--muted); }
.outfit-body { padding: 20px; }
.outfit-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--rose-dark); font-size: .72rem; font-weight: 700; letter-spacing: .08em; }
.outfit-stale { border-radius: 999px; background: var(--surface-soft); color: var(--muted); padding: 4px 8px; letter-spacing: 0; }
.outfit-body h3 { margin: 7px 0 8px; font-family: "Songti SC", "SimSun", serif; font-size: 1.35rem; font-weight: 500; }
.outfit-body > p { margin: 0; color: var(--muted); line-height: 1.7; }
.outfit-body ul { display: grid; gap: 6px; margin: 14px 0 0; padding-left: 18px; color: var(--muted); font-size: .82rem; line-height: 1.55; }
.toast { position: fixed; z-index: 50; right: 18px; bottom: max(22px, env(safe-area-inset-bottom)); max-width: min(360px, calc(100% - 36px)); padding: 13px 17px; border-radius: 14px; color: white; background: var(--ink); box-shadow: var(--shadow); }
[hidden] { display: none !important; }
@media (max-width: 720px) {
  .shell { width: min(100% - 24px, 1120px); padding-top: 30px; }
  .profile-card, .upload-card { align-items: stretch; flex-direction: column; }
  .garment-grid { grid-template-columns: 1fr; }
  .outfit-generator { grid-template-columns: 1fr; gap: 20px; padding: 22px; }
  .outfit-form { grid-template-columns: 1fr; }
  .outfit-grid { grid-template-columns: 1fr; }
  .garment-photo-wrap { aspect-ratio: 5 / 4; }
  .edit-grid { grid-template-columns: 1fr; }
  .edit-grid .wide { grid-column: auto; }
}
@media (max-width: 430px) {
  .tabs { gap: 3px; padding: 4px; }
  .tab { min-height: 42px; font-size: .82rem; }
  .outfit-photo-row { grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
