/* 隐藏滚动条但保持滚动功能 */
::-webkit-scrollbar {
    width: 0;
    height: 0;
}

html, body {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    width: 0;
    height: 0;
}

/* 分类页面容器 */
.category-container {
    min-height: 100vh;
    background-color: #f5f5f5;
    padding-bottom: 80px;
}

/* 顶部导航栏 */
.category-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background-color: #ffffff;
    border-bottom: 1px solid #f0f0f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin-right: 12px;
    border-radius: 50%;
    transition: background-color 0.3s;
}

.back-btn:hover {
    background-color: #f5f5f5;
}

.back-btn:active {
    background-color: #e8e8e8;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* 筛选区域 */
.filter-sections {
    padding: 10px 0;
    background-color: #ffffff;
    margin-bottom: 6px;
}

/* 每行可横向滑动 */
.filter-row-scrollable {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-bottom: 8px;
}

.filter-row-scrollable:last-child {
    margin-bottom: 0;
}

.filter-row-scrollable::-webkit-scrollbar {
    display: none;
}

/* 滚动容器 */
.filter-scroll-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 16px;
    white-space: nowrap;
}

/* 一级标签 - 默认浅灰背景 */
.filter-label {
    flex-shrink: 0;
    padding: 5px 12px;
    background-color: #f5f5f5;
    color: #666;
    font-size: 13px;
    font-weight: 500;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-label:hover {
    background-color: #e8e8e8;
}

/* 一级标签选中 - 粉色背景 */
.filter-label.active {
    background: linear-gradient(135deg, #ff3366, #ff6b9d);
    color: #ffffff;
}

/* 二级标签 - 默认浅灰背景 */
.filter-option {
    flex-shrink: 0;
    padding: 5px 12px;
    background-color: #f5f5f5;
    color: #666;
    font-size: 13px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.filter-option:hover {
    background-color: #e8e8e8;
}

/* 二级标签选中 - 粉色背景 */
.filter-option.active {
    background: linear-gradient(135deg, #ff3366, #ff6b9d);
    color: #ffffff;
    font-weight: 500;
}

/* 短剧网格 */
.category-drama-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px;
    width: 100%;
    box-sizing: border-box;
}

.category-drama-item {
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    width: 100%;
    min-width: 0;
}

.category-drama-item::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    background: linear-gradient(135deg, rgba(255, 51, 102, 0.1), rgba(255, 107, 157, 0.1));
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    pointer-events: none;
}

.category-drama-item:hover {
    transform: translateY(-8px) scale(1.02);
}

.category-drama-item:hover::before {
    opacity: 1;
}

.category-drama-item:active {
    transform: scale(0.95);
}

.category-drama-cover {
    position: relative;
    width: 100%;
    padding-top: 133%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 8px;
}

.category-drama-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.category-drama-item:hover .category-drama-cover img {
    transform: scale(1.05);
}

.category-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 12px;
    z-index: 10;
}

.category-badge.free {
    background: linear-gradient(135deg, #ff3366, #ff6b9d);
    color: #ffffff;
}

.category-badge.vip {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #333;
}

.category-drama-title {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-drama-meta {
    font-size: 12px;
    color: #999;
}

/* 加载更多 */
.load-more {
    padding: 20px 16px;
    text-align: center;
}

.load-more-btn {
    padding: 12px 40px;
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 24px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.load-more-btn:hover {
    background-color: #f5f5f5;
    border-color: #ccc;
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading 样式 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 16px;
    gap: 12px;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #f0f0f0;
    border-top-color: #ff3366;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    font-size: 14px;
    color: #999;
}

/* 没有更多数据 */
.no-more {
    padding: 20px 16px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

.no-more::before,
.no-more::after {
    content: '';
    display: inline-block;
    width: 40px;
    height: 1px;
    background: #ddd;
    vertical-align: middle;
    margin: 0 10px;
}

/* 响应式设计 */
@media (max-width: 375px) {
    .category-drama-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 12px;
    }

    .filter-label {
        font-size: 13px;
        padding: 6px 14px;
    }

    .filter-option {
        padding: 6px 14px;
        font-size: 13px;
    }
}

@media (min-width: 768px) {
    .category-drama-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
        padding: 20px;
    }
}

@media (min-width: 1024px) {
    .category-drama-grid {
        grid-template-columns: repeat(5, 1fr);
        max-width: 1200px;
        margin: 0 auto;
    }
}
