/* 卟凡科技 - 移动端适配增强
 * 挂在站点打包 CSS 之后，仅在窄屏生效，不改变桌面端布局。
 */

/* ---------- 汉堡菜单（默认隐藏，590px 以下生效） ---------- */
.mobile-nav-toggle,
.mobile-nav-panel {
  display: none;
}
.mobile-nav-toggle span {
  display: block;
  height: 2px;
  background: #3f5570;
  border-radius: 2px;
}

@media (width <= 590px) {
  /* 汉堡按钮：插入 .nav 末尾（发布按钮之后） */
  .mobile-nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    flex: none;
    width: 42px;
    height: 42px;
    margin-left: 8px;
    padding: 11px 9px;
    background: none;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-nav-toggle span {
    transition: transform 0.25s, opacity 0.25s;
  }
  .mobile-nav-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .mobile-nav-toggle.open span:nth-child(2) {
    opacity: 0;
  }
  .mobile-nav-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* 导航面板：从 header 下边缘滑出 */
  .mobile-nav-panel {
    display: block;
    position: fixed;
    top: 62px;
    left: 0;
    right: 0;
    z-index: 30;
    max-height: calc(100vh - 62px);
    overflow: auto;
    background: #fff;
    box-shadow: 0 14px 34px rgba(16, 31, 51, 0.18);
    padding: 10px 0;
    transform: translateY(-10px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.22s, opacity 0.22s, visibility 0.22s;
  }
  .mobile-nav-panel.open {
    transform: none;
    opacity: 1;
    visibility: visible;
  }
  .mobile-nav-panel a {
    display: block;
    padding: 13px 22px;
    color: #435168;
    font-size: 15px;
    border-bottom: 1px solid #f0f3f7;
  }
  .mobile-nav-panel a:last-child {
    border-bottom: 0;
  }
  .mobile-nav-panel a.active {
    color: #3f5570;
    font-weight: 700;
    background: #f0f4f8;
  }
  .mobile-nav-panel .mobile-nav-publish {
    color: #fff !important;
    background: #3f5570 !important;
    border-radius: 25px !important;
    text-align: center;
    margin: 12px 14px 6px;
    padding: 13px;
    font-weight: 700;
    border-bottom: 0;
  }
  body.mobile-menu-open {
    overflow: hidden;
  }
}

/* ---------- 移动端布局细节增强 ---------- */
@media (width <= 590px) {
  /* 容器边距更紧凑 */
  .inner {
    width: min(1180px, 100% - 24px);
  }

  /* 顶部信息条：保留关键入口为单行精简（会员中心/退出），隐藏欢迎语与分隔符 */
  .topbar {
    display: block;
    height: auto;
    min-height: 34px;
    padding: 5px 12px;
    font-size: 12px;
  }
  .topbar .inner {
    width: 100%;
    height: auto;
    min-height: 0;
  }
  .topbar .inner span:first-child {
    display: none;
  }
  .topbar .inner span:last-child {
    white-space: nowrap;
  }
  .topbar i {
    margin: 0 5px;
  }

  /* 导航：Logo 缩小，留出汉堡位置 */
  .nav {
    min-height: 62px;
    gap: 10px;
  }
  .logo img {
    width: 106px;
  }

  /* Hero 按钮加宽，触控更友好 */
  .hero button,
  .form-page button,
  .search button {
    min-width: 168px;
    padding: 13px 26px;
    font-size: 15px;
  }

  /* 首页分区标题压缩 */
  .section-heading h2 {
    font-size: 18px;
    margin-bottom: 10px;
  }
  .section-heading {
    margin-bottom: 14px;
  }

  /* 快捷入口卡片：触控目标加大 */
  .quick > a {
    padding: 17px 15px;
    gap: 12px;
  }
  .quick img {
    width: 46px;
    height: 46px;
  }
  .quick b {
    font-size: 16px;
  }

  /* 信息卡片 */
  .cards {
    gap: 10px;
  }
  .tile strong {
    font-size: 13px;
    padding: 10px;
  }
  .tile {
    border-radius: 9px;
  }

  /* 列表/详情 */
  .list-card h2 {
    font-size: 16px;
    line-height: 1.45;
  }
  .crumb {
    font-size: 13px;
  }
  .info-head h1 {
    font-size: 21px;
  }
  .content {
    padding: 18px;
  }
  .content h2 {
    font-size: 18px;
  }

  /* 表单：字号 16px 防止 iOS 聚焦自动放大 */
  .form-page input,
  .form-page select,
  .form-page textarea,
  .auth-page input {
    font-size: 16px;
    padding: 12px;
  }
  .form-page label,
  .auth-page label {
    font-size: 14px;
  }

  /* 认证页按钮全宽 */
  .auth-page button,
  .member-publish {
    width: 100%;
    text-align: center;
    padding: 14px 18px;
  }
  .auth-page section {
    padding: 26px 20px;
  }

  /* 会员中心：头像与资料紧凑排列 */
  .member-profile {
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px;
  }
  .member-publish {
    margin-left: 0;
  }
  .member-posts article {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
  .member-posts .status {
    align-self: flex-start;
  }

  /* 分页触控 */
  .pagination button {
    min-width: 36px;
    min-height: 36px;
  }

  /* 页脚：备案图标缩放，文字换行保护 */
  footer .inner {
    font-size: 12px;
  }
  footer .beian-wrap {
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .beian-icon {
    width: 16px;
    height: 16px;
  }
  footer span:last-child {
    flex-wrap: wrap;
    gap: 12px;
  }

  /* 协议页 */
  .legal-page {
    margin: 14px 12px;
    padding: 22px 18px;
  }
  .legal-page h1 {
    font-size: 22px;
  }
  .legal-page h2 {
    font-size: 16px;
  }
}
