/* 主样式文件 - 兼容IE浏览器 */

/* 基础样式 */
* {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "Hiragino Sans GB", "Heiti SC", "WenQuanYi Micro Hei", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #f5f5f5;
}

/* 清除浮动 */
.clearfix:before,
.clearfix:after {
    content: " ";
    display: table;
}

.clearfix:after {
    clear: both;
}

.clearfix {
    *zoom: 1; /* IE6-7 触发hasLayout */
}

/* 容器 */
.container {
    width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 顶部信息栏 */
.top-bar {
    background-color: #1890ff;
    color: #fff;
    height: 32px;
    line-height: 32px;
}

.top-bar .container {
    position: relative;
}

.welcome {
    float: left;
}

.top-links {
    float: right;
}

.top-link {
    cursor: pointer;
    margin-left: 15px;
}

.top-link:hover {
    opacity: 0.8;
    filter: alpha(opacity=80); /* IE8兼容 */
}

/* 页头 */
.header {
    background-color: #fff;
    -webkit-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    -moz-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 12px 0;
    height: 60px;
}

.logo {
    float: left;
    display: inline-block;
    vertical-align: middle;
}

.logo-img {
    height: 40px;
    width: 40px;
    vertical-align: middle;
}

.logo-text {
    display: inline-block;
    vertical-align: middle;
    margin-left: 8px;
    font-size: 20px;
    font-weight: bold;
    color: #1890ff;
}

/* 导航 */
.main-nav {
    float: left;
    margin-left: 48px;
}

.nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    height: 40px;
    line-height: 40px;
}

.nav-item {
    float: left;
    margin-right: 24px;
}

.nav-item a {
    display: block;
    color: #666;
    text-decoration: none;
    font-size: 16px;
    padding: 0 8px;
}

.nav-item a:hover,
.nav-item.active a {
    color: #1890ff;
}

/* 用户操作区 */
.user-actions {
    float: right;
    height: 40px;
    line-height: 40px;
}

.cart-link,
.user-link {
    display: inline-block;
    margin-left: 24px;
    color: #666;
    text-decoration: none;
}

.cart-link:hover,
.user-link:hover {
    color: #1890ff;
}

/* 图标 */
.icon-cart,
.icon-user,
.icon-fire,
.icon-arrow-right {
    display: inline-block;
    width: 16px;
    height: 16px;
    background-repeat: no-repeat;
    background-position: center;
    vertical-align: middle;
    margin-right: 4px;
}

.icon-cart {
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="9" cy="21" r="1"></circle><circle cx="20" cy="21" r="1"></circle><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path></svg>');
}

.icon-user {
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg>');
}

.icon-fire {
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3s.5-2 2.5-3c0 0-1 1-1 2c0 .5 1 1 2 2c1 1 1 2 1 3c0 2.5-2 4.5-4.5 4.5S6 16.5 6 14c0-1 .5-2 2.5-3c0 0 0 1 .5 2s.5 1 .5 1.5"></path></svg>');
}

.icon-arrow-right {
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="5" y1="12" x2="19" y2="12"></line><polyline points="12 5 19 12 12 19"></polyline></svg>');
    margin-left: 4px;
    margin-right: 0;
}

/* 主要内容 */
.main-content {
    padding: 24px 0;
}

/* 轮播图 */
.carousel-container {
    position: relative;
    margin-bottom: 32px;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
}

.carousel {
    position: relative;
    height: 400px;
    width: 100%;
}

.carousel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    filter: alpha(opacity=0); /* IE8兼容 */
    -webkit-transition: opacity 0.6s ease-in-out;
    -moz-transition: opacity 0.6s ease-in-out;
    -ms-transition: opacity 0.6s ease-in-out;
    -o-transition: opacity 0.6s ease-in-out;
    transition: opacity 0.6s ease-in-out;
    z-index: 1;
}

.carousel-item.active {
    opacity: 1;
    filter: alpha(opacity=100); /* IE8兼容 */
    z-index: 2;
}

.carousel-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.carousel-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px;
    background: -webkit-linear-gradient(top, transparent, rgba(0, 0, 0, 0.7));
    background: -moz-linear-gradient(top, transparent, rgba(0, 0, 0, 0.7));
    background: -ms-linear-gradient(top, transparent, rgba(0, 0, 0, 0.7));
    background: -o-linear-gradient(top, transparent, rgba(0, 0, 0, 0.7));
    background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.7));
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#B3000000', GradientType=0); /* IE9兼容 */
}

.carousel-caption h2 {
    color: #fff;
    margin: 0 0 8px;
    font-size: 28px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.carousel-caption p {
    color: #fff;
    margin: 0;
    font-size: 18px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.carousel-controls {
    position: absolute;
    top: 50%;
    width: 100%;
    z-index: 3;
}

.carousel-control {
    position: absolute;
    top: -20px;
    width: 40px;
    height: 40px;
    line-height: 36px;
    text-align: center;
    background-color: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    border-radius: 50%;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.carousel-control.prev {
    left: 16px;
}

.carousel-control.next {
    right: 16px;
}

.carousel-indicators {
    position: absolute;
    bottom: 16px;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 3;
}

.indicator {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin: 0 4px;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    cursor: pointer;
}

.indicator.active {
    background-color: #fff;
}

/* 区块样式 */
.section {
    background-color: #fff;
    border-radius: 8px;
    -webkit-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    -moz-box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 24px;
    margin-bottom: 24px;
}

.section-header {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    margin-bottom: 16px;
}

.section-title {
    font-size: 20px;
    font-weight: bold;
    margin: 0;
    color: #333;
}

.more-link {
    color: #1890ff;
    text-decoration: none;
}

/* 美食分类 */
.category-list {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    margin: 0 -8px;
}

.category-item {
    width: 16.666%;
    padding: 0 8px;
    margin-bottom: 16px;
    text-align: center;
}

.category-item a {
    text-decoration: none;
    color: #333;
    display: block;
}

.category-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
}

.category-item h3 {
    margin: 0;
    font-size: 16px;
    font-weight: normal;
}

/* 热门菜品 */
.food-list {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    margin: 0 -12px;
}

.food-item {
    width: 25%;
    padding: 0 12px;
    margin-bottom: 24px;
}

.food-img {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    height: 180px;
}

.food-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.food-tags {
    position: absolute;
    top: 8px;
    left: 8px;
}

.tag {
    display: inline-block;
    padding: 2px 6px;
    margin-right: 4px;
    border-radius: 4px;
    font-size: 12px;
    color: #fff;
}

.tag-hot {
    background-color: #f5222d;
}

.tag-special {
    background-color: #fa8c16;
}

.tag-signature {
    background-color: #722ed1;
}

.tag-popular {
    background-color: #1890ff;
}

.tag-spicy {
    background-color: #f5222d;
}

.tag-mild {
    background-color: #fa8c16;
}

.tag-sour {
    background-color: #13c2c2;
}

.food-info {
    padding: 12px 0;
}

.food-name {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.food-price {
    margin-bottom: 4px;
}

.price {
    font-size: 16px;
    font-weight: bold;
    color: #f5222d;
}

.old-price {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
    margin-left: 8px;
}

.food-sales {
    font-size: 12px;
    color: #999;
}

/* 推荐商家 */
.merchant-list {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    margin: 0 -12px;
}

.merchant-item {
    width: 33.333%;
    padding: 0 12px;
    margin-bottom: 24px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
}

.merchant-img {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    margin-right: 12px;
    -ms-flex-negative: 0;
    flex-shrink: 0;
}

.merchant-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.merchant-info {
    -webkit-box-flex: 1;
    -ms-flex-positive: 1;
    flex-grow: 1;
}

.merchant-name {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: bold;
}

.merchant-rating {
    color: #faad14;
    margin-bottom: 4px;
    font-size: 14px;
}

.merchant-type {
    color: #666;
    margin-bottom: 4px;
    font-size: 14px;
}

.merchant-meta {
    color: #999;
    font-size: 12px;
}

.merchant-meta span {
    margin-right: 8px;
}

/* 页脚 */
.footer {
    background-color: #333;
    color: #fff;
    padding: 24px 0;
    text-align: center;
}

.copyright {
    font-size: 14px;
    color: #999;
}

.copyright a {
    color: #fff;
    text-decoration: none;
}

/* 媒体查询 - 响应式设计 */
@media (max-width: 1200px) {
    .container {
        width: 960px;
    }
    
    .category-item {
        width: 20%;
    }
}

@media (max-width: 992px) {
    .container {
        width: 720px;
    }
    
    .category-item {
        width: 25%;
    }
    
    .food-item {
        width: 33.333%;
    }
    
    .merchant-item {
        width: 50%;
    }
}

@media (max-width: 768px) {
    .container {
        width: 540px;
    }
    
    .category-item {
        width: 33.333%;
    }
    
    .food-item {
        width: 50%;
    }
    
    .merchant-item {
        width: 100%;
    }
    
    .carousel {
        height: 300px;
    }
}

@media (max-width: 576px) {
    .container {
        width: 100%;
        padding: 0 15px;
    }
    
    .category-item {
        width: 50%;
    }
    
    .food-item {
        width: 100%;
    }
    
    .carousel {
        height: 200px;
    }
}

/* IE8兼容性修复 */
.lt-ie9 .container {
    width: 960px !important;
}

.lt-ie9 .category-list,
.lt-ie9 .food-list,
.lt-ie9 .merchant-list {
    *zoom: 1;
}

.lt-ie9 .category-item {
    *display: inline;
    *zoom: 1;
    *width: 16%;
}

.lt-ie9 .food-item {
    *display: inline;
    *zoom: 1;
    *width: 24%;
}

.lt-ie9 .merchant-item {
    *display: inline;
    *zoom: 1;
    *width: 32%;
}

.container {
    /* height: 50px; */
}