/* 分析服务专用样式文件 */
/* ========== 模态框样式 ========== */
.analysis-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(4px);
}

.analysis-modal-content {
    background: #ffffff;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

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

.analysis-modal-header h3 {
    margin: 0;
    color:#2c3e50;
    font-size: 20px;
    font-weight: 600;
}

.analysis-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color:#5d6368;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.analysis-modal-close:hover {
    color:#2c3e50;
    background: v#f1f5f9;
}

.analysis-modal-body {
    padding: 24px;
}

.analysis-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #cdd2d9;
}

/* ========== 进度条样式 ========== */
.analysis-progress-modal {
    z-index: 10000;
}

.analysis-progress-modal-content {
    max-width: 500px;
    margin: 20vh auto;
}

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

.analysis-progress-spinner .spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.analysis-progress-bar-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.analysis-progress-bar {
    flex: 1;
    height: 20px;
    background-color: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.analysis-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
}

.analysis-progress-text {
    font-weight: bold;
    color: #007bff;
    min-width: 40px;
}

.progress-detail {
    color: #6c757d;
    font-size: 0.9em;
    text-align: center;
}

/* ========== 分析结果样式 ========== */
.analysis-analysis-result {
    max-width: 800px;
}

.analysis-header {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #cdd2d9;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.analysis-header-left h4 {
    margin: 0 0 8px 0;
    color:#2c3e50;
    font-size: 20px;
    font-weight: 600;
}

.analysis-header .analysis-info {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}

.analysis-time, .analysis-model {
    font-size: 13px;
    color:#5d6368;
    background: #f8fafc;
    padding: 4px 12px;
    border-radius: 12px;
    border: 1px solid #cdd2d9;
}

.analysis-header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.analysis-model-select-doc {
    padding: 6px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background: #ffffff;
    color:#2c3e50;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.analysis-model-select-doc:hover {
    border-color: #c4d0d9;
}

.analysis-model-select-doc:focus {
    outline: none;
    border-color: #c4d0d9;
    box-shadow: 0 0 0 3px rgba(196, 208, 217, 0.1);
}

/* ========== 分析内容样式 ========== */
.analysis-content {
    overflow-y: auto;
    max-height: 60vh;
}

.analysis-content h5 {
    margin: 0 0 16px 0;
    color:#2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.analysis-section {
    margin-bottom: 32px;
}

.analysis-section h5 {
    margin: 0 0 16px 0;
    color:#2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.analysis-section p {
    line-height: 1.7;
    color: #5a6c7d;
    margin-bottom: 16px;
}

.analysis-section ul {
    padding-left: 24px;
    margin-bottom: 16px;
}

.analysis-section li {
    margin-bottom: 10px;
    line-height: 1.6;
    color: #5a6c7d;
}

/* ========== 分析历史样式 ========== */
.analysis-history {
    max-width: 900px;
}

.document-analysis-history {
    max-width: 900px;
}

.analyses-list {
    max-height: 600px;
    overflow-y: auto;
}

.history-item {
    margin-bottom: 20px;
    padding: 20px;
    border: 1px solid #cdd2d9;
    border-radius: 8px;
    background: #ffffff;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.history-item:hover {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border-color: #cbd5e1;
}

.history-item.current-version {
    border: 2px solid #007bff;
    background-color: #f8f9ff;
}

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

.history-item .time {
    font-size: 13px;
    color:#5d6368;
}

.history-item .model {
    font-size: 12px;
    background: #007bff;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    margin-right: 8px;
}

.history-item .view-detail {
    padding: 4px 12px;
    font-size: 12px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.history-item .view-detail:hover {
    background: #1e7e34;
}

.history-item .source {
    font-size: 12px;
    color:#5d6368;
    margin-top: 8px;
}

.history-item .source.archive {
    color: #dc3545;
}

.analysis-history-item {
    border: 1px solid #cdd2d9;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 16px;
    background: #ffffff;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.analysis-history-item:hover {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.analysis-type {
    background: #007bff;
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.analysis-preview {
    font-size: 15px;
    line-height: 1.6;
    margin-top: 16px;
}

/* ========== 分析结果容器样式 ========== */
.analysis-result-container {
    display: flex;
    gap: 24px;
    max-height: 85vh;
    overflow: hidden;
}

.analysis-left-panel {
    flex: 0 0 60%;
    overflow-y: auto;
    padding-right: 12px;
}

.analysis-right-panel {
    flex: 0 0 40%;
    overflow-y: auto;
    padding-left: 12px;
    border-left: 1px solid #cdd2d9;
}

.flowchart-header {
    margin-bottom: 20px;
}

.flowchart-header h4 {
    margin: 0;
    color:#2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.flowchart-content {
    text-align: center;
    min-height: 300px;
}

.no-flowchart, .js-no-flowchart {
    text-align: center;
    color:#5d6368;
    padding: 48px 24px;
    background: #f8fafc;
    border: 1px solid #cdd2d9;
    border-radius: 8px;
}

.analysis-actions {
    margin-top: 20px;
    text-align: right;
    border-top: 1px solid #cdd2d9;
    padding-top: 20px;
}

/* ========== 无分析模态框样式 ========== */
.no-analysis-container {
    text-align: center;
    padding: 40px 20px;
}

.no-analysis-message h4 {
    margin: 0 0 16px 0;
    color:#2c3e50;
    font-size: 20px;
    font-weight: 600;
}

.no-analysis-message p {
    color: #5a6c7d;
    line-height: 1.6;
    margin-bottom: 32px;
}

/* ========== JavaScript样式类 ========== */
.js-text-fallback {
    background: #f8fafc;
    border: 1px solid #cdd2d9;
    border-radius: 8px;
    padding: 20px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    color: #5a6c7d;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-x: auto;
}

.js-error-div, .js-error-flowchart {
    text-align: center;
    padding: 48px 24px;
    color: #ef4444;
    background: #f8fafc;
    border: 1px solid #cdd2d9;
    border-radius: 8px;
    font-weight: 500;
}

.js-analysis-section {
    margin-bottom: 24px;
}

.js-content-title {
    font-size: 18px;
    font-weight: 600;
    color:#2c3e50;
    margin-bottom: 12px;
    border-bottom: 2px solid #3b82f6;
    padding-bottom: 8px;
}

.js-value-title {
    font-size: 18px;
    font-weight: 600;
    color:#2c3e50;
    margin-bottom: 12px;
    border-bottom: 2px solid #10b981;
    padding-bottom: 8px;
}

.js-no-analysis {
    text-align: center;
    color:#5d6368;
    padding: 48px 24px;
    background: #f8fafc;
    border: 1px solid #cdd2d9;
    border-radius: 8px;
}

.js-complex-ul {
    margin: 0;
    margin-top: 8px;
    padding-left: 24px;
}

.js-complex-li {
    margin-bottom: 8px;
    line-height: 1.6;
    color: #5a6c7d;
}

.js-complex-container {
    margin-top: 12px;
}

.js-complex-item {
    margin-bottom: 12px;
}

.js-complex-title {
    font-weight: 600;
    font-size: 16px;
    color:#2c3e50;
    margin-bottom: 6px;
}

.js-complex-title-sm {
    font-weight: 500;
    font-size: 15px;
    color:#2c3e50;
    margin-bottom: 6px;
}

.js-complex-content {
    margin-left: 20px;
}

.js-complex-text {
    line-height: 1.6;
    color: #5a6c7d;
}

.js-modal-wide {
    max-width: 95vw;
    width: 1600px;
    height: 90vh;
    max-height: 90vh;
}

.js-modal-body-fixed {
    overflow: hidden;
    height: calc(100% - 80px);
    padding: 20px;
}

.js-loading-visible {
    display: flex !important;
}

.js-loading-hidden {
    display: none !important;
}

/* ========== 按钮样式 ========== */
.analysis-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.analysis-btn-primary {
    background: #007bff;
    color: white;
}

.analysis-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10);
}

.analysis-btn-secondary {
    background: #6c757d;
    color: white;
}

.analysis-btn-secondary:hover {
    background: #5a6268;
}

.analysis-btn-history {
    background: #28a745;
    color: white;
}

.analysis-btn-history:hover {
    background: #1e7e34;
}

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

.analysis-btn-outline-secondary {
    background: transparent;
    color: #6c757d;
    border: 1px solid #6c757d;
}

.analysis-btn-outline-secondary:hover {
    background: #6c757d;
    color: white;
}

/* ========== 加载状态样式 ========== */
.analysis-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color:#5d6368;
}

.analysis-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #cdd2d9;
    border-top: 3px solid #c4d0d9;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

/* ========== 流程图样式 ========== */
.flowchart-wrapper {
    position: relative;
    text-align: center;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    background-color: #fafafa;
    margin: 10px 0;
}

.flowchart-zoom-button {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 12px;
    font-size: 0.8em;
    background-color: rgba(0, 123, 255, 0.8);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    z-index: 10;
    transition: background-color 0.2s;
}

.flowchart-zoom-button:hover {
    background-color: rgba(0, 123, 255, 1);
}

.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;
}

/* ========== 无数据状态 ========== */
.analysis-no-data {
    text-align: center;
    color:#5d6368;
    padding: 40px 20px;
    font-style: italic;
}

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

/* ========== 动画效果 ========== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.analysis-section {
    animation: fadeIn 0.3s ease-out;
}

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