/* 全局重置与基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Microsoft Yahei", "PingFang SC", sans-serif;
}

body {
    color: #333;
    background-color: #f8f8f8;
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

button {
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部导航样式 */
.header {
    background-color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 999;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: #c8102e; /* 平遥古城红 */
}

.nav ul {
    display: flex;
    gap: 30px;
}

.nav a {
    font-size: 16px;
    font-weight: 500;
}

.nav a.active {
    color: #c8102e;
    border-bottom: 2px solid #c8102e;
}

.nav a:hover {
    color: #c8102e;
}

/* 横幅样式 */
.banner {
    position: relative;
    height: 400px;
    overflow: hidden;
    margin-bottom: 40px;
}

.banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-mask {
    position: absolute; /* 基于 banner-item 绝对定位 */
    left: 0; /* 左对齐 */
    bottom: 0; /* 固定在轮播图底部（推荐），也可改为 top:0 固定在顶部 */
    width: 100%; /* 宽度占满轮播项 */
    padding: 30px 50px; /* 内边距，避免内容贴边 */
    background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0)); /* 渐变背景，更美观 */
    color: #fff; /* 文字白色 */
    z-index: 10; /* 确保层级高于图片，避免被遮挡 */
    box-sizing: border-box; /* 关键：内边距计入宽度，避免宽度溢出导致重叠 */
}

.banner-mask h2 {
    font-size: 28px;
    margin: 0 0 10px 0; /* 取消默认外边距，控制与下方p标签的间距 */
    line-height: 1.2; /* 行高，避免文字行重叠 */
}


.banner-mask p {
    font-size: 16px;
    margin: 0 0 20px 0; /* 控制与按钮的间距 */
    line-height: 1.5;
}

.banner-mask .banner-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #f08c00; /* 按钮背景色 */
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background 0.3s;
    width: 200px;
}

.banner-btn:hover {
    background-color: #a00c24;
}

/* 筛选栏样式 */
.scenic-filter, .food-filter, .hotel-filter, .strategy-filter {
    margin-bottom: 30px;
}

.filter-tab {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 20px;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 16px;
    white-space: nowrap; /* 避免筛选按钮文字换行 */
}

.filter-btn.active {
    background-color: #c8102e;
    color: #fff;
    border-color: #c8102e;
}

.filter-btn:hover:not(.active) {
    border-color: #c8102e;
    color: #c8102e;
}

/* 通用列表/卡片样式（修复：内容完整显示） */
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 22px;
    color: #333;
}

.section-title span {
    font-weight: bold;
}

.more-btn {
    font-size: 14px;
    color: #c8102e;
}

.more-btn:hover {
    text-decoration: underline;
}

/* 首页推荐模块样式 */
.scenic-recommend, .food-recommend, .strategy-recommend, .hotel-recommend {
    margin-bottom: 60px;
}

.scenic-list, .food-list, .strategy-list, .hotel-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

/* 卡片：自适应高度 + 最小高度 */
.scenic-item, .food-item, .strategy-item, .hotel-item {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
    min-height: 380px; /* 最小高度，避免过矮 */
    display: flex;
    flex-direction: column; /* 图上文下 */
}

.scenic-item:hover, .food-item:hover, .strategy-item:hover, .hotel-item:hover {
    transform: translateY(-5px);
}

/* 图片容器：固定高度 */
.scenic-img, .food-img, .strategy-img, .hotel-img {
    width: 100%;
    height: 200px; /* 固定图片高度 */
    object-fit: cover;
}

/* 文字容器：自适应高度，确保内容完整 */
.scenic-info, .food-info, .strategy-info, .hotel-info {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px; /* 内部间距，提升可读性 */
}

.scenic-info h4, .food-info h4, .strategy-info h4, .hotel-info h4 {
    font-size: 18px;
    margin-bottom: 4px;
}

.tag {
    display: inline-block;
    padding: 3px 8px;
    background-color: #f0f0f0;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 4px;
}

.brief {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    /* 取消行数限制，确保内容显示 */
    display: block;
    overflow: visible;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: #999;
    margin-top: auto; /* 元信息靠下对齐 */
}

.price {
    font-size: 14px;
    color: #c8102e;
    font-weight: 500;
}

.detail-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 15px;
    background-color: #c8102e;
    color: #fff;
    border-radius: 4px;
    font-size: 14px;
}

.detail-btn:hover {
    background-color: #a00c24;
}

/* 专题页卡片样式（修复：内容完整显示） */
.scenic-card, .food-card, .hotel-card, .strategy-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    display: flex;
    flex-direction: column; /* 图上文下 */
    min-height: 400px; /* 最小高度 */
}

/* 图片容器：固定高度 */
.scenic-card .card-img, 
.food-card .card-img, 
.hotel-card .card-img, 
.strategy-card .card-img {
    height: 220px; /* 固定图片高度 */
}

.scenic-card .card-img img, 
.food-card .card-img img, 
.hotel-card .card-img img, 
.strategy-card .card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 文字容器：自适应高度 */
.scenic-card .card-content, 
.food-card .card-content, 
.hotel-card .card-content, 
.strategy-card .card-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.card-title {
    font-size: 22px;
    margin-bottom: 10px;
    color: #333;
}

.card-tag {
    display: inline-block;
    padding: 4px 10px;
    background-color: #f8e0e4;
    color: #c8102e;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 15px;
}

/* 取消文字高度限制，确保内容完整 */
.scenic-card .card-brief, 
.food-card .card-brief, 
.hotel-card .card-brief, 
.strategy-card .card-brief {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    max-height: none;
    overflow-y: visible;
}

.card-meta {
    margin-bottom: 20px;
}

.meta-item {
    display: flex;
    margin-bottom: 8px;
}

.meta-item .label {
    width: 80px;
    color: #999;
    font-weight: 500;
}

.meta-item .value {
    flex: 1;
    color: #666;
}

/* 美食页专属优化 */
.food-card .shop-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.food-card .shop-item {
    display: flex;
    flex-direction: row;
    gap: 10px;
    color: #666;
    margin-bottom: 8px;
}

.food-card .shop-item .label {
    width: 80px;
    color: #999;
    font-weight: 500;
    flex-shrink: 0;
}

/* 景点详情页样式 */
.scenic-detail {
    margin-bottom: 60px;
}

.basic-info {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 30px;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    margin-bottom: 40px;
}

.main-img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
}

.info-right {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.detail-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.content-title {
    font-size: 20px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.content-text {
    font-size: 16px;
    color: #666;
    line-height: 1.8;
    margin-bottom: 30px;
}

.tips-list {
    margin-bottom: 30px;
}

.tips-list li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
    color: #666;
}

.tips-list li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #c8102e;
    font-size: 20px;
}

.around-scenic, .around-food {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.around-item {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 8px;
}

.around-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
}

.around-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 12px;
    background-color: #c8102e;
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
}

/* 住宿页设施标签样式 */
.feature-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.feature-tag {
    padding: 5px 12px;
    background-color: #f0f8f0;
    color: #2a9d2a;
    border-radius: 4px;
    font-size: 14px;
}

/* 攻略页样式 */
.hot-strategy {
    margin-bottom: 40px;
}

.hot-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column; /* 图上文下 */
    min-height: 450px; /* 最小高度 */
}

.hot-img img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.hot-info {
    padding: 30px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hot-title {
    font-size: 24px;
    margin-bottom: 15px;
    color: #c8102e;
}

.hot-tag {
    display: inline-block;
    padding: 4px 10px;
    background-color: #f8e0e4;
    color: #c8102e;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 15px;
}

.hot-brief {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.8;
}

.hot-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    color: #999;
}

.read-full-btn {
    padding: 10px 25px;
    background-color: #c8102e;
    color: #fff;
    border-radius: 4px;
    font-size: 16px;
}

.read-full-btn:hover {
    background-color: #a00c24;
}

/* 攻略弹窗样式 */
.strategy-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background-color: #fff;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
    border-radius: 8px;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-close:hover {
    color: #c8102e;
}

.modal-title {
    font-size: 24px;
    margin-bottom: 10px;
    color: #333;
}

.modal-tag {
    display: inline-block;
    padding: 4px 10px;
    background-color: #f8e0e4;
    color: #c8102e;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 15px;
}

.modal-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    color: #999;
    font-size: 14px;
}

.modal-content-text {
    font-size: 16px;
    color: #666;
    line-height: 1.8;
}

/* 图片预览弹窗样式 */
.img-preview {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

#previewImg {
    max-width: 90%;
    max-height: 90vh;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: #fff;
    cursor: pointer;
}

.close-btn:hover {
    color: #c8102e;
}

/* 空数据提示样式 */
.empty-tip {
    text-align: center;
    padding: 50px 0;
    color: #999;
    font-size: 16px;
}

/* 底部样式 */
.footer {
    background-color: #333;
    color: #fff;
    padding: 50px 0 20px;
    margin-top: 80px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-logo {
    font-size: 22px;
    font-weight: bold;
    color: #fff;
}

.footer-nav {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-nav a {
    color: #ccc;
    font-size: 14px;
}

.footer-nav a:hover {
    color: #c8102e;
}

.copyright {
    font-size: 12px;
    color: #999;
    margin-top: 20px;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        height: auto;
        padding: 15px 20px;
    }

    .logo {
        margin-bottom: 15px;
    }

    .nav ul {
        gap: 15px;
    }

    .banner {
        height: 250px;
    }

    .banner-mask {
        padding-left: 20px;
    }

    .banner-mask h2 {
        font-size: 28px;
    }

    .banner-mask p {
        font-size: 16px;
    }

    .basic-info {
        padding: 15px;
        grid-template-columns: 1fr;
    }

    .detail-content {
        padding: 20px;
    }

    /* 移动端取消最小高度，完全自适应 */
    .scenic-item, .food-item, .strategy-item, .hotel-item {
        min-height: auto;
    }

    .scenic-card, .food-card, .hotel-card, .strategy-card {
        min-height: auto;
    }

    .hot-card {
        min-height: auto;
    }
}

@media (max-width: 480px) {
    .scenic-list, .food-list, .strategy-list, .hotel-list {
        grid-template-columns: 1fr;
    }
}

.record-info {
    margin-top: 8px;
    font-size: 12px;
    color: #999;
}
.record-info a {
    color: #999;
    text-decoration: none;
}
.record-info a:hover {
    color: #666;
    text-decoration: underline;
}
.record-info span {
    margin: 0 4px;
}


/* 轮播Banner样式 - 兼容原有banner视觉风格 */
.swiper-banner {
    position: relative;
    height: 400px;
    overflow: hidden;
    margin-bottom: 40px;
}
.banner-swiper {
    width: 100%;
    height: 400px; /* 必须固定轮播容器高度（根据你的设计调整），否则容器高度仅由第一张图撑开，后续项无高度 */
}
.banner-list {
    width: 100%;
    height: 100%;
    display: flex; /* 轮播项横向排列（如果是滑动轮播） */
    transition: transform 0.5s ease; /* 滑动过渡，可选 */
}
.banner-item {
    position: relative; /* 关键：为banner-mask提供定位参考 */
    width: 100%; /* 每个轮播项占满容器 */
    height: 100%; /* 高度继承父容器 */
    flex-shrink: 0; /* 防止轮播项被压缩 */
}
.banner-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 必加：图片按比例填充容器，不拉伸变形 */
    display: block; /* 清除图片底部空白 */
}
/* 复用原有banner-img样式，保证图片适配 */
.banner-item .banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 图片铺满容器且保持比例，避免变形 */
}
/* 复用原有mask样式，文字层布局不变 */
.banner-item .banner-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.7), rgba(0,0,0,0.3));
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 80px;
    color: #fff;
}
/* 轮播指示器（小圆点） */
.banner-dots {
    position: absolute;
    bottom: 20px; /* 调整与底部的距离，避开mask */
    left: 50%;
    transform: translateX(-50%);
    z-index: 20; /* 层级高于mask，确保可见 */
    display: flex;
    gap: 8px;
}
.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    cursor: pointer;
}
.dot.active { background: #fff; }
/* 左右切换箭头 */
.banner-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    background: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    z-index: 20; /* 层级高于mask */
}
.banner-arrow:hover {
    background: #c8102e;
}
.prev-arrow {
    left: 20px;
}

.next-arrow {
    right: 20px;
}
/* 移动端轮播适配 - 与原有banner响应式统一 */
@media (max-width: 768px) {
    .swiper-banner {
        height: 250px;
    }
    .banner-item .banner-mask {
        padding-left: 20px;
    }
    .banner-item .banner-mask h2 {
        font-size: 28px;
    }
    .banner-item .banner-mask p {
        font-size: 16px;
    }
    .banner-arrow {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
}