/* ===================== 工资 & 五险一金 & 离职补偿金计算器 ===================== */

/* ---- 顶部工具栏 ---- */
.sc-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.sc-mode-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.sc-mode-tab {
    padding: 10px 18px;
    border: 1px solid var(--c-border, #e2e8f0);
    border-radius: 12px;
    background: var(--c-surface, #fff);
    color: var(--c-text-sub, #334155);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all .15s ease;
}
.sc-mode-tab:hover { border-color: var(--c-primary, #0066ff); color: var(--c-primary, #0066ff); }
.sc-mode-tab.active { background: var(--c-primary, #0066ff); border-color: var(--c-primary, #0066ff); color: #fff; }
.sc-download-btn { flex-shrink: 0; margin: 0; }

/* ---- 布局 ---- */
.sc-layout { display: grid; grid-template-columns: 380px 1fr; gap: 20px; align-items: stretch; }

.sc-card {
    background: var(--c-surface, #fff);
    border: 1px solid var(--c-border, #e2e8f0);
    border-radius: 16px;
    padding: 24px;
}

.sc-title { font-size: 17px; font-weight: 800; color: var(--c-text, #0f172a); margin: 0 0 18px; }

.sc-field { margin-bottom: 16px; }
.sc-field > label { display: block; font-size: 13px; font-weight: 700; color: var(--c-text-sub, #334155); margin-bottom: 7px; }
.sc-input-wrap { position: relative; }
.sc-input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--c-border, #e2e8f0);
    border-radius: 10px;
    background: var(--c-surface, #fff);
    color: var(--c-text, #0f172a);
    font-size: 15px;
    font-weight: 600;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.sc-input:focus { border-color: var(--c-primary, #0066ff); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-primary, #0066ff) 15%, transparent); }
.sc-suffix { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); font-size: 13px; color: var(--c-text-muted, #94a3b8); font-weight: 600; }
.sc-select { cursor: pointer; appearance: auto; }
.sc-help { font-size: 12px; color: var(--c-text-muted, #94a3b8); margin: 6px 0 0; }
.sc-help--block { margin: 0 0 16px; line-height: 1.7; }
.sc-divider { text-align: center; font-size: 12px; font-weight: 700; color: var(--c-text-muted, #94a3b8); letter-spacing: 4px; margin: 4px 0 16px; }

.sc-radio-group { display: flex; gap: 10px; flex-wrap: wrap; }
.sc-radio { position: relative; }
.sc-radio input { position: absolute; opacity: 0; pointer-events: none; }
.sc-radio span {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid var(--c-border, #e2e8f0);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--c-text-sub, #334155);
    cursor: pointer;
    transition: all .15s ease;
    background: var(--c-surface, #fff);
}
.sc-radio input:checked + span {
    border-color: #10b981;
    background: #ecfdf5;
    color: #047857;
}

.btn-block { width: 100%; margin-top: 6px; }

/* ---- 结果 ---- */
.sc-result-empty { text-align: center; padding: 70px 20px; color: var(--c-text-muted, #94a3b8); }
.sc-result-empty .emoji { font-size: 40px; margin-bottom: 10px; }
.sc-result-empty p { font-size: 14px; margin: 0; }

.sc-result-head { display: flex; align-items: center; gap: 24px; padding-bottom: 16px; border-bottom: 1px dashed var(--c-border, #e2e8f0); }
.sc-net-label { font-size: 13px; font-weight: 700; color: var(--c-text-muted, #64748b); }
.sc-net-num { font-size: 44px; font-weight: 900; color: #10b981; font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 4px; }
.sc-net-unit { font-size: 12px; color: var(--c-text-muted, #94a3b8); }

.sc-doughnut-wrap { position: relative; width: 120px; height: 120px; margin-left: auto; flex-shrink: 0; }
.sc-doughnut { width: 100%; height: 100%; transform: rotate(-90deg); }
.sc-dough-bg { fill: none; stroke: var(--c-border, #e2e8f0); stroke-width: 12; }
.sc-dough-seg { fill: none; stroke-width: 12; stroke-linecap: butt; }
.sc-seg-net { stroke: #10b981; }
.sc-seg-fund { stroke: #f59e0b; }
.sc-seg-tax { stroke: #ef4444; }
.sc-dough-center {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.sc-dough-center span { font-size: 16px; font-weight: 900; color: var(--c-text, #0f172a); }
.sc-dough-center small { font-size: 10px; color: var(--c-text-muted, #94a3b8); }

.sc-bill { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sc-bill li { display: flex; justify-content: space-between; font-size: 14px; padding: 5px 0; color: var(--c-text-sub, #334155); }
.sc-bill li .v { font-variant-numeric: tabular-nums; font-weight: 700; }
.sc-bill li .v.minus { color: #ef4444; }
.sc-bill li .v.sub { color: var(--c-text-muted, #94a3b8); font-weight: 600; font-size: 13px; }
.sc-bill li.total {
    border-top: 1px dashed var(--c-border, #e2e8f0);
    margin-top: 4px; padding-top: 10px;
    font-size: 15px; font-weight: 800; color: var(--c-text, #0f172a);
}
.sc-bill li.total .v { color: #10b981; font-size: 18px; }
.sc-bill li.ps-group-title {
    font-size: 12px; font-weight: 800; color: var(--c-text-muted, #94a3b8);
    border-top: 1px dashed var(--c-border, #e2e8f0);
    margin-top: 10px; padding-top: 10px; letter-spacing: 2px;
}

.sc-extra { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.sc-extra-item {
    text-align: center;
    padding: 14px 8px;
    background: var(--c-surface-soft, #f8fafc);
    border-radius: 12px;
}
.sc-extra-num { font-size: 20px; font-weight: 900; color: var(--c-primary, #0066ff); font-variant-numeric: tabular-nums; }
.sc-extra-key { font-size: 11px; color: var(--c-text-muted, #64748b); margin-top: 4px; }

/* ---- 工资条解读 ---- */
.ps-bar-wrap { margin-left: auto; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; width: 150px; }
.ps-bar { height: 14px; border-radius: 99px; background: var(--c-surface-soft, #f1f5f9); overflow: hidden; position: relative; }
.ps-bar span { display: block; height: 100%; border-radius: 99px; width: 0; transition: width .4s ease; }
.ps-bar--earn span { background: linear-gradient(90deg, #10b981, #34d399); }
.ps-bar--deduct span { background: linear-gradient(90deg, #ef4444, #f87171); }
.ps-bar--earn::after { content: '应发'; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 10px; font-weight: 700; color: #065f46; }
.ps-bar--deduct::after { content: '扣款'; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 10px; font-weight: 700; color: #7f1d1d; }

.ps-tips { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.ps-tip {
    font-size: 12px;
    line-height: 1.7;
    color: var(--c-text-sub, #334155);
    background: var(--c-surface-soft, #f8fafc);
    border-left: 3px solid var(--c-primary, #0066ff);
    border-radius: 8px;
    padding: 8px 12px;
}

/* ---- 离职补偿金 ---- */
.sv-formula {
    margin-left: auto;
    flex-shrink: 0;
    text-align: right;
    font-size: 13px;
    font-weight: 700;
    color: var(--c-text-sub, #334155);
    background: var(--c-surface-soft, #f8fafc);
    border-radius: 12px;
    padding: 12px 16px;
    max-width: 220px;
}
.sv-law { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.sv-law-note {
    font-size: 13px;
    line-height: 1.7;
    border-radius: 8px;
    padding: 9px 12px;
}
.sv-law-note:not(:empty) { margin-bottom: 2px; }
.sv-law-note[class*="warn"] {
    background: color-mix(in srgb, #ef4444 10%, transparent);
    border: 1px dashed color-mix(in srgb, #ef4444 45%, transparent);
    color: #dc2626;
}
.sv-law-item {
    font-size: 12px;
    line-height: 1.8;
    color: var(--c-text-sub, #334155);
    background: var(--c-surface-soft, #f8fafc);
    border-left: 3px solid #f59e0b;
    border-radius: 8px;
    padding: 8px 12px;
}

.sc-diclaim {
    margin-top: 14px;
    padding: 10px 16px;
    font-size: 12px;
    color: var(--c-text-muted, #94a3b8);
    background: var(--c-surface-soft, #f8fafc);
    border: 1px dashed var(--c-border, #e2e8f0);
    border-radius: 10px;
    line-height: 1.7;
}

/* ---- 黑夜模式覆盖 ---- */
[data-theme="dark"] .sc-radio input:checked + span {
    background: color-mix(in srgb, #10b981 18%, #131c31);
    color: #34d399;
}
[data-theme="dark"] .sc-mode-tab.active { color: #fff; }
[data-theme="dark"] .ps-bar--earn::after { color: #6ee7b7; }
[data-theme="dark"] .ps-bar--deduct::after { color: #fca5a5; }
[data-theme="dark"] .ps-bar { background: #1e293b; }
[data-theme="dark"] .sv-law-note.warn {
    background: color-mix(in srgb, #ef4444 16%, #131c31);
    border-color: color-mix(in srgb, #ef4444 55%, transparent);
    color: #fca5a5;
}

@media (max-width: 900px) {
    .sc-layout { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .sc-extra { grid-template-columns: 1fr; }
    .ps-bar-wrap, .sv-formula { width: 100%; max-width: none; margin-left: 0; text-align: left; }
}
