/* AI 场景详情 / 换脸详情 / toast
 * 场景页对齐 ai18vip /create 双栏工作台（画廊 + 控制台）
 */
.hg-ai-toast {
  position: fixed;
  left: 50%;
  bottom: 18%;
  z-index: 10050;
  transform: translateX(-50%) translateY(12px);
  max-width: min(86vw, 360px);
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.hg-ai-toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.hg-ai-detail-page {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 96px;
  color: #f4f1ec;
}
.hg-ai-detail-page.hg-ai-scene-pc {
  /* 与首页 / AI列表一致：全宽 + --hg-page-gutter（16 / clamp(24px,5vw,96px) / ≥1280:96） */
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 18px var(--hg-page-gutter) 56px;
  color: #f4f1ec;
  box-sizing: border-box;
}

/* —— 面包屑 —— */
.hg-ai-wb-crumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 13px;
  color: rgba(244, 241, 236, 0.48);
}
.hg-ai-wb-crumb a {
  color: rgba(244, 241, 236, 0.55);
  text-decoration: none;
}
.hg-ai-wb-crumb a:hover { color: #f4f1ec; }
.hg-ai-wb-crumb em {
  font-style: normal;
  color: rgba(244, 241, 236, 0.82);
  max-width: min(52vw, 420px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hg-ai-wb-crumb__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(244, 241, 236, 0.7);
  font-size: 16px;
  cursor: pointer;
}
.hg-ai-wb-crumb__back:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

/* —— 双栏工作台 —— */
.hg-ai-wb {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 12px;
  align-items: start;
}

/* 左画廊 */
.hg-ai-wb-gallery {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.hg-ai-wb-gallery__frame {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  max-width: min(100%, calc(min(78vh, 760px) * 3 / 4));
  min-height: 0;
  aspect-ratio: 3 / 4;
  max-height: min(78vh, 760px);
  margin-inline: auto;
  border-radius: 15px;
  background: #15161b;
  border: 1px solid rgba(255, 255, 255, 0.05);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hg-ai-wb-gallery__media {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #101116;
}
.hg-ai-wb-gallery__media img,
.hg-ai-wb-gallery__media video {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  background: #101116;
}
.hg-ai-wb-gallery__empty {
  padding: 40px 24px;
  text-align: center;
  color: rgba(244, 241, 236, 0.4);
}
.hg-ai-wb-gallery__empty p {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
  color: rgba(244, 241, 236, 0.75);
}
.hg-ai-wb-gallery__badge {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: rgba(244, 241, 236, 0.88);
  font-size: 12px;
  letter-spacing: 0.02em;
  pointer-events: none;
}
.hg-ai-wb-gallery__caption {
  margin: 0;
  padding: 0 4px;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(244, 241, 236, 0.38);
}

/* 右控制台 */
.hg-ai-wb-console {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  padding: 22px 22px 20px;
  border-radius: 15px;
  background: #17171b;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.hg-ai-wb-console__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.hg-ai-wb-console__meta { min-width: 0; flex: 1; }
.hg-ai-wb-eyebrow {
  margin: 0 0 10px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: rgba(244, 241, 236, 0.38);
  font-weight: 500;
}
.hg-ai-wb-title {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.35;
  font-weight: 700;
  color: #f4f1ec;
  word-break: break-word;
}
.hg-ai-wb-sub {
  margin: 0;
  font-size: 13px;
  color: rgba(244, 241, 236, 0.42);
}
.hg-ai-wb-price {
  flex-shrink: 0;
  text-align: right;
  color: #e6c9a2;
  line-height: 1.15;
}
.hg-ai-wb-price strong {
  display: block;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.hg-ai-wb-price span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: rgba(230, 201, 162, 0.72);
}

.hg-ai-wb-upload-block { display: flex; flex-direction: column; gap: 10px; }
.hg-ai-wb-upload-label {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #e8c4a8;
}
.hg-ai-req {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(240, 139, 145, 0.16);
  color: #f08b91;
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  vertical-align: 1px;
}

.hg-ai-wb-upload-row {
  display: grid;
  grid-template-columns: minmax(148px, 0.72fr) minmax(0, 1.28fr);
  gap: 12px;
  align-items: stretch;
}
.hg-ai-wb-side {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  min-height: 0;
}
.hg-ai-wb-side .hg-ai-wb-tips {
  flex: 1 1 auto;
}
.hg-ai-wb-side .hg-ai-wb-balance {
  flex: 0 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.hg-ai-upload-group { margin-bottom: 0; }
.hg-ai-upload-label {
  margin: 0 0 8px;
  font-size: 12px;
  color: rgba(244, 241, 236, 0.45);
}
.hg-ai-upload-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 168px;
  padding: 16px 12px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
  color: inherit;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .15s ease, background .15s ease;
}
.hg-ai-upload-box:hover,
.hg-ai-upload-box.is-dragover {
  border-color: rgba(226, 193, 154, 0.55);
  background: rgba(226, 193, 154, 0.05);
}
.hg-ai-upload-box--drop {
  align-self: stretch;
  height: 100%;
  min-height: 248px;
  border-color: rgba(226, 193, 154, 0.55);
  border-style: solid;
  background: rgba(255, 255, 255, 0.02);
}
.hg-ai-upload-box--drop:hover,
.hg-ai-upload-box--drop.is-dragover {
  border-color: rgba(226, 193, 154, 0.85);
  background: rgba(226, 193, 154, 0.06);
}
.hg-ai-upload-box.is-disabled { opacity: .55; pointer-events: none; }
.hg-ai-upload-box.has-image {
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.1);
  background: #0f1014;
  padding: 0;
}
.hg-ai-upload-box.has-image .hg-ai-upload-icon,
.hg-ai-upload-box.has-image .hg-ai-upload-text,
.hg-ai-upload-box.has-image .hg-ai-upload-meta { display: none; }
.hg-ai-upload-box.has-image .hg-ai-upload-preview-host {
  position: absolute;
  inset: 0;
  min-height: 0;
}

.hg-ai-upload-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  margin-bottom: 12px;
  position: relative;
}
.hg-ai-upload-icon::before,
.hg-ai-upload-icon::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  background: rgba(244, 241, 236, 0.7);
  transform: translate(-50%, -50%);
}
.hg-ai-upload-icon::before { width: 18px; height: 2px; }
.hg-ai-upload-icon::after { width: 2px; height: 18px; }

/* 云上传图标感 */
.hg-ai-upload-icon--cloud {
  width: 48px;
  height: 40px;
  border-radius: 0;
  background: transparent;
  margin-bottom: 14px;
}
.hg-ai-upload-icon--cloud::before {
  width: 34px;
  height: 20px;
  border-radius: 12px 12px 8px 8px;
  background: rgba(244, 241, 236, 0.28);
  top: 38%;
  box-shadow: -12px 6px 0 -2px rgba(244, 241, 236, 0.18), 14px 8px 0 -4px rgba(244, 241, 236, 0.14);
}
.hg-ai-upload-icon--cloud::after {
  width: 2px;
  height: 14px;
  top: 72%;
  background: rgba(226, 193, 154, 0.95);
  box-shadow: -4px -4px 0 -1px rgba(226, 193, 154, 0.95), 4px -4px 0 -1px rgba(226, 193, 154, 0.95);
}

.hg-ai-upload-text {
  font-size: 13px;
  color: rgba(244, 241, 236, 0.72);
  text-align: center;
  line-height: 1.4;
}
.hg-ai-upload-meta {
  margin-top: 8px;
  font-size: 11px;
  color: rgba(244, 241, 236, 0.38);
  text-align: center;
}
.hg-ai-upload-preview-host {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 168px;
}
.hg-ai-upload-preview {
  display: block;
  width: 100%;
  max-height: 360px;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.hg-ai-wb-tips {
  padding: 16px 16px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.hg-ai-wb-tips__title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(244, 241, 236, 0.78);
}
.hg-ai-wb-tips__title::before {
  content: 'i';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(244, 241, 236, 0.45);
  font-size: 10px;
  font-weight: 700;
  font-style: italic;
  line-height: 1;
  color: rgba(244, 241, 236, 0.7);
  flex-shrink: 0;
}
.hg-ai-wb-tips ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.hg-ai-wb-tips li {
  position: relative;
  padding-left: 22px;
  font-size: 12px;
  line-height: 1.5;
  color: rgba(244, 241, 236, 0.55);
}
.hg-ai-wb-tips li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: rgba(226, 193, 154, 0.16);
  box-shadow: inset 0 0 0 1px rgba(226, 193, 154, 0.45);
}
.hg-ai-wb-tips li::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 6px;
  width: 6px;
  height: 3px;
  border-left: 1.5px solid #e2c19a;
  border-bottom: 1.5px solid #e2c19a;
  transform: rotate(-45deg);
}

.hg-ai-prompts { display: grid; gap: 12px; }
.hg-ai-prompt-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: rgba(244, 241, 236, 0.55);
}
.hg-ai-prompt-input {
  width: 100%;
  min-height: 96px;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  resize: vertical;
  font-size: 14px;
  line-height: 1.5;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.28);
  color: #f4f1ec;
}
.hg-ai-prompt-input::placeholder { color: rgba(244, 241, 236, 0.32); }

.hg-ai-wb-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.hg-ai-wb-balance__left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 13px;
  color: rgba(244, 241, 236, 0.7);
}
.hg-ai-wb-balance__recharge {
  flex-shrink: 0;
  border: 0;
  padding: 0;
  background: transparent;
  color: #e6c9a2;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
.hg-ai-wb-balance__recharge:hover { color: #f0d7b4; }

.hg-ai-coin {
  display: inline-block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe9a0, #e2c19a 55%, #b8894a 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  flex-shrink: 0;
}

.hg-ai-wb-cta {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 0 52px 0 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(98deg, #e8d0ae 0%, #e2c19a 48%, #d4ad78 100%);
  color: #1a140c;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(226, 193, 154, 0.18);
}
.hg-ai-wb-cta:hover { filter: brightness(1.04); }
.hg-ai-wb-cta.is-disabled,
.hg-ai-wb-cta:disabled {
  opacity: .45;
  cursor: not-allowed;
  filter: none;
  box-shadow: none;
}
.hg-ai-wb-cta__wand {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  background:
    linear-gradient(135deg, transparent 46%, #1a140c 46%, #1a140c 54%, transparent 54%),
    radial-gradient(circle at 70% 30%, #1a140c 0 1.5px, transparent 2px),
    radial-gradient(circle at 30% 70%, #1a140c 0 1.2px, transparent 1.8px);
  opacity: 0.85;
}
.hg-ai-wb-cta__label { letter-spacing: 0.02em; }
.hg-ai-wb-cta__spark {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #ff8a7a, #c44a3a 70%);
  box-shadow: 0 0 0 3px rgba(196, 74, 58, 0.22);
}
.hg-ai-wb-cta__spark::before,
.hg-ai-wb-cta__spark::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
}
.hg-ai-wb-cta__spark::before { width: 10px; height: 2px; }
.hg-ai-wb-cta__spark::after { width: 2px; height: 10px; }

.hg-ai-wb-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(244, 241, 236, 0.38);
}
.hg-ai-wb-note__clock {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1.5px solid rgba(244, 241, 236, 0.35);
  position: relative;
}
.hg-ai-wb-note__clock::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 1.5px;
  height: 5px;
  background: rgba(244, 241, 236, 0.45);
  transform-origin: bottom;
}
.hg-ai-wb-note__clock::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 6px;
  width: 4px;
  height: 1.5px;
  background: rgba(244, 241, 236, 0.45);
}

/* 生成中 / 结果 */
.hg-ai-generating,
.hg-ai-result {
  padding: 32px 24px;
  text-align: center;
}
.hg-ai-generating__inner { max-width: 360px; margin: 0 auto; }
.hg-ai-generating__ring {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 3px solid rgba(226, 193, 154, 0.2);
  border-top-color: #e2c19a;
  animation: hg-ai-spin 0.9s linear infinite;
}
@keyframes hg-ai-spin { to { transform: rotate(360deg); } }
.hg-ai-generating__title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
  color: #f4f1ec;
}
.hg-ai-generating__sub {
  margin: 0 0 18px;
  font-size: 13px;
  color: rgba(244, 241, 236, 0.42);
}
.hg-ai-generating__pct {
  margin: 8px 0 0;
  font-size: 13px;
  color: rgba(244, 241, 236, 0.65);
}
.hg-ai-progress-track {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin: 0;
}
.hg-ai-progress-bar {
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, #e2c19a, #d4ad78);
  transition: width .3s ease;
}
.hg-ai-result-media-wrap {
  margin: 0 auto 16px;
  max-width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
}
.hg-ai-result-media {
  display: block;
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
}
.hg-ai-result-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hg-ai-btn-submit {
  flex-shrink: 0;
  min-width: 112px;
  height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 22px;
  background: linear-gradient(90deg, #e2c19a, #d4ad78);
  color: #1a140c;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.hg-ai-btn-submit.is-disabled,
.hg-ai-btn-submit:disabled {
  opacity: .45;
  cursor: not-allowed;
}
.hg-ai-btn-outline {
  height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  background: transparent;
  color: #f4f1ec;
  font-size: 14px;
  cursor: pointer;
}

.hg-ai-hidden-input { display: none !important; }
.hg-ai-detail-error {
  padding: 48px 16px;
  text-align: center;
  color: rgba(244, 241, 236, 0.45);
}
.hg-ai-dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* 换脸页仍复用的旧壳 */
.hg-ai-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.hg-ai-detail-header h1 {
  flex: 1;
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #f4f1ec;
  text-align: center;
}
.hg-ai-back,
.hg-ai-history {
  border: 0;
  background: transparent;
  color: rgba(244, 241, 236, 0.65);
  font-size: 14px;
  cursor: pointer;
  padding: 6px 4px;
}
.hg-ai-notes {
  margin: 12px 0 16px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
}
.hg-ai-notes__title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  color: rgba(244, 241, 236, 0.85);
}
.hg-ai-notes ol {
  margin: 0;
  padding-left: 18px;
  color: rgba(244, 241, 236, 0.55);
  font-size: 12px;
  line-height: 1.7;
}
.hg-ai-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0));
  background: linear-gradient(180deg, rgba(13, 14, 17, 0), #0d0e11 28%);
}
.hg-ai-meta { flex: 1; min-width: 0; }
.hg-ai-meta__price {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: #e6c9a2;
}
.hg-ai-meta__balance {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: rgba(244, 241, 236, 0.45);
}
.hg-ai-face-target { margin: 16px 0; }
.hg-ai-face-target__title {
  margin: 0 0 8px;
  font-size: 13px;
  color: rgba(244, 241, 236, 0.55);
}
.hg-ai-face-target__img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 12px;
  background: #111;
}

@media (max-width: 960px) {
  .hg-ai-detail-page.hg-ai-scene-pc { padding: 14px var(--hg-page-gutter) 40px; }
  .hg-ai-wb {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .hg-ai-wb-gallery,
  .hg-ai-wb-console {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  /* H5：宽度驱动高度；max-height 触顶时同步限制宽度，保持 3:4 */
  .hg-ai-wb-gallery__frame {
    flex: 0 0 auto;
    width: 100%;
    max-width: min(100%, calc(min(70vh, 560px) * 3 / 4));
    min-height: 0;
    aspect-ratio: 3 / 4;
    max-height: min(70vh, 560px);
    margin-inline: auto;
  }
  .hg-ai-wb-gallery__media img,
  .hg-ai-wb-gallery__media video {
    width: 100%;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
  }
  .hg-ai-upload-preview,
  .hg-ai-result-media,
  .hg-ai-face-target__img {
    max-width: 100%;
    height: auto;
  }
  .hg-ai-upload-box.has-image .hg-ai-upload-preview {
    height: 100%;
    max-height: none;
  }
  .hg-ai-result-media-wrap {
    width: 100%;
    max-width: 100%;
  }
  .hg-ai-wb-title { font-size: 18px; }
  .hg-ai-wb-price strong { font-size: 28px; }
  .hg-ai-wb-upload-row { grid-template-columns: minmax(0, 1fr); }
  .hg-ai-upload-box--drop { min-height: 160px; height: auto; }
  .hg-ai-wb-side { min-height: 0; }
}
@media (max-width: 520px) {
  .hg-ai-dual-grid { grid-template-columns: minmax(0, 1fr); }
  .hg-ai-wb-console { padding: 16px 14px 18px; gap: 14px; }
  .hg-ai-wb-crumb em { max-width: 42vw; }
  .hg-ai-wb-gallery__frame {
    aspect-ratio: 3 / 4;
    max-height: min(62vh, 480px);
    max-width: min(100%, calc(min(62vh, 480px) * 3 / 4));
  }
  .hg-ai-upload-preview {
    max-height: 280px;
  }
  .hg-ai-upload-box.has-image .hg-ai-upload-preview {
    max-height: none;
  }
}


/* —— 支付渠道弹窗（对齐 web PaySelectModal，SSR px） —— */
.hg-ai-pay-root {
  position: fixed;
  inset: 0;
  z-index: 200000;
  pointer-events: none;
  display: block;
  visibility: visible;
  opacity: 1;
}
.hg-ai-pay-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  pointer-events: auto;
}
.hg-ai-pay-modal {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(92vw, 420px);
  max-height: min(86vh, 640px);
  overflow: auto;
  background: #fff;
  color: #1a1a1a;
  border-radius: 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
  box-sizing: border-box;
}
.hg-ai-pay-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.06);
  color: #333;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.hg-ai-pay-select {
  padding: 22px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.hg-ai-ps-head { padding-right: 28px; }
.hg-ai-ps-title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #1a1a1a;
}
.hg-ai-ps-amount {
  margin: 0;
  font-size: 14px;
  color: #666;
}
.hg-ai-ps-amount-num {
  font-size: 16px;
  font-weight: 600;
  color: #ff9144;
}
.hg-ai-ps-loading,
.hg-ai-ps-empty {
  padding: 24px 0;
  text-align: center;
  font-size: 14px;
  color: #999;
}
.hg-ai-ps-channels {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hg-ai-ps-channel {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid #ddd;
  background: #fff;
  text-align: left;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.hg-ai-ps-channel.is-active {
  border-color: #6330fb;
  box-shadow: 0 4px 12px rgba(99, 48, 251, 0.22);
}
.hg-ai-ps-icon {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}
.hg-ai-ps-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hg-ai-ps-name {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
}
.hg-ai-ps-sub {
  font-size: 12px;
  color: #888;
}
.hg-ai-ps-radio {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid #ddd;
  box-sizing: border-box;
  position: relative;
}
.hg-ai-ps-radio.is-checked {
  border-color: #ff9144;
  background: #ff9144;
}
.hg-ai-ps-radio.is-checked::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 3px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.hg-ai-ps-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hg-ai-ps-confirm {
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffd21c 0%, #f5a623 100%);
  color: #111;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.hg-ai-ps-confirm.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.hg-ai-ps-recharge-guide {
  background: linear-gradient(90deg, #ff9144 0%, #ff6a2b 100%);
}
.hg-ai-ps-paid {
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #6330fb;
  font-size: 13px;
  cursor: pointer;
}
.hg-ai-ps-secure {
  margin: 4px 0 0;
  text-align: center;
  font-size: 12px;
  color: #cbc0bd;
}
.hg-ai-pay-iframe-shell {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100vw, 480px);
  background: #fff;
  display: flex;
  flex-direction: column;
  pointer-events: auto;
  z-index: 2;
}
.hg-ai-pay-iframe-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
  background: #fff;
}
.hg-ai-pay-iframe-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.88);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.hg-ai-pay-iframe-frame {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  border: 0;
  background: #fff;
}
.hg-ai-pay-iframe-fallback {
  flex-shrink: 0;
  margin: 0;
  padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  text-align: center;
  font-size: 13px;
  color: #666;
  background: #fff;
}
.hg-ai-pay-iframe-fallback a {
  color: #6330fb;
}
@media (max-width: 520px) {
  .hg-ai-pay-modal {
    width: min(94vw, 420px);
    top: auto;
    bottom: 12px;
    transform: translate(-50%, 0);
    max-height: min(78vh, 640px);
    border-radius: 16px 16px 12px 12px;
  }
}

.hg-ai-pay-iframe-shell[hidden] { display: none !important; }
