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

:root {
    --primary-pink: #FFB6C1;
    --light-pink: #FFC0CB;
    --gold: #FFD700;
    --white: #FFFFFF;
    --dark-gray: #333333;
    --light-gray: #F5F5F5;
}

body {
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
    color: var(--dark-gray);
    overflow-x: hidden;
    background: linear-gradient(135deg, #FFE5E5 0%, #FFF5F5 100%);
}

/* Canvas 背景 */
#particles-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

/* 密码页面样式 */
.password-content {
    text-align: center;
    padding: 3rem;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(255, 182, 193, 0.3);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 3;
}

.password-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

.password-title {
    font-size: 2.5rem;
    color: var(--primary-pink);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.password-hint {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
}

.password-input-wrapper {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}

.password-input {
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
    border: 2px solid var(--light-pink);
    border-radius: 50px;
    outline: none;
    transition: all 0.3s ease;
    width: 250px;
    text-align: center;
}

.password-input:focus {
    border-color: var(--primary-pink);
    box-shadow: 0 0 15px rgba(255, 182, 193, 0.4);
}

.password-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.password-error {
    color: #ff4757;
    font-size: 1rem;
    min-height: 1.5rem;
    margin-bottom: 0.5rem;
}

.password-tip {
    color: #999;
    font-size: 0.9rem;
    font-style: italic;
}

/* 页面区块 */
.section {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s ease;
    z-index: 2;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem;
}

.section.active {
    opacity: 1;
    visibility: visible;
}

/* 首页样式 */
.home-content {
    text-align: center;
    padding: 2rem;
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 600px;
}

.home-title {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--dark-gray);
    font-weight: 300;
    letter-spacing: 0.1em;
}

.highlight {
    color: var(--primary-pink);
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(255, 182, 193, 0.3);
}

.home-subtitle {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 3rem;
    font-weight: 300;
    line-height: 1.6;
}

/* 淡入动画 */
.fade-in {
    animation: fadeIn 1.5s ease-in;
}

.fade-in-delay {
    animation: fadeIn 1.5s ease-in 0.5s both;
}

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

/* 按钮样式 */
.btn {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    letter-spacing: 0.05em;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-pink) 0%, var(--light-pink) 100%);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(255, 182, 193, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 182, 193, 0.6);
}

.btn-primary:active {
    transform: translateY(-1px);
}

/* 脉冲动画 */
.pulse {
    animation: pulse 2s infinite;
}

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

/* 表白页面样式 */
.confession-content {
    max-width: 800px;
    padding: 2rem;
    text-align: center;
    position: relative;
    z-index: 3;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: var(--dark-gray);
    font-weight: 300;
}

.typewriter-container {
    background: rgba(255, 255, 255, 0.8);
    padding: 2rem;
    border-radius: 20px;
    margin-bottom: 3rem;
    box-shadow: 0 8px 32px rgba(255, 182, 193, 0.2);
    backdrop-filter: blur(10px);
}

.typewriter-text {
    font-size: 1.2rem;
    line-height: 2;
    color: var(--dark-gray);
    text-align: left;
    min-height: 200px;
    font-family: 'KaiTi', 'STKaiti', serif;
}

.cursor {
    display: inline-block;
    font-size: 1.2rem;
    color: var(--primary-pink);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0;
    }
}

/* 照片展示 */
.photos-container {
    margin-bottom: 2rem;
}

.photos-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--dark-gray);
    font-weight: 400;
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.photo-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.photo-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 8px 25px rgba(255, 182, 193, 0.4);
}

.photo-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    border-radius: 15px 15px 0 0;
}

.photo-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--light-pink) 0%, var(--primary-pink) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--white);
}

.photo-placeholder span {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.photo-placeholder p {
    font-size: 0.9rem;
    opacity: 0.9;
}

.photo-caption {
    padding: 0.8rem;
    text-align: center;
    color: var(--dark-gray);
    font-size: 0.95rem;
    font-style: italic;
    background: var(--white);
}

/* 时间线样式 */
.timeline-content {
    max-width: 900px;
    padding: 2rem;
    position: relative;
    z-index: 3;
}

.timeline {
    position: relative;
    margin: 3rem 0;
    padding: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--primary-pink), var(--light-pink));
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    width: 50%;
    padding: 1rem 2rem;
    margin-bottom: 2rem;
}

.timeline-item.left {
    left: 0;
    text-align: right;
    padding-right: 3rem;
}

.timeline-item.right {
    left: 50%;
    text-align: left;
    padding-left: 3rem;
}

.timeline-dot {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--gold);
    border: 4px solid var(--white);
    border-radius: 50%;
    top: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.timeline-item.left .timeline-dot {
    right: -10px;
}

.timeline-item.right .timeline-dot {
    left: -10px;
}

.timeline-card {
    background: rgba(255, 255, 255, 0.9);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.timeline-card h3 {
    color: var(--primary-pink);
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.timeline-card p {
    color: #666;
    line-height: 1.6;
}

/* 最终表白页面 */
.final-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

#heart-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.final-text {
    text-align: center;
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.85);
    padding: 3rem;
    border-radius: 30px;
    box-shadow: 0 8px 32px rgba(255, 182, 193, 0.3);
    backdrop-filter: blur(10px);
    margin-bottom: 2rem;
}

.final-title {
    font-size: 3.5rem;
    color: var(--primary-pink);
    margin-bottom: 1rem;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(255, 182, 193, 0.3);
}

.final-subtitle {
    font-size: 2.5rem;
    color: var(--dark-gray);
    margin-bottom: 1.5rem;
    font-weight: 300;
}

.final-message {
    font-size: 1.3rem;
    line-height: 2;
    color: #555;
    margin-bottom: 1.5rem;
    font-family: 'KaiTi', 'STKaiti', serif;
}

.final-signature {
    font-size: 1.1rem;
    color: var(--primary-pink);
    font-style: italic;
}

.button-container {
    display: flex;
    gap: 2rem;
    position: relative;
    z-index: 2;
}

.btn-yes {
    background: linear-gradient(135deg, var(--primary-pink) 0%, #FF69B4 100%);
    color: var(--white);
    padding: 1.2rem 3rem;
    font-size: 1.3rem;
    box-shadow: 0 6px 20px rgba(255, 105, 180, 0.4);
}

.btn-yes:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(255, 105, 180, 0.6);
}

.btn-no {
    background: #E0E0E0;
    color: #999;
    padding: 1.2rem 3rem;
    font-size: 1.3rem;
    transition: all 0.3s ease;
}

/* 庆祝页面 */
.celebrate-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

#celebrate-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.celebrate-text {
    text-align: center;
    position: relative;
    z-index: 2;
    background: rgba(255, 255, 255, 0.9);
    padding: 3rem;
    border-radius: 30px;
    box-shadow: 0 8px 32px rgba(255, 182, 193, 0.4);
    backdrop-filter: blur(10px);
}

.celebrate-title {
    font-size: 3rem;
    color: var(--primary-pink);
    margin-bottom: 1rem;
    animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.1);
    }
    50% {
        transform: scale(1);
    }
}

.celebrate-subtitle {
    font-size: 2.5rem;
    color: var(--dark-gray);
    margin-bottom: 1.5rem;
    font-weight: 300;
}

.celebrate-message {
    font-size: 1.3rem;
    line-height: 2;
    color: #555;
    margin-bottom: 1.5rem;
    font-family: 'KaiTi', 'STKaiti', serif;
}

.celebrate-signature {
    font-size: 1.1rem;
    color: var(--primary-pink);
    font-style: italic;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .section {
        padding: 0.5rem;
        align-items: flex-start;
        padding-top: 2rem;
    }

    /* 密码页面 */
    .password-content {
        padding: 1.5rem;
        width: 100%;
    }

    .password-icon {
        font-size: 3rem;
    }

    .password-title {
        font-size: 1.8rem;
    }

    .password-hint {
        font-size: 1rem;
    }

    .password-input-wrapper {
        flex-direction: column;
        gap: 0.8rem;
    }

    .password-input {
        width: 100%;
        max-width: 300px;
    }

    .password-btn {
        width: 100%;
        max-width: 300px;
    }

    /* 首页 */
    .home-content {
        padding: 1rem;
    }

    .home-title {
        font-size: 2.5rem;
    }

    .home-subtitle {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }

    /* 表白页面 */
    .confession-content {
        padding: 1rem;
        width: 100%;
    }

    .section-title {
        font-size: 1.6rem;
        margin-bottom: 1rem;
    }

    .typewriter-container {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    .typewriter-text {
        font-size: 0.95rem;
        line-height: 1.8;
        min-height: auto;
    }

    /* 照片 */
    .photos-title {
        font-size: 1.4rem;
    }

    .photo-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }

    .photo-image,
    .photo-placeholder {
        height: 140px;
    }

    .photo-caption {
        font-size: 0.8rem;
        padding: 0.5rem;
    }

    /* 时间线 */
    .timeline-content {
        padding: 1rem;
        width: 100%;
    }

    .timeline {
        margin: 1.5rem 0;
        padding: 1rem 0;
    }

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

    .timeline-item {
        width: 100%;
        padding-left: 2.5rem;
        padding-right: 0.5rem;
        margin-bottom: 1rem;
        text-align: left !important;
    }

    .timeline-item.left,
    .timeline-item.right {
        left: 0;
    }

    .timeline-item .timeline-dot {
        left: 5px !important;
        right: auto !important;
        width: 16px;
        height: 16px;
    }

    .timeline-card {
        padding: 1rem;
    }

    .timeline-card h3 {
        font-size: 1.1rem;
    }

    .timeline-card p {
        font-size: 0.9rem;
    }

    /* 最终表白 */
    .final-content {
        padding: 0.5rem;
    }

    .final-text {
        padding: 1.5rem;
        margin-bottom: 1rem;
        width: 100%;
    }

    .final-title {
        font-size: 2rem;
    }

    .final-subtitle {
        font-size: 1.4rem;
    }

    .final-message {
        font-size: 1rem;
        line-height: 1.8;
    }

    .final-signature {
        font-size: 0.95rem;
    }

    .button-container {
        flex-direction: column;
        gap: 0.8rem;
        width: 100%;
        max-width: 280px;
    }

    .btn-yes,
    .btn-no {
        width: 100%;
        padding: 1rem;
        font-size: 1.1rem;
    }

    /* 庆祝页面 */
    .celebrate-text {
        padding: 1.5rem;
        width: 90%;
    }

    .celebrate-title {
        font-size: 1.6rem;
    }

    .celebrate-subtitle {
        font-size: 1.4rem;
    }

    .celebrate-message {
        font-size: 1rem;
    }

    /* 按钮通用 */
    .btn {
        padding: 0.9rem 2rem;
        font-size: 1rem;
    }
}

/* 小屏幕手机 */
@media (max-width: 380px) {
    .home-title {
        font-size: 2rem;
    }

    .photo-grid {
        grid-template-columns: 1fr;
    }

    .final-title {
        font-size: 1.6rem;
    }

    .final-subtitle {
        font-size: 1.2rem;
    }
}
