/* 隐藏滚动条但保持滚动功能 */
::-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;
}

/* 收藏/历史页面容器 */
.favorites-container {
    min-height: 100vh;
    background-color: #f8f9fa;
    padding-bottom: 80px;
}

/* 顶部导航 */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    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;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s;
}

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

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

.header-actions {
    display: flex;
    align-items: center;
}

.edit-btn {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid #ff3366;
    border-radius: 16px;
    font-size: 13px;
    color: #ff3366;
    cursor: pointer;
    transition: all 0.3s;
}

.edit-btn:hover {
    background: #ff3366;
    color: #ffffff;
}

.edit-btn.active {
    background: #ff3366;
    color: #ffffff;
}

/* 内容区域 */
.favorites-content {
    padding: 16px;
}

/* 网格布局 */
.favorites-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* 收藏/历史项 */
.favorite-item {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.favorite-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.favorite-item.selecting .item-cover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px 12px 0 0;
}

.favorite-item.selected .checkbox {
    background: #ff3366;
    border-color: #ff3366;
}

.favorite-item.selected .checkbox::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 10px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -60%) rotate(45deg);
}

/* 封面区域 */
.item-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
}

.item-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 遮罩层 */
.item-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.episode-count {
    font-size: 12px;
    color: #ffffff;
    background: rgba(255, 51, 102, 0.9);
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    width: fit-content;
}

/* 进度条 */
.progress-bar {
    display: block;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    display: block;
    height: 100%;
    background: #ff3366;
    border-radius: 2px;
}

.progress-text {
    font-size: 11px;
    color: #ffffff;
}

/* 复选框 */
.select-checkbox {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 10;
}

.checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.3);
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
}

/* 信息区域 */
.item-info {
    padding: 12px;
}

.item-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.item-desc {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}

.item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.update-time {
    font-size: 11px;
    color: #bbb;
}

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}

.empty-icon {
    margin-bottom: 20px;
}

.empty-text {
    font-size: 16px;
    color: #666;
    margin-bottom: 8px;
}

.empty-subtext {
    font-size: 13px;
    color: #999;
    margin-bottom: 24px;
}

.browse-btn {
    padding: 12px 32px;
    background: linear-gradient(135deg, #ff3366 0%, #ff6b9d 100%);
    color: #ffffff;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(255, 51, 102, 0.3);
}

.browse-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 51, 102, 0.4);
}

/* 底部操作栏 */
.bottom-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
    z-index: 100;
}

.select-all {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.select-all .checkbox {
    border-color: #ccc;
    background: transparent;
}

.select-all span {
    font-size: 14px;
    color: #666;
}

.select-all.active .checkbox {
    background: #ff3366;
    border-color: #ff3366;
}

.select-all.active .checkbox::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%) rotate(45deg);
    width: 6px;
    height: 10px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
}

.delete-btn {
    padding: 10px 24px;
    background: #ff3366;
    color: #ffffff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.delete-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.delete-btn:not(:disabled):hover {
    background: #e62e5c;
}

/* 响应式设计 */
@media (max-width: 375px) {
    .favorites-grid {
        gap: 12px;
    }

    .item-info {
        padding: 10px;
    }

    .item-title {
        font-size: 13px;
    }

    .item-desc {
        font-size: 11px;
    }

    .update-time {
        font-size: 10px;
    }
}

@media (min-width: 414px) {
    .favorites-grid {
        gap: 20px;
    }

    .item-info {
        padding: 14px;
    }

    .item-title {
        font-size: 15px;
    }
}

/* 删除确认对话框 */
.delete-dialog {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-dialog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.delete-dialog-content {
    position: relative;
    background: #ffffff;
    border-radius: 16px;
    padding: 28px 24px;
    width: 280px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: dialogShow 0.3s ease;
}

@keyframes dialogShow {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.delete-dialog-icon {
    margin-bottom: 16px;
}

.delete-dialog-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
}

.delete-dialog-text {
    font-size: 14px;
    color: #666;
    margin: 0 0 24px 0;
    line-height: 1.5;
}

.delete-dialog-buttons {
    display: flex;
    gap: 12px;
}

.delete-dialog-btn {
    flex: 1;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.delete-dialog-btn-cancel {
    background: #f5f5f5;
    color: #666;
}

.delete-dialog-btn-cancel:hover {
    background: #e8e8e8;
}

.delete-dialog-btn-confirm {
    background: #ff3366;
    color: #ffffff;
}

.delete-dialog-btn-confirm:hover {
    background: #e62e5c;
}

/* Toast 提示 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}
