@charset "UTF-8";
/* ================ 信封打开后的主应用 ================
   - 顶部 Bar: 左 Logo + 右选择栏
   - Tab 1 邀请函: 图片 + 姓名 + 倒计时 + 详情 + 导航
   - Tab 2/3: 相册与回执 (布局适配)
=================================================== */

/* ---- 密码通过后信封舞台 (1bg 背景) ---- */
.envelope-stage{
  position: fixed;
  inset: 0;
  z-index: var(--z-page);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 60px;
  gap: 22px;
  background:
    linear-gradient(180deg, rgba(245,239,228,0.35) 0%, rgba(245,239,228,0.05) 30%, rgba(245,239,228,0.55) 100%),
    url("../assets/images/1bg.jpg") center center / cover no-repeat,
    var(--paper);
  animation: fadeIn 0.6s ease-out;
  perspective: 1600px;
  perspective-origin: 50% 50%;
}
.envelope-stage[hidden]{ display: none; }
.envelope-stage.is-leaving{
  animation: envStageOut 0.7s cubic-bezier(.55,.05,.3,1) forwards;
}
@keyframes envStageOut{
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.94) translateY(-24px); visibility: hidden; }
}

/* 信封艺术图容器 (双层: 外观 + 内页) */
.envelope-art-wrap{
  position: relative;
  width: min(86vw, 520px);
  margin-top: 100px;
  margin-bottom: -26px;
  aspect-ratio: 4 / 3;
  transform-style: preserve-3d;
  filter: drop-shadow(0 30px 50px rgba(56, 35, 23, 0.35));
}
.envelope-art{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 6px;
  transition: transform 0.9s cubic-bezier(.55,.05,.3,1),
              opacity 0.6s ease;
  transform-origin: 50% 100%;
}
.envelope-art--closed{
  z-index: 2;
  transform: rotateX(0deg);
}
.envelope-art--open{
  z-index: 1;
  opacity: 0;
  transform: scale(0.94);
  pointer-events: none;
}
/* 开启动画: 外观翻起 + 淡出, 内页浮现 */
.envelope-art-wrap.is-opened .envelope-art--closed{
  transform: perspective(1200px) rotateX(72deg) translateY(-8%) scale(1.02);
  opacity: 0;
  transition:
    transform 0.85s cubic-bezier(.55,.05,.3,1),
    opacity 0.7s ease 0.15s;
}
.envelope-art-wrap.is-opened .envelope-art--open{
  opacity: 1;
  transform: scale(1);
  transition:
    opacity 0.6s ease 0.4s,
    transform 0.7s cubic-bezier(.2,.9,.3,1) 0.35s;
}

/* 蜡封长按 hit 区域 (信封中央爪印位置) */
.envelope-seal-hit{
  position: absolute;
  left: 50%;
  bottom: 12%;
  transform: translateX(-50%);
  width: 22%;
  aspect-ratio: 1 / 1;
  max-width: 110px;
  min-width: 60px;
  border-radius: 50%;
  background: rgba(110, 32, 41, 0.02);
  border: none;
  outline: none;
  cursor: pointer;
  z-index: 4;
  transition: transform 0.25s;
  -webkit-tap-highlight-color: transparent;
}
.envelope-seal-hit:hover{
  transform: translateX(-50%) scale(1.05);
}
.envelope-seal-hit.is-pressing{
  transform: translateX(-50%) scale(0.94);
}
.envelope-seal-progress{
  position: absolute;
  inset: -6%;
  width: 112%;
  height: 112%;
  transition: stroke-dashoffset 0.7s linear;
  pointer-events: none;
  opacity: 0;
}
.envelope-seal-hit.is-pressing .envelope-seal-progress{ opacity: 0.9; }
.envelope-seal-hit.is-pressing .envelope-seal-progress circle{
  stroke-dashoffset: 0;
}
.envelope-art-wrap.is-opened .envelope-seal-hit{
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.invite-hint{
  font-family: var(--font-serif);
  font-size: 15px;
  margin-bottom: 20px;
  color: var(--wine);
  letter-spacing: 0.3em;
  padding: 6px 10px;
  background: rgba(253, 247, 234, 0.72);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(196, 158, 112, 0.3);
  animation: hintBreath 2.8s ease-in-out infinite;
}
@keyframes hintBreath{
  0%,100% { opacity: 0.8; }
  50%     { opacity: 1; }
}

/* ---- 顶部导航 Bar (左 Logo + 右选择栏) ---- */
.top-nav-bar {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 20px;
  height: 60px;
  background: rgba(245, 239, 228, 0.85);
  backdrop-filter: blur(14px) saturate(1.05);
  -webkit-backdrop-filter: blur(14px) saturate(1.05);
  border-bottom: 1px solid rgba(196, 158, 112, 0.25);
  box-shadow: 0 4px 20px -12px rgba(90, 23, 33, 0.15);
}

.top-nav__brand{
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.25s;
  user-select: none;
}
.top-nav__brand:hover{ transform: scale(1.02); }
.top-nav__brand img{
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--gold);
  background: var(--paper);
  padding: 2px;
  box-shadow: 0 3px 10px -4px rgba(90, 23, 33, 0.25);
}
.top-nav__brand-text{
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--wine);
  letter-spacing: 0.15em;
}

.top-nav__tabs{
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-item{
  padding: 8px 16px;
  border-radius: 999px;
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.3s ease;
  background: transparent;
  border: 1px solid transparent;
}
.nav-item:hover{
  color: var(--wine);
  background: rgba(230, 189, 183, 0.18);
}
.nav-item.is-active,
.nav-item.active{
  background: linear-gradient(135deg, var(--wine) 0%, var(--wine-light) 100%);
  color: #FBF1E3;
  box-shadow: 0 4px 12px rgba(110, 32, 41, 0.3);
}

/* ---- 主内容容器 ---- */
#main-app{
  position: fixed;
  inset: 0;
  z-index: var(--z-page);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}
#main-app[hidden]{ display: none; }

.page-content{
  flex: 1;
  min-height: calc(100vh - 60px);
  padding: 0;
}

.tab-panel{
  display: none;
  animation: fadeSlide 0.45s ease-out;
}
.tab-panel.is-active,
.tab-panel.active{
  display: block;
}
#tab-gallery.is-active,
#tab-gallery.active{
  display: flex;
}
#tab-rsvp.is-active,
#tab-rsvp.active{
  display: block;
}
@keyframes fadeSlide{
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============ Tab 1 · 邀请函 ============ */
#tab-invitation{ padding-bottom: 60px; }

.top-hero-image{
  position: relative;
  width: 100%;
  max-height: 46vh;
  min-height: 240px;
  overflow: hidden;
}
.top-hero-image img{
  width: 100%;
  height: 100%;
  max-height: 48vh;
  object-fit: cover;
  display: block;
}


.invite-card{
  position: relative;
  width: min(92vw, 640px);
  margin: -32px auto 0;
  padding: 40px 28px 32px;
  background: rgba(255, 250, 240, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 20px;
  border: 1px solid rgba(196, 158, 112, 0.35);
  box-shadow:
    0 30px 60px -20px rgba(90, 23, 33, 0.2),
    0 10px 30px -10px rgba(74, 46, 31, 0.15);
  text-align: center;
  z-index: 2;
}

.invite-header{ margin-bottom: 28px; }
.sub-title-en{
  display: block;
  font-family: var(--font-en);
  font-size: 12px;
  letter-spacing: 0.35em;
  color: var(--gold-deep);
  margin-bottom: 12px;
}
.couple-names{
  font-family: var(--font-serif);
  font-size: clamp(24px, 6vw, 34px);
  color: var(--deep-wine);
  font-weight: 500;
  letter-spacing: 0.1em;
  margin: 0;
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.couple-names > span[contenteditable]{
  outline: none;
  padding: 0 2px;
}
.couple-names .amp{
  font-family: var(--font-script);
  font-size: 1.4em;
  color: var(--rose-deep);
  font-weight: 400;
  padding: 0 4px;
}
.invite-desc{
  margin-top: 10px;
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--ink-soft);
  letter-spacing: 0.15em;
  outline: none;
}

/* 倒计时 */
.countdown-group{
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 28px;
}
.cd-box{
  flex: 1;
  max-width: 78px;
  min-width: 0;
  padding: 12px 4px;
  background: linear-gradient(180deg, rgba(253, 247, 234, 0.9), rgba(240, 223, 192, 0.7));
  border: 1px solid rgba(196, 158, 112, 0.35);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.cd-box span{
  font-family: var(--font-en);
  font-size: clamp(26px, 5.5vw, 32px);
  font-weight: 600;
  color: var(--wine);
  line-height: 1;
}
.cd-box label{
  font-size: 15px;
  color: var(--gold-deep);
  letter-spacing: 0.2em;
  font-family: var(--font-serif);
}

/* 婚礼详情 */
.wedding-details{
  margin: 0 auto 24px;
  padding: 8px 4px;
  border-top: 1px dashed rgba(196, 158, 112, 0.4);
  border-bottom: 1px dashed rgba(196, 158, 112, 0.4);
}
.info-row{
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 8px 4px;
  font-family: var(--font-serif);
  font-size: 50px;
  color: var(--ink);
  text-align: left;
  line-height: 1.6;
}
.info-row .label{
  flex: 0 0 54px;
  color: var(--gold-deep);
  font-size: 50px;
  letter-spacing: 0.18em;
}
.info-row .val{
  flex: 1;
  outline: none;
  word-break: break-all;
}
.info-row .val.bold{
  font-weight: 600;
  color: var(--wine);
}
.info-row.sub-address{
  padding-left: calc(54px + 5px);
  padding-top: 2px;
  color: var(--ink-soft);
  font-size: 40px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.info-row.sub-address .val{
  color: var(--ink-soft);
  font-size: 15px;
  letter-spacing: -0.005em;
  padding: 11px 0;
  min-width: 0;
  flex: 0 0 auto;
}
.addr-copy-btn{
  flex: 0 0 auto;
  margin-left: 18px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(201, 169, 110, 0.12);
  border: 1px solid rgba(196, 158, 112, 0.35);
  color: var(--gold-deep);
  font-size: 13px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}
.addr-copy-btn:hover{
  background: rgba(201, 169, 110, 0.2);
}
.addr-copy-btn:active{
  transform: scale(0.98);
}

/* 一键导航按钮 */
.action-wrapper{
  display: flex;
  justify-content: center;
  margin-top: 8px;
}
.nav-button{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 32px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--wine) 0%, var(--wine-light) 100%);
  color: #FBF1E3;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-decoration: none;
  box-shadow:
    0 10px 24px -8px rgba(110, 32, 41, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.3s;
}
.nav-button:hover{
  transform: translateY(-2px);
  box-shadow:
    0 14px 30px -8px rgba(110, 32, 41, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* ============ Tab 2 · 相册 (布局适配) ============ */
#tab-gallery{
  display: none;
  padding: 32px 20px 60px;
  min-height: calc(100vh - 60px);
  flex-direction: column;
}
#tab-gallery.is-active,
#tab-gallery.active{
  display: flex;
}
#tab-gallery .page-head{ flex-shrink: 0; }
#tab-gallery .depth-gallery{
  flex: 1;
  min-height: 58vh;
}
#tab-gallery .depth-gallery__pager{
  flex-shrink: 0;
}

/* ============ Tab 3 · 回执 (布局适配) ============ */
#tab-rsvp{
  padding: 32px 20px 60px;
  min-height: calc(100vh - 60px);
}
#tab-rsvp .rsvp-grid{
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* ---- 手机端优化 ---- */
@media (max-width: 640px){
  .top-nav-bar{
    padding: 8px 12px;
    height: 54px;
  }
  .top-nav__brand img{ width: 32px; height: 32px; }
  .top-nav__brand-text{ font-size: 14px; letter-spacing: 0.1em; }
  .top-nav__tabs{ gap: 2px; }
  .nav-item{ padding: 6px 10px; font-size: 12px; }

  .top-hero-image{ min-height: 200px; max-height: 40vh; }
  .invite-card{
    width: 92vw;
    padding: 32px 20px 26px;
    margin: -24px auto 0;
  }
  .countdown-group{ gap: 6px; }
  .cd-box{ max-width: none; padding: 10px 2px; }
  .info-row{ font-size: 15px; }
  .info-row .label{ flex: 0 0 48px; font-size: 14px; letter-spacing: 0.08em;}
  .nav-button{ padding: 10px 24px; font-size: 16px; letter-spacing: 0.2em; }

  #tab-gallery, #tab-rsvp{ padding: 20px 12px 50px; }
  #tab-rsvp .rsvp-grid{ grid-template-columns: 1fr; gap: 16px; }
}

/* =========================================================
   Tab 1 · 邀请函小狗装饰
   ========================================================= */

.invite-scene {
  position: relative;
  width: min(92vw, 760px);
  margin: 0 auto;
}


/* 两只小狗的共同设置 */
.invite-dog {
  position: absolute;
  z-index: 3;

  width: 105px;
  height: auto;

  pointer-events: none;
  user-select: none;

  filter:
    drop-shadow(0 8px 12px rgba(74, 46, 31, 0.12));

  transition:
    transform 0.35s ease;
}


/* 左边小狗 */
.invite-dog--left {
  left: -42px;
  top: 70px;

  transform: rotate(-6deg);
}


/* 右边小狗 */
.invite-dog--right {
  right: 38px;
  top: 235px;

  width: 96px;

  transform:
      rotate(0deg);
}

@media (max-width: 640px) {
  .invite-scene {
    width: 92vw;
  }


  .invite-dog {
    width: 76px;
  }


  .invite-dog--left {
    left: -18px;
    top: 68px;

    transform: rotate(-6deg);
  }


  .invite-dog--right {
    right: -16px;
    top: 210px;

    width: 70px;

    transform:
      rotate(-5deg);
  }