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

/* 全局样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* 导航栏样式 */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.navbar-brand .logo {
    font-size: 24px;
    font-weight: 700;
    color: #ff6b81;
    margin: 0;
}

.navbar-nav {
    display: flex;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: #666;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: #ff6b81;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #ff6b81;
    border-radius: 1px;
}

/* 主内容区域 */
.main-content {
    padding: 40px 0;
}

/* 标题样式 */
.section-title {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin-bottom: 40px;
    text-align: center;
}

/* 卡片样式 */
.upload-card,
.filter-card,
.message-form-card {
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    padding: 30px;
    margin-bottom: 40px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.upload-card:hover,
.filter-card:hover,
.message-form-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

/* 上传区域样式 */
.upload-header {
    text-align: center;
    margin-bottom: 30px;
}

.upload-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.upload-header p {
    color: #666;
    font-size: 16px;
}

.upload-area {
    border: 2px dashed #e0e0e0;
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    background-color: #fafafa;
}

.upload-area:hover {
    border-color: #ff6b81;
    background-color: #fff5f7;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.upload-area p {
    color: #666;
    font-size: 16px;
    margin-bottom: 20px;
}

.upload-btn {
    background-color: #ff6b81;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(255, 107, 129, 0.3);
}

.upload-btn:hover {
    background-color: #ff526e;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 129, 0.4);
}

.upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 20px;
}

.preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-remove {
    position: absolute;
    top: 5px;
    right: 5px;
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 14px;
    cursor: pointer;
    color: #ff6b81;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.preview-remove:hover {
    background-color: #ff6b81;
    color: #fff;
    transform: scale(1.1);
}

/* 分类筛选样式 */
.filter-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-tag {
    background-color: #f0f0f0;
    color: #666;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-tag:hover,
.filter-tag.active {
    background-color: #ff6b81;
    color: #fff;
    transform: translateY(-2px);
}

/* 画廊网格样式 */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.gallery-item img {
    width: 100%;
    height: 280px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.gallery-item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: #fff;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-item-info {
    opacity: 1;
}

.gallery-item-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.gallery-item-info p {
    font-size: 14px;
    opacity: 0.9;
}

/* 纪念日时间轴样式 */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #e0e0e0;
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.timeline-item:nth-child(odd) {
    flex-direction: row-reverse;
}

.timeline-content {
    width: calc(50% - 60px);
    background-color: #fff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.timeline-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.timeline-content p {
    color: #666;
    margin-bottom: 10px;
}

.timeline-date {
    font-size: 14px;
    color: #ff6b81;
    font-weight: 500;
}

.timeline-dot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 20px;
    background-color: #ff6b81;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    border: 4px solid #fff;
    box-shadow: 0 0 0 2px #ff6b81;
}

/* 留言板样式 */
.messages-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
}

.message-form-card h3 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #ff6b81;
    background-color: #fff;
    box-shadow: 0 0 0 2px rgba(255, 107, 129, 0.1);
}

.send-btn {
    background-color: #ff6b81;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-shadow: 0 2px 10px rgba(255, 107, 129, 0.3);
}

.send-btn:hover {
    background-color: #ff526e;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 107, 129, 0.4);
}

.messages-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message-item {
    background-color: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.message-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.message-author {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.message-time {
    font-size: 12px;
    color: #999;
}

.message-content {
    color: #666;
    line-height: 1.6;
    margin-bottom: 10px;
}

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

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    animation: slideIn 0.3s ease;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.close-btn:hover {
    color: #ff6b81;
    transform: rotate(90deg);
}

.modal-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

.modal-nav {
    background-color: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 20px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
}

.modal-nav:hover {
    background-color: #fff;
    color: #ff6b81;
    transform: translateY(-50%) scale(1.1);
}

.prev-btn {
    left: 30px;
}

.next-btn {
    right: 30px;
}

.modal-photo {
    max-width: 100%;
    max-height: 70vh;
    overflow: hidden;
    border-radius: 8px;
}

.modal-photo img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.modal-info {
    padding: 20px;
    background-color: #fafafa;
    border-top: 1px solid #e0e0e0;
}

.modal-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.modal-info p {
    color: #666;
    font-size: 14px;
}

/* 底部样式 */
.footer {
    background-color: #fff;
    border-top: 1px solid #e0e0e0;
    padding: 30px 0;
    text-align: center;
}

.footer p {
    color: #666;
    font-size: 14px;
}

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

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

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}