/* ============ 等待页 ============ */
.page-waiting {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  overflow: hidden;
}
.page-waiting .bg-photo {
  /* 老钱风兜底：胡桃棕 + 香槟金多层；JS 会优先用第一张婚纱照覆盖 */
  background-image:
    linear-gradient(135deg, rgba(92, 74, 62, 0.45), rgba(191, 160, 104, 0.28)),
    radial-gradient(ellipse at 30% 30%, rgba(212, 181, 168, 0.22), transparent 60%),
    linear-gradient(180deg, #6B5544 0%, #5C4A3E 50%, #3A2E26 100%);
  background-size: cover;
  background-position: center;
}
.waiting-content {
  position: relative;
  z-index: 2;
  padding: 0 24px;
  max-width: 720px;
}
.wedding-date {
  margin-top: 1em;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6em;
}
.wedding-date .date-line {
  font-family: var(--f-en-title);
  font-size: clamp(1.3rem, 3.4vw, 2rem);
  letter-spacing: 0.3em;
  color: #fff;
}
.wedding-date .time-block {
  display: inline-flex;
  flex-direction: column;
  gap: 0.35em;
  padding: 0.6em 1.4em;
  border-top: 1px solid rgba(201, 169, 110, 0.4);
  border-bottom: 1px solid rgba(201, 169, 110, 0.4);
}
.wedding-date .tz-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.4em;
  font-family: var(--f-body);
  font-size: clamp(0.85rem, 1.8vw, 1rem);
  letter-spacing: 0.15em;
}
.wedding-date .tz-label {
  color: var(--c-gold-light);
  font-size: 0.88em;
  white-space: nowrap;
}
.wedding-date .tz-time {
  font-family: var(--f-num);
  font-weight: 600;
  font-size: 1.4em;
  letter-spacing: 0.1em;
  color: #fff;
}
.wedding-place {
  font-family: var(--f-body);
  font-size: clamp(0.9rem, 2.2vw, 1.1rem);
  letter-spacing: 0.3em;
  margin-top: 0.4em;
  color: rgba(255,255,255,0.85);
}
.countdown-label {
  margin-top: 2.4em;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  letter-spacing: 0.4em;
  color: var(--c-gold-light);
}
.countdown {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 0.4em;
  margin-top: 0.5em;
  font-family: var(--f-num);
}
.cd-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 1.5em;
}
.cd-num {
  font-size: clamp(3rem, 9vw, 6rem);
  font-weight: 700;
  line-height: 1;
  color: #fff;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}
.cd-lbl {
  font-family: var(--f-body);
  font-size: clamp(0.7rem, 1.6vw, 0.95rem);
  letter-spacing: 0.4em;
  margin-top: 0.6em;
  color: var(--c-gold-light);
}
.cd-sep {
  font-size: clamp(2rem, 7vw, 4rem);
  color: var(--c-gold);
  align-self: center;
  transform: translateY(-0.4em);
}
.countdown-soon {
  margin-top: 2em;
  font-family: var(--f-en-title);
  font-style: italic;
  font-size: 1.4rem;
  letter-spacing: 0.3em;
  color: var(--c-gold-light);
}

/* ============ 暂停 / 结束 共用 ============ */
.page-paused .bg-photo {
  background-image:
    linear-gradient(135deg, rgba(92, 74, 62, 0.5), rgba(184, 146, 131, 0.4)),
    linear-gradient(180deg, #8B7560 0%, #5C4A3E 60%, #3A2E26 100%);
  background-size: cover;
  background-position: center;
}
.page-ended .bg-photo {
  background-image:
    linear-gradient(135deg, rgba(92, 74, 62, 0.55), rgba(30, 22, 18, 0.7)),
    linear-gradient(180deg, #5C4A3E 0%, #3A2E26 50%, #1F1611 100%);
  background-size: cover;
  background-position: center;
}
.page-paused, .page-ended {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.state-text {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 0 24px;
}
.sub-text {
  font-family: var(--f-body);
  font-size: 1.1rem;
  letter-spacing: 0.2em;
  margin-top: 1em;
}
.sub-text.light { color: rgba(255,255,255,0.92); }

/* ============ 直播页（全屏视频 + 悬浮评论，IG/抖音风）============ */
.page-live {
  position: relative;
  height: 100vh;
  height: 100dvh;
  background: #000;
  overflow: hidden;
}

/* 全屏视频 */
.live-video-fs {
  position: absolute;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.player-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
#player {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  background: #000;
}
.video-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  background: rgba(0,0,0,0.6);
  padding: 12px 24px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.95rem;
  letter-spacing: 0.2em;
  z-index: 8;
}

/* 顶部半透明信息条 */
.live-top-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 28px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.55), transparent);
  color: #fff;
  pointer-events: none;
}
body.has-pinned .live-top-bar { top: 44px; }
.live-top-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.live-couple {
  font-family: var(--f-cn-title);
  font-size: 1.35rem;
  color: #fff;
  letter-spacing: 0.08em;
  text-shadow: 0 1px 6px rgba(0,0,0,0.6);
  white-space: nowrap;
}
.live-top-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(208,72,72,0.9);
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.74rem;
  letter-spacing: 0.05em;
}
.live-viewers {
  background: rgba(0,0,0,0.45);
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.76rem;
  backdrop-filter: blur(4px);
  white-space: nowrap;
}
.live-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,255,255,0.7); }
  70% { box-shadow: 0 0 0 7px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

/* 飘升 emoji 动画层 */
.reaction-float-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 6;
}
.float-emoji {
  position: absolute;
  bottom: 110px;
  animation: floatUp 3s ease-out forwards;
  will-change: transform, opacity;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}
@keyframes floatUp {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  12% { opacity: 1; transform: translateY(-15px) scale(1.15); }
  100% { transform: translateY(-58vh) translateX(28px) scale(0.9); opacity: 0; }
}

/* 左下半透明悬浮评论 */
.live-comments {
  position: absolute;
  left: 0;
  bottom: 104px;
  width: min(78%, 440px);
  max-height: 38vh;
  z-index: 5;
  padding-left: 12px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.live-comments.collapsed {
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
}

/* 隐藏/显示评论 toggle —— 放右侧，避免挡住左下评论流 */
.comments-toggle {
  position: absolute;
  right: 12px;
  bottom: 118px;
  z-index: 7;
  background: rgba(0,0,0,0.4);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.74rem;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
/* 全局置顶通知 — 固定浮在所有页面顶部 */
.pinned-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 10px 20px;
  background: linear-gradient(135deg, rgba(253,247,233,0.97), rgba(245,234,208,0.97));
  border-bottom: 2px solid var(--c-gold);
  color: var(--c-wine);
  font-size: 0.95rem;
  line-height: 1.5;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  word-break: break-word;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  animation: pinIn 0.32s ease;
  backdrop-filter: blur(6px);
}
.pinned-banner.hidden { display: none; }
.pinned-banner .pin-icon { flex-shrink: 0; font-size: 1.1em; }

/* 当置顶 banner 显示时，全屏页内容整体下移避免遮挡（live 顶栏在上面已处理） */
body.has-pinned .page-waiting .waiting-content,
body.has-pinned .page-paused .state-text,
body.has-pinned .page-ended .state-text {
  padding-top: 40px;
}
@keyframes pinIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ 全局婚纱照按钮（底部左侧，半透明） ============ */
.photo-btn {
  position: fixed;
  bottom: 18px;
  left: 18px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--c-wine);
  border: 1px solid var(--c-gold);
  border-radius: 999px;
  font-family: var(--f-body);
  font-size: 0.84rem;
  letter-spacing: 0.12em;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(6px);
  opacity: 0.62;
  transition: opacity 0.2s ease, background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
}
.photo-btn:hover {
  opacity: 1;
  background: var(--c-cream-2);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
}
.photo-btn:active { transform: scale(0.96); }
.photo-btn .photo-btn-icon { font-size: 1em; }

/* live 页是全屏视频 + 底部输入条，婚纱照按钮挪到右上角避开评论/输入区 */
body.is-live .photo-btn {
  left: auto;
  right: 12px;
  bottom: auto;
  top: 60px;
  opacity: 0.78;
}
body.has-pinned.is-live .photo-btn { top: 100px; }

@media (max-width: 768px) {
  .photo-btn { bottom: 14px; left: 12px; padding: 5px 11px; font-size: 0.76rem; opacity: 0.7; }
  body.is-live .photo-btn { top: 58px; right: 10px; bottom: auto; left: auto; }
}

/* ============ 婚纱照画廊 lightbox ============ */
.gallery {
  position: fixed;
  inset: 0;
  background: rgba(20, 12, 16, 0.95);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: galIn 0.22s ease;
}
.gallery.hidden { display: none; }
@keyframes galIn {
  from { opacity: 0; backdrop-filter: blur(0); }
  to { opacity: 1; backdrop-filter: blur(6px); }
}

.gal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
  z-index: 3;
}
.gal-close:hover { background: rgba(255,255,255,0.22); }

.gal-counter {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--c-gold-light);
  font-family: var(--f-num);
  font-size: 1rem;
  letter-spacing: 0.2em;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  z-index: 3;
}

.gal-img-wrap {
  position: relative;
  width: 90vw;
  height: 86vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
#gal-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.6);
  user-select: none;
  -webkit-user-drag: none;
}
.gal-loading {
  position: absolute;
  color: var(--c-gold-light);
  font-family: var(--f-body);
  letter-spacing: 0.3em;
}
.gal-empty {
  text-align: center;
  color: var(--c-gold-light);
  font-family: var(--f-en-title);
  font-style: italic;
  letter-spacing: 0.3em;
}
.gal-empty-orn { font-size: 2.4rem; margin-bottom: 0.6em; }
.gal-empty-sub { font-size: 0.85rem; margin-top: 0.8em; opacity: 0.7; }

.gal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 4px;
  transition: background 0.15s ease;
  z-index: 3;   /* 高于 .gal-img-wrap，否则「上一张」按钮被图片容器盖住点不到 */
}
.gal-nav:hover { background: rgba(255,255,255,0.22); }
.gal-nav:disabled { opacity: 0.25; cursor: not-allowed; }
.gal-prev { left: 24px; }
.gal-next { right: 24px; }

@media (max-width: 768px) {
  .gal-img-wrap { width: 98vw; height: 82vh; }
  .gal-nav { width: 42px; height: 42px; font-size: 1.8rem; }
  .gal-prev { left: 10px; }
  .gal-next { right: 10px; }
  .gal-close { top: 10px; right: 12px; width: 38px; height: 38px; font-size: 1.5rem; }
  .gal-counter { top: 16px; font-size: 0.88rem; }
}

.live-comments .chat-list {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  max-height: 38vh;
  overflow-y: auto;
  padding: 0;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to top, #000 72%, transparent);
  mask-image: linear-gradient(to top, #000 72%, transparent);
}
.live-comments .chat-list::-webkit-scrollbar { display: none; }

/* 评论气泡（覆盖在视频上，半透明深色）*/
.chat-item {
  font-size: 0.9rem;
  line-height: 1.45;
  word-break: break-word;
  animation: msgIn 0.25s ease;
  background: rgba(0,0,0,0.42);
  color: #fff;
  padding: 5px 11px;
  border-radius: 14px;
  width: fit-content;
  max-width: 100%;
  backdrop-filter: blur(2px);
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-item .chat-time {
  font-family: var(--f-num);
  font-size: 0.72rem;
  color: rgba(255,255,255,0.55);
  margin-right: 0.4em;
}
.chat-item .chat-name {
  color: var(--c-gold-light);
  font-weight: 600;
  margin-right: 0.35em;
}
.chat-item .chat-name::after { content: '：'; }
.chat-item.reaction {
  background: transparent;
  backdrop-filter: none;
  font-size: 1.9rem;
  letter-spacing: 0.12em;
  padding: 2px 6px;
  animation: msgIn 0.25s ease, popReact 0.5s ease;
}
.chat-item.reaction .chat-time { display: none; }
.chat-item.reaction .chat-name {
  font-size: 0.76rem;
  color: rgba(255,255,255,0.6);
  display: block;
  font-weight: 400;
  margin-bottom: 0.1em;
}
.chat-item.reaction .chat-name::after { content: ''; }
@keyframes popReact {
  0% { transform: scale(0.6); }
  60% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* 被禁言提示 */
.chat-banned {
  position: absolute;
  left: 12px;
  bottom: 104px;
  z-index: 7;
  padding: 8px 14px;
  background: rgba(162,58,58,0.92);
  color: #fff;
  border-radius: 999px;
  font-size: 0.84rem;
}

/* 底部输入条 */
.live-bottom-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 7;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bottom-input-line {
  display: flex;
  gap: 8px;
}
.bottom-input-line input {
  flex: 1;
  min-width: 0;
  background: rgba(255,255,255,0.92);
  border: none;
  border-radius: 999px;
  padding: 0.62em 1.1em;
  font-size: 0.92rem;
}
.bottom-input-line input:focus {
  background: #fff;
  box-shadow: 0 0 0 2px rgba(191,160,104,0.5);
}
.send-btn {
  background: var(--c-gold);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0 1.3em;
  font-family: var(--f-body);
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.send-btn:hover { background: var(--c-gold-deep); }
.quick-reactions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.quick-reactions .reaction {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: transform 0.1s ease, background 0.15s ease;
}
.quick-reactions .reaction:hover { background: rgba(255,255,255,0.32); }
.quick-reactions .reaction:active { transform: scale(0.85); }

/* ============ 手机端竖屏 ============ */
@media (max-width: 768px) {
  .live-couple { font-size: 1.15rem; }
  .live-comments { width: 82%; bottom: 100px; max-height: 34vh; }
  .live-comments .chat-list { max-height: 34vh; }
  .comments-toggle { bottom: 116px; right: 10px; }
  .quick-reactions .reaction { width: 36px; height: 36px; font-size: 1.15rem; }
}
@media (min-width: 769px) {
  .mobile-only { display: none !important; }
}
