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

html {
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    font-family: "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    line-height: 1;
    color: #333;
    background: linear-gradient(180deg, #0a1929 0%, #1a2942 50%, #0a1929 100%);
    background-attachment: fixed;
    max-width: 100vw;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

main {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    margin: 0;
    width: 100%;
}

.image-gallery {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    line-height: 0;
    background: transparent;
}

.image-item {
    width: 100%;
    display: block;
    background: linear-gradient(180deg, #0a1929 0%, #1a2942 50%, #0a1929 100%);
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    margin: 0;
    padding: 0;
    line-height: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.image-item.loaded {
    opacity: 1;
    transform: translateY(0);
}

.image-item img {
    max-width: 100%;
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
    line-height: 0;
}

.image-item:empty {
    min-height: 600px;
}

.loading {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: none;
    flex-direction: column;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.loading p {
    margin: 0;
    color: #555;
    font-size: 0.75rem;
    line-height: 1.4;
}

.controls {
    display: none;
}

button {
    display: none;
}

#image-counter {
    display: none;
}

footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.9rem;
}

/* 加载动画 */
.loader {
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    h1 {
        font-size: 1.4rem;
    }

    .image-gallery {
        gap: 0;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.2rem;
    }

    main {
        padding: 0;
    }

    /* 优化移动端图片加载动画 */
    .image-item {
        transition: opacity 0.4s ease, transform 0.4s ease;
    }

    .image-item.visible {
        animation: slideUp 0.4s ease-out;
    }

    @keyframes slideUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}


/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    /* 禁用文本选择以提升触摸体验 */
    .image-item {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
    }

    /* 优化触摸滚动 */
    body {
        -webkit-overflow-scrolling: touch;
    }

    .retry-button {
        padding: 12px 20px !important;
        font-size: 16px !important;
        min-height: 44px; /* 触摸友好的最小高度 */
    }
}

.retry-button:hover {
    background: #0056b3;
}

.retry-button:active {
    transform: scale(0.95);
} 