/* 全局样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* 导航栏样式 */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* 卡片样式 */
.card {
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.course-card {
    height: 100%;
}

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

/* 按钮样式 */
.btn {
    border-radius: 25px;
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(45deg, #007bff, #0056b3);
    border: none;
}

.btn-primary:hover {
    background: linear-gradient(45deg, #0056b3, #004085);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(45deg, #28a745, #1e7e34);
    border: none;
}

.btn-success:hover {
    background: linear-gradient(45deg, #1e7e34, #155724);
    transform: translateY(-2px);
}

.btn-purple {
    background: linear-gradient(45deg, #6f42c1, #5a32a3);
    border: none;
    color: white;
}

.btn-purple:hover {
    background: linear-gradient(45deg, #5a32a3, #4c2a85);
    transform: translateY(-2px);
    color: white;
}

.text-purple {
    color: #6f42c1 !important;
}

/* 表单样式 */
.form-control {
    border-radius: 10px;
    border: 2px solid #e9ecef;
    padding: 12px 15px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* 管理后台样式 */
.admin-sidebar {
    background: #343a40;
    min-height: calc(100vh - 56px);
}

.admin-sidebar .nav-link {
    color: #adb5bd;
    padding: 12px 20px;
    border-radius: 5px;
    margin: 2px 10px;
    transition: all 0.3s ease;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background: #495057;
    color: #fff;
}

.admin-sidebar .nav-link i {
    width: 20px;
    text-align: center;
    margin-right: 10px;
}

/* 统计卡片 */
.stats-card {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.stats-card.success {
    background: linear-gradient(45deg, #28a745, #1e7e34);
}

.stats-card.warning {
    background: linear-gradient(45deg, #ffc107, #e0a800);
}

.stats-card.info {
    background: linear-gradient(45deg, #17a2b8, #138496);
}

.stats-card h3 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

/* 表格样式 */
.table {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.table thead th {
    background: #f8f9fa;
    border: none;
    font-weight: 600;
    color: #495057;
    padding: 15px;
}

.table tbody td {
    padding: 15px;
    border-top: 1px solid #e9ecef;
    vertical-align: middle;
}

/* 课程学习页面 */
.course-sidebar {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    height: fit-content;
}

.chapter-title {
    font-weight: 600;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 12px 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 5px;
}

.lesson-item {
    padding: 8px 15px;
    margin: 2px 0;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    font-size: 14px; /* 减小字体大小 */
}

.lesson-item:hover {
    background: #e9ecef;
}

.lesson-item.active {
    background: #007bff;
    color: white;
}

.lesson-item.completed {
    background: #28a745;
    color: white;
}

.lesson-item i {
    margin-right: 8px;
    width: 16px;
}

/* 视频播放器 */
.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}

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

/* Markdown内容样式 */
.markdown-content {
    line-height: 1.8;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4,
.markdown-content h5,
.markdown-content h6 {
    margin-top: 30px;
    margin-bottom: 15px;
    color: #333;
}

.markdown-content h1 {
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.markdown-content h2 {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 8px;
}

.markdown-content pre {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    padding: 15px;
    overflow-x: auto;
}

.markdown-content code {
    background: #f8f9fa;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 0.9em;
}

.markdown-content blockquote {
    border-left: 4px solid #007bff;
    padding-left: 15px;
    margin: 20px 0;
    color: #6c757d;
    font-style: italic;
}

/* 搜索框样式 */
.search-form {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .course-card .card-img-top {
        height: 150px;
    }
    
    .stats-card h3 {
        font-size: 2rem;
    }
    
    .admin-sidebar {
        min-height: auto;
    }
    
    .course-sidebar {
        margin-top: 20px;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

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

/* 成功/错误状态 */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.8em;
    font-weight: 500;
}

.status-published {
    background: #d4edda;
    color: #155724;
}

.status-draft {
    background: #f8d7da;
    color: #721c24;
}

.status-active {
    background: #d1ecf1;
    color: #0c5460;
}

.status-inactive {
    background-color: #6c757d;
    color: white;
}

/* 管理功能卡片样式 */
.management-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 25px 20px;
    height: 100%;
    transition: all 0.3s ease;
    text-align: center;
}

.management-card:hover {
    border-color: #007bff;
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,123,255,0.15);
}

.management-card h6 {
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
}

.management-card p {
    font-size: 0.9rem;
    margin-bottom: 15px;
    min-height: 40px;
}

.management-card .btn {
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: 500;
}
/* 课时对齐样式 */
.lesson-outline-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

.lesson-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lesson-duration {
    min-width: 80px;
    text-align: right;
    color: #6c757d;
}

/* 章节标题样式改进 */
.chapter-title {
    font-weight: 600;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 12px 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 5px;
}

/* 课时列表样式 */
.lessons-list {
    margin-left: 15px;
    margin-bottom: 20px;
}

.lesson-item {
    font-size: 14px;
}
