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

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
header {
    background: linear-gradient(to right, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-top: 5px;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.back-btn {
    color: white;
    text-decoration: none;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateX(-5px);
}

/* 主要内容区域 */
.main-content {
    padding: 40px;
    flex-grow: 1;
}

.buttons-container {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 40px 30px;
    border-radius: 15px;
    width: 300px;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(to right, #ff416c, #ff4b2b);
    color: white;
}

.btn-secondary {
    background: linear-gradient(to right, #2193b0, #6dd5ed);
    color: white;
}

.btn:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.btn i {
    font-size: 4rem;
    margin-bottom: 20px;
}

.btn span {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.btn-desc {
    font-size: 1rem;
    opacity: 0.9;
    margin-top: 10px;
}

/* 内容页面样式 */
.content-page {
    padding: 30px;
    flex-grow: 1;
}

/* 加载指示器 */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    display: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #3498db;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 20px;
}

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

/* ========== 图片容器样式修改 ========== */
.images-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /* 调整最小宽度 */
    gap: 20px;
    margin-bottom: 40px;
}

.image-card {
    background-color: #f8f9fa;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    position: relative; /* 为图片容器添加相对定位 */
}

.image-card:hover {
    transform: translateY(-5px);
}

/* 图片容器设置为2:3比例 */
.image-card::before {
    content: "";
    display: block;
    padding-top: 150%; /* 2:3比例，3/2=1.5=150% */
}

.image-card img {
    position: absolute; /* 绝对定位 */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* 保持比例填充 */
    display: block;
    object-position: center; /* 图片居中显示 */
}




/* ========== 图片加载错误修改 ========== */
/* 图片加载相关样式 */
.image-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f8f9fa;
}

.no-images-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-top: 20px;
}

/* 图片卡片比例 */
.image-card {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3; /* 宽2高3 */
    height: auto;
    overflow: hidden;
}

/* 旧浏览器支持 */
@supports not (aspect-ratio: 2/3) {
    .image-card {
        padding-top: 150%; /* 3/2 = 1.5 = 150% */
        height: 0;
    }
    
    .image-container {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }
}
/* ========== 视频容器样式修改 ========== */
.videos-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); /* 调整最小宽度 */
    gap: 20px;
    margin-bottom: 40px;
}

.video-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    position: relative; /* 为视频卡片添加相对定位 */
}

.video-card:hover {
    transform: translateY(-5px);
}

/* 视频容器设置为9:16比例（抖音标准） */
.video-card::before {
    content: "";
    display: block;
    padding-top: 177.78%; /* 9:16比例，16/9≈1.7778=177.78% */
}

.video-wrapper {
    position: absolute; /* 绝对定位 */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
}

.video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 保持比例填充 */
    display: block;
}

/* 视频加载状态 */
.video-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2;
}

.video-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

/* 视频信息和控制面板 */
.video-info {
    position: relative; /* 恢复相对定位 */
    padding: 15px;
    background-color: white;
    z-index: 1; /* 确保在视频上方 */
}

.video-info p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-info i {
    color: #6a11cb;
}

.video-controls {
    padding: 10px 15px;
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
    display: flex;
    gap: 10px;
    z-index: 1; /* 确保在视频上方 */
}

/* 其他样式保持不变 */
.image-info {
    padding: 15px;
    background-color: white;
}

.image-info p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.image-info i {
    color: #6a11cb;
}

.error-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #e74c3c;
    font-size: 1.2rem;
    background-color: #f8f9fa;
}

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

/* 视频卡片错误状态 */
.video-card.error {
    border: 2px solid #ff6b6b;
    background: #fff5f5;
}

.error-msg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ff6b6b;
    font-size: 16px;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 10;
}

.retry-btn {
    margin-top: 15px;
    padding: 8px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

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

/* 视频控制按钮 */
.btn-small {
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-small.btn-play {
    background: #007bff;
    color: white;
}

.btn-small.btn-play:hover {
    background: #0056b3;
}

.btn-small.btn-mute {
    background: #6c757d;
    color: white;
}

.btn-small.btn-mute:hover {
    background: #545b62;
}

.btn-small.btn-remove {
    background: #dc3545;
    color: white;
    margin-left: auto;
}

.btn-small.btn-remove:hover {
    background: #c82333;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
    transform: translateY(-2px);
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
    transform: translateY(-2px);
}

.load-more-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
}

.stats {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    margin: 20px 0;
}

.stats p {
    margin: 5px 0;
}

.small-text {
    font-size: 12px;
    color: #6c757d;
}

/* 使用说明 */
.instructions {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    margin-top: 40px;
}

.instructions h3 {
    margin-bottom: 15px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.instructions ul {
    list-style-type: none;
    padding-left: 20px;
}

.instructions li {
    margin-bottom: 10px;
    padding-left: 25px;
    position: relative;
}

.instructions li:before {
    content: "•";
    color: #6a11cb;
    font-size: 1.5rem;
    position: absolute;
    left: 0;
    top: -5px;
}

/* 页脚 */
footer {
    background-color: #f1f3f5;
    color: #666;
    text-align: center;
    padding: 20px;
    margin-top: auto;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .buttons-container {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        max-width: 350px;
    }

    header h1 {
        font-size: 2rem;
    }

    .nav {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }

    .images-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }

    .videos-container {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 15px;
    }
}
