.portal-nav-toggle,
.portal-filter-summary,
.portal-filter-close {
  display: none;
}

/* Keep tablet grids flexible while preserving the existing desktop layout. */
@media (max-width: 1050px) {
  .news-body :is(.news-layout, .article-detail-layout) > *,
  :is(.sol-hero-inner, .sol-current) > * {
    min-width: 0;
  }

  .article-detail-head h1 {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .article-body {
    overflow-wrap: anywhere;
  }

  .article-body :is(img, video, iframe) { max-width: 100%; }
  .article-body img { height: auto; }
  .article-body figure { margin-inline: 0; }

  .article-body :is(table, pre) {
    display: block;
    max-width: 100%;
    overflow-x: auto;
  }

  .sol-capability-flow,
  .sol-process ol {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  .sol-capability-flow > b,
  .sol-process li::after { display: none; }
}

@media (max-width: 900px) {
  .site-header.has-navigation-toggle .header-inner {
    position: relative;
    width: calc(100% - 28px);
    min-height: 64px;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 8px 0;
  }

  .site-header.has-navigation-toggle .brand {
    flex: 0 1 auto;
    align-self: center;
    width: clamp(100px, 33vw, 138px);
    height: auto;
    min-width: 0;
  }

  .site-header.has-navigation-toggle .brand img {
    display: block;
    width: 100%;
    height: auto;
  }

  .site-header.has-navigation-toggle :is(.portal-member-slot, .login) {
    height: 44px;
  }

  .site-header.has-navigation-toggle .portal-account-menu :is(a, button) {
    display: grid;
    min-height: 44px;
    align-items: center;
  }

  .site-header.has-navigation-toggle .portal-nav-toggle {
    display: grid;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 1px solid #d9e6fa;
    border-radius: 10px;
    color: #23406f;
    background: #f4f8ff;
    font-size: 23px;
    cursor: pointer;
  }

  .portal-nav-toggle[aria-expanded="false"] .ri-close-line,
  .portal-nav-toggle[aria-expanded="true"] .ri-menu-line { display: none; }

  .site-header.has-navigation-toggle .nav {
    position: absolute;
    z-index: 20;
    inset: 100% 0 auto;
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    height: auto;
    max-height: calc(100dvh - 76px);
    overflow-y: auto;
    padding: 8px;
    border: 1px solid #e2ecfa;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(30, 67, 126, .14);
  }

  .site-header.is-navigation-open .nav { display: grid; }

  .site-header.has-navigation-toggle .nav a {
    min-height: 44px;
    padding: 8px 12px;
    border-radius: 7px;
    font-size: 15px;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .site-header.has-navigation-toggle .nav a::after { content: none; }

  .site-header.has-navigation-toggle .nav a:is(.active, :hover, :focus-visible) {
    background: #eff5ff;
  }

  .site-header:not(.has-navigation-toggle) .nav:has(~ .portal-nav-toggle) {
    height: auto;
    flex-wrap: wrap;
    gap: 8px 18px;
    overflow: visible;
  }

  .site-footer :is(.footer-brand-block, .footer-link-column, .footer-contact, .footer-assurances > div) {
    min-width: 0;
  }

  .site-footer :is(.footer-brand-block h2, .footer-link-column a, .footer-contact-row strong, .footer-bottom span) {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .site-footer .footer-contact-row {
    max-width: 100%;
  }

  .site-footer :is(.footer-brand-block p, .footer-link-column a) { font-size: 14px; }

  /* The original banner illustration sits between the copy and the stats on small screens. */
  .hero-stage .hero-banner {
    display: grid;
    height: auto;
    padding: 28px 15px 20px;
    gap: 12px;
    background: linear-gradient(160deg, #f8fbff, #eaf3ff 63%, #fff);
  }

  .hero-stage .hero-banner::before {
    position: static;
    grid-row: 2;
    width: 100%;
    height: clamp(155px, 51vw, 300px);
    opacity: 1;
    background: url("assets/hero-background-saas-panel-v1.png") right center / auto 100% no-repeat;
  }

  .hero-stage .hero-copy {
    position: relative;
    grid-row: 1;
    inset: auto;
    width: min(100%, 650px);
    margin-inline: auto;
    transform: none;
  }

  .hero-stage .hero-copy > p { font-size: 15px; }
  .hero-stage .hero-actions { flex-wrap: wrap; }

  .hero-stage .stats-card {
    position: relative;
    grid-row: 3;
    inset: auto;
    width: min(100%, 650px);
    height: auto;
    min-height: 120px;
    margin-inline: auto;
    transform: none;
  }

  .service-grid,
  .customer-case-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .service-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, .65fr);
    align-items: center;
    height: auto;
    min-height: 218px;
  }

  .service-card .service-copy {
    width: auto;
    padding: 18px 0 14px 16px;
  }

  .service-copy h3 { font-size: 21px; }
  .service-copy p { height: auto; }
  .service-copy a { min-height: 44px; margin-top: 6px; }

  .service-card > img {
    position: static;
    align-self: end;
    width: 100%;
    height: auto;
    object-fit: contain;
  }

  .media-resources .platform-tabs {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 108px), 1fr));
    height: auto;
    overflow: visible;
  }

  .media-resources .platform-tab {
    min-width: 0;
    min-height: 44px;
    padding: 5px;
    gap: 5px;
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
    overflow-wrap: anywhere;
  }

  .media-resources .platform-tab img { flex: 0 0 18px; width: 18px; height: 18px; }

  .media-resources .resource-card:not(.is-news) {
    height: auto;
    min-height: 150px;
    padding-bottom: 52px;
  }

  .media-resources .resource-card-head { flex-wrap: wrap; }
  .media-resources .resource-card h3 { white-space: normal; overflow-wrap: anywhere; }

  .latest-news-showcase .latest-news-nav {
    flex-wrap: wrap;
    gap: 4px;
    overflow: visible;
  }

  .latest-news-showcase .latest-news-tabs {
    flex-wrap: wrap;
    overflow: visible;
  }

  .latest-news-showcase .latest-news-tabs button { min-width: 0; min-height: 44px; }

  .latest-news-showcase .latest-news-nav-more {
    display: inline-flex;
    min-height: 44px;
    margin-inline: auto 0;
  }

  .news-showcase-content h3 { display: block; min-height: 0; overflow-wrap: anywhere; }
  .news-showcase-content > p:not(.news-meta) { font-size: 14px; }

  /* The disclosure wraps the existing controls and preserves their query parameters. */
  .portal-media-page .media-filter-panel { padding: 0 12px; }

  .portal-filter-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 8px 4px;
    list-style: none;
    color: #23406f;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
  }

  .portal-filter-summary::-webkit-details-marker { display: none; }
  .portal-filter-summary i:last-child { margin-inline-start: auto; }
  .portal-filter-disclosure[open] .portal-filter-summary i:last-child { transform: rotate(180deg); }

  .portal-filter-scroll {
    max-height: min(55vh, 460px);
    max-height: min(55dvh, 460px);
    overflow: auto;
    overscroll-behavior: contain;
    padding: 0 4px 4px;
    border-top: 1px solid #e5edf8;
  }

  .portal-filter-close {
    display: block;
    min-height: 44px;
    margin: 8px 0;
    padding-inline: 14px;
    border: 1px solid #dbe5f2;
    border-radius: 8px;
    color: #29446e;
    background: #f5f8ff;
    font-size: 14px;
    cursor: pointer;
  }

  .portal-media-page .portal-filter-grid .filter-options { overflow-x: visible; }
  .portal-media-page .portal-filter-grid .filter-options button {
    min-height: 36px;
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .portal-media-page .results-toolbar {
    align-items: stretch;
    gap: 10px;
    flex-direction: column;
    padding: 12px;
  }

  .portal-media-page .results-controls {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
  }

  .portal-media-page .media-search {
    grid-area: 1 / 1 / 2 / 4;
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .portal-media-page .apply-filter { grid-area: 1 / 4; min-width: 0; }
  .portal-media-page .media-sort { width: 100%; min-width: 0; }
  .portal-media-page :is(.media-search input, .media-sort select, .media-custom-price input, [data-category-select]) {
    font-size: 16px;
  }

  .portal-media-page .media-price-list .media-price-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 14px;
  }

  .portal-media-page :is(.media-identity, .self-media-identity) {
    grid-area: 1 / 1 / 2 / -1;
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 12px;
  }

  .portal-media-page .media-identity > img { width: 68px; height: 56px; }
  .portal-media-page .self-media-identity > img { width: 56px; height: 56px; }

  .portal-media-page .media-price-row :is(.media-identity, .self-media-identity) h2 {
    overflow: visible;
    transform: none;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .portal-media-page .media-price-row .media-properties {
    grid-area: 2 / 1 / 3 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 12px 0 0;
    border: 0;
    border-top: 1px solid #e5ecf6;
  }

  .portal-media-page .media-properties :is(dt, dd) {
    white-space: normal;
    overflow: visible;
    overflow-wrap: anywhere;
  }

  .portal-media-page .media-properties :is(.web-media-remark, .remark) { grid-column: 1 / -1; }

  .portal-media-page .portal-stacked-prices {
    grid-area: 3 / 1;
    border: 0;
    padding: 4px 0;
  }

  .portal-media-page .media-price-list .publish-button {
    grid-area: 3 / 2;
    min-width: 88px;
    height: 44px;
    padding-inline: 12px;
  }

  .portal-media-page .pagination { flex-wrap: wrap; }
  .portal-media-page .pagination :is(button, select) { min-height: 44px; font-size: 14px; }

  .news-category-tabs { flex-wrap: wrap; gap: 4px; overflow: visible; }
  .news-category-tabs button { min-height: 44px; padding-inline: 12px; }

  .article-body :is(h2, h3, h4) { scroll-margin-top: 78px; }

  .about-business-grid .business-visual img,
  .about-business-grid article:hover .business-visual img { transform: none; }
  .about-business-grid p span { white-space: normal; }
  .timeline-list p { font-size: 14px; }

  .sol-hero-inner,
  .sol-current { grid-template-columns: minmax(0, 1fr); }

  .sol-hero-inner { padding-top: 16px; }
  .sol-hero h1 { font-size: clamp(30px, 6vw, 44px); }
  .sol-hero h2 { font-size: clamp(18px, 3.4vw, 24px); }
  .sol-hero-visual,
  .sol-current-visual {
    display: flex;
    justify-content: center;
    height: auto;
    min-width: 0;
  }

  .sol-hero-visual img,
  .sol-current-visual img {
    width: min(100%, 520px);
    max-width: 100%;
    height: auto;
    right: auto;
  }

  .sol-hero-glow { width: min(65%, 380px); height: auto; aspect-ratio: 1; right: 12%; }
  .sol-current-visual { margin-top: 16px; }
  .sol-current-visual::before,
  .sol-orbit { max-width: 100%; right: 0; }

  .sol-current-actions { flex-wrap: wrap; }
}

@media (max-width: 620px) {
  .hero-stage .hero-actions > button { flex: 1 1 130px; }

  .service-grid,
  .customer-case-grid,
  .why-jumei-grid { grid-template-columns: minmax(0, 1fr); }

  .why-jumei-item { min-height: 0; padding-block: 24px; }
  .why-jumei-item:not(:last-child) { border-bottom: 1px solid #e1e9f5; }
  .why-jumei-grid .why-jumei-item::after { display: none; }
  .why-jumei-highlight { min-height: 0; margin-top: 14px; }

  .latest-news-showcase .latest-news-tabs { justify-content: flex-start; }
  .latest-news-showcase .latest-news-tabs button { padding-inline: 9px; }

  .portal-media-page .portal-filter-grid { grid-template-columns: minmax(0, 1fr); }
  .portal-media-page .portal-filter-grid .filter-row {
    grid-column: 1;
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    padding-inline: 0;
  }

  .portal-media-page .media-sort { grid-column: span 2; }
  .portal-media-page .media-price-row .media-properties { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .news-hero,
  .news-hero-inner { min-height: 256px; }
  .news-hero h1 { font-size: clamp(26px, 7vw, 35px); }
  .article-list-content { padding-right: 0; overflow-wrap: anywhere; }
  .article-list-cover { height: auto; aspect-ratio: 16 / 9; }
  .article-list-cover img { display: block; aspect-ratio: 16 / 9; }
  .article-paper { padding-inline: 15px; }
  .article-hero-image { height: auto; aspect-ratio: 16 / 9; }
  .article-detail-head .breadcrumbs { flex-wrap: wrap; }

  .sol-wrap { width: calc(100% - 30px); }
  .sol-section { padding-block: 48px; }
  .sol-hero-copy { padding: 20px 0 18px; }
  .sol-hero-desc { margin-block: 15px 22px; }
  .sol-current { padding: 20px 16px; }
  .sol-current h3,
  .sol-heading h2,
  .sol-heading.compact h2 { font-size: 27px; }

  .sol-current dl > div {
    grid-template-columns: minmax(88px, auto) minmax(0, 1fr);
    align-items: start;
    gap: 8px;
  }

  .sol-current dt { gap: 5px; }
  .sol-current dd { overflow-wrap: anywhere; }
  .sol-scene-card { padding-inline: 8px; }

  .sol-capability-flow,
  .sol-process ol { grid-template-columns: minmax(0, 1fr); }

  .sol-proof-stats strong { font-size: clamp(23px, 7vw, 34px); }
  .sol-proof blockquote { padding-inline: 32px; }

  .sol-cta-inner {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    gap: 14px;
    padding: 24px 18px;
    text-align: center;
  }
}
