:root {
  --bg: #f6f5f9;
  --surface: #ffffff;
  --surface-soft: #faf9fd;
  --ink: #23212b;
  --ink-soft: #6b6877;
  --line: #e8e5ef;
  --primary: #5b4b8a;
  --primary-soft: #eeeaf8;
  --accent: #c97758;
  --accent-soft: #fbeee8;
  --green: #3f8f6f;
  --shadow: 0 12px 32px rgba(40, 34, 64, 0.07);
  --radius: 16px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; }
.hidden { display: none !important; }
.muted { color: var(--ink-soft); }
.small-text { font-size: 12px; }

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 232px;
  flex: 0 0 232px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 28px 18px 22px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 30px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px;
  background: linear-gradient(145deg, var(--primary), #8472bd);
  color: #fff; display: grid; place-items: center;
  font-size: 19px; font-weight: 700; letter-spacing: 1px;
}
.brand h1 { font-size: 16px; margin: 0; letter-spacing: 0.5px; }
.brand p { font-size: 10px; color: var(--ink-soft); margin: 0; letter-spacing: 1.8px; }

.nav { display: flex; flex-direction: column; gap: 6px; }
.nav-item {
  border: 0; background: transparent; text-align: left;
  padding: 11px 12px; border-radius: 11px; color: var(--ink-soft);
  display: flex; align-items: center; gap: 11px; font-weight: 500;
  transition: background 0.18s, color 0.18s;
}
.nav-item:hover { background: var(--surface-soft); color: var(--ink); }
.nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.nav-icon {
  width: 26px; height: 26px; border-radius: 8px; background: var(--surface-soft);
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.nav-item.active .nav-icon { background: #fff; color: var(--primary); }

.sidebar-foot { margin-top: auto; padding: 18px 8px 0; border-top: 1px solid var(--line); }
.sidebar-foot p { font-size: 11px; color: var(--ink-soft); margin: 12px 0 0; }
.sidebar-foot code { background: var(--surface-soft); padding: 1px 4px; border-radius: 4px; }

.main { flex: 1; min-width: 0; padding: 0 34px 48px; }
.topbar {
  display: flex; justify-content: space-between; align-items: flex-end;
  padding: 30px 0 24px; gap: 20px;
}
.topbar h2 { margin: 0; font-size: 23px; letter-spacing: -0.3px; }
.topbar p { margin: 4px 0 0; color: var(--ink-soft); }
.topbar-meta { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 12px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(63,143,111,0.12); }

.view { display: none; animation: fade 0.25s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; margin-bottom: 20px;
}
.panel-heading { margin-bottom: 18px; }
.panel-heading h3, .panel-heading.inline h3 { margin: 0; font-size: 16px; }
.panel-heading p { margin: 4px 0 0; color: var(--ink-soft); font-size: 12px; }
.panel-heading.inline { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }

.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 18px; }
.toolbar-title { margin-right: auto; }
.toolbar-title h3 { margin: 0; font-size: 16px; }
.toolbar-title p { margin: 2px 0 0; color: var(--ink-soft); font-size: 12px; }
.search-wrap { position: relative; flex: 1 1 240px; }
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--ink-soft); font-size: 11px;
}
.search-wrap input { width: 100%; padding: 9px 12px 9px 34px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  border: 1px solid var(--line); background: var(--surface-soft);
  padding: 6px 12px; border-radius: 999px; font-size: 12px; color: var(--ink-soft);
  transition: all 0.16s;
}
.chip:hover { border-color: #cfc5e8; color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.view-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.view-btn {
  border: 0; background: var(--surface); color: var(--ink-soft);
  padding: 8px 12px; font-size: 12px; transition: all 0.16s;
}
.view-btn + .view-btn { border-left: 1px solid var(--line); }
.view-btn:hover, .view-btn.active { background: var(--primary-soft); color: var(--primary); }
.group-btn { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.group-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.auto-badge {
  border: 1px solid var(--line); background: var(--surface-soft); color: var(--ink-soft);
  border-radius: 999px; padding: 4px 10px; font-size: 11px; white-space: nowrap;
}
.auto-badge:hover { border-color: var(--primary); color: var(--primary); }
.auto-badge.pending { background: #fff3cd; border-color: #e5b84b; color: #8a5a00; font-weight: 600; }
.auto-badge.notify { background: #fdeaea; border-color: #e0a0a0; color: #a33; }

.select, .text-input, textarea.text-input {
  border: 1px solid var(--line); background: var(--surface); border-radius: 10px;
  padding: 9px 11px; outline: none; transition: border-color 0.16s, box-shadow 0.16s;
}
.select:focus, .text-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(91,75,138,0.1); }
.select.wide { width: 100%; margin-bottom: 12px; }
textarea.text-input { resize: vertical; width: 100%; }

.primary-btn, .secondary-btn, .ghost-btn {
  border-radius: 10px; padding: 9px 16px; border: 1px solid transparent;
  font-weight: 600; font-size: 13px; transition: all 0.16s;
}
.primary-btn { background: var(--primary); color: #fff; }
.primary-btn:hover { background: #4c3e78; }
.secondary-btn { background: var(--surface); border-color: var(--line); color: var(--ink); }
.secondary-btn:hover { border-color: var(--primary); color: var(--primary); }
.ghost-btn { background: transparent; color: var(--ink-soft); }
.ghost-btn:hover { background: var(--surface-soft); color: var(--ink); }
.small { padding: 6px 10px; font-size: 12px; }
.compact { padding: 8px 11px; font-size: 12px; }
.wide-btn { width: 100%; padding: 12px; }
button:disabled { opacity: 0.45; cursor: not-allowed; }

.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 15px 18px; }
.stat-card strong { display: block; font-size: 22px; line-height: 1.2; }
.stat-card span { color: var(--ink-soft); font-size: 12px; }

.item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(188px, 1fr)); gap: 16px; }
.item-grid.grouped { display: block; }
.category-group { margin-bottom: 26px; }
.group-head { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.group-head h3 { margin: 0; font-size: 15px; }
.group-head span { font-size: 12px; color: var(--ink-soft); }
.item-grid.list-view, .item-grid .item-grid.list-view { display: flex; flex-direction: column; gap: 8px; }
.item-row {
  display: grid; grid-template-columns: 56px minmax(140px, 1.5fr) repeat(4, minmax(66px, 1fr)) auto;
  align-items: center; gap: 10px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px;
}
.item-row:hover { border-color: #cfc5e8; }
.item-row-thumb { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; background: var(--surface-soft); }
.item-row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.item-row-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-row-meta { font-size: 11px; color: var(--ink-soft); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-row-cell { font-size: 12px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-row-actions { display: flex; gap: 4px; }
.item-row-actions .mini-btn { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; white-space: nowrap; }
@media (max-width: 900px) {
  .item-row { grid-template-columns: 48px 1fr auto; }
  .item-row-cell { display: none; }
}
.item-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  overflow: hidden; box-shadow: 0 6px 18px rgba(40,34,64,0.04);
  transition: transform 0.18s, box-shadow 0.18s;
}
.item-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.item-image { aspect-ratio: 1 / 1; background: var(--surface-soft); overflow: hidden; }
.item-image img { width: 100%; height: 100%; object-fit: cover; }
.item-body { padding: 12px 13px; }
.item-body h3 { font-size: 14px; margin: 7px 0 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-body p { margin: 0; font-size: 11px; color: var(--ink-soft); }
.badge {
  display: inline-block; background: var(--primary-soft); color: var(--primary);
  font-size: 10px; padding: 2px 8px; border-radius: 6px; font-weight: 600;
}
.fav-btn { float: right; border: 0; background: transparent; font-size: 11px; color: var(--ink-soft); padding: 0; }
.fav-btn.on { color: var(--accent); font-weight: 700; }
.item-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.tag { font-size: 10px; background: var(--surface-soft); border: 1px solid var(--line); color: var(--ink-soft); padding: 1px 6px; border-radius: 5px; }
.card-actions { display: flex; border-top: 1px solid var(--line); }
.mini-btn { flex: 1; border: 0; background: transparent; padding: 9px 4px; font-size: 11px; color: var(--ink-soft); }
.mini-btn:hover { background: var(--surface-soft); color: var(--primary); }
.mini-btn.danger:hover { color: #b5514f; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-soft); }
.empty-art { width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 20px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 24px; font-weight: 700; }
.empty-state h3 { color: var(--ink); margin: 0 0 6px; }
.empty-state p { margin: 0; font-size: 13px; }

.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.model-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.model-photo { height: 260px; background: var(--surface-soft); display: grid; place-items: center; overflow: hidden; }
.model-photo img { width: 100%; height: 100%; object-fit: cover; }
.model-photo .no-photo { color: var(--ink-soft); font-size: 13px; }
.model-info { padding: 16px; }
.model-info h3 { margin: 0 0 10px; font-size: 16px; }
.info-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; padding: 3px 0; }
.info-row span:first-child { color: var(--ink-soft); }
.info-row span:last-child { text-align: right; }
.model-actions { display: flex; gap: 8px; padding: 0 16px 16px; }

.stylist-layout { display: grid; grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.1fr); gap: 20px; align-items: start; }
.field-label { display: block; font-size: 12px; font-weight: 600; margin: 16px 0 7px; }
.field-label:first-of-type { margin-top: 0; }
.hint { font-weight: 400; color: var(--ink-soft); font-size: 11px; margin-left: 6px; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; max-height: 230px; overflow-y: auto; padding: 2px; }
.picker-card { border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: var(--surface); text-align: center; }
.picker-card.selected { border-color: var(--primary); background: var(--primary-soft); }
.picker-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 7px; background: var(--surface-soft); }
.picker-card span { display: block; font-size: 10px; margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.selected-list { min-height: 42px; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface-soft); }
.selected-chip { background: #fff; border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; font-size: 11px; display: flex; align-items: center; gap: 6px; }
.selected-chip button { border: 0; background: transparent; color: var(--ink-soft); padding: 0; font-size: 13px; line-height: 1; }
.button-row { display: flex; gap: 10px; margin-top: 18px; }
.button-row.wrap { flex-wrap: wrap; }
.button-row > button { flex: 1; }
.save-row { display: flex; gap: 8px; margin-top: 12px; }
.save-row .text-input { flex: 1; min-width: 0; }

.preview-panel { position: sticky; top: 20px; }
.canvas-wrap { position: relative; background: linear-gradient(145deg, #f3f0f9, #eae6f3); border-radius: 14px; min-height: 460px; display: grid; place-items: center; overflow: hidden; }
.canvas-wrap canvas, .ai-preview { width: 100%; max-width: 560px; height: auto; max-height: 620px; object-fit: contain; }
.canvas-placeholder { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; color: var(--ink-soft); background: rgba(255,255,255,0.72); }
.canvas-placeholder p { margin: 14px 0 4px; color: var(--ink); font-weight: 600; }
.canvas-placeholder span { font-size: 11px; }
.placeholder-ring { width: 74px; height: 74px; border: 2px dashed #c9bfdf; border-radius: 50%; display: grid; place-items: center; color: var(--primary); font-size: 22px; font-weight: 700; }
.preview-note { margin-top: 12px; font-size: 11px; color: var(--ink-soft); background: var(--surface-soft); border-radius: 9px; padding: 9px 11px; }

.outfit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.outfit-card { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.outfit-card img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--surface-soft); }
.outfit-card .outfit-body { padding: 10px; }
.outfit-card h4 { margin: 0 0 3px; font-size: 13px; }
.outfit-card p { margin: 0; font-size: 10px; color: var(--ink-soft); }
.outfit-card .mini-btn { border-top: 1px solid var(--line); }
.outfit-actions { display: flex; border-top: 1px solid var(--line); }
.outfit-actions .mini-btn { border-top: 0; }
.picker-filter { margin-bottom: 10px; }
.empty-inline { color: var(--ink-soft); font-size: 12px; padding: 14px 0; }

.recommend-layout { display: grid; grid-template-columns: minmax(320px, 0.85fr) minmax(360px, 1.15fr); gap: 20px; align-items: start; }
.weather-card { background: linear-gradient(135deg, #f0ecfa, #f8f4fb); border: 1px solid #e4dcf5; border-radius: 14px; padding: 18px; margin-bottom: 18px; }
.weather-loading { color: var(--ink-soft); font-size: 12px; }
.weather-main { display: flex; align-items: center; gap: 16px; }
.weather-icon { width: 54px; height: 54px; border-radius: 16px; background: #fff; display: grid; place-items: center; font-size: 17px; font-weight: 700; color: var(--primary); }
.weather-temp { font-size: 30px; font-weight: 700; line-height: 1.1; }
.weather-temp small { font-size: 14px; font-weight: 500; }
.weather-detail { font-size: 11px; color: var(--ink-soft); margin-top: 4px; }
.control-group { margin-bottom: 16px; }
.inline-input { display: flex; gap: 8px; align-items: center; }
.inline-input .text-input { flex: 1; min-width: 0; }
.checkbox-line { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-soft); cursor: pointer; }
.checkbox-line input { accent-color: var(--primary); }
.manual-weather { display: flex; gap: 8px; margin-top: 9px; }
.manual-weather .text-input { width: 100px; }
.manual-weather .select { flex: 1; }
.parsed-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.parsed-chip { font-size: 10px; background: var(--accent-soft); color: var(--accent); padding: 2px 7px; border-radius: 6px; }
.exclude-box { max-height: 100px; overflow-y: auto; display: flex; flex-wrap: wrap; gap: 5px; }
.exclude-chip { font-size: 10px; border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px; background: var(--surface-soft); color: var(--ink-soft); }
.exclude-chip.off { opacity: 0.4; }

.results-heading { margin: 6px 0 14px; }
.results-heading h3 { margin: 0; font-size: 16px; }
.results-heading p { margin: 3px 0 0; font-size: 12px; color: var(--ink-soft); }
.recommend-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.recommend-card.best { border-color: #cfc2ec; }
.rec-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.rec-top h4 { margin: 0; font-size: 15px; }
.rec-top p { margin: 3px 0 0; font-size: 11px; color: var(--ink-soft); }
.score-badge { background: var(--primary); color: #fff; border-radius: 10px; padding: 6px 10px; font-size: 13px; font-weight: 700; white-space: nowrap; }
.score-badge small { font-size: 9px; font-weight: 400; opacity: 0.8; }
.rec-items { display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap; }
.rec-thumb { width: 62px; text-align: center; }
.rec-thumb img { width: 62px; height: 62px; object-fit: cover; border-radius: 8px; background: var(--surface-soft); border: 1px solid var(--line); }
.rec-thumb span { display: block; font-size: 9px; color: var(--ink-soft); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-reasons { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.reason { font-size: 11px; color: var(--green); background: #eef7f2; border-radius: 6px; padding: 3px 8px; }
.reason.warn { color: var(--accent); background: var(--accent-soft); }
.rec-actions { display: flex; gap: 8px; }
.rec-actions button { flex: 1; font-size: 12px; }

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; align-items: start; }
.settings-grid .panel { margin-bottom: 0; }
.settings-grid .field-label { margin-top: 12px; }
.setting-info { font-size: 12px; color: var(--ink-soft); background: var(--surface-soft); border-radius: 10px; padding: 12px; margin-bottom: 14px; }
.file-label { display: inline-block; text-align: center; cursor: pointer; }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: #2f2a3f; color: #fff; padding: 11px 18px; border-radius: 10px; font-size: 13px; opacity: 0; pointer-events: none; transition: all 0.22s; z-index: 200; max-width: 80vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #a84d4a; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(31,27,45,0.42); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal { background: var(--surface); border-radius: 18px; width: min(620px, 100%); max-height: 88vh; overflow-y: auto; box-shadow: 0 24px 70px rgba(30,24,50,0.25); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 22px 12px; }
.modal-head h3 { margin: 0; font-size: 17px; }
.modal-head button { border: 0; background: transparent; font-size: 20px; color: var(--ink-soft); line-height: 1; }
.modal-body { padding: 6px 22px 10px; }

.image-viewer { width: min(1000px, 96vw); max-height: 92vh; display: flex; flex-direction: column; background: var(--surface); border-radius: 18px; overflow: hidden; box-shadow: 0 24px 70px rgba(30,24,50,0.3); }
.viewer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.viewer-head h3 { margin: 0; font-size: 15px; }
.viewer-tools { display: flex; align-items: center; gap: 6px; }
.viewer-scale { min-width: 46px; text-align: center; font-size: 12px; color: var(--ink-soft); }
.viewer-stage { flex: 1; min-height: 300px; overflow: hidden; display: grid; place-items: center; background: var(--surface-soft); touch-action: none; cursor: grab; }
.viewer-stage:active { cursor: grabbing; }
.viewer-stage img { max-width: 90%; max-height: 70vh; object-fit: contain; user-select: none; transform-origin: center center; }
.viewer-tip { margin: 0; padding: 8px 16px 12px; font-size: 11px; color: var(--ink-soft); text-align: center; }
.preview-actions { display: flex; gap: 6px; }

.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid .field-label { margin-top: 12px; }
.upload-area { display: flex; gap: 12px; align-items: center; }
.upload-preview { width: 84px; height: 84px; border-radius: 12px; background: var(--surface-soft); border: 1px dashed var(--line); object-fit: cover; display: grid; place-items: center; color: var(--ink-soft); font-size: 11px; }
.upload-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 11px; }
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input[type="range"] { flex: 1; accent-color: var(--primary); }
.range-row strong { width: 16px; text-align: center; }
.season-row { display: flex; gap: 10px; flex-wrap: wrap; }
.season-row label { font-size: 12px; color: var(--ink-soft); display: flex; gap: 4px; align-items: center; }
.help-content h4 { margin: 16px 0 6px; font-size: 13px; }
.help-content p, .help-content li { font-size: 12px; color: var(--ink-soft); }
.help-content ol { padding-left: 20px; }

.ai-status { margin-top: 12px; padding: 9px 11px; border-radius: 9px; font-size: 11px; background: var(--surface-soft); color: var(--ink-soft); border: 1px solid var(--line); }
.ai-status.pending { background: var(--primary-soft); color: var(--primary); border-color: #ddd4f1; }
.ai-status.done { background: #eef7f2; color: var(--green); border-color: #cfe6db; }
.ai-status.error { background: #fdf0ef; color: #a84d4a; border-color: #f0cfcd; }

.batch-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 92px; border: 1.5px dashed #cabfe4; border-radius: 12px; background: var(--surface-soft); cursor: pointer; text-align: center; }
.batch-drop strong { font-size: 13px; color: var(--primary); }
.batch-drop span { font-size: 11px; color: var(--ink-soft); }
.batch-drop.dragover { background: var(--primary-soft); border-color: var(--primary); }
.batch-summary { margin: 12px 0 8px; font-size: 12px; color: var(--ink-soft); }
.batch-rows { display: grid; gap: 10px; max-height: 52vh; overflow-y: auto; padding-right: 3px; }
.batch-row { display: grid; grid-template-columns: 62px 1fr; gap: 10px; padding: 9px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.batch-thumb { width: 62px; height: 78px; border-radius: 9px; overflow: hidden; background: var(--surface-soft); }
.batch-thumb img { width: 100%; height: 100%; object-fit: cover; }
.batch-fields { min-width: 0; }
.batch-line { display: grid; grid-template-columns: 1.2fr 0.9fr 0.7fr; gap: 7px; align-items: center; }
.batch-line .batch-input { width: 100%; min-width: 0; }
.batch-line.batch-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 7px; }
.batch-state { font-size: 11px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch-state.done { color: var(--green); }
.batch-state.failed { color: #a84d4a; }
.batch-actions { display: flex; gap: 5px; flex-shrink: 0; }
.small-btn { padding: 4px 8px; font-size: 11px; }
.ghost-btn.danger { color: #a84d4a; }
.batch-details { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line); }
.batch-details label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--ink-soft); min-width: 0; }
.batch-details .season-row { padding-top: 4px; }
.batch-details .full { grid-column: 1 / -1; }

.virtual-editor { display: grid; grid-template-columns: 250px 1fr; gap: 18px; align-items: start; }
.virtual-preview { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 14px; aspect-ratio: 3 / 4; overflow: hidden; display: grid; place-items: center; }
.virtual-preview svg, .virtual-preview img { width: 100%; height: 100%; object-fit: cover; }
.virtual-controls { max-height: 54vh; overflow-y: auto; padding-right: 4px; }
.virtual-controls .inline-input { flex-wrap: wrap; }
.virtual-controls .field-label { margin-top: 10px; }

.remote-info { display: flex; gap: 16px; align-items: flex-start; margin: 12px 0; }
.remote-qr { width: 132px; flex-shrink: 0; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.remote-qr img { width: 100%; height: auto; display: block; }
.remote-qr span { display: block; font-size: 10px; color: var(--ink-soft); margin-top: 4px; }
.remote-detail { min-width: 0; flex: 1; }
.remote-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; padding: 7px 9px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 8px; word-break: break-all; }
.remote-mono.strong { font-weight: 700; letter-spacing: 2px; color: var(--primary); font-size: 14px; }

@media (max-width: 1100px) {
  .virtual-editor { grid-template-columns: 1fr; }
  .virtual-preview { max-width: 300px; }
  .stylist-layout, .recommend-layout { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; padding: 12px; gap: 10px; overflow-x: auto; }
  .brand { padding: 0 8px 0 0; flex-shrink: 0; }
  .brand p { display: none; }
  .nav { flex-direction: row; gap: 4px; }
  .nav-item { padding: 8px 10px; white-space: nowrap; }
  .sidebar-foot { display: none; }
  .main { padding: 0 16px 36px; }
  .topbar { padding: 20px 0; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .settings-grid { grid-template-columns: 1fr; }
  .remote-info { flex-direction: column; align-items: center; }
  .remote-qr { width: 180px; }
  .remote-detail { width: 100%; }
  .batch-row { grid-template-columns: 52px 1fr; }
  .batch-thumb { width: 52px; height: 68px; }
  .batch-line { grid-template-columns: 1fr 1fr; }
  .batch-details { grid-template-columns: 1fr; }
  .batch-line.batch-meta { flex-wrap: wrap; }
}
