/*
 * 企业版界面主题
 * 统一为扁平、克制、数据优先的企业级视觉：减少装饰、渐变、营销文案与无效小字。
 * 该文件最后加载，仅做样式覆盖，不改动业务结构。
 */

:root {
    --bg: #f4f5f7;
    --bg-grid: transparent;
    --surface: #ffffff;
    --surface-2: #f9fafb;
    --surface-3: #f1f3f5;
    --border: #e4e7ec;
    --border-strong: #d0d5dd;
    --text: #101828;
    --text-2: #475467;
    --text-3: #667085;
    --primary: #1d4ed8;
    --primary-600: #1e40af;
    --primary-700: #1e3a8a;
    --primary-soft: #eef4ff;
    --primary-soft-2: #dbe7fe;
    --teal: #0e7490;
    --teal-soft: #ecfeff;
    --success: #047857;
    --success-soft: #ecfdf3;
    --warning: #b54708;
    --warning-soft: #fffaeb;
    --danger: #b42318;
    --danger-soft: #fef3f2;
    --info: #175cd3;
    --info-soft: #eff8ff;
    --nav: #0f172a;
    --nav-2: #0f172a;
    --nav-text: #cbd5e1;
    --nav-muted: #64748b;
    --nav-active: #ffffff;
    --shadow-xs: 0 1px 2px rgba(16, 24, 40, .04);
    --shadow-sm: 0 1px 3px rgba(16, 24, 40, .06);
    --shadow-md: 0 8px 24px rgba(16, 24, 40, .08);
    --shadow-lg: 0 16px 40px rgba(16, 24, 40, .12);
    --radius-sm: 4px;
    --radius: 6px;
    --radius-lg: 8px;
    --radius-xl: 10px;
    --sidebar-w: 232px;
    --topbar-h: 56px;
}

[data-theme="dark"] {
    --bg: #0b1220;
    --surface: #101827;
    --surface-2: #131d2e;
    --surface-3: #1a2638;
    --border: #223047;
    --border-strong: #2d3d58;
    --text: #e6edf7;
    --text-2: #aab6c9;
    --text-3: #7f8da3;
    --primary: #5b8cff;
    --primary-600: #4a7cf5;
    --primary-700: #3c6be0;
    --primary-soft: #152747;
    --primary-soft-2: #1c3460;
    --teal: #38bdf8;
    --teal-soft: #0d2b38;
    --success: #34d399;
    --success-soft: #0d2a22;
    --warning: #fbbf24;
    --warning-soft: #2d2410;
    --danger: #f87171;
    --danger-soft: #321a1a;
    --info: #60a5fa;
    --info-soft: #12233a;
    --nav: #080e1a;
    --nav-2: #080e1a;
}

body {
    background-image: none;
    font-size: 13.5px;
}

/* ---------- 应用框架 ---------- */
.sidebar {
    background: var(--nav);
    padding: 18px 12px 14px;
}

.sidebar::before,
.sidebar::after {
    display: none;
}

.sidebar-brand {
    padding: 0 8px 18px;
    gap: 10px;
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    box-shadow: none;
}

.brand-mark img {
    border-radius: 8px;
}

.brand-name {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0;
}

.brand-sub {
    font-size: 11px;
    letter-spacing: 0;
    color: var(--nav-muted);
    margin-top: 1px;
    text-transform: none;
}

.side-nav {
    gap: 2px;
}

.nav-group-label {
    font-size: 11px;
    letter-spacing: 0;
    text-transform: none;
    color: var(--nav-muted);
    padding: 14px 10px 6px;
}

.nav-item {
    padding: 9px 10px;
    border-radius: 6px;
    font-size: 13px;
    gap: 10px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, .06);
}

.nav-item.active {
    background: rgba(255, 255, 255, .09);
    box-shadow: none;
    color: #fff;
}

.nav-item.active::before {
    left: -12px;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: #60a5fa;
    box-shadow: none;
}

.nav-icon {
    width: 17px;
    height: 17px;
    opacity: .8;
}

.nav-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, .1);
    color: #e2e8f0;
}

.user-card {
    background: transparent;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, .08);
    border-radius: 0;
    padding: 12px 6px 0;
}

.user-card:hover {
    background: transparent;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #475569;
    font-size: 12px;
    font-weight: 600;
}

.user-name {
    font-size: 12.5px;
    font-weight: 500;
}

.user-role {
    font-size: 11px;
}

.topbar {
    height: var(--topbar-h);
    padding: 0 20px;
    background: var(--surface);
    backdrop-filter: none;
}

.crumb {
    font-size: 12px;
}

.view-root {
    padding: 20px;
    max-width: 1600px;
}

/* ---------- 页头 ---------- */
.page-head {
    align-items: center;
    margin-bottom: 16px;
}

.page-title {
    font-size: 22px;
    font-weight: 650;
    letter-spacing: -.2px;
    margin-top: 0;
}

.page-kicker,
.page-desc,
.card-sub,
.field-hint,
.upload-hint,
.result-tip,
.decl-formula,
.ledger-tip,
.ledger-legend,
.import-tabs-hint {
    display: none !important;
}

/* ---------- 按钮 / 表单 ---------- */
.btn {
    height: 34px;
    padding: 0 13px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: none !important;
}

.btn-primary {
    background: var(--primary);
    border: 1px solid var(--primary);
}

.btn-primary:hover {
    background: var(--primary-600);
    border-color: var(--primary-600);
}

.btn-outline {
    background: var(--surface);
}

.btn-lg {
    height: 38px;
    padding: 0 16px;
    font-size: 13px;
    border-radius: 6px;
}

.btn-sm {
    height: 28px;
    padding: 0 9px;
    font-size: 12px;
}

.btn-ghost {
    color: var(--text-2);
}

.icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 6px;
}

.input,
.textarea,
.select-native {
    height: 36px;
    border-radius: 6px;
}

.input-sm {
    height: 32px;
    min-height: 32px;
    border-radius: 6px;
}

.field-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
}

/* ---------- 卡片 / 表格 / 徽标 ---------- */
.card {
    border-radius: 8px;
    box-shadow: none;
}

.card-head {
    padding: 14px 16px;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
}

.card-meta {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 3px;
}

.card-body {
    padding: 16px;
}

.badge {
    height: 20px;
    padding: 0 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.data-table {
    font-size: 12.5px;
}

.data-table th {
    padding: 9px 12px;
    font-size: 11.5px;
    font-weight: 600;
    background: var(--surface-2);
}

.data-table td {
    padding: 10px 12px;
}

.tabs,
.segmented {
    border-radius: 6px;
    padding: 3px;
}

.tab,
.seg-btn {
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12.5px;
}

/* ---------- 工作台 ---------- */
.ai-banner {
    display: none !important;
}

.kpi-grid {
    gap: 12px;
}

.kpi-card {
    border-radius: 8px;
    padding: 16px;
    box-shadow: none;
}

.kpi-card::after {
    display: none;
}

.kpi-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-3);
}

.kpi-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--text-3);
}

.kpi-icon svg {
    width: 15px;
    height: 15px;
}

.kpi-value {
    font-size: 24px;
    font-weight: 650;
    letter-spacing: -.5px;
    margin-top: 10px;
}

.kpi-value.small {
    font-size: 20px;
}

.kpi-foot {
    font-size: 11.5px;
    margin-top: 5px;
}

.dash-grid {
    gap: 14px;
    margin-top: 14px;
}

.dash-col {
    gap: 14px;
}

.dash-date {
    height: 34px;
    padding: 0 11px;
    border-radius: 6px;
    font-size: 12px;
    box-shadow: none;
}

.chart-legend span {
    font-size: 11.5px;
}

.recent-item {
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    padding: 10px 0;
}

.recent-doc-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.recent-title {
    font-size: 12.5px;
}

.recent-sub {
    font-size: 11px;
}

.recent-amount strong {
    font-size: 12px;
}

.recent-amount span {
    font-size: 10.5px;
}

.batch-icon {
    border-radius: 6px;
}

/* ---------- 数据导入 ---------- */
.import-tabs {
    margin-bottom: 12px;
}

.import-tabs .seg-btn svg {
    width: 14px;
    height: 14px;
}

.import-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    max-width: 1200px;
}

.import-aside {
    display: none !important;
}

.import-main {
    gap: 14px;
}

.upload-card .card-body {
    padding: 16px;
}

.ai-dropzone,
.excel-dropzone {
    padding: 24px;
    border-radius: 8px;
    background: var(--surface-2);
}

.scan-stage,
.scan-chip,
.ai-orb,
.pipeline-orb {
    display: none !important;
}

.dz-title {
    font-size: 14px;
    font-weight: 600;
}

.dz-hint {
    font-size: 12px;
    margin-top: 4px;
}

.dz-formats {
    margin-top: 10px;
}

.pipeline-card {
    padding: 14px 16px;
    border-radius: 8px;
}

.pipeline-head {
    margin-bottom: 10px;
}

.pipeline-steps {
    display: none !important;
}

.pipeline-progress {
    height: 4px;
    margin-top: 0;
}

.pipeline-progress i {
    background: var(--primary);
}

.result-card .card-head {
    padding: 14px 16px;
}

.result-head-actions .btn {
    height: 32px;
}

.decl-list {
    padding: 12px 14px 16px;
    max-height: none;
    gap: 10px;
}

.decl-card {
    border-radius: 8px;
}

.decl-card.selected::before {
    height: 2px;
    background: var(--primary);
}

.decl-top {
    padding: 12px 14px 8px;
}

.decl-no {
    font-size: 12.5px;
}

.decl-sub {
    font-size: 11px;
}

.decl-badges .badge {
    height: 19px;
}

.conf-ring {
    display: none !important;
}

.decl-metrics {
    padding: 2px 14px 10px 58px;
    gap: 8px;
}

.decl-metrics span {
    font-size: 11px;
}

.decl-metrics strong {
    font-size: 12px;
}

.decl-warn {
    margin: 0 14px 10px 58px;
    padding: 7px 9px;
    border-radius: 6px;
}

.decl-actions {
    padding: 0 14px 12px 58px;
}

.decl-editor {
    padding: 12px 14px 14px;
}

.decl-form {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.decl-items-mini {
    border-radius: 6px;
}

.excel-map {
    display: none !important;
}

.excel-alert {
    margin: 12px 16px 0;
    border-radius: 6px;
}

.excel-table-wrap {
    max-height: 520px;
}

.excel-table {
    font-size: 12px;
}

.excel-table th,
.excel-table td {
    padding: 8px 10px;
}

.excel-table .mono {
    font-size: 11.5px;
}

.excel-foot {
    font-size: 11px;
}

.history-card .data-table {
    font-size: 12px;
}

.history-card .data-table th,
.history-card .data-table td {
    padding: 9px 12px;
}

/* ---------- 退税台账 ---------- */
.ledger-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.ledger-kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 14px;
}

.ledger-kpi > span {
    font-size: 12px;
    color: var(--text-3);
}

.ledger-kpi > strong {
    display: block;
    font-size: 20px;
    font-weight: 650;
    letter-spacing: -.3px;
    margin-top: 3px;
}

.ledger-kpi > small {
    display: none;
}

.ledger-kpi strong small {
    display: inline;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-3);
}

.ledger-toolbar {
    padding: 12px 16px;
    gap: 8px;
}

.ledger-summary {
    padding: 8px 16px;
    font-size: 11.5px;
}

.ledger-wrap {
    max-height: calc(100vh - 340px);
}

.ledger-table {
    font-size: 12px;
}

.ledger-table th {
    font-size: 11px;
    padding: 9px 8px;
}

.ledger-table td {
    height: 34px;
    padding: 6px 8px;
}

.xl-ledger .doc-no-link {
    font-size: 11.5px;
}

.xl-ledger .deal-tag {
    border-radius: 4px;
    background: var(--surface-3);
    font-size: 10.5px;
}

/* ---------- 详情 ---------- */
.detail-section {
    border-radius: 8px;
}

.detail-section-head {
    padding: 10px 14px;
}

.detail-section-icon {
    border-radius: 6px;
}

.detail-section-head strong {
    font-size: 12.5px;
}

.detail-section-head small {
    display: none !important;
}

.calc-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.calc-icon {
    background: var(--primary-soft);
    color: var(--primary);
    border-radius: 6px;
}

.calc-head small,
.calc-note {
    display: none !important;
}

.calc-formula {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 11px;
}

.calc-list > div {
    font-size: 11.5px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.calc-list strong {
    font-size: 12.5px;
}

.detail-meta-card {
    border-radius: 8px;
}

.report-grid {
    grid-template-columns: 1fr;
    gap: 12px;
}

.report-card {
    border-radius: 8px;
}

.report-head small,
.report-foot {
    display: none !important;
}

.report-head strong {
    font-size: 13px;
}

/* ---------- 系统设置 ---------- */
.settings-grid {
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
    gap: 14px;
    max-width: 1200px;
}

.settings-engine {
    display: none !important;
}

.formula-cards {
    grid-template-columns: 1fr;
    gap: 0;
}

.formula-card {
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
    padding: 10px 0;
}

.formula-card:last-child {
    border-bottom: 0;
}

.formula-card-top {
    margin-bottom: 6px;
}

.formula-card p {
    display: none !important;
}

.formula-card code {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 11px;
    padding: 5px 8px;
}

/* ---------- 账号 ---------- */
.user-avatar {
    background: #475569;
}

.role-badge {
    border-radius: 4px;
}

/* ---------- 登录 ---------- */
.login-cover {
    background: var(--nav);
    padding: 40px 44px;
}

.login-cover::before,
.login-cover::after,
.cover-glow,
.cover-points {
    display: none !important;
}

.cover-brand img {
    width: 40px;
    height: 40px;
    filter: none;
}

.cover-brand-copy strong {
    font-size: 16px;
    font-weight: 600;
}

.cover-brand-copy span {
    font-size: 11px;
    letter-spacing: .4px;
    color: #94a3b8;
}

.cover-title {
    font-size: clamp(30px, 3.2vw, 42px);
    letter-spacing: -.8px;
    font-weight: 600;
}

.cover-title em {
    color: #93c5fd;
}

.cover-desc {
    font-size: 13px;
    line-height: 1.8;
    color: #94a3b8;
    max-width: 460px;
    margin-top: 14px;
}

.cover-foot {
    font-size: 11px;
    color: #64748b;
}

.login-panel {
    background: var(--surface);
}

.login-card {
    width: min(360px, 100%);
}

.login-head {
    margin-bottom: 24px;
}

.login-head img {
    width: 40px;
    height: 40px;
    filter: none;
}

.login-head h1 {
    font-size: 21px;
    font-weight: 650;
    letter-spacing: -.3px;
}

.login-head p {
    display: none;
}

.login-field {
    border-radius: 6px;
    padding: 7px 11px;
}

.login-field-label {
    font-size: 11px;
    letter-spacing: 0;
}

.login-field:focus-within {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 12%, transparent);
}

.login-submit {
    height: 42px;
    border-radius: 6px;
    background: var(--primary);
    box-shadow: none;
    font-weight: 600;
}

.login-submit:hover {
    background: var(--primary-600);
    transform: none;
    box-shadow: none;
}

.login-help {
    background: transparent;
    border: 0;
    padding: 0;
    margin-top: 18px;
    font-size: 11.5px;
}

.login-help-mark {
    display: none;
}

.login-footer {
    margin-top: 28px;
    font-size: 11px;
    justify-content: center;
}

.login-footer .sep,
.login-footer span:nth-child(3) {
    display: none;
}

/* ---------- 启动加载 ---------- */
.auth-loading {
    background: var(--bg);
}

.auth-loading-mark {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    box-shadow: none;
}

.auth-loading-title {
    margin-top: 14px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0;
}

.auth-loading-bar {
    width: 160px;
}

.auth-loading-bar span {
    background: var(--primary);
}

.auth-loading-text {
    font-size: 12px;
}

/* ---------- 响应式 ---------- */
@media (min-width: 981px) {
    .kpi-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1280px) {
    .dash-grid {
        grid-template-columns: 1fr;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1100px) {
    .ledger-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .login-cover {
        display: none;
    }
}

@media (max-width: 860px) {
    .view-root {
        padding: 16px;
    }

    .page-title {
        font-size: 20px;
    }

    .decl-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        padding-left: 14px;
    }

    .decl-actions,
    .decl-warn {
        padding-left: 14px;
        margin-left: 14px;
    }

    .decl-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .ledger-kpis {
        grid-template-columns: 1fr;
    }

    .decl-form {
        grid-template-columns: 1fr;
    }

    .decl-metrics {
        grid-template-columns: 1fr 1fr;
    }
}
