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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: auto;
}

/* 容器样式 */
.container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 400% 400%;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* 引导页面 */
.guide-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
}

.guide-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.guide-content {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.guide-header {
    position: relative;
    margin-bottom: 30px;
}

.guide-header h2 {
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.guide-close {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.guide-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.guide-body {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.guide-section {
    flex: 1;
    text-align: center;
}

.guide-clickable {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.guide-clickable::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.guide-clickable:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.guide-clickable:hover::before {
    left: 100%;
}

.guide-clickable:active {
    transform: translateY(-2px);
}

.guide-click-hint {
    margin-top: 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.guide-clickable:hover .guide-click-hint {
    opacity: 1;
}

.guide-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.guide-section h3 {
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.guide-section p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.guide-divider {
    width: 2px;
    height: 80px;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.guide-tip {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    margin: 0;
    text-align: center;
}

/* 加载动画 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.loading-text {
    color: #fff;
    font-size: 16px;
    font-weight: 300;
    letter-spacing: 1px;
}

/* 主内容 */
.main-content {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease;
    padding: 20px;
    max-width: 100%;
}

.main-content.show {
    opacity: 1;
    transform: translateY(0);
}

/* 页面标题 */
.page-header {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.3));
    animation: logoGlow 3s ease-in-out infinite alternate;
}

@keyframes logoGlow {
    0% {
        filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.3));
    }
    100% {
        filter: drop-shadow(0 2px 15px rgba(255, 255, 255, 0.2));
    }
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
    margin: 0;
    background: linear-gradient(45deg, #ffffff, #f0f8ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: titleGlow 3s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    0% {
        text-shadow: 0 2px 10px rgba(255, 255, 255, 0.3);
    }
    100% {
        text-shadow: 0 2px 20px rgba(255, 255, 255, 0.6), 0 0 30px rgba(255, 255, 255, 0.4);
    }
}

/* 响应式标题 */
@media (max-width: 480px) {
    .page-title {
        font-size: 24px;
        letter-spacing: 1px;
    }
    
    .page-header {
        padding: 15px 0;
        gap: 10px;
    }
    
    .logo {
        animation: titleGlow 3s ease-in-out infinite alternate;
        width: 80px;
        height: 80px;
    }
}

/* 分类选择器 - 隐藏 */
.category-selector {
    display: none;
}

/* 导航标签 */
.nav-tabs {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 25px;
    padding: 8px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: none;
}

.nav-tabs.active {
    display: block;
}

.tab-container {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    position: relative;
}

.tab-btn {
    flex: 1;
    min-width: 0;
    padding: 12px 8px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-weight: 500;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    touch-action: manipulation;
}

.tab-btn:hover {
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

.tab-btn.active {
    color: #fff;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.tab-indicator {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
    border-radius: 20px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.2);
}

/* 图片容器 */
.image-container {
    position: relative;
    width: 100%;
    height: 70vh;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    touch-action: manipulation;
    display: none;
}

.image-container.active {
    display: block;
}

.image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 20px;
    overflow: hidden;
    z-index: 1;
}

.image-wrapper.active {
    opacity: 1;
    transform: scale(1) translateY(0);
    z-index: 10;
}

.main-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: rgba(0, 0, 0, 0.1);
    transition: transform 0.6s ease;
    touch-action: manipulation;
}

.image-wrapper:hover .main-image {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 30px 20px 20px;
    transform: translateY(100%);
    transition: transform 0.4s ease;
    pointer-events: none;
}

.image-wrapper.active .image-overlay {
    transform: translateY(0);
}

.image-title {
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    margin: 0;
}

/* 返回按钮样式 */
.back-btn {
    position: absolute;
    top: 72px;
    right: 20px;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 1000;
    font-size: 16px;
    text-decoration: none;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    box-shadow: 0 5px 20px rgba(255, 255, 255, 0.2);
}

.back-btn:active {
    transform: scale(0.95);
}

/* 移动端返回按钮优化 */
@media (max-width: 768px) {
    .back-btn {
        right: 15px;
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .back-btn {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
}

/* 底部装饰 */
.bottom-decoration {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 40px;
    gap: 15px;
}

.decoration-line {
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
    border-radius: 1px;
}

.decoration-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: dotPulse 2s ease-in-out infinite;
}

.dot:nth-child(2) {
    animation-delay: 0.3s;
}

.dot:nth-child(3) {
    animation-delay: 0.6s;
}

@keyframes dotPulse {
    0%, 100% {
        opacity: 0.4;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .tab-btn {
        font-size: 11px;
        padding: 10px 6px;
    }
    
    .image-container {
        height: 60vh;
        border-radius: 15px;
    }
    
    .image-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .nav-tabs {
        position: relative;
    }
    
    .tab-container {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-template-rows: repeat(2, 1fr);
        gap: 8px;
        padding: 10px;
    }
    
    .tab-btn {
        padding: 10px 8px;
        font-size: 11px;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        line-height: 1.2;
        margin-right: 0;
        touch-action: manipulation;
    }
    
    .image-container {
        height: 55vh;
    }
    
    .image-title {
        font-size: 18px;
    }
    
    .scroll-hint {
        display: none;
    }
    
    .tab-indicator {
        top: 0;
        left: 0;
        height: 40px;
    }
}

/* 滑动提示 */
.scroll-hint {
    display: none;
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 10px;
    font-weight: 300;
    white-space: nowrap;
    animation: fadeInOut 3s ease-in-out infinite;
    pointer-events: none;
    transition: opacity 0.3s ease;
    opacity: 1;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

/* 触摸优化 */
@media (hover: none) and (pointer: coarse) {
    .tab-btn:hover {
        transform: none;
    }
    
    .tab-btn:active {
        transform: scale(0.95);
        background: rgba(255, 255, 255, 0.1);
    }
    
    .image-wrapper:hover .main-image {
        transform: none;
    }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .main-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* 全屏查看模态框 */
.fullscreen-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.fullscreen-modal.show {
    opacity: 1;
    visibility: visible;
}

.fullscreen-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    cursor: pointer;
}

.fullscreen-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.fullscreen-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    z-index: 10001;
}

.fullscreen-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.fullscreen-close:active {
    transform: scale(0.95);
}

.fullscreen-image-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 90vw;
    max-height: 80vh;
    margin-bottom: 20px;
}

.fullscreen-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.8);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.fullscreen-modal.show .fullscreen-image {
    transform: scale(1);
}

.fullscreen-title {
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
}

.fullscreen-modal.show .fullscreen-title {
    opacity: 1;
    transform: translateY(0);
}

/* 移动端全屏优化 */
@media (max-width: 768px) {
    .fullscreen-close {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
    
    .fullscreen-container {
        padding: 15px;
    }
    
    .fullscreen-image-wrapper {
        max-width: 95vw;
        max-height: 75vh;
    }
    
    .fullscreen-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .fullscreen-close {
        width: 40px;
        height: 40px;
    }
    
    .fullscreen-title {
        font-size: 18px;
    }
}

/* 添加图片点击提示 */
.main-image {
    cursor: pointer;
}

.image-wrapper::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.3s ease;
    pointer-events: none;
    z-index: 10;
}

.image-wrapper::before {
    content: '🔍';
    position: absolute;
    top: 50%;
    left: 50%;
    font-size: 24px;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.3s ease 0.1s;
    pointer-events: none;
    z-index: 11;
}

.image-wrapper:hover::after {
    transform: translate(-50%, -50%) scale(1);
}

.image-wrapper:hover::before {
    transform: translate(-50%, -50%) scale(1);
}