/* 智选好物 - 橙色系电商风格 */

:root {
    --primary: #ff6b35;
    --primary-dark: #e55a2b;
    --primary-light: #ff8c5a;
    --secondary: #ffa726;
    --accent: #ff9800;
    --success: #4caf50;
    --danger: #f44336;
    --warning: #ffeb3b;
    --dark: #333333;
    --gray: #666666;
    --light-gray: #f5f5f5;
    --border: #e0e0e0;
    --white: #ffffff;
    --shadow: 0 2px 12px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #fafafa;
    color: var(--dark);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 语言切换 */
.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.lang-switch a {
    color: var(--gray);
    font-size: 13px;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.2s;
}

.lang-switch a:hover,
.lang-switch a.active {
    color: var(--primary);
    background: rgba(255, 107, 53, 0.1);
}

.lang-switch span {
    color: var(--border);
}

.header-top-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* 顶部导航栏 */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 13px;
}

.header-top a {
    color: rgba(255,255,255,0.9);
    margin-left: 15px;
    transition: color 0.3s;
}

.header-top a:hover {
    color: white;
}

.header-main {
    display: flex;
    align-items: center;
    padding: 15px 0;
    gap: 30px;
}

.logo {
    font-size: 28px;
    font-weight: bold;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.logo-icon {
    font-size: 32px;
}

.search-box {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 120px 12px 20px;
    border: none;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.search-box button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-dark);
    color: white;
    border: none;
    padding: 8px 25px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.search-box button:hover {
    background: var(--primary);
}

.cart-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.2);
    padding: 10px 20px;
    border-radius: 25px;
    color: white;
    transition: background 0.3s;
}

.cart-btn:hover {
    background: rgba(255,255,255,0.3);
}

.cart-icon {
    font-size: 20px;
    position: relative;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--danger);
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* 分类导航 */
.nav-bar {
    background: white;
    border-bottom: 2px solid var(--primary);
}

.nav-categories {
    display: flex;
    list-style: none;
    justify-content: center;
}

.nav-categories li a {
    display: block;
    padding: 15px 25px;
    font-size: 15px;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
}

.nav-categories li a:hover,
.nav-categories li a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: rgba(255,107,53,0.05);
}

/* 轮播图区域 */
.banner-section {
    position: relative;
    margin: 8px 0 16px;
    overflow: hidden;
}

/* 三栏布局：左2小图 + 中间大轮播 + 右2小图 */
.banner-layout {
    display: grid;
    grid-template-columns: 120px 1fr 120px;
    gap: 8px;
    height: 180px;
    overflow: hidden;
}

/* 左右侧边小图面板 */
.banner-side-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

/* 小图卡片 */
.banner-side-card {
    flex: 1;
    min-height: 0;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    display: block;
    transition: box-shadow 0.25s;
    text-decoration: none;
    background: #e8e8e8;
}

.banner-side-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.banner-side-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 没有图片时的文字占位 */
.banner-side-card-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    padding: 12px;
    text-align: center;
    background: rgba(0,0,0,0.25);
    backdrop-filter: blur(2px);
}

.banner-side-card-text span {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.banner-side-card-text small {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 4px;
}

/* 中间大轮播 */
.banner-main {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    height: 100%;
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 50%, #feada6 100%);
}

.banner-slides {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.banner-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
}

.banner-slide.active {
    opacity: 1;
    visibility: visible;
}

.banner-slide iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: transparent;
}

.banner-slide > a {
    display: block;
    width: 100%;
    height: 100%;
}

.banner-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-content {
    position: absolute;
    bottom: 40px;
    left: 40px;
    color: white;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.3);
}

.banner-content h2 {
    font-size: 36px;
    margin-bottom: 10px;
}

.banner-content p {
    font-size: 18px;
    opacity: 0.9;
}

/* 左右切换箭头 */
.banner-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.85);
    border: none;
    border-radius: 50%;
    font-size: 16px;
    color: #333;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.banner-main:hover .banner-arrow {
    opacity: 1;
}

.banner-arrow:hover {
    background: white;
}

.banner-prev { left: 12px; }
.banner-next { right: 12px; }

/* 圆点指示器 */
.banner-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.banner-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,0.55);
    cursor: pointer;
    transition: all 0.3s;
}

.banner-dot.active {
    background: white;
    width: 28px;
    border-radius: 5px;
}

/* 分类导航区块 */
.category-section {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    margin: 12px 0;
    box-shadow: var(--shadow);
}

.section-title {
    font-size: 18px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--primary);
    border-radius: 2px;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 4px;
}

.category-item {
    text-align: center;
    padding: 6px 2px;
    border-radius: 6px;
    transition: all 0.25s;
    cursor: pointer;
}

.category-item:hover {
    background: rgba(255,107,53,0.08);
    transform: translateY(-2px);
}

.category-icon {
    font-size: 26px;
    margin-bottom: 4px;
    display: block;
    line-height: 1;
}

.category-name {
    font-size: 12px;
    color: var(--gray);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-item:hover .category-name {
    color: var(--primary);
}

/* 促销活动区域 */
.promo-section {
    margin: 20px 0;
}

.promo-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.promo-item {
    background: white;
    border-radius: 10px;
    padding: 12px 10px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    display: block;
    text-decoration: none;
    color: inherit;
    min-height: 80px;
}

.promo-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.promo-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

/* 促销项图片/媒体容器 */
.promo-media {
    width: 100%;
    height: 60px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 6px;
    background: #f8f8f8;
}

.promo-media img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.promo-media iframe,
.promo-media .promo-iframe-wrapper {
    width: 100%;
    height: 100%;
    border: none;
    overflow: hidden;
}

.promo-content {
    position: relative;
}

.promo-title {
    font-size: 15px;
    color: var(--primary);
    margin-bottom: 4px;
    font-weight: bold;
    line-height: 1.3;
}

.promo-subtitle {
    font-size: 12px;
    color: var(--gray);
    line-height: 1.3;
}

.promo-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--danger);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
}

/* 热门商品区域 */
.products-section {
    margin: 30px 0;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.view-more {
    color: var(--primary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.view-more:hover {
    text-decoration: underline;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    position: relative;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.product-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
    background: var(--light-gray);
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-badges {
    position: absolute;
    top: 6px;
    left: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.badge {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 11px;
    color: white;
}

.badge-hot {
    background: var(--danger);
}

.badge-new {
    background: var(--success);
}

.badge-discount {
    background: var(--primary);
}

.product-info {
    padding: 10px;
}

.product-name {
    font-size: 13px;
    color: var(--dark);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 36px;
    line-height: 18px;
}

.product-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.price-current {
    font-size: 18px;
    color: var(--primary);
    font-weight: bold;
}

.price-original {
    font-size: 12px;
    color: var(--gray);
    text-decoration: line-through;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 11px;
    color: var(--gray);
}

.product-sales {
    display: flex;
    align-items: center;
    gap: 3px;
}

/* 广告区域 */
.ad-section {
    margin: 18px 0;
}

.ad-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.ad-item {
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    background: #f5f5f5;
    border: 1px solid #eee;
}

/* 广告容器 - 支持多种类型 */
.ad-container {
    display: block;
    width: 100%;
    height: auto;
}

.ad-container.ad-image {
    cursor: pointer;
}

.ad-container.ad-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.3s;
}

.ad-container.ad-image:hover img {
    transform: scale(1.02);
}

.ad-container.ad-javascript {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
    border-radius: 8px;
}

.ad-container.ad-iframe {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s;
}

.ad-item:hover img {
    transform: scale(1.05);
}

.ad-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
}

.ad-title {
    font-size: 18px;
    font-weight: bold;
}

/* 底部 */
.footer {
    background: #2d2d2d;
    color: rgba(255,255,255,0.8);
    padding: 50px 0 30px;
    margin-top: 50px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-logo {
    font-size: 24px;
    font-weight: bold;
    color: white;
    margin-bottom: 15px;
}

.footer-desc {
    font-size: 14px;
    line-height: 1.8;
    opacity: 0.7;
}

.footer-title {
    font-size: 16px;
    color: white;
    margin-bottom: 20px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: rgba(255,255,255,0.6);
    font-size: 14px;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 25px;
    text-align: center;
    font-size: 13px;
    opacity: 0.6;
}

/* 搜索结果页 */
.search-header {
    background: white;
    padding: 20px 0;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.search-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-keyword {
    font-size: 20px;
}

.search-keyword span {
    color: var(--primary);
}

.sort-options {
    display: flex;
    gap: 15px;
}

.sort-btn {
    padding: 8px 20px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.sort-btn:hover,
.sort-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(255,107,53,0.1);
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 40px 0;
}

.page-btn {
    padding: 10px 18px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.page-btn:hover,
.page-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(255,107,53,0.1);
}

.page-dots {
    padding: 10px 5px;
    color: var(--gray);
}

/* 商品详情页 */
.product-detail {
    display: flex;
    gap: 40px;
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: var(--shadow);
}

.detail-images {
    flex: 0 0 450px;
}

.detail-main-image {
    width: 100%;
    height: 450px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--light-gray);
    margin-bottom: 15px;
}

.detail-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-thumbs {
    display: flex;
    gap: 10px;
}

.detail-thumb {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.detail-thumb:hover,
.detail-thumb.active {
    border-color: var(--primary);
}

.detail-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-info {
    flex: 1;
}

.detail-name {
    font-size: 24px;
    margin-bottom: 15px;
    line-height: 1.4;
}

.detail-desc {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 20px;
    line-height: 1.8;
}

.detail-price-box {
    background: rgba(255,107,53,0.1);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.detail-price {
    font-size: 32px;
    color: var(--primary);
    font-weight: bold;
}

.detail-original-price {
    font-size: 16px;
    color: var(--gray);
    text-decoration: line-through;
    margin-left: 15px;
}

.detail-meta {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
    font-size: 14px;
    color: var(--gray);
}

.detail-actions {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 15px 40px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: rgba(255,107,53,0.1);
}

/* 相关商品 */
.related-section {
    margin: 40px 0;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .banner-layout {
        grid-template-columns: 1fr;
        height: auto;
    }
    .banner-side-panel { display: none; }
    .banner-main { height: 180px; }
    
    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .promo-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .ad-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .header-main {
        flex-wrap: wrap;
    }
    
    .search-box {
        order: 3;
        flex: 100%;
        max-width: 100%;
        margin-top: 15px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .promo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .ad-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .product-detail {
        flex-direction: column;
    }
    
    .detail-images {
        flex: none;
    }
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 50px;
    color: var(--gray);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--gray);
}

.empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-text {
    font-size: 18px;
}

/* 搜索页筛选栏 */
.search-page {
    min-height: 500px;
}

.search-filter {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.filter-group {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.filter-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.filter-group label {
    flex-shrink: 0;
    width: 80px;
    font-size: 14px;
    color: var(--gray);
    margin-right: 15px;
    padding-top: 6px;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filter-options a {
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--dark);
    background: var(--light-gray);
    transition: all 0.2s;
}

.filter-options a:hover {
    color: var(--primary);
    background: rgba(255, 107, 53, 0.1);
}

.filter-options a.active {
    color: white;
    background: var(--primary);
}

.search-keyword {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.search-keyword strong {
    color: var(--primary);
}

/* 无结果 */
.no-result {
    text-align: center;
    padding: 80px 20px;
    background: white;
    border-radius: 12px;
}

.no-result-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.no-result p {
    font-size: 18px;
    color: var(--gray);
    margin-bottom: 20px;
}

/* 面包屑 */
.breadcrumb {
    padding: 15px 0;
    font-size: 13px;
    color: var(--gray);
}

.breadcrumb a {
    color: var(--gray);
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb span {
    margin: 0 8px;
}

/* 商品详情页样式 */
.product-detail-left {
    flex: 0 0 450px;
}

.product-main-image {
    width: 100%;
    height: 450px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--light-gray);
}

.product-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-detail-right {
    flex: 1;
}

.product-detail-name {
    font-size: 24px;
    font-weight: bold;
    color: var(--dark);
    margin-bottom: 20px;
    line-height: 1.4;
}

.product-detail-price {
    background: rgba(255, 107, 53, 0.1);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
}

.price-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px;
}

.price-label {
    font-size: 14px;
    color: var(--primary);
}

.price-current-large {
    font-size: 36px;
    font-weight: bold;
    color: var(--primary);
}

.price-original-large {
    font-size: 16px;
    color: var(--gray);
    text-decoration: line-through;
}

.price-discount-tag {
    background: var(--primary);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
}

.product-detail-meta {
    display: flex;
    gap: 30px;
    margin-bottom: 25px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-label {
    font-size: 14px;
    color: var(--gray);
}

.meta-value {
    font-size: 14px;
    color: var(--dark);
    font-weight: 500;
}

.product-detail-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.btn-large {
    padding: 15px 40px;
    font-size: 16px;
    border-radius: 25px;
}

.product-detail-services {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.service-tag {
    font-size: 13px;
    color: var(--success);
    background: rgba(76, 175, 80, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
}

.product-detail-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: var(--shadow);
}

.product-description {
    font-size: 15px;
    line-height: 1.8;
    color: var(--dark);
}

.product-description p {
    margin-bottom: 15px;
}

/* 商品缩略图 */
.product-thumbnails {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.thumbnail-item {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.thumbnail-item:hover {
    border-color: var(--primary);
}

.thumbnail-item.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(255, 107, 53, 0.3);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 推荐购买标签 */
.recommend-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b35, #ff8c5a);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    margin-right: 8px;
    vertical-align: middle;
}

/* 谷歌风格搜索结果 */
.search-result-item {
    display: flex;
    gap: 16px;
    background: white;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.search-result-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* 搜索结果小logo样式 - 正方形、圆角 */
.search-result-logo {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--light-gray);
    cursor: pointer;
    transition: transform 0.3s;
}

.search-result-logo:hover {
    transform: scale(1.05);
}

.search-result-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-content {
    flex: 1;
    min-width: 0;
}

.search-result-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 6px;
    display: block;
    text-decoration: none;
}

.search-result-title:hover {
    text-decoration: underline;
}

.search-result-price {
    font-size: 20px;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 8px;
}

.search-result-desc {
    font-size: 13px;
    color: var(--gray);
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-result-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--gray);
    margin-bottom: 10px;
}

.search-result-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.search-result-actions .btn {
    padding: 6px 16px;
    font-size: 13px;
}

/* 系统推荐建议 */
.ai-recommendation {
    background: linear-gradient(135deg, #fff5f0, #fff);
    border: 1px solid rgba(255, 107, 53, 0.15);
    border-radius: 12px;
    padding: 20px;
    margin: 18px 0;
}

.ai-recommendation-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.ai-recommendation-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.ai-recommendation-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
}

.ai-recommendation-badge {
    font-size: 11px;
    color: var(--primary);
    background: rgba(255,107,53,0.1);
    padding: 2px 8px;
    border-radius: 10px;
    margin-left: auto;
}

.ai-recommendation-content {
    font-size: 14px;
    color: var(--gray);
    line-height: 1.7;
    margin-bottom: 14px;
}

.ai-recommendation-products {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.ai-product-card {
    flex-shrink: 0;
    width: 100%;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s, box-shadow 0.3s;
}

.ai-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.ai-product-card:hover {
    transform: translateY(-3px);
}

.ai-product-card img {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.ai-product-card-info {
    padding: 10px;
}

.ai-product-card-name {
    font-size: 12px;
    color: var(--dark);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    height: 34px;
    margin-bottom: 6px;
}

.ai-reason {
    font-size: 11px;
    color: #e65100;
    background: #fff3e0;
    padding: 3px 6px;
    border-radius: 4px;
    line-height: 1.5;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ai-product-card-price {
    font-size: 14px;
    font-weight: bold;
    color: var(--primary);
    margin-top: 5px;
}

/* 智能推荐区域 */
.smart-recommendations {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.smart-recommendations-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary);
}

.smart-recommendations-icon {
    font-size: 24px;
}

.smart-recommendations-header h3 {
    font-size: 18px;
    color: var(--dark);
    margin: 0;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 80px;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(255,107,53,0.4);
    transition: opacity 0.3s, transform 0.2s;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}
.back-to-top:hover { transform: scale(1.1); }

/* =====================================================
   响应式设计 - 平板端（≤1024px）
   ===================================================== */
@media (max-width: 1024px) {
    .container { max-width: 100%; padding: 0 12px; }
    .products-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
    .banner-side-panel { display: none; }
    .banner-main { width: 100%; }
    .banner-layout { grid-template-columns: 1fr; height: auto; }
    .banner-main { height: 180px; }
    /* 平板端隐藏顶部小栏（商家登录/帮助中心） */
    .header-top { display: none !important; }
}

/* =====================================================
   响应式设计 - 移动端（≤768px）
   ===================================================== */
@media (max-width: 768px) {
    /* 基础布局 */
    .container { padding: 0 10px; }
    
    /* 顶部导航 - 强制隐藏商家登录/帮助中心栏 */
    .header-top { display: none !important; }
    /* header-top-right 内链接横排，避免竖排 */
    .header-top-right {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: center;
        gap: 10px;
        white-space: nowrap;
    }
    .header-top-right a { white-space: nowrap; }
    
    /* 压缩 header 高度 */
    .header-main { padding: 8px 0; gap: 8px; flex-wrap: nowrap; }
    .logo { gap: 6px; }
    .logo span:last-child { font-size: 15px; }
    .logo-icon { font-size: 20px; }
    
    /* 搜索框 */
    .search-box { flex: 1; min-width: 0; }
    .search-box input {
        font-size: 16px; /* 防止 iOS 自动缩放 */
        padding: 8px 90px 8px 14px;
        border-radius: 20px 0 0 20px;
    }
    .search-box button { padding: 8px 12px; font-size: 13px; }
    
    /* 分类导航 */
    .nav-bar { overflow: hidden; }
    .nav-categories {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0;
        padding: 0;
    }
    .nav-categories::-webkit-scrollbar { display: none; }
    .nav-categories li { flex-shrink: 0; }
    .nav-categories li a { padding: 10px 14px; font-size: 13px; white-space: nowrap; }
    
    /* 轮播图 */
    .banner-layout { grid-template-columns: 1fr; height: auto; }
    .banner-main { width: 100%; border-radius: 10px; height: 140px; }
    .banner-side-panel { display: none; }
    .banner-slides { height: 140px; border-radius: 10px; }
    .banner-slide img { border-radius: 10px; }
    .banner-content h2 { font-size: 16px; }
    .banner-dots { bottom: 8px; }
    .banner-dot { width: 6px; height: 6px; }
    
    /* 分类网格 - 横向滚动单行，名称不换行 */
    .category-section { overflow: hidden; }
    .category-grid {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 8px;
        padding: 4px 0 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .category-grid::-webkit-scrollbar { display: none; }
    .category-item {
        flex: 0 0 auto;
        width: 76px;          /* 加宽以容纳4个汉字 */
        padding: 10px 4px;
        text-align: center;
    }
    .category-icon { font-size: 28px; margin-bottom: 6px; }
    .category-name {
        font-size: 12px;
        white-space: nowrap;  /* 强制单行，不换行 */
        overflow: hidden;
        text-overflow: ellipsis;
        display: block;
        width: 100%;
    }
    
    /* 促销区 */
    .promo-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .promo-item { padding: 10px 8px; border-radius: 8px; min-height: 70px; }
    .promo-media { height: 50px; }
    .promo-title { font-size: 13px; }
    .promo-subtitle { font-size: 11px; }
    .promo-badge { top: 6px; right: 6px; padding: 2px 6px; font-size: 10px; }
    
    /* 商品网格 */
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .product-card { padding: 10px; border-radius: 10px; }
    .product-image { height: 140px; }
    .product-name { font-size: 13px; -webkit-line-clamp: 2; }
    .product-price { font-size: 16px; }
    .product-meta { font-size: 11px; }
    
    /* 搜索结果 */
    .search-result-logo { width: 60px; height: 60px; border-radius: 8px; }
    .search-result-title { font-size: 14px; }
    .search-result-price { font-size: 15px; }
    .search-result-desc { font-size: 12px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .search-result-actions { gap: 6px; }
    .btn-primary, .btn-secondary { font-size: 12px; padding: 5px 10px; }
    
    /* 广告卡片 */
    .search-ad-thumb { width: 60px; height: 60px; }
    .search-ad-title { font-size: 13px; }
    .search-ad-desc { font-size: 12px; -webkit-line-clamp: 2; }
    
    /* 筛选栏 */
    .filter-options { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .filter-options::-webkit-scrollbar { display: none; }
    .filter-options a { flex-shrink: 0; font-size: 12px; padding: 4px 10px; }
    
    /* AI推荐 */
    .ai-recommendation { margin-top: 15px; padding: 14px; }
    .ai-recommendation-products { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    
    /* 分页 */
    .pagination { gap: 4px; }
    .page-btn { padding: 6px 10px; font-size: 13px; min-width: 32px; }
    
    /* 页脚 */
    .footer-links { flex-wrap: wrap; gap: 10px; justify-content: center; }
    .footer-bottom { text-align: center; font-size: 12px; }

    /* 浮动按钮（移动端返回顶部） */
    .back-to-top { width: 40px; height: 40px; font-size: 16px; right: 12px; bottom: 16px; }
}

/* =====================================================
   响应式设计 - 小屏手机（≤480px）
   ===================================================== */
@media (max-width: 480px) {
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .category-grid { gap: 6px; }
    .category-item { width: 60px; padding: 8px 3px; }
    .category-icon { font-size: 20px; }
    .category-name { font-size: 10px; }
    .banner-main { height: 130px; }
    .banner-slides { height: 130px; }
    .promo-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .promo-item { padding: 8px 6px; min-height: 60px; }
    .promo-media { height: 40px; margin-bottom: 6px; }
    .promo-title { font-size: 12px; }
    .promo-subtitle { font-size: 10px; }
    .ai-recommendation-products { grid-template-columns: repeat(2, 1fr); }
    .search-page { padding: 0; }
    .search-filter { padding: 10px; margin-bottom: 10px; }
}

/* =====================================================
   触摸设备优化
   ===================================================== */
@media (hover: none) and (pointer: coarse) {
    /* 触摸设备：增大点击区域 */
    .btn-primary, .btn-secondary { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
    .product-card { -webkit-tap-highlight-color: rgba(255,107,53,0.1); }
    .nav-categories li a { min-height: 40px; display: flex; align-items: center; }
    /* 移除 hover 效果，改为 active */
    .product-card:hover { transform: none; box-shadow: var(--shadow); }
    .product-card:active { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
}

/* =====================================================
   打印优化
   ===================================================== */
@media print {
    .header, .nav-bar, .footer, .search-box, .banner-section,
    .promo-section, .search-filter, .pagination, .btn-primary,
    .btn-secondary, .back-to-top { display: none !important; }
    .container { max-width: 100%; padding: 0; }
    .product-card { page-break-inside: avoid; border: 1px solid #eee; }
}
