/* ===================================================================
   文档化主题（2026-11-10）
   目标：向「接口文档」观感靠拢 —— 三栏布局、克制的排版、右侧本页目录、
        上一篇/下一篇。只在 ≥769px 覆盖布局，手机端保留原有抽屉式目录。
   =================================================================== */

.docs-progress {
    position: fixed; top: 0; left: 0; right: 0; height: 2px;
    z-index: 1200; background: transparent; opacity: 0;
    transition: opacity .25s ease; pointer-events: none;
}
.docs-progress i {
    display: block; height: 100%; width: 0;
    background: linear-gradient(90deg, #4a8a41, #86d477);
    transition: width .12s linear;
}

/* ---- 桌面三栏 ---- */
@media (min-width: 769px) {
    /* 2026-11-12：外层 main.container 的 1200px 一直卡着三栏（.wiki-layout 的 1580px 根本没生效，
       1920 屏下正文只剩 ~614px）。docs.css 只被 wiki 页面引用，这里直接放宽容器。 */
    main.container { max-width: 1680px; }
    /* 导航栏保持站点统一宽度（1200px），不再跟着正文放宽：
       放宽后 logo 贴左、菜单贴右，从首页点进 Wiki 会像整条导航被拉到两边（BOSS 2026-11-14） */
    .wiki-layout {
        display: flex; gap: 44px; max-width: 1640px;   /* 250 侧栏 + 208 目录 + 88 间距 + 1080 正文 */
        margin: 0 auto; align-items: flex-start;
    }
    .wiki-sidebar {
        width: 250px; flex: 0 0 250px; position: sticky; top: 76px;
        max-height: calc(100vh - 96px); overflow-y: auto;
        background: transparent; border-radius: 0; padding: 4px 6px 28px 0;
    }
    .wiki-sidebar::-webkit-scrollbar { width: 5px; }
    .wiki-sidebar::-webkit-scrollbar-thumb { background: #dfe3e6; }

    /* 分组标题降级为「小标签」，不再是方块按钮 */
    .wiki-sidebar-group { margin: 0 0 2px; }
    .wiki-sidebar-group > button {
        width: 100%; background: none; border: 0; border-radius: 0;
        padding: 15px 10px 6px; font-size: 11.5px; font-weight: 700;
        letter-spacing: .09em; color: #9aa3ad; text-align: left;
        cursor: pointer; position: relative;
    }
    .wiki-sidebar-group.open > button { background: none; color: #6b7280; }
    .wiki-sidebar-group > button::after {
        content: ""; position: absolute; right: 12px; top: 19px;
        width: 6px; height: 6px; border-right: 1.5px solid #c3c9d0;
        border-bottom: 1.5px solid #c3c9d0;
        transform: rotate(45deg); transition: transform .2s ease;
    }
    .wiki-sidebar-group.open > button::after {
        transform: rotate(225deg); border-color: #9aa3ad;
    }
    .wiki-sidebar-items { border: 0; background: transparent; }
    .wiki-sidebar-items a {
        display: block; padding: 7px 12px 7px 13px; margin: 1px 0;
        font-size: 13.5px; line-height: 1.5; color: #4b5563;
        border-radius: 6px; border-left: 2px solid transparent;
        text-decoration: none; transition: background .15s, color .15s;
    }
    .wiki-sidebar-items a:hover { background: #f4f7f4; color: #1f2328; }
    .wiki-sidebar-items a.active {
        background: #edf6ee; color: #2c6b39; font-weight: 600;
        border-left-color: #5DA552;
    }
}

/* ---- 右侧「本页目录」 ---- */
.docs-toc { display: none; }
@media (min-width: 1200px) {
    .docs-toc {
        display: block; width: 208px; flex: 0 0 208px;
        position: sticky; top: 84px; max-height: calc(100vh - 120px);
        overflow-y: auto; padding-left: 4px;
    }
    .docs-toc.is-empty { display: none; }
}
.docs-toc-title {
    font-size: 11.5px; font-weight: 700; letter-spacing: .09em;
    color: #9aa3ad; margin: 0 0 10px 11px;
}
.docs-toc-list { list-style: none; margin: 0; padding: 0; border-left: 1px solid #eceef0; }
.docs-toc-list li { margin: 0; }
.docs-toc-list a {
    display: block; padding: 6px 10px; margin-left: -1px;
    font-size: 13px; line-height: 1.55; color: #737d88;
    text-decoration: none; border-left: 2px solid transparent;
    transition: color .15s, border-color .15s;
}
.docs-toc-list .lvl3 a { padding-left: 23px; font-size: 12.5px; color: #8a919c; }
.docs-toc-list a:hover { color: #1f2328; }
.docs-toc-list a.active { color: #2c6b39; border-left-color: #5DA552; font-weight: 600; }

/* ---- 正文排版 ---- */
/* 2026-11-11：正文宽度 820 → 1040px。原值在 1380px 的三栏里左右留白过多，
   读文档时视线频繁折返。1040px 下仍能保持每行 ~100 字符的可读性。 */
.wiki-article { max-width: 1080px; }
.wiki-article h1 {
    font-size: 31px; line-height: 1.28; font-weight: 700; letter-spacing: -.02em;
    color: #111418; margin: 0 0 14px; padding: 0; border: 0;
}
.wiki-lead {
    font-size: 16px; line-height: 1.8; color: #5b6470;
    margin: 0 0 30px; padding: 0;
}
.wiki-article h2 {
    font-size: 21px; line-height: 1.4; font-weight: 650; color: #15181d;
    margin: 46px 0 14px; padding: 0 0 10px; border: 0;
    border-bottom: 1px solid #e9ebee; scroll-margin-top: 92px; position: relative;
}
.wiki-article h3 {
    font-size: 16.5px; line-height: 1.5; font-weight: 650; color: #242a31;
    margin: 30px 0 10px; scroll-margin-top: 92px; position: relative;
}
.wiki-article h4 { font-size: 15px; font-weight: 650; color: #2f353d; margin: 22px 0 8px; }
.wiki-article p, .wiki-article li {
    font-size: 15.5px; line-height: 1.85; color: #3d4451;
}
.wiki-article p { margin: 0 0 14px; }
.wiki-article li { margin-bottom: 6px; }
.wiki-article ul, .wiki-article ol { padding-left: 22px; margin: 0 0 16px; }
.wiki-article strong { color: #1f2328; font-weight: 650; }
.wiki-article hr { border: 0; border-top: 1px solid #e9ebee; margin: 32px 0; }
.wiki-article img { max-width: 100%; border-radius: 10px; }

/* 标题锚点 */
.docs-anchor {
    margin-left: 8px; font-size: .7em; font-weight: 400;
    color: #b6bcc4 !important; text-decoration: none; border: 0 !important;
    opacity: 0; transition: opacity .15s ease;
}
.wiki-article h2:hover .docs-anchor,
.wiki-article h3:hover .docs-anchor,
.docs-anchor:focus { opacity: 1; }

/* ---- 行内代码 / 代码块 ---- */
.wiki-article code {
    background: #f2f4f6; color: #1f2328; border: 1px solid #e7e9ec;
    padding: 1px 6px; border-radius: 5px; font-size: 13px;
    font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
}
.docs-pre { position: relative; margin: 16px 0; }
.wiki-article pre {
    background: #f7f9fa; border: 1px solid #e7e9ec; border-radius: 10px;
    padding: 16px 18px; margin: 0; overflow-x: auto;
    font-size: 13px; line-height: 1.7;
}
.wiki-article pre code { background: none; border: 0; padding: 0; font-size: 13px; }
.docs-copy {
    position: absolute; top: 8px; right: 8px;
    padding: 4px 10px; font-size: 12px; font-family: inherit;
    color: #5b6470; background: #fff; border: 1px solid #e0e3e7;
    border-radius: 6px; cursor: pointer; opacity: 0;
    transition: opacity .15s, color .15s, border-color .15s;
}
.docs-pre:hover .docs-copy { opacity: 1; }
.docs-copy:hover { color: #2c6b39; border-color: #bcd9c2; }
.docs-copy.done { color: #2c6b39; border-color: #bcd9c2; opacity: 1; }

/* ---- 提示块 ---- */
.wiki-custom-block {
    margin: 20px 0; padding: 14px 18px; border-radius: 10px;
    border: 1px solid #e7e9ec; border-left: 3px solid #94a3b8;
    background: #fafbfc; font-size: 15px; line-height: 1.8; color: #3d4451;
}
.wiki-custom-block p:last-child, .wiki-custom-block ul:last-child { margin-bottom: 0; }
.wiki-custom-block.tip {
    border-left-color: #3f9c5a; border-color: #dbeee2;
    background: #f3faf5; color: #245b33;
}
.wiki-custom-block.tip strong { color: #1d4a29; }
.wiki-custom-block.warning {
    border-left-color: #d98510; border-color: #f6e6cb;
    background: #fff9f0; color: #7c4a03;
}
.wiki-custom-block.warning strong { color: #643a02; }

/* ---- 上一篇 / 下一篇 ---- */
.docs-pager {
    display: flex; gap: 14px; align-items: stretch;
    margin: 60px 0 10px; padding-top: 26px; border-top: 1px solid #e9ebee;
}
.docs-pager-link {
    flex: 1 1 0; display: flex; flex-direction: column; gap: 5px;
    padding: 13px 16px; border: 1px solid #e4e7ea; border-radius: 10px;
    text-decoration: none !important; background: #fff;
    transition: border-color .18s, background .18s, transform .18s;
}
.docs-pager-link:hover {
    border-color: #9fcda8; background: #f7fbf8; transform: translateY(-1px);
}
.docs-pager-link .k { font-size: 11.5px; color: #9aa3ad; letter-spacing: .05em; }
.docs-pager-link .t { font-size: 14px; font-weight: 600; color: #2c6b39; }
.docs-pager-link.next { text-align: right; align-items: flex-end; margin-left: auto; }

/* ---- 手机端：只调排版，不动抽屉 ---- */
@media (max-width: 768px) {
    .wiki-article h1 { font-size: 24px; }
    .wiki-article h2 { font-size: 18px; margin-top: 34px; }
    .wiki-article h3 { font-size: 15.5px; margin-top: 24px; }
    .wiki-lead { font-size: 15px; margin-bottom: 22px; }
    .wiki-article p, .wiki-article li { font-size: 15px; line-height: 1.8; }
    .docs-pager { flex-direction: column; margin-top: 40px; }
    .docs-pager-link.next { text-align: left; align-items: flex-start; }
    .docs-copy { opacity: 1; }
}

/* ---- 侧栏控件 & 表格：对齐文档站观感 ---- */
@media (min-width: 769px) {
    .wiki-sidebar > div:first-of-type {
        font-size: 11.5px !important; font-weight: 700 !important;
        letter-spacing: .09em; color: #9aa3ad !important;
        padding: 6px 10px 10px !important;
    }
    .wiki-search-wrap { padding: 0 10px 8px; border-bottom: 0; }
    #wikiSearch {
        width: 100%; padding: 7px 11px; font-size: 13px;
        border: 1px solid #e4e7ea; border-radius: 8px; background: #f7f8f9;
        color: #1f2328; box-sizing: border-box; transition: .16s;
    }
    #wikiSearch:focus { border-color: #9fcda8; background: #fff; outline: none; box-shadow: 0 0 0 3px rgba(93,165,82,.1); }
    .wiki-toggle-all { display: flex; gap: 6px; padding: 8px 10px 12px; }
    .wiki-toggle-all button {
        flex: 1; padding: 5px 0; font-size: 12px; font-family: inherit;
        color: #6b7280; background: #fff; border: 1px solid #e4e7ea;
        border-radius: 7px; cursor: pointer; transition: .16s;
    }
    .wiki-toggle-all button:hover { color: #2c6b39; border-color: #bcd9c2; background: #f7fbf8; }
}

.wiki-breadcrumb { font-size: 12.5px; color: #9aa3ad; margin-bottom: 14px; }
.wiki-breadcrumb a { color: #6b7280; text-decoration: none; }
.wiki-breadcrumb a:hover { color: #2c6b39; }

/* 表格：中性表头 + 细边框，不再用大面积渐变 */
.wiki-doc-table {
    width: 100%; border-collapse: separate; border-spacing: 0;
    border: 1px solid #e7e9ec; border-radius: 10px; overflow: hidden;
    margin: 18px 0; font-size: 14px; background: #fff;
    box-shadow: none;
}
.wiki-doc-table th, .wiki-doc-table.dl-table th {
    background: #f6f8fa; color: #46505c; font-weight: 650;
    font-size: 12.5px; letter-spacing: .02em; text-align: left;
    padding: 10px 12px; border-bottom: 1px solid #e7e9ec; white-space: nowrap;
}
.wiki-doc-table td, .wiki-doc-table.dl-table td {
    padding: 10px 12px; border-bottom: 1px solid #f0f2f4;
    color: #3d4451; font-size: 13.5px; vertical-align: middle;
}
.wiki-doc-table tbody tr:last-child td, .wiki-doc-table.dl-table tbody tr:last-child td { border-bottom: 0; }
.wiki-doc-table tbody tr:nth-child(even) td,
.wiki-doc-table.dl-table tbody tr:nth-child(even) td { background: #fbfcfc; }
.wiki-doc-table tbody tr:hover td,
.wiki-doc-table.dl-table tbody tr:hover td { background: #f4f9f5; }
.wiki-doc-table.dl-table td:first-child { color: #2c6b39; font-weight: 650; }
.wiki-doc-table.dl-table td.dl-file a { color: #2f7d43; font-weight: 600; }
.wiki-doc-table.dl-table td.dl-count { color: #2f7d43; }

/* 信息行（开服时间/配置…）：更轻的卡面 */
.wiki-info-row {
    border: 1px solid #e7e9ec; background: #fafbfc;
    border-radius: 10px; padding: 14px 16px; gap: 14px 24px;
}
.wiki-info-row > div { display: flex; flex-direction: column; gap: 3px; min-width: 120px; }
.wiki-info-row span { font-size: 11.5px; color: #9aa3ad; letter-spacing: .03em; }
.wiki-info-row strong { font-size: 13.5px; color: #1f2328; font-weight: 600; }
