/* 分步向导样式 - 优化用户体验 */

/* CSS变量定义 */
:root {
    /* 主色调 */
    --primary-color: #4055FB;
    --primary-hover: #3447E8;
    --primary-light: #E8EBFF;
    
    /* 渐变色 */
    --gradient-primary: linear-gradient(135deg, #4055FB 0%, #7B68EE 100%);
    --gradient-secondary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    
    /* 中性色 */
    --text-primary: #1F2329;
    --text-secondary: #6B7280;
    --text-muted: #9CA3AF;
    --text-light: #D1D5DB;
    
    /* 背景色 */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8FAFC;
    --bg-tertiary: #F1F5F9;
    --bg-card: #FFFFFF;
    
    /* 边框和阴影 */
    --border-color: #E5E7EB;
    --border-light: #F3F4F6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* 圆角 */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* 间距 */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
}

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100vh;
    overflow: hidden; /* 防止页面滚动 */
}

/* 导航栏样式 */
.navbar {
    background: var(--bg-primary) !important;
    border-bottom: 1px solid var(--border-light);
    padding: var(--spacing-md) 0;
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    text-decoration: none;
    color: var(--text-primary) !important;
    font-weight: 600;
    font-size: 1.25rem;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: var(--spacing-md);
    color: white;
    font-size: 1.2rem;
}

.brand-text {
    font-weight: 600;
    color: var(--text-primary);
}

/* 自动保存状态 */
.auto-save-status {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    padding: 4px 8px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.auto-save-status i {
    color: #10B981;
    font-size: 0.7rem;
}

.auto-save-status.saving {
    color: var(--primary-color);
    background: rgba(64, 85, 251, 0.1);
    border-color: rgba(64, 85, 251, 0.2);
}

.auto-save-status.saving i {
    color: var(--primary-color);
}

.auto-save-status.error {
    color: #EF4444;
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.2);
}

.auto-save-status.error i {
    color: #EF4444;
}

/* 向导容器 */
.wizard-container {
    height: calc(100vh - 70px - 70px); /* 减去导航栏和底部操作栏高度 */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

/* 页面标题区域 */
.page-header {
    text-align: center;
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm) 0;
    flex-shrink: 0;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* 进度指示器 */
.progress-container {
    margin-bottom: var(--spacing-md);
    flex-shrink: 0;
}

.progress-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm);
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    max-width: 100%;
    margin: 0 auto;
    width: 95%;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    flex: 1;
}

.step.active {
    background: var(--primary-light);
    color: var(--primary-color);
}

.step.completed {
    background: #ECFDF5;
    color: #059669;
}

.step-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.step.active .step-icon {
    background: var(--gradient-primary);
    color: white;
    transform: scale(1.1);
}

.step.completed .step-icon {
    background: #10B981;
    color: white;
}

.step-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.3s ease;
    text-align: center;
}

.step.active .step-label {
    color: var(--primary-color);
    font-weight: 600;
}

.step.completed .step-label {
    color: #059669;
    font-weight: 600;
}

/* 向导步骤 */
.wizard-step {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
    flex: 1;
    overflow-y: auto;
    padding: 0 var(--spacing-sm);
}

.wizard-step.active {
    display: flex;
    flex-direction: column;
}

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

.step-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: all 0.3s ease;
    max-width: 100%;
    width: 95%;
    margin: 0 auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.step-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    background: var(--gradient-primary);
    padding: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-shrink: 0;
}

.header-icon {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    backdrop-filter: blur(10px);
}

.header-content {
    flex: 1;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    margin-bottom: var(--spacing-xs);
}

.card-subtitle {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.card-body {
    padding: var(--spacing-md);
    flex: 1;
    overflow-y: auto;
}

/* 表单网格 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
}

/* 表单行布局 */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-row .form-group.full-width {
    grid-column: 1 / -1;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.required {
    color: #EF4444;
    font-weight: 600;
}

.help-icon {
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.help-icon:hover {
    color: var(--primary-color);
}

.form-control {
    padding: var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(64, 85, 251, 0.1);
    transform: translateY(-1px);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.help-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
    opacity: 0.8;
}

.invalid-feedback {
    font-size: 0.75rem;
    color: #EF4444;
    margin-top: var(--spacing-xs);
    display: none;
}

.form-control.is-invalid + .invalid-feedback {
    display: block;
}

/* 教材资料特殊样式 */
.textbook-section {
    margin-bottom: var(--spacing-xl);
}

.section-title h5 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.section-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

.references-section {
    border-top: 1px solid var(--border-light);
    padding-top: var(--spacing-lg);
}

/* 底部操作栏 */
.bottom-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: var(--spacing-sm) 0;
    height: 70px;
}

/* 预览底部导航区域 */
.preview-bottom-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 999;
    padding: var(--spacing-sm) 0;
    height: 70px;
    display: none; /* 初始隐藏 */
}

.actions-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-lg);
}

.actions-left,
.actions-center,
.actions-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.actions-center {
    flex: 1;
    justify-content: center;
}

/* 按钮样式 */
.btn {
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    text-align: center;
    justify-content: center;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.btn-outline-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
}

.btn-outline-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

.btn-lg {
    padding: var(--spacing-lg) var(--spacing-2xl);
    font-size: 1.125rem;
}

/* 生成大纲按钮样式 */
.btn-generate {
    background: linear-gradient(135deg, #4a9b8e 0%, #5ba3a3 100%);
    border: none;
    color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(74, 155, 142, 0.3);
    transition: all 0.3s ease;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-generate:hover {
    background: linear-gradient(135deg, #3d8277 0%, #4a8a8a 100%);
    box-shadow: 0 6px 16px rgba(74, 155, 142, 0.4);
    transform: translateY(-2px);
    color: white;
}

.btn-generate:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(74, 155, 142, 0.3);
}

.btn-generate:focus {
    box-shadow: 0 0 0 3px rgba(74, 155, 142, 0.2);
    color: white;
}

.btn-generate i {
    margin-right: 8px;
    font-size: 1.1em;
}

/* 结果显示区域 */
.result-section {
    margin-top: 0;
}

/* 预览容器 - 与表单填写界面保持一致的宽度 */
.preview-container {
    max-width: 95%;
    width: 95%;
    margin: 0 auto;
    margin-top: var(--spacing-lg);
    margin-bottom: 90px; /* 为底部导航留出空间 */
}

.preview-card {
    background: #f8fffe;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    max-width: 100%;
    margin: 0 auto;
    border: 1px solid var(--border-light);
}


.preview-body {
    padding: var(--spacing-2xl);
    background: transparent;
    border-radius: var(--radius-xl);
}


.title-icon {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    backdrop-filter: blur(10px);
}

.title-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: white;
    margin-bottom: var(--spacing-xs);
}

.title-content p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

.result-actions {
    display: flex;
    gap: var(--spacing-md);
}

.result-body {
    padding: var(--spacing-2xl);
}

.syllabus-content {
    background: transparent;
    padding: var(--spacing-lg) var(--spacing-2xl);
    border-radius: var(--radius-md);
    line-height: 1.8;
    color: var(--text-primary);
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
}

/* 自定义滚动条样式 */
.syllabus-content::-webkit-scrollbar {
    width: 8px;
}

.syllabus-content::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.syllabus-content::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: var(--radius-sm);
    transition: background 0.3s ease;
}

.syllabus-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

.syllabus-content h1,
.syllabus-content h2,
.syllabus-content h3,
.syllabus-content h4 {
    color: var(--text-primary);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.syllabus-content h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: var(--spacing-lg);
    margin-top: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.syllabus-content table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--spacing-lg) 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.syllabus-content table th,
.syllabus-content table td {
    border: 1px solid var(--border-color);
    padding: var(--spacing-md);
    text-align: left;
}

.syllabus-content table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
}

/* 加载模态框 */
.loading-modal .modal-content {
    border: none;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    background: var(--bg-primary);
    max-width: 400px;
    margin: 0 auto;
}

.loading-modal .modal-dialog {
    max-width: 400px;
    margin: 1.75rem auto;
}

.loading-modal .modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

.loading-content {
    text-align: center;
    padding: var(--spacing-2xl);
}

.loading-spinner {
    margin-bottom: var(--spacing-xl);
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-light);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

.loading-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.loading-content p {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-lg);
}

.loading-progress {
    width: 200px;
    height: 4px;
    background: var(--border-light);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 2px;
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .page-title {
        font-size: 1.75rem;
    }
    
    .page-subtitle {
        font-size: 0.9rem;
    }
    
    .progress-steps {
        flex-direction: column;
        gap: var(--spacing-sm);
        padding: var(--spacing-sm);
    }
    
    .step {
        padding: var(--spacing-sm);
    }
    
    .step-icon {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .actions-container {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .actions-left,
    .actions-center,
    .actions-right {
        width: 100%;
        justify-content: center;
    }
    
    .result-header {
        flex-direction: column;
        gap: var(--spacing-lg);
        text-align: center;
    }
    
    .result-actions {
        justify-content: center;
    }
    
    .wizard-container {
        height: calc(100vh - 80px - 70px);
    }
    
    .card-body {
        padding: var(--spacing-lg);
    }
    
    .bottom-actions {
        padding: var(--spacing-sm) 0;
        height: 70px;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.75rem;
    }
    
    .card-header {
        padding: var(--spacing-lg);
    }
    
    .header-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }
    
    .card-title {
        font-size: 1.25rem;
    }
    
    .btn-lg {
        padding: var(--spacing-md) var(--spacing-lg);
        font-size: 1rem;
    }
}

/* 动画效果 */
.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

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

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

/* 打印样式 */
@media print {
    .navbar,
    .bottom-actions,
    .result-actions,
    .progress-container {
        display: none !important;
    }
    
    .wizard-container {
        padding: 0;
    }
    
    .syllabus-content {
        box-shadow: none;
        border: none;
    }
    
    .page-header {
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}

/* ========================================
   历史记录样式
   ======================================== */

/* 历史记录模态框 */
.history-container {
    max-height: 60vh;
    overflow-y: auto;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.history-item {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-lg);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.history-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-lg);
}

.history-info {
    flex: 1;
    min-width: 0;
}

.history-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    line-height: 1.4;
}

.history-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-sm);
    line-height: 1.5;
}

.history-separator {
    margin: 0 var(--spacing-sm);
    color: var(--text-muted);
}

.history-time {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.history-tags {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

.history-tags .badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.history-actions {
    display: flex;
    gap: var(--spacing-xs);
    flex-shrink: 0;
}

.history-actions .btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.history-actions .btn:hover {
    transform: scale(1.1);
}

.empty-history {
    color: var(--text-muted);
    padding: var(--spacing-2xl) var(--spacing-lg);
}

.empty-history .display-1 {
    font-size: 4rem;
    margin-bottom: var(--spacing-lg);
    opacity: 0.5;
}

.empty-history h5 {
    font-weight: 500;
    margin-bottom: var(--spacing-sm);
}

.empty-history p {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .history-item-header {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .history-actions {
        align-self: flex-end;
    }
    
    .history-title {
        font-size: 1rem;
    }
    
    .history-meta {
        font-size: 0.85rem;
    }
    
    .history-time {
        font-size: 0.8rem;
    }
}

/* 历史记录动画 */
@keyframes historyItemSlideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.history-item {
    animation: historyItemSlideIn 0.3s ease-out;
}

/* 历史记录加载状态 */
.history-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-2xl);
    color: var(--text-muted);
}

.history-loading .spinner-border {
    width: 1.5rem;
    height: 1.5rem;
    margin-right: var(--spacing-sm);
}

/* ========================================
   网页形式的教学大纲样式
   ======================================== */

/* 结果显示区域 - 网页形式 */
.result-section {
    display: none;
    background: var(--bg-primary);
    min-height: 100vh;
    overflow-y: auto;
}

.result-section.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

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

/* 网页形式的教学大纲容器 */
.syllabus-webpage {
    max-width: 100%;
    margin: 0;
    background: var(--bg-primary);
    min-height: 100vh;
}

/* 教学大纲页面头部 - 已移除，按钮移至底部 */

/* 教学大纲页面底部操作区域 */
.syllabus-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    padding: var(--spacing-md) var(--spacing-lg);
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.footer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.action-buttons {
    display: flex;
    gap: var(--spacing-sm);
}

/* 教学大纲文档容器 */
.syllabus-document {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-2xl) var(--spacing-lg) calc(var(--spacing-2xl) + 100px) var(--spacing-lg);
    background: var(--bg-primary);
    min-height: calc(100vh - 100px);
}

.syllabus-content {
    font-family: 'Microsoft YaHei', 'SimSun', 'Times New Roman', serif;
    line-height: 1.8;
    color: var(--text-primary);
    font-size: 16px;
}

/* 教学大纲标题样式 */
.syllabus-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: var(--spacing-lg);
    page-break-after: avoid;
}

.syllabus-content h2 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: var(--spacing-2xl);
    margin-bottom: var(--spacing-lg);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: var(--spacing-sm);
    page-break-after: avoid;
}

.syllabus-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
    page-break-after: avoid;
}

.syllabus-content h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
    page-break-after: avoid;
}

/* 段落样式 */
.syllabus-content p {
    margin-bottom: var(--spacing-md);
    text-align: justify;
    text-indent: 2em;
    line-height: 1.8;
}

/* 表格样式 */
.syllabus-content table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--spacing-lg) 0;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    page-break-inside: avoid;
}

.syllabus-content th,
.syllabus-content td {
    border: 1px solid var(--border-color);
    padding: var(--spacing-md);
    text-align: left;
    vertical-align: top;
    line-height: 1.6;
}

.syllabus-content th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
}

.syllabus-content td {
    background: var(--bg-primary);
}

/* 列表样式 */
.syllabus-content ul,
.syllabus-content ol {
    margin: var(--spacing-md) 0;
    padding-left: var(--spacing-xl);
    line-height: 1.8;
}

.syllabus-content li {
    margin-bottom: var(--spacing-sm);
    line-height: 1.8;
}

/* 章节分隔 */
.syllabus-content .section {
    margin-bottom: var(--spacing-2xl);
    page-break-inside: avoid;
}

.syllabus-content .section:not(:last-child) {
    border-bottom: 1px solid var(--border-light);
    padding-bottom: var(--spacing-xl);
}

/* 基本信息表格特殊样式 */
.syllabus-content .basic-info table {
    margin: var(--spacing-lg) 0;
}

.syllabus-content .basic-info th {
    width: 30%;
    background: var(--primary-light);
    color: var(--primary-color);
    font-weight: 600;
}

.syllabus-content .basic-info td {
    width: 70%;
    background: var(--bg-primary);
}

/* 打印样式 */
@media print {
    .syllabus-header {
        display: none;
    }
    
    .syllabus-document {
        padding: 0;
        max-width: none;
        margin: 0;
    }
    
    .syllabus-content {
        font-size: 14px;
        line-height: 1.6;
    }
    
    .syllabus-content h1 {
        font-size: 2rem;
        page-break-after: avoid;
    }
    
    .syllabus-content h2 {
        font-size: 1.5rem;
        page-break-after: avoid;
    }
    
    .syllabus-content table {
        page-break-inside: avoid;
    }
    
    .syllabus-content .section {
        page-break-inside: avoid;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .syllabus-document {
        padding: var(--spacing-lg) var(--spacing-md) calc(var(--spacing-lg) + 100px) var(--spacing-md);
    }
    
    .syllabus-content h1 {
        font-size: 2rem;
    }
    
    .syllabus-content h2 {
        font-size: 1.5rem;
    }
    
    .footer-actions {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .action-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .syllabus-content table {
        font-size: 14px;
    }
    
    .syllabus-content th,
    .syllabus-content td {
        padding: var(--spacing-sm);
    }
}
