/* =========================================
   Calorie Calculator - Specific Styles
   所有通用样式已移至 style.css
   ========================================= */

/* --- 单位切换按钮 --- */
.unit-toggle { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 25px; 
}

.unit-btn { 
    flex: 1; 
    padding: 10px; 
    border: 1px solid #ccc; 
    background: #f5f5f5; 
    cursor: pointer; 
    border-radius: 4px; 
    font-weight: 600; 
    color: #666; 
    font-size: 14px; 
    text-align: center;
    transition: all 0.2s;
}

.unit-btn.active { 
    background: #005a4e; 
    color: #fff; 
    border-color: #004d40; 
}

.unit-btn:hover:not(.active) {
    background: #e8e8e8;
}

/* --- Calorie 特有表单布局 --- */
.calorie-form-inner { 
    width: 100%;
    max-width: 100%; 
    margin: 0; 
}

.height-inputs { 
    display: flex; 
    gap: 10px; 
}

.height-inputs .input-group { 
    flex: 1; 
    margin-bottom: 0; 
}

/* --- Activity Level 下拉框优化 --- */
#cactivity {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 35px;
}

/* --- 卡路里目标表格 --- */
.calorie-goals-table {
    width: 100%;
    margin-top: 0;
}

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

.calorie-goals-table th {
    text-align: left;
    padding: 5px 1px;
    color: #333;
    font-weight: bold;
    border-bottom: 2px solid #ddd;
    font-size: 14px;
}

.calorie-goals-table td {
    padding: 5px 1px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.calorie-goals-table tr:hover {
    background-color: #f5f5f5;
}

.calorie-goals-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.calorie-goals-table tr:nth-child(even):hover {
    background-color: #f0f0f0;
}

/* --- 图表容器 --- */
.chart-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    border-top: 1px solid #eee;
    width: 100%;
}

.chart-container canvas {
    max-width: 100%;
    height: auto !important;
}

/* --- 卡路里说明文字 --- */
.calorie-note { 
    margin-top: 25px; 
    font-size: 13px; 
    color: #666; 
    line-height: 1.5; 
    padding: 15px; 
    background: #f9f9f9; 
    border-radius: 4px; 
    border: 1px solid #eee; 
}

.calorie-summary-section { 
    margin-top: 30px; 
}

/* --- 响应式优化 --- */
@media screen and (max-width: 992px) {
    .height-inputs { 
        flex-direction: row; 
    }
    
    .height-inputs .input-group { 
        min-width: 0; 
    }

    .chart-container {
        padding: 15px 10px;
    }

    .calorie-goals-table {
        font-size: 13px;
    }

    .calorie-goals-table th,
    .calorie-goals-table td {
        padding: 8px 6px;
    }
}

@media screen and (max-width: 768px) {
    .calorie-goals-table {
        overflow-x: auto;
        display: block;
    }

    .calorie-goals-table table {
        min-width: 500px;
    }
}

/* --- 打印样式 --- */
@media print {
    .calorie-goals-table,
    .chart-container,
    .calorie-note {
        display: block !important;
    }

    .chart-container {
        page-break-inside: avoid;
    }

    .calorie-goals-table table,
    .calorie-goals-table th,
    .calorie-goals-table td {
        border: 1px solid #999 !important;
    }
}
