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

@font-face {
    font-family: 'MiSans';
    src: url('MiSans.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: 'MiSans', 'Microsoft YaHei', 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #fdfcfb 0%, #e2d1c3 100%);
    color: #333;
    overflow-x: hidden;
    position: relative;
}

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

/* 开场特效 */
.opening-effect {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #ff9a9e 0%, #fad0c4 99%, #fad0c4 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 1s ease-in-out;
}

.opening-effect.fade-out {
    opacity: 0;
    pointer-events: none;
}

.heart-loader {
    text-align: center;
    animation: pulse 2s infinite;
}

.heart {
    width: 100px;
    height: 100px;
    background-color: #ff6b6b;
    position: relative;
    transform: rotate(-45deg);
    animation: beat 1.2s infinite;
    margin: 0 auto 30px;
}

.heart:before,
.heart:after {
    content: "";
    width: 100px;
    height: 100px;
    background-color: #ff6b6b;
    border-radius: 50%;
    position: absolute;
}

.heart:before {
    top: -50px;
    left: 0;
}

.heart:after {
    top: 0;
    left: 50px;
}

.heart-text {
    color: white;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    margin-top: 20px;
}

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

/* 头部样式 */
.header {
    text-align: center;
    padding: 50px 20px;
    animation: fadeInDown 1s ease;
}

.header h1 {
    font-size: 3rem;
    color: #e84393;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.header p {
    font-size: 1.5rem;
    color: #6c5ce7;
}

/* 导航栏样式 */
.navigation {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50px;
    margin: 20px auto;
    max-width: 800px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    padding: 5px;
}

.navigation ul {
    display: flex;
    justify-content: space-around;
    list-style: none;
    padding: 10px 0;
    margin: 0;
    flex-wrap: wrap;
}

.navigation li {
    flex: 1;
    min-width: 100px;
    text-align: center;
    margin: 5px;
}

.navigation a {
    text-decoration: none;
    color: #6c5ce7;
    font-weight: bold;
    font-size: 1.1rem;
    padding: 12px 15px;
    border-radius: 30px;
    transition: all 0.3s ease;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.navigation a:hover, .navigation a.active {
    background: #6c5ce7;
    color: white;
    transform: scale(1.05);
}

/* 章节样式 */
.section {
    background: rgba(255, 255, 255, 0.9);
    margin: 40px 0;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 1s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.section h2 {
    text-align: center;
    color: #e84393;
    margin-bottom: 30px;
    font-size: 2.2rem;
    position: relative;
}

.section h2:after {
    content: "";
    display: block;
    width: 100px;
    height: 4px;
    background: linear-gradient(to right, #ff9a9e, #fad0c4);
    margin: 10px auto;
    border-radius: 2px;
}

/* 时间轴样式 */
.timeline-intro {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 15px;
}

.timeline-intro p {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #6c5ce7;
}

.timeline-toggle-btn {
    background: linear-gradient(to right, #ff9a9e, #fad0c4);
    border: none;
    color: white;
    padding: 12px 30px;
    font-size: 1.1rem;
    border-radius: 30px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.timeline-toggle-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 30px auto 0;
    padding: 20px 0;
}

.timeline:before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, #ff9a9e, #a18cd1);
    left: 50%;
    margin-left: -2px;
    border-radius: 2px;
}

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

.timeline-item:nth-child(odd) {
    padding-right: calc(50% + 30px);
    text-align: right;
}

.timeline-item:nth-child(even) {
    padding-left: calc(50% + 30px);
}

.timeline-date {
    display: inline-block;
    padding: 10px 20px;
    background: #6c5ce7;
    color: white;
    border-radius: 30px;
    font-weight: bold;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(108, 92, 231, 0.3);
    position: relative;
    z-index: 2;
}

.timeline-content {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    transition: transform 0.3s ease;
    border: 1px solid #f0f0f0;
}

.timeline-content:hover {
    transform: translateY(-3px);
}

.timeline-content:before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #6c5ce7;
    border: 4px solid white;
    border-radius: 50%;
    top: 30px;
    z-index: 1;
    box-shadow: 0 0 0 2px #6c5ce7;
}

.timeline-item:nth-child(odd) .timeline-content:before {
    right: -60px;
}

.timeline-item:nth-child(even) .timeline-content:before {
    left: -60px;
}

.timeline-content h3 {
    margin-top: 0;
    color: #e84393;
    border-bottom: 2px solid #f8f9fa;
    padding-bottom: 10px;
}

.timeline-content p {
    line-height: 1.6;
    color: #555;
}

.add-timeline {
    text-align: center;
    margin-top: 30px;
}

/* 照片墙样式 */
.photo-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.photo-item {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.4s ease;
    height: 200px;
    position: relative;
}

.photo-item:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.2);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    display: block;
}

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

.photo-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px;
    transform: translateY(100%);
    transition: transform 0.4s ease;
}

.photo-item:hover .photo-info {
    transform: translateY(0);
}

.photo-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
}

.photo-info p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.add-photo {
    text-align: center;
    margin-top: 30px;
}

/* 特殊日期样式 */
.special-dates-container,
.birthday-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.special-date,
.birthday {
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    color: white;
}

.special-date:hover,
.birthday:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.special-date h3,
.birthday h3 {
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.date {
    font-size: 1.2rem;
    margin-bottom: 15px;
    font-weight: bold;
}

.countdown {
    font-size: 1.3rem;
    font-weight: bold;
    background: rgba(255, 255, 255, 0.3);
    padding: 10px;
    border-radius: 10px;
}

/* 情话样式 */
.quotes-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
    position: relative;
    min-height: 200px;
}

.quote {
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
    padding: 30px 40px;
    border-radius: 20px;
    font-size: 1.5rem;
    text-align: center;
    color: #fff;
    font-style: italic;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    width: 100%;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.quote:before,
.quote:after {
    content: '"';
    font-size: 5rem;
    position: absolute;
    color: rgba(255, 255, 255, 0.3);
    font-family: Georgia, serif;
    font-weight: bold;
}

.quote:before {
    top: -10px;
    left: 10px;
}

.quote:after {
    bottom: -40px;
    right: 10px;
}

.quote:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.add-quote {
    text-align: center;
    margin-top: 30px;
}

/* 按钮样式 */
button {
    background: linear-gradient(to right, #ff9a9e, #fad0c4);
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(255, 154, 158, 0.4);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

button:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: 0.5s;
}

button:hover:before {
    left: 100%;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(255, 154, 158, 0.6);
}

button[type="submit"] {
    width: 100%;
    margin-top: 15px;
}

/* 页脚样式 */
.footer {
    text-align: center;
    padding: 30px;
    margin-top: 50px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 15px;
    font-size: 1.2rem;
}

.footer p:first-child {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #e84393;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideIn 0.3s ease;
}


.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
}

.close:hover,
.close:focus {
    color: #e84393;
}

.modal-content h2 {
    color: #e84393;
    margin-top: 0;
    margin-bottom: 25px;
    text-align: center;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #6c5ce7;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #6c5ce7;
    outline: none;
}

.form-group input[type="file"] {
    border: 2px dashed #ddd;
    padding: 20px;
    text-align: center;
    background-color: #f9f9f9;
    cursor: pointer;
}

.form-group input[type="file"]:hover {
    border-color: #6c5ce7;
    background-color: #f0f0f0;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 14px;
}

#upload-status {
    margin-top: 10px;
    padding: 10px;
    border-radius: 5px;
    text-align: center;
    font-weight: bold;
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #ff9a9e, #fad0c4);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border: none;
}

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

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* 动画定义 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

@keyframes beat {
    0% { transform: scale(1) rotate(-45deg); }
    50% { transform: scale(1.1) rotate(-45deg); }
    100% { transform: scale(1) rotate(-45deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .header p {
        font-size: 1.2rem;
    }
    
    .navigation {
        border-radius: 20px;
        margin: 15px auto;
        padding: 5px;
        max-width: 95%;
    }
    
    .navigation ul {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 5px 0;
    }
    
    .navigation li {
        flex: 0 0 33%;
        margin: 3px 0;
        min-width: auto;
    }
    
    .navigation a {
        font-size: 0.9rem;
        padding: 8px 5px;
        margin: 0 2px;
        border-radius: 15px;
    }
    
    .timeline:before {
        left: 31px;
        margin-left: 0;
    }
    
    .timeline-item {
        padding: 0 20px 0 70px;
        margin-bottom: 30px;
        text-align: left !important;
    }
    
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        padding: 0 20px 0 70px;
        text-align: left;
    }
    
    .timeline-item:nth-child(odd) .timeline-content:before,
    .timeline-item:nth-child(even) .timeline-content:before {
        left: -50px;
        right: auto;
        top: 25px;
    }
    
    .timeline-date {
        padding: 8px 15px;
        font-size: 0.9rem;
        margin-bottom: 10px;
    }
    
    .timeline-content {
        padding: 15px;
    }
    
    .timeline-content h3 {
        font-size: 1.3rem;
        padding-bottom: 8px;
    }
    
    .timeline-content p {
        font-size: 0.95rem;
    }
    
    .photo-wall {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .quote {
        font-size: 1.1rem;
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .section {
        padding: 20px;
        margin: 20px 0;
    }
    
    .header {
        padding: 30px 10px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .section h2 {
        font-size: 1.8rem;
    }
    
    .navigation li {
        flex: 0 0 50%;
    }
    
    .timeline {
        padding: 15px 0;
    }
    
    .timeline:before {
        left: 26px;
    }
    
    .timeline-item {
        padding: 0 15px 0 55px;
        margin-bottom: 25px;
    }
    
    .timeline-item:nth-child(odd) .timeline-content:before,
    .timeline-item:nth-child(even) .timeline-content:before {
        left: -42px;
        width: 16px;
        height: 16px;
        top: 20px;
    }
    
    .timeline-date {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .timeline-content {
        padding: 12px;
    }
    
    .timeline-content h3 {
        font-size: 1.2rem;
        padding-bottom: 6px;
    }
    
    .timeline-content p {
        font-size: 0.9rem;
    }
    
    .photo-wall {
        grid-template-columns: 1fr;
    }
    
    .special-dates-container,
    .birthday-container {
        grid-template-columns: 1fr;
    }
    
    .quote {
        font-size: 1rem;
        padding: 15px;
    }
    
    .quote:before {
        font-size: 3rem;
        top: -15px;
    }
    
    .quote:after {
        font-size: 3rem;
        bottom: -30px;
    }
}