* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Lora', 'Noto Serif SC', 'Georgia', 'Times New Roman', serif;
    background: linear-gradient(135deg, #8B7355 0%, #6B5B47 50%, #4A4A4A 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
    position: relative;
    overflow-x: hidden;
}

/* 桌子纹理效果 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.03) 2px,
            rgba(0, 0, 0, 0.03) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.03) 2px,
            rgba(0, 0, 0, 0.03) 4px
        );
    pointer-events: none;
    z-index: 0;
}

/* 雪花效果 */
.snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -50px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1em;
    font-family: Arial, sans-serif;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.5);
    animation: snowfall linear infinite;
    pointer-events: none;
    user-select: none;
}

@keyframes snowfall {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0;
    }
    15% {
        opacity: 0.3;
    }
    25% {
        opacity: 0.6;
    }
    85% {
        opacity: 0.8;
    }
    95% {
        opacity: 0.4;
    }
    100% {
        transform: translateY(calc(100vh + 50px)) translateX(var(--drift)) rotate(360deg);
        opacity: 0;
    }
}

/* 不同大小的雪花 */
.snowflake.small {
    font-size: 0.8em;
    animation-duration: 8s;
}

.snowflake.medium {
    font-size: 1em;
    animation-duration: 10s;
}

.snowflake.large {
    font-size: 1.5em;
    animation-duration: 12s;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

header {
    text-align: center;
    margin-bottom: 35px;
    background: rgba(255, 255, 255, 0.92);
    padding: 27px 33px;
    border-radius: 17px;
    box-shadow: 
        0 10px 23px rgba(0, 0, 0, 0.15),
        0 3px 10px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.header-content {
    margin-bottom: 20px;
}

h1 {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
    font-weight: 300;
    letter-spacing: 2px;
}

.title-main {
    font-size: 2.1em;
    color: #4a5568;
    font-weight: 400;
    letter-spacing: 5px;
    text-transform: uppercase;
    font-family: 'Playfair Display', 'Cormorant Garamond', 'Georgia', serif;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
}

.title-sub {
    font-size: 1.2em;
    color: #8B7355;
    font-weight: 500;
    letter-spacing: 3px;
    margin-top: -3px;
    font-family: 'Playfair Display', 'Cormorant Garamond', 'Georgia', serif;
}

.header-subtitle {
    font-size: 0.73em;
    color: #718096;
    font-weight: 300;
    letter-spacing: 2px;
    margin-top: 7px;
    font-style: italic;
    font-family: 'Lora', 'Noto Serif SC', 'Georgia', serif;
}

.audio-controls {
    display: flex;
    align-items: center;
    justify-content: center;
}

.audio-control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 13px;
    width: 100%;
}

.audio-btn {
    background: linear-gradient(135deg, #8B7355 0%, #6B5B47 100%);
    color: white;
    border: none;
    padding: 9px 21px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 
        0 3px 10px rgba(139, 115, 85, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 5px;
    letter-spacing: 1px;
    min-width: 93px;
    justify-content: center;
}

.audio-btn:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(139, 115, 85, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(135deg, #9B8365 0%, #7B6B57 100%);
}

.audio-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 10px rgba(139, 115, 85, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-icon {
    font-size: 18px;
}

.btn-text {
    font-weight: 500;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 233px;
    padding: 0 7px;
}

.volume-icon {
    font-size: 12px;
    opacity: 0.7;
}

.volume-value {
    font-weight: 500;
    color: #4a5568;
    min-width: 30px;
    text-align: left;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.volume-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, #e2e8f0, #cbd5e0);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B7355 0%, #6B5B47 100%);
    cursor: pointer;
    box-shadow: 
        0 2px 6px rgba(139, 115, 85, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.2s;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 
        0 3px 8px rgba(139, 115, 85, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B7355 0%, #6B5B47 100%);
    cursor: pointer;
    border: none;
    box-shadow: 
        0 2px 6px rgba(139, 115, 85, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.2s;
}

.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
    box-shadow: 
        0 3px 8px rgba(139, 115, 85, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.gallery {
    position: relative;
    width: 100%;
    min-height: 800px;
    padding: 80px 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
    overflow: visible;
}

.gallery-item {
    position: absolute;
    width: 380px;
    height: 270px;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                z-index 0.3s,
                box-shadow 0.3s;
    transform-origin: center center;
    border: 10px solid #fff;
    border-radius: 2px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(0, 0, 0, 0.1) inset;
    background: #fff;
    pointer-events: auto;
    will-change: transform, z-index;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* 照片堆叠效果 - 通过JavaScript动态设置位置和旋转 */
/* 基础样式已通过内联样式设置 */

/* 确保所有照片都可以被点击，即使被遮挡 */
.gallery-item {
    pointer-events: auto;
}

/* 悬停效果 - 轻微提升 */
.gallery-item:hover:not(.selected) {
    transform: translate(var(--tx, 0), var(--ty, 0)) rotate(var(--rot, 0deg)) translateY(-15px) scale(1.08) !important;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(0, 0, 0, 0.1) inset;
    z-index: 100 !important;
}

/* 选中状态 - 完全显示在最前面 */
.gallery-item.selected {
    transform: translate(0, 0) rotate(0deg) scale(1.15) !important;
    z-index: 1000 !important;
    box-shadow: 
        0 30px 60px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(0, 0, 0, 0.1) inset;
    pointer-events: auto;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 0;
}

/* 照片边框效果 */
.gallery-item::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    pointer-events: none;
}

/* 照片阴影效果 */
.gallery-item::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    filter: blur(10px);
    opacity: 0.6;
    transition: opacity 0.3s;
}

.gallery-item.selected::after {
    opacity: 0.8;
    width: 100%;
    height: 30px;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90%;
    margin-top: 5%;
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.2s;
    object-fit: contain;
    cursor: zoom-in;
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close {
    position: absolute;
    top: 30px;
    right: 50px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 1001;
}

.close:hover {
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.modal-nav {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.5);
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
    transform: translateY(-2px);
}

.nav-btn:active {
    transform: translateY(0);
}

/* 图片计数器 */
.image-counter {
    position: absolute;
    top: 30px;
    left: 50px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    backdrop-filter: blur(10px);
    z-index: 1001;
}

@media (max-width: 768px) {
    .image-counter {
        top: 20px;
        left: 20px;
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    header {
        padding: 20px 17px;
    }
    
    .title-main {
        font-size: 1.5em;
        letter-spacing: 3px;
    }
    
    .title-sub {
        font-size: 1em;
        letter-spacing: 2px;
    }
    
    .header-subtitle {
        font-size: 0.65em;
        letter-spacing: 1px;
    }
    
    .audio-control-group {
        gap: 10px;
    }
    
    .audio-btn {
        padding: 8px 16px;
        font-size: 12px;
        min-width: 80px;
    }
    
    .volume-control {
        max-width: 100%;
    }
    
    .gallery {
        padding: 40px 15px;
        min-height: 600px;
    }
    
    .gallery-item {
        width: 200px;
        height: 140px;
        border: 6px solid #fff;
    }
    
    .gallery-item.selected {
        transform: translate(0, 0) rotate(0deg) scale(1.1) !important;
    }
    
    .close {
        top: 20px;
        right: 30px;
        font-size: 30px;
    }
    
    .modal-nav {
        bottom: 30px;
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* 小屏幕设备 */
@media (max-width: 480px) {
    .gallery {
        padding: 30px 10px;
        min-height: 500px;
    }
    
    .gallery-item {
        width: 160px;
        height: 110px;
        border: 5px solid #fff;
    }
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 50px;
    color: white;
    font-size: 20px;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

