/* ============ 孩子身高计算器 ============ */
/* 卡片头部右侧重置按钮垂直居中 */
.card-header-right {
    align-items: center;
}

/* 输入框 + 单位（输入框复用 common.css .setting-input） */
.input-with-unit {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 260px;
}

.input-with-unit .setting-input {
    flex: 1;
}

.input-with-unit .unit {
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
}

/* 快捷身高按钮（复用 common .btn/.btn-outline/.btn-sm） */
.quick-values {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

/* 性别选择（复用 common 按钮，选中态高亮） */
.gender-group {
    display: flex;
    gap: 10px;
}

.gender-group .btn.active {
    background: #8b5cf6;
    border-color: #8b5cf6;
    color: #fff;
}

/* 结果区 */
.result-box {
    padding: 18px 20px;
    background: #f8f7ff;
    border: 1px solid #e9e3ff;
    border-radius: 8px;
}

.result-label {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 10px;
}

.result-content {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 12px;
}

.result-value {
    font-size: 32px;
    font-weight: bold;
    color: #7c3aed;
}

.result-unit {
    font-size: 16px;
    color: #6b7280;
}

.result-range {
    margin-bottom: 12px;
    font-size: 13px;
    color: #6b7280;
}

.result-pct {
    margin-bottom: 12px;
    font-size: 13px;
    color: #7c3aed;
    font-weight: 500;
}

.result-formula {
    padding-top: 12px;
    border-top: 1px dashed #d1d5db;
    font-size: 13px;
    color: #374151;
}

.formula-label {
    color: #9ca3af;
    margin-right: 4px;
}

.form-error {
    margin-top: 10px;
    padding: 8px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    font-size: 13px;
    color: #dc2626;
}

/* 参考表 */
.table-section {
    margin-top: 20px;
}

.table-title {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.table-wrapper {
    overflow-x: auto;
}

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

.reference-table th,
.reference-table td {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    text-align: center;
}

.reference-table th {
    background: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.reference-table td {
    color: #6b7280;
}

.reference-table tbody tr:hover {
    background: #f9fafb;
}

/* 百分位表：左右并排男/女，说明、区块标题、表头小标签 */
.table-dual {
    display: flex;
    gap: 16px;
}

.table-block {
    flex: 1;
    min-width: 0;
}

.reference-table th.table-gender {
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
    color: #7c3aed;
    background: #f5f3ff;
    letter-spacing: 0.5px;
}

.table-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin: -4px 0 12px;
}

.table-note {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 12px;
    line-height: 1.5;
}

.reference-table th small {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: #9ca3af;
    margin-top: 2px;
}

@media (max-width: 640px) {
    .table-dual {
        flex-direction: column;
    }
}

/* ============ 深色模式 ============ */
body.dark .input-with-unit .unit {
    color: #9aa0a6;
}

body.dark .result-box {
    background: rgba(139, 92, 246, 0.1);
    border-color: #3a2f5c;
}

body.dark .result-label {
    color: #9aa0a6;
}

body.dark .result-value {
    color: #c4b5fd;
}

body.dark .result-unit {
    color: #9aa0a6;
}

body.dark .result-range {
    color: #9aa0a6;
}

body.dark .result-pct {
    color: #c4b5fd;
}

body.dark .form-error {
    background: rgba(220, 38, 38, 0.12);
    border-color: #7f1d1d;
    color: #fca5a5;
}

body.dark .table-title {
    color: #e0e0e0;
}

body.dark .reference-table th {
    background: #212529;
    color: #cfcfcf;
}

body.dark .reference-table th.table-gender {
    background: #2a2440;
    color: #c4b5fd;
}

body.dark .reference-table td {
    color: #9aa0a6;
    border-color: #495057;
}

body.dark .reference-table tbody tr:hover {
    background: #212529;
}

body.dark .table-subtitle {
    color: #9aa0a6;
}

body.dark .table-note {
    color: #8a9099;
}

body.dark .reference-table th small {
    color: #8a9099;
}
