/* ==========================================================================
 * css/xhs-battle-poster.css — 《今天是太阳雨》今日战报图（小红书竖版 3:4 / 微博横版 4:3）样式
 * 兼容桌面宽屏、真实手机视口与桌面「手机预览 (body.is-mobile-sim)」及日间/夜间双主题
 * ========================================================================== */

.xhs-hero-poster-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding-top: 4px;
}

.xhs-hero-poster-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid rgba(217, 119, 6, 0.36);
  background: linear-gradient(135deg, #D97706 0%, #C26A0A 55%, #B45309 100%);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 18px rgba(180, 83, 9, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.26);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.xhs-hero-poster-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 9px 22px rgba(180, 83, 9, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.34);
  filter: brightness(1.04);
}

.xhs-hero-poster-btn:active {
  transform: translateY(0);
}

.xhs-subnav-poster-btn {
  border-color: var(--hairline-strong) !important;
  background: rgba(245, 158, 11, 0.1);
  color: var(--sun-gold) !important;
}

.xhs-poster-inline-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 9px;
  border: 1px solid rgba(217, 119, 6, 0.36);
  background: linear-gradient(135deg, #D97706 0%, #B45309 100%);
  color: #FFFFFF !important;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(180, 83, 9, 0.2);
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.xhs-poster-inline-btn:hover {
  transform: translateY(-1px);
  opacity: 0.95;
}

/* 弹窗遮罩与主体（挂载于 body 根节点） */
.xhs-poster-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(15, 14, 12, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.xhs-poster-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.xhs-poster-dialog {
  position: relative;
  width: 100%;
  max-width: 448px;
  max-height: calc(100dvh - 24px);
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: #FAF6EE;
  color: #1C1917;
  border: 1px solid rgba(180, 128, 56, 0.28);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.42);
  overflow: hidden;
  transform: translateY(8px) scale(0.985);
  transition: transform 0.2s cubic-bezier(0.2, 0.85, 0.3, 1), max-width 0.2s ease;
}

.xhs-poster-dialog.is-landscape {
  max-width: 590px;
}

body[data-theme="dark"] .xhs-poster-dialog {
  background: #171614;
  color: #F5F2EB;
  border-color: rgba(245, 185, 82, 0.24);
}

.xhs-poster-backdrop.is-open .xhs-poster-dialog {
  transform: translateY(0) scale(1);
}

.xhs-poster-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(180, 128, 56, 0.16);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.xhs-poster-topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.xhs-poster-format-tabs {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 999px;
  background: rgba(180, 128, 56, 0.13);
  border: 1px solid rgba(180, 128, 56, 0.24);
  gap: 2px;
}

body[data-theme="dark"] .xhs-poster-format-tabs {
  background: rgba(245, 185, 82, 0.1);
  border-color: rgba(245, 185, 82, 0.24);
}

.xhs-poster-fmt-btn {
  padding: 4.5px 11px;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: #78716C;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

body[data-theme="dark"] .xhs-poster-fmt-btn {
  color: #A8A29E;
}

.xhs-poster-fmt-btn.is-active {
  background: #FFFFFF;
  color: #9A3412;
  box-shadow: 0 2px 6px rgba(28, 25, 23, 0.12);
}

body[data-theme="dark"] .xhs-poster-fmt-btn.is-active {
  background: #2C2823;
  color: #FBBF24;
}

.xhs-poster-topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-left: auto;
}

.xhs-poster-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4.5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(180, 128, 56, 0.3);
  background: rgba(217, 119, 6, 0.1);
  color: #B45309;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}

body[data-theme="dark"] .xhs-poster-switch-btn {
  background: rgba(245, 185, 82, 0.14);
  color: #FBBF24;
  border-color: rgba(245, 185, 82, 0.28);
}

.xhs-poster-switch-btn:hover {
  background: rgba(217, 119, 6, 0.18);
}

.xhs-poster-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 1px solid rgba(120, 113, 108, 0.24);
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  opacity: 0.78;
}

.xhs-poster-close-btn:hover {
  opacity: 1;
}

.xhs-poster-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.xhs-poster-frame {
  position: relative;
  width: 100%;
  max-width: 356px;
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  overflow: hidden;
  background: #F7F1E5;
  box-shadow: 0 12px 32px rgba(28, 25, 23, 0.16);
  border: 1px solid rgba(180, 128, 56, 0.22);
}

.xhs-poster-dialog.is-landscape .xhs-poster-frame {
  max-width: 540px;
  aspect-ratio: 4 / 3;
}

.xhs-poster-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: auto;
  -webkit-touch-callout: default;
}

.xhs-poster-img[hidden] {
  display: none !important;
}

.xhs-poster-loading,
.xhs-poster-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px;
  text-align: center;
  background: rgba(250, 246, 238, 0.94);
  color: #92400E;
  font-size: 12.5px;
  font-weight: 700;
}

.xhs-poster-loading[hidden],
.xhs-poster-error[hidden] {
  display: none !important;
}

.xhs-poster-retry-btn {
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid rgba(217, 119, 6, 0.38);
  background: #D97706;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.xhs-poster-smart-note {
  width: 100%;
  max-width: 460px;
  font-size: 11px;
  line-height: 1.45;
  color: #78716C;
  text-align: center;
}

body[data-theme="dark"] .xhs-poster-smart-note {
  color: #A8A29E;
}

.xhs-poster-footer {
  padding: 10px 14px 14px;
  border-top: 1px solid rgba(180, 128, 56, 0.16);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.xhs-poster-main-action {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11.5px 16px;
  border-radius: 13px;
  border: none;
  background: linear-gradient(135deg, #D97706 0%, #B45309 100%);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(180, 83, 9, 0.25);
  transition: transform 0.15s ease, filter 0.15s ease, opacity 0.15s ease;
}

.xhs-poster-main-action:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.xhs-poster-main-action:disabled,
.xhs-poster-switch-btn:disabled,
.xhs-poster-fmt-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.xhs-poster-feedback {
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(22, 163, 74, 0.1);
  border: 1px solid rgba(22, 163, 74, 0.25);
  color: #166534;
  font-size: 11.5px;
  line-height: 1.5;
  font-weight: 600;
  text-align: center;
}

body[data-theme="dark"] .xhs-poster-feedback {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.3);
  color: #86EFAC;
}

.xhs-poster-feedback[hidden] {
  display: none !important;
}

@media (max-width: 480px) {
  .xhs-hero-poster-btn {
    width: 100%;
    justify-content: center;
    padding: 9px 14px;
  }
  .xhs-poster-backdrop {
    padding: 8px;
  }
  .xhs-poster-frame {
    max-width: 318px;
  }
  .xhs-poster-dialog.is-landscape .xhs-poster-frame {
    max-width: 100%;
  }
}

body.is-mobile-sim .xhs-hero-poster-btn {
  width: 100%;
  justify-content: center;
}
