/* 幻灯片展示样式 */
.slideshow-container {
    min-height: 100vh;
    padding-top: 70px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    position: relative;
    overflow: hidden;
}

/* 主显示区域 */
.slideshow-main {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.slide-viewer {
    width: 100%;
    max-width: 900px;
    height: 600px;
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    background: #fff;
    margin-bottom: 30px;
}

.slide-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: opacity 0.5s ease-in-out;
    border-radius: 16px;
}

.slide-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 30px 20px 20px;
    border-radius: 0 0 16px 16px;
}

.slide-counter {
    font-size: 14px;
    font-weight: 600;
    opacity: 0.9;
    margin-bottom: 8px;
}

.slide-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
}

/* 控制按钮 */
.slide-controls {
    display: flex !important;
    gap: 15px !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 auto 30px auto !important;
    max-width: 900px !important;
    width: 100% !important;
}

.control-btn {
    width: 50px;
    height: 50px;
    border: 2px solid #000;
    background: #fff;
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.control-btn:hover {
    background: #000;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.control-btn:active {
    transform: translateY(0);
}

.control-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.control-btn:disabled:hover {
    background: #fff;
    color: #000;
    transform: none;
    box-shadow: none;
}

/* 缩略图侧边栏 */
.thumbnails-sidebar {
    position: fixed;
    top: 70px;
    right: -400px;
    width: 400px;
    height: calc(100vh - 70px);
    background: #fff;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.thumbnails-sidebar.active {
    right: 0;
}

.thumbnails-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.thumbnails-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #000;
}

.close-thumbnails {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-thumbnails:hover {
    background: #f0f0f0;
    color: #000;
}

.thumbnails-grid {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
}

.thumbnail-item {
    aspect-ratio: 4/3;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8f9fa;
    position: relative;
}

.thumbnail-item:hover {
    border-color: #000;
    transform: scale(1.05);
}

.thumbnail-item.active {
    border-color: #000;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-number {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* 进度条 */
.progress-bar {
    width: 100% !important;
    max-width: 900px !important;
    height: 4px !important;
    background: #e0e0e0 !important;
    border-radius: 2px !important;
    overflow: hidden !important;
    margin: 0 auto 20px auto !important;
    display: block !important;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #000, #333);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

/* 自动播放控制 */
.autoplay-controls {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 20px !important;
    margin: 0 auto 30px auto !important;
    max-width: 900px !important;
    width: 100% !important;
}

.autoplay-speed {
    display: flex;
    align-items: center;
    gap: 10px;
}

.autoplay-speed label {
    font-weight: 600;
    color: #333;
}

.autoplay-speed select {
    padding: 8px 12px;
    border: 2px solid #000;
    border-radius: 8px;
    background: #fff;
    font-weight: 500;
    cursor: pointer;
}

/* 全屏模式 */
.fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
}

.fullscreen-overlay.active {
    display: flex;
}

.fullscreen-content {
    position: relative;
    max-width: 95%;
    max-height: 95%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fullscreen-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.fullscreen-close:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
}

#fullscreen-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.fullscreen-controls {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
}

.fullscreen-controls .control-btn {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
}

.fullscreen-controls .control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.8);
}

/* 键盘快捷键提示 */
.keyboard-help {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border: 2px solid #000;
    border-radius: 12px;
    padding: 30px;
    z-index: 3000;
    display: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
}

.keyboard-help.active {
    display: block;
}

.help-content h4 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 700;
    color: #000;
    text-align: center;
}

.help-content ul {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.help-content li {
    padding: 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f0f0f0;
}

.help-content li:last-child {
    border-bottom: none;
}

kbd {
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 8px;
    font-family: monospace;
    font-size: 12px;
    font-weight: 600;
    color: #333;
}

.help-close {
    width: 100%;
    padding: 12px;
    background: #000;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.help-close:hover {
    background: #333;
    transform: translateY(-2px);
}

/* 加载状态 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    font-size: 18px;
    color: #666;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #000;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .slideshow-main {
        padding: 15px;
    }

    .slide-viewer {
        height: 400px;
        margin-bottom: 20px;
    }

    .slide-overlay {
        padding: 20px 15px 15px;
    }

    .slide-title {
        font-size: 16px;
    }

    .slide-controls {
        gap: 10px;
        margin-bottom: 20px;
    }

    .control-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .thumbnails-sidebar {
        width: 100%;
        right: -100%;
    }

    .thumbnails-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 10px;
        padding: 15px;
    }

    .autoplay-controls {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        justify-content: center;
        margin: 0 auto 20px auto;
    }

    .autoplay-speed {
        flex-direction: column;
        gap: 8px;
        justify-content: center;
        align-items: center;
    }
    
    .progress-bar {
        margin: 0 auto 20px auto;
    }

    .fullscreen-controls {
        bottom: -50px;
    }

    .fullscreen-controls .control-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    .keyboard-help {
        padding: 20px;
        max-width: 350px;
    }

    .help-content h4 {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .slide-viewer {
        height: 300px;
    }

    .slide-overlay {
        padding: 15px 10px 10px;
    }

    .slide-title {
        font-size: 14px;
    }

    .control-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .thumbnails-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
        gap: 8px;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .slideshow-container {
        background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    }

    .slide-viewer {
        background: #333;
    }

    .thumbnails-sidebar {
        background: #333;
        border-left: 1px solid #555;
    }

    .thumbnails-header {
        background: #2d2d2d;
        border-bottom-color: #555;
        color: white;
    }

    .thumbnails-header h3 {
        color: white;
    }

    .close-thumbnails {
        color: #ccc;
    }

    .close-thumbnails:hover {
        background: #555;
        color: white;
    }

    .thumbnail-item {
        background: #2d2d2d;
    }

    .progress-bar {
        background: #555;
    }

    .autoplay-speed label {
        color: #ccc;
    }

    .autoplay-speed select {
        background: #333;
        border-color: #555;
        color: white;
    }
}
