/* ============================================================
   财税计算器系列共用样式
   覆盖：增值税计算器 / 印花税计算 / 残保金计算 / 工会经费计提 / 小微企业税收优惠测算
   依赖 devtools.css 的 :root 变量，自动适配黑夜模式
   ============================================================ */

/* ---------- 结果卡片 ---------- */
.tc-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
    gap: 10px;
    margin-top: 12px;
}
.tc-card {
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--c-border);
    border-radius: 12px;
    background: var(--c-bg-card);
    transition: border-color .2s, background .2s;
}
.tc-card .k {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--c-text-muted);
}
.tc-card .v {
    margin-top: 4px;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.01em;
    color: var(--c-text);
    word-break: break-all;
    font-variant-numeric: tabular-nums;
}
.tc-card .n {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.55;
    color: var(--c-text-muted);
}
.tc-card.is-primary { border-color: rgba(0, 102, 255, .35); background: var(--c-primary-soft); }
.tc-card.is-primary .v { color: var(--c-primary); }
.tc-card.is-ok { border-color: rgba(10, 143, 94, .35); background: rgba(10, 143, 94, .07); }
.tc-card.is-ok .v { color: #0a8f5e; }
.tc-card.is-warn { border-color: rgba(199, 107, 28, .35); background: rgba(199, 107, 28, .07); }
.tc-card.is-warn .v { color: #c76b1c; }
.tc-card.is-danger { border-color: rgba(229, 72, 77, .4); background: rgba(229, 72, 77, .07); }
.tc-card.is-danger .v { color: #e5484d; }
:root[data-theme="dark"] .tc-card.is-ok .v { color: #4ecb8d; }
:root[data-theme="dark"] .tc-card.is-warn .v { color: #eda45c; }
:root[data-theme="dark"] .tc-card.is-danger .v { color: #ff7a7f; }
:root[data-theme="dark"] .tc-card.is-primary .v { color: #6aa8ff; }

/* ---------- 提示条 ---------- */
.tc-note {
    margin-top: 12px;
    padding: 11px 14px;
    border: 1px solid var(--c-border);
    border-radius: 10px;
    background: var(--c-bg-soft);
    font-size: 13px;
    line-height: 1.8;
    color: var(--c-text-sub);
}
.tc-note b, .tc-note strong { color: var(--c-text); }
.tc-note--info { border-left: 3px solid var(--c-primary); }
.tc-note--ok { border-left: 3px solid #0a8f5e; background: rgba(10, 143, 94, .06); }
.tc-note--warn { border-left: 3px solid #c76b1c; background: rgba(199, 107, 28, .07); }
.tc-note--danger { border-left: 3px solid #e5484d; background: rgba(229, 72, 77, .07); }
.tc-note + .tc-note { margin-top: 8px; }

/* ---------- 结果表格增强 ---------- */
.tc-num {
    text-align: right !important;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.dt-table tr.tc-total td {
    font-weight: 800;
    color: var(--c-text);
    background: var(--c-surface-2);
}
.dt-table th.tc-num { text-align: right !important; }
.tc-table-wrap { margin-top: 12px; overflow-x: auto; }
.tc-table-wrap .dt-table { margin-top: 0; min-width: 480px; }

/* ---------- 小节标题 ---------- */
.tc-sub {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 22px;
}
.tc-sub:first-child { margin-top: 0; }
.tc-sub h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 800;
    color: var(--c-text);
    letter-spacing: -0.01em;
}
.tc-sub .tc-sub-note { font-size: 12.5px; color: var(--c-text-muted); }

/* ---------- 内联标记 ---------- */
.tc-flag {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
.tc-flag--ok { background: rgba(10, 143, 94, .13); color: #0a8f5e; }
.tc-flag--warn { background: rgba(199, 107, 28, .15); color: #c76b1c; }
.tc-flag--danger { background: rgba(229, 72, 77, .13); color: #e5484d; }
.tc-flag--muted { background: var(--c-surface-2); color: var(--c-text-muted); }
:root[data-theme="dark"] .tc-flag--ok { color: #4ecb8d; }
:root[data-theme="dark"] .tc-flag--warn { color: #eda45c; }
:root[data-theme="dark"] .tc-flag--danger { color: #ff7a7f; }

/* ---------- 占比条（工会经费 40/60 等） ---------- */
.tc-split {
    display: flex;
    height: 12px;
    margin-top: 10px;
    border: 1px solid var(--c-border);
    border-radius: 999px;
    overflow: hidden;
    background: var(--c-bg-soft);
}
.tc-split i { display: block; height: 100%; transition: width .25s; }

/* ---------- 紧凑定义列表 ---------- */
.tc-dl { margin: 12px 0 0; }
.tc-dl dt {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--c-text);
    margin-top: 12px;
}
.tc-dl dt:first-child { margin-top: 0; }
.tc-dl dd {
    margin: 3px 0 0;
    font-size: 13px;
    line-height: 1.8;
    color: var(--c-text-sub);
}

/* ---------- 政策版本脚注 ---------- */
.tc-ver {
    margin-top: 18px;
    padding-top: 12px;
    border-top: 1px dashed var(--c-border);
    font-size: 12px;
    line-height: 1.85;
    color: var(--c-text-muted);
}
.tc-ver b { color: var(--c-text-sub); }

/* ---------- 明细行删除按钮 ---------- */
.tc-del {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 1px solid var(--c-border);
    border-radius: 7px;
    background: transparent;
    color: var(--c-text-muted);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: all .2s;
}
.tc-del:hover { color: #fff; background: #ff4d79; border-color: #ff4d79; }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
    .tc-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tc-card .v { font-size: 17px; }
    .tc-sub { margin-top: 18px; }
}
