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

/* 现代优雅的背景和基础样式 */
body {
    font-family: 'Montserrat', 'Microsoft YaHei', sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
    background-color: #0a0a0a;
    color: #333;
    line-height: 1.6;
}

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

/* 渐变背景层 */
.gradient-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: linear-gradient(135deg, rgba(24, 24, 40, 0.95) 0%, rgba(36, 20, 40, 0.95) 100%);
    mix-blend-mode: overlay;
}

/* 主内容容器 */
.container {
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 卡片式情书设计 */
.love-letter-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    padding: 40px;
    max-width: 550px;
    width: 100%;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeInUp 1s ease-out;
    transform-style: preserve-3d;
    transform: perspective(1000px) rotateX(5deg);
    transition: all 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.love-letter-card:hover {
    transform: perspective(1000px) rotateX(0deg) translateY(-10px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.2);
}

/* 卡片标题区域 */
.card-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    gap: 20px;
}

.decorative-line {
    height: 1px;
    flex: 1;
    background: linear-gradient(to right, transparent, rgba(237, 76, 103, 0.5), transparent);
}

.card-title {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 900;
    color: #ed4c67;
    letter-spacing: 1px;
    margin: 0;
}

/* 卡片内容区域 */
.card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

/* 情书文字 */
.love-message {
    text-align: center;
    max-width: 400px;
    margin: 0 auto;
}

.message-line {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
    opacity: 0;
    animation: fadeIn 0.8s ease-out forwards;
    position: relative;
}

/* 为每一行添加延迟动画 */
.message-line:nth-child(1) { animation-delay: 0.2s; }
.message-line:nth-child(2) { animation-delay: 0.4s; }
.message-line:nth-child(3) { animation-delay: 0.6s; }
.message-line:nth-child(4) { animation-delay: 0.8s; }
.message-line:nth-child(5) { animation-delay: 1.0s; }
.message-line:nth-child(6) { animation-delay: 1.2s; }
.message-line:nth-child(7) { animation-delay: 1.4s; }
.message-line:nth-child(8) { animation-delay: 1.6s; }
.message-line:nth-child(9) { animation-delay: 1.8s; }
.message-line:nth-child(10) { animation-delay: 2.0s; }

/* 高亮文本 */
.message-line.highlight {
    color: #ed4c67;
    font-weight: 700;
    font-size: 22px;
    animation: pulse 2s ease-in-out infinite;
}

/* 署名区域 */
.signature-area {
    margin-top: 10px;
}

.signature {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 18px;
    color: #666;
    text-align: right;
}

/* 互动按钮区域 */
.interaction-buttons {
    display: flex;
    gap: 20px;
    margin-top: 15px;
}

/* 按钮样式 */
.btn {
    padding: 12px 28px;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.btn-accept {
    background: linear-gradient(135deg, #ed4c67 0%, #ff6b81 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.btn-accept:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 30px rgba(237, 76, 103, 0.4);
}

.btn-accept:active {
    transform: translateY(0) scale(0.98);
}

.btn-reject {
    background: transparent;
    color: #666;
    border: 2px solid #ddd;
    position: relative;
    transition: all 0.3s ease;
}

.btn-reject:hover {
    transform: translateY(-3px);
    border-color: #999;
    color: #333;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* 成功全屏效果 */
.success-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ed4c67 0%, #ff6b81 100%);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: successFadeIn 1s ease-out;
}

.success-content {
    text-align: center;
    color: white;
    padding: 40px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: successSlideUp 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-title {
    font-family: 'Playfair Display', serif;
    font-size: 42px;
    margin-bottom: 20px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    animation: heartbeat 1.5s ease-in-out infinite;
}

.success-message {
    font-size: 18px;
    margin-bottom: 10px;
    opacity: 0.9;
}

#success-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

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

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

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

@keyframes heartbeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1); }
    42% { transform: scale(1.3); }
    70% { transform: scale(1); }
}

@keyframes successFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes successSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 响应式设计 - 平板设备 (768px - 1023px) */
@media (max-width: 1023px) {
    .love-letter-card {
        padding: 35px;
        margin: 20px;
    }
    
    .card-title {
        font-size: 26px;
    }
    
    .message-line {
        font-size: 17px;
    }
    
    .message-line.highlight {
        font-size: 20px;
    }
    
    .btn {
        padding: 11px 25px;
        font-size: 15px;
    }
}

/* 响应式设计 - 手机设备 (小于768px) */
@media (max-width: 767px) {
    .love-letter-card {
        padding: 28px 20px;
        margin: 15px;
        border-radius: 12px;
    }
    
    .card-header {
        gap: 15px;
        margin-bottom: 25px;
    }
    
    .card-title {
        font-size: 22px;
    }
    
    .message-line {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    .message-line.highlight {
        font-size: 18px;
    }
    
    .interaction-buttons {
        gap: 15px;
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 14px;
        width: 100%;
    }
    
    .success-title {
        font-size: 32px;
    }
    
    .success-message {
        font-size: 16px;
    }
}

/* 响应式设计 - 小屏手机 (小于480px) */
@media (max-width: 479px) {
    .love-letter-card {
        padding: 24px 16px;
        margin: 10px;
    }
    
    .card-title {
        font-size: 20px;
    }
    
    .message-line {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .message-line.highlight {
        font-size: 16px;
    }
    
    .signature {
        font-size: 16px;
    }
    
    .success-content {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .success-title {
        font-size: 28px;
    }
    
    .success-message {
        font-size: 14px;
    }
}

/* 横屏模式优化 */
@media screen and (orientation: landscape) and (max-height: 500px) {
    body {
        min-height: 100vh;
        padding: 15px;
    }
    
    .love-letter-card {
        padding: 25px 30px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .card-header {
        margin-bottom: 20px;
    }
    
    .card-content {
        gap: 20px;
    }
    
    .message-line {
        margin-bottom: 8px;
    }
}