/* 移动端（≤1023px）适配：只作用于「内容页」——文章页（构建时输出的单栏版本）/ 搜索页。
 * 桌面端（>1023px）完全不受影响。
 * 文章页：桌面版是云梦「绝对定位画布」，硬改流式会和布局脚本打架；
 *         所以构建时额外输出一份 .emba-mobile 干净单栏 DOM，窄屏时隐藏桌面画布、只显示它。
 */
.emba-mobile { display: none; }

@media screen and (max-width: 1023px) {
  html, body { min-width: 0 !important; overflow-x: hidden !important; background: #fff; }
  body > * { display: none !important; }
  body > .emba-mobile { display: block !important; }

  .emba-mobile {
    font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: #2b2b29; background: #fff; -webkit-text-size-adjust: 100%;
  }
  .emba-m-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid #ece8e2;
    position: sticky; top: 0; background: rgba(255,255,255,.96); z-index: 10;
  }
  .emba-m-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
  .emba-m-logo img { width: 34px; height: 34px; display: block; }
  .emba-m-brand { font-size: 17px; font-weight: 700; color: #002D5E; letter-spacing: .5px; line-height: 1.1; }
  .emba-m-brand em { display: block; font-style: normal; font-size: 9px; font-weight: 400; color: #8a97a8; letter-spacing: 1px; }
  .emba-m-links { display: flex; gap: 16px; }
  .emba-m-links a { font-size: 14px; color: #002D5E; text-decoration: none; }

  .emba-m-main { padding: 18px 18px 40px; }
  .emba-m-main .eco-article { width: auto !important; max-width: 100% !important; padding: 0 !important; margin: 0 !important; }
  .emba-m-main .eco-rule { width: 36px; height: 3px; margin-bottom: 14px; }
  .emba-m-main .eco-title { font-size: 26px !important; line-height: 1.35 !important; }
  .emba-m-main .eco-meta { font-size: 12px !important; line-height: 1.9 !important; }
  .emba-m-main .eco-lede { font-size: 16px !important; line-height: 1.8 !important; padding-left: 12px !important; }
  .emba-m-main .eco-body p,
  .emba-m-main .eco-body li,
  .emba-m-main .eco-body td { font-size: 17px !important; line-height: 1.9 !important; }
  .emba-m-main .eco-body h2 { font-size: 19px !important; margin: 34px 0 14px !important; }
  .emba-m-main .eco-body blockquote { font-size: 19px !important; line-height: 1.75 !important; padding-left: 14px !important; margin: 26px 0 !important; }
  .emba-m-main img, .emba-m-main video, .emba-m-main iframe { max-width: 100% !important; height: auto !important; }
  .emba-m-main video { width: 100% !important; }
  .emba-m-main table { display: block; overflow-x: auto; max-width: 100%; }
  .emba-m-main pre { font-size: 13px !important; overflow-x: auto; }


  /* 移动版小标题（div 实现，保留 role=heading 语义，避免与桌面版重复 h1/h2） */
  .emba-m-main .eco-body .eco-m-h2 {
    margin: 34px 0 14px; padding: 0 0 10px;
    border-bottom: 1px solid #e7e4df;
    font-size: 19px !important; line-height: 1.55; font-weight: 700; color: #141414;
  }
  .emba-m-main .eco-body > .eco-m-h2:first-child { margin-top: 4px; }
  .emba-m-main .eco-body--numbered .eco-m-h2 { position: relative; padding-left: 40px; counter-increment: eco-sec; }
  .emba-m-main .eco-body--numbered .eco-m-h2--plain { padding-left: 0; counter-increment: none; }
  .emba-m-main .eco-body--numbered .eco-m-h2--plain::before { display: none; }
  .emba-m-main .eco-body--numbered .eco-m-h2::before {
    content: counter(eco-sec, decimal-leading-zero);
    position: absolute; left: 0; top: 0;
    font-family: "Songti SC", "Source Han Serif SC", serif;
    font-size: 18px; line-height: 1.55; font-weight: 600; color: #E3120B;
  }


  .emba-m-main .eco-body p.eco-caption { font-size: 12px !important; line-height: 1.7 !important; margin: 6px 0 14px !important; }
  .emba-m-main .eco-body p.eco-caption--label { font-size: 13px !important; margin: 18px 0 8px !important; }

  .emba-m-footer { padding: 24px 18px 34px; border-top: 1px solid #ece8e2; color: #9a958e; font-size: 12px; line-height: 2; text-align: center; }

  /* 移动版搜索页 */
  .emba-m-search { padding: 16px; }
  .emba-m-search form { display: flex; gap: 8px; margin-bottom: 18px; }
  .emba-m-search input[type="search"], .emba-m-search input[type="text"] {
    flex: 1; min-width: 0; box-sizing: border-box; padding: 10px 12px; font-size: 15px;
    border: 1px solid #d9d4cc; border-radius: 2px;
  }
  .emba-m-search button { padding: 10px 16px; font-size: 15px; border: 0; background: #002D5E; color: #fff; border-radius: 2px; }
  .emba-m-search .m-count { font-size: 13px; color: #9a958e; margin-bottom: 12px; }
  .emba-m-search .m-item { display: block; padding: 14px 0; border-bottom: 1px solid #f0ece6; text-decoration: none; color: inherit; }
  .emba-m-search .m-title { font-size: 16px; line-height: 1.5; color: #141414; font-weight: 600; }
  .emba-m-search .m-sub { margin-top: 6px; font-size: 12px; color: #9a958e; }
}
