/* AscendAI UX 升级共享样式 */

/* ---- 步骤检查清单 ---- */
.step-checklist-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 0;
    margin-bottom: 12px;
    font-size: 13px;
    flex-shrink: 0;
    overflow: hidden;
}
.step-checklist-card h4 {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}
.step-checklist-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    margin: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: #334155;
}
.step-checklist-toggle:hover {
    background: #f1f5f9;
}
.step-checklist-toggle .toggle-title {
    font-weight: 600;
    flex-shrink: 0;
}
.step-checklist-toggle .toggle-summary {
    margin-left: auto;
    font-size: 12px;
    color: #64748b;
    white-space: nowrap;
}
.step-checklist-card.all-complete .step-checklist-toggle .toggle-summary {
    color: #15803d;
}
.step-checklist-body {
    padding: 0 14px 10px;
    border-top: 1px solid #e2e8f0;
}
.step-checklist-card.is-collapsed .step-checklist-body {
    display: none;
}
.step-checklist-card.is-collapsed {
    margin-bottom: 8px;
}
.step-checklist-items {
    list-style: none;
    margin: 0;
    padding: 0;
}
.step-checklist-items li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 4px 0;
    color: #475569;
}
.step-checklist-items li.done { color: #15803d; }
.step-checklist-items li.warn { color: #b45309; }
.step-checklist-items li.fail { color: #b91c1c; }
.step-checklist-items li .chk-icon { flex-shrink: 0; width: 18px; text-align: center; }
.step-checklist-items li a.step-link {
    color: #004098;
    text-decoration: underline;
    cursor: pointer;
    margin-left: 4px;
}

/* ---- 侧边栏步骤状态 ---- */
.step-item.locked {
    opacity: 0.55;
    cursor: not-allowed;
}
.step-item.locked:hover {
    background: transparent;
}
.step-item.in-progress .step-icon {
    background: #fef3c7;
    color: #b45309;
    border: 2px solid #f59e0b;
}
.step-item.step-unlocked:not(.active):not(.completed) .step-icon {
    background: #f1f5f9;
    color: #64748b;
}

/* ---- 精简模式 ---- */
body.simple-mode .step4-kgraph-wrap,
body.simple-mode .step4-kgraph-tabs,
body.simple-mode #step4CoverageMatrixPanel,
body.simple-mode .step4-advanced-panel,
body.simple-mode #step-6 .detection-results-container .optimization-detail-list,
body.simple-mode #step-6 .modification-confirm-panel {
    display: none !important;
}
body.simple-mode .simple-mode-hint {
    display: block;
}
.simple-mode-hint {
    display: none;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: #1e40af;
    margin-bottom: 12px;
}

/* ---- 精简模式开关 ---- */
.ux-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.ux-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
}
.ux-toggle-btn:hover { border-color: #004098; color: #004098; }
.ux-toggle-btn.active {
    background: #004098;
    border-color: #004098;
    color: #fff;
}

/* ---- 结构化错误面板 ---- */
.structured-error-panel {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10050;
    max-width: 520px;
    width: calc(100% - 32px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    border-left: 4px solid #dc2626;
    padding: 16px 20px;
    animation: uxSlideUp 0.3s ease;
}
.structured-error-panel.warning { border-left-color: #f59e0b; }
.structured-error-panel.info { border-left-color: #3b82f6; }
.structured-error-panel h5 {
    margin: 0 0 6px;
    font-size: 15px;
    color: #1e293b;
}
.structured-error-panel p {
    margin: 0 0 12px;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}
.structured-error-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.structured-error-actions button {
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #fff;
    cursor: pointer;
}
.structured-error-actions button.primary {
    background: #004098;
    border-color: #004098;
    color: #fff;
}
@keyframes uxSlideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ---- 长任务中心 ---- */
.task-center {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10040;
    width: 320px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    border: 1px solid #e2e8f0;
    overflow: hidden;
    transition: all 0.3s;
}
.task-center.minimized {
    width: auto;
    min-width: 200px;
}
.task-center.minimized .task-center-body { display: none; }
.task-center-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
}
.task-center-header h5 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}
.task-center-body { padding: 12px 14px; }
.task-center-status {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 8px;
}
.task-center-progress {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}
.task-center-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #004098, #2563eb);
    border-radius: 3px;
    transition: width 0.3s;
}
.task-center-detail {
    font-size: 12px;
    color: #475569;
    line-height: 1.4;
}
.task-center-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}
.task-center-actions button {
    flex: 1;
    padding: 5px 8px;
    font-size: 11px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
}
.task-center.done .task-center-header { background: #f0fdf4; }
.task-center.failed .task-center-header { background: #fef2f2; }

/* ---- 文档解析进度（步骤5）---- */
.doc-parse-progress {
    background: linear-gradient(180deg, #f0f9ff 0%, #f8fafc 100%);
    border: 1px solid #7dd3fc;
    border-radius: 10px;
    padding: 14px 16px;
    margin-top: 12px;
    display: none;
    box-shadow: 0 4px 14px rgba(14, 165, 233, 0.12);
}
.doc-parse-progress.visible { display: block; }

/* 上传区即时状态横幅（紧贴文件列表下方） */
.original-plan-upload-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 12px;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid #bae6fd;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    box-shadow: 0 4px 16px rgba(0, 64, 152, 0.1);
}
.original-plan-upload-banner[hidden] { display: none !important; }
.original-plan-upload-banner--parsing,
.original-plan-upload-banner--selected {
    border-color: #0ea5e9;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
}
.original-plan-upload-banner--success {
    border-color: #86efac;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}
.original-plan-upload-banner--error {
    border-color: #fca5a5;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
}
.original-plan-upload-banner__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #0369a1;
    background: rgba(255, 255, 255, 0.85);
}
.original-plan-upload-banner--success .original-plan-upload-banner__icon { color: #15803d; }
.original-plan-upload-banner--error .original-plan-upload-banner__icon { color: #dc2626; }
.original-plan-upload-banner__body { flex: 1; min-width: 0; }
.original-plan-upload-banner__body strong {
    display: block;
    font-size: 14px;
    color: #0f172a;
    margin-bottom: 4px;
}
.original-plan-upload-banner__body p {
    margin: 0;
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
}
.original-plan-upload-banner__bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 3px;
    margin-top: 10px;
    overflow: hidden;
}
.original-plan-upload-banner__bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #004098, #0ea5e9);
    border-radius: 3px;
    transition: width 0.4s ease;
}
.doc-parse-stages {
    list-style: none;
    margin: 0;
    padding: 0;
}
.doc-parse-stages li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    font-size: 13px;
    color: #94a3b8;
}
.doc-parse-stages li.active { color: #004098; font-weight: 500; }
.doc-parse-stages li.done { color: #15803d; }
.doc-parse-stages li .stage-icon { width: 20px; text-align: center; }
.doc-parse-completeness {
    margin-top: 10px;
    font-size: 12px;
    color: #64748b;
}
.doc-parse-completeness .bar {
    height: 6px;
    background: #e2e8f0;
    border-radius: 3px;
    margin-top: 4px;
    overflow: hidden;
}
.doc-parse-completeness .bar-fill {
    height: 100%;
    background: #22c55e;
    border-radius: 3px;
}

/* ---- 首次引导 ---- */
.onboarding-overlay {
    position: fixed;
    inset: 0;
    z-index: 20000;
    background: rgba(0,0,0,0.45);
}
.onboarding-spotlight {
    position: absolute;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.45);
    pointer-events: none;
}
.onboarding-tooltip {
    position: fixed;
    z-index: 20001;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    max-width: 360px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}
.onboarding-tooltip h4 {
    margin: 0 0 8px;
    font-size: 16px;
    color: #1e293b;
}
.onboarding-tooltip p {
    margin: 0 0 16px;
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
}
.onboarding-tooltip .ob-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.onboarding-tooltip button {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    border: none;
}
.onboarding-tooltip .ob-skip {
    background: transparent;
    color: #94a3b8;
}
.onboarding-tooltip .ob-next {
    background: #004098;
    color: #fff;
}

/* ---- 工作台：继续上次 ---- */
.continue-last-banner {
    background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}
.continue-last-banner .info h5 {
    margin: 0 0 4px;
    font-size: 15px;
    color: #1e40af;
}
.continue-last-banner .info p {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}
.continue-last-banner .actions {
    display: flex;
    gap: 8px;
}
