/**
 * Morning Closet · Acloset Standard UI Components & Layout
 */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100%;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

button {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

input, select, textarea {
  font: inherit;
  color: inherit;
  border: none;
  outline: none;
}

img {
  display: block;
  max-width: 100%;
}

/* ================== 主视口容器 ================== */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-top: calc(10px + var(--safe-top));
  padding-bottom: calc(90px + var(--safe-bottom));
  padding-left: 16px;
  padding-right: 16px;
  position: relative;
}

/* ================== Acloset 经典导航头部 ================== */
.acloset-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 16px;
}

.acloset-greeting {
  display: flex;
  flex-direction: column;
}

.greeting-name {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.greeting-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.header-action-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-btn-ghost {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  transition: background 0.15s;
}

.icon-btn-ghost:active {
  background: var(--bg-hover);
}

.avatar-badge-wrap {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  overflow: hidden;
  border: 1.5px solid var(--border-line);
  cursor: pointer;
}

.avatar-badge-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ================== Acloset 标志性 AI 造型师 金刚区 ================== */
.acloset-stylist-block {
  margin-bottom: 22px;
}

.block-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.block-main-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-main);
}

.block-sub-action {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* 金刚区 2x2 / 4宫格 */
.stylist-grid-large {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.stylist-card-primary {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.15s, box-shadow 0.15s;
}

.stylist-card-primary:active {
  transform: scale(0.98);
}

.stylist-card-info {
  display: flex;
  flex-direction: column;
}

.stylist-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.stylist-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.stylist-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  background: var(--accent-blue-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.stylist-card-icon.purple {
  background: var(--accent-purple-soft);
}

.stylist-row-mini {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.stylist-mini-item {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s;
}

.stylist-mini-item:active {
  transform: scale(0.96);
}

.mini-icon-circle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  font-size: 18px;
  background: var(--bg-subtle);
}

.mini-item-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-sub);
  line-height: 1.25;
}

/* ================== Acloset 经典穿搭组合卡 (横向流) ================== */
.outfit-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 12px;
}

.outfit-date-weather {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.outfit-date-weather span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-refresh-outfit {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  color: var(--text-sub);
  background: var(--bg-card);
  border: 1px solid var(--border-line);
  transition: transform 0.3s;
}

.btn-refresh-outfit:active {
  transform: rotate(180deg);
}

/* Acloset 标志性穿搭滑动卡组 */
.outfits-scroll-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 14px;
  scrollbar-width: none;
  margin-inline: -16px;
  padding-inline: 16px;
}

.outfits-scroll-track::-webkit-scrollbar {
  display: none;
}

.outfit-card-snap {
  flex: 0 0 260px;
  width: 260px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s;
}

.outfit-card-snap:active {
  transform: scale(0.99);
}

/* 拼贴画白底无缝呈现区 (Flat-lay Collage) */
.outfit-canvas-preview {
  width: 100%;
  height: 240px;
  background: #FDFDFD;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  padding: 12px;
  gap: 8px;
  border-bottom: 1px solid var(--border-card);
}

.canvas-slot-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.canvas-slot-item img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.06));
}

.canvas-slot-item.full-top {
  grid-column: 1 / -1;
}

.canvas-badge-rank {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 10px;
  font-weight: 700;
  background: rgba(17, 24, 39, 0.85);
  color: #FFF;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
  backdrop-filter: blur(4px);
}

.outfit-info-footer {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.outfit-title-text {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.outfit-why-text {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.outfit-footer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border-line);
}

.btn-select-wear {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-white);
  background: var(--text-main);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  transition: opacity 0.15s;
}

.btn-select-wear.worn {
  background: var(--accent-green);
}

.btn-detail-link {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ================== Acloset 智能问答气泡交互 (对结果继续提问) ================== */
.ai-chat-prompt-bar {
  margin-top: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-full);
  padding: 6px 8px 6px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
  gap: 8px;
}

.ai-chat-placeholder {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  flex: 1;
}

.btn-send-round {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--primary-gradient);
  color: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ================== 穿搭画布 (Acloset 平铺拼图装配台) ================== */
.studio-canvas-stage {
  background: #FFFFFF;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-card);
  width: 100%;
  aspect-ratio: 1 / 1.15;
  position: relative;
  box-shadow: var(--shadow-float);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.studio-grid-layout {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 12px;
}

.stage-item-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
}

.stage-item-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.08));
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.stage-item-wrapper:active img {
  transform: scale(1.06);
}

/* 浮动工具小药丸 */
.stage-floating-toolbar {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.toolbar-btn {
  font-size: 16px;
  color: var(--text-sub);
  width: 26px;
  height: 26px;
}

/* 画布下方抽屉单品选择池 */
.studio-closet-picker {
  margin-top: 18px;
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: 16px;
  border: 1px solid var(--border-card);
  box-shadow: var(--shadow-card);
}

.picker-category-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-card);
}

.picker-category-row::-webkit-scrollbar {
  display: none;
}

.picker-cat-tab {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.picker-cat-tab.active {
  color: var(--text-main);
  background: var(--bg-subtle);
  font-weight: 700;
}

.picker-items-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  max-height: 240px;
  overflow-y: auto;
}

.picker-item-tile {
  background: var(--bg-page);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid var(--border-card);
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}

.picker-item-tile:active {
  transform: scale(0.94);
  border-color: var(--primary-blue);
}

.picker-item-tile img {
  width: 50px;
  height: 60px;
  object-fit: contain;
}

.picker-item-name {
  font-size: 10px;
  color: var(--text-sub);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  text-align: center;
}

/* ================== Acloset 风格数字衣橱网格与分类 ================== */
.closet-folder-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.folder-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
}

.folder-preview-quad {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 6px;
  aspect-ratio: 1 / 1;
  margin-bottom: 10px;
}

.quad-img-cell {
  background: #FFF;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.quad-img-cell img {
  max-width: 80%;
  max-height: 80%;
  object-fit: contain;
}

.folder-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
}

.folder-count {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 智能登记横幅卡片 (Acloset 招牌：智能抠图去底) */
.smart-entry-card {
  background: linear-gradient(135deg, #F8FAFC 0%, #EEF2FF 100%);
  border: 1px solid #E0E7FF;
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.smart-entry-text h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.smart-entry-text p {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 3px;
}

.btn-smart-camera {
  padding: 8px 16px;
  background: var(--primary-blue);
  color: #FFF;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

/* 衣橱单品大网格 */
.closet-items-grid-modern {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.closet-item-card-clean {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 10px 8px 8px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.15s;
}

.closet-item-card-clean:active {
  transform: scale(0.96);
}

.item-clean-poster {
  width: 100%;
  aspect-ratio: 1 / 1.15;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FFF;
  border-radius: var(--radius-xs);
}

.item-clean-poster img {
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.05));
}

.item-brand-tag {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 6px;
  letter-spacing: 0.04em;
}

.item-clean-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* ================== 日程 & 旅行规划日历 (Acloset 日历视图) ================== */
.calendar-card-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  padding: 18px 16px;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
}

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

.calendar-month-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
}

.calendar-grid-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.calendar-grid-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day-cell {
  aspect-ratio: 1 / 1.25;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 2px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-main);
  position: relative;
}

.cal-day-cell.active-today {
  background: var(--bg-subtle);
  font-weight: 700;
}

.cal-outfit-mini-thumb {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  margin-top: 2px;
  overflow: hidden;
}

.cal-outfit-mini-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* ================== Acloset 风格 5 标签底部 TabBar (中间突出圆钮) ================== */
.acloset-bottom-tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top: 1px solid var(--border-line);
  padding-bottom: var(--safe-bottom);
}

:root[data-theme="dark"] .acloset-bottom-tabbar {
  background: rgba(21, 25, 33, 0.94);
}

.tabbar-five-grid {
  max-width: 480px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 64px;
  align-items: center;
}

.tab-nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  transition: color 0.15s;
}

.tab-nav-btn svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
}

.tab-nav-btn.active {
  color: var(--text-main);
}

.tab-nav-btn.active svg {
  stroke: var(--text-main);
}

/* 中间悬浮圆形黑底加号大钮 (Acloset 核心设计基因) */
.tab-center-add-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-center-add {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--text-main);
  color: var(--text-white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-center-btn);
  margin-top: -16px;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-center-add:active {
  transform: scale(0.92);
}

.btn-center-add svg {
  width: 24px;
  height: 24px;
  stroke: #FFF;
  stroke-width: 2.2;
}

/* ================== 通用弹层与抽屉 ================== */
.modal-scrim {
  position: fixed;
  inset: 0;
  background: var(--bg-backdrop);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-scrim.visible {
  opacity: 1;
  pointer-events: auto;
}

.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 110;
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  box-shadow: var(--shadow-float);
  padding: 12px 20px calc(24px + var(--safe-bottom));
  max-height: 88vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.bottom-sheet.visible {
  transform: translateY(0);
}

.sheet-handle-bar {
  width: 38px;
  height: 4px;
  background: var(--border-line);
  border-radius: 99px;
  margin: 0 auto 16px;
}
