/* 骨架屏样式 */

/* 骨架屏基础动画 */
@keyframes skeleton-loading {
    0% {
        background-position: -200px 0;
    }
    100% {
        background-position: calc(200px + 100%) 0;
    }
}

/* 骨架屏基础类 */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200px 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

/* 车辆卡片骨架屏 */
.vehicle-card-skeleton {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
}

.vehicle-image-skeleton {
    width: 100%;
    height: 200px;
    margin-bottom: 12px;
}

.vehicle-title-skeleton {
    height: 20px;
    width: 70%;
    margin-bottom: 8px;
}

.vehicle-meta-skeleton {
    height: 16px;
    width: 100%;
    margin-bottom: 8px;
}

.vehicle-price-skeleton {
    height: 24px;
    width: 50%;
    margin-bottom: 12px;
}

.vehicle-tags-skeleton {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.vehicle-tag-skeleton {
    height: 20px;
    width: 60px;
    border-radius: 10px;
}

/* 品牌列表骨架屏 */
.brand-skeleton {
    display: flex;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.brand-logo-skeleton {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 12px;
}

.brand-info-skeleton {
    flex: 1;
}

.brand-name-skeleton {
    height: 18px;
    width: 80px;
    margin-bottom: 4px;
}

.brand-count-skeleton {
    height: 14px;
    width: 60px;
}

/* 轮播图骨架屏 */
.banner-skeleton {
    width: 100%;
    height: 400px;
    border-radius: 12px;
    margin-bottom: 20px;
}

/* 加载状态指示器 */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 4px;
    background: #f0f0f0;
    border-radius: 2px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
    transition: width 0.3s ease;
    animation: progress-shimmer 2s infinite;
}

@keyframes progress-shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

/* 错误状态样式 */
.error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #666;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.error-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.error-message {
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.retry-button {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.retry-button:hover {
    background: #5a67d8;
}

/* 空状态样式 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #999;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #666;
}

.empty-message {
    font-size: 14px;
    line-height: 1.5;
}

/* 搜索建议样式 */
.search-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

.suggestion-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s ease;
}

.suggestion-item:hover {
    background: #f8fafc;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-highlight {
    background: #fef3c7;
    padding: 2px 4px;
    border-radius: 3px;
}

/* 筛选反馈样式 */
.filter-active {
    background: #667eea !important;
    color: white !important;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.filter-transition {
    transition: all 0.3s ease;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .vehicle-card-skeleton {
        padding: 12px;
    }
    
    .vehicle-image-skeleton {
        height: 160px;
    }
    
    .brand-skeleton {
        padding: 8px;
    }
    
    .brand-logo-skeleton {
        width: 40px;
        height: 40px;
    }
    
    .banner-skeleton {
        height: 250px;
    }
    
    /* 触摸目标优化 */
    .touch-target {
        min-height: 44px;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .suggestion-item {
        padding: 16px;
        min-height: 44px;
    }
    
    /* 移动端筛选反馈 */
    .filter-feedback {
        right: 10px !important;
        left: 10px !important;
        max-width: none !important;
        font-size: 13px !important;
    }
    
    /* 移动端错误状态 */
    .error-state, .empty-state {
        padding: 40px 20px;
    }
    
    .error-icon, .empty-icon {
        font-size: 36px;
    }
    
    .error-title, .empty-title {
        font-size: 16px;
    }
    
    .error-message, .empty-message {
        font-size: 13px;
    }
    
    /* 移动端搜索建议 */
    .search-suggestions {
        max-height: 200px;
    }
    
    .suggestion-item {
        padding: 14px 16px;
        font-size: 14px;
    }
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .vehicle-card-skeleton {
        padding: 8px;
        margin-bottom: 12px;
    }
    
    .vehicle-image-skeleton {
        height: 140px;
    }
    
    .brand-skeleton {
        padding: 6px;
    }
    
    .brand-logo-skeleton {
        width: 36px;
        height: 36px;
    }
    
    .banner-skeleton {
        height: 200px;
    }
    
    /* 更小的触摸目标 */
    .touch-target {
        min-height: 40px;
        min-width: 40px;
    }
    
    .suggestion-item {
        padding: 12px 14px;
        min-height: 40px;
        font-size: 13px;
    }
}

/* 横屏优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .banner-skeleton {
        height: 180px;
    }
    
    .vehicle-image-skeleton {
        height: 120px;
    }
}

/* 高DPI屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .skeleton {
        background-size: 100px 100%;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .suggestion-item:hover {
        background: #f8fafc;
    }
    
    .suggestion-item:active {
        background: #e2e8f0;
        transform: scale(0.98);
    }
    
    .retry-button:active {
        transform: scale(0.95);
    }
}
