/**
 * @file header.css
 * @purpose 顶部信息栏样式
 * @author 重庆嘉华医院
 * @datetime 2026-07-18 10:00:00
 * @description 顶部信息栏样式，包含导航栏、顶部信息栏等。
 */

 /* ----- 顶部信息栏 ----- */
 .header {
    height: 110px;
    background-color: #fff;
  }
  .header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
  }
  /* 顶部信息栏左侧内容 */
  .header__left {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    max-height: 86px;
    margin-right: 20px;
  }
  .header__logo {
    height: 80%;
    object-fit: contain;
  }
  /* 顶部信息栏右侧内容 */
  .header__right {
    display: flex;
    align-items: center;
    height: 100%;
    max-height: 86px;
    gap: 20px;
  }
  .header__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    max-height: 86px;
    gap: 5px;
  }
  .header__item img {
    height: 100%;
    object-fit: contain;
  }
  .header__qr {
    height: 60px;
    width: 60px;
    object-fit: contain;
  }
  .header__item span {
    font-size: 14px;
    color: #333333;
    white-space: nowrap;
  }

  /* ----- 导航栏 ----- */
  .navbar {
    height: 66px;
    background-color: #00B4D8;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0;
    transition: box-shadow 0.3s ease;
  }
  /* 导航栏 sticky 吸附状态（滚动到顶部后触发） */
  .navbar.is-sticky {
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  }
  /* 哨兵元素 */
  .nav-sentinel {
    height: 1px;
    pointer-events: none;
    visibility: hidden;
  }
  /* 内容容器 */
  .navbar .container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 20px;
  }

  /* 移动端遮罩层 */
  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  /* 移动端遮罩层显示状态 */
  .nav-overlay.is-visible {
    display: block;
    opacity: 1;
  }

  /* 导航栏左侧内容 LOGO */
  /* PC吸附 */
  .navbar__logo-sticky {
    opacity: 0;
    max-width: 0;
    height: 48px;
    object-fit: contain;
    flex-shrink: 0;
    margin-right: 0;
    overflow: hidden;
    pointer-events: none;
    transition: opacity 0.4s ease,
                max-width 0.4s cubic-bezier(0.25, 0.8, 0.25, 1.2);
  }
  /* 吸附状态：Logo 淡入 + 展开 + 菜单栏自然移位 */
  .navbar.is-sticky .navbar__logo-sticky {
    opacity: 1;
    max-width: 56px;
    margin-right: 12px;
    pointer-events: auto;
  }
  /* 移动端LOGO */
  .navbar__logo-mobile {
    display: none;
    height: 40px;
    width: auto;
    object-fit: contain;
    flex-shrink: 0;
  }

  /* 导航菜单容器 */
  .nav-menu {
    display: flex;
    align-items: center;
    gap: 0;
    height: 100%;
    list-style: none;
    margin: 0;
    padding: 0;
  }
  /* 导航菜单头部（PC端隐藏） */
  .nav-menu__header {
    display: none;
  }
  /* 导航菜单列表项 */
  .nav-menu__item {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 10px;
    font-family: 思源黑体, sans-serif;
    font-style: normal;
    font-weight: 700;
    font-size: 20px;
    line-height: 42px;
    text-align: center;
    letter-spacing: 0.08em;
    color: #fff;
    cursor: pointer;
    width: auto;
  }

  /* 导航项分隔线 */
  .nav-menu__item:not(:last-child)::after {
    content: "";
    display: block;
    width: 1px;
    height: 18px;
    position: absolute;
    top: 0;
    bottom: 0;
    margin: auto;
    right: 0;
    background: #fff;
    opacity: 0.3;
  }

  /* 一级导航链接 */
  .nav-menu__link {
    display: block;
    position: relative;
    color: #fff;
    height: 66px;
    line-height: 66px;
    padding: 0 10px;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    user-select: none;
  }
  /* 导航项底部下划线动画 */
  .nav-menu__item::before {
    content: "";
    width: 0;
    height: 2px;
    background: #fff;
    position: absolute;
    right: 10%;
    bottom: 10px;
    -webkit-transition: 0.48s;
    transition: 0.48s;
  }

  /* 导航项 hover 时下划线动画 */
  .nav-menu__item:hover::before {
    width: 80%;
    right: auto;
    left: 10%;
  }
  /* 导航项 active 状态下划线动画 */
  .nav-menu__item.active::before {
    width: 80%;
    right: auto;
    left: 10%;
  }
  /* 下拉箭头图标（参考样式中无箭头，隐藏） */
  .nav-menu__link .bi {
    display: none;
  }

  /* 二级下拉菜单（桌面端 hover 展开） */
  .nav-submenu {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    top: 66px;
    transform: translateY(20px);
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    list-style: none;
    left: 0;
    width: 100%;
    background-color: #fff;
    margin: 0;
    padding: 8px 0;
    text-align: center;
    z-index: 66666;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
  }
  /* 二级下拉菜单列表项 */
  .nav-submenu__item {
    display: block;
    text-align: center;
    width: 100%;
    font-size: 16px;
    padding: 0;
  }
  /* 二级下拉菜单链接 */
  .nav-submenu__link {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    font-family: 思源黑体, sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 16px;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
  }
  /* 二级下拉菜单链接悬停状态 */
  .nav-submenu__item:hover > .nav-submenu__link,
  .nav-submenu__item.active > .nav-submenu__link {
    background-color: #00B4D8;
    color: #fff;
  }
  /* hover 展开子菜单 */
  .nav-menu__item--has-sub:hover > .nav-submenu {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    z-index: 9999;
  }

  /* 汉堡菜单按钮（桌面端隐藏，移动端显示） */
  .hamburger {
    display: none;
    /* flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1002;
    position: relative;
    flex-shrink: 0; */
  }

  /* 响应式 - 桌面端中等屏幕（≤1440px） */
  @media (max-width: 1440px) {
    .navbar .container {
      justify-content: flex-start;
      overflow-x: auto;
      overflow-y: hidden;
      padding: 0 15px;
      scrollbar-width: none;
      -ms-overflow-style: none;
    }
    .navbar .container::-webkit-scrollbar {
      display: none;
    }
    .nav-menu {
      flex-wrap: nowrap;
      flex-shrink: 0;
    }
    .nav-menu__item {
      font-size: 18px;
      letter-spacing: 0.06em;
      padding: 0 8px;
    }
    .nav-menu__link {
      padding: 0 8px;
    }
  }

  /* 响应式 - 桌面端小屏幕（≤1200px） */
  @media (max-width: 1200px) {
    .nav-menu__item {
      font-size: 17px;
      letter-spacing: 0.04em;
      padding: 0 6px;
    }
    .nav-menu__link {
      padding: 0 6px;
    }
  }

  /* 响应式 - 桌面端平板屏幕（≤992px） */
  @media (max-width: 992px) {
    .nav-menu__item {
      font-size: 16px;
      letter-spacing: 0;
      padding: 0 4px;
    }
    .nav-menu__link {
      padding: 0 4px;
    }
  }

  /* 响应式 - 移动端（≤768px） */
  @media (max-width: 768px) {
    /* 隐藏 PC 端顶部信息栏 */
    .header {
      display: none;
    }
    /* 移动端导航栏：白色背景，保持高 z-index 确保不被轮播图覆盖 */
    .navbar{
      background-color: #ffffff;
      box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
      z-index: 1000;  /* 保持高 z-index，确保导航栏始终在最上层 */
    }
    /* 导航栏容器：左右布局（Logo 左 + 汉堡右） */
    .navbar .container {
      justify-content: space-between;
    }
    /* 在移动端始终隐藏 sticky Logo */
    .navbar__logo-sticky{
      display: none !important;
    }
    /* 显示移动端 480×150 Logo */
    .navbar__logo-mobile {
      display: block;
    }
    /* 移动端菜单头部栏：显示 */
    .nav-menu__header {
      display: flex;
    }
    /* 移动端菜单头部栏样式 */
    .nav-menu__header {
      flex-direction: row;
      align-items: center;
      justify-content: space-between;
      padding: 20px 24px;
      background-color: #ffffff;
      border-bottom: 1px solid rgba(0,0,0,0.08);
    }
    /* 移动端菜单头部栏标题 */
    .nav-menu__header-title {
      font-size: 18px;
      font-weight: 600;
      color: #00B4D8;
    }
    /* 移动端菜单头部栏关闭按钮, 汉堡菜单按钮（桌面端隐藏，移动端显示） */
    .nav-menu__close-btn, .hamburger {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 40px;
      height: 40px;
      padding: 0;
      background: transparent;
      border: none;
      cursor: pointer;
      transition: background-color 0.2s ease;
    }
    /* Bootstrap 关闭图标样式 和 汉堡菜单按钮图标样式 */
    .nav-menu__close-btn .bi, .hamburger .bi {
      color: #00B4D8;
      font-size: 24px;
      font-weight: 600;
    }
    /* 遮罩层：覆盖导航栏，位于菜单之下 */
    .nav-overlay {
      z-index: 1050;
      pointer-events: none;
    }

    /* ---- 移动端滑出菜单 ---- */
    .nav-menu {
      position: fixed;
      top: 0;
      right: -300px;
      width: 300px;
      max-width: 85vw;
      height: 100vh;
      height: 100dvh;  /* 动态视口高度，兼容移动浏览器地址栏 */
      flex-direction: column;
      align-items: stretch;
      gap: 0;
      background-color: #ffffff;
      box-shadow: -4px 0 24px rgba(0,0,0,0.15);
      padding: 0;  /* 头部栏占据顶部，无需额外 padding */
      overflow-y: auto;
      /* 使用较高的 z-index 确保始终在遮罩层之上，使用 isolation 强制创建独立层叠上下文 */
      z-index: 1100;
      isolation: isolate;
      transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }
    /* 移动端菜单展开状态 */
    .nav-menu.is-open {
      right: 0;
    }
    /* 移动端一级导航项 */
    .nav-menu__item {
      all: unset;
    }
    /* 移动端一级导航项链接样式 */
    .nav-menu__link {
      width: 100%;
      padding: 0 20px;
      height: 56px;
      font-size: 16px;
      color: #333333;
      box-sizing: border-box;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: space-between;
      transition: border-color .3s, background-color .3s, color .3s;
    }
    /* 移动端一级导航项链接 hover 状态 */
    .nav-menu__link:hover {
      background-color: #ecf5ff;
    }
    /* 移动端一级导航项链接 active 状态 */
    .nav-menu__item.active > .nav-menu__link {
      color: #00B4D8;
    }
    /* 移动端下拉箭头（Bootstrap Icons） */
    .nav-menu__link .bi {
      display: block;
      color: #909399;
      font-size: 16px;
      transition: transform 0.3s, -webkit-transform 0.3s;
    }
    /* 移动端子菜单展开时箭头旋转（由 JS 控制） */
    .nav-menu__item--has-sub.sub-open > .nav-menu__link .bi {
      transform: rotate(180deg);
    }
    /* 移动端二级菜单：手风琴展开 ul元素 */
    .nav-submenu {
      position: static;
      max-height: 0;
      overflow: hidden;
      box-shadow: none;
      padding: 0 20px;
      border: none;
      transition: max-height 0.35s ease;
    }
    /* 移动端二级菜单：手风琴展开 li元素 */
    .nav-submenu__item {
      padding: 0;
      text-align: left;
    }
    /* 移动端二级菜单链接 hover 状态 */
    .nav-submenu__item:hover > .nav-submenu__link {
      /* background-color: #ecf5ff; */
      background-color: #fff;
      color: #0096c7;
    } 
    /* 展开状态（JS 动态计算 max-height） */
    .nav-submenu.is-open {
      /* max-height 由 JS 动态设置 */
    }
    /* 移动端二级菜单链接样式 */
    .nav-submenu__link {
      padding: 12px 20px;
      font-size: 15px;
      color: #555555;
    }
    /* 移动端二级导航项链接 hover 状态 */
    .nav-submenu__link:hover {
      background-color: #ecf5ff;
      color: #0096c7;
    }
    /* 移动端二级导航项链接 active 状态 */
    .nav-submenu__item.active > .nav-submenu__link {
      color: #00B4D8;
    }
  }