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

/* 根变量 */
:root {
    --primary-color: #e83e8c;
    --secondary-color: #6c757d;
    --accent-color: #ffc107;
    --text-color: #333;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --white: #ffffff;
    --font-main: 'Noto Serif SC', serif;
    --font-heading: 'Ma Shan Zheng', cursive;
    --transition: all 0.3s ease;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* 基础样式 */
body {
    font-family: var(--font-main);
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--light-color);
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    margin-bottom: 1rem;
    line-height: 1.2;
}

h1 {
    font-size: 3rem;
    color: var(--primary-color);
}

h2 {
    font-size: 2.5rem;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 1rem;
    text-align: center;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 3px;
}

h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
}

p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: #c2185b;
}

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

/* 容器 */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 按钮 */
.btn-primary {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 12px 30px;
    border: none;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background-color: #c2185b;
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    color: var(--white);
}

/* 导航栏 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: transparent;
    z-index: 1000;
    transition: var(--transition);
    padding: 20px 0;
}

.navbar.scrolled {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow);
    padding: 15px 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    color: var(--white);
    font-weight: bold;
    transition: var(--transition);
}

.navbar.scrolled .logo {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 5px 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--white);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

.navbar.scrolled .nav-links a {
    color: var(--text-color);
}

.navbar.scrolled .nav-links a::after {
    background-color: var(--primary-color);
}

.navbar.scrolled .nav-links a:hover {
    color: var(--primary-color);
}

/* 汉堡菜单 */
.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--white);
    transition: var(--transition);
}

.navbar.scrolled .bar {
    background-color: var(--text-color);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.active .bar:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* 英雄区域 */
.hero {
    height: 100vh;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('https://picsum.photos/id/1059/1920/1080') center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    position: relative;
}

.hero-content {
    max-width: 800px;
    padding: 20px;
    animation: fadeIn 1.5s ease-in-out;
}

.couple-names {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem 0;
    font-size: 2.5rem;
    font-family: var(--font-heading);
}

.bride,
.groom {
    font-size: 2.8rem;
    color: var(--white);
}

.ampersand {
    margin: 0 1.5rem;
    color: var(--accent-color);
    font-size: 2.5rem;
}

.hero .date {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    color: var(--light-color);
}

/* 我们的故事 */
.story {
    padding: 8rem 0;
    background: linear-gradient(135deg, #fff5f7 0%, #fff0f3 100%);
    position: relative;
    overflow: hidden;
}

/* 背景装饰 */
.story::before {
    content: '❤';
    position: absolute;
    color: rgba(232, 62, 140, 0.05);
    font-size: 15rem;
    top: -5rem;
    left: -5rem;
    z-index: 0;
}

.story::after {
    content: '❤';
    position: absolute;
    color: rgba(232, 62, 140, 0.05);
    font-size: 10rem;
    bottom: -3rem;
    right: -3rem;
    z-index: 0;
}

.story .container {
    position: relative;
    z-index: 1;
}

.story h2 {
    color: #c2185b;
    position: relative;
}

.story h2::after {
    background: linear-gradient(90deg, #e83e8c, #ff80ab);
    width: 120px;
}

.story-content {
    margin-top: 3rem;
}

.story-timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

/* 浪漫时间线样式 */
.story-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #e83e8c, #ff80ab);
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(232, 62, 140, 0.3);
}

/* 点缀的小爱心 */
.story-timeline::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle, rgba(232, 62, 140, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

.timeline-item {
    margin-bottom: 4rem;
    position: relative;
    display: flex;
    align-items: center;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease-out forwards;
}

/* 延迟动画 */
.timeline-item:nth-child(1) { animation-delay: 0.2s; }
.timeline-item:nth-child(2) { animation-delay: 0.4s; }
.timeline-item:nth-child(3) { animation-delay: 0.6s; }
.timeline-item:nth-child(4) { animation-delay: 0.8s; }

.timeline-item:nth-child(odd) {
    flex-direction: row-reverse;
}

.timeline-date {
    flex: 0 0 150px;
    text-align: center;
    font-weight: bold;
    font-size: 1.3rem;
    color: #c2185b;
    font-family: var(--font-heading);
    position: relative;
}

/* 日期装饰 */
.timeline-date::after {
    content: '♡';
    position: absolute;
    color: rgba(232, 62, 140, 0.5);
    font-size: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.timeline-item:nth-child(odd) .timeline-date::after {
    left: -20px;
}

.timeline-item:nth-child(even) .timeline-date::after {
    right: -20px;
}

.timeline-content {
    flex: 1;
    background-color: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    margin: 0 2rem;
    position: relative;
    transition: var(--transition);
    border: 1px solid rgba(232, 62, 140, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* 时间线图标样式 */
.timeline-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, #e83e8c, #ff80ab);
    color: white;
    border-radius: 50%;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 5px 15px rgba(232, 62, 140, 0.3);
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.timeline-icon::before {
    content: '';
    position: absolute;
    top: 5px;
    left: 5px;
    right: 5px;
    bottom: 5px;
    background-color: white;
    border-radius: 50%;
    z-index: -1;
}

.timeline-icon i {
    z-index: 2;
    animation: floatHeart 2s ease-in-out infinite;
}

.timeline-content:hover .timeline-icon {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(232, 62, 140, 0.5);
}

/* 为不同图标设置不同的动画延迟 */
.timeline-item:nth-child(1) .timeline-icon i {
    animation-delay: 0.1s;
}

.timeline-item:nth-child(2) .timeline-icon i {
    animation-delay: 0.2s;
}

.timeline-item:nth-child(3) .timeline-icon i {
    animation-delay: 0.3s;
}

.timeline-item:nth-child(4) .timeline-icon i {
    animation-delay: 0.4s;
}

/* 内容卡片装饰 */
.timeline-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #e83e8c, #ff80ab);
}

.timeline-content::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 24px;
    height: 24px;
    background-color: var(--white);
    border: 4px solid #e83e8c;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(232, 62, 140, 0.3);
    transition: all 0.3s ease;
}

.timeline-item:nth-child(odd) .timeline-content::after {
    left: -12px;
    transform: translateY(-50%);
}

.timeline-item:nth-child(even) .timeline-content::after {
    right: -12px;
    transform: translateY(-50%);
}

/* 悬停效果 */
.timeline-content:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    border-color: rgba(232, 62, 140, 0.4);
}

.timeline-content:hover::after {
    transform: translateY(-50%) scale(1.2);
    box-shadow: 0 0 15px rgba(232, 62, 140, 0.5);
}

.timeline-content h3 {
    color: #c2185b;
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.timeline-content h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 60px;
    height: 2px;
    background-color: #ff80ab;
}

.timeline-content p {
    color: #666;
    line-height: 1.8;
    font-size: 1.05rem;
}

/* 小爱心动画 */
@keyframes floatHeart {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-10px) rotate(5deg);
        opacity: 1;
    }
}

/* 新增动画 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 婚礼详情 */
.details {
    padding: 8rem 0;
    background-color: #f8f0f4;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.detail-item {
    background-color: var(--white);
    padding: 2.5rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.detail-item:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.detail-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: 50%;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

/* 照片集 */
.gallery {
    padding: 8rem 0;
    background-color: var(--white);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 400px;
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* 回复 */
.rsvp {
    padding: 8rem 0;
    background: linear-gradient(rgba(232, 62, 140, 0.1), rgba(232, 62, 140, 0.1)), url('https://picsum.photos/id/1025/1920/1080') center/cover no-repeat fixed;
}

.rsvp-form {
    max-width: 700px;
    margin: 3rem auto;
    background-color: var(--white);
    padding: 3rem;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
}

.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(232, 62, 140, 0.1);
}

.radio-group {
    display: flex;
    gap: 2rem;
}

.radio-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.radio-group input[type="radio"] {
    width: auto;
    margin-right: 8px;
}

.rsvp-form button {
    width: 100%;
    margin-top: 1rem;
}

/* 页脚 */
.footer {
    background-color: var(--dark-color);
    color: var(--white);
    padding: 3rem 0;
    text-align: center;
}

.footer-content {
    max-width: 600px;
    margin: 0 auto;
}

.social-links {
    margin: 1.5rem 0;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border-radius: 50%;
    margin: 0 10px;
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow);
    z-index: 99;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background-color: #c2185b;
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

/* 动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 992px) {
    h1 {
        font-size: 2.5rem;
    }
    
    h2 {
        font-size: 2rem;
    }
    
    .couple-names {
        flex-direction: column;
    }
    
    .ampersand {
        margin: 1rem 0;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--white);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow);
        padding: 2rem 0;
    }
    
    .nav-links.active {
        left: 0;
    }
    
    .nav-links li {
        margin: 1.5rem 0;
    }
    
    .nav-links a {
        color: var(--text-color);
    }
    
    .hamburger {
        display: block;
    }
    
    .story-timeline::before {
        left: 20px;
    }
    
    .timeline-item {
        flex-direction: column !important;
        align-items: flex-start;
    }
    
    .timeline-date {
        flex: none;
        text-align: left;
        margin-left: 50px;
        margin-bottom: 1rem;
    }
    
    .timeline-content {
        margin-left: 50px;
        margin-right: 0;
    }
    
    .timeline-content::before {
        left: -10px !important;
    }
    
    .details-grid {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .radio-group {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 576px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    .bride,
    .groom {
        font-size: 2.2rem;
    }
    
    .btn-primary {
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    .rsvp-form {
        padding: 2rem;
    }
}

/* 加载动画 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease-out;
}

.loading.fade {
    opacity: 0;
    pointer-events: none;
}