/* 四个学术首页共用留白、内容宽度和图片尺寸；字体由 academic-typography.css 管理。 */
:root {
    --academic-hero-top: clamp(120px, calc(80px + 3.3333vw), 168px);
    --academic-hero-bottom: 40px;
    --academic-hero-content-height: 420px;
    --academic-hero-inset: 32px;
    --academic-hero-gap: 48px;
    --academic-hero-height: calc(var(--academic-hero-top) + var(--academic-hero-content-height) + var(--academic-hero-bottom));
}

.wiki-page .wiki-masthead,
.vision-page .vision-masthead,
.wsit-page .wsit-banner,
.insights-page .insights-masthead {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: var(--academic-hero-height);
    padding-block: var(--academic-hero-top) var(--academic-hero-bottom);
}

.wiki-page .wiki-masthead-grid,
.vision-page .vision-masthead > .vision-container,
.wsit-page .wsit-banner > .container,
.insights-page .insights-masthead > .insights-container {
    width: min(100% - var(--academic-hero-inset) * 2, 1240px);
    max-width: none;
    padding-inline: 0;
    margin-inline: auto;
    flex: 1;
    min-height: 0;
}

.vision-page .vision-masthead > .vision-container,
.wsit-page .wsit-banner > .container,
.insights-page .insights-masthead > .insights-container {
    display: flex;
    flex-direction: column;
}

.wiki-page .wiki-masthead-grid,
.vision-page .vision-masthead-grid,
.wsit-page .wsit-banner-grid,
.insights-page .insights-masthead-grid {
    display: grid;
    flex: 1;
    min-height: 0;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    align-items: center;
    gap: var(--academic-hero-gap);
    padding-bottom: 0;
}

.wiki-page .wiki-masthead-grid > div,
.vision-page .vision-masthead-grid > div,
.wsit-page .wsit-banner-copy,
.insights-page .insights-masthead-grid > div {
    min-width: 0;
    align-self: center;
}

.wiki-page .wiki-masthead-figure,
.vision-page .vision-masthead-figure,
.wsit-page .wsit-figure,
.insights-page .insights-figure {
    height: 100%;
    min-height: 0;
    margin: 0;
}

.wiki-page .wiki-masthead-photo,
.vision-page .vision-masthead-photo,
.wsit-page .wsit-photo,
.insights-page .insights-photo,
.wsit-page .wsit-photo img,
.insights-page .insights-figure img {
    height: 100%;
    max-height: none;
    aspect-ratio: auto;
}

.wiki-page .wiki-masthead .wiki-kicker,
.vision-page .vision-masthead .vision-eyebrow,
.wsit-page .wsit-banner .wsit-eyebrow,
.insights-page .insights-masthead .insights-eyebrow { margin-bottom: 12px; }

/* 百科保留搜索功能，缩小搜索区内部的额外留白。 */
.wiki-page .wiki-search-label { margin: 20px 0 8px; }
.wiki-page .wiki-suggestions { margin-top: 10px; }
.wiki-page .wiki-search-form input { padding-block: 10px; }

@media (min-width: 768px) and (max-width: 1199.98px) {
    :root {
        /* 为平板双行网站导航保留完整空间。 */
        --academic-hero-top: 176px;
        --academic-hero-bottom: 32px;
        --academic-hero-content-height: 400px;
        --academic-hero-inset: 24px;
        --academic-hero-gap: 32px;
    }
}

@media (max-width: 767.98px) {
    :root {
        --academic-hero-top: 80px;
        --academic-hero-bottom: 28px;
        --academic-hero-inset: 20px;
        --academic-hero-gap: 24px;
        --academic-hero-copy-height: 300px;
        --academic-hero-image-height: min((100vw - 40px) / 1.85, 280px);
        --academic-hero-content-height: calc(var(--academic-hero-copy-height) + var(--academic-hero-gap) + var(--academic-hero-image-height));
    }

    :root:lang(en) { --academic-hero-copy-height: 416px; }

    /* 文字与图片保持固定间距，剩余空间均分到整组内容上下。 */
    .wiki-page .wiki-masthead-grid,
    .vision-page .vision-masthead-grid,
    .wsit-page .wsit-banner-grid,
    .insights-page .insights-masthead-grid {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto var(--academic-hero-image-height);
        align-content: center;
    }

    .wiki-page .wiki-masthead-figure,
    .vision-page .vision-masthead-figure,
    .wsit-page .wsit-figure,
    .insights-page .insights-figure { height: var(--academic-hero-image-height); }

    .wiki-page .wiki-search-label { margin-top: 16px; }
    .wiki-page .wiki-suggestions { margin-top: 8px; }
    .wiki-page .wiki-search-form input { padding-block: 8px; }
    .wiki-page .wiki-search-form button { min-height: 44px; padding-block: 10px; }
}

@media (min-width: 390px) and (max-width: 559.98px) {
    :root:lang(en) { --academic-hero-copy-height: 376px; }
}

@media (min-width: 560px) and (max-width: 767.98px) {
    :root { --academic-hero-copy-height: 272px; }
    :root:lang(en) { --academic-hero-copy-height: 344px; }
}

@media (min-width: 600px) and (max-width: 767.98px) {
    :root:lang(en) { --academic-hero-copy-height: 304px; }
}

@media (max-width: 359.98px) {
    :root:lang(en) { --academic-hero-copy-height: 432px; }
}
