.tool-card-mark.tax-talk,
.workspace-mark.tax-talk {
    color: #1e3a8a;
    background: #dbeafe;
}

.tft-shell {
    --tft-ink: #172033;
    --tft-muted: #64748b;
    --tft-primary: #1d4ed8;
    --tft-primary-soft: #eff6ff;
    --tft-success: #15705b;
    --tft-success-soft: #eefbf6;
    --tft-line: #dfe6ef;
    color: var(--tft-ink);
}

.tft-shell .btn-primary,
.tft-shell .btn-secondary,
.tft-shell .btn-text {
    min-height: 36px;
    border-radius: 8px;
    font-weight: 650;
}

.tft-shell .btn-primary {
    background: var(--tft-primary);
    box-shadow: 0 5px 12px rgba(29, 78, 216, .16);
}

.tft-shell .btn-primary:hover { background: #1e40af; }
.tft-shell .btn-primary:disabled { opacity: .48; box-shadow: none; cursor: not-allowed; }
.tft-shell .btn-secondary { border: 1px solid #cbd5e1; background: #fff; }
.tft-shell .btn-secondary:hover { border-color: #93b4e7; color: #1d4ed8; background: #f8fbff; }
.tft-shell .btn-text { border: 0; color: #52657e; background: transparent; cursor: pointer; }
.tft-shell .btn-text:hover { color: #1d4ed8; background: #f1f5f9; }

.tft-workbench {
    display: grid;
    grid-template-columns: minmax(330px, 390px) minmax(0, 1fr);
    align-items: start;
    gap: 16px;
}

.tft-input-column {
    position: sticky;
    top: 82px;
    display: grid;
    gap: 10px;
}

.tft-upload-panel,
.tft-empty-state,
.tft-result {
    border: 1px solid var(--tft-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .055);
}

.tft-upload-panel { padding: 18px; }

.tft-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.tft-section-head > div { display: grid; gap: 3px; }
.tft-step-label {
    color: #46617f;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .08em;
}
.tft-section-head strong { color: #152238; font-size: 18px; }
.tft-section-head small { color: var(--tft-muted); font-size: 12px; line-height: 1.5; }
.tft-file-count {
    flex: 0 0 auto;
    padding: 5px 9px;
    border-radius: 999px;
    color: #4b607a;
    background: #f1f5f9;
    font-size: 11px;
    font-weight: 700;
}
.tft-file-count.ready { color: #116149; background: #dcfce7; }

.tft-upload-grid { display: grid; gap: 9px; }

.tft-upload-card {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 72px;
    padding: 11px 12px;
    border: 1px solid #d8e1ec;
    border-radius: 10px;
    background: #fbfcfe;
    cursor: pointer;
    transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.tft-upload-card:hover,
.tft-upload-card:focus-visible {
    border-color: #8eb0df;
    outline: none;
    background: #f8fbff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .08);
}

.tft-upload-card.ready { border-color: #abd7c5; background: #f4fbf8; }
.tft-upload-mark {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 9px;
    color: #35516e;
    background: #e8eef5;
    font-size: 12px;
    font-weight: 800;
}
.tft-upload-card.ready .tft-upload-mark { color: #fff; background: var(--tft-success); }
.tft-upload-copy { display: grid; min-width: 0; gap: 2px; }
.tft-upload-copy strong { color: #1f2d42; font-size: 13px; }
.tft-upload-copy small { color: #748297; font-size: 11px; line-height: 1.4; }
.tft-file-feedback {
    display: block;
    min-width: 0;
    overflow: hidden;
    color: #8a97a8;
    font-size: 11px;
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tft-upload-card.ready .tft-file-feedback { color: #1b6b54; }
.tft-upload-card .btn-secondary {
    min-height: 31px;
    padding: 6px 9px;
    color: #4d6077;
    font-size: 11px;
    white-space: nowrap;
}

.tft-submit-block {
    display: grid;
    gap: 8px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #e8edf3;
}
.tft-submit-block .btn-primary { width: 100%; min-height: 42px; }
.tft-submit-block > span { color: #718096; font-size: 11px; line-height: 1.5; text-align: center; }

.tft-service {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #64748b;
    font-size: 11px;
}
.tft-service::before {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #94a3b8;
    content: "";
}
.tft-service.ready { color: #17634e; }
.tft-service.ready::before { background: #22a06b; box-shadow: 0 0 0 3px #dcfce7; }
.tft-service.error { color: #9f2f2f; }
.tft-service.error::before { background: #dc2626; box-shadow: 0 0 0 3px #fee2e2; }

.tft-guidance {
    margin-top: 13px;
    padding-top: 12px;
    border-top: 1px solid #edf1f5;
}
.tft-guidance summary,
.tft-audit summary {
    color: #52657e;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
}
.tft-guidance summary:hover,
.tft-audit summary:hover { color: #1d4ed8; }
.tft-rule { display: grid; gap: 10px; margin-top: 12px; }
.tft-rule > div { display: grid; gap: 3px; padding-left: 10px; border-left: 2px solid #cbd8e8; }
.tft-rule b { color: #344963; font-size: 11px; }
.tft-rule span { color: #6f7f93; font-size: 11px; line-height: 1.55; }
.tft-privacy-note { margin: 11px 0 0; color: #718096; font-size: 11px; line-height: 1.6; }

.tft-status {
    padding: 11px 13px;
    border: 1px solid #c9d8ea;
    border-radius: 10px;
    color: #3f5c7c;
    background: #f4f8fc;
    font-size: 12px;
    line-height: 1.55;
}
.tft-status.error { color: #991b1b; border-color: #fecaca; background: #fff4f4; }
.tft-status.success { color: #116149; border-color: #bbdfd1; background: #effaf5; }
.tft-status ul { margin: 6px 0 0; padding-left: 18px; }

.tft-output-column { min-width: 0; }
.tft-empty-state {
    display: grid;
    align-content: center;
    justify-items: center;
    min-height: 560px;
    padding: 40px;
    color: #66768b;
    text-align: center;
    background: linear-gradient(180deg, #fff 0%, #fafcff 100%);
}
.tft-empty-state::before {
    display: grid;
    width: 54px;
    height: 54px;
    margin-bottom: 16px;
    place-items: center;
    border-radius: 16px;
    color: #2d5f9e;
    background: #eaf2fc;
    content: "核";
    font-size: 21px;
    font-weight: 800;
}
.tft-empty-state h3 { margin: 6px 0 7px; color: #213149; font-size: 19px; }
.tft-empty-state p { max-width: 470px; margin: 0; font-size: 13px; line-height: 1.7; }
.tft-empty-checks { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 18px; }
.tft-empty-checks span { padding: 6px 9px; border-radius: 7px; color: #53677f; background: #f1f5f9; font-size: 11px; }

.tft-result { overflow: hidden; }
.tft-result-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 20px;
    border-bottom: 1px solid #e7edf4;
    background: #fbfdff;
}
.tft-result-title { min-width: 0; }
.tft-result-state {
    display: inline-flex;
    margin-bottom: 7px;
    padding: 4px 8px;
    border-radius: 999px;
    color: #116149;
    background: #dcfce7;
    font-size: 11px;
    font-weight: 750;
}
.tft-result-state.warning { color: #92400e; background: #fef3c7; }
.tft-result-title h3 { margin: 0; color: #17233a; font-size: 18px; }
.tft-result-title p { margin: 5px 0 0; color: #64748b; font-size: 12px; }
.tft-total { flex: 0 0 auto; text-align: right; }
.tft-total span { display: block; color: #607087; font-size: 11px; }
.tft-total strong { display: block; margin-top: 3px; color: #173f78; font-size: 25px; font-variant-numeric: tabular-nums; }
.tft-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.tft-tags span { padding: 4px 7px; border-radius: 6px; color: #53667d; background: #eef2f7; font-size: 10px; }

.tft-warning { margin: 14px 16px 0; padding: 11px 13px; border-left: 3px solid #d89b2b; border-radius: 8px; color: #7c5717; background: #fffaed; }
.tft-warning strong { display: block; margin-bottom: 4px; font-size: 12px; }
.tft-warning ul { margin: 0; padding-left: 17px; font-size: 11px; line-height: 1.55; }

.tft-ocr-review {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 12px 16px 0;
    padding: 11px 13px;
    border: 1px solid #f3d59a;
    border-radius: 9px;
    color: #71501a;
    background: #fffaf0;
}
.tft-ocr-review > div { display: grid; gap: 3px; }
.tft-ocr-review strong { font-size: 12px; }
.tft-ocr-review > div span { color: #8a6a32; font-size: 10px; }
.tft-ocr-review label {
    display: inline-flex;
    align-items: flex-start;
    gap: 7px;
    max-width: 430px;
    color: #654716;
    font-size: 11px;
    font-weight: 650;
    line-height: 1.45;
    cursor: pointer;
}
.tft-ocr-review input { flex: 0 0 auto; margin-top: 2px; accent-color: #1d4ed8; }

.tft-result-grid {
    display: grid;
    grid-template-columns: minmax(0, .98fr) minmax(0, 1.02fr);
    gap: 12px;
    padding: 14px;
}
.tft-finance-panel,
.tft-message-panel {
    min-width: 0;
    border: 1px solid #e0e7ef;
    border-radius: 11px;
    background: #fff;
    overflow: hidden;
}
.tft-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 48px;
    padding: 11px 13px;
    border-bottom: 1px solid #e7edf4;
    background: #f8fafc;
}
.tft-panel-head h4 { margin: 0; color: #26374f; font-size: 13px; }
.tft-panel-head > span,
.tft-message-head > div > span { color: #15705b; font-size: 10px; font-weight: 650; }
.tft-message-head > div { display: grid; gap: 3px; }
.tft-message-head .btn-primary { flex: 0 0 auto; min-height: 32px; padding: 6px 10px; font-size: 11px; }

.tft-table-wrap { overflow-x: auto; }
.tft-table { width: 100%; border-collapse: collapse; }
.tft-table th { padding: 9px 11px; color: #52657e; background: #edf3f8; font-size: 10px; text-align: left; white-space: nowrap; }
.tft-table th:nth-child(2) { text-align: right; }
.tft-table td { padding: 9px 11px; border-top: 1px solid #edf1f5; color: #33445a; font-size: 11px; line-height: 1.4; }
.tft-table td.money { color: #172b4d; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tft-tax-label { display: block; }
.tft-tax-note { display: block; margin-top: 2px; color: #7a8798; font-size: 9px; }

.tft-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid #e7edf4; }
.tft-kpis > div { min-width: 0; padding: 10px 12px; border-right: 1px solid #edf1f5; border-bottom: 1px solid #edf1f5; background: #fbfcfd; }
.tft-kpis > div:nth-child(2n) { border-right: 0; }
.tft-kpis > div:nth-last-child(-n + 2) { border-bottom: 0; }
.tft-kpis span { display: block; margin-bottom: 3px; color: #758397; font-size: 9px; }
.tft-kpis strong { display: block; overflow: hidden; color: #2c3d55; font-size: 13px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }

.tft-message-panel { display: flex; flex-direction: column; }
.tft-message {
    flex: 1;
    min-height: 286px;
    max-height: 390px;
    margin: 0;
    padding: 14px;
    overflow: auto;
    color: #334155;
    background: #fff;
    font: 12px/1.72 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.tft-message-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid #e7edf4;
    background: #fbfcfd;
}
.tft-message-actions button { min-height: 31px; padding: 6px 9px; font-size: 11px; }

.tft-audit { margin: 0 14px 14px; border: 1px solid #e4eaf1; border-radius: 10px; background: #fbfcfe; }
.tft-audit summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 13px;
    list-style-position: inside;
}
.tft-audit summary em { color: #738197; font-size: 10px; font-style: normal; font-weight: 500; }
.tft-review-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 10px; padding: 0 12px 12px; }
.tft-panel { min-width: 0; padding: 12px; border: 1px solid #e5eaf0; border-radius: 8px; background: #fff; }
.tft-panel h4 { margin: 0 0 9px; color: #33455c; font-size: 12px; }
.tft-check-list,
.tft-source-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.tft-check-list li { display: grid; grid-template-columns: auto 1fr; gap: 7px; color: #526278; font-size: 11px; line-height: 1.5; }
.tft-check-state { color: #15705b; font-weight: 750; }
.tft-check-state.warning { color: #b45309; }
.tft-source-list li { display: grid; gap: 2px; color: #738197; font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.tft-source-list b { color: #3c4d63; }
.tft-source-ocr { color: #9a6700; font-weight: 650; }

@media (max-width: 1120px) {
    .tft-workbench { grid-template-columns: 1fr; }
    .tft-input-column { position: static; }
    .tft-upload-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .tft-upload-card { grid-template-columns: 32px minmax(0, 1fr); }
    .tft-upload-card .btn-secondary { grid-column: 1 / -1; width: 100%; }
    .tft-empty-state { min-height: 300px; }
}

@media (max-width: 820px) {
    .tft-upload-grid,
    .tft-result-grid,
    .tft-review-grid { grid-template-columns: 1fr; }
    .tft-upload-card { grid-template-columns: 34px minmax(0, 1fr) auto; }
    .tft-upload-card .btn-secondary { grid-column: auto; width: auto; }
}

@media (max-width: 680px) {
    .tft-upload-panel { padding: 15px; }
    .tft-section-head,
    .tft-result-head { align-items: flex-start; flex-direction: column; }
    .tft-file-count { align-self: flex-start; }
    .tft-upload-card { grid-template-columns: 32px minmax(0, 1fr); }
    .tft-upload-card .btn-secondary { grid-column: 1 / -1; width: 100%; }
    .tft-empty-state { min-height: 260px; padding: 28px 18px; }
    .tft-total { text-align: left; }
    .tft-result-grid { padding: 10px; }
    .tft-message-head { align-items: stretch; flex-direction: column; }
    .tft-message-head .btn-primary { width: 100%; }
    .tft-message-actions { align-items: stretch; flex-direction: column; }
    .tft-message-actions button { width: 100%; }
    .tft-kpis { grid-template-columns: 1fr; }
    .tft-kpis > div { border-right: 0; border-bottom: 1px solid #edf1f5; }
    .tft-kpis > div:nth-last-child(-n + 2) { border-bottom: 1px solid #edf1f5; }
    .tft-kpis > div:last-child { border-bottom: 0; }
    .tft-audit summary { align-items: flex-start; flex-direction: column; }
    .tft-ocr-review { align-items: flex-start; flex-direction: column; }
}
