/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏样式 */
.navbar {
    background-color: #c00;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-logo h2 {
    color: white;
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-item {
    margin: 0 15px;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: #ffd700;
}

.nav-buttons {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #ffd700;
    color: #c00;
}

.btn-primary:hover {
    background-color: #ffc400;
}

.btn-secondary {
    background-color: #fff;
    color: #c00;
    border: 1px solid #c00;
}

.btn-secondary:hover {
    background-color: #f0f0f0;
}

.btn-admin {
    background-color: #333;
    color: white;
}

.btn-admin:hover {
    background-color: #555;
}

/* 主要内容样式 */
.main-content {
    min-height: calc(100vh - 140px);
}

/* 横幅样式 */
.hero {
    background: linear-gradient(135deg, #c00, #800);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.btn-lg {
    padding: 12px 30px;
    font-size: 1.1rem;
}

/* 区块样式 */
.section {
    padding: 60px 0;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
    color: #c00;
}

.bg-light {
    background-color: #f8f9fa;
}

/* 课程卡片样式 */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.course-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.course-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.course-content {
    padding: 20px;
}

.course-content h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: #333;
}

.course-content p {
    color: #666;
    margin-bottom: 15px;
}

.course-meta {
    display: flex;
    justify-content: space-between;
    color: #888;
    font-size: 0.9rem;
}

/* 统计卡片样式 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.stat-card {
    text-align: center;
    padding: 30px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 2rem;
    color: #c00;
    margin-bottom: 10px;
}

.stat-card p {
    color: #666;
}

/* 新闻列表样式 */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.news-item {
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.news-item h3 {
    color: #c00;
    margin-bottom: 10px;
}

.news-item p {
    color: #666;
    margin-bottom: 15px;
}

.news-date {
    color: #888;
    font-size: 0.9rem;
}

/* 页脚样式 */
.footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 30px 0;
}

/* 课程列表页面样式 */
.filter-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.filter-group label {
    font-weight: 500;
    margin-right: 10px;
    color: #333;
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.courses-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.course-item {
    display: flex;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.course-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.course-item-image {
    width: 250px;
    height: 180px;
    object-fit: cover;
}

.course-item-content {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.course-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 15px 0;
}

.meta-item {
    font-size: 0.9rem;
    color: #666;
}

/* 考试页面样式 */
.exams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.exam-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.exam-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.exam-card h3 {
    font-size: 1.3rem;
    color: #c00;
    margin-bottom: 10px;
}

.exam-card p {
    color: #666;
    margin-bottom: 15px;
}

.exam-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 15px 0;
    font-size: 0.9rem;
    color: #666;
}

.exam-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 15px 0;
    font-size: 0.9rem;
    color: #666;
}

.exam-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.exam-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.exam-status.not-taken {
    background-color: #f8d7da;
    color: #721c24;
}

.exam-records {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.record-info h4 {
    color: #333;
    margin-bottom: 5px;
}

.record-info p {
    color: #666;
    font-size: 0.9rem;
}

.record-score {
    display: flex;
    align-items: center;
    gap: 15px;
}

.score {
    font-size: 1.2rem;
    font-weight: bold;
    color: #c00;
}

.status.passed {
    background-color: #d4edda;
    color: #155724;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
}

/* 个人中心样式 */
.profile-layout {
    display: flex;
    gap: 30px;
}

.profile-sidebar {
    width: 250px;
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.user-info {
    text-align: center;
    margin-bottom: 30px;
}

.user-avatar img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
}

.user-info h3 {
    color: #333;
    margin-bottom: 5px;
}

.user-info p {
    color: #666;
    font-size: 0.9rem;
}

.profile-nav ul {
    list-style: none;
}

.profile-nav li {
    margin-bottom: 10px;
}

.profile-nav a {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.profile-nav a:hover,
.profile-nav a.active {
    background-color: #c00;
    color: white;
}

.profile-main {
    flex: 1;
}

.profile-section {
    display: none;
    background: white;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.profile-section.active {
    display: block;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.stat-card h3 {
    font-size: 1.5rem;
    color: #c00;
    margin-bottom: 5px;
}

.course-progress-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.course-progress-item {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.course-progress-info h4 {
    color: #333;
    margin-bottom: 5px;
}

.course-progress-info p {
    color: #666;
    font-size: 0.9rem;
}

.course-progress-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 15px 0;
}

.progress-bar {
    flex: 1;
    height: 10px;
    background-color: #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #c00;
    border-radius: 5px;
}

.progress-text {
    font-size: 0.9rem;
    color: #666;
    min-width: 40px;
}

.exam-results {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.exam-result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.exam-result-info h4 {
    color: #333;
    margin-bottom: 5px;
}

.exam-result-info p {
    color: #666;
    font-size: 0.9rem;
}

.exam-result-score {
    display: flex;
    align-items: center;
    gap: 15px;
}

.exam-result-score .score {
    font-size: 1.2rem;
    font-weight: bold;
    color: #c00;
}

.learning-records,
.exam-records {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.record-info h4 {
    color: #333;
    margin-bottom: 5px;
}

.record-info p {
    color: #666;
    font-size: 0.9rem;
}

.record-actions {
    display: flex;
    gap: 10px;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.9rem;
}

.certificates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.certificate-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.certificate-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.certificate-info {
    padding: 20px;
    text-align: center;
}

.certificate-info h4 {
    color: #333;
    margin-bottom: 10px;
}

.certificate-info p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.settings-form {
    display: grid;
    gap: 20px;
    max-width: 500px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
}

.btn-page {
    padding: 8px 15px;
    background-color: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
}

.btn-page.active {
    background-color: #c00;
    color: white;
    border-color: #c00;
}

.btn-page:hover:not(.active) {
    background-color: #e9ecef;
}

.page-numbers {
    display: flex;
    gap: 5px;
}

/* 后台管理样式 */
.admin-layout {
    display: flex;
    min-height: calc(100vh - 140px);
}

.admin-sidebar {
    width: 250px;
    background-color: #333;
    color: white;
    transition: all 0.3s;
}

.sidebar-header {
    padding: 20px;
    background-color: #c00;
    text-align: center;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.sidebar-menu {
    padding: 0;
    list-style: none;
}

.sidebar-menu li {
    border-bottom: 1px solid #444;
}

.sidebar-menu a {
    display: block;
    padding: 15px 20px;
    color: #ddd;
    text-decoration: none;
    transition: all 0.3s;
}

.sidebar-menu a:hover,
.sidebar-menu a.active {
    background-color: #c00;
    color: white;
    border-left: 4px solid #ffd700;
}

.admin-main {
    flex: 1;
    padding: 20px;
    background-color: #f5f5f5;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.admin-header h1 {
    margin: 0;
    color: #c00;
}

.admin-section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.admin-table {
    overflow-x: auto;
}

.admin-table table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.admin-table tr:hover {
    background-color: #f8f9fa;
}

.status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

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

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

.admin-actions {
    display: flex;
    gap: 10px;
}

.admin-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.admin-btn-primary {
    background-color: #c00;
    color: white;
}

.admin-btn-primary:hover {
    background-color: #a00;
}

.admin-btn-secondary {
    background-color: #6c757d;
    color: white;
}

.admin-btn-secondary:hover {
    background-color: #5a6268;
}

.admin-btn-success {
    background-color: #28a745;
    color: white;
}

.admin-btn-success:hover {
    background-color: #218838;
}

.admin-btn-danger {
    background-color: #dc3545;
    color: white;
}

.admin-btn-danger:hover {
    background-color: #c82333;
}

/* 模态框样式 */
.admin-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
}

.admin-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-modal-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.admin-modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-modal-header h3 {
    margin: 0;
    color: #333;
}

.admin-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.admin-modal-close:hover {
    color: #333;
}

.admin-modal-body {
    padding: 20px;
}

.admin-modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.admin-form-group {
    margin-bottom: 20px;
}

.admin-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.admin-form-group input,
.admin-form-group select,
.admin-form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.admin-form-group input:focus,
.admin-form-group select:focus,
.admin-form-group textarea:focus {
    outline: none;
    border-color: #c00;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-item {
        margin: 5px 10px;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    
    .section {
        padding: 40px 0;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .courses-grid,
    .exams-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .course-item {
        flex-direction: column;
    }
    
    .course-item-image {
        width: 100%;
        height: 200px;
    }
    
    .filter-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .profile-layout {
        flex-direction: column;
    }
    
    .profile-sidebar {
        width: 100%;
    }
    
    .admin-layout {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
    }
    
    .certificates-grid {
        grid-template-columns: 1fr;
    }
}