/* 全局样式 */
:root {
    --primary-color: #1e88e5;
    --secondary-color: #64b5f6;
    --dark-color: #0d47a1;
    --light-color: #e3f2fd;
    --success-color: #43a047;
    --warning-color: #ffa000;
    --danger-color: #e53935;
}

body {
    font-family: "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

/* 头部样式 */
header {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

/* 卡片样式 */
.card {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 8px;
    margin-bottom: 20px;
}

.card-header {
    border-radius: 8px 8px 0 0 !important;
}

/* 按钮样式 */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--dark-color);
    border-color: var(--dark-color);
}

/* 任务列表样式 */
.tasks-container {
    max-height: 600px;
    overflow-y: auto;
}

#current-tasks {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.task-item {
    cursor: pointer;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.task-item:hover {
    background-color: #f0f0f0;
}

.task-item.active {
    border-left-color: var(--primary-color);
    background-color: var(--light-color);
}

.task-status {
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 20px;
    display: inline-block;
    cursor: pointer;
    min-width: 90px;
    text-align: center;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
}

.task-status:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.status-pending {
    background-color: #e0e0e0;
    color: #616161;
}

.status-processing {
    background-color: var(--warning-color);
    color: white;
}

.status-success {
    background-color: var(--success-color);
    color: white;
}

.status-failed {
    background-color: var(--danger-color);
    color: white;
}

/* 解析内容样式 */
#explanation-content, #result-content {
    min-height: 200px;
    padding: 15px;
    overflow-y: auto;
    max-height: 70vh;
}

/* MathML公式样式 */
math {
    font-size: 1.1em;
    margin: 0 3px;
}

/* MathJax LaTeX公式样式 */
.MathJax {
    font-size: 1.1em !important;
    margin: 0 3px;
}

.MathJax_Display {
    margin: 1em 0 !important;
    text-align: center !important;
}

/* MathJax SVG 输出样式 */
.MathJax svg {
    vertical-align: middle;
}

/* MathJax CHTML 输出样式 */
.MathJax_CHTML {
    display: inline-block;
    line-height: normal;
    word-spacing: normal;
    word-wrap: normal;
    min-width: 0;
    min-height: 0;
    text-align: left;
    text-indent: 0;
    text-transform: none;
    font-style: normal;
    font-weight: normal;
    font-size: 100%;
    font-size-adjust: none;
    letter-spacing: normal;
    border: 0;
    padding: 0;
    margin: 0;
}

/* 解析内容中的图片样式 */
#explanation-content img, #result-content img {
    max-width: 100%;
    height: auto;
    margin: 10px 0;
    border-radius: 4px;
}

/* 模态框样式 */
.modal-header.bg-primary {
    color: white;
}

.btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* 数学公式样式 */
.math {
    font-size: 1.1em;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .col-md-3, .col-md-9 {
        padding: 0 10px;
    }
}

/* 加载动画 */
.spinner {
    width: 40px;
    height: 40px;
    margin: 20px auto;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

.spinner-sm {
    width: 16px;
    height: 16px;
    margin: 0;
    border-width: 2px;
    display: inline-block;
    vertical-align: middle;
}

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

@keyframes pulse {
    0% {
        transform: scale(0);
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

/* 图片预览 */
.image-preview {
    max-width: 100%;
    max-height: 200px;
    margin-top: 10px;
    border-radius: 4px;
    display: none;
}
