@import url('https://fonts.googleapis.com/css2?family=Great+Vibes&family=LXGW+WenKai+TC:wght@400&family=Noto+Sans+TC:wght@300;400;500;700&family=Noto+Serif+TC:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
  --primary: #9a8a78;      /* 溫潤莫蘭迪大地灰褐 (新郎西裝色系) */
  --primary-dark: #706253; /* 深褐/領結棕 */
  --primary-light: #f0eae1;/* 柔和奶油粉白 */
  --accent: #95adc1;       /* 雅緻仙境霧藍 (新娘背景禮服色系) */
  --background: #faf8f5;   /* 極簡白紗米白 */
  --text: #3d3731;         /* 暖炭褐文字 */
  --text-light: #80756b;   /* 淺泥灰文字 */
  --white: #ffffff;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow: 0 8px 30px rgba(154, 138, 120, 0.12);
  --shadow-hover: 0 12px 40px rgba(154, 138, 120, 0.2);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --paper-noise: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.12'/%3E%3C/svg%3E");
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

html {
  height: 100%;
  overflow: hidden;
  position: fixed;
  width: 100%;
}

body {
  font-family: 'Noto Sans TC', sans-serif;
  background-color: #f3f0eb; /* 電腦版背景底色 */
  color: var(--text);
  line-height: 1.6;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  height: 100%;
  overflow: hidden;
  overscroll-behavior-y: none; /* 防止手機下拉重新整理 */
}

body.no-scroll,
html.no-scroll {
  overflow: hidden !important;
  height: 100vh !important;
  height: 100dvh !important;
  scrollbar-width: none;
}

body.no-scroll::-webkit-scrollbar,
html.no-scroll::-webkit-scrollbar {
  display: none;
}

/* 將內容限制在手機寬度，置中顯示 */
.app-container {
  width: 100%;
  max-width: 480px;
  background-color: var(--background);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
  height: 100vh;
  height: 100dvh;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: none; /* 防止手機下拉重新整理 */
  scroll-behavior: smooth; /* 確保內部錨點跳轉平滑過渡 */
  display: flex;
  flex-direction: column;
}

body.no-scroll .app-container {
  overflow: hidden !important;
  height: 100vh;
  height: 100dvh;
}

/* 預設隱藏 app-container 滾動條以求美觀 (可選) */
.app-container {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}
.app-container::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* 預載入淡入效果的類別 */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 1. Hero 封面區區塊 */
.hero {
  position: relative;
  height: 90vh;
  min-height: 550px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  color: var(--white);
  text-align: center;
  padding-bottom: 80px;
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

/* 漸層疊加 */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.2) 50%, rgba(74, 62, 61, 0.8) 100%);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 90%;
}

.hero-names {
  font-family: 'Playfair Display', serif;
  font-size: 2.8rem;
  font-weight: 400;
  letter-spacing: 2px;
  margin-bottom: 10px;
  text-shadow: 1px 1px 10px rgba(0,0,0,0.3);
}

.hero-names span,
.hero-names-cn {
  display: block;
  font-family: 'Noto Serif TC', serif;
  font-size: 1.35rem;
  font-weight: 400;
  letter-spacing: 6px;
  text-indent: 6px; /* 修正字距造成的視覺微偏 */
  margin: 10px 0 16px;
  opacity: 0.95;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.hero-names-cn .hero-amp {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.3rem;
  font-weight: 400;
  margin: 0 6px;
  opacity: 0.9;
  letter-spacing: 0;
  display: inline-block;
  text-indent: 0;
}


.hero-date {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  letter-spacing: 3px;
  margin-bottom: 20px;
  opacity: 0.9;
  text-shadow: 1px 1px 5px rgba(0,0,0,0.3);
  display: inline-block;
  border-top: 1px solid rgba(255,255,255,0.4);
  border-bottom: 1px solid rgba(255,255,255,0.4);
  padding: 8px 20px;
}

.hero-scroll-btn {
  background: none;
  border: none;
  color: var(--white);
  cursor: pointer;
  animation: bounce 2s infinite;
  margin-top: 10px;
}

.hero-scroll-btn svg {
  fill: var(--white);
  filter: drop-shadow(1px 1px 3px rgba(0,0,0,0.3));
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-10px); }
  60% { transform: translateY(-5px); }
}

/* 2. 倒數計時區 */
.section {
  padding: 50px 24px;
  text-align: center;
  position: relative;
}

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  color: var(--primary-dark);
  margin-bottom: 10px;
  position: relative;
  display: inline-block;
}

.section-title::after {
  content: '';
  display: block;
  width: 14px;
  height: 14px;
  margin: 5px auto 0;
  background-color: var(--accent);
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 30px;
}

/* 倒數計時卡片 */
.countdown-container {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 0 auto;
}

.countdown-box {
  flex: 1;
  background-color: var(--white);
  padding: 15px 5px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  border: 1px solid rgba(154, 138, 120, 0.1);
  transition: var(--transition);
}

.countdown-box:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.countdown-num {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--primary-dark);
  display: block;
}

.countdown-label {
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 500;
}

/* 3. 相本輪播區 */
.gallery-section {
  background-color: var(--primary-light);
}

.slider-container {
  position: relative;
  width: 100%;
  height: 380px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.slider-wrapper {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform 0.5s ease-in-out;
}

.slide {
  min-width: 100%;
  height: 100%;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 輪播控制按鈕 */
.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(255, 255, 255, 0.7);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 10;
  transition: var(--transition);
  color: var(--text);
}

.slider-btn:active {
  background-color: rgba(255, 255, 255, 0.9);
}

.slider-btn-prev {
  left: 10px;
}

.slider-btn-next {
  right: 10px;
}

.slider-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 15px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(154, 138, 120, 0.3);
  cursor: pointer;
  transition: var(--transition);
}

.dot.active {
  background-color: var(--primary-dark);
  width: 20px;
  border-radius: 4px;
}

/* 4. 時間地點區 */
.info-card {
  background-color: var(--white);
  border-radius: var(--radius-lg);
  padding: 30px 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(154, 138, 120, 0.1);
  margin-bottom: 25px;
  text-align: left;
}

.info-item {
  display: flex;
  margin-bottom: 20px;
}

.info-item:last-child {
  margin-bottom: 0;
}

.info-icon {
  margin-right: 15px;
  flex-shrink: 0;
  margin-top: 3px;
}

.info-icon svg {
  fill: var(--primary);
}

.info-details h4 {
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 4px;
  font-weight: 700;
}

.info-details p {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* 地圖 */
.map-container {
  width: 100%;
  height: 250px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(154, 138, 120, 0.1);
  margin-bottom: 15px;
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.map-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--primary);
  color: var(--white);
  text-decoration: none;
  font-weight: 500;
  padding: 12px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  transition: var(--transition);
  font-size: 0.95rem;
}

.map-btn:active {
  background-color: var(--primary-dark);
  transform: translateY(1px);
}

.map-btn svg {
  fill: var(--white);
}

/* 5. RSVP 表單區 */
.rsvp-section {
  background-color: var(--primary-light);
  border-top-left-radius: 30px;
  border-top-right-radius: 30px;
}

.rsvp-form {
  background-color: var(--white);
  border-radius: var(--radius-lg);
  padding: 30px 20px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(154, 138, 120, 0.1);
  text-align: left;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}

.form-group label span {
  color: var(--accent);
}

/* 輸入框樣式 */
.form-control {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid #e1dbd6;
  background-color: #faf8f5;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  background-color: var(--white);
  box-shadow: 0 0 0 3px rgba(154, 138, 120, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* 雙欄按鈕選項 (出席/不克出席) */
.radio-tile-group {
  display: flex;
  gap: 15px;
}

.radio-tile-label {
  flex: 1;
  position: relative;
  cursor: pointer;
}

.radio-tile-label input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border: 1px solid #e1dbd6;
  border-radius: var(--radius-md);
  background-color: #faf8f5;
  transition: var(--transition);
  font-weight: 500;
  font-size: 0.95rem;
  text-align: center;
}

.radio-tile-label input:checked + .radio-tile {
  border-color: var(--primary);
  background-color: var(--primary-light);
  color: var(--primary-dark);
  box-shadow: 0 0 0 3px rgba(154, 138, 120, 0.15);
}

/* 遞交按鈕 */
.submit-btn {
  width: 100%;
  background-color: var(--primary);
  color: var(--white);
  border: none;
  font-weight: 700;
  padding: 14px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: var(--transition);
  font-size: 1rem;
  letter-spacing: 1px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.submit-btn:active {
  background-color: var(--primary-dark);
  transform: translateY(1px);
}

.submit-btn:disabled {
  background-color: var(--text-light);
  opacity: 0.6;
  cursor: not-allowed;
}

/* 送出表單時的讀取圈圈 */
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 訊息回饋彈窗 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(74, 62, 61, 0.7);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  padding: 20px;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-content {
  background-color: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px 30px;
  text-align: center;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 360px;
  transform: scale(0.8);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-overlay.active .modal-icon {
  animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.4s forwards;
}

@keyframes popIn {
  0% { transform: scale(0) rotate(-15deg); opacity: 0; }
  50% { transform: scale(1.3) rotate(8deg); opacity: 1; }
  75% { transform: scale(0.9) rotate(-3deg); opacity: 1; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.modal-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: #e8f5e9;
  color: #4caf50;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 20px;
  transform: scale(0);
  opacity: 0;
}

.modal-icon svg {
  fill: #4caf50;
}

.modal-content h3 {
  font-size: 1.4rem;
  margin-bottom: 10px;
  color: var(--text);
}

.modal-content p {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 25px;
}

.modal-btn {
  background-color: var(--primary);
  color: var(--white);
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius-md);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}

.modal-btn:active {
  background-color: var(--primary-dark);
}

/* 頁尾 */
.footer {
  padding: 30px 24px;
  text-align: center;
  background-color: var(--text);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  margin-top: auto;
}

.footer-logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-style: italic;
  color: var(--white);
  margin-bottom: 8px;
  letter-spacing: 2px;
}

/* ============================================================
   信封入口開啟動畫樣式 (Envelope Overlay Styles)
   ============================================================ */
.envelope-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  background-color: var(--primary-light);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.8s ease, transform 0.8s ease;
  overflow: hidden;
}

/* 限制喜帖信封開啟時的捲動 */
body.no-scroll {
  overflow: hidden;
  height: 100%;
}

.envelope-container {
  perspective: 1000px;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.envelope {
  position: relative;
  width: 90vw;
  max-width: 440px;
  aspect-ratio: 1.5 / 1;
  height: auto;
  background: var(--paper-noise), linear-gradient(135deg, #8ba1b0, #6e8492); /* Dusty blue / Slate blue with paper texture */
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25), inset 0 0 20px rgba(0,0,0,0.05);
  transform-style: preserve-3d;
}

/* 信封上蓋 (Top Flap) */
.envelope .flap {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--paper-noise), linear-gradient(180deg, #95abbb 0%, #768d9e 100%);
  clip-path: polygon(0 0, 50% 65%, 100% 0);
  transform-origin: top;
  transition: transform 0.6s ease, z-index 0.6s ease;
  z-index: 4;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.15));
  display: flex;
  justify-content: center;
}

/* 封蓋燙金文字 */
.flap-text {
  position: absolute;
  top: 15%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: #d1b882; /* Gold foil */
  text-shadow: 1px 1px 0px rgba(255,255,255,0.15), -1px -1px 0px rgba(0,0,0,0.2);
  transition: opacity 0.3s ease;
}

.flap-names {
  font-family: 'Great Vibes', cursive;
  font-size: 2rem;
  letter-spacing: 2px;
}

.flap-date {
  font-family: 'Playfair Display', serif;
  font-size: 0.7rem;
  letter-spacing: 3px;
}

/* 信封前袋 (Pocket) */
.envelope .pocket {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--paper-noise), linear-gradient(to top, #6b818d, #899fae);
  clip-path: polygon(0 45%, 50% 70%, 100% 45%, 100% 100%, 0 100%);
  z-index: 3;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  filter: drop-shadow(0 -2px 5px rgba(0,0,0,0.1));
}

/* 內頁小信紙 (Invitation Letter) */
.envelope .letter {
  position: absolute;
  bottom: 3%;
  left: 4%;
  width: 92%;
  height: 88%;
  background-color: #ffffff;
  background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(212, 175, 55, 0.03) 10px, rgba(212, 175, 55, 0.03) 20px);
  border-radius: var(--radius-sm);
  z-index: 2;
  transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275), z-index 0.8s ease;
  padding: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border: 1px solid rgba(212, 175, 55, 0.3); /* Gold border */
}

.letter-content {
  border: 1px solid rgba(212, 175, 55, 0.6); /* Inner thin gold border */
  padding: 15px;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.letter-content h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--primary-dark);
  margin-bottom: 5px;
  letter-spacing: 1px;
}

.letter-content p {
  font-size: 0.8rem;
  color: #706253;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.letter-content .mini-heart {
  color: var(--accent);
  margin-top: 10px;
  font-size: 1.2rem;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* 蠟印按鈕 (Wax Seal Button) */
.envelope .seal-btn {
  position: absolute;
  top: 65%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 75px;
  height: 75px;
  border-radius: 46% 54% 48% 52% / 55% 45% 53% 47%;
  background: radial-gradient(circle at 35% 35%, #cca570 0%, #9c7b4f 40%, #5c431e 100%);
  border: none;
  box-shadow: 
    0 8px 15px rgba(0,0,0,0.5), 
    inset 0 4px 5px rgba(255,255,255,0.4),
    inset 0 -4px 6px rgba(0,0,0,0.7);
  cursor: pointer;
  z-index: 5;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.3s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  outline: none;
  font-size: 0;
}

/* 內凹蓋印圈與藤蔓裝飾 */
.envelope .seal-btn::before {
  content: "";
  position: absolute;
  top: 12%;
  left: 12%;
  right: 12%;
  bottom: 12%;
  border-radius: 50%;
  background: linear-gradient(135deg, #8a6a40, #ad8a5c);
  box-shadow: 
    inset 0 3px 5px rgba(0,0,0,0.6),
    inset 0 -2px 4px rgba(255,255,255,0.3),
    0 1px 1px rgba(255,255,255,0.4);
  border: 2px dashed rgba(92, 67, 30, 0.5);
}

/* 凸起燙金文字 */
.envelope .seal-btn::after {
  content: "G&E";
  position: absolute;
  z-index: 2;
  font-family: 'Great Vibes', cursive;
  font-size: 1.6rem;
  color: #cca570;
  text-shadow: 
    -1px -1px 1px rgba(255,255,255,0.5),
    1px 1px 2px rgba(0,0,0,0.8),
    2px 2px 3px rgba(0,0,0,0.4);
}

.envelope .seal-btn:hover {
  transform: translate(-50%, -50%) scale(1.08);
}

.envelope .seal-btn:active {
  transform: translate(-50%, -50%) scale(0.95);
}

/* 信封開啟動畫狀態 (Open States) */
.envelope.open .flap {
  transform: scaleY(-1);
  z-index: 1; /* 蓋子翻開後移至信紙後方 */
}

.envelope.open .flap-text {
  opacity: 0; /* 翻開時隱藏文字 */
}

.envelope.open .letter {
  transform: translateY(-65%);
  z-index: 4; /* 信紙抽起移至最前方 */
}

.envelope.open .seal-btn {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0);
}

.envelope-overlay.fade-out {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}

/* ============================================================
   iOS 水滴透視風格底部導覽列 (Bottom Navigation)
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: max(12px, env(safe-area-inset-bottom, 12px)); /* 往下擺，同時避開 iPhone 底線 */
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px; /* 外框邊距變窄 */
  background-color: rgba(60, 55, 50, 0.45); /* More transparent to allow blur to show */
  border-radius: 40px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(25px) saturate(150%); /* Authentic iOS Glassmorphism */
  -webkit-backdrop-filter: blur(25px) saturate(150%); /* Safari support */
  z-index: 900;
  width: 90%;
  max-width: 400px;
  border: 1px solid rgba(255, 255, 255, 0.15); /* Stronger border for glass effect */
}

.bottom-nav .nav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px; /* 上下內邊距再次縮減 */
  border-radius: 30px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem; /* 字體稍微縮小配合纖細版型 */
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex: 1;
}

.bottom-nav .nav-item:hover {
  color: rgba(255, 255, 255, 0.9);
}

.bottom-nav .nav-item.active {
  background-color: #f8f3eb; /* Soft white/cream active pill */
  color: #4a4238; /* Dark text for contrast */
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  flex: 1.2; /* Slightly wider when active */
}

.bottom-nav .nav-icon {
  font-size: 1.1rem;
}

/* 確保底部不會被導覽列擋住 */
.footer {
  padding-bottom: 100px;
}

/* ============================================================
   分頁滑動與過渡樣式 (Sliding Tab Pages Layout)
   ============================================================ */
.tab-pages-wrapper {
  display: flex;
  width: 300%; /* 3 pages */
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
  align-items: flex-start;
}

/* 強制防止信封展示時背景露出滾動條 */
body.no-scroll .tab-pages-wrapper {
  display: none !important;
}

.tab-page {
  width: 33.3333%;
  flex-shrink: 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.tab-page.active {
  height: auto;
  overflow: visible;
  opacity: 1;
}

/* ============================================================
   婚紗照頁面 Gallery Carousel (Interactive Scroll & Center Zoom)
   ============================================================ */
.gallery-carousel-title {
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--primary-dark);
  text-align: center;
  letter-spacing: 6px;
  text-indent: 6px;
  margin-bottom: 18px;
}

.gallery-carousel {
  position: relative;
  width: 100%;
  overflow-x: auto;
  scroll-behavior: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  cursor: grab;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none;  /* IE and Edge */
  mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 8%, black 92%, transparent 100%);
  padding: 30px 0; /* Increase padding to prevent overflow scale clipping */
}

.gallery-carousel::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

.gallery-carousel:active {
  cursor: grabbing;
}

.gallery-carousel-track {
  display: flex;
  gap: 12px;
  width: max-content;
  pointer-events: auto;
  animation: none !important;
  padding: 0 40px; /* Give some breathing room at the ends */
}

.gallery-carousel-slide {
  flex-shrink: 0;
  width: 220px;
  height: 280px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  user-select: none;
  -webkit-user-drag: none;
  /* 滑動時中心放大特效 (由 JS 直接控制) */
  transform: scale(0.9);
  will-change: transform;
}

.gallery-carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none; /* 避免拖曳時觸發瀏覽器預設的圖片拖曳 */
}

.gallery-page-hero {
  padding: 35px 20px 10px;
  opacity: 1;
}

/* 愛情故事穿插心語 (Interspersed Love Story - Clean Seamless Layout) */
.story-interlude {
  padding: 24px 20px 12px;
  max-width: 440px;
  margin: 0 auto;
  text-align: center;
}

.story-interlude-card,
.story-card-special {
  background: none;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  text-align: center;
  position: relative;
}

.story-interlude-mark {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--accent); /* Dusty blue */
  opacity: 0.45;
  line-height: 1;
  margin-bottom: 8px;
  user-select: none;
}

.story-interlude-text p {
  font-family: 'Noto Serif TC', serif;
  font-size: 0.95rem;
  line-height: 2.2;
  color: #4a3f35;
  letter-spacing: 1px;
  margin-bottom: 12px;
  text-align: center;
}

.story-interlude-text p:last-child {
  margin-bottom: 0;
}

.story-highlight-text {
  font-weight: 500 !important;
  color: var(--primary-dark) !important;
}

.story-interlude-sign {
  font-family: 'Great Vibes', cursive;
  font-size: 2rem;
  color: var(--primary-dark);
  letter-spacing: 1px;
  margin-top: 14px;
  display: block;
}




/* ============================================================
   Q&A 婚禮手札手風琴樣式 (Gary & Emma Bespoke Wedding Stationery Style)
   ============================================================ */
.qa-page-header {
  padding: 42px 20px 20px;
  text-align: center;
}

/* 法式拱門婚紗照縮圖 */
.qa-arch-wrapper {
  width: 135px;
  height: 175px;
  margin: 0 auto 18px;
  border-radius: 70px 70px 16px 16px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 10px 28px rgba(154, 138, 120, 0.22);
  border: 4px solid var(--white);
  outline: 1px solid rgba(154, 138, 120, 0.3);
}

.qa-arch-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.qa-tag {
  display: inline-block;
  padding: 4px 14px;
  background-color: var(--primary-light);
  color: var(--primary-dark);
  font-family: 'Playfair Display', serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 3px;
  border-radius: 20px;
  margin-bottom: 8px;
  border: 1px solid rgba(154, 138, 120, 0.2);
}

.qa-welcome-card {
  max-width: 440px;
  margin: 15px auto 0;
  background-color: rgba(255, 255, 255, 0.75);
  border: 1px dashed rgba(154, 138, 120, 0.35);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  backdrop-filter: blur(4px);
}

.qa-welcome-card p {
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.75;
  margin: 0;
}

.qa-section {
  padding: 10px 20px 50px;
  max-width: 520px;
  margin: 0 auto;
}

.qa-category {
  margin-bottom: 28px;
}

.qa-chapter-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding-left: 2px;
}

.qa-chapter-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background-color: var(--accent); /* Dusty blue signature */
  color: var(--white);
  font-family: 'Playfair Display', serif;
  font-size: 0.85rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 8px rgba(149, 173, 193, 0.35);
  flex-shrink: 0;
}

.qa-chapter-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.qa-chapter-title {
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 1px;
  margin: 0;
}

.qa-chapter-en {
  font-family: 'Playfair Display', serif;
  font-size: 0.8rem;
  color: var(--text-light);
  letter-spacing: 1.5px;
  font-style: italic;
}

.qa-accordion-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qa-accordion-item {
  background: #ffffff;
  border: 1px solid rgba(154, 138, 120, 0.18);
  border-left: 3.5px solid transparent;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(154, 138, 120, 0.05);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.qa-accordion-item:hover {
  border-color: rgba(154, 138, 120, 0.35);
}

.qa-accordion-item.open {
  border-color: rgba(154, 138, 120, 0.32);
  border-left-color: var(--accent); /* Dusty blue accent line */
  box-shadow: 0 6px 22px rgba(154, 138, 120, 0.12);
}

.qa-accordion-header {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  font-family: inherit;
}

.qa-question-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  padding-right: 12px;
}

.qa-q-letter {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
  flex-shrink: 0;
  margin-top: 1px;
  transition: color 0.25s ease;
}

.qa-accordion-item.open .qa-q-letter {
  color: var(--accent);
}

.qa-question-text {
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
  letter-spacing: 0.3px;
  transition: color 0.2s ease;
}

.qa-accordion-item.open .qa-question-text {
  color: var(--primary-dark);
}

.qa-chevron-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.qa-accordion-item.open .qa-chevron-circle {
  background-color: rgba(149, 173, 193, 0.22);
  color: var(--accent);
}

.qa-chevron-svg {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.qa-accordion-item.open .qa-chevron-svg {
  transform: rotate(180deg);
}

/* 經典 Grid 平滑展開 (0fr -> 1fr) */
.qa-accordion-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.qa-accordion-item.open .qa-accordion-body {
  grid-template-rows: 1fr;
}

.qa-answer-content {
  min-height: 0;
  overflow: hidden;
  padding: 0 16px 0 16px;
  transition: padding 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.qa-accordion-item.open .qa-answer-content {
  padding: 0 16px 16px 16px;
}

.qa-answer-bubble {
  background: rgba(242, 236, 228, 0.45);
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-left: 2px solid rgba(154, 138, 120, 0.3);
}

.qa-a-letter {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
  flex-shrink: 0;
  margin-top: 1px;
}

.qa-answer-bubble p {
  margin: 0;
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 0.92rem;
  line-height: 1.7;
  color: #5a4e44;
  letter-spacing: 0.3px;
}

/* 頁底貼心叮嚀卡 */
.qa-contact-card {
  margin-top: 36px;
  background-color: var(--white);
  border: 1px solid rgba(154, 138, 120, 0.2);
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 4px 18px rgba(154, 138, 120, 0.08);
  position: relative;
}

.qa-contact-seal {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8ba1b0, #6e8492);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 0.85rem;
  box-shadow: 0 3px 10px rgba(110, 132, 146, 0.3);
}

.qa-contact-title {
  font-family: 'Noto Sans TC', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--primary-dark);
  margin-bottom: 8px;
}

.qa-contact-desc {
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 12px;
}

.qa-contact-sign {
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-size: 0.95rem;
  letter-spacing: 1px;
  color: var(--primary-dark);
}




