* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header h1 {
    font-size: 24px;
    margin-bottom: 15px;
}

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

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: rgba(255,255,255,0.2);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.tab-btn:hover:not(:disabled) {
    background: rgba(255,255,255,0.3);
}

.tab-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tab-btn.active {
    background: white;
    color: #667eea;
}

/* 主内容区 */
.main-content {
    flex: 1;
    padding: 30px;
}

.panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 24px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.panel-header h2 {
    font-size: 20px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

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

.btn-secondary:hover {
    background: #e0e0e0;
}

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

.btn-danger:hover {
    background: #ff7875;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* 课程系列卡片 */
.series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.series-card {
    border: 2px solid #f0f0f0;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.series-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102,126,234,0.15);
}

.series-card.selected {
    border-color: #667eea;
    background: #f8f9ff;
}

.series-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.series-header h3 {
    font-size: 18px;
    color: #333;
    flex: 1;
}

.series-actions {
    display: flex;
    gap: 8px;
}

.series-info p {
    margin: 8px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

.series-info strong {
    color: #333;
}

/* 课程阶段列表 */
.levels-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.level-item {
    border: 2px solid #f0f0f0;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.level-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102,126,234,0.15);
}

.level-item.selected {
    border-color: #667eea;
    background: #f8f9ff;
}

.level-info {
    flex: 1;
}

.level-info h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
}

.level-info p {
    font-size: 14px;
    color: #666;
    margin: 4px 0;
}

.level-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    margin-left: 16px;
}

.level-switcher {
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    background: #fff;
    color: #333;
    min-width: 200px;
}

.lessons-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 16px;
    padding: 10px 14px;
    background: #f5f7ff;
    border-radius: 6px;
    font-size: 13px;
    color: #555;
}

/* 课程大纲页的课次明细表 */
.outline-lessons {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed #e0e0e0;
    cursor: default;
}

.outline-lessons-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

.lesson-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}

.lesson-table th,
.lesson-table td {
    border: 1px solid #ececec;
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
    line-height: 1.6;
    color: #666;
}

.lesson-table th {
    background: #fafafa;
    color: #333;
    font-weight: 600;
}

.lesson-table tbody tr {
    cursor: pointer;
}

.lesson-table tbody tr:hover {
    background: #f5f7ff;
}

.lesson-table .col-no {
    width: 60px;
    text-align: center;
    color: #333;
}

.lesson-table .col-title {
    width: 180px;
    color: #333;
}

.lesson-table .col-points {
    white-space: pre-wrap;
    word-break: break-word;
}

/* 课程大纲列表 */
.outlines-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.outline-item {
    border: 2px solid #f0f0f0;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.outline-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.outline-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102,126,234,0.15);
}

.outline-item.selected {
    border-color: #667eea;
    background: #f8f9ff;
}

.outline-info {
    flex: 1;
}

.outline-info h3 {
    font-size: 16px;
    color: #333;
    margin-bottom: 10px;
}

.outline-info p {
    font-size: 14px;
    color: #666;
    margin: 6px 0;
}

.outline-info strong {
    color: #333;
}

.outline-actions {
    display: flex;
    gap: 8px;
}

/* 课次网格 */
.lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

.lesson-card {
    border: 2px solid #f0f0f0;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
}

.lesson-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102,126,234,0.15);
}

.lesson-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f0f0f0;
}

.lesson-header h4 {
    font-size: 16px;
    color: #333;
    flex: 1;
}

.lesson-actions {
    display: flex;
    gap: 8px;
}

.lesson-content p {
    margin: 10px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

.lesson-content strong {
    color: #333;
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

.modal-large {
    max-width: 700px;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.modal-header h3 {
    font-size: 18px;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.3s ease;
}

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

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #f0f0f0;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* 提示消息 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    z-index: 2000;
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    background: #52c41a;
}

.toast.error {
    background: #ff4d4f;
}

.toast.warning {
    background: #faad14;
}

.toast.info {
    background: #1890ff;
}

/* 课程体系新增内容 */
.panel-actions {
    display: flex;
    gap: 10px;
}

.level-goals p,
.lesson-content p {
    white-space: pre-wrap;
}

.level-goals {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #e8e8e8;
}

.lesson-images {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.lesson-image {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
}

.lesson-image-role {
    font-size: 12px;
    color: #888;
}

.lesson-image img {
    max-width: 160px;
    max-height: 120px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    cursor: zoom-in;
}

.form-images .lesson-image img {
    cursor: default;
}

.import-tip {
    margin-bottom: 16px;
    padding: 10px 12px;
    background: #f5f7ff;
    border-radius: 6px;
    font-size: 13px;
    color: #555;
    line-height: 1.6;
}

.image-preview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    cursor: zoom-out;
}

.image-preview-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        padding: 15px 20px;
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .nav-tabs {
        flex-wrap: wrap;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .series-grid {
        grid-template-columns: 1fr;
    }
    
    .lessons-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}
