/* Static-deployment navigation and responsive safety layer. */
html {
  overflow-x: hidden;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
}

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

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

img, video {
  height: auto;
}

.section-shell,
.page-hero-shell,
.footer-shell,
.footer-bottom,
.nav-shell {
  max-width: calc(100vw - 30px);
}

.intro > *,
.platform-advantage > *,
.service-feature-layout > *,
.service-showcase-row > *,
.service-overview > *,
.aicb-intro > *,
.contact-section > *,
.contact-form-section > *,
.history-layout > * {
  min-width: 0;
}

.contact-form input,
.contact-form textarea,
.contact-form select,
.contact-form button {
  max-width: 100%;
  font: inherit;
}

h1, h2, h3, p, a, span, strong, small {
  overflow-wrap: break-word;
}

.footer-bottom a {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.footer-bottom a[href^="https://beian.miit.gov.cn/"]::before {
  content: "";
  width: 18px;
  height: 20px;
  flex: none;
  background: url("/images/footer-license.png") center / contain no-repeat;
}

.footer-bottom a:hover,
.footer-bottom a:focus-visible {
  text-decoration: underline;
}

/* Fit the layout to the actual browser viewport while keeping browser zoom at 100%. */
@media (min-width: 1025px) {
  body {
    zoom: var(--site-scale, 1);
  }

  .section-shell,
  .page-hero-shell,
  .footer-shell,
  .footer-bottom {
    width: min(1475px, var(--site-layout-width, calc(100vw - 48px)));
    max-width: none;
  }

  .nav-shell {
    width: min(1550px, var(--site-layout-width, calc(100vw - 48px)));
    max-width: none;
  }

  .hero-shell {
    width: min(1550px, var(--site-layout-width, calc(100vw - 48px)));
  }
}

/* Keep each screenshot aligned with the title and description above it. */
main.service-page:has(.service-trading-showcase) .service-mini-grid .service-mini-copy {
  text-align: center;
}

main.service-page:has(.service-trading-showcase) .service-mini-grid .service-mini-copy > svg {
  display: block;
  margin-inline: auto;
}

main.service-page:has(.service-trading-showcase) .service-mini-grid .service-showcase-image-link {
  margin-inline: auto;
}

/* One stable, decorative illustration per service page, shared by all feature tabs. */
main.service-page:has(.service-hero-image[src$="/concrete-trading.webp"]) { --feature-art: url("/images/services/feature-concrete-trading.webp"); }
main.service-page:has(.service-hero-image[src$="/smart-manufacturing.webp"]) { --feature-art: url("/images/services/feature-smart-manufacturing.webp"); }
main.service-page:has(.service-hero-image[src$="/material-procurement.webp"]) { --feature-art: url("/images/services/feature-material-procurement.webp"); }
main.service-page:has(.service-hero-image[src$="/ai-dispatch.webp"]) { --feature-art: url("/images/services/feature-ai-dispatch.webp"); }
main.service-page:has(.service-hero-image[src$="/supply-chain-finance.webp"]) { --feature-art: url("/images/services/feature-supply-chain-finance.webp"); }
main.service-page:has(.service-hero-image[src$="/industry-information.webp"]) { --feature-art: url("/images/services/feature-industry-information.webp"); }

main.service-page .service-feature-panel {
  gap: 16px;
  overflow: hidden;
}

main.service-page .service-feature-panel .service-feature-copy {
  flex: 1 1 54%;
  max-width: 54%;
  position: relative;
  z-index: 1;
}

main.service-page .service-feature-panel::after {
  content: "";
  flex: 1 1 42%;
  align-self: stretch;
  min-width: 0;
  background: var(--feature-art) center / contain no-repeat;
}

@media (max-width: 900px) {
  main.service-page .service-feature-panel {
    flex-direction: column;
    align-items: stretch;
  }

  main.service-page .service-feature-panel .service-feature-copy {
    flex: none;
    max-width: none;
  }

  main.service-page .service-feature-panel::after {
    flex: none;
    align-self: center;
    width: 100%;
    min-height: 210px;
    background-size: contain;
  }
}

@media (max-width: 1024px) {
  .desktop-nav,
  .nav-cta {
    display: none !important;
  }

  .menu-button {
    color: #fff;
    background: transparent;
    border: 0;
    margin-left: auto;
    padding: 10px;
    display: grid !important;
    place-items: center;
    min-width: 44px;
    min-height: 44px;
  }

  .mobile-nav {
    color: #fff;
    background: rgba(2, 22, 47, .98);
    border-top: 1px solid rgba(255, 255, 255, .12);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    padding: 28px 24px 32px;
  }

  .site-header:has(.menu-button[aria-expanded="true"]) .mobile-nav {
    display: grid;
  }

  .section-heading,
  .ai-banner-content,
  .service-contact-band .section-shell {
    gap: 28px;
  }
}

@media (max-width: 620px) {
  .section-shell,
  .page-hero-shell,
  .footer-shell,
  .footer-bottom,
  .nav-shell {
    width: calc(100% - 30px);
    max-width: none;
  }

  h1 {
    font-size: clamp(2.35rem, 12vw, 4rem) !important;
    line-height: 1.08 !important;
  }

  h2 {
    font-size: clamp(1.8rem, 8.5vw, 2.65rem) !important;
    line-height: 1.18 !important;
  }

  .mobile-nav {
    grid-template-columns: 1fr;
    max-height: calc(100dvh - 72px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .hero-actions,
  .news-tabs,
  .service-feature-tabs {
    flex-wrap: wrap;
  }

  .primary-button,
  .outline-button,
  .text-button {
    min-height: 44px;
  }

  .service-grid,
  .service-grid-six,
  .capability-grid,
  .culture-grid,
  .service-mini-grid,
  .service-value-grid {
    grid-template-columns: 1fr !important;
  }

  .ecosystem-row {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-panel,
  .map-panel-image,
  .service-showcase-visual,
  .service-value-image,
  .scene-image {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
