/* 全局样式重置与基础设置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft Yahei", sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
}

/* 导航栏样式 */
.navbar {
    background-color: #2c3e50;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.navbar .logo {
    color: white;
    font-size: 24px;
    font-weight: bold;
}

.navbar .nav-links {
    display: flex;
    gap: 20px;
}

.navbar .nav-links a {
    color: white;
    text-decoration: none;
    font-size: 16px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.navbar .nav-links a:hover {
    background-color: #34495e;
}

.navbar .nav-links a.active {
    background-color: #1abc9c;
}

/* 页面容器（用于切换不同页面） */
.page-container {
    width: 90%;
    max-width: 1200px;
    margin: 30px auto;
    min-height: 80vh;
}

/* 隐藏所有页面的默认样式 */
.page {
    display: none;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 首页样式 */
.home-page {
    display: block;
}

.canteen-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 20px;
}

.canteen-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.3s;
}

.canteen-card:hover {
    transform: translateY(-5px);
}

.canteen-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.canteen-info {
    padding: 15px;
}

.canteen-info h3 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.canteen-info p {
    color: #7f8c8d;
    line-height: 1.6;
}

/* 食堂详情页样式 */
.canteen-detail-page .back-btn {
    display: inline-block;
    padding: 8px 16px;
    background-color: #1abc9c;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    margin-bottom: 20px;
}

.window-list {
    margin-top: 20px;
}

.window-item {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.window-item h3 {
    font-size: 22px;
    margin-bottom: 15px;
    color: #2c3e50;
    padding-bottom: 10px;
    border-bottom: 2px solid #f5f5f5;
}

.dish-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.dish-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.3s;
}

.dish-card:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.dish-img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}

.dish-info {
    padding: 10px;
}

.dish-info h4 {
    font-size: 16px;
    margin-bottom: 8px;
    color: #333;
}

.dish-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.dish-actions button {
    background-color: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #7f8c8d;
    transition: color 0.3s;
}

.dish-actions button.like-btn.active {
    color: #e74c3c;
}

.dish-actions button.dislike-btn.active {
    color: #3498db;
}

.dish-actions button i {
    font-size: 16px;
}

/* 登录/注册页样式 */
.login-page, .register-page {
    max-width: 500px;
    margin: 50px auto;
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.form-title {
    text-align: center;
    font-size: 26px;
    margin-bottom: 30px;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #7f8c8d;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    border-color: #1abc9c;
    box-shadow: 0 0 0 2px rgba(26, 188, 156, 0.2);
}

.submit-btn {
    width: 100%;
    padding: 12px;
    background-color: #1abc9c;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.submit-btn:hover {
    background-color: #16a085;
}

.form-switch {
    text-align: center;
    margin-top: 20px;
    color: #7f8c8d;
}

.form-switch a {
    color: #1abc9c;
    text-decoration: none;
}

.form-switch a:hover {
    text-decoration: underline;
}

/* 我的喜欢页面样式 */
.favorite-page .empty-tip {
    text-align: center;
    color: #7f8c8d;
    font-size: 18px;
    margin-top: 50px;
}

/* 提示框样式 */
.tip-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 15px 25px;
    background-color: rgba(0,0,0,0.7);
    color: white;
    border-radius: 6px;
    display: none;
    z-index: 9999;
}