/* 全局样式 */
:root {
    --primary-color: #FF4300;
    --primary-dark: #d05814;
    --light-gray: #f8f9fa;
    --dark-gray: #343a40;
    --text-color: #212529;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    background-color: #fff;
    line-height: 1.6;
}

/* 导航栏样式 */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary-color) !important;
    font-size: 1.5rem;
    font-family: "Arial Black", "Arial Bold", Gadget, sans-serif;
}

.nav-link {
    color: var(--text-color) !important;
    font-weight: 500;
    margin-left: 1rem;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

/* 搜索板块 */
.search-section {
    background-color: var(--light-gray);
    padding: 3rem 0;
    margin-bottom: 3rem;
}

.search-card {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

/* 自定义二级按钮样式 — 继承品牌橙色 */
.model-btn {
    background-color: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.4rem 1.2rem;
    border-radius: 4px;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
    margin: 0.25rem;
    font-weight: 500;
    font-size: 0.95rem;
}

.model-btn:hover {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(237, 101, 23, 0.2);
}

/* 品牌板块 */
.brand-section {
    margin-bottom: 4rem;
}

.brand-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-color);
    text-align: center;
}

.brand-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
    max-height: 300px;
    overflow: hidden;
    transition: max-height 0.5s ease;
}

.brand-grid.expanded {
    max-height: none;
}

.brand-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 0;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.brand-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    border-color: var(--primary-color);
}

.brand-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.brand-name {
    font-weight: 500;
    font-size: 0.9rem;
    text-align: center;
}

.toggle-btn {
    display: block;
    margin: 0 auto;
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.5rem 2rem;
    border-radius: 4px;
    transition: all 0.3s;
}

.toggle-btn:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* 热销车辆板块 */
.hot-cars-section {
    margin-bottom: 4rem;
}

.car-card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    height: 100%;
}

.car-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.car-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.car-card-body {
    padding: 1rem;
}

.car-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.2rem;
    max-height: 3.6rem; 
    height: 3.6rem;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

.car-price {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.car-id {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.car-more-btn {
    display: block;
    width: 100%;
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 0.5rem;
    border-radius: 4px;
    text-align: center;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.car-more-btn:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* 底部样式 */
footer {
    background-color: var(--dark-gray);
    color: #fff;
    padding: 3rem 0 1rem;
}

.footer-text {
    font-size: 0.9rem;
    line-height: 1.8;
    color: #adb5bd;
}

.copyright {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    color: #adb5bd;
    text-align: center;
}

/* 新增：自定义带图标的下拉框样式 (同时也用于文字下拉) */
.brand-dropdown {
    position: relative;
    width: 100%;
}

.dropdown-toggle-custom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 48px;
    padding: 0 1rem;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.dropdown-toggle-custom .selected-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-toggle-custom .brand-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.dropdown-menu-custom {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.5rem 0;
    background-color: #fff;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    list-style: none;
    max-height: 500px;
    overflow-y: auto;
    display: none;
    
}

.dropdown-menu-custom.show {
    display: block;
}

.dropdown-item-custom {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: #212529;
    text-decoration: none;
    cursor: pointer;
}

.dropdown-item-custom:hover {
    background-color: var(--light-gray);
}

.dropdown-item-custom .brand-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

/* 响应式适配 */
@media (max-width: 1200px) {
    .brand-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 992px) {
    .brand-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .car-img {
        height: 150px;
    }
}

@media (max-width: 768px) {
    .brand-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .search-section {
        padding: 2rem 0;
    }

    .search-card {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .brand-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .brand-title {
        font-size: 1.5rem;
    }

    .car-img {
        height: 120px;
    }
}


/* 无结果提示样式 */
.no-result-tip {
    width: 100%;
    padding: 4rem 2rem;
    text-align: center;
    color: #6c757d;
    font-size: 1rem;
    display: none;
    /* 默认隐藏 */
}

.no-result-tip i {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
    color: #adb5bd;
}

/* 清除车型选项 */
.reset-btn {
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.brand-dropdown .dropdown-item-custom i.brand-img {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    border-radius: 4px;
    margin-right: 8px;
    font-size: 1.1rem;
    color: #555;
}
.selected-brand i {
    margin-right: 8px;
    font-size: 1.1rem;
    color: #ed6517;
}

/* 售出状态 */
.card-img-top{height:180px;object-fit:cover;}
.shch1{ display: none;}
.shoutu {
    position: relative;      /* 为内部绝对定位元素（如售出标志）提供参考 */
    display: block;          /* 块级显示，避免内联元素间隙问题（也可以保留 inline-block） */
    height: 226px;           /* 固定高度 */
    overflow: hidden;        /* 隐藏超出部分 */
}

@media (max-width:1260px) {
.shoutu {height: 266px;}
}

@media (max-width:640px) {
.shoutu {height: 406px;}
}


.shoutu img {
    display: block;          /* 去掉图片底部的间隙 */
    width: 100%;             /* 宽度填满容器 */
    height: 100%;            /* 高度填满容器 */
    object-fit: cover;       /* 图片按比例缩放，完全覆盖容器，多余部分裁剪，默认居中裁剪 */
}

.shch2 {
    position: absolute; /* 绝对定位，使其位于 card-img-top 上方 */
    top: 0;
    left: 0;
    width: 100%; /* 撑满整个容器 */
    height: 100%; /* 撑满整个容器 */
    object-fit: cover; /* 保证图片不会变形，同时完全覆盖容器 */
}

.card-img-top {
    width: 100%; /* 确保图片宽度占满容器 */
    height: auto; /* 保持图片的原始宽高比 */
}

.text-muted{ text-transform: uppercase;}

        #car-list { min-height: 400px; }
        /* 加载提示样式 - 核心修改：调整加载图标颜色为#ed6517 */
        .loading-more {
            text-align: center;
            padding: 1.5rem 0;
            color: #6c757d;
        }
        .loading-more .spinner-border {
            width: 2rem;
            height: 2rem;
            margin-bottom: 0.5rem;
            border-color: #ed6517; /* 主色调 */
            border-right-color: transparent; /* 保持转圈效果 */
        }
        /* 全部加载完成提示样式 */
        .all-loaded {
            text-align: center;
            padding: 1.5rem 0;
            color: #6c757d;
            display: none;
        }
        /* 图片懒加载占位样式 */
        .lazy-load-img {
            background: #f8f9fa; /* 浅灰色占位背景 */
            background-repeat: no-repeat;
            background-position: center;
            min-height: 180px; /* 固定最小高度，避免布局跳动 */
            object-fit: cover; /* 图片适配容器 */
            width: 100%; /* 宽度铺满容器 */
        }
        
@media (max-width: 767.98px) { /* 针对移动端（小于768px） */
    #car-list {
        --bs-gutter-x: 1rem; /* 列间距，可根据需要调整 */
        --bs-gutter-y: 1rem;
    }
    #car-list > .car-item {
        flex: 0 0 auto;
        width: calc(50% - var(--bs-gutter-x) * 0.5); /* 50%宽度，减去列间距 */
        max-width: calc(50% - var(--bs-gutter-x) * 0.5);
    }
    /* 适配移动端卡片图片高度，避免变形 */
    .shoutu {
        height: 160px !important; /* 移动端统一图片高度 */
    }
    .card-img-top {
        height: 180px !important;
    }
}

/* 可选：优化移动端筛选栏和卡片间距 */
@media (max-width: 767.98px) {
    .hot-cars-section {
        padding: 0 0.5rem;
    }
    .car-item .card {
        margin-bottom: 0.1rem;
    }
    /* 确保分页控件在移动端适配 */
    .pagination {
        flex-wrap: wrap;
    }
    .page-item {
        margin: 0.1rem;
    }
    .page-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}