/* ================= 基础重置 ================= */
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Microsoft YaHei", sans-serif; color: #333; background: #fff; line-height: 1.6; }
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: none; }
img { max-width: 100%; height: auto; border: 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ================= 顶部导航 ================= */
.nav-main { background: #222; }
.nav-main ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.nav-main li { position: relative; }
.nav-main a { display: block; color: #fff; padding: 14px 22px; text-decoration: none; font-size: 18px; }
.nav-main a:hover { background: #444; color: #fff; }
.nav-main li > ul { display: none; position: absolute; top: 100%; left: 0; background: #333; min-width: 160px; z-index: 99; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
.nav-main li > ul a { padding: 10px 16px; font-size: 14px; }

/* 桌面端：恢复悬停显示 (直接匹配你的 li > ul 结构) */
@media (min-width: 769px) {
  .nav-main li:hover > ul { display: block; }
}

.nav-sub { background: #f5f5f5; border-bottom: 1px solid #e5e5e5; }
.nav-sub ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.nav-sub a { display: block; padding: 8px 16px; color: #555; text-decoration: none; font-size: 14px; }
.nav-sub a:hover { color: #2563eb; }

/* ================= 轮播图 ================= */
.slider { position: relative; width: 100%; height: 420px; overflow: hidden; margin: 20px 0; border-radius: 8px; background: #eee; }
.slider .slide { display: none; position: absolute; inset: 0; }
.slider .slide.active { display: block; }
.slider .slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slider .dots { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; z-index: 5; }
.slider .dots span { display: inline-block; width: 12px; height: 12px; background: rgba(255,255,255,.55); border-radius: 50%; margin: 0 5px; cursor: pointer; transition: .2s; }
.slider .dots span.active { background: #fff; transform: scale(1.2); }

/* ================= 页面布局 ================= */
.breadcrumb { padding: 14px 0; color: #666; font-size: 14px; }
.breadcrumb a { color: #2563eb; }
.layout { display: flex; gap: 24px; align-items: flex-start; margin-bottom: 30px; }
.main { flex: 1; min-width: 0; background: #fff; padding: 20px; border-radius: 6px; border: 1px solid #eee; }
.main h1 { font-size: 22px; margin: 0 0 16px; padding-bottom: 10px; border-bottom: 1px solid #eee; }
.page-content, .article-content, .product-content { line-height: 1.9; color: #333; }

/* ================= 侧边栏 ================= */
.sidebar { width: 280px; flex-shrink: 0; }
.sidebar-box { background: #fafafa; border: 1px solid #eee; border-radius: 6px; padding: 16px; margin-bottom: 16px; }
.sidebar-box h3 { font-size: 16px; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid #eee; color: #222; }
.sidebar-box ul { list-style: none; margin: 0; padding: 0; }
.sidebar-box li { font-size: 14px; line-height: 1.9; color: #555; border-bottom: 1px dashed #eee; padding: 6px 0; }
.sidebar-box li a { color: #555; }
.sidebar-box li a:hover { color: #2563eb; }

/* ================= 底部 ================= */
.footer { border-top: 1px solid #eee; padding: 24px 0; color: #777; font-size: 13px; text-align: center; background: #fafafa; margin-top: 40px; }
.footer a { color: #555; text-decoration: none; margin: 0 8px; }
.footer a:hover { color: #2563eb; }

/* ================= 首页模块 ================= */
.section { padding: 32px 0; }
.section h2 { font-size: 22px; margin: 0 0 16px; color: #222; border-left: 4px solid #2563eb; padding-left: 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card { display: block; padding: 16px; border: 1px solid #eee; border-radius: 6px; color: #333; background: #fff; transition: .2s; }
.card:hover { border-color: #2563eb; box-shadow: 0 2px 12px rgba(37,99,235,.12); transform: translateY(-2px); }

/* ================= 产品图集 ================= */
.product-price { color: #e67e22; font-size: 16px; margin-bottom: 16px; font-weight: bold; }
.gallery { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.gallery img { width: 160px; height: 160px; object-fit: cover; border: 1px solid #eee; border-radius: 4px; }

/* ===== 头部品牌与功能栏 ===== */
.header-top { background: #fff; border-bottom: 1px solid #eee; padding: 12px 0; }
.header-top-inner { display: flex; justify-content: space-between; align-items: center; gap: 20px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #222; flex-shrink: 1; min-width: 0; }
.brand-logo { height: 120px; width: auto; max-width: 220px; object-fit: contain; flex-shrink: 0; }

.brand-name { font-size: 58px; font-weight: bold; letter-spacing: 1px; white-space: nowrap; line-height: 1.2; }
body.lang-en .brand-name { font-size: 34px; letter-spacing: 0; white-space: normal; }

.header-actions { display: flex; align-items: center; gap: 20px; flex-shrink: 0; }
.lang-switch { font-size: 14px; }
.lang-switch a { color: #666; padding: 0 4px; }
.lang-switch a.active { color: #2563eb; font-weight: bold; }
.lang-switch .divider { color: #ddd; margin: 0 2px; }

.search-form { display: flex; align-items: center; border: 1px solid #ddd; border-radius: 20px; overflow: hidden; background: #f8f9fa; flex-shrink: 0; height: 40px; }
.search-form input { border: 0; background: transparent; padding: 8px 14px; outline: none; width: 220px; font-size: 14px; min-width: 0; }
.search-form button { border: 0; background: #2563eb; color: #fff; padding: 0 16px; height: 100%; cursor: pointer; font-size: 14px; flex-shrink: 0; }
.search-form button:hover { background: #1d4ed8; }

.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 30px; }
.pagination a { display: inline-block; padding: 8px 16px; border: 1px solid #eee; border-radius: 4px; color: #333; background: #fff; transition: 0.2s; font-size: 14px; }
.pagination a:hover, .pagination a.active { background: #2563eb; color: #fff; border-color: #2563eb; }

/* ================= 百度白皮书移动端体验优化 ================= */
body { overflow-x: hidden; } 
a, button { touch-action: manipulation; } 

.back-to-top {
  position: fixed; right: 20px; bottom: 80px; width: 44px; height: 44px;
  background: #2563eb; color: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 2px 10px rgba(0,0,0,0.15);
  opacity: 0; visibility: hidden; transition: all 0.3s; z-index: 999;
}
.back-to-top.show { opacity: 1; visibility: visible; }
.back-to-top:hover { background: #1d4ed8; }

.mobile-bottom-bar {
  display: none; position: fixed; bottom: 0; left: 0; right: 0; height: 56px;
  background: #fff; border-top: 1px solid #eee; box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
  z-index: 1000; padding-bottom: env(safe-area-inset-bottom); 
}
.mobile-bottom-bar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #555; font-size: 12px; text-decoration: none; }
.mobile-bottom-bar a:active { background: #f5f5f5; }
.mobile-bottom-bar svg { margin-bottom: 2px; }

/* ================= 移动端专属样式覆盖 (折叠菜单版) ================= */
@media (max-width: 768px) {
  body { padding-bottom: 65px; }
  
  /* 头部优化 */
  .header-top { padding: 10px 0; }
  .header-top-inner { flex-direction: column; gap: 10px; }
  .brand-logo { height: 60px; max-width: 150px; }
  .brand-name { font-size: 24px; white-space: normal; }
  body.lang-en .brand-name { font-size: 20px; }
  .header-actions { width: 100%; justify-content: space-between; gap: 10px; }
  .search-form { flex: 1; height: 36px; }
  .search-form input { width: 100%; padding: 6px 10px; }
  .search-form button { padding: 0 12px; }

  /* 🎯 导航栏改造：默认折叠 */
  .nav-main { position: relative; padding-top: 45px; } /* 留出顶部按钮的空间 */
  
  /* 注入的菜单切换按钮 (绝对定位在顶部右侧) */
  .mobile-menu-btn {
    position: absolute;
    top: 5px;
    right: 15px;
    padding: 6px 15px;
    background: transparent;
    color: #fff;
    border: 1px solid #fff;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    z-index: 10;
  }

  /* 隐藏和显示逻辑：默认隐藏 ul */
  .nav-main .container { display: none; }
  .nav-main.menu-open .container { display: block; } /* 展开时显示 */

  /* 纵向列表样式 */
  .nav-main ul { 
    display: block; 
    margin: 0; 
    padding: 0; 
    border-top: 1px solid #444;
  }
  .nav-main li { 
    border-bottom: 1px solid #444; 
    position: relative; 
  }
  .nav-main a { 
    white-space: normal; 
    padding: 15px 20px; 
    font-size: 16px; 
    display: block;
  }

  /* 箭头样式 */
  .nav-main li.has-sub > a::after {
    content: ''; 
    position: absolute;
    right: 20px;
    top: 50%;
    margin-top: -3px;
    width: 8px;
    height: 8px;
    border-right: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: rotate(45deg); 
    transition: transform 0.3s;
  }
  .nav-main li.has-sub.active > a::after {
    transform: rotate(-135deg); 
    margin-top: 1px;
  }

  /* 子菜单推拉展开 */
  .nav-main li > ul { 
    display: none !important; 
    position: static !important; 
    width: 100% !important;
    background: #1a1a1a; 
    box-shadow: none;
  }
  .nav-main li.active > ul { 
    display: block !important; 
  }
  .nav-main li > ul a {
    padding: 12px 20px 12px 40px;
    font-size: 14px;
    color: #ddd;
    border-top: 1px solid #333;
  }

  /* 中英文切换逻辑 */
  .mobile-menu-btn .text-zh { display: inline; }
  .mobile-menu-btn .text-en { display: none; }
  body.lang-en .mobile-menu-btn .text-zh { display: none; }
  body.lang-en .mobile-menu-btn .text-en { display: inline; }

  /* 其他页面内容 (保持不变) */
  .breadcrumb { padding: 10px 0; font-size: 12px; white-space: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .breadcrumb::-webkit-scrollbar { display: none; }
  .main { padding: 15px; }
  .main h1 { font-size: 18px; }
  .page-content, .article-content, .product-content { font-size: 15px; line-height: 1.8; }
  .layout { flex-direction: column; gap: 15px; }
  .main, .sidebar { width: 100%; }
  .slider { height: 200px; margin: 10px 0; }
  .section { padding: 20px 0; }
  .section h2 { font-size: 18px; }
  .mobile-bottom-bar { display: flex; }
  .back-to-top { bottom: 75px; right: 15px; }
  .footer { margin-top: 20px; padding: 15px 0; font-size: 12px; }
}