/* 分析报告解析器样式 */

/* 分析报告容器 */
.analysis-container {
    margin: 0;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fff;
    height: 100%;
    overflow-y: auto;
    max-height: 120vh;
    position: relative;
    top: 20px;
}

/* 分析报告标题 */
.analysis-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    padding: 10px;
    position: relative;
    top: 0;
    z-index: 20;
    width: 100%;
    background-color: #fff;
    border-bottom: none;
}

/* 分析部分 */
.analysis-section {
    margin-bottom: 10px;
    padding: 15px;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border: 1px solid #f0f0f0;
    position: relative;
}

/* 子标题 */
.analysis-subtitle {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    padding-left: 10px;
    position: relative;
    top: 0;
    z-index: 15;
    background-color: #fff;
    padding: 10px;
}

/* 分析内容 */
.analysis-content {
    line-height: 1.6;
    color: #333;
    margin-bottom: 15px;
    text-align: justify;
    padding-top: 5px;
}

/* 流程图容器 */
.mermaid {
    margin: 20px 0;
    padding: 15px;
    background-color: #fff;
    border-radius: 6px;
    text-align: center;
    overflow: auto;
    max-width: 100%;
    font-family: 'Courier New', monospace;
}

/* Mermaid图表样式覆盖 */
.mermaid .node rect, 
.mermaid .node circle, 
.mermaid .node ellipse, 
.mermaid .node polygon {
    fill: #f5f5f5;
    stroke: #999;
    stroke-width: 1px;
}

.mermaid .edgePath .path {
    stroke: #666;
    stroke-width: 1.5px;
}

.mermaid .label {
    font-family: 'Arial', sans-serif;
    font-size: 14px;
    color: #333;
}

.mermaid .cluster rect {
    fill: #f0f0f0;
    stroke: #ddd;
    stroke-width: 1px;
}

/* 加载中状态 */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    height: 50vh;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 2s linear infinite;
    margin-bottom: 15px;
}

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

/* 错误信息 */
.error-message {
    color: #e74c3c;
    padding: 15px;
    border: 1px solid #e74c3c;
    border-radius: 6px;
    background-color: #fef5f5;
    margin: 20px 0;
    text-align: center;
}

/* 无分析报告提示 */
.no-analysis {
    color: #7f8c8d;
    padding: 20px;
    text-align: center;
    font-style: italic;
    border: 1px dashed #bdc3c7;
    border-radius: 6px;
    margin: 20px 0;
}

/* 分析标题容器（包含按钮） */
.analysis-title-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #fff;
    border-bottom: 1px solid #e0e0e0;
}

/* 分析按钮容器 */
.analysis-buttons {
    display: flex;
    gap: 8px;
}

/* 重新分析按钮样式 */
.reanalyze-button {
    padding: 6px 12px;
    font-size: 0.8em;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.reanalyze-button:hover {
    background-color: #0056b3;
}

.reanalyze-button:active {
    background-color: #004085;
}

/* 历史记录按钮样式 */
.history-button {
    padding: 6px 12px;
    font-size: 0.8em;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.history-button:hover {
    background-color: #1e7e34;
}

.history-button:active {
    background-color: #155724;
}

/* 版本信息样式 */
.version-info {
    font-size: 0.7em;
    color: #666;
    font-weight: normal;
    margin-left: 5px;
}

/* 历史记录容器 */
.analysis-history-container {
    padding: 15px;
}

/* 历史记录项 */
.history-item {
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 6px;
    background-color: #fafafa;
    border: 1px solid #ddd;
    transition: box-shadow 0.2s ease;
}

.history-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 当前版本样式 */
.history-item.current-version {
    border: 2px solid #007bff;
    background-color: #f8f9ff;
}

/* 历史记录头部 */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

/* 历史版本详情按钮 */
.history-item button {
    padding: 4px 8px;
    font-size: 0.7em;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.history-item button:hover {
    opacity: 0.8;
}

/* 返回按钮样式 */
.back-to-current-button {
    padding: 6px 12px;
    font-size: 0.8em;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.back-to-current-button:hover {
    background-color: #5a6268;
}

/* 无历史记录容器 */
.no-history-container {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* 重新分析和错误状态改进 */
.analysis-loading-container p[style*="color: #007bff"] {
    font-weight: 500;
}

.analysis-error-container {
    padding: 20px;
    text-align: center;
    border: 1px solid #dc3545;
    border-radius: 6px;
    background-color: #f8d7da;
    color: #721c24;
    margin: 20px 0;
}

.analysis-error-container h3 {
    color: #721c24;
    margin-bottom: 10px;
}

.retry-button {
    padding: 8px 16px;
    background-color: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 5px;
    transition: background-color 0.2s ease;
}

.retry-button:hover {
    background-color: #c82333;
}


/* 响应式调整 */
@media (max-width: 768px) {
    .analysis-container {
        padding: 15px;
        max-height: none;
        position: static;
    }
    
    .analysis-title {
        font-size: 1.3rem;
        position: static;
        padding: 8px 0;
        box-shadow: none;
        background-color: #fff;
    }
    
    .analysis-subtitle {
        font-size: 1.1rem;
        background-color: #fff;
        position: static;
    }
    
    .analysis-section {
        padding: 10px;
    }
    
    .analysis-section .analysis-title {
        position: static;
        padding: 8px 0;
    }
    
    /* 移动端按钮调整 */
    .analysis-title-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .analysis-buttons {
        width: 100%;
        justify-content: flex-end;
    }
    
    .reanalyze-button,
    .history-button,
    .back-to-current-button {
        font-size: 0.9em;
        padding: 8px 12px;
    }
    
    /* 历史记录移动端调整 */
    .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .history-item button {
        font-size: 0.8em;
        padding: 6px 10px;
    }
    
    .analysis-history-container h3 {
        font-size: 1.2em;
    }
} 

/* 移动端适配 - 448x924 */
@media (max-width: 480px) {
    .analysis-container {
        padding: 12px;
        max-height: none;
        position: static;
        top: 0;
        border-radius: 6px;
    }
    
    .analysis-title {
        font-size: 1.2rem;
        position: static;
        padding: 8px 0;
        box-shadow: none;
        background-color: #fff;
    }
    
    .analysis-subtitle {
        font-size: 1rem;
        background-color: #fff;
        position: static;
        padding: 8px;
    }
    
    .analysis-section {
        padding: 12px;
        margin-bottom: 8px;
        border-radius: 4px;
    }
    
    .analysis-content {
        font-size: 14px;
        line-height: 1.5;
        margin-bottom: 12px;
        padding-top: 4px;
    }

    .mermaid {
        margin: 15px 0;
        padding: 12px;
        border-radius: 4px;
        font-size: 12px;
    }

    .loading {
        padding: 20px;
        height: 40vh;
    }

    .loading-spinner {
        width: 30px;
        height: 30px;
        margin-bottom: 12px;
    }

    .error-message {
        padding: 12px;
        margin: 15px 0;
        font-size: 14px;
    }

    .no-analysis {
        padding: 16px;
        margin: 15px 0;
        font-size: 14px;
    }

    .analysis-title-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 8px;
        margin-bottom: 12px;
    }
    
    .analysis-buttons {
        width: 100%;
        justify-content: flex-end;
        gap: 6px;
    }
    
    .reanalyze-button,
    .history-button,
    .back-to-current-button {
        font-size: 0.8em;
        padding: 6px 10px;
    }

    .version-info {
        font-size: 0.6em;
        margin-left: 4px;
    }

    .analysis-history-container {
        padding: 12px;
    }

    .history-item {
        margin-bottom: 10px;
        padding: 10px;
        border-radius: 4px;
    }

    .history-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .history-item button {
        font-size: 0.7em;
        padding: 4px 8px;
    }

    .analysis-history-container h3 {
        font-size: 1.1em;
    }

    .retry-button {
        padding: 6px 12px;
        font-size: 14px;
        margin: 4px;
    }

    .analysis-error-container {
        padding: 16px;
        margin: 15px 0;
    }

    .analysis-error-container h3 {
        margin-bottom: 8px;
        font-size: 16px;
    }
}

/* 超小屏幕适配 - 针对448px宽度 */
@media (max-width: 448px) {
    .analysis-container {
        padding: 8px;
        border-radius: 4px;
    }
    
    .analysis-title {
        font-size: 1.1rem;
        padding: 6px 0;
    }
    
    .analysis-subtitle {
        font-size: 0.9rem;
        padding: 6px;
    }
    
    .analysis-section {
        padding: 10px;
        margin-bottom: 6px;
    }
    
    .analysis-content {
        font-size: 13px;
        line-height: 1.4;
        margin-bottom: 10px;
    }

    .mermaid {
        margin: 12px 0;
        padding: 8px;
        font-size: 11px;
    }

    .loading {
        padding: 16px;
        height: 35vh;
    }

    .loading-spinner {
        width: 24px;
        height: 24px;
        border-width: 3px;
        margin-bottom: 10px;
    }

    .error-message {
        padding: 10px;
        margin: 12px 0;
        font-size: 13px;
    }

    .no-analysis {
        padding: 14px;
        margin: 12px 0;
        font-size: 13px;
    }

    .analysis-title-container {
        gap: 6px;
        padding: 6px;
        margin-bottom: 10px;
    }
    
    .analysis-buttons {
        gap: 4px;
    }
    
    .reanalyze-button,
    .history-button,
    .back-to-current-button {
        font-size: 0.7em;
        padding: 5px 8px;
    }

    .version-info {
        font-size: 0.55em;
        margin-left: 3px;
    }

    .analysis-history-container {
        padding: 10px;
    }

    .history-item {
        margin-bottom: 8px;
        padding: 8px;
    }

    .history-header {
        gap: 4px;
    }
    
    .history-item button {
        font-size: 0.65em;
        padding: 3px 6px;
    }

    .analysis-history-container h3 {
        font-size: 1rem;
    }

    .retry-button {
        padding: 5px 10px;
        font-size: 13px;
        margin: 3px;
    }

    .analysis-error-container {
        padding: 12px;
        margin: 12px 0;
    }

    .analysis-error-container h3 {
        margin-bottom: 6px;
        font-size: 15px;
    }

    .no-history-container {
        padding: 30px;
        font-size: 14px;
    }
} 