/**
 * 移动端优化样式 - 参考1688风格
 * 特点：简洁、紧凑、信息密度高、卡片式设计
 */

/* ========== 移动端基础优化 (≤768px) ========== */
@media (max-width: 768px) {
  
  /* 全局重置 */
  * {
    -webkit-tap-highlight-color: transparent;
  }
  
  body {
    background: #f5f5f5 !important;
    padding-bottom: 60px; /* 为底部导航留空间 */
  }
  
  /* 容器优化 - 1688风格：无左右边距 */
  .container {
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
  }
  
  /* ========== 顶部导航栏 - 1688风格 ========== */
  .site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }
  
  .site-header .bar {
    height: 44px !important;
    padding: 0 12px !important;
    gap: 8px !important;
    background: #fff;
  }
  
  .site-logo {
    font-size: 16px !important;
    font-weight: 600 !important;
    white-space: nowrap;
    flex-shrink: 0;
  }
  
  .site-search {
    flex: 1;
    gap: 6px !important;
    min-width: 0;
  }
  
  .site-search input[type="search"],
  .site-search input[type="text"] {
    flex: 1;
    min-width: 0 !important;
    height: 32px !important;
    font-size: 14px !important;
    padding: 0 12px !important;
    border-radius: 16px !important;
    background: #f5f5f5 !important;
    border: none !important;
  }
  
  .search-ad-small {
    width: 40px !important;
    height: 32px !important;
    flex-shrink: 0;
  }
  
  /* ========== 模块标题 - 1688风格 ========== */
  .section-header,
  .hot-search-header {
    padding: 12px 12px 8px !important;
    margin-bottom: 0 !important;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
  }
  
  .section-header h2,
  .hot-search-header h3 {
    font-size: 16px !important;
    font-weight: 600 !important;
    margin: 0 !important;
    color: #333;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  
  .section-header p {
    display: none; /* 移动端隐藏副标题 */
  }
  
  /* ========== 热门搜索 - 1688风格 ========== */
  .hot-searches {
    background: #fff;
    margin: 0 !important;
    padding-bottom: 8px !important;
  }
  
  .hot-search-tags {
    padding: 8px 12px !important;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .hot-tag {
    padding: 4px 12px !important;
    margin: 0 !important;
    font-size: 12px !important;
    background: #f5f5f5 !important;
    border-radius: 12px !important;
    color: #666 !important;
    border: none !important;
    transition: all 0.2s;
  }
  
  .hot-tag:active {
    background: #e0e0e0 !important;
    transform: scale(0.98);
  }
  
  /* ========== 产品卡片 - 1688风格：2列网格 ========== */
  .category-section {
    margin: 0 !important;
    padding: 0 !important;
    background: #fff;
    margin-bottom: 8px !important;
  }
  
  .row.g-4 {
    margin: 0 !important;
    padding: 8px !important;
    row-gap: 8px !important;
    column-gap: 8px !important;
  }
  
  /* 强制2列布局 */
  .row .col-lg-3,
  .row .col-lg-4,
  .row .col-md-4,
  .row .col-md-6 {
    width: calc(50% - 4px) !important;
    flex: 0 0 calc(50% - 4px) !important;
    max-width: calc(50% - 4px) !important;
    padding: 0 !important;
  }
  
  /* 产品卡片样式 - 1688风格 */
  .product-card {
    background: #fff !important;
    border: 1px solid #f0f0f0 !important;
    border-radius: 8px !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    height: 100%;
  }
  
  .product-card:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }
  
  .product-card-img {
    width: 100% !important;
    height: 140px !important;
    background: #fafafa !important;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
  }
  
  .product-card-img i {
    font-size: 48px !important;
    color: #d0d0d0 !important;
  }
  
  .product-card-body {
    padding: 8px !important;
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  
  .product-card-title {
    font-size: 13px !important;
    line-height: 1.4 !important;
    margin-bottom: 6px !important;
    color: #333;
    font-weight: 400;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 36px;
  }
  
  .product-card-title a {
    color: #333 !important;
  }
  
  .product-card-desc {
    display: none; /* 移动端隐藏描述 */
  }
  
  .product-card-price {
    color: #ff5000 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    margin: 4px 0 !important;
  }
  
  .product-card-meta {
    font-size: 11px !important;
    color: #999 !important;
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 4px;
  }
  
  .product-card-meta span {
    display: flex;
    align-items: center;
    gap: 2px;
  }
  
  /* ========== 公司卡片 - 1688风格 ========== */
  .company-card {
    background: #fff !important;
    border: 1px solid #f0f0f0 !important;
    border-radius: 8px !important;
    padding: 10px !important;
    margin: 0 !important;
  }
  
  .company-card .d-flex {
    margin-bottom: 8px !important;
  }
  
  .company-logo {
    width: 40px !important;
    height: 40px !important;
    border-radius: 4px !important;
    flex-shrink: 0;
  }
  
  .company-logo i {
    font-size: 20px !important;
  }
  
  .company-name {
    font-size: 13px !important;
    margin: 0 !important;
    line-height: 1.4;
  }
  
  .company-name a {
    color: #333 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .company-intro {
    font-size: 11px !important;
    color: #999 !important;
    margin-bottom: 6px !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .company-info {
    font-size: 11px !important;
    color: #999 !important;
  }
  
  .company-info div {
    margin-bottom: 2px !important;
  }
  
  /* ========== 商机卡片 - 1688风格 ========== */
  .opportunity-card {
    background: #fff !important;
    border: 1px solid #f0f0f0 !important;
    border-radius: 8px !important;
    padding: 10px !important;
    margin: 0 !important;
    position: relative;
  }
  
  .opportunity-card.hot {
    border-color: #ff5000 !important;
  }
  
  .opportunity-card .badge {
    font-size: 10px !important;
    padding: 2px 6px !important;
    margin-right: 4px !important;
    margin-bottom: 6px !important;
  }
  
  .opportunity-card h6 {
    font-size: 13px !important;
    margin-bottom: 8px !important;
    line-height: 1.4;
    color: #333;
  }
  
  .opportunity-card h6 a {
    color: #333 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .opportunity-amount {
    color: #ff5000 !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    margin-bottom: 6px !important;
  }
  
  .opportunity-card .d-flex {
    font-size: 11px !important;
    color: #999 !important;
  }
  
  /* ========== 资讯卡片 - 1688风格 ========== */
  .news-card {
    border: 1px solid #f0f0f0 !important;
    border-radius: 8px !important;
    overflow: hidden;
    margin: 0 !important;
  }
  
  .news-card .card-img-top {
    height: 100px !important;
    background: #fafafa !important;
  }
  
  .news-card .card-img-top i {
    font-size: 36px !important;
    color: #d0d0d0 !important;
  }
  
  .news-card .card-body {
    padding: 8px !important;
  }
  
  .news-card .card-title {
    font-size: 13px !important;
    margin-bottom: 4px !important;
    line-height: 1.4;
    color: #333;
  }
  
  .news-card .card-title a {
    color: #333 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .news-card .card-text {
    display: none; /* 移动端隐藏摘要 */
  }
  
  .news-card .badge {
    font-size: 10px !important;
    padding: 2px 6px !important;
    margin-right: 4px !important;
    margin-bottom: 4px !important;
  }
  
  .news-card .text-muted {
    font-size: 11px !important;
    color: #999 !important;
  }
  
  /* ========== 行业应用/服务/特色 - 1688风格 ========== */
  .industry-applications,
  .services-support,
  .tech-features {
    background: #fff;
    margin: 0 0 8px 0 !important;
    padding: 0 !important;
  }
  
  .industry-grid,
  .services-grid,
  .features-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    padding: 8px !important;
  }
  
  .industry-card,
  .service-card,
  .feature-card {
    background: #fff !important;
    border: 1px solid #f0f0f0 !important;
    border-radius: 8px !important;
    padding: 0 !important;
    overflow: hidden;
  }
  
  .industry-image,
  .feature-image {
    height: 100px !important;
    width: 100%;
    overflow: hidden;
  }
  
  .industry-image img,
  .feature-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .industry-content,
  .feature-content {
    padding: 8px !important;
  }
  
  .industry-content h3,
  .service-card h3,
  .feature-content h3 {
    font-size: 13px !important;
    margin-bottom: 4px !important;
    color: #333;
  }
  
  .industry-content p,
  .service-card p,
  .feature-content p {
    font-size: 11px !important;
    color: #999;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .service-icon {
    font-size: 32px !important;
    margin-bottom: 6px !important;
  }
  
  .service-card {
    padding: 12px !important;
    text-align: center;
  }
  
  /* ========== 供应商榜单 - 1688风格 ========== */
  .supplier-rating-card {
    background: #fff !important;
    border: 1px solid #f0f0f0 !important;
    border-radius: 8px !important;
    padding: 10px !important;
    margin: 0 !important;
    text-align: center;
  }
  
  .supplier-rating-card h6 {
    font-size: 13px !important;
    margin-bottom: 6px !important;
    color: #333;
  }
  
  .supplier-badge {
    font-size: 10px !important;
    padding: 3px 8px !important;
    margin-bottom: 6px !important;
  }
  
  .certification-tag {
    font-size: 9px !important;
    padding: 2px 5px !important;
    margin: 2px !important;
  }
  
  /* ========== 行业报告 - 1688风格 ========== */
  .premium-report-card {
    background: #fff !important;
    border: 1px solid #f0f0f0 !important;
    border-radius: 8px !important;
    padding: 10px !important;
    margin: 0 !important;
    position: relative;
  }
  
  .report-icon-wrapper {
    height: 70px !important;
    margin-bottom: 6px !important;
  }
  
  .report-icon {
    font-size: 36px !important;
  }
  
  .premium-report-card h6 {
    font-size: 13px !important;
    margin-bottom: 4px !important;
    color: #333;
  }
  
  .premium-report-card p {
    font-size: 11px !important;
    color: #999;
    margin-bottom: 6px !important;
  }
  
  .report-stats span {
    font-size: 10px !important;
    color: #999;
  }
  
  .btn-sm {
    font-size: 12px !important;
    padding: 6px 12px !important;
    width: 100%;
    margin-top: 6px;
  }
  
  /* ========== 行业指标 - 1688风格 ========== */
  .category-section.bg-light {
    background: #fff !important;
    padding: 0 !important;
    margin-bottom: 8px !important;
  }
  
  .indicator-card {
    background: #fff !important;
    border: 1px solid #f0f0f0 !important;
    border-radius: 8px !important;
    padding: 10px !important;
    margin: 0 !important;
    text-align: center;
  }
  
  .indicator-value {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #333;
    margin: 4px 0 !important;
  }
  
  .indicator-change {
    font-size: 11px !important;
  }
  
  .data-update-time {
    font-size: 9px !important;
    color: #999;
    margin-top: 4px !important;
  }
  
  /* 指标保持2列 */
  .row .col-lg-2 {
    width: calc(50% - 4px) !important;
    flex: 0 0 calc(50% - 4px) !important;
    max-width: calc(50% - 4px) !important;
    padding: 0 !important;
  }
  
  /* ========== 新闻内容区 - 1688风格 ========== */
  .news-section {
    background: #fff;
    margin: 0 0 8px 0 !important;
    padding: 0 !important;
  }
  
  .news-content {
    display: block !important;
    padding: 8px !important;
  }
  
  .news-item {
    background: #fff !important;
    border: 1px solid #f0f0f0 !important;
    border-radius: 8px !important;
    padding: 10px !important;
    margin-bottom: 8px !important;
  }
  
  .news-item.featured {
    margin-bottom: 8px !important;
  }
  
  .news-image {
    height: 120px !important;
    border-radius: 6px !important;
    margin-bottom: 8px !important;
    overflow: hidden;
  }
  
  .news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  .news-item h3,
  .news-item h4 {
    font-size: 14px !important;
    margin-bottom: 4px !important;
    color: #333;
    line-height: 1.4;
  }
  
  .news-item p {
    font-size: 12px !important;
    color: #999;
    margin-bottom: 6px !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .news-meta {
    font-size: 11px !important;
    color: #999;
  }
  
  /* ========== 合作伙伴 - 1688风格 ========== */
  .partners-section {
    background: #fff;
    margin: 0 0 8px 0 !important;
    padding: 0 !important;
  }
  
  .partners-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
    padding: 8px !important;
  }
  
  .partner-logo {
    height: 50px !important;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
  }
  
  .partner-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }
  
  /* ========== 信息流 - 1688风格 ========== */
  .latest-feeds {
    background: #fff;
    margin: 0 0 8px 0 !important;
    padding: 0 !important;
  }
  
  .feed {
    list-style: none;
    padding: 8px !important;
    margin: 0 !important;
  }
  
  .feed-item {
    background: #fff !important;
    border: 1px solid #f0f0f0 !important;
    border-radius: 8px !important;
    padding: 10px !important;
    margin-bottom: 8px !important;
  }
  
  .feed-item:last-child {
    margin-bottom: 0 !important;
  }
  
  .feed-title {
    font-size: 13px !important;
    margin-bottom: 4px !important;
    color: #333;
    line-height: 1.4;
  }
  
  .feed-summary {
    font-size: 12px !important;
    color: #999;
    margin-bottom: 6px !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .feed-meta {
    font-size: 11px !important;
    color: #999;
    display: flex;
    justify-content: space-between;
  }
  
  /* ========== 按钮优化 ========== */
  .btn-load-more,
  .load-more-container {
    padding: 12px !important;
    text-align: center;
  }
  
  .btn-load-more,
  .load-more-container a {
    display: inline-block;
    padding: 10px 24px !important;
    font-size: 14px !important;
    border-radius: 20px !important;
    background: #ff5000 !important;
    color: #fff !important;
    border: none;
  }
  
  /* ========== Footer优化 ========== */
  .site-footer {
    background: #fff;
    padding: 20px 12px !important;
    margin-top: 0 !important;
    border-top: 1px solid #f0f0f0;
  }
  
  .footer-main {
    flex-direction: column !important;
    gap: 15px !important;
  }
  
  .footer-brand h4 {
    font-size: 15px !important;
    margin-bottom: 4px !important;
  }
  
  .footer-brand p {
    font-size: 12px !important;
    color: #999;
  }
  
  .footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px !important;
  }
  
  .footer-links a {
    color: #666 !important;
  }
  
  .footer-company-info h4 {
    font-size: 14px !important;
    margin-bottom: 8px !important;
  }
  
  .company-contact p {
    font-size: 11px !important;
    color: #999;
    margin-bottom: 4px !important;
  }
  
  .footer-copyright {
    font-size: 10px !important;
    color: #999;
  }
  
  /* ========== VIP标签优化 ========== */
  .vip-badge {
    padding: 0.1rem 0.4rem !important;
    font-size: 9px !important;
  }
  
  .vip-badge-inline {
    margin-left: 0.3rem !important;
    padding: 0.1rem 0.3rem !important;
  }
  
  /* ========== 广告位优化 ========== */
  .ad-1,
  .ad-type-1,
  .ad-type-2,
  .ad-type-3,
  .ad-type-4,
  .ad-type-5 {
    margin: 8px 0 !important;
    padding: 0 !important;
    min-height: 50px !important;
    background: #fafafa;
    border-radius: 6px;
  }
  
  /* ========== 隐藏不必要的元素 ========== */
  .section-header p,
  .product-card-desc,
  .news-card .card-text {
    display: none !important;
  }
  
  /* ========== 底部固定导航栏（可选，参考1688） ========== */
  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 1000;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
  }
  
  .mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #999;
    font-size: 10px;
    text-decoration: none;
    flex: 1;
  }
  
  .mobile-bottom-nav a.active {
    color: #ff5000;
  }
  
  .mobile-bottom-nav i {
    font-size: 20px;
  }
}

/* ========== 超小屏幕优化 (≤576px) ========== */
@media (max-width: 576px) {
  
  /* 产品卡片图片稍大 */
  .product-card-img {
    height: 160px !important;
  }
  
  /* 其他保持2列布局 */
}

/* ========== 平板横屏优化 (768-991px) ========== */
@media (min-width: 769px) and (max-width: 991px) {
  
  /* 3列布局 */
  .row .col-lg-3,
  .row .col-lg-4,
  .row .col-md-4 {
    width: calc(33.333% - 6px) !important;
    flex: 0 0 calc(33.333% - 6px) !important;
    max-width: calc(33.333% - 6px) !important;
  }
  
  .row .col-md-6 {
    width: calc(50% - 4px) !important;
    flex: 0 0 calc(50% - 4px) !important;
    max-width: calc(50% - 4px) !important;
  }
  
  /* 指标3列 */
  .row .col-lg-2 {
    width: calc(33.333% - 6px) !important;
    flex: 0 0 calc(33.333% - 6px) !important;
    max-width: calc(33.333% - 6px) !important;
  }
  
  /* 行业网格2列 */
  .industry-grid,
  .services-grid,
  .features-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}
