/* Deep Reading Category Select Page CSS - 深度阅览分类选择页面样式 */

/* ========== CSS 变量 ========== */
:root {
    /* 分类颜色 */
    --deep-reading-color-amber: #f59e0b;
    --deep-reading-color-amber-light: #fef3c7;
    --deep-reading-color-emerald: #10b981;
    --deep-reading-color-emerald-light: #d1fae5;
    --deep-reading-color-blue: #3b82f6;
    --deep-reading-color-blue-light: #dbeafe;
    --deep-reading-color-purple: #8b5cf6;
    --deep-reading-color-purple-light: #ede9fe;
    --deep-reading-color-pink: #ec4899;
    --deep-reading-color-pink-light: #fce7f3;
}

/* ========== 页面布局 ========== */
.category-select-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
    position: relative;
}

/* ========== 返回按钮 ========== */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--bs-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    transition: all 0.2s ease;
    padding: 0.5rem 0.75rem;
    border-radius: var(--bs-border-radius);
}

.back-button:hover {
    color: var(--bs-primary);
    background: rgba(74, 158, 255, 0.08);
}

.back-button i {
    font-size: 1.1rem;
}

/* ========== 页面头部 ========== */
.category-select-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding: 2rem 1.5rem;
    background: linear-gradient(135deg, #fef9f3 0%, #fdf2e9 100%);
    border-radius: var(--bs-border-radius-xl);
}

.category-select-header-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    background: #fff;
    border-radius: var(--bs-border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f59e0b;
    box-shadow: var(--bs-box-shadow);
    font-size: 1.5rem;
}

.category-select-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #222;
}

.category-select-header p {
    color: var(--bs-secondary);
    font-size: 1.05rem;
    margin: 0;
}

/* ========== 分类网格布局 ========== */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* ========== 分类卡片 ========== */
.category-card {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    border-radius: var(--bs-border-radius-xl);
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
    display: block;
    padding: 1.5rem 1.25rem;
    text-align: center;
}

/* 卡片交互效果 */
.category-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    border-color: transparent;
}

/* 触摸设备和焦点状态 */
.category-card:active,
.category-card:focus {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* 无 hover 能力的设备 */
@media (hover: none) {
    .category-card:hover {
        transform: none;
    }
}

/* ========== 卡片图标 ========== */
.category-card-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    border-radius: var(--bs-border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    font-weight: bold;
}

.category-card:hover .category-card-icon {
    transform: scale(1.15) translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.category-card-icon i,
.category-card-icon span {
    line-height: 1;
    font-weight: bold;
}

/* 确保 Bootstrap 图标继承颜色并增加对比度 */
.category-card-icon .bi,
.category-card-icon .bi::before {
    color: inherit !important;
    font-weight: bold !important;
}

/* ========== 卡片标题 ========== */
.category-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #333;
    transition: color 0.3s ease;
}

.category-card:hover .category-card-title {
    color: #222;
}

/* ========== 卡片描述 ========== */
.category-card-desc {
    font-size: 0.9rem;
    color: var(--bs-secondary);
    margin: 0;
    transition: color 0.3s ease;
}

.category-card:hover .category-card-desc {
    color: #666;
}

/* ========== 多彩卡片背景 ========== */
.category-card[data-color="amber"] .category-card-icon {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #78350f;
}

.category-card[data-color="emerald"] .category-card-icon {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
}

.category-card[data-color="blue"] .category-card-icon {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

.category-card[data-color="purple"] .category-card-icon {
    background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
    color: #5b21b6;
}

.category-card[data-color="pink"] .category-card-icon {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    color: #9d174d;
}

/* ========== 响应式设计 ========== */
@media (max-width: 767px) {
    .category-select-page {
        padding: 1rem 0.75rem;
    }
    
    .back-button {
        font-size: 0.9rem;
        margin-bottom: 1rem;
        padding: 0.4rem 0.6rem;
    }
    
    .category-select-header {
        padding: 1.5rem 1rem;
        margin-bottom: 1.5rem;
    }
    
    .category-select-header-icon {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
        margin-bottom: 0.75rem;
    }
    
    .category-select-header h1 {
        font-size: 1.5rem;
    }
    
    .category-select-header p {
        font-size: 0.95rem;
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }
    
    .category-card {
        padding: 1.25rem 1rem;
    }
    
    .category-card-icon {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }
    
    .category-card-title {
        font-size: 1rem;
    }
    
    .category-card-desc {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .category-card {
        padding: 1rem 0.75rem;
    }
    
    .category-card-icon {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
        margin-bottom: 0.5rem;
    }
    
    .category-card-title {
        font-size: 0.9rem;
    }
    
    .category-card-desc {
        font-size: 0.8rem;
    }
}
