/* 名片海报交付工具：尺寸、方案、问候语和真实分享能力。 */
.face-swap-page .poster-card {
  --poster-safe-area: 3mm;
  padding: var(--poster-safe-area) !important;
  box-sizing: border-box;
}

.face-swap-page .poster-footer {
  gap: 8px !important;
}

.face-swap-page .poster-greeting {
  min-width: 0;
}

.face-swap-page .poster-greeting p {
  font-size: 12px !important;
  line-height: 1.45 !important;
  overflow-wrap: anywhere;
}

.face-swap-page .poster-qr-box {
  max-width: 80px;
  overflow: visible;
}

.face-swap-page .poster-qr-wrap,
.face-swap-page .poster-qr-wrap canvas {
  width: 80px !important;
  height: 80px !important;
  max-width: 80px;
  max-height: 80px;
  display: block;
  box-sizing: border-box;
}

.face-swap-page .poster-card[data-poster-exporting="1"] .poster-bio {
  overflow: visible !important;
}

.face-swap-page .poster-card[data-poster-exporting="1"] {
  padding: 4mm !important;
}

.face-swap-page .poster-card[data-poster-exporting="1"] .poster-company {
  overflow: visible !important;
  padding-bottom: 2px;
  line-height: 1.5 !important;
  white-space: normal !important;
}

.face-swap-page .poster-card[data-poster-exporting="1"] .poster-bio-text {
  display: block !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  padding-bottom: 2px;
  line-height: 1.25 !important;
  -webkit-line-clamp: unset !important;
}

.face-swap-page .poster-card[data-poster-exporting="1"] .qr-hint-text {
  display: block;
  padding: 2px 0 1px;
  line-height: 1.5 !important;
}

.face-swap-page .poster-card[data-poster-exporting="1"] .poster-bio-toggle {
  display: none !important;
}

.face-swap-page .poster-delivery-tools {
  margin: 10px 16px 12px;
  padding: 12px;
  border: 1px solid #e7e9f2;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(30, 37, 79, 0.06);
}

.poster-delivery-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.poster-delivery-head strong {
  color: #262a42;
  font-size: 13px;
}

.poster-delivery-head span {
  color: #9296a8;
  font-size: 10px;
}

.poster-size-options,
.poster-scheme-options,
.poster-scheme-actions,
.greeting-template-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.poster-size-button,
.poster-scheme-option,
.poster-scheme-button,
.greeting-template-button,
.poster-qr-retry {
  border: 1px solid #dfe2ec;
  border-radius: 999px;
  background: #f8f9fc;
  color: #636779;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
}

.poster-size-button,
.poster-scheme-option,
.poster-scheme-button {
  padding: 8px 10px;
}

.poster-size-button.is-active,
.poster-scheme-option.is-active {
  border-color: #6974e8;
  background: #eef0ff;
  color: #4f58cb;
  font-weight: 700;
}

.poster-scheme-options {
  margin-bottom: 9px;
}

.ai-poster-panel .poster-delivery-tools {
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.poster-scheme-actions {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid #f0f1f5;
}

.poster-scheme-button.primary {
  border-color: #5e69e4;
  background: #5e69e4;
  color: #fff;
}

.face-swap-page .poster-card[data-poster-size="landscape"] {
  aspect-ratio: 9 / 5.8;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(142px, 0.46fr);
  grid-template-areas: "top top" "contact footer";
  grid-template-rows: auto minmax(0, 1fr);
  column-gap: 10px;
  align-items: start;
}

/* Authoritative card face: same DOM classes and adaptive-layout engine as home. */
.face-swap-page .poster-card[data-face-synced="1"] {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
}
.face-swap-page .poster-card[data-face-synced="1"] > :not(.synced-card-face-stage):not(.synced-poster-bio) {
  display: none !important;
}
.face-swap-page .poster-card[data-face-synced="1"] .synced-card-face-stage {
  position: absolute;
  left: 4%;
  top: 8%;
  width: 92%;
  z-index: 2;
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
}
.face-swap-page .poster-card[data-face-synced="1"] .synced-card-home-container {
  position: relative;
  width: 100% !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  perspective: none !important;
  cursor: default !important;
}
.face-swap-page .poster-card[data-face-synced="1"] .synced-card-flipper {
  position: relative !important;
  width: 100% !important;
  height: auto !important;
  transform: none !important;
  perspective: none !important;
}
.face-swap-page .poster-card[data-face-synced="1"] .synced-card-front {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  overflow: hidden !important;
  border-radius: 12px;
  backface-visibility: visible !important;
  transform: none !important;
}
.face-swap-page .poster-card[data-face-synced="1"] .card-avatar-big .card-avatar-img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
}
.face-swap-page .poster-card[data-face-synced="1"] .synced-card-qr-slot {
  position: absolute;
  right: 4%;
  bottom: 4.5%;
  z-index: 8;
  width: 20%;
  max-width: 80px !important;
  aspect-ratio: 1;
  padding: 4px;
  border-radius: 5px;
  background: transparent;
  box-sizing: border-box;
  display: grid;
  place-items: center;
}
.face-swap-page .poster-card[data-face-synced="1"] .synced-card-qr-slot .poster-qr-wrap {
  position: absolute !important;
  inset: 4px !important;
  width: auto !important;
  height: auto !important;
}
.face-swap-page .poster-card[data-face-synced="1"] .synced-card-qr-slot .poster-qr-wrap img,
.face-swap-page .poster-card[data-face-synced="1"] .synced-card-qr-slot .poster-qr-wrap canvas {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
}
.face-swap-page .poster-card[data-face-synced="1"][data-poster-size="landscape"] {
  padding: 0 !important;
  display: block !important;
  min-height: 0 !important;
  background: transparent !important;
  box-shadow: none;
}
.face-swap-page .poster-card[data-face-synced="1"][data-poster-size="landscape"] .synced-card-face-stage {
  left: 0;
  top: 0;
  width: 100%;
  height: auto;
}
.face-swap-page .poster-card[data-face-synced="1"]:not([data-poster-size="landscape"]) {
  padding: 0 !important;
  display: block !important;
}
.face-swap-page .poster-card[data-face-synced="1"] .synced-poster-bio {
  display: none;
}
.face-swap-page .poster-card[data-face-synced="1"][data-poster-size="9-16"] .synced-card-face-stage {
  top: 8%;
  width: 94%;
  left: 3%;
}
.face-swap-page .poster-card[data-face-synced="1"][data-poster-size="9-16"] .synced-poster-bio {
  display: block;
  position: absolute;
  left: 5%;
  right: 5%;
  top: 46%;
  bottom: 7%;
  z-index: 3;
  overflow: visible;
  color: #fff;
  text-align: left;
}
.face-swap-page .poster-card[data-face-synced="1"][data-poster-size="9-16"] .synced-poster-bio b {
  display: inline-block;
  margin-bottom: 7px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.16);
  font-size: 12px;
}
.face-swap-page .poster-card[data-face-synced="1"][data-poster-size="9-16"] .synced-poster-bio p {
  margin: 0;
  color: rgba(255,255,255,.92);
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (min-width: 431px) {
  .face-swap-page .poster-card[data-face-synced="1"] .synced-card-qr-slot {
    width: 20%;
  }
}

.face-swap-page .poster-card[data-poster-size="landscape"] .poster-top {
  grid-area: top;
  min-width: 0;
}

.face-swap-page .poster-card[data-poster-size="landscape"] .poster-contact {
  grid-area: contact;
  min-width: 0;
  gap: 3px;
}

.face-swap-page .poster-card[data-poster-size="landscape"] .poster-footer {
  grid-area: footer;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 6px;
}

.face-swap-page .poster-card[data-poster-size="landscape"] > .poster-divider {
  display: none;
}

.face-swap-page .poster-card[data-poster-size="landscape"] .poster-qr-box {
  align-self: center;
}

.face-swap-page .poster-card[data-poster-size="3-4"] {
  aspect-ratio: 3 / 4;
  min-height: 0;
}

.face-swap-page .poster-card[data-poster-size="4-5"] {
  aspect-ratio: 4 / 5;
  min-height: 0;
}

.face-swap-page .poster-card[data-poster-size="9-16"] {
  aspect-ratio: 9 / 16;
  min-height: 0;
}

.face-swap-page .poster-card[data-poster-size]:not([data-poster-size="landscape"]) {
  display: flex;
  flex-direction: column;
}

.face-swap-page .poster-card[data-poster-size]:not([data-poster-size="landscape"]) .poster-footer {
  margin-top: auto;
}

.face-swap-page .greeting-edit {
  display: block !important;
}

.face-swap-page .greeting-edit > label {
  display: block;
  margin-bottom: 7px;
  font-weight: 650;
}

.face-swap-page .greeting-edit > input {
  display: none !important;
}

.poster-greeting-textarea {
  width: 100%;
  min-height: 72px;
  padding: 10px 11px;
  resize: vertical;
  border: 1px solid #dfe2ec;
  border-radius: 9px;
  color: #2f3247;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
  box-sizing: border-box;
}

.poster-greeting-textarea:focus {
  outline: 2px solid rgba(94, 105, 228, 0.12);
  border-color: #6974e8;
}

.poster-greeting-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 6px 0 8px;
  color: #979aaa;
  font-size: 10px;
}

.greeting-template-button {
  padding: 7px 9px;
}

.poster-qr-retry {
  padding: 6px 8px;
}

.face-swap-page .qr-note,
.face-swap-page .qr-hint-text {
  color: rgba(255, 255, 255, 0.76) !important;
  font-size: 11px !important;
}

.face-swap-page .poster-qr-unavailable {
  display: flex;
  min-height: 80px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px;
  border: 1px dashed rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 10px;
  line-height: 1.35;
  text-align: center;
  box-sizing: border-box;
}

.face-swap-page .poster-qr-unavailable .poster-qr-retry {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.face-swap-page .share-grid .grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  padding: 6px 4px;
  border-radius: 10px;
  min-height: 76px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  box-sizing: border-box;
}

.face-swap-page .share-grid .grid-item .grid-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.face-swap-page .share-grid .grid-item:active {
  transform: scale(.95);
}

.face-swap-page .share-grid .grid-item:focus-visible {
  outline: 2px solid #5e69e4;
  outline-offset: -2px;
}

.face-swap-page .share-grid .grid-item span {
  color: #4e5265;
  font-size: 12px;
  font-weight: 650;
}

.face-swap-page .share-grid .poster-promotion-entry .grid-icon {
  background: linear-gradient(135deg, #1f9d67, #3ccf91);
  color: #fff;
  box-shadow: 0 6px 14px rgba(31, 157, 103, 0.22);
}

.face-swap-page .share-grid .poster-promotion-entry[aria-busy="true"] {
  opacity: 0.68;
  pointer-events: none;
}

@media (min-width: 431px) {
  .face-swap-page .poster-card[data-poster-mode="promotion"] .poster-qr-box,
  .face-swap-page .poster-card[data-poster-mode="promotion"] .poster-qr-wrap,
  .face-swap-page .poster-card[data-poster-mode="promotion"] .poster-qr-wrap canvas {
    width: 110px !important;
    height: 110px !important;
    max-width: 110px !important;
    max-height: 110px !important;
  }
}

.face-swap-page .poster-card[data-poster-mode="promotion"] .qr-hint-text {
  display: none !important;
}

.poster-promotion-result-host {
  margin: 0;
  padding: 16px;
  overflow-y: auto;
}

.poster-promotion-result-panel {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.poster-promotion-result-content {
  min-height: 0;
}

.poster-promotion-export-status {
  margin-top: 8px;
  padding: 10px;
  border-radius: 10px;
  background: #fff;
  color: #50556d;
  text-align: center;
}

.poster-promotion-export-status[data-state="failed"] {
  color: #b42318;
  background: #fff6f5;
}

.poster-promotion-export-status p {
  margin: 0;
  font-size: 12px;
}

.poster-promotion-export-status img {
  display: block;
  width: min(100%, 360px);
  height: auto;
  margin: 10px auto;
  border-radius: 8px;
}

.poster-promotion-export-status button {
  margin-top: 8px;
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  background: #5e69e4;
  color: #fff;
  font: inherit;
}

.poster-promotion-export-status .poster-promotion-retry-image {
  background: #fff;
  color: #50556d;
  border: 1px solid #cdd4e3;
}

.poster-promotion-exit {
  display: block;
  margin: 8px auto 0;
  padding: 8px 16px;
  border: 1px solid #cdd4e3;
  border-radius: 999px;
  background: #fff;
  color: #4e556a;
  font: inherit;
}

.poster-image-preview[hidden] {
  display: none !important;
}

.poster-image-preview {
  position: fixed;
  inset: 0;
  z-index: 100200;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(10, 14, 28, 0.82);
  box-sizing: border-box;
}

.poster-image-preview-panel {
  width: min(100%, 520px);
  max-height: calc(100svh - 32px);
  overflow-y: auto;
  padding: 14px;
  border-radius: 16px;
  background: #fff;
  text-align: center;
  box-sizing: border-box;
}

.poster-image-preview-panel h2 {
  margin: 0 0 6px;
  color: #20233b;
  font-size: 18px;
}

.poster-image-preview-panel p {
  margin: 7px 0;
  color: #62677a;
  font-size: 12px;
  line-height: 1.5;
}

.poster-image-preview-panel img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: calc(100svh - 180px);
  margin: 0 auto;
  border-radius: 8px;
  object-fit: contain;
}

.poster-image-preview-close {
  margin-top: 8px;
  padding: 9px 20px;
  border: 0;
  border-radius: 999px;
  background: #5e69e4;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.poster-share-guide {
  margin: 8px 0 0;
  padding: 9px 11px;
  border-radius: 9px;
  background: #f1f3ff;
  color: #4e57bf !important;
}

@media (max-width: 430px) {
  .face-swap-page .poster-card[data-poster-size="3-4"] {
    width: min(calc(100vw - 32px), calc((100svh - 150px) * 0.75));
  }

  .face-swap-page .poster-card[data-poster-size="4-5"] {
    width: min(calc(100vw - 32px), calc((100svh - 150px) * 0.8));
  }

  .face-swap-page .poster-card[data-poster-size="9-16"] {
    width: min(calc(100vw - 32px), calc((100svh - 150px) * 0.5625));
  }
}

@media (max-width: 430px) {
  .face-swap-page .poster-greeting p {
    font-size: 11px !important;
  }

}
