/**
 * LMS学修前端样式
 * 用于学员报数和进度查看页面
 */

/* 仪表盘样式 */
.lms-practice-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.dashboard-header {
    margin-bottom: 30px;
    text-align: center;
}

.dashboard-title {
    font-size: 28px;
    color: #333;
    margin-bottom: 20px;
}

.dashboard-summary {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.summary-item {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    min-width: 120px;
}

.summary-number {
    font-size: 32px;
    font-weight: bold;
    color: #007cba;
    line-height: 1;
}

.summary-label {
    font-size: 14px;
    color: #666;
    margin-top: 8px;
}

/* 学修项目列表 */
.practice-items {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}

.practice-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.2s;
}

.practice-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.item-header {
    margin-bottom: 15px;
}

.item-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

.item-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.practice-type {
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.class-name {
    background: #f3e5f5;
    color: #7b1fa2;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* 进度条 */
.item-progress {
    margin-bottom: 15px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    transition: width 0.3s ease;
}

.progress-stats {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: #666;
}

.current-count {
    font-weight: 600;
    color: #28a745;
}

.percentage {
    color: #007cba;
    font-weight: 500;
}

/* 状态显示 */
.item-status {
    margin-bottom: 15px;
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 8px;
}

.status-not_started {
    background: #fff3cd;
    color: #856404;
}

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

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

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

.progress-analysis {
    font-size: 12px;
}

.status-ahead {
    color: #28a745;
    font-weight: 500;
}

.status-behind {
    color: #dc3545;
    font-weight: 500;
}

.status-on-track {
    color: #007cba;
    font-weight: 500;
}

.status-overdue {
    color: #dc3545;
    font-weight: 500;
}

/* 操作按钮 */
.item-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background: #007cba;
    color: #fff;
}

.btn-primary:hover {
    background: #005a87;
}

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

.btn-secondary:hover {
    background: #545b62;
}

/* 对话框样式 */
.practice-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dialog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
}

.dialog-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

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

.dialog-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.dialog-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dialog-close:hover {
    color: #666;
}

.dialog-body {
    padding: 0 20px;
}

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

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input[type="number"],
.form-group input[type="date"],
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.form-group input[type="number"] {
    width: calc(100% - 60px);
    display: inline-block;
}

.unit-label {
    display: inline-block;
    margin-left: 10px;
    color: #666;
    font-size: 14px;
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

/* 进度页面样式 */
.lms-my-practice-progress {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.progress-header {
    text-align: center;
    margin-bottom: 30px;
}

.progress-header h2 {
    font-size: 24px;
    color: #333;
}

.progress-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.progress-item h3 {
    font-size: 18px;
    color: #333;
    margin: 0 0 15px 0;
}

.progress-info p {
    margin: 8px 0;
    color: #666;
}

/* 提示消息 */
.lms-practice-notice {
    background: #fff3cd;
    color: #856404;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #ffeaa7;
    text-align: center;
}

.no-practice-message {
    background: #f8f9fa;
    padding: 40px 20px;
    text-align: center;
    border-radius: 8px;
    color: #666;
}

/* 图表占位符 */
.chart-placeholder {
    background: #f8f9fa;
    padding: 40px 20px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 30px;
    color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .lms-practice-dashboard {
        padding: 15px;
    }
    
    .dashboard-summary {
        gap: 15px;
    }
    
    .summary-item {
        min-width: 100px;
        padding: 15px;
    }
    
    .summary-number {
        font-size: 24px;
    }
    
    .practice-items {
        grid-template-columns: 1fr;
    }
    
    .practice-item {
        padding: 15px;
    }
    
    .dialog-content {
        width: 95%;
        margin: 10px;
    }
    
    .dialog-header,
    .dialog-body,
    .dialog-footer {
        padding: 15px;
    }
    
    .item-actions {
        flex-direction: column;
    }
    
    .btn {
        text-align: center;
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 详情弹窗 */
.practice-details-dialog .dialog-content {
    max-width: 560px;
}

.practice-details-summary {
    margin-bottom: 20px;
    padding: 14px 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.practice-details-meta {
    margin: 0;
}

.practice-details-row {
    display: flex;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid #eef2f7;
    font-size: 14px;
    line-height: 1.5;
}

.practice-details-row:last-child {
    border-bottom: none;
}

.practice-details-row dt {
    flex: 0 0 88px;
    margin: 0;
    color: #64748b;
    font-weight: 600;
}

.practice-details-row dd {
    flex: 1;
    margin: 0;
    color: #1e293b;
    word-break: break-word;
}

.practice-details-history-title {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
    color: #334155;
}

.practice-details-loading,
.practice-details-empty {
    padding: 16px 0;
    text-align: center;
    color: #64748b;
    font-size: 14px;
}

.report-history {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 280px;
    overflow-y: auto;
}

.report-history .report-item {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    align-items: baseline;
    padding: 10px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #fff;
    font-size: 14px;
}

.report-history .report-date {
    font-weight: 600;
    color: #1e293b;
}

.report-history .report-count {
    color: #b45309;
    font-weight: 600;
}

.report-history .report-duration {
    color: #64748b;
    font-size: 13px;
}

.report-history .report-notes {
    flex: 1 1 100%;
    color: #475569;
    font-size: 13px;
    line-height: 1.5;
}
