/* 小企业报税计算器 · 财税藏蓝金主题（zhandu.cn） */

.th-card {
    padding-bottom: 18px;
}

/* ---------- 设置区 ---------- */
.th-setup {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 10px 24px;
    padding: 16px 18px;
    background: linear-gradient(135deg, #f4f7fc, #eef3fa);
    border-bottom: 1px solid #e3eaf5;
    border-radius: 12px 12px 0 0;
}

.th-setup-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.th-label {
    flex: 0 0 62px;
    font-size: 13px;
    font-weight: 600;
    color: #3d4d63;
}

.th-tip {
    font-style: normal;
    font-size: 12px;
    color: #93a0b4;
}

.th-seg {
    display: inline-flex;
    background: #fff;
    border: 1px solid #d8e1ef;
    border-radius: 9px;
    padding: 3px;
    gap: 2px;
}

.th-seg-btn {
    border: 0;
    background: transparent;
    color: #55627a;
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 7px;
    cursor: pointer;
    transition: background .15s, color .15s;
    white-space: nowrap;
}

.th-seg-btn:hover {
    color: #24457c;
}

.th-seg-btn.on {
    background: linear-gradient(135deg, #2c4a75, #1f3a63);
    color: #fff;
    font-weight: 600;
}

/* 开关 */
.th-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
    cursor: pointer;
}

.th-switch input {
    display: none;
}

.th-switch i {
    position: absolute;
    inset: 0;
    background: #ccd6e6;
    border-radius: 999px;
    transition: background .18s;
}

.th-switch i::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform .18s;
    box-shadow: 0 1px 3px rgba(20, 40, 80, .3);
}

.th-switch input:checked + i {
    background: linear-gradient(135deg, #2c4a75, #1f3a63);
}

.th-switch input:checked + i::after {
    transform: translateX(18px);
}

/* ---------- 输入区 ---------- */
.th-inputs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    padding: 16px 18px 4px;
}

.th-field label {
    display: block;
    font-size: 12.5px;
    color: #55627a;
    margin-bottom: 6px;
    font-weight: 600;
}

.th-money {
    display: flex;
    align-items: center;
    border: 1.5px solid #d8e1ef;
    border-radius: 10px;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

.th-money:focus-within {
    border-color: #2c4a75;
    box-shadow: 0 0 0 3px rgba(44, 74, 117, .12);
}

.th-money i {
    font-style: normal;
    padding: 0 4px 0 12px;
    color: #8d99ad;
    font-weight: 700;
}

.th-money input {
    border: 0;
    outline: none;
    width: 100%;
    min-width: 0;
    padding: 11px 12px 11px 4px;
    font-size: 15px;
    font-weight: 600;
    color: #1c2a3f;
    background: transparent;
    -moz-appearance: textfield;
    appearance: textfield;
}

.th-money input::-webkit-outer-spin-button,
.th-money input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.th-money input::placeholder {
    font-weight: 400;
    font-size: 12.5px;
    color: #a8b2c4;
}

/* ---------- 结果区 ---------- */
.th-empty {
    padding: 34px 14px;
    text-align: center;
    color: #93a0b4;
    font-size: 14px;
}

.th-empty.sm {
    padding: 16px 10px;
    font-size: 13px;
}

.th-total {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin: 16px 18px 0;
    padding: 16px 20px;
    border-radius: 12px;
    background: linear-gradient(135deg, #2c4a75, #17304f);
    color: #fff;
}

.th-total-l {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.th-total-l i {
    font-style: normal;
    font-size: 12.5px;
    opacity: .75;
}

.th-total-l b {
    font-size: 30px;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.th-total-l u {
    text-decoration: none;
    font-size: 12px;
    color: #ffd98a;
    font-weight: 600;
}

.th-total-r {
    margin-left: auto;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 13px;
    color: #cfe0f5;
}

.th-total-r b {
    font-size: 17px;
    color: #9fe3b9;
}

.th-total-r span {
    font-size: 11.5px;
    opacity: .6;
}

/* 明细表 */
.th-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.th-table th,
.th-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #eef2f8;
    text-align: left;
    vertical-align: top;
}

.th-table thead th {
    background: #f4f7fc;
    color: #3d4d63;
    font-size: 12.5px;
    white-space: nowrap;
}

.th-table tbody tr:last-child td {
    border-bottom: 0;
}

.th-calc .th-td-name {
    font-weight: 700;
    color: #24457c;
    white-space: nowrap;
}

.th-calc .th-td-amt {
    font-weight: 700;
    color: #b4451f;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.th-calc .th-td-how {
    color: #55627a;
    font-variant-numeric: tabular-nums;
}

.th-calc .th-td-memo {
    color: #93a0b4;
    font-size: 12px;
}

.th-warn {
    margin: 10px 18px 0;
    padding: 10px 14px;
    background: #fdf8ec;
    border: 1px solid #f0e3c0;
    border-radius: 9px;
    font-size: 12.5px;
    line-height: 1.8;
    color: #6b5a26;
}

/* ---------- 记账 ---------- */
.th-ledger-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.th-ledger-form select {
    border: 1.5px solid #d8e1ef;
    border-radius: 9px;
    padding: 9px 10px;
    font-size: 13.5px;
    color: #2c3a52;
    background: #fff;
    outline: none;
}

.th-ledger-form .th-money {
    width: 150px;
}

.th-money.sm input {
    padding: 9px 10px 9px 4px;
    font-size: 14px;
}

.th-ledger-form > input[type="text"] {
    flex: 1;
    min-width: 140px;
    border: 1.5px solid #d8e1ef;
    border-radius: 9px;
    padding: 9px 12px;
    font-size: 13.5px;
    outline: none;
    color: #2c3a52;
}

.th-ledger-form > input[type="text"]:focus {
    border-color: #2c4a75;
}

.th-btn {
    border: 0;
    background: linear-gradient(135deg, #2c4a75, #1f3a63);
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: 9px;
    padding: 9px 20px;
    cursor: pointer;
    white-space: nowrap;
    transition: transform .12s, box-shadow .15s;
}

.th-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(31, 58, 99, .3);
}

.th-ledger-sum {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 14px;
    padding: 10px 14px;
    background: #f4f7fc;
    border-radius: 9px;
    font-size: 13px;
    color: #55627a;
}

.th-ledger-sum b {
    font-variant-numeric: tabular-nums;
}

.th-ledger-sum b.in {
    color: #2e7a51;
}

.th-ledger-sum b.out {
    color: #b4451f;
}

.th-mini {
    margin-left: auto;
    border: 1px solid #2c4a75;
    background: #fff;
    color: #24457c;
    font-size: 12px;
    border-radius: 999px;
    padding: 4px 12px;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.th-mini:hover {
    background: #2c4a75;
    color: #fff;
}

.th-mini.ghost {
    border-color: #b4451f;
    color: #b4451f;
}

.th-mini.ghost:hover {
    background: #b4451f;
    color: #fff;
}

.th-ledger-list {
    margin-top: 10px;
    max-height: 260px;
    overflow-y: auto;
}

.th-ledger-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px dashed #eef2f8;
    font-size: 13px;
}

.th-ledger-item:last-child {
    border-bottom: 0;
}

.th-ledger-item > i {
    flex: 0 0 auto;
    font-style: normal;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}

.th-ledger-item > i.in {
    background: linear-gradient(135deg, #52ab72, #3d9160);
}

.th-ledger-item > i.out {
    background: linear-gradient(135deg, #d97b4a, #c05f2e);
}

.th-li-memo {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #2c3a52;
}

.th-li-date {
    flex: 0 0 auto;
    font-size: 11.5px;
    color: #93a0b4;
}

.th-ledger-item > b {
    flex: 0 0 auto;
    font-variant-numeric: tabular-nums;
    min-width: 90px;
    text-align: right;
}

.th-ledger-item > b.in {
    color: #2e7a51;
}

.th-ledger-item > b.out {
    color: #b4451f;
}

.th-li-del {
    flex: 0 0 auto;
    border: 0;
    background: transparent;
    color: #b9c2d4;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
}

.th-li-del:hover {
    color: #b4451f;
    background: #fdf1ec;
}

/* ---------- 征期日历 ---------- */
.th-cal {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.th-cal-item {
    border: 1px solid #e3eaf5;
    border-radius: 10px;
    padding: 11px 13px;
    background: #fbfcfe;
}

.th-cal-item.now {
    border-color: #9db4d8;
    background: #f4f8fd;
    box-shadow: 0 2px 8px rgba(44, 74, 117, .08);
}

.th-cal-m {
    font-size: 13.5px;
    font-weight: 700;
    color: #24457c;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.th-cal-m i {
    font-style: normal;
    font-size: 10.5px;
    background: #ffd98a;
    color: #6b5a26;
    border-radius: 6px;
    padding: 1px 7px;
    font-weight: 600;
}

.th-cal-item ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.th-cal-item li {
    position: relative;
    padding: 3px 0 3px 14px;
    font-size: 12.5px;
    line-height: 1.7;
    color: #55627a;
}

.th-cal-item li::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 11px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #8d99ad;
}

.th-cal-item li:first-child::before {
    background: #2c4a75;
}

.th-cal-year {
    margin-top: 12px;
    font-size: 12.5px;
    color: #6b5a26;
    background: #fdf8ec;
    border: 1px solid #f0e3c0;
    border-radius: 9px;
    padding: 9px 14px;
    line-height: 1.8;
}

.th-note-p {
    margin: 10px 0 0;
    font-size: 12px;
    color: #93a0b4;
}

/* ---------- 印花税表 ---------- */
.th-table th:nth-child(2),
.th-table td:nth-child(2),
.th-table th:nth-child(3),
.th-table td:nth-child(3) {
    white-space: nowrap;
}

/* ---------- 说明卡 ---------- */
.th-note {
    font-size: 12.5px;
    line-height: 1.9;
    color: #8a93a6;
}

.th-note b {
    color: #67748c;
}

/* ---------- 相关工具 ---------- */
.th-rel-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.th-rel-item {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #e6eaf2;
    border-radius: 12px;
    padding: 13px 14px;
    text-decoration: none;
    background: #fbfcff;
    transition: transform .12s, box-shadow .15s, border-color .15s;
}

.th-rel-item:hover {
    transform: translateY(-2px);
    border-color: #bcd0f5;
    box-shadow: 0 4px 14px rgba(37, 99, 235, .12);
}

.th-rel-ico {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #eaf1fb, #dbe8f9);
    color: #2d5aa8;
}

.th-rel-t {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.th-rel-t b {
    font-size: 14px;
    color: #2a3142;
}

.th-rel-t i {
    font-style: normal;
    font-size: 12px;
    color: #8a93a6;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.th-rel-go {
    margin-left: auto;
    color: #b9c2d4;
    flex: 0 0 auto;
}

/* ---------- 移动端 ---------- */
@media (max-width: 768px) {
    .th-inputs {
        grid-template-columns: 1fr;
    }

    .th-cal {
        grid-template-columns: 1fr;
    }

    .th-total-l b {
        font-size: 24px;
    }

    .th-total-r {
        margin-left: 0;
        text-align: left;
    }

    .th-rel-grid {
        grid-template-columns: 1fr;
    }

    .th-setup {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .th-seg-btn {
        padding: 6px 10px;
        font-size: 12.5px;
    }

    .th-ledger-form > input[type="text"] {
        order: 5;
    }
}
