/* ======= 工资个税计算器样式 ======= */

.tool-page .tool-container {
    max-width: 1200px;
}

.tool-title-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--primary-light);
}

.tool-title-wrapper i {
    font-size: 2rem;
    color: var(--primary-color);
}

.tool-title-wrapper .tool-title {
    margin-bottom: 0;
    border-bottom: none;
}

/* ---- 双栏 ---- */
.st-layout {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.st-panel {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
}

.st-panel-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.st-group {
    margin-bottom: 16px;
}

.st-group:last-child {
    margin-bottom: 0;
}

.st-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.st-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.st-field:last-child {
    margin-bottom: 0;
}

.st-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.st-field .form-input,
.st-field .form-select {
    width: 100%;
    padding: 9px 11px;
    font-size: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-primary);
    font-family: 'Consolas', 'Monaco', monospace;
    box-sizing: border-box;
}

.st-field .form-select {
    font-family: inherit;
    cursor: pointer;
}

.st-field .form-input:focus,
.st-field .form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 140, 240, 0.12);
}

.st-hint {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ---- 分段按钮 ---- */
.st-seg {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-white);
}

.st-seg button {
    flex: 1;
    padding: 8px 6px;
    border: 0;
    background: transparent;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.st-seg button + button {
    border-left: 1px solid var(--border-color);
}

.st-seg button.active {
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
}

/* ---- 比例行 ---- */
.st-rate-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.st-rate-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.st-rate-item span {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.st-rate-item input {
    width: 52px;
    flex: 0 0 52px;
    padding: 6px 6px;
    font-size: 13px;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
    color: var(--text-primary);
    font-family: 'Consolas', 'Monaco', monospace;
    box-sizing: border-box;
}

.st-rate-item input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.st-rate-item em {
    font-style: normal;
    font-size: 12px;
    color: var(--text-muted);
}

/* ---- 右侧结果 ---- */
.st-main {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.st-hero {
    background: linear-gradient(135deg, #2d8cf0 0%, #4a9ff5 100%);
    border-radius: var(--radius-md);
    padding: 20px 18px;
    text-align: center;
    color: #fff;
}

.st-hero-label {
    font-size: 13px;
    opacity: 0.9;
    margin-bottom: 6px;
}

.st-hero-value {
    font-size: 34px;
    font-weight: 700;
    line-height: 1.2;
    font-family: 'Consolas', 'Monaco', monospace;
    letter-spacing: -0.5px;
}

.st-hero-sub {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 8px;
}

.st-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.st-stats-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.st-stat {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 8px;
    text-align: center;
}

.st-stat b {
    display: block;
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Consolas', 'Monaco', monospace;
    margin-bottom: 4px;
    word-break: break-all;
}

.st-stat span {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ---- 表格 ---- */
.st-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-white);
}

.st-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    min-width: 620px;
}

.st-table th,
.st-table td {
    padding: 9px 10px;
    border-bottom: 1px solid var(--border-color);
    text-align: right;
    white-space: nowrap;
}

.st-table th {
    background: var(--bg-light);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 12px;
    position: sticky;
    top: 0;
}

.st-table th:first-child,
.st-table td:first-child {
    text-align: left;
}

.st-table tbody tr:last-child td {
    border-bottom: none;
}

.st-table tbody tr:hover {
    background: var(--bg-light);
}

.st-table tbody tr.is-last {
    background: #eaf4ff;
    font-weight: 600;
}

.st-table tfoot td {
    background: var(--bg-light);
    font-weight: 600;
    border-top: 2px solid var(--primary-light);
}

.st-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.st-section-title i {
    color: var(--primary-color);
}

.st-tip {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.7;
    background: var(--bg-light);
    border-left: 3px solid var(--primary-color);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 10px 12px;
}

.st-sum-line {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.9;
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
}

.st-sum-line b {
    color: var(--text-primary);
    margin-right: 6px;
}

.st-error {
    display: none;
    font-size: 13px;
    color: #e5484d;
    background: #fff1f0;
    border: 1px solid #ffccc7;
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    margin-bottom: 12px;
}

.st-error.show {
    display: block;
}

/* ---- 响应式 ---- */
@media (max-width: 900px) {
    .st-layout {
        grid-template-columns: 1fr;
    }

    .st-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .st-hero-value {
        font-size: 28px;
    }

    .st-rate-grid {
        grid-template-columns: 1fr;
    }

    .st-panel {
        padding: 12px;
    }
}
