/* ==========================================================================
   百素New —— 主题配置驱动的外观（第四轮新增）
   配合 index.php 输出的 CSS 变量：
     --wz-icon-size  书签卡图标尺寸（默认 64px）
     --wz-cols       书签卡每行张数（64px 图标 → 5 张）
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 书签卡：图标尺寸由 --wz-icon-size 驱动，每行张数由 --wz-cols 驱动
   覆盖 bookmark-big.css 中写死的 40px / minmax(196px,1fr)
   -------------------------------------------------------------------------- */
.site-main-li .site-list.sortable:not(.article-grid) {
    /* 用 calc 反推列宽：总宽 - (列数-1)*间距，再除以列数。
       间距与 bookmark-big.css 保持一致（14px），保证卡片等宽铺满。 */
    grid-template-columns: repeat(var(--wz-cols, 5), minmax(0, 1fr)) !important;
}

.site-main-li .site-list .list.link .icon,
.site-main-li .site-list .list.wz .icon {
    width: var(--wz-icon-size, 64px) !important;
    height: var(--wz-icon-size, 64px) !important;
    max-width: none;
    object-fit: contain;
    padding: 4px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eef0f4;
}

/* 卡片内部留白随图标一起长，避免大图标顶到边框 */
.site-main-li .site-list .list.link {
    padding: 10px 12px;
    gap: 4px;
}

/* 图标变大后标题也跟着提一档，信息层级更清楚 */
.site-main-li .site-list .list .title {
    font-size: calc(var(--wz-icon-size, 64px) / 4.2);
    line-height: 1.35;
}

/* --------------------------------------------------------------------------
   2. 直达小图标（direct_btn=1 时出现），hover 卡片才显形
   -------------------------------------------------------------------------- */
.site-main-li .site-list .list .wz-go {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin-left: 6px;
    border-radius: 50%;
    color: #8a93a3;
    font-size: 14px;
    text-decoration: none;
    opacity: .35;
    transition: opacity .2s, background-color .2s, color .2s;
}

.site-main-li .site-list .list:hover .wz-go {
    opacity: 1;
    background: rgba(255, 255, 255, .22);
    color: #fff;
}

.site-main-li .site-list .list .wz-go:hover {
    background: #fff;
    color: #1E9FFF;
}

/* --------------------------------------------------------------------------
   3. 悬停提示气泡（hover_tip=1，由 wz-features.js 注入）
   -------------------------------------------------------------------------- */
#wz-tip {
    position: fixed;
    z-index: 99999;
    max-width: 320px;
    padding: 8px 12px;
    background: rgba(33, 40, 52, .96);
    color: #fff;
    font-size: 12.5px;
    line-height: 1.6;
    border-radius: 8px;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .22);
    pointer-events: none;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .16s ease, transform .16s ease;
    word-break: break-word;
}

#wz-tip.show {
    opacity: 1;
    transform: translateY(0);
}

/* --------------------------------------------------------------------------
   4. 侧栏收起 / 展开
   body.wz-sidebar-collapsed 时侧栏只剩图标列，主内容区左移
   -------------------------------------------------------------------------- */
#wz-sidebar-toggle {
    position: fixed;
    top: 22px;
    left: 240px;                 /* 与 .navlist-main 同宽 */
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: #fff;
    color: #5a6b85;
    border: 1px solid #e6eaf0;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(15, 30, 60, .1);
    cursor: pointer;
    transition: left .25s ease, background-color .2s, color .2s;
    user-select: none;
}

#wz-sidebar-toggle:hover {
    background: #1E9FFF;
    color: #fff;
    border-color: #1E9FFF;
}

#wz-sidebar-toggle i {
    font-size: 14px;
    transition: transform .25s ease;
}

body.wz-sidebar-collapsed #wz-sidebar-toggle {
    left: 64px;
}

body.wz-sidebar-collapsed #wz-sidebar-toggle i {
    transform: rotate(180deg);
}

/* 侧栏本体：宽度过渡 + 收起态只留图标
   注意：style.css 里有一条 .navlist-main{width:240px}（特异性同为 0-1-0），
   它在本文件之后加载，光靠同特异性的 .navlist-main 是压不住的。
   所以收起态一律用 body.wz-sidebar-collapsed .navlist-main（0-2-0）显式写死宽度，
   展开态则用 body:not(.wz-sidebar-collapsed) 提高特异性去覆盖 style.css。 */
body:not(.wz-sidebar-collapsed) .navlist-main {
    width: var(--wz-sidebar-w, 240px);
    transition: width .25s ease;
    overflow: hidden;
}

body.wz-sidebar-collapsed .navlist-main {
    width: 64px !important;
    transition: width .25s ease;
    overflow: hidden;
}

body.wz-sidebar-collapsed .navlist-main .logo,
body.wz-sidebar-collapsed .navlist-main .type-list .list p,
body.wz-sidebar-collapsed .navlist-main .type-list .list .icon,
body.wz-sidebar-collapsed .navlist-main .type-list .list-w2 p,
body.wz-sidebar-collapsed .navlist-main .user-info .text {
    display: none;
}

body.wz-sidebar-collapsed .navlist-main .type-list .list {
    width: 44px;
    margin-left: auto;
    margin-right: auto;
}

body.wz-sidebar-collapsed .navlist-main .type-list .list a {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

body.wz-sidebar-collapsed .navlist-main .type-list .list a i {
    margin-right: 0;
}

/* 收起态不允许展开子分类（否则会撑出横向滚动） */
body.wz-sidebar-collapsed .navlist-main .type-list .list-sub {
    display: none !important;
}

body.wz-sidebar-collapsed .navlist-main .user-info {
    justify-content: center;
    padding: 18px 0;
}

/* 主内容区跟着让位（style.css 里 .index-main{padding-left:260px} 是 0-1-0，
   这里用 0-2-0 覆盖） */
body.wz-sidebar-collapsed .index-main {
    padding-left: 84px;
}

/* --------------------------------------------------------------------------
   5. 子分类被关闭时（sidebar_sub=0）——侧栏项不再有展开箭头
   -------------------------------------------------------------------------- */
.navlist-main .type-list[data-sub="0"] .list .icon i.sub {
    display: none;
}

/* --------------------------------------------------------------------------
   6. 窄屏：图标适当缩一档，否则一行放不下
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
    :root { --wz-cols: 2; }

    .site-main-li .site-list .list.link .icon,
    .site-main-li .site-list .list.wz .icon {
        width: min(var(--wz-icon-size, 64px), 46px) !important;
        height: min(var(--wz-icon-size, 64px), 46px) !important;
    }

    .site-main-li .site-list .list .title {
        font-size: 14px;
    }

    /* 移动端侧栏是抽屉，收起按钮交给右下角 fixbar，避免双入口打架 */
    #wz-sidebar-toggle { display: none; }
    body.wz-sidebar-collapsed .index-main { padding-left: 20px !important; }
    /* 移动端抽屉必须保持全宽：用 !important 压过上面的 64px 收起态 */
    body.wz-sidebar-collapsed .navlist-main { width: 240px !important; }
    body.wz-sidebar-collapsed .navlist-main .type-list .list p,
    body.wz-sidebar-collapsed .navlist-main .type-list .list .icon,
    body.wz-sidebar-collapsed .navlist-main .user-info .text { display: block; }
}


/* ============================================================
   热点新闻：顶部独立一栏，位于「搜索框 + 时间」那一排的上方
   （.hot-panel/.hot-card 的内部布局由热点新闻插件自带样式负责，这里只做容器）
   ============================================================ */
.wz-hotnews {
    width: 100%;
    margin: 0 auto 14px;
    padding: 10px 14px 14px;
    background: var(--wz-card-bg, #fff);
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .06);
    font-size: 14px;
    overflow: hidden;
}
.wz-hotnews-tit {
    display: block;
    color: #f56c6c;
    font-weight: 600;
    font-size: 15px;
    padding: 2px 0 8px;
}
.wz-hotnews-tit i { margin-right: 5px; }
.wz-hotnews-body { width: 100%; min-width: 0; }
.wz-hotnews-body #lytoday { text-align: left; }
.wz-hotnews-body .empty,
.wz-hotnews-body .lytoday-empty { display: none; }

/* 热点新闻没加载出任何内容时，整栏自动塌陷（不占位置、不留白条） */
.wz-hotnews.is-empty { display: none; }

@media screen and (max-width: 768px) {
    .wz-hotnews { padding: 8px 10px 10px; }
}

/* ============================================================
   搜索栏：搜索引擎下拉框（搜索框左侧）
   注意特异性：必须用 .header-main 前缀压过 style.css 的同名气泡
   ============================================================ */
.header-main .seaech-main .input { display: flex; align-items: center; }
.header-main .seaech-main .input #search-engines {
    flex: 0 0 118px;
    width: 118px;
    height: 46px;
    box-sizing: border-box;
    padding: 0 22px 0 12px;
    border: 1px solid #fff;
    border-right: 0;
    border-radius: 5px 0 0 5px;
    background-color: #fff;
    color: #333;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23999'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
    background-size: 10px 6px;
    transition: 0.3s all;
}
.header-main .seaech-main .input #search-engines:focus { border-color: #1E9FFF; }
.header-main .seaech-main .input #search-engines option { font-weight: normal; }
/* 输入框排在下拉框右侧：左侧圆角让给下拉框 */
.header-main .seaech-main .input input {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    border-radius: 0 5px 5px 0;
}

/* 搜索提交图标（原「百度搜索」按钮的替代入口） */
.seaech-main .input #seaech-to {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    border-radius: 50%;
    cursor: pointer;
    color: #888;
}
.seaech-main .input #seaech-to:hover { background: rgba(0,0,0,.08); color: #2196f3; }

/* ===== 第八轮：搜索模块开关 + 站内搜索空态 ===== */
/* 关闭搜索模块后 header-main 只剩时间块，右对齐补位 */
.header-main.wz-no-search .times-main { margin-left: auto; }

/* 站内搜索无结果提示条（kbsearch.js 自研过滤的空态） */
.wz-search-empty {
    width: 100%;
    margin: 0 0 14px;
    padding: 22px 14px;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    color: #999;
    font-size: 14px;
    text-align: center;
}

/* ---------- 搜索过滤显隐（2.5.1）----------
 * bookmark-big.css 的 .site-main-li .site-list .list.link 与 article-big.css 的 .list.wz
 * 都是 display:flex !important，style.css 的 .list.hidden{display:none} 特异性不够被压制，
 * 导致站内搜索"卡片隐藏不了、关键词筛不出结果"。这里用更高特异性 + !important 夺回：
 * 未命中卡(.hidden)必须真正从布局消失，.link/.wz 两种大卡都覆盖。 */
.site-main-li .site-list .list.hidden,
.site-main-li .site-list .list.link.hidden,
.site-main-li .site-list .list.wz.hidden { display: none !important; }


/* ==========================================================================
   7. 整页壁纸 + 毛玻璃（第十轮 2.6.0）
   --------------------------------------------------------------------------
   index.php 在 body 上加 .wz-has-wall，并在 :root 注入三个变量：
     --wz-wallpaper  壁纸图片 url()
     --wz-wall-blur  高斯模糊 px
     --wz-wall-mask  白色遮罩 0~0.9
     --wz-card-alpha 卡片玻璃不透明度 0~1（第十一轮可调：越小壁纸越透）
     --wz-glass-blur 卡片毛玻璃模糊 px（第十一轮可调：越小壁纸越清晰）
   分层：body::before 壁纸（fixed + blur，scale(1.08) 防止模糊后四边露白）
        body::after  白遮罩（降低壁纸存在感，保证文字可读）
        内容区       玻璃化容器（半透明白 + backdrop-filter）
   注意：卡片 hover 的"变蓝"语言全部保留，只改非 hover 态背景。
   ========================================================================== */
body.wz-has-wall::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image: var(--wz-wallpaper);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(var(--wz-wall-blur, 8px));
    transform: scale(1.08);          /* 抵消模糊造成的边缘虚化 */
    pointer-events: none;
}

body.wz-has-wall::after {
    content: '';
    position: fixed;
    inset: 0;
    z-index: -1;
    background-color: #fff;
    opacity: var(--wz-wall-mask, .3);
    pointer-events: none;
}

/* ---------- 主要白容器玻璃化（非 hover 态）---------- */
body.wz-has-wall .navlist-main,
body.wz-has-wall .site-main-li,
body.wz-has-wall .wz-hotnews,
body.wz-has-wall .wz-search-empty,
body.wz-has-wall .site-main-li .sub-tabs,
body.wz-has-wall .site-main-li .site-list .list.link:not(:hover),
body.wz-has-wall .site-main-li .site-list .list.wz:not(:hover) {
    background-color: rgba(255, 255, 255, var(--wz-card-alpha, .62));
    -webkit-backdrop-filter: blur(var(--wz-glass-blur, 10px)) saturate(1.15);
    backdrop-filter: blur(var(--wz-glass-blur, 10px)) saturate(1.15);
}

/* ---------- 文章卡夺回（第十二轮 2.6.2）----------
   article-big.css 的 .list.wz 是 background-color:#ffffff !important，
   上面的普通规则压不过它 → 文章卡永远纯白、透明度对它无效。
   这里用同权重 !important + 更高特异性夺回（hover 的 calc 规则本就带 !important）。 */
body.wz-has-wall .site-main-li .site-list .list.wz:not(:hover) {
    background-color: rgba(255, 255, 255, var(--wz-card-alpha, .62)) !important;
}

/* ---------- 壁纸模式：圆角柔化，观感更现代 ---------- */
body.wz-has-wall .site-main-li,
body.wz-has-wall .wz-hotnews {
    border-radius: 12px;
    box-shadow: 0 6px 22px rgba(15, 30, 60, .08);
}

body.wz-has-wall .site-main-li .site-list .list.link,
body.wz-has-wall .site-main-li .site-list .list.wz {
    border-radius: 12px;
    border-color: rgba(255, 255, 255, .6);
}

/* 文章卡 hover 原本是 #fff !important，壁纸模式下改成"更实的玻璃"，
   否则 hover 会突然从半透明跳成纯白 */
body.wz-has-wall .site-main-li .site-list .list.wz:hover {
    background-color: rgba(255, 255, 255, calc(var(--wz-card-alpha, .62) + .22)) !important;
}

/* 搜索横幅与时间块在壁纸下保持自身配色（搜索背景另由主题配置的 background 管），
   只把时间块的蓝色阴影压柔一点，避免和壁纸抢眼 */
body.wz-has-wall .header-main .times-main {
    box-shadow: 0 6px 18px rgba(30, 159, 255, .25);
}

/* 侧栏玻璃化后，原来那条 1px 灰阴影显得脏，换成更淡的分隔 */
body.wz-has-wall .navlist-main {
    box-shadow: 1px 0 0 rgba(255, 255, 255, .35);
}
