/* ===========================================================
   手机导航栏补充样式
   配合 nav.mobile.css 使用，补充语言切换和占位符等
   =========================================================== */

:root {
  --mb-nav-color: #0073c0;
}

/* ─── 手机端 Header 占位（防止被固定 header 遮挡） ─── */
.ys_mobile_spacer {
  display: none;
}

/* ─── 导航栏 Logo 图片垂直居中 ─── */
.ys_phnav_logo a img {
  vertical-align: middle;
}

/* ─── 语言切换（菜单底部） ─── */
.top-rt-lang {
  height: auto;
  overflow: hidden;
  color: #fff;
  font-size: 16px;
  display: -webkit-box;
  display: -moz-box;
  display: -webkit-flex;
  display: -moz-flex;
  display: -ms-flexbox;
  display: flex;
  align-items: center;
  padding: 15px 20px;
}
.top-rt-lang i {
  font-size: 24px;
  display: inline-block;
  margin-right: 10px;
}
.top-rt-lang a {
  display: inline-block;
  color: #fff;
  margin: 0 5px;
  text-decoration: none;
}
.top-rt-lang a.active {
  font-weight: bold;
  text-decoration: underline;
}

/* ─── 电脑端隐藏辅助 ─── */
@media (min-width: 851px) {
  .mb-only { display: none !important; }

  /* 确保 nav.mobile.css 的菜单在桌面端隐藏 */
  .ys_phnav_header,
  .ys_hd_ph {
    display: none !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   手机端样式（统一断点：max-width: 767px）
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 850px) {
  /* Header 占位 */
  .ys_mobile_spacer {
    display: block;
    height: 51px;
  }

  /* 显示辅助 */
  .mb-show {
    display: block !important;
  }

  /* 显示移动端侧滑菜单及汉堡按钮 */
  .ys_hd_ph {
    display: block !important;
  }
  .ys_phnav_r {
    display: flex !important;
  }

  /* 隐藏 PC 导航栏（修复：去掉 .has-mobile-nav，原 class 从未被设置） */
  .full-head,
  .full-head-spacer {
    display: none !important;
  }

  /* 导航栏布局：等宽对称 flex — 用户名相对屏幕绝对居中 */
  .ys_phnav_header {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center;
  }

  /* Logo 固定宽度，不可压缩 */
  .ys_phnav_logo {
    width: 120px;
    flex-shrink: 0;
  }

  /* 汉堡容器与 Logo 等宽（120px），汉堡在容器内右对齐 */
  .ys_phnav_r {
    width: 120px;
    flex-shrink: 0;
    justify-content: flex-end;
  }

  /* 账户区在中间剩余空间，内容居中对齐 */
  .ph-user-section {
    position: static;
    flex: 1 1 0%;
    min-width: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible; /* 允许下拉菜单溢出 */
    margin: 0 8px;
  }
}

/* 未登录：登录按钮 */
.ph-user-section .ph-login-btn {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--mb-nav-color, #0073c0);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.6;
}

/* 已登录：用户名 + 下拉箭头 */
.ph-user-dropdown {
  position: relative;
  max-width: 100%; /* 限制宽度不超过父容器 */
}

.ph-user-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  padding: 4px 0;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  max-width: 100%; /* 限制宽度 */
}

.ph-user-name {
  font-size: 14px;
  font-weight: 600;
  color: #1c5cb0;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex-shrink: 1; /* 允许被压缩 */
}

.ph-user-arrow {
  font-size: 10px;
  color: #1c5cb0;
  transition: transform 0.25s ease;
}

.ph-user-dropdown.open .ph-user-arrow {
  transform: rotate(180deg);
}

.ph-user-dropdown.open .ph-user-name {
  color: #00479d;
}

/* 下拉菜单 */
.ph-user-menu {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  width: 240px;
}

.ph-user-dropdown.open .ph-user-menu {
  display: block;
}

.ph-user-menu-inner {
  width: 100%;
  padding: 0;
  background: #fff;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.08);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  overflow: hidden;
}

/* 移动端弹窗顶部：问候语 + 完整账号 */
.ph-user-menu-header {
  padding: 14px 16px 12px;
  width: 100%;
  box-sizing: border-box;
}
.ph-user-greeting {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.4;
}
.ph-user-full-account {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
  word-break: break-all;
}

.ph-user-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
  padding: 14px 22px;
  font-size: 17px;
  color: #0f172a;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.ph-user-menu-item:hover,
.ph-user-menu-item:active {
  background: #f2f7fc;
  color: var(--mb-nav-color, #0073c0);
}

.ph-user-menu-item i {
  width: 24px;
  text-align: center;
  font-size: 20px;
  color: #64748b;
  flex-shrink: 0;
}

.ph-user-menu-divider {
  width: 100%;
  height: 1px;
  background: #e2e8f0;
  margin: 4px 0;
}
