/* 自定义颜色 */
.bg-yellow {
    background-color: #FFC107;
}

/* 移动端特定样式 */
@media (max-width: 768px) {
    body {
        padding-bottom: 150px;
    }
    
    /* 移动头部样式 */
    .mobile-header {
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }
    
    .header-actions .btn {
        font-size: 1.2rem;
    }
    
    /* 搜索容器样式 */
    .search-container {
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }
    
    /* 选项卡容器样式 */
    .tab-container {
        padding: 0.5rem 0;
    }
    
    .nav-tabs {
        margin-bottom: 0;
    }
    
    .nav-tabs .nav-link {
        font-size: 0.9rem;
        padding: 0.5rem 0;
        color: #666;
    }
    
    .nav-tabs .nav-link.active {
        background-color: transparent;
        color: #FFC107;
        border-bottom: 2px solid #FFC107;
        font-weight: bold;
    }
    
    /* 原材料列表样式 */
.material-list {
    padding: 0.5rem;
}

/* 原材料列表表头 */
.material-header {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: nowrap !important;
    padding: 1rem;
    background-color: #f8f9fa;
    border: none;
    border-radius: 12px 12px 0 0;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 0;
    width: 100%;
    box-sizing: border-box;
    /* 强制覆盖任何可能的垂直布局 */
    position: relative;
    height: auto !important;
    min-height: 60px;
}

/* 确保表头在任何情况下都保持水平排列 */
.material-header > div {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
}

/* 重置任何可能影响表头布局的样式 */
.material-list .material-header {
    float: none !important;
    clear: both !important;
    width: 100% !important;
    text-align: left !important;
    margin-right: 0 !important;
    margin-left: 0 !important;

.material-header-info {
    flex: 1;
}

.material-header-quantity {
    width: 70px;
    text-align: center;
}

.material-header-actions {
    width: 60px;
    text-align: right;
}

.material-header h5 {
    font-size: 0.95rem;
    margin: 0;
    color: #495057;
    font-weight: 600;
}

.material-header p {
    font-size: 0.75rem;
    margin: 0;
    color: #adb5bd;
}

/* 原材料列表项 */
.material-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: white;
    border: none;
    margin-bottom: 0;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border-radius: 0;
}

/* 第一个材料项 */
.material-header + .material-item {
    border-top: none;
    border-radius: 0;
}

/* 最后一个材料项 */
.material-item:last-child {
    border-radius: 0 0 12px 12px;
    margin-bottom: 1rem;
}

/* 仅有一个材料项 */
.material-header + .material-item:only-child {
    border-radius: 0 0 12px 12px;
}

/* 没有表头的情况 */
.material-list > .material-item:first-child:not(.material-header + .material-item) {
    border-radius: 12px 12px 0 0;
}

.material-list > .material-item:last-child:not(.material-header + .material-item + .material-item) {
    border-radius: 0 0 12px 12px;
}

.material-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

.material-item .material-info {
    flex: 1;
}

.material-item .material-info h5 {
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
    color: #343a40;
    font-weight: 500;
}

.material-item .material-info p {
    font-size: 0.85rem;
    color: #e76f51;
    margin-bottom: 0;
    font-weight: 500;
}

/* 数量显示 */
.material-quantity {
    width: 70px;
    text-align: center;
}

.material-quantity .quantity-text {
    display: inline-block;
    min-width: 30px;
    padding: 0.35rem 0.75rem;
    background-color: #ffc107;
    color: white;
    border-radius: 15px;
    font-size: 0.95rem;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
    transition: all 0.3s ease;
}

.material-quantity .quantity-text:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(255, 193, 7, 0.5);
}

/* 操作按钮 */
.material-item .material-actions {
    width: 60px;
    text-align: right;
}

.material-item .material-actions .btn {
    background-color: #ffc107;
    color: #ffffff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 1.1rem;
     border: none;
     box-shadow: 0 2px 6px rgba(255, 193, 7, 0.3);
     transition: all 0.3s ease;
 }
    
    /* 已选原材料样式 */
    .selected-materials-container {
        background-color: #f8f9fa;
        border-radius: 0.5rem;
        margin: 0.5rem;
    }
    
    .selected-materials-container h4 {
        font-size: 1rem;
        margin-bottom: 0.5rem;
        color: #666;
    }
    
    .selected-list {
        max-height: 200px;
        overflow-y: auto;
    }
    
    .selected-material {
        background-color: white;
        border: 1px solid rgba(0, 0, 0, 0.05);
        margin-bottom: 0.5rem;
        padding: 0.5rem;
        font-size: 0.9rem;
    }
    
    .selected-material h5 {
        font-size: 0.9rem;
    }
    
    .selected-material p {
        font-size: 0.8rem;
    }
    
    /* 总计样式 */
.total-section {
    background-color: white;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.75rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    margin: 1rem 0;
}

/* 调整总计行按钮的布局 */
.total-section .row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.total-section .col-auto {
    flex: 0 0 auto;
}

/* 已选原材料按钮样式 */
.total-section .btn-outline-warning {
    margin: 0 10px;
}

.sticky-bottom {
    position: fixed;
    bottom: calc(80px + env(safe-area-inset-bottom));
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    margin: 0;
    border-radius: 0;
    border-top: 1px solid #e0e0e0;
}

/* 固定顶部样式 */
.fixed-top-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 调整内容区域的顶部内边距，避免被固定顶部遮挡 */
.tab-content,
.selected-materials-container {
    margin-top: 180px; /* 根据固定顶部区域的总高度调整 */
}
    
    .fixed-bottom .btn-warning {
        background-color: #FFC107;
        color: #333;
        border-radius: 25px;
        padding: 0.5rem 1.5rem;
        font-weight: bold;
    }
    
    /* 确保按钮样式覆盖 */
    .btn-transparent {
        background-color: transparent;
        border: none;
    }
    
    .btn-transparent:hover {
        background-color: rgba(0, 0, 0, 0.1);
    }
}

/* 基本样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* 加载状态样式 */
.spinner-border {
    color: #ffc107;
}

/* 错误提示样式 */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.alert-danger {
    background-color: #fee2e2;
    color: #dc2626;
}

.alert-success {
    background-color: #dcfce7;
    color: #166534;
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
}

/* 原材料列表项样式 */
.material-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.material-item:hover {
    background-color: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.material-info h5 {
    margin-bottom: 0.25rem;
    font-size: 1.1rem;
}

.material-info p {
    margin-bottom: 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.material-actions {
    display: flex;
    align-items: center;
}

/* 搜索框样式 */
.input-group {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    overflow: hidden;
}

/* 选项卡样式 */
.nav-tabs {
    border-bottom: none;
    display: flex;
    justify-content: space-around;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    overflow: hidden;
}

.nav-tabs .nav-link {
    border: none;
    border-radius: 0;
    flex: 1;
    text-align: center;
    color: #6c757d;
    transition: all 0.2s;
}

.nav-tabs .nav-link.active {
    background-color: #FFC107;
    color: white;
    font-weight: bold;
}

/* 已选原材料样式 */
.selected-material {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background-color: #e7f3ff;
    border: 1px solid #b3d9ff;
    border-radius: 0.5rem;
}

.selected-material .material-quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* 总计区域固定定位样式 */
.sticky-bottom {
    position: fixed;
    bottom: calc(80px + env(safe-area-inset-bottom));
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    margin: 0;
    border-radius: 0;
    border-top: 1px solid #e0e0e0;
}

/* 配方卡片样式 */
.recipe-card {
    transition: all 0.2s;
    border-radius: 0.5rem;
    overflow: hidden;
}

.recipe-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 详情模态框 */
.modal-content {
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid #eee;
}

.modal-footer {
    border-top: 1px solid #eee;
}

/* 按钮样式 */
.btn {
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    border: none;
}

.btn-primary {
    background-color: #ffc107;
    color: #333;
}

.btn-primary:hover {
    background-color: #ffb300;
    color: #333;
}

.btn-primary:disabled {
    background-color: #ffd700;
    opacity: 0.7;
}

.btn-danger {
    background-color: #dc3545;
}

.btn-danger:hover {
    background-color: #bb2d3b;
}

.btn-danger:disabled {
    background-color: #dc3545;
    opacity: 0.7;
}

.btn-outline-primary {
    color: #ffc107;
    border: 1px solid #ffc107;
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: #ffc107;
    color: #333;
}

.btn-outline-secondary {
    color: #6c757d;
    border: 1px solid #6c757d;
    background-color: transparent;
}

.btn-outline-secondary:hover {
    background-color: #6c757d;
    color: white;
}

/* 底部导航栏样式 */
footer.fixed-bottom {
    height: calc(80px + env(safe-area-inset-bottom));
    z-index: 999;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    padding: 0;
    /* 确保在移动设备上完整显示 */
    padding-bottom: env(safe-area-inset-bottom);
    margin: 0;
}

footer.fixed-bottom .container {
    height: 100%;
    padding: 0;
    margin: 0;
    width: 100%;
}

footer.fixed-bottom .row {
    height: 100%;
    margin: 0;
    display: flex;
    align-items: center;
}

footer.fixed-bottom .col-4 {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

/* 底部导航链接样式 */
footer.fixed-bottom .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 80px;
    padding: 0.5rem;
    color: #6c757d;
    transition: color 0.3s ease;
    text-decoration: none;
    box-sizing: border-box;
}

footer.fixed-bottom .nav-link:hover,
footer.fixed-bottom .nav-link.active {
    color: #FFC107;
}

footer.fixed-bottom .nav-link i {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
    display: block;
}

footer.fixed-bottom .nav-link p {
    font-size: 0.75rem;
    margin: 0;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    display: block;
}

/* 确保body有足够的底部内边距，避免内容被固定元素遮挡 */
body {
    padding-bottom: 160px;
}

/* 确保模态框内容全部显示，没有滚动条 */
#materialQuantityModal .modal-body {
    overflow: hidden;
    max-height: calc(100vh - 100px);
}

#materialQuantityModal .modal-content {
    max-height: calc(100vh - 50px);
    overflow: hidden;
}

/* 原材料用量输入对话框样式 */
.digital-keyboard {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 15px;
    max-height: calc(100vh - 200px); /* 确保键盘不会超出屏幕高度 */
}

.key-btn {
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.key-btn:hover {
    background-color: #f8f9fa;
}

.key-btn:active {
    transform: scale(0.95);
}

.clear-btn {
    background-color: #ffebee;
    color: #f44336;
    border-color: #ffcdd2;
}

.clear-btn:hover {
    background-color: #ffcdd2;
}

/* 输入框样式 */
#quantityInput {
    font-weight: 500;
    background-color: #f8f9fa;
}

/* 对话框按钮样式 */
#confirmQuantityBtn {
    border-radius: 8px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    body {
        padding-bottom: calc(160px + env(safe-area-inset-bottom));
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* 材料项在移动端垂直排列 */
    .material-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    /* 确保表头始终水平排列 */
    .material-header {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
    }
    
    .material-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    /* 移动端数字键盘调整 */
    .digital-keyboard {
        gap: 8px;
    }
    
    .key-btn {
        padding: 12px;
        font-size: 1.1rem;
    }
}
