/* ==========================================================================
   小涵互联 · 移动端 UI 系统 v5（唯一真源）
   --------------------------------------------------------------------------
   设计原则：
   1. 只做结构性规则，不做逐页补丁 —— 同类元素全站统一外观
   2. 三层防线防横向溢出：html/body 裁剪 → flex 子项 min-width:0 → 长文本换行
   3. 触控优先：所有可点区域 ≥44px，底部安全区留白
   4. 桌面端零影响：全部规则包裹在 max-width:900px 内
   断点：≤900px 手机/小屏平板；≤380px 极窄屏微调
   ========================================================================== */

@media (max-width: 900px) {

  /* ---------------------------------------------------------------- 令牌层 */
  :root {
    --m-pad: 14px;          /* 页面左右留白 */
    --m-gap: 12px;          /* 卡片间距 */
    --m-radius: 14px;       /* 卡片圆角 */
    --m-radius-sm: 10px;
    --m-tap: 44px;          /* 最小触控尺寸 */
    --m-tabbar-h: 60px;     /* 底部导航高度 */
    --m-safe: env(safe-area-inset-bottom, 0px);
    --m-fs-h1: 21px;
    --m-fs-h2: 16px;
    --m-fs-title: 15px;
    --m-fs-body: 14px;
    --m-fs-sub: 12.5px;
  }

  /* -------------------------------------------------------- 第 1 层：防溢出 */
  html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
  }

  *, *::before, *::after {
    box-sizing: border-box;
    min-width: 0;                    /* 关键：阻止 flex/grid 子项撑破容器 */
  }

  img, video, canvas, svg, picture, iframe {
    max-width: 100%;
  }

  img, video, canvas, iframe {
    height: auto;
  }

  /* 长串（URL / 文件名 / 代码）强制换行，防撑宽 */
  a, p, span, b, strong, em, i, li, td, th, h1, h2, h3, h4, div {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  pre, code, kbd, samp {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    max-width: 100%;
  }

  /* ------------------------------------------------------------ 页面容器 */
  .shell,
  main.shell,
  .shell-narrow,
  .hub,
  .mg-main,
  .container,
  .wrap,
  body.xh-page > main,
  main:not(.shell):not(.shell-narrow):not(.hub):not(.auth-main):not(.hb-page):not(.xh-err-wrap):not(.mg-main) {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: var(--m-pad) !important;
    padding-right: var(--m-pad) !important;
    padding-top: 12px;
  }

  /* 底部导航留白（两种 body 类都兼容） */
  body.xh-has-tabbar,
  body.xh-has-nav {
    padding-bottom: 0 !important;
  }

  body.xh-has-tabbar .shell,
  body.xh-has-nav .shell,
  body.xh-has-tabbar main,
  body.xh-has-nav main {
    padding-bottom: calc(var(--m-tabbar-h) + var(--m-safe) + 18px) !important;
  }

  /* 页脚整体上移，不被底栏压住 */
  .xh-foot,
  .site-foot {
    margin-bottom: calc(var(--m-tabbar-h) + var(--m-safe) + 4px) !important;
    padding-left: var(--m-pad);
    padding-right: var(--m-pad);
  }

  /* ------------------------------------------------------------ 顶部导航 */
  .xh-nav,
  .xh-nav-fixed {
    height: 56px !important;
    min-height: 56px !important;
  }

  .xh-nav-inner {
    height: 56px !important;
    padding: 0 10px !important;
    gap: 8px;
    display: flex !important;
    align-items: center;
  }

  /* 桌面横向菜单在手机端一律隐藏，只留汉堡 */
  .xh-nav-links,
  .xh-nav-side .xh-theme-label,
  .xh-hide-sm {
    display: none !important;
  }

  .xh-nav-burger {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: var(--m-tap) !important;
    height: var(--m-tap) !important;
    margin-left: auto;
    border-radius: 10px;
  }

  .xh-nav-brand {
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
  }

  .xh-nav-logo img,
  .xh-nav-logo svg {
    width: 28px;
    height: 28px;
  }

  .xh-nav-titles {
    min-width: 0;
    overflow: hidden;
  }

  .xh-nav-titles b,
  .xh-nav-titles i {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--m-fs-title);
    line-height: 1.25;
  }

  .xh-nav-titles i {
    font-size: 11.5px;
    opacity: .75;
  }

  .xh-nav-side {
    display: flex !important;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
  }

  .xh-theme-btn,
  .xh-nav-btn {
    min-width: var(--m-tap);
    height: var(--m-tap);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
  }

  /* ------------------------------------------------------------ 侧边抽屉 */
  .xh-drawer-panel {
    width: min(86vw, 340px) !important;
    max-width: 86vw;
    height: 100%;
    display: flex;
    flex-direction: column;
  }

  .xh-drawer-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 14px calc(18px + var(--m-safe));
  }

  .xh-drawer-tiles,
  .xh-drawer-list {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .xh-drawer-tile {
    min-height: 64px;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 6px !important;
    border-radius: 12px;
    text-align: center;
    font-size: 12.5px;
  }

  .xh-drawer-list a,
  .xh-drawer-user {
    min-height: var(--m-tap);
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 10px 4px !important;
  }

  /* ------------------------------------------------------- 底部 TabBar */
  .xh-tabbar {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: calc(var(--m-tabbar-h) + var(--m-safe)) !important;
    padding: 6px 4px calc(4px + var(--m-safe)) !important;
    display: flex !important;
    align-items: stretch;
    justify-content: space-around;
    gap: 0;
    z-index: 900 !important;
    transform: none !important;
    border-radius: 0 !important;
    box-sizing: border-box;
  }

  .xh-tabbar.hide {
    transform: translateY(110%) !important;
    transition: transform .22s var(--xh-ease, ease);
  }

  .xh-tab {
    flex: 1 1 0;
    min-width: 0;
    max-width: 96px;
    height: 100%;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 4px 2px !important;
    border-radius: 10px;
    text-decoration: none;
    overflow: hidden;
  }

  .xh-tab-ico,
  .xh-tab-ico svg {
    width: 22px !important;
    height: 22px !important;
    flex: 0 0 auto;
  }

  .xh-tab-label {
    font-size: 10.5px !important;
    line-height: 1.1;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .xh-tab-ind {
    display: none !important;
  }

  /* ------------------------------------------------- 横向滑动的标签栏 */
  .cat-tab,
  .cat-tabs,
  .tabs,
  .xhm-tabs,
  .cm-tabs,
  .plat-tabs,
  .xh-hscroll,
  .hero-chips,
  .filter-bar,
  .tab-bar {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center;
    gap: 8px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 8px var(--m-pad) !important;
    margin-left: calc(var(--m-pad) * -1) !important;
    margin-right: calc(var(--m-pad) * -1) !important;
    max-width: none;
    width: auto;
    scroll-padding-left: var(--m-pad);
  }

  .cat-tab::-webkit-scrollbar,
  .cat-tabs::-webkit-scrollbar,
  .tabs::-webkit-scrollbar,
  .xhm-tabs::-webkit-scrollbar,
  .cm-tabs::-webkit-scrollbar,
  .plat-tabs::-webkit-scrollbar,
  .xh-hscroll::-webkit-scrollbar,
  .hero-chips::-webkit-scrollbar {
    display: none;
  }

  .cat-tab > *,
  .cat-tabs > *,
  .tabs > a,
  .tabs > button,
  .xhm-tab,
  .cm-tab,
  .plat-tab,
  .chip,
  .cm-chip,
  .hero-chip {
    flex: 0 0 auto !important;
    white-space: nowrap;
    min-height: 36px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 7px 14px !important;
    border-radius: 999px !important;
    font-size: 13px !important;
    line-height: 1;
  }

  /* -------------------------------------------------------------- 标题层 */
  h1, .hero h1, .v3-hero h1, .hb-hero h1, .ab-hero h1, .hub-hero h1 {
    font-size: var(--m-fs-h1) !important;
    line-height: 1.35 !important;
    margin: 0 0 10px !important;
    letter-spacing: -.2px;
  }

  h2, .section-head h2, .cm-panel-head h1, .mc-panel h2 {
    font-size: var(--m-fs-h2) !important;
    line-height: 1.4 !important;
    margin: 0 0 8px !important;
  }

  h3 {
    font-size: 15px !important;
  }

  h1 br {
    display: none;
  }

  .section-head {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 10px;
    margin: 16px 0 10px;
  }

  .section-head p {
    flex: 1 1 100%;
    font-size: var(--m-fs-sub);
    margin: 0;
    line-height: 1.55;
  }

  .section-head .more,
  a.more,
  .v3-sec-more {
    flex: 0 0 auto;
    font-size: 12.5px;
    min-height: 32px;
    display: inline-flex;
    align-items: center;
  }

  /* ------------------------------------------------------------ Hero 区块 */
  .hero,
  .hb-hero,
  .hub-hero,
  .v3-hero,
  .ab-hero {
    display: block !important;
    padding: 18px 16px !important;
    margin: 4px 0 14px !important;
    border-radius: var(--m-radius) !important;
    overflow: hidden;
  }

  .hero-grid,
  .hero-panel,
  .hb-hero,
  .hb-hero .hb-hero-txt,
  .hero-stats,
  .hb-stats,
  .v3-stats,
  .cm-hero-stats {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .hero-panel,
  .hero-grid > *,
  .hero > * + * {
    margin-top: 12px;
    flex: 1 1 100%;
  }

  .hero-stat,
  .hb-stat,
  .v3-stat,
  .mc-stat,
  .cm-hero-stats > * {
    flex: 1 1 calc(50% - 8px) !important;
    min-width: 0 !important;
    padding: 10px 8px !important;
    text-align: center;
    border-radius: var(--m-radius-sm);
    overflow: hidden;
  }

  .hero-stat b,
  .hb-stat b,
  .v3-stat b,
  .mc-stat b,
  .cm-hero-stats b {
    display: block !important;
    font-size: 18px !important;
    line-height: 1.2 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero-stat span,
  .hb-stat span,
  .v3-stat span,
  .mc-stat span,
  .cm-hero-stats span {
    display: block;
    font-size: 11.5px !important;
    line-height: 1.3;
    opacity: .8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hero-actions {
    display: flex !important;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
  }

  .hero-actions .btn,
  .hero-actions a {
    flex: 1 1 calc(50% - 10px);
    min-height: var(--m-tap);
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border-radius: 12px;
  }

  .hero-desc,
  .hub-hero p,
  .hb-eyebrow,
  .hub-eyebrow {
    font-size: var(--m-fs-sub) !important;
    line-height: 1.65 !important;
    margin: 0 0 10px !important;
    max-width: 100%;
  }

  /* -------------------------------------------------------------- 搜索框 */
  .hub-search,
  .search-box,
  .xhm-field,
  .hb-search {
    display: flex !important;
    align-items: center;
    gap: 8px;
    width: 100% !important;
    max-width: 100% !important;
    min-height: var(--m-tap);
    padding: 0 12px !important;
    border-radius: 12px;
    overflow: hidden;
  }

  .hub-search input,
  .search-box input,
  .xhm-field input,
  .hb-search input {
    flex: 1 1 auto !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 42px;
    padding: 0 !important;
    font-size: 14px !important;
    background: transparent;
    border: 0;
    outline: 0;
  }

  .hub-search button,
  .search-box button,
  .hub-search svg,
  .search-box svg,
  .hub-search kbd,
  .search-box kbd {
    flex: 0 0 auto !important;
    max-width: 40px;
  }

  .search-box kbd,
  .hub-search kbd {
    display: none !important;
  }

  /* ---------------------------------------------------------------- 卡片 */
  .card,
  .m-card,
  .v3-card,
  .site-card,
  .tl-card,
  .v3-site-card,
  .repo-item,
  .cm-topic,
  .cm-repo,
  .issue-item,
  .cm-issue-item,
  .quick-app,
  .mc-scan-card,
  .ad-box {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: var(--m-tap);
    padding: 12px 14px !important;
    margin: 0 0 var(--m-gap) !important;
    border-radius: var(--m-radius) !important;
    overflow: hidden;
  }

  .card-head,
  .v3-card-head,
  .tl-head,
  .cm-repo-top,
  .cm-panel-head {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
    padding: 0 0 8px !important;
    min-width: 0;
  }

  .card-head .card-title,
  .v3-card-head .t,
  .v3-card-head b,
  .tl-title,
  .repo-name,
  .cm-repo-top a,
  .cm-item .body > a.t,
  .issue-item a.t {
    flex: 1 1 auto;
    min-width: 0;
    font-size: var(--m-fs-title) !important;
    line-height: 1.35 !important;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal !important;
  }

  .card-ico,
  .v3-ibx,
  .tl-ico,
  .site-ico,
  .dl-icon,
  .quick-ico,
  .plat-ico {
    flex: 0 0 auto !important;
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    overflow: hidden;
  }

  .card-ico svg,
  .v3-ibx svg,
  .tl-ico svg,
  .site-ico svg,
  .dl-icon svg,
  .quick-ico svg,
  .plat-ico svg {
    width: 20px !important;
    height: 20px !important;
  }

  .card-body,
  .tl-desc,
  .dl-desc,
  .cm-topic .desc,
  .v3-card-bd {
    font-size: var(--m-fs-sub) !important;
    line-height: 1.6 !important;
    color: var(--xh-muted);
    max-width: 100%;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
  }

  .card-foot,
  .v3-card-foot,
  .tl-foot,
  .cm-repo-foot,
  .dl-foot {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 8px !important;
    padding-top: 10px !important;
    min-width: 0;
  }

  /* 卡片内按钮不被压扁 */
  .card-foot .xh-btn,
  .v3-card-foot .xh-btn,
  .tl-foot .xh-btn,
  .tl-go,
  .dl-btn,
  .lh-go,
  .lc-go {
    flex: 0 0 auto !important;
    min-width: 84px;
    min-height: 38px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 14px !important;
    font-size: 13px !important;
    white-space: nowrap !important;
    border-radius: 10px !important;
  }

  .dl-btn.lg {
    width: 100% !important;
    min-height: var(--m-tap) !important;
    font-size: 14.5px !important;
  }

  .detail-actions {
    display: flex !important;
    flex-wrap: wrap;
    gap: 10px;
  }

  .detail-actions .xh-btn {
    flex: 1 1 calc(50% - 10px);
    min-height: var(--m-tap);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
  }

  /* 标签/徽标不撑行 */
  .tl-tag,
  .badge,
  .xh-ad-tag,
  .tag-pill {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto !important;
    font-size: 11.5px !important;
    line-height: 1.25 !important;
    padding: 3px 9px !important;
    min-height: 22px;
    min-width: 0;
    border-radius: 999px !important;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
  }

  /* 标签所在的卡片头部/脚部允许换行，避免徽标把容器顶破 */
  .card-head,
  .v3-card-head,
  .tl-head,
  .dl-foot,
  .card-foot,
  .v3-card-foot,
  .tl-foot {
    flex-wrap: wrap !important;
    row-gap: 6px !important;
  }

  .notice-strip {
    display: block !important;
    flex: 1 1 100%;
    font-size: 12.5px !important;
    padding: 9px 12px !important;
    line-height: 1.55;
    border-radius: var(--m-radius-sm) !important;
    white-space: normal;
  }

  .notice-strip {
    display: block !important;
    padding: 9px 12px !important;
    line-height: 1.55;
    border-radius: var(--m-radius-sm) !important;
    white-space: normal;
    font-size: 12.5px !important;
  }

  /* ------------------------------------------------------------- 栅格系统 */
  .grid,
  .site-grid,
  .mc-grid,
  .repo-list,
  .cm-list,
  .quick,
  .card-list,
  .list-grid,
  .grid-2,
  .grid-3,
  .grid-4,
  .hero-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: var(--m-gap) !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* 快捷入口类：两列小卡 */
  .quick,
  .mc-grid.tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .quick-item {
    min-height: 76px;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px;
    padding: 10px 8px !important;
    border-radius: var(--m-radius-sm) !important;
    overflow: hidden;
  }

  .quick-item .qi-txt,
  .quick-item b {
    font-size: 12.5px !important;
    text-align: center;
    line-height: 1.3;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .quick-item i {
    display: none !important;
  }

  /* --------------------------------------------------------------- 表单 */
  /* 注意：绝不能把 checkbox/radio/file 等控件纳入整行输入框规则，
     否则复选框会被撑成 44px 高的整行方块，把「同意用户协议」等文案挤到重叠。 */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="tel"],
  input[type="number"],
  input[type="search"],
  input[type="url"],
  input[type="date"],
  input[type="time"],
  input:not([type]):not([class*="chk"]),
  textarea,
  select {
    width: 100% !important;
    max-width: 100% !important;
    min-height: var(--m-tap);
    padding: 10px 12px !important;
    font-size: 15px !important;   /* ≥16px 可防 iOS 自动放大，15px 兼顾观感 */
    border-radius: 10px !important;
    box-sizing: border-box;
  }

  /* 复选框 / 单选框：保持原生小尺寸，并与紧随其后的文案基线对齐 */
  input[type="checkbox"],
  input[type="radio"] {
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    min-height: 18px !important;
    max-width: 18px !important;
    margin: 2px 0 0 0 !important;
    padding: 0 !important;
    flex: 0 0 auto !important;
    vertical-align: middle;
  }

  input[type="file"] {
    width: 100% !important;
    max-width: 100% !important;
    font-size: 13px !important;
    padding: 8px 0 !important;
    min-height: 0 !important;
  }

  /* 含复选框的说明行（同意协议等）统一成 flex 一行，不重叠不换行错位 */
  label.check,
  label.agree,
  label[for],
  .field label,
  .auth-card label,
  .check {
    display: flex !important;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    font-size: 13px !important;
    line-height: 1.6 !important;
    min-height: 0 !important;
    text-align: left;
    font-weight: normal;
  }

  label.check > span,
  label.agree > span,
  .check > span {
    flex: 1 1 auto;
    min-width: 0;
  }

  label.check a,
  label.agree a,
  .check a {
    display: inline;
    min-height: 0;
    word-break: break-word;
  }

  textarea {
    min-height: 110px;
    line-height: 1.6;
  }

  .xhm-form .xhm-box,
  .xhm-row,
  .field {
    display: flex !important;
    align-items: center;
    gap: 10px;
    width: 100% !important;
    min-height: var(--m-tap);
  }

  .xhm-submit,
  .auth-submit,
  .xh-btn-primary,
  button[type="submit"] {
    width: 100% !important;
    min-height: var(--m-tap) !important;
    font-size: 15px !important;
    border-radius: 12px !important;
  }

  .xhm-card {
    width: min(94vw, 460px) !important;
    max-width: 94vw !important;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px !important;
    border-radius: var(--m-radius) !important;
  }

  .xhm-aside,
  .xhm-qr,
  .xhm-qr-side {
    display: none !important;
  }

  /* --------------------------------------------------------------- 表格 */
  table,
  table.xh-table,
  .tbl,
  .tbl table,
  .hist-table {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
    font-size: 12.5px !important;
  }

  table thead,
  .hist-table thead {
    display: table-header-group;
  }

  table th,
  table td,
  .hist-table td {
    padding: 9px 10px !important;
    white-space: nowrap;
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* --------------------------------------------------------- 认证页(登录) */
  body.auth-body .auth-shell,
  body.auth-body .auth-main {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 18px var(--m-pad) !important;
    min-height: auto !important;
  }

  body.auth-body .auth-brand {
    display: block !important;
    text-align: center;
    padding: 8px 0 16px !important;
  }

  body.auth-body .auth-brand h1 {
    font-size: 20px !important;
  }

  body.auth-body .auth-brand .brand-mark,
  body.auth-body .auth-brand .brand-mark img {
    width: 56px;
    height: 56px;
    margin: 0 auto 8px;
  }

  body.auth-body .auth-card {
    width: 100% !important;
    max-width: 100% !important;
    padding: 18px 16px !important;
    border-radius: var(--m-radius) !important;
  }

  .auth-tabs,
  .auth-tab {
    display: flex !important;
    width: 100%;
  }

  .auth-tab {
    flex: 1 1 0;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    font-size: 14px;
  }

  /* ---------------------------------------------------------- 会员中心 */
  .mc-nav {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    gap: 8px;
    padding: 6px 0 10px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .mc-nav::-webkit-scrollbar { display: none; }

  .mc-nav a {
    flex: 0 0 auto;
    min-height: 38px;
    display: inline-flex !important;
    align-items: center;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 13px;
    white-space: nowrap;
  }

  .mc-side {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: var(--m-gap);
  }

  .mc-row {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 10px;
    padding: 11px 0;
    min-height: var(--m-tap);
  }

  .mc-row span:last-child {
    max-width: 55%;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mc-panel {
    padding: 14px !important;
    border-radius: var(--m-radius) !important;
    margin-bottom: var(--m-gap);
  }

  /* ---------------------------------------------------------- 广告 / 其他 */
  .xh-ad-slot,
  .ad-wrap,
  .ad-footer {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden;
    border-radius: var(--m-radius-sm);
    margin: 12px 0;
  }

  .xh-ad-slot img,
  .ad-wrap img,
  .ad-footer img {
    width: 100% !important;
    height: auto !important;
    display: block;
  }

  .pager {
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 14px 0 4px;
  }

  .pager a,
  .pager span,
  .pager button {
    min-width: var(--m-tap);
    min-height: 38px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 10px !important;
    font-size: 13px;
    border-radius: 9px;
  }

  /* 页脚链接竖向堆叠 */
  .xh-foot-inner,
  .site-foot-inner {
    display: block !important;
    padding: 18px var(--m-pad) !important;
    text-align: center;
  }

  .xh-foot-col,
  .site-foot-links,
  .xh-foot-links {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center;
    gap: 8px 14px !important;
    margin: 0 0 10px !important;
  }

  .xh-foot-links a,
  .site-foot-links a {
    min-height: 34px;
    display: inline-flex !important;
    align-items: center;
    font-size: 12.5px;
  }

  .xh-foot-copy {
    font-size: 11.5px !important;
    line-height: 1.7;
    opacity: .75;
  }

  /* 小工具/旧版页 iframe 自适应 */
  iframe.xh-legacy-frame {
    width: 100% !important;
    min-height: 68vh;
    border: 0;
  }

  /* 详情正文 */
  .detail-body,
  .content-body {
    font-size: 14.5px !important;
    line-height: 1.8 !important;
  }

  .detail-body img,
  .content-body img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: var(--m-radius-sm);
  }

  .detail-body h2,
  .content-body h2 {
    font-size: 16.5px !important;
    margin: 18px 0 8px !important;
  }

  .detail-body h3,
  .content-body h3 {
    font-size: 15px !important;
    margin: 14px 0 6px !important;
  }

  .detail-body pre,
  .content-body pre {
    padding: 12px !important;
    border-radius: var(--m-radius-sm);
    font-size: 12.5px !important;
    overflow-x: auto;
  }

  /* 空状态 */
  .cm-empty {
    padding: 28px 16px !important;
    text-align: center;
    font-size: 13.5px;
    line-height: 1.7;
  }
}

/* ------------------------------------------------------------ 极窄屏微调 */
@media (max-width: 380px) {
  :root {
    --m-pad: 12px;
    --m-fs-h1: 19px;
    --m-tabbar-h: 58px;
  }

  .hero-stat b,
  .hb-stat b,
  .v3-stat b,
  .mc-stat b {
    font-size: 16px !important;
  }

  .mc-row span:last-child {
    max-width: 50%;
  }

  .xh-tab-label {
    font-size: 10px !important;
  }
}

/* -------------------------------------------------- 横屏手机（矮屏）修正 */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .xh-drawer-tiles,
  .xh-drawer-list {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  .hero,
  .hb-hero,
  .hub-hero,
  .v3-hero {
    padding: 14px 14px !important;
  }
}
