* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', sans-serif;
}

/* 整体背景优化 */
body {
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

/* 菜单标题样式 */
.menu-header {
    text-align: center;
    margin-bottom: 30px;
}

#menu-title {
    font-size: 2.5rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    outline: none;
}

.menu-divider {
    height: 2px;
    background: linear-gradient(to right, rgba(212, 175, 55, 0.1), rgba(212, 175, 55, 1) 30%, rgba(212, 175, 55, 1) 70%, rgba(212, 175, 55, 0.1));
    width: 100%;
    margin: 0 auto;
}

/* 移除装饰元素相关样式 */
.menu-decoration {
    display: none; /* 隐藏装饰元素 */
}

/* 菜单内容 */
.menu-content {
    padding: 20px 0;
}

.menu-section {
    margin-bottom: 30px;
}

.menu-section h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #333;
    outline: none;
    /* 移除之前可能存在的边框样式 */
    border-bottom: none;
    display: block;
}

/* 修改菜单容器样式 */
.menu-container {
    background-color: #fff;
    /* 确保背景图片正确显示 */
    background-size: cover;
    background-position: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    width: 600px;
    max-width: 600px;
    padding: 40px;
    margin: 0 auto;
    position: relative;
    /* 固定高度，确保海报大小一致 */
    min-height: 800px;
}

/* 菜品卡片样式优化 - 固定大小 */
.dish-card {
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    margin: 0 auto;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #f0f0f0;
    width: 100%; /* 确保卡片占满整个网格单元 */
    /* 固定卡片高度 */
    height: 360px; /* 进一步增加卡片整体高度 */
    display: flex;
    flex-direction: column;
}

.dish-image {
    height: 250px; /* 进一步增加图片容器高度，使图片更接近正方形 */
    overflow: hidden;
    position: relative;
    flex-shrink: 0; /* 防止图片区域被压缩 */
}

.dish-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 确保图片覆盖整个容器并保持比例 */

}

/* 菜品信息样式 - 固定大小 */
.dish-info {
    padding: 15px;
    text-align: center;
    background-color: #fff;
    border-top: 1px solid #f5f5f5;
    flex-grow: 1; /* 让信息区域填充剩余空间 */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.dish-info h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: #333;
    outline: none;
    font-weight: 600;
    /* 限制文本行数 */
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.dish-info p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 8px;
    outline: none;
    line-height: 1.5;
    /* 限制文本行数 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

/* 添加一个半透明的覆盖层，使内容更易读 */
.menu-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.85); /* 白色半透明背景 */
    z-index: 0;
    border-radius: 8px;
}

/* 确保内容在覆盖层之上 */
.menu-header, .menu-content {
    position: relative;
    z-index: 1;
}

/* 修改菜品容器样式 */
.dishes-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 固定两列布局 */
    gap: 20px; /* 增加间距 */
    width: 100%;
    margin: 0 auto;
}

/* 以下是正确的菜品卡片样式，保留这部分 */
/* 菜品卡片样式优化 - 固定大小 */
.dish-card {
    background-color: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.08);
    margin: 0 auto;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #f0f0f0;
    width: 100%; /* 确保卡片占满整个网格单元 */
    /* 固定卡片高度 */
    height: 350px; /* 再次增加卡片整体高度 */
    display: flex;
    flex-direction: column;
}

.dish-image {
    height: 240px; /* 再次增加图片容器高度，使图片更接近正方形 */
    overflow: hidden;
    position: relative;
    flex-shrink: 0; /* 防止图片区域被压缩 */
}

.dish-image img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 确保图片覆盖整个容器并保持比例 */
}

/* 恢复价格原始样式 */
.price {
    font-weight: bold;
    color: #e67e22;
    font-size: 1.1rem;
    outline: none;
    /* 移除特殊样式 */
    /* display: inline-block; */
    /* padding: 5px 15px; */
    /* background-color: #fff8e1; */
    /* border-radius: 20px; */
}

/* 打印样式 */
@media print {
    .control-panel {
        display: none;
    }
    
    .menu-container {
        box-shadow: none;
        padding: 0;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .control-panel {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .menu-container {
        padding: 20px;
    }
    
    #menu-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 480px) {
    .dishes-container {
        grid-template-columns: 1fr;
    }
}

/* 控制面板美化 */
.control-panel {
    background-color: #fff;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    border: 1px solid #f0f0f0;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* 美化下拉菜单 */
select {
    padding: 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background-color: #fff;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24'%3E%3Cpath fill='%23333' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

select:hover, select:focus {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
    outline: none;
}

/* 美化按钮 */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
}

.btn::before {
    font-family: "Font Awesome 5 Free", sans-serif;
    font-weight: 900;
    font-size: 16px;
}

.btn-primary {
    background-color: #3498db;
    color: #fff;
    box-shadow: 0 2px 5px rgba(52, 152, 219, 0.3);
}

.btn-primary::before {
    content: "\f093"; /* 上传图标 */
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.4);
}

.btn-success {
    background-color: #27ae60;
    color: #fff;
    box-shadow: 0 2px 5px rgba(39, 174, 96, 0.3);
}

.btn-success::before {
    content: "\f019"; /* 下载图标 */
}

.btn-success:hover {
    background-color: #219653;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.4);
}

/* 标签美化 */
label {
    font-weight: 500;
    color: #555;
    font-size: 14px;
}


/* 加载提示样式 */
.loading-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 16px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
}

.loading-message i {
    font-size: 20px;
}

/* Logo上传按钮样式 */
.btn-warning {
    background-color: #f39c12;
    color: #fff;
    box-shadow: 0 2px 5px rgba(243, 156, 18, 0.3);
}

.btn-warning::before {
    content: "\f1c5"; /* 图片文件图标 */
}

.btn-warning:hover {
    background-color: #e67e22;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(243, 156, 18, 0.4);
}

.menu-footer {
    text-align: center;
    margin-top: 30px;
    position: relative;
    z-index: 1;
}

.menu-footer img {
    max-width: 180px;
    height: auto;
}

.footer-divider {
    height: 1px;
    width: 80%;
    margin: 0 auto;
}