:root {
  --bg: #eef0f4;
  --stage-bg: #f5f6f8;
  --surface: #ffffff;
  --text: #111827;
  --text-sub: #6b7280;
  --border: #e5e7eb;
  --accent: #111827;
  --accent-active: #2563eb;
  --radius: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

button,
input {
  font-family: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

/* ==================== 舞台容器：自动适配横屏 / 9:16 立式竖屏 / 物理旋转 ==================== */
.app-stage-wrap {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #e5e7eb;
}

.app-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--stage-bg);
  overflow: hidden;
  container-type: size;
  container-name: stage;
}

/* 在横屏显示器上预览竖屏版时，居中呈现标准 9:16 立式大屏舞台（学 vidu） */
@media (min-aspect-ratio: 10/10) {
  body.is-portrait .app-viewport {
    height: calc(100vh - 20px);
    width: calc((100vh - 20px) * 9 / 16);
    max-width: 96vw;
    border-radius: 22px;
    border: 1px solid rgba(17, 24, 39, 0.12);
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.18);
  }
}

/* 真竖屏显示器 / 手机：100% 满屏无边框铺满 */
@media (max-aspect-ratio: 10/10) {
  body.is-portrait .app-viewport {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
}

/* 物理竖挂横屏显示器开启 90° / 270° 旋转时，100% 竖向全屏铺满 */
body[data-rotation="90"] .app-viewport,
body[data-rotation="270"] .app-viewport {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  width: 100vh !important;
  height: 100vw !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
}

body[data-rotation="90"] .app-viewport {
  transform: translate(-50%, -50%) rotate(90deg) !important;
}

body[data-rotation="270"] .app-viewport {
  transform: translate(-50%, -50%) rotate(270deg) !important;
}

body[data-rotation="180"] .app-viewport {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 0 !important;
  border: none !important;
  box-shadow: none !important;
  transform: translate(-50%, -50%) rotate(180deg) !important;
}

/* ==================== 右上角极简硬件工具栏 ==================== */
.viewport-tools {
  position: absolute;
  top: max(12px, env(safe-area-inset-top, 12px));
  right: 12px;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tool-toggle-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(17, 24, 39, 0.52);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.15s, background 0.15s;
}

.tool-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tool-pill {
  height: 34px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(17, 24, 39, 0.56);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: rgba(255, 255, 255, 0.94);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.tool-pill:hover {
  background: rgba(17, 24, 39, 0.78);
}

.tool-pill.active {
  background: var(--accent-active);
  border-color: var(--accent-active);
  color: #fff;
}

/* 阶段二自动收起硬件工具条，仅保留极轻巧角落按钮按需展开 */
body.in-workspace .viewport-tools {
  top: 18px;
  right: 18px;
}

body.in-workspace .tool-toggle-btn {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(243, 244, 246, 0.9);
  border-color: rgba(17, 24, 39, 0.08);
  color: var(--text-sub);
  box-shadow: none;
}

body.in-workspace .tool-toggle-btn:hover {
  color: var(--text);
  background: #e5e7eb;
}

body.in-workspace .viewport-tools:not(.expanded) .tool-bar {
  display: none;
}

body.in-workspace .viewport-tools.expanded {
  background: rgba(255, 255, 255, 0.96);
  padding: 5px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
}

body.in-workspace .viewport-tools.expanded .tool-pill {
  background: #f3f4f6;
  color: var(--text);
  border-color: transparent;
}

body.in-workspace .viewport-tools.expanded .tool-pill.active {
  background: var(--accent);
  color: #fff;
}

/* ==================== 阶段一：全屏沉浸式大画幅拍照取景 ==================== */
.stage-capture {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #0d1117;
}

.camera-stage {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, #1f2735 0%, #111620 58%, #0a0d14 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.camera-stage video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.camera-stage video.is-mirrored {
  transform: scaleX(-1);
}

/* 极简人像取景虚线构图引导（不遮挡、零文字干扰） */
.camera-guide-frame {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 110px;
  z-index: 4;
}

.guide-oval {
  width: min(56cqw, 360px);
  aspect-ratio: 3 / 4;
  max-height: 54cqh;
  border-radius: 50% 50% 46% 46% / 44% 44% 56% 56%;
  border: 1.5px dashed rgba(255, 255, 255, 0.24);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.camera-idle {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 96px;
}

.camera-idle-trigger {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 16px;
}

.camera-circle-icon {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: transform 0.16s ease, background 0.16s ease;
}

.camera-idle-trigger:hover .camera-circle-icon {
  background: rgba(255, 255, 255, 0.14);
  transform: scale(1.04);
}

.camera-idle-trigger:active .camera-circle-icon {
  transform: scale(0.96);
}

/* 快门白闪 */
.shutter-flash {
  position: absolute;
  inset: 0;
  background: #ffffff;
  z-index: 25;
  pointer-events: none;
  animation: shutterFlashFade 0.3s ease-out forwards;
}

@keyframes shutterFlashFade {
  0% { opacity: 0.9; }
  100% { opacity: 0; }
}

/* 中央大号倒计时环 */
.countdown-overlay {
  position: absolute;
  inset: 0;
  z-index: 22;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.countdown-ring {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 3px solid #ffffff;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

#countdownNum {
  font-size: 68px;
  font-weight: 700;
  color: #111827;
  font-variant-numeric: tabular-nums;
}

/* 底部悬浮大触控快门条（学 vidu） */
.capture-hud-bottom {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: max(26px, env(safe-area-inset-bottom, 26px));
  z-index: 16;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.hud-side-btn {
  min-width: 86px;
  height: 52px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  background: rgba(17, 24, 39, 0.62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}

.hud-side-btn:hover {
  background: rgba(17, 24, 39, 0.82);
}

.hud-side-btn:active {
  transform: scale(0.96);
}

.hud-side-btn.active {
  background: rgba(37, 99, 235, 0.9);
  border-color: rgba(147, 197, 253, 0.7);
}

.shutter-main-btn {
  height: 62px;
  min-width: 176px;
  padding: 0 32px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.95);
  background: #ffffff;
  color: #111827;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.34);
  transition: transform 0.12s ease, opacity 0.15s ease;
}

.shutter-main-btn:hover {
  opacity: 0.94;
}

.shutter-main-btn:active {
  transform: scale(0.96);
}

.shutter-ring {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.5px solid #111827;
  position: relative;
  flex-shrink: 0;
}

.shutter-ring::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #111827;
}

/* ==================== 阶段二：横屏默认（左 29% + 右上 23% + 右下 77%） ==================== */
.stage-workspace {
  width: 100%;
  height: 100%;
  padding: 14px;
  display: grid;
  grid-template-columns: 29% 1fr;
  grid-template-rows: 190px 1fr;
  grid-template-areas:
    "photo advice"
    "photo catalog";
  gap: 14px;
}

.left-photo-pane {
  grid-area: photo;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  min-width: 0;
}

.photo-frame {
  flex: 1;
  min-height: 0;
  background: #0f172a;
  border-radius: 9px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  display: block;
}

.photo-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(17, 24, 39, 0.74);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
  max-width: calc(100% - 20px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.generating-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.76);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  text-align: center;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.loader-ring {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.photo-controls {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-ctrl {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 10px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-ctrl:hover {
  background: #f3f4f6;
}

.btn-ctrl:active {
  transform: scale(0.98);
}

/* AI 建议 + 推荐卡片区 */
.ai-advice-bar {
  grid-area: advice;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  align-items: center;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.advice-text-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  border-right: 1px solid var(--border);
  padding-right: 16px;
  height: 100%;
  min-width: 0;
}

.advice-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.advice-title {
  font-size: 14px;
  font-weight: 700;
}

.face-pill {
  background: #eff6ff;
  color: var(--accent-active);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.advice-content {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.5;
}

.advice-rec-col {
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
}

.rec-strip {
  display: flex;
  gap: 12px;
  height: 164px;
  width: 100%;
  overflow-x: auto;
  align-items: center;
  scrollbar-width: none;
}

.rec-strip::-webkit-scrollbar {
  display: none;
}

.rec-card {
  width: 138px;
  height: 160px;
  background: #f9fafb;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: border-color 0.15s, transform 0.15s;
}

.rec-card:hover {
  border-color: var(--accent-active);
  transform: translateY(-1px);
}

.rec-card.active {
  border-color: var(--accent-active);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.rec-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.rec-card-label {
  position: absolute;
  inset: auto 0 0 0;
  background: linear-gradient(to top, rgba(17, 24, 39, 0.88), rgba(17, 24, 39, 0));
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  padding: 14px 6px 5px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rec-badge {
  position: absolute;
  top: 5px;
  left: 5px;
  background: var(--accent-active);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
}

/* 发型库与多维筛选 */
.catalog-section {
  grid-area: catalog;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  min-width: 0;
}

.filter-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.filter-group {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}

.filter-divider {
  width: 1px;
  height: 18px;
  background: var(--border);
  flex-shrink: 0;
}

.chip {
  border: 1px solid transparent;
  background: #f3f4f6;
  color: var(--text-sub);
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.12s;
}

.chip:hover {
  color: var(--text);
  background: #e5e7eb;
}

.chip.active {
  background: var(--accent);
  color: #fff;
}

.catalog-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  grid-auto-rows: 218px;
  gap: 12px;
  padding-right: 4px;
}

.hair-item {
  height: 218px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
}

.hair-item:hover {
  border-color: var(--accent-active);
  transform: translateY(-2px);
}

.hair-item.active {
  border-color: var(--accent-active);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.hair-thumb-wrap {
  width: 100%;
  flex: 1;
  min-height: 0;
  background: #f3f4f6;
  overflow: hidden;
}

.hair-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.hair-meta {
  padding: 7px 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  flex-shrink: 0;
}

.hair-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hair-sub {
  font-size: 11px;
  color: var(--text-sub);
  flex-shrink: 0;
}

/* ==================== 竖屏专属完整布局（立式大屏 / 9:16 模拟舞台 / 手机全适配） ==================== */
body.is-portrait .stage-workspace {
  padding: 10px;
  padding-top: max(10px, env(safe-area-inset-top, 10px));
  padding-bottom: max(10px, env(safe-area-inset-bottom, 10px));
  grid-template-columns: 54% 1fr;
  grid-template-rows: minmax(0, 44%) minmax(0, 56%);
  grid-template-areas:
    "photo advice"
    "catalog catalog";
  gap: 10px;
}

body.is-portrait .left-photo-pane {
  padding: 8px;
  gap: 8px;
}

body.is-portrait .photo-controls {
  gap: 6px;
}

body.is-portrait .btn-ctrl {
  padding: 9px 6px;
  font-size: 13px;
}

/* 竖屏右上区：上文下 2×2 四款带图白模推荐卡片，一屏全览 */
body.is-portrait .ai-advice-bar {
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

body.is-portrait .advice-text-col {
  border-right: none;
  border-bottom: 1px solid var(--border);
  padding-right: 0;
  padding-bottom: 8px;
  height: auto;
  flex-shrink: 0;
  gap: 4px;
}

body.is-portrait .advice-header {
  padding-right: 34px;
}

body.is-portrait .advice-title {
  font-size: 13px;
}

body.is-portrait .face-pill {
  font-size: 11px;
  padding: 1px 8px;
}

body.is-portrait .advice-content {
  font-size: 12px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.is-portrait .advice-rec-col {
  flex: 1;
  min-height: 0;
  height: auto;
  display: block;
}

body.is-portrait .rec-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 7px;
  width: 100%;
  height: 100%;
  overflow: hidden;
  align-items: stretch;
}

body.is-portrait .rec-card {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

body.is-portrait .rec-badge {
  top: 4px;
  left: 4px;
  font-size: 9.5px;
  padding: 1px 5px;
}

body.is-portrait .rec-card-label {
  font-size: 10.5px;
  padding: 12px 4px 4px;
}

/* 竖屏下半区：规整双行筛选（性别+长度一行 / 风格一行）+ 3~4 列纯白模网格 */
body.is-portrait .catalog-section {
  padding: 10px;
  gap: 10px;
}

body.is-portrait .filter-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding-bottom: 8px;
  gap: 6px 8px;
}

body.is-portrait #lengthFilters + .filter-divider {
  display: none;
}

body.is-portrait #styleFilters {
  width: 100%;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

body.is-portrait #styleFilters::-webkit-scrollbar {
  display: none;
}

body.is-portrait .filter-group {
  flex-wrap: nowrap;
  flex-shrink: 0;
}

body.is-portrait .catalog-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 192px;
  gap: 9px;
  padding-right: 0;
  scrollbar-width: none;
}

body.is-portrait .catalog-grid::-webkit-scrollbar {
  display: none;
}

body.is-portrait .hair-item {
  height: 192px;
}

body.is-portrait .hair-meta {
  padding: 6px 7px;
}

body.is-portrait .hair-title {
  font-size: 12px;
}

body.is-portrait .hair-sub {
  font-size: 10.5px;
}

/* ---------- 手机窄竖屏容器适配（舞台逻辑宽 <= 440px，如 390×844） ---------- */
@container stage (max-width: 440px) {
  body.is-portrait .viewport-tools {
    top: max(10px, env(safe-area-inset-top, 10px));
    right: 10px;
  }

  body.is-portrait .tool-pill {
    height: 30px;
    padding: 0 8px;
    font-size: 11px;
  }

  body.is-portrait .capture-hud-bottom {
    left: 14px;
    right: 14px;
    bottom: max(22px, env(safe-area-inset-bottom, 22px));
    gap: 10px;
  }

  body.is-portrait .hud-side-btn {
    min-width: 72px;
    height: 46px;
    padding: 0 14px;
    font-size: 13.5px;
  }

  body.is-portrait .shutter-main-btn {
    height: 56px;
    min-width: 148px;
    padding: 0 24px;
    font-size: 16px;
  }

  body.is-portrait .stage-workspace {
    padding: 8px;
    gap: 8px;
    grid-template-columns: 52% 1fr;
    grid-template-rows: minmax(0, 41%) minmax(0, 59%);
  }

  body.is-portrait .left-photo-pane {
    padding: 6px;
    gap: 6px;
  }

  body.is-portrait .btn-ctrl {
    padding: 7px 4px;
    font-size: 11.5px;
  }

  body.is-portrait .ai-advice-bar {
    padding: 8px;
    gap: 6px;
  }

  body.is-portrait .advice-text-col {
    padding-bottom: 6px;
  }

  body.is-portrait.in-workspace .viewport-tools {
    top: 13px;
    right: 13px;
  }

  body.is-portrait.in-workspace .tool-toggle-btn {
    width: 24px;
    height: 24px;
  }

  body.is-portrait .advice-header {
    padding-right: 28px;
  }

  body.is-portrait .advice-title {
    font-size: 12px;
  }

  body.is-portrait .advice-content {
    font-size: 11px;
  }

  body.is-portrait .rec-strip {
    gap: 5px;
  }

  body.is-portrait .rec-card-label {
    font-size: 9.5px;
    padding: 10px 3px 3px;
  }

  body.is-portrait .catalog-section {
    padding: 8px;
    gap: 8px;
  }

  body.is-portrait .chip {
    font-size: 12px;
    padding: 5px 9px;
  }

  body.is-portrait .catalog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 158px;
    gap: 7px;
  }

  body.is-portrait .hair-item {
    height: 158px;
  }

  body.is-portrait .hair-meta {
    padding: 5px 6px;
  }

  body.is-portrait .hair-title {
    font-size: 11px;
  }

  body.is-portrait .hair-sub {
    display: none;
  }
}

/* ---------- 门店立式竖屏大屏容器适配（舞台逻辑宽 >= 760px 且为竖屏，如 1080×1920） ---------- */
@container stage (min-width: 760px) and (min-height: 1100px) {
  body.is-portrait .tool-pill {
    height: 44px;
    padding: 0 16px;
    font-size: 14px;
    border-radius: 12px;
  }

  body.is-portrait .tool-toggle-btn {
    width: 46px;
    height: 46px;
    border-radius: 12px;
  }

  body.is-portrait .guide-oval {
    width: 560px;
    max-height: 56cqh;
    border-width: 2px;
  }

  body.is-portrait .camera-circle-icon {
    width: 148px;
    height: 148px;
  }

  body.is-portrait .capture-hud-bottom {
    bottom: 56px;
    gap: 28px;
  }

  body.is-portrait .hud-side-btn {
    min-width: 132px;
    height: 68px;
    padding: 0 28px;
    font-size: 20px;
  }

  body.is-portrait .shutter-main-btn {
    height: 82px;
    min-width: 248px;
    padding: 0 46px;
    font-size: 24px;
    gap: 14px;
  }

  body.is-portrait .shutter-ring {
    width: 30px;
    height: 30px;
    border-width: 3px;
  }

  body.is-portrait .countdown-ring {
    width: 200px;
    height: 200px;
  }

  body.is-portrait #countdownNum {
    font-size: 98px;
  }

  body.is-portrait .stage-workspace {
    padding: 20px;
    gap: 18px;
    grid-template-columns: 54% 1fr;
    grid-template-rows: minmax(0, 44%) minmax(0, 56%);
  }

  body.is-portrait .left-photo-pane {
    padding: 16px;
    gap: 14px;
    border-radius: 18px;
  }

  body.is-portrait .photo-frame {
    border-radius: 14px;
  }

  body.is-portrait .photo-tag {
    font-size: 16px;
    padding: 6px 14px;
    top: 14px;
    left: 14px;
  }

  body.is-portrait .btn-ctrl {
    height: 56px;
    font-size: 18px;
    border-radius: 12px;
  }

  body.is-portrait .ai-advice-bar {
    padding: 18px;
    gap: 14px;
    border-radius: 18px;
  }

  body.is-portrait .advice-text-col {
    padding-bottom: 14px;
    gap: 8px;
  }

  body.is-portrait.in-workspace .viewport-tools {
    top: 32px;
    right: 34px;
  }

  body.is-portrait .advice-header {
    padding-right: 52px;
  }

  body.is-portrait .advice-title {
    font-size: 20px;
  }

  body.is-portrait .face-pill {
    font-size: 16px;
    padding: 4px 14px;
  }

  body.is-portrait .advice-content {
    font-size: 17px;
    line-height: 1.5;
    -webkit-line-clamp: 3;
  }

  body.is-portrait .rec-strip {
    gap: 12px;
  }

  body.is-portrait .rec-card {
    border-radius: 14px;
  }

  body.is-portrait .rec-badge {
    font-size: 13px;
    padding: 3px 9px;
    top: 8px;
    left: 8px;
  }

  body.is-portrait .rec-card-label {
    font-size: 15px;
    padding: 20px 8px 8px;
  }

  body.is-portrait .catalog-section {
    padding: 18px;
    gap: 16px;
    border-radius: 18px;
  }

  body.is-portrait .filter-header {
    padding-bottom: 14px;
    gap: 12px;
  }

  body.is-portrait .chip {
    font-size: 17px;
    padding: 10px 18px;
    border-radius: 10px;
  }

  body.is-portrait .catalog-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 316px;
    gap: 16px;
  }

  body.is-portrait .hair-item {
    height: 316px;
    border-radius: 14px;
  }

  body.is-portrait .hair-meta {
    padding: 10px 12px;
  }

  body.is-portrait .hair-title {
    font-size: 16px;
  }

  body.is-portrait .hair-sub {
    font-size: 14px;
  }
}

/* ==================== Toast 提示 ==================== */
.toast-box {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  max-width: 90%;
}

.toast {
  background: rgba(17, 24, 39, 0.9);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.toast.err {
  background: #dc2626;
}
