﻿/* Web Icons 字体图标定义 */
@font-face {
  font-family: 'web-icons';
  src: url('../font/web-icons.eot');
  src: url('../font/web-icons.eot') format('embedded-opentype'),
       url('../font/web-icons.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* Glyphicons 字体图标定义 */
@font-face {
  font-family: 'Glyphicons Halflings';
  src: url('../font/glyphicons-halflings-regular.eot');
  src: url('../font/glyphicons-halflings-regular.eot') format('embedded-opentype'),
       url('../font/glyphicons-halflings-regular.woff2') format('woff2'),
       url('../font/glyphicons-halflings-regular.woff') format('woff'),
       url('../font/glyphicons-halflings-regular.ttf') format('truetype'),
       url('../font/glyphicons-halflings-regular.svg') format('svg');
  font-weight: normal;
  font-style: normal;
}

/* FontAwesome 字体图标定义 */
@font-face {
  font-family: 'FontAwesome';
  src: url('../font/fontawesome-webfont.eot');
  src: url('../font/fontawesome-webfont.eot') format('embedded-opentype'),
       url('../font/fontawesome-webfont.woff') format('woff'),
       url('../font/fontawesome-webfont.ttf') format('truetype'),
       url('../font/fontawesome-webfont.svg') format('svg');
  font-weight: normal;
  font-style: normal;
}

/* 基础图标类 */
[class^="icon-"],
[class*=" icon-"] {
  font-family: 'web-icons', 'Glyphicons Halflings', 'FontAwesome', sans-serif;
  speak: none;
  font-style: normal;
  font-weight: normal;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Bootstrap Glyphicons 支持 */
.glyphicon {
  position: relative;
  top: 1px;
  display: inline-block;
  font-family: 'Glyphicons Halflings';
  font-style: normal;
  font-weight: normal;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 导航栏切换按钮图标 */
.navbar-toggle .icon-bar {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 1px;
  background-color: #76838f;
}

.navbar-toggle .icon-bar + .icon-bar {
  margin-top: 4px;
}

/* Hamburger 菜单图标 */
.hamburger {
  position: relative;
  display: inline-block;
  width: 22px;
  height: 18px;
  cursor: pointer;
  padding: 0;
  border: none;
  background: transparent;
  vertical-align: middle;
}

.hamburger .hamburger-bar {
  display: block !important;
  position: absolute;
  width: 100%;
  height: 2px;
  background-color: #76838f !important;
  border-radius: 1px;
  transition: all 0.3s ease;
  left: 0;
}

.navbar-toggle.hamburger > .hamburger-bar:nth-child(1) {
  top: 0;
}

.navbar-toggle.hamburger > .hamburger-bar:nth-child(2) {
  top: 50%;
  margin-top: -1px;
  opacity: 1;
  visibility: visible;
}

.navbar-toggle.hamburger > .hamburger-bar:nth-child(3) {
  bottom: 0;
}

.hamburger .hamburger-bar:nth-of-type(1) {
  top: 0;
}

.hamburger .hamburger-bar:nth-of-type(2) {
  top: 50%;
  margin-top: -1px;
  opacity: 1;
  visibility: visible;
}

.hamburger .hamburger-bar:nth-of-type(3) {
  bottom: 0;
}

/* Hamburger 关闭状态（collapsed） */
.navbar-toggle.hamburger.collapsed > .hamburger-bar:nth-child(1) {
  top: 0;
  transform: none;
}

.navbar-toggle.hamburger.collapsed > .hamburger-bar:nth-child(2) {
  opacity: 1;
  top: 50%;
  margin-top: -1px;
  transform: none;
}

.navbar-toggle.hamburger.collapsed > .hamburger-bar:nth-child(3) {
  bottom: 0;
  transform: none;
}

.hamburger.collapsed .hamburger-bar:nth-of-type(1) {
  top: 0;
  transform: none;
}

.hamburger.collapsed .hamburger-bar:nth-of-type(2) {
  opacity: 1;
  top: 50%;
  margin-top: -1px;
  transform: none;
}

.hamburger.collapsed .hamburger-bar:nth-of-type(3) {
  bottom: 0;
  transform: none;
}

/* Hamburger 打开状态（非collapsed） */
.hamburger:not(.collapsed) .hamburger-bar:nth-of-type(1) {
  top: 50%;
  margin-top: -1px;
  transform: rotate(45deg);
}

.hamburger:not(.collapsed) .hamburger-bar:nth-of-type(2) {
  opacity: 0;
}

.hamburger:not(.collapsed) .hamburger-bar:nth-of-type(3) {
  bottom: 50%;
  margin-bottom: -1px;
  transform: rotate(-45deg);
}

/* 确保导航栏图标可见 - 修复手机端显示问题 */
.navbar-toggle .hamburger-bar {
  background-color: #76838f !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* 确保collapsed状态下三个横杆都可见且位置正确 */
.hamburger.collapsed .hamburger-bar {
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}

.hamburger.collapsed .hamburger-bar:nth-of-type(1) {
  top: 0 !important;
  transform: none !important;
  opacity: 1 !important;
}

.hamburger.collapsed .hamburger-bar:nth-of-type(2) {
  opacity: 1 !important;
  top: 50% !important;
  margin-top: -1px !important;
  transform: none !important;
  visibility: visible !important;
}

.hamburger.collapsed .hamburger-bar:nth-of-type(3) {
  bottom: 0 !important;
  transform: none !important;
  opacity: 1 !important;
}

/* 桌面版隐藏汉堡菜单 */
@media (min-width: 768px) {
  .navbar-toggle.hamburger {
    display: none !important;
  }
}

/* 移动端确保汉堡菜单正确显示和定位 - 参考图三效果 */
@media (max-width: 767px) {
  button.navbar-toggle.hamburger,
  .navbar-toggle.hamburger {
    display: block !important;
    padding: 6px 8px !important;
    margin: 0;
    border: none !important;
    background: transparent !important;
    width: 40px !important;
    height: 40px !important;
    position: relative !important;
    visibility: visible !important;
    opacity: 1 !important;
    overflow: visible !important;
  }
  
  /* 按钮内的hamburger容器（如果有） */
  .navbar-toggle.hamburger .hamburger {
    width: 24px;
    height: 20px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    display: block !important;
    visibility: visible !important;
  }
  
  /* 强制显示所有三个横杆 - hamburger-bar直接在button内 */
  button.navbar-toggle.hamburger .hamburger-bar,
  .navbar-toggle.hamburger .hamburger-bar,
  .hamburger .hamburger-bar {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 2px !important;
    background-color: #333 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    border-radius: 1px;
    transition: all 0.3s ease;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  /* 确保三个横杆正确排列 - 使用固定位置值 */
  button.navbar-toggle.hamburger > .hamburger-bar:nth-child(1),
  .navbar-toggle.hamburger > .hamburger-bar:nth-child(1) {
    top: 0 !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
  }
  
  button.navbar-toggle.hamburger > .hamburger-bar:nth-child(2),
  .navbar-toggle.hamburger > .hamburger-bar:nth-child(2) {
    top: 9px !important;
    margin-top: 0 !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
  }
  
  button.navbar-toggle.hamburger > .hamburger-bar:nth-child(3),
  .navbar-toggle.hamburger > .hamburger-bar:nth-child(3) {
    top: 18px !important;
    bottom: auto !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
  }
}

/* 兼容 Bootstrap 的 icon-bar */
.navbar-toggle .icon-bar {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 1px;
  background-color: #76838f !important;
  margin-top: 4px;
}

.navbar-toggle .icon-bar:first-child {
  margin-top: 0;
}

