/* 卡曼智能出口退税系统 - 业务页面样式 */
[hidden] { display: none !important; }

/* ---------- 顶部引擎状态 ---------- */
.engine-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 30px;
    padding: 0 11px;
    border-radius: 20px;
    border: 1px solid color-mix(in srgb, var(--success) 22%, var(--border));
    background: var(--success-soft);
    color: var(--success);
    font-size: 10.5px;
    font-weight: 650;
    white-space: nowrap;
}
.engine-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 18%, transparent); animation: pulseDot 2s ease infinite; }
@keyframes pulseDot { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }

/* ---------- 工作台 AI 横幅 ---------- */
.ai-banner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    margin-bottom: 16px;
    border-radius: var(--radius-lg);
    border: 1px solid color-mix(in srgb, var(--primary) 16%, var(--border));
    background:
        radial-gradient(120% 180% at 0% 0%, color-mix(in srgb, var(--primary) 12%, transparent), transparent 52%),
        linear-gradient(135deg, var(--surface), color-mix(in srgb, var(--primary) 3%, var(--surface)));
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.ai-banner::after {
    content: "";
    position: absolute;
    right: -60px;
    top: -90px;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--teal) 14%, transparent), transparent 65%);
    pointer-events: none;
}
.ai-banner-orb {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--teal));
    box-shadow: 0 12px 26px -12px color-mix(in srgb, var(--primary) 80%, transparent);
    flex: 0 0 auto;
    display: grid;
    place-items: center;
}
.ai-banner-orb span {
    width: 19px;
    height: 19px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,.9);
    border-right-color: transparent;
    animation: spin 2.4s linear infinite;
}
.ai-banner-orb i {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 10px #fff;
}
.ai-banner-copy { flex: 1; min-width: 0; }
.ai-banner-copy strong { display: block; font-size: 14px; font-weight: 700; letter-spacing: -.1px; }
.ai-banner-copy span { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.ai-banner-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.ai-banner .btn { flex: 0 0 auto; }

/* ---------- 台账 KPI ---------- */
.ledger-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.ledger-kpi {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 15px 17px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.ledger-kpi::after { content: ""; position: absolute; right: -30px; top: -36px; width: 96px; height: 96px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--primary) 9%, transparent), transparent 68%); }
.ledger-kpi > span { display: block; font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.ledger-kpi > strong { display: block; margin-top: 7px; font-size: 22px; font-weight: 730; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.ledger-kpi > strong small { font-size: 11px; font-weight: 500; color: var(--text-3); }
.ledger-kpi > small { display: block; margin-top: 4px; font-size: 10.5px; color: var(--text-3); }

/* ---------- 台账工具条 ---------- */
.ledger-view .page-actions .btn { white-space: nowrap; }
.ledger-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.ledger-toolbar .search-box { flex: 0 1 320px; min-width: 210px; }
.ledger-toolbar .search-box svg { position: absolute; left: 12px; width: 15px; height: 15px; color: var(--text-3); pointer-events: none; }
.ledger-toolbar .search-box .input { padding-left: 35px; height: 36px; }
.ledger-date { width: 136px; height: 36px; min-height: 36px; font-size: 12px; }
.date-sep { font-size: 11px; color: var(--text-3); }
.ledger-toolbar .cselect { width: auto; min-width: 120px; }
.ledger-toolbar .cselect-trigger { min-height: 36px; font-size: 12px; }
.ledger-legend { display: inline-flex; align-items: center; gap: 10px; margin-left: auto; font-size: 10.5px; color: var(--text-3); white-space: nowrap; }
.ledger-legend span { display: inline-flex; align-items: center; gap: 4px; }
.dot.green { background: var(--success); }
.dot.amber { background: var(--warning); }
.dot.blue { background: var(--primary); }
.dot.red { background: var(--danger); }

.ledger-wrap { overflow: auto; max-height: calc(100vh - 390px); min-height: 360px; }
.xl-ledger { min-width: 1960px; table-layout: fixed; font-size: 10.5px; }
.xl-ledger th { font-size: 10px; padding: 9px 7px; white-space: nowrap; }
.xl-ledger td { padding: 7px 7px; height: 34px; border-right: 1px solid color-mix(in srgb, var(--border) 65%, transparent); }
.xl-ledger tbody tr { cursor: default; }
.xl-ledger tbody tr:hover { background: color-mix(in srgb, var(--primary) 4%, var(--surface)); }
.xl-ledger .col-check { width: 38px; text-align: center; }
.xl-ledger .col-idx { width: 46px; text-align: center; color: var(--text-3); font-variant-numeric: tabular-nums; }
.xl-ledger .col-no { width: 158px; }
.xl-ledger .col-actions { width: 112px; }
.xl-ledger th:nth-child(4) { width: 88px; }
.xl-ledger th:nth-child(5) { width: 72px; }
.xl-ledger th:nth-child(6) { width: 54px; }
.xl-ledger th:nth-child(7) { width: 90px; }
.xl-ledger th:nth-child(8) { width: 86px; }
.xl-ledger th:nth-child(9) { width: 66px; }
.xl-ledger th:nth-child(10) { width: 98px; }
.xl-ledger th:nth-child(11) { width: 96px; }
.xl-ledger th:nth-child(12) { width: 66px; }
.xl-ledger th:nth-child(13) { width: 88px; }
.xl-ledger th:nth-child(14) { width: 82px; }
.xl-ledger th:nth-child(15) { width: 78px; }
.xl-ledger th:nth-child(16) { width: 130px; }
.xl-ledger th:nth-child(17) { width: 128px; }
.xl-ledger th:nth-child(18) { width: 80px; }
.xl-ledger th:nth-child(19) { width: 120px; }
.xl-ledger th:nth-child(20) { width: 80px; }
.xl-ledger .doc-no-link { font-size: 10.5px; }
.xl-ledger .deal-tag { display: inline-flex; height: 20px; align-items: center; padding: 0 6px; border-radius: 5px; background: var(--surface-3); color: var(--text-2); font-size: 10px; font-weight: 650; }
.xl-ledger .muted { color: var(--text-3); font-size: 10px; }
.xl-ledger .green { color: var(--success); font-weight: 650; }
.xl-ledger .red { color: var(--danger); }
.cell-ellipsis { max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.warn-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--warning); margin-left: 5px; vertical-align: middle; box-shadow: 0 0 0 3px var(--warning-soft); }
.ledger-tip { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--text-3); }
.ledger-tip svg { width: 12px; height: 12px; }

/* ---------- 智能识别 ---------- */
.import-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; align-items: start; }
.import-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.import-aside { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.upload-card .card-body { padding-top: 16px; }
.ai-dropzone { position: relative; border-style: dashed; background: radial-gradient(90% 120% at 50% 0%, color-mix(in srgb, var(--primary) 7%, transparent), transparent 62%), var(--surface-2); padding: 22px; }
.scan-stage { position: relative; width: 150px; height: 92px; margin: 0 auto 14px; display: grid; place-items: center; }
.scan-doc { position: relative; width: 86px; height: 74px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border-strong); box-shadow: 0 14px 28px -18px rgba(16,24,40,.35); padding: 14px 12px; overflow: hidden; transform: rotate(-3deg); }
.scan-doc span { display: block; height: 5px; border-radius: 3px; background: var(--surface-3); margin-bottom: 7px; }
.scan-doc span:nth-child(1) { width: 70%; background: color-mix(in srgb, var(--primary) 28%, var(--surface-3)); }
.scan-doc span:nth-child(2) { width: 92%; }
.scan-doc span:nth-child(3) { width: 80%; background: color-mix(in srgb, var(--warning) 30%, var(--surface-3)); }
.scan-doc span:nth-child(4) { width: 60%; }
.scan-beam { position: absolute; left: 0; right: 0; height: 2px; top: 0; background: linear-gradient(90deg, transparent, var(--primary), var(--teal), transparent); box-shadow: 0 0 12px color-mix(in srgb, var(--primary) 70%, transparent); animation: scanBeam 2.4s ease-in-out infinite; }
@keyframes scanBeam { 0%, 100% { top: 8%; opacity: .4; } 50% { top: 88%; opacity: 1; } }
.scan-chip { position: absolute; right: 4px; bottom: 4px; display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); color: var(--primary); font-size: 9.5px; font-weight: 700; box-shadow: var(--shadow-xs); }
.scan-chip svg { width: 11px; height: 11px; }
.ai-dropzone .dz-title { font-size: 15px; }
.ai-dropzone .dz-hint { max-width: 520px; margin-left: auto; margin-right: auto; line-height: 1.6; }
.upload-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.upload-hint { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--text-3); }
.upload-hint svg { width: 13px; height: 13px; }

/* 识别流程 */
.pipeline-card { padding: 16px 18px 18px; }
.pipeline-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.pipeline-title { display: flex; align-items: center; gap: 11px; }
.pipeline-title strong { display: block; font-size: 13.5px; }
.pipeline-title small { display: block; font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
.pipeline-orb { width: 34px; height: 34px; border-radius: 11px; background: linear-gradient(135deg, var(--primary), var(--teal)); display: grid; place-items: center; position: relative; flex: 0 0 auto; }
.pipeline-orb::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255,255,255,.9); border-right-color: transparent; animation: spin 1.6s linear infinite; }
.pipeline-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 7px 14px; }
.pipe-step { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 9px; opacity: .55; transition: all var(--transition); }
.pipe-step.active { background: var(--primary-soft); opacity: 1; }
.pipe-step.done { opacity: 1; }
.pipe-dot { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; font-size: 10px; font-weight: 700; color: var(--text-3); flex: 0 0 auto; }
.pipe-step.active .pipe-dot { border-color: var(--primary); color: var(--primary); background: var(--surface); }
.pipe-step.done .pipe-dot { border-color: var(--success); background: var(--success); color: #fff; }
.pipe-dot svg { width: 12px; height: 12px; }
.pipe-copy strong { display: block; font-size: 11.5px; }
.pipe-copy small { display: block; font-size: 10px; color: var(--text-3); margin-top: 1px; }
.pipeline-progress { height: 3px; border-radius: 4px; background: var(--surface-3); margin-top: 14px; overflow: hidden; }
.pipeline-progress i { display: block; height: 100%; width: 0; border-radius: 4px; background: linear-gradient(90deg, var(--primary), var(--teal)); transition: width 420ms ease; }

/* 识别结果 */
.result-card { overflow: hidden; }
.result-head { align-items: flex-start; }
.result-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.result-toolbar { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 9px 18px; background: var(--surface-2); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.result-tip { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--text-3); }
.result-tip svg { width: 13px; height: 13px; color: var(--primary); }
.result-legend { display: inline-flex; align-items: center; gap: 10px; font-size: 10.5px; color: var(--text-3); }
.result-legend span { display: inline-flex; align-items: center; gap: 4px; }
.decl-list { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 11px; max-height: 780px; overflow: auto; }
.decl-card { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); transition: all var(--transition); overflow: hidden; }
.decl-card:hover { border-color: color-mix(in srgb, var(--primary) 30%, var(--border)); box-shadow: var(--shadow-sm); }
.decl-card.selected { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background: color-mix(in srgb, var(--primary) 2.4%, var(--surface)); }
.decl-card.selected::before { content: ""; display: block; height: 2px; background: linear-gradient(90deg, var(--primary), var(--teal)); }
.decl-top { display: flex; align-items: center; gap: 11px; padding: 12px 14px 8px; }
.decl-check { flex: 0 0 auto; }
.decl-title { flex: 1; min-width: 0; }
.decl-no { font-size: 13px; font-weight: 700; font-family: "SFMono-Regular", Consolas, monospace; letter-spacing: -.2px; }
.decl-sub { font-size: 10.5px; color: var(--text-3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.decl-badges { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.conf-ring { position: relative; width: 44px; height: 44px; flex: 0 0 auto; }
.conf-ring svg { width: 44px; height: 44px; transform: rotate(-90deg); }
.conf-ring .ring-bg { fill: none; stroke: var(--surface-3); stroke-width: 4; }
.conf-ring .ring-fg { fill: none; stroke: var(--ring); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 113; stroke-dashoffset: calc(113 - 113 * var(--pct) / 100); transition: stroke-dashoffset 500ms ease; }
.conf-ring span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 9.5px; font-weight: 750; color: var(--ring); }
.decl-metrics { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 7px; padding: 2px 14px 10px 63px; }
.decl-metrics > div { min-width: 0; }
.decl-metrics span { display: block; font-size: 9.5px; color: var(--text-3); }
.decl-metrics strong { display: block; font-size: 11.5px; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.decl-metrics strong small { font-size: 9px; color: var(--text-3); font-weight: 500; }
.decl-metrics strong.blue { color: var(--primary); }
.decl-warn { display: flex; align-items: flex-start; gap: 7px; margin: 0 14px 9px 63px; padding: 7px 9px; border-radius: 8px; background: var(--warning-soft); font-size: 10.5px; color: var(--warning); line-height: 1.55; }
.decl-warn svg { width: 13px; height: 13px; flex: 0 0 auto; margin-top: 1px; }
.decl-actions { display: flex; align-items: center; gap: 8px; padding: 0 14px 10px 63px; }
.decl-formula { margin-left: auto; font-size: 10px; color: var(--text-3); }
.decl-editor { border-top: 1px dashed var(--border); padding: 12px 14px 14px; background: var(--surface-2); }
.decl-form { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.decl-form .field-label { font-size: 10px; }
.decl-form .input-sm { height: 32px; min-height: 32px; font-size: 11.5px; }
.decl-calc-line { display: flex; align-items: center; gap: 18px; margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); font-size: 10.5px; color: var(--text-3); flex-wrap: wrap; }
.decl-calc-line strong { color: var(--text); font-size: 11.5px; margin-left: 4px; font-variant-numeric: tabular-nums; }
.decl-calc-line strong:last-child { color: var(--success); }
.decl-items-mini { margin-top: 10px; border: 1px solid var(--border); border-radius: 9px; overflow: auto; max-height: 240px; background: var(--surface); }
.decl-items-mini table { width: 100%; border-collapse: collapse; font-size: 10.5px; min-width: 620px; }
.decl-items-mini th { text-align: left; padding: 7px 8px; background: var(--surface-2); color: var(--text-3); font-size: 9.5px; font-weight: 650; white-space: nowrap; }
.decl-items-mini td { padding: 6px 8px; border-top: 1px solid var(--border); white-space: nowrap; }
.decl-items-mini td.num, .decl-items-mini th.num { text-align: right; font-variant-numeric: tabular-nums; }
.decl-more { padding: 7px 8px; font-size: 10px; color: var(--text-3); border-top: 1px solid var(--border); }
.ai-dropzone .badge { height: 20px; font-size: 9.5px; }

/* 右侧 AI 卡片 */
.ai-status-card { padding: 18px; text-align: center; position: relative; overflow: hidden; }
.ai-status-card::after { content: ""; position: absolute; inset: -50% -30% auto auto; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--primary) 12%, transparent), transparent 66%); pointer-events: none; }
.ai-orb { width: 58px; height: 58px; border-radius: 19px; margin: 2px auto 12px; background: linear-gradient(135deg, var(--primary), var(--teal)); position: relative; display: grid; place-items: center; box-shadow: 0 16px 32px -18px color-mix(in srgb, var(--primary) 80%, transparent); }
.ai-orb span { width: 23px; height: 23px; border-radius: 50%; border: 2px solid rgba(255,255,255,.9); border-right-color: transparent; animation: spin 2.2s linear infinite; }
.ai-orb i { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #fff; box-shadow: 0 0 12px #fff; }
.ai-status-copy strong { display: block; font-size: 14px; font-weight: 700; }
.ai-status-copy span { display: block; font-size: 10.5px; color: var(--text-3); margin-top: 3px; }
.ai-status-tags { display: flex; justify-content: center; gap: 5px; margin-top: 10px; }
.ai-capabilities { margin-top: 14px; text-align: left; display: flex; flex-direction: column; gap: 7px; }
.ai-capabilities li { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--text-2); padding: 5px 7px; border-radius: 7px; background: var(--surface-2); }
.ai-capabilities .dot { flex: 0 0 auto; }

.report-placeholder { text-align: center; padding: 18px 8px; color: var(--text-3); }
.report-placeholder svg { width: 34px; height: 34px; margin: 0 auto 9px; color: color-mix(in srgb, var(--primary) 55%, var(--text-3)); opacity: .65; }
.report-placeholder p { font-size: 11px; line-height: 1.7; max-width: 260px; margin: 0 auto; }
.report-metric { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 11px; color: var(--text-3); }
.report-metric:last-of-type { border-bottom: 0; }
.report-metric strong { color: var(--text); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.report-divider { height: 1px; background: var(--border); margin: 8px 0; }
.report-engine { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 9px; background: var(--surface-2); }
.report-engine strong { display: block; font-size: 10.5px; }
.report-engine small { display: block; font-size: 9.5px; color: var(--text-3); margin-top: 1px; }
.engine-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); flex: 0 0 auto; }
.tip-list { display: flex; flex-direction: column; gap: 9px; counter-reset: tip; }
.tip-list li { position: relative; padding-left: 22px; font-size: 11px; color: var(--text-2); line-height: 1.65; counter-increment: tip; }
.tip-list li::before { content: counter(tip); position: absolute; left: 0; top: 1px; width: 16px; height: 16px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 9px; font-weight: 700; display: grid; place-items: center; }
.history-card .data-table { font-size: 11.5px; }
.history-card .data-table th, .history-card .data-table td { padding: 9px 14px; }

/* ---------- 详情弹窗 ---------- */
.detail-shell { display: flex; flex-direction: column; min-height: 520px; }
.detail-top { padding: 16px 22px 0; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 3; }
.detail-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.detail-no { font-size: 19px; font-weight: 750; letter-spacing: -.3px; font-family: "SFMono-Regular", Consolas, monospace; }
.detail-sub { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.detail-badges { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.detail-tabs { display: flex; align-items: center; gap: 2px; margin-top: 12px; }
.detail-tab { border: 0; background: transparent; display: inline-flex; align-items: center; gap: 6px; padding: 9px 12px; border-radius: 9px 9px 0 0; font-size: 11.5px; font-weight: 650; color: var(--text-3); position: relative; }
.detail-tab svg { width: 14px; height: 14px; }
.detail-tab:hover { color: var(--text); background: var(--surface-2); }
.detail-tab.active { color: var(--primary); background: var(--primary-soft); }
.detail-tab.active::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--primary); }
.detail-tab em { font-style: normal; font-size: 9.5px; background: var(--surface-3); color: var(--text-3); border-radius: 10px; padding: 1px 5px; }
.detail-tab.warn em { background: var(--warning-soft); color: var(--warning); }
.detail-body { padding: 18px 22px 22px; overflow: auto; max-height: calc(100vh - 300px); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 16px; align-items: start; }
.detail-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.detail-section { border: 1px solid var(--border); border-radius: 13px; overflow: hidden; }
.detail-section-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); }
.detail-section-icon { width: 30px; height: 30px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex: 0 0 auto; }
.detail-section-icon.amber { background: var(--warning-soft); color: var(--warning); }
.detail-section-icon svg { width: 15px; height: 15px; }
.detail-section-head strong { display: block; font-size: 12px; }
.detail-section-head small { display: block; font-size: 9.5px; color: var(--text-3); margin-top: 1px; }
.detail-form { padding: 14px; gap: 11px; }
.detail-form .field-label { font-size: 10.5px; }
.detail-form .input, .detail-form .textarea { font-size: 12px; }
.detail-form .input { min-height: 36px; height: 36px; }
.detail-form .textarea { min-height: 56px; }
.detail-aside { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 18px; }
.calc-card { border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border)); border-radius: 14px; background: linear-gradient(180deg, color-mix(in srgb, var(--primary) 4%, var(--surface)), var(--surface)); padding: 14px; }
.calc-head { display: flex; align-items: center; gap: 9px; }
.calc-icon { width: 32px; height: 32px; border-radius: 9px; background: var(--primary); color: #fff; display: grid; place-items: center; }
.calc-icon svg { width: 16px; height: 16px; }
.calc-head strong { display: block; font-size: 12.5px; }
.calc-head small { display: block; font-size: 9.5px; color: var(--text-3); margin-top: 1px; }
.calc-formula { margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: var(--surface); border: 1px dashed var(--border-strong); font-family: "SFMono-Regular", Consolas, monospace; font-size: 10.5px; color: var(--text-2); line-height: 1.5; }
.calc-list { margin-top: 8px; display: flex; flex-direction: column; }
.calc-list > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 10.5px; color: var(--text-3); }
.calc-list > div:last-child { border-bottom: 0; }
.calc-list strong { font-size: 12px; color: var(--text); font-variant-numeric: tabular-nums; }
.calc-list strong.green { color: var(--success); }
.calc-note { margin-top: 6px; font-size: 9.5px; color: var(--text-3); line-height: 1.55; }
.detail-meta-card { border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px; display: flex; flex-direction: column; gap: 7px; }
.detail-meta-card > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 10.5px; color: var(--text-3); }
.detail-meta-card strong { color: var(--text-2); font-size: 10.5px; }
.detail-items-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
.detail-items { font-size: 11px; min-width: 900px; }
.detail-items th { font-size: 10px; padding: 9px 10px; }
.detail-items td { padding: 8px 10px; }
.detail-items .spec-cell { max-width: 300px; white-space: normal; color: var(--text-3); font-size: 10px; line-height: 1.45; }
.detail-items .strong { font-weight: 700; }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.report-card { border: 1px solid var(--border); border-radius: 13px; padding: 14px; }
.report-head { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.report-head svg { width: 18px; height: 18px; color: var(--primary); }
.report-head strong { display: block; font-size: 12.5px; }
.report-head small { display: block; font-size: 9.5px; color: var(--text-3); margin-top: 1px; }
.conf-list { display: flex; flex-direction: column; gap: 7px; }
.conf-row { display: grid; grid-template-columns: 82px 1fr 34px; align-items: center; gap: 8px; font-size: 10px; color: var(--text-2); }
.conf-track { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.conf-track i { display: block; height: 100%; border-radius: 6px; }
.conf-track i.green { background: var(--success); }
.conf-track i.amber { background: var(--warning); }
.conf-track i.red { background: var(--danger); }
.conf-row strong { text-align: right; font-size: 10px; font-variant-numeric: tabular-nums; }
.report-foot { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); font-size: 9.5px; color: var(--text-3); }
.report-foot strong { color: var(--text-2); }
.warn-list { display: flex; flex-direction: column; gap: 7px; }
.warn-list li { position: relative; padding: 7px 9px 7px 25px; border-radius: 8px; background: var(--warning-soft); color: var(--text-2); font-size: 10.5px; line-height: 1.6; }
.warn-list li::before { content: "!"; position: absolute; left: 8px; top: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--warning); color: #fff; font-size: 8px; font-weight: 800; display: grid; place-items: center; }
.report-ok { display: flex; align-items: center; gap: 8px; padding: 12px; border-radius: 9px; background: var(--success-soft); color: var(--success); font-size: 11px; }
.report-ok svg { width: 16px; height: 16px; }
.report-source { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--border); display: flex; flex-direction: column; gap: 5px; font-size: 9.5px; color: var(--text-3); }
.report-source .btn { align-self: flex-start; margin-top: 4px; }
.detail-foot-left { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.detail-foot-meta { font-size: 10.5px; color: var(--text-3); font-family: "SFMono-Regular", Consolas, monospace; }

/* PDF 预览 */
.pdf-modal-body { background: #3a4252; min-height: 300px; max-height: calc(100vh - 180px); overflow: auto; padding: 16px; }
.pdf-loading { display: flex; align-items: center; justify-content: center; gap: 10px; height: 260px; color: #dbe4f5; font-size: 12px; }
.pdf-pages { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.pdf-page { position: relative; background: #fff; box-shadow: 0 12px 30px rgba(0,0,0,.25); border-radius: 3px; overflow: hidden; }
.pdf-page canvas { display: block; max-width: 100%; height: auto; }
.pdf-page-no { position: absolute; right: 8px; bottom: 8px; font-size: 9px; color: #fff; background: rgba(13,27,51,.62); padding: 2px 6px; border-radius: 4px; }
.pdf-docx-tip { display: flex; align-items: flex-start; gap: 12px; padding: 24px; color: #dbe4f5; max-width: 560px; margin: 40px auto; background: rgba(255,255,255,.06); border-radius: 12px; }
.pdf-docx-tip svg { width: 22px; height: 22px; flex: 0 0 auto; margin-top: 2px; }
.pdf-docx-tip strong { display: block; font-size: 13px; color: #fff; }
.pdf-docx-tip p { margin: 6px 0 0; font-size: 11.5px; line-height: 1.7; color: #b9c6dd; }

/* ---------- 设置 ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.settings-engine { grid-column: span 2; }
.formula-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.formula-card { border: 1px solid var(--border); border-radius: 11px; padding: 12px; background: var(--surface-2); }
.formula-card-top { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.formula-card-top strong { font-size: 11.5px; }
.formula-card code { display: block; font-size: 10.5px; color: var(--primary); background: var(--surface); border: 1px dashed var(--border-strong); border-radius: 6px; padding: 6px 8px; font-family: "SFMono-Regular", Consolas, monospace; }
.formula-card p { margin: 7px 0 0; font-size: 10px; color: var(--text-3); line-height: 1.55; }
.engine-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.engine-facts > div { padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.engine-facts span { display: block; font-size: 10px; color: var(--text-3); }
.engine-facts strong { display: block; font-size: 11.5px; margin-top: 3px; }

/* 状态分布 */
.status-bars { display: flex; flex-direction: column; gap: 9px; }
.status-bar-row { display: grid; grid-template-columns: 78px 1fr 30px 34px; align-items: center; gap: 7px; font-size: 10.5px; color: var(--text-2); }
.status-bar-label { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.status-bar-label i { width: 7px; height: 7px; border-radius: 3px; }
.status-bar-track { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.status-bar-track i { display: block; height: 100%; border-radius: 6px; transition: width 500ms ease; }
.status-bar-row strong { text-align: right; font-size: 11px; font-variant-numeric: tabular-nums; }
.status-bar-row small { color: var(--text-3); text-align: right; font-size: 9.5px; }

/* 运抵国 */
.dest-row { display: grid; grid-template-columns: 20px 76px 1fr 48px; align-items: center; gap: 7px; padding: 6px 0; }
.dest-rank { width: 18px; height: 18px; border-radius: 6px; background: var(--surface-3); color: var(--text-3); font-size: 9.5px; font-weight: 700; display: grid; place-items: center; }
.dest-name { font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dest-track { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.dest-track i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--primary), var(--teal)); }
.dest-row strong { text-align: right; font-size: 10.5px; font-variant-numeric: tabular-nums; }

/* 复选框在表格中的尺寸 */
.xl-ledger .ccheck-box { width: 16px; height: 16px; border-radius: 5px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1380px) {
    .import-grid { grid-template-columns: minmax(0, 1fr) 300px; }
    .decl-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .decl-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
    .ledger-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .import-grid { grid-template-columns: 1fr; }
    .import-aside { display: grid; grid-template-columns: 1fr 1fr; }
    .import-aside .tip-card { grid-column: span 2; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-aside { position: static; flex-direction: row; flex-wrap: wrap; }
    .calc-card { flex: 1 1 320px; }
    .detail-meta-card { flex: 1 1 220px; }
    .settings-grid { grid-template-columns: 1fr; }
    .settings-engine { grid-column: auto; }
    .engine-facts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
    .ai-banner { flex-wrap: wrap; }
    .ai-banner-copy { flex-basis: calc(100% - 60px); }
    .ai-banner .btn { margin-left: 60px; }
    .report-grid { grid-template-columns: 1fr; }
    .decl-metrics { padding-left: 14px; }
    .decl-actions { padding-left: 14px; }
    .decl-warn { margin-left: 14px; }
    .decl-form { grid-template-columns: 1fr 1fr; }
    .pipe-step { padding: 6px; }
    .import-aside { grid-template-columns: 1fr; }
    .import-aside .tip-card { grid-column: auto; }
}
@media (max-width: 640px) {
    .ledger-kpis { grid-template-columns: 1fr 1fr; gap: 9px; }
    .ledger-kpi > strong { font-size: 18px; }
    .ledger-toolbar .search-box { flex-basis: 100%; }
    .ledger-date { width: calc(50% - 20px); }
    .ledger-legend { display: none; }
    .result-head-actions { width: 100%; }
    .result-head-actions .btn { flex: 1; }
    .decl-top { flex-wrap: wrap; }
    .decl-badges { width: 100%; justify-content: flex-start; padding-left: 29px; }
    .conf-ring { margin-left: auto; }
    .decl-metrics { grid-template-columns: 1fr 1fr; }
    .decl-form { grid-template-columns: 1fr; }
    .decl-calc-line { gap: 9px; }
    .pipe-steps { grid-template-columns: 1fr; }
    .engine-pill { display: none; }
    .detail-top, .detail-body { padding-left: 14px; padding-right: 14px; }
    .detail-foot { flex-wrap: wrap; }
    .detail-foot-left { width: 100%; }
    .formula-cards { grid-template-columns: 1fr; }
    .engine-facts { grid-template-columns: 1fr; }
    .detail-aside { flex-direction: column; }
}

/* ---------- Excel 台账导入 ---------- */
.import-tabs { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.import-tabs .seg-btn { display: inline-flex; align-items: center; gap: 6px; }
.import-tabs .seg-btn svg { width: 14px; height: 14px; }
.import-tabs-hint { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-3); }
.import-tabs-hint svg { width: 12px; height: 12px; }

.excel-dropzone { padding: 26px 22px; }
.excel-drop-icon { width: 52px; height: 52px; border-radius: 16px; margin: 0 auto 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--success-soft), var(--primary-soft)); color: var(--success); }
.excel-drop-icon svg { width: 26px; height: 26px; }
.excel-orb { background: linear-gradient(135deg, var(--success), var(--teal)); }
.excel-column-hints { display: flex; flex-wrap: wrap; gap: 5px; }
.excel-column-hints .badge { height: 20px; font-size: 10px; font-weight: 600; }
.excel-map { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.map-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 7px; background: var(--surface); border: 1px solid var(--border); font-size: 10px; color: var(--text-2); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-chip i { font-style: normal; color: var(--text-3); }
.excel-alert { display: flex; gap: 8px; margin: 12px 16px 0; padding: 10px 12px; border-radius: 10px; background: var(--warning-soft); color: var(--warning); font-size: 11px; line-height: 1.6; }
.excel-alert.muted { background: var(--surface-2); color: var(--text-3); }
.excel-alert svg { width: 14px; height: 14px; flex: 0 0 auto; margin-top: 2px; }
.excel-alert strong { display: block; margin-bottom: 2px; }
.excel-alert ul { margin: 0; padding-left: 16px; }
.excel-table-wrap { max-height: 560px; overflow: auto; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.excel-table { font-size: 11.5px; }
.excel-table th, .excel-table td { padding: 8px 10px; white-space: nowrap; }
.excel-table .col-check { width: 36px; }
.excel-table .mono { font-family: "SFMono-Regular", Consolas, monospace; font-size: 10.5px; }
.excel-table .strong { font-weight: 700; }
.excel-table .green { color: var(--success); }
.excel-table .muted { color: var(--text-3); font-size: 10px; }
.excel-more { padding: 9px 12px; font-size: 10.5px; color: var(--text-3); background: var(--surface-2); }
.excel-foot { display: flex; align-items: center; gap: 6px; padding: 10px 16px; font-size: 10.5px; color: var(--text-3); }
.excel-foot svg { width: 12px; height: 12px; }
@media (max-width: 640px) {
    .import-tabs { align-items: flex-start; }
    .import-tabs-hint { display: none; }
    .excel-map { max-height: 120px; overflow: auto; }
}
