

/* 首屏 banner：宽度始终 100vw，按 1920 × 634 设计比例，内容等比缩放；
   字号在桌面/平板上按档位放大后，盒子允许长高，保证文案不被裁切 */
.qual-hero {
    position: relative;
    overflow: hidden;
    width: 100%;
    container-type: inline-size;
    min-height: calc(100vw * 634 / 1920);
    height: auto;
    background: #eaf4ff url("../images/qualification-hero-bg.jpg") center center / cover no-repeat;
}

.qual-hero > * {
    --cqw-length: 100cqw; /* 先按容器宽度解析成 px 再进 atan2，避免部分浏览器跨单位返回 0 */
    --hero-scale: tan(atan2(var(--cqw-length), 1920px)); /* hero 实际宽度 / 1920 */
    zoom: var(--hero-scale);
}

.qual-hero-inner {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    height: 100%;
    padding-top: 76px;
    padding-left: 58px;
}

.qual-hero h1 {
    margin: 0;
    font-family: var(--font-bold);
    font-size: 60px;
    font-weight: 700;
    line-height: 1.15;
    color: #111827;
}

.qual-hero p {
    max-width: 720px;
    margin: 64px 0 0;
    font-family: var(--font-regular);
    font-size: 20px;
    line-height: 40px;
    color: #465063;
}

.qual-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 213px;
    height: 54px;
    margin-top: 69px;
    border-radius: 6px;
    background: #1f66e5;
    font-family: var(--font-medium);
    font-size: 20px;
    font-weight: 500;
    color: #fff;
    transition: background .2s ease, transform .2s ease;
}

.qual-btn:hover {
    background: #1557cf;
    transform: translateY(-1px);
}

.qual-main {
    padding-bottom: 110px;
}

.qual-intro {
    position: relative;
}

.qual-title {
    position: absolute;
    z-index: 2;
    top: 68px;
    left: 0;
    right: 0;
    margin: 0;
    font-family: var(--font-bold);
    font-size: 36px;
    font-weight: 700;
    line-height: 1.3;
    color: #111827;
    text-align: center;
}

.qual-strip {
    display: block;
    width: 100%;
    height: auto;
}

.qual-card {
    position: relative;
    max-width: 1200px;
    margin: 0 auto 0;
    padding: 44px 34px 50px;
    border-radius: 18px;
    background: url("../images/bg-icon.png") right 26px top 0 / 210px auto no-repeat;
    box-shadow: 0px 0px 43px 0px rgba(168,214,255,0.57);
}

/* 左侧 tab + 右侧证书区 */
.qual-layout {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    gap: 30px;
    align-items: start;
}

.qual-tabs {
    display: flex;
    flex-direction: column;
    padding: 8px 0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 10px 26px -12px rgba(45, 106, 190, .28);
}

.qual-side,
.qual-panels {
    min-width: 0;
}

.qual-tab {
    position: relative;
    display: block;
    width: 100%;
    padding: 15px 20px;
    border: 0;
    background: none;
    font-family: var(--font-medium);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.5;
    color: #4b5563;
    text-align: left;
    cursor: pointer;
    transition: color .2s ease;
}

.qual-tab:hover {
    color: #1f66e5;
}

.qual-tab.is-active {
    font-family: var(--font-bold);
    font-weight: 700;
    color: #111827;
}

.qual-tab.is-active::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 3px;
    height: 30px;
    border-radius: 0 3px 3px 0;
    background: #1f66e5;
    transform: translateY(-50%);
}

.qual-panels {
    min-width: 0;
}

.qual-panel {
    display: none;
}

.qual-panel.is-active {
    display: block;
}

.qual-panel-title {
    margin: 2px 0 24px;
    font-family: var(--font-bold);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.4;
    color: #111827;
    text-align: center;
}

.qual-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.qual-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px 26px;
    border: 0;
    border-top: 1px solid #eef1f7;
    background: none;
    cursor: zoom-in;
    text-align: center;
}

.qual-item-thumb {
    display: flex;
    width: 100%;
    height: 292px;
    align-items: center;
    justify-content: center;
}

.qual-item-thumb img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    background: #fff;
    box-shadow: 0 10px 22px -12px rgba(31, 65, 120, .45);
    transition: transform .25s ease, box-shadow .25s ease;
}

.qual-item:hover .qual-item-thumb img {
    transform: translateY(-4px);
    box-shadow: 0 16px 30px -14px rgba(31, 65, 120, .52);
}

.qual-item-name {
    margin-top: 16px;
    font-family: var(--font-normal);
    font-size: 15px;
    line-height: 24px;
    color: #333;
}

.qual-empty {
    margin: 0;
    padding: 60px 0 30px;
    font-size: 16px;
    color: #8a94a6;
    text-align: center;
}

.qual-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 60px;
}

.qual-lightbox[hidden] {
    display: none;
}

body.qual-lightbox-open {
    overflow: hidden;
}

.qual-lightbox-mask {
    position: absolute;
    inset: 0;
    background: rgba(7, 19, 38, .84);
    backdrop-filter: blur(6px);
}

.qual-lightbox-dialog {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    width: 100%;
    max-width: 1120px;
}

.qual-lightbox-figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    max-height: 88vh;
}

.qual-lightbox-img {
    max-width: min(760px, 70vw);
    max-height: 76vh;
    width: auto;
    height: auto;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
}

.qual-lightbox-title {
    margin: 18px 0 0;
    font-size: 18px;
    line-height: 1.6;
    color: #e8f1ff;
    text-align: center;
}

.qual-lightbox-close {
    position: fixed;
    top: 28px;
    right: 32px;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    background: none;
    font-size: 38px;
    line-height: 1;
    color: #fff;
    cursor: pointer;
    opacity: .85;
    transition: opacity .2s ease;
}

.qual-lightbox-close:hover {
    opacity: 1;
}

.qual-lightbox-nav {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    padding: 0 0 4px;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    font-size: 34px;
    line-height: 1;
    color: #fff;
    cursor: pointer;
    transition: background .2s ease;
}

.qual-lightbox-nav:hover {
    background: rgba(255, 255, 255, .26);
}

.qual-lightbox-nav[disabled] {
    opacity: .3;
    cursor: default;
}

@media (max-width: 1440px) {
    .qual-card {
        padding: 40px 30px 46px;
    }

    .qual-layout {
        grid-template-columns: 160px minmax(0, 1fr);
        gap: 24px;
    }

    .qual-tab {
        padding: 13px 16px;
        font-size: 17px;
    }

    .qual-item-thumb {
        height: 258px;
    }
}

@media (max-width: 1200px) {
    .qual-title {
        font-size: 32px;
    }

    .qual-card {
        padding: 34px 24px 40px;
    }

    .qual-layout {
        grid-template-columns: 150px minmax(0, 1fr);
        gap: 20px;
    }

    .qual-panel-title {
        font-size: 23px;
    }

    .qual-item-thumb {
        height: 226px;
    }
}

/* 平板：侧边 tab 变成顶部横向 tab 条 */
@media (max-width: 1024px) {
    .qual-main {
        padding-bottom: 80px;
    }

    .qual-intro {
        margin-top: 0;
        padding-top: 60px;
    }

    .qual-title {
        position: static;
        margin-bottom: 30px;
    }

    .qual-card {
        margin-top: 26px;
        padding: 22px 18px 28px;
        border-radius: 14px;
    }

    .qual-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .qual-side {
        position: sticky;
        top: 90px;
        z-index: 5;
        min-width: 0;
    }

    .qual-tabs {
        flex-direction: row;
        gap: 4px;
        padding: 6px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 10px;
    }

    .qual-tab {
        width: auto;
        flex: 0 0 auto;
        padding: 9px 14px;
        font-size: 15px;
        white-space: nowrap;
        border-radius: 8px;
    }

    .qual-tab.is-active {
        background: #eef5ff;
    }

    .qual-tab.is-active::before {
        display: none;
    }

    .qual-panel-title {
        margin: 10px 0 16px;
        font-size: 20px;
    }

    .qual-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .qual-item {
        padding: 18px 10px 20px;
    }

    .qual-item-thumb {
        height: 190px;
    }

    .qual-item-name {
        margin-top: 12px;
        font-size: 14px;
        line-height: 22px;
    }

    .qual-lightbox {
        padding: 30px 24px;
    }

    .qual-lightbox-nav {
        display: none;
    }
}

@media (max-width: 768px) {
    .qual-intro {
        padding-top: 48px;
    }

    .qual-title {
        margin-bottom: 22px;
        font-size: 26px;
    }

    .qual-card {
        padding: 16px 12px 22px;
        border-radius: 12px;
    }

    .qual-panel-title {
        font-size: 18px;
        line-height: 26px;
    }

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

    .qual-item-thumb {
        height: 176px;
    }

    .qual-item-name {
        font-size: 13px;
        line-height: 20px;
    }

    .qual-lightbox {
        padding: 20px 14px;
    }

    .qual-lightbox-img {
        max-width: 92vw;
        max-height: 72vh;
    }

    .qual-lightbox-title {
        margin-top: 12px;
        font-size: 15px;
    }

    .qual-lightbox-close {
        top: 16px;
        right: 18px;
    }
}

@media (max-width: 480px) {
    .qual-grid {
        grid-template-columns: 1fr;
    }

    .qual-item-thumb {
        height: 210px;
    }
}

/* 桌面/平板：首屏文案比例系数 = max(--hero-typo 断点档位, 首屏缩放比)。
   视口 ≤ 1920 时取断点档位（小屏字号比设计值略大，避免字太小）；
   > 1920（宽屏 / 浏览器缩小页面）时跟着首屏等比放大，滚轮缩放时比例保持不变。 */
@media (min-width: 1024px) {
    .qual-hero h1 {
        font-size: calc(60px * max(var(--hero-typo), var(--hero-scale)) / var(--hero-scale));
    }

    .qual-hero p {
        font-size: calc(20px * max(var(--hero-typo), var(--hero-scale)) / var(--hero-scale));
        line-height: calc(40px * max(var(--hero-typo), var(--hero-scale)) / var(--hero-scale));
    }

    .qual-hero .qual-btn {
        font-size: calc(20px * max(var(--hero-typo), var(--hero-scale)) / var(--hero-scale));
    }
}
