/* =========================================================
   聚淼成型科技主题 - 全局样式（main.css v3.1）
   Author: 深圳市聚淼成型科技有限公司
   Description: 全站通用布局、导航、页脚与响应式样式
   ========================================================= */

/* ========== 顶部欢迎条 ========== */
.topbar {
  background: #f5f7fa;
  font-size: 13px;
  color: #555;
  line-height: 36px;
  border-bottom: 1px solid #eee;
}

.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.topbar .welcome {
  color: #333;
}

.topbar .links {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar a {
  color: #0b6cff;
  font-weight: 500;
}

.topbar .phone {
  font-weight: 600;
  color: #0b6cff;
}

/* ========== 页眉与导航栏 ========== */
.site-header {
  background: #fff;
  border-bottom: 1px solid #eee;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
}

/* ===== LOGO 图片 + 公司文字 ===== */
.logo a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo img {
  height: 50px;
  width: auto;
  display: block;
}

.logo-text {
  font-size: 18px;
  color: #0b6cff;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1;
}

/* ===== 主导航菜单 ===== */
.main-nav .menu {
  display: flex;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav .menu li a {
  color: #333;
  font-size: 15px;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.main-nav .menu li a:hover {
  color: #0b6cff;
}

/* ===== 移动端菜单按钮 ===== */
.menu-toggle {
  display: none;
  cursor: pointer;
  font-size: 24px;
}

/* ===== 移动端菜单按钮优化 ===== */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
    font-size: 28px;
    line-height: 1;
    color: #0b6cff;
    padding: 10px 14px;
    margin-right: 12px;
    border-radius: 6px;
    background: transparent;
    transition: background 0.2s ease, transform 0.2s ease;
  }

  .menu-toggle:hover {
    background: rgba(11, 108, 255, 0.08);
    transform: scale(1.05);
  }

  .header-inner {
    padding: 12px 14px;
  }

  .logo img {
    height: 48px;
  }
}

/* ========== 页脚 ========== */
.site-footer {
  background: #111;
  color: #ccc;
  text-align: center;
  padding: 25px 10px;
  font-size: 14px;
  line-height: 1.8;
}

.site-footer a {
  color: #aaa;
  text-decoration: none;
}

.site-footer a:hover {
  color: #fff;
}

.site-footer .icp a {
  color: #888;
  font-size: 13px;
}

/* ========== 全宽页面模板样式 ========== */
.fullwidth-content {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

.fullwidth-content img,
.fullwidth-content video {
  display: block;
  max-width: 100%;
  height: auto;
}

/* ===== 首页去空白（front-page.php） ===== */
body.home .site-content.fullwidth,
body.front-page .site-content.fullwidth {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

body.home .entry-content,
body.front-page .entry-content {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

body.home .wp-block-group:first-child,
body.front-page .wp-block-group:first-child {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* ========== 自动吸顶 + 滚动阴影效果 ========== */
.site-header {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 10000;
  background: #fff;
  border-bottom: 1px solid #eee;
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

/* 滚动后添加阴影 */
body.scrolled .site-header {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}

/* 修复父级阻止 sticky 生效 */
body, .container, .site-content {
  overflow: visible !important;
}

/* ========== 移动端导航栏展开优化 ========== */
@media (max-width: 768px) {
  .main-nav {
    position: absolute;
    top: 72px;
    left: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .main-nav ul {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    width: 100%;
  }

  .main-nav li {
    list-style: none;
    width: 100%;
    border-bottom: 1px solid #eee;
  }

  .main-nav li a {
    display: block;
    width: 100%;
    padding: 10px 0;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s ease;
  }

  .main-nav li a:hover {
    background: #f5f7fa;
    color: #0b6cff;
  }

  .main-nav.show {
    display: flex;
    animation: fadeSlideDown 0.25s ease-out;
  }

  @keyframes fadeSlideDown {
    from {
      opacity: 0;
      transform: translateY(-6px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .main-nav::-webkit-scrollbar {
    width: 6px;
  }

  .main-nav::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 6px;
  }

  .main-nav::-webkit-scrollbar-thumb:hover {
    background: #999;
  }
}

/* ========== 全局悬浮组件 ========== */
.floating-widget {
  position: fixed;
  bottom: 40px;
  right: 30px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 10000;
}

.floating-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: var(--bg-color, #0b6cff);
  color: var(--icon-color, #ffffff);
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
  cursor: pointer;
}

.floating-item:hover {
  background: #005ce6;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.35);
}

.floating-icon svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* 微信二维码样式 */
.wechat-qr {
  position: absolute;
  right: 60px;
  bottom: 0;
  width: 120px;
  height: 120px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 10001;
}

.wechat-qr::after {
  content: '';
  position: absolute;
  right: -8px;
  bottom: 18px;
  width: 0;
  height: 0;
  border-left: 8px solid #ffffff;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  box-shadow: 3px 0 5px rgba(0, 0, 0, 0.1);
}

.wechat-qr img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

/* 电话号码样式 */
.phone-number {
  position: absolute;
  right: 60px;
  bottom: 15px;
  padding: 8px 16px;
  background: #ffffff;
  color: #333333;
  border-radius: 20px;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 10001;
  white-space: nowrap;
}

.phone-number::after {
  content: '';
  position: absolute;
  right: -8px;
  bottom: 15px;
  width: 0;
  height: 0;
  border-left: 8px solid #ffffff;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  box-shadow: 3px 0 5px rgba(0, 0, 0, 0.1);
}

/* 移动端适配 */
@media (max-width: 768px) {
  .floating-widget {
    bottom: 20px;
    right: 20px;
  }
  
  .floating-item {
    width: 45px;
    height: 45px;
  }
  
  .floating-icon svg {
    width: 22px;
    height: 22px;
  }
  
  .wechat-qr {
    width: 100px;
    height: 100px;
    right: 55px;
  }
  
  .phone-number {
    right: 55px;
    font-size: 13px;
    padding: 6px 12px;
  }
}


