/* ========================================
   全局样式和重置
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #d4a373;
    --secondary-color: #8b7355;
    --text-dark: #333;
    --text-light: #666;
    --bg-light: #faf8f5;
    --white: #ffffff;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

html {
    scroll-behavior: auto; /* GSAP控制滚动，禁用浏览器smooth */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overscroll-behavior: none; /* 禁用弹性滚动 */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
    color: var(--text-dark);
    background-color: var(--bg-light);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========================================
   音乐控制按钮 - 固定定位
   ======================================== */
.music-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    /* GPU加速 */
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
    backdrop-filter: blur(10px);
}

.music-btn:hover {
    transform: translateZ(0) scale(1.1);
    background: rgba(0, 0, 0, 0.95);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.music-btn img {
    width: 38px;
    height: 38px;
}

.music-btn.playing img {
    animation: rotate 2s linear infinite;
}

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

/* ========================================
   主容器
   ======================================== */
.main-container {
    max-width: 100%;
    margin: 0 auto;
    /* GPU加速容器 */
    transform: translateZ(0);
    will-change: scroll-position;
}

/* ========================================
   通用样式
   ======================================== */
.section-title {
    font-size: 32px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-dark);
    position: relative;
    /* GPU加速 */
    transform: translateZ(0);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%) translateZ(0);
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* ========================================
   1. 英雄区域
   ======================================== */
.hero-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-light) 0%, #f0ebe5 100%);
    /* GPU加速 */
    transform: translateZ(0);
    will-change: transform;
}

.hero-content {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.hero-image {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: var(--shadow);
    /* GPU加速 */
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

.hero-overlay {
    position: absolute;
    bottom: 40px;
    left: 20px;
    right: 20px;
    text-align: center;
    color: var(--white);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.couple-names {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 10px;
}

.wedding-date {
    font-size: 18px;
    font-weight: 300;
    letter-spacing: 2px;
}

/* ========================================
   2. 新郎新娘介绍
   ======================================== */
.couple-intro {
    padding: 80px 20px;
    background: var(--white);
    /* GPU加速 */
    transform: translateZ(0);
}

.couple-cards {
    display: flex;
    gap: 40px;
    max-width: 800px;
    margin: 0 auto;
    flex-wrap: wrap;
    justify-content: center;
}

.couple-card {
    flex: 1;
    min-width: 250px;
    text-align: center;
    padding: 30px;
    background: var(--bg-light);
    border-radius: 15px;
    /* GPU加速 */
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

.couple-avatar {
    width: 150px;
    height: 150px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    border: 5px solid var(--primary-color);
    /* GPU加速 */
    transform: translateZ(0);
}

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

.couple-card h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--text-dark);
}

.couple-intro-text {
    color: var(--text-light);
    font-size: 14px;
}

/* ========================================
   3. 照片网格
   ======================================== */
.photo-grid-section {
    padding: 80px 20px;
    background: var(--bg-light);
    /* GPU加速 */
    transform: translateZ(0);
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.photo-item {
    position: relative;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: var(--shadow);
    /* GPU加速 - 关键！ */
    transform: translateZ(0);
    will-change: transform, opacity;
    backface-visibility: hidden;
    /* 初始状态：隐藏 */
    opacity: 0;
}

/* 左侧滑入 */
.photo-item[data-direction="left"] {
    transform: translate3d(-100px, 0, 0);
}

/* 右侧滑入 */
.photo-item[data-direction="right"] {
    transform: translate3d(100px, 0, 0);
}

/* 动画激活状态 */
.photo-item.active {
    opacity: 1;
    transform: translate3d(0, 0, 0) !important;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* GPU加速 */
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* ========================================
   4. 倒计时
   ======================================== */
.countdown-section {
    padding: 80px 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    /* GPU加速 */
    transform: translateZ(0);
}

.countdown-section .section-title {
    color: var(--white);
}

.countdown-section .section-title::after {
    background: var(--white);
}

.countdown {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    /* GPU加速 */
    transform: translateZ(0);
}

.countdown-value {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 10px;
}

.countdown-label {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

/* ========================================
   5. 婚礼信息
   ======================================== */
.wedding-info {
    padding: 80px 20px;
    background: var(--white);
    /* GPU加速 */
    transform: translateZ(0);
}

.info-cards {
    display: flex;
    gap: 40px;
    max-width: 900px;
    margin: 0 auto;
    flex-wrap: wrap;
    justify-content: center;
}

.info-card {
    flex: 1;
    min-width: 280px;
    padding: 40px 30px;
    background: var(--bg-light);
    border-radius: 15px;
    box-shadow: var(--shadow);
    text-align: center;
    /* GPU加速 */
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

.info-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.info-card h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.info-card p {
    color: var(--text-light);
    font-size: 16px;
    line-height: 1.8;
}

/* ========================================
   6. RSVP表单
   ======================================== */
.rsvp-section {
    padding: 80px 20px;
    background: var(--bg-light);
    /* GPU加速 */
    transform: translateZ(0);
}

.rsvp-form {
    max-width: 500px;
    margin: 0 auto 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    /* GPU加速 */
    transform: translateZ(0);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(212, 163, 115, 0.1);
}

.form-group textarea {
    resize: vertical;
}

.submit-btn {
    width: 100%;
    padding: 15px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    /* GPU加速 */
    transform: translateZ(0);
    will-change: transform;
}

.submit-btn:hover {
    background: var(--secondary-color);
    transform: translateZ(0) translateY(-2px);
}

.submit-btn:active {
    transform: translateZ(0) translateY(0);
}

.rsvp-count {
    text-align: center;
    font-size: 16px;
    color: var(--text-light);
}

.rsvp-count span {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 20px;
}

/* ========================================
   7. 感谢区域
   ======================================== */
.thank-you-section {
    padding: 100px 20px;
    background: var(--white);
    text-align: center;
    /* GPU加速 */
    transform: translateZ(0);
}

.thank-you-section h2 {
    font-size: 36px;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.thank-you-section p {
    font-size: 18px;
    color: var(--text-light);
    margin-bottom: 30px;
}

.heart-icon {
    font-size: 60px;
}

/* ========================================
   响应式设计 - 平板
   ======================================== */
@media (max-width: 768px) {
    .section-title {
        font-size: 28px;
    }
    
    .couple-names {
        font-size: 32px;
    }
    
    .wedding-date {
        font-size: 16px;
    }
    
    .photo-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .countdown-value {
        font-size: 36px;
    }
}

/* ========================================
   响应式设计 - 手机
   ======================================== */
@media (max-width: 480px) {
    .section-title {
        font-size: 24px;
        margin-bottom: 30px;
    }
    
    .couple-names {
        font-size: 28px;
    }
    
    .wedding-date {
        font-size: 14px;
    }
    
    .music-btn {
        width: 45px;
        height: 45px;
        top: 15px;
        right: 15px;
    }
    
    .music-btn img {
        width: 34px;
        height: 34px;
    }
    
    .photo-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .countdown-value {
        font-size: 32px;
    }
    
    .countdown-label {
        font-size: 12px;
    }
    
    .thank-you-section h2 {
        font-size: 28px;
    }
}
