/* =====================================================
   焕搭小窝 - 可爱粉嫩主题样式
   ===================================================== */

:root {
  --pink-primary: #FF7BAC;
  --pink-deep: #FF4B8B;
  --pink-light: #FFB3CC;
  --pink-bg: #FFF0F5;
  --pink-card: #FFF5F8;
  --purple-accent: #C084FC;
  --text-dark: #2D1B33;
  --text-mid: #6B4878;
  --text-light: #B08CC0;
  --white: #FFFFFF;
  --shadow-sm: 0 2px 12px rgba(255, 123, 172, 0.15);
  --shadow-md: 0 6px 24px rgba(255, 75, 139, 0.2);
  --shadow-lg: 0 12px 40px rgba(255, 75, 139, 0.25);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-full: 9999px;
}

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

html, body {
  width: 100%;
  min-height: 100vh;
  background: var(--pink-bg);
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text-dark);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* =====================================================
   顶部导航栏
   ===================================================== */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: linear-gradient(135deg, #FF7BAC 0%, #FF4B8B 100%);
  padding: 12px 20px 0;
  box-shadow: 0 2px 20px rgba(255, 75, 139, 0.3);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
}

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

.logo-icon {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.logo-text {
  color: white;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
}

.header-slogan {
  color: rgba(255,255,255,0.85);
  font-size: 11px;
}

/* 步骤进度条 */
.step-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px 14px;
  gap: 0;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  position: relative;
}

.step-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 14px;
  left: calc(50% + 14px);
  right: calc(-50% + 14px);
  height: 2px;
  background: rgba(255,255,255,0.3);
  transition: background 0.4s;
}

.step-item.done:not(:last-child)::after,
.step-item.active:not(:last-child)::after {
  background: rgba(255,255,255,0.85);
}

.step-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  border: 2px solid rgba(255,255,255,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
  font-size: 12px;
  font-weight: 600;
  transition: all 0.3s;
}

.step-item.active .step-circle {
  background: white;
  border-color: white;
  color: var(--pink-deep);
  box-shadow: 0 0 0 4px rgba(255,255,255,0.3);
}

.step-item.done .step-circle {
  background: rgba(255,255,255,0.9);
  border-color: white;
  color: var(--pink-deep);
}

.step-label {
  color: rgba(255,255,255,0.7);
  font-size: 10px;
  white-space: nowrap;
}

.step-item.active .step-label,
.step-item.done .step-label {
  color: white;
  font-weight: 600;
}

/* =====================================================
   主内容区
   ===================================================== */

.main-content {
  padding-top: 115px;
  min-height: 100vh;
  padding-bottom: 100px;
}

/* =====================================================
   页面切换动画
   ===================================================== */

.page-view {
  display: none;
  animation: fadeSlideIn 0.35s ease;
}

.page-view.active {
  display: block;
}

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

/* =====================================================
   Step 1：上传照片
   ===================================================== */

.upload-page {
  padding: 24px 20px;
}

.page-title {
  text-align: center;
  margin-bottom: 24px;
}

.page-title h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.page-title p {
  font-size: 13px;
  color: var(--text-mid);
  line-height: 1.6;
}

.upload-area {
  border: 2.5px dashed var(--pink-light);
  border-radius: var(--radius-lg);
  background: var(--white);
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.upload-area:active {
  transform: scale(0.98);
  border-color: var(--pink-deep);
}

.upload-area.has-photo {
  border-style: solid;
  border-color: var(--pink-primary);
  padding: 0;
  min-height: unset;
}

.upload-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, #FFE4EE, #FFB3CC);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.upload-tip {
  text-align: center;
}

.upload-tip .main-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.upload-tip .sub-text {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.6;
}

.upload-tip .hint-pills {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
  flex-wrap: wrap;
}

.hint-pill {
  background: var(--pink-bg);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 11px;
  color: var(--pink-deep);
  font-weight: 500;
}

.preview-img {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  border-radius: calc(var(--radius-lg) - 3px);
  display: block;
  background: #fdf0f5;
}

.preview-mask {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
  padding: 12px;
  display: flex;
  justify-content: center;
}

.change-photo-btn {
  color: white;
  font-size: 13px;
  background: rgba(255,255,255,0.25);
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: var(--radius-full);
  padding: 6px 16px;
  backdrop-filter: blur(4px);
}

.photo-tips {
  margin-top: 20px;
  background: white;
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.photo-tips-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tips-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.tip-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.5;
}

.tip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pink-light);
  margin-top: 5px;
  flex-shrink: 0;
}

/* =====================================================
   Step 2：选择服装
   ===================================================== */

.clothes-page {
  padding: 16px 0;
}

.category-tabs {
  display: flex;
  gap: 10px;
  padding: 0 20px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
  flex-shrink: 0;
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 500;
  background: white;
  color: var(--text-mid);
  border: 1.5px solid transparent;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.25s;
  white-space: nowrap;
}

.cat-tab.active {
  background: linear-gradient(135deg, var(--pink-primary), var(--pink-deep));
  color: white;
  border-color: var(--pink-deep);
  box-shadow: 0 4px 14px rgba(255, 75, 139, 0.35);
}

.clothes-search {
  padding: 0 20px 16px;
  display: flex;
  gap: 10px;
}

.search-input-wrap {
  flex: 1;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 15px;
  color: var(--text-light);
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 42px;
  border-radius: var(--radius-full);
  border: 1.5px solid #F0D0DE;
  background: white;
  padding: 0 14px 0 38px;
  font-size: 14px;
  color: var(--text-dark);
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: var(--pink-primary);
}

.search-input::placeholder { color: var(--text-light); }

.clothes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 0 20px;
}

.clothes-card {
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.25s;
  border: 2.5px solid transparent;
  position: relative;
}

.clothes-card:active {
  transform: scale(0.97);
}

.clothes-card.selected {
  border-color: var(--pink-deep);
  box-shadow: 0 0 0 4px rgba(255, 75, 139, 0.15), var(--shadow-md);
}

.clothes-card-img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
  background: #f5e8ee;
}

.clothes-card-info {
  padding: 10px 12px 12px;
}

.clothes-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.4;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clothes-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.clothes-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--pink-deep);
}

.clothes-price::before { content: '¥'; font-size: 11px; }

.clothes-category-tag {
  font-size: 10px;
  background: var(--pink-bg);
  color: var(--pink-deep);
  border-radius: var(--radius-full);
  padding: 2px 8px;
}

.selected-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--pink-deep);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(255,75,139,0.4);
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s;
}

.clothes-card.selected .selected-badge {
  opacity: 1;
  transform: scale(1);
}

.clothes-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 0;
  color: var(--text-light);
  font-size: 14px;
}

.clothes-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 0;
}

.clothes-empty .empty-icon { font-size: 48px; margin-bottom: 12px; }
.clothes-empty p { font-size: 14px; color: var(--text-light); }

/* =====================================================
   Step 3：生成效果图
   ===================================================== */

.result-page {
  padding: 16px 0;
}

.result-page > .result-box,
.result-page > .error-box,
.result-page > .generating-box {
  padding-left: 20px;
  padding-right: 20px;
}

/* ── 生成中：左右对比布局 ── */
.gen-compare {
  padding: 0 20px;
}

.gen-compare-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

/* 左侧原图：高度跟随图片自然高度，最高 65vh */
.gen-photo {
  width: 100%;
  max-height: 65vh;
  height: auto;
  object-fit: contain;
  border-radius: calc(var(--radius-md) - 2px);
  display: block;
  background: #fdf0f5;
}

/* 右侧动画面板 */
.gen-side {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: linear-gradient(160deg, #fce8f2 0%, #f3d8f0 40%, #e8d5f5 70%, #f5dff0 100%);
  background-size: 200% 200%;
  animation: genBreathe 4s ease-in-out infinite;
  /* 高度与左侧对齐 */
  min-height: 260px;
}

@keyframes genBreathe {
  0%, 100% { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
}

/* 扫光层 */
.gen-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 20%,
    rgba(255, 255, 255, 0.55) 50%,
    transparent 80%
  );
  animation: genShimmer 2.4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes genShimmer {
  0%   { transform: translateX(-120%) skewX(-15deg); }
  100% { transform: translateX(220%)  skewX(-15deg); }
}

/* 中心魔法核心 */
.gen-core {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 三层同心扩散圆环 */
.gen-ring {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(255, 123, 172, 0.4);
  animation: genPulse 2.4s ease-out infinite;
}
.gen-ring-1 { width: 56px;  height: 56px;  animation-delay: 0s; }
.gen-ring-2 { width: 88px;  height: 88px;  animation-delay: 0.6s; border-color: rgba(192, 132, 252, 0.3); }
.gen-ring-3 { width: 120px; height: 120px; animation-delay: 1.2s; border-color: rgba(255, 123, 172, 0.2); }

@keyframes genPulse {
  0%   { transform: scale(0.7); opacity: 0.9; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* 中心✨图标 */
.gen-wand {
  font-size: 36px;
  animation: genWandFloat 3s ease-in-out infinite;
  z-index: 1;
}

@keyframes genWandFloat {
  0%, 100% { transform: scale(1)    rotate(-8deg);  filter: drop-shadow(0 0 6px rgba(255,123,172,0.6)); }
  33%       { transform: scale(1.18) rotate(6deg);   filter: drop-shadow(0 0 14px rgba(192,132,252,0.8)); }
  66%       { transform: scale(0.92) rotate(-4deg);  filter: drop-shadow(0 0 8px rgba(255,75,139,0.7)); }
}

/* 漂浮粒子 */
.gsp {
  position: absolute;
  font-style: normal;
  font-size: 14px;
  animation: gspFloat var(--d, 3s) ease-in-out infinite var(--delay, 0s);
  opacity: 0;
}

@keyframes gspFloat {
  0%   { transform: translateY(0)    scale(0.6); opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 0.8; }
  100% { transform: translateY(-70px) scale(1.1); opacity: 0; }
}

.gsp1  { left: 12%;  bottom: 20%; --d: 3.2s; --delay: 0s; }
.gsp2  { left: 30%;  bottom: 15%; --d: 2.8s; --delay: 0.4s; }
.gsp3  { left: 55%;  bottom: 18%; --d: 3.6s; --delay: 0.8s; }
.gsp4  { left: 75%;  bottom: 22%; --d: 2.6s; --delay: 1.2s; }
.gsp5  { left: 18%;  bottom: 40%; --d: 3.0s; --delay: 0.6s; }
.gsp6  { left: 65%;  bottom: 38%; --d: 3.4s; --delay: 1.0s; }
.gsp7  { left: 42%;  bottom: 12%; --d: 2.4s; --delay: 1.6s; }
.gsp8  { left: 85%;  bottom: 30%; --d: 3.8s; --delay: 0.2s; }

/* 生成中的标签动画 */
.gen-label-anim {
  animation: genLabelPulse 2s ease-in-out infinite;
}
@keyframes genLabelPulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.6; }
}

/* 底部进度区 */
.gen-footer {
  text-align: center;
  padding: 4px 0;
}

.gen-progress-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-mid);
  margin: 8px 0 4px;
}

.gen-hint {
  font-size: 11px;
  color: var(--text-light);
}

.progress-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--pink-light);
  animation: dotBounce 1.2s ease-in-out infinite;
}

.dot:nth-child(1) { animation-delay: 0s; }
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0.7); background: var(--pink-light); }
  40% { transform: scale(1.2); background: var(--pink-deep); }
}

.progress-text {
  font-size: 12px;
  color: var(--text-light);
}

/* 结果展示 */
.result-box {
  display: none;
  padding: 0 20px;
}

.result-box.show {
  display: block;
}

.result-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.compare-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.compare-label {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(0,0,0,0.55);
  color: white;
  font-size: 11px;
  border-radius: var(--radius-full);
  padding: 3px 10px;
  backdrop-filter: blur(4px);
}

.compare-img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
  background: #f5e8ee;
}

.selected-clothes-info {
  background: white;
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.selected-clothes-thumb {
  width: 56px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.selected-clothes-detail {
  flex: 1;
}

.selected-clothes-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.selected-clothes-price {
  font-size: 15px;
  font-weight: 700;
  color: var(--pink-deep);
}

.buy-btn-sm {
  background: linear-gradient(135deg, var(--pink-primary), var(--pink-deep));
  color: white;
  border-radius: var(--radius-full);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(255,75,139,0.35);
  cursor: pointer;
  border: none;
}

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

.action-btn {
  flex: 1;
  height: 48px;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  border: none;
  transition: all 0.25s;
}

.action-btn:active { transform: scale(0.97); }

.btn-save {
  background: white;
  color: var(--pink-deep);
  border: 2px solid var(--pink-light);
  box-shadow: var(--shadow-sm);
}

.btn-again {
  background: linear-gradient(135deg, var(--pink-primary), var(--pink-deep));
  color: white;
  box-shadow: 0 6px 20px rgba(255, 75, 139, 0.35);
}

/* 错误状态 */
.error-box {
  display: none;
  background: white;
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  margin: 0 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.error-box.show { display: block; }
.error-icon { font-size: 48px; margin-bottom: 16px; }
.error-msg { font-size: 14px; color: var(--text-mid); margin-bottom: 20px; line-height: 1.6; }

/* =====================================================
   底部操作按钮
   ===================================================== */

.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(255, 123, 172, 0.12);
  border-top: 1px solid rgba(255, 123, 172, 0.1);
}

.btn-primary {
  width: 100%;
  height: 52px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #FF7BAC 0%, #FF4B8B 100%);
  color: white;
  font-size: 17px;
  font-weight: 700;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(255, 75, 139, 0.4);
  transition: all 0.25s;
  letter-spacing: 0.5px;
}

.btn-primary:active {
  transform: scale(0.97);
  box-shadow: 0 4px 16px rgba(255, 75, 139, 0.3);
}

.btn-primary:disabled {
  background: linear-gradient(135deg, #FFC4D9, #FFAAC5);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* Step 2 底部：返回 + 主按钮并排 */
.bottom-bar-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-back {
  flex-shrink: 0;
  height: 52px;
  padding: 0 18px;
  border-radius: var(--radius-full);
  background: white;
  color: var(--text-mid);
  font-size: 14px;
  font-weight: 600;
  border: 1.5px solid #F0D0DE;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-back:active {
  background: var(--pink-bg);
  border-color: var(--pink-primary);
  transform: scale(0.97);
}

.btn-primary-flex {
  flex: 1;
  width: auto;
}

/* Step 3 结果页：换照片文字按钮 */
.btn-change-photo {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 13px;
  text-align: center;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-change-photo:active {
  color: var(--pink-deep);
}

/* Step 2 底部：返回 + 生成并排 */
.bottom-bar-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-back {
  flex-shrink: 0;
  height: 52px;
  padding: 0 18px;
  border-radius: var(--radius-full);
  background: white;
  color: var(--text-mid);
  font-size: 14px;
  font-weight: 600;
  border: 1.5px solid #F0D0DE;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-back:active {
  transform: scale(0.97);
  border-color: var(--pink-primary);
  color: var(--pink-deep);
}

.btn-primary-flex {
  flex: 1;
  width: auto;
}

/* Step 3 结果页：换照片按钮 */
.btn-change-photo {
  display: block;
  width: 100%;
  margin-top: 12px;
  height: 44px;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-mid);
  font-size: 14px;
  font-weight: 500;
  border: 1.5px dashed var(--pink-light);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-change-photo:active {
  border-color: var(--pink-primary);
  color: var(--pink-deep);
  background: var(--pink-bg);
}

/* =====================================================
   通用组件
   ===================================================== */

/* Toast 消息 */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(45, 27, 51, 0.9);
  color: white;
  border-radius: var(--radius-full);
  padding: 10px 20px;
  font-size: 13px;
  z-index: 999;
  opacity: 0;
  transition: all 0.3s;
  white-space: nowrap;
  backdrop-filter: blur(8px);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 骨架屏 */
.skeleton {
  background: linear-gradient(90deg, #f0e6ec 25%, #f8eef3 50%, #f0e6ec 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 8px;
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton-card {
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.skeleton-img {
  width: 100%;
  aspect-ratio: 3/4;
}

.skeleton-line {
  height: 12px;
  margin: 10px 12px 6px;
}

.skeleton-line.short { width: 60%; }

/* 渐变装饰元素 */
.deco-circle {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  opacity: 0.06;
}

.deco-circle-1 {
  width: 300px;
  height: 300px;
  background: var(--pink-primary);
  top: -80px;
  right: -80px;
}

.deco-circle-2 {
  width: 200px;
  height: 200px;
  background: var(--purple-accent);
  bottom: 200px;
  left: -60px;
}

/* 隐藏文件输入 */
#file-input { display: none; }

/* =====================================================
   照片预览条（Step 2/3 顶部，可点击换照片）
   ===================================================== */

.photo-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin: 0 20px 14px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.2s;
}

.photo-strip:active {
  border-color: var(--pink-primary);
  transform: scale(0.99);
}

.photo-strip-thumb {
  width: 44px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--pink-bg);
}

.photo-strip-info {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.photo-strip-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
}

.photo-strip-change {
  font-size: 12px;
  color: var(--pink-deep);
  background: var(--pink-bg);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-weight: 500;
}

/* =====================================================
   登录弹窗
   ===================================================== */

.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(45, 27, 51, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  animation: overlayFadeIn 0.2s ease;
}

@keyframes overlayFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.login-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 28px;
  padding: 36px 28px 32px;
  box-shadow: 0 16px 48px rgba(255, 75, 139, 0.18);
  animation: cardSlideUp 0.25s ease;
}

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

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-logo-icon {
  font-size: 48px;
  margin-bottom: 8px;
}

.login-logo-text {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.login-slogan {
  font-size: 13px;
  color: var(--text-light);
}

/* 微信登录 loading */
.wechat-login-tip {
  text-align: center;
  padding: 16px 0 8px;
}

.wechat-loading {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.wechat-spin {
  width: 40px;
  height: 40px;
  border: 3px solid var(--pink-light);
  border-top-color: var(--pink-deep);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.wechat-tip-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.wechat-tip-sub {
  font-size: 13px;
  color: var(--text-light);
}

/* 手机号登录表单 */
.login-form-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 20px;
  text-align: center;
}

.login-input-group {
  margin-bottom: 16px;
}

.login-label {
  display: block;
  font-size: 13px;
  color: var(--text-mid);
  margin-bottom: 8px;
  font-weight: 500;
}

.login-input-wrap {
  display: flex;
  align-items: center;
  background: var(--pink-bg);
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  overflow: hidden;
  transition: border-color 0.2s;
}

.login-input-wrap:focus-within {
  border-color: var(--pink-primary);
}

.login-input-prefix {
  padding: 0 12px;
  font-size: 14px;
  color: var(--text-mid);
  font-weight: 600;
  border-right: 1px solid var(--pink-light);
  white-space: nowrap;
}

.login-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 14px 12px;
  font-size: 15px;
  color: var(--text-dark);
  -webkit-appearance: none;
}

.login-input::placeholder {
  color: var(--text-light);
}

.resend-btn {
  padding: 0 14px;
  font-size: 13px;
  color: var(--pink-deep);
  background: transparent;
  border: none;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}

.resend-btn:disabled {
  color: var(--text-light);
  cursor: default;
}

.login-error {
  font-size: 13px;
  color: #FF4B8B;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: #fff0f5;
  border-radius: 8px;
}

.login-btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #FF7BAC 0%, #FF4B8B 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
  margin-bottom: 16px;
  transition: opacity 0.2s, transform 0.1s;
  -webkit-tap-highlight-color: transparent;
}

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

.login-btn:not(:disabled):active {
  transform: scale(0.98);
}

.login-agreement {
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.6;
}

.login-agreement a {
  color: var(--pink-primary);
  text-decoration: none;
}

/* Header 用户信息 */
.header-user {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-full);
  padding: 4px 12px;
}

.header-user-phone {
  font-size: 13px;
  color: #fff;
  font-weight: 500;
}

.header-user-logout {
  font-size: 12px;
  color: rgba(255,255,255,0.75);
}

/* Header 未登录时的登录按钮 */
.header-login-btn {
  background: rgba(255,255,255,0.22);
  border: 1.5px solid rgba(255,255,255,0.5);
  border-radius: var(--radius-full);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 16px;
  cursor: pointer;
  transition: background 0.2s;
  letter-spacing: 1px;
}

.header-login-btn:active {
  background: rgba(255,255,255,0.35);
}

/* 登录弹窗关闭按钮 */
.login-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--pink-bg);
  border: none;
  font-size: 14px;
  color: var(--text-mid);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.2s;
}

.login-close-btn:active {
  background: var(--pink-light);
}
