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

body {
    font-family: 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    min-height: 100vh;
    overflow-x: hidden;
    /* 移动端优化 */
    -webkit-tap-highlight-color: transparent;
    -webkit-overflow-scrolling: touch;
}

/* PWA全屏模式下隐藏地址栏 */
@media all and (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* 确保主容器可以滚动 */
#app {
    min-height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 封面页 */
.cover {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #ff6b9d 0%, #c06c84 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;
    transition: opacity 1s, transform 1s;
}

.cover.hide {
    opacity: 0;
    transform: scale(1.2);
    pointer-events: none;
}

/* 烟花页面 */
.fireworks-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1s;
}

.fireworks-page.show {
    opacity: 1;
    pointer-events: auto;
}

.fireworks-content {
    text-align: center;
    position: relative;
    z-index: 1000;
}

.confetti-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin-bottom: 20px;
}

.confetti-left,
.confetti-right {
    font-size: 100px;
    transition: all 0.6s ease-out;
    animation: bounce 2s infinite;
}

.confetti-left.explode {
    transform: translate(-300px, -200px) rotate(360deg) scale(2);
    opacity: 0;
}

.confetti-right.explode {
    transform: translate(300px, -200px) rotate(-360deg) scale(2);
    opacity: 0;
}

.fireworks-title {
    font-size: 72px;
    color: white;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    animation: pulse 2s infinite;
}

.fireworks-subtitle {
    font-size: 32px;
    color: rgba(255, 255, 255, 0.9);
    animation: fadeInUp 2s infinite;
}

.cover-content {
    text-align: center;
    color: white;
}

.cover-content h1 {
    font-size: 120px;
    margin-bottom: 20px;
    animation: bounce 2s infinite;
}

.cover-content h2 {
    font-size: 48px;
    margin-bottom: 30px;
}

.subtitle {
    font-size: 24px;
    opacity: 0.9;
    animation: pulse 2s infinite;
}

.animate-text {
    animation: fadeInUp 1s ease-out;
}

/* 爱心雨 */
.hearts {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.heart {
    position: absolute;
    top: -50px;
    font-size: 30px;
    animation: fall 4s linear infinite;
}

@keyframes fall {
    to {
        top: 110vh;
        transform: rotate(360deg);
    }
}

/* 主内容 */
.main-content {
    padding: 50px 20px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    /* 确保移动端可以滚动 */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 气球装饰 */
.balloons {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.balloon {
    position: absolute;
    font-size: 60px;
    animation: float 4s ease-in-out infinite;
}

.balloon-1 {
    left: 5%;
    top: 10%;
    animation-delay: 0s;
}

.balloon-2 {
    left: 85%;
    top: 20%;
    animation-delay: 1s;
}

.balloon-3 {
    left: 15%;
    top: 60%;
    animation-delay: 2s;
}

.balloon-4 {
    left: 90%;
    top: 70%;
    animation-delay: 1.5s;
}

.balloon-5 {
    left: 50%;
    top: 5%;
    animation-delay: 0.5s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(-5deg);
    }

    50% {
        transform: translateY(-30px) rotate(5deg);
    }
}

/* 通用样式 */
section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 30px;
    padding: 60px 40px;
    margin-bottom: 50px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
}

.title {
    font-size: 56px;
    text-align: center;
    background: linear-gradient(45deg, #f093fb, #f5576c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
}

.subtitle {
    font-size: 32px;
    text-align: center;
    color: #666;
    margin-bottom: 40px;
}

.section-title {
    font-size: 42px;
    text-align: center;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 40px;
}

/* 生日祝福卡片 */
.wish-card {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.wish-text {
    font-size: 24px;
    line-height: 2;
    color: #333;
    text-align: center;
}

/* 倒计时 */
.countdown {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.time-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    border-radius: 20px;
    text-align: center;
    min-width: 120px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: pulse-glow 2s infinite;
}

.time-number {
    font-size: 48px;
    font-weight: bold;
    color: white;
}

.time-label {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 10px;
}

.love-quote {
    text-align: center;
    font-size: 24px;
    color: #666;
    font-style: italic;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
    }

    50% {
        box-shadow: 0 10px 50px rgba(102, 126, 234, 0.8);
    }
}

/* 照片墙 */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.photo-card {
    text-align: center;
}

.photo-placeholder {
    width: 100%;
    height: 300px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s;
}

.photo-card:hover .photo-placeholder {
    transform: scale(1.05) rotate(2deg);
}

.photo-icon {
    font-size: 80px;
}

.photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 20px;
}

.photo-caption {
    font-size: 18px;
    color: #666;
    font-weight: bold;
}

/* 理由列表 */
.reasons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.reason-card {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    padding: 20px;
    border-radius: 15px;
    display: flex;
    gap: 15px;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.reason-card:hover {
    transform: translateY(-5px);
}

.reason-number {
    background: #ff6b9d;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.reason-text {
    font-size: 16px;
    color: #333;
}

.btn-more {
    display: block;
    margin: 0 auto;
    padding: 15px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    cursor: pointer;
    transition: transform 0.3s;
}

.btn-more:hover {
    transform: scale(1.05);
}

/* 蛋糕和蜡烛 */
.cake-container {
    text-align: center;
    margin: 40px 0;
}

.cake {
    font-size: 150px;
    animation: bounce 2s infinite;
}

.candles {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.candle {
    position: relative;
}

.flame {
    width: 20px;
    height: 30px;
    background: linear-gradient(180deg, #ff6b00, #ffd700);
    border-radius: 50% 50% 0 0;
    animation: flicker 0.5s infinite;
    margin: 0 auto;
}

.flame.blown {
    opacity: 0;
}

.wick {
    width: 4px;
    height: 30px;
    background: #8b4513;
    margin: 0 auto;
}

@keyframes flicker {

    0%,
    100% {
        transform: scale(1) translateY(0);
    }

    50% {
        transform: scale(1.1) translateY(-3px);
    }
}

.wish-instruction,
.wish-made {
    text-align: center;
    font-size: 24px;
    color: #666;
    margin: 20px 0;
}

.btn-blow {
    display: block;
    margin: 20px auto;
    padding: 15px 40px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 20px;
    cursor: pointer;
    transition: transform 0.3s;
}

.btn-blow:hover {
    transform: scale(1.1);
}

/* 最终留言 */
.message-box {
    background: linear-gradient(135deg, #fff5f5 0%, #ffe4e4 100%);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.final-message {
    font-size: 24px;
    line-height: 2;
    color: #333;
    text-align: center;
}

.signature {
    font-size: 28px;
    color: #ff6b9d;
    font-weight: bold;
}

/* 烟花画布 */
#fireworks {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 998;
    /* 在烟花页面时显示在文字下方 */
}

/* 音乐控制 */
.music-control {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    animation: pulse 2s infinite;
}

/* 返回按钮 */
.back-control {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: transform 0.3s, box-shadow 0.3s;
}

.back-control:hover {
    transform: scale(1.1) rotate(180deg);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.fade-in {
    animation: fadeInUp 1s ease-out;
}

/* 响应式 */
@media (max-width: 768px) {
    .title {
        font-size: 40px;
    }

    .subtitle {
        font-size: 24px;
    }

    .section-title {
        font-size: 32px;
    }

    .wish-text {
        font-size: 18px;
    }

    .cover-content h1 {
        font-size: 80px;
    }

    .cover-content h2 {
        font-size: 32px;
    }

    .time-box {
        min-width: 80px;
        padding: 20px;
    }

    .time-number {
        font-size: 32px;
    }

    section {
        padding: 40px 20px;
    }

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

    /* 蜡烛适配手机尺寸 */
    .cake {
        font-size: 100px;
    }

    .candles {
        gap: 8px;
        flex-wrap: wrap;
        max-width: 90%;
        margin: 20px auto 0;
    }

    .candle {
        transform: scale(0.6);
    }

    .flame {
        width: 15px;
        height: 20px;
    }

    .btn-blow {
        font-size: 16px;
        padding: 12px 30px;
    }
}

/* 密码保护页面样式 */
.password-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.password-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 50px 40px;
    border-radius: 25px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 450px;
    width: 90%;
    animation: fadeInUp 0.8s ease-out;
}

.password-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

.password-title {
    font-size: 28px;
    color: #333;
    margin-bottom: 10px;
    font-weight: bold;
}

.password-hint {
    font-size: 18px;
    color: #666;
    margin-bottom: 30px;
}

.password-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.password-input {
    flex: 1;
    padding: 15px 20px;
    font-size: 18px;
    border: 2px solid #ddd;
    border-radius: 50px;
    outline: none;
    transition: all 0.3s;
    text-align: center;
    letter-spacing: 5px;
}

.password-input:focus {
    border-color: #f093fb;
    box-shadow: 0 0 15px rgba(240, 147, 251, 0.3);
}

.password-btn {
    padding: 15px 35px;
    font-size: 18px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
}

.password-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(240, 147, 251, 0.4);
}

.password-btn:active {
    transform: scale(0.95);
}

.password-error {
    color: #f5576c;
    font-size: 16px;
    margin-top: 10px;
    display: none;
    animation: shake 0.5s;
}

.password-footer {
    margin-top: 30px;
    font-size: 40px;
    animation: float 3s ease-in-out infinite;
}

/* 抖动动画 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-10px); }
    20%, 40%, 60%, 80% { transform: translateX(10px); }
}

/* 响应式 - 密码页面 */
@media (max-width: 768px) {
    .password-container {
        padding: 40px 30px;
    }
    
    .password-title {
        font-size: 24px;
    }
    
    .password-hint {
        font-size: 16px;
    }
    
    .password-input-group {
        flex-direction: column;
    }
    
    .password-input,
    .password-btn {
        width: 100%;
        font-size: 16px;
    }
}