/* 主样式文件 - 页面布局和特效 */

/* ================================
   全局样式
================================ */

body {
  font-family: var(--font-secondary);
  line-height: var(--leading-relaxed);
  color: var(--text-primary);
  background: var(--background);
  overflow-x: hidden;
}

.main-container {
  position: relative;
}

/* ================================
   加载动画
================================ */

.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--gradient-romantic);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: var(--z-system);
  transition: opacity 1s ease, visibility 1s ease;
}

.loading-container {
  text-align: center;
  color: white;
}

.loading-rings {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 2rem;
}

.ring {
  position: absolute;
  border: 3px solid transparent;
  border-top: 3px solid rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  animation: spin 2s linear infinite;
}

.ring-1 {
  width: 120px;
  height: 120px;
  animation-duration: 2s;
}

.ring-2 {
  width: 90px;
  height: 90px;
  top: 15px;
  left: 15px;
  animation-duration: 1.5s;
  animation-direction: reverse;
}

.ring-3 {
  width: 60px;
  height: 60px;
  top: 30px;
  left: 30px;
  animation-duration: 1s;
}

.loading-text {
  font-size: var(--text-lg);
  margin-bottom: 2rem;
  opacity: 0.9;
  font-weight: var(--fw-medium);
}

.loading-progress {
  width: 250px;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  overflow: hidden;
  margin: 0 auto;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, white, rgba(255, 255, 255, 0.8));
  border-radius: 2px;
  transition: width 0.3s ease;
  width: 0%;
}

.loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
}

/* ================================
   粒子背景系统
================================ */

.particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: var(--z-behind);
}

/* ================================
   英雄区域
================================ */

.hero-section {
  min-height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--gradient-hero);
}

/* 视差背景 */
.parallax-bg {
  position: absolute;
  top: -10%;
  left: -10%;
  width: 120%;
  height: 120%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  will-change: transform;
}

.parallax-bg.layer1 {
  z-index: 1;
  opacity: 0.7;
}

.parallax-bg.layer2 {
  z-index: 2;
  opacity: 0.4;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(232, 113, 113, 0.1) 0%,
    rgba(244, 170, 185, 0.2) 50%,
    rgba(229, 157, 57, 0.1) 100%
  );
  z-index: 3;
}

.hero-content {
  position: relative;
  z-index: 4;
  text-align: center;
  color: white;
  max-width: 800px;
  padding: 0 var(--space-4);
}

.hero-title-container {
  margin-bottom: var(--space-12);
}

.hero-title {
  font-size: var(--text-6xl);
  font-weight: var(--fw-black);
  margin-bottom: var(--space-6);
  line-height: var(--leading-tight);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.groom-name,
.bride-name {
  display: inline-block;
  animation: slideInUp 1s ease-out;
}

.bride-name {
  animation-delay: 0.3s;
}

.heart-symbol {
  margin: 0 var(--space-4);
  color: var(--accent);
  animation: heartbeat 2s ease-in-out infinite;
  animation-delay: 0.6s;
}

/* 文本旋转器 */
.hero-subtitle-rotator {
  font-size: var(--text-xl);
  font-family: var(--font-secondary);
  font-weight: var(--fw-medium);
  color: rgba(255, 255, 255, 0.9);
  height: 2.5rem; /* Tweak based on line-height and font-size */
  position: relative;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
}

.rotator-track {
  display: block;
  animation: textRotate 12s cubic-bezier(0.7, 0, 0.3, 1) infinite;
}

.rotator-item {
  display: block;
  line-height: 2.5rem; /* Should match the container height */
  padding-bottom: 0.5rem;
}

/* 日期徽章 */
.hero-date-container {
  margin-bottom: var(--space-12);
}

.save-date-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  padding: var(--space-6) var(--space-8);
  border-radius: var(--radius-2xl);
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: scaleIn 1s ease-out 0.8s both;
}

.save-the-date {
  display: block;
  font-family: var(--font-script);
  font-size: var(--text-lg);
  color: var(--accent);
  margin-bottom: var(--space-2);
}

.wedding-date {
  display: block;
  font-size: var(--text-2xl);
  font-weight: var(--fw-bold);
  margin-bottom: var(--space-1);
}

.wedding-time {
  display: block;
  font-size: var(--text-base);
  opacity: 0.9;
}

/* CTA按钮 */
.hero-cta {
  animation: fadeIn 1s ease-out 1.2s both;
}

/* 滚动指示器 */
.scroll-indicator {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: rgba(255, 255, 255, 0.8);
  z-index: 4;
  animation: fadeIn 1s ease-out 1.5s both;
}

.scroll-mouse {
  width: 30px;
  height: 50px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 15px;
  margin: 0 auto var(--space-3);
  position: relative;
}

.scroll-wheel {
  width: 4px;
  height: 8px;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 2px;
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  animation: scrollBounce 2s ease-in-out infinite;
}

.scroll-text {
  font-size: var(--text-sm);
  margin-bottom: var(--space-2);
  opacity: 0.8;
}

.scroll-arrow {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 10px solid rgba(255, 255, 255, 0.6);
  margin: 0 auto;
  animation: scrollArrow 2s ease-in-out infinite;
}

/* ================================
   通用区域样式
================================ */

section {
  padding: var(--space-32) 0;
  position: relative;
}

section:nth-child(even) {
  background: var(--surface-elevated);
}

/* ================================
   新人介绍区
================================ */

.couple-section {
  background: linear-gradient(135deg, var(--cream-50) 0%, var(--rose-50) 100%);
}

.couple-cards {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-12);
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
}

.couple-card {
  animation: fadeIn 0.8s ease-out;
}

.groom-card {
  animation-delay: 0.2s;
}

.bride-card {
  animation-delay: 0.6s;
}

/* 连接动画 */
.couple-connection {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  animation: fadeIn 0.8s ease-out 0.4s both;
}

.connection-line {
  width: 2px;
  height: 60px;
  background: linear-gradient(to bottom, var(--primary), var(--accent));
  position: relative;
}

.pulsing-orb {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 15px;
  height: 15px;
  background-color: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
  animation: pulseOrb 2s infinite cubic-bezier(0.66, 0, 0, 1);
}

.connection-text {
  margin-top: var(--space-4);
}

.ampersand {
  font-family: var(--font-script);
  font-size: var(--text-4xl);
  color: var(--primary);
  font-weight: var(--fw-bold);
}

/* ================================
   爱情故事区
================================ */

.love-story-section {
  background: var(--surface);
  position: relative;
}

.love-story-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="hearts" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><text x="10" y="15" font-size="10" text-anchor="middle" fill="rgba(232,113,113,0.05)">💕</text></pattern></defs><rect width="100" height="100" fill="url(%23hearts)"/></svg>');
  opacity: 0.5;
  pointer-events: none;
}

/* ================================
   婚礼详情区
================================ */

.wedding-details-section {
  background: linear-gradient(135deg, var(--gold-50) 0%, var(--cream-100) 100%);
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-8);
}

.detail-card {
  animation: slideInUp 0.8s ease-out;
  animation-fill-mode: both;
}

.time-card {
  animation-delay: 0.1s;
}

.location-card {
  animation-delay: 0.2s;
}

.dresscode-card {
  animation-delay: 0.3s;
}

.special-card {
  animation-delay: 0.4s;
}

/* 详情卡片特殊样式 */
.detail-date {
  font-size: var(--text-xl);
  font-weight: var(--fw-bold);
  color: var(--primary);
  margin-bottom: var(--space-2);
}

.detail-time {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

.venue-name {
  font-size: var(--text-lg);
  font-weight: var(--fw-semibold);
  color: var(--primary);
  margin-bottom: var(--space-2);
}

.venue-address {
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

.location-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.dresscode-item,
.special-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.dresscode-icon,
.special-icon {
  font-size: var(--text-lg);
}

/* ================================
   照片画廊区
================================ */

.photo-gallery-section {
  background: var(--surface);
  position: relative;
}

.gallery-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* 生活照片轮播 */
.life-photos-carousel {
  margin-top: var(--space-20);
}

.carousel-title {
  text-align: center;
  font-size: var(--text-2xl);
  margin-bottom: var(--space-8);
  color: var(--text-primary);
}

.carousel-container {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.carousel-track {
  display: flex;
  transition: transform var(--duration-slower) var(--ease-elegant);
  position: relative;
  width: 100%;
}

.carousel-slide {
  min-width: 100%;
  position: relative;
}

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

.carousel-btn {
  display: none !important;
}

.carousel-prev,
.carousel-next {
  display: none !important;
}



.carousel-dots {
  display: flex;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4);
  background: rgba(255, 255, 255, 0.9);
}

.carousel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--neutral-400);
  cursor: pointer;
  transition: background var(--duration-normal) var(--ease-elegant);
}

.carousel-dot.active {
  background: var(--primary);
}

/* ================================
   邀请函区
================================ */

.invitation-section {
  background: linear-gradient(135deg, var(--cream-100) 0%, var(--rose-50) 100%);
  padding: var(--space-32) 0;
}

.invitation-card {
  max-width: 600px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--radius-2xl);
  padding: var(--space-12);
  box-shadow: var(--shadow-2xl);
  position: relative;
  border: 1px solid var(--gold-200);
  animation: scaleIn 0.8s ease-out;
}

.invitation-border {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  right: var(--space-4);
  bottom: var(--space-4);
  border: 2px solid var(--gold-300);
  border-radius: var(--radius-xl);
  pointer-events: none;
}

.invitation-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.invitation-title {
  font-size: var(--text-3xl);
  color: var(--primary);
  margin-bottom: var(--space-4);
}

.invitation-ornament {
  font-size: var(--text-2xl);
  animation: float 3s ease-in-out infinite;
}

.invitation-content {
  line-height: var(--leading-loose);
  margin-bottom: var(--space-8);
  text-align: center;
}

.invitation-greeting {
  font-size: var(--text-lg);
  font-weight: var(--fw-medium);
  margin-bottom: var(--space-4);
  color: var(--primary);
}

.invitation-text {
  margin-bottom: var(--space-4);
  color: var(--text-secondary);
}

.invitation-signature {
  text-align: center;
}

.signature-closing,
.signature-respect {
  margin-bottom: var(--space-2);
  color: var(--text-secondary);
}

.signature-names {
  margin: var(--space-4) 0;
}

.signature-name {
  font-size: var(--text-xl);
  font-weight: var(--fw-semibold);
  color: var(--primary);
}

.signature-separator {
  margin: 0 var(--space-3);
  font-family: var(--font-script);
  color: var(--accent);
}

.signature-date {
  color: var(--text-tertiary);
  font-size: var(--text-sm);
  margin-top: var(--space-4);
}

.invitation-stamp {
  position: absolute;
  top: var(--space-8);
  right: var(--space-8);
  width: 60px;
  height: 60px;
  background: var(--gradient-romantic);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  animation: pulseGlow 2s ease-in-out infinite;
}

.stamp-content {
  color: white;
  font-size: var(--text-xl);
}

/* ================================
   联系信息区
================================ */

.contact-section {
  background: var(--surface);
}

.rsvp-section {
  text-align: center;
  margin-top: var(--space-4);
}

/* ================================
   感谢页面
================================ */

.thank-you-section {
  background: var(--gradient-hero);
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.thank-you-content {
  position: relative;
  z-index: 2;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.thank-you-animation {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  z-index: 1;
}

.floating-hearts-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.floating-heart {
  position: absolute;
  font-size: var(--text-2xl);
  animation: float 6s ease-in-out infinite;
  opacity: 0.1;
}

.floating-heart:nth-child(1) {
  top: 10%;
  left: 10%;
  animation-delay: 0s;
}

.floating-heart:nth-child(2) {
  top: 20%;
  right: 15%;
  animation-delay: 1s;
}

.floating-heart:nth-child(3) {
  top: 60%;
  left: 20%;
  animation-delay: 2s;
}

.floating-heart:nth-child(4) {
  bottom: 30%;
  right: 10%;
  animation-delay: 3s;
}

.floating-heart:nth-child(5) {
  bottom: 10%;
  left: 50%;
  animation-delay: 4s;
}

.thank-you-title {
  font-size: var(--text-5xl);
  margin-bottom: var(--space-8);
  font-weight: var(--fw-black);
  animation: scaleIn 0.8s ease-out;
}

.thank-you-messages {
  margin-bottom: var(--space-12);
}

.thank-you-text {
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
  opacity: 0.9;
  animation: slideInUp 0.8s ease-out;
}

.main-message {
  font-size: var(--text-xl);
  font-weight: var(--fw-semibold);
  animation-delay: 0.2s;
}

.thank-you-text:nth-child(2) {
  animation-delay: 0.4s;
}

.thank-you-text:nth-child(3) {
  animation-delay: 0.6s;
}

.heart-beat-container {
  margin-bottom: var(--space-12);
}

.heart-beat-animation {
  font-size: var(--text-6xl);
  animation: heartbeat 2s ease-in-out infinite;
  display: inline-block;
}

.social-actions {
  margin-bottom: var(--space-12);
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: center;
}

.final-blessing {
  margin-top: var(--space-8);
}

.blessing-text {
  font-family: var(--font-script);
  font-size: var(--text-2xl);
  opacity: 0.8;
  animation: neonGlow 3s ease-in-out infinite alternate;
}

/* ================================
   滚动动画触发器
================================ */

.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: all var(--duration-leisurely) var(--ease-elegant);
}

.scroll-animate.animate {
  opacity: 1;
  transform: translateY(0);
}

.scroll-animate-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: all var(--duration-leisurely) var(--ease-elegant);
}

.scroll-animate-left.animate {
  opacity: 1;
  transform: translateX(0);
}

.scroll-animate-right {
  opacity: 0;
  transform: translateX(30px);
  transition: all var(--duration-leisurely) var(--ease-elegant);
}

.scroll-animate-right.animate {
  opacity: 1;
  transform: translateX(0);
}

/* ================================
   文字揭示效果
================================ */

.text-reveal .char {
  display: inline-block;
  opacity: 0;
  animation: textReveal 0.8s var(--ease-back) forwards;
}

/* Staggered animation delays */
.groom-name .char:nth-child(1) { animation-delay: 0.1s; }
.groom-name .char:nth-child(2) { animation-delay: 0.2s; }
.groom-name .char:nth-child(3) { animation-delay: 0.3s; }

.bride-name .char:nth-child(1) { animation-delay: 0.5s; }
.bride-name .char:nth-child(2) { animation-delay: 0.6s; }
.bride-name .char:nth-child(3) { animation-delay: 0.7s; }

/* ================================
   特殊效果
================================ */

/* GPU 加速 */
.gpu-accelerated {
  will-change: transform;
  transform: translateZ(0);
}

/* 背景模糊效果 */
.backdrop-blur {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* 图片滤镜增强 */
.image-enhanced {
  filter: brightness(1.1) contrast(1.05) saturate(1.1);
  transition: filter var(--duration-normal) var(--ease-elegant);
}

/* 悬浮提升效果 */
.hover-lift {
  transition: transform var(--duration-normal) var(--ease-elegant);
}

.hover-lift:hover {
  transform: translateY(-4px);
}

/* 脉冲效果 */
.pulse {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.05);
  }
}

/* ================================
   无障碍支持
================================ */

/* 高对比度模式 */
@media (prefers-contrast: high) {
  .hero-title,
  .section-title {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
  }
  
  .card-front,
  .card-back,
  .detail-card {
    border: 2px solid var(--text-primary);
  }
}

/* 减少透明度 */
@media (prefers-reduced-transparency) {
  .hero-overlay,
  .modal-overlay,
  .navigation {
    backdrop-filter: none;
    background: var(--surface);
  }
}