* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #6366f1;
    --secondary-color: #8b5cf6;
    --accent-color: #ec4899;
    --dark-bg: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.8);
    --text-light: #f1f5f9;
    --text-muted: #94a3b8;
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.5);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 10;
}

/* 背景动画 */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.3;
    animation: float 20s infinite ease-in-out;
}

.circle-1 {
    width: 400px;
    height: 400px;
    background: var(--primary-color);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.circle-2 {
    width: 300px;
    height: 300px;
    background: var(--secondary-color);
    bottom: -150px;
    right: -100px;
    animation-delay: 5s;
}

.circle-3 {
    width: 350px;
    height: 350px;
    background: var(--accent-color);
    top: 50%;
    right: -100px;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(50px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-30px, 30px) scale(0.9);
    }
}

/* 头部 */
.header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.title {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    letter-spacing: 1px;
}

/* 相册容器 */
.album-container {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeInUp 0.8s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 主显示区 */
.main-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    min-height: 600px;
}

.photo-wrapper {
    position: relative;
    flex: 1;
    max-width: 900px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    transition: var(--transition);
}

.photo-wrapper:hover {
    transform: scale(1.02);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

#mainPhoto {
    width: 100%;
    height: 600px;
    object-fit: contain;
    background: rgba(0, 0, 0, 0.5);
    display: block;
    animation: photoFadeIn 0.5s ease-out;
}

@keyframes photoFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.photo-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    padding: 2rem 1.5rem 1rem;
    text-align: center;
}

#photoCounter {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-light);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* 导航按钮 */
.nav-btn {
    width: 60px;
    height: 60px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-btn svg {
    width: 28px;
    height: 28px;
}

.nav-btn:hover {
    background: var(--primary-color);
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.nav-btn:active {
    transform: scale(0.95);
}

/* 缩略图区域 */
.thumbnails-container {
    margin-bottom: 2rem;
    overflow: hidden;
}

.thumbnails {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 1rem 0;
    scroll-behavior: smooth;
}

.thumbnails::-webkit-scrollbar {
    height: 8px;
}

.thumbnails::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.thumbnails::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.thumbnail {
    min-width: 120px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    border: 3px solid transparent;
    position: relative;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.thumbnail:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.thumbnail.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.thumbnail::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(99, 102, 241, 0.3);
    opacity: 0;
    transition: var(--transition);
}

.thumbnail.active::after {
    opacity: 1;
}

/* 控制按钮 */
.controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.control-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: var(--text-light);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.control-btn svg {
    width: 20px;
    height: 20px;
}

.control-btn:hover {
    background: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.control-btn:active {
    transform: translateY(0);
}

.control-btn.active {
    background: var(--accent-color);
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.5);
}

/* 网格视图 */
.grid-view {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.grid-view.active {
    display: flex;
    opacity: 1;
}

.close-grid {
    position: absolute;
    top: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 101;
}

.close-grid svg {
    width: 24px;
    height: 24px;
}

.close-grid:hover {
    background: var(--accent-color);
    transform: rotate(90deg);
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    max-width: 1400px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 1rem;
}

.grid-container::-webkit-scrollbar {
    width: 10px;
}

.grid-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

.grid-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

.grid-item {
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: var(--transition);
}

.grid-item:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.grid-item:hover img {
    transform: scale(1.1);
}

.grid-item::before {
    content: attr(data-index);
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    z-index: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .title {
        font-size: 2rem;
    }

    .main-display {
        flex-direction: column;
        min-height: auto;
        gap: 1rem;
    }

    #mainPhoto {
        height: 400px;
    }

    .nav-btn {
        width: 50px;
        height: 50px;
    }

    .nav-btn svg {
        width: 24px;
        height: 24px;
    }

    .controls {
        flex-direction: column;
    }

    .control-btn {
        width: 100%;
        justify-content: center;
    }

    .grid-container {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
}

/* 加载动画 */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading {
    animation: spin 1s linear infinite;
}
