* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a90e2;
    --secondary-color: #50c878;
    --dark-color: #333;
    --light-color: #f5f5f5;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    color: var(--dark-color);
    min-height: 100vh;
    padding-bottom: 40px;
    overflow-x: hidden;
}

.header {
    text-align: center;
    padding: 30px 20px 15px;
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--primary-color);
    position: relative;
    display: inline-block;
}

.header h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--secondary-color);
    border-radius: 2px;
}

.tabs {
    display: flex;
    justify-content: center;
    margin-top: 15px;
    gap: 20px;
}

.tab-btn {
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 30px;
    background: #e0e0e0;
    color: #666;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(74, 144, 226, 0.3);
}

.tab-btn:hover:not(.active) {
    background: #d0d0d0;
    transform: translateY(-1px);
}

.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 20px;
    perspective: 1000px;
}

.gallery-item {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    aspect-ratio: 4/3;
    position: relative;
    cursor: pointer;
    background: linear-gradient(45deg, #f1f8ff, #e6f3ff);
    border: 2px solid #e0e0e0;
    opacity: 0;
    transform: translateY(20px) rotateX(10deg);
    animation: itemAppear 0.6s forwards;
}

@keyframes itemAppear {
    to {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
}

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

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

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    transition: transform 0.3s ease;
    background: white;
    padding: 5px;
}

.modal.active .modal-img {
    transform: scale(1);
}

.modal-controls {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    flex-wrap: wrap;
    justify-content: center;
}

.modal-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px) scale(1.1);
}

.close-btn {
    position: absolute;
    top: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.close-btn:hover {
    background: rgba(255, 50, 50, 0.6);
    transform: rotate(90deg);
}

/* 通知样式 */
.notification {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 15px 30px;
    background: var(--primary-color);
    color: white;
    border-radius: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
    z-index: 2000;
    font-weight: 500;
}

.notification.show {
    transform: translateX(-50%) translateY(0);
}

/* 加载动画 */
.loading-dots {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.loading-dots.hidden {
    opacity: 0;
}

.dot {
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 50%;
    margin: 0 8px;
    display: inline-block;
    animation: dotPulse 1.5s infinite ease-in-out;
}

.dot:nth-child(1) {
    animation-delay: 0s;
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-15px);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .tab-btn {
        padding: 10px 25px;
        font-size: 1rem;
    }
    
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
        padding: 10px;
    }
    
    .modal-controls {
        gap: 10px;
        margin-top: 15px;
    }
    
    .modal-btn, .close-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .close-btn {
        top: 15px;
        right: 15px;
    }
}

@media (max-width: 480px) {
    .tabs {
        gap: 10px;
    }
    
    .tab-btn {
        padding: 8px 20px;
    }
    
    .gallery {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-controls {
        gap: 8px;
    }
    
    .modal-btn {
        width: 36px;
        height: 36px;
    }
}