/* ============================================================
   发型大师 - 平板优先布局样式
   两页结构：选择页 + 结果页
   ============================================================ */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary: #a855f7;
  --primary-dark: #9333ea;
  --primary-light: #c084fc;
  --bg-gradient: linear-gradient(160deg, #fdf4ff 0%, #fae8ff 40%, #f0e8ff 70%, #e8d5ff 100%);
  --card-bg: rgba(255, 255, 255, 0.96);
  --card-shadow: 0 4px 32px rgba(168, 85, 247, 0.12);
  --border-color: #ede9fe;
  --text-primary: #1a1a2e;
  --text-secondary: #6b7280;
  --radius: 20px;
  --radius-sm: 12px;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-gradient);
  color: var(--text-primary);
  height: 100%;
}

/* ============================================================
   页面基础
   ============================================================ */

.page {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ============================================================
   顶部标题栏
   ============================================================ */

.header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  height: 60px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  z-index: 100;
}

.header-inner {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  font-size: 26px;
}

.logo-text {
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  padding-left: 16px;
  border-left: 2px solid var(--border-color);
  margin-left: 8px;
}

/* ============================================================
   选择区（可滚动）
   ============================================================ */

.select-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px 100px; /* 底部留空给 fixed 操作栏 */
  display: flex;
  flex-direction: column;
  gap: 20px;
  -webkit-overflow-scrolling: touch;
}

.select-area::-webkit-scrollbar {
  width: 4px;
}
.select-area::-webkit-scrollbar-thumb {
  background: #d8b4fe;
  border-radius: 2px;
}

/* ============================================================
   上传卡片
   ============================================================ */

.upload-card {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.upload-area {
  border: 2px dashed #d8b4fe;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #faf5ff;
  display: flex;
  align-items: stretch;
  justify-content: center;
  min-height: 280px;
}

.upload-area:hover {
  border-color: var(--primary);
  background: #f5f0ff;
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  width: 100%;
  min-height: 280px;
}

.upload-icon-large {
  font-size: 52px;
  margin-bottom: 14px;
  opacity: 0.9;
}

.upload-text {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.upload-hint {
  font-size: 14px;
  color: var(--text-secondary);
}

.preview-image {
  width: 100%;
  height: 280px;
  object-fit: cover;
  display: block;
  background: #faf5ff;
}

/* ============================================================
   区块通用
   ============================================================ */

.section-block {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.section-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-left: 4px;
}

/* ============================================================
   性别切换
   ============================================================ */

.gender-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.gender-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: white;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.25s ease;
}

.gender-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.gender-btn.active {
  border-color: var(--primary);
  background: linear-gradient(135deg, #f5f0ff, #faf5ff);
  color: var(--primary-dark);
  font-weight: 600;
}

/* ============================================================
   发型选择
   ============================================================ */

.panel-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.25s ease;
}

.tab-btn.active {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--primary);
  color: var(--primary-dark);
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(168, 85, 247, 0.15);
}

/* 发型网格 */
.hairstyle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.hairstyle-card {
  background: white;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.25s ease;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.hairstyle-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.15);
  border-color: var(--primary-light);
}

.hairstyle-card.selected {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.3);
}

.hairstyle-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  background: linear-gradient(135deg, #faf5ff, #f0e8ff);
  position: relative;
  overflow: hidden;
}

/* 发型封面图 */
.hairstyle-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* emoji fallback（有图片时隐藏） */
.hairstyle-emoji {
  font-size: 48px;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.hairstyle-emoji.hidden-fallback {
  display: none;
}

.hairstyle-image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 35%;
  background: linear-gradient(to top, rgba(255,255,255,0.7), transparent);
}

.hairstyle-name {
  padding: 10px 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  text-align: center;
  background: white;
}

.selected-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 13px;
  z-index: 1;
  opacity: 0;
  transform: scale(0);
  transition: all 0.2s ease;
}

.hairstyle-card.selected .selected-badge {
  opacity: 1;
  transform: scale(1);
}

/* ============================================================
   发色网格
   ============================================================ */

.color-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.color-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 8px 4px;
  border-radius: 10px;
  border: 2px solid transparent;
  transition: all 0.2s;
  background: white;
}

.color-item:hover {
  background: #f5f0ff;
}

.color-item.active {
  border-color: var(--primary);
  background: #faf5ff;
}

.color-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.08);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.color-item:hover .color-swatch {
  transform: scale(1.12);
}

.color-name {
  font-size: 10px;
  color: var(--text-secondary);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.color-item.active .color-name {
  color: var(--primary);
  font-weight: 600;
}

/* ============================================================
   底部固定操作栏
   ============================================================ */

.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 24px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  z-index: 200;
  box-shadow: 0 -4px 20px rgba(168, 85, 247, 0.1);
}

.generate-btn {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
  transition: all 0.3s ease;
  letter-spacing: 0.5px;
}

.generate-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(168, 85, 247, 0.5);
}

.generate-btn:active:not(:disabled) {
  transform: translateY(0);
}

.generate-btn:disabled {
  background: linear-gradient(135deg, #d1d5db, #b0b0b0);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-icon {
  font-size: 18px;
}

/* ============================================================
   Loading 遮罩
   ============================================================ */

.loading-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-content {
  background: white;
  border-radius: 24px;
  padding: 48px 64px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  min-width: 280px;
}

.loading-spinner {
  width: 56px;
  height: 56px;
  border: 4px solid #ede9fe;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.loading-hint {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ============================================================
   结果页 — 卡片流布局（与首页统一设计语言）
   ============================================================ */

/* 结果页导航栏返回按钮 */
.nav-back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border: 2px solid var(--border-color);
  border-radius: 20px;
  background: white;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.nav-back-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

/* 主内容滚动区 */
.result-scroll-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  -webkit-overflow-scrolling: touch;
}

.result-scroll-area::-webkit-scrollbar { width: 0; }

/* 成功提示条 */
.success-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-sm);
}

.success-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.success-text {
  font-size: 12px;
  color: #166534;
  font-weight: 500;
  line-height: 1.3;
}

/* 发型效果图卡片 */
.result-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.result-card-img-wrap {
  width: 100%;
  max-height: 45vh;
  background: linear-gradient(180deg, #f5f0ff 0%, #ede9fe 100%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.result-card-img {
  width: 100%;
  height: 100%;
  max-height: 45vh;
  object-fit: contain;
  display: block;
}

.result-card-info {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.result-style-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.result-time {
  font-size: 12px;
  color: var(--text-muted);
}

/* 三视图卡片 */
.threeview-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.threeview-card-header {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
}

.threeview-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.threeview-card-title-icon {
  font-size: 16px;
}

.threeview-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
}

.threeview-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  animation: pulse-dot 1.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.threeview-card-body {
  padding: 8px;
  min-height: 100px;
  max-height: 35vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 三视图加载态 */
.threeview-loading-new {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.threeview-loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #ede9fe;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.threeview-loading-text {
  font-size: 13px;
  color: var(--text-secondary);
}

/* 三视图错误 */
.threeview-error {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ef4444;
  font-size: 13px;
}

.threeview-error-icon {
  font-size: 18px;
}

/* 三视图结果 */
.threeview-result-new {
  width: 100%;
  text-align: center;
}

.threeview-result-img {
  width: 100%;
  max-height: 35vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
}

.threeview-card-footer {
  padding: 6px 16px 10px;
  text-align: center;
}

.threeview-footer-text {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

/* 底部操作栏 */
.result-bottom-bar {
  flex-shrink: 0;
  padding: 12px 24px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 10px;
  justify-content: center;
}

.action-btn {
  flex: 1;
  max-width: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.action-btn-outline {
  background: white;
  border: 2px solid var(--border-color);
  color: var(--text-primary);
}

.action-btn-outline:hover {
  border-color: var(--primary-light);
  color: var(--primary);
  background: #faf5ff;
}

.action-btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  color: white;
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.3);
}

.action-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(168, 85, 247, 0.4);
}

.action-btn-icon {
  font-size: 16px;
}

/* ============================================================
   Toast
   ============================================================ */

.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 99999;
  animation: toast-in 0.3s ease;
  pointer-events: none;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ============================================================
   上传操作按钮组
   ============================================================ */

.upload-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.upload-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: white;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
}

.upload-action-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary);
  background: #faf5ff;
}

.upload-action-btn:active {
  transform: scale(0.97);
}

/* ============================================================
   拍照弹窗
   ============================================================ */

.camera-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  z-index: 10000;
  display: flex;
  flex-direction: column;
}

.camera-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* 顶部栏 */
.camera-topbar {
  flex-shrink: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10;
}

.camera-close-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.camera-close-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.camera-topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: white;
}

/* 摄像头画面 */
.camera-viewport {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #000;
}

.camera-viewport video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 虚线取景框 — 截到肩膀往上 */
.camera-guide {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 72%;
  height: 70%;
  pointer-events: none;
  z-index: 5;
}

/* 虚线边框用四条边绘制，中间镂空 */
.camera-guide::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 2.5px dashed rgba(255, 255, 255, 0.7);
  border-radius: 16px;
}

/* 四角高亮 */
.camera-guide::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 16px;
  box-shadow:
    inset 0 0 0 2px rgba(168, 85, 247, 0.8);
}

.camera-guide-top {
  position: absolute;
  top: -36px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 20px;
  white-space: nowrap;
}

.camera-guide-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}

/* 半透明遮罩（取景框外区域变暗） */
.camera-viewport::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    ellipse 72% 70% at center,
    transparent 68%,
    rgba(0, 0, 0, 0.4) 100%
  );
  z-index: 2;
  pointer-events: none;
}

/* 无摄像头提示 */
.camera-no-device {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #111;
  padding: 24px;
}

.camera-no-device-icon {
  font-size: 56px;
  opacity: 0.6;
}

.camera-no-device-text {
  font-size: 18px;
  font-weight: 600;
  color: white;
}

.camera-no-device-hint {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
}

.camera-no-device-btn {
  margin-top: 12px;
  padding: 12px 32px;
  border: none;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.camera-no-device-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.4);
}

/* 底部拍照按钮 */
.camera-bottombar {
  flex-shrink: 0;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: 10;
}

.camera-shutter-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.8);
  background: transparent;
  cursor: pointer;
  padding: 4px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.camera-shutter-btn:hover {
  border-color: white;
}

.camera-shutter-btn:active {
  transform: scale(0.92);
}

.camera-shutter-ring {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.camera-shutter-inner {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: white;
  transition: all 0.15s;
}

.camera-shutter-btn:active .camera-shutter-inner {
  background: #e0d0f0;
}

/* ============================================================
   拍照预览弹窗
   ============================================================ */

.camera-preview-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  z-index: 10001;
  display: flex;
  flex-direction: column;
}

.camera-preview-container {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.camera-preview-viewport {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
}

.camera-preview-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* 预览底部操作 */
.camera-preview-bottombar {
  flex-shrink: 0;
  padding: 20px 24px;
  padding-bottom: max(20px, env(safe-area-inset-bottom));
  display: flex;
  gap: 16px;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
}

.camera-retake-btn,
.camera-confirm-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  border-radius: 28px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.camera-retake-btn {
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: white;
}

.camera-retake-btn:hover {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.1);
}

.camera-confirm-btn {
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.4);
}

.camera-confirm-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(168, 85, 247, 0.5);
}

/* ============================================================
   响应式适配 — 小屏幕 / 手机
   ============================================================ */

@media (max-width: 768px) {
  .result-scroll-area {
    padding: 16px 16px 0;
  }

  .result-bottom-bar {
    padding: 12px 16px;
    gap: 8px;
  }

  .action-btn {
    padding: 12px 6px;
    font-size: 13px;
  }
}

/* ============================================================
   响应式适配 — 大屏平板 / 桌面
   ============================================================ */

@media (min-width: 1024px) {
  .result-scroll-area {
    padding: 24px 48px 0;
  }

  .result-bottom-bar {
    padding: 16px 48px;
  }
}



