/* ============================================================
 * 白砚 Hero 横幅 - 首页全屏 Banner
 * 渐变背景 + 大标题 + 副标题 + 搜索框 + 热门标签 + 快捷入口卡片
 * 作用域限定 .baiyc-hb，兼容子比 main.css 工具类
 * ============================================================ */

/* 主题缺全局 box-sizing:border-box，须在作用域内自补 */
.baiyc-hb,
.baiyc-hb *,
.baiyc-hb *::before,
.baiyc-hb *::after {
    box-sizing: border-box;
}

/* ---------- 外壳：渐变背景 ---------- */
.baiyc-hb {
    position: relative;
    margin-bottom: 20px;
    padding: 54px 24px 46px;
    overflow: hidden;
    border-radius: var(--main-radius, 10px);
    background: linear-gradient(120deg, var(--baiyc-hb-from, #6a5af9) 0%, var(--baiyc-hb-to, #4bb8a9) 100%);
    color: #fff;
    text-align: center;
}

/* ---------- 全屏（通栏）：铺满视口宽度、无圆角、内容纵向居中 ---------- */
.baiyc-hb.baiyc-hb-full {
    width: 100%;
    margin: 0 0 20px;
    border-radius: 0;
    padding: 52px 16px 30px;
    min-height: var(--baiyc-hb-h, 430px);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- 导航栏透明叠加：横幅顶到导航栏下方（复刻父主题 show-slide 透明效果） ----------
 * 仅当主题开启「导航栏固定顶部」(body.nav-fixed) 时生效：
 * 此时父主题给 body 加了 88px(移动端 72px) 顶部占位，这里用负 margin 抵消，把横幅顶到最上方；
 * 再补上等量的 padding-top，让标题/搜索框落在导航栏下方不被遮挡。 */
body.baiyc-hb-overlay {
    --baiyc-hb-nav: 88px;
}

body.baiyc-hb-overlay.nav-fixed .baiyc-hb.baiyc-hb-full {
    margin-top: calc(-1 * var(--baiyc-hb-nav));
    padding-top: calc(52px + var(--baiyc-hb-nav));
    min-height: calc(var(--baiyc-hb-h, 430px) + var(--baiyc-hb-nav));
}

/* 页面顶部时导航栏透明、文字变白、去掉毛玻璃与阴影；向下滚动(.body-scroll)后自动恢复实色 */
body.nav-fixed:not(.body-scroll):not(.mobile-navbar-show).baiyc-hb-overlay .header {
    --header-bg: linear-gradient(0deg, rgba(0, 0, 0, 0) 5%, rgba(0, 0, 0, .1) 80%);
    --header-color: #fff;
    -webkit-backdrop-filter: unset;
    backdrop-filter: unset;
    box-shadow: none;
}

/* ---------- 背景图模式：图片铺满，叠加遮罩保证文字清晰 ---------- */
.baiyc-hb.baiyc-hb-has-bg {
    background: var(--baiyc-hb-bg) center / cover no-repeat;
}

/* 媒体背景基准：默认只保留极轻的光斑，尽量还原原图明亮色调 */
.baiyc-hb.baiyc-hb-has-media .baiyc-hb-decor {
    background:
        radial-gradient(circle at 12% 78%, rgba(255, 255, 255, .10), transparent 24%),
        radial-gradient(circle at 88% 22%, rgba(255, 255, 255, .08), transparent 22%);
}

/* 浅色遮罩（默认）：仅底部极轻微压暗，整体保持明亮通透 */
.baiyc-hb.baiyc-hb-has-media.baiyc-hb-mask-light .baiyc-hb-decor {
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .04) 55%, rgba(0, 0, 0, .16) 100%),
        radial-gradient(circle at 12% 78%, rgba(255, 255, 255, .10), transparent 24%),
        radial-gradient(circle at 88% 22%, rgba(255, 255, 255, .08), transparent 22%);
}

/* 中等遮罩 */
.baiyc-hb.baiyc-hb-has-media.baiyc-hb-mask-medium .baiyc-hb-decor {
    background:
        linear-gradient(180deg, rgba(0, 0, 0, .06) 0%, rgba(0, 0, 0, .18) 60%, rgba(0, 0, 0, .30) 100%),
        radial-gradient(circle at 12% 78%, rgba(255, 255, 255, .10), transparent 24%),
        radial-gradient(circle at 88% 22%, rgba(255, 255, 255, .08), transparent 22%);
}

/* 浓遮罩：深色，文字最清晰 */
.baiyc-hb.baiyc-hb-has-media.baiyc-hb-mask-strong .baiyc-hb-decor {
    background:
        linear-gradient(120deg, rgba(0, 0, 0, .32) 0%, rgba(0, 0, 0, .46) 100%),
        radial-gradient(circle at 12% 78%, rgba(255, 255, 255, .10), transparent 24%),
        radial-gradient(circle at 88% 22%, rgba(255, 255, 255, .08), transparent 22%);
}

/* 媒体背景上给文字加柔和阴影：即使浅遮罩、亮图也能看清 */
.baiyc-hb.baiyc-hb-has-media .baiyc-hb-title {
    text-shadow: 0 2px 16px rgba(0, 0, 0, .45), 0 1px 4px rgba(0, 0, 0, .30);
}

.baiyc-hb.baiyc-hb-has-media .baiyc-hb-sub {
    text-shadow: 0 1px 12px rgba(0, 0, 0, .45), 0 1px 3px rgba(0, 0, 0, .30);
}

/* ---------- 视频背景：铺满外壳，位于最底层 ---------- */
.baiyc-hb-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
}

/* 装饰：柔和波纹 / 光斑（位于视频背景之上、内容之下） */
.baiyc-hb-decor {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(circle at 12% 78%, rgba(255, 255, 255, .18), transparent 22%),
        radial-gradient(circle at 88% 22%, rgba(255, 255, 255, .16), transparent 20%),
        radial-gradient(circle at 78% 92%, rgba(0, 0, 0, .06), transparent 30%);
}

.baiyc-hb-decor::before,
.baiyc-hb-decor::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
}

.baiyc-hb-decor::before {
    width: 300px;
    height: 300px;
    right: -90px;
    bottom: -140px;
}

.baiyc-hb-decor::after {
    width: 200px;
    height: 200px;
    left: -80px;
    top: -90px;
    background: rgba(255, 255, 255, .06);
}

/* ---------- 内容容器 ---------- */
.baiyc-hb-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
}

.baiyc-hb-title {
    margin: 0 auto 10px;
    max-width: 680px;
    font-size: 42px;
    font-weight: 800;
    line-height: 1.18;
    color: #fff;
    letter-spacing: .5px;
}

.baiyc-hb-sub {
    margin: 0 auto 30px;
    max-width: 680px;
    font-size: 17px;
    font-weight: 400;
    color: rgba(255, 255, 255, .88);
}

/* ---------- 搜索框（白色胶囊 + 主色按钮） ---------- */
.baiyc-hb-search {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 660px;
    margin: 0 auto 18px;
    padding: 8px 8px 8px 24px;
    background: #fff;
    border-radius: 50px;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .16);
}

.baiyc-hb-search-input {
    flex: 1;
    min-width: 0;
    height: 44px;
    border: 0;
    outline: none;
    background: transparent;
    font-size: 16px;
    color: #333;
}

.baiyc-hb-search-input::placeholder {
    color: #9aa0a8;
}

.baiyc-hb-search-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 46px;
    padding: 0 26px;
    border: 0;
    cursor: pointer;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: var(--baiyc-hb-from, #007aff);
    transition: filter .2s, transform .2s;
}

.baiyc-hb-search-btn:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.baiyc-hb-search-btn i {
    font-size: 15px;
}

/* ---------- 热门标签 ---------- */
.baiyc-hb-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    max-width: 680px;
    margin: 0 auto 40px;
}

.baiyc-hb-tag {
    display: inline-block;
    padding: 6px 16px;
    font-size: 13px;
    color: #fff;
    text-decoration: none;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 30px;
    transition: background .2s, transform .2s;
}

.baiyc-hb-tag:hover {
    background: rgba(255, 255, 255, .3);
    transform: translateY(-1px);
    color: #fff;
}

/* ---------- 快捷入口卡片 ---------- */
.baiyc-hb-cards {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.baiyc-hb-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    text-decoration: none;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 12px;
    backdrop-filter: blur(4px);
    transition: background .2s, transform .2s, box-shadow .2s;
}

.baiyc-hb-card:hover {
    background: rgba(255, 255, 255, .24);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
}

.baiyc-hb-card-icon {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    font-size: 16px;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .12);
    overflow: hidden;
}

/* 图片图标：去掉渐变底色，图片铺满方块 */
.baiyc-hb-card-icon.baiyc-hb-card-icon-img {
    background: rgba(255, 255, 255, .16);
}

.baiyc-hb-card-icon-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 兼容子比 SVG 图标（zibsvg-*）在卡片图标方块内居中显示 */
.baiyc-hb-card-icon svg,
.baiyc-hb-card-icon .icon {
    width: 1em;
    height: 1em;
    fill: currentColor;
}

.baiyc-hb-card-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    text-align: left;
}

.baiyc-hb-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.baiyc-hb-card-sub {
    font-size: 11.5px;
    color: rgba(255, 255, 255, .82);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 图标颜色预设（渐变方块） */
.baiyc-hb-c-blue   { background: linear-gradient(135deg, #4f9dff, #2b6fe0); }
.baiyc-hb-c-green  { background: linear-gradient(135deg, #34d399, #10b981); }
.baiyc-hb-c-teal   { background: linear-gradient(135deg, #2dd4bf, #0d9488); }
.baiyc-hb-c-purple { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.baiyc-hb-c-orange { background: linear-gradient(135deg, #fbbf24, #f97316); }
.baiyc-hb-c-red    { background: linear-gradient(135deg, #fb7185, #ef4444); }
.baiyc-hb-c-pink   { background: linear-gradient(135deg, #f9a8d4, #ec4899); }

/* ---------- 深色模式 ---------- */
body.dark-mode .baiyc-hb {
    filter: saturate(.92) brightness(.9);
}

body.dark-mode .baiyc-hb .baiyc-hb-search {
    background: rgba(22, 24, 30, .6);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .4), inset 0 0 0 1px rgba(255, 255, 255, .1);
}

body.dark-mode .baiyc-hb .baiyc-hb-search-input {
    background: transparent !important;
    border: 0 !important;
    color: #eef1f6 !important;
    box-shadow: none !important;
}

body.dark-mode .baiyc-hb .baiyc-hb-search-input::placeholder {
    color: rgba(238, 241, 246, .55) !important;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1100px) {
    .baiyc-hb-cards {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .baiyc-hb.baiyc-hb-full {
        padding: 40px 16px 30px;
        min-height: var(--baiyc-hb-h-m, 320px);
    }

    /* 叠加模式：移动端基础内边距为 40，顶部同样补上导航栏高度 */
    body.baiyc-hb-overlay.nav-fixed .baiyc-hb.baiyc-hb-full {
        padding-top: calc(40px + var(--baiyc-hb-nav));
        min-height: calc(var(--baiyc-hb-h-m, 320px) + var(--baiyc-hb-nav));
    }

    /* 移动端不播放视频背景，回退为背景图片（poster / --baiyc-hb-bg） */
    .baiyc-hb-video {
        display: none;
    }

    .baiyc-hb-title {
        font-size: 30px;
    }

    .baiyc-hb-sub {
        font-size: 15px;
        margin-bottom: 22px;
    }

    .baiyc-hb-search {
        padding-left: 16px;
    }

    .baiyc-hb-search-btn span {
        display: none;
    }

    .baiyc-hb-search-btn {
        padding: 0 16px;
    }

    /* 移动端隐藏快捷入口卡片 */
    .baiyc-hb-cards {
        display: none;
    }

    .baiyc-hb-tags {
        margin-bottom: 4px;
    }
}

/* 叠加模式：≤640px 时父主题导航栏占位降为 72px，同步调整偏移量 */
@media (max-width: 640px) {
    body.baiyc-hb-overlay {
        --baiyc-hb-nav: 72px;
    }
}

@media (max-width: 420px) {
    .baiyc-hb-cards {
        grid-template-columns: 1fr;
    }
}
