/* TDEE 计算器样式 */

.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; }

.td-error {
    display: none; margin-bottom: 1rem; padding: 0.65rem 0.9rem;
    border-radius: 8px; background: #fff1f0; border: 1px solid #ffccc7;
    color: #c92a2a; font-size: 0.9rem;
}
.td-error.show { display: block; }

.td-label {
    display: block; margin-bottom: 0.35rem; font-size: 0.88rem;
    font-weight: 600; color: var(--text-color);
}
.td-unit { font-weight: 400; color: #7a8394; font-size: 0.82rem; }
.td-grid {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem; margin-bottom: 0.85rem;
}
.td-field { min-width: 0; }
.td-sex-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.9rem; flex-wrap: wrap; }
.td-sex-row > span { font-size: 0.88rem; font-weight: 600; color: var(--text-color); margin-right: 0.3rem; }
.td-sex-row button, .td-mini-btn {
    padding: 0.42rem 1rem; border: 1px solid var(--border-color, #dfe3e8);
    background: #fff; color: var(--text-color); border-radius: 8px;
    font-size: 0.88rem; cursor: pointer; transition: all .15s;
}
.td-sex-row button:hover, .td-mini-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }
.td-sex-row button.active {
    background: var(--primary-color); border-color: var(--primary-color); color: #fff;
}
.td-mini-btn { padding: 0.3rem 0.65rem; font-size: 0.8rem; }
.td-hint { margin: 0 0 1.1rem; font-size: 0.85rem; color: #7a8394; line-height: 1.7; }

.td-result-grid {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem; margin-bottom: 1.1rem;
}
.td-card {
    border: 1px solid var(--border-color, #e6e9ef); border-top: 3px solid var(--primary-color);
    border-radius: 9px; padding: 0.85rem; background: #fafbff; text-align: center;
}
.td-card:nth-child(2) { border-top-color: #4facfe; }
.td-card:nth-child(3) { border-top-color: #43cea2; }
.td-card:nth-child(4) { border-top-color: #f5a623; }
.td-card-label { font-size: 0.84rem; color: #7a8394; }
.td-card-value {
    margin-top: 0.3rem; font-size: 1.55rem; font-weight: 700; color: var(--primary-color);
    font-variant-numeric: tabular-nums; word-break: break-all;
}
.td-card:nth-child(2) .td-card-value { color: #2196c9; }
.td-card:nth-child(3) .td-card-value { color: #2a9d72; }
.td-card:nth-child(4) .td-card-value { color: #c47f10; }
.td-card-tip { font-size: 0.76rem; color: #9aa3b2; margin-top: 0.15rem; }

.td-callout {
    padding: 0.7rem 0.9rem; border-radius: 8px; background: #f0f7ff;
    border-left: 3px solid var(--primary-color); font-size: 0.88rem;
    color: var(--text-color); margin-bottom: 1.2rem; line-height: 1.75;
    word-break: break-word; font-variant-numeric: tabular-nums;
}
.td-callout.is-warn { background: #fff7e6; border-left-color: #f5a623; color: #8a5a00; }

.td-section-title {
    margin: 1.3rem 0 0.7rem; font-size: 1.05rem; font-weight: 600;
    color: var(--text-color); display: flex; align-items: center; gap: 0.4rem;
}
.td-macro-grid {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem; margin-bottom: 0.9rem;
}
.td-macro {
    border: 1px solid var(--border-color, #e6e9ef); border-radius: 9px;
    padding: 0.85rem; background: #fff; text-align: center;
}
.td-macro-name { font-size: 0.88rem; font-weight: 600; color: var(--text-color); }
.td-macro-val {
    margin-top: 0.3rem; font-size: 1.5rem; font-weight: 700; color: var(--primary-color);
    font-variant-numeric: tabular-nums;
}
.td-macro:nth-child(2) .td-macro-val { color: #c47f10; }
.td-macro:nth-child(3) .td-macro-val { color: #2a9d72; }
.td-macro-kcal { font-size: 0.8rem; color: #9aa3b2; margin-top: 0.15rem; }
.td-unit-small { font-size: 0.85rem; font-weight: 500; color: #7a8394; }

.td-table-wrap { overflow-x: auto; }
.td-table { width: 100%; border-collapse: collapse; font-size: 0.89rem; }
.td-table th, .td-table td {
    padding: 0.5rem 0.65rem; border-bottom: 1px solid var(--border-color, #e9ecf2); text-align: left;
}
.td-table th { background: #f5f7fb; font-weight: 600; white-space: nowrap; }
.td-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.td-table tr.is-current { background: #eef5ff; font-weight: 600; }
.td-table tbody tr:hover { background: #fafbff; }
.td-note { margin-top: 0.7rem; font-size: 0.84rem; color: #7a8394; line-height: 1.7; }

.cs-table-wrap { overflow-x: auto; }
.cs-table { width: 100%; border-collapse: collapse; font-size: 0.89rem; }
.cs-table th, .cs-table td {
    padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--border-color, #e9ecf2); text-align: left;
}
.cs-table th { background: #f5f7fb; font-weight: 600; }
.cs-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.cs-hint { margin-top: 0.7rem; font-size: 0.83rem; color: #7a8394; line-height: 1.6; }

@media (max-width: 820px) {
    .td-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .td-result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
    .td-grid, .td-result-grid, .td-macro-grid { grid-template-columns: minmax(0, 1fr); }
}
