/* 党建教育页移动端：覆盖桌面画布基线，不影响 821px 及以上的电脑端页面。 */
@media (max-width: 820px) {
  body[data-page="dangjian"] { --mobile-header-height: 62px; }

  html,
  body {
    min-width: 0 !important;
    overflow-x: hidden;
  }

  :root {
    --container: 100%;
    --type-section-title: 19px;
    --type-card-title: 16px;
    --type-body: 12px;
  }

  .container,
  #siteShellHeader .header-inner.container {
    width: calc(100% - 36px) !important;
  }

  #siteShellHeader .header-inner {
    min-height: 62px;
    gap: 10px;
  }

  #siteShellHeader .brand img { max-width: 112px; }
  #siteShellHeader .main-nav { display: none !important; }
  #siteShellHeader .nav-toggle { display: inline-flex !important; margin-left: auto; }
  #siteShellHeader .header-inner .button-small { display: none !important; }
  #siteShellHeader .compact-nav { width: min(296px, calc(100vw - 36px)); }

  .section { padding: 36px 0; }
  .section-heading { margin-bottom: 18px; }
  .section-heading h2 { font-size: 19px !important; line-height: 1.38; }
  .section-heading p { font-size: 12px !important; line-height: 1.65; }
  body[data-page="dangjian"] .section-heading > span { gap: 8px; font-size: 11px; }
  body[data-page="dangjian"] .section-heading > span::before,
  body[data-page="dangjian"] .section-heading > span::after { flex-basis: 34px; width: 34px !important; }
  body[data-page="dangjian"] #audience .section-heading > span,
  body[data-page="dangjian"] #solution .section-heading > span,
  body[data-page="dangjian"] #products .section-heading > span,
  body[data-page="dangjian"] #content .section-heading > span,
  body[data-page="dangjian"] #cases .section-heading > span { gap: 8px; font-size: 11px !important; }

  #dangjian-intro.dangjian-hero { height: 338px !important; min-height: 338px !important; overflow: hidden; background: #fbf8f4; }
  #dangjian-intro.dangjian-hero::before { z-index: 0; width: 100%; opacity: 1; background-position: right center; background-size: auto 100%; }
  #dangjian-intro.dangjian-hero::after { position: absolute; z-index: 1; inset: 0; background: linear-gradient(90deg, rgba(0, 0, 0, .86), rgba(0, 0, 0, .64)); content: ""; pointer-events: none; }
  #dangjian-intro .dangjian-hero-grid { position: relative; z-index: 2; width: 100%; height: 338px !important; min-height: 338px !important; padding: 0; }
  /* 与思政页一致：上方为文案与主按钮，下方为独立的能力入口。 */
  #dangjian-intro .inner-hero-copy { display: flex; flex-direction: column; align-self: stretch; width: 100%; box-sizing: border-box; height: 338px !important; min-height: 338px !important; padding: 48px 18px 18px; transform: translateY(-10px); }
  #dangjian-intro .inner-hero-copy h1 { margin-bottom: 8px; color: #fff; font-size: clamp(22px, 6vw, 25px); line-height: 1.36; }
  #dangjian-intro .inner-hero-copy > p { color: rgba(255, 255, 255, .9); font-size: clamp(13px, 3.5vw, 14px); font-weight: 400; line-height: 1.55; }
  #dangjian-intro .inner-hero-actions { align-items: center; justify-content: flex-end; flex-direction: row; flex-wrap: wrap; gap: 0; margin-top: 10px; }
  #dangjian-intro .inner-hero-actions .button { min-width: 0; min-height: 0; padding: 0; border: 0; border-radius: 0; color: #f0bd6b; background: transparent; font-size: 12px; }
  #dangjian-intro .inner-hero-actions .button::after { margin-left: 6px; content: "→"; font-size: 15px; line-height: 1; }
  #dangjian-intro .inner-hero-actions .button-ghost { display: none; }
  #dangjian-intro .dangjian-hero-capabilities { position: static; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 24px 0 0; padding: 0; border: 0; background: transparent; }
  #dangjian-intro .dangjian-hero-capabilities > div { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; min-height: 50px; padding: 0 3px; gap: 4px; border: 0; border-right: 1px solid rgba(255,255,255,.22); }
  #dangjian-intro .dangjian-hero-capabilities > div:last-child { border-right: 0; }
  #dangjian-intro .dangjian-capability-icon { flex: 0 0 18px; width: 18px; height: 18px; margin: 0; background-color: #e3b366; }
  #dangjian-intro .dangjian-hero-capabilities span { color: rgba(255,255,255,.9); font-size: 9px; line-height: 1.2; text-align: center; white-space: normal; }
  #dangjian-intro .dangjian-hero-banner-reserve { display: none; }

  .dangjian-audience-showcase,
  body[data-page="dangjian"] #products .wire-grid-4,
  body[data-page="dangjian"] #cases .wire-grid-3 {
    display: flex;
    grid-template-columns: none;
    gap: 12px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 2px 2px 12px;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .dangjian-audience-showcase::-webkit-scrollbar,
  body[data-page="dangjian"] #products .wire-grid-4::-webkit-scrollbar,
  body[data-page="dangjian"] #cases .wire-grid-3::-webkit-scrollbar { display: none; }

  .dangjian-audience-showcase > article,
  body[data-page="dangjian"] #products .wire-grid-4 > .matrix-card,
  body[data-page="dangjian"] #cases .wire-grid-3 > .matrix-card {
    flex: 0 0 260px;
    min-width: 0;
    scroll-snap-align: start;
  }

  .dangjian-audience-showcase > article,
  body[data-page="dangjian"] #products .wire-grid-4 > .matrix-card,
  body[data-page="dangjian"] #cases .wire-grid-3 > .matrix-card {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .dangjian-mobile-slider-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 2px 0 0;
  }

  .dangjian-mobile-slider-dots button {
    width: 6px;
    height: 6px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #c9c4bc;
    cursor: pointer;
    transition: background .18s ease, width .18s ease;
  }

  .dangjian-mobile-slider-dots button.is-active { width: 18px; border-radius: 4px; background: #a96f2f; }

  .dangjian-audience-showcase article { border-radius: 8px; box-shadow: none; }
  /* 与 PC 端共用媒体比例；cover 保持图片等比，不再被 100% 100% 拉伸。 */
  .dangjian-audience-showcase article > .image-placeholder { min-height: 0; aspect-ratio: 16 / 9; background-position: center; background-size: cover !important; background-repeat: no-repeat; }
  .dangjian-audience-showcase article > div:last-child { min-height: 110px; box-sizing: border-box; padding: 10px 14px; }
  .dangjian-audience-showcase span { padding-bottom: 8px; font-size: 22px; }
  .dangjian-audience-showcase i { top: 12px; right: 14px; width: 24px; height: 24px; }
  .dangjian-audience-showcase h3 { margin: 10px 0 5px; font-size: 16px; }
  .dangjian-audience-showcase p { font-size: 11px; line-height: 1.55; }

  body[data-page="dangjian"] #solution .split-feature { min-height: 0; border-radius: 8px; }
  body[data-page="dangjian"] #solution .split-feature-image { min-height: 0; aspect-ratio: 16 / 9; }
  body[data-page="dangjian"] #solution .split-feature-copy { padding: 18px 16px; }
  body[data-page="dangjian"] #solution .card-label { margin-bottom: 12px; padding-bottom: 8px; font-size: 11px; }
  body[data-page="dangjian"] #solution .split-feature-copy h3 { font-size: 18px; }
  body[data-page="dangjian"] #solution .split-feature-copy > p { font-size: 12px; }
  body[data-page="dangjian"] #solution .split-meta { margin-top: 14px; }
  body[data-page="dangjian"] #solution .split-meta b { padding: 8px 8px 0 44px; font-size: 14px; }
  body[data-page="dangjian"] #solution .split-meta b::before { top: 5px; left: 8px; width: 32px; height: 32px; }
  body[data-page="dangjian"] #solution .split-meta span { margin: -3px 8px 0 44px; font-size: 11px; }
  .dangjian-solution-flow { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; min-height: 142px; padding: 14px 10px 38px; border-radius: 8px; }
  .dangjian-solution-flow > div { grid-template-columns: 1fr; justify-content: center; min-height: 78px; gap: 5px; font-size: 10px; place-items: center; }
  .dangjian-solution-flow > div > i { width: 36px; height: 36px; }
  .dangjian-solution-flow > div > i::after { width: 18px; height: 18px; }
  .dangjian-solution-flow > div:not(:last-of-type)::after { top: 24px; left: calc(50% + 18px); display: block; width: calc(100% - 36px); }
  .dangjian-solution-flow > div:not(:last-of-type)::before { top: 20px; left: calc(100% - 9px); display: block; width: 9px; height: 9px; border-width: 2px; }
  .dangjian-solution-flow .button { position: absolute; right: 14px; bottom: 12px; justify-self: auto; margin: 0; font-size: 11px; }

  body[data-page="dangjian"] #products .matrix-card { border-radius: 8px; box-shadow: none !important; }
  body[data-page="dangjian"] #products .matrix-card > .image-placeholder { min-height: 0; aspect-ratio: 16 / 9; }
  body[data-page="dangjian"] #products .matrix-card-body { min-height: 0; padding: 12px 42px 12px 14px; }
  body[data-page="dangjian"] #products .matrix-card-body::after { right: 12px; bottom: 10px; font-size: 20px; }
  body[data-page="dangjian"] #products .matrix-card-body h3 { font-size: 16px; }
  body[data-page="dangjian"] #products .matrix-card-body p { font-size: 11px; }
  body[data-page="dangjian"] #products .center-action { margin-top: 16px; text-align: right; }
  body[data-page="dangjian"] #products .center-action .button { min-width: 0; min-height: 32px; padding: 0 12px; border: 1px solid #c69b58; border-radius: 5px; color: #b6752d; background: transparent; font-size: 12px; }
  body[data-page="dangjian"] #products .center-action .button::after { margin-left: 8px; color: #b6752d; font-size: 16px; }

  .dangjian-content-showcase { gap: 14px; }
  .dangjian-content-showcase > .image-placeholder { min-height: 0; aspect-ratio: 16 / 9; border-radius: 8px; }
  .dangjian-content-list { gap: 10px; }
  .dangjian-content-list article { grid-template-columns: 36px minmax(0, 1fr); gap: 9px; min-height: 0; padding: 12px; border-radius: 8px; }
  .dangjian-content-list i { width: 32px; height: 32px; }
  .dangjian-content-list i::after { width: 17px; height: 17px; }
  body[data-page="dangjian"] .dangjian-content-item--history i::before { display: none; }
  .dangjian-content-list b { margin-right: 5px; font-size: 18px; }
  .dangjian-content-list h3 { font-size: 14px; }
  .dangjian-content-list p { margin-top: 5px; font-size: 10px; line-height: 1.55; }

  body[data-page="dangjian"] #cases { padding: 0 0 22px; }
  body[data-page="dangjian"] #cases > .container { padding: 26px 18px; border-radius: 8px; }
  body[data-page="dangjian"] #cases .section-heading { margin-bottom: 22px; }
  body[data-page="dangjian"] #cases .section-heading h2 { margin: 12px 0 8px; }
  /* 案例卡和首页手机端保持同一组紧凑文字层级。 */
  body[data-page="dangjian"] #cases .wire-grid-3 .matrix-card-body { min-height: 0; padding: 12px 42px 12px 14px; }
  body[data-page="dangjian"] #cases .wire-grid-3 .matrix-card-body small { margin-bottom: 5px; font-size: 10px; }
  body[data-page="dangjian"] #cases .wire-grid-3 .matrix-card-body h3 { margin-bottom: 5px; font-size: 15px; line-height: 1.35; }
  body[data-page="dangjian"] #cases .wire-grid-3 .matrix-card-body p { font-size: 11px; line-height: 1.5; }
  body[data-page="dangjian"] #cases .wire-grid-3 .matrix-card-body::after { right: 14px; bottom: 14px; font-size: 22px; }

  .dangjian-final-cta { padding-bottom: 22px; }
  .dangjian-final-cta .container { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 12px; min-height: 0; padding: 20px 18px; border-radius: 8px; }
  .dangjian-final-cta .container > i { width: 36px; height: 36px; }
  .dangjian-final-cta h2 { margin-bottom: 5px; font-size: 16px; line-height: 1.35; white-space: normal; }
  .dangjian-final-cta p { font-size: 11px; line-height: 1.5; }
  .dangjian-final-cta-actions { grid-column: 1 / -1; display: flex; flex-direction: row; flex-wrap: nowrap; gap: 9px; width: 100%; max-width: 100%; margin: 0; overflow: hidden; }
  .dangjian-final-cta .button { flex: 0 0 auto; width: auto !important; min-width: 0; min-height: 31px; padding: 0 10px; font-size: 11px; gap: 8px; justify-content: flex-start; white-space: nowrap; }
  .dangjian-final-cta .button span { font-size: 14px; }

  #siteShellFooter .container { width: calc(100% - 36px) !important; }
}
