/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333;
    line-height: 1.6;
    background-color: #f5f5f7;
}

/* 苹果典型色系 */
:root {
    --primary-color: #0071e3;
    --secondary-color: #86868b;
    --accent-color: #f56300;
    --background-light: #ffffff;
    --background-dark: #f5f5f7;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --border-color: #d2d2d7;
    --success-color: #34c759;
    --warning-color: #ff9500;
    --error-color: #ff3b30;
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 头部样式 */
header {
    background-color: var(--background-light);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

/* 添加搜索框样式 */
.search-container {
    flex: 1;
    max-width: 50%;
    margin: 0 20px;
    position: relative;
}

.search-form {
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    height: 40px;
    padding: 0 50px 0 20px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
    background-color: var(--background-dark);
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: white;
    box-shadow: 0 0 0 2px rgba(0, 113, 227, 0.2);
}

.search-button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: none;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.search-button:hover {
    background-color: #005bb5;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--text-primary);
}

.logo img {
    height: 40px;
}

.nav-menu {
    display: flex;
}

.nav-menu li {
    margin-left: 20px;
}

.nav-menu a {
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.mobile-menu-btn {
    display: none;
    font-size: 24px;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
}

/* 特色服务 */
.features {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    margin: 30px 0;
    gap: 20px;
}

.feature-item {
    flex: 1;
    min-width: 200px;
    background-color: var(--background-light);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-icon {
    font-size: 36px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.feature-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.feature-desc {
    color: var(--text-secondary);
}

/* 分类导航 */
.categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    margin: 10px 0 20px;
    gap: 10px;
    background-color: var(--background-light);
    padding: 10px;
    border-radius: 8px;
}

.category-item {
    padding: 8px 15px;
    text-align: center;
    background-color: #f5f5f7;
    border-radius: 20px;
    transition: all 0.3s;
    cursor: pointer;
}

.category-item:hover {
    background-color: #e0e0e5;
}

.category-item.active {
    background-color: var(--primary-color);
    color: white;
}

.category-name {
    font-size: 14px;
    font-weight: 500;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .categories {
        padding: 8px;
        gap: 8px;
    }
    
    .category-item {
        padding: 6px 12px;
    }
    
    .category-name {
        font-size: 12px;
    }
}

.category-item.active {
    background-color: var(--primary-color);
    color: white;
}

.category-item.active .category-icon,
.category-item.active .category-name {
    color: white;
}

.category-item:hover {
    background-color: var(--primary-color);
    color: white;
}

.category-item:hover .category-icon,
.category-item:hover .category-name {
    color: white;
}

.category-icon {
    font-size: 28px;
    color: var(--primary-color);
    margin-bottom: 10px;
    transition: color 0.3s;
}

.category-name {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    transition: color 0.3s;
}

/* 车辆列表 */
.section-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 40px 0 20px;
    position: relative;
    padding-left: 15px;
}

.section-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 5px;
    height: 24px;
    width: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.car-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.car-card {
    background-color: var(--background-light);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

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

.car-image {
    height: 200px;
    overflow: hidden;
}

.car-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.car-card:hover .car-image img {
    transform: scale(1.05);
}

.car-info {
    padding: 15px;
}

.car-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 48px;
}

.car-price {
    display: flex;
    align-items: baseline;
    margin-bottom: 10px;
}

.current-price {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-color);
}

.original-price {
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: line-through;
    margin-left: 10px;
}

.car-meta {
    display: flex;
    justify-content: flex-start; /* 修改为左对齐 */
    gap: 10px; /* 保持间距 */
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 5px; /* 保持上边距 */
}

.car-meta span {
    background-color: #f5f5f7;
    padding: 2px 8px;
    border-radius: 4px;
}

.car-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.car-tag {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    background-color: #f0f0f0;
    color: var(--text-secondary);
}

.car-tag.hot {
    background-color: #ffece3;
    color: var(--accent-color);
}

/* 详情页样式 */
.car-detail {
    background-color: var(--background-light);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin: 20px 0;
}

.detail-gallery {
    position: relative;
    height: 500px;
}

.gallery-main {
    height: 100%;
    position: relative;
    overflow: hidden;
    touch-action: pan-y; /* 允许垂直平移，但水平滑动会被捕获 */
}

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

.gallery-thumbs {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 0 20px;
}

.gallery-thumb {
    width: 60px;
    height: 60px;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
}

.gallery-thumb.active {
    border-color: var(--primary-color);
}

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

/* 添加移动端适配样式 */
@media (max-width: 768px) {
    .detail-gallery {
        height: 300px; /* 移动端降低轮播图高度 */
    }
    
    .gallery-nav {
        display: none; /* 在移动端隐藏左右切换按钮 */
    }
    
    .gallery-thumbs {
        bottom: 10px;
        gap: 5px;
    }
    
    .gallery-thumb {
        width: 40px;
        height: 40px;
    }
    
    .detail-info {
        padding: 15px;
    }
    
    .detail-title {
        font-size: 20px;
        margin-bottom: 10px;
    }
    
    .detail-meta {
        gap: 10px;
    }
    
    .parameter-list {
        grid-template-columns: 1fr; /* 参数列表在移动端单列显示 */
    }
    
    .car-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* 其他移动端适配样式 */
@media (max-width: 576px) {
    .header-container {
        padding: 10px 0;
        flex-wrap: wrap; /* 允许换行 */
    }
    
    .logo {
        font-size: 20px;
    }
    
    .search-container {
        order: 3; /* 在移动端将搜索框放在第三位 */
        max-width: 100%;
        margin: 10px 0 0;
        width: 100%; /* 确保搜索框占满整行 */
        flex-basis: 100%; /* 添加这一行，强制搜索框占据整行 */
    }
    
    .nav-menu {
        display: flex;
        font-size: 14px;
    }
    
    .nav-menu li {
        margin-left: 0;
    }
    
    .mobile-menu-btn {
        display: none;
    }
    
    .section-title {
        font-size: 20px;
        margin: 30px 0 15px;
    }
    
    .detail-highlights {
        flex-direction: column;
        gap: 5px;
    }
    
    .highlight-item {
        width: 100%;
    }
}

.detail-info {
    padding: 20px;
}

.detail-header {
    margin-bottom: 20px;
}

.detail-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.detail-price-box {
    display: flex;
    align-items: baseline;
    margin-bottom: 15px;
}

.detail-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-color);
}

.detail-original-price {
    font-size: 16px;
    color: var(--text-secondary);
    text-decoration: line-through;
    margin-left: 15px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
}

.meta-item {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
}

.meta-icon {
    margin-right: 5px;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.detail-tag {
    padding: 5px 12px;
    border-radius: 5px;
    background-color: #f0f0f0;
    color: var(--text-secondary);
    font-size: 14px;
}

.detail-tag.hot {
    background-color: #ffece3;
    color: var(--accent-color);
}

.detail-highlights {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.highlight-item {
    padding: 8px 15px;
    border-radius: 5px;
    background-color: #e8f4fc;
    color: var(--primary-color);
    font-size: 14px;
}

.detail-description {
    margin-bottom: 30px;
    line-height: 1.8;
}

.detail-parameters {
    margin-bottom: 30px;
}

.parameter-group {
    margin-bottom: 20px;
}

.parameter-group-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.parameter-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.parameter-item {
    display: flex;
}

.parameter-label {
    min-width: 100px;
    color: var(--text-secondary);
}

.parameter-value {
    font-weight: 500;
    color: var(--text-primary);
}

.detail-services {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.service-item {
    flex: 1;
    min-width: 200px;
    background-color: var(--background-dark);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.service-icon {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.service-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.service-desc {
    font-size: 14px;
    color: var(--text-secondary);
}

.detail-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.action-btn {
    flex: 1;
    padding: 12px 0;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-secondary {
    background-color: #f5f5f7;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

/* 推荐车型 */
.recommend-cars {
    margin: 40px 0;
}

/* 页脚 */
footer {
    background-color: var(--background-light);
    padding: 40px 0;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
}


.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.logo img {
    display: block;
}

.logo span {
    font-size: 18px;
    font-weight: bold;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .logo span {
        font-size: 16px;
    }
}

/* 搜索结果样式 */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px;
    background-color: var(--background-light);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 16px;
}