/* AI 企业评估 V2 — 页面专属样式 */

/* ===== 布局 ===== */
.aev2-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ===== 左栏：报告列表 ===== */
.aev2-report-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.aev2-tab-btn {
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    border: none;
    white-space: nowrap;
}

.aev2-tab-btn.active {
    background: #eff6ff;
    color: #2563eb;
}

.aev2-tab-btn:hover:not(.active) {
    background: #f3f4f6;
    color: #374151;
}

.aev2-select {
    width: 100%;
    padding: 6px 10px;
    font-size: 13px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    outline: none;
    background: white;
}

/* 报告列表项 */
.aev2-report-item {
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    margin-bottom: 4px;
}

.aev2-report-item:hover {
    background: #f9fafb;
    border-color: #e5e7eb;
}

.aev2-report-item.active {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.aev2-report-item .aev2-report-org-name {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
    /* 同候选列表：企业全称换行完整显示，行高随内容增长，不再单行省略 */
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
}

.aev2-report-item .aev2-report-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #6b7280;
}

.aev2-report-type-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
}

.aev2-report-type-badge.basic {
    background: #e0e7ff;
    color: #4338ca;
}

.aev2-report-type-badge.invest {
    background: #fef3c7;
    color: #92400e;
}

.aev2-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
}

.aev2-status-pending {
    background: #f3f4f6;
    color: #6b7280;
}

.aev2-status-processing {
    background: #fef3c7;
    color: #92400e;
}

.aev2-status-failed {
    background: #fee2e2;
    color: #dc2626;
}

.aev2-status-success {
    background: #d1fae5;
    color: #059669;
}

/* 下载按钮（左栏 + 右栏通用） */
.aev2-download-btn,
.aev2-erc-download {
    cursor: pointer;
    color: #0066FF;
    font-size: 13px;
    margin-left: auto;
    transition: color 0.15s;
}

.aev2-download-btn:hover,
.aev2-erc-download:hover {
    color: #0052CC;
}

/* 空状态 */
.aev2-empty-list {
    text-align: center;
    padding: 40px 16px;
    color: #9ca3af;
    font-size: 13px;
}

.aev2-empty-list i {
    font-size: 32px;
    margin-bottom: 8px;
    display: block;
    color: #d1d5db;
}

/* ===== 右栏：searching 搜索结果 ===== */
.aev2-search-header {
    position: sticky;
    top: 0;
    z-index: 10;
}

/* 候选企业列表（紧凑单行） */
.aev2-candidate-list {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
}

.aev2-candidate-card {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f3f4f6;
}

.aev2-candidate-card:last-child {
    border-bottom: none;
}

.aev2-candidate-card:hover {
    background: #f0f7ff;
}

.aev2-candidate-card .aev2-candidate-name {
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
    /* 企业全称通常较长（含括号分公司后缀），改为按内容换行、行高自动增长，
       保证全称完整可读；不再做单行省略（“…”会让用户无法判断是哪家企业） */
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    word-break: break-word;
    flex: 1 1 auto;
    /* flex 子项默认 min-width:auto 会拒绝压缩、导致不换行，必须置 0 */
    min-width: 0;
}

.aev2-candidate-card .aev2-candidate-desc {
    font-size: 11px;
    color: #9ca3af;
    margin-left: auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-left: 12px;
    flex-shrink: 0;   /* 不被名称挤压，保证“法定代表人 · 注册资本”完整显示 */
}

/* ===== 右栏：await_confirm 确认面板 ===== */
.aev2-confirm-section {
    margin-bottom: 24px;
}

.aev2-confirm-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.aev2-confirm-org-card {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
}

.aev2-attach-area {
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    transition: all 0.2s;
}

.aev2-attach-area:hover {
    border-color: #93c5fd;
    background: #eff6ff;
}

.aev2-attach-btn {
    padding: 8px 20px;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
}

.aev2-attach-btn:hover {
    background: #f3f4f6;
}

.aev2-file-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    font-size: 13px;
    color: #1e40af;
}

.aev2-file-remove {
    cursor: pointer;
    color: #6b7280;
    font-size: 16px;
    line-height: 1;
}

.aev2-file-remove:hover {
    color: #dc2626;
}

/* ===== 右栏：enterprise 企业视图 ===== */
.aev2-enterprise-topbar {
    flex-shrink: 0;
}

.aev2-enterprise-reports {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.aev2-enterprise-report-card {
    flex-shrink: 0;
    min-width: 200px;
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    cursor: pointer;
    transition: all 0.2s;
}

.aev2-enterprise-report-card:hover {
    border-color: #bfdbfe;
    background: #eff6ff;
}

.aev2-enterprise-report-card .aev2-erc-type {
    font-size: 12px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.aev2-enterprise-report-card .aev2-erc-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #6b7280;
}

.aev2-enterprise-report-empty {
    font-size: 13px;
    color: #9ca3af;
    padding: 8px 0;
}

/* Chat 输入区 */
.aev2-chat-input-area {
    position: relative;
}

/* ===== 通用：搜索结果加载 ===== */
.aev2-loading-hint {
    text-align: center;
    padding: 40px;
    color: #6b7280;
    font-size: 14px;
}

.aev2-loading-hint i {
    margin-right: 6px;
}

/* ===== 对话气泡样式 ===== */
.aev2-chat-container {
    max-width: 900px;
    margin: 0 auto;
}

/* ===== 对话气泡（对齐 industry_chat） ===== */

.chat-bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    animation: fadeIn 0.3s ease-in-out;
    word-wrap: break-word;
}

/* 用户气泡（右侧，蓝色渐变） */
.chat-bubble-user {
    background: linear-gradient(135deg, #0066FF 0%, #0052CC 100%);
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

/* Agent 气泡（左侧，全宽白色） */
.chat-bubble-agent {
    max-width: 100%;
    background: white;
    color: #374151;
    margin-right: auto;
    border-bottom-left-radius: 4px;
    border: 1px solid #e5e7eb;
}

/* 候选企业列表所在的气泡（chatRenderer.appendSearchResults 加 chat-bubble-result 类）。
   气泡作为 flex 项默认按内容收缩，列表内容不长时会缩得很窄、右侧留下大片空白，
   连带把企业全称的可用宽度压小。给一个最小宽度撑开一些：
   80% 而非 100%，保留气泡的视觉特征，不占满整行 */
.chat-bubble-agent.chat-bubble-result {
    min-width: 80%;
}

/* Markdown 渲染内容 */
.md-rendered-content {
    line-height: 1.7;
    font-size: 14px;
}

.md-rendered-content p {
    margin-bottom: 8px;
}

.md-rendered-content p:last-child {
    margin-bottom: 0;
}

.md-rendered-content ul,
.md-rendered-content ol {
    padding-left: 20px;
    margin-bottom: 8px;
}

.md-rendered-content li {
    margin-bottom: 4px;
}

.md-rendered-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 12px 16px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 13px;
    margin-bottom: 8px;
}

.md-rendered-content code {
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

.md-rendered-content pre code {
    background: transparent;
    padding: 0;
}

.md-rendered-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 8px;
}

.md-rendered-content th,
.md-rendered-content td {
    border: 1px solid #e5e7eb;
    padding: 6px 12px;
    text-align: left;
    font-size: 13px;
}

.md-rendered-content th {
    background: #f9fafb;
    font-weight: 600;
}

.md-rendered-content blockquote {
    border-left: 3px solid #d1d5db;
    padding-left: 12px;
    color: #6b7280;
    margin-bottom: 8px;
}

.md-rendered-content a {
    color: #0066FF;
    text-decoration: underline;
}

/* typing-indicator 动画复用 base.css */
