/*
Theme Name: DocBook 电子书/试卷主题
Version: 6.0.0
Template: zibll
Description: 专为电子书、试卷设计的WordPress子主题，文档/电子书现代风格，支持日夜切换
*/

/* ============================================================
   DocBook v6.0.0 — 文档电子书风格
   设计原则：CSS 变量驱动，body.dark-theme 自动切换日夜
   ============================================================ */

/* ========== 设计变量（浅色） ========== */
:root {
    --bg: #eef1f6;
    --surface: #ffffff;
    --surface-2: #f4f6fa;
    --text: #1f2733;
    --muted: #6b7685;
    --border: #e6eaf0;
    --brand: #2f5f8f;
    --brand-2: #3b82c4;
    --accent: #e08a3c;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 3px rgba(17, 24, 39, .06), 0 8px 22px rgba(17, 24, 39, .05);
    --shadow-hover: 0 14px 34px rgba(17, 24, 39, .12);
    --header-bg: rgba(255, 255, 255, .82);
    --header-border: rgba(230, 234, 240, .9);
}

/* ========== 设计变量（深色 / 日夜切换） ========== */
body.dark-theme {
    --bg: #0e131a;
    --surface: #161d27;
    --surface-2: #1f2832;
    --text: #e6ebf2;
    --muted: #93a1b0;
    --border: #28323e;
    --brand: #5b9bd5;
    --brand-2: #6fb0e0;
    --accent: #f0a85a;
    --shadow: 0 1px 3px rgba(0, 0, 0, .45), 0 8px 22px rgba(0, 0, 0, .35);
    --shadow-hover: 0 14px 34px rgba(0, 0, 0, .55);
    --header-bg: rgba(16, 21, 28, .82);
    --header-border: rgba(40, 50, 62, .9);
}

/* ========== 基础重置 ========== */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    transition: background-color .35s ease, color .35s ease;
}

body.dark-theme {
    background: var(--bg);
}

/* 父主题为自身固定导航预留的 body 顶部 padding（88px/72px），
   子主题 header 是独立 sticky 的，不需要这个补偿，否则顶部会出现空白带 */
body.nav-fixed,
body.nav-fixed.nav-fixed {
    padding-top: 0;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color .2s ease;
}

img {
    max-width: 100%;
    height: auto;
}

.doc-container {
    width: 100%;
    max-width: var(--mian-max-width, 1180px);
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================================
   自定义头部
   ============================================================ */
.doc-header {
    position: sticky;
    top: 0;
    z-index: 999;
    background: var(--header-bg);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--header-border);
    transition: background-color .35s ease, border-color .35s ease, box-shadow .3s ease;
}

.doc-header.is-scrolled {
    box-shadow: 0 6px 20px rgba(17, 24, 39, .08);
}

.doc-header__inner {
    max-width: var(--mian-max-width, 1180px);
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 24px;
}

/* Logo */
.doc-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 19px;
    color: var(--text);
    white-space: nowrap;
    flex-shrink: 0;
}

.doc-logo__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    color: #fff;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
    box-shadow: 0 4px 12px rgba(47, 95, 143, .35);
}

.doc-logo__text {
    letter-spacing: .3px;
}

/* 导航（紧跟 logo 左对齐） */
.doc-nav {
    flex: 1;
    display: flex;
    justify-content: flex-start;
}

.doc-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.doc-menu > li {
    position: relative;
}

.doc-menu > li > a {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    color: var(--muted);
    transition: color .2s ease, background-color .2s ease;
}

/* 有子菜单的一级项：右侧展开小箭头 */
.doc-menu > li.menu-item-has-children > a::after {
    content: '';
    width: 6px;
    height: 6px;
    margin-left: 7px;
    margin-top: -3px;
    border-right: 1.8px solid currentColor;
    border-bottom: 1.8px solid currentColor;
    transform: rotate(45deg);
    opacity: .65;
    transition: transform .2s ease;
}

.doc-menu > li.menu-item-has-children:hover > a::after {
    transform: rotate(225deg);
    margin-top: 1px;
}

/* 后台设置的 logo 图片自适应高度 */
.doc-logo img {
    max-height: 40px;
    width: auto;
    display: block;
}

.doc-menu > li > a:hover,
.doc-menu > li.current-menu-item > a,
.doc-menu > li.current-menu-parent > a {
    color: var(--brand);
    background: var(--surface-2);
}

/* 二级菜单 */
.doc-menu .sub-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 170px;
    list-style: none;
    margin: 0;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-hover);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: all .2s ease;
    z-index: 50;
}

.doc-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.doc-menu .sub-menu li a {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--muted);
}

/* 二级菜单项左侧小图标 */
.doc-menu .sub-menu li a::before {
    content: '';
    flex-shrink: 0;
    width: 5px;
    height: 5px;
    margin-right: 9px;
    border-radius: 50%;
    background: var(--brand);
    opacity: .55;
    transition: opacity .2s ease, transform .2s ease;
}

.doc-menu .sub-menu li a:hover::before {
    opacity: 1;
    transform: scale(1.25);
}

.doc-menu .sub-menu li a:hover {
    color: var(--brand);
    background: var(--surface-2);
}

/* 右侧操作区 */
.doc-header__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.doc-theme-toggle {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: all .2s ease;
}

.doc-theme-toggle:hover {
    border-color: var(--brand);
    color: var(--brand);
    transform: translateY(-1px);
}

.doc-theme-toggle .icon-sun {
    display: none;
}

.doc-theme-toggle .icon-moon {
    display: block;
}

body.dark-theme .doc-theme-toggle .icon-sun {
    display: block;
}

body.dark-theme .doc-theme-toggle .icon-moon {
    display: none;
}

.doc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s ease;
    border: 1px solid transparent;
}

.doc-btn--ghost {
    color: var(--brand);
    background: transparent;
    border-color: var(--border);
}

.doc-btn--ghost:hover {
    border-color: var(--brand);
    background: var(--surface-2);
}

/* 注册按钮（主色实心） */
.doc-btn--primary {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
}

.doc-btn--primary:hover {
    background: var(--brand-2);
    border-color: var(--brand-2);
    transform: translateY(-1px);
}

/* 顶部用户区：未登录的两个按钮 */
.doc-auth {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* 已登录：头像 + 名称 + 悬停下拉 */
.doc-user {
    position: relative;
    flex-shrink: 0;
}

.doc-user__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px 8px 8px;
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
    max-width: 200px;
}

.doc-user__toggle:hover {
    color: var(--brand);
}

/* 头像容器：父主题 .avatar-img 是 38px 高的行内块，会把头像顶偏，这里归一为 30px */
.doc-user__toggle .avatar-img {
    display: block;
    width: 30px;
    height: 30px;
    line-height: 0;
    flex-shrink: 0;
}

.doc-user__toggle img {
    display: block;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.doc-user__name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-user__caret {
    color: var(--muted);
    flex-shrink: 0;
    transition: transform .2s ease;
}

.doc-user:hover .doc-user__caret {
    transform: rotate(180deg);
}

/* 下拉菜单 */
.doc-user__menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 188px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow-hover);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
    z-index: 50;
}

.doc-user:hover .doc-user__menu,
.doc-user:focus-within .doc-user__menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.doc-user__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}

.doc-user__item svg {
    color: var(--brand);
    flex-shrink: 0;
}

.doc-user__item:hover {
    background: var(--surface-2);
}

.doc-user__item--danger {
    color: #d2484a;
}

.doc-user__item--danger svg {
    color: #d2484a;
}

.doc-user__item--danger:hover {
    background: rgba(210, 72, 74, .08);
}

/* 移动端用户区（汉堡菜单内平铺） */
.doc-auth--mobile {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.doc-auth--mobile .doc-btn {
    flex: 1;
}

.doc-user-m {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.doc-user-m__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 4px 12px;
}

.doc-user-m__head img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.doc-user-m__head span {
    font-size: 15px;
    font-weight: 600;
}

.doc-user-m__link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    transition: background-color .15s ease;
}

.doc-user-m__link svg {
    color: var(--brand);
}

.doc-user-m__link:hover {
    background: var(--surface-2);
}

.doc-user-m__link--btn .newadd-btns,
.doc-user__item--btn .newadd-btns {
    color: var(--brand);
    font-weight: 500;
}

.doc-user-m__logout {
    color: #d2484a;
}

.doc-user-m__logout svg {
    color: #d2484a;
}

.doc-user-m__logout:hover {
    background: rgba(210, 72, 74, .08);
}

/* 搜索框（桌面端在右侧操作区） */
.doc-search {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--muted);
    transition: border-color .2s ease, box-shadow .2s ease;
}

.doc-search:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(47, 95, 143, .15);
}

.doc-search svg {
    flex-shrink: 0;
    color: var(--muted);
}

.doc-search input {
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 14px;
    width: 150px;
}

.doc-search input::placeholder {
    color: var(--muted);
}

/* 移动端搜索：默认隐藏桌面框，菜单展开时在面板内显示 */
.doc-search--mobile {
    display: none;
}

/* 移动端汉堡 */
.doc-burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 38px;
    height: 38px;
    padding: 0 9px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    cursor: pointer;
}

.doc-burger span {
    display: block;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all .25s ease;
}

.doc-burger.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.doc-burger.is-open span:nth-child(2) {
    opacity: 0;
}

.doc-burger.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   主视觉 Hero
   ============================================================ */
.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #16324f 0%, #1f4d77 48%, #2f6ea3 100%);
    color: #fff;
}

.hero__bg {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 18% 30%, rgba(255, 255, 255, .10) 0, transparent 42%),
        radial-gradient(circle at 82% 22%, rgba(255, 255, 255, .08) 0, transparent 40%),
        radial-gradient(circle at 50% 90%, rgba(255, 255, 255, .06) 0, transparent 45%);
}

.hero__bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
    background-size: 38px 38px;
    mask-image: radial-gradient(circle at 50% 40%, #000 0, transparent 75%);
    -webkit-mask-image: radial-gradient(circle at 50% 40%, #000 0, transparent 75%);
}

.hero__inner {
    position: relative;
    z-index: 1;
    max-width: 920px;
    margin: 0 auto;
    padding: 78px 24px 70px;
    text-align: center;
}

.hero__badge {
    display: inline-block;
    padding: 7px 18px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .5px;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .22);
    backdrop-filter: blur(6px);
    margin-bottom: 22px;
}

.hero__title {
    margin: 0 0 14px;
    font-size: 44px;
    line-height: 1.18;
    font-weight: 800;
    letter-spacing: -.5px;
    text-shadow: 0 2px 16px rgba(0, 0, 0, .18);
}

.hero__subtitle {
    margin: 0 0 34px;
    font-size: 18px;
    opacity: .88;
    font-weight: 400;
}

/* 搜索框 */
.hero__search {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 560px;
    margin: 0 auto 38px;
    padding: 7px 7px 7px 16px;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, .22);
}

.hero__search-icon {
    flex-shrink: 0;
    color: #9aa6b2;
}

.hero__search input[type="search"] {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 15px;
    color: #1f2733;
    padding: 8px 4px;
}

.hero__search input[type="search"]::-webkit-search-cancel-button {
    -webkit-appearance: none;
}

.hero__search button {
    flex-shrink: 0;
    border: 0;
    cursor: pointer;
    padding: 11px 26px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--accent) 0%, #d9772e 100%);
    transition: transform .2s ease, box-shadow .2s ease;
}

.hero__search button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(224, 138, 60, .4);
}

/* 统计 */
.hero__stats {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 14px;
    flex-wrap: wrap;
}

.hero__stat {
    min-width: 120px;
    padding: 14px 22px;
    border-radius: 14px;
    background: rgba(255, 255, 255, .10);
    border: 1px solid rgba(255, 255, 255, .16);
    backdrop-filter: blur(6px);
}

.hero__stat .num {
    display: block;
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
}

.hero__stat .lbl {
    font-size: 13px;
    opacity: .82;
}

/* ============================================================
   主体内容
   ============================================================ */
.doc-main {
    padding: 46px 0 60px;
}

/* 栏目页 / 内容页顶部留白
   子主题 header 是 sticky（在文档流内占位 65px），父主题为自身 fixed 导航预留的
   body padding-top(88px/72px) 已被本文件置 0，于是父主题的 main.container 紧贴头部下沿。
   这里补回内容区顶部的呼吸空间；首页不使用 main，不受影响。 */
main.container {
    padding-top: 24px;
}

/* 小工具板块带（每个板块小工具自带灰底带，叠起来与 doc-main 视觉一致） */
.home-band {
    padding: 14px 0;
}

.home-band:first-of-type {
    padding-top: 46px;
}

.home-band:last-of-type {
    padding-bottom: 60px;
}

/* 自定义内容板块 */
.rich-content {
    color: var(--text);
    line-height: 1.8;
}

.rich-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* 板块通用 */
.content-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 20px;
    margin-bottom: 28px;
    box-shadow: var(--shadow);
    transition: background-color .35s ease, border-color .35s ease;
}

.section-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 5px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
}

.section-title {
    margin: 0;
    font-size: 21px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: "";
    width: 5px;
    height: 20px;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--brand) 0%, var(--brand-2) 100%);
}

.section-desc {
    margin: 4px 0 0;
    font-size: 14px;
    color: var(--muted);
}

.section-link {
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--brand);
    padding: 6px 14px;
    border-radius: 8px;
    transition: background-color .2s ease;
}

.section-link:hover {
    background: var(--surface-2);
}

/* ========== 分类卡片 ========== */
/* flex + flex:1：无论几个分类（含多行时最后一行不满）都均分撑满整行宽度 */
.cat-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.cat-card {
    flex: 1 1 150px;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 1px solid var(--border);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.cat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--brand);
}

.cat-card__icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 19px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
}

.cat-card__body {
    min-width: 0;
}

.cat-card__name {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cat-card__count {
    font-size: 12px;
    color: var(--muted);
}

/* ========== 书籍卡片（带缩略图） ========== */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
    gap: 22px;
}

.book-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: transparent;
}

.book-cover {
    display: block;
    position: relative;
    height: 220px;
    overflow: hidden;
    background: linear-gradient(135deg, #5b6fb0 0%, #7b5bb0 100%);
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.book-card:hover .book-cover img {
    transform: scale(1.06);
}

.book-placeholder {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #5b6fb0 0%, #7b5bb0 100%);
}

.book-placeholder .ph-icon {
    font-size: 54px;
    filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .25));
}

.doc-empty {
    margin: 8px 0 4px;
    padding: 18px 16px;
    color: #8a8f99;
    background: rgba(125, 125, 125, .06);
    border: 1px dashed rgba(125, 125, 125, .25);
    border-radius: 10px;
    font-size: 14px;
    text-align: center;
}

.book-card:nth-child(4n+2) .book-cover,
.book-card:nth-child(4n+2) .book-placeholder {
    background: linear-gradient(135deg, #2f8f8f 0%, #2f6ea3 100%);
}

.book-card:nth-child(4n+3) .book-cover,
.book-card:nth-child(4n+3) .book-placeholder {
    background: linear-gradient(135deg, #c0713c 0%, #b34a4a 100%);
}

.book-card:nth-child(4n+4) .book-cover,
.book-card:nth-child(4n+4) .book-placeholder {
    background: linear-gradient(135deg, #3c7bc0 0%, #5b5bb0 100%);
}

.book-meta {
    padding: 14px;
}

.book-title {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 40px;
}

.book-title a:hover {
    color: var(--brand);
}

.book-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 12px;
    color: var(--muted);
}

.book-tag {
    padding: 3px 9px;
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--brand);
    font-weight: 600;
    white-space: nowrap;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ========== 文章列表（纯标题） ========== */
.article-list {
    display: flex;
    flex-direction: column;
}

.article-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 6px;
    border-radius: 10px;
    border-bottom: 1px solid var(--border);
    transition: background-color .2s ease;
}

.article-item:last-child {
    border-bottom: 0;
}

.article-item:hover {
    background: var(--surface-2);
}

.article-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 17px;
    background: var(--surface-2);
}

.article-body {
    flex: 1;
    min-width: 0;
}

.article-title {
    margin: 0 0 5px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-item:hover .article-title {
    color: var(--brand);
}

/* 第二行元信息：统一灰调，品牌蓝只留给标题 hover，避免满屏彩色 */
.article-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    color: var(--muted);
}

.article-meta .tag {
    padding: 1px 8px;
    border-radius: 6px;
    background: var(--surface-2);
    color: var(--muted);
    font-weight: 400;
}


/* ============================================================
   自定义页脚
   ============================================================ */
.doc-footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    margin-top: 30px;
    transition: background-color .35s ease, border-color .35s ease;
}

.doc-footer__inner {
    max-width: var(--mian-max-width, 1180px);
    margin: 0 auto;
    padding: 52px 24px 30px;
    display: grid;
    grid-template-columns: 1.4fr 2fr;
    gap: 40px;
}

.doc-footer__desc {
    margin: 16px 0 18px;
    color: var(--muted);
    font-size: 14px;
    max-width: 320px;
}

.doc-footer__social {
    display: flex;
    gap: 10px;
}

.doc-footer__social a {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 1px solid var(--border);
    color: var(--muted);
    transition: all .2s ease;
}

.doc-footer__social a:hover {
    color: var(--brand);
    border-color: var(--brand);
    transform: translateY(-2px);
}

.doc-footer__cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.doc-footer__col h4 {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.doc-footer__col ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.doc-footer__col ul a,
.doc-footer__col .cat-link {
    font-size: 14px;
    color: var(--muted);
}

.doc-footer__col ul a:hover {
    color: var(--brand);
}

.doc-footer__bottom {
    border-top: 1px solid var(--border);
}

.doc-footer__bottom-inner {
    max-width: var(--mian-max-width, 1180px);
    margin: 0 auto;
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--muted);
}

/* 页脚 logo：读取后台「日间/夜间模式图片」，统一高度 */
.doc-footer .doc-logo img {
    display: block;
    height: 34px;
    width: auto;
}

/* 页脚首行文字（后台 footer_t1_t） */
.doc-footer__title {
    margin: 14px 0 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

/* 简介/版权来自后台 textarea，wpautop 输出的段落去掉多余外边距 */
.doc-footer__desc p {
    margin: 0 0 8px;
}

.doc-footer__desc p:last-child {
    margin-bottom: 0;
}

.doc-footer__bottom-inner p {
    margin: 0;
}

/* 社交图标：微信 / 更多联系方式 hover 弹出二维码 */
.doc-footer__social a {
    position: relative;
}

.doc-footer__qr {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 12px);
    transform: translateX(-50%) translateY(4px);
    /* 显式宽度：避免绝对定位元素遇上 img{max-width:100%} 时宽高塌缩循环 */
    width: 134px;
    padding: 6px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(17, 24, 39, .14);
    line-height: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
    z-index: 30;
}

.doc-footer__social a:hover .doc-footer__qr {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.doc-footer__qr img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 900px) {
    .doc-footer__inner {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .doc-nav {
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow);
        padding: 10px 16px 16px;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        display: none;
    }

    .doc-nav.is-open {
        display: block;
    }

    .doc-menu {
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
    }

    .doc-menu > li > a {
        padding: 11px 12px;
    }

    .doc-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: 0;
        border-left: 2px solid var(--border);
        border-radius: 0;
        padding: 0 0 0 10px;
        margin: 0 0 6px 12px;
        background: transparent;
    }

    .doc-burger {
        display: flex;
    }

    .doc-search--desktop {
        display: none;
    }

    .doc-nav.is-open .doc-search--mobile {
        display: flex;
        width: 100%;
        margin: 10px 0 2px;
    }

    .doc-search--mobile input {
        flex: 1;
        width: 100%;
    }

    /* 移动端隐藏桌面操作区的用户区，改由汉堡菜单内的移动版承载 */
    .doc-header__actions .doc-auth,
    .doc-header__actions .doc-user {
        display: none;
    }

    .doc-nav.is-open .doc-auth--mobile,
    .doc-nav.is-open .doc-user-m {
        display: block;
    }

    .doc-btn--ghost {
        display: none;
    }

    .hero__inner {
        padding: 54px 20px 48px;
    }

    .hero__title {
        font-size: 30px;
    }

    .hero__subtitle {
        font-size: 15px;
    }

    .hero__search {
        flex-wrap: nowrap;
        padding: 6px 6px 6px 14px;
    }

    .hero__search button {
        padding: 10px 18px;
    }

    .content-section {
        padding: 20px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .book-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 14px;
    }

    .book-cover {
        height: 190px;
    }

    .cat-grid {
        gap: 12px;
    }

    .cat-card {
        flex-basis: 130px;
    }

    .doc-footer__cols {
        grid-template-columns: 1fr 1fr;
    }
}

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

    .hero__stats {
        gap: 10px;
    }

    .hero__stat {
        min-width: 100px;
        padding: 12px 14px;
    }

    .cat-card {
        padding: 12px;
        gap: 10px;
    }

    .cat-card__icon {
        width: 38px;
        height: 38px;
        font-size: 17px;
        border-radius: 10px;
    }

    .cat-card__name {
        font-size: 14px;
    }

    .cat-card__count {
        font-size: 11px;
    }
}

/* ============================================================
   头部用户区下拉（父主题原版盒子 .sub-user-box 适配）
   ============================================================ */
.doc-user__menu--zib {
    min-width: 268px;
    padding: 0;
}

.doc-user__menu--zib .padding-10 {
    padding: 10px !important;
}

/* 盒子内 zibll 组件颜色跟随子主题变量 */
.doc-user__menu--zib .sub-user-box {
    width: 246px;
    color: var(--text);
}

.doc-user__menu--zib .sub-user-box a {
    text-decoration: none;
}

.doc-user__menu--zib .sub-user-box .user-right b {
    color: var(--text);
}

/* ============================================================
   右侧悬浮栏（float-right）美化 + 二维码弹层修复
   ============================================================ */
/* 按钮：白底圆角卡片化，保留父主题 --this-color/--this-bg 个性化变量 */
.float-right .float-btn {
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(17, 24, 39, .08), 0 4px 14px rgba(17, 24, 39, .06);
    border: 1px solid var(--border, #e6eaf0);
    backdrop-filter: blur(6px);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.float-right .float-btn:hover {
    transform: translateX(-2px);
    box-shadow: 0 6px 18px rgba(17, 24, 39, .14);
    border-color: var(--brand, #2f5f8f);
}

.float-right.round .float-btn + .float-btn {
    margin-top: 8px;
}

/* 二维码弹层兜底：canvas 只保留一个时的正确尺寸，防止被多余 canvas 撑爆 */
.float-btn.qrcode-btn .qrcode canvas,
.float-btn.qrcode-btn .qrcode img {
    width: 100px !important;
    height: 100px !important;
    display: block;
}

.float-btn.qrcode-btn .qrcode {
    width: 110px;
    height: 110px;
    overflow: hidden;
    margin: 0 auto;
}

/* 弹出面板统一卡片化 */
.float-btn .hover-show-con {
    box-shadow: 0 10px 30px rgba(17, 24, 39, .16);
    border: 1px solid var(--border, #e6eaf0);
}

/* ============================================================
   多分类板块：每个分类一个独立板块卡片，一行 1-4 个，板块间有间隙
   ============================================================ */
.mc-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: start;
}

/* 强制等宽自适应：minmax(0,1fr) 防止长标题把板块撑爆溢出容器 */
.mc-grid--2,
.mc-grid--3,
.mc-grid--4 {
    grid-template-columns: repeat(1, minmax(0, 1fr));
}

.mc-grid > * {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.mc-grid .article-meta {
    flex-wrap: wrap;
}

/* 标题适配板块宽度：换行显示（最多 2 行），不再被裁切 */
.mc-panel .article-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
    overflow: hidden;
    line-height: 1.45;
}

.mc-grid .mc-panel {
    margin: 0;
    height: 100%;
    padding: 10px;
}

@media (min-width: 601px) {
    .mc-grid--2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

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

@media (min-width: 601px) and (max-width: 1100px) {
    .mc-grid--3,
    .mc-grid--4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

/* 板块内列表更紧凑（独立小板块用） */
.article-list--compact .article-item {
    padding: 9px 0;
}

/* ============================================================
   首页多位置布局：主内容 + 侧边栏（front-page.php 多位置小工具区）
   ============================================================ */
.home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

@media (min-width: 1200px) {
    .home-layout--with-side {
        grid-template-columns: minmax(0, 1fr) 320px;
    }
}

/* 主内容列：内嵌的 docbook 板块自带 home-band/doc-container，去双重宽度与内边距 */
.home-main {
    min-width: 0;
}

.home-main .home-band {
    padding: 0;
}

.home-main .doc-container {
    max-width: none;
    padding: 0;
}

.home-side {
    min-width: 0;
}

@media (max-width: 1199px) {
    .home-layout--with-side .home-side {
        order: 2;
    }
}

/* ============================================================
   内容板块并排：板块设为 1/2、1/3、1/4 行宽时相邻自动排成一行
   ============================================================ */
.home-widgets {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 0 20px;
}

.home-widgets .home-band {
    flex: 1 1 100%;
    min-width: 0;
}

/* 半行：两个相邻板块并排；单个时自动撑满整行 */
.home-widgets .home-band--cols-2 {
    flex: 1 1 calc(50% - 10px);
    max-width: calc(50% - 10px);
}

.home-widgets .home-band--cols-3 {
    flex: 1 1 calc(33.333% - 14px);
    max-width: calc(33.333% - 14px);
}

.home-widgets .home-band--cols-4 {
    flex: 1 1 calc(25% - 15px);
    max-width: calc(25% - 15px);
}

/* 整行板块独占一行，隔断并排流 */
.home-widgets .home-band:not([class*='home-band--cols-']) {
    flex-basis: 100%;
}

@media (max-width: 992px) {
    .home-widgets .home-band--cols-3,
    .home-widgets .home-band--cols-4 {
        flex-basis: calc(50% - 10px);
        max-width: calc(50% - 10px);
    }
}

@media (max-width: 600px) {
    .home-widgets .home-band--cols-2,
    .home-widgets .home-band--cols-3,
    .home-widgets .home-band--cols-4 {
        flex-basis: 100%;
        max-width: 100%;
    }
}

/* 并排板块内标题同样两行换行适配 */
.home-widgets .article-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    white-space: normal;
    overflow: hidden;
    line-height: 1.45;
}

/* ============================================================
   内容板块：一行显示多条内容（per_row 1-4，列表/卡片均支持）
   ============================================================ */
.article-list.article-per-2,
.book-grid.article-per-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 22px;
}

.article-list.article-per-3,
.book-grid.article-per-3 {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px 20px;
}

.article-list.article-per-4,
.book-grid.article-per-4 {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 4px 16px;
}

/* 多列时列表条目铺满各自单元格，去掉底部通栏分隔线观感 */
.article-list.article-per-2 .article-item,
.article-list.article-per-3 .article-item,
.article-list.article-per-4 .article-item {
    border-bottom: none;
    border-radius: 8px;
    padding: 8px 10px;
}

.article-list.article-per-2 .article-item:hover,
.article-list.article-per-3 .article-item:hover,
.article-list.article-per-4 .article-item:hover {
    background: var(--surface-2);
}

/* 窄屏降级：≤992px 时 3/4 条降为 2 条；≤600px 恢复 1 条/行 */
@media (max-width: 992px) {
    .article-list.article-per-3,
    .article-list.article-per-4,
    .book-grid.article-per-3,
    .book-grid.article-per-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .article-list.article-per-2,
    .article-list.article-per-3,
    .article-list.article-per-4,
    .book-grid.article-per-2,
    .book-grid.article-per-3,
    .book-grid.article-per-4 {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   右侧悬浮栏（float-right）美化 v2
   ============================================================ */
.float-right .float-btn {
    border-radius: 14px;
    background: var(--surface, #fff);
    box-shadow: 0 2px 6px rgba(17, 24, 39, .06), 0 10px 26px rgba(17, 24, 39, .09);
    border: 1px solid var(--border, #e6eaf0);
    backdrop-filter: blur(6px);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease, background-color .22s ease;
}

.float-right .float-btn:hover {
    transform: translateX(-4px);
    border-color: var(--brand, #2f5f8f);
    box-shadow: 0 4px 10px rgba(47, 95, 143, .12), 0 16px 34px rgba(47, 95, 143, .17);
}

.float-right.round .float-btn + .float-btn {
    margin-top: 10px;
}

/* 悬浮按钮内图标保持父主题 --this-color 个性化配色，并稍放大 */
.float-right .float-btn svg,
.float-right .float-btn i {
    transition: transform .22s ease;
}

.float-right .float-btn:hover svg,
.float-right .float-btn:hover i {
    transform: scale(1.12);
}

/* 弹出面板统一圆角卡片化 */
.float-btn .hover-show-con {
    border-radius: 14px;
    box-shadow: 0 12px 36px rgba(17, 24, 39, .18);
    border: 1px solid var(--border, #e6eaf0);
    overflow: hidden;
}

/* ============================================================
   资料分类板块：下方子分类行（悬停一级卡片切换）
   ============================================================ */
.cat-sub {
    display: flex;
    justify-content: flex-start;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed var(--border);
}

.cat-sub__panel {
    display: none;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
}

.cat-sub__panel.is-active {
    display: flex;
}

.cat-sub__panel a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--muted);
    font-size: 13.5px;
    white-space: nowrap;
    transition: color .2s ease, background-color .2s ease;
}

.cat-sub__panel a:hover {
    color: #fff;
    background: var(--brand);
}

.cat-sub__count {
    font-size: 12px;
    opacity: .65;
}

/* 有子分类的一级卡片：右上角小箭头提示 */
.cat-card--parent {
    position: relative;
}

.cat-card--parent::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 6px;
    height: 6px;
    border-right: 1.8px solid currentColor;
    border-bottom: 1.8px solid currentColor;
    transform: rotate(45deg);
    opacity: .5;
}

/* ============================================================
   内容板块：一行显示 5/6 条（4 条已有，此处补 5/6 与降级）
   ============================================================ */
.article-list.article-per-5,
.book-grid.article-per-5 {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px 14px;
}

.article-list.article-per-6,
.book-grid.article-per-6 {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px 12px;
}

.article-list.article-per-5 .article-item,
.article-list.article-per-6 .article-item {
    border-bottom: none;
    border-radius: 8px;
    padding: 8px 8px;
}

.article-list.article-per-5 .article-item:hover,
.article-list.article-per-6 .article-item:hover {
    background: var(--surface-2);
}

@media (max-width: 992px) {
    .article-list.article-per-5,
    .article-list.article-per-6,
    .book-grid.article-per-5,
    .book-grid.article-per-6 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .article-list.article-per-5,
    .article-list.article-per-6,
    .book-grid.article-per-6 {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   资料分类板块美化 v3：卡片铺满整行 + 图标收敛 + 子分类行左对齐
   ============================================================ */
.cat-grid {
    gap: 12px;
}

.cat-card {
    padding: 12px 14px;
    background: var(--surface);
    border-radius: 12px;
}

.cat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(47, 95, 143, .12);
    border-color: var(--brand);
}

/* 当前展示组的卡片高亮（与下方子分类联动） */
.cat-card.is-current {
    border-color: var(--brand);
    background: linear-gradient(180deg, rgba(47, 95, 143, .06), rgba(47, 95, 143, 0)), var(--surface);
    box-shadow: 0 6px 18px rgba(47, 95, 143, .12);
}

/* 图标按位置四色渐变轮换 */
.cat-card:nth-child(4n + 1) .cat-card__icon {
    background: linear-gradient(135deg, #5b8def, #3a6fd8);
}

.cat-card:nth-child(4n + 2) .cat-card__icon {
    background: linear-gradient(135deg, #34c3a6, #1fa387);
}

.cat-card:nth-child(4n + 3) .cat-card__icon {
    background: linear-gradient(135deg, #f5a623, #e8890c);
}

.cat-card:nth-child(4n + 4) .cat-card__icon {
    background: linear-gradient(135deg, #a06bf5, #7e3ff2);
}

.cat-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 17px;
    box-shadow: 0 3px 8px rgba(17, 24, 39, .14);
}

.cat-card__name {
    font-size: 14.5px;
}

.cat-card--parent::after {
    top: 11px;
    right: 11px;
}

.cat-card.is-current--parent::after,
.cat-card.is-current::after {
    opacity: .9;
}

/* 子分类行：软色带容器，左对齐跟随卡片行 */
.cat-sub {
    margin-top: 12px;
    padding: 11px 14px;
    background: var(--surface-2);
    border: none;
    border-radius: 12px;
}

.cat-sub__panel {
    gap: 8px;
}

.cat-sub__panel a {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 6px 14px;
    font-size: 13px;
    color: var(--muted);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
}

.cat-sub__panel a:hover {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
    box-shadow: 0 4px 12px rgba(47, 95, 143, .3);
}

.cat-sub__count {
    font-size: 11.5px;
    opacity: .55;
}

/* ============================================================
   手机端使用父主题默认头部：PC 显示子主题 doc-header，
   ≤768px 切换为父主题 zib_header 输出；并收紧手机两侧留白
   ============================================================ */
.doc-mobile-zibheader {
    display: none;
}

@media (max-width: 768px) {
    /* 手机端顶部 = 父主题 zib_header（fixed 定位，实测高 52px），给页面内容预留偏移；
       !important 压过本文件 body.nav-fixed{padding-top:0} 与父主题的 72px 规则。
       用 body.nav-fixed 而非 body.docbook-body：真机走父主题 header.php 时
       body 上没有 .docbook-body class，用 nav-fixed 才能同样命中 */
    body.nav-fixed,
    body.nav-fixed.nav-fixed {
        padding-top: 52px !important;
    }

    .doc-header {
        display: none;
    }

    .doc-mobile-zibheader {
        display: block;
    }

    /* 手机版两侧空白收紧：24px -> 12px */
    .doc-container {
        padding: 0 12px;
    }

    .home-band {
        padding: 10px 0;
    }

    .home-band:first-of-type {
        padding-top: 12px;
    }

    .home-band:last-of-type {
        padding-bottom: 24px;
    }
}

/* ============================================================
   posts-mini 列表条目：默认无描边，鼠标移上去才显示品牌色边缘
   ============================================================ */
.posts-mini {
    border: 1px solid transparent;
    border-radius: 10px;
    transition: border-color .2s ease, background-color .2s ease;
}

.posts-mini:hover {
    border-color: var(--brand, #5b8def);
    background: rgba(91, 141, 239, .05);
}

/* ============================================================
   三栏纯标题列表（多分类板块）：标题前加圆点
   ============================================================ */
.mc-panel .article-list--compact .article-title::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--brand, #5b8def);
    margin-right: 8px;
    vertical-align: middle;
}

/* ============================================================
   资料筛选条（分类 / 类型 / 排序）+ 筛选结果列表
   布局：左侧固定标签 + 右侧胶囊按钮横向排列，
   选中项实心主色。点击任一胶囊即时（AJAX）刷新下方列表，不跳页。
   ============================================================ */
.doc-filter {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
}

.doc-filter__row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.doc-filter__row:last-child {
    margin-bottom: 0;
}

.doc-filter__label {
    flex-shrink: 0;
    min-width: 40px;
    padding-top: 5px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
}

.doc-filter__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.doc-filter__tag {
    padding: 4px 15px;
    font-size: 13px;
    line-height: 1.7;
    font-family: inherit;
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    transition: color .18s ease, background-color .18s ease, border-color .18s ease;
}

.doc-filter__tag:hover {
    color: var(--brand);
    border-color: var(--brand);
}

.doc-filter__tag.is-active {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand);
}

.doc-filter__result {
    margin-top: 14px;
    transition: opacity .18s ease;
}

.doc-filter__result.is-loading {
    opacity: .45;
    pointer-events: none;
}

/* 结果列表：左红点 + 标题 + 灰色元信息，参照参考站纯文字列表 */
.doc-fl-list {
    display: flex;
    flex-direction: column;
}

.doc-fl-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 4px;
    border-bottom: 1px solid var(--border);
}

.doc-fl-item:last-child {
    border-bottom: none;
}

.doc-fl-item:hover {
    background: var(--surface-2);
}

.doc-fl-item__main {
    flex: 1;
    min-width: 0;
}

.doc-fl-item__title {
    display: block;
    font-size: 14px;
    color: var(--text);
    line-height: 1.55;
}

.doc-fl-item:hover .doc-fl-item__title {
    color: var(--brand);
}

.doc-fl-item__title::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
    margin-right: 8px;
    vertical-align: middle;
}

.doc-fl-item__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 2px;
    padding-left: 13px;
    font-size: 12px;
    color: var(--muted);
}

.doc-fl-item__cat {
    color: var(--brand);
}

@media (max-width: 600px) {
    .doc-filter {
        padding: 12px;
    }

    .doc-filter__label {
        min-width: 32px;
        font-size: 13px;
    }
}

/* ============================================================
   多分类三栏列表：文字口径统一
   参照参考站纯文字列表——单层字号、统一灰调元信息、红色圆点、无分隔线堆叠
   ============================================================ */
.mc-panel .section-title {
    font-size: 16px;
    font-weight: 600;
}

.mc-panel .section-link {
    font-size: 12.5px;
}

.mc-panel .article-list--compact .article-item {
    padding: 8px 0;
    border-bottom: none;
}

.mc-panel .article-list--compact .article-item:hover {
    background: transparent;
}

.mc-panel .article-list--compact .article-title,
.mc-panel .article-list--compact .article-title:hover {
    font-size: 13.5px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text);
}

.mc-panel .article-list--compact .article-title:hover {
    color: var(--brand);
}

.mc-panel .article-list--compact .article-title::before {
    width: 5px;
    height: 5px;
    background: var(--accent);
    margin-right: 8px;
    vertical-align: middle;
}

.mc-panel .article-list--compact .article-meta {
    padding-left: 13px;
    font-size: 12px;
    color: var(--muted);
}

/* ============================================================
   移动端顶栏交互修复
   1) .mobile-navbar 关闭时的遮罩点击区（父主题只加不删）
   2) 搜索层关闭按钮（父主题移动端未输出）
   3) 筛选条在窄屏的密度收紧
   ============================================================ */

/* 搜索层关闭按钮 */
.docbook-search-close {
    position: absolute;
    top: 50%;
    right: 12px;
    width: 34px;
    height: 34px;
    margin-top: -17px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, .06);
    cursor: pointer;
    z-index: 3;
}

.docbook-search-close::before,
.docbook-search-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 15px;
    height: 1.6px;
    background: var(--text);
    border-radius: 2px;
}

.docbook-search-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.docbook-search-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.docbook-search-close:hover {
    background: rgba(0, 0, 0, .12);
}

/* 搜索层已打开时，给输入框让出右侧位置 */
.main-search.show .docbook-search-close {
    display: block;
}

.main-search:not(.show) .docbook-search-close {
    display: none;
}

/* 移动端导航打开时禁止页面滚动（避免背景跟着滚） */
body.mobile-navbar-show {
    overflow: hidden;
}

/* 手机端：去掉左侧「分类 / 类型 / 排序」名称列，胶囊按钮整行铺满 */
@media (max-width: 767px) {
    .doc-filter__row {
        gap: 0;
    }

    .doc-filter__label {
        display: none;
    }
}

/* 窄屏：筛选条密度收紧，避免一屏塞不下 */
@media (max-width: 480px) {
    .doc-filter {
        padding: 12px 12px;
    }

    .doc-filter__row {
        gap: 0;
        margin-bottom: 8px;
    }

    .doc-filter__tags {
        gap: 6px;
    }

    .doc-filter__tag {
        padding: 4px 12px;
        font-size: 12.5px;
    }

    /* 结果条目更紧凑 */
    .doc-fl-item {
        padding: 8px 2px;
    }

    .doc-fl-item__title {
        font-size: 13.5px;
    }
}
