/* ── 查询模式切换 ── */
.fw-tabs {
    display: flex;
    gap: 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.2rem;
}

.fw-tab {
    flex: 1;
    padding: 0.7rem 0;
    border: none;
    background: #fafafa;
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    border-right: 1px solid #e0e0e0;
}

.fw-tab:last-child {
    border-right: none;
}

.fw-tab:hover {
    background: #f0f4ff;
    color: #2563eb;
}

.fw-tab.active {
    background: #2563eb;
    color: white;
    font-weight: 600;
}

/* ── 表单 ── */
.fw-form {
    grid-template-columns: 1fr 1fr;
}

.fw-form-single {
    grid-template-columns: 1fr;
    max-width: 300px;
}

/* ── 查询结果 ── */
.fw-result {
    margin-top: 1.5rem;
}

.fw-result-card {
    background: #f8f9fb;
    border: 1px solid #e8eaf0;
    border-radius: 10px;
    overflow: hidden;
}

.fw-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1.2rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.9rem;
}

.fw-result-row:last-child {
    border-bottom: none;
}

.fw-result-label {
    color: #666;
}

.fw-result-val {
    font-weight: 600;
    color: #333;
    font-family: 'Fira Code', monospace;
}

.fw-result-advice {
    background: #fffbeb;
    border-top: 2px solid #fde68a;
    padding: 0.8rem 1.2rem;
    font-size: 0.88rem;
    color: #92400e;
    line-height: 1.7;
    display: block;
}

/* ── 对照表双列 ── */
.fw-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    max-width: 900px;
    margin: 0 auto;
}

.fw-table-col {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
}

.fw-table-title {
    padding: 0.8rem 1rem;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    margin: 0;
}

.fw-table-title-cn {
    background: #eef2ff;
    color: #2563eb;
}

.fw-table-title-who {
    background: #ecfdf5;
    color: #059669;
}

.fw-table {
    width: 100%;
    border-collapse: collapse;
}

.fw-table th {
    background: #f5f7fa;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.fw-table td {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    color: #555;
    border-bottom: 1px solid #f0f0f0;
}

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

.fw-table-note {
    padding: 0.7rem 1rem;
    font-size: 0.8rem;
    color: #999;
    line-height: 1.6;
    border-top: 1px solid #f0f0f0;
    margin: 0;
}

/* ── 等级标签 ── */
.level-tag {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 500;
}

.level-thin { background: #dbeafe; color: #2563eb; }
.level-normal { background: #d1fae5; color: #059669; }
.level-over { background: #fef3c7; color: #d97706; }
.level-obese { background: #fee2e2; color: #dc2626; }

/* ── 各范围详细说明 ── */
.fw-range-list {
    max-width: 760px;
    margin: 0 auto;
}

.fw-range-item {
    margin-bottom: 1rem;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    background: white;
}

.fw-range-head {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1.2rem;
    font-weight: 600;
}

.fw-range-tag {
    font-family: 'Fira Code', monospace;
    font-size: 0.85rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: rgba(255,255,255,0.6);
}

.fw-range-name {
    font-size: 0.95rem;
}

.fw-range-thin { background: #dbeafe; color: #2563eb; }
.fw-range-normal { background: #d1fae5; color: #059669; }
.fw-range-over { background: #fef3c7; color: #92400e; }
.fw-range-obese { background: #fee2e2; color: #dc2626; }

.fw-range-body {
    padding: 0.8rem 1.2rem;
}

.fw-range-body p {
    font-size: 0.88rem;
    color: #555;
    line-height: 1.8;
    margin: 0;
}

/* ── Mobile ── */
@media (max-width: 640px) {
    .fw-form {
        grid-template-columns: 1fr;
    }

    .fw-compare {
        grid-template-columns: 1fr;
    }

    .fw-tabs {
        flex-direction: column;
    }

    .fw-tab {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .fw-tab:last-child {
        border-bottom: none;
    }
}