/* ======================================================================
 *  赡养个税抵扣 /tools/elderly-support-tax
 *  独生 / 非独生子女赡养老人专项附加扣除计算器。依赖 home.css 全局变量 + tool-detail.css。
 * ====================================================================== */

[hidden] { display: none !important; }

.est-layout {
    display: grid;
    grid-template-columns: 440px minmax(0, 1fr);
    gap: 20px;
    margin-bottom: 24px;
    align-items: start;
}
.est-card {
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 22px;
}
.est-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin-bottom: 16px;
}

/* ---------- 表单 ---------- */
.est-field { margin-bottom: 16px; min-width: 0; }
.est-field > label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: var(--c-text-sub);
    margin-bottom: 8px;
}
.est-help {
    font-size: 11.5px;
    line-height: 1.65;
    color: var(--c-text-muted);
    margin: 7px 0 2px;
}
.est-help b { color: var(--c-text-sub); }
.est-input-wrap { position: relative; display: flex; align-items: center; }
.est-input {
    width: 100%;
    height: 43px;
    padding: 0 44px 0 14px;
    font-size: 14px;
    font-family: inherit;
    color: var(--c-text);
    background: var(--c-surface-soft);
    border: 1px solid var(--c-border);
    border-radius: 12px;
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
    -moz-appearance: textfield;
}
.est-input::-webkit-outer-spin-button,
.est-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.est-input:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-soft); }
.est-suffix {
    position: absolute; right: 14px;
    font-size: 12px; color: var(--c-text-muted); pointer-events: none;
}
.est-select {
    appearance: none; -webkit-appearance: none; cursor: pointer;
    padding-right: 36px; font-size: 13px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a93a8' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 12px center;
}

/* 分段选择 */
.est-seg { display: flex; flex-wrap: wrap; gap: 8px; }
.est-seg button {
    flex: 1 1 auto;
    padding: 10px 12px;
    font-size: 13.5px; font-weight: 700; font-family: inherit;
    color: var(--c-text-sub);
    background: var(--c-surface-soft);
    border: 1.5px solid var(--c-border);
    border-radius: 11px; cursor: pointer;
    transition: all 0.15s ease;
}
.est-seg button:hover { border-color: var(--c-primary); }
.est-seg button.is-on {
    color: #fff;
    background: linear-gradient(135deg, #f97316, #f59e0b);
    border-color: #f59e0b;
    box-shadow: 0 3px 10px rgba(249, 115, 22, 0.22);
}

.est-divider {
    display: flex; align-items: center; gap: 10px;
    margin: 18px 0 14px;
    font-size: 12px; font-weight: 700; color: var(--c-text-muted);
}
.est-divider::after { content: ""; flex: 1; height: 1px; background: var(--c-border); }
.est-hidden { display: none; }

/* ---------- 结果 ---------- */
.est-result-card { min-height: 360px; }
.est-result-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 12px; min-height: 340px; text-align: center;
    color: var(--c-text-muted); font-size: 13.5px; line-height: 1.8;
}
.est-result-empty .emoji { font-size: 46px; opacity: 0.75; }
.est-result-body { animation: estFade 0.28s ease; }
@keyframes estFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.est-hero {
    padding: 22px 24px; border-radius: 16px;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.12), rgba(245, 158, 11, 0.06));
    border: 1px solid rgba(249, 115, 22, 0.26);
    margin-bottom: 14px;
}
.est-hero-label { font-size: 12.5px; color: var(--c-text-sub); margin-bottom: 6px; }
.est-hero-num { display: flex; align-items: baseline; gap: 4px; color: #f0851c; line-height: 1.1; }
.est-hero-num .cur { font-size: 20px; font-weight: 700; }
.est-hero-num b { font-size: 38px; font-weight: 800; letter-spacing: -0.035em; }
.est-hero-sub { font-size: 12.5px; color: var(--c-text-sub); margin-top: 8px; }

.est-split {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px;
}
.est-split-item {
    padding: 14px 16px; border-radius: 12px;
    background: var(--c-surface-soft); border: 1px solid var(--c-border);
}
.est-split-num { font-size: 18px; font-weight: 800; color: var(--c-text); letter-spacing: -0.02em; margin-bottom: 4px; }
.est-split-key { font-size: 11.5px; color: var(--c-text-muted); }

.est-bill {
    list-style: none; border: 1px solid var(--c-border); border-radius: 14px; overflow: hidden; margin-bottom: 14px;
}
.est-bill li {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 11px 16px; font-size: 13px; border-bottom: 1px solid var(--c-border);
}
.est-bill li:last-child { border-bottom: none; }
.est-bill .k { display: block; color: var(--c-text-sub); }
.est-bill .k small { display: block; font-size: 11px; color: var(--c-text-muted); margin-top: 2px; }
.est-bill .v { font-weight: 700; color: var(--c-text); white-space: nowrap; }
.est-bill li.total { background: var(--c-surface-soft); }
.est-bill li.total .k { font-weight: 700; color: var(--c-text); }
.est-bill li.total .v { color: var(--c-accent-green); font-size: 15px; }

.est-note {
    font-size: 12.5px; line-height: 1.8; color: var(--c-text-sub);
    padding: 12px 14px; border-radius: 12px;
    background: var(--c-primary-soft); border: 1px dashed rgba(0, 102, 255, 0.28);
}
.est-note b { color: var(--c-text); }
.est-warn {
    font-size: 12.5px; line-height: 1.7; color: #b45309;
    padding: 10px 14px; border-radius: 12px; margin-top: 10px;
    background: #fff7ed; border: 1px solid #f5d8b8;
}

/* ---------- 政策速查 ---------- */
.est-table-card {
    background: var(--c-bg-card); border: 1px solid var(--c-border);
    border-radius: var(--radius-md); box-shadow: var(--shadow-sm); padding: 22px; margin-bottom: 20px;
}
.est-table-scroll { overflow-x: auto; border: 1px solid var(--c-border); border-radius: 12px; }
.est-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 520px; }
.est-table thead th {
    text-align: left; padding: 12px 16px; font-size: 12.5px; font-weight: 700;
    color: var(--c-text-sub); background: var(--c-surface-soft); border-bottom: 1px solid var(--c-border); white-space: nowrap;
}
.est-table tbody td { padding: 11px 16px; color: var(--c-text-sub); border-bottom: 1px solid var(--c-border); }
.est-table tbody tr:last-child td { border-bottom: none; }
.est-table tbody td b { color: var(--c-text); }
.est-disclaim {
    font-size: 12px; line-height: 1.85; color: var(--c-text-muted);
    background: var(--c-surface-soft); border: 1px solid var(--c-border);
    border-radius: 12px; padding: 14px 16px; margin-bottom: 26px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1000px) {
    .est-layout { grid-template-columns: 1fr; }
    .est-result-card { min-height: auto; }
    .est-result-empty { min-height: 180px; }
}
@media (max-width: 620px) {
    .est-card, .est-table-card { padding: 18px; }
    .est-hero-num b { font-size: 30px; }
    .est-split { grid-template-columns: 1fr; }
    .est-bill li { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* ---------- 黑夜模式 ---------- */
[data-theme="dark"] .est-input { background: rgba(255, 255, 255, 0.04); }
[data-theme="dark"] .est-input option { background: #131c31; color: #e5e9f0; }
[data-theme="dark"] .est-select option { background: #131c31; color: #e5e9f0; }
[data-theme="dark"] .est-seg button { background: rgba(255, 255, 255, 0.04); color: var(--c-text-sub); }
[data-theme="dark"] .est-hero {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.18), rgba(245, 158, 11, 0.1));
    border-color: rgba(249, 115, 22, 0.34);
}
[data-theme="dark"] .est-hero-num { color: #fbbf24; }
[data-theme="dark"] .est-note { background: rgba(59, 130, 246, 0.12); border-color: rgba(59, 130, 246, 0.32); }
[data-theme="dark"] .est-warn { background: rgba(180, 83, 9, 0.16); border-color: rgba(180, 83, 9, 0.4); color: #fcd9a8; }
[data-theme="dark"] .est-split-item,
[data-theme="dark"] .est-bill li.total,
[data-theme="dark"] .est-table thead th,
[data-theme="dark"] .est-disclaim { background: rgba(255, 255, 255, 0.03); }
[data-theme="dark"] .est-bill li.total .v { color: #34d399; }
