/* Python 100 天 · 在线教程工具 —— /tools/py100
   纯前端，主题变量放 :root（浮层挂在 body 下，不能只定义在 .p100 上）。 */
:root {
    --p100-bg: #0f141b;
    --p100-card: #171e28;
    --p100-card-2: #1d2632;
    --p100-line: #2b3745;
    --p100-line-2: #38465a;
    --p100-fg: #e7edf4;
    --p100-sub: #9dabba;
    --p100-faint: #8493a3;
    --p100-accent: #5aa2ff;
    --p100-accent-2: #2f6fd0;
    --p100-accent-soft: rgba(90, 162, 255, .14);
    --p100-ok: #4ac26b;
    --p100-warn: #e5a50b;
    --p100-err: #f2635c;
    --p100-shadow: 0 10px 30px rgba(0, 0, 0, .30);
    --p100-shadow-sm: 0 2px 10px rgba(0, 0, 0, .18);
    --p100-shadow-md: 0 8px 24px rgba(0, 0, 0, .26);
    --p100-r: 14px;
    --p100-r-sm: 9px;
    --p100-zebra: rgba(127, 127, 127, .06);
    /* 语义柔和底：判定色随主题走，不再在组件里硬编码 rgba */
    --p100-ok-soft: rgba(74, 194, 107, .14);
    --p100-warn-soft: rgba(229, 165, 11, .14);
    --p100-err-soft: rgba(242, 99, 92, .14);
    --p100-on-accent: #ffffff;
    /* 版式尺度：吸顶页签实测高 / 锚点偏移（电脑端满屏，不做版心限宽） */
    --p100-tabs-h: 51px;
    --p100-anchor-offset: 132px;
}
[data-theme="light"] {
    --p100-bg: #f6f8fb;
    --p100-card: #ffffff;
    --p100-card-2: #f1f5fa;
    --p100-line: #e0e7ef;
    --p100-line-2: #c9d5e2;
    --p100-fg: #1b2430;
    --p100-sub: #5c6a7a;
    --p100-faint: #64748b;
    --p100-accent: #136ce9;
    --p100-accent-2: #0d54bb;
    --p100-accent-soft: rgba(19, 108, 233, .10);
    --p100-ok: #1a7f37;
    --p100-warn: #9a6700;
    --p100-err: #c5362c;
    --p100-shadow: 0 10px 30px rgba(20, 40, 70, .10);
    --p100-shadow-sm: 0 2px 10px rgba(20, 40, 70, .07);
    --p100-shadow-md: 0 8px 24px rgba(20, 40, 70, .13);
    --p100-zebra: rgba(15, 20, 25, .038);
    --p100-ok-soft: rgba(26, 127, 55, .10);
    --p100-warn-soft: rgba(154, 103, 0, .10);
    --p100-err-soft: rgba(197, 54, 44, .09);
    --p100-on-accent: #ffffff;
}
/* 满屏（保留左侧导航）+ 把滚动权交还 html，否则站点 body{overflow-y:scroll} 会让页内 sticky 失效 */
body.page-py100-full { overflow: visible; }
/* 笔记抽屉打开时锁住背景滚动（放在 overflow:visible 之后才能覆盖） */
body.page-py100-full.p100-note-open { overflow: hidden; }
body.page-py100-full .app,
body.page-py100-full .main-content,
body.page-py100-full .page-container { max-width: 100%; width: 100%; }
/* ★站点 style.css 在 <=700px 给 .main-content 写了 overflow-x:hidden，
   CSS 规范会把配对的 overflow-y:visible 计算成 auto，使 .main-content 成为
   滚动容器 → 本页所有 position:sticky（页签 / 阅读工具条 / 侧栏）全部失效。
   这里显式还原 visible，把滚动权交还 html（html 自带 overflow-x:hidden 兜底）。 */
body.page-py100-full .main-content { border-right: 0; min-width: 0; overflow: visible; }
.p100, .p100 * { box-sizing: border-box; }
.p100 [hidden], .p100-pane[hidden], .p100-mask[hidden], .p100-toast[hidden],
.p100-drawer [hidden], .p100-code.is-folded pre { display: none !important; }
.p100 {
    max-width: 100%; margin: 0;
    padding: clamp(18px, 1.6vw, 26px) clamp(14px, 2.2vw, 34px) calc(56px + env(safe-area-inset-bottom, 0px));
    color: var(--p100-fg); font-size: 14px; line-height: 1.65;
}
.p100 button, .p100 input, .p100 select, .p100 textarea { font-family: inherit; }
.p100 button { cursor: pointer; }
.p100 a { color: var(--p100-accent); }
.p100 :focus-visible { outline: 2px solid var(--p100-accent); outline-offset: 2px; }
.p100-read > *, .p100-grid > *, .p100-me-grid > *, .p100-tools > *, .p100-hero > * { min-width: 0; }
.p100 h2, .p100 h3, .p100 p { margin-top: 0; }
.p100-loading { padding: 32px; text-align: center; color: var(--p100-sub); }
.p100-empty { padding: 34px 18px; text-align: center; color: var(--p100-sub); background: var(--p100-card); border: 1px dashed var(--p100-line-2); border-radius: var(--p100-r); }
.p100-hint { color: var(--p100-sub); font-size: 13px; margin: 10px 0 16px; line-height: 1.75; max-width: 92ch; }
.p100-count { color: var(--p100-sub); font-size: 12.5px; margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.p100-sec-t { font-size: 17px; margin: 26px 0 13px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; }
.p100-sec-t small { font-size: 12px; color: var(--p100-faint); font-weight: 400; }
/* 长列表内部滚动统一细滚动条 + 滚动不冒泡到整页 */
.p100-side::-webkit-scrollbar, .p100-toc::-webkit-scrollbar, .p100-me-list::-webkit-scrollbar,
.p100-code pre::-webkit-scrollbar, .p100-table-wrap::-webkit-scrollbar,
.p100-ref-code::-webkit-scrollbar, .p100-tools::-webkit-scrollbar { width: 9px; height: 9px; }
.p100-side::-webkit-scrollbar-thumb, .p100-toc::-webkit-scrollbar-thumb,
.p100-me-list::-webkit-scrollbar-thumb, .p100-code pre::-webkit-scrollbar-thumb,
.p100-table-wrap::-webkit-scrollbar-thumb, .p100-ref-code::-webkit-scrollbar-thumb {
    border-radius: 9px; background: var(--p100-line-2); }
.p100-me-list, .p100-code pre, .p100-table-wrap, .p100-ref-code { overscroll-behavior: contain; }

/* ---------- hero ---------- */
.p100-hero {
    display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap;
    padding: 22px 26px; border-radius: 18px; border: 1px solid var(--p100-line);
    background: var(--p100-card); background-image: linear-gradient(120deg, var(--p100-accent-soft), transparent 62%);
    box-shadow: var(--p100-shadow-sm); margin-bottom: 16px;
}
.p100-hero-l { display: flex; align-items: center; gap: 18px; flex: 1 1 480px; }
.p100-hero-ic { font-size: 38px; width: 66px; height: 66px; flex: 0 0 66px; display: grid; place-items: center;
    border-radius: 18px; background: var(--p100-accent-soft); border: 1px solid var(--p100-line); }
.p100-hero-t h1 { font-size: clamp(20px, 1.55vw + 10px, 28px); margin: 0 0 7px; letter-spacing: .2px; line-height: 1.35; }
.p100-hero-t p { color: var(--p100-sub); margin: 0 0 11px; max-width: 76ch; font-size: 13.5px; line-height: 1.75; }
.p100-hero-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.p100-hero-tags span { font-size: 11.5px; color: var(--p100-sub); border: 1px solid var(--p100-line);
    background: var(--p100-card-2); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.p100-hero-r { display: flex; gap: 8px; flex: 0 0 auto; }

/* ---------- 通用控件 ---------- */
.p100-btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 38px;
    padding: 7px 13px; border-radius: var(--p100-r-sm); border: 1px solid var(--p100-line-2);
    background: var(--p100-card-2); color: var(--p100-fg); font-size: 13px; text-decoration: none; white-space: nowrap; }
.p100-btn { transition: border-color .15s ease, color .15s ease, background-color .15s ease, box-shadow .15s ease; }
.p100-btn:hover { border-color: var(--p100-accent); color: var(--p100-accent); background: var(--p100-accent-soft); }
.p100-btn.pri { background: var(--p100-accent-2); border-color: var(--p100-accent-2); color: var(--p100-on-accent); }
.p100-btn.pri:hover { background: var(--p100-accent); border-color: var(--p100-accent); color: var(--p100-on-accent); box-shadow: var(--p100-shadow-sm); }
.p100-btn.sm { min-height: 32px; padding: 5px 10px; font-size: 12.5px; }
.p100-btn.xs { min-height: 27px; padding: 3px 9px; font-size: 11.5px; }
.p100-btn.danger { color: var(--p100-err); border-color: var(--p100-err); }
.p100-btn.danger:hover { background: var(--p100-err-soft); border-color: var(--p100-err); color: var(--p100-err); }
.p100-btn.is-ok, .p100-btn.is-on { color: var(--p100-ok); border-color: var(--p100-ok); }
.p100-btn.is-ok:hover, .p100-btn.is-on:hover { background: var(--p100-ok-soft); color: var(--p100-ok); border-color: var(--p100-ok); }
.p100-btn:disabled { opacity: .45; cursor: not-allowed; }
.p100-icon-btn { min-width: 32px; min-height: 32px; border-radius: 8px; border: 1px solid var(--p100-line);
    background: var(--p100-card-2); color: var(--p100-sub); font-size: 16px; line-height: 1; }
.p100-icon-btn.is-on { color: var(--p100-warn); border-color: var(--p100-warn); }
.p100-select, .p100 input[type="date"], .p100 input[type="search"], .p100 textarea {
    background: var(--p100-card); color: var(--p100-fg); border: 1px solid var(--p100-line-2);
    border-radius: var(--p100-r-sm); min-height: 38px; padding: 6px 10px; font-size: 13px; }
.p100-select:focus, .p100 input:focus, .p100 textarea:focus { outline: none; border-color: var(--p100-accent); box-shadow: 0 0 0 3px var(--p100-accent-soft); }
.p100 input[type="search"]::-webkit-search-cancel-button { display: none; }
.p100-search { position: relative; flex: 1 1 260px; min-width: 180px; }
.p100-search > span { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 13px; opacity: .7; pointer-events: none; }
.p100-search input { width: 100%; padding-left: 32px; }
.p100-search.big { flex: 1 1 360px; }
.p100-tools { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-bottom: 12px; }
.p100-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 8px; }
.p100-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 5px 11px;
    border: 1px solid var(--p100-line); border-radius: 999px; background: var(--p100-card);
    color: var(--p100-sub); font-size: 12.5px; }
.p100-chip i { font-style: normal; font-size: 11px; color: var(--p100-faint); }
.p100-chip:hover { border-color: var(--p100-accent); }
.p100-chip.is-on { background: var(--p100-accent-soft); border-color: var(--p100-accent); color: var(--p100-accent); }
.p100-badge { font-size: 11px; color: var(--p100-sub); border: 1px solid var(--p100-line);
    background: var(--p100-card-2); padding: 2px 7px; border-radius: 6px; white-space: nowrap; }
.p100-badge.warn { color: var(--p100-warn); border-color: var(--p100-warn); }

/* ---------- 统计 ---------- */
.p100-stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0;
    border: 1px solid var(--p100-line); border-radius: var(--p100-r); overflow: hidden;
    background: var(--p100-card); margin-bottom: 16px; box-shadow: var(--p100-shadow-sm); }
.p100-stat { padding: 13px 18px; border-left: 1px solid var(--p100-line); display: flex; flex-direction: column; gap: 3px; }
.p100-stat:first-child { border-left: 0; }
/* 语义分色：起点用品牌色、只看自己的进度用成功色，其余客观数字保持中性，避免彩虹数字 */
.p100-stat b { font-size: 22px; line-height: 1.2; color: var(--p100-fg); font-variant-numeric: tabular-nums; letter-spacing: .2px; }
/* 选择器必须带 .p100-stat b 前缀，否则会被上面的 (0,1,1) 规则盖掉 */
.p100-stat b.p100-stat-0 { color: var(--p100-accent); }
.p100-stat b.p100-stat-5 { color: var(--p100-ok); }
.p100-stat em { font-style: normal; font-size: 12px; color: var(--p100-sub); }

/* ---------- 页签 ---------- */
.p100-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; position: sticky; top: 0; z-index: 30;
    background: var(--p100-bg); border-bottom: 1px solid var(--p100-line); margin-bottom: 18px; padding: 5px 0;
    scroll-snap-type: x proximity; overscroll-behavior-x: contain; }
.p100-tabs::-webkit-scrollbar { display: none; }
.p100-tab { flex: 0 0 auto; min-height: 40px; padding: 8px 15px; border: 0; border-bottom: 2px solid transparent;
    background: transparent; color: var(--p100-sub); font-size: 13.5px; white-space: nowrap; scroll-snap-align: start;
    transition: color .15s ease, background-color .15s ease; }
.p100-tab:hover { color: var(--p100-accent); background: var(--p100-accent-soft); }
.p100-tab.is-on { color: var(--p100-accent); border-bottom-color: var(--p100-accent); font-weight: 600; }
.p100-err { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin-bottom: 14px;
    border: 1px solid var(--p100-err); border-radius: var(--p100-r-sm); color: var(--p100-err); background: var(--p100-card); }

/* ---------- 阶段卡 / 每日卡 ---------- */
.p100-stage-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 12px; }
.p100-stage-card { text-align: left; display: flex; flex-direction: column; gap: 8px; padding: 15px 16px;
    border: 1px solid var(--p100-line); border-radius: var(--p100-r); background: var(--p100-card); color: var(--p100-fg);
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.p100-stage-card:hover { border-color: var(--p100-accent); box-shadow: var(--p100-shadow-md); transform: translateY(-1px); }
.p100-stage-card.is-on { border-color: var(--p100-accent); box-shadow: var(--p100-shadow-sm); }
.p100-stage-card.is-on .p100-stage-name { color: var(--p100-accent); }
.p100-stage-h { display: flex; align-items: center; gap: 8px; }
.p100-stage-ic { font-size: 20px; }
.p100-stage-name { font-size: 14px; font-weight: 650; flex: 1 1 auto; }
.p100-stage-card p { color: var(--p100-sub); font-size: 12px; line-height: 1.65; margin: 0; min-height: 40px; }
.p100-stage-bar { height: 5px; border-radius: 5px; background: var(--p100-card-2); overflow: hidden; }
.p100-stage-bar i { display: block; height: 100%; background: var(--p100-ok); }
.p100-stage-f { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--p100-faint); }
.p100-stage-f b { color: var(--p100-sub); font-weight: 500; }
.p100-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(286px, 1fr)); gap: 12px; }
.p100-card { display: flex; flex-direction: column; gap: 8px; padding: 15px; border: 1px solid var(--p100-line);
    border-radius: var(--p100-r); background: var(--p100-card); min-width: 0; contain: layout style;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.p100-card:hover { border-color: var(--p100-accent); box-shadow: var(--p100-shadow-md); transform: translateY(-1px); }
.p100-card.is-cur { border-color: var(--p100-accent); box-shadow: inset 3px 0 0 var(--p100-accent); }
.p100-card.is-done { background: linear-gradient(180deg, var(--p100-accent-soft), transparent 46%), var(--p100-card); }
.p100-card-h { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.p100-day { font-size: 11px; font-weight: 700; color: var(--p100-accent); background: var(--p100-accent-soft);
    padding: 2px 8px; border-radius: 6px; }
.p100-card-stage { font-size: 11px; color: var(--p100-faint); }
.p100-card-t { margin: 0; font-size: 15.5px; line-height: 1.45; text-wrap: pretty; }
.p100-card-t button { border: 0; background: none; padding: 0; color: var(--p100-fg); text-align: left; font-size: inherit; font-weight: 650; }
.p100-card-t button:hover { color: var(--p100-accent); }
.p100-card-sum { color: var(--p100-sub); font-size: 12px; line-height: 1.7; margin: 0; flex: 1 1 auto;
    display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.p100-card-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.p100-card-tags span { font-size: 11px; padding: 1px 7px; border-radius: 5px; background: var(--p100-card-2); color: var(--p100-sub); }
.p100-card-meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--p100-faint); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.p100-card-acts { display: flex; gap: 7px; align-items: center; margin-top: 2px; }
.p100-card-acts .p100-icon-btn { margin-left: auto; }
/* ---------- 章节阅读 ---------- */
.p100-read { display: grid; grid-template-columns: minmax(0, 258px) minmax(0, 1fr) minmax(0, 210px); gap: 16px; align-items: start; }
.p100-side, .p100-toc, .p100-article { background: var(--p100-card); border: 1px solid var(--p100-line); border-radius: var(--p100-r); min-width: 0; }
.p100-side, .p100-toc { position: sticky; top: calc(var(--p100-tabs-h) + 8px); max-height: calc(100vh - var(--p100-tabs-h) - 24px);
    overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 12px; }
.p100-side-h { font-size: 13px; font-weight: 650; margin: 2px 0 10px; }
.p100-side .p100-search { margin-bottom: 8px; }
.p100-tree-group { margin-bottom: 4px; }
.p100-tree-h { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 32px; padding: 5px 7px;
    background: var(--p100-card-2); border: 1px solid var(--p100-line); border-radius: 7px; color: var(--p100-fg); font-size: 12px; text-align: left; }
.p100-tree-h i { margin-left: auto; font-style: normal; color: var(--p100-faint); }
.p100-tree-caret { color: var(--p100-accent); }
.p100-tree-docs { padding: 4px 0 6px; }
.p100-tree-doc { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 29px; padding: 4px 6px;
    background: none; border: 0; border-radius: 6px; color: var(--p100-sub); font-size: 11.8px; text-align: left; }
.p100-tree-doc:hover { background: var(--p100-card-2); color: var(--p100-fg); }
.p100-tree-doc.is-cur { background: var(--p100-accent-soft); color: var(--p100-accent); font-weight: 600; }
.p100-tree-day { flex: 0 0 28px; color: var(--p100-faint); font-size: 10.5px; }
.p100-tree-t { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p100-tree-ok { color: var(--p100-ok); }
.p100-article { overflow: hidden; }
.p100-read-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    position: sticky; top: var(--p100-tabs-h); z-index: 6; padding: 12px 18px;
    border-bottom: 1px solid var(--p100-line); background: var(--p100-card); }
.p100-read-t h2 { font-size: 18px; margin: 0 0 2px; }
.p100-read-t p { color: var(--p100-faint); font-size: 11.5px; margin: 0; }
.p100-read-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.p100-toc h3 { font-size: 12.5px; margin: 2px 0 8px; color: var(--p100-sub); }
.p100-toc ul { list-style: none; padding: 0; margin: 0; }
.p100-toc li a { display: block; padding: 4px 6px; color: var(--p100-sub); font-size: 11.5px; text-decoration: none;
    border-left: 2px solid transparent; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p100-toc li a:hover { color: var(--p100-accent); border-left-color: var(--p100-accent); background: var(--p100-card-2); }
.p100-toc-l2 { padding-left: 9px; }
.p100-toc-l3, .p100-toc-l4, .p100-toc-l5, .p100-toc-l6 { padding-left: 18px; }
.p100-toc-empty { color: var(--p100-faint); font-size: 12px; }
.p100-doc-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
    padding: 14px 18px; border-top: 1px solid var(--p100-line); }
.p100-doc-nav-tip { color: var(--p100-faint); font-size: 11.5px; }

/* ---------- 正文排版 ---------- */
.p100-article-body { padding: 22px clamp(16px, 2.4vw, 38px) 36px; font-size: var(--p100-fs, 16px);
    line-height: 1.9; overflow-wrap: anywhere; scroll-margin-top: var(--p100-anchor-offset); }
.p100-article-body > :first-child { margin-top: 0; }
.p100-article-body p { margin: .85em 0; text-wrap: pretty; }
.p100-article-body h1, .p100-article-body h2, .p100-article-body h3,
.p100-article-body h4, .p100-article-body h5, .p100-article-body h6 {
    line-height: 1.45; margin: 1.5em 0 .6em; scroll-margin-top: var(--p100-anchor-offset); font-weight: 700; text-wrap: balance; }
.p100-article-body h1 { font-size: 1.7em; }
.p100-article-body h2 { font-size: 1.42em; padding-bottom: .25em; border-bottom: 1px solid var(--p100-line); }
.p100-article-body h3 { font-size: 1.22em; }
.p100-article-body h4 { font-size: 1.08em; }
.p100-article-body ul, .p100-article-body ol { padding-left: 1.7em; margin: .7em 0; }
.p100-article-body li { margin: .25em 0; }
.p100-article-body blockquote { margin: 1em 0; padding: 8px 16px; border-left: 3px solid var(--p100-accent);
    background: var(--p100-accent-soft); border-radius: 0 var(--p100-r-sm) var(--p100-r-sm) 0; color: var(--p100-sub); }
.p100-article-body blockquote p { margin: .3em 0; }
.p100-article-body hr { border: 0; border-top: 1px solid var(--p100-line); margin: 1.6em 0; }
.p100-article-body img { max-width: 100%; height: auto; border-radius: 8px; background: var(--p100-card-2); }
.p100-doc-img { display: block; margin: 12px auto; }
.p100-img-fallback { display: inline-block; font-size: 12px; padding: 8px 12px; border: 1px dashed var(--p100-line-2); border-radius: 8px; }
.p100-ic { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .88em; padding: 1px 5px;
    border-radius: 5px; background: var(--p100-card-2); border: 1px solid var(--p100-line); }
.p100-hit { background: var(--p100-accent-soft); color: var(--p100-accent); border-radius: 3px; padding: 0 2px; }
.p100-table-wrap { overflow-x: auto; margin: 1.1em 0; border: 1px solid var(--p100-line); border-radius: var(--p100-r-sm); }
.p100-article-body table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: .88em; }
.p100-article-body th, .p100-article-body td { border-right: 1px solid var(--p100-line); border-bottom: 1px solid var(--p100-line);
    padding: 7px 11px; text-align: left; vertical-align: top; }
.p100-article-body th:last-child, .p100-article-body td:last-child { border-right: 0; }
.p100-article-body tr:last-child td { border-bottom: 0; }
.p100-article-body thead th { background: var(--p100-card-2); font-weight: 650; }
.p100-article-body tbody tr:nth-child(even) { background: var(--p100-zebra); }
/* ---------- 代码块（编辑器固定深色，不随主题变） ---------- */
.p100-code { margin: 1.2em 0; border: 1px solid #30363d; border-radius: var(--p100-r-sm); overflow: hidden; background: #0d1117; }
.p100-code-bar { display: flex; align-items: center; gap: 6px; padding: 5px 10px; background: #161b22; border-bottom: 1px solid #30363d; }
.p100-code-lang { color: #8b949e; font-size: 11px; margin-right: auto; text-transform: uppercase; letter-spacing: .5px; }
.p100-code-btn { min-height: 24px; padding: 2px 8px; font-size: 11px; color: #c9d1d9; background: #21262d;
    border: 1px solid #30363d; border-radius: 5px; }
.p100-code-btn:hover { border-color: #58a6ff; color: #58a6ff; }
.p100-code pre { margin: 0; padding: 12px 14px; overflow-x: auto; max-height: 560px; overflow-y: auto;
    font-size: 12.5px; line-height: 1.65; color: #d6deeb; background: #0d1117; }
.p100-code code, .p100-code pre { font-family: ui-monospace, SFMono-Regular, Consolas, "Courier New", monospace; }
.p100-t-c { color: #8b949e; }
.p100-t-s { color: #a5d6ff; }
.p100-t-k { color: #ff7b72; }
.p100-t-n { color: #79c0ff; }
.p100-t-f { color: #d2a8ff; }

/* ---------- 全文检索 ---------- */
.p100-progress { padding: 9px 14px; border-radius: 8px; background: var(--p100-accent-soft); color: var(--p100-accent); font-size: 12.5px; margin-bottom: 12px; }
.p100-results { display: flex; flex-direction: column; gap: 8px; }
.p100-result { display: block; width: 100%; text-align: left; padding: 12px 15px; border: 1px solid var(--p100-line);
    border-radius: var(--p100-r-sm); background: var(--p100-card); color: var(--p100-fg); }
.p100-result:hover { border-color: var(--p100-accent); }
.p100-result-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 5px; }
.p100-result-h b { font-size: 14px; }
.p100-result-s { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
    color: var(--p100-sub); font-size: 13px; line-height: 1.75; max-width: 92ch; }

/* ---------- 自测练习 ---------- */
.p100-quiz-box { max-width: 900px; margin-inline: auto; }
.p100-quiz-card, .p100-quiz-done, .p100-quiz-empty { padding: 20px 22px; border: 1px solid var(--p100-line);
    border-radius: var(--p100-r); background: var(--p100-card); }
.p100-quiz-empty { text-align: center; color: var(--p100-sub); }
.p100-quiz-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.p100-quiz-prog { margin-left: auto; color: var(--p100-faint); font-size: 12px; }
.p100-quiz-q { font-size: 17px; line-height: 1.6; margin: 0 0 16px; }
.p100-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.p100-opt { display: flex; align-items: center; gap: 9px; min-height: 46px; padding: 9px 12px; text-align: left;
    border: 1px solid var(--p100-line-2); border-radius: var(--p100-r-sm); background: var(--p100-card-2);
    color: var(--p100-fg); font-size: 13.5px; line-height: 1.5; }
.p100-opt:hover:not(:disabled) { border-color: var(--p100-accent); }
.p100-opt.is-on { border-color: var(--p100-accent); background: var(--p100-accent-soft); }
.p100-opt.is-right { border-color: var(--p100-ok); background: var(--p100-ok-soft); }
.p100-opt.is-wrong { border-color: var(--p100-err); background: var(--p100-err-soft); }
.p100-opt-k { flex: 0 0 24px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 6px;
    background: var(--p100-card); border: 1px solid var(--p100-line); font-size: 11.5px; color: var(--p100-sub); }
.p100-opt:disabled { cursor: default; opacity: 1; }
.p100-quiz-exp { margin-top: 16px; padding: 12px 15px; border-radius: 8px; border-left: 3px solid var(--p100-ok); background: var(--p100-card-2); }
.p100-quiz-exp.is-bad { border-left-color: var(--p100-err); }
.p100-quiz-exp b { font-size: 13px; }
.p100-quiz-exp p { margin: 5px 0 0; color: var(--p100-sub); font-size: 12.5px; line-height: 1.8; }
.p100-quiz-acts { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.p100-quiz-hint { color: var(--p100-faint); font-size: 12px; }
.p100-quiz-done { text-align: center; }
.p100-quiz-score { font-size: 48px; font-weight: 700; color: var(--p100-accent); line-height: 1.2; }
.p100-quiz-score small { font-size: 20px; }
.p100-quiz-done p { color: var(--p100-sub); }
.p100-quiz-done-acts { display: flex; gap: 10px; justify-content: center; margin-top: 14px; }
/* ---------- 速查手册 ---------- */
/* 速查条目按可用宽度自动分栏：超宽屏 3~4 列、平板 2 列、手机 1 列，不靠硬断点跳变 */
.p100-ref-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.p100-ref-group { grid-column: 1 / -1; margin: 14px 0 2px; font-size: 14px; color: var(--p100-accent);
    padding-bottom: 6px; border-bottom: 1px dashed var(--p100-line); }
.p100-ref { padding: 12px 14px; border: 1px solid var(--p100-line); border-radius: var(--p100-r-sm); background: var(--p100-card); min-width: 0; }
.p100-ref-t { display: flex; align-items: center; gap: 8px; }
.p100-ref-t b { font-size: 13.5px; }
.p100-ref-t .p100-btn { margin-left: auto; }
.p100-ref-code { margin: 9px 0; padding: 9px 11px; border-radius: 7px; background: var(--p100-card-2);
    border: 1px solid var(--p100-line); overflow-x: auto; font-size: 12px; line-height: 1.6;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--p100-accent); white-space: pre-wrap; overflow-wrap: anywhere; }
.p100-ref-d { margin: 0; color: var(--p100-sub); font-size: 12px; line-height: 1.7; }

/* ---------- 我的学习 ---------- */
/* 四块面板固定 2×2（总览/计划为主面板，需保持宽度），窄屏由断点改单列 */
.p100-me-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.p100-panel { padding: 18px; border: 1px solid var(--p100-line); border-radius: var(--p100-r); background: var(--p100-card); min-width: 0; }
.p100-panel h2 { font-size: 15px; margin: 0 0 14px; }
.p100-me-top { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.p100-ring { position: relative; flex: 0 0 118px; width: 118px; height: 118px; }
.p100-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.p100-ring circle { fill: none; stroke-width: 10; }
.p100-ring-bg { stroke: var(--p100-card-2); }
.p100-ring-fg { stroke: var(--p100-accent); stroke-linecap: round; transition: stroke-dasharray .4s ease; }
.p100-ring > div { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.p100-ring b { font-size: 24px; color: var(--p100-accent); }
.p100-ring span { font-size: 11px; color: var(--p100-sub); }
.p100-me-kpis { flex: 1 1 190px; display: grid; grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); gap: 9px; }
.p100-me-kpis div { display: flex; flex-direction: column; padding: 8px; border: 1px solid var(--p100-line); border-radius: 8px; }
.p100-me-kpis b { font-size: 15px; }
.p100-me-kpis em { font-style: normal; font-size: 11px; color: var(--p100-sub); }
.p100-plan { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.p100-plan label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--p100-sub); }
.p100-me-data { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.p100-me-list { max-height: 300px; overflow-y: auto; scrollbar-width: thin; }
.p100-me-row { display: block; width: 100%; text-align: left; padding: 9px 11px; margin-bottom: 7px;
    border: 1px solid var(--p100-line); border-radius: 8px; background: var(--p100-card-2); color: var(--p100-fg); }
.p100-me-row:hover { border-color: var(--p100-accent); }
.p100-me-row b { display: block; font-size: 13px; }
.p100-me-row span { display: block; color: var(--p100-sub); font-size: 11.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p100-me-empty { color: var(--p100-faint); font-size: 12.5px; }

/* ---------- 页脚、抽屉、toast ---------- */
.p100-foot { margin-top: 30px; padding: 18px 4px 0; border-top: 1px solid var(--p100-line); color: var(--p100-faint); font-size: 12px; line-height: 1.85; }
.p100-foot p { margin: 0 0 6px; max-width: 100ch; }
.p100-mask { position: fixed; inset: 0; z-index: 100000; display: flex; justify-content: flex-end;
    background: rgba(0, 0, 0, .55); backdrop-filter: blur(2px); }
.p100-drawer { width: min(460px, 92vw); height: 100%; display: flex; flex-direction: column; gap: 10px;
    padding: 18px; background: var(--p100-card); color: var(--p100-fg); box-shadow: var(--p100-shadow); }
.p100-drawer-h { display: flex; align-items: center; justify-content: space-between; }
.p100-drawer-h h2 { font-size: 16px; margin: 0; }
.p100-drawer textarea { flex: 1 1 auto; min-height: 220px; resize: none; font-size: 14px; line-height: 1.75; }
.p100-drawer-f { display: flex; justify-content: flex-end; gap: 9px; }
.p100-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
    z-index: 100001; max-width: min(90vw, 520px); padding: 10px 18px; border-radius: 999px;
    background: var(--p100-card-2); color: var(--p100-fg); border: 1px solid var(--p100-line-2);
    box-shadow: var(--p100-shadow); font-size: 13px; text-align: center; }

/* ---------- 响应式（断点降序，后者覆盖前者） ---------- */
@media (min-width: 1600px) {
    .p100 { padding-left: clamp(28px, 3vw, 56px); padding-right: clamp(28px, 3vw, 56px); }
    .p100-grid { grid-template-columns: repeat(auto-fill, minmax(306px, 1fr)); }
    .p100-stage-list { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
    .p100-read { grid-template-columns: minmax(0, 286px) minmax(0, 1fr) minmax(0, 244px); }
}
/* 三栏只在内容区足够宽时启用：站点左侧导航固定占 275px，
   视口 1440 时内容区仅 ~1133px，旧三栏把正文挤到 ~500px（约 31 汉字/行）。
   按「正文优先」分级：>=1600 三栏 / 1201-1599 两栏 / <=1200 单栏。 */
@media (max-width: 1599px) {
    .p100-read { grid-template-columns: minmax(0, 240px) minmax(0, 1fr); }
    .p100-toc { display: none; }
}
@media (max-width: 1400px) {
    .p100-read { grid-template-columns: minmax(0, 228px) minmax(0, 1fr); }
}
@media (max-width: 1200px) {
    .p100-read { grid-template-columns: minmax(0, 1fr); }
    .p100-side { position: static; max-height: 250px; order: -1; }
    .p100-article { order: 0; }
    /* 修复：吸顶页签实测 51px，旧值 46px 会让阅读工具条压住页签底部 5px */
    .p100-read-bar { top: var(--p100-tabs-h); }
    .p100-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .p100-stat:nth-child(4) { border-left: 0; }
    .p100-stat:nth-child(n+4) { border-top: 1px solid var(--p100-line); }
}
@media (max-width: 1000px) {
    .p100-side { max-height: 220px; }
}
@media (max-width: 900px) {
    .p100-hero { padding: 18px; }
    .p100-hero-l { flex-basis: 100%; }
    /* 按可用宽度自动决定列数，不再 900px 一刀切单列让宽平板留大片空白；
       min(100%, Npx) 保证极窄屏不会因固定最小列宽而横向溢出 */
    .p100-me-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
    .p100-ref-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
    .p100-opts { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
}
@media (max-width: 767px) {
    .p100 { padding: 12px 12px calc(48px + env(safe-area-inset-bottom, 0px)); }
    /* 图标移到右上角浮标，文字列占满宽度：否则 360px 屏上 46px 图标会把
       说明与 6 个中文标签挤成 3 行，首屏被头部吃掉近 320px */
    .p100-hero { gap: 12px; padding: 14px; position: relative; }
    .p100-hero-l { display: block; }
    .p100-hero-ic { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px;
        flex-basis: auto; font-size: 22px; border-radius: 10px; }
    .p100-hero-t h1 { font-size: 19px; padding-right: 46px; }
    /* 说明与 6 个中文标签全部完整保留：靠图标浮动/标签收紧压缩高度，
       不截断文字（截断出的省略号会让用户误以为内容缺失） */
    .p100-hero-t p { font-size: 12.5px; line-height: 1.65; }
    .p100-hero-tags { gap: 4px; }
    .p100-hero-tags span { font-size: 11px; padding: 3px 7px; }
    .p100-hero-r { width: 100%; }
    .p100-hero-r .p100-btn { flex: 1 1 0; }
    .p100-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .p100-stat { padding: 9px 12px; }
    .p100-stat:nth-child(odd) { border-left: 0; }
    .p100-stat:nth-child(n+3) { border-top: 1px solid var(--p100-line); }
    .p100-stat b { font-size: 18px; }
    .p100-stat em { font-size: 11.5px; }
    /* 横滑页签右侧渐隐，暗示还有更多页签；滚动条隐藏但保留 scroll-snap */
    .p100-tabs { margin: 0 -12px 14px; padding: 4px 12px;
        -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), transparent 100%);
        mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 26px), transparent 100%); }
    .p100-tab { min-height: 44px; padding: 8px 13px; font-size: 13px; }
    /* 工具条两列栅格：搜索框与计数整行，其余控件两两并排，纵向占用近乎减半 */
    .p100-tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-items: stretch; }
    .p100-tools .p100-search, .p100-tools .p100-count { grid-column: 1 / -1; }
    .p100-tools .p100-count { justify-self: end; margin-left: 0; }
    .p100-tools .p100-btn, .p100-tools .p100-select { width: 100%; min-width: 0; }
    .p100-search { min-width: 0; }
    .p100 input[type="search"], .p100 input[type="date"], .p100 select, .p100 textarea { font-size: 16px; min-height: 42px; }
    .p100-btn { min-height: 40px; }
    .p100-btn.sm { min-height: 40px; }
    .p100-icon-btn { min-width: 40px; min-height: 40px; }
    .p100-chip { min-height: 40px; }
    .p100-stage-list, .p100-grid { grid-template-columns: minmax(0, 1fr); }
    .p100-card-tags span { font-size: 11px; }
    .p100-card-meta { font-size: 11.5px; }
    .p100-card-acts .p100-btn { flex: 1 1 auto; }
    .p100-read-bar { position: static; padding: 12px; }
    /* 阅读工具 7 个按钮改单行横滑：比两行堆叠省约 46px 首屏高度，渐隐提示可滑动 */
    .p100-read-acts { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
        width: 100%; min-width: 0; margin: 0 -12px; padding: 0 12px 3px;
        -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 22px), transparent 100%);
        mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 22px), transparent 100%); }
    .p100-read-acts::-webkit-scrollbar { display: none; }
    .p100-read-acts > * { flex: 0 0 auto; }
    .p100-side { max-height: 200px; }
    .p100-article-body { padding: 16px 14px 26px; scroll-margin-top: 12px; }
    .p100-article-body h1, .p100-article-body h2, .p100-article-body h3,
    .p100-article-body h4, .p100-article-body h5, .p100-article-body h6 { scroll-margin-top: 12px; }
    .p100-code pre { font-size: 12px; }
    .p100-doc-nav { padding: 12px; }
    .p100-doc-nav-tip { display: none; }
    .p100-doc-nav .p100-btn { flex: 1 1 0; }
    .p100-opts, .p100-me-grid, .p100-ref-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
    .p100-opt { min-height: 44px; font-size: 14px; }
    .p100-me-data .p100-btn, .p100-me-data label.p100-btn { flex: 1 1 100%; }
    .p100-foot { font-size: 12px; }
    .p100-drawer { width: 100%; height: auto; max-height: 88vh; border-radius: 16px 16px 0 0;
        align-self: flex-end; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
    .p100-mask { align-items: flex-end; }
    .p100-drawer textarea { min-height: 180px; font-size: 16px; }
    .p100-panel { padding: 14px; }
}
/* 站点 <=700px 会出现 53px 高的吸顶手机顶栏，页签必须让位，
   否则 z-index 更高的页签会盖住菜单 / 主题切换按钮 */
@media (max-width: 700px) {
    .p100-tabs { top: 53px; }
}
@media (max-width: 420px) {
    /* 超小屏保持 6 个中文标签齐全，只收紧字号与内边距让它们排成两行 */
    .p100-hero-tags span { font-size: 10px; padding: 2px 6px; }
    .p100-tools { gap: 7px; }
    .p100-tools .p100-btn { padding-left: 8px; padding-right: 8px; font-size: 12.5px; }
    .p100-card-t { font-size: 14px; }
    .p100-card-meta { gap: 7px; }
    .p100-quiz-card, .p100-quiz-done { padding: 15px; }
    .p100-quiz-q { font-size: 15.5px; }
    .p100-article-body { font-size: var(--p100-fs, 16px); }
    .p100-read-acts .p100-btn { padding: 5px 9px; }
}
@media (hover: none) {
    .p100-card:hover, .p100-stage-card:hover { box-shadow: none; transform: none; }
    .p100-btn:hover { background: var(--p100-card-2); }
}
@media (prefers-reduced-motion: reduce) {
    .p100 *, .p100 *::before, .p100 *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
    .p100-tabs, .p100-hero-r, .p100-tools, .p100-chips, .p100-side, .p100-toc, .p100-doc-nav,
    .p100-read-acts, .p100-foot, .p100-toast, .p100-mask { display: none !important; }
    .p100-read { display: block; max-width: none; }
    .p100-article { border: 0; }
    /* 打印用满纸宽，不保留屏幕阅读的居中限宽 */
    .p100-article-body { max-width: none; margin: 0; }
    .p100-read-bar, .p100-doc-nav { padding-inline: 18px; }
}

