/* 收藏页面特定样式 */

/* 页面包装器 */
.favorites-wrapper {
    min-height: 100vh;
    background-color: var(--background-color);
}

/* ========== 页面头部 ========== */
.favorites-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background-color: var(--card-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.favorites-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--primary-color);
    transition: background-color 0.2s;
    text-decoration: none;
}

.favorites-back:hover {
    background-color: rgba(0, 122, 255, 0.1);
}

.favorites-back svg {
    flex-shrink: 0;
}

.favorites-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    flex: 1;
    text-align: center;
}

.favorites-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 36px;
}

.favorites-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-secondary-color);
    cursor: pointer;
    transition: all 0.2s;
}

.favorites-action-btn:hover {
    background-color: rgba(0, 122, 255, 0.1);
    color: var(--primary-color);
}

/* ========== 收藏统计 ========== */
.favorites-stats {
    padding: 12px 16px;
    font-size: 13px;
    color: var(--text-secondary-color);
    background-color: var(--background-color);
    border-bottom: 1px solid var(--border-color);
}

.favorites-count {
    font-weight: 600;
    color: var(--primary-color);
}

/* ========== 收藏列表 ========== */
.favorites-content {
    padding: 8px 0;
}

.favorites-list {
    padding: 0;
}

/* 收藏项 */
.favorite-item {
    background-color: var(--card-color);
    margin-bottom: 8px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
}

.favorite-item:active {
    transform: scale(0.98);
}

/* 编辑模式下的收藏项 */
.favorite-item.edit-mode {
    padding-left: 48px;
}

.favorite-item .select-checkbox {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    display: none;
    transition: all 0.2s;
}

.favorite-item.edit-mode .select-checkbox {
    display: block;
}

.favorite-item .select-checkbox:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.favorite-item .select-checkbox:checked::after {
    content: '✓';
    color: white;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* ========== 批量操作栏 ========== */
.batch-actions {
    position: fixed;
    bottom: 60px;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 16px;
    background-color: var(--card-color);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 100;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.batch-btn {
    padding: 10px 24px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.batch-btn.select-all {
    background-color: var(--background-color);
    color: var(--text-color);
}

.batch-btn.select-all:hover {
    background-color: var(--border-color);
}

.batch-btn.delete-batch {
    background-color: var(--danger-color);
    color: white;
}

.batch-btn.delete-batch:hover {
    background-color: #dc3545;
}

.batch-btn.delete-batch:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== 加载动画 ========== */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    text-align: center;
    background: var(--card-color);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e0e0e0;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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

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

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.empty-text {
    font-size: 16px;
    color: var(--text-secondary-color);
    margin-bottom: 8px;
}

.empty-subtext {
    font-size: 14px;
    color: var(--text-secondary-color);
    opacity: 0.8;
}

.empty-favorites {
    padding: 60px 20px;
    text-align: center;
}

.empty-favorites-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-favorites-text {
    font-size: 15px;
    color: var(--text-secondary-color);
    margin-bottom: 8px;
}

.empty-favorites-subtext {
    font-size: 13px;
    color: var(--text-secondary-color);
    opacity: 0.8;
}

/* ========== 加载更多 ========== */
.load-more {
    display: flex;
    justify-content: center;
    padding: 16px;
}

.load-more-btn {
    padding: 10px 32px;
    background-color: var(--card-color);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.load-more-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

/* ========== 暗黑模式适配 ========== */
@media (prefers-color-scheme: dark) {
    .favorite-item {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }
    
    .batch-btn.select-all {
        background-color: var(--card-color);
    }
    
    .batch-btn.select-all:hover {
        background-color: var(--border-color);
    }
}

/* ========== 响应式调整 ========== */
@media (max-width: 320px) {
    .favorites-header {
        padding: 10px 12px;
    }
    
    .favorites-title {
        font-size: 16px;
    }
    
    .empty-state {
        padding: 60px 20px;
    }
    
    .empty-icon {
        font-size: 48px;
    }
}
