/* ============================================================
   MikuX 主题样式
   配色方案：Indigo (#6366F1)
   ============================================================ */
/* ===== <pre> 标签滚动条美化 ===== */

/* WebKit 内核浏览器（Chrome, Safari, Edge） */
pre::-webkit-scrollbar {
    width: 6px;                /* 垂直滚动条宽度 */
    height: 6px;               /* 水平滚动条高度 */
}

pre::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.04);
    border-radius: 3px;
}

pre::-webkit-scrollbar-thumb {
    background: #b8a9f0;       /* 淡紫色，与代码块滚动条一致 */
    border-radius: 3px;
    transition: background 0.2s;
}

pre::-webkit-scrollbar-thumb:hover {
    background: #9f8ee0;       /* 悬停加深 */
}

/* 深色模式适配 */
.dark-mode pre::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
}

.dark-mode pre::-webkit-scrollbar-thumb {
    background: #8b7fc0;
}

.dark-mode pre::-webkit-scrollbar-thumb:hover {
    background: #a090d0;
}

/* Firefox 浏览器 */
pre {
    scrollbar-width: thin;
    scrollbar-color: #b8a9f0 rgba(0, 0, 0, 0.04);
}

.dark-mode pre {
    scrollbar-color: #8b7fc0 rgba(255, 255, 255, 0.06);
}
/* ===== 行内代码样式（非代码块） ===== */
.api-doc code:not(pre code),
.post-content code:not(pre code) {
    font-size: 0.9em;
    padding: 0.15em 0.5em;
    border-radius: 4px;
    background: #EEF2FF;          /* 浅紫背景 */
    color: #4F46E5;               /* 深紫文字 */
    border: 1px solid #C7D2FE;    /* 淡紫边框 */
    word-break: break-word;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

/* 深色模式适配 */
.dark-mode .api-doc code:not(pre code),
.dark-mode .post-content code:not(pre code) {
    background: #2D2A4A;          /* 深紫背景 */
    color: #A5B4FC;               /* 亮紫文字 */
    border: 1px solid #4F46E5;    /* 紫边框 */
}

/* ===== 引用块样式 ===== */
.api-doc blockquote,
.post-content blockquote {
    margin: 1.2em 0;
    padding: 16px 20px;
    background: var(--primary-50);
    border-left: 4px solid var(--primary);
    border-radius: 0 8px 8px 0;
    color: var(--text);
    font-style: italic;
    line-height: 1.7;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: background 0.3s, border-color 0.3s;
}

/* 引用块内的段落 */
.api-doc blockquote p,
.post-content blockquote p {
    margin: 0;
}

/* 引用块内的引用（嵌套） */
.api-doc blockquote blockquote,
.post-content blockquote blockquote {
    margin: 0.5em 0 0;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.3);
    border-left-color: var(--primary-400);
}

/* 深色模式适配 */
.dark-mode .api-doc blockquote,
.dark-mode .post-content blockquote {
    background: var(--primary-50);
    border-left-color: var(--primary-400);
}

.dark-mode .api-doc blockquote blockquote,
.dark-mode .post-content blockquote blockquote {
    background: rgba(255, 255, 255, 0.06);
    border-left-color: var(--primary-600);
}
/* 作者卡片样式 */
.author-card {
    padding: 20px !important;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}
.author-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}
.author-header {
    display: flex;
    align-items: center;
    gap: 16px;
}
.author-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--bg);
    object-fit: cover;
}
.author-info h3 {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--text);
}
.author-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}
.author-action {
    margin-top: 12px;
    text-align: right;
    border-top: 1px solid var(--border);
    padding-top: 10px;
}
.view-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    color: var(--primary);
    text-decoration: none;
}
.view-link:hover {
    color: var(--primary-600);
}
.view-link svg {
    display: inline-block;
}
.sort-link {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 12px;
    transition: background 0.2s, color 0.2s;
}
.sort-link:hover {
    background: var(--primary-50);
    color: var(--primary);
}
.sort-link.active {
    background: var(--primary);
    color: #fff;
}


/* 夜间模式下 Logo 图标变为白色 */
.dark-mode .github-link svg,
.dark-mode .login-link svg
{
    fill: #ffffff;
    stroke: #ffffff;
}
.dark-mode .mx-logo img {
    filter: brightness(0) invert(1);
}
.dark-mode .download-card:not(._link):not(._github) svg {
    color: #ffffff;
    fill: #ffffff;
    stroke: #ffffff;
}

/* 深色模式：下载按钮悬浮时图标变白 */
.download-card__btn:hover svg {
    fill: #ffffff !important;
    stroke: #ffffff !important;
}

/* 明亮模式：_link 主图标颜色为紫色 */
.download-card__icon._link svg {
    fill: #6366F1;
    stroke: #6366F1;
}

/* 外部打开按钮默认紫色，悬浮变白 */
.download-card__btn svg {
    fill: #6366F1;
    stroke: #6366F1;
    transition: fill 0.2s, stroke 0.2s;
}

.download-card__icon._github + .download-card__info + .download-card__btn:hover {
    color: #ffffff;
}
/* 深色模式：外部打开按钮默认白色，悬浮不变 */
.dark-mode .download-card__btn svg {
    fill: #ffffff;
    stroke: #ffffff;
}
.dark-mode .download-card__btn:hover svg {
    fill: #ffffff;
    stroke: #ffffff;
}

.dark-mode .download_view svg path {
    fill: #ffffff !important;
}

.download_view:hover svg path {
    fill: #ffffff !important;
}

.dark-mode  .toolbar-btn svg path {
    fill: #ffffff !important;
}

.toolbar-btn:hover svg path {
    fill: #ffffff !important;
}

.dark-mode .mx-card .category-toggle svg path,
.dark-mode .mx-card .tag-title svg path,
.dark-mode .mx-card .toc-toggle svg path{
    fill: #fff !important;
}
/* 夜间模式：浮动工具栏按钮背景色改为 #4F46E5 */
.dark-mode .toolbar-btn:hover {
    background: #4F46E5 !important;
    border-color: #4F46E5 !important;
}
/* ===== 评论区样式 ===== */
.comment-block {
    margin-top: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--card);
    overflow: hidden; /* 保证圆角生效 */
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
    background: transparent;
    border: none;
    border-radius: 0;
    margin: 0;
}
.comment-header:hover {
    background: var(--primary-50);
}

.comment-body {
    padding: 0 16px 16px;
    background: transparent;
    border: none;
    border-radius: 0;
    margin-top: 10px;
}

/* 其余样式保持不变（如 .comment-trigger、#comment-toggle-icon、.comment-list 等） */
.comment-trigger {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.comment-trigger i {
    color: var(--primary);
}

#comment-toggle-icon {
    font-size: 18px;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}
#comment-toggle-icon.rotated {
    transform: rotate(180deg);
}

.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}
.comment-list .comment-list {
    padding-left: 40px;
}
.comment-item {
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}
.comment-item:last-child {
    border-bottom: none;
}
.comment-author {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}
.comment-author img.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg);
}
.comment-author .fn a {
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    font-style: normal;
}
.comment-author .fn a:hover {
    color: #818CF8;
}
.comment-author .comment-location {
    font-weight: normal;
    font-size: 12px;
    color: var(--text-muted);
}
.comment-author .comment-ua {
    font-weight: normal;
    font-size: 12px;
    color: var(--text-muted);
    margin-left: auto;
}
.comment-time {
    font-weight: normal;
    font-size: 12px;
    color: var(--text-muted);
}
.comment-content {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text);
    padding-left: 52px;
}
.comment-actions {
    padding-left: 52px;
    margin-top: 6px;
}
.comment-reply-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    transition: color 0.2s;
}
.comment-reply-btn:hover {
    color: var(--primary-600);
    text-decoration: underline;
}

.comment-children {
    list-style: none;
    padding-left: 40px;
    margin: 10px 0 0 0;
}

.comment-reply-form-wrapper {
    margin: 12px 0 0 52px;
    padding: 12px;
    background: var(--bg);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.comment-form-wrapper form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.comment-form-wrapper input,
.comment-form-wrapper textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    transition: border-color 0.2s;
}
.comment-form-wrapper input:focus,
.comment-form-wrapper textarea:focus {
    border-color: var(--primary);
    outline: none;
}
.comment-form-wrapper textarea {
    min-height: 80px;
    resize: vertical;
}
.comment-form-wrapper button {
    padding: 8px 24px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-block;
}
.comment-form-wrapper button:hover {
    background: var(--primary-600);
}
.comment-form-wrapper p:last-child {
    text-align: right;
    margin-bottom: 0;
}

.comment-empty {
    color: var(--text-muted);
    text-align: center;
    padding: 16px 0;
}

/* 深色模式适配 */
.dark-mode .comment-header:hover {
    background: var(--primary-50);
}
.dark-mode .comment-item {
    border-bottom-color: var(--border);
}
.dark-mode .comment-form-wrapper input,
.dark-mode .comment-form-wrapper textarea {
    background: var(--bg);
    color: var(--text);
    border-color: var(--border);
}
.dark-mode .comment-reply-form-wrapper {
    background: var(--bg);
    border-color: var(--border);
}
/* 导航栏垂直对齐修复 */
.mx-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}
.mx-nav > * {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}
.mx-nav .theme-dropdown {
    display: inline-flex;
    align-items: center;
}
.github-link {
    font-size: 16px;
    line-height: 1;
}
/* ===== 分页按钮（极简风格） ===== */
.mx-pagination a,
.mx-pagination span {
    font-weight: bold;
    text-decoration: none !important;
}
.mx-pagination .active a{
    color: white;
}
/* ===== 相关推荐（大卡片样式） ===== */
.related-posts h2 {
    font-size: 18px;
    font-weight: 600;
    color: #4F46E5;
    padding-bottom: 6px;
    line-height: 1.4;
    position: relative;
}
/* 卡片容器 - 与 .theme-card 完全一致 */
.related-card {
    padding: 0 !important;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--card);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: var(--shadow);
}
.related-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}

/* 图片容器 - 与 .theme-card-image 一致 */
.related-image {
    position: relative;
    width: 100%;
    padding-top: 66%; /* 3:2 比例 */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--bg);
    transition: background-size 0.4s ease;
    overflow: hidden;
}
.related-card:hover .related-image {
    background-size: 125% !important;
}

/* 阅读量 - 右上角 */
.related-views {
    position: absolute;
    top: 8px;
    right: 10px;
    background: rgba(0, 0, 0, 0.20);
    color: #ffffff;
    padding: 2px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 500;
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    z-index: 2;
    pointer-events: none;
    transition: background 0.3s ease;
}
.related-views i {
    font-size: 10px;
}
.dark-mode .related-views {
    background: rgba(0, 0, 0, 0.25);
    color: #f0f0f0;
    border-color: rgba(255, 255, 255, 0.06);
}

/* 分类胶囊 - 右下角 */
.related-category {
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 2;
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 2px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    pointer-events: auto;
    transition: background 0.2s, transform 0.2s;
}
.related-category a {
    color: #fff;
    text-decoration: none;
    display: block;
}
.related-category:hover {
    background: var(--primary-600);
    transform: scale(1.05);
}
.dark-mode .related-category {
    background: rgba(99, 102, 241, 0.7);
    border-color: rgba(255, 255, 255, 0.05);
}
.dark-mode .related-category:hover {
    background: rgba(99, 102, 241, 0.9);
}

/* 描述胶囊 - 左上角滑入 */
.related-info {
    position: absolute;
    top: 10px;
    left: 0;
    transform: translateX(-100%);
    max-width: 180px;
    padding: 4px 12px;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    border-radius: 0 20px 20px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    backdrop-filter: blur(4px);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-left: none;
}
.related-card:hover .related-info {
    transform: translateX(0);
}

/* 标题 - 底部居中 */
.related-title {
    padding: 12px 14px 14px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    word-break: break-word;
}

/* 响应式适配 */
@media (max-width: 480px) {
    .related-image {
        padding-top: 60%;
    }
    .related-title {
        font-size: 13px;
        padding: 8px 10px 10px;
    }
    .related-views {
        font-size: 10px;
        padding: 2px 8px;
        top: 6px;
        right: 8px;
    }
    .related-views i {
        font-size: 9px;
    }
}

/* 相关推荐网格布局 */
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}
@media (max-width: 768px) {
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}
@media (max-width: 480px) {
    .related-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }
}

.related-posts {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.related-posts h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 16px;
}

.api-doc ul{margin-left:18px}
/* 移动端默认折叠 */
@media (max-width: 768px) {
    .toc-list-wrapper {
        display: none;
    }
    .toc-list-wrapper.open {
        display: block;
    }
    .toc-toggle {
        margin-bottom: 0 !important;
        padding: 4px 0;
        font-size: 14px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 6px;
        cursor: pointer;
        user-select: none;
    }
    .toc-toggle .toggle-icon {
        font-size: 12px;
        transition: transform 0.3s ease;
        margin-left: auto; /* 将箭头推到右侧 */
    }
    .toc-toggle.open .toggle-icon {
        transform: rotate(180deg);
    }
}

/* 桌面端始终展开 */
@media (min-width: 769px) {
    .toc-list-wrapper {
        display: block !important;
    }
    .toc-toggle .toggle-icon {
        display: none;
    }
}
/* 浅色模式：侧边栏分类图标变为主题色 */
:root .mx-sidebar a img,
:root .mx-toolbar h2 img,
:not(.dark-mode) .mx-sidebar a img {
    filter: invert(32%) sepia(93%) saturate(1351%) hue-rotate(227deg) brightness(94%) contrast(101%);
}
/* 防止分类和标签 flex 拉伸 */
.mx-sidebar .mx-card {
    align-self: flex-start;  /* 防止 flex 拉伸 */
    width: 100%;             /* 保持宽度填满父容器 */
}
/* 描述胶囊 - 默认隐藏（左上角外部） */
.theme-card-desc {
    position: absolute;
    top: 10px;
    left: 0;                         /* 对齐左边缘 */
    transform: translateX(-100%);    /* 完全移出左侧 */
    max-width: 180px;
    padding: 4px 12px;
    background: var(--primary); 
    color: #fff;
    font-size: 12px;
    border-radius: 0 20px 20px 0;    /* 右侧圆角，左侧直角，增加滑入感 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    backdrop-filter: blur(4px);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3;
    pointer-events: none;            /* 防止干扰点击 */
    border: 1px solid rgba(255,255,255,0.08);
    border-left: none;               /* 消除左侧边框，增强滑入效果 */
}

/* 鼠标悬浮在卡片上时，描述滑入 */
.theme-card:hover .theme-card-desc {
    transform: translateX(0);
}

.api-doc ol {
    padding-left: 2em;  /* 左内边距，控制缩进量 */
    margin: 0.5em 0 1em;
}
.api-doc ol li {
    margin-bottom: 4px;  /* 可选：增加列表项间距 */
}
/* 大卡片标题区域（标题居中，胶囊右对齐） */
.theme-card-title {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px 10px;
    position: relative;
    min-height: 40px; /* 固定最小高度，但高度可能随标题变化，不建议固定 */
}

.title-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
    text-align: center;
}
/* 分类胶囊 - 固定在图片右下角 */
.theme-card-category {
    position: absolute;
    bottom: 12px;        /* 距离底部距离 */
    right: 12px;         /* 距离右侧距离 */
    z-index: 2;
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 2px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.1);
    white-space: nowrap;
    pointer-events: auto;
    transition: background 0.2s;
}

.theme-card-category a {
    color: #fff;
    text-decoration: none;
    display: block;
}

.theme-card-category:hover {
    background: var(--primary-600);
    transform: scale(1.05);
}

/* 深色模式适配 */
.dark-mode .theme-card-category {
    background: rgba(99, 102, 241, 0.7);
    border-color: rgba(255,255,255,0.05);
}
.dark-mode .theme-card-category:hover {
    background: rgba(99, 102, 241, 0.9);
}

.theme-card-category a {
    color: #fff;
    text-decoration: none;
    display: block;
}

.theme-card-category:hover {
    background: var(--primary-600);
    transform: scale(1.04);
}

/* 深色模式：将分类 SVG 图标变为浅灰色（包括侧边栏和二级标题） */
.dark-mode .mx-sidebar a img,
.dark-mode .mx-toolbar h2 img {
    filter: brightness(0) saturate(100%) invert(1) brightness(0.9);
}
/* ===== 下载卡片样式 ===== */
.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.download-card {
    display: flex;
    align-items: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    transition: box-shadow 0.25s, transform 0.25s;
    box-shadow: var(--shadow);
}

.download-card:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.12);
    transform: translateY(-2px);
}

/* 图标 */
.download-card__icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
    margin-right: 14px;
}

.download-card__icon._image {
    background: linear-gradient(135deg, #6366F1, #4F46E5);
}

.download-card__icon._link {
    background: linear-gradient(135deg, #6366F1, #4F46E5);
}
.download-card__icon._github {
    background: black;
}
/* 文字信息 */
.download-card__info {
    flex: 1;
    min-width: 0;
}

.download-card__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.download-card__desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* 下载按钮 */
.download-card__btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--primary-50);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, transform 0.2s;
    text-decoration: none;
    font-size: 15px;
}

.download-card__btn:hover {
    background: var(--primary);
    color: #fff;
    transform: scale(1.05);
}
.download-card__btn i {
    transition: color 0.2s;
}
.download-card__btn:hover i {
    color: #ffffff !important;
}
/* 深色模式适配 */
.dark-mode .download-card {
    background: var(--card);
}

.dark-mode .download-card__btn {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

.dark-mode .download-card__btn:hover {
    background: var(--primary);
    color: #fff;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .download-grid {
        grid-template-columns: 1fr;
    }
}

/* 深色模式下载卡片增强 */
.dark-mode .download-card {
    background: #2a2740;           /* 比背景略亮，形成区分 */
    border-color: #4a4580;          /* 较亮的边框 */
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.dark-mode .download-card:hover {
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.2);
    border-color: #6366f1;
}

/* 标题文字颜色调亮 */
.dark-mode .download-card__title {
    color: #e5e7eb;
}

/* 描述文字（如果有） */
.dark-mode .download-card__desc {
    color: #9ca3af;
}

/* 图标容器背景不变，但可微调 */
.dark-mode .download-card__icon._link {
    background: linear-gradient(135deg, #4F46E5, #6366F1);
}

.mx-stats .number {
    font-size: 15px;
    white-space: nowrap;
}   
/* ===== 文章卡片（标题左，阅读量右） ===== */
.article-card {
    padding: 0 !important;
    background: var(--card);
    border-radius: var(--radius);
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    height: auto;
}
.article-card:hover {
    background: var(--primary-50);
    box-shadow: 0 4px 12px rgba(99,102,241,0.10);
}
.article-card-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    font-size: 14px;
}
.article-title {
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}
.article-views {
    color: var(--text-muted);
    font-size: 13px;
    white-space: nowrap;
    margin-left: 12px;
    flex-shrink: 0;
}
.article-views i {
    margin-right: 4px;
}

/* 文章卡片网格：与普通卡片列数一致 */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(332px, 1fr)) !important; /* 与普通卡片一致，但普通卡片可能用 minmax(260px,1fr) ？ */
    gap: 16px;
}

/* 确保文章卡片高度自适应，内容不溢出 */
.article-card {
    height: auto;
    min-height: 44px; /* 保证最小高度，避免太矮 */
}

/* ===== 主题卡片（图片在上方） ===== */
.theme-card {
    padding: 0 !important;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--card);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: var(--shadow);
}

.theme-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.15);
}

/* 图片容器（背景图） */
.theme-card-image {
    position: relative;
    width: 100%;
    padding-top: 66%; /* 3:2 比例 */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--bg);
    transition: background-size 0.4s ease;
    overflow: hidden;
}

/* 悬浮时放大图片（确保放大而非缩小） */
.theme-card:hover .theme-card-image {
    background-size: 125% !important; /* 强制放大到 125% */
}

/* 阅读量在图片右上角，位置固定 */
.theme-card-views {
    position: absolute;
    top: 8px;
    right: 10px;
    background: rgba(0, 0, 0, 0.20);
    color: #ffffff;
    padding: 2px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 500;
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    z-index: 2;
    pointer-events: none;
    transition: background 0.3s ease;
}

/* 深色模式：更通透 */
.dark-mode .theme-card-views {
    background: rgba(0, 0, 0, 0.25);
    color: #f0f0f0;
    border-color: rgba(255, 255, 255, 0.06);
}

/* 阅读量图标略小 */
.theme-card-views i {
    font-size: 10px;
}

/* 标题在下方居中 */
.theme-card-title {
    padding: 12px 14px 14px;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.4;
    word-break: break-word;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .theme-card-image {
        padding-top: 60%;
    }
    .theme-card-title {
        font-size: 13px;
        padding: 8px 10px 10px;
    }
    .theme-card-views {
        font-size: 10px;
        padding: 2px 8px;
        top: 6px;
        right: 8px;
    }
    .theme-card-views i {
        font-size: 9px;
    }
}

/* “更多”链接图标美化 */
.more-link i {
    transition: transform 0.2s ease;
    font-size:13px;
}
.more-link:hover i {
    transform: translateX(3px); /* 悬停时图标右移，增强交互感 */
}
.more-link {
    color: var(--primary);
    text-decoration: none;
    font-size:13px;
    margin-left: 6px;
    transition: color 0.2s;
}
.more-link:hover {
    color: var(--primary-600);
    text-decoration: underline;
}

/* 移动端适当调整字体 */
@media (max-width: 480px) {
    .more-link {
        font-size:10px;
        margin-left: 4px;
    }
}

.more-link i {
    transition: transform 0.2s ease;
}
.more-link:hover i {
    transform: translateX(3px);
}
/* ===== 统计模块（一行显示，手机端隐藏） ===== */
.mx-stats {
    background: linear-gradient(135deg, var(--primary), var(--primary-600));
    border-radius: var(--radius);
    padding: 12px 20px;           /* 减小内边距，更紧凑 */
    color: #fff;
    text-align: center;
    display: flex;                /* 改为 flex 行内排列 */
    align-items: center;
    justify-content: center;
    gap: 6px;                    /* 元素间距 */
    flex-wrap: nowrap;            /* 强制一行 */
}

.mx-stats p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

.mx-stats .number {
    font-size: 18px;             /* 数字适当放大，但不夸张 */
    font-weight: 700;
    line-height: 1.2;
}

/* 手机端隐藏（宽度小于 768px） */
@media (max-width: 768px) {
    .mx-stats {
        display: none;
    }
}

/* WebKit 浏览器（Chrome, Safari, Edge） */
.code-block-body::-webkit-scrollbar,
pre[class*="language-"]::-webkit-scrollbar {
    height: 6px;                         /* 滚动条高度 */
    background: rgba(255, 255, 255, 0.1); /* 轨道背景（半透明白） */
    border-radius: 3px;
}

.code-block-body::-webkit-scrollbar-track,
pre[class*="language-"]::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
}

.code-block-body::-webkit-scrollbar-thumb,
pre[class*="language-"]::-webkit-scrollbar-thumb {
    background: #b8a9f0;                 /* 淡紫色（柔和，不鲜艳） */
    border-radius: 3px;
    transition: background 0.2s;
}

.code-block-body::-webkit-scrollbar-thumb:hover,
pre[class*="language-"]::-webkit-scrollbar-thumb:hover {
    background: #9f8ee0;                 /* 悬停时稍微加深 */
}

/* Firefox 浏览器 */
.code-block-body,
pre[class*="language-"] {
    scrollbar-width: thin;
    scrollbar-color: #b8a9f0 rgba(255, 255, 255, 0.06);
}

/* 可选：当代码块内容不超长时隐藏滚动条（保留空间） */
.code-block-body:not(:hover)::-webkit-scrollbar-thumb,
pre[class*="language-"]:not(:hover)::-webkit-scrollbar-thumb {
    /* 如果需要悬停才显示，可取消注释，但建议始终显示以便用户知晓可滚动 */
    /* opacity: 0.6; */
}
/* ===== 浮动工具栏 ===== */
.floating-toolbar {
    position: fixed;
    right: 20px;
    bottom: 120px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toolbar-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #ffffff;
    color: #4F46E5;
    font-size: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: background 0.2s, color 0.2s, transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid rgba(99, 102, 241, 0.1);
}

.toolbar-btn:hover {
    background: #4F46E5;
    color: #ffffff;
    transform: scale(1.08);
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

/* 上下箭头 SVG 图标颜色继承 */
.toolbar-btn svg {
    stroke: currentColor;
}

.toolbar-btn:hover svg {
    stroke: #ffffff;
}

/* 二维码弹出框 */
.toolbar-qrcode {
    position: absolute;
    right: 56px;
    top: 50%;
    transform: translateY(-50%) scale(0.9);
    width: 160px;
    padding: 12px 12px 10px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    pointer-events: none;
    text-align: center;
    border: 1px solid #f1f3f5;
}

.toolbar-qrcode::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 8px solid #ffffff;
    filter: drop-shadow(2px 0 4px rgba(0,0,0,0.05));
}

.toolbar-item:hover .toolbar-qrcode {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) scale(1);
    pointer-events: auto;
}

.toolbar-qrcode img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 6px;
    background: #f8fafc;
    display: block;
    margin: 0 auto;
}

.toolbar-qrcode span {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}

/* 响应式 */
@media (max-width: 768px) {
    .floating-toolbar {
        right: 12px;
        bottom: 100px;
        gap: 8px;
    }
    .toolbar-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    .toolbar-qrcode {
        width: 140px;
        right: 50px;
    }
    .toolbar-qrcode img {
        width: 100px;
        height: 100px;
    }
}
/* ===== 返回示例中的图片美化（适配当前结构） ===== */
.api-doc > img,
.api-doc p > img,
.api-doc .response-content img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 12px auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.api-doc > img:hover,
.api-doc .response-content img:hover {
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35);
    transform: translateY(-2px);
}

/* 超链接样式：缩小 + 主题配色 */
.api-doc a {
    font-size: 0.92em;
    color: #6366F1;
    text-decoration: none;
    border-bottom: 1px solid rgba(99, 102, 241, 0.2);
    transition: color 0.2s, border-color 0.2s;
}

.api-doc a:hover {
    color: #4F46E5;
    border-bottom-color: #4F46E5;
}

/* 缩小分类标题图标与文字间距 */
.mx-toolbar h2 img {
    margin-right: 2px !important;
}
   
.category-section {
    margin-bottom: 40px;
}
#hot {
    margin-bottom: 40px;  /* 与上面一致，保持统一 */
}

/* ===== 文章页三级标题样式 ===== */
.api-doc h2 {
    font-size: 18px;
    font-weight: 600;
    color: #4F46E5;
    margin: 28px 0 12px 0;
    padding-bottom: 6px;
    border-bottom: 2px solid #EEF2FF;
    line-height: 1.4;
    position: relative;
}

.api-doc h2::before {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, #6366F1, #4F46E5);
    border-radius: 2px;
}

.api-doc h2 {display: flex; align-items: center; gap: 8px;}
.related-posts h2 {display: flex; align-items: center; gap: 8px;}
/* 文章页普通标题也保持统一 */
.post-content h2 {
    font-size: 20px;
    font-weight: 600;
    color: #1E1B2E;
    margin: 24px 0 12px 0;
    padding-bottom: 6px;
    border-bottom: 2px solid #F1F5F9;
}
/* ===== 文档页表格美化 ===== */
.mx-doc table {
    width: 100%;
    font-size: 14px;
    border-collapse: collapse;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.20), 0 1px 3px rgba(0, 0, 0, 0.06); /* 主要阴影带主题色 */
    margin: 0.5em 0 1em;
}

/* 表头 */
.mx-doc thead {
    background: linear-gradient(135deg, #7C6FEB, #5B4FCF);
}

.mx-doc th {
    color: #ffffff;
    font-weight: 700;
    padding: 12px 18px;
    text-align: left;
    border: none;
    font-size: 13px;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* 表体 */
.mx-doc td {
    padding: 10px 18px;
    border-bottom: 1px solid #e8edf5;
    color: #1e1b2e;
    font-size: 13.5px;
}

/* 最后一行去掉底部边框 */
.mx-doc tbody tr:last-child td {
    border-bottom: none;
}

/* 隔行变色 */
.mx-doc tbody tr:nth-child(even) {
    background-color: #f8f9ff;
}

/* 行悬停效果 */
.mx-doc tbody tr:hover {
    background-color: #EEF2FF;
    transition: background 0.2s;
}

/* 响应式滚动容器 */
@media (max-width: 768px) {
    .mx-doc .table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 0.5em 0 1em;
    }
    .mx-doc .table-wrap table {
        min-width: 480px;
    }
}
/* 复制成功提示 */
.copy-toast {
    position: fixed;
    top: 80px;
    right: 24px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #6366F1, #4F46E5);
    color: #fff;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    animation: slideInRight 0.3s ease, fadeOut 2s ease 1.7s forwards;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.copy-toast .toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    flex-shrink: 0;
}

.copy-toast .toast-icon svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: #fff;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@keyframes slideInRight {
    0% { opacity: 0; transform: translateX(30px); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes fadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; }
}
/* ===== 代码块容器 ===== */
.code-block-wrapper {
    position: relative;
    margin: 1em 0;
    border-radius: 8px;
    overflow: hidden;
    background: linear-gradient(160deg, #652487 0%, #443ac3 35%, #0174b7 68%, #04988e 100%);
}

/* ===== 代码块顶栏 ===== */
.code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 16px;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 40px;
    user-select: none;
}

/* 语言标签 */
.code-block-header .lang {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 右侧按钮组 */
.code-block-header .actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* 顶栏按钮（图标按钮） */
.code-block-header .actions button {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    line-height: 1;
}

.code-block-header .actions button:hover {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.95);
}

.code-block-header .actions button:active {
    background: rgba(255, 255, 255, 0.2);
}

/* 复制成功状态 */
.code-block-header .actions button.copied {
    color: #4ade80;
}

/* ===== 代码内容区域 ===== */
.code-block-body {
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 2000px;
}

.code-block-body.collapsed {
    max-height: 0 !important;
}

/* 代码块内部样式 */
.code-block-body pre[class*="language-"] {
    margin: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    padding: 1.2em 1.5em;
    color: rgba(255, 255, 255, 0.92);
    font-family: 'JetBrains Mono', 'Consolas', 'Menlo', monospace;
    font-size: 0.9em;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.code-block-body pre[class*="language-"] code {
    background: transparent !important;
    color: inherit !important;
    padding: 0 !important;
    font-family: inherit;
}

/* 行内代码样式 */
:not(pre) > code[class*="language-"] {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.15em 0.5em;
    border-radius: 4px;
    font-size: 0.9em;
    color: #fff;
}


/* ---------- 基础 ---------- */
.mx-pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}
.mx-pagination span {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    font-size: 14px;
    cursor: pointer;
}
.mx-pagination span.active {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
}
.mx-pagination span:hover:not(.active) {
    background: #f3f4f6;
}

:root {
    --primary: #6366F1;
    --primary-400: #818CF8;
    --primary-600: #4F46E5;
    --primary-50: #EEF2FF;
    --bg: #F8FAFC;
    --card: #FFFFFF;
    --text: #1E1B2E;
    --text-muted: #A3A3A3;
    --border: #E5E7EB;
    --radius: 16px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
}

/* ---------- 容器 ---------- */
.mx-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ---------- Header ---------- */
.mx-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    height: 64px;
    display: flex;
    align-items: center;
}
.mx-header .mx-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.mx-header-placeholder { height: 64px; }

.mx-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
}
.mx-logo span { font-size: 22px; }

.mx-search {
    flex: 1;
    max-width: 480px;
    margin: 0 24px;
    position: relative;
}
.mx-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}
.mx-search input {
    width: 100%;
    padding: 8px 16px 8px 40px;
    border-radius: 9999px;
    border: 1px solid var(--border);
    background: var(--bg);
    font-size: 14px;
    outline: none;
    transition: 0.2s;
}
.mx-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.mx-nav {
    display: flex;
    gap: 20px;
}
.mx-nav a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: 0.2s;
}
.mx-nav a:hover { color: var(--primary); }

/* ---------- 首页布局 ---------- */
.mx-main { padding: 32px 0; }

.mx-main .mx-container {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

/* ---------- 侧边栏 ---------- */
.mx-sidebar {
    width: 180px;
    flex-shrink: 0;
    position: sticky;
    top: 96px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.category-icon {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    margin-right: 6px;
    display: inline-block;
}
.mx-sidebar .mx-card { padding: 16px; }
.mx-sidebar h2 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.mx-sidebar ul {
    list-style: none;
}
.mx-sidebar ul li a {
    display: flex;
    align-items: center; 
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: none;
    transition: 0.15s;
}
.mx-sidebar ul li a img {
    width: 18px;
    height: 18px;
    margin-right: 6px;
    flex-shrink: 0;       /* 防止图片被压缩 */
}
.mx-sidebar ul li a:hover { background: var(--primary-50); }
.mx-sidebar ul li a.active {
    background: var(--primary-50);
    color: var(--primary);
    font-weight: 500;
}

.mx-stats {
    background: linear-gradient(135deg, var(--primary), var(--primary-600));
    border-radius: var(--radius);
    padding: 20px;
    color: #fff;
    text-align: center;
}

.mx-stats p:last-child { font-size: 13px; opacity: 0.8; }

/* ---------- 内容区 ---------- */
/* 默认（桌面） */
.mx-content {
    flex: 1;
    min-width: 0; /* 改为 0，避免小屏溢出 */
}

/* 平板及以下（宽度 ≤ 1024px） */
@media (max-width: 1024px) {
    .mx-content {
        min-width: 0 !important;
    }
}

/* 手机（宽度 ≤ 768px） */
@media (max-width: 768px) {
    .mx-content {
        min-width: 0 !important;
        width: 100%; /* 确保占满父容器 */
    }
}

/* 小屏手机（宽度 ≤ 480px） */
@media (max-width: 480px) {
    .mx-content {
        min-width: 0 !important;
        width: 100%;
    }
}

.mx-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.mx-toolbar h2 { font-size: 20px; font-weight: 600; }
.mx-toolbar span {
    font-size: 13px;
    color: var(--text-muted);
}

/* 分类标题：图标和文字水平居中，在一行显示 */
.category-section .mx-toolbar h2 {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap; /* 确保不换行 */
}
.category-section .mx-toolbar h2 img {
    display: inline-block;
    width: 24px;
    height: 24px;
    vertical-align: middle;
}
.category-section .mx-toolbar h2 span {
    display: inline-block;
    white-space: nowrap;
}

.mx-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

/* ---------- 卡片 ---------- */
.mx-card {
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: 0.2s;
}
.mx-card:hover {
    border-color: var(--primary-400);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99,102,241,0.10);
}

.api-card {
    padding: 20px;
    cursor: pointer;
}
.api-header {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.api-header img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--bg);
    flex-shrink: 0;
}
.api-header h4 {
    font-size: 15px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.api-meta {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}
.api-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- API 详情页 ---------- */
.mx-doc .mx-card { padding: 32px; margin: 0 auto; }

.doc-header {
    display: flex;
    gap: 20px;
    align-items: center;
}
.doc-header img {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    object-fit: cover;
    background: var(--bg);
}
.doc-header h1 { font-size: 24px; font-weight: 700; }
.doc-header p { color: var(--text-muted); margin-top: 4px; }

.doc-info { display: flex; flex-direction: column; gap: 12px; }
.doc-info > div {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.doc-info span {
    color: var(--text-muted);
    font-size: 14px;
    min-width: 72px;
}
.doc-info code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    background: #EEF2FF;
    padding: 4px 12px;
    border-radius: 6px;
    word-break: break-all;
}
.doc-info .method { color: #059669; background: #ECFDF5; }
.doc-info .format { color: #2563EB; background: #EFF6FF; }
.doc-info button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}
.doc-info button:hover { background: var(--bg); color: var(--primary); }


.code-block {
    background: #1E1B2E;
    color: #E5E7EB;
    padding: 16px 20px;
    border-radius: 10px;
    font-size: 13px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
}
.code-wrapper {
    position: relative;
}
.code-wrapper pre {
    background: #1E1B2E;
    color: #E5E7EB;
    padding: 16px 20px;
    border-radius: 10px;
    font-size: 13px;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
}
.code-wrapper button {
    position: absolute;
    top: 8px;
    right: 12px;
    background: rgba(255,255,255,0.08);
    color: #9CA3AF;
    border: none;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}
.code-wrapper button:hover { background: rgba(255,255,255,0.15); color: #fff; }

.doc-footer {
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    text-align: right;
    font-size: 13px;
    color: var(--text-muted);
}
.doc-footer a { color: var(--primary); text-decoration: none; }
.doc-footer a:hover { text-decoration: underline; }

/* ---------- Toast ---------- */
.mx-toast {
    position: fixed;
    top: 80px;
    right: 24px;
    background: #059669;
    color: #fff;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    z-index: 999;
    box-shadow: 0 4px 16px rgba(5,150,105,0.3);
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-12px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
    .mx-search { margin: 0 12px; max-width: 200px; }
    .mx-nav { gap: 12px; }
    .mx-nav a { font-size: 13px; }
    .mx-main .mx-container { flex-direction: column; }
    .mx-sidebar {
        width: 100%;
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
    }
    .mx-sidebar .mx-card { flex: 1; min-width: 160px; }
    .mx-grid { grid-template-columns: 1fr; }
    .mx-doc .mx-card { padding: 20px; }
    .doc-header { flex-direction: column; text-align: center; }
    .doc-info > div { flex-wrap: wrap; }
}

@media (max-width: 480px) {
    .mx-header .mx-container { flex-wrap: wrap; gap: 8px; }
    .mx-search { order: 3; flex: 1 1 100%; max-width: 100%; margin: 0; }
    .mx-nav { gap: 8px; }
}

/* ============================================================
   MikuX 页脚样式
   ============================================================ */

.mx-footer {
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    padding: 48px 0 24px;
    margin-top: 48px;
    color: #374151;
}

.mx-footer .mx-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 三列均分，介绍不再过宽 */
.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 32px;
}

.footer-item h4 {
    font-size: 16px;
    font-weight: 600;
    color: #1e1b2e;
    margin-bottom: 16px;
    letter-spacing: 0.5px;
}

.footer-item p {
    font-size: 14px;
    line-height: 1.7;
    color: #6b7280;
    margin-bottom: 10px;
}

.footer-item a {
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
    display: block;
    padding: 4px 0;
    transition: color 0.2s;
}

.footer-item a:hover {
    color: #6366f1;
}

.footer-item .cloud-info {
    margin-top: 12px;
    font-size: 13px;
}

.footer-item .cloud-info a {
    display: inline;
    color: #6366f1;
    font-weight: 500;
}

/* ----- 赞赏工具（药丸大弧度样式） ----- */
.donate-box {
    margin-top: 12px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.donate-label {
    font-size: 13px;
    font-weight: bold;
    color: #6366F1;
    margin-right: 4px;
}

#donateBox {
    list-style: none;
    display: flex;
    gap: 8px;
    padding: 0;
    margin: 0;
    flex-wrap: nowrap;
}

#donateBox li {
    cursor: pointer;
    font-size: 13px;
    padding: 4px 14px;
    border-radius: 20px;          /* 药丸大弧度 */
    transition: all 0.2s;
    color: #374151;
    user-select: none;
    background: #f1f5f9;          /* 浅灰背景 */
    border: none;                 /* 去掉边框 */
    white-space: nowrap;
    flex-shrink: 0;
}

#donateBox li:hover {
    background: #6366f1;          /* 紫色背景 */
    color: #fff;                  /* 白色文字 */
}

/* ----- 二维码弹窗（按钮附近显示） ----- */
#QRBox {
    position: fixed;
    z-index: 99999;
    display: none;
    pointer-events: none;
}

#QRBox.active {
    display: block;
    pointer-events: auto;
}

#MainBox {
    width: 180px;
    height: 180px;
    background: #fff no-repeat center center;
    background-size: 170px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    opacity: 0;
    transform: scale(0.95) translateY(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    border: 2px solid #fff;
}

#MainBox.showQR {
    opacity: 1;
    transform: scale(1) translateY(0);
}

#MainBox.hideQR {
    opacity: 0;
    transform: scale(0.95) translateY(-6px);
}

/* ----- 分割线 ----- */
.footer-divider {
    border-top: 1px solid #e5e7eb;
    margin: 32px 0 20px;
}

/* ----- 版权 & 备案（居中对齐，紧挨着） ----- */
.footer-bottom {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 14px;
    color: #9ca3af;
    text-align: center;
}

.footer-bottom a {
    color: #6366f1;
    text-decoration: none;
}

.footer-bottom a:hover {
    text-decoration: underline;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }
}

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

    .footer-bottom {
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }

    #MainBox {
        width: 150px;
        height: 150px;
        background-size: 140px;
    }
}


/* 默认浅色模式变量 */
:root {
    --primary: #6366F1;
    --primary-400: #818CF8;
    --primary-600: #4F46E5;
    --primary-50: #EEF2FF;
    --bg: #F8FAFC;
    --card: #FFFFFF;
    --text: #1E1B2E;
    --text-muted: #A3A3A3;
    --border: #E5E7EB;
    --radius: 16px;
    --shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* 深色模式变量 */
.dark-mode {
    --primary: #818CF8;
    --primary-400: #6366F1;
    --primary-600: #4F46E5;
    --primary-50: #2D2A4A;
    --bg: #12101A;
    --card: #1E1B2E;
    --text: #E5E7EB;
    --text-muted: #9CA3AF;
    --border: #2D2A4A;
    --shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* 应用背景、文字等通用样式 */
body {
    background: var(--bg);
    color: var(--text);
    transition: background 0.3s, color 0.3s;
}
.mx-card,
.mx-header,
.mx-footer,
.toolbar-btn,
.toolbar-qrcode,
.code-block-header {
    transition: background 0.3s, color 0.3s, border-color 0.3s, box-shadow 0.3s;
}

/* ===== 主题切换按钮 ===== */
.mx-nav .theme-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 8px;
    font-size: 14px;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}
.theme-toggle:hover {
    background: var(--primary-50);
    border-color: var(--primary);
}
/* 深色模式下的按钮颜色 */
.dark-mode .mx-nav .theme-toggle {
    color: rgba(255, 255, 255, 0.6);
}
.dark-mode .mx-nav .theme-toggle:hover {
    color: var(--primary);
}

/* 调整图标大小 */
.mx-nav .theme-toggle svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}
.theme-toggle svg {
    stroke: currentColor;
}
.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
    transition: transform 0.5s ease, opacity 0.3s ease;
}
.dark-mode .theme-toggle .sun-icon {
    transform: rotate(90deg);
}
/* 默认显示太阳，深色模式显示月亮 */
.theme-toggle .moon-icon { display: none; }
.dark-mode .theme-toggle .sun-icon { display: none; }
.dark-mode .theme-toggle .moon-icon { display: block; }

.mx-header {
    background: rgba(255,255,255,0.85); /* 浅色默认 */
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
}
.dark-mode .mx-header {
    background: rgba(18, 16, 26, 0.9);  /* 深色模式背景 */
    border-bottom-color: var(--border);
}

.mx-footer {
    background: var(--footer-bg, #f8fafc);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}
:root {
    --footer-bg: #f8fafc;
}
.dark-mode {
    --footer-bg: #1a1728;
}
.mx-footer a {
    color: var(--text-muted);
}
.mx-footer a:hover {
    color: var(--primary);
}
.doc-info code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    background: var(--primary-50);
    padding: 4px 12px;
    border-radius: 6px;
    word-break: break-all;
    color: var(--text);  /* 文字颜色使用变量 */
}

/* 深色模式下代码背景加深 */
.dark-mode .doc-info code {
    background: #2D2A4A;
}

/* 默认样式保持不变，深色模式覆盖 */
.dark-mode .toolbar-btn {
    background: rgba(255, 255, 255, 0.12);  /* 半透明白，柔和 */
    border-color: rgba(255, 255, 255, 0.08);
}


/* ===== 深色模式精确修复 ===== */

/* 搜索框 */
.dark-mode .mx-search input {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}
.dark-mode .mx-search input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

/* 赞赏按钮 */
.dark-mode #donateBox li {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text);
}
.dark-mode #donateBox li:hover {
    background: #6366f1;
    color: #fff;
    border-color: #6366f1;
}

/* 表头不变 */
.dark-mode .table-wrap th,
.dark-mode .mx-doc th,
.dark-mode table th {
    background: linear-gradient(135deg, #7C6FEB, #5B4FCF) !important;
    color: #ffffff !important;
}

/* 所有表格行背景 */
.dark-mode .table-wrap tbody tr,
.dark-mode .mx-doc tbody tr,
.dark-mode table tbody tr {
    background-color: #1e1b2e !important;
}
.dark-mode .table-wrap tbody tr:nth-child(even),
.dark-mode .mx-doc tbody tr:nth-child(even),
.dark-mode table tbody tr:nth-child(even) {
    background-color: #2a2740 !important;
}

/* 单元格背景透明，文字颜色亮色 */
.dark-mode .table-wrap td,
.dark-mode .mx-doc td,
.dark-mode table td {
    background-color: transparent !important;
    color: #d1d5db !important;
}

/* 表格边框 */
.dark-mode .table-wrap table,
.dark-mode .mx-doc table,
.dark-mode table {
    border: 1px solid #3d3a5a !important;
}
.dark-mode .table-wrap td,
.dark-mode .mx-doc td,
.dark-mode table td {
    border-bottom: 1px solid #3d3a5a !important;
}

/* 悬停 */
.dark-mode .table-wrap tbody tr:hover,
.dark-mode .mx-doc tbody tr:hover,
.dark-mode table tbody tr:hover {
    background-color: #3a3555 !important;
}
.dark-mode .table-wrap tbody tr:hover td,
.dark-mode .mx-doc tbody tr:hover td,
.dark-mode table tbody tr:hover td {
    background-color: transparent !important;
}


/* ===== 主题切换下拉菜单 ===== */
.theme-dropdown {
    position: relative;
    display: inline-block;
    margin-left: 8px;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    border-radius: 20px;
    font-size: 14px;
    transition: background 0.2s, color 0.2s;
    font-family: inherit;
}
.theme-toggle:hover {
    background: var(--primary-50);
    color: var(--primary);
}
.theme-toggle svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}
.toggle-text {
    font-size: 13px;
}

/* 默认显示太阳，根据模式切换图标 */
.theme-toggle .moon-icon,
.theme-toggle .system-icon {
    display: none;
}
body:not(.dark-mode) .theme-toggle .sun-icon { display: block; }
.dark-mode .theme-toggle .moon-icon { display: block; }
.dark-mode .theme-toggle .sun-icon { display: none; }

/* 取消 system-icon 展示 */
.theme-toggle .system-icon { display: none !important; }

/* 下拉菜单 */
.theme-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    padding: 6px 0;
    min-width: 110px;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    z-index: 1000;
}

.theme-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.theme-menu li {
    text-align: center;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    transition: background 0.15s, color 0.15s;
    display: block;      
    align-items: center;
    gap: 8px;
}
.theme-menu li:hover {
    background: var(--primary-50);
    color: var(--primary);
}
.theme-menu li.active {
    background: var(--primary-50);
    color: var(--primary);
    font-weight: 500;
}

/* 深色模式下拉菜单背景 */
.dark-mode .theme-menu {
    background: #1e1b2e;
    border-color: #2d2a4a;
}
.dark-mode .theme-menu li:hover {
    background: #2d2a4a;
}
/* ===== 深色模式：右下角工具栏按钮颜色反转 ===== */
.dark-mode .toolbar-btn {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
}


/* 移动端顶栏优化 */
@media (max-width: 768px) {
    .mx-header {
        padding: 6px 0;
        min-height: 52px;
        height: auto;
    }
    .mx-header .mx-container {
        flex-wrap: wrap;
        gap: 4px 8px;
        align-items: center;
    }
    .mx-logo {
        font-size: 18px;
        gap: 6px;
    }
    .mx-logo svg {
        width: 28px;
        height: 28px;
    }
    .mx-search {
        order: 3;
        flex: 1 1 100%;
        margin: 2px 0;
        max-width: 100%;
    }
    .mx-search input {
        padding: 6px 12px 6px 32px;
        font-size: 13px;
    }
    .mx-nav {
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 13px;
    }
    .mx-nav .theme-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 2px 6px;
        line-height: 1;
        vertical-align: middle;
    }
    .mx-nav .theme-toggle svg {
        width: 16px;
        height: 16px;
    }
    .toggle-text {
        display: none; /* 移动端隐藏“主题”文字 */
    }
    .mx-nav a {
        font-size: 13px;
        padding: 4px 0;
    }
    /* 移动端侧边栏卡片紧凑 */
    .mx-sidebar .mx-card {
        padding: 6px 12px !important;
    }
    
    /* 分类标题左对齐，箭头靠右 */
   .category-toggle {
        margin-bottom: 0 !important;
        padding: 4px 0;
        font-size: 14px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 6px;
        cursor: pointer;
        user-select: none;
    }
    .category-toggle .toggle-icon {
        margin-left: auto; /* 将箭头推到右侧 */
        font-size: 12px;
        transition: transform 0.3s ease;
    }

    /* 分类列表默认折叠，展开时紧凑 */
    .category-list {
        display: none;
        margin: 0 !important;
        padding: 0 !important;
        padding: 0;
    }
    .category-list.open {
        display: block;
    }
    
    /* 分类列表项紧凑 */
    .category-list li {
        margin-bottom: 0px;
    }
    .category-list a {
        display: block;
        padding: 4px 8px;
        font-size: 13px;
        border-radius: 6px;
        color: var(--text-muted);
        text-decoration: none;
        transition: background 0.15s;
    }
    .category-list a:hover,
    .category-list a.active {
        background: var(--primary-50);
        color: var(--primary);
    }
}

/* 移动端分类折叠 */
@media (max-width: 768px) {
    .category-list {
        display: none; /* 默认折叠 */
    }
    .category-list.open {
        display: block;
    }
    .category-toggle {
        cursor: pointer;
        user-select: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .category-toggle .toggle-icon {
        transition: transform 0.3s ease;
    }
    .category-toggle.open .toggle-icon {
        transform: rotate(180deg);
    }

}

/* 桌面端保持展开，隐藏箭头 */
@media (min-width: 769px) {
    .category-list {
        display: block !important;
    }
    .category-toggle .toggle-icon {
        display: none;
    }
}
/* 移动端：强制每行2列 */
@media (max-width: 768px) {
    .mx-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px;
    }
    /* 卡片内边距调小，防止内容溢出 */
    .api-card {
        padding: 16px;
    }
    .api-header img {
        width: 40px;
        height: 40px;
    }
    .api-header h4 {
        font-size: 14px;
        white-space: normal;
        word-break: break-word;
    }
    .api-desc {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }
}

/* 极窄屏（宽度 < 380px）单列 */
@media (max-width: 380px) {
    .mx-grid {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }
    .api-card {
        padding: 14px;
    }
}

/* 移动端文章页头部强制左对齐 + 垂直居中 */
@media (max-width: 768px) {
    .mx-doc .doc-header,
    .doc-header {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 12px !important;
        text-align: left !important;
        flex-direction: row !important; /* 确保水平排列 */
    }
    .mx-doc .doc-header img,
    .doc-header img {
        flex-shrink: 0 !important;
        width: 48px !important;
        height: 48px !important;
        margin: 0 !important;
    }
    .mx-doc .doc-header > div,
    .doc-header > div {
        flex: 1 !important;
        text-align: left !important;
        min-width: 0 !important;
    }
    .mx-doc .doc-header h1,
    .doc-header h1 {
        font-size: 18px !important;
        word-break: break-word !important;
        text-align: left !important;
        margin: 0 0 2px 0 !important;
    }
    .mx-doc .doc-header p,
    .doc-header p {
        font-size: 14px !important;
        text-align: left !important;
        margin: 0 !important;
    }
}
/* ===== 标签云 ===== */
.tag-cloud {
    padding: 16px;
}
.tag-cloud h2{
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}
.tag-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.tag-cloud .toggle-icon {
    font-size: 12px;
    transition: transform 0.3s ease;
    margin-left: auto;
    flex-shrink: 0;
}
.tag-cloud .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 3px;
    margin-top: 2px;
}

.tag-cloud .tags a {
    display: inline-flex;
    align-items: center;
    justify-content: center;   /* 文字水平居中 */
    padding: 4px 10px;
    border-radius: 16px;
    background: var(--primary);
    color: #fff;
    border: 1px solid var(--primary);
    text-decoration: none;
    font-size: 12px;
    line-height: 1.2;
    transition: background 0.2s, transform 0.2s, border-color 0.2s;
    white-space: nowrap;
}
.tag-cloud .tags a:hover {
    background: var(--primary-600);
    border-color: var(--primary-600);
    transform: scale(1.05);
    color: #fff !important;
}
/* 移动端折叠 */
@media (max-width: 768px) {
    #category-list,
    #tag-list {
        display: none;
    }
    #category-list.open,
    #tag-list.open {
        display: block;
    }

    .tag-toggle {
        margin-bottom: 0 !important;
        padding: 4px 0;
        font-size: 14px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 6px;
        cursor: pointer;
        user-select: none;
    }
        /* 分类列表无外边距 */
    .tag-list {
        margin: 0 !important;
        padding: 0 !important;
    }
}
@media (min-width: 769px) {
    #category-list,
    #tag-list {
        display: block !important;
    }
    .category-toggle .toggle-icon,
    .tag-toggle .toggle-icon {
        display: none;
    }
}
.api-doc p {
    margin-bottom: 1.2em;
}
/* 移动端：所有网格单列 */
@media (max-width: 768px) {
    .mx-grid,
    .article-grid {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    /* 卡片内边距调小，防止内容溢出 */
    .api-card {
        padding: 16px;
    }
    .api-header img {
        width: 40px;
        height: 40px;
    }
    .api-header h4 {
        font-size: 14px;
        white-space: normal;
        word-break: break-word;
    }
    .api-desc {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }
    /* 文章卡片（log分类）保持单列 */
    .article-card-inner {
        padding: 8px 14px;
        font-size: 13px;
    }
}
.api-doc li p {
    margin-bottom: 0;
}
