/* ============================================================
   聖文 ♡ 壯壯 — 一週年紀念網頁 共用設計系統
   ============================================================ */

/* --- Google Fonts --- */
@import url('https://fonts.loli.net/css2?family=Playfair+Display:wght@400;600;700;900&family=Cinzel:wght@400;700&family=EB+Garamond:ital,wght@0,400;0,600;1,400&family=Noto+Serif+TC:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600&family=Ma+Shan+Zheng&display=swap');

/* --- CSS Custom Properties --- */
:root {
  /* Colors - Classical Gold & Deep Bronze */
  --bg-primary: #0a0908;
  --bg-secondary: #1a1612;
  --bg-tertiary: #26211c;
  --card: #1a1612;

  /* Classical Gold Palette */
  --gold: #af8a54; /* Metallic Classic Gold */
  --gold-light: #e5c185; /* Soft Champagne Gold */
  --gold-dim: rgba(175, 138, 84, 0.15);
  --bronze: #7c623c;
  --bronze-light: #a68b6a;
  --rose: #926b4d; /* Muted Bronze instead of Pink */
  --rose-light: #d4a574;
  --rose-dim: rgba(146, 107, 77, 0.1);
  --accent-rose: #af8a54;
  --accent-pink: #e5c185; 
  --accent-gold: #f5c77e;
  --accent-purple: #7e57c2;
  --accent-blue: #5c6bc0;

  /* Text Colors */
  --text-primary: #f2ede4;
  --text-secondary: #c5b9ac;
  --text-muted: #8e8271;
  --dim: #72685a;

  /* Glass System */
  --glass-bg: rgba(38, 33, 28, 0.4);
  --glass-hover: rgba(54, 47, 40, 0.6);
  --glass-b: rgba(175, 138, 84, 0.2);
  --glass-border: rgba(175, 138, 84, 0.15);
  --glass-border-hover: rgba(175, 138, 84, 0.3);
  --glass-blur: blur(20px);
  --glass-blur-heavy: blur(40px);

  /* Shadows */
  --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.6);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-elevated: 0 16px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(175, 138, 84, 0.15);
  --shadow-glow-strong: 0 0 50px rgba(175, 138, 84, 0.25);

  /* Typography */
  --font-display: 'Cinzel', 'Playfair Display', serif;
  --font-serif: 'EB Garamond', 'Noto Serif TC', serif;
  --font-sans: 'Inter', sans-serif;
  --font-ui: 'Inter', sans-serif;
  --font-handwriting: 'Ma Shan Zheng', cursive;
  --font-counter: 'Cinzel', serif;

  /* Spacing */
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --section-padding: clamp(3rem, 8vw, 6rem);
  --container-width: min(90vw, 1200px);

  /* Border Radius - Apple Style */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions - Spring Easing */
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --transition-fast: 0.2s var(--ease-spring);
  --transition-normal: 0.4s var(--ease-spring);
  --transition-slow: 0.8s var(--ease-out-expo);

  /* Tab Bar */
  --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);

  /* Animation Duration */
  --duration-fast: 150ms;
  --duration-normal: 300ms;
  --duration-slow: 500ms;
}

/* --- Focus Visible (Keyboard Navigation) --- */
*:focus { outline: none; }
*:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(175, 138, 84, 0.25);
}

/* Lazy-load image fade-in */
img.lazy-load {
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
  filter: blur(4px);
}
img.lazy-load.loaded {
  opacity: 1;
  filter: blur(0);
}

/* Text contrast fixes */
.text-muted { color: var(--text-secondary) !important; }
.gold-dim-text { color: var(--text-secondary); }

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.8;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html {
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

/* --- Custom Scrollbar --- */
::-webkit-scrollbar {
  width: 3px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 2px;
}

/* --- Background Gradient --- */
.bg-gradient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(196, 114, 127, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse 80% 50% at 80% 80%, rgba(212, 165, 116, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 0%, rgba(168, 85, 247, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse 50% 30% at 0% 50%, rgba(99, 102, 241, 0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(15, 15, 24, 0.6) 0%, transparent 80%),
    linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  z-index: -2;
  animation: gradientShift 20s ease-in-out infinite alternate;
}

@keyframes gradientShift {
  0% { opacity: 1; }
  50% { opacity: 0.85; }
  100% { opacity: 0.95; }
}

/* Background mesh overlay */
.bg-mesh {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d4a574' fill-opacity='0.4'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

/* --- Grain Texture Overlay --- */
.grain-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.025;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px 128px;
}

/* --- Floating Action Buttons (New Design) --- */
/* --- Floating Action Buttons: Right Side (FAB Style) --- */
.floating-nav-btn {
  position: fixed;
  z-index: 1000;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(175, 138, 84, 0.9), rgba(127, 98, 60, 0.9));
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  right: 20px;
  top: 50%;
  transform: translateY(-50%) translateY(44px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 0 15px rgba(175, 138, 84, 0.3);
  transition: all 0.3s ease;
  animation: floatIn 0.6s var(--ease-out-expo) 0.4s both;
}

.floating-music-btn {
  position: fixed;
  z-index: 1000;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(175, 138, 84, 0.9), rgba(127, 98, 60, 0.9));
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  right: 20px;
  top: 50%;
  transform: translateY(-50%) translateY(-44px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 0 15px rgba(175, 138, 84, 0.3);
  transition: all 0.3s ease;
  animation: floatIn 0.6s var(--ease-out-expo) 0.55s both;
}

.floating-nav-btn:hover,
.floating-music-btn:hover {
  transform: translateY(-50%) scale(1.15);
  box-shadow: 0 8px 28px rgba(0,0,0,0.6), 0 0 25px rgba(175, 138, 84, 0.5);
}

.floating-nav-btn:active,
.floating-music-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.floating-music-btn.playing {
  animation: pulse 2s infinite;
}

/* Floating Nav Menu Panel */
.floating-nav-panel {
  position: fixed;
  right: 88px;
  top: 50%;
  transform: translateY(-50%) translateX(20px) scale(0.95);
  background: rgba(10, 9, 8, 0.98);
  border: 1px solid var(--gold-dim);
  border-radius: 16px;
  padding: 1rem 0;
  min-width: 160px;
  backdrop-filter: blur(20px);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s var(--ease-out-expo);
  z-index: 999;
}

.floating-nav-panel.show {
  opacity: 1;
  transform: translateY(-50%) translateX(0) scale(1);
  pointer-events: auto;
}

.floating-nav-panel li {
  list-style: none;
}

.floating-nav-panel a {
  display: block;
  padding: 0.9rem 1.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  transition: all 0.2s ease;
  border-left: 2px solid transparent;
}

.floating-nav-panel a:hover,
.floating-nav-panel a.active {
  background: rgba(175, 138, 84, 0.1);
  color: var(--gold-light);
  border-left-color: var(--gold);
}

.floating-nav-panel a.active {
  font-weight: 600;
}

/* Music Player Panel - Bottom Right */
.music-player-panel {
  position: fixed;
  right: 88px;
  top: 50%;
  transform: translateY(-50%) translateX(20px) scale(0.95);
  background: rgba(10, 9, 8, 0.98);
  border: 1px solid var(--gold-dim);
  border-radius: 16px;
  padding: 1.2rem;
  min-width: 220px;
  backdrop-filter: blur(20px);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s var(--ease-out-expo);
  z-index: 999;
}

.music-player-panel.show {
  opacity: 1;
  transform: translateY(-50%) translateX(0) scale(1);
  pointer-events: auto;
}

.mp-track-info {
  margin-bottom: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--gold-dim);
}

.mp-track-title {
  font-size: 0.85rem;
  color: var(--gold-light);
  font-family: var(--font-serif);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mp-track-artist {
  font-size: 0.7rem;
  color: var(--dim);
  margin-top: 4px;
}

.mp-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 0.8rem;
}

.mp-control-btn {
  background: none;
  border: none;
  color: var(--gold);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 8px;
  transition: transform 0.15s ease;
}

.mp-control-btn:hover {
  transform: scale(1.2);
}

.mp-play-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--gold-dim);
  border: 1px solid var(--gold-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.mp-volume {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mp-volume span {
  font-size: 0.7rem;
  color: var(--dim);
}

.mp-volume input[type=range] {
  flex: 1;
  accent-color: var(--gold);
  height: 3px;
  cursor: pointer;
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(20px) translateZ(0);
  }
  to {
    opacity: 1;
    transform: translateY(0) translateZ(0);
  }
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(175, 138, 84, 0.2);
  }
  50% {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 30px rgba(175, 138, 84, 0.5);
  }
}

/* --- Particle Canvas --- */
#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.3;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-family: var(--font-display);
  background: linear-gradient(135deg, var(--gold), var(--rose), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.5rem);
  color: var(--text-primary);
  font-weight: 500;
}

h3 {
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  color: var(--text-primary);
  font-weight: 500;
}

p {
  font-size: clamp(0.95rem, 1.5vw, 1.1rem);
  color: var(--text-secondary);
  font-weight: 300;
}

/* --- Glass Card --- */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-card);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.glass-card:hover {
  background: var(--glass-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-4px) scale(1.01);
  box-shadow: var(--shadow-elevated), var(--shadow-glow);
}

.glass-card:hover::before {
  opacity: 1;
}

/* Card variants */
.glass-card-elevated {
  box-shadow: var(--shadow-elevated);
}

.glass-card-glow {
  box-shadow: var(--shadow-card), 0 0 30px rgba(212, 165, 116, 0.1);
}

.glass-card-interactive {
  cursor: pointer;
  user-select: none;
}

.glass-card-interactive:active {
  transform: translateY(-2px) scale(0.99);
}

/* --- Container --- */
.container {
  width: var(--container-width);
  margin: 0 auto;
  padding: 0 1rem;
}

/* --- Section --- */
.section {
  padding: var(--section-padding) 0;
  position: relative;
}

.section-title {
  text-align: center;
  padding: var(--space-10) var(--space-4) var(--space-8);
}

.section-title .sec-num {
  font-family: var(--font-display);
  font-size: 0.65rem;
  color: var(--gold);
  letter-spacing: 0.5em;
  display: block;
  margin-bottom: var(--space-2);
}

.section-title h2 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  margin-bottom: 0.5rem;
}

.section-title .subtitle {
  font-family: var(--font-handwriting);
  font-size: 1.3rem;
  color: var(--gold-light);
  opacity: 0.8;
}

/* --- Divider --- */
.divider {
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: var(--space-4) auto;
}

.divider-ornate {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: var(--space-6) auto;
}

.divider-ornate::before,
.divider-ornate::after {
  content: '';
  flex: 1;
  max-width: 100px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim));
}

.divider-ornate::after {
  background: linear-gradient(90deg, var(--gold-dim), transparent);
}

.divider-ornate-icon {
  font-size: 1.2rem;
  opacity: 0.6;
}

/* Decorative corners */
.corner-decoration {
  position: absolute;
  width: 60px;
  height: 60px;
  pointer-events: none;
  opacity: 0.3;
}

.corner-decoration.top-left {
  top: 0;
  left: 0;
  border-top: 2px solid var(--gold);
  border-left: 2px solid var(--gold);
}

.corner-decoration.top-right {
  top: 0;
  right: 0;
  border-top: 2px solid var(--gold);
  border-right: 2px solid var(--gold);
}

.corner-decoration.bottom-left {
  bottom: 0;
  left: 0;
  border-bottom: 2px solid var(--gold);
  border-left: 2px solid var(--gold);
}

.corner-decoration.bottom-right {
  bottom: 0;
  right: 0;
  border-bottom: 2px solid var(--gold);
  border-right: 2px solid var(--gold);
}

/* Glowing text effect */
.text-glow {
  text-shadow: 0 0 20px rgba(212, 165, 116, 0.5), 0 0 40px rgba(212, 165, 116, 0.3);
}

.text-glow-strong {
  text-shadow: 0 0 30px rgba(212, 165, 116, 0.7), 0 0 60px rgba(212, 165, 116, 0.5), 0 0 90px rgba(212, 165, 116, 0.3);
}

/* Gradient text */
.text-gradient {
  background: linear-gradient(135deg, var(--gold), var(--rose), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-gradient-soft {
  background: linear-gradient(135deg, var(--gold-light), var(--rose-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 2rem;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-normal);
  text-decoration: none;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::before {
  width: 300px;
  height: 300px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-rose), var(--accent-pink));
  color: white;
  box-shadow: 0 4px 20px rgba(232, 168, 124, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 40px rgba(232, 168, 124, 0.5);
}

.btn-primary:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: 0 4px 15px rgba(232, 168, 124, 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.btn-ghost:hover {
  background: var(--glass-hover);
  border-color: var(--accent-rose);
  color: var(--accent-rose);
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(232, 168, 124, 0.15);
}

.btn-ghost:active {
  transform: translateY(0);
}

.btn-icon {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: 50%;
}

.btn-icon:hover {
  transform: scale(1.1) rotate(5deg);
}

/* --- Navigation Bar (Hidden) --- */
.nav-bar {
  display: none !important;
}

/* --- iOS Tab Bar (Hidden) --- */
.tab-bar {
  display: none !important;
}

/* --- Floating Navigation Menu --- */
.floating-nav-container {
  position: fixed;
  bottom: 2rem;
  left: 1.5rem;
  z-index: 2000;
  transform: translateZ(0);
  animation: fadeIn 0.8s ease-out forwards;
}

.nav-menu-toggle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(26, 22, 18, 0.9);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transition: all var(--transition-normal);
  backdrop-filter: blur(10px);
}

.nav-menu-toggle:hover {
  transform: scale(1.1) translateY(-2px);
  border-color: var(--gold);
  box-shadow: 0 15px 40px rgba(175, 138, 84, 0.2);
}

.nav-menu-toggle.active {
  background: var(--gold);
  color: var(--bg-primary);
  transform: rotate(90deg);
}

/* --- Gallery & Masonry --- */
.gallery-grid {
  columns: 4 240px;
  column-gap: 1.5rem;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 1.5rem;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: all 0.5s var(--ease-out-expo);
  border: 1px solid var(--glass-border);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  background: var(--glass-bg);
}

.gallery-item:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--gold);
  box-shadow: 0 20px 50px rgba(175, 138, 84, 0.25);
  z-index: 10;
}

.gallery-item img, .gallery-item video {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.8s var(--ease-out-expo);
  filter: brightness(0.9);
}

.gallery-item:hover img, .gallery-item:hover video {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.gallery-item .badge {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  background: rgba(10, 9, 8, 0.7);
  backdrop-filter: blur(10px);
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.7rem;
  color: var(--gold-light);
  letter-spacing: 0.1em;
  z-index: 2;
  border: 1px solid var(--glass-border);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s ease;
}

.gallery-item:hover .badge {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 768px) {
  .gallery-grid {
    columns: 2 160px;
    column-gap: 1rem;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    columns: 2 140px;
    column-gap: 0.8rem;
    padding: 0 1rem;
  }
  .gallery-item {
    margin-bottom: 0.8rem;
  }
}

/* --- Background Music Player (Global) --- */
.bg-music-player {
  /* Fixed positioning removed - buttons are now independent FABs */
  display: none;
}

/* .music-btn removed - now uses .floating-music-btn */

@keyframes musicPulse {
  0% { box-shadow: 0 0 0 0 rgba(175, 138, 84, 0.4); }
  70% { box-shadow: 0 0 0 15px rgba(175, 138, 84, 0); }
  100% { box-shadow: 0 0 0 0 rgba(175, 138, 84, 0); }
}

/* Lightbox body lock - prevent background scroll */
body.lb-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
}

/* --- Scroll Animation --- */
.reveal {
  opacity: 0;
  transform: translateY(50px);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-60px);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}
.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(60px);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}
.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}
.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* 3D reveal effects */
.reveal-3d {
  opacity: 0;
  transform: translateY(60px) perspective(1000px) rotateX(-5deg);
  transition: opacity 0.8s var(--ease-out-expo), transform 0.8s var(--ease-out-expo);
}

.reveal-3d.visible {
  opacity: 1;
  transform: translateY(0) perspective(1000px) rotateX(0);
}

/* Stagger reveal from bottom */
.reveal-stagger {
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-out-expo);
}

.reveal-stagger.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* Staggered children */
.stagger-children > * {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-out-expo);
}
.stagger-children.visible > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.1s; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.15s; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.2s; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.25s; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.3s; }
.stagger-children.visible > *:nth-child(7) { transition-delay: 0.35s; }
.stagger-children.visible > *:nth-child(8) { transition-delay: 0.4s; }
.stagger-children.visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* --- Quote Bubble --- */
.quote-bubble {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 1.2rem 1.5rem;
  margin: 0.8rem 0;
  font-size: 0.95rem;
  line-height: 1.8;
}

.quote-bubble.left {
  border-left: 3px solid var(--accent-pink);
  margin-right: 2rem;
}

.quote-bubble.right {
  border-left: 3px solid var(--accent-gold);
  margin-left: 2rem;
}

.quote-bubble .speaker {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
  display: block;
}

.quote-bubble.left .speaker {
  color: var(--accent-pink);
}

.quote-bubble.right .speaker {
  color: var(--accent-gold);
}

/* --- Image Styles --- */
.img-rounded {
  border-radius: 16px;
  overflow: hidden;
}

.img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Lightbox --- */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
  display: flex;
  opacity: 1;
}

.lightbox-overlay img,
.lightbox-overlay video {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 1.5rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-nav.prev { left: 1.5rem; }
.lightbox-nav.next { right: 1.5rem; }

/* --- Floating Hearts Animation --- */
@keyframes floatHeart {
  0% {
    transform: translateY(100vh) rotate(0deg) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 0.6;
    transform: translateY(90vh) rotate(15deg) scale(1);
  }
  90% {
    opacity: 0.3;
  }
  100% {
    transform: translateY(-10vh) rotate(360deg) scale(0.5);
    opacity: 0;
  }
}

.floating-hearts-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.floating-heart {
  position: absolute;
  bottom: -20px;
  font-size: 1.2rem;
  animation: floatHeart linear infinite;
  opacity: 0;
}

/* --- Keyframe Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(232, 168, 124, 0.2); }
  50% { box-shadow: 0 0 40px rgba(232, 168, 124, 0.4); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes typewriter {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes slideInFromBottom {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.15); }
  28% { transform: scale(1); }
  42% { transform: scale(1.15); }
  70% { transform: scale(1); }
}

/* --- Music Player Bar (floating) --- */
.music-player-bar {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1.2rem;
  background: rgba(13, 6, 24, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  box-shadow: var(--shadow-soft);
  transition: all var(--transition-normal);
}

.music-player-bar:hover {
  background: rgba(26, 10, 46, 0.95);
}

.music-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--accent-rose), var(--accent-pink));
  color: white;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast);
}

.music-toggle-btn:hover {
  transform: scale(1.1);
}

.music-info {
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- Page Transition --- */
.page-enter {
  animation: fadeIn 0.6s var(--ease-out-expo);
}

.page-transition {
  position: relative;
}

.page-transition::before,
.page-transition::after {
  content: '';
  position: fixed;
  top: 0;
  width: 50%;
  height: 100%;
  background: var(--bg-primary);
  z-index: 9999;
  transition: transform 0.6s var(--ease-out-expo);
}

.page-transition::before {
  left: 0;
  transform: translateX(-100%);
}

.page-transition::after {
  right: 0;
  transform: translateX(100%);
}

.page-transition.active::before {
  transform: translateX(0);
}

.page-transition.active::after {
  transform: translateX(0);
}

/* Page loader */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-heart {
  font-size: 3rem;
  animation: heartbeat 1.5s ease-in-out infinite;
}

/* Smooth page scrolling indicator */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--rose), var(--gold));
  z-index: 10000;
  transition: width 0.1s linear;
}

/* --- Footer --- */
.site-footer {
  text-align: center;
  padding: 3rem 1rem;
  border-top: 1px solid var(--glass-border);
  margin-top: 4rem;
  margin-bottom: 80px; /* Space for tab bar */
}

.site-footer p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.site-footer .footer-heart {
  display: inline-block;
  color: var(--rose);
  animation: heartbeat 2s ease-in-out infinite;
}

/* Page body with tab bar spacing */
.page-body-tabbar {
  padding-bottom: 85px;
}

/* --- Loading Spinner --- */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--glass-border);
  border-top-color: var(--accent-rose);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 2rem auto;
}

/* --- Utility Classes --- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* --- Responsive Helpers --- */
@media (max-width: 768px) {
  :root {
    --section-padding: clamp(2rem, 6vw, 3.5rem);
    --radius-lg: 14px;
  }
  
  .glass-card {
    padding: 1.25rem;
  }
  
  .nav-bar {
    padding: 0.6rem 0;
  }
  
  .btn {
    padding: 0.65rem 1.4rem;
    font-size: 0.85rem;
  }
  
  .btn-icon {
    width: 40px;
    height: 40px;
  }
  
  /* Optimize tab bar for mobile */
  .tab-bar {
    height: 56px;
  }
  
  .tab-item {
    font-size: 0.5rem;
    gap: 2px;
  }
  
  .tab-item .tab-icon {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  :root {
    --section-padding: clamp(1.2rem, 4vw, 2.5rem);
    --radius-lg: 10px;
  }
  
  .glass-card {
    padding: 1rem;
  }
  
  .btn {
    padding: 0.55rem 1rem;
    font-size: 0.8rem;
  }
  
  .btn-icon {
    width: 36px;
    height: 36px;
  }
  
  .corner-decoration {
    width: 30px;
    height: 30px;
  }
  
  .text-glow-strong {
    text-shadow: 0 0 15px rgba(175, 138, 84, 0.5), 0 0 30px rgba(175, 138, 84, 0.3);
  }
  
  /* Enhance touch targets */
  .nav-links a,
  .tab-item {
    min-height: 40px;
  }
  
  .section-title {
    padding: var(--space-6) var(--space-4) var(--space-4);
  }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
  .btn:hover,
  .glass-card:hover,
  .nav-card:hover {
    transform: none;
  }
  
  .btn:active,
  .glass-card:active,
  .nav-card:active,
  .tab-item:active {
    transform: scale(0.96);
    transition-duration: 0.1s;
  }
  
  /* Enhance touch feedback */
  .btn:active::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: inherit;
  }
}

/* Landscape mode on mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: 3rem 1rem;
  }
  
  .hero-date-badge {
    font-size: clamp(3rem, 15vw, 6rem);
  }
  
  .section {
    padding: 2rem 0;
  }
}

/* Dark mode optimizations */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
  }
}

/* High contrast mode */
@media (prefers-contrast: high) {
  :root {
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-secondary: #e0e0e0;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal,
  .reveal-left,
  .reveal-right,
  .reveal-scale,
  .reveal-3d,
  .reveal-stagger {
    opacity: 1;
    transform: none;
  }

  .floating-heart,
  .floating-heart-enhanced,
  .cursor-heart {
    display: none;
  }

  .hero-carousel img {
    transition: none;
  }

  .bg-gradient {
    animation: none;
  }
}

/* --- Shared PIN / Numpad Styles (used by index.html & secret.html) --- */
.pin-dots {
  display: flex;
  gap: 14px;
  margin-bottom: 2rem;
}

.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  transition: all 0.3s var(--ease-spring);
}

.pin-dot.filled {
  background: var(--gold);
  box-shadow: 0 0 20px rgba(212, 165, 116, 0.6);
  animation: dotPulse 1.5s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 16px rgba(212, 165, 116, 0.5); }
  50% { box-shadow: 0 0 24px rgba(212, 165, 116, 0.8); }
}

.pin-dot.wrong {
  border-color: #e55;
  animation: pinShake 0.4s var(--ease-smooth);
}

@keyframes pinShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.numpad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 240px;
}

.numpad button {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--text-primary);
  border: 1px solid var(--glass-b);
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  cursor: pointer;
  transition: all 0.2s;
  justify-self: center;
}

.numpad button:active {
  background: linear-gradient(135deg, var(--gold), var(--bronze));
  border-color: var(--gold-light);
  transform: scale(0.92);
  box-shadow: 0 2px 12px rgba(175, 138, 84, 0.3);
}

.numpad .zero {
  grid-column: 2;
}

.numpad .del,
.numpad .enter {
  font-size: 1.2rem;
  color: var(--gold);
}

.numpad .enter {
  font-weight: bold;
}

@media (max-width: 480px) {
  .numpad { width: 200px; gap: 8px; }
  .numpad button { width: 56px; height: 56px; font-size: 1.1rem; }
  .pin-dots { gap: 10px; margin-bottom: 1.5rem; }
  .pin-dot { width: 12px; height: 12px; }
}

/* --- Touch Feedback --- */
.touch-active {
  opacity: 0.7;
  transform: scale(0.97);
  transition: opacity 0.1s, transform 0.1s;
}

/* --- Broken Image Fallback --- */
img.img-error {
  background: var(--bg-tertiary);
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-sm);
  min-height: 80px;
  display: block;
}

/* --- Secret Page: Authentication State --- */
body:not(.secret-unlocked) .secret-item img,
body:not(.secret-unlocked) .secret-item video {
  filter: brightness(0.3) blur(8px) !important;
  pointer-events: none;
}

body:not(.secret-unlocked) .lock-overlay {
  opacity: 1 !important;
}

body.secret-unlocked .lock-overlay {
  display: none !important;
}

/* --- 彩蛋入口：頁尾愛心 --- */
.footer-heart {
  display: inline-block;
  color: var(--rose);
  animation: heartbeat 2s ease-in-out infinite;
  cursor: pointer;
  padding: 8px 10px;        /* 擴大觸控範圍 */
  margin: -8px -10px;       /* 視覺不偏移 */
  border-radius: 50%;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.3s var(--ease-spring), filter 0.3s ease;
  position: relative;
}

.footer-heart.egg-charging {
  transform: scale(1.6);
  filter: drop-shadow(0 0 12px rgba(212, 165, 116, 0.9));
  animation: heartbeat 0.5s ease-in-out infinite;
}

/* 彩蛋觸發全屏提示 */
#eggOverlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}

#eggOverlay.show {
  opacity: 1;
  pointer-events: auto;
}

.egg-heart {
  font-size: 4rem;
  animation: heartbeat 0.8s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(255, 107, 157, 0.6));
}

.egg-text {
  font-family: var(--font-handwriting);
  color: var(--gold);
  font-size: 1.6rem;
  text-align: center;
}

.egg-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.2em;
}

/* 提示文字：非常低調 */
.footer-easter-hint {
  display: block;
  font-size: 0.5rem;
  color: var(--dim);
  opacity: 0.4;
  letter-spacing: 0.25em;
  margin-top: 0.6rem;
  user-select: none;
  -webkit-user-select: none;
}

/* --- 全站手機觸控優化 --- */
button, a, [role="button"] {
  -webkit-tap-highlight-color: transparent;
}

/* 防止 iOS 雙擊縮放影響互動元素 */
.numpad button,
.filter-btn,
.pb-ctrls span,
.nav-menu-toggle,
.music-btn {
  touch-action: manipulation;
}

/* 手機上：確保浮動導覽選單不超出螢幕 */
@media (max-width: 480px) {
  .floating-nav-links {
    min-width: 150px;
    padding: 0.8rem;
    gap: 0.25rem;
  }

  .floating-nav-links a {
    font-size: 0.85rem;
    padding: 0.7rem 0.8rem;
    gap: 0.6rem;
  }

  /* 播放器欄在手機上稍微往下移，避免遮擋內容 */
  .player-bar {
    bottom: 80px;
  }

  /* 字尾提示在極小螢幕也能看到 */
  .footer-easter-hint {
    font-size: 0.48rem;
  }
}

/* --- Wax Seal --- */
.wax-seal {
  width: 80px;
  height: 80px;
  background: radial-gradient(circle at 40% 35%, #b22222, #6b0f0f);
  border-radius: 50%;
  margin: 3.5rem auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  cursor: pointer;
  transition: all 0.3s var(--ease-spring);
  -webkit-tap-highlight-color: transparent;
}

.wax-seal:active, .wax-seal.pressing {
  transform: scale(0.85) translateY(2px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.wax-seal-icon {
  color: #f5e6d0;
  font-size: 1.3rem;
  line-height: 1;
  pointer-events: none;
}

.wax-seal-text {
  color: rgba(245, 230, 208, 0.75);
  font-size: 0.38rem;
  letter-spacing: 0.1em;
  margin-top: 3px;
  font-family: var(--font-display);
  pointer-events: none;
}

.seal-fingerprint {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: repeating-radial-gradient(circle at 50% 50%, transparent 0px, transparent 2px, rgba(245,230,208,0.08) 2.5px, transparent 3px);
  opacity: 0;
  transition: opacity 0.8s ease;
  pointer-events: none;
}

.wax-seal.signed .seal-fingerprint {
  opacity: 1;
}

/* Floating text from seal */
.floating-seal-text {
  position: absolute;
  transform: translateX(-50%);
  color: var(--gold);
  font-family: var(--font-handwriting);
  font-size: 1.2rem;
  pointer-events: none;
  z-index: 100;
  animation: sealTextFlow 3s var(--ease-out-expo) forwards;
  text-shadow: 0 0 10px rgba(175, 138, 84, 0.3);
  white-space: nowrap;
}

@keyframes sealTextFlow {
  0% { transform: translate(-50%, 0); opacity: 0; filter: blur(10px); }
  10% { opacity: 1; filter: blur(0); }
  100% { transform: translate(-50%, -100px); opacity: 0; }
}

.seal-ripple {
  position: absolute;
  inset: -15px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  opacity: 0;
  pointer-events: none;
}

.wax-seal.pressing .seal-ripple {
  animation: sealRipple 0.8s ease-out;
}

@keyframes sealRipple {
  0% { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* Note card for letter page */
.note-card {
  max-width: 500px;
  margin: 3rem auto;
  padding: 2rem 2.5rem;
  background: rgba(253, 252, 248, 0.03);
  border: 1px solid var(--gold-dim);
  border-radius: 12px;
  text-align: center;
  position: relative;
}

.note-card::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 20%;
  right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.note-card p {
  font-family: var(--font-handwriting);
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 2.2;
  margin: 0;
}

.note-card .note-title {
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  color: var(--gold);
  margin-bottom: 1rem;
  text-transform: uppercase;
}


/* ═══════════════════════════════════════════════════════
   CINEMATIC FILM LAYER — 參考即將到來頁面風格
   ═══════════════════════════════════════════════════════ */

/* ── Body Cinematic Class ── */
body.cinematic .letterbox-top,
body.cinematic .letterbox-bot {
  height: 0;
  transition: height 1.4s cubic-bezier(.7,0,.3,1);
}
body.cinematic.active .letterbox-top,
body.cinematic.active .letterbox-bot {
  height: 8vh;
}

/* ── Film Grain (animated) ── */
.grain {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: .04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-size: 256px 256px;
  animation: grain-shift 0.08s steps(1) infinite;
}
@keyframes grain-shift {
  0%   { background-position: 0 0; }
  10%  { background-position: -5% -10%; }
  20%  { background-position: -15% 5%; }
  30%  { background-position: 7% -25%; }
  40%  { background-position: -5% 25%; }
  50%  { background-position: -15% 10%; }
  60%  { background-position: 15% 0%; }
  70%  { background-position: 0 15%; }
  80%  { background-position: 3% 35%; }
  90%  { background-position: -10% 10%; }
}

/* ── Letterbox Bars ── */
.letterbox-top,
.letterbox-bot {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 90;
  background: #000;
  height: 0;
  transition: height 1.4s cubic-bezier(.7,0,.3,1);
  pointer-events: none;
}
.letterbox-top { top: 0; }
.letterbox-bot { bottom: 0; }
body.cinematic .letterbox-top,
body.cinematic .letterbox-bot {
  height: 0; /* 默认无黑边，用户可js切换 */
}

/* ── Vignette ── */
.vignette {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: radial-gradient(
    ellipse 80% 80% at 50% 50%,
    transparent 35%,
    rgba(0,0,0,.65) 100%
  );
}

/* ── Scan Lines ── */
.scanline {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0,0,0,.04) 2px,
    rgba(0,0,0,.04) 4px
  );
}

/* ── Ambient Lights ── */
.light {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 1;
}
.light-gold {
  width: 60vw;
  height: 60vw;
  max-width: 500px;
  max-height: 500px;
  background: radial-gradient(circle, rgba(200,168,124,.07) 0%, transparent 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%,-60%);
  animation: light-breathe 8s ease-in-out infinite;
}
.light-rose {
  width: 40vw;
  height: 40vw;
  max-width: 320px;
  max-height: 320px;
  background: radial-gradient(circle, rgba(184,107,122,.06) 0%, transparent 70%);
  bottom: 10%;
  right: -5%;
  animation: light-breathe 11s ease-in-out infinite reverse;
}
@keyframes light-breathe {
  0%,100% { opacity: .6; transform: translate(-50%,-60%) scale(1); }
  50%      { opacity: 1;   transform: translate(-50%,-60%) scale(1.15); }
}

/* ── Hero Vignette Layer ── */
.hero-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: radial-gradient(
    ellipse 70% 70% at 50% 50%,
    transparent 30%,
    rgba(0,0,0,.5) 100%
  );
  pointer-events: none;
}

/* ── Hero Quote Divider ── */
.hero-quote-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1.2rem auto;
  width: min(240px, 50vw);
  opacity: 0;
  animation: fadeIn .6s ease 1.4s forwards;
}
.hero-quote-divider span {
  display: block;
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, rgba(200,168,124,.3));
}
.hero-quote-divider span:last-child {
  background: linear-gradient(90deg, rgba(200,168,124,.3), transparent);
}
.hero-quote-divider span:nth-child(2) {
  width: 5px;
  height: 5px;
  background: var(--gold);
  transform: rotate(45deg);
  flex: 0;
  opacity: .5;
}

/* ── Flash Intro ── */
.flash {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: #fff;
  animation: flash-out .6s .4s cubic-bezier(.7,0,1,1) forwards;
  pointer-events: none;
}
@keyframes flash-out {
  from { opacity: .12; }
  to   { opacity: 0; pointer-events: none; }
}

/* ── Cinematic Countdown (override existing) ── */
.countdown-hero {
  opacity: 0;
  animation: reveal-up .8s 1.8s cubic-bezier(.16,1,.3,1) forwards;
  text-align: center;
  margin-top: 3.5rem;
}

.counter-row {
  display: flex;
  justify-content: center;
  gap: 0;
}

.counter-box {
  background: rgba(4, 4, 10, 0.6);
  border: 1px solid rgba(200,168,124,.1);
  padding: 1.2rem 0.8rem;
  min-width: 80px;
  position: relative;
  backdrop-filter: blur(10px);
}

.counter-box::before {
  content: '';
  position: absolute;
  top: -1px; left: -1px;
  width: 10px; height: 10px;
  border-top: 1px solid var(--gold);
  border-left: 1px solid var(--gold);
}

.counter-box::after {
  content: '';
  position: absolute;
  bottom: -1px; right: -1px;
  width: 10px; height: 10px;
  border-bottom: 1px solid var(--gold);
  border-right: 1px solid var(--gold);
}

.counter-num {
  font-family: var(--font-display);
  font-size: 2rem;
  color: var(--gold-light);
  text-shadow: 0 0 15px rgba(229,193,133,.4);
  display: block;
  line-height: 1;
}

.counter-label {
  font-size: .6rem;
  color: rgba(200,168,124,.5);
  letter-spacing: .4em;
  text-transform: uppercase;
  margin-top: 8px;
  display: block;
}

/* ── Cinematic Hero ── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
  background: var(--bg-primary);
  padding: 2rem 1rem;
}

.hero-bg-slider {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(4,4,10,.2) 0%, rgba(4,4,10,.65) 100%);
  z-index: 1;
}

.hero-date-badge {
  font-family: var(--font-display);
  font-size: clamp(5rem, 25vw, 13rem);
  font-weight: 700;
  line-height: 1;
  color: var(--gold-light);
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 50%, var(--bronze) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  opacity: 0;
  animation: reveal-up 1.8s var(--ease-out-expo) forwards;
  filter: drop-shadow(0 0 30px rgba(175, 138, 84, .6));
  margin-bottom: 0.5rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 5vw, 2.5rem);
  color: var(--gold);
  letter-spacing: .5em;
  margin-bottom: 2rem;
  opacity: 0;
  animation: reveal-up 1.5s var(--ease-out-expo) .6s forwards;
  text-shadow: 0 0 20px rgba(175, 138, 84, .4);
}

.hero-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(.9rem, 2vw, 1.1rem);
  color: var(--gold-light);
  line-height: 2.2;
  padding: 1.5rem 2rem;
  border-top: 1px solid rgba(200,168,124,.2);
  border-bottom: 1px solid rgba(200,168,124,.2);
  background: rgba(4,4,10,.4);
  backdrop-filter: blur(8px);
  opacity: 0;
  animation: reveal-up 1.5s ease 1.2s forwards;
  max-width: 500px;
  margin: 0 auto;
  text-shadow: 0 0 8px rgba(175, 138, 84, .25);
}

.hero-scroll-hint {
  margin-top: 3rem;
  opacity: 0;
  animation: fadeIn 1s ease 2.5s forwards;
}

.scroll-arrow {
  display: inline-block;
  animation: bounceDown 2s ease-in-out infinite;
  font-size: 1.6rem;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(175, 138, 84, .5);
}

@keyframes bounceDown {
  0%,100% { transform: translateY(0); opacity: 1; }
  50%      { transform: translateY(10px); opacity: .6; }
}

/* ── Background Gradient Update ── */
.bg-gradient {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background:
    radial-gradient(ellipse 80% 50% at 20% 20%, rgba(184,107,122,.08) 0%, transparent 50%),
    radial-gradient(ellipse 80% 50% at 80% 80%, rgba(200,168,124,.06) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 50% 0%,  rgba(184,107,122,.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(4,4,10,.7) 0%, transparent 80%),
    linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  z-index: -3;
  animation: gradientShift 20s ease-in-out infinite alternate;
}

/* ── Section Title Cinematic ── */
.section-title {
  text-align: center;
  padding: var(--space-10) var(--space-4) var(--space-8);
}
.section-title .sec-num {
  font-family: var(--font-display);
  font-size: .6rem;
  color: rgba(200,168,124,.4);
  letter-spacing: .7em;
  display: block;
  margin-bottom: var(--space-2);
  text-transform: uppercase;
}
.section-title h2 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 400;
  letter-spacing: .2em;
  color: var(--gold-light);
  margin-bottom: .4rem;
}
.section-title .subtitle {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.1rem;
  color: rgba(200,168,124,.45);
}

/* ── Photo Strip Cinematic ── */
.photo-strip-wrapper {
  position: relative;
  overflow: hidden;
  padding: 2.5rem 2rem;
  background: linear-gradient(180deg, transparent, rgba(200,168,124,.04), transparent);
}
.photo-strip-wrapper::before,
.photo-strip-wrapper::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  height: 24px;
  background-color: var(--bg-primary);
  background-image:
    repeating-linear-gradient(90deg,
      transparent 0, transparent 8px,
      var(--gold) 8px, var(--gold) 10px,
      transparent 10px, transparent 12px,
      transparent 20px, transparent 22px,
      var(--gold) 22px, var(--gold) 24px,
      transparent 24px, transparent 36px
    );
  z-index: 3;
  opacity: .4;
}
.photo-strip-wrapper::before { top: 0; }
.photo-strip-wrapper::after  { bottom: 0; }

/* ── Nav Cards Cinematic ── */
.nav-card {
  display: block;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 4 / 3;
  border: 1px solid rgba(200,168,124,.08);
  transition: all .4s ease;
}
.nav-card:hover {
  transform: translateY(-4px);
  border-color: rgba(200,168,124,.25);
  box-shadow: 0 12px 40px rgba(0,0,0,.5), 0 0 20px rgba(200,168,124,.1);
}
.nav-card-bg img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(.55) sepia(.1);
  transition: filter .5s ease;
}
.nav-card:hover .nav-card-bg img { filter: brightness(.7) sepia(.05); }

/* ── Footer Cinematic ── */
.site-footer {
  text-align: center;
  padding: 3rem 1rem;
  border-top: 1px solid rgba(200,168,124,.06);
  margin-top: 4rem;
  margin-bottom: 2rem;
}
.site-footer p {
  font-size: .75rem;
  color: rgba(200,168,124,.35);
  letter-spacing: .15em;
}
.footer-heart {
  display: inline-block;
  color: var(--rose);
  animation: heartbeat 2.8s ease-in-out infinite;
}
@keyframes heartbeat {
  0%,100% { transform: scale(1); }
  14%      { transform: scale(1.3); }
  28%      { transform: scale(1); }
  42%      { transform: scale(1.15); }
  56%      { transform: scale(1); }
}

/* ── Reveal Animations ── */
@keyframes reveal-up {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Letterbox Toggle (optional JS) ── */
body.letterbox-on .letterbox-top,
body.letterbox-on .letterbox-bot {
  height: 8vh;
}



/* ══════════════════════════════════════════════════════════════
   CHAPTER INDEX / NAV PANEL — 側邊滑入面板
   ══════════════════════════════════════════════════════════════ */

/* ── FAB 按鈕 ── */
.ch-idx-btn {
  position: fixed;
  z-index: 1000;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(10, 9, 8, 0.92);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  right: 20px;
  top: 50%;
  transform: translateY(-50%) translateY(44px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.4), 0 0 20px rgba(175, 138, 84, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.3s ease;
  animation: floatIn 0.6s var(--ease-out-expo) 0.4s both;
}

.ch-idx-btn:hover {
  transform: translateY(-50%) scale(1.15);
  background: rgba(175, 138, 84, 0.15);
  border-color: var(--gold);
  box-shadow: 0 6px 12px rgba(0,0,0,0.5), 0 0 25px rgba(175, 138, 84, 0.3);
  color: var(--gold-light);
}

.ch-idx-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.ch-idx-btn.active {
  background: rgba(175, 138, 84, 0.2);
  border-color: var(--gold);
  color: var(--gold-light);
  transform: translateY(-50%) scale(1.05);
}

/* ── 面板本體 ── */
.ch-idx-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(320px, 88vw);
  height: 100%;
  background: rgba(10, 9, 8, 0.97);
  border-left: 1px solid var(--gold-dim);
  z-index: 999;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
}

.ch-idx-panel.show {
  transform: translateX(0);
}

/* ── 面板 Header ── */
.ch-idx-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 1.4rem;
  border-bottom: 1px solid var(--gold-dim);
  flex-shrink: 0;
}

.ch-idx-header span {
  font-family: var(--font-display);
  font-size: .7rem;
  letter-spacing: .4em;
  color: var(--gold);
  text-transform: uppercase;
}

.ch-idx-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(175, 138, 84, 0.1);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  font-size: .75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s ease;
}

.ch-idx-close:hover {
  background: rgba(175, 138, 84, 0.2);
  border-color: var(--gold);
  color: var(--gold-light);
  transform: rotate(90deg);
}

/* ── 列表 ── */
.ch-idx-list {
  flex: 1;
  overflow-y: auto;
  padding: .8rem 0;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-dim) transparent;
}

.ch-idx-list::-webkit-scrollbar { width: 3px; }
.ch-idx-list::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 2px; }

/* ── 項目 ── */
.ch-idx-item {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .85rem 1.4rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: .88rem;
  font-family: var(--font-sans);
  letter-spacing: .05em;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: all .2s ease;
  border-left: 2px solid transparent;
}

.ch-idx-item:hover {
  background: rgba(175, 138, 84, 0.08);
  color: var(--gold-light);
  border-left-color: var(--gold);
}

.ch-idx-item.active {
  background: rgba(175, 138, 84, 0.12);
  color: var(--gold-light);
  border-left-color: var(--gold);
}

.ch-idx-item.active .idx-dot {
  background: var(--gold);
  box-shadow: 0 0 8px rgba(175, 138, 84, 0.6);
}

/* ── 項目左側圓點 ── */
.idx-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: 1px solid var(--gold);
  flex-shrink: 0;
  transition: all .2s ease;
}

.ch-idx-item:hover .idx-dot {
  background: rgba(175, 138, 84, 0.4);
}

/* ── 項目文字 ── */
.idx-label {
  flex: 1;
}

