/* ==========================================================================
   移动端侧滑菜单 · 对齐站点设计语言
   ========================================================================== */

/* ---------- 遮罩 ---------- */
.mnav-mask {
  position: fixed;
  inset: 0;
  z-index: 900;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
  -webkit-tap-highlight-color: transparent;
}

.mnav-mask.open {
  opacity: 1;
  visibility: visible;
}

/* ---------- 抽屉 ---------- */
.mnav {
  position: fixed;
  top: 8px;
  left: 8px;
  bottom: 8px;
  z-index: 901;
  width: 78%;
  max-width: 300px;
  display: flex;
  flex-direction: column;

  background: var(--ap-card, #fff);
  border: 1px solid var(--ap-line, rgba(0, 0, 0, 0.08));
  border-radius: 18px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);

  transform: translate3d(calc(-100% - 16px), 0, 0);
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  overflow: hidden;
}

.mnav.open {
  transform: translate3d(0, 0, 0);
}

/* ---------- 头部 ---------- */
.mnav-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--ap-line, rgba(0, 0, 0, 0.08));
}

.mnav-logo {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1 1 auto;
}

.mnav-logo img {
  height: 24px;
  width: auto;
  max-width: 130px;
  display: block;
  object-fit: contain;
}

.mnav-close {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: var(--ap-fill, rgba(0, 0, 0, 0.05));
  color: var(--ap-text-3, #86868b);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: background 0.14s ease, color 0.14s ease;
}

.mnav-close:active {
  background: var(--ap-line-strong, rgba(0, 0, 0, 0.12));
  color: var(--ap-text, #1d1d1f);
}

/* ---------- 菜单列表 ---------- */
.mnav-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px;
}

.mnav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mnav-item {
  display: block;
}

.mnav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 12px;
  margin-bottom: 2px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ap-text, #1d1d1f);
  text-decoration: none;
  line-height: 1.4;
  border-radius: 10px;
  letter-spacing: -0.01em;
  transition: background 0.14s ease, color 0.14s ease;
  -webkit-tap-highlight-color: transparent;
}

.mnav-link:active {
  background: var(--ap-fill, rgba(0, 0, 0, 0.05));
}

.mnav-link.active {
  color: var(--ap-accent, #0071e3);
  background: var(--ap-accent-soft, rgba(0, 113, 227, 0.1));
  font-weight: 600;
}

/* 首页图标 */
.mnav-ico {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ap-text-3, #86868b);
}

.mnav-ico:empty {
  display: none;
}

.mnav-link.active .mnav-ico {
  color: var(--ap-accent, #0071e3);
}

.mnav-ico svg {
  width: 17px;
  height: 17px;
  display: block;
}

.mnav-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 非首页项：图标占位，保持文字对齐 */
.mnav-item:not(:first-child) .mnav-link {
  padding-left: 12px;
}

/* ---------- 底部工具 ---------- */
.mnav-foot {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--ap-line, rgba(0, 0, 0, 0.08));
}

.mnav-tool {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  border: 1px solid var(--ap-line, rgba(0, 0, 0, 0.08));
  border-radius: 980px;
  background: var(--ap-fill-2, rgba(0, 0, 0, 0.02));
  color: var(--ap-text-2, #6e6e73);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  transition: background 0.14s ease, color 0.14s ease;
  -webkit-tap-highlight-color: transparent;
}

.mnav-tool:active {
  background: var(--ap-fill, rgba(0, 0, 0, 0.05));
  color: var(--ap-text, #1d1d1f);
}

.mnav-tool svg {
  width: 14px;
  height: 14px;
  display: block;
}

/* 抽屉打开时锁定滚动 */
body.mnav-locked {
  overflow: hidden !important;
  touch-action: none;
}

/* ---------- 汉堡按钮动画 ---------- */
.menu-btn .menu-bar {
  transition: transform 0.24s ease, opacity 0.16s ease;
}

.menu-btn.is-active .menu-bar:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.menu-btn.is-active .menu-bar:nth-child(2) {
  opacity: 0;
}
.menu-btn.is-active .menu-bar:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ---------- 仅移动端 ---------- */
@media (min-width: 992px) {
  .mnav,
  .mnav-mask {
    display: none !important;
  }
}
