/* --------------------------------------------------------------------------
   响应式与端侧兼容：桌面 / 平板 / 常规手机（约 320–430px 宽）及刘海屏安全区
   依赖 tokens.css 中的 --sal / --sar / --sab / --sat / --header-stack
   -------------------------------------------------------------------------- */

/* 下拉导航：小屏横屏时避免被裁切 */
@media (max-width: 980px) {
  .nav {
    max-height: min(70vh, calc(100dvh - var(--header-stack) - 12px));
    max-height: min(70vh, calc(100vh - var(--header-stack) - 12px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  /* 触控最小热区约 44×44（Apple HIG / Material） */
  .nav-link {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0.75rem 0.75rem;
  }

  .lang-toggle {
    min-height: 44px;
    padding: 0.55rem 1.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .brand--lockup {
    --brand-logo-h: clamp(32px, 8vw, 40px);
  }

  .brand-logo--hero,
  .brand-logo--solid {
    max-width: min(72vw, 200px);
  }
}

/* Hero：横屏手机保证首屏可读 */
@media (max-height: 520px) and (orientation: landscape) {
  .home-splash {
    height: auto;
    min-height: 100dvh;
    max-height: none;
  }

  .hero {
    flex: none;
    min-height: 58dvh;
  }

  .hero {
    padding-top: calc(var(--header-stack) + 0.35rem);
    padding-bottom: 0.35rem;
  }

  .highlights--docked {
    flex: none;
  }

  .highlights--docked .highlight {
    padding: 0.9rem 1rem;
    min-height: auto;
  }
}

/* 服务标签：窄屏允许换行 */
@media (max-width: 480px) {
  .tag-row {
    gap: 0.4rem;
  }

  .tag {
    font-size: 0.8125rem;
    padding: 0.4rem 0.7rem;
  }
}

/* 产品类型胶囊：长中文在窄屏改为圆角块 + 换行 */
@media (max-width: 520px) {
  .pill {
    border-radius: var(--radius-md);
    min-height: 44px;
    align-items: flex-start;
    padding: 0.75rem 1rem;
    line-height: 1.45;
  }

  .pill span {
    word-break: break-word;
    overflow-wrap: anywhere;
  }
}

/* 平板宽度：流程在窄屏改为 3 列卡片式 */
@media (max-width: 1100px) and (min-width: 521px) {
  .process-timeline {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    row-gap: 1.25rem;
  }

  .process-timeline::before,
  .process-timeline::after {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   全屏区块统一适配（核心服务 + 技术设备）
   -------------------------------------------------------------------------- */

/* 矮视口：两屏同步收紧，避免一屏溢出、一屏留白 */
@media (max-height: 860px) {
  :root {
    --panel-pad-block: clamp(0.9rem, 1.9vh, 1.35rem);
    --panel-head-gap: clamp(0.95rem, 1.9vh, 1.35rem);
    --panel-inner-gap: clamp(0.72rem, 1.35vh, 0.95rem);
    --panel-body-offset: clamp(0.45rem, 1vh, 0.7rem);
  }

  .page-section#services {
    --svc-gap-banner-intro: clamp(0.62rem, 1.15vh, 0.78rem);
    --svc-gap-intro-cols: clamp(0.7rem, 1.25vh, 0.88rem);
    --svc-gap-cols: clamp(0.68rem, 1.25vw, 0.82rem);
    --svc-gap-highlights: clamp(0.65rem, 1.15vh, 0.82rem);
    --svc-gap-highlight-cards: clamp(0.62rem, 1vw, 0.78rem);
    --svc-list-pad: clamp(0.9rem, 1.5vh, 1.1rem);
    --svc-list-gap: clamp(0.5rem, 0.9vh, 0.65rem);
  }

  .service-highlight {
    min-height: clamp(6rem, 12vh, 7.35rem);
  }

  .service-list {
    line-height: 1.68;
  }

  .page-section#technology {
    --tech-head-gap: clamp(0.32rem, 0.75vh, 0.52rem);
    --tech-pad-top-extra: 0.12rem;
    --tech-pad-bottom: clamp(0.42rem, 0.85vh, 0.62rem);
    --tech-board-gap: clamp(0.38rem, 0.75vh, 0.55rem);
    --tech-eq-img-min-h: clamp(3.35rem, 8.5vh, 4.25rem);
    --tech-eq-img-max-h: clamp(3.85rem, 9.5vh, 5.15rem);
    --tech-col-img-min-h: clamp(3.25rem, 8.5vh, 4.15rem);
    --tech-col-img-max-h: clamp(4.5rem, 12vh, 5.75rem);
    --tech-grid-gap: clamp(0.48rem, 0.85vw, 0.65rem);
    --tech-card-pad: clamp(0.58rem, 1vw, 0.78rem);
  }

  .service-banner {
    padding: clamp(0.8rem, 1.6vh, 1rem) clamp(0.95rem, 1.6vw, 1.15rem);
  }

  .tech-team-band {
    padding: clamp(0.5rem, 1vh, 0.68rem) clamp(0.82rem, 1.45vw, 1rem);
  }

  .tech-team-band__title {
    margin-bottom: 0.25rem;
    font-size: clamp(0.92rem, 1.05vw, 1.02rem);
  }

  .tech-team-band__desc {
    font-size: clamp(0.74rem, 0.86vw, 0.82rem);
    line-height: 1.48;
  }
}

@media (max-height: 860px) and (min-width: 521px) {
  .page-section#process .process-board {
    min-height: clamp(21rem, 50vh, 30rem);
    padding: clamp(1.35rem, 3vh, 2rem) clamp(0.9rem, 1.6vw, 1.2rem);
  }

  .page-section#process .process-timeline {
    --process-node: clamp(50px, 6vh, 60px);
    --process-stem: clamp(28px, 4.5vh, 38px);
    --process-lane: clamp(4rem, 10vh, 5.5rem);
  }

  .page-section#process .process-timeline__item {
    min-height: clamp(12.5rem, 30vh, 16.5rem);
  }
}

@media (max-height: 720px) {
  :root {
    --panel-pad-block: clamp(0.75rem, 1.55vh, 1.05rem);
    --panel-head-gap: clamp(0.8rem, 1.55vh, 1.05rem);
    --panel-inner-gap: clamp(0.6rem, 1.15vh, 0.82rem);
  }

  .page-section#technology {
    --tech-eq-img-min-h: clamp(3rem, 7.5vh, 3.85rem);
    --tech-eq-img-max-h: clamp(3.5rem, 8.5vh, 4.75rem);
    --tech-col-img-min-h: clamp(3rem, 8vh, 4rem);
    --tech-col-img-max-h: clamp(4.25rem, 11vh, 5.25rem);
  }
}

@media (max-height: 720px) and (min-width: 521px) {
  .page-section#process .process-board {
    min-height: clamp(18rem, 46vh, 26rem);
    padding: clamp(1.1rem, 2.5vh, 1.65rem) clamp(0.85rem, 1.4vw, 1.1rem);
  }

  .page-section#process .process-timeline {
    --process-node: clamp(46px, 5.5vh, 54px);
    --process-stem: clamp(24px, 3.8vh, 32px);
    --process-lane: clamp(3.25rem, 8.5vh, 4.5rem);
  }

  .page-section#process .process-timeline__item {
    min-height: clamp(10.5rem, 26vh, 14rem);
  }
}

/* --------------------------------------------------------------------------
   技术设备模块：iOS / Windows 桌面 / 平板 / 常规手机 流体比例
   -------------------------------------------------------------------------- */

/* 大屏桌面（Windows 常见 1920、2K） */
@media (min-width: 1280px) {
  .page-section#technology {
    --tech-top-cols: minmax(0, 1.62fr) minmax(0, 1fr);
    --tech-eq-img-min-h: clamp(5rem, 13vh, 6.75rem);
    --tech-eq-img-max-h: clamp(6rem, min(18vh, 14vw), 9.5rem);
    --tech-col-img-min-h: clamp(4.5rem, 12vh, 6rem);
    --tech-col-img-max-h: clamp(6rem, min(17vh, 15vw), 8.75rem);
    --tech-col-img-min-h: clamp(4.65rem, min(13vh, 12.5vw), 6.75rem);
    --tech-col-img-max-h: clamp(6.75rem, min(19vh, 18vw), 9.5rem);
    --tech-col-media-gap: clamp(0.8rem, 1.35vh, 1.05rem);
  }
}

/* 笔记本 / iPad 横屏（仍并排） */
@media (max-width: 1180px) and (min-width: 901px) {
  .page-section#technology {
    --tech-top-cols: minmax(0, 1.48fr) minmax(0, 1fr);
    --tech-eq-img-min-h: clamp(4.5rem, 11.5vh, 5.85rem);
    --tech-eq-img-max-h: clamp(5.25rem, min(14vh, 13vw), 7.75rem);
    --tech-col-img-min-h: clamp(3.85rem, min(11.5vh, 12vw), 5.65rem);
    --tech-col-img-max-h: clamp(5.65rem, min(16vh, 17vw), 7.35rem);
  }
}

/* 平板及以下：上下堆叠，区块可纵向滚动（覆盖 sections 中后置的全屏锁高规则） */
@media (max-width: 900px) {
  .home-splash,
  .page-section:not(.page-section--contact-about),
  .viewport-panel--fill {
    height: auto;
    min-height: 100dvh;
    max-height: none;
    overflow: visible;
  }

  .page-section__contain,
  .page-section__contain--stack,
  .page-section__contain--services {
    flex: none;
    min-height: auto;
    overflow: visible;
  }

  .page-section--services,
  .page-section#services {
    overflow: visible;
  }

  .page-section#services .page-section__contain--services,
  .page-section#technology .page-section__contain--stack {
    justify-content: flex-start;
    gap: var(--panel-head-gap);
    padding-top: calc(var(--header-stack) + clamp(1rem, 2.5vh, 1.5rem));
    padding-bottom: max(var(--panel-pad-block), var(--sab));
  }

  .tech-board__top {
    grid-template-columns: 1fr;
    gap: clamp(0.85rem, 2.2vw, 1.1rem);
  }

  .page-section#technology {
    --tech-eq-img-min-h: clamp(4rem, 22vw, 5.25rem);
    --tech-eq-img-max-h: clamp(4.75rem, 28vw, 6.5rem);
    --tech-col-img-min-h: clamp(3.65rem, 24vw, 4.85rem);
    --tech-col-img-max-h: clamp(4.5rem, 30vw, 6.15rem);
  }

  /* 填料柱两图横排，节省纵向空间 */
  .tech-columns__media {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--tech-col-media-gap, clamp(0.65rem, 2vw, 0.85rem));
  }

  .tech-columns__thumb {
    min-height: clamp(3rem, 18vw, 4rem);
    padding: clamp(0.4rem, 1.5vw, 0.55rem);
  }

  .tech-columns__thumb img {
    max-height: clamp(4rem, 24vw, 5.5rem);
  }
}

/* 手机：设备区改为单图轮播 */
@media (max-width: 640px) {
  .page-section#technology {
    --tech-eq-img-min-h: clamp(7rem, 42vw, 9.5rem);
    --tech-eq-img-max-h: clamp(8rem, 48vw, 11rem);
    --tech-caption-size: clamp(0.64rem, 2.8vw, 0.74rem);
    --tech-note-size: clamp(0.72rem, 3.1vw, 0.82rem);
    --tech-card-pad: clamp(0.55rem, 3vw, 0.72rem);
  }

  .tech-equipment__carousel {
    flex: 0 0 auto;
  }

  .tech-equipment__grid {
    display: block;
    position: relative;
    min-height: clamp(10rem, 58vw, 14rem);
  }

  .tech-equipment__item {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transform: none;
    animation: none !important;
    transition: opacity 0.45s var(--ease-soft), visibility 0.45s;
    pointer-events: none;
  }

  .tech-equipment__carousel:not(.is-ready) .tech-equipment__item:first-child {
    position: relative;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .tech-equipment__item.is-active {
    position: relative;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .tech-equipment__dots {
    display: flex;
  }
}

/* 窄屏手机：色谱柱单列 */
@media (max-width: 520px) {
  .page-section#technology {
    --tech-eq-img-min-h: clamp(7rem, 44vw, 9.5rem);
    --tech-eq-img-max-h: clamp(8rem, 50vw, 11rem);
  }

  .tech-columns__media {
    grid-template-columns: 1fr;
  }

  .tech-columns__media {
    gap: clamp(0.68rem, 2.5vw, 0.88rem);
  }

  .tech-columns__thumb {
    min-height: clamp(3rem, 38vw, 4.25rem);
    padding: clamp(0.4rem, 2vw, 0.55rem);
  }

  .tech-columns__thumb img {
    max-height: clamp(4.25rem, 44vw, 6rem);
  }
}

/* 横屏手机：技术屏内容压缩 */
@media (max-width: 900px) and (max-height: 520px) and (orientation: landscape) {
  .page-section#technology {
    --tech-eq-img-min-h: clamp(2.75rem, 16vh, 3.35rem);
    --tech-eq-img-max-h: clamp(3rem, 18vh, 3.75rem);
    --tech-col-img-min-h: clamp(2.5rem, 16vh, 3.15rem);
    --tech-col-img-max-h: clamp(3rem, 20vh, 3.75rem);
    --tech-board-gap: 0.35rem;
  }

  .tech-equipment__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: clamp(0.55rem, 1vw, 0.75rem);
    row-gap: clamp(0.5rem, 1vh, 0.68rem);
  }

  .tech-equipment__carousel .tech-equipment__grid {
    display: block;
    position: relative;
    min-height: clamp(6rem, 28vh, 8rem);
  }

  .tech-equipment__carousel .tech-equipment__item {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    animation: none !important;
    pointer-events: none;
  }

  .tech-equipment__carousel .tech-equipment__item.is-active {
    position: relative;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .tech-equipment__carousel .tech-equipment__dots {
    display: flex;
  }

  .tech-columns__media {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tech-team-band {
    padding: 0.55rem 0.85rem;
  }

  .tech-team-band__desc {
    font-size: 0.76rem;
    line-height: 1.45;
  }
}

/* 极窄屏（320px 级） */
@media (max-width: 360px) {
  .page-section#technology {
    --tech-eq-img-min-h: clamp(6rem, 42vw, 8rem);
    --tech-eq-img-max-h: clamp(7rem, 46vw, 9.25rem);
    --tech-caption-size: 0.62rem;
    --tech-note-size: 0.7rem;
    --tech-card-pad: 0.5rem;
  }
}

/* 技术图：仅触控设备上始终显示轻微放大提示（无 hover 也能感知可点） */
@media (hover: none) {
  .tech-equipment__zoom,
  .tech-columns__zoom {
    opacity: 0.42;
  }

  .tech-equipment.shell--glass:hover,
  .tech-columns.shell--glass:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
  }

  .tech-equipment__thumb:hover,
  .tech-columns__thumb:hover {
    transform: none;
  }
}

/* 精细指针设备：补充悬停动效（避免触控端样式粘连） */
@media (hover: hover) and (pointer: fine) {
  .shell--lift:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
    border-color: rgba(0, 56, 200, 0.16);
  }

  .btn--ghost:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
  }

  .btn--solid:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }

  .btn--outline-dark:hover {
    border-color: rgba(0, 56, 200, 0.3);
    color: var(--color-brand);
  }

  .split:hover .split__media img {
    transform: scale(1.04);
  }

  .tech-equipment__thumb:hover .tech-equipment__zoom,
  .tech-columns__thumb:hover .tech-columns__zoom {
    opacity: 1;
  }

  .tech-equipment__thumb:hover img,
  .tech-columns__thumb:hover img {
    transform: scale(1.04);
  }

  .lightbox__close:hover {
    background: rgba(255, 255, 255, 0.16);
  }
}

/* 触控端：关闭易粘连的悬停位移 */
@media (hover: none), (pointer: coarse) {
  .tech-equipment__thumb,
  .tech-columns__thumb {
    min-height: 44px;
  }

  .shell--lift:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
    border-color: var(--color-line);
  }

  .btn--ghost:hover,
  .btn--solid:hover {
    transform: none;
  }

  .btn--solid:hover {
    box-shadow: var(--shadow-sm);
  }

  .split:hover .split__media img {
    transform: scale(1.001);
  }

  .pill:hover {
    transform: none;
    box-shadow: none;
  }

  .process-timeline__item:hover .process-timeline__node,
  .process-timeline__item:hover .process-timeline__content {
    transform: none;
  }
}

/* 极窄屏（如 320px） */
@media (max-width: 360px) {
  .section {
    padding: 3.25rem 0;
  }

  .section-head {
    margin-bottom: 2.25rem;
  }

  .hero__title {
    font-size: 1.55rem;
  }

  .contact-card {
    padding: 1.35rem;
  }

  .brand--lockup {
    --brand-logo-h: 30px;
  }

  .brand-logo--hero,
  .brand-logo--solid {
    max-width: min(92vw, 168px);
  }
}
