/* ===== MPA-EC 专用样式（独立CSS文件） ===== */

/* MPA-EC 主题色 */
.mpa-ec-theme {
    --primary-color: #e84855;
    --secondary-color: #111;
    --light-bg: #f8f8f8;
    --dark-bg: #ebebeb;
    --border-color: #ddd;
}

/* Predictor Section - 酶功能预测部分 */
.predictor-section {
    background: var(--light-bg);
    border-radius: 10px;
    padding: 30px;
    margin: 30px 0;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.predictor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 1024px) {
    .predictor-grid {
        grid-template-columns: 1fr;
    }
}

/* 输入区域 */
.input-area {
    padding-right: 30px;
    border-right: 1px solid var(--border-color);
}

@media (max-width: 1024px) {
    .input-area {
        padding-right: 0;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 30px;
    }
}

/* 输出区域 */
.output-area {
    padding-left: 30px;
}

@media (max-width: 1024px) {
    .output-area {
        padding-left: 0;
        padding-top: 30px;
    }
}

/* 分区标题 */
.section-title {
    color: var(--secondary-color);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.section-title i {
    color: var(--primary-color);
    margin-right: 10px;
}

/* 序列输入容器 */
.sequence-container {
    margin-bottom: 20px;
}

.sequence-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.sequence-label {
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 1rem;
}

.sequence-counter {
    color: #868e96;
    font-size: 0.85rem;
    font-family: monospace;
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 10px;
}

/* 文本输入框 */
.sequence-input {
    width: 100%;
    min-height: 180px;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    resize: vertical;
    background: #f8f9fa;
    transition: all 0.2s ease;
}

.sequence-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(232, 72, 85, 0.1);
    background: white;
}

/* 按钮组 */
.input-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.action-btn {
    padding: 12px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.action-btn.primary {
    background: var(--primary-color);
    color: white;
    grid-column: span 2;
}

.action-btn.secondary {
    background: white;
    color: #5f6368;
    border: 1px solid var(--border-color);
}

.action-btn.primary:hover {
    background: #d91c2c;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(232, 72, 85, 0.2);
}

.action-btn.secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #f8f9fa;
}

/* 批量预测 */
.batch-section {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid var(--border-color);
}

.batch-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-upload {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-bottom: 8px;
}

.file-input {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
}

.file-info {
    color: #868e96;
    font-size: 0.85rem;
    font-style: italic;
}

/* 模型控制 */
.model-control {
    background: var(--dark-bg);
    padding: 20px;
    border-radius: 8px;
    margin-top: 25px;
    border: 1px solid var(--border-color);
}

.model-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.current-model {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1rem;
    background: white;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.model-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.model-btn {
    background: white;
    color: #5f6368;
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.model-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-1px);
}

.model-btn.mpa {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.model-btn.llama {
    border-color: #ffc107;
    color: #ffc107;
}

/* EC结果显示 */
.ec-display {
    text-align: center;
    margin-bottom: 30px;
}

.ec-label {
    color: #868e96;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.ec-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 12px 0;
    letter-spacing: 1px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);
}

/* 推理部分 */
.reasoning-section {
    margin-top: 30px;
}

.reasoning-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reasoning-content {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.6;
    min-height: 200px;
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
}

/* Loading状态 */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f1f3f4;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-top: 25px;
    position: relative;
    width: 100%;
    max-width: 500px;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: var(--border-color);
    z-index: 1;
}

.step {
    position: relative;
    z-index: 2;
    background: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    color: #868e96;
    border: 2px solid var(--border-color);
    min-width: 120px;
    text-align: center;
}

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

/* 错误消息 */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    border: 1px solid #f5c6cb;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Paper Section - 论文介绍部分 */
.paper-section {
    background: var(--light-bg);
    border-radius: 10px;
    padding: 30px;
    margin: 30px 0;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
}

.paper-header {
    margin-bottom: 25px;
}

.paper-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--secondary-color);
    line-height: 1.3;
}

.paper-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 768px) {
    .paper-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.paper-abstract {
    background: white;
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.abstract-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 15px;
}

.abstract-text {
    color: #495057;
    line-height: 1.7;
    font-size: 0.9rem;
    text-align: justify;
}

.paper-image {
    text-align: center;
}

.paper-img {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color);
}

.image-caption {
    margin-top: 12px;
    color: #868e96;
    font-size: 0.8rem;
    font-style: italic;
    text-align: center;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .predictor-section,
    .paper-section {
        padding: 20px;
    }
    
    .input-buttons {
        grid-template-columns: 1fr;
    }
    
    .action-btn.primary {
        grid-column: span 1;
    }
    
    .model-buttons {
        grid-template-columns: 1fr;
    }
    
    .ec-number {
        font-size: 2rem;
    }
}

/* 导航栏高亮 */
.nav-pills .nav-link.active {
    background-color: var(--primary-color) !important;
    color: white !important;
}

.nav-pills .nav-link {
    color: #999;
}

.nav-pills .nav-link:hover {
    color: var(--primary-color);
}

/* 引用信息样式 */
.citation-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    margin-top: 20px;
    margin-bottom: 20px;
}

.citation-box p {
    margin-bottom: 0;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #495057;
}

/* 防止容器自动变宽 */
.predictor-grid {
    max-width: 100%;
    overflow: hidden;
}

.output-area {
    max-width: 100%;
    overflow-x: hidden;
}

#batch-results-container {
    max-width: 100%;
    overflow-x: hidden;
}

/* 文件预览区域 */
.file-preview {
    max-width: 100%;
    word-break: break-all;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    font-size: 0.85em;
    line-height: 1.4;
}

/* 序列输入区域 */
.sequence-input {
    max-width: 100%;
    word-break: break-all;
    font-family: 'Courier New', monospace;
}


