/* ========== 全局样式 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, #faf7ff 0%, #eef5fc 50%, #f5f8ff 100%);
  color: #2d2b3d;
  line-height: 1.6;
  font-size: 14px;
  min-height: 100vh;
}

:root {
  /* 蓝紫渐变主题色系 */
  --primary-purple: #a855f7;
  --primary-deeppurple: #8b5cf6;
  --primary-blue: #06b6d4;
  --primary-deepblue: #0891b2;
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --primary-light: #c084fc;
  --primary-dark: #6d28d9;

  /* 主渐变：左上紫 → 右下青蓝 */
  --primary-gradient: linear-gradient(135deg, #a855f7 0%, #8b5cf6 50%, #06b6d4 100%);
  --primary-gradient-hover: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 50%, #0891b2 100%);
  --primary-gradient-soft: linear-gradient(135deg, rgba(168, 85, 247, 0.12), rgba(6, 182, 212, 0.12));

  /* 点缀色 */
  --accent: #22d3ee;
  --accent-deep: #06b6d4;
  --accent-emerald: #6ee7b7;
  --danger: #ef4444;
  --danger-hover: #dc2626;
  --warning: #f59e0b;

  /* 灰阶 */
  --gray-50: #faf9fc;
  --gray-100: #f3f1f9;
  --gray-200: #e8e5ef;
  --gray-300: #d4d0dd;
  --gray-400: #a8a3b3;
  --gray-500: #7c7888;
  --gray-600: #565263;
  --gray-700: #3e3b4b;
  --gray-800: #26243a;

  /* 阴影（玻璃拟态风格） */
  --shadow-sm: 0 2px 8px rgba(139, 92, 246, 0.08);
  --shadow: 0 4px 16px rgba(139, 92, 246, 0.10);
  --shadow-md: 0 8px 24px rgba(139, 92, 246, 0.12);
  --shadow-lg: 0 16px 48px rgba(139, 92, 246, 0.16);

  /* 圆角 */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;
}

/* ========== 顶部导航 ========== */
.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
  margin: 0 16px 0 16px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 44px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px rgba(168, 85, 247, 0.35));
}

.logo-icon svg {
  width: 100%;
  height: 100%;
}

.nav-left h1 {
  font-size: 20px;
  font-weight: 700;
  color: var(--gray-800);
  letter-spacing: -0.3px;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.backup-tip {
  color: var(--primary-dark);
  font-size: 13px;
  padding: 6px 14px;
  background: var(--primary-gradient-soft);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: var(--radius-pill);
  max-width: 520px;
}

.version-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  background: linear-gradient(135deg, #f3e8ff, #e0f2fe);
  border-radius: 12px;
  font-size: 11px;
  color: #8b5cf6;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid rgba(139, 92, 246, 0.15);
  user-select: none;
}

.version-badge:hover {
  background: linear-gradient(135deg, #e0d4ff, #c7f0fb);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}

.version-badge:active {
  transform: translateY(0);
}

/* ========== 按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border: 1px solid transparent;
  background: #ffffff;
  color: var(--gray-600);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
}

.btn:hover {
  background: var(--gray-50);
  border-color: var(--gray-200);
  color: var(--gray-700);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary-gradient);
  border-color: transparent;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(139, 92, 246, 0.35), 0 2px 8px rgba(6, 182, 212, 0.25);
}

.btn-primary:hover {
  background: var(--primary-gradient-hover);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.45), 0 4px 14px rgba(6, 182, 212, 0.35);
  transform: translateY(-2px);
}

.btn-success {
  background: linear-gradient(135deg, #06b6d4, #0891b2);
  border-color: transparent;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.35);
}

.btn-success:hover {
  background: linear-gradient(135deg, #0891b2, #0e7490);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.45);
  transform: translateY(-2px);
}

.btn-danger {
  background: linear-gradient(135deg, #f87171, #ef4444);
  border-color: transparent;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
  transform: translateY(-2px);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--gray-200);
  color: var(--gray-600);
}

.btn-ghost:hover {
  background: var(--primary-gradient-soft);
  border-color: rgba(6, 182, 212, 0.4);
  color: var(--primary-deeppurple);
}

.btn-lg {
  padding: 12px 28px;
  font-size: 15px;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 13px;
}

/* ========== 主容器 ========== */
.main-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 28px;
}

/* ========== 卡片 ========== */
.card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.8);
}

/* ========== 操作按钮区 ========== */
.action-section {
  margin-bottom: 20px;
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* ========== 筛选区 ========== */
.filter-section.card {
  padding: 10px 14px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.88);
}

.filter-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.filter-header h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  white-space: nowrap;
}

.filter-search {
  position: relative;
  flex: 1;
  min-width: 120px;
  max-width: 240px;
  display: flex;
  align-items: center;
}

.filter-search input {
  width: 100%;
  padding: 4px 28px 4px 10px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: #fff;
  font-size: 12px;
  transition: all 0.15s;
}

.filter-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
  outline: none;
}

/* Nav button active state */
.btn.btn-ghost.nav-active {
  background: var(--primary-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--shadow-sm);
}

/* Upload progress bar */
.upload-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.progress-bar-bg {
  flex: 1;
  height: 8px;
  background: var(--gray-200);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 12px;
  color: var(--gray-600);
  white-space: nowrap;
}

/* Recycle bin batch bar */
.recycle-batch-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: var(--radius);
  margin-bottom: 12px;
  animation: slideDown 0.25s ease;
}

.recycle-batch-bar span {
  font-size: 13px;
  color: #92400e;
  font-weight: 500;
}

.recycle-batch-bar .btn {
  padding: 4px 12px;
  font-size: 12px;
}

/* Recycle checkbox */
.card.recycle-card {
  position: relative;
}

.card.recycle-card .card-checkbox {
  display: block;
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.filter-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: end;
  overflow-x: auto;
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex-shrink: 1;
}

.filter-item label {
  font-size: 10px;
  color: var(--gray-500);
  font-weight: 500;
  white-space: nowrap;
}

.filter-item select,
.filter-item input[type="month"] {
  padding: 2px 6px;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  background: var(--gray-50);
  font-size: 11px;
  color: var(--gray-800);
  height: 24px;
  transition: border-color 0.15s, background 0.15s;
  width: 100%;
  min-width: 60px;
  max-width: 100px;
}

.filter-item select:hover,
.filter-item input:hover {
  background: #fff;
  border-color: var(--gray-300);
}

.filter-item select:focus,
.filter-item input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.08);
}

.filter-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.filter-actions .btn {
  padding: 3px 10px;
  height: 24px;
  font-size: 11px;
  line-height: 1;
}

.filter-date-item input[type="month"] {
  max-width: 110px;
}

/* 开关 */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--gray-300);
  transition: 0.3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background-color: var(--primary);
}

.switch input:checked + .slider:before {
  transform: translateX(20px);
}

.switch-label {
  font-size: 12px;
  color: var(--gray-500);
}

/* ========== 统计看板 ========== */
.dashboard-section {
  margin-bottom: 8px;
}

.dashboard-section h3 {
  margin-bottom: 6px;
  font-size: 13px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.dashboard-card {
  padding: 10px 12px !important;
}

.dashboard-card h4 {
  margin-bottom: 6px;
  color: var(--gray-600);
  font-size: 11px;
  font-weight: 500;
}

.stat-total {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.stat-number {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, #a855f7, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1px;
}

.stat-label {
  color: var(--gray-500);
  font-size: 11px;
}

/* 柱状图 */
.chart-bar {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.chart-bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
}

.chart-bar-label {
  width: 44px;
  color: var(--gray-600);
  flex-shrink: 0;
}

.chart-bar-track {
  flex: 1;
  height: 12px;
  background: var(--gray-100);
  border-radius: 6px;
  overflow: hidden;
  position: relative;
}

.chart-bar-fill {
  height: 100%;
  background: var(--primary-gradient);
  border-radius: 6px;
  transition: width 0.5s ease;
  min-width: 2px;
}

.chart-bar-value {
  width: 24px;
  text-align: right;
  color: var(--gray-500);
  font-weight: 500;
  flex-shrink: 0;
}

/* 饼图 */
.chart-pie {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chart-pie-visual {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 2px auto;
  position: relative;
}

.chart-pie-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 10px;
  justify-content: center;
}

.pie-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pie-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

/* ========== 衣橱健康度评分卡片 ========== */
.health-card {
  margin-top: 8px;
  padding: 10px 14px;
}

.health-card h4 {
  margin-bottom: 6px;
  color: var(--gray-600);
  font-size: 12px;
  font-weight: 500;
}

.health-layout {
  display: flex;
  gap: 12px;
  align-items: stretch;
  flex-wrap: wrap;
}

.health-score-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 90px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.08), rgba(6, 182, 212, 0.08));
  border: 1px solid rgba(168, 85, 247, 0.15);
}

.health-score {
  font-size: 34px;
  font-weight: 800;
  line-height: 1;
  background: linear-gradient(135deg, #a855f7, #06b6d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -2px;
}

.health-score-unit {
  color: var(--gray-400);
  font-size: 10px;
  margin-top: 2px;
}

.health-grade {
  margin-top: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  background: var(--gray-100);
  color: var(--gray-600);
}

.health-grade.grade-excellent { background: #dcfce7; color: #15803d; }
.health-grade.grade-good      { background: #dbeafe; color: #1d4ed8; }
.health-grade.grade-fair      { background: #fef9c3; color: #a16207; }
.health-grade.grade-poor      { background: #fee2e2; color: #b91c1c; }

.health-detail {
  flex: 1;
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.health-dim {
  display: grid;
  grid-template-columns: 80px 1fr 26px;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}

.health-dim-name {
  color: var(--gray-600);
}

.health-dim-bar {
  height: 5px;
  background: var(--gray-100);
  border-radius: 999px;
  overflow: hidden;
}

.health-dim-fill {
  height: 100%;
  width: 0%;
  background: var(--primary-gradient);
  border-radius: 999px;
  transition: width 0.5s ease;
}

.health-dim-score {
  text-align: right;
  color: var(--gray-500);
  font-weight: 500;
  font-size: 10px;
}

.health-advice {
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 10px;
  color: var(--gray-600);
}

.health-advice-item {
  display: flex;
  align-items: flex-start;
  gap: 3px;
  line-height: 1.3;
}

.health-advice-item::before {
  content: "💡";
  flex-shrink: 0;
}

/* 场合标签（A3） */
.tag-occasion {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #c4b5fd;
}

/* 颜色搭配建议（B4） */
#outfitColorAdvice {
  margin: 0 0 12px 0;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.5;
  display: none;
}

#outfitColorAdvice.advice-ok {
  display: block;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

#outfitColorAdvice.advice-tip {
  display: block;
  background: #fef9c3;
  color: #a16207;
  border: 1px solid #fde047;
}

#outfitColorAdvice.advice-warn {
  display: block;
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

/* ========== 批量操作栏 ========== */
.batch-action-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.batch-action-bar select {
  padding: 6px 10px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: #fff;
  font-size: 13px;
}

/* ========== 列表区 ========== */
.list-section {
  margin-bottom: 32px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.list-count {
  color: var(--gray-500);
  font-size: 13px;
}

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

/* 衣物列表：8列布局 */
#clothingGrid {
  grid-template-columns: repeat(8, 1fr);
}

/* 响应式调整：小屏幕自适应 */
@media (max-width: 1200px) {
  #clothingGrid {
    grid-template-columns: repeat(6, 1fr);
  }
}

@media (max-width: 900px) {
  #clothingGrid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 600px) {
  #clothingGrid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.outfit-grid {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

/* 衣物卡片 */
.clothing-card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.6);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  position: relative;
}

.clothing-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(139, 92, 246, 0.3);
}

.card-checkbox {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.card-image {
  width: 100%;
  height: 120px;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card-image-placeholder {
  width: 100%;
  height: 100%;
  background: var(--gray-100);
  color: var(--gray-400);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  text-align: center;
  padding: 10px;
  gap: 4px;
}

.card-image-placeholder::before {
  content: "🖼️";
  font-size: 32px;
  opacity: 0.5;
}

.card-info {
  padding: 8px;
}

.card-title {
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 4px;
  font-size: 12px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 4px;
}

.tag {
  display: inline-block;
  padding: 1px 5px;
  background: var(--gray-100);
  color: var(--gray-600);
  border-radius: 10px;
  font-size: 11px;
}

.tag-season-spring { background: #dcfce7; color: #166534; }
.tag-season-summer { background: #bae6fd; color: #075985; }
.tag-season-autumn { background: #fed7aa; color: #9a3412; }
.tag-season-winter { background: #dbeafe; color: #1e40af; }
.tag-season-all { background: #f3e8ff; color: #6b21a8; }

.tag-status-normal { background: #dcfce7; color: #166534; }
.tag-status-borrow { background: #fef3c7; color: #92400e; }
.tag-status-damage { background: #fee2e2; color: #991b1b; }
.tag-status-destroy { background: #e5e7eb; color: #4b5563; }
.tag-status-other { background: #f3f4f6; color: #4b5563; }

.card-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--gray-500);
}

.card-recycled-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--gray-600);
  color: #fff;
  padding: 4px 10px;
  font-size: 11px;
  border-bottom-left-radius: var(--radius);
  z-index: 2;
}

/* 穿搭卡片 */
.outfit-card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.6);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}

.outfit-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(139, 92, 246, 0.3);
}

.outfit-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  height: 200px;
  background: var(--gray-100);
}

.outfit-images .card-image {
  height: 100%;
}

.outfit-info {
  padding: 12px;
}

.outfit-name {
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 4px;
}

.outfit-count {
  font-size: 12px;
  color: var(--gray-500);
}

/* 回收站卡片按钮 */
.recycle-actions {
  display: flex;
  gap: 8px;
  padding: 0 12px 12px;
}

.recycle-actions .btn {
  flex: 1;
  padding: 6px 12px;
  font-size: 13px;
}

/* 空状态 */
.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: var(--gray-400);
  background: #fff;
  border-radius: var(--radius-md);
  border: 2px dashed var(--gray-200);
}

.empty-state p {
  font-size: 15px;
}

/* ========== 弹窗 ========== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-content {
  background: #fff;
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-lg {
  max-width: 960px;
}

.modal-sm {
  max-width: 400px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--gray-100);
  background: var(--primary-gradient-soft);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-800);
}

.modal-close {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-pill);
  font-size: 18px;
  color: var(--gray-500);
  cursor: pointer;
  line-height: 1;
  padding: 6px 10px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close:hover {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.2);
}

.modal-close-light {
  position: absolute;
  top: 20px;
  right: 20px;
  color: #fff;
  font-size: 32px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  background: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-100);
}

/* ========== 上传区 ========== */
.upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-md);
  padding: 60px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--gray-50);
}

.upload-area:hover,
.upload-area.dragover {
  border-color: var(--primary);
  background: #eff6ff;
}

.upload-area p {
  font-size: 16px;
  color: var(--gray-600);
}

.upload-hint {
  font-size: 12px !important;
  color: var(--gray-400) !important;
  margin-top: 8px;
}

.upload-list-section h4 {
  margin-bottom: 16px;
  color: var(--gray-700);
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.upload-card {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 12px;
}

.upload-fail-grid .upload-card {
  border-color: #fde68a;
  background: #fffbeb;
}

.upload-card-header {
  display: flex;
  gap: 12px;
  margin-bottom: 12px;
}

.upload-thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.upload-fail-tip {
  font-size: 11px;
  color: #92400e;
  background: #fde68a;
  padding: 4px 8px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.upload-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.upload-form .form-row {
  gap: 4px;
}

.upload-form label {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 2px;
}

.required-star {
  color: var(--danger);
  font-weight: 700;
  line-height: 1;
  margin-right: 1px;
}

.upload-form select,
.upload-form input {
  padding: 4px 8px;
  font-size: 12px;
}

.upload-remove-btn {
  align-self: flex-start;
  padding: 2px 8px;
  font-size: 12px;
  background: none;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  cursor: pointer;
  color: var(--gray-500);
}

.upload-remove-btn:hover {
  color: var(--danger);
  border-color: var(--danger);
}

.upload-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-200);
}

/* ========== 衣物详情 ========== */
.clothing-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.clothing-preview {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 12px;
}

.detail-image-wrap {
  width: 100%;
  min-height: 400px;
  max-height: 450px;
  background: var(--gray-100);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 10px;
  box-sizing: border-box;
}

.detail-img {
  max-width: 100%;
  max-height: 430px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  display: block;
}

.clothing-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-row label {
  font-size: 13px;
  color: var(--gray-600);
  font-weight: 500;
}

.form-row select,
.form-row input[type="text"],
.form-row input[type="month"] {
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 14px;
  background: #fff;
  color: var(--gray-800);
}

.form-row select:focus,
.form-row input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.form-row select:disabled,
.form-row input:disabled {
  background: var(--gray-100);
  color: var(--gray-400);
  cursor: not-allowed;
}

.borrow-section {
  padding: 12px;
  background: var(--primary-gradient-soft);
  border-radius: var(--radius);
  border: 1px solid rgba(168, 85, 247, 0.18);
  margin-top: 8px;
}

.borrow-section h4 {
  margin-bottom: 12px;
  color: var(--primary);
  font-size: 14px;
}

/* ========== 穿搭选择器 ========== */
.outfit-picker {
  margin: 16px 0;
}

/* 搜索框 */
.picker-search {
  position: relative;
  margin-bottom: 16px;
}

.picker-search input {
  width: 100%;
  padding: 8px 36px 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--gray-50);
  transition: border-color 0.2s, background 0.2s;
}

.picker-search input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
}

.picker-search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--gray-200);
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 12px;
  color: var(--gray-500);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.picker-search-clear:hover {
  background: var(--gray-300);
  color: var(--gray-700);
}

.picker-section {
  margin-bottom: 20px;
}

.picker-section h4 {
  margin-bottom: 10px;
  color: var(--gray-700);
}

.picker-count {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: normal;
}

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

.picker-item {
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.picker-item:hover {
  border-color: var(--gray-400);
}

.picker-item.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.picker-item-image {
  width: 100%;
  height: 100px;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.picker-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.picker-item-name {
  padding: 6px 8px;
  font-size: 12px;
  color: var(--gray-600);
  background: #fff;
  text-align: center;
}

.picker-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 20px;
  height: 20px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.picker-item.selected .picker-check {
  display: flex;
}

/* ========== 穿搭详情图册 ========== */
.outfit-detail-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.gallery-item {
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
  box-shadow: var(--shadow);
  background: var(--gray-100);
}

.gallery-item img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}

/* 图片大图查看 */
.image-modal {
  background: rgba(0, 0, 0, 0.85);
}

.image-modal-content {
  background: transparent;
  box-shadow: none;
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
}

.viewer-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius);
}

/* ========== Toast ========== */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 4px solid;
  animation: slideIn 0.3s ease;
  min-width: 200px;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast-success {
  border-left-color: var(--accent-deep);
}

.toast-error {
  border-left-color: var(--danger);
}

.toast-warning {
  border-left-color: var(--warning);
}

.toast-info {
  border-left-color: var(--primary);
}

/* ========== 背景装饰 ========== */
.bg-decoration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
}

.orb-1 {
  top: -200px;
  right: -100px;
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, #a855f7 0%, transparent 70%);
  animation: float1 20s ease-in-out infinite;
}

.orb-2 {
  bottom: -180px;
  left: -150px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, #06b6d4 0%, transparent 70%);
  animation: float2 25s ease-in-out infinite;
  opacity: 0.32;
}

.orb-3 {
  top: 35%;
  right: 25%;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, #8b5cf6 0%, transparent 70%);
  animation: float3 30s ease-in-out infinite;
  opacity: 0.22;
}

@keyframes float1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-30px, 40px); }
}

@keyframes float2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(40px, -30px); }
}

@keyframes float3 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-20px, -20px); }
}

/* ========== IndexedDB 失败警告条 ========== */
.storage-warning {
  position: sticky;
  top: 0;
  z-index: 99;
  background: linear-gradient(135deg, #fef2f2 0%, #fff7ed 100%);
  border-bottom: 2px solid #ef4444;
  padding: 0 16px;
  animation: slideDown 0.35s ease;
}

@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.storage-warning-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ============================================================
   B3: Lookbook 画廊视图（纯 CSS radio 切换，无 JS）
   ============================================================ */
/* 隐藏用于切换的 radio，仅通过 label 触发 */
.outfit-view-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.outfit-view-toggle {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.65);
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(139, 92, 246, 0.18);
  width: fit-content;
  margin-bottom: 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.outfit-view-toggle .view-btn {
  padding: 6px 18px;
  border: none;
  background: transparent;
  color: var(--gray-600);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
  user-select: none;
}

.outfit-view-toggle .view-btn:hover {
  color: var(--primary-deeppurple);
}

/* 激活态：蓝紫渐变胶囊 */
#outfitViewGrid:checked ~ .outfit-view-toggle label[for="outfitViewGrid"],
#outfitViewLookbook:checked ~ .outfit-view-toggle label[for="outfitViewLookbook"] {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
}

/* 默认（宫格）：画廊视图隐藏 */
.lookbook-view {
  display: none;
  column-count: 3;
  column-gap: 16px;
}

/* 切换到画廊视图：隐藏宫格、显示画廊、隐藏空状态 */
#outfitViewLookbook:checked ~ #outfitGrid { display: none; }
#outfitViewLookbook:checked ~ #lookbookView { display: block; }
#outfitViewLookbook:checked ~ #outfitEmpty { display: none !important; }

/* 画廊卡片：大图 + 瀑布流，break-inside 防截断 */
.lookbook-card {
  break-inside: avoid;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.6);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
  cursor: pointer;
}

.lookbook-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(139, 92, 246, 0.35);
}

.lookbook-card-image {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lookbook-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lookbook-card-emoji {
  font-size: 48px;
  opacity: 0.65;
}

.lookbook-card-info {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.lookbook-card-name {
  font-weight: 600;
  color: var(--gray-800);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lookbook-card-count {
  flex-shrink: 0;
  padding: 2px 10px;
  background: var(--primary-gradient-soft);
  color: var(--primary-deeppurple);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
}

/* ============================================================
   B5: 拖拽创建穿搭模式
   ============================================================ */
/* 工具栏：搜索框 + 模式切换 并排 */
.picker-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.picker-toolbar .picker-search {
  flex: 1;
  margin-bottom: 0;
  min-width: 200px;
}

/* 模式切换胶囊按钮组 */
.picker-mode-toggle {
  display: flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.7);
  padding: 3px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(139, 92, 246, 0.18);
  flex-shrink: 0;
}

.picker-mode-toggle .mode-btn {
  padding: 6px 14px;
  border: none;
  background: transparent;
  color: var(--gray-600);
  border-radius: var(--radius-pill);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}

.picker-mode-toggle .mode-btn:hover {
  color: var(--primary-deeppurple);
}

.picker-mode-toggle .mode-btn.active {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 3px 10px rgba(139, 92, 246, 0.25);
}

/* 拖拽模式整体布局：左侧衣物库 + 右侧画板 */
.picker-drag-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  min-height: 400px;
}

/* 左侧衣物库 */
.picker-source {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(139, 92, 246, 0.12);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
}

.picker-source h4 {
  margin-bottom: 10px;
  color: var(--gray-700);
  font-size: 13px;
}

.picker-source-list {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  align-content: start;
  max-height: 460px;
  overflow-y: auto;
  padding-right: 4px;
}

.picker-source-empty {
  grid-column: 1 / -1;
  color: var(--gray-400);
  font-size: 12px;
  text-align: center;
  padding: 30px 10px;
}

/* 可拖拽源卡片 */
.source-item {
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: grab;
  background: #fff;
  transition: transform 0.15s, border-color 0.15s, opacity 0.15s, box-shadow 0.15s;
  position: relative;
}

.source-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.source-item.selected {
  opacity: 0.45;
  border-color: var(--primary);
  cursor: default;
}

.source-item.selected::after {
  content: "✓ 已添加";
  position: absolute;
  top: 4px;
  left: 4px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  z-index: 1;
}

.source-item.dragging {
  opacity: 0.4;
  cursor: grabbing;
}

.source-item-image {
  width: 100%;
  height: 70px;
  background: var(--gray-100);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.source-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.source-item-name {
  padding: 4px 6px;
  font-size: 11px;
  color: var(--gray-600);
  text-align: center;
  background: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 右侧画板：上装/下装/配饰三栏 */
.picker-dropzone {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.dropzone-column {
  background: rgba(255, 255, 255, 0.5);
  border: 2px dashed rgba(139, 92, 246, 0.25);
  border-radius: var(--radius-md);
  padding: 10px;
  min-height: 360px;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.dropzone-column h4 {
  margin-bottom: 10px;
  color: var(--gray-700);
  font-size: 13px;
}

/* 拖拽悬停高亮（仅匹配分类的栏位） */
.dropzone-column.drag-over {
  background: rgba(139, 92, 246, 0.08);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}

.dropzone-slot {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dropzone-hint {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-size: 12px;
  text-align: center;
  padding: 20px 10px;
  border-radius: var(--radius);
}

/* 画板内已选衣物项（小缩略图 + 名称 + × 移除） */
.dropzone-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  position: relative;
  transition: border-color 0.15s, transform 0.15s;
  cursor: grab;
}

.dropzone-item:hover {
  border-color: var(--primary);
}

.dropzone-item.dragging {
  opacity: 0.5;
  transform: scale(0.98);
}

.dropzone-item.drag-over-top {
  border-top: 3px solid var(--primary);
  margin-top: 8px;
}

.dropzone-item.drag-over-bottom {
  border-bottom: 3px solid var(--primary);
  margin-bottom: 8px;
}

.dropzone-item-image {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropzone-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dropzone-item-image .card-image-placeholder {
  height: 100%;
}

.dropzone-item-name {
  flex: 1;
  font-size: 12px;
  color: var(--gray-700);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dropzone-item-x {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border: none;
  background: var(--gray-200);
  color: var(--gray-600);
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
}

.dropzone-item-x:hover {
  background: #ef4444;
  color: #fff;
}

/* 响应式：窄屏拖拽布局纵向堆叠 + 画廊列数降级 */
@media (max-width: 720px) {
  .picker-drag-layout {
    grid-template-columns: 1fr;
  }
  .picker-source-list {
    max-height: 240px;
  }
  .picker-dropzone {
    grid-template-columns: 1fr;
  }
  .lookbook-view {
    column-count: 1;
  }
  .picker-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .picker-mode-toggle {
    justify-content: center;
  }
}

@media (max-width: 1024px) and (min-width: 721px) {
  .lookbook-view {
    column-count: 2;
  }
}

.storage-warning-icon {
  font-size: 22px;
  flex-shrink: 0;
  animation: shake 2s ease-in-out infinite;
}

@keyframes shake {
  0%, 90%, 100% { transform: rotate(0); }
  92% { transform: rotate(-10deg); }
  94% { transform: rotate(10deg); }
  96% { transform: rotate(-6deg); }
  98% { transform: rotate(6deg); }
}

.storage-warning-text {
  flex: 1;
  font-size: 13px;
  color: #991b1b;
  line-height: 1.5;
}

.storage-warning-text strong {
  color: #7f1d1d;
  font-weight: 700;
}

.storage-warning-close {
  flex-shrink: 0;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #b91c1c;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.storage-warning-close:hover {
  background: #ef4444;
  color: #fff;
  border-color: #ef4444;
}

@media (max-width: 768px) {
  .storage-warning-inner {
    padding: 10px 4px;
    gap: 8px;
  }
  .storage-warning-icon {
    font-size: 18px;
  }
  .storage-warning-text {
    font-size: 12px;
  }
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .top-nav {
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
  }

  .main-container {
    padding: 16px;
  }

  .nav-right {
    flex-direction: column;
    width: 100%;
  }

  .backup-tip {
    max-width: 100%;
  }

  .clothing-detail-layout {
    grid-template-columns: 1fr;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .batch-action-bar {
    flex-wrap: wrap;
  }

  .filter-search {
    max-width: none;
    width: 100%;
  }

  .filter-header {
    flex-wrap: wrap;
  }

  .filter-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }

  .filter-grid {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .filter-item select,
  .filter-item input[type="month"] {
    max-width: 100%;
  }

  .recycle-batch-bar {
    flex-wrap: wrap;
  }
}

/* ========== G3-11 / B1: 图片操作按钮 ========== */
.detail-image-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.btn-change-image {
  padding: 8px 12px;
  font-size: 13px;
  text-align: center;
  width: auto;
  margin: 0;
}

/* ========== G3-14: 穿搭选择器已选标签 ========== */
.picker-selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  min-height: 0;
}

.picker-selected-tags:empty {
  margin-bottom: 0;
}

.selected-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.3);
  border-radius: 12px;
  font-size: 12px;
  color: var(--primary-deeppurple);
  cursor: default;
  transition: all 0.15s;
}

.selected-tag:hover {
  background: rgba(139, 92, 246, 0.15);
}

.selected-tag-x {
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  border-radius: 50%;
  transition: all 0.15s;
}

.selected-tag-x:hover {
  background: var(--primary-deeppurple);
  color: #fff;
}

/* ============================================================
   C1-EXT: 旅行管理模块样式
   ============================================================ */

/* 旅行管理区域按钮容器 */
.travel-section-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* 行程卡片网格 */
.trip-grid {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* 行程卡片 */
.trip-card {
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.trip-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(139, 92, 246, 0.35);
}

.trip-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.trip-card-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--gray-800);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trip-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--gray-600);
}

.trip-card-intl {
  color: #d97706;
  background: #fef3c7;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

.trip-card-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}

.trip-card-progress .progress-bar-bg {
  flex: 1;
}

.trip-card-progress-text {
  font-size: 12px;
  color: var(--gray-500);
  white-space: nowrap;
  min-width: 92px;
  text-align: right;
}

/* 出行类型标签 */
.tag-travel-type {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  white-space: nowrap;
}

.tag-travel-休闲 { background: #dcfce7; color: #166534; }
.tag-travel-商务 { background: #dbeafe; color: #1e40af; }
.tag-travel-户外 { background: #fed7aa; color: #9a3412; }
.tag-travel-家庭 { background: #fce7f3; color: #9d174d; }
.tag-travel-其他 { background: #f3f4f6; color: #4b5563; }

/* 物品库管理弹窗 */
.travel-items-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-100);
  flex-wrap: wrap;
}

.travel-items-tip {
  font-size: 12px;
  color: var(--gray-500);
  flex: 1;
  min-width: 200px;
}

.travel-items-group {
  margin-bottom: 18px;
}

.travel-items-group h5 {
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--gray-200);
}

.travel-items-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.travel-item-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  transition: all 0.15s;
}

.travel-item-card:hover {
  background: var(--primary-gradient-soft);
  border-color: rgba(139, 92, 246, 0.25);
}

.travel-item-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.travel-item-name {
  font-size: 14px;
  color: var(--gray-800);
  font-weight: 500;
}

/* 必备/衣橱关联/新建 标签 */
.tag-essential,
.tag-wardrobe-link,
.tag-new-item,
.required-mark {
  display: inline-block;
  font-size: 11px;
  padding: 1px 8px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  white-space: nowrap;
}

.tag-essential {
  background: #fee2e2;
  color: #b91c1c;
}

.tag-wardrobe-link {
  background: #e0f2fe;
  color: #0369a1;
}

.tag-new-item {
  background: #fef3c7;
  color: #b45309;
}

.required-mark {
  color: var(--danger);
  padding: 0 2px;
  background: transparent;
}

.wardrobe-link-tag {
  font-size: 12px;
  padding: 3px 10px;
  background: var(--primary-gradient-soft);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius-pill);
  color: var(--primary-dark);
  font-weight: 500;
}

/* 行程详情弹窗：表单 */
.trip-edit-form {
  padding: 14px 16px;
  margin-bottom: 16px;
}

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

.form-row-full {
  grid-column: 1 / -1;
}

.form-row textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 13px;
  resize: vertical;
  font-family: inherit;
  background: #fff;
}

.form-row textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
  outline: none;
}

/* 进度条区域 */
.trip-progress-wrap {
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.trip-progress-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--gray-600);
  min-width: 110px;
}

.trip-progress-text strong {
  color: var(--primary-dark);
  font-size: 14px;
}

.trip-progress-wrap .progress-bar-bg {
  flex: 1;
  height: 10px;
}

.trip-progress-actions {
  display: flex;
  gap: 8px;
}

/* 推荐/清单 区块通用 */
.trip-recommend-section,
.trip-checklist-section {
  margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.trip-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--gray-200);
  gap: 10px;
  flex-wrap: wrap;
}

.trip-section-header h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--gray-800);
}

.checklist-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* 推荐项列表 */
.recommend-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recommend-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-left: 3px solid #fbbf24;
  border-radius: var(--radius);
  transition: all 0.15s;
}

.recommend-item:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-sm);
}

.recommend-item.added {
  background: #f0fdf4;
  border-left-color: #4ade80;
  opacity: 0.75;
}

.recommend-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.recommend-icon {
  font-size: 18px;
  line-height: 1;
}

.recommend-name {
  font-size: 14px;
  color: var(--gray-800);
  font-weight: 500;
}

.recommend-cat {
  font-size: 11px;
  color: var(--gray-500);
  background: var(--gray-100);
  padding: 1px 8px;
  border-radius: var(--radius-pill);
}

/* 打包清单分组 */
.checklist-group {
  margin-bottom: 14px;
}

.checklist-group h5 {
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--gray-200);
}

.checklist-group-count {
  font-size: 12px;
  color: var(--gray-500);
  font-weight: normal;
}

.checklist-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  transition: all 0.15s;
}

.checklist-item:hover {
  border-color: var(--primary-light);
}

.checklist-item.checked {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.checklist-item.checked .checklist-name {
  text-decoration: line-through;
  color: var(--gray-400);
}

.checklist-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  user-select: none;
}

.checklist-checkbox input[type=checkbox] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.checklist-name {
  font-size: 14px;
  color: var(--gray-800);
}

.checklist-remove {
  background: transparent;
  border: none;
  color: var(--gray-400);
  cursor: pointer;
  font-size: 14px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
}

.checklist-remove:hover {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

/* 衣橱选择器中：travel_item 卡片样式覆盖 */
.travel-item-picker {
  border-style: dashed;
}

.travel-item-picker.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.travel-item-picker.disabled:hover {
  border-color: #bbf7d0;
}

.travel-item-icon {
  background: var(--primary-gradient-soft) !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 空提示文字 */
.empty-tip {
  padding: 24px 16px;
  text-align: center;
  color: var(--gray-400);
  font-size: 13px;
}

/* 响应式：窄屏表单变单列 */
@media (max-width: 640px) {
  .form-grid-2col {
    grid-template-columns: 1fr;
  }
  .trip-progress-wrap {
    flex-wrap: wrap;
  }
  .trip-progress-wrap .progress-bar-bg {
    order: 3;
    flex-basis: 100%;
  }
}

/* ========== B1 优化：批量上传抠图按钮 ========== */
.upload-thumb {
  position: relative;
}
.upload-bg-remove-btn {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 10px;
  font-size: 12px;
  background: rgba(139, 92, 246, 0.92);
  color: #fff;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
  transition: all .2s ease;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}
.upload-bg-remove-btn:hover {
  background: linear-gradient(135deg, #a855f7, #06b6d4);
  transform: translateX(-50%) translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.5);
}
.upload-bg-remove-btn:active {
  transform: translateX(-50%) translateY(0);
}

/* 响应式：窄屏时微调模块更紧凑 */
@media (max-width: 768px) {
  #bgRefineModal > div {
    max-height: 98vh;
    padding: 0;
  }
  #bgRefineModal .div-grid-2col-resp {
    grid-template-columns: 1fr !important;
  }
}

/* ========== v1.9.0 移动端优化 ========== */
* { -webkit-tap-highlight-color: transparent; }
button, .btn, [class*="btn"] { min-height: 44px; touch-action: manipulation; }

@media (max-width: 768px) {
  .top-nav { padding: 10px 14px; margin: 0 8px; flex-wrap: wrap; }
  .backup-tip { display: none; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .clothing-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .outfit-grid { grid-template-columns: repeat(2, 1fr); }
  .app-container { padding-bottom: env(safe-area-inset-bottom, 0px); }
}

@media (max-width: 380px) {
  .clothing-grid { grid-template-columns: repeat(2, 1fr); }
  .outfit-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr; }
}
