/* ============================================================
   进度猫用户手册 · 独立样式表（homepage/manual）
   自包含：不依赖站点任何其他样式；类名统一 jm- 前缀，避免污染
   ============================================================ */

/* Bootstrap Glyphicon 字体（本目录自带，保持手册资源自包含） */
@font-face {
    font-family: 'Glyphicons Halflings';
    src: url('fonts/glyphicons-halflings-regular.woff') format('woff'),
         url('fonts/glyphicons-halflings-regular.ttf')  format('truetype');
    font-weight: normal;
    font-style: normal;
}
.jm-gly {
    position: relative; top: 1px;
    display: inline-block;
    font-family: 'Glyphicons Halflings';
    font-style: normal; font-weight: 400; line-height: 1;
    -webkit-font-smoothing: antialiased;
}
.jm-gly.play-circle::before  { content: "\e130"; }
.jm-gly.folder-open::before  { content: "\e118"; }
.jm-gly.check::before        { content: "\e067"; }
.jm-gly.align-left::before   { content: "\e052"; }
.jm-gly.book::before         { content: "\e043"; }
.jm-gly.bell::before         { content: "\e123"; }
.jm-gly.flash::before        { content: "\e162"; }
.jm-gly.user::before         { content: "\e008"; }
.jm-gly.question-sign::before{ content: "\e085"; }

.jm-body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    color: #24292f;
    background: #fff;
    font-size: 15.5px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
.jm-body *, .jm-body *::before, .jm-body *::after { box-sizing: border-box; }
.jm-body a { color: #3b66f5; text-decoration: none; }
.jm-body a:hover { text-decoration: underline; }

/* ---------- 顶栏 ---------- */
.jm-header {
    position: sticky; top: 0; z-index: 50;
    height: 60px; background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid #e8ecf2;
}
.jm-header-inner {
    max-width: 1440px; margin: 0 auto; padding: 0 24px;
    height: 100%; display: flex; align-items: center; justify-content: space-between;
}
.jm-brand { display: flex; align-items: center; gap: 7px; text-decoration: none !important; }
.jm-brand-logo { height: 32px; width: auto; display: block; }
.jm-brand-text { font-size: 16px; font-weight: 700; color: #1f2328; }
.jm-brand-text em { font-style: normal; font-weight: 500; color: #8b949e; margin-left: 6px; font-size: 13px; }
.jm-header-nav { display: flex; align-items: center; gap: 18px; }
.jm-header-nav > a { font-size: 14px; color: #57606a; }
.jm-header-nav > a:hover { color: #1f2328; text-decoration: none; }
.jm-btn-primary {
    display: inline-block; padding: 7px 16px; border-radius: 8px;
    background: #527afe; color: #fff !important; font-size: 14px; font-weight: 500;
    box-shadow: 0 2px 6px rgba(82, 122, 254, .3); transition: background .15s;
}
.jm-btn-primary:hover { background: #4066f0; text-decoration: none !important; }

/* ---------- 布局 ---------- */
.jm-layout { max-width: 1440px; margin: 0 auto; padding: 0 24px; display: flex; align-items: flex-start; }

/* 侧栏目录树 */
.jm-sidebar {
    width: 272px; flex: 0 0 272px;
    position: sticky; top: 60px;
    height: calc(100vh - 60px); overflow-y: auto;
    padding: 24px 12px 48px 0;
    border-right: 1px solid #eef1f5;
    scrollbar-width: thin; scrollbar-color: #d8dee6 transparent;
}
.jm-sidebar::-webkit-scrollbar { width: 5px; }
.jm-sidebar::-webkit-scrollbar-thumb { background: #d8dee6; border-radius: 4px; }

.jm-search { position: relative; margin-bottom: 18px; padding-right: 12px; }
.jm-search input {
    width: 100%; padding: 8px 12px 8px 34px;
    border: 1px solid #e3e8ef; border-radius: 8px;
    background: #f7f9fc; font-size: 13.5px; color: #24292f;
    outline: none; transition: border-color .15s, background .15s;
    font-family: inherit;
}
.jm-search input:focus { border-color: #527afe; background: #fff; box-shadow: 0 0 0 3px rgba(82, 122, 254, .12); }
.jm-search::before {
    content: ""; position: absolute; left: 10px; top: 50%; margin-top: -7px;
    width: 14px; height: 14px;
    background: no-repeat center/contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b949e' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cline x1='16.5' y1='16.5' x2='21' y2='21'/%3E%3C/svg%3E");
}

.jm-cate { margin-bottom: 20px; }
.jm-cate-head {
    font-size: 11.5px; font-weight: 600; color: #98a3b3;
    padding: 0 12px; margin: 18px 0 6px; letter-spacing: 1.2px;
}
.jm-doc-link {
    display: block; padding: 6px 12px 6px 34px;
    font-size: 13.5px; color: #57606a; border-radius: 7px;
    position: relative; transition: background .12s, color .12s;
}
.jm-doc-link:hover { background: #f3f6fb; color: #1f2328; text-decoration: none; }
.jm-doc-link.active {
    background: #edf2fe; color: #3b66f5; font-weight: 600;
}
.jm-doc-link.active::before {
    content: ""; position: absolute; left: 22px; top: 50%; margin-top: -7px;
    width: 3px; height: 14px; border-radius: 2px; background: #527afe;
}
/* 正文命中（标题不含关键词、内容含）：结果后追加浅色标记 */
.jm-doc-link.jm-hit-text::after {
    content: "内容"; margin-left: 6px; padding: 0 5px; border-radius: 4px;
    background: #eef4ff; color: #7d97e8; font-size: 10.5px; line-height: 15px;
    vertical-align: 1px;
}
.jm-cate.jm-hidden, .jm-doc-link.jm-hidden { display: none; }
.jm-empty-hint { font-size: 12.5px; color: #8b949e; padding: 6px 12px; display: none; }

/* ---------- 主内容 ---------- */
.jm-main { flex: 1 1 auto; min-width: 0; display: flex; align-items: flex-start; justify-content: center; }
.jm-content { width: 100%; max-width: 780px; padding: 40px 48px 96px; }

.jm-breadcrumb { font-size: 13px; color: #8b949e; margin-bottom: 10px; }
.jm-breadcrumb span { color: #24292f; font-weight: 500; }

.jm-content > h1 {
    font-size: 34px; line-height: 1.3; font-weight: 700;
    margin: 0 0 8px; letter-spacing: -.5px; color: #131720;
}
.jm-updated { font-size: 12.5px; color: #8b949e; margin-bottom: 28px; }
.jm-updated time { color: #57606a; }

.jm-article > *:first-child { margin-top: 0; }
.jm-article p { margin: 0 0 16px; }
.jm-article .jm-lead { font-size: 17px; color: #4a5158; line-height: 1.8; margin-bottom: 26px; }

.jm-article h2 {
    font-size: 23px; font-weight: 700; color: #131720;
    margin: 44px 0 14px; padding-top: 8px; letter-spacing: -.3px;
    scroll-margin-top: 84px;
}
.jm-article h2 .jm-anchor { margin-left: 8px; opacity: 0; font-size: .7em; font-weight: 400; text-decoration: none; transition: opacity .15s; }
.jm-article h2:hover .jm-anchor { opacity: .55; }
.jm-article h3 { font-size: 17.5px; font-weight: 600; color: #1f2328; margin: 30px 0 10px; scroll-margin-top: 84px; }
.jm-article ul, .jm-article ol { margin: 0 0 16px; padding-left: 24px; }
.jm-article li { margin: 5px 0; }
.jm-article li::marker { color: #527afe; font-weight: 600; }
.jm-article strong { color: #131720; }
.jm-article img { max-width: 100%; }
.jm-article hr { border: 0; border-top: 1px solid #eef1f5; margin: 36px 0; }

/* 步骤列表 */
.jm-steps { list-style: none; padding: 0; margin: 0 0 20px !important; counter-reset: jmstep; }
.jm-steps > li {
    counter-increment: jmstep; position: relative;
    padding: 0 0 18px 44px; margin: 0 !important;
}
.jm-steps > li::before {
    content: counter(jmstep); position: absolute; left: 0; top: 1px;
    width: 28px; height: 28px; border-radius: 50%;
    background: #edf2fe; color: #3b66f5;
    font-size: 13.5px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.jm-steps > li::after {
    content: ""; position: absolute; left: 13.5px; top: 32px; bottom: 2px;
    width: 1.5px; background: #e3e9f5;
}
.jm-steps > li:last-child::after { display: none; }

/* 提示框 */
.jm-callout {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 14px 16px; border-radius: 10px;
    margin: 0 0 18px; font-size: 14px; line-height: 1.7;
}
.jm-callout .jm-callout-icon { font-size: 16px; line-height: 1.6; flex: 0 0 auto; }
.jm-callout p { margin: 0 0 6px; }
.jm-callout p:last-child { margin-bottom: 0; }
.jm-callout-tip  { background: #f0f7ff; border: 1px solid #d4e4fd; color: #2c5cae; }
.jm-callout-note { background: #f6f8fa; border: 1px solid #e3e8ef; color: #4a5158; }
.jm-callout-warn { background: #fff8eb; border: 1px solid #f5e3b3; color: #8a6116; }

/* 截图 */
.jm-figure { margin: 24px 0 28px; }
.jm-figure a { display: block; }
.jm-figure img {
    display: block; width: 100%;
    border: 1px solid #e5e9f0; border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -12px rgba(16, 24, 40, .14);
    transition: box-shadow .2s, transform .2s;
}
.jm-figure a:hover img { box-shadow: 0 2px 4px rgba(16, 24, 40, .06), 0 14px 32px -12px rgba(16, 24, 40, .22); transform: translateY(-1px); }
.jm-figure figcaption {
    text-align: center; font-size: 13px; color: #8b949e; margin-top: 10px;
}

/* 表格 */
.jm-article table {
    width: 100%; border-collapse: collapse; margin: 0 0 20px;
    font-size: 14px; display: block; overflow-x: auto;
}
.jm-article th, .jm-article td { border: 1px solid #e8ecf2; padding: 9px 13px; text-align: left; vertical-align: top; }
.jm-article th { background: #f7f9fc; font-weight: 600; color: #1f2328; white-space: nowrap; }
.jm-article tr:nth-child(even) td { background: #fbfcfe; }

/* 界面元素指示（按钮/菜单/标签的行内模拟） */
.jm-ui {
    display: inline-block; padding: 1px 9px; margin: 0 2px;
    border: 1px solid #d5dce7; border-radius: 6px; background: #f7f9fc;
    font-size: .88em; color: #3b66f5; white-space: nowrap;
    box-shadow: 0 1px 0 #e3e8ef;
}
.jm-kbd {
    display: inline-block; padding: 1px 7px; margin: 0 2px;
    border: 1px solid #d0d7e0; border-bottom-width: 2.5px; border-radius: 6px;
    background: #f6f8fa; font-size: .85em; font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    color: #24292f; white-space: nowrap;
}

/* 代码 */
.jm-article code {
    font-family: ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, monospace;
    font-size: .88em; background: #f2f5f9; color: #c7254e;
    padding: 2px 6px; border-radius: 5px;
}

/* 上下篇 */
.jm-pager { display: flex; gap: 16px; margin-top: 48px; padding-top: 28px; border-top: 1px solid #eef1f5; }
.jm-pager a {
    flex: 1 1 0; padding: 16px 18px; border: 1px solid #e5e9f0; border-radius: 12px;
    text-decoration: none !important; transition: border-color .15s, box-shadow .15s;
    min-width: 0;
}
.jm-pager a:hover { border-color: #b9c8f5; box-shadow: 0 4px 16px -8px rgba(82, 122, 254, .25); }
.jm-pager .jm-pager-label { display: block; font-size: 12px; color: #8b949e; margin-bottom: 4px; }
.jm-pager .jm-pager-title { display: block; font-size: 14.5px; font-weight: 600; color: #24292f; }
.jm-pager .jm-pager-next { text-align: right; }

/* 右侧本页目录 */
.jm-toc {
    width: 188px; flex: 0 0 188px;
    position: sticky; top: 60px;
    max-height: calc(100vh - 90px); overflow-y: auto;
    padding: 48px 0 24px 20px;
    font-size: 13px; scrollbar-width: none;
}
.jm-toc::-webkit-scrollbar { display: none; }
.jm-toc-title { font-size: 12px; font-weight: 600; color: #8b949e; letter-spacing: .8px; margin-bottom: 10px; }
.jm-toc a { display: block; padding: 4px 0 4px 12px; color: #57606a; border-left: 2px solid #eef1f5; line-height: 1.5; }
.jm-toc a:hover { color: #3b66f5; text-decoration: none; }
.jm-toc a.jm-toc-active { color: #3b66f5; border-left-color: #527afe; font-weight: 600; }
@media (max-width: 1279px) { .jm-toc { display: none; } }

/* 截图占位（待补图）：虚线框 + 说明，替换为真实 <img> 后样式自动回归普通 figure */
.jm-figure-todo .jm-figure-todo-box {
    display: flex; align-items: center; gap: 14px;
    padding: 22px 24px;
    border: 1.5px dashed #b9c8f5; border-radius: 12px;
    background: repeating-linear-gradient(-45deg, #f8faff, #f8faff 12px, #f2f6ff 12px, #f2f6ff 24px);
}
.jm-figure-todo .jm-figure-todo-icon {
    font-size: 26px; flex: 0 0 auto;
    filter: grayscale(.15);
}
.jm-figure-todo .jm-figure-todo-text { font-size: 13.5px; color: #57606a; line-height: 1.8; }
.jm-figure-todo .jm-figure-todo-text strong { color: #3b66f5; }
.jm-figure-todo figcaption { color: #98a3b3; }

/* 视频嵌入（B 站等 iframe）：16:9 自适应，与截图同款外框 */
.jm-video { margin: 24px 0 28px; }
.jm-video iframe {
    display: block; width: 100%; aspect-ratio: 16 / 9;
    border: 1px solid #e5e9f0; border-radius: 12px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px -12px rgba(16, 24, 40, .14);
}
.jm-video figcaption { text-align: center; font-size: 13px; color: #8b949e; margin-top: 10px; }

/* ---------- 封面 ---------- */
.jm-cover { max-width: 860px; margin: 0 auto; padding: 72px 24px 96px; }
.jm-cover-eyebrow {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; font-weight: 600; color: #3b66f5;
    background: #edf2fe; border-radius: 999px; padding: 4px 14px; margin-bottom: 22px;
}
.jm-cover h1 { font-size: 44px; line-height: 1.25; font-weight: 800; margin: 0 0 16px; letter-spacing: -1px; color: #0f1522; }
.jm-cover-sub { font-size: 17px; color: #57606a; margin: 0 0 36px; max-width: 620px; line-height: 1.8; }
.jm-cate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 44px; }
.jm-cate-card {
    display: block; padding: 22px 24px; border: 1px solid #e5e9f0; border-radius: 14px;
    text-decoration: none !important; transition: border-color .15s, box-shadow .15s, transform .15s;
    background: #fff;
}
.jm-cate-card:hover { border-color: #b9c8f5; box-shadow: 0 8px 24px -10px rgba(82, 122, 254, .25); transform: translateY(-2px); }
/* 封面分类卡图标：色块徽章式（Linear/Vercel 卡片范式），侧栏不使用图标 */
.jm-cate-card-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; border-radius: 10px;
    background: #eef3ff; margin-bottom: 12px;
}
.jm-cate-card-icon .jm-gly { font-size: 18px; color: #3b66f5; }
.jm-cate-card-name { font-size: 16.5px; font-weight: 700; color: #131720; margin-bottom: 4px; display: block; }
.jm-cate-card-docs { font-size: 13px; color: #8b949e; line-height: 1.7; }
@media (max-width: 720px) { .jm-cate-grid { grid-template-columns: 1fr; } .jm-cover h1 { font-size: 34px; } }

/* ---------- 灯箱 ---------- */
.jm-lightbox {
    position: fixed; inset: 0; z-index: 200; display: none;
    align-items: center; justify-content: center;
    background: rgba(9, 14, 22, .82); cursor: zoom-out; padding: 32px;
}
.jm-lightbox.jm-open { display: flex; }
.jm-lightbox img { max-width: 94vw; max-height: 92vh; border-radius: 8px; box-shadow: 0 24px 80px rgba(0, 0, 0, .5); }

/* ---------- 移动端 ---------- */
.jm-menu-toggle {
    display: none; position: fixed; left: 14px; bottom: 22px; z-index: 120;
    width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
    background: #527afe; color: #fff; font-size: 19px;
    box-shadow: 0 6px 18px rgba(82, 122, 254, .45);
}
.jm-backdrop { display: none; }
@media (max-width: 1023px) {
    .jm-menu-toggle { display: block; }
    .jm-sidebar {
        position: fixed; left: 0; top: 60px; z-index: 110;
        background: #fff; width: 290px; flex-basis: 290px;
        transform: translateX(-102%); transition: transform .22s ease;
        box-shadow: 8px 0 32px rgba(16, 24, 40, .12);
        padding-left: 14px;
    }
    .jm-sidebar.jm-open { transform: translateX(0); }
    .jm-backdrop {
        display: block; position: fixed; inset: 60px 0 0 0; z-index: 100;
        background: rgba(9, 14, 22, .4); opacity: 0; pointer-events: none; transition: opacity .2s;
    }
    .jm-backdrop.jm-open { opacity: 1; pointer-events: auto; }
    .jm-content { padding: 32px 20px 80px; }
    .jm-content > h1 { font-size: 27px; }
    .jm-article h2 { font-size: 20px; }
    .jm-pager { flex-direction: column; }
}

/* ---------- 打印 ---------- */
@media print {
    .jm-header, .jm-sidebar, .jm-toc, .jm-menu-toggle, .jm-backdrop, .jm-pager { display: none !important; }
    .jm-content { max-width: none; padding: 0; }
    .jm-figure img { box-shadow: none; }
}
