/* 食物卡路里工具专用样式 */

/* ============================================
   搜索功能区
   ============================================ */
.search-section {
    margin-bottom: 30px;
}

.search-box {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.search-btn {
    padding: 12px 32px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.search-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.search-tags .tag {
    padding: 8px 18px;
    background: #f5f5f5;
    border: 2px solid transparent;
    border-radius: 20px;
    font-size: 14px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-tags .tag:hover {
    background: #e8f4ff;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.search-tags .tag.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ============================================
   食物选择区
   ============================================ */
.food-selection {
    background: #f8f9fa;
    padding: 24px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.food-input-group {
    display: flex;
    gap: 16px;
    align-items: flex-end;
}

.food-input {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.food-input label {
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.food-input .form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.food-input .form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.btn {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.btn-outline {
    background: transparent;
    color: #666;
    border: 2px solid #e0e0e0;
}

.btn-outline:hover {
    border-color: #ff4444;
    color: #ff4444;
    background: #fff5f5;
}

.btn-secondary {
    background: #28a745;
    color: white;
}

.btn-secondary:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* ============================================
   今日摄入统计区
   ============================================ */
.daily-intake {
    margin-bottom: 30px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
}

.intake-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    transition: all 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.summary-card:nth-child(2) {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.summary-card:nth-child(3) {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.summary-icon {
    font-size: 32px;
    opacity: 0.9;
}

.summary-content {
    flex: 1;
}

.summary-content h4 {
    font-size: 14px;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 8px;
}

.summary-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.summary-unit {
    font-size: 12px;
    opacity: 0.8;
}

/* ============================================
   食物列表区
   ============================================ */
.food-list-section {
    margin-bottom: 30px;
}

.food-list {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    min-height: 200px;
    margin-bottom: 16px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 15px;
    margin: 0;
}

.food-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.food-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateX(4px);
}

.food-item:last-child {
    margin-bottom: 0;
}

.food-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 16px;
}

.food-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    min-width: 120px;
}

.food-details {
    display: flex;
    gap: 24px;
    color: #666;
    font-size: 14px;
}

.food-weight,
.food-calories {
    display: flex;
    align-items: center;
    gap: 4px;
}

.food-actions {
    display: flex;
    gap: 8px;
}

.delete-btn {
    padding: 6px 16px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background: #cc0000;
    transform: scale(1.05);
}

.list-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ============================================
   常见食物区
   ============================================ */
.common-foods {
    margin-bottom: 30px;
}

.food-categories {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 24px;
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    padding: 10px 24px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #e8f4ff;
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.food-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.food-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.food-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 6px 16px rgba(74, 144, 226, 0.15);
    transform: translateY(-4px);
}

.food-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.food-card-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.food-card-calories {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
}

.food-card-unit {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
}

.food-card-description {
    font-size: 13px;
    color: #666;
    line-height: 1.6;
}

/* ============================================
   响应式设计
   ============================================ */
@media (max-width: 768px) {
    .search-box {
        flex-direction: column;
    }

    .search-btn {
        width: 100%;
    }

    .food-input-group {
        flex-direction: column;
    }

    .food-input {
        width: 100%;
    }

    .btn {
        width: 100%;
    }

    .intake-summary {
        grid-template-columns: 1fr;
    }

    .food-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .food-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .food-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .list-actions {
        flex-direction: column;
    }

    .category-tabs {
        justify-content: center;
    }

    .food-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .section-title {
        font-size: 18px;
    }

    .summary-card {
        padding: 20px;
    }

    .summary-icon {
        font-size: 28px;
    }

    .summary-value {
        font-size: 28px;
    }

    .food-list {
        padding: 16px;
    }

    .food-categories {
        padding: 16px;
    }

    .tab-btn {
        padding: 8px 16px;
        font-size: 13px;
    }
}
