/* 基础重置和全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background-color: #0a0a0a;
    color: #e0e0e0;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
    opacity: 0;
    animation: fadeIn 0.5s ease-in-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* 炫光背景效果 */
.glow-effect {
    position: fixed;
    width: 60vw;
    height: 60vh;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(8, 119, 229, 0.15) 0%, rgba(8, 119, 229, 0.05) 30%, transparent 70%);
    filter: blur(80px);
    z-index: -1;
    opacity: 0;
    animation: float 20s ease-in-out infinite, fadeInGlow 1s ease-in-out forwards;
}

@keyframes fadeInGlow {
    from {
        opacity: 0;
    }
    to {
        opacity: 0.6;
    }
}

.glow-effect-2 {
    top: 20%;
    right: 10%;
    background: radial-gradient(circle, rgba(10, 71, 129, 0.12) 0%, rgba(10, 71, 129, 0.04) 30%, transparent 70%);
    animation: float 25s ease-in-out infinite reverse, fadeInGlow 1.2s ease-in-out 0.2s forwards;
    width: 50vw;
    height: 50vh;
    opacity: 0;
}

.glow-effect-3 {
    bottom: 10%;
    left: 15%;
    background: radial-gradient(circle, rgba(8, 119, 229, 0.1) 0%, rgba(8, 119, 229, 0.03) 30%, transparent 70%);
    animation: float 30s ease-in-out infinite, fadeInGlow 1.5s ease-in-out 0.4s forwards;
    width: 40vw;
    height: 40vh;
    opacity: 0;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(20px, 30px) scale(1.05);
    }
    50% {
        transform: translate(-15px, 10px) scale(0.95);
    }
    75% {
        transform: translate(10px, -20px) scale(1.02);
    }
}

/* 主容器 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    position: relative;
    z-index: 1;
}

/* 头部样式 */
header {
    text-align: center;
    padding: 60px 0 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 40px;
}

.title {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #92E4EF, #0578E9);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-transform: uppercase;
    background-size: 200% auto;
    animation: gradientShift 3s ease-in-out infinite alternate;
}

.title .highlight {
    background: linear-gradient(90deg, #92E4EF, #0578E9);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: gradientShift 3s ease-in-out infinite alternate;
    margin-left: 15px;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 100% 50%;
    }
}

.subtitle {
    font-size: 1.2rem;
    color: #aaa;
    font-weight: 300;
    letter-spacing: 1px;
}

/* 画廊网格布局 */
.gallery-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 60px;
}

.gallery-item {
    background: rgba(20, 20, 30, 0.7);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(100, 100, 150, 0.2);
    position: relative;
    backdrop-filter: blur(10px);
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(8, 119, 229, 0.25),
                0 0 0 1px rgba(10, 71, 129, 0.1),
                inset 0 0 20px rgba(255, 255, 255, 0.05);
    border-color: rgba(8, 119, 229, 0.4);
}

/* 列表模式鼠标光标 - 只显示小手 */
.gallery-item,
.gallery-item:hover .image-container,
.gallery-item:hover .image-container img {
    cursor: pointer;
}

/* 禁止大图模式的图片样式 */
.gallery-item.no-lightbox,
.gallery-item.no-lightbox:hover .image-container,
.gallery-item.no-lightbox:hover .image-container img {
    cursor: default;
}

.gallery-item.no-lightbox:hover {
    transform: none !important;
    box-shadow: none !important;
    border-color: rgba(100, 100, 150, 0.2) !important;
}

.gallery-item.no-lightbox:hover .image-container img {
    transform: none !important;
}

.gallery-item.no-lightbox::before {
    display: none;
}

/* 列表模式查看大图图标提示 - 已取消 */

/* 确保图片容器也有正确的光标 */
.image-container {
    cursor: inherit;
}

.image-container img {
    cursor: inherit;
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(8, 119, 229, 0.5), transparent);
}

.image-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.image-container img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.8s ease;
}

.gallery-item:hover .image-container img {
    transform: scale(1.05);
}

.image-overlay {
    display: none;
}

.image-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.image-description {
    font-size: 1rem;
    color: #ccc;
    font-weight: 300;
}

/* 页脚样式 */
footer {
    text-align: center;
    padding: 40px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
    font-size: 0.9rem;
}

#image-count {
    color: #0877E5;
    font-weight: 600;
}

/* 大图模式样式 */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: block;
    opacity: 1;
}

.lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
}

.lightbox-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 1400px;
    max-height: 95vh;
    background: rgba(20, 20, 30, 0.98);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(8, 119, 229, 0.3);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
}

.lightbox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: rgba(10, 10, 20, 0.9);
    border-bottom: 1px solid rgba(100, 100, 150, 0.2);
}

.lightbox-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-btn {
    background: rgba(100, 100, 150, 0.2);
    border: 1px solid rgba(150, 150, 255, 0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: rgba(8, 119, 229, 0.4);
    transform: scale(1.1);
}

.image-counter {
    font-size: 1.1rem;
    color: #ccc;
    min-width: 80px;
    text-align: center;
}

.close-btn {
    background: rgba(255, 50, 50, 0.2);
    border: 1px solid rgba(255, 100, 100, 0.3);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(255, 50, 50, 0.4);
    transform: scale(1.1);
}

.lightbox-content {
    display: flex;
    flex-direction: column;
    height: calc(90vh - 81px);
}

.image-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    position: relative;
    overflow: hidden;
    min-height: 70vh;
}

#lightbox-image {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    transition: transform 0.3s ease;
    cursor: grab;
}

#lightbox-image:active {
    cursor: grabbing;
}

/* 大图模式拖动优化 */
#lightbox-image.dragging {
    opacity: 0.9;
    filter: brightness(1.1);
    transition: opacity 0.1s, filter 0.1s;
}

/* 非左键拖动时的禁止图标 */
#lightbox-image.no-drag {
    cursor: not-allowed !important;
}

/* 大图模式默认光标 */
#lightbox-image {
    cursor: grab;
}

/* 拖动时的光标 */
#lightbox-image.dragging {
    cursor: grabbing;
}

.zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.zoom-btn {
    background: rgba(100, 100, 150, 0.3);
    border: 1px solid rgba(150, 150, 255, 0.2);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.zoom-btn:hover {
    background: rgba(8, 119, 229, 0.5);
    transform: scale(1.1);
}

.image-info {
    display: none;
}

#image-title {
    font-size: 1.8rem;
    color: white;
    margin-bottom: 10px;
}

#image-description {
    color: #aaa;
    line-height: 1.5;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        padding: 0 30px;
    }
    
    .title {
        font-size: 3rem;
    }
}

@media (max-width: 992px) {
    .container {
        padding: 0 20px;
    }
    
    .title {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .gallery-grid {
        gap: 20px;
    }
    
    .lightbox-container {
        width: 95%;
    }
    
    .lightbox-header {
        padding: 15px 20px;
    }
    
    .image-wrapper {
        padding: 15px;
    }
    
    .image-info {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.8rem;
    }
    
    .view-mode {
        flex-direction: column;
        gap: 10px;
    }
    
    .lightbox-content {
        height: calc(90vh - 71px);
    }
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.loading::after {
    content: '';
    width: 50px;
    height: 50px;
    border: 3px solid rgba(8, 119, 229, 0.3);
    border-top-color: #0877E5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 优化滚动动画 - 修复跳帧问题 */
@keyframes smoothScrollDown {
    0% {
        transform: translateY(0) scale(1);
    }
    30% {
        transform: translateY(2px) scale(0.998);
    }
    70% {
        transform: translateY(4px) scale(1.002);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

@keyframes smoothScrollUp {
    0% {
        transform: translateY(0) scale(1);
    }
    30% {
        transform: translateY(-2px) scale(0.998);
    }
    70% {
        transform: translateY(-4px) scale(1.002);
    }
    100% {
        transform: translateY(0) scale(1);
    }
}

/* 全局滚动状态 */
body.scrolling {
    cursor: default !important;
}

/* 只在非滚动时应用hover效果 */
body:not(.scrolling) .gallery-item:hover {
    transform: translateY(-15px) scale(1.02);
    box-shadow: 0 20px 40px rgba(8, 119, 229, 0.25),
                0 0 0 1px rgba(10, 71, 129, 0.1),
                inset 0 0 20px rgba(255, 255, 255, 0.05);
    border-color: rgba(8, 119, 229, 0.4);
}

/* 滚动时禁用hover过渡 */
.gallery-item.scrolling:hover {
    transition: none !important;
}

/* 滚动动画类 */
.gallery-item.scrolling-down {
    animation: smoothScrollDown 0.3s ease-out;
}

.gallery-item.scrolling-up {
    animation: smoothScrollUp 0.3s ease-out;
}

/* 智能滚动激活状态 */
.gallery-item.scroll-active {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 15px 30px rgba(146, 228, 239, 0.2),
                0 0 0 1px rgba(5, 120, 233, 0.3),
                inset 0 0 15px rgba(255, 255, 255, 0.05);
    border-color: rgba(5, 120, 233, 0.5);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                box-shadow 0.2s ease,
                border-color 0.2s ease;
    z-index: 5;
}

/* 顶部黑边效果 */
header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #000, rgba(0, 0, 0, 0.7), #000);
    z-index: 2;
}

/* 炫光效果增强 */
.glow-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 30%, rgba(146, 228, 239, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 70%, rgba(5, 120, 233, 0.1) 0%, transparent 50%);
    filter: blur(20px);
    animation: float 15s ease-in-out infinite;
}

.glow-effect::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, rgba(146, 228, 239, 0.08) 0%, rgba(5, 120, 233, 0.05) 40%, transparent 70%);
    filter: blur(40px);
}