body {
    min-height: 100vh;
    font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
}

.tool-home {
    background:
        radial-gradient(circle at top left, rgba(25, 135, 84, 0.12), transparent 32%),
        radial-gradient(circle at top right, rgba(13, 110, 253, 0.12), transparent 28%),
        linear-gradient(180deg, #f8f9fa 0%, #eef3f8 100%);
}

.hero-copy-bs {
    max-width: 860px;
}

.tool-nav-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.88));
    backdrop-filter: blur(8px);
}

.tool-link-card {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
    border-radius: 1rem;
    border: 1px solid rgba(13, 110, 253, 0.12);
    background: #fff;
    box-shadow: 0 0.75rem 2rem rgba(33, 37, 41, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.tool-link-card:hover,
.tool-link-card:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 1rem 2.4rem rgba(33, 37, 41, 0.1);
    border-color: rgba(13, 110, 253, 0.28);
}

.tool-link-card .card-body {
    padding: 1.5rem;
}

.tool-link-icon {
    width: 3rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.9rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.tool-link-icon.tax {
    background: rgba(25, 135, 84, 0.12);
    color: #146c43;
}

.tool-link-icon.avg {
    background: rgba(13, 110, 253, 0.12);
    color: #0a58ca;
}

.tool-link-arrow {
    color: #6c757d;
    font-weight: 700;
}

.tool-quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.cost-hero-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.9));
}

.cost-hero-body {
    padding: 1.5rem !important;
}

.cost-hero-header {
    margin-bottom: 0.9rem !important;
}

.cost-hero-copy {
    max-width: 860px;
}

.cost-hero-title {
    font-size: clamp(1.7rem, 3vw, 2.2rem);
    line-height: 1.1;
}

.cost-hero-card .hero-copy-bs {
    max-width: 980px;
    font-size: 0.98rem;
    line-height: 1.45;
}

.cost-summary-grid {
    --bs-gutter-x: 0.75rem;
    --bs-gutter-y: 0.75rem;
}

.cost-summary-grid > [class*="col-"] {
    display: flex;
}

.cost-summary-grid > [class*="col-"] > .summary-card {
    width: 100%;
}

.summary-card {
    background: linear-gradient(180deg, rgba(13, 110, 253, 0.035), rgba(13, 110, 253, 0.01));
    border-radius: 0.8rem;
}

.summary-card .card-body {
    padding: 0.75rem 0.95rem;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
}

.summary-card-label {
    font-size: 0.82rem;
    line-height: 1.2;
    margin: 0;
    white-space: nowrap;
}

.summary-card-value {
    font-size: 1.5rem;
    line-height: 1;
    letter-spacing: -0.02em;
    text-align: right;
    white-space: nowrap;
}

.movement-switch .btn {
    white-space: nowrap;
}

.example-list li + li {
    margin-top: 0.35rem;
}

.history-table th,
.history-table td {
    white-space: nowrap;
}

.tag {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
    font-weight: 700;
}

.tag.purchase {
    background: rgba(25, 135, 84, 0.12);
    color: #146c43;
}

.tag.sale {
    background: rgba(220, 53, 69, 0.12);
    color: #b02a37;
}

.tag.loss {
    background: rgba(108, 117, 125, 0.14);
    color: #495057;
}

.alert p {
    line-height: 1.8;
    white-space: pre-line;
}

.reverse-mode-switch .btn {
    min-width: 7rem;
}

.reverse-demo-input,
.reverse-demo-panel {
    position: relative;
    border: 1px solid rgba(33, 37, 41, 0.08);
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.72);
    padding: 1.25rem 1.25rem 1.1rem;
}

.reverse-demo-panel {
    min-height: 24rem;
}

.reverse-demo-copy-wrap {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

.reverse-copy-btn {
    min-width: 2.5rem;
    padding-inline: 0.55rem;
    font-weight: 700;
}

.reverse-demo-input-line,
.reverse-step {
    font-family: "Cascadia Mono", "Consolas", monospace;
    white-space: pre-wrap;
}

.reverse-demo-input-line {
    line-height: 1.7;
}

.reverse-demo-steps {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.reverse-step {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.24s ease, transform 0.24s ease;
    line-height: 1.7;
}

.reverse-step.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.reverse-step-arrow {
    color: #6c757d;
}

.reverse-step-formula {
    color: #0d6efd;
}

.reverse-step-result {
    font-size: 1.1rem;
    font-weight: 700;
    color: #198754;
}

.tax-tool-shell-page {
    background:
        radial-gradient(circle at top left, rgba(25, 135, 84, 0.09), transparent 26%),
        radial-gradient(circle at bottom right, rgba(13, 110, 253, 0.08), transparent 24%),
        linear-gradient(180deg, #f5f7fa 0%, #edf2f7 100%);
}

.tax-tool-shell {
    display: grid;
    grid-template-columns: 20rem minmax(0, 1fr);
    min-height: 100vh;
}

.tax-tool-sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    min-height: 100vh;
    padding: 2rem 1.25rem;
    background: rgba(255, 255, 255, 0.84);
    backdrop-filter: blur(12px);
    border-right: 1px solid rgba(33, 37, 41, 0.08);
}

.tax-tool-sidebar-head {
    margin-bottom: 1.5rem;
}

.tax-tool-nav {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.tax-tool-nav-link {
    display: block;
    padding: 0.8rem 0.9rem;
    border-radius: 0.95rem;
    color: #344054;
    text-decoration: none;
    background: transparent;
    transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.tax-tool-nav-link:hover,
.tax-tool-nav-link:focus-visible {
    background: rgba(13, 110, 253, 0.08);
    color: #0a58ca;
    transform: translateX(2px);
}

.tax-tool-nav-link.active {
    background: linear-gradient(135deg, #198754, #157347);
    color: #fff;
    box-shadow: 0 0.8rem 2rem rgba(25, 135, 84, 0.18);
}

.tax-tool-sidebar-actions,
.tax-preset-panel {
    margin-top: 1.25rem;
    display: grid;
    gap: 0.75rem;
}

.spain-identity-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 1rem;
}

.spain-identity-card {
    padding: 1.5rem;
}

.spain-calculator-layout {
    display: grid;
    grid-template-columns: minmax(18rem, 24rem) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.spain-sticky-card {
    position: sticky;
    top: 1.5rem;
}

.spain-main-column {
    min-width: 0;
}

.spain-kpi-grid,
.spain-result-grid,
.spain-legend-grid {
    display: grid;
    gap: 1rem;
}

.spain-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
}

.spain-result-grid {
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
}

.spain-result-item,
.spain-flow-row,
.spain-legend-item {
    border: 1px solid rgba(33, 37, 41, 0.08);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.88);
    padding: 1rem 1.1rem;
}

.spain-result-item span,
.spain-flow-row span {
    display: block;
    color: #6c757d;
    font-size: 0.88rem;
    margin-bottom: 0.35rem;
}

.spain-result-item strong,
.spain-flow-row strong {
    font-size: 1.1rem;
}

.spain-flow-box {
    display: grid;
    gap: 0.75rem;
}

.spain-note-box {
    border-radius: 1rem;
    padding: 1rem 1.1rem;
    background: rgba(25, 135, 84, 0.08);
    color: #146c43;
    border: 1px solid rgba(25, 135, 84, 0.16);
}

.spain-note-list {
    padding-left: 1.1rem;
}

.spain-note-list li + li {
    margin-top: 0.5rem;
}

.spain-legend-grid {
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.spain-legend-item.iva {
    background: rgba(13, 110, 253, 0.08);
    color: #0a58ca;
}

.spain-legend-item.withholding {
    background: rgba(255, 193, 7, 0.14);
    color: #997404;
}

.spain-legend-item.final {
    background: rgba(220, 53, 69, 0.08);
    color: #b02a37;
}

.spain-legend-item.social {
    background: rgba(25, 135, 84, 0.08);
    color: #146c43;
}

@media (max-width: 991.98px) {
    .spain-calculator-layout {
        grid-template-columns: 1fr;
    }

    .spain-sticky-card {
        position: static;
    }
}

.profit-simulator-layout {
    display: grid;
    grid-template-columns: minmax(18rem, 22rem) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.profit-simulator-sticky-card {
    position: sticky;
    top: 1.5rem;
}

.profit-simulator-main {
    min-width: 0;
}

.profit-period-switch .btn {
    min-width: 3.25rem;
}

.profit-scenario-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 1199.98px) {
    .profit-simulator-layout {
        grid-template-columns: 1fr;
    }

    .profit-simulator-sticky-card {
        position: static;
    }

    .profit-period-switch {
        width: 100%;
    }

    .profit-period-switch .btn {
        flex: 1 1 0;
    }
}

@media (max-width: 767.98px) {
    .profit-scenario-grid {
        grid-template-columns: 1fr;
    }
}

.tax-tool-content {
    padding: 2rem;
}

.tax-tool-hero {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.82));
}

.tax-tool-card {
    display: block;
    height: 100%;
    padding: 1.4rem;
    border-radius: 1.15rem;
    text-decoration: none;
    color: inherit;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(13, 110, 253, 0.1);
    box-shadow: 0 1rem 2.6rem rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.tax-tool-card:hover,
.tax-tool-card:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 1.2rem 2.8rem rgba(15, 23, 42, 0.1);
    border-color: rgba(25, 135, 84, 0.22);
}

.tax-tool-card-kicker {
    display: inline-block;
    margin-bottom: 0.7rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #198754;
}

.pricing-tool-card-kicker {
    display: inline-block;
    margin-bottom: 0.75rem;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #198754;
}

.pricing-tool-card {
    display: block;
    height: 100%;
    padding: 1.4rem;
    border-radius: 1.15rem;
    color: inherit;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(13, 110, 253, 0.1);
    box-shadow: 0 1rem 2.6rem rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.pricing-tool-card:hover,
.pricing-tool-card:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 1.2rem 2.8rem rgba(15, 23, 42, 0.1);
    border-color: rgba(25, 135, 84, 0.22);
}

.pricing-metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.9rem;
}

.pricing-metric-card {
    border-radius: 1rem;
    padding: 1rem 1.1rem;
    background: linear-gradient(180deg, rgba(13, 110, 253, 0.035), rgba(13, 110, 253, 0.01));
    border: 1px solid rgba(13, 110, 253, 0.08);
}

.pricing-metric-label {
    margin: 0 0 0.35rem;
    font-size: 0.82rem;
    color: #6c757d;
}

.pricing-metric-value {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: #212529;
}

.pricing-summary-box {
    border-radius: 1rem;
    padding: 1rem 1.1rem;
    background: rgba(255, 255, 255, 0.78);
    border: 1px dashed rgba(25, 135, 84, 0.24);
}

.profit-conclusion-box {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(25, 135, 84, 0.16);
}

.profit-conclusion-copy {
    flex-shrink: 0;
}

.pricing-table td,
.pricing-table th {
    white-space: nowrap;
}

.pricing-note-list li + li {
    margin-top: 0.45rem;
}

@media (max-width: 640px) {
    .cost-hero-body {
        padding: 1.1rem !important;
    }

    .cost-hero-title {
        font-size: 1.6rem;
    }

    .cost-hero-card .hero-copy-bs {
        font-size: 0.92rem;
        line-height: 1.4;
    }

    .summary-card .card-body {
        padding: 0.7rem 0.8rem;
        gap: 0.6rem;
    }

    .summary-card-label {
        font-size: 0.76rem;
    }

    .summary-card-value {
        font-size: 1.22rem;
    }

    .movement-switch {
        display: grid;
        grid-template-columns: 1fr;
    }

    .tax-tool-shell {
        grid-template-columns: 1fr;
    }

    .tax-tool-sidebar {
        position: static;
        min-height: auto;
        border-right: 0;
        border-bottom: 1px solid rgba(33, 37, 41, 0.08);
    }

    .tax-tool-content {
        padding: 1rem;
    }

    .profit-conclusion-box {
        flex-direction: column;
    }
}