/* KCRZ 分步表单样式 - Wave 2 增强版 */

/* ===== 进度条 ===== */
.progress-steps {
    display: flex;
    overflow-x: auto;
    justify-content: space-between;
    position: relative;
    padding: 0 10px;
    max-width: 700px;
    margin: 0 auto;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50px;
    right: 50px;
    height: 2px;
    background: #dee2e6;
    z-index: 0;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #6c757d;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-item.active .step-circle {
    border-color: #0d6efd;
    background: #0d6efd;
    color: #fff;
    box-shadow: 0 0 0 4px rgba(13,110,253,0.2);
    animation: pulse-ring 2s infinite;
}

.step-item.completed .step-circle {
    border-color: #198754;
    background: #198754;
    color: #fff;
}

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 4px rgba(13,110,253,0.2); }
    50% { box-shadow: 0 0 0 8px rgba(13,110,253,0.1); }
    100% { box-shadow: 0 0 0 4px rgba(13,110,253,0.2); }
}

.step-label {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 6px;
    white-space: nowrap;
}

.step-item.active .step-label { color: #0d6efd; font-weight: 600; }
.step-item.completed .step-label { color: #198754; }

/* ===== 表单卡片 ===== */
.form-card {
    background: #fff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    animation: card-enter 0.5s ease-out;
}

@keyframes card-enter {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-card-title {
    font-weight: 700;
    font-size: 1.25rem;
    color: #212529;
    margin-bottom: 4px;
}

/* ===== 表单增强 ===== */
.form-group-enhanced {
    margin-bottom: 1.25rem;
    position: relative;
}

.form-group-enhanced label {
    font-weight: 600;
    font-size: 0.875rem;
    color: #495057;
    margin-bottom: 6px;
}

.form-group-enhanced .form-text {
    font-size: 0.75rem;
    color: #adb5bd;
}

.form-group-enhanced .is-invalid ~ .invalid-feedback {
    display: block;
}

.input-icon-wrap {
    position: relative;
}

.input-icon-wrap .bi {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
    z-index: 5;
}

.input-icon-wrap .form-control {
    padding-left: 40px;
}

.input-icon-wrap .form-select {
    padding-left: 40px;
}

/* 金额范围滑块 */
.range-display {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0d6efd;
    margin: 8px 0;
}

.range-display .unit {
    font-size: 0.875rem;
    color: #868e96;
    font-weight: 400;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e9ecef;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #0d6efd;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(13,110,253,0.3);
    transition: transform 0.2s;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

/* 行业选择卡片 */
.industry-card {
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #fff;
}

.industry-card:hover {
    border-color: #0d6efd;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13,110,253,0.1);
}

.industry-card.selected {
    border-color: #0d6efd;
    background: #e8f0fe;
}

.industry-card .industry-icon {
    font-size: 2rem;
    margin-bottom: 8px;
    display: block;
}

.industry-card .industry-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: #495057;
}

/* ===== OCR上传区 ===== */
.ocr-upload-zone {
    cursor: pointer;
    transition: all 0.2s;
}

.ocr-upload-zone:hover {
    background: #f0f7ff;
}

.border-dashed {
    border: 2px dashed #dee2e6 !important;
}

/* ===== 确认页样式 ===== */
.confirm-section {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}

.confirm-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f3f5;
}

.confirm-label {
    font-size: 0.75rem;
    color: #868e96;
    display: block;
    margin-bottom: 2px;
}

/* ===== 银行评分圆环 ===== */
.bank-score-circle {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: conic-gradient(#0d6efd 0%, #e9ecef 0%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    position: relative;
    transition: background 1s ease;
}

.bank-score-circle::before {
    content: '';
    position: absolute;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #fff;
}

.score-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: #212529;
    position: relative;
    z-index: 1;
    line-height: 1;
}

.score-unit {
    font-size: 0.875rem;
    color: #868e96;
    position: relative;
    z-index: 1;
}

/* ===== 评级徽章 ===== */
.bank-level-badge {
    display: inline-block;
    padding: 4px 20px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1rem;
}

.level-a-plus { background: #d1e7dd; color: #0f5132; }
.level-a { background: #cfe2ff; color: #084298; }
.level-b { background: #fff3cd; color: #664d03; }
.level-c { background: #f8d7da; color: #842029; }

/* ===== 产品卡片 ===== */
.product-card {
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 10px;
    transition: box-shadow 0.2s;
}

.product-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ===== 等待页动画 ===== */
.loading-stage {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 0;
    opacity: 0.3;
    transition: all 0.5s ease;
}

.loading-stage.active {
    opacity: 1;
}

.loading-stage.completed {
    opacity: 0.6;
}

.loading-stage .stage-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #868e96;
    transition: all 0.5s;
    flex-shrink: 0;
}

.loading-stage.active .stage-icon {
    background: #cfe2ff;
    color: #0d6efd;
    animation: icon-bounce 1s infinite;
}

.loading-stage.completed .stage-icon {
    background: #d1e7dd;
    color: #198754;
}

@keyframes icon-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.loading-stage .stage-text {
    flex: 1;
}

.loading-stage .stage-title {
    font-weight: 600;
    color: #212529;
    font-size: 0.95rem;
}

.loading-stage .stage-desc {
    font-size: 0.8rem;
    color: #868e96;
    margin-top: 2px;
}

.spinner-ring {
    width: 48px;
    height: 48px;
    border: 4px solid #e9ecef;
    border-top-color: #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== 否决结果页 ===== */
.veto-card {
    border: 2px solid #f8d7da;
    border-radius: 16px;
    padding: 24px;
    background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
    margin-bottom: 16px;
}

.veto-card .veto-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #f8d7da;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: #dc3545;
    margin: 0 auto 16px;
}

.veto-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    background: #fff;
    margin-bottom: 8px;
    border: 1px solid #f1f3f5;
}

.veto-item .veto-item-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.veto-item.hard .veto-item-icon {
    background: #f8d7da;
    color: #dc3545;
}

.veto-item.soft .veto-item-icon {
    background: #fff3cd;
    color: #ffc107;
}

.repair-card {
    border: 2px solid #cfe2ff;
    border-radius: 16px;
    padding: 24px;
    background: linear-gradient(135deg, #f0f7ff 0%, #ffffff 100%);
}

/* ===== 差距分析页 ===== */
.gap-bank-card {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    transition: all 0.3s;
}

.gap-bank-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.gap-bank-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gap-bank-header .bank-name {
    font-weight: 700;
    font-size: 1.1rem;
    color: #212529;
}

.gap-bank-header .match-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.match-full { background: #d1e7dd; color: #0f5132; }
.match-partial { background: #fff3cd; color: #664d03; }
.match-poor { background: #f8d7da; color: #842029; }

.gap-rule-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid #f1f3f5;
}

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

.gap-rule-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    margin-right: 12px;
}

.gap-rule-icon.pass { background: #d1e7dd; color: #198754; }
.gap-rule-icon.warning { background: #fff3cd; color: #ffc107; }
.gap-rule-icon.blocker { background: #f8d7da; color: #dc3545; }

.gap-rule-name {
    flex: 1;
    font-size: 0.875rem;
    color: #495057;
}

.gap-rule-detail {
    font-size: 0.75rem;
    color: #868e96;
    text-align: right;
}

.gap-summary-card {
    background: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%);
    border-radius: 16px;
    padding: 24px;
    color: #fff;
}

.gap-summary-card h5 { color: #fff; }

.improvement-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.15);
}

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

.improvement-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* ===== 额度对比页 ===== */
.credit-compare-table {
    border-collapse: separate;
    border-spacing: 0;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.credit-compare-table thead th {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    font-weight: 700;
    font-size: 0.8rem;
    color: #495057;
    padding: 14px 16px;
    text-align: center;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

.credit-compare-table tbody td {
    padding: 14px 16px;
    text-align: center;
    border-bottom: 1px solid #f1f3f5;
    font-size: 0.875rem;
    vertical-align: middle;
}

.credit-compare-table tbody tr:hover {
    background: #f8f9ff;
}

.credit-compare-table tbody tr:last-child td {
    border-bottom: none;
}

.credit-amount-highlight {
    font-size: 1.1rem;
    font-weight: 800;
    color: #0d6efd;
}

.credit-bar-wrap {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    margin-top: 4px;
}

.credit-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #0d6efd, #6610f2);
    transition: width 1s ease;
}

.confidence-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
}

.confidence-high { background: #d1e7dd; color: #0f5132; }
.confidence-medium { background: #fff3cd; color: #664d03; }
.confidence-low { background: #f8d7da; color: #842029; }

/* ===== 结果页增强 ===== */
.result-section {
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    animation: section-enter 0.6s ease-out both;
}

.result-section:nth-child(2) { animation-delay: 0.1s; }
.result-section:nth-child(3) { animation-delay: 0.2s; }
.result-section:nth-child(4) { animation-delay: 0.3s; }

@keyframes section-enter {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-section-title {
    font-weight: 700;
    font-size: 1rem;
    color: #212529;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.result-section-title .bi {
    color: #0d6efd;
}

.wuxing-detail-item {
    display: flex;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f1f3f5;
}

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

.wuxing-element-tag {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    margin-right: 12px;
    flex-shrink: 0;
}

.element-jin { background: linear-gradient(135deg, #ffd700, #ffaa00); color: #fff; }
.element-mu { background: linear-gradient(135deg, #52b788, #2d6a4f); color: #fff; }
.element-shui { background: linear-gradient(135deg, #74c0fc, #339af0); color: #fff; }
.element-huo { background: linear-gradient(135deg, #ff6b6b, #e03131); color: #fff; }
.element-tu { background: linear-gradient(135deg, #b197fc, #7950f2); color: #fff; }

.score-bar {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.score-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1.5s ease;
}

/* 五行标签页 */
.wuxing-tab-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: #f8f9fa;
    padding: 4px;
    border-radius: 10px;
}

.wuxing-tab-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
    color: #868e96;
    cursor: pointer;
    transition: all 0.3s;
}

.wuxing-tab-btn:hover { color: #495057; }

.wuxing-tab-btn.active {
    background: #fff;
    color: #0d6efd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.wuxing-tab-content {
    display: none;
}

.wuxing-tab-content.active {
    display: block;
    animation: tab-fade 0.3s ease;
}

@keyframes tab-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== 导出按钮组 ===== */
.export-btn-group {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.export-btn-group .btn {
    border-radius: 10px;
    font-weight: 600;
    padding: 10px 24px;
}

/* ===== 响应式 ===== */
@media (max-width: 576px) {
    .form-card { padding: 20px; }
    .progress-steps { padding: 0; }
    .step-label { font-size: 0.65rem; }
    .step-circle { width: 32px; height: 32px; font-size: 0.8rem; }
    .bank-score-circle { width: 120px; height: 120px; }
    .bank-score-circle::before { width: 90px; height: 90px; }
    .score-number { font-size: 2rem; }
    .wuxing-tab-nav { flex-wrap: wrap; }
    .wuxing-tab-btn { font-size: 0.7rem; padding: 6px 8px; }
    .gap-rule-item { flex-wrap: wrap; }
    .gap-rule-detail { text-align: left; width: 100%; margin-top: 4px; }
    .credit-compare-table { font-size: 0.75rem; }
    .credit-compare-table thead th, .credit-compare-table tbody td { padding: 8px; }
}

@media (max-width: 768px) {
    .industry-card { padding: 12px; }
    .industry-card .industry-icon { font-size: 1.5rem; }
}

/* ===== Wave 3 移动端增强 ===== */

/* 紧凑进度条 - 移动端显示为小圆点 */
@media (max-width: 480px) {
    .progress-steps::before { display: none; }
    .step-item { flex-direction: row; gap: 6px; }
    .step-circle { width: 26px; height: 26px; font-size: 0.65rem; border-width: 2px; }
    .step-item.active .step-circle { box-shadow: 0 0 0 3px rgba(13,110,253,0.2); }
    .step-label { display: none; }
    .step-item.completed .step-circle::after { content: '\2713'; font-size: 0.65rem; }
    .step-item.completed .step-circle i { display: none; }

    .form-card { padding: 16px 12px; border-radius: 12px; }
    .form-card-title { font-size: 1rem; }

    /* 移动端sticky底部栏 */
    .mobile-sticky-bar { padding: 8px 12px; }
    .mobile-sticky-bar .btn { font-size: 0.8rem; padding: 8px 16px; }

    /* loading 页移动端 */
    .loading-hero { padding: 30px 0 20px; }
    .loading-hero .hero-icon { font-size: 2.5rem; }
    .loading-stage { padding: 8px 0; gap: 8px; }
    .loading-stage .stage-icon { width: 36px; height: 36px; font-size: 0.9rem; }
    .loading-stage .stage-title { font-size: 0.85rem; }
    .loading-stage .stage-desc { font-size: 0.7rem; }
    .loading-stage .stage-badge { font-size: 0.65rem; }

    /* 雷达图缩小 */
    .wuxing-tab-content canvas { max-width: 180px !important; }
    .wuxing-detail-item { font-size: 0.75rem; }

    /* 额度对比hero */
    .credit-hero { padding: 20px 16px; }
    .credit-hero .hero-amount { font-size: 1.8rem; }

    /* veto 页 */
    .veto-card { padding: 16px; }
    .veto-card .veto-icon { width: 48px; height: 48px; font-size: 1.3rem; }
    .repair-card { padding: 16px; }

    /* 通用间距压缩 */
    .confirm-section { padding: 12px 0; }
    .confirm-label { font-size: 0.7rem; }
    .result-section { padding: 14px; margin-bottom: 14px; }
    .gap-bank-header { padding: 12px 14px; }
    .gap-rule-item { padding: 8px 14px; }

    /* 快捷导航改为2列 */
    .row.g-2.mb-4 > .col-4 { flex: 0 0 50%; max-width: 50%; }
}

/* 中等屏幕优化 */
@media (min-width: 481px) and (max-width: 768px) {
    .wuxing-tab-content canvas { max-width: 220px !important; }
    .credit-hero .hero-amount { font-size: 2rem; }
    .form-card { padding: 20px 16px; }
}

/* 平板横屏 */
@media (min-width: 769px) and (max-width: 1024px) {
    .wuxing-tab-content canvas { max-width: 240px !important; }
}

/* 分享模态框移动端 */
@media (max-width: 480px) {
    .modal-dialog { margin: 8px; }
    .modal-body .input-group { flex-direction: column; gap: 8px; }
    .modal-body .input-group .form-control { border-radius: 8px !important; }
}

/* 打印/导出优化 */
@media print {
    .progress-steps, .mobile-sticky-bar, .export-btn-group, .btn { display: none !important; }
    .form-card { border: none; box-shadow: none; }
    .result-section { break-inside: avoid; }
}
