/* ========== 招标文件解析 ========== */
.parsing-page {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 上传解析区 */
.parse-upload-area {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 32px;
}

.parse-upload-zone {
    border: 2px dashed var(--border-dark);
    border-radius: var(--radius-lg);
    padding: 48px;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.parse-upload-zone:hover,
.parse-upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.parse-upload-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: var(--primary-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.parse-upload-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.parse-upload-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* 解析进度 */
.parse-progress {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 32px;
}

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

.progress-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar-wrapper {
    margin-bottom: 20px;
}

.progress-bar-track {
    width: 100%;
    height: 8px;
    background: var(--bg-body);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-top: 16px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.progress-step-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    border: 2px solid var(--border-color);
    color: var(--text-muted);
    background: var(--bg-card);
    transition: var(--transition);
}

.progress-step.active .progress-step-dot {
    border-color: var(--primary);
    color: var(--primary);
    background: var(--primary-bg);
}

.progress-step.done .progress-step-dot {
    border-color: var(--success);
    background: var(--success);
    color: var(--text-white);
}

.progress-step-label {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
}

.progress-step.done .progress-step-label {
    color: var(--success);
    font-weight: 500;
}

.progress-step.active .progress-step-label {
    color: var(--primary);
    font-weight: 500;
}

/* 解析结果 */
.parse-results {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.parse-result-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.parse-tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.parse-tab:hover {
    color: var(--text-primary);
}

.parse-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.parse-tab-count {
    background: var(--bg-body);
    color: var(--text-secondary);
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 10px;
}

.parse-tab.active .parse-tab-count {
    background: var(--primary);
    color: var(--text-white);
}

/* 需求项卡片 */
.requirement-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.requirement-item {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 18px 20px;
    transition: var(--transition);
}

.requirement-item:hover {
    box-shadow: var(--shadow-md);
}

.requirement-header {
    display: flex;
    align-items: start;
    gap: 12px;
    margin-bottom: 10px;
}

.requirement-index {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    flex-shrink: 0;
}

.requirement-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
    line-height: 1.5;
}

.requirement-body {
    padding-left: 40px;
}

.requirement-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 10px;
}

.requirement-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 评分项 */
.scoring-table {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.scoring-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border-bottom: 1px solid var(--border-color);
}

.scoring-summary-item {
    padding: 20px;
    text-align: center;
    border-right: 1px solid var(--border-color);
}

.scoring-summary-item:last-child {
    border-right: none;
}

.scoring-summary-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
}

.scoring-summary-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* 废标项 */
.disqualify-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.disqualify-item {
    background: var(--danger-bg);
    border-radius: var(--radius-lg);
    border: 1px solid #FCA5A5;
    padding: 16px 20px;
    display: flex;
    align-items: start;
    gap: 12px;
}

.disqualify-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--danger);
    color: var(--text-white);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 700;
}

.disqualify-content {
    flex: 1;
}

.disqualify-title {
    font-size: 14px;
    font-weight: 600;
    color: #991B1B;
    margin-bottom: 4px;
}

.disqualify-desc {
    font-size: 13px;
    color: #B91C1C;
    line-height: 1.6;
}

/* 关键信息 */
.key-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.key-info-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    padding: 20px;
}

.key-info-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.key-info-value {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

.key-info-value.highlight {
    color: var(--primary);
}

/* 已解析文件列表 */
.parsed-files-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.parsed-file-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.parsed-file-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: var(--transition);
    cursor: pointer;
}

.parsed-file-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.parsed-file-card.active {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.parsed-file-info {
    flex: 1;
    min-width: 0;
}

.parsed-file-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.parsed-file-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

@media (max-width: 768px) {
    .scoring-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    .key-info-grid {
        grid-template-columns: 1fr;
    }
    .progress-steps {
        flex-wrap: wrap;
        gap: 12px;
    }
}

/* ========== V4: 输入方式切换 Tab ========== */
.parse-input-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0;
}

.parse-input-tab {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.parse-input-tab:hover {
    color: var(--text-primary);
    background: var(--bg-body);
}

.parse-input-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: var(--primary-bg);
}

/* 文字输入区 */
.parse-text-zone {
    text-align: center;
    padding: 20px 0;
}

.parse-text-input {
    width: 100%;
    min-height: 200px;
    margin-top: 16px;
    padding: 16px;
    font-size: 14px;
    line-height: 1.6;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    resize: vertical;
    font-family: inherit;
}

.parse-text-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

/* 图片上传区 */
.parse-image-zone {
    text-align: center;
    padding: 20px 0;
}

.parse-image-upload-zone {
    border: 2px dashed var(--border-dark);
    border-radius: var(--radius-lg);
    padding: 24px;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 12px;
}

.parse-image-upload-zone:hover,
.parse-image-upload-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

.image-preview-area {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    min-height: 60px;
    align-items: center;
}

.image-preview-item {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 11px;
    padding: 2px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview-remove:hover {
    background: var(--danger);
}

/* 附加文字输入框 */
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    font-size: 13px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
}

/* ========== V5: 项目制 ========== */
.project-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    cursor: pointer;
    transition: var(--transition);
}

.project-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.project-card-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.project-card-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.project-card-sections {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.project-section-tag {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-body);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.project-section-tag.active {
    background: var(--primary-bg);
    color: var(--primary);
    border-color: var(--primary);
}

/* 分块 Tab */
.project-section-tabs {
    display: flex;
    gap: 4px;
    padding: 12px 24px 0;
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
}

.project-section-tab {
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    white-space: nowrap;
}

.project-section-tab:hover { color: var(--text-primary); }

.project-section-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 500;
}

.section-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    display: inline-block;
}

/* 分块内容 */
.section-detail { min-height: 300px; }

.ai-result-box {
    background: var(--primary-bg);
    border: 1px solid var(--primary);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
}

.ai-result-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 12px;
}

.ai-result-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-result-item {
    display: flex;
    gap: 10px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}

.ai-result-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ai-result-content { flex: 1; }

.ai-result-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.ai-result-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.ai-result-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.5;
}

.ai-result-value {
    font-size: 13px;
    color: var(--text-primary);
    margin-top: 2px;
}

/* 输入方式切换 */
.section-input-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}

.section-input-tab {
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    transition: var(--transition);
}

.section-input-tab:hover { border-color: var(--primary); }

.section-input-tab.active {
    color: var(--primary);
    border-color: var(--primary);
    background: var(--primary-bg);
}

/* 上传区 */
.section-upload-zone {
    border: 2px dashed var(--border-dark);
    border-radius: var(--radius-md);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-muted);
}

.section-upload-zone:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
    color: var(--primary);
}

.section-image-zone {
    border: 2px dashed var(--border-dark);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.section-image-zone:hover,
.section-image-zone.dragover {
    border-color: var(--primary);
    background: var(--primary-bg);
}

/* 手工维护区 */
.manual-edit-area {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.manual-edit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

/* 附件列表 */
.attachment-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.attachment-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 18px;
}

.attachment-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ========== 层级结构（需求/废标） ========== */
.hierarchy-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hierarchy-group {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.hierarchy-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
}

.hierarchy-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.hierarchy-group-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: #fff;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.hierarchy-group-actions {
    display: flex;
    gap: 2px;
}

.hierarchy-items {
    padding: 8px 16px;
}

.hierarchy-item {
    display: flex;
    gap: 12px;
    padding: 10px 8px;
    border-bottom: 1px solid var(--border-light);
    align-items: flex-start;
}

.hierarchy-item:last-child {
    border-bottom: none;
}

.hierarchy-item-num {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    flex-shrink: 0;
    margin-top: 2px;
    min-width: 28px;
}

.hierarchy-item-content {
    flex: 1;
    min-width: 0;
}

.hierarchy-item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.hierarchy-item-summary {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.hierarchy-item-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.hierarchy-item:hover .hierarchy-item-actions {
    opacity: 1;
}

/* ========== 评分项卡片 ========== */
.scoring-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.scoring-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.scoring-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
}

.scoring-card-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.scoring-card-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: #fff;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.scoring-card-actions {
    display: flex;
    gap: 2px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.scoring-card:hover .scoring-card-actions {
    opacity: 1;
}

.scoring-card-body {
    padding: 12px 16px;
}

.scoring-card-tags {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.scoring-card-row {
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 4px;
}

.scoring-card-label {
    color: var(--text-muted);
    font-weight: 500;
}

.scoring-card-value {
    color: var(--text-primary);
}

.scoring-card-summary {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 8px;
    padding: 6px 10px;
    background: var(--bg-body);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--success);
}

/* ========== 辅助 ========== */
.border-light { border-color: var(--border-light) !important; }

/* ========== 备注板块 ========== */
.remark-section {
    margin-top: 20px;
    padding: 16px;
    background: var(--warning-bg, #fff8e1);
    border: 1px solid var(--warning);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--warning);
}

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

.remark-textarea {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
}

/* 可编辑文本样式 */
[contenteditable="true"] {
    cursor: text;
    border-radius: 4px;
    padding: 2px 4px;
    margin: -2px -4px;
    transition: background 0.2s;
}

[contenteditable="true"]:hover {
    background: var(--primary-bg);
    outline: 1px dashed var(--primary);
}

[contenteditable="true"]:focus {
    background: var(--bg-card);
    outline: 2px solid var(--primary);
}

/* ========== 统一表格样式 ========== */
.parse-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
}

.parse-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.parse-table thead th {
    background: var(--bg-body);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 12px;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.parse-table tbody tr {
    border-bottom: 1px solid var(--border-light, var(--border-color));
    transition: background 0.15s;
}

.parse-table tbody tr:hover {
    background: var(--primary-bg);
}

.parse-table tbody tr:last-child {
    border-bottom: none;
}

.parse-table td {
    padding: 10px 12px;
    color: var(--text-primary);
    vertical-align: top;
    line-height: 1.5;
}

.parse-table .td-num {
    color: var(--text-muted);
    font-weight: 500;
    text-align: center;
    font-size: 12px;
}

.parse-table .td-title {
    font-weight: 500;
    min-width: 100px;
}

.parse-table .td-type {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.parse-table .td-score {
    font-weight: 600;
    color: var(--success);
    text-align: center;
}

.parse-table .td-outline {
    color: var(--text-secondary);
    min-width: 200px;
}

.parse-table .td-remark {
    color: var(--text-muted);
    font-size: 12px;
    min-width: 100px;
}

.parse-table .td-actions {
    white-space: nowrap;
    text-align: right;
}

/* 表格内 contenteditable 单元格样式 */
.parse-table [contenteditable="true"] {
    padding: 4px 6px;
    margin: 0;
    border-radius: 4px;
    min-height: 20px;
}

.parse-table [contenteditable="true"]:empty::before {
    content: '点击编辑';
    color: var(--text-muted);
    opacity: 0.5;
    font-size: 12px;
}

/* ========== 进度条 ========== */
.parse-progress-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.parse-progress-modal {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 32px 40px;
    min-width: 360px;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

.parse-progress-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.parse-progress-bar-wrap {
    width: 100%;
    height: 8px;
    background: var(--bg-body);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.parse-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light, #60a5fa));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.parse-progress-text {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* ========== 投标附件解析卡片 ========== */
.attachment-parsed-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.attachment-parsed-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.attachment-parsed-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-body);
    border-bottom: 1px solid var(--border-color);
}

.attachment-sections-list {
    padding: 8px 16px;
}

.attachment-section-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light, var(--border-color));
}

.attachment-section-item:last-child {
    border-bottom: none;
}

.attachment-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.attachment-section-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.attachment-section-summary {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.5;
}

.attachment-blanks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.blank-tag-wrap {
    display: inline-flex;
    align-items: center;
    margin: 0 4px 4px 0;
    border-radius: 4px;
    overflow: hidden;
}

.blank-tag {
    display: inline-block;
    background: #fff8e1;
    color: #e65100;
    border: 1px solid #ffcc02;
    border-radius: 4px 0 0 4px;
    padding: 3px 8px;
    font-size: 12px;
    border-right: none;
    outline: none;
}

.blank-tag-del {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    color: #fff;
    border: 1px solid #ffcc02;
    border-left: none;
    border-radius: 0 4px 4px 0;
    width: 20px;
    height: 24px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
}

.blank-tag-del:hover {
    background: #dc2626;
}

/* ========== 投标附件折叠卡片 ========== */
.attachment-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border-light, var(--border-color));
}

.attachment-section-header:hover {
    background: var(--bg-body);
}

.attachment-section-item.collapsed .attachment-section-body {
    display: none;
}

.attachment-section-item.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.toggle-icon {
    transition: transform 0.2s;
    flex-shrink: 0;
}

.attachment-section-body {
    padding: 14px 16px;
}

.attachment-section-content {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-primary);
    margin-top: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.attachment-section-content:focus {
    background: var(--bg-card);
    outline: 2px solid var(--primary);
}

/* 富文本模式下的表格样式 */
.attachment-section-content.has-html,
.raw-content-preview {
    /* 表格样式 */
}

.attachment-section-content.has-html table,
.raw-content-preview table {
    width: 100%;
    border-collapse: collapse;
    margin: 8px 0;
    font-size: 13px;
    empty-cells: show;
}

.attachment-section-content.has-html table th,
.raw-content-preview table th {
    border: 1px solid var(--border-color);
    padding: 6px 8px;
    background: var(--bg-body);
    font-weight: 600;
    text-align: left;
}

.attachment-section-content.has-html table td,
.raw-content-preview table td {
    border: 1px solid var(--border-color);
    padding: 6px 8px;
}

.attachment-section-content.has-html table td:empty::before,
.raw-content-preview table td:empty::before {
    content: ' ';
    white-space: pre;
}

.attachment-section-content.has-html table td:focus,
.raw-content-preview table td:focus {
    outline: 2px solid var(--primary);
    background: #fffbe6;
}

.add-row-bar {
    display: flex;
    gap: 4px;
    padding: 4px 0 0;
    margin-top: 4px;
    border-top: 1px dashed var(--border-color);
}

/* 插入的表格卡片（独立隔离，不影响其他章节） */
.inserted-table-card { position: relative; }
.inserted-table-body { padding: 8px; max-height: 400px; overflow-y: auto; }
.inserted-table-body table { width: 100%; border-collapse: collapse; font-size: 12px; }
.inserted-table-body th { border: 1px solid #ddd; padding: 4px 6px; background: #f5f5f5; font-weight: 600; text-align: center; }
.inserted-table-body td { border: 1px solid #ddd; padding: 4px 6px; text-align: center; }
.inserted-table-body td:focus { outline: 2px solid var(--primary); background: #fffbe6; }

.attachment-section-content.has-html p,
.raw-content-preview p {
    margin: 4px 0;
    line-height: 1.6;
}

.attachment-section-content.has-html h3,
.raw-content-preview h3 {
    margin: 12px 0 6px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.attachment-section-content.has-html h4,
.raw-content-preview h4 {
    margin: 10px 0 4px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.att-sec-title-text {
    flex: 1;
    min-width: 0;
    padding: 2px 6px;
    border-radius: 4px;
}

.att-sec-title-text:focus {
    background: var(--bg-card);
    outline: 2px solid var(--primary);
}
