/* K12课本网 - 分类导航页面样式 */

/* 全局样式重置 */
* {
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
}

/* 页面头部区域 */
.category-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
    color: white;
    padding: 4rem 0 3rem;
    margin-bottom: 3rem;
}

.category-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

.category-hero .container {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 1rem;
    text-shadow: 0 4px 8px rgba(0,0,0,0.3);
    animation: fadeInUp 0.8s ease-out;
}

.hero-title-link {
    color: white !important;
    text-decoration: none !important;
    transition: all 0.3s ease;
}

.hero-title-link:hover {
    color: rgba(255, 255, 255, 0.9) !important;
    text-shadow: 0 6px 12px rgba(0,0,0,0.4);
    transform: translateY(-2px);
}

.hero-subtitle {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.stat-item {
    text-align: center;
    background: rgba(255,255,255,0.1);
    padding: 1.5rem 2rem;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-5px);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    display: block;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.5rem;
}

/* 快速导航区域 */
.quick-nav-section {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    animation: fadeInUp 0.6s ease-out;
}

.quick-nav-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
}

.quick-nav-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(to right, #667eea, #764ba2);
    border-radius: 2px;
}

.quick-nav-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.quick-nav-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    color: #333;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.quick-nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    transition: left 0.5s;
}

.quick-nav-item:hover::before {
    left: 100%;
}

.quick-nav-item:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    text-decoration: none;
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

.quick-nav-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
    transition: transform 0.3s ease;
}

.quick-nav-item:hover .quick-nav-icon {
    transform: scale(1.1);
}

.quick-nav-text {
    font-weight: 600;
    font-size: 1.1rem;
}

.quick-nav-count {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-top: 0.3rem;
    font-weight: 400;
}

/* 分类导航区域 */
.nav-section {
    background: white;
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    animation: fadeInUp 0.6s ease-out;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 30px;
    background: linear-gradient(to bottom, #667eea, #764ba2);
    border-radius: 2px;
}

.section-icon {
    color: #667eea;
    font-size: 1.5rem;
}

/* 年级分类样式 */
.grade-category {
    margin-bottom: 3rem;
    position: relative;
}

.grade-category-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 1.5rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f8f9ff 0%, #e3f2fd 100%);
    border-radius: 12px;
    border-left: 5px solid #667eea;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.grade-category-title:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateX(5px);
}

.grade-category-icon {
    font-size: 1.2rem;
    opacity: 0.8;
}

.nav-tree {
    margin-left: 1.5rem;
    position: relative;
}

.nav-tree::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, #667eea, #764ba2);
    opacity: 0.3;
}

.grade-item {
    margin-bottom: 2rem;
    position: relative;
}

.grade-link {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    display: block;
    padding: 1rem 1.5rem;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.grade-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #667eea, #764ba2);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.grade-link:hover::before {
    transform: scaleY(1);
}

.grade-link:hover {
    background: linear-gradient(135deg, #f8f9ff 0%, #e3f2fd 100%);
    border-color: #667eea;
    color: #333;
    text-decoration: none;
    transform: translateX(10px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
}

.grade-icon {
    color: #667eea;
    margin-right: 0.75rem;
    font-size: 1.1rem;
}

/* 学期和科目样式 */
.semester-list {
    margin: 1.5rem 0 0 2rem;
    position: relative;
}

.semester-list::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #28a745;
    opacity: 0.4;
}

.semester-item {
    margin-bottom: 1.5rem;
}

.semester-link {
    font-size: 1rem;
    font-weight: 500;
    color: #495057;
    text-decoration: none;
    display: block;
    padding: 0.75rem 1.25rem;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    border-left: 3px solid #28a745;
    transition: all 0.3s ease;
    position: relative;
}

.semester-link:hover {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    text-decoration: none;
    transform: translateX(8px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
}

.semester-icon {
    color: #28a745;
    margin-right: 0.5rem;
}

.subject-list {
    margin: 1rem 0 0 3rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.subject-link {
    font-size: 0.9rem;
    color: #6c757d;
    text-decoration: none;
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.subject-link:hover {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    text-decoration: none;
    border-color: #17a2b8;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.3);
}

.subject-icon {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* 科目分类网格 */
.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.subject-category-block {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.subject-category-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(to right, #667eea, #764ba2);
}

.subject-category-block:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.subject-category-title {
    font-weight: 700;
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.category-icon {
    color: #667eea;
    font-size: 1.1rem;
}

.subject-category-block .subject-link {
    margin-bottom: 0.75rem;
    margin-right: 0.75rem;
}

/* 导航数量显示样式 */
.nav-count {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 400;
    margin-left: 0.5rem;
    opacity: 0.8;
}

.grade-link .nav-count,
.semester-link .nav-count,
.subject-link .nav-count {
    float: right;
    margin-left: auto;
    margin-right: 0;
    background: rgba(0,0,0,0.1);
    padding: 0.15rem 0.4rem;
    border-radius: 10px;
    font-size: 0.75rem;
}

.grade-link:hover .nav-count,
.semester-link:hover .nav-count,
.subject-link:hover .nav-count {
    background: rgba(255,255,255,0.2);
    color: white;
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    
    .stat-item {
        padding: 1rem 1.5rem;
        min-width: 200px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .quick-nav-section,
    .nav-section {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .quick-nav-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    .quick-nav-item {
        padding: 1rem;
    }
    
    .quick-nav-icon {
        font-size: 1.5rem;
    }
    
    .quick-nav-text {
        font-size: 1rem;
    }
    
    .nav-tree {
        margin-left: 0.5rem;
    }
    
    .semester-list {
        margin-left: 1rem;
    }
    
    .subject-list {
        margin-left: 1.5rem;
    }
    
    .subject-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .grade-link,
    .semester-link {
        font-size: 0.95rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .grade-category-title {
        font-size: 1.2rem;
        padding: 0.75rem 1rem;
    }
}

@media (max-width: 480px) {
    .category-hero {
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    .quick-nav-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .subject-category-block {
        padding: 1.5rem;
    }
}

/* 滚动条美化 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(to bottom, #667eea, #764ba2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(to bottom, #5a6fd8, #6a4190);
}

/* 加载动画 */
.loading {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.loading.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* 特殊效果 */
.grade-link,
.semester-link,
.subject-link,
.quick-nav-item {
    position: relative;
    overflow: hidden;
}

.grade-link::after,
.semester-link::after,
.subject-link::after,
.quick-nav-item::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    transition: all 0.5s ease;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.grade-link:active::after,
.semester-link:active::after,
.subject-link:active::after,
.quick-nav-item:active::after {
    width: 200px;
    height: 200px;
}

/* 右栏科目分类样式优化 */
.col-lg-4 .nav-section,
.col-md-5 .nav-section {
    /* 移除粘性定位，让左右栏同步滚动 */
}

.col-lg-4 .subject-category-block,
.col-md-5 .subject-category-block {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.col-lg-4 .subject-category-title,
.col-md-5 .subject-category-title {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

.col-lg-4 .subject-link,
.col-md-5 .subject-link {
    display: block;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.col-lg-4 .subject-link:hover,
.col-md-5 .subject-link:hover {
    background: #f8f9fa;
    transform: translateX(5px);
}

.col-lg-4 .subject-icon,
.col-md-5 .subject-icon {
    font-size: 0.8rem;
    margin-right: 0.5rem;
    color: #6c757d;
}

.col-lg-4 .nav-count,
.col-md-5 .nav-count {
    font-size: 0.8rem;
    color: #6c757d;
    float: right;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .row {
        flex-direction: column;
    }
    
    .col-lg-4,
    .col-md-5 {
        margin-top: 2rem;
        order: 2;
    }
    
    .col-lg-8,
    .col-md-7 {
        order: 1;
    }
    
    /* 移动端左右栏正常滚动 */
}
