/* 宁夏大学食堂菜品展示系统样式文件 */
/* 该文件定义了网站的所有样式，包括布局、颜色、字体、动画等 */
/* 主要内容包括：
   1. 全局样式和背景效果
   2. 容器和页面布局
   3. 表单元素样式
   4. 按钮和交互元素样式
   5. 列表和卡片布局
   6. 导航栏样式
   7. 响应式设计和动画效果
*/

/* 全局样式 */
/* 设置页面基础字体、边距、背景色和渐变效果 */
body {
    font-family: 'Arial', sans-serif;  /* 全局字体设置 */
    margin: 0;  /* 清除默认边距 */
    padding: 0;  /* 清除默认内边距 */
    background-color: #fff8f0;  /* 温暖的米黄色背景 */
    background-image: linear-gradient(135deg, #fff8f0 0%, #ffe6d5 100%);  /* 温暖的渐变背景效果 */
    min-height: 100vh;  /* 确保页面至少占满整个视口高度 */
    color: #333;  /* 基础文字颜色 */
}
/* 页面容器样式 */
/* 设置主要内容区域的布局、宽度、背景和阴影效果 */
.container {
    max-width: 1000px;  /* 容器最大宽度 */
    margin: 30px auto;  /* 上下外边距30px，左右居中 */
    padding: 30px;  /* 内边距30px */
    background-color: white;  /* 容器背景色 */
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);  /* 容器阴影效果 */
    border-radius: 15px;  /* 容器圆角 */
    background: rgba(255, 255, 255, 0.95);  /* 半透明背景 */
    backdrop-filter: blur(5px);  /* 毛玻璃效果 */
}
/* 标题样式 */
/* 设置所有标题的颜色和对齐方式 */
h1, h2, h3 {
    color: #d8310d;  /* 温暖的红色标题颜色 */
    text-align: center;  /* 标题居中对齐 */
}

/* 表单基础样式 */
/* 设置表单组、标签和输入框的基础样式 */
.form-group {
    margin-bottom: 15px;  /* 表单组之间的下边距 */
}

label {
    display: block;  /* 标签块级显示 */
    margin-bottom: 5px;  /* 标签与输入框之间的间距 */
    font-weight: bold;  /* 标签粗体显示 */
}

input[type="text"], input[type="password"], select {
    width: 100%;  /* 输入框宽度占满父容器 */
    padding: 10px;  /* 输入框内边距 */
    border: 1px solid #ddd;  /* 输入框边框 */
    border-radius: 4px;  /* 输入框圆角 */
    box-sizing: border-box;  /* 确保内边距和边框不影响总宽度 */
}

/* 按钮基础样式 */
/* 设置所有按钮的基础样式、颜色、大小和交互效果 */
button {
    background-color: #ff7043;  /* 温暖的橙色按钮 */
    color: white;  /* 按钮文字颜色 */
    padding: 12px 20px;  /* 按钮内边距 */
    border: none;  /* 无边框 */
    border-radius: 25px;  /* 按钮圆角 */
    cursor: pointer;  /* 鼠标悬停时显示指针 */
    margin-right: 15px;  /* 按钮之间的右边距 */
    margin-top: 15px;  /* 按钮上边距 */
    font-size: 14px;  /* 按钮文字大小 */
    font-weight: bold;  /* 按钮文字粗体 */
    transition: all 0.3s ease;  /* 按钮过渡动画效果 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);  /* 按钮阴影效果 */
}

/* 按钮悬停效果 */
button:hover {
    background-color: #e64a19;  /* 悬停时背景色加深 */
    transform: translateY(-2px);  /* 悬停时向上微移 */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);  /* 悬停时阴影加深扩大 */
}

/* 按钮点击效果 */
button:active {
    transform: translateY(0);  /* 点击时恢复原位 */
}

/* 返回按钮样式 */
/* 设置返回按钮的特殊颜色 */
.btn-back {
    background-color: #f44336;  /* 返回按钮背景色（红色） */
}

.btn-back:hover {
    background-color: #da190b;  /* 返回按钮悬停时背景色加深 */
}

/* 喜欢按钮样式 */
/* 设置喜欢按钮的特殊样式和大小 */
.btn-favorite {
    background-color: #ffb74d;  /* 温暖的黄色按钮 */
    border-radius: 20px;  /* 喜欢按钮圆角 */
    padding: 8px 16px;  /* 喜欢按钮内边距（更小） */
    font-size: 12px;  /* 喜欢按钮文字大小（更小） */
}

.btn-favorite:hover {
    background-color: #e68900;  /* 喜欢按钮悬停时背景色加深 */
}

/* 表单样式优化 */
/* 增强表单元素的视觉效果和用户体验 */
.form-group {
    margin-bottom: 20px;  /* 表单组之间的下边距 */
}

label {
    display: block;  /* 标签块级显示 */
    margin-bottom: 8px;  /* 标签与输入框之间的间距 */
    font-weight: bold;  /* 标签粗体显示 */
    color: #555;  /* 标签文字颜色 */
    font-size: 14px;  /* 标签文字大小 */
}

input[type="text"], input[type="password"] {
    width: 100%;  /* 输入框宽度占满父容器 */
    padding: 12px;  /* 输入框内边距 */
    border: 2px solid #e0e0e0;  /* 输入框边框 */
    border-radius: 10px;  /* 输入框圆角 */
    box-sizing: border-box;  /* 确保内边距和边框不影响总宽度 */
    font-size: 14px;  /* 输入框文字大小 */
    transition: border-color 0.3s ease;  /* 边框颜色过渡效果 */
}

/* 输入框获取焦点时的样式 */
input[type="text"]:focus, input[type="password"]:focus {
    outline: none;  /* 移除默认焦点轮廓 */
    border-color: #ff9800;  /* 焦点时边框颜色变为橙色 */
    box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.1);  /* 焦点时的发光效果 */
}

/* 列表样式优化 */
/* 校区列表样式 */
.campus-list {
    list-style-type: none;  /* 移除默认列表符号 */
    padding: 0;  /* 清除默认内边距 */
    display: grid;  /* 使用网格布局 */
    grid-template-columns: repeat(2, 1fr);  /* 每行显示2个校区 */
    gap: 25px;  /* 校区之间的间距 */
}

.campus-list li {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);  /* 橙色渐变背景 */
    padding: 30px;  /* 内边距 */
    border-radius: 15px;  /* 圆角 */
    cursor: pointer;  /* 鼠标悬停时显示指针 */
    transition: all 0.3s ease;  /* 过渡动画效果 */
    text-align: center;  /* 文字居中 */
    font-size: 20px;  /* 文字大小 */
    font-weight: bold;  /* 文字粗体 */
    color: white;  /* 文字颜色 */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);  /* 阴影效果 */
    border: 3px solid transparent;  /* 透明边框 */
}

.campus-list li:hover {
    background: linear-gradient(135deg, #f57c00 0%, #ff9800 100%);  /* 悬停时渐变反转 */
    transform: translateY(-5px);  /* 悬停时向上微移 */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);  /* 悬停时阴影加深扩大 */
    border-color: rgba(255, 255, 255, 0.5);  /* 悬停时显示白色边框 */
}

/* 食堂列表样式 */
.canteen-list {
    list-style-type: none;  /* 移除默认列表符号 */
    padding: 0;  /* 清除默认内边距 */
    display: grid;  /* 使用网格布局 */
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));  /* 响应式网格，每列最小350px */
    gap: 30px;  /* 食堂之间的间距 */
}

.canteen-list li {
    background-color: #fff3e0;  /* 温暖的浅橙色背景 */
    padding: 20px;  /* 内边距 */
    border-radius: 15px;  /* 圆角 */
    cursor: pointer;  /* 鼠标悬停时显示指针 */
    transition: all 0.3s ease;  /* 过渡动画效果 */
    text-align: center;  /* 文字居中 */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);  /* 阴影效果 */
    border: 2px solid transparent;  /* 透明边框 */
}

.canteen-list li:hover {
    background-color: #ffe0b2;  /* 悬停时背景色加深 */
    transform: translateY(-5px);  /* 悬停时向上微移 */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);  /* 悬停时阴影加深扩大 */
    border-color: #ff9800;  /* 悬停时显示橙色边框 */
}

/* 菜品卡片样式 */
.dish {
    background: linear-gradient(135deg, #ffe0b2 0%, #ffcc80 100%);  /* 温暖的橙色渐变背景 */
    padding: 15px;  /* 内边距 */
    border-left: 4px solid #ff9800;  /* 左侧橙色边框 */
    border-radius: 10px;  /* 圆角 */
    text-align: center;  /* 文字居中 */
    transition: all 0.3s ease;  /* 过渡动画效果 */
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);  /* 阴影效果 */
}

.dish:hover {
    transform: translateY(-2px);  /* 悬停时向上微移 */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);  /* 悬停时阴影加深扩大 */
}

/* 喜欢菜品卡片样式 */
.favorite-item {
    background-color: white;  /* 白色背景 */
    padding: 20px;  /* 内边距 */
    border-radius: 15px;  /* 圆角 */
    text-align: center;  /* 文字居中 */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);  /* 阴影效果 */
    transition: all 0.3s ease;  /* 过渡动画效果 */
    border: 2px solid transparent;  /* 透明边框 */
}

.favorite-item:hover {
    transform: translateY(-5px);  /* 悬停时向上微移 */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);  /* 悬停时阴影加深扩大 */
    border-color: #ff9800;  /* 悬停时显示橙色边框 */
}
/* 隐藏元素样式 */
/* 用于隐藏页面元素的类 */
.hidden {
    display: none;  /* 设置元素不可见 */
}

/* 旧的校区列表样式（可能已被优化样式替代） */
/* .campus-list {
    list-style-type: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.campus-list li {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
}

.campus-list li:hover {
    background-color: #e9e9e9;
} */

/* 旧的食堂列表样式（可能已被优化样式替代） */
/* .canteen-list {
    list-style-type: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.canteen-list li {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
    text-align: center;
}

.canteen-list li:hover {
    background-color: #e9e9e9;
} */

/* 食堂图片样式 */
/* 设置食堂图片的尺寸和外观 */
.canteen-photo {
    width: 350px;  /* 图片宽度 */
    height: 300px;  /* 图片高度 */
    object-fit: cover;  /* 图片缩放方式，保持比例并覆盖容器 */
    border-radius: 4px;  /* 图片圆角 */
    margin-bottom: 10px;  /* 图片下边距 */
}

/* 食堂名称样式 */
/* 设置食堂名称的字体大小、粗细和边距 */
.canteen-name {
    font-size: 18px;  /* 字体大小 */
    font-weight: bold;  /* 字体粗细 */
    margin-bottom: 10px;  /* 下边距 */
}

/* 食堂描述样式 */
/* 设置食堂描述的字体大小、颜色和对齐方式 */
.canteen-description {
    font-size: 16px;  /* 字体大小 */
    color: #666;  /* 字体颜色 */
    margin-top: 10px;  /* 上边距 */
    text-align: center;  /* 文本居中 */
    font-weight: bold;  /* 字体粗细 */
}

/* 窗口列表样式 */
/* 设置窗口列表的基础样式 */
.window-list {
    list-style-type: none;  /* 移除默认列表符号 */
    padding: 0;  /* 清除默认内边距 */
}

.window-list li {
    background-color: #fff3e0;  /* 温暖的橙色背景 */
    padding: 15px;  /* 内边距 */
    margin-bottom: 10px;  /* 下边距 */
    border-radius: 4px;  /* 圆角 */
    transition: background-color 0.3s;  /* 背景色过渡效果 */
}

.window-list li:hover {
    background-color: #ffe0b2;  /* 悬停时背景色加深 */
}

/* 菜品列表样式 */
/* 设置菜品列表的网格布局 */
.dish-list {
    list-style-type: none;  /* 移除默认列表符号 */
    padding: 0;  /* 清除默认内边距 */
    display: grid;  /* 使用网格布局 */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));  /* 响应式网格，每列最小300px */
    gap: 20px;  /* 菜品之间的间距 */
}

/* 菜品卡片基础样式 */
/* 设置菜品卡片的背景色、边框和对齐方式 */
.dish {
    background-color: #fff3cd;  /* 背景色 */
    padding: 10px;  /* 内边距 */
    border-left: 4px solid #ffc107;  /* 左侧边框 */
    border-radius: 4px;  /* 圆角 */
    text-align: center;  /* 文本居中 */
}

/* 菜品图片样式 */
/* 设置菜品图片的尺寸和外观 */
.dish-photo {
    width: 300px;  /* 图片宽度 */
    height: 250px;  /* 图片高度 */
    object-fit: cover;  /* 图片缩放方式 */
    border-radius: 4px;  /* 图片圆角 */
    margin-bottom: 10px;  /* 图片下边距 */
}

/* 菜品名称样式 */
/* 设置菜品名称的字体大小、粗细和边距 */
.dish-name {
    font-size: 16px;  /* 字体大小 */
    font-weight: bold;  /* 字体粗细 */
    margin-bottom: 10px;  /* 下边距 */
}

/* 喜欢菜品容器样式 */
/* 设置喜欢菜品区域的背景色和边距 */
.favorite-dishes {
    margin-top: 20px;  /* 上边距 */
    padding: 15px;  /* 内边距 */
    background-color: #fff3e0;  /* 温暖的橙色背景 */
    border-radius: 4px;  /* 圆角 */
}

/* 喜欢菜品标题样式 */
/* 设置喜欢菜品标题的边距和对齐方式 */
.favorite-dishes h3 {
    margin-top: 0;  /* 清除上边距 */
    margin-bottom: 20px;  /* 下边距 */
    text-align: center;  /* 文本居中 */
}

/* 喜欢菜品列表样式 */
/* 设置喜欢菜品列表的网格布局 */
.favorite-list {
    list-style-type: none;  /* 移除默认列表符号 */
    padding: 0;  /* 清除默认内边距 */
    display: grid;  /* 使用网格布局 */
    grid-template-columns: repeat(3, 1fr);  /* 三列布局 */
    gap: 20px;  /* 菜品之间的间距 */
}

/* 喜欢菜品卡片样式 */
/* 设置喜欢菜品卡片的背景色、边框和阴影 */
.favorite-item {
    background-color: white;  /* 背景色 */
    padding: 15px;  /* 内边距 */
    border-radius: 4px;  /* 圆角 */
    text-align: center;  /* 文本居中 */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);  /* 阴影效果 */
    border: 2px solid #ffe0b2;  /* 温暖的橙色边框 */
}

/* 喜欢菜品图片样式 */
/* 设置喜欢菜品图片的尺寸、边距和显示方式 */
.favorite-item .dish-photo {
    width: 250px;  /* 图片宽度 */
    height: 220px;  /* 图片高度 */
    object-fit: cover;  /* 图片缩放方式 */
    border-radius: 4px;  /* 图片圆角 */
    margin: 0 auto 15px auto;  /* 上下外边距和左右居中 */
    display: block;  /* 块级显示 */
}

/* 喜欢菜品文本样式 */
/* 设置喜欢菜品文本的边距和对齐方式 */
.favorite-item p {
    margin: 5px 0;  /* 上下外边距 */
    text-align: left;  /* 文本左对齐 */
}

/* 喜欢菜品强调文本样式 */
/* 设置喜欢菜品中强调文本的颜色 */
.favorite-item strong {
    color: #333;  /* 强调文本颜色 */
}

/* 旧的导航按钮样式 */
/* 设置页面内导航按钮的边距和对齐方式 */
.nav-btn {
    margin-bottom: 20px;  /* 下边距 */
    text-align: center;  /* 文本居中 */
}

/* 导航栏样式 */
/* 全局导航栏容器样式 */
#main-nav {
    background-color: #d8310d;  /* 红色背景 */
    color: white;  /* 文字颜色 */
    padding: 10px 0;  /* 上下内边距调整，导航栏高度更适宜 */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);  /* 阴影效果 */
    position: sticky;  /* 粘性定位，滚动时固定在顶部 */
    top: 0;  /* 固定位置 */
    z-index: 1000;  /* 层级设置，确保在最上层 */
    min-height: 60px;
    display: flex;
    align-items: center;
}

/* 导航栏logo样式 */
.nav-logo {
    display: flex;
    align-items: center;
    margin-right: 20px;
}

.nav-logo img {
    height: 50px;
    width: auto;
}

/* 导航栏内容容器样式 */
.nav-content {
    max-width: 1000px;  /* 最大宽度 */
    margin: 0 auto;  /* 水平居中 */
    padding: 0 20px;  /* 左右内边距 */
    display: flex;  /* 使用弹性布局 */
    align-items: center;  /* 垂直居中 */
    gap: 20px;
}

/* 导航栏标题样式 */
.nav-title {
    font-size: 24px;  /* 字体大小 */
    font-weight: bold;  /* 字体粗细 */
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);  /* 文字阴影效果 */
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: auto;
}

/* 校区选择图标样式 */
.campus-icon {
    font-size: 28px;
    cursor: pointer;
    transition: transform 0.3s ease;
    display: inline-block;
    padding: 5px 10px;
    border-radius: 50%;
}

/* 校区下拉菜单样式 */
.campus-dropdown {
    position: relative;
    display: inline-block;
}

.campus-dropdown .dropdown-content {
    left: 50%;
    transform: translateX(-50%);
    margin-top: 5px;
    min-width: 120px;
}

.campus-dropdown .dropdown-content a {
    text-align: center;
}

/* 导航栏按钮容器样式 */
.nav-buttons {
    display: flex;  /* 使用弹性布局 */
    gap: 15px;
    align-items: center;
}

/* 下拉菜单容器 */
.dropdown {
    position: relative;
    display: inline-block;
}

/* 下拉按钮样式 */
.dropdown-btn {
    background-color: #ff7043;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
}

/* 下拉按钮悬停效果 */
.dropdown-btn:hover {
    background-color: #e64a19;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* 下拉内容样式 */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #ffffff;
    min-width: 160px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    z-index: 1001;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 0;
    top: calc(100% + 2px);
}

/* 下拉菜单项样式 */
.dropdown-content a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: all 0.3s ease;
    cursor: pointer;
}

/* 下拉菜单项悬停效果 */
.dropdown-content a:hover {
    background-color: #f1f1f1;
    color: #d8310d;
    padding-left: 20px;
}

/* 点击显示下拉菜单（通过JavaScript控制） */
.dropdown.active .dropdown-content {
    display: block;
}

/* 下拉菜单显示时按钮的样式 */
.dropdown.active .dropdown-btn {
    background-color: #e64a19;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* 导航栏普通按钮样式 */
#main-nav button:not(.dropdown-btn) {
    background-color: #ff7043;
    color: white;
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 导航栏普通按钮悬停效果 */
#main-nav button:not(.dropdown-btn):hover {
    background-color: #e64a19;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* 导航栏按钮点击效果 */
#main-nav button:active {
    transform: translateY(0);
}

/* 首页样式 */
.home-hero {
    margin: 30px 0;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.hero-image {
    width: 100%;
    height: auto;
    display: block;
}

.canteen-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 30px;
}

/* 食堂页面样式 */
.canteen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.canteen-item {
    background-color: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.canteen-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.canteen-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.canteen-item p {
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

/* 问题反馈页面样式 */
.feedback-info {
    background-color: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.feedback-info ul {
    list-style-type: none;
    padding: 0;
}

.feedback-info li {
    margin-bottom: 15px;
    font-size: 16px;
}

.feedback-note {
    background-color: #fff3e0;
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    font-style: italic;
    color: #d8310d;
    font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .canteen-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .canteen-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .nav-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-buttons button {
        margin: 5px;
    }
}