/* ============================================================
   潜龙元创 · 手机端独立 UI（微信风格）
   白底 + 浅灰分隔线 + 微信绿强调色，仅在移动端生效。
   ============================================================ */

.m-app {
  display: none;
}

@media (max-width: 768px), (max-width: 900px) and (pointer: coarse) {
  /* 隐藏电脑端结构，只显示手机端容器 */
  body > header,
  body > section,
  body > footer,
  #loggedInContent,
  #notLoggedInContent {
    display: none !important;
  }

  body {
    background: #ffffff;
    padding: 0;
  }

  .m-app {
    display: block;
    min-height: 100vh;
    min-height: 100dvh;
    background: #ffffff;
    color: #191919;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
      'Helvetica Neue', 'Microsoft YaHei', sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    overflow-x: hidden;
  }

  .m-app *,
  .m-app *::before,
  .m-app *::after {
    box-sizing: border-box;
  }

  /* 覆盖各页面旧的移动端通用规则 */
  .m-app .m-section {
    padding: 0 !important;
    margin: 22px 0 0 !important;
    max-width: none !important;
    width: auto !important;
  }

  .m-app h1 {
    margin: 0 !important;
    font-size: 17px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    letter-spacing: 0;
  }

  .m-app h2 {
    margin: 0 !important;
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    letter-spacing: 0;
  }

  .m-app h3 {
    margin: 0 !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    line-height: 1.45 !important;
  }

  .m-app p {
    margin: 0;
  }

  .m-app a {
    color: inherit;
    text-decoration: none;
  }

  .m-app img {
    display: block;
    max-width: 100%;
  }

  .m-app button {
    width: auto !important;
    min-height: 0;
    font-family: inherit;
    border: none;
    background: none;
  }

  /* ---------- 线性图标 ---------- */
  .m-svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block;
  }

  /* ---------- 顶部标题栏 ---------- */
  .m-titlebar {
    position: sticky !important;
    top: 0;
    left: 0;
    z-index: 1100;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    height: calc(44px + env(safe-area-inset-top)) !important;
    margin: 0 !important;
    padding: env(safe-area-inset-top) 52px 0 !important;
    background: #ffffff !important;
    border-bottom: 0.5px solid #e5e5e5 !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
  }

  .m-titlebar h1 {
    font-size: 17px !important;
    font-weight: 600 !important;
    color: #191919;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .m-titlebar-action {
    position: absolute;
    right: 8px;
    bottom: 0;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    color: #191919;
  }

  .m-titlebar-action:active {
    opacity: 0.55;
  }

  /* ---------- 主内容 ---------- */
  .m-main {
    padding: 0 0 calc(66px + env(safe-area-inset-bottom));
    max-width: 640px;
    margin: 0 auto;
    background: #ffffff;
  }

  .m-section-label {
    padding: 0 16px 7px;
    font-size: 13px;
    color: #808080;
    line-height: 1.4;
  }

  .m-section-sublabel {
    padding: 0 16px 10px;
    margin-top: -2px;
    font-size: 12px;
    color: #b2b2b2;
  }

  /* ---------- 列表组 ---------- */
  .m-group {
    background: #ffffff;
    border-top: 0.5px solid #e5e5e5;
    border-bottom: 0.5px solid #e5e5e5;
  }

  .m-group + .m-group {
    border-top: 0;
  }

  .m-cell {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 56px;
    padding: 11px 16px !important;
    background: #ffffff;
    color: #191919;
    text-align: left;
    transition: background-color 120ms ease;
  }

  .m-cell + .m-cell {
    border-top: 0.5px solid #ededed;
  }

  .m-cell:active {
    background: #ececec;
  }

  .m-cell-icon {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    color: #7a7a7a;
  }

  .m-cell-icon .m-svg {
    width: 23px;
    height: 23px;
  }

  .m-cell-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .m-cell-title {
    font-size: 16px;
    line-height: 1.35;
    color: #191919;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .m-cell-desc {
    font-size: 13px;
    line-height: 1.4;
    color: #999999;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .m-cell-desc.is-wrap {
    white-space: normal;
    overflow: visible;
  }

  .m-cell-desc.is-2line {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .m-cell.is-extra {
    display: none;
  }

  .m-group.is-expanded .m-cell.is-extra {
    display: flex;
  }

  .m-cell.is-news {
    align-items: flex-start;
    padding-top: 13px !important;
    padding-bottom: 13px !important;
  }

  .m-cell.is-news .m-cell-arrow {
    margin-top: 3px;
  }

  .m-cell-value {
    flex-shrink: 0;
    max-width: 46%;
    font-size: 14px;
    color: #999999;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .m-cell-arrow {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    color: #c8c8c8;
  }

  .m-cell-arrow .m-svg {
    width: 16px;
    height: 16px;
    stroke-width: 1.9;
  }

  .m-cell-thumb {
    width: 46px;
    height: 46px;
    border-radius: 5px;
    flex-shrink: 0;
    overflow: hidden;
    background: #f2f2f2;
    color: #b2b2b2;
    display: grid;
    place-items: center;
  }

  .m-cell-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .m-cell-thumb .m-svg {
    width: 22px;
    height: 22px;
  }

  .m-cell-tag {
    flex-shrink: 0;
    font-size: 11px;
    line-height: 1;
    color: #07c160;
    border: 0.5px solid rgba(7, 193, 96, 0.45);
    border-radius: 3px;
    padding: 3px 5px;
  }

  .m-cell-tag.is-gray {
    color: #999999;
    border-color: #d9d9d9;
  }

  /* ---------- 内容区块 ---------- */
  .m-block {
    padding: 16px;
    background: #ffffff;
    border-top: 0.5px solid #e5e5e5;
    border-bottom: 0.5px solid #e5e5e5;
  }

  .m-block p {
    font-size: 15px;
    line-height: 1.75;
    color: #333333;
  }

  .m-block p + p {
    margin-top: 10px;
  }

  .m-block-title {
    font-size: 16px;
    font-weight: 500;
    color: #191919;
    margin-bottom: 8px;
  }

  .m-block-note {
    margin-top: 12px;
    font-size: 12px;
    color: #b2b2b2;
  }

  .m-notice {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 12px 16px;
    background: #f7f7f7;
    color: #666666;
    font-size: 13px;
    line-height: 1.65;
  }

  .m-notice + .m-notice {
    border-top: 0.5px solid #ededed;
  }

  .m-notice .m-svg {
    width: 17px;
    height: 17px;
    margin-top: 1px;
    flex-shrink: 0;
    color: #b2b2b2;
  }

  .m-notice a {
    color: #576b95;
  }

  /* ---------- 品牌头部 ---------- */
  .m-brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 16px;
    background: #ffffff;
    border-bottom: 0.5px solid #e5e5e5;
  }

  .m-brand-block img {
    width: 54px;
    height: 54px;
    border-radius: 9px;
    flex-shrink: 0;
  }

  .m-brand-block h2 {
    font-size: 19px !important;
    font-weight: 600 !important;
    color: #191919;
  }

  .m-brand-block p {
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.5;
    color: #999999;
  }

  /* ---------- 数据行 ---------- */
  .m-stat-row {
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border-bottom: 0.5px solid #e5e5e5;
  }

  .m-stat {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 14px 4px !important;
    color: #191919;
  }

  .m-stat:active {
    background: #f2f2f2;
  }

  .m-stat + .m-stat::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 0.5px;
    background: #ededed;
  }

  .m-stat strong {
    font-size: 19px;
    font-weight: 600;
    line-height: 1.2;
    color: #191919;
  }

  .m-stat span {
    font-size: 12px;
    color: #999999;
  }

  /* ---------- 微信绿按钮 ---------- */
  .m-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 46px;
    padding: 0 20px !important;
    border-radius: 6px;
    font-size: 16px !important;
    font-weight: 500 !important;
    line-height: 1;
    text-align: center;
    transition: background-color 120ms ease, opacity 120ms ease;
  }

  .m-btn .m-svg {
    width: 18px;
    height: 18px;
  }

  .m-btn-primary {
    background: #07c160;
    color: #ffffff !important;
  }

  .m-btn-primary:active {
    background: #06ad56;
  }

  .m-btn-plain {
    background: #f2f2f2;
    color: #191919 !important;
  }

  .m-btn-plain:active {
    background: #e6e6e6;
  }

  .m-btn-outline {
    background: #ffffff;
    border: 0.5px solid #07c160;
    color: #07c160 !important;
  }

  .m-btn-outline:active {
    background: #f2fbf6;
  }

  .m-btn-block {
    width: 100% !important;
  }

  .m-btn-row {
    display: flex;
    gap: 12px;
    padding: 22px 16px;
  }

  .m-btn-row .m-btn {
    flex: 1;
  }

  .m-btn-standalone {
    display: flex;
    width: auto !important;
    max-width: calc(100% - 32px);
    margin: 22px 16px;
  }

  .m-text-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    min-height: 46px;
    padding: 0 16px;
    background: #ffffff;
    border-top: 0.5px solid #e5e5e5;
    border-bottom: 0.5px solid #e5e5e5;
    font-size: 15px;
    color: #576b95;
  }

  .m-text-btn:active {
    background: #f2f2f2;
  }

  /* ---------- 我的页面 ---------- */
  .m-profile {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 16px;
    background: #ffffff;
  }

  .m-avatar {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    flex-shrink: 0;
    overflow: hidden;
    background: #f2f2f2;
    color: #b2b2b2;
    display: grid;
    place-items: center;
  }

  .m-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .m-avatar .m-svg {
    width: 30px;
    height: 30px;
  }

  .m-profile-info {
    flex: 1;
    min-width: 0;
  }

  .m-profile-info h2 {
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #191919;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .m-profile-info p {
    margin-top: 3px;
    font-size: 13px;
    color: #999999;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .m-profile-edit {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 32px;
    padding: 0 10px !important;
    border: 0.5px solid #d9d9d9;
    border-radius: 4px;
    background: #ffffff;
    color: #333333;
    font-size: 13px !important;
  }

  .m-profile-edit:active {
    background: #f2f2f2;
  }

  .m-profile-edit .m-svg {
    width: 14px;
    height: 14px;
  }

  /* 未登录 */
  .m-guest {
    padding: 34px 24px 26px;
    text-align: center;
    background: #ffffff;
  }

  .m-guest img {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    margin: 0 auto 14px;
  }

  .m-guest h2 {
    font-size: 18px !important;
    font-weight: 600 !important;
  }

  .m-guest p {
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.6;
    color: #999999;
  }

  .m-guest-actions {
    display: flex;
    gap: 12px;
    margin-top: 22px;
  }

  .m-guest-actions .m-btn {
    flex: 1;
  }

  /* ---------- 业务/联系人卡片 ---------- */
  .m-service-icon {
    color: #7a7a7a;
  }

  .m-member-avatar {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    background: #f2f2f2;
    color: #7a7a7a;
    font-size: 17px;
    font-weight: 500;
  }

  .m-role-tag {
    font-size: 11px;
    line-height: 1;
    color: #576b95;
    background: #f2f4f8;
    border-radius: 3px;
    padding: 3px 5px;
  }

  /* 新闻 */
  .m-news-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
  }

  .m-news-tag {
    font-size: 11px;
    line-height: 1;
    color: #07c160;
    border: 0.5px solid rgba(7, 193, 96, 0.45);
    border-radius: 3px;
    padding: 3px 5px;
  }

  .m-news-date {
    font-size: 12px;
    color: #b2b2b2;
  }

  .m-news-link {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    font-size: 13px;
    color: #576b95;
  }

  .m-news-link .m-svg {
    width: 14px;
    height: 14px;
  }

  /* 无数据 */
  .m-empty {
    padding: 28px 16px;
    text-align: center;
    font-size: 14px;
    color: #b2b2b2;
    background: #ffffff;
  }

  .m-group .m-empty {
    border-top: 0.5px solid #ededed;
  }

  /* 页脚 */
  .m-foot {
    padding: 30px 16px calc(16px + env(safe-area-inset-bottom));
    text-align: center;
    font-size: 12px;
    line-height: 1.8;
    color: #b2b2b2;
  }

  .m-foot a {
    color: #576b95;
  }

  /* ---------- 底部标签栏 ---------- */
  .m-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    gap: 0;
    height: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 3px 8px calc(3px + env(safe-area-inset-bottom)) !important;
    background: rgba(255, 255, 255, 0.98);
    border-top: 0.5px solid #e5e5e5;
    box-shadow: none !important;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    flex-wrap: nowrap !important;
  }

  .m-tab {
    flex: 1;
    max-width: 130px;
    display: flex;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    align-items: center;
    justify-content: center;
    gap: 1px;
    height: auto !important;
    min-height: 50px;
    padding: 3px 0 !important;
    background: transparent;
    color: #7a7a7a;
    font-size: 10px;
    line-height: 1.3;
    transition: color 120ms ease, opacity 120ms ease;
  }

  .m-tab:active {
    opacity: 0.55;
  }

  .m-tab-icon {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
  }

  .m-tab-icon .m-svg {
    width: 23px;
    height: 23px;
    stroke-width: 1.7;
  }

  .m-tab > span:last-child {
    display: block;
    white-space: nowrap;
    line-height: 1.3;
  }

  .m-tab.is-active {
    color: #07c160;
    font-weight: 500;
  }

  .m-tab.is-active .m-tab-icon .m-svg {
    stroke-width: 2;
  }

  /* ---------- 小屏适配 ---------- */
  @media (max-width: 360px) {
    .m-main {
      max-width: 100%;
    }

    .m-titlebar {
      padding-left: 48px !important;
      padding-right: 48px !important;
    }

    .m-cell {
      padding-left: 12px !important;
      padding-right: 12px !important;
    }

    .m-cell-title {
      font-size: 15px;
    }

    .m-cell-desc {
      font-size: 12px;
    }

    .m-section-label {
      padding-left: 12px;
      padding-right: 12px;
    }

    .m-brand-block,
    .m-profile,
    .m-guest {
      padding-left: 12px;
      padding-right: 12px;
    }

    .m-notice {
      padding-left: 12px;
      padding-right: 12px;
    }

    .m-btn-row {
      padding-left: 12px;
      padding-right: 12px;
    }

    .m-avatar {
      width: 54px;
      height: 54px;
    }
  }

  /* ---------- 大屏手机 ---------- */
  @media (min-width: 600px) and (max-width: 768px) {
    .m-main {
      border-left: 0.5px solid #ededed;
      border-right: 0.5px solid #ededed;
    }
  }
}
