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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: linear-gradient(180deg, #fdf6f0 0%, #fce4ec 30%, #f8e8e0 60%, #fdf6f0 100%);
    color: #4a3728;
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
}

a { color: #e08a6a; text-decoration: none; }
a:hover { color: #d4724e; }

/* ==================== 雪花 ==================== */
.snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -20px;
    color: #fce4ec;
    font-size: 14px;
    opacity: 0;
    animation: snowfall linear infinite;
    text-shadow: 0 0 6px rgba(248, 165, 160, 0.4), 0 0 12px rgba(255,255,255,0.3);
}

@keyframes snowfall {
    0% {
        transform: translateY(-20px) rotate(0deg) scale(0.5);
        opacity: 0;
    }
    10% {
        opacity: 0.8;
    }
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(105vh) rotate(360deg) scale(1.2);
        opacity: 0;
    }
}

/* ==================== 装饰浮动元素 ==================== */
.floating-decor {
    position: fixed;
    pointer-events: none;
    z-index: 0;
    font-size: 30px;
    opacity: 0.15;
    animation: floatAround 20s ease-in-out infinite;
}

/* 位置通过内联样式设置在 HTML 中 */

@keyframes floatAround {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    25% {
        transform: translateY(-20px) rotate(5deg);
    }
    50% {
        transform: translateY(10px) rotate(-3deg);
    }
    75% {
        transform: translateY(-10px) rotate(4deg);
    }
}

/* ==================== 头部 ==================== */
.header {
    background: linear-gradient(135deg, #f8a5a0 0%, #f5c4b8 30%, #fad0c4 60%, #f8c8dc 100%);
    color: #fff;
    text-align: center;
    padding: 45px 20px 60px;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(255,255,255,0.15) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(255,255,255,0.1) 0%, transparent 50%);
    animation: headerShimmer 8s ease-in-out infinite;
}

@keyframes headerShimmer {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(20px, -10px); }
}

.header-content {
    position: relative;
    z-index: 1;
}

.header-content h1 {
    font-size: 2.4em;
    font-weight: 700;
    letter-spacing: 2px;
    text-shadow: 0 2px 15px rgba(232, 138, 106, 0.3);
}

.subtitle {
    margin-top: 10px;
    font-size: 1.1em;
    opacity: 0.92;
    text-shadow: 0 1px 8px rgba(0,0,0,0.08);
}

/* ==================== 时间轴 ==================== */
.timeline {
    max-width: 960px;
    margin: -40px auto 40px;
    padding: 0 20px;
    position: relative;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, #f8a5a0, #fad0c4, #f5c4b8);
    transform: translateX(-50%);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
    width: 100%;
}

.timeline-dot {
    position: absolute;
    left: 50%;
    top: 30px;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #f8a5a0, #f5c4b8);
    border: 4px solid #fff;
    border-radius: 50%;
    transform: translateX(-50%);
    box-shadow: 0 2px 8px rgba(248, 165, 160, 0.4);
    z-index: 2;
}

.timeline-card {
    width: calc(50% - 45px);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    padding: 28px;
    box-shadow: 0 4px 20px rgba(248, 165, 160, 0.12);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.timeline-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(248, 165, 160, 0.2);
}

.timeline-item.left .timeline-card {
    float: left;
}

.timeline-item.right .timeline-card {
    float: right;
}

.timeline-item::after {
    content: '';
    display: table;
    clear: both;
}

/* 卡片上的小三角 */
.timeline-card::before {
    content: '';
    position: absolute;
    top: 28px;
    width: 0;
    height: 0;
    border: 10px solid transparent;
}

.timeline-item.left .timeline-card::before {
    right: -20px;
    border-left-color: rgba(255,255,255,0.92);
    border-right: 0;
}

.timeline-item.right .timeline-card::before {
    left: -20px;
    border-right-color: rgba(255,255,255,0.92);
    border-left: 0;
}

/* 日期标签 */
.card-date {
    display: inline-block;
    background: linear-gradient(135deg, #f8a5a0, #f5c4b8);
    color: #fff;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    margin-bottom: 12px;
}

.card-title {
    font-size: 1.4em;
    color: #4a3728;
    margin-bottom: 10px;
}

.card-desc {
    color: #7a6a5a;
    font-size: 0.95em;
    margin-bottom: 16px;
    white-space: pre-wrap;
}

/* ==================== 照片网格 ==================== */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.photo-grid:has(.photo-item:only-child) {
    grid-template-columns: 1fr;
}

.photo-item {
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    aspect-ratio: 4/3;
    background: #f0f0f0;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    opacity: 0;
}

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

/* ==================== 视频 ==================== */
.video-section {
    margin-top: 16px;
}

.video-wrapper {
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    margin-bottom: 8px;
}

.video-wrapper video {
    width: 100%;
    display: block;
    max-height: 400px;
    background: #000;
}

/* ==================== 灯箱 ==================== */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 92vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 10px 60px rgba(0,0,0,0.5);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    line-height: 1;
}

.lightbox-close:hover { opacity: 1; }

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #b8a898;
    background: rgba(255,255,255,0.5);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 2px dashed rgba(248, 165, 160, 0.3);
}

.empty-state .empty-icon {
    font-size: 5em;
    margin-bottom: 16px;
    animation: gentleBounce 3s ease-in-out infinite;
}

@keyframes gentleBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.empty-state p {
    font-size: 1.1em;
}

.empty-state.small {
    padding: 30px 20px;
}

/* ==================== 底部 ==================== */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: #999;
    font-size: 0.85em;
}

.admin-link {
    opacity: 0.5;
    transition: opacity 0.2s;
}

.admin-link:hover { opacity: 1; }

/* ==================== 管理后台 ==================== */
.admin-login-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8a5a0 0%, #f5c4b8 50%, #fad0c4 100%);
    padding: 20px;
}

.admin-login-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.admin-login-card h2 {
    text-align: center;
    margin-bottom: 28px;
    color: #333;
}

.admin-back-link {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9em;
}

/* ===== 管理头部 ===== */
.admin-header {
    background: #2c3e50;
    color: #fff;
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.admin-header-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    font-size: 1.2em;
    font-weight: 600;
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-user {
    opacity: 0.7;
    font-size: 0.9em;
}

/* ===== 管理容器 ===== */
.admin-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 28px 24px;
}

.admin-section {
    background: #fff;
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.admin-section h2 {
    font-size: 1.15em;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

/* ===== 表单 ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 0.9em;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #ddd;
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.2s;
    background: #fafafa;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.form-group textarea {
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 16px;
}

.form-row .form-group {
    flex: 1;
}

.form-group-2x { flex: 2 !important; }

.form-error {
    color: #e74c3c;
    font-size: 0.9em;
    margin-bottom: 12px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

/* ===== 按钮 ===== */
.btn {
    display: inline-block;
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
    line-height: 1.4;
}

.btn-primary {
    background: linear-gradient(135deg, #f8a5a0, #f5c4b8);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(248, 165, 160, 0.4);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid #ddd;
    color: #666;
}

.btn-outline:hover {
    border-color: #667eea;
    color: #667eea;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85em;
}

.btn-block {
    display: block;
    width: 100%;
}

/* ===== 事件卡片 ===== */
.admin-event-card {
    border: 1.5px solid #eee;
    border-radius: 10px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.admin-event-card:hover {
    border-color: #ddd;
}

.admin-event-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    cursor: pointer;
    transition: background 0.2s;
}

.admin-event-main:hover {
    background: #f8f7ff;
}

.admin-event-info {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.admin-event-date {
    display: inline-block;
    background: #f8a5a0;
    color: #fff;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
}

.admin-event-meta {
    color: #999;
    font-size: 0.85em;
    margin-left: 4px;
}

.admin-event-actions {
    display: flex;
    gap: 8px;
}

.admin-event-edit {
    padding: 18px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

/* ===== 文件管理 ===== */
.file-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #eee;
}

.file-section > label {
    display: block;
    font-size: 0.9em;
    font-weight: 600;
    color: #555;
    margin-bottom: 10px;
}

.file-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 0.85em;
}

.file-item img {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
}

.file-item video {
    width: 80px;
    height: 48px;
    object-fit: cover;
    border-radius: 6px;
    background: #000;
}

.file-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #666;
}

.upload-area {
    border: 2px dashed #ddd;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.upload-area:hover {
    border-color: #f8a5a0;
    background: #fdf6f0;
}

.upload-area input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.upload-area p {
    color: #999;
    font-size: 0.9em;
}

.upload-area:hover p {
    color: #f8a5a0;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    .header { padding: 30px 16px 45px; }
    .header-content h1 { font-size: 1.6em; }

    .timeline { margin-top: -30px; }
    .timeline-line { left: 20px; }

    .timeline-item { padding-left: 50px; }

    .timeline-dot {
        left: 20px;
        top: 24px;
        width: 14px;
        height: 14px;
    }

    .timeline-card {
        width: 100%;
        float: none !important;
        padding: 20px;
    }

    .timeline-card::before { display: none; }

    .card-title { font-size: 1.2em; }

    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .admin-event-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .admin-event-info { flex-wrap: wrap; }

    .admin-header-inner {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }

    .admin-container { padding: 16px; }
    .admin-section { padding: 18px; }
}

@media (max-width: 480px) {
    .photo-grid { grid-template-columns: 1fr 1fr; }
}

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

.timeline-item {
    animation: fadeInUp 0.5s ease both;
}

.timeline-item:nth-child(1) { animation-delay: 0.05s; }
.timeline-item:nth-child(2) { animation-delay: 0.10s; }
.timeline-item:nth-child(3) { animation-delay: 0.15s; }
.timeline-item:nth-child(4) { animation-delay: 0.20s; }
.timeline-item:nth-child(5) { animation-delay: 0.25s; }
.timeline-item:nth-child(6) { animation-delay: 0.30s; }
.timeline-item:nth-child(7) { animation-delay: 0.35s; }
.timeline-item:nth-child(8) { animation-delay: 0.40s; }
.timeline-item:nth-child(9) { animation-delay: 0.45s; }
.timeline-item:nth-child(10){ animation-delay: 0.50s; }

/* ==================== 背景音乐播放器 ==================== */
.music-toggle {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #f8a5a0, #f5c4b8);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(248, 165, 160, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.music-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(248, 165, 160, 0.5);
}

.music-toggle.playing {
    animation: musicPulse 2s ease-in-out infinite;
}

@keyframes musicPulse {
    0%, 100% { box-shadow: 0 4px 20px rgba(248, 165, 160, 0.4); }
    50% { box-shadow: 0 4px 30px rgba(248, 165, 160, 0.7), 0 0 40px rgba(248, 165, 160, 0.3); }
}

.music-toggle .note-icon {
    transition: transform 0.3s ease;
}

.music-toggle.playing .note-icon {
    animation: noteSpin 3s linear infinite;
}

@keyframes noteSpin {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(10deg); }
    75% { transform: rotate(-10deg); }
    100% { transform: rotate(0deg); }
}

/* ==================== 页脚 ==================== */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: #b8a898;
    font-size: 0.85em;
}
