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

/* 加载指示器样式 */
.image-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    z-index: 10;
    transition: opacity 0.3s ease;
}

.loader-spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 10px;
}

.loader-text {
    font-size: 14px;
    font-weight: 500;
}

.error-text {
    color: #ff6b6b;
    font-size: 14px;
    font-weight: 500;
}

.image-loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.image-loader.error {
    background: rgba(255, 107, 107, 0.2);
    border: 1px solid #ff6b6b;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(-45deg, #455E6E, #4B5DA7, #6344BC, #6B2184);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: #e0e0e0;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

/* 放射线条特效 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, transparent 20%, rgba(255, 255, 255, 0.05) 21%, transparent 22%),
                radial-gradient(circle at 30% 70%, transparent 25%, rgba(255, 255, 255, 0.03) 26%, transparent 27%),
                radial-gradient(circle at 70% 30%, transparent 18%, rgba(255, 255, 255, 0.07) 19%, transparent 20%);
    background-size: 100% 100%;
    animation: radiate 20s linear infinite;
    z-index: -1;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }
    25% {
        background-position: 100% 50%;
    }
    50% {
        background-position: 100% 100%;
    }
    75% {
        background-position: 0% 100%;
    }
    100% {
        background-position: 0% 50%;
    }
}

@keyframes radiate {
    0% {
        transform: rotate(0deg) scale(1);
        opacity: 0.6;
    }
    50% {
        transform: rotate(180deg) scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: rotate(360deg) scale(1);
        opacity: 0.6;
    }
}

/* 头部样式 */
header {
    background: rgba(0, 0, 0, 0.8);
    padding: 1.5rem 0;
    text-align: center;
    box-shadow: 0 0 30px rgba(0, 150, 255, 0.3);
    position: relative;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 200, 255, 0.5);
    overflow: hidden;
}

/* 头部发光效果 */
header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #00a0ff, #7b42f6, #00a0ff, transparent);
    animation: headerGlow 3s ease infinite;
}

.title-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease-out;
    background: rgba(0, 0, 0, 0.6);
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0, 150, 255, 0.2);
    border: 1px solid rgba(0, 200, 255, 0.3);
    position: relative;
    transition: all 0.3s ease;
}

@keyframes headerGlow {
    0%, 100% {
        background-position: 0% 0%;
    }
    50% {
        background-position: 200% 0%;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.title-image {
    max-width: 240px;
    height: auto;
    position: relative;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    /* 彻底移除所有可能的遮罩 */
    background: none !important;
    z-index: 10;
    opacity: 1 !important;
    filter: none !important;
}

.title-image:hover {
    transform: scale(1.03);
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

header p {
    font-size: 1.1rem;
    color: #ffffff;
    margin-top: 0.8rem;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
    font-weight: 400;
    letter-spacing: 1px;
    transition: color 0.3s ease;
}

header p:hover {
    color: #ffffff;
    text-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}

/* 主容器 */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* 页脚样式 */
footer {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #b0e0e6;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: 3rem;
    box-shadow: 0 -2px 10px rgba(0, 191, 255, 0.1);
    border-top: 1px solid #00bfff;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #00bfff, transparent);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
}

.footer-text {
    font-size: 0.9rem;
    margin: 0;
    text-shadow: 0 0 5px rgba(0, 191, 255, 0.3);
}

.license-info {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* 瀑布流容器 */
.masonry-container {
    margin: 0 auto;
    padding: 1rem;
    position: relative;
}

/* 图片项 */
.image-item {
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 191, 255, 0.1);
    overflow: hidden;
    margin-bottom: 1.5rem;
    transition: transform 0.5s ease, box-shadow 0.5s ease, z-index 0.5s ease;
    position: absolute;
    width: calc(33.333% - 1rem);
    border: 1px solid rgba(0, 191, 255, 0.2);
    backdrop-filter: blur(10px);
    z-index: 1;
}

/* 大屏幕响应式 - 4列布局 */
@media (min-width: 1024px) {
    .image-item {
        width: calc(25% - 1rem);
    }
}

.image-item:hover {
    transform: translateY(-15px) scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 191, 255, 0.2), 0 0 40px rgba(0, 191, 255, 0.1);
    border-color: rgba(0, 191, 255, 0.6);
    z-index: 10;
    animation: sparkle 2s ease-in-out infinite alternate;
}

@keyframes sparkle {
    0% {
        box-shadow: 0 15px 30px rgba(0, 191, 255, 0.2), 0 0 40px rgba(0, 191, 255, 0.1);
        transform: translateY(-15px) scale(1.05);
    }
    100% {
        box-shadow: 0 15px 30px rgba(0, 191, 255, 0.4), 0 0 80px rgba(0, 191, 255, 0.3), 0 0 100px rgba(0, 191, 255, 0.1);
        transform: translateY(-15px) scale(1.05);
    }
}

.image-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: all 0.5s ease;
}

.image-item img.loading {
    background: linear-gradient(90deg, #1a1a1a 25%, #282828 50%, #1a1a1a 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 加载指示器 */
.loading-indicator {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-size: 1.1rem;
    display: none;
}

.loading-indicator.show {
    display: block;
}

/* 图片预览模态框 */
.image-preview {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.95), rgba(26, 32, 44, 0.95));
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

/* 添加科技感网格背景 */
.image-preview::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(0, 191, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 191, 255, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
}

.image-preview.active {
    opacity: 1;
    visibility: visible;
}

.preview-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1px solid rgba(0, 191, 255, 0.3);
    background: rgba(0, 0, 0, 0.7);
    box-shadow: 0 0 60px rgba(0, 191, 255, 0.15);
}

.preview-image-wrapper {
    max-width: 90vw;
    max-height: 80vh;
    overflow: hidden;
    position: relative;
}

.preview-image-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(0, 191, 255, 0.05), transparent);
    pointer-events: none;
}

.preview-img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
        filter: brightness(0.8);
    }
    to {
        transform: scale(1);
        opacity: 1;
        filter: brightness(1);
    }
}

/* 预览导航按钮 */
.preview-prev,
.preview-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(0, 191, 255, 0.5);
    color: #00bfff;
    font-size: 2rem;
    padding: 1rem 1.5rem;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 10;
    backdrop-filter: blur(5px);
}

.preview-prev:hover,
.preview-next:hover {
    background: rgba(0, 191, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.5);
}

.preview-prev {
    left: -50px;
}

.preview-next {
    right: -50px;
}

.preview-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(0, 191, 255, 0.5);
    color: #00bfff;
    font-size: 2.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.preview-close:hover {
    transform: scale(1.2);
    background: rgba(0, 191, 255, 0.2);
    box-shadow: 0 0 20px rgba(0, 191, 255, 0.5);
}

.preview-caption {
    position: absolute;
    bottom: -40px;
    left: 0;
    right: 0;
    text-align: center;
    color: #00bfff;
    font-size: 1.1rem;
    text-shadow: 0 0 10px rgba(0, 191, 255, 0.5);
}

.error-indicator {
    position: absolute;
    bottom: 10px;
    left: 0;
    right: 0;
    background-color: rgba(0, 128, 255, 0.7);
    color: #000;
    text-align: center;
    padding: 10px 15px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    margin: 0 10px;
    animation: fadeIn 0.6s ease, pulse 2s ease infinite;
    text-shadow: 0 0 5px rgba(0, 191, 255, 0.5);
    border: 1px solid rgba(0, 191, 255, 0.5);
}

.image-error {
    filter: grayscale(70%) blur(2px);
    border: 3px dashed rgba(0, 191, 255, 0.7);
}

/* 响应式媒体查询 */
@media (max-width: 768px) {
    .image-item {
        width: calc(50% - 1rem);
    }
    
    .preview-prev {
        left: 10px;
        font-size: 1.5rem;
        padding: 0.8rem 1.2rem;
    }
    
    .preview-next {
        right: 10px;
        font-size: 1.5rem;
        padding: 0.8rem 1.2rem;
    }
    
    .preview-close {
        top: -40px;
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .image-item {
        width: 100%;
    }
    
    header {
        padding: 1.5rem 0;
    }
    
    .title-image {
        max-width: 200px;
    }
    
    .preview-content {
        max-width: 95%;
    }
}