/* ============ 输入提示 ============ */
.input-hint {
    font-size: 12px;
    color: #6b7280;
    margin-top: 4px;
    display: block;
}

/* ============ 单位切换 ============ */
.setting-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.setting-label-row .setting-label {
    margin-bottom: 0;
}

.unit-select {
    padding: 5px 10px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 13px;
    color: #374151;
    background: #fff;
    outline: none;
    cursor: pointer;
}

.unit-select:focus {
    border-color: #8b5cf6;
}

.dual-input {
    display: flex;
    gap: 10px;
}

.dual-input .setting-input {
    flex: 1;
}

/* ============ 收窄结果卡空状态（覆盖公共默认 60px 内边距） ============ */
.settings-card .empty-state {
    padding: 32px !important;
}

/* ============ 图例 ============ */
.legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
}

.legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

.legend-color.under {
    background-color: #fef3c7;
    border: 1px solid #f59e0b;
}

.legend-color.normal {
    background-color: #dcfce7;
    border: 1px solid #22c55e;
}

.legend-color.over {
    background-color: #fee2e2;
    border: 1px solid #ef4444;
}

.legend-color.obese {
    background-color: #fecaca;
    border: 1px solid #dc2626;
}

/* ============ 表格 ============ */
.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

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

.hw-table th,
.hw-table td {
    padding: 8px 12px;
    text-align: center;
    border: 1px solid #e5e7eb;
    white-space: nowrap;
}

.hw-table th {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    font-weight: 600;
    color: #374151;
}

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

.hw-table tbody tr:first-child td:first-child {
    font-weight: 600;
    background: #f3f4f6;
}

.hw-table .bmi-under {
    background-color: #fef3c7;
    color: #b45309;
}

.hw-table .bmi-normal {
    background-color: #dcfce7;
    color: #166534;
}

.hw-table .bmi-over {
    background-color: #fee2e2;
    color: #991b1b;
}

.hw-table .bmi-obese {
    background-color: #fecaca;
    color: #991b1b;
}

.hw-table td[title] {
    position: relative;
    cursor: pointer;
}

.hw-table td[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: #1f2937;
    color: white;
    font-size: 12px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 100;
    margin-bottom: 8px;
}

.hw-table td[title]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1f2937;
    margin-bottom: 2px;
}

/* ============ 结果区域（BMI 专属） ============ */
.result-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bmi-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.bmi-icon {
    font-size: 32px;
}

.result-title {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.bmi-bar-container {
    margin: 20px 0;
    padding: 0 10px;
}

.bmi-bar {
    display: flex;
    height: 30px;
    border-radius: 15px;
    background: #e5e7eb;
    position: relative;
    overflow: hidden;
}

.bmi-bar-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    font-weight: 500;
}

.bmi-bar-section.underweight {
    background: #f59e0b;
    flex: 0.5;
}

.bmi-bar-section.normal {
    background: #10b981;
    flex: 1.2;
}

.bmi-bar-section.overweight {
    background: #f97316;
    flex: 0.8;
}

.bmi-bar-section.obese {
    background: #ef4444;
    flex: 0.5;
}

.bmi-indicator {
    position: absolute;
    top: -5px;
    width: 20px;
    height: 40px;
    background: white;
    border: 3px solid #1f2937;
    border-radius: 10px;
    transform: translateX(-50%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: left 0.3s ease;
}

.result-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 0;
}

.item-label {
    font-size: 14px;
    color: #6b7280;
    min-width: 120px;
}

.item-value {
    font-size: 14px;
    color: #1f2937;
    font-weight: 500;
}

.status-underweight {
    color: #f59e0b;
}

.status-normal {
    color: #10b981;
}

.status-overweight {
    color: #f97316;
}

.status-obese {
    color: #ef4444;
}

.copy-button-container {
    margin-top: 20px;
    text-align: center;
}

/* ============ BMI 标准参考表 ============ */
.bmi-table {
    width: 100%;
    border-collapse: collapse;
}

.bmi-table th {
    padding: 12px;
    background: #f8fafc;
    border-bottom: 2px solid #e5e7eb;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    text-align: left;
}

.bmi-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    font-size: 14px;
    color: #1f2937;
}

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

.underweight-row td:first-child {
    color: #f59e0b;
    font-weight: 600;
}

.normal-row td:first-child {
    color: #10b981;
    font-weight: 600;
}

.overweight-row td:first-child {
    color: #f97316;
    font-weight: 600;
}

.obese-row td:first-child {
    color: #ef4444;
    font-weight: 600;
}

/* ============ 对齐修复：分栏内取消 settings-card 的 margin-top ============ */
.section-row > .settings-card {
    margin-top: 0;
}

/* 统一两卡头部高度（左卡含按钮略高），保证标题与分隔线水平对齐 */
.section-row > .settings-card > .card-header {
    min-height: 48px;
}

/* ============ 深色模式 ============ */
body.dark .input-hint {
    color: #9ca3af;
}

body.dark .unit-select {
    background: #1f2937;
    border-color: #374151;
    color: #e5e7eb;
}

body.dark .legend-item {
    color: #9ca3af;
}

body.dark .table-wrapper {
    border-color: #374151;
}

body.dark .hw-table th {
    background: #1f2937;
    color: #e5e7eb;
}

body.dark .hw-table td {
    border-color: #374151;
}

body.dark .hw-table tbody tr:hover {
    background: #1f2937;
}

body.dark .hw-table tbody tr:first-child td:first-child {
    background: #1f2937;
}

body.dark .bmi-table th {
    background: #1f2937;
    color: #e5e7eb;
    border-color: #374151;
}

body.dark .bmi-table td {
    border-color: #374151;
    color: #e5e7eb;
}

body.dark .result-title {
    color: #e5e7eb;
}

body.dark .item-label {
    color: #9ca3af;
}

body.dark .item-value {
    color: #e5e7eb;
}

body.dark .bmi-bar {
    background: #374151;
}

body.dark .bmi-indicator {
    border-color: #e5e7eb;
}
