/*
 * software_testing.css — 软件测试教程（/tools/software-testing）
 * 设计令牌定义在 :root 与 [data-theme="light"]（浮层挂在 body 上，变量必须全局可继承）。
 *
 * 关键约束（勿回退）：
 *  1) 站点 style.css 的 body{overflow-y:scroll} 会让 body 成为滚动容器 → 页内 sticky 失效，
 *     本页必须 overflow:visible 把滚动权交还 html。
 *  2) 凡用 hidden 属性控制显隐、且选择器带 display 的元素，必须补 [hidden] 兜底。
 *  3) 手机端输入控件 ≥16px 防 iOS 聚焦缩放，触控目标 ≥44px。
 *  4) 长表格 / 代码块在容器内自身滚动，绝不撑破页面宽度。
 *  5) 难度徽标使用 ASCII 类名（st-lv-1/2/3），避免编码问题导致选择器失效。
 */
:root {
    --st-bg: #0d1117;
    --st-bg-2: #121923;
    --st-card: #161e28;
    --st-card-2: #1c2632;
    --st-card-3: #243140;
    --st-border: #253140;
    --st-border-2: #35465a;
    --st-text: #e8eef6;
    --st-sub: #a9b8c8;
    --st-faint: #8496a8;
    --st-accent: #3fc2a5;
    --st-accent-2: #219b80;
    --st-accent-soft: rgba(63, 194, 165, .13);
    --st-on-accent: #05241d;
    --st-blue: #6db4ff;
    --st-blue-soft: rgba(109, 180, 255, .13);
    --st-warn: #e6b34a;
    --st-warn-soft: rgba(230, 179, 74, .13);
    --st-err: #f4786c;
    --st-err-soft: rgba(244, 120, 108, .13);
    --st-ok: #5dd39a;
    --st-code-bg: #0a0f15;
    --st-zebra: rgba(127, 127, 127, .055);
    --st-shadow: 0 20px 48px -28px rgba(0, 0, 0, .9);
    --st-shadow-sm: 0 10px 24px -18px rgba(0, 0, 0, .85);
    --st-r: 14px;
    --st-r-s: 10px;
    --st-r-xs: 8px;
    --st-maxw: 1720px;
}

[data-theme="light"] {
    --st-bg: #f2f6f8;
    --st-bg-2: #ffffff;
    --st-card: #ffffff;
    --st-card-2: #f3f7fa;
    --st-card-3: #e8eff5;
    --st-border: #dfe8ee;
    --st-border-2: #c8d6e0;
    --st-text: #12212d;
    --st-sub: #465a6c;
    --st-faint: #64748b;
    --st-accent: #0e8a70;
    --st-accent-2: #0a6d58;
    --st-accent-soft: rgba(14, 138, 112, .10);
    --st-on-accent: #ffffff;
    --st-blue: #0a63bd;
    --st-blue-soft: rgba(10, 99, 189, .09);
    --st-warn: #8a6100;
    --st-warn-soft: rgba(138, 97, 0, .10);
    --st-err: #bf3b2d;
    --st-err-soft: rgba(191, 59, 45, .09);
    --st-ok: #137a4d;
    --st-code-bg: #f5f8fa;
    --st-zebra: rgba(15, 20, 25, .038);
    --st-shadow: 0 16px 36px -26px rgba(18, 32, 43, .45);
    --st-shadow-sm: 0 8px 20px -16px rgba(18, 32, 43, .35);
}

/* ---------- 满屏与滚动修复 ---------- */
body.page-software-testing-full .app,
body.page-software-testing-full .main-content,
body.page-software-testing-full .page-container { max-width: 100%; }
body.page-software-testing-full .main-content { width: 100%; border-right: 0; }
body.page-software-testing-full { overflow: visible; }
body.st-side-open, body.st-drawer-open { overflow: hidden; }

.st {
    max-width: var(--st-maxw);
    margin: 0 auto;
    padding: 20px 24px 72px;
    color: var(--st-text);
    min-width: 0;
}
.st [hidden] { display: none !important; }
.st-side-mask[hidden], .st-mask[hidden], .st-note-editor[hidden], .st-toast[hidden] { display: none !important; }
.st :focus-visible { outline: 2px solid var(--st-accent); outline-offset: 2px; border-radius: 6px; }
.st h1, .st h2, .st h3, .st h4 { line-height: 1.35; }
.st p { line-height: 1.8; }
.st button, .st input, .st select, .st textarea { font-family: inherit; }

/* ---------- Hero ---------- */
.st-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(290px, 380px);
    gap: 26px;
    align-items: center;
    padding: 24px 26px;
    border: 1px solid var(--st-border);
    border-radius: var(--st-r);
    background: linear-gradient(120deg, var(--st-accent-soft), transparent 62%), var(--st-card);
    box-shadow: var(--st-shadow-sm);
}
.st-hero-l { display: flex; gap: 18px; align-items: flex-start; min-width: 0; }
.st-hero-ic {
    flex: 0 0 auto; width: 56px; height: 56px; display: grid; place-items: center;
    font-size: 30px; border-radius: 16px;
    background: linear-gradient(140deg, var(--st-accent), var(--st-blue));
    box-shadow: var(--st-shadow-sm);
}
.st-hero-t { min-width: 0; }
.st-hero-t h1 { margin: 0 0 6px; font-size: 28px; letter-spacing: .5px; }
.st-hero-t p { margin: 0; color: var(--st-sub); font-size: 14px; max-width: 78ch; }
.st-hero-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.st-hero-tags span {
    font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
    background: var(--st-card-2); border: 1px solid var(--st-border); color: var(--st-sub);
}
.st-hero-r { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.st-side-toggle {
    align-self: flex-end; display: inline-flex; align-items: center; gap: 6px;
    height: 38px; padding: 0 14px; border-radius: 10px; cursor: pointer;
    border: 1px solid var(--st-border-2); background: var(--st-card-2); color: var(--st-text);
    font-size: 13px;
}
.st-side-toggle:hover { border-color: var(--st-accent); color: var(--st-accent); }
.st-search {
    display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px;
    border: 1px solid var(--st-border-2); border-radius: 12px; background: var(--st-bg-2);
}
.st-search:focus-within { border-color: var(--st-accent); box-shadow: 0 0 0 3px var(--st-accent-soft); }
.st-search input {
    flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: transparent;
    color: var(--st-text); font-size: 15px;
}
.st-search input::placeholder { color: var(--st-faint); }
.st-search-ic { color: var(--st-faint); }
.st-search-kbd {
    flex: 0 0 auto; font: 12px/1 monospace; padding: 3px 7px; border-radius: 6px;
    border: 1px solid var(--st-border-2); color: var(--st-faint);
}

/* ---------- 统计条 / 页签 ---------- */
.st-stats {
    display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0; margin: 16px 0; border: 1px solid var(--st-border);
    border-radius: var(--st-r); background: var(--st-card); overflow: hidden;
}
.st-stat {
    padding: 14px 18px; min-width: 0;
    border-left: 1px solid var(--st-border);
}
.st-stat:first-child { border-left: 0; }
.st-stat b { display: block; font-size: 22px; color: var(--st-accent); line-height: 1.3; }
.st-stat:nth-child(3) b { color: var(--st-blue); }
.st-stat:nth-child(5) b { color: var(--st-warn); }
.st-stat span { display: block; font-size: 12px; color: var(--st-sub); margin-top: 2px; }
.st-skeleton, .st-skeleton-card {
    display: block; border-radius: 8px;
    background: linear-gradient(90deg, var(--st-card-2), var(--st-card-3), var(--st-card-2));
    background-size: 200% 100%; animation: st-shimmer 1.4s linear infinite;
}
.st-skeleton { width: 56px; height: 10px; }
.st-skeleton-card { height: 180px; }
@keyframes st-shimmer { to { background-position: -200% 0; } }

.st-tabs {
    display: flex; gap: 6px; margin-bottom: 16px; padding: 5px;
    border: 1px solid var(--st-border); border-radius: 12px; background: var(--st-card);
    position: sticky; top: 8px; z-index: 30; box-shadow: var(--st-shadow-sm);
}
.st-tab {
    flex: 1 1 0; min-width: 0; height: 42px; padding: 0 12px; cursor: pointer;
    border: 1px solid transparent; border-radius: 9px; background: transparent;
    color: var(--st-sub); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.st-tab:hover { background: var(--st-card-2); color: var(--st-text); }
.st-tab.is-on { background: var(--st-accent-soft); border-color: var(--st-accent); color: var(--st-accent); }

.st-loading {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    padding: 22px; border: 1px dashed var(--st-border-2); border-radius: var(--st-r);
    color: var(--st-sub); font-size: 14px; flex-wrap: wrap;
}
.st-spinner {
    width: 20px; height: 20px; border-radius: 50%;
    border: 2px solid var(--st-border-2); border-top-color: var(--st-accent);
    animation: st-spin .8s linear infinite;
}
@keyframes st-spin { to { transform: rotate(360deg); } }

/* ---------- 通用按钮 / chip ---------- */
.st-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 38px; padding: 0 14px; cursor: pointer; font-size: 13px;
    border: 1px solid var(--st-border-2); border-radius: 10px;
    background: var(--st-card-2); color: var(--st-text); transition: border-color .15s, background .15s;
}
.st-btn:hover:not(:disabled) { border-color: var(--st-accent); background: var(--st-accent-soft); }
.st-btn:disabled { opacity: .5; cursor: not-allowed; }
.st-btn-pri { background: var(--st-accent); border-color: var(--st-accent); color: var(--st-on-accent); font-weight: 600; }
.st-btn-pri:hover:not(:disabled) { background: var(--st-accent-2); border-color: var(--st-accent-2); color: var(--st-on-accent); }
.st-btn-xs { min-height: 30px; padding: 0 9px; font-size: 12px; }
.st-btn.is-done, .st-btn.is-on { border-color: var(--st-accent); color: var(--st-accent); background: var(--st-accent-soft); }
.st-chip {
    display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 0 12px;
    border: 1px solid var(--st-border); border-radius: 999px; cursor: pointer;
    background: var(--st-card); color: var(--st-sub); font-size: 12.5px; white-space: nowrap;
}
.st-chip:hover { border-color: var(--st-border-2); color: var(--st-text); }
.st-chip.is-on { background: var(--st-accent-soft); border-color: var(--st-accent); color: var(--st-accent); font-weight: 600; }
.st-chip em { font-style: normal; color: var(--st-faint); font-size: 11px; }
.st-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.st-count { margin-left: auto; color: var(--st-faint); font-size: 12px; }
.st-result { padding: 8px 12px; margin-bottom: 12px; border-radius: var(--st-r-s); background: var(--st-blue-soft); color: var(--st-blue); font-size: 13px; }
.st-empty, .st-tool-placeholder {
    padding: 30px 18px; text-align: center; color: var(--st-faint); font-size: 14px;
    border: 1px dashed var(--st-border-2); border-radius: var(--st-r); background: var(--st-card);
}
.st-error { padding: 14px 16px; border-radius: var(--st-r-s); background: var(--st-err-soft); color: var(--st-err); font-size: 13px; }

/* ---------- 课程网格 ---------- */
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 14px; }
.st-card {
    display: flex; flex-direction: column; gap: 10px; padding: 16px; min-width: 0;
    border: 1px solid var(--st-border); border-radius: var(--st-r);
    background: var(--st-card); cursor: pointer; box-shadow: var(--st-shadow-sm);
    transition: transform .15s, border-color .15s;
}
.st-card:hover { transform: translateY(-2px); border-color: var(--st-accent); }
.st-card-top { display: flex; align-items: center; gap: 8px; }
.st-card-ic { font-size: 24px; line-height: 1; }
.st-lv { margin-left: auto; font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.st-lv-1 { background: var(--st-blue-soft); color: var(--st-blue); }
.st-lv-2 { background: var(--st-warn-soft); color: var(--st-warn); }
.st-lv-3 { background: var(--st-err-soft); color: var(--st-err); }
.st-card-fav { color: var(--st-warn); font-size: 13px; }
.st-card h3 { margin: 0; font-size: 16px; }
.st-card-desc {
    margin: 0; color: var(--st-sub); font-size: 12.5px; line-height: 1.7;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.st-card-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.st-card-tags span { font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--st-card-2); color: var(--st-faint); }
.st-card-foot { display: flex; align-items: center; gap: 8px; margin-top: auto; font-size: 11.5px; color: var(--st-faint); }
.st-card-foot > span:first-child { flex: 0 0 auto; }
.st-prog { flex: 1 1 auto; height: 6px; border-radius: 99px; background: var(--st-card-3); overflow: hidden; }
.st-prog i { display: block; height: 100%; background: var(--st-accent); border-radius: 99px; }

/* ---------- 章节阅读 ---------- */
.st-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--st-faint); margin-bottom: 14px; }
.st-crumb button { border: 0; background: none; color: var(--st-accent); cursor: pointer; padding: 2px 0; font-size: 12.5px; }
.st-crumb button:hover { text-decoration: underline; }
.st-lesson-grid { display: grid; grid-template-columns: minmax(0, 1fr) 262px; gap: 20px; align-items: start; }
.st-lesson-main {
    min-width: 0; padding: 24px 28px 30px; border: 1px solid var(--st-border);
    border-radius: var(--st-r); background: var(--st-card); box-shadow: var(--st-shadow-sm);
}
.st-back { border: 0; background: none; color: var(--st-accent); cursor: pointer; font-size: 13px; padding: 0 0 10px; }
.st-lesson-main h1 { margin: 0 0 8px; font-size: 27px; }
.st-lesson-main h1:focus { outline: none; }
.st-lesson-sum { margin: 0 0 10px; color: var(--st-sub); font-size: 14px; }
.st-lesson-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; color: var(--st-faint); }
.st-lesson-ops { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 18px; padding-bottom: 18px; border-bottom: 1px solid var(--st-border); }
.st-body > p, .st-body > ul, .st-body > ol, .st-body > h2, .st-body > h3, .st-body > blockquote { max-width: 78ch; }
.st-body h2 { font-size: 20px; margin: 26px 0 10px; padding-left: 10px; border-left: 3px solid var(--st-accent); }
.st-body h3 { font-size: 16px; margin: 20px 0 8px; color: var(--st-sub); }
.st-body p { margin: 10px 0; color: var(--st-text); font-size: 14px; }
.st-body ul, .st-body ol { margin: 10px 0; padding-left: 22px; color: var(--st-text); font-size: 14px; }
.st-body li { margin: 6px 0; line-height: 1.8; }
.st-body blockquote {
    margin: 14px 0; padding: 10px 16px; border-left: 3px solid var(--st-warn);
    background: var(--st-warn-soft); border-radius: 0 var(--st-r-s) var(--st-r-s) 0;
    color: var(--st-sub); font-size: 13.5px;
}
.st-body hr { border: 0; border-top: 1px solid var(--st-border); margin: 24px 0; }
.st-body code, .st-doc-out {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12.5px;
}
.st-body > p code, .st-body li code { padding: 1px 5px; border-radius: 5px; background: var(--st-card-3); color: var(--st-accent); }
.st-body a { color: var(--st-blue); }
.st-tasks { list-style: none; padding-left: 0 !important; }
.st-tasks li { display: flex; gap: 9px; align-items: flex-start; }
.st-task-box { flex: 0 0 auto; width: 14px; height: 14px; margin-top: 4px; border: 1.5px solid var(--st-border-2); border-radius: 4px; }
.st-table-wrap { max-width: 100%; overflow-x: auto; margin: 14px 0; border: 1px solid var(--st-border); border-radius: var(--st-r-s); }
.st-table-wrap table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.st-table-wrap th, .st-table-wrap td { padding: 9px 12px; text-align: left; border-right: 1px solid var(--st-border); border-bottom: 1px solid var(--st-border); vertical-align: top; }
.st-table-wrap th { background: var(--st-card-2); color: var(--st-text); font-weight: 600; white-space: nowrap; position: sticky; top: 0; z-index: 2; }
.st-table-wrap td:last-child, .st-table-wrap th:last-child { border-right: 0; }
.st-table-wrap tbody tr:last-child td { border-bottom: 0; }
.st-table-wrap tbody tr:nth-child(even) { background: var(--st-zebra); }
.st-code-wrap { margin: 14px 0; border: 1px solid var(--st-border); border-radius: var(--st-r-s); overflow: hidden; background: var(--st-code-bg); }
.st-code-bar { display: flex; align-items: center; padding: 6px 10px; border-bottom: 1px solid var(--st-border); background: var(--st-card-2); font-size: 11.5px; color: var(--st-faint); }
.st-code-bar span { font-family: ui-monospace, Menlo, Consolas, monospace; }
.st-code-copy { margin-left: auto; border: 0; background: none; color: var(--st-accent); cursor: pointer; font-size: 11.5px; }
.st-code-wrap pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-size: 12.5px; line-height: 1.7; color: var(--st-text); }
.st-c-com { color: var(--st-faint); }
.st-c-str { color: var(--st-ok); }
.st-c-num { color: var(--st-warn); }
.st-c-kw { color: var(--st-blue); }
.st-pager { display: flex; justify-content: space-between; gap: 10px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--st-border); }
.st-toc { position: sticky; top: 68px; max-height: calc(100vh - 88px); overflow-y: auto; padding: 16px; border: 1px solid var(--st-border); border-radius: var(--st-r); background: var(--st-card); }
.st-toc h3 { margin: 0 0 12px; font-size: 14px; }
.st-toc-item {
    display: flex; align-items: flex-start; gap: 7px; width: 100%; padding: 7px 8px;
    border: 0; border-radius: 8px; background: none; color: var(--st-sub);
    cursor: pointer; text-align: left; font-size: 12.5px; line-height: 1.5;
}
.st-toc-item:hover { background: var(--st-card-2); color: var(--st-text); }
.st-toc-item.is-cur { background: var(--st-accent-soft); color: var(--st-accent); font-weight: 600; }
.st-toc-item em { flex: 0 0 auto; font-style: normal; color: var(--st-faint); font-size: 11px; }
.st-tree-done { color: var(--st-ok); }
.st-tree-dot { color: var(--st-faint); }

/* ---------- 知识百科 ---------- */
.st-wiki-grid { display: grid; grid-template-columns: 296px minmax(0, 1fr); gap: 18px; align-items: start; }
.st-wiki-nav { position: sticky; top: 68px; max-height: calc(100vh - 88px); overflow-y: auto; padding: 16px; border: 1px solid var(--st-border); border-radius: var(--st-r); background: var(--st-card); }
.st-wiki-nav h3 { margin: 0 0 12px; font-size: 15px; }
.st-wiki-nav h3 small { font-weight: 400; color: var(--st-faint); font-size: 11px; }
.st-wiki-ch { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px dashed var(--st-border); }
.st-wiki-ch:last-child { border-bottom: 0; }
.st-wiki-ch h4 { margin: 0 0 4px; font-size: 13px; }
.st-wiki-ch p { margin: 0 0 8px; font-size: 11.5px; color: var(--st-faint); line-height: 1.6; }
.st-wiki-link {
    display: block; width: 100%; padding: 6px 9px; margin-bottom: 3px; text-align: left;
    border: 0; border-radius: 7px; background: none; color: var(--st-sub); cursor: pointer; font-size: 12.5px;
}
.st-wiki-link:hover { background: var(--st-card-2); color: var(--st-text); }
.st-wiki-link.is-cur { background: var(--st-accent-soft); color: var(--st-accent); font-weight: 600; }
.st-wiki-main { min-width: 0; }
.st-wiki-body, .st-terms { padding: 20px 22px; border: 1px solid var(--st-border); border-radius: var(--st-r); background: var(--st-card); }
.st-terms { margin-top: 16px; }
.st-wiki-welcome span { font-size: 34px; }
.st-wiki-welcome h2 { margin: 8px 0; font-size: 20px; }
.st-wiki-welcome p { color: var(--st-sub); font-size: 14px; max-width: 76ch; }
.st-wiki-cats { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.st-wiki-cats span { padding: 4px 10px; border: 1px solid var(--st-border); border-radius: 999px; font-size: 12px; color: var(--st-sub); }
.st-wiki-cats em { font-style: normal; color: var(--st-faint); }
.st-wiki-sec-head small { color: var(--st-accent); font-size: 12px; }
.st-wiki-sec h2 { margin: 6px 0; font-size: 21px; }
.st-wiki-sec-head p { color: var(--st-sub); font-size: 14px; margin: 0 0 18px; }
.st-wiki-sec h3 { font-size: 14px; margin: 20px 0 8px; }
.st-wiki-points { padding-left: 22px; font-size: 13.5px; color: var(--st-text); }
.st-wiki-points li { margin: 8px 0; line-height: 1.75; }
.st-wiki-terms { display: flex; flex-wrap: wrap; gap: 7px; }
.st-terms-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.st-terms-head h3 { margin: 0; font-size: 15px; }
.st-terms-head h3 small { font-weight: 400; color: var(--st-faint); font-size: 11px; }
.st-terms-head input {
    margin-left: auto; flex: 1 1 220px; max-width: 320px; min-width: 0; height: 38px; padding: 0 12px;
    border: 1px solid var(--st-border-2); border-radius: 9px; background: var(--st-bg-2); color: var(--st-text); font-size: 14px;
}
.st-term-layout { display: grid; grid-template-columns: minmax(180px, 280px) minmax(0, 1fr); gap: 14px; }
.st-term-list { max-height: 340px; overflow-y: auto; border: 1px solid var(--st-border); border-radius: var(--st-r-s); }
.st-term-item { display: block; width: 100%; padding: 8px 11px; text-align: left; border: 0; border-bottom: 1px solid var(--st-border); background: none; color: var(--st-text); cursor: pointer; }
.st-term-item:last-child { border-bottom: 0; }
.st-term-item:hover { background: var(--st-card-2); }
.st-term-item.is-cur { background: var(--st-accent-soft); }
.st-term-item b { display: block; font-size: 13px; font-weight: 600; }
.st-term-item small { display: block; color: var(--st-faint); font-size: 11px; margin-top: 2px; }
.st-term-detail { padding: 14px; border: 1px solid var(--st-border); border-radius: var(--st-r-s); background: var(--st-card-2); color: var(--st-sub); font-size: 13px; min-height: 120px; }
.st-term-card h4 { margin: 0 0 4px; font-size: 17px; color: var(--st-text); }
.st-term-en { color: var(--st-blue); font-size: 12.5px; margin-bottom: 8px; }
.st-term-cat { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--st-blue-soft); color: var(--st-blue); font-size: 11px; }
.st-term-card p { margin: 12px 0 0; line-height: 1.8; }

/* ---------- 实战练习 ---------- */
.st-quiz-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.st-quiz-bar select {
    height: 38px; min-width: 130px; padding: 0 10px; border: 1px solid var(--st-border-2);
    border-radius: 9px; background: var(--st-card); color: var(--st-text); font-size: 13px;
}
.st-quiz-progress { display: flex; gap: 4px; margin-bottom: 14px; flex-wrap: wrap; }
.st-quiz-progress i { flex: 1 1 12px; height: 5px; border-radius: 99px; background: var(--st-card-3); }
.st-quiz-progress i.is-done { background: var(--st-ok); }
.st-quiz-progress i.is-cur { background: var(--st-accent); }
.st-quiz-card { padding: 22px 24px; border: 1px solid var(--st-border); border-radius: var(--st-r); background: var(--st-card); }
.st-quiz-meta { color: var(--st-faint); font-size: 12px; margin-bottom: 10px; }
.st-quiz-card h3 { margin: 0 0 16px; font-size: 18px; line-height: 1.6; }
.st-quiz-options { display: grid; gap: 8px; }
.st-quiz-opt {
    display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; cursor: pointer;
    border: 1px solid var(--st-border); border-radius: var(--st-r-s); background: var(--st-card-2);
    font-size: 13.5px; line-height: 1.6;
}
.st-quiz-opt:hover { border-color: var(--st-border-2); }
.st-quiz-opt input { margin-top: 3px; accent-color: var(--st-accent); flex: 0 0 auto; }
.st-quiz-opt.is-right { border-color: var(--st-ok); background: rgba(93, 211, 154, .12); }
.st-quiz-opt.is-wrong { border-color: var(--st-err); background: var(--st-err-soft); }
.st-quiz-ops { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.st-quiz-explain { margin-top: 16px; padding: 14px 16px; border-radius: var(--st-r-s); background: var(--st-card-2); font-size: 13px; color: var(--st-sub); }
.st-explain-head { font-weight: 700; margin-bottom: 6px; }
.st-explain-head.is-ok { color: var(--st-ok); }
.st-explain-head.is-bad { color: var(--st-err); }
.st-quiz-score { display: flex; gap: 24px; align-items: center; padding: 24px; border: 1px solid var(--st-border); border-radius: var(--st-r); background: var(--st-card); }
.st-score-ring { flex: 0 0 auto; width: 116px; height: 116px; border-radius: 50%; display: grid; place-items: center; text-align: center; border: 8px solid var(--st-accent); }
.st-score-ring b { display: block; font-size: 26px; color: var(--st-accent); }
.st-score-ring span { font-size: 11px; color: var(--st-faint); }
.st-score-detail h3 { margin: 0 0 8px; font-size: 18px; }
.st-score-detail p { margin: 4px 0; color: var(--st-sub); font-size: 13px; }
.st-score-ops { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.st-quiz-welcome { padding: 40px 24px; text-align: center; border: 1px dashed var(--st-border-2); border-radius: var(--st-r); background: var(--st-card); }
.st-quiz-welcome span { font-size: 36px; }
.st-quiz-welcome h3 { margin: 10px 0 6px; font-size: 19px; }
.st-quiz-welcome p { margin: 0 auto; max-width: 62ch; color: var(--st-sub); font-size: 13.5px; }
.st-wrong { margin-top: 16px; }
.st-wrong-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.st-wrong-head h3 { margin: 0; font-size: 16px; }
.st-wrong-head .st-btn:first-of-type { margin-left: auto; }
.st-wrong-item { padding: 14px 16px; margin-bottom: 10px; border: 1px solid var(--st-border); border-radius: var(--st-r-s); background: var(--st-card); }
.st-wrong-item b { font-size: 13.5px; }
.st-wrong-item p { margin: 6px 0; color: var(--st-ok); font-size: 13px; }
.st-wrong-item small { color: var(--st-faint); font-size: 12px; line-height: 1.7; display: block; }

/* ---------- 测试工具箱 ---------- */
.st-tool-grid { display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 18px; align-items: start; }
.st-tool-tabs { position: sticky; top: 68px; max-height: calc(100vh - 88px); overflow-y: auto; display: grid; gap: 6px; padding: 12px; border: 1px solid var(--st-border); border-radius: var(--st-r); background: var(--st-card); }
.st-tool-tab { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 2px 8px; padding: 9px 10px; text-align: left; border: 1px solid transparent; border-radius: var(--st-r-s); background: none; color: var(--st-sub); cursor: pointer; }
.st-tool-tab > span { grid-row: 1 / 3; font-size: 18px; align-self: center; }
.st-tool-tab b { font-size: 12.5px; color: var(--st-text); font-weight: 600; }
.st-tool-tab small { font-size: 10.5px; color: var(--st-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-tool-tab:hover { background: var(--st-card-2); }
.st-tool-tab.is-on { border-color: var(--st-accent); background: var(--st-accent-soft); }
.st-tool-tab.is-on b { color: var(--st-accent); }
.st-tool-main { min-width: 0; }
.st-tool-head, .st-tool-form, .st-tool-result, .st-tool-ops { padding: 18px 20px; border: 1px solid var(--st-border); background: var(--st-card); }
.st-tool-head { border-radius: var(--st-r) var(--st-r) 0 0; }
.st-tool-head h3 { margin: 0 0 6px; font-size: 18px; }
.st-tool-head p { margin: 0; color: var(--st-sub); font-size: 13px; }
.st-tool-form { border-top: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.st-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.st-field-wide { grid-column: 1 / -1; }
.st-field label { font-size: 12px; color: var(--st-sub); font-weight: 600; }
.st-field input[type="text"], .st-field input[type="number"], .st-field select, .st-field textarea {
    width: 100%; box-sizing: border-box; min-height: 38px; padding: 8px 10px;
    border: 1px solid var(--st-border-2); border-radius: 9px;
    background: var(--st-bg-2); color: var(--st-text); font-size: 14px;
}
.st-field textarea { resize: vertical; min-height: 96px; line-height: 1.7; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.st-field input:focus, .st-field select:focus, .st-field textarea:focus { outline: none; border-color: var(--st-accent); box-shadow: 0 0 0 3px var(--st-accent-soft); }
.st-field small { color: var(--st-faint); font-size: 11px; line-height: 1.6; }
.st-check { display: inline-flex !important; align-items: center; gap: 8px; min-height: 38px; }
.st-check input { width: 18px; height: 18px; accent-color: var(--st-accent); }
.st-check span { font-size: 13px; color: var(--st-text); font-weight: 400 !important; }
.st-tool-ops { border-top: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.st-tool-result { border-top: 0; border-radius: 0 0 var(--st-r) var(--st-r); min-height: 120px; }
.st-result-table { max-height: 460px; overflow: auto; }
.st-result-table th { background: var(--st-card-2); }
.st-result-note { margin-top: 14px; padding: 12px 14px; border-radius: var(--st-r-s); background: var(--st-blue-soft); }
.st-result-note h4 { margin: 0 0 6px; font-size: 13px; color: var(--st-blue); }
.st-result-note ul { margin: 0; padding-left: 20px; font-size: 12.5px; color: var(--st-sub); line-height: 1.8; }
.st-doc-out { white-space: pre-wrap; word-break: break-word; margin: 0; padding: 14px; border: 1px solid var(--st-border); border-radius: var(--st-r-s); background: var(--st-code-bg); max-height: 460px; overflow: auto; line-height: 1.7; }

/* ---------- 页脚 / 侧栏 / 抽屉 / toast ---------- */
.st-foot { margin-top: 26px; padding: 14px 18px; border: 1px dashed var(--st-border-2); border-radius: var(--st-r); color: var(--st-faint); font-size: 12px; }
.st-foot p { margin: 0; line-height: 1.8; }
.st-side {
    position: fixed; top: 0; left: 0; bottom: 0; width: min(86vw, 340px); z-index: 100001;
    transform: translateX(-102%); transition: transform .24s ease; display: flex; flex-direction: column;
    background: var(--st-bg-2); border-right: 1px solid var(--st-border); box-shadow: var(--st-shadow);
}
.st-side.is-open { transform: translateX(0); }
.st-side-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--st-border); }
.st-side-head strong { font-size: 15px; }
.st-tree { flex: 1 1 auto; overflow-y: auto; padding: 12px; }
.st-tree-cat { margin-bottom: 6px; }
.st-tree-cat-t, .st-tree-course-t, .st-tree-lesson {
    display: flex; align-items: center; gap: 6px; width: 100%; padding: 7px 8px; text-align: left;
    border: 0; border-radius: 8px; background: none; color: var(--st-text); cursor: pointer; font-size: 13px;
}
.st-tree-cat-t { font-weight: 600; }
.st-tree-cat-t em { margin-left: auto; font-style: normal; color: var(--st-faint); font-size: 11px; }
.st-tree-cat-t:hover, .st-tree-course-t:hover, .st-tree-lesson:hover { background: var(--st-card-2); }
.st-tree-caret { display: inline-block; color: var(--st-faint); transition: transform .18s; }
.st-tree-cat.is-open > .st-tree-cat-t .st-tree-caret { transform: rotate(90deg); }
.st-tree-courses { padding-left: 12px; border-left: 1px dashed var(--st-border); margin-left: 12px; }
.st-tree-course-t[aria-expanded="true"] .st-tree-caret { transform: rotate(90deg); }
.st-tree-lessons { padding-left: 10px; }
.st-tree-lesson { font-size: 12px; color: var(--st-sub); padding: 6px 8px; }
.st-tree-lesson.is-cur { background: var(--st-accent-soft); color: var(--st-accent); font-weight: 600; }
.st-side-mask { position: fixed; inset: 0; z-index: 100000; background: rgba(4, 8, 12, .6); }
.st-mask { position: fixed; inset: 0; z-index: 100002; display: flex; justify-content: flex-end; background: rgba(4, 8, 12, .58); }
.st-drawer { width: min(94vw, 430px); height: 100%; overflow-y: auto; background: var(--st-bg-2); border-left: 1px solid var(--st-border); box-shadow: var(--st-shadow); }
.st-drawer-head { display: flex; align-items: center; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--st-border); position: sticky; top: 0; background: var(--st-bg-2); }
.st-drawer-head h3 { margin: 0; font-size: 15px; flex: 1 1 auto; }
.st-drawer-body { padding: 14px 16px 40px; }
.st-note-item { padding: 12px 14px; margin-bottom: 10px; border: 1px solid var(--st-border); border-radius: var(--st-r-s); background: var(--st-card); }
.st-note-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.st-note-head strong { font-size: 13px; }
.st-note-head small { color: var(--st-faint); font-size: 11px; }
.st-note-head .st-btn { margin-left: auto; }
.st-note-item p { margin: 8px 0; font-size: 13px; color: var(--st-sub); white-space: pre-wrap; }
.st-note-link { border: 0; background: none; color: var(--st-accent); cursor: pointer; font-size: 12px; padding: 0; }
.st-note-editor { position: fixed; inset: 0; z-index: 100004; display: grid; place-items: center; padding: 18px; background: rgba(4, 8, 12, .66); }
.st-note-box { width: min(96vw, 520px); padding: 20px; border-radius: var(--st-r); background: var(--st-card); border: 1px solid var(--st-border); box-shadow: var(--st-shadow); }
.st-note-box h3 { margin: 0 0 12px; font-size: 17px; }
.st-note-box textarea { width: 100%; box-sizing: border-box; min-height: 180px; padding: 12px; border: 1px solid var(--st-border-2); border-radius: var(--st-r-s); background: var(--st-bg-2); color: var(--st-text); font-size: 15px; line-height: 1.7; resize: vertical; }
.st-note-ops { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.st-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100010; padding: 11px 18px; border-radius: 999px; background: var(--st-card-3); color: var(--st-text); border: 1px solid var(--st-border-2); box-shadow: var(--st-shadow); font-size: 13px; max-width: 88vw; text-align: center; }
.st-noscript { max-width: 760px; margin: 40px auto; padding: 20px; border: 1px solid var(--st-border); border-radius: var(--st-r); text-align: center; }

/* ---------- 响应式（断点降序，后者覆盖前者） ---------- */
@media (min-width: 1600px) {
    .st { padding: 28px 36px 88px; }
    .st-grid { grid-template-columns: repeat(auto-fill, minmax(296px, 1fr)); gap: 16px; }
    .st-lesson-grid { grid-template-columns: minmax(0, 1fr) 300px; }
    .st-wiki-grid { grid-template-columns: 330px minmax(0, 1fr); }
    .st-tool-grid { grid-template-columns: 282px minmax(0, 1fr); }
}
@media (max-width: 1280px) {
    .st-wiki-grid { grid-template-columns: 260px minmax(0, 1fr); }
    .st-tool-grid { grid-template-columns: 226px minmax(0, 1fr); }
    .st-lesson-grid { grid-template-columns: minmax(0, 1fr) 230px; }
}
@media (max-width: 1100px) {
    .st-lesson-grid, .st-wiki-grid, .st-tool-grid { grid-template-columns: minmax(0, 1fr); }
    .st-toc, .st-wiki-nav, .st-tool-tabs { position: static; max-height: none; }
    .st-toc { order: -1; }
    .st-toc-item { display: inline-flex; width: auto; margin: 0 5px 5px 0; border: 1px solid var(--st-border); }
    .st-toc h3 { width: 100%; }
    .st-tool-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; }
    .st-wiki-nav { max-height: 320px; }
    .st-term-layout { grid-template-columns: minmax(160px, 260px) minmax(0, 1fr); }
}
@media (max-width: 900px) {
    .st { padding: 16px 16px 64px; }
    .st-hero { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 18px; }
    .st-hero-r { flex-direction: row; flex-wrap: wrap; align-items: center; }
    .st-side-toggle { align-self: auto; }
    .st-search { flex: 1 1 260px; }
    .st-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .st-stat:nth-child(4) { border-left: 0; border-top: 1px solid var(--st-border); }
    .st-stat:nth-child(5) { border-top: 1px solid var(--st-border); }
    .st-stat:nth-child(n+4) { border-top: 1px solid var(--st-border); }
    .st-tabs { top: 0; }
    .st-tool-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    .st-hero-ic { width: 46px; height: 46px; font-size: 25px; }
    .st-hero-t h1 { font-size: 23px; }
    .st-hero-t p { font-size: 13px; }
    .st-hero-tags span { font-size: 11px; }
    .st-tabs {
        top: 53px; overflow-x: auto; flex-wrap: nowrap; scroll-snap-type: x proximity;
        scrollbar-width: none; -webkit-overflow-scrolling: touch;
    }
    .st-tabs::-webkit-scrollbar { display: none; }
    .st-tab { flex: 0 0 auto; scroll-snap-align: start; min-height: 44px; }
    .st-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .st-stat { padding: 12px 14px; }
    .st-stat:nth-child(n+3) { border-top: 1px solid var(--st-border); }
    .st-stat:nth-child(odd) { border-left: 0; }
    .st-stat b { font-size: 19px; }
    .st-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
    .st-card { padding: 14px; }
    .st-chip { min-height: 40px; padding: 0 14px; font-size: 13px; }
    .st-btn { min-height: 44px; font-size: 13.5px; }
    .st-btn-xs { min-height: 38px; }
    .st-side-toggle, .st-search { min-height: 44px; }
    .st-tool-form { grid-template-columns: minmax(0, 1fr); }
    .st-field input[type="text"], .st-field input[type="number"], .st-field select, .st-field textarea,
    .st-quiz-bar select, .st-terms-head input, .st-note-box textarea, .st-search input {
        font-size: 16px; min-height: 44px;
    }
    .st-lesson-main, .st-wiki-body, .st-terms, .st-tool-head, .st-tool-form, .st-tool-ops, .st-tool-result, .st-quiz-card { padding: 16px 14px; }
    .st-lesson-main h1 { font-size: 22px; }
    .st-body > p, .st-body > ul, .st-body > ol, .st-body > h2, .st-body > h3, .st-body > blockquote { max-width: 100%; }
    .st-term-layout { grid-template-columns: minmax(0, 1fr); }
    .st-term-list { max-height: 240px; }
    .st-terms-head input { max-width: none; flex: 1 1 100%; }
    .st-quiz-bar select { flex: 1 1 calc(50% - 8px); }
    .st-quiz-score { flex-direction: column; text-align: center; }
    .st-quiz-opt { min-height: 48px; }
    .st-tool-tabs { grid-template-columns: minmax(0, 1fr); }
    .st-tool-tab small { white-space: normal; }
    .st-pager { gap: 8px; }
    .st-pager .st-btn { flex: 1 1 0; }
    .st-table-wrap, .st-code-wrap pre, .st-doc-out { max-width: 100%; }
    .st-side { width: min(90vw, 360px); }
    .st-mask { align-items: flex-end; }
    .st-drawer { width: 100%; max-height: 86vh; border-radius: 16px 16px 0 0; border-left: 0; }
    .st-note-box { padding: 16px; }
    .st-note-box textarea { min-height: 140px; }
    .st-toast { bottom: calc(16px + env(safe-area-inset-bottom)); }
}
@media (max-width: 480px) {
    .st { padding: 12px 12px 56px; }
    .st-hero { padding: 14px; }
    .st-hero-l { gap: 12px; }
    .st-hero-ic { width: 40px; height: 40px; font-size: 22px; }
    .st-hero-t h1 { font-size: 20px; }
    .st-hero-tags { gap: 4px; }
    .st-hero-tags span { padding: 2px 7px; font-size: 10.5px; }
    .st-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .st-stat { padding: 10px 12px; }
    .st-grid { grid-template-columns: minmax(0, 1fr); }
    .st-crumb { font-size: 11.5px; }
    .st-quiz-bar select { flex: 1 1 100%; }
    .st-quiz-card h3 { font-size: 16px; }
    .st-tool-ops .st-btn { flex: 1 1 calc(50% - 8px); }
}
@media (hover: none) {
    .st-card:hover { transform: none; }
    .st-btn:hover, .st-chip:hover, .st-tab:hover { background: inherit; }
    .st-tab.is-on:hover { background: var(--st-accent-soft); }
}
@media (prefers-reduced-motion: reduce) {
    .st *, .st-spinner { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
@media print {
    .st-tabs, .st-hero-r, .st-side, .st-side-mask, .st-mask, .st-note-editor, .st-toast,
    .st-tool-ops, .st-lesson-ops, .st-pager, .st-toc, .st-foot { display: none !important; }
    .st { max-width: none; padding: 0; }
    .st-card, .st-lesson-main { box-shadow: none; break-inside: avoid; }
    .st-body > p, .st-body > ul, .st-body > ol { max-width: none; }
}
