/* ========== 轮播区块包裹层（顶部让出固定头部高度，避免被遮挡） ========== */

/* 轮播包裹层（顶部内距等于固定头部高度；padding 在父级，绝对定位幻灯片随之整体下移） */
.main-page__hero {
    padding-top: var(--site-header-height, 0px);
}

/* ========== 轮播容器（基础尺寸与令牌） ========== */

/* 轮播区块（基础高度、兜底背景与页面级局部令牌集中声明处） */
.main-page__carousel {
    /* 轮播区块高度（移动优先，桌面断点覆盖） */
    --main-page-carousel-height: 280px;
    /* 轮播区块兜底背景（默认图，无卡片时显示） */
    --carousel-banner-bg: url('../../images/head.jpg') center center / cover no-repeat;
    /* 缩略图占位底（图片加载前浅色） */
    --carousel-thumb-bg: rgb(255 255 255 / 27%);
    /* 进度轨道底（半透明白） */
    --carousel-progress-track: rgb(255 255 255 / 24%);
    /* 切换按钮边框（半透明白） */
    --carousel-arrow-border: rgb(255 255 255 / 60%);
    /* 切换按钮底色（半透明黑） */
    --carousel-arrow-bg: rgb(0 0 0 / 40%);
    /* 当前卡片投影（轻阴影） */
    --carousel-card-shadow: 0 8px 32px rgb(0 0 0 / 18%);

    position: relative;
    height: var(--main-page-carousel-height);
    overflow: hidden;
    background: var(--carousel-banner-bg);
}

/* 轮播面板与窗口（铺满轮播区块） */
.main-page__carousel-panel,
.main-page__carousel-window {
    width: 100%;
    height: 100%;
}

/* 轮播视口（铺满轮播区块） */
.main-page__carousel-viewport {
    width: 100%;
    height: 100%;
}

/* ========== 轮播卡片（默认、当前与相邻状态） ========== */

/* 轮播卡片（默认隐藏与居中定位） */
.main-page__carousel-slide {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: var(--website-radius);
    overflow: hidden;
    opacity: 0;
    transform: translate(-50%, -50%);
    transition: opacity .45s ease, box-shadow .45s ease;
}

/* 轮播卡片图片（cover 裁切铺满，继承卡片圆角） */
.main-page__carousel-slide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
}

/* 轮播卡片（当前激活状态，投影悬起） */
.main-page__carousel-slide--active {
    z-index: 3;
    opacity: 1;
    box-shadow: var(--carousel-card-shadow);
}

/* 轮播卡片（相邻状态：单图形态下恒隐藏，仅保当前卡片） */
.main-page__carousel-slide--previous,
.main-page__carousel-slide--next {
    display: none;
}

/* ========== 轮播辅助控件（播放进度与缩略图） ========== */

/* 轮播播放进度容器（底部轨道） */
.main-page__carousel-progress {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 5;
    height: 7px;
    overflow: hidden;
    background: var(--carousel-progress-track);
}

/* 轮播播放进度条（缩放填充） */
.main-page__carousel-progress span {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--website-primary);
    transform: scaleX(0);
    transform-origin: left center;
    will-change: transform;
}

/* 轮播缩略图列表（底部居中排列；基础间距承接平板档） */
.main-page__carousel-thumbnails {
    position: absolute;
    bottom: 16px;
    left: 50%;
    z-index: 4;
    display: flex;
    gap: 6px;
    transform: translateX(-50%);
}

/* 轮播缩略图图片（固定尺寸与裁剪；基础尺寸承接平板档） */
.main-page__carousel-thumbnails img {
    display: block;
    width: 72px;
    height: 44px;
    border: 2px solid transparent;
    background: var(--carousel-thumb-bg);
    object-fit: cover;
    cursor: pointer;
}

/* 轮播缩略图图片（当前激活边框） */
.main-page__carousel-thumbnails img.main-page__carousel-thumbnail--active {
    border-color: var(--website-surface);
}

/* 轮播缩略图图片（键盘焦点描边） */
.main-page__carousel-thumbnails img:focus-visible {
    outline: 2px solid var(--website-surface);
    outline-offset: 2px;
}

/* ========== 轮播切换按钮（提高组件作用域覆盖首页通用 button 规则） ========== */

/* 轮播切换按钮（基础外观与居中定位；基础尺寸承接平板档） */
.main-page__carousel .main-page__carousel-arrow {
    position: absolute;
    top: 50%;
    z-index: 6;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 0;
    line-height: 1;
    border: 1px solid var(--carousel-arrow-border);
    border-radius: var(--website-radius);
    color: var(--website-surface);
    background: var(--carousel-arrow-bg);
    cursor: pointer;
    transform: translateY(-50%);
}

/* 轮播上一张按钮（左侧定位） */
.main-page__carousel .main-page__carousel-arrow--previous {
    left: 24px;
}

/* 轮播下一张按钮（右侧定位） */
.main-page__carousel .main-page__carousel-arrow--next {
    right: 24px;
}

/* 轮播切换按钮图标（基础箭头形状） */
.main-page__carousel .main-page__carousel-arrow span {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border: solid currentColor;
    border-width: 2px 2px 0 0;
    font-size: 0;
    transform: translate(-50%, -50%) rotate(45deg);
}

/* 轮播上一张按钮图标（左箭头方向） */
.main-page__carousel .main-page__carousel-arrow--previous span {
    border-width: 0 0 2px 2px;
    transform: translate(-40%, -50%) rotate(45deg);
}

/* 轮播下一张按钮图标（右箭头方向） */
.main-page__carousel .main-page__carousel-arrow--next span {
    border-width: 0 2px 2px 0;
    transform: translate(-60%, -50%) rotate(-45deg);
}

/* 轮播切换按钮（悬停与键盘焦点反馈：主题蓝底） */
.main-page__carousel .main-page__carousel-arrow:hover,
.main-page__carousel .main-page__carousel-arrow:focus-visible {
    background: var(--website-primary);
}

/* 轮播切换按钮（键盘焦点描边） */
.main-page__carousel .main-page__carousel-arrow:focus-visible {
    outline: 2px solid var(--website-surface);
    outline-offset: 2px;
}

/* ========== 断点布局 ========== */

/* ---- 桌面基准（992px 及以上） ---- */

/* 桌面轮播区块（高度与控件尺寸） */
@media (min-width: 992px) {
    /* 轮播区块（小桌面高度） */
    .main-page__carousel {
        --main-page-carousel-height: 420px;
    }

    /* 轮播缩略图列表（桌面间距） */
    .main-page__carousel-thumbnails {
        gap: 8px;
    }

    /* 轮播缩略图图片（桌面尺寸） */
    .main-page__carousel-thumbnails img {
        width: 76px;
        height: 48px;
    }

    /* 轮播切换按钮（桌面尺寸） */
    .main-page__carousel .main-page__carousel-arrow {
        width: 46px;
        height: 46px;
    }
}

/* ---- 宽屏桌面（>=1600px） ---- */

/* 轮播区块（超宽屏高度） */
@media (min-width: 1600px) {
    .main-page__carousel {
        --main-page-carousel-height: 560px;
    }

    /* 轮播缩略图图片（宽屏尺寸） */
    .main-page__carousel-thumbnails img {
        width: 80px;
        height: 50px;
    }

    /* 轮播切换按钮（宽屏尺寸） */
    .main-page__carousel .main-page__carousel-arrow {
        width: 48px;
        height: 48px;
    }
}

/* ---- 标准桌面（1201px-1599px） ---- */

/* 轮播区块（标准桌面高度） */
@media (min-width: 1201px) and (max-width: 1599px) {
    .main-page__carousel {
        --main-page-carousel-height: 480px;
    }
}

/* ---- 平板移动端（768px-991px） ---- */

/* 平板轮播区块（高度） */
@media (min-width: 768px) and (max-width: 991px) {
    /* 轮播区块（平板高度） */
    .main-page__carousel {
        --main-page-carousel-height: 360px;
    }
}

/* ---- 手机移动端（<=767px） ---- */

/* 手机缩略图/箭头收紧 */
@media (max-width: 767px) {
    /* 轮播缩略图列表（限宽居中） */
    .main-page__carousel-thumbnails {
        max-width: calc(100% - 32px);
        gap: 5px;
        justify-content: center;
        overflow: hidden;
    }

    /* 轮播缩略图图片（手机紧凑尺寸） */
    .main-page__carousel-thumbnails img {
        flex: 0 0 64px;
        width: 64px;
        height: 44px;
    }

    /* 轮播上一张按钮（左侧内缩） */
    .main-page__carousel .main-page__carousel-arrow--previous {
        left: 16px;
    }

    /* 轮播下一张按钮（右侧内缩） */
    .main-page__carousel .main-page__carousel-arrow--next {
        right: 16px;
    }
}

/* ---- 减少动态效果 ---- */

/* 减少动态偏好下的轮播卡片（保留状态切换，缩短过渡） */
@media (prefers-reduced-motion: reduce) {
    .main-page__carousel-slide {
        transition-duration: .01ms;
    }
}