/* 自定义变量 */
:root {
    --primary-color: #4a6cf7;
    --primary-hover: #3a5ae7;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
}

/* 全局样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background-color: #fff;
}

/* 导航栏样式 */
.navbar {
    padding: 0.8rem 0;
    transition: var(--transition);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 600;
}

.navbar-nav .nav-link {
    color: var(--gray-700);
    font-weight: 500;
    padding: 0.5rem 1rem;
    margin: 0 0.2rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.navbar-nav .nav-link:hover {
    color: var(--primary-color);
    background-color: var(--gray-100);
}

.navbar-nav .nav-link.active {
    color: var(--primary-color);
    background-color: var(--gray-100);
}

/* 黄色文字样式 */
.text-yellow-light {
    color: #FFD700 !important;
}

.text-yellow-dark {
    color: #FFC107 !important;
}

/* 按钮样式 */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 1.25rem;
}

/* 自定义图片样式 */
.custom-image {
    width: 100%;
    height: 225px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: white;
    font-size: 48px;
}

/* 自定义头像样式 */
.custom-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 16px;
}

/* 讲师团队头像样式 - 更大尺寸 */
.instructor-team .custom-avatar {
    width: 300px;
    height: 300px;
    font-size: 64px;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-outline-primary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* 卡片样式 */
.card {
    border-radius: var(--border-radius);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-img-top {
    transition: var(--transition);
}

.card:hover .card-img-top {
    transform: scale(1.05);
}

/* 头部横幅样式 */
header {
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #4a6cf7 0%, #6c5ce7 100%);
    opacity: 0.1;
    z-index: 0;
}

header > .container {
    position: relative;
    z-index: 1;
}

/* 课程卡片样式 */
.course-card {
    position: relative;
}

.course-card .card-body {
    position: relative;
    z-index: 1;
}

.course-card .card-img-top {
    height: 180px;
    object-fit: cover;
}

/* 讲师卡片样式 */
.teacher-card {
    position: relative;
    overflow: hidden;
}

.teacher-card .card-img-top {
    transition: var(--transition);
}

.teacher-card:hover .card-img-top {
    transform: scale(1.1);
}

/* 表单样式 */
.form-control {
    border-radius: var(--border-radius);
    border-color: var(--gray-300);
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(74, 108, 247, 0.25);
}

/* 页脚样式 */
footer {
    background-color: var(--gray-900);
    color: white;
}

footer a {
    transition: var(--transition);
}

footer a:hover {
    color: white !important;
    text-decoration: none;
}

/* 模态框样式 */
.modal-content {
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid var(--gray-200);
}

/* 工具类 */
.text-primary {
    color: var(--primary-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-gray-50 {
    background-color: var(--gray-100);
}

.rounded-pill {
    border-radius: 50px;
}

.shadow-sm {
    box-shadow: var(--box-shadow);
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 响应式设计 */

/* 大型移动设备和小型平板 (768px 及以下) */
@media (max-width: 768px) {
    /* 导航栏响应式设计 */
    .navbar-nav .nav-link {
        padding: 0.8rem 1rem;
        margin: 0;
        border-radius: 0;
    }
    
    .navbar-nav .nav-link.active {
        background-color: transparent;
        color: var(--primary-color);
        border-bottom: 2px solid var(--primary-color);
    }
    
    /* 头部区域响应式设计 */
    header {
        padding: 6rem 0 4rem;
    }
    
    /* 课程卡片响应式设计 */
    .course-card .card-img-top {
        height: 150px;
    }
    
    /* 字体大小响应式调整 */
    .display-4 {
        font-size: 2.25rem;
    }
    
    /* 容器内边距调整 */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* 卡片网格响应式 */
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }
    
    /* 页脚响应式 */
    footer .col-lg-4, 
    footer .col-lg-2 {
        margin-bottom: 2rem;
    }
}

/* 小型移动设备 (576px 及以下) */
@media (max-width: 576px) {
    /* 导航栏响应式 */
    .navbar-brand {
        font-size: 1.25rem;
    }
    
    /* 按钮响应式 */
    .btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* 表单元素响应式 */
    .form-control {
        height: 2.5rem;
        font-size: 0.9rem;
    }
    
    /* 字体大小进一步调整 */
    .display-4 {
        font-size: 1.75rem;
    }
    
    h1, .text-4xl {
        font-size: 1.75rem;
    }
    
    h2, .text-3xl {
        font-size: 1.5rem;
    }
    
    h3, .text-2xl {
        font-size: 1.25rem;
    }
    
    h4, .text-xl {
        font-size: 1.125rem;
    }
    
    /* 课程卡片进一步调整 */
    .course-card .card-img-top {
        height: 120px;
    }
    
    /* 卡片网格进一步调整 */
    .card-grid {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    /* 边距调整 */
    .py-5 { 
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
    
    .py-6 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
    
    /* 视频容器调整 */
    .video-container {
        padding-bottom: 66.25%; /* 3:2 宽高比，更适合移动设备竖屏观看 */
    }
    
    /* 搜索表单调整 */
    .search-form {
        max-width: 100%;
    }
    
    /* 分类筛选按钮调整为全宽 */
    .category-filter button {
        width: calc(50% - 0.25rem);
        text-align: center;
        margin-bottom: 0.5rem;
    }
    
    /* 页脚进一步调整 */
    footer .container {
        text-align: center;
    }
    
    /* 统计卡片响应式 */
    .stat-number {
        font-size: 2rem;
    }
    
    /* 间距调整 */
    .mb-4 { margin-bottom: 1rem !important; }
    .mt-4 { margin-top: 1rem !important; }
    .mb-5 { margin-bottom: 1.5rem !important; }
    .mt-5 { margin-top: 1.5rem !important; }
}

/* 平板和小型桌面 (769px - 992px) */
@media (min-width: 769px) and (max-width: 992px) {
    .card-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    /* 调整触摸目标大小 */
    .btn, .nav-link, .category-filter button {
        min-height: 48px;
        min-width: 48px;
        padding: 0.75rem 1rem;
    }
    
    /* 移除悬停效果，添加触摸反馈 */
    .hover-lift:hover {
        transform: none;
    }
    
    .card:hover {
        transform: none;
    }
    
    .card:hover .card-img-top {
        transform: none;
    }
    
    /* 添加触摸反馈动画 */
    .btn:active, .nav-link:active, .category-filter button:active {
        transform: scale(0.98);
    }
}

/* 横屏移动设备优化 */
@media (max-height: 576px) and (orientation: landscape) {
    header {
        padding: 4rem 0 2rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-details h3 {
        font-size: 1.2rem;
    }
}

/* 打印样式 */
@media print {
    .navbar, footer, .btn, .video-container, .course-actions {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        color: black;
        background-color: white;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
        break-inside: avoid;
    }
}

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

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

/* 加载动画 */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* 悬停效果 */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* 进度条样式 */
.progress {
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    background-color: var(--primary-color);
    transition: width 0.6s ease;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.page-item {
    margin: 0 0.25rem;
}

.page-link {
    color: var(--primary-color);
    border-radius: var(--border-radius);
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    transition: var(--transition);
}

.page-link:hover {
    background-color: var(--gray-100);
    border-color: var(--primary-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* 标签样式 */
.badge {
    border-radius: 50px;
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* VIP徽章样式 */
.vip-badge {
    background-color: #ffd700;
    color: #333;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
    margin-left: 5px;
    vertical-align: middle;
}

.badge.bg-warning.text-white.ml-1 {
    background-color: #ffd700 !important;
    color: #333 !important;
    font-weight: bold;
}

/* 卡片网格样式 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* 视频播放器容器样式 */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.video-container iframe,
.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* 课程大纲样式 */
.course-outline {
    background-color: var(--gray-100);
    border-radius: var(--border-radius);
    padding: 1.5rem;
}

.course-outline-item {
    padding: 1rem;
    margin-bottom: 0.5rem;
    background-color: white;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.course-outline-item:hover {
    border-left-color: var(--primary-color);
    transform: translateX(5px);
}

.course-outline-item.active {
    border-left-color: var(--primary-color);
    background-color: rgba(74, 108, 247, 0.05);
}

/* 统计数字样式 */
.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

.stat-label {
    color: var(--gray-600);
    margin-top: 0.5rem;
}

/* 评分星星样式 */
.rating {
    display: inline-flex;
    color: var(--warning-color);
}

.rating i {
    margin-right: 2px;
}

/* 上传区域样式 */
.upload-area {
    border: 2px dashed var(--gray-300);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
    background-color: var(--gray-50);
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background-color: rgba(74, 108, 247, 0.05);
}

.upload-area.drag-over {
    border-color: var(--primary-color);
    background-color: rgba(74, 108, 247, 0.1);
}

/* 课程搜索框样式 */
.search-form {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-form input {
    padding-left: 3rem;
    padding-right: 1rem;
    height: 3rem;
    border-radius: 50px;
    border: 1px solid var(--gray-300);
    width: 100%;
    transition: var(--transition);
}

.search-form input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(74, 108, 247, 0.25);
    outline: none;
}

.search-form .search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-500);
}

/* 分类筛选样式 */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.category-filter button {
    border: 1px solid var(--gray-300);
    background-color: white;
    color: var(--gray-700);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
}

.category-filter button:hover,
.category-filter button.active {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: white;
}

/* 通知样式 */
.alert {
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    border: none;
    box-shadow: var(--box-shadow);
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

/* 过渡动画 */
.transition-all {
    transition: all 0.3s ease;
}

/* 隐藏元素 */
.hidden {
    display: none !important;
}

/* 文本截断 */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 弹性布局工具类 */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-3 {
    gap: 1rem;
}

.gap-4 {
    gap: 1.5rem;
}

/* 间距工具类 */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }
.mt-6 { margin-top: 4rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }
.mb-6 { margin-bottom: 4rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }
.p-6 { padding: 4rem; }

.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 1rem; padding-bottom: 1rem; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }
.py-6 { padding-top: 4rem; padding-bottom: 4rem; }

.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; }
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 1rem; padding-right: 1rem; }
.px-4 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-5 { padding-left: 3rem; padding-right: 3rem; }
.px-6 { padding-left: 4rem; padding-right: 4rem; }

/* 宽度工具类 */
.w-full { width: 100%; }
.w-16 { width: 4rem; }
.w-40 { width: 10rem; }

/* 高度工具类 */
.h-full { height: 100%; }
.h-16 { height: 4rem; }
.h-40 { height: 10rem; }
.h-14 { height: 3.5rem; }

/* 字体工具类 */
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.font-normal { font-weight: 400; }

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }

/* 文本对齐 */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* 文本颜色 */
.text-gray-400 { color: var(--gray-400); }
.text-gray-500 { color: var(--gray-500); }
.text-gray-600 { color: var(--gray-600); }
.text-gray-700 { color: var(--gray-700); }
.text-gray-800 { color: var(--gray-800); }
.text-gray-900 { color: var(--gray-900); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }
.text-info { color: var(--info-color); }
.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--secondary-color); }