/*
 * 首页共享前台样式
 * Reason: 规则从原有主题样式按选择器归属拆分；不修改尺寸、颜色、断点和资源语义。
 */

.zbt-home {
    /* 首页外壳允许首屏背景延伸到页面两侧；正文区段保留独立的 PSD 宽度约束。 */
    max-inline-size: none;
    margin-inline: auto;
    background: var(--zbt-home-psd-canvas-background);
}

/* 只放开首屏，避免正文画布、轮播和新闻列表随超宽屏被拉伸。 */
.zbt-home > :not(.zbt-home-hero):not(.zbt-home-content),
.zbt-home-content > :not(.zbt-home-hero) {
    max-inline-size: var(--zbt-home-psd-canvas-inline-size);
    margin-inline: auto;
}

/* Chrome 在 1473px 会同时命中旧的 max-width:92.0624rem 和 min-width:92.0625rem；取桌面条件的反集保证互斥。 */
@media not all and (min-width: 92.0625rem) {
    .zbt-home {
        /* 新闻区现有 1200px 阅读边界作为流式首页各区段的共同外框。 */
        --zbt-home-responsive-stage-width: min(calc(100% - 96px), 1200px);
        /* 以视口换算共同展示台的约 9% 内缩，避免百分比在产品小卡内按小卡宽度重新计算。 */
        --zbt-home-responsive-inner-inset: clamp(24px, calc(9vw - 8.64px), 108px);
    }

    .zbt-home-section--about .zbt-section-kicker,
    .zbt-home-section--products .zbt-section-kicker,
    .zbt-solutions-showcase__section-title,
    .zbt-home-advantages__section-title,
    .zbt-home-news__title {
        /* PSD 标题位于展示台左缘内约 9%，不能贴着蓝色面板外沿。 */
        padding-inline-start: var(--zbt-home-responsive-inner-inset);
    }
}

@media (max-width: 70rem) {
    .zbt-home {
        --zbt-home-responsive-stage-width: min(calc(100% - 64px), 960px);
        --zbt-home-responsive-inner-inset: clamp(24px, calc(9vw - 5.76px), 86.4px);
    }
}

@media (max-width: 48rem) {
    .zbt-home {
        --zbt-home-responsive-stage-width: calc(100% - 48px);
        /* 单列手机保留原有齐左标题，避免短标题挤占卡片阅读空间。 */
        --zbt-home-responsive-inner-inset: 0px;
    }
}

.zbt-home-hero__actions .zbt-home-button {
    inline-size: 310px;
    min-block-size: 105px;
    padding: 0;
    border: 0;
    border-radius: var(--aura-morph-control-radius-squircle);
    box-shadow: none;
    font-family: "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
    font-size: 32px;
    font-weight: 400;
    line-height: 42px;
}

.zbt-home-button {
    display: inline-flex;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    gap: 33px;
    inline-size: 310px;
    min-block-size: 105px;
    padding: 0 29px;
    border: 0;
    border-radius: var(--aura-morph-control-radius-squircle);
    font-family: "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
    font-size: 32px;
    font-weight: 400;
    line-height: 42px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 160ms ease, color 160ms ease;
}

.zbt-home-button--hero-primary,
.zbt-home-button--about-more {
    background: var(--aura-spec-color-surface-primary);
    color: var(--aura-spec-color-text-neutral-diffuse);
}

.zbt-home-button--hero-secondary {
    background: var(--aura-spec-color-surface-neutral);
    color: var(--aura-spec-color-text-neutral-deep);
}

.zbt-home-button--products-more,
.zbt-home-button--solutions-more,
.zbt-home-button--news-more {
    background: var(--aura-spec-color-surface-neutral);
    color: var(--aura-spec-color-text-primary);
}

.zbt-home-button__icon,
.zbt-home-button__icon img {
    display: block;
    flex: 0 0 53px;
    inline-size: 53px;
    block-size: 53px;
}

.zbt-home-button--hero-primary,
.zbt-home-button--hero-secondary {
    justify-content: center;
    gap: 0;
    padding-inline: 0;
}

.zbt-home-button--hero-primary:hover,
.zbt-home-button--hero-primary:focus-visible,
.zbt-home-button--about-more:hover,
.zbt-home-button--about-more:focus-visible {
    background: var(--aura-spec-color-surface-primary-radiant);
}

.zbt-home-button--hero-secondary:hover,
.zbt-home-button--hero-secondary:focus-visible {
    background: #f3f3f3;
}

.zbt-home-button--products-more:hover,
.zbt-home-button--products-more:focus-visible {
    background: #eaf5ff;
}

.zbt-home-button--solutions-more:hover,
.zbt-home-button--solutions-more:focus-visible,
.zbt-home-button--news-more:hover,
.zbt-home-button--news-more:focus-visible {
    background: #f3f3f3;
}

.zbt-home-button:focus-visible {
    outline: 3px solid var(--aura-spec-color-surface-accent);
    outline-offset: 3px;
}

.zbt-home-section {
    padding-block: var(--aura-tectonic-inset-block-xl-fluid);
}

.zbt-home-section--surface {
    background: var(--aura-spec-color-surface-neutral);
}

.zbt-home-section--muted {
    background: var(--aura-spec-color-surface-neutral-subtle);
}

.zbt-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: var(--aura-tectonic-gap-all-lg);
    margin-bottom: var(--aura-tectonic-outset-block-xl);
}

.zbt-section-heading h2 {
    margin: 0;
    color: var(--aura-spec-color-text-neutral-deep);
    font-size: var(--aura-litho-display-size-2xl);
    font-weight: var(--aura-litho-heading-weight-bold);
    line-height: var(--aura-litho-heading-height-tight);
}

.zbt-text-link {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: var(--aura-tectonic-gap-all-sm);
    color: var(--aura-spec-color-text-primary);
    font-weight: var(--aura-litho-heading-weight-bold);
}

.zbt-text-link:hover,
.zbt-text-link:focus-visible {
    color: var(--aura-spec-color-text-primary-radiant);
}

.zbt-home-empty {
    margin: 0;
    color: var(--aura-spec-color-text-neutral-subtle);
}

.zbt-home-empty--inverse {
    color: var(--aura-spec-color-text-neutral-diffuse);
}

/*
 * 原因：Firefox/LibreWolf 会丢弃 scale(calc(100vw / 1920px))，但外层区块高度仍按
 * 视口缩小。只在检测到不支持该表达式时，给所有首页 PSD 画布使用脚本预先写入的纯数字比例。
 * Chromium 不添加兜底类，继续使用各区块原有的原生缩放声明。
 */
@media (min-width: 92.0625rem) and (max-width: 119.9375rem) {
    html.zbt-home-canvas-scale-fallback .zbt-home-about__layout,
    html.zbt-home-canvas-scale-fallback .zbt-home-products__layout,
    html.zbt-home-canvas-scale-fallback .zbt-home-section--solutions.has-psd-default:not(.is-solution-interactive) .zbt-solutions-showcase__default,
    html.zbt-home-canvas-scale-fallback .zbt-home-section--solutions:not(.has-psd-default) .zbt-solutions-showcase,
    html.zbt-home-canvas-scale-fallback .zbt-home-section--solutions.has-psd-default.is-solution-interactive .zbt-solutions-showcase,
    html.zbt-home-canvas-scale-fallback .zbt-home-advantages__default,
    html.zbt-home-canvas-scale-fallback .zbt-home-advantages__dynamic,
    html.zbt-home-canvas-scale-fallback .zbt-home-news__default,
    html.zbt-home-canvas-scale-fallback .zbt-home-news__dynamic {
        transform: scale(var(--zbt-home-psd-scale, 1));
    }
}

@media (max-width: 48rem) {
.zbt-section-heading {
        align-items: start;
        grid-template-columns: 1fr;
    }

.zbt-section-heading {
        display: grid;
    }
}

@media (max-width: 75rem) {
.zbt-home-hero__actions .zbt-home-button {
        inline-size: 260px;
        min-block-size: 88px;
        font-size: 28px;
    }
}

@media (max-width: 48rem) {
.zbt-home-hero__actions .zbt-home-button {
        inline-size: min(44vw, 160px);
        min-block-size: 58px;
        font-size: 19px;
        line-height: 28px;
    }
}

@media not all and (min-width: 92.0625rem) {
.zbt-home-section--about .zbt-home-button,
.zbt-home-section--products .zbt-home-button,
.zbt-home-section--solutions .zbt-home-button,
.zbt-home-news .zbt-home-button {
        inline-size: min(100%, clamp(11.5rem, 16vw, 16.125rem));
        block-size: auto;
        min-block-size: 0;
        aspect-ratio: 310 / 105;
        gap: clamp(0.625rem, 1.72vw, 2.0625rem);
        padding-inline: clamp(0.625rem, 1.52vw, 1.875rem);
        font-size: clamp(1.125rem, 1.7vw, 2rem);
        line-height: 1.3;
    }

.zbt-home-section--about .zbt-home-button__label,
.zbt-home-section--products .zbt-home-button__label,
.zbt-home-section--solutions .zbt-home-button__label,
.zbt-home-news .zbt-home-button__label {
        min-inline-size: 0;
        white-space: nowrap;
    }

.zbt-home-section--about .zbt-home-button__icon,
.zbt-home-section--about .zbt-home-button__icon img,
.zbt-home-section--products .zbt-home-button__icon,
.zbt-home-section--products .zbt-home-button__icon img,
.zbt-home-section--solutions .zbt-home-button__icon,
.zbt-home-section--solutions .zbt-home-button__icon img,
.zbt-home-news .zbt-home-button__icon,
.zbt-home-news .zbt-home-button__icon img {
        flex-basis: clamp(2.125rem, 2.76vw, 3.3125rem);
        inline-size: clamp(2.125rem, 2.76vw, 3.3125rem);
        block-size: clamp(2.125rem, 2.76vw, 3.3125rem);
    }

.zbt-solutions-showcase__more .zbt-home-button__icon,
.zbt-solutions-showcase__more .zbt-home-button__icon img {
        flex-basis: clamp(2.125rem, 2.76vw, 2.75rem);
        inline-size: clamp(2.125rem, 2.76vw, 2.75rem);
        block-size: clamp(2.125rem, 2.76vw, 2.75rem);
    }
}

@media (max-width: 48rem) {
.zbt-solutions-showcase__more .zbt-home-button__icon,
.zbt-solutions-showcase__more .zbt-home-button__icon img {
        flex-basis: 2.125rem;
        inline-size: 2.125rem;
        block-size: 2.125rem;
    }
}

@media (max-width: 35rem) {
.zbt-home-about__more .zbt-home-button__icon,
.zbt-home-about__more .zbt-home-button__icon img {
        flex-basis: 46px;
        inline-size: 46px;
        block-size: 46px;
    }
}

/* 首页同类说明文字共用PSD比例：小标题32px、正文22px、行距42px。
 * PSD文字图层包含0.906986缩放，35.28167/24.25615最终对应32/22，不能直接使用原始字号。
 * 响应式只缩放正文基准，小标题和行距由同一个值派生，避免多个clamp分别触底后比例漂移。
 * 仅覆盖关于我们、产品介绍、行业方案及优势卡说明；章节标题、数字统计、产品卡片和页脚不在此层级。
 */
.zbt-home-about__copy,
.zbt-products-intro,
.zbt-solutions-showcase__copy,
.zbt-home-advantage {
    --zbt-home-copy-body-size: 22px;
}

:is(.zbt-home, .editor-styles-wrapper) .zbt-home-section--about .zbt-home-about__copy h2,
:is(.zbt-home, .editor-styles-wrapper) .zbt-home-section--products .zbt-products-intro h2,
:is(.zbt-home, .editor-styles-wrapper) .zbt-home-section--solutions .zbt-solutions-showcase__copy h2,
:is(.zbt-home, .editor-styles-wrapper) .zbt-home-advantages .zbt-home-advantage h2 {
    /* 选择器限定真实业务容器，覆盖旧区块独立缩放，同时不误伤大标题。 */
    font-size: calc(var(--zbt-home-copy-body-size) * 32 / 22);
    line-height: calc(var(--zbt-home-copy-body-size) * 42 / 22);
}

:is(.zbt-home, .editor-styles-wrapper) .zbt-home-section--about .zbt-home-about__copy p,
:is(.zbt-home, .editor-styles-wrapper) .zbt-home-section--products .zbt-products-intro p,
:is(.zbt-home, .editor-styles-wrapper) .zbt-home-section--solutions .zbt-solutions-showcase__copy p,
:is(.zbt-home, .editor-styles-wrapper) .zbt-home-advantages .zbt-home-advantage p {
    font-size: var(--zbt-home-copy-body-size);
    line-height: calc(var(--zbt-home-copy-body-size) * 42 / 22);
}

@media (width < 92.0625rem) {
    .zbt-home-about__copy,
    .zbt-products-intro,
    .zbt-solutions-showcase__copy,
    .zbt-home-advantage {
        /* 手机正文保留16px可读下限；小标题约23.27px，而不是各区块各设22/24px下限。 */
        --zbt-home-copy-body-size: clamp(16px, calc(100vw * 22 / 1920), 22px);
    }
}
