/* 文档分析结果页面样式 */
.result-page {
    min-height: 100vh;
    background: linear-gradient(180deg, #f8f9ff 0%, #ffffff 100%);
    padding: 20px;
}

.result-container {
    max-width: 1200px;
    margin: 0 auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    padding: 28px 32px 32px;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 16px;
}

.result-title-area {
    flex: 1;
    min-width: 0;
}

/* 导出按钮区域 */
.result-actions {
    flex-shrink: 0;
}

.export-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
    transition: all 0.2s;
}

.export-btn:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.export-btn:active {
    transform: translateY(0);
}

.export-icon {
    width: 16px;
    height: 16px;
}

.dropdown-arrow {
    width: 14px;
    height: 14px;
    margin-left: 2px;
    transition: transform 0.2s;
}

/* 导出下拉菜单 */
.export-dropdown {
    position: relative;
    display: inline-block;
}

.export-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border: 1px solid #e5e7eb;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s;
    z-index: 100;
}

.export-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.export-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: none;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.export-menu-item:first-child {
    border-radius: 8px 8px 0 0;
}

.export-menu-item:last-child {
    border-radius: 0 0 8px 8px;
}

.export-menu-item:hover {
    background: #f3f4f6;
}

.export-menu-icon {
    font-size: 16px;
}

/* 标题行：标题和评分在同一行 */
.result-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 6px;
}

.result-title-area h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: #111827;
}

.result-meta {
    font-size: 12px;
    color: #6b7280;
}

/* 综合评分样式 */
.meta-score {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

/* 评分颜色：60分以下警告色 */
.score-warning {
    color: #f59e0b;
}

/* 评分颜色：60-90分正常色 */
.score-normal {
    color: #2563eb;
}

/* 评分颜色：90分以上优秀色 */
.score-excellent {
    color: #10b981;
}

.result-score {
    text-align: right;
}

.result-score .score-label {
    font-size: 12px;
    color: #6b7280;
}

.result-score .score-value {
    font-size: 26px;
    font-weight: 700;
    color: #2563eb;
}

.result-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e5e7eb;
}

.result-tabs .tab-btn {
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.result-tabs .tab-btn:hover {
    color: #2563eb;
}

.result-tabs .tab-btn.tab-btn-active {
    color: #2563eb;
    border-bottom-color: #2563eb;
    font-weight: 700;
    font-size: 15px;
}

.result-body {
    display: grid;
    grid-template-columns: minmax(0, 2.1fr) minmax(0, 1.4fr);
    margin-top: 16px;
    gap: 24px;
}

.result-left,
.result-right {
    min-width: 0;
}

/* PC端：默认显示左右布局，通过tab切换显示/隐藏 */
@media (min-width: 768px) {
    .result-body {
        display: grid;
        grid-template-columns: 1fr;
    }
    
    #summaryPanel {
        display: none;
    }
    
    #qaPanel {
        display: block;
    }
    
    .result-tabs.pc-only {
        display: flex;
    }
    
    .result-tabs.mobile-only {
        display: none;
    }
}

.panel-header {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 10px;
}

/* 问答黄色提示框（参考安卓端） */
.qa-warning-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: #FFF9E6;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.qa-warning-text {
    flex: 1;
    font-size: 13px;
    color: #856404;
    line-height: 1.5;
}

.qa-warning-close {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #856404;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.2s;
    padding: 0;
    line-height: 1;
}

.qa-warning-close:hover {
    background: rgba(133, 100, 4, 0.1);
}

.overview-content .overview-section {
    margin-bottom: 20px;
}

.overview-content h3 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 8px;
}

.overview-content p {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.7;
}

.overview-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 8px;
}

.overview-column h3 {
    font-size: 14px;
    margin-bottom: 6px;
}

.overview-column ul {
    margin: 0;
    padding-left: 18px;
}

.overview-column li {
    font-size: 13px;
    color: #4b5563;
    margin-bottom: 4px;
    line-height: 1.6;
}

/* 关键词高亮样式（参考安卓端） */
.overview-content span[style*="color"],
.section-card span[style*="color"] {
    font-weight: 500;
}

.empty-text {
    font-size: 13px;
    color: #9ca3af;
}

.sections-content .section-card {
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    padding: 16px 18px;
    margin-bottom: 12px;
    background: #f9fafb;
}

/* 根据 section 类型应用特定样式（参考安卓端 sectionStyleMap） */
/* key_points: 蓝色主题（默认样式，参考安卓端 section_border, primary_blue） */
.sections-content .section-card.section-key-points {
    border-left: 4px solid #2563eb; /* primary_blue - 左边框颜色 */
    background: linear-gradient(90deg, #eff6ff 0%, #ffffff 40%); /* background_secondary 渐变 */
    border-top: 1px solid #e5e7eb; /* section_border - 其他边框保持默认 */
    border-right: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

/* risks: 红色危险主题（参考安卓端 R.color.section_danger_bg, R.color.error_color, R.color.error_red） */
.sections-content .section-card.section-risks {
    border-left: 4px solid #ef4444; /* error_red - 左边框颜色 */
    background: linear-gradient(90deg, #fee2e2 0%, #ffffff 40%); /* section_danger_bg 渐变 */
    border-top: 1px solid #ef4444; /* error_color - 其他边框也用红色 */
    border-right: 1px solid #ef4444;
    border-bottom: 1px solid #ef4444;
}

/* suggestions: 绿色成功主题（参考安卓端 R.color.section_success_bg, R.color.success_green） */
.sections-content .section-card.section-suggestions {
    border-left: 4px solid #10b981; /* success_green - 左边框颜色 */
    background: linear-gradient(90deg, #dcfce7 0%, #ffffff 40%); /* section_success_bg 渐变 */
    border-top: 1px solid #10b981; /* success_green - 其他边框也用绿色 */
    border-right: 1px solid #10b981;
    border-bottom: 1px solid #10b981;
}

/* 其他类型的 section 使用循环颜色（保持向后兼容） */
.sections-content .section-card:not(.section-key-points):not(.section-risks):not(.section-suggestions):nth-child(1) {
    border-left: 4px solid #2563eb;
    background: linear-gradient(90deg, #eff6ff 0%, #ffffff 40%);
}

.sections-content .section-card:not(.section-key-points):not(.section-risks):not(.section-suggestions):nth-child(2) {
    border-left: 4px solid #10b981;
    background: linear-gradient(90deg, #ecfdf5 0%, #ffffff 40%);
}

.sections-content .section-card:not(.section-key-points):not(.section-risks):not(.section-suggestions):nth-child(3) {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(90deg, #fffbeb 0%, #ffffff 40%);
}

.sections-content .section-card:not(.section-key-points):not(.section-risks):not(.section-suggestions):nth-child(4) {
    border-left: 4px solid #8b5cf6;
    background: linear-gradient(90deg, #f5f3ff 0%, #ffffff 40%);
}

.sections-content .section-card:not(.section-key-points):not(.section-risks):not(.section-suggestions):nth-child(5) {
    border-left: 4px solid #0ea5e9;
    background: linear-gradient(90deg, #e0f2fe 0%, #ffffff 40%);
}

.sections-content .section-card:not(.section-key-points):not(.section-risks):not(.section-suggestions):nth-child(6) {
    border-left: 4px solid #22c55e;
    background: linear-gradient(90deg, #dcfce7 0%, #ffffff 40%);
}

/* 超过6个的模块，奇偶行用不同浅色区分 */
.sections-content .section-card:not(.section-key-points):not(.section-risks):not(.section-suggestions):nth-child(n+7):nth-child(odd) {
    border-left: 4px solid #6366f1;
    background: linear-gradient(90deg, #e0e7ff 0%, #ffffff 40%);
}

.sections-content .section-card:not(.section-key-points):not(.section-risks):not(.section-suggestions):nth-child(n+7):nth-child(even) {
    border-left: 4px solid #14b8a6;
    background: linear-gradient(90deg, #ccfbf1 0%, #ffffff 40%);
}

/* 模块内关键词和重点文字加粗显示 */
.sections-content .section-card strong {
    font-weight: 600;
    color: #111827;
}

.sections-content .section-card h3 {
    font-size: 15px;
    margin-bottom: 6px;
    color: #111827;
}

.sections-content .section-card p {
    font-size: 13px;
    color: #4b5563;
    margin-bottom: 4px;
}

.sections-content .section-card ul {
    margin: 0;
    padding-left: 18px;
}

.sections-content .section-card li {
    font-size: 13px;
    color: #4b5563;
    margin-bottom: 3px;
}

.qa-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.qa-history {
    max-height: 360px;
    overflow-y: auto;
    padding-right: 4px;
}

.qa-item {
    margin-bottom: 12px;
}

.qa-question-row,
.qa-answer-row {
    display: flex;
    margin-bottom: 4px;
}

.qa-question-row {
    justify-content: flex-end;
}

.qa-answer-row {
    justify-content: flex-start;
}

.qa-bubble {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 80%;
}

.user-bubble {
    flex-direction: row-reverse;
}

.qa-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #111827;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-avatar {
    background: #2563eb;
    color: #fff;
}

.qa-bubble-content {
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.6;
}

.user-bubble .qa-bubble-content {
    background: #e5f2ff;
    color: #111827;
}

.ai-bubble .qa-bubble-content {
    background: #f3f4f6;
    color: #111827;
}

.qa-input-area {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.qa-input-area textarea {
    flex: 1;
    min-height: 70px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    padding: 10px 12px;
    font-size: 13px;
    resize: vertical;
    box-sizing: border-box;
}

.qa-input-area textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.qa-input-area button {
    padding: 0 18px;
    border-radius: 8px;
    border: none;
    background: #2563eb;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    min-width: 72px;
    transition: background 0.2s, transform 0.1s;
}

.qa-input-area button:hover:not(:disabled) {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.qa-input-area button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.qa-tip {
    font-size: 12px;
    color: #9ca3af;
}

.qa-quick-questions {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.qa-quick-questions .quick-question-btn {
    border: none;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    background: #eff6ff;
    color: #2563eb;
    cursor: pointer;
}

.qa-quick-questions .quick-question-btn:hover {
    background: #dbeafe;
}

/* 底部浮动提问按钮（页面正中间底部悬浮） */
.summary-ask-entry {
    position: fixed;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%);
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    text-align: center;
    z-index: 9999;
}

.ask-entry-btn {
    padding: 10px 24px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
    transition: all 0.2s;
}

.ask-entry-btn:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.ask-entry-btn:active {
    transform: translateY(0);
}

.error-message-center {
    text-align: center;
    font-size: 14px;
    color: #dc2626;
    padding: 40px 20px;
}

/* 状态徽章样式（参考安卓端colors.xml和DocumentAnalysisReportActivity.kt） */
.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin: 0 4px;
    vertical-align: middle;
}

/* 通过状态：绿色 */
.status-pass {
    background-color: #DCFCE7; /* section_success_bg */
    color: #10B981; /* success_green */
}

/* 警告状态：橙色 */
.status-warning {
    background-color: #FEF3C7; /* section_warning_bg */
    color: #F59E0B; /* warning_orange */
}

/* 失败状态：红色 */
.status-fail {
    background-color: #FEE2E2; /* section_danger_bg */
    color: #EF4444; /* error_red */
}

/* Priority badges for priority levels (优先级：高/中/低) */
/* 参考安卓端 DocumentAnalysisReportActivity.kt line 2285-2291 */
.priority-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin: 0 4px;
    vertical-align: middle;
}

.priority-high {
    background-color: #FEE2E2; /* Red light */
    color: #EF4444; /* Red dark - error_red */
}

.priority-medium {
    background-color: #FEF3C7; /* Orange light */
    color: #F59E0B; /* Orange dark - warning_orange */
}

.priority-low {
    background-color: #F3F4F6; /* Gray light */
    color: #6B7280; /* Gray dark - text_secondary */
}

/* 待办事项样式（参考安卓端 DocumentAnalysisReportActivity.kt） */
.todo-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.todo-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    transition: all 0.2s;
}

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

/* 已完成的待办 */
.todo-item.todo-completed {
    background: #f9fafb;
    border-color: #e5e7eb;
}

/* 已过期的待办 */
.todo-item.todo-expired {
    background: #fffbeb;
    border-color: #fcd34d;
}

/* 旗帜图标 */
.todo-flag {
    font-size: 16px;
    flex-shrink: 0;
    line-height: 1.4;
}

.todo-flag-normal {
    color: #EF4444; /* 红色旗帜 */
}

.todo-flag-urgent {
    color: #DC2626; /* 紧急：深红色 */
}

.todo-flag-expired,
.todo-flag-completed {
    color: #CCCCCC; /* 灰色 */
}

/* 待办主体内容 */
.todo-main {
    flex: 1;
    min-width: 0;
}

.todo-content {
    font-size: 14px;
    color: #333333;
    line-height: 1.5;
    word-break: break-word;
}

/* 紧急待办内容：红色文字 */
.todo-content-urgent {
    color: #DC2626;
}

/* 已过期/已完成待办内容：灰色+删除线 */
.todo-content-expired,
.todo-content-completed {
    color: #CCCCCC;
    text-decoration: line-through;
}

/* 待办元信息行 */
.todo-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

/* 待办状态标签 */
.todo-status {
    font-size: 12px;
    font-weight: 500;
}

.todo-status-urgent {
    color: #DC2626; /* 紧急：红色 */
}

.todo-status-expired {
    color: #F59E0B; /* 过期：橙色 */
}

.todo-status-completed {
    color: #10B981; /* 完成：绿色 */
}

/* 待办优先级标签 */
.todo-priority {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.todo-priority-high {
    background-color: #FEE2E2;
    color: #EF4444;
}

.todo-priority-medium {
    background-color: #FEF3C7;
    color: #F59E0B;
}

.todo-priority-low {
    background-color: #F3F4F6;
    color: #6B7280;
}

/* 待办截止时间 */
.todo-deadline {
    font-size: 12px;
    color: #666666;
}

.todo-deadline-urgent {
    color: #DC2626; /* 紧急：红色 */
}

/* 移动端适配 */
@media (max-width: 767px) {
    .result-page {
        padding: 10px;
    }
    
    .result-container {
        padding: 16px 14px 18px;
    }
    
    .result-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    
    .result-actions {
        width: 100%;
        margin-top: 8px;
    }
    
    .export-btn {
        width: 100%;
        justify-content: center;
        padding: 10px 16px;
    }
    
    .export-dropdown {
        width: 100%;
    }
    
    .export-menu {
        left: 0;
        right: 0;
        min-width: auto;
    }
    
    .result-tabs.mobile-only {
        display: flex;
        margin-bottom: 16px;
    }
    
    .result-tabs.pc-only {
        display: none;
    }
    
    .result-tabs .tab-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    
    .result-body {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    
    #summaryPanel {
        display: none;
    }
    
    #qaPanel {
        display: block;
    }
    
    .overview-columns {
        grid-template-columns: 1fr;
    }
    
    .qa-history {
        max-height: 260px;
    }
    
    .qa-input-area {
        flex-direction: column;
    }
    
    .qa-input-area button {
        align-self: flex-end;
        padding-top: 10px;
        padding-bottom: 10px;
    }
}


