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

:root {
    --primary-color: #ff6b8b;
    --secondary-color: #ff9aa2;
    --accent-color: #ffb3ba;
    --text-color: #333;
    --light-text: #fff;
    --bg-color: #fff5f7;
    --card-bg: #ffffff;
    --shadow: 0 10px 30px rgba(255, 107, 139, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Noto Serif SC', serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden;
}

.container {
    width: 100%;
    min-height: 100vh;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    transition: var(--transition);
}

.nav-logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.heart-icon {
    color: var(--primary-color);
    margin-right: 0.5rem;
    animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    20% { transform: scale(1.1); }
    40% { transform: scale(1); }
    60% { transform: scale(1.1); }
    80% { transform: scale(1); }
    100% { transform: scale(1); }
}

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

.nav-item {
    margin-left: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    position: relative;
    transition: var(--transition);
}

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

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

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 3px 0;
    transition: var(--transition);
}

/* 主页部分样式 */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: linear-gradient(135deg, #fff5f7 0%, #ffccd5 100%);
    position: relative;
    overflow: hidden;
}

.hero-content {
    z-index: 2;
    max-width: 800px;
    padding: 0 20px;
}

.hero-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    animation: fadeInDown 1s ease-out;
}

.hero-subtitle {
    font-size: 1.8rem;
    margin-bottom: 2rem;
    color: var(--secondary-color);
    animation: fadeInUp 1s ease-out 0.3s both;
}

.date-counter {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease-out 0.6s both;
}

.counter-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 1rem;
    padding: 1rem;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    box-shadow: var(--shadow);
    min-width: 100px;
}

.counter-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.counter-label {
    font-size: 0.9rem;
    color: var(--text-color);
}

.hero-quote {
    font-size: 1.2rem;
    font-style: italic;
    margin-bottom: 2rem;
    color: var(--text-color);
    animation: fadeInUp 1s ease-out 0.9s both;
}

.btn-primary {
    display: inline-block;
    padding: 12px 30px;
    background-color: var(--primary-color);
    color: var(--light-text);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: 0 5px 15px rgba(255, 107, 139, 0.3);
    animation: fadeInUp 1s ease-out 1.2s both;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 107, 139, 0.4);
}

.hearts-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
    overflow: hidden;
}

.heart {
    position: absolute;
    font-size: 30px;
    color: rgba(255, 107, 139, 0.4);
    animation: float 6s infinite ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
}

.heart-1 {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.heart-2 {
    top: 30%;
    right: 15%;
    animation-delay: 1s;
}

.heart-3 {
    bottom: 20%;
    left: 20%;
    animation-delay: 2s;
}

.heart-4 {
    bottom: 30%;
    right: 10%;
    animation-delay: 3s;
}

.heart-5 {
    top: 50%;
    left: 50%;
    animation-delay: 4s;
}

.heart-6 {
    top: 15%;
    left: 30%;
    animation-delay: 1.5s;
}

.heart-7 {
    top: 60%;
    right: 25%;
    animation-delay: 2.5s;
}

.heart-8 {
    bottom: 15%;
    left: 40%;
    animation-delay: 3.5s;
}

@keyframes float {
    0% {
        transform: translateY(0);
        opacity: 0.3;
    }
    25% {
        transform: translateY(-10px);
        opacity: 0.5;
    }
    50% {
        transform: translateY(-20px);
        opacity: 0.7;
    }
    75% {
        transform: translateY(-10px);
        opacity: 0.5;
    }
    100% {
        transform: translateY(0);
        opacity: 0.3;
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 通用部分样式 */
.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.section-header p {
    font-size: 1.2rem;
    color: var(--secondary-color);
    max-width: 600px;
    margin: 0 auto;
}

/* 时光轴部分样式 */
.timeline-section {
    padding: 100px 5%;
    background-color: var(--bg-color);
}

.timeline {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background-color: var(--primary-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 50px;
    width: 50%;
    padding: 0 40px;
}

.timeline-item:nth-child(odd) {
    left: 0;
    text-align: right;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-icon {
    position: absolute;
    top: 0;
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--light-text);
    z-index: 2;
}

.timeline-item:nth-child(odd) .timeline-icon {
    right: -20px;
}

.timeline-item:nth-child(even) .timeline-icon {
    left: -20px;
}

.timeline-content {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(255, 107, 139, 0.15);
}

.timeline-content h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.timeline-date {
    display: inline-block;
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    padding: 3px 10px;
    background-color: rgba(255, 154, 162, 0.1);
    border-radius: 20px;
}

.timeline-content p {
    color: var(--text-color);
}

/* 相册部分样式 */
.gallery-section {
    padding: 100px 5%;
    background-color: #fff;
}

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

.gallery-item {
    background-color: var(--card-bg);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(255, 107, 139, 0.2);
}

.gallery-img {
    height: 250px;
    overflow: hidden;
}

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

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

.gallery-caption {
    padding: 20px;
}

.gallery-caption h4 {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.gallery-caption p {
    color: var(--text-color);
    font-style: italic;
}

/* 情书部分样式 */
.letter-section {
    padding: 100px 5%;
    background-color: var(--bg-color);
}

.letter-container {
    max-width: 800px;
    margin: 0 auto;
}

.letter-paper {
    background-color: var(--card-bg);
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    position: relative;
    background-image: linear-gradient(transparent 24px, #e8e8e8 25px);
    background-size: 100% 25px;
    line-height: 25px;
}

.letter-paper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 30px;
    width: 2px;
    height: 100%;
    background-color: rgba(255, 107, 139, 0.3);
}

.letter-header {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    font-weight: 700;
}

.letter-content {
    margin-bottom: 30px;
}

.letter-content p {
    margin-bottom: 20px;
    text-indent: 2em;
}

.letter-footer {
    text-align: right;
    color: var(--text-color);
}

.letter-footer span {
    display: block;
    margin-bottom: 5px;
}

/* 祝福部分样式 */
.wishes-section {
    padding: 100px 5%;
    background-color: #fff;
}

.wishes-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto 50px;
}

.wish-card {
    display: flex;
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.wish-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(255, 107, 139, 0.15);
}

.wish-avatar {
    width: 50px;
    height: 50px;
    background-color: var(--accent-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--primary-color);
    margin-right: 15px;
    flex-shrink: 0;
}

.wish-content h4 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.wish-content p {
    color: var(--text-color);
}

.add-wish {
    text-align: center;
}

.btn-secondary {
    display: inline-block;
    padding: 12px 30px;
    background-color: transparent;
    color: var(--primary-color);
    text-decoration: none;
    border: 2px solid var(--primary-color);
    border-radius: 50px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: var(--light-text);
}

/* 页脚样式 */
.footer {
    background-color: var(--primary-color);
    color: var(--light-text);
    padding: 50px 5%;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.footer-logo .heart-icon {
    color: var(--light-text);
    margin-right: 0.5rem;
}

.footer-text {
    margin-bottom: 20px;
}

.footer-text p {
    margin-bottom: 5px;
}

.footer-social {
    display: flex;
    gap: 20px;
}

.social-link {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--light-text);
    transition: var(--transition);
}

.social-link:hover {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

/* 弹窗样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: auto;
}

.modal-content {
    background-color: var(--card-bg);
    margin: 10% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: modalFadeIn 0.5s;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-color);
}

.close:hover {
    color: var(--primary-color);
}

.modal h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
}

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

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

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

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    /* 导航栏优化 */
    .navbar {
        padding: 0.5rem 5%;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 60px;
        flex-direction: column;
        background-color: rgba(255, 255, 255, 0.98);
        width: 100%;
        text-align: center;
        transition: var(--transition);
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.1);
        padding: 30px 0;
        z-index: 100;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-item {
        margin: 15px 0;
    }

    .nav-link {
        font-size: 1.2rem;
        padding: 10px 0;
    }

    .hamburger {
        display: flex;
        z-index: 101;
    }

    .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 {
        padding: 60px 0;
        height: auto;
        min-height: 100vh;
    }

    .hero-content {
        padding: 0 15px;
    }

    .hero-title {
        font-size: 2.8rem;
        margin-bottom: 1.5rem;
    }

    .hero-subtitle {
        font-size: 1.5rem;
        margin-bottom: 2.5rem;
    }

    .date-counter {
        flex-wrap: wrap;
        gap: 1rem;
        margin-bottom: 2.5rem;
    }

    .counter-item {
        margin: 0.5rem;
        min-width: 70px;
        padding: 0.8rem;
    }

    .counter-number {
        font-size: 1.8rem;
    }

    .counter-label {
        font-size: 0.8rem;
    }

    .hero-quote {
        font-size: 1.1rem;
        margin-bottom: 2.5rem;
        padding: 0 10px;
    }

    .btn-primary {
        padding: 15px 35px;
        font-size: 1.1rem;
    }

    /* 爱心图案优化 */
    .heart {
        font-size: 24px;
    }

    /* 时间轴优化 */
    .timeline-section {
        padding: 80px 5%;
    }

    .timeline::before {
        left: 30px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 20px;
        text-align: left;
        margin-bottom: 40px;
    }

    .timeline-item:nth-child(even) {
        left: 0;
    }

    .timeline-icon {
        left: 10px !important;
        width: 40px;
        height: 40px;
    }

    .timeline-content {
        padding: 20px;
    }

    .timeline-content h3 {
        font-size: 1.5rem;
    }

    .timeline-date {
        font-size: 0.9rem;
    }

    .section-header {
        margin-bottom: 2.5rem;
    }

    .section-header h2 {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }

    .section-header p {
        font-size: 1.1rem;
    }

    /* 页脚优化 */
    .footer {
        padding: 30px 0;
    }

    .footer-content {
        flex-direction: column;
        gap: 15px;
    }

    .footer-logo {
        font-size: 1.1rem;
    }

    .footer-text p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    /* 导航栏进一步优化 */
    .navbar {
        padding: 0.3rem 5%;
    }
    
    .nav-menu {
        top: 50px;
    }
    
    .nav-link {
        font-size: 1.1rem;
    }
    
    /* 主页部分进一步优化 */
    .hero {
        padding: 40px 0;
    }
    
    .hero-content {
        padding: 0 10px;
    }

    .hero-title {
        font-size: 2.2rem;
        margin-bottom: 1.2rem;
    }

    .hero-subtitle {
        font-size: 1.3rem;
        margin-bottom: 2rem;
    }

    .date-counter {
        gap: 0.5rem;
        margin-bottom: 2rem;
    }

    .counter-item {
        min-width: 60px;
        padding: 0.6rem;
    }

    .counter-number {
        font-size: 1.5rem;
    }

    .counter-label {
        font-size: 0.7rem;
    }

    .hero-quote {
        font-size: 1rem;
        margin-bottom: 2rem;
        padding: 0 5px;
    }

    .btn-primary {
        padding: 12px 25px;
        font-size: 1rem;
    }
    
    /* 爱心图案进一步优化 */
    .heart {
        font-size: 20px;
    }

    /* 时间轴进一步优化 */
    .timeline-section {
        padding: 60px 5%;
    }

    .section-header {
        margin-bottom: 2rem;
    }

    .section-header h2 {
        font-size: 2rem;
        margin-bottom: 0.8rem;
    }

    .section-header p {
        font-size: 1rem;
    }
    
    .timeline-item {
        margin-bottom: 30px;
    }
    
    .timeline-content {
        padding: 15px;
    }
    
    .timeline-content h3 {
        font-size: 1.3rem;
    }
    
    .timeline-date {
        font-size: 0.8rem;
    }
    
    .timeline-content p {
        font-size: 0.9rem;
    }

    /* 页脚进一步优化 */
    .footer {
        padding: 20px 0;
    }

    .footer-logo {
        font-size: 1rem;
    }

    .footer-text p {
        font-size: 0.8rem;
    }
}

/* 横屏模式优化 */
@media (max-height: 500px) and (orientation: landscape) {
    .navbar {
        padding: 0.3rem 5%;
    }
    
    .hero {
        min-height: 100vh;
        padding: 40px 0;
    }
    
    .hero-content {
        padding: 0 15px;
    }
    
    .hero-title {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1.4rem;
        margin-bottom: 1.5rem;
    }
    
    .date-counter {
        margin-bottom: 1.5rem;
    }
    
    .counter-item {
        min-width: 60px;
        padding: 0.5rem;
    }
    
    .counter-number {
        font-size: 1.5rem;
    }
    
    .counter-label {
        font-size: 0.7rem;
    }
    
    .hero-quote {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .btn-primary {
        padding: 10px 25px;
        font-size: 1rem;
    }
    
    .timeline-section {
        padding: 40px 5%;
    }
    
    .section-header {
        margin-bottom: 1.5rem;
    }
    
    .section-header h2 {
        font-size: 2rem;
        margin-bottom: 0.5rem;
    }
    
    .section-header p {
        font-size: 1rem;
    }
    
    .timeline-item {
        margin-bottom: 25px;
    }
    
    .timeline-content {
        padding: 15px;
    }
    
    .timeline-content h3 {
        font-size: 1.3rem;
    }
    
    .timeline-content p {
        font-size: 0.9rem;
    }
    
    .footer {
        padding: 15px 0;
    }
}