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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    padding-bottom: 100px;
}

/* 网格背景 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(200, 200, 200, 0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(200, 200, 200, 0.3) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    z-index: -1;
}

.image-container {
    max-width: 1200px;
    width: 100%;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 标题区域 */
.image-title-section {
    text-align: center;
    margin-bottom: 10px;
}

.image-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #2c3e50;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.loading-indicator {
    color: #3498db;
    font-size: 1.5rem;
}

.category-hint {
    font-size: 14px;
    color: #7f8c8d;
    line-height: 1.4;
    max-width: 600px;
    word-wrap: break-word;
    text-align: center;
}

/* 图片展示区域 */
.image-display-container {
    width: 100%;
    max-width: 400px;
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-wrapper {
    position: relative;
    width: auto;
    max-width: 100%;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: imageShow 0.6s ease-out;
}

@keyframes imageShow {
    0% {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    100% {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.image-wrapper img {
    width: 100%;
    height: auto;
    max-height: 70vh;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 15px;
}

.image-wrapper:hover .image-overlay {
    opacity: 1;
}

.image-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 10px;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-wrapper:hover .image-actions {
    opacity: 1;
}

.action-btn {
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    backdrop-filter: blur(10px);
}

.action-btn:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* 占位符 */
.image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 60px 40px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #7f8c8d;
    text-align: center;
    width: 100%;
    min-height: 300px;
}

.image-placeholder i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.image-placeholder p {
    font-size: 1.1rem;
    font-weight: 500;
}

/* 底部导航栏 */
.image-bottom-nav {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
}

.image-nav-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 40px;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.image-nav-items {
    display: flex;
    gap: 10px;
}

.image-nav-item {
    background: transparent;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #7f8c8d;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.image-nav-item:hover {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.image-nav-item.active {
    background: #3498db;
    color: white;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.refresh-btn {
    background: #2c3e50;
    color: white;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 12px rgba(44, 62, 80, 0.3);
    margin-left: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.refresh-btn:hover:not(:disabled) {
    background: #34495e;
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(44, 62, 80, 0.4);
}

.refresh-btn:active:not(:disabled) {
    transform: translateY(0);
}

.refresh-btn:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 4px 8px rgba(149, 165, 166, 0.3);
}

.refresh-btn i {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.refresh-btn.loading i {
    animation: spin 1s linear infinite;
}

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

/* 全屏模态框 */
.fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.fullscreen-content {
    position: relative;
    max-width: 95%;
    max-height: 95%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.fullscreen-close {
    position: absolute;
    top: -50px;
    right: -50px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: #2c3e50;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.fullscreen-close:hover {
    background: white;
    transform: scale(1.1);
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        align-items: center;
        justify-content: center;
        padding: 10px 0 120px 0;
    }
    
    .image-container {
        padding: 15px 10px;
        min-height: auto;
        justify-content: center;
    }
    
    .image-title {
        font-size: 2rem;
    }
    
    .category-hint {
        font-size: 12px;
        max-width: 90%;
        line-height: 1.3;
    }
    
    .image-display-container {
        max-width: 95%;
        min-height: 300px;
        margin-bottom: 30px;
    }
    
    .image-placeholder {
        padding: 40px 20px;
        min-height: 250px;
    }
    
    .image-placeholder i {
        font-size: 3rem;
        margin-bottom: 15px;
    }
    
    .image-placeholder p {
        font-size: 1rem;
    }
    
    .image-nav-container {
        padding: 8px 10px;
        gap: 8px;
    }
    
    .image-nav-item {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .refresh-btn {
        width: 32px;
        height: 32px;
        font-size: 11px;
        margin-left: 6px;
    }
    
    .action-btn {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .image-overlay {
        padding: 10px;
    }
    
    .fullscreen-close {
        top: 20px;
        right: 20px;
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
}

/* 加载状态 */
.image-wrapper.loading {
    position: relative;
    min-height: 320px; /* 保持预加载框架的可见高度 */
    aspect-ratio: 3 / 4; /* 加载中给定一个稳定的比例，避免布局跳变 */
}

.image-wrapper.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 40px;
    height: 40px;
    border: 3px solid rgba(52, 152, 219, 0.3);
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 3;
}



/* 错误状态 */
.error-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #e74c3c;
    text-align: center;
    width: 100%;
    min-height: 200px;
}

.error-message i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.7;
}

.error-message p {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 10px;
}

.error-message .retry-btn {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.error-message .retry-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
}