/* =========================================
   1. 基础与全局变量
   ========================================= */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #f8fafc;              
  --bg-alt: #f1f5f9;          
  --surface: #ffffff;         
  --border: #e2e8f0;          
  --primary: #0f172a;         
  --secondary: #475569;       
  --muted: #94a3b8;           
  --accent: #2563eb;          
  --accent-hover: #1d4ed8;
  --accent-soft: #eff6ff;     
  --radius-sm: 6px;           
  --radius-md: 12px;
  --radius-lg: 16px;
  --font-main: 'Inter', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --max-width: 1400px;        
}

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--secondary);
  font-family: var(--font-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; 
  word-wrap: break-word;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* =========================================
   2. 顶部工具栏与导航
   ========================================= */
.topbar-new { background: #f8fafc; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--secondary); height: 40px; display: flex; align-items: center; }
.topbar-new .container { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.topbar-left { display: flex; gap: 20px; align-items: center; }
.topbar-right { display: flex; gap: 20px; align-items: center; }
.topbar-right a { display: flex; align-items: center; gap: 6px; transition: color 0.2s; color: var(--secondary); text-decoration: none; font-size: 13px; }
.topbar-right a:hover { color: var(--accent); }

.lang-switcher { position: relative; display: inline-block; }
#langBtn { background: #fff; border: 1px solid var(--border); padding: 4px 10px; border-radius: var(--radius-sm); font-size: 12px; cursor: pointer; display: flex; align-items: center; gap: 5px; color: var(--primary); font-weight: 500; }
#langDropdown { display: none; position: absolute; top: 100%; right: 0; margin-top: 5px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 4px 12px rgba(0,0,0,0.1); z-index: 10000; width: 140px; overflow: hidden; }
.lang-dropdown-item { padding: 8px 12px; font-size: 12px; cursor: pointer; border-bottom: 1px solid var(--bg-alt); display: flex; align-items: center; gap: 8px; color: var(--primary); }
.lang-dropdown-item:hover, .lang-dropdown-item.active { background: var(--accent-soft); color: var(--accent); }

.navbar { background: rgba(255, 255, 255, 0.95); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 1000; }
.navbar .container { display: flex; align-items: center; justify-content: space-between; height: 80px; gap: 15px; }
.logo { flex-shrink: 0; width: 200px; display: flex; align-items: center; }
.logo img { height: 48px; width: auto; object-fit: contain; }

.nav-links { flex: 1; display: flex; justify-content: center; gap: 30px; align-items: center; height: 100%; }
.nav-links > a, .nav-item-wrapper > a { font-size: 15px; font-weight: 500; color: var(--primary); position: relative; height: 100%; display: flex; align-items: center; white-space: nowrap; }
.nav-links > a:hover, .nav-item-wrapper:hover > a { color: var(--accent); }
.nav-links a.active { color: var(--accent); font-weight: 600; }
.nav-links a.active::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px; background: var(--accent); }

.nav-icons { flex-shrink: 0; display: flex; gap: 20px; align-items: center; font-size: 18px; color: var(--primary); }
.btn-quote { background: var(--accent); color: #fff; border: none; padding: 10px 20px; border-radius: var(--radius-sm); font-weight: 500; cursor: pointer; font-size: 14px; white-space: nowrap; transition: 0.2s; }
.btn-quote:hover { background: var(--accent-hover); }

.nav-highlight {
  background: linear-gradient(135deg, #ff8c00, #ff5722) !important; 
  color: #fff !important;
  height: 36px !important; line-height: 36px !important; padding: 0 16px !important; 
  border-radius: 18px !important; font-weight: 600 !important; font-size: 14px !important;
  display: inline-flex !important; align-items: center !important; justify-content: center !important;
  box-shadow: 0 2px 8px rgba(255, 87, 34, 0.3) !important; text-decoration: none !important; 
  box-sizing: border-box !important; border: none !important; white-space: nowrap !important; margin-left: 10px;
}
.nav-highlight::after { display: none !important; }
.nav-highlight:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(255, 87, 34, 0.5) !important; }

/* =========================================
   3. PC 端下拉菜单 (已优化为 3 列自适应)
   ========================================= */
.nav-item-wrapper { position: static; display: flex; align-items: center; height: 100%; }
.mega-menu { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); width: 85%; max-width: 1400px; background: #fff; border: 1px solid var(--border); border-top: none; border-radius: 0 0 16px 16px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); display: none; z-index: 999; }
.mega-container { width: 100%; padding: 30px 40px; display: flex; gap: 40px; }
.mega-left { width: 200px; border-right: 1px solid var(--border); padding-right: 20px; }
.mega-left li { padding: 12px 16px; font-size: 15px; color: var(--primary); border-radius: var(--radius-sm); cursor: pointer; display: flex; gap: 12px; align-items: center; }
.mega-left li:hover, .mega-left li.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.mega-right-wrapper { flex: 1; }
/* 这里改成了 repeat(3, 1fr) 强制三列，并加大了 gap */
.mega-panel { display: none; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.mega-panel.active { display: grid; }
.mega-panel h4 { font-size: 16px; color: #111; margin-bottom: 15px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.mega-panel ul li { font-size: 14px; color: #666; cursor: pointer; margin-bottom: 8px;}
.mega-panel ul li:hover { color: var(--accent); }

/* =========================================
   4. 轮播图
   ========================================= */
.hero-carousel { position: relative; width: 100%; height: 450px; background: #0B2447; overflow: hidden; }
.carousel-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.8s ease-in-out; display: flex; align-items: center; }
.carousel-slide.active { opacity: 1; z-index: 10; }
.slide-bg-1 { background: linear-gradient(135deg, #0B2447 0%, #19376D 100%); }
.slide-bg-2 { background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%); }
.slide-bg-3 { background: linear-gradient(135deg, #09121f 0%, #1a2c4d 100%); }
.carousel-content { position: relative; z-index: 20; color: #fff; width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 0 80px; }
.carousel-content h2 { font-size: 38px; font-weight: 800; margin-bottom: 15px; }
.carousel-content p { font-size: 16px; color: #94a3b8; max-width: 600px; margin-bottom: 30px; }
.btn-hero { display: inline-block; border: 1px solid rgba(255,255,255,0.3); color: #fff; padding: 12px 30px; border-radius: var(--radius-sm); font-size: 15px; font-weight: 500; }
.carousel-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; background: rgba(255,255,255,0.1); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; cursor: pointer; z-index: 30; }
.arrow-left { left: 30px; }
.arrow-right { right: 30px; }
.carousel-dots { position: absolute; bottom: 25px; left: 50%; transform: translateX(-50%); display: flex; gap: 12px; z-index: 30; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.3); cursor: pointer; transition: 0.3s; }
.dot.active { background: #fff; width: 24px; border-radius: 4px; }

/* =========================================
   5. 分类栏与区块
   ========================================= */
section { padding: 80px 0; }
.category-bar { border-bottom: 1px solid var(--border); background: #fff; padding: 0; }
.cat-container { display: flex; justify-content: space-between; padding: 0 24px; }
.cat-item { display: flex; flex-direction: column; align-items: center; padding: 25px 0; cursor: pointer; flex: 1; transition: color 0.2s; }
.cat-item:hover { color: var(--accent); }
.cat-icon { font-size: 32px; margin-bottom: 12px; color: #94a3b8; }
.cat-item:hover .cat-icon { color: var(--accent); }
.cat-name { font-size: 15px; font-weight: 600; text-align: center; }

/* =========================================
   6. 核心优势区
   ========================================= */
.features-section { padding: 60px 0; background: #f8f9fa; }
.section-header { text-align: center; margin-bottom: 40px; }
.section-header h2 { font-size: 28px; color: #111; margin-bottom: 10px; }
.section-header p { color: #666; }
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
.feature-card { background: #fff; padding: 30px 20px; border-radius: 8px; border: 1px solid #eee; }
.feature-card i { font-size: 40px; margin-bottom: 15px; }
.feature-card h3 { font-size: 18px; color: #111; margin-bottom: 10px; }
.feature-card p { font-size: 14px; color: #666; line-height: 1.6; }
.icon-blue { color: #0052cc; }
.icon-orange { color: #ff5722; }
.icon-green { color: #00b42a; }
.icon-purple { color: #722ed1; }

/* =========================================
   7. 热门现货区 (B2B 国际大型站专业卡片布局)
   ========================================= */
.hot-products-section { padding: 60px 0; background: #fff; }
.hot-products-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.hot-products-header h2 { font-size: 28px; color: #111; margin-bottom: 10px; }
.hot-products-header p { color: #666; }
.btn-view-more { padding: 10px 20px; background: #0052cc; color: #fff; border-radius: 6px; font-weight: 500; white-space: nowrap; display: inline-block; }

.products-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }

/* === 核心修复：B2B 专业产品卡片 === */
.product-card {
  background: #fff; 
  border: 1px solid #e2e8f0; 
  border-radius: 8px; 
  padding: 20px;
  transition: all 0.3s ease; 
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.product-card:hover { 
  box-shadow: 0 12px 24px rgba(0,0,0,0.08); 
  transform: translateY(-4px); 
  border-color: #cbd5e1;
}

/* 图片容器 - 灰色底、固定比例、图片居中 */
.product-img-box {
  width: 100%;
  aspect-ratio: 1 / 1; /* 强制正方形，大厂标准 */
  background: #f8fafc; 
  display: flex; 
  align-items: center; 
  justify-content: center;
  margin-bottom: 16px; 
  border-radius: 6px; 
  overflow: hidden;
  border: 1px solid #f1f5f9;
}
.product-img-box img { 
  width: 100%; 
  height: 100%; 
  object-fit: contain; /* 保证图片不拉伸，完整显示 */
  padding: 10px;
  transition: transform 0.3s ease;
}
.product-card:hover .product-img-box img {
  transform: scale(1.05); /* 悬浮时图片微微放大，增加高级感 */
}
.product-img-box i { font-size: 40px; color: #cbd5e1; }

/* 产品信息区 */
.product-card h4 {
  font-size: 16px; 
  color: #0f172a; 
  margin-bottom: 8px; 
  font-weight: 600;
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis;
  line-height: 1.4;
}
.product-card .product-brand {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 12px;
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis;
}
.product-card .product-stock {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 12px;
}
.product-card .product-price { 
  color: #2563eb; 
  font-weight: 700; 
  font-size: 18px; 
  margin-top: auto; /* 把价格推到最底部，保持对齐 */
}

/* =========================================
   8. Footer
   ========================================= */
footer { background: #0a192f; color: #94a3b8; padding: 40px 0 20px; font-size: 13px; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 30px; }
.footer-grid h3 { color: #fff; font-size: 15px; margin-bottom: 15px; }
.footer-grid ul { padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; line-height: 1.5; }
.footer-grid a { color: #94a3b8; transition: 0.2s; }
.footer-grid a:hover { color: #fff; }
.footer-grid i { color: #3b82f6; width: 16px; text-align: center; margin-right: 5px; }
.copyright { border-top: 1px solid #1e3358; padding-top: 20px; text-align: center; font-size: 12px; color: #64748b; }

/* =========================================
   9. B2B 大型企业标准移动端重构
   ========================================= */
.mobile-only-wrap { display: none !important; } 

@media (max-width: 768px) {
  .topbar-new { height: auto; padding: 10px 0; display: block; }
  .topbar-new .container { flex-direction: column; gap: 10px; }
  .topbar-left { justify-content: center; text-align: center; font-size: 12px; }
  .topbar-right { justify-content: center; flex-wrap: wrap; gap: 15px; }

  .navbar .container { flex-direction: column; height: auto; gap: 10px; padding: 12px 10px; }
  .logo { width: 100%; justify-content: center; margin-bottom: 5px; }
  
  .nav-links { 
    display: flex !important; width: 100%; overflow-x: auto; 
    justify-content: flex-start; padding: 5px 0 10px 0; gap: 20px; 
    -webkit-overflow-scrolling: touch;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links > a, .nav-item-wrapper > a { font-size: 14px; height: 40px; white-space: nowrap; flex-shrink: 0; }
  .nav-item-wrapper .mega-menu { display: none !important; }
  
  .nav-highlight { height: 30px !important; line-height: 30px !important; padding: 0 12px !important; font-size: 13px !important; margin-top: 5px; margin-left: 0; }

  .nav-icons { width: 100%; justify-content: center; gap: 30px; margin-top: 5px; }
  .nav-icons .btn-quote { display: none; }

  .mobile-only-wrap { display: block !important; width: 100%; padding: 0 15px 10px; background: #fff; }
  .mobile-menu-btn { background: #f0f5ff; color: #0052cc; font-weight: 600; text-align: center; padding: 12px; border-radius: 8px; font-size: 14px; margin-bottom: 10px; }
  .mobile-menu-content { border-top: 1px solid #eee; padding: 15px 0; }
  .mobile-menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .mobile-menu-grid a, .mobile-menu-grid div { padding: 12px; background: #f8f9fa; border-radius: 8px; text-align: center; font-weight: 500; color: #333; }
  .mobile-menu-grid .highlight-item { background: #fff0f0; color: #ff5722; border: 1px solid #ffccbc; }

  section { padding: 30px 0; }
  .hero-carousel { height: 250px; }
  .carousel-content { padding: 0 20px; text-align: center; }
  .carousel-content h2 { font-size: 22px; line-height: 1.3; }
  .carousel-content p { font-size: 13px; margin-bottom: 20px; }
  .carousel-arrow { display: none; }

  .cat-container { display: grid !important; grid-template-columns: repeat(3, 1fr); gap: 15px 10px; padding: 15px 10px; }
  .cat-item { padding: 10px 0; width: 100%; }
  .cat-icon { font-size: 26px; margin-bottom: 8px; }
  .cat-name { font-size: 13px; line-height: 1.2; word-break: break-word; }

  .features-section { padding: 40px 0; }
  .section-header h2 { font-size: 22px; }
  .section-header p { font-size: 13px; }
  .features-grid { grid-template-columns: 1fr !important; gap: 15px; }
  .feature-card { padding: 20px 15px; display: flex; flex-direction: column; align-items: center; }
  .feature-card h3 { font-size: 16px; margin-bottom: 8px; }
  .feature-card p { font-size: 13px; }

  .hot-products-header { flex-direction: column; align-items: flex-start; gap: 15px; margin-bottom: 20px; }
  .hot-products-header h2 { font-size: 22px; }
  .hot-products-header p { font-size: 13px; }
  .btn-view-more { width: 100%; text-align: center; padding: 12px; }
  
  .products-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px; }
  .product-card { padding: 12px; }
  .product-card h4 { font-size: 14px; }
  .product-card .product-price { font-size: 16px; }
  .product-card .product-brand { font-size: 12px; }
  .product-card .product-stock { font-size: 12px; }
  .product-img-box { margin-bottom: 10px; }

  .footer-grid { grid-template-columns: 1fr !important; gap: 30px; text-align: center; }
  .footer-grid i { margin-right: 0; display: block; margin: 0 auto 5px; }
}