/* ============================================
   电竞学苑 - 自定义样式表
   作者: 网站项目实训
   描述: 响应式课程学习网站样式
   断点: 320px(手机), 768px(平板), 1200px(PC)
   ============================================ */

/* ---------- 全局样式 ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    overflow-x: hidden;
}

/* ---------- 滚动条美化 ---------- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

/* ---------- 导航栏样式 ---------- */
.navbar {
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-size: 1.5rem;
    letter-spacing: 1px;
}

.nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover {
    transform: translateY(-2px);
}

/* ---------- 轮播图样式 ---------- */
.carousel-item img {
    height: 400px;
    object-fit: cover;
}

@media (max-width: 768px) {
    .carousel-item img {
        height: 250px;
    }
    
    .carousel-caption h5 {
        font-size: 1rem;
    }
    
    .carousel-caption p {
        font-size: 0.8rem;
    }
}

.carousel-caption {
    background: rgba(0,0,0,0.6);
    border-radius: 10px;
    padding: 15px;
    bottom: 20%;
}

/* ---------- 公告栏样式 - 修复文字溢出 ---------- */
.alert-info {
    overflow: hidden;
    flex-wrap: wrap;
}

.marquee-text {
    overflow: hidden;
    white-space: normal;
    word-break: break-word;
    flex: 1;
    line-height: 1.5;
}

/* ---------- 热门课程卡片样式 ---------- */
.course-card {
    transition: all 0.3s ease;
    border: none;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.course-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
}

.course-card img {
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.course-card:hover img {
    transform: scale(1.05);
}

.course-card .card-body {
    padding: 1.5rem;
}

.course-card .card-title {
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #1e293b;
}

.course-card .card-text {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.course-tag {
    display: inline-block;
    padding: 4px 12px;
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 10px;
}

/* ---------- 特色卡片样式 (过渡效果) ---------- */
.feature-card {
    transition: all 0.3s ease;
    border: 1px solid #e2e8f0;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-color: #3b82f6;
}

.feature-card i {
    transition: transform 0.3s ease;
}

.feature-card:hover i {
    transform: scale(1.1);
}

/* ---------- 课程列表页样式 ---------- */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 30px;
    justify-content: center;
}

.filter-btn {
    padding: 8px 20px;
    border: 2px solid #e2e8f0;
    background: white;
    border-radius: 30px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
}

.filter-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.filter-btn.active {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border-color: transparent;
    color: white;
}

/* ---------- 课程详情页样式 ---------- */
.detail-header {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    color: white;
    padding: 60px 0;
    margin-bottom: 40px;
}

.detail-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

.teacher-info {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 15px;
    margin: 20px 0;
}

.teacher-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.outline-list {
    list-style: none;
    padding-left: 0;
}

.outline-list li {
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.outline-list li i {
    color: #3b82f6;
    font-size: 1.2rem;
}

.resource-link {
    display: inline-block;
    padding: 10px 20px;
    background: #f1f5f9;
    color: #1e293b;
    text-decoration: none;
    border-radius: 10px;
    margin-right: 15px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.resource-link:hover {
    background: #3b82f6;
    color: white;
    transform: translateY(-2px);
}

/* ---------- 登录页样式 (CSS动画) ---------- */
.login-container {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 40px 20px;
}

.login-card {
    background: white;
    border-radius: 25px;
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header i {
    font-size: 3rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102,126,234,0.25);
}

/* ---------- 在线答疑页样式 ---------- */
.qa-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
}

.question-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.question-card:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.question-title {
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 10px;
}

.question-meta {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-bottom: 10px;
}

.question-content {
    color: #475569;
    margin-bottom: 15px;
}

.answer-box {
    background: #f8fafc;
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
    border-left: 4px solid #3b82f6;
}

.reply-form {
    margin-top: 15px;
    display: flex;
    gap: 10px;
}

.reply-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    outline: none;
    transition: all 0.3s ease;
}

.reply-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.2);
}

/* ---------- 响应式适配 ---------- */
/* 平板设备 (768px) */
@media (max-width: 768px) {
    .detail-header {
        padding: 40px 0;
    }
    
    .detail-header h1 {
        font-size: 1.8rem;
    }
    
    .teacher-info {
        flex-direction: column;
        text-align: center;
    }
    
    .login-card {
        padding: 30px 20px;
    }
    
    .reply-form {
        flex-direction: column;
    }
}

/* 手机设备 (320px) */
@media (max-width: 480px) {
    .course-card img {
        height: 160px;
    }
    
    .feature-card {
        padding: 20px !important;
    }
    
    .detail-content {
        padding: 20px;
    }
    
    .resource-link {
        display: block;
        text-align: center;
        margin-right: 0;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
}

/* ---------- 辅助类 ---------- */
.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1rem;
}

.text-gradient {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
}

.btn-primary-custom {
    background: linear-gradient(135deg, #3b82f6, #8b5cf6);
    border: none;
    padding: 10px 25px;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.btn-primary-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(59,130,246,0.4);
}