/* SF Online — Editorial Fashion OS */
:root {
  --bg: #F4F1EC;
  --surface: #FFFCF7;
  --surface-2: #FFFFFF;
  --ink: #1A1714;
  --muted: #8A8178;
  --line: #E7E0D6;
  --accent: #C2410C;
  --accent-soft: #FED7AA;
  --keep: #0F766E;
  --keep-soft: #CCFBF1;
  --flag: #BE123C;
  --flag-soft: #FFE4E6;
  --warn: #B45309;
  --warn-soft: #FEF3C7;
  --review: #B45309;
  --review-soft: #FEF3C7;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(26, 23, 20, 0.06);
  --font-sans: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-serif: "Noto Serif SC", "Songti SC", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(194, 65, 12, 0.06), transparent 50%),
    radial-gradient(900px 400px at 100% 0%, rgba(15, 118, 110, 0.05), transparent 45%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: rgba(26, 23, 20, 0.06);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 12px;
}

.app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

/* Top bar */
.topbar {
  height: 60px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 252, 247, 0.86);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 200px;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: #F8F4EE;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.brand-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.1;
}
.brand-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  letter-spacing: 0.04em;
}

.topbar-center {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.mode-badge {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--warn-soft);
  color: var(--warn);
  white-space: nowrap;
}
.mode-badge.live {
  background: var(--keep-soft);
  color: var(--keep);
}
.mode-badge.mock {
  background: var(--accent-soft);
  color: var(--accent);
}

.stat-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  background: rgba(26, 23, 20, 0.04);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
}
.stat-pill strong {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Buttons */
.btn {
  border: 1px solid transparent;
  border-radius: 11px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(194, 65, 12, 0.22);
}
.btn.primary:hover { background: #9A3412; }
.btn.primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}
.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn.ghost:hover { background: rgba(26, 23, 20, 0.04); }
.btn.full { width: 100%; justify-content: center; }
.btn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #FDBA74;
  box-shadow: 0 0 0 3px rgba(253, 186, 116, 0.25);
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
}
.icon-btn:hover { color: var(--ink); }

/* Progress */
.progress-bar {
  height: 3px;
  background: rgba(26, 23, 20, 0.06);
  position: relative;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #EA580C);
  transition: width 0.35s ease;
}
.progress-text {
  position: absolute;
  right: 16px;
  top: 6px;
  font-size: 11px;
  color: var(--muted);
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 0;
  min-height: calc(100vh - 60px);
}

.sidebar {
  border-right: 1px solid var(--line);
  padding: 18px 16px 24px;
  background: rgba(255, 252, 247, 0.55);
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow: auto;
}

.side-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.search-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--muted);
}
.search-wrap input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font-size: 13px;
  color: var(--ink);
  font-family: inherit;
}

.chip-col {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}
.chip:hover { border-color: #D6CEC2; }
.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #F8F4EE;
}
.chip.keep.active { background: var(--keep); border-color: var(--keep); }
.chip.review.active { background: var(--review); border-color: var(--review); }
.chip.reject.active { background: var(--flag); border-color: var(--flag); }

.side-foot {
  margin-top: auto;
  padding-top: 12px;
}

/* Gallery */
.gallery-wrap {
  padding: 22px 24px 40px;
}
.gallery-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
}
.gallery-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.gallery-meta {
  font-size: 13px;
  color: var(--muted);
}

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

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  animation: cardIn 0.45s ease both;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: #D9D0C3;
}
.card.selected {
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(194, 65, 12, 0.16);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-thumb {
  position: relative;
  aspect-ratio: 3 / 4;
  background: #E8E2D8;
  overflow: hidden;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.card:hover .card-thumb img { transform: scale(1.04); }

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 4px 8px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
}
.badge.keep { background: rgba(204, 251, 241, 0.92); color: var(--keep); }
.badge.review { background: rgba(254, 243, 199, 0.94); color: var(--warn); }
.badge.reject { background: rgba(255, 228, 230, 0.94); color: var(--flag); }
.badge.pending { background: rgba(255, 252, 247, 0.9); color: var(--muted); }
.badge.error { background: rgba(255, 228, 230, 0.94); color: var(--flag); }

.card-body {
  padding: 12px 12px 14px;
}
.card-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  min-height: 22px;
}
.tag {
  font-size: 11px;
  color: var(--muted);
  background: rgba(26, 23, 20, 0.04);
  border-radius: 999px;
  padding: 3px 8px;
}
.tag.accent {
  color: var(--accent);
  background: rgba(194, 65, 12, 0.08);
}

.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--muted);
}
.empty-state h2 {
  font-family: var(--font-serif);
  color: var(--ink);
  font-size: 24px;
  margin: 12px 0 10px;
}
.empty-state p {
  line-height: 1.7;
  font-size: 14px;
}
.empty-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(26, 23, 20, 0.05);
  font-size: 22px;
}

/* Drawer */
.drawer[hidden] { display: none; }
.drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
}
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 23, 20, 0.28);
  backdrop-filter: blur(2px);
}
.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(430px, 100%);
  height: 100%;
  background: var(--surface-2);
  border-left: 1px solid var(--line);
  box-shadow: -18px 0 50px rgba(26, 23, 20, 0.12);
  display: flex;
  flex-direction: column;
  animation: slideIn 0.22s ease;
}
@keyframes slideIn {
  from { transform: translateX(18px); opacity: 0.6; }
  to { transform: translateX(0); opacity: 1; }
}

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line);
}
.drawer-kicker {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.drawer-title {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 600;
  margin-top: 4px;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-body {
  overflow: auto;
  padding: 16px 18px 32px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.drawer-hero {
  border-radius: 16px;
  overflow: hidden;
  background: #EDE7DD;
  aspect-ratio: 4 / 5;
}
.drawer-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.decision-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.decision-pill {
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 999px;
}
.decision-pill.keep { background: var(--keep-soft); color: var(--keep); }
.decision-pill.review { background: var(--review-soft); color: var(--review); }
.decision-pill.reject { background: var(--flag-soft); color: var(--flag); }
.conf-pill {
  font-size: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
}

.detail-section h3 {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.model-tag {
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
  background: rgba(26, 23, 20, 0.05);
  color: var(--muted);
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 500;
}

.desc-text, .reason-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink);
}
.reason-text { color: var(--muted); }

.item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.item-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 13px;
}
.item-cat {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  min-width: 72px;
}
.item-name { font-weight: 500; }
.item-notes { color: var(--muted); font-size: 12px; }

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-row .chip {
  cursor: default;
}

.color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0;
}
.color-swatch {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px 5px 5px;
  font-size: 12px;
  background: var(--surface);
}
.swatch-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid rgba(26, 23, 20, 0.12);
}

.score-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.score-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--surface);
}
.score-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.score-value {
  font-family: var(--font-serif);
  font-size: 28px;
  font-weight: 600;
  margin-top: 4px;
}
.score-bar {
  height: 4px;
  background: rgba(26, 23, 20, 0.08);
  border-radius: 999px;
  margin-top: 8px;
  overflow: hidden;
}
.score-bar > i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  animation: revealUp 0.45s ease forwards;
}
.delay-1 { animation-delay: 0.08s; }
.delay-2 { animation-delay: 0.16s; }
.delay-3 { animation-delay: 0.24s; }
@keyframes revealUp {
  to { opacity: 1; transform: translateY(0); }
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #F8F4EE;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  z-index: 60;
  box-shadow: 0 16px 40px rgba(26, 23, 20, 0.25);
}

/* Responsive */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: relative;
    top: 0;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .topbar {
    height: auto;
    min-height: 60px;
    flex-wrap: wrap;
    padding: 12px 16px;
    gap: 12px;
  }
  .topbar-center { order: 3; width: 100%; }
  .gallery-wrap { padding: 16px; }
}
