/* 面试刷题库 · doc.xlingo.fun/langchain 同款米绿主题。CJK 字体栈 + 整数字号，无负字距。 */
:root {
  /* 参考站 token（浅色） */
  --bg: #f6f7f2;
  --bg-sidebar: #f0f3ed;
  --bg-topbar: rgba(246, 247, 242, .88);
  --border-topbar: rgba(37, 55, 51, .1);
  --bg-elevated: #fbfcf8;
  --bg-input: #f9faf7;
  --bg-hover: #e7eee6;
  --bg-active: #dcece3;
  --border: #e0e4dc;
  --border-soft: #e4e9e2;
  --border-control: #dce1d9;
  --text: #1d2a2a;
  --text-body: #2c3a37;
  --text-title: #173e36;
  --text-h2: #1e5549;
  --text-secondary: #4a5b56;
  --muted: #7d8a84;
  --faint: #9ca69f;
  --primary: #1e5d50;
  --primary-deep: #185043;
  --accent-bar: #29806c;
  --primary-soft: #e3efe9;
  --link: #16755e;
  --code-bg: #eef3ed;
  --code-text: #1f6c58;
  --pre-bg: #19302b;
  --pre-text: #d5eee5;
  --danger: #a85246;
  /* md 表格/引用/计数徽章 */
  --table-head-bg: #eaf2ea;
  --table-head-text: #31584f;
  --table-stripe: #f4f8f4;
  --quote-bg: #edf5ee;
  --quote-text: #4a605a;
  --cnt-active-bg: #cfe4da;
  /* 语义色（难度/状态） */
  --card: #fbfcf8;
  --green: #2f8f6b;
  --green-soft: #e3f2ea;
  --orange: #b45309;
  --orange-soft: #fbeedd;
  --red: #b04430;
  --red-soft: #f9e8e3;
  --gold: #b45309;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(28, 47, 41, 0.06);
  --shadow-pop: 0 18px 40px rgba(28, 47, 41, 0.12);
  --font: Manrope,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans CJK SC",-apple-system,"Segoe UI",Arial,sans-serif;
  --serif: "Noto Serif SC",Songti SC,STSong,SimSun,"Noto Serif CJK SC",serif;
  --mono: "DM Mono","JetBrains Mono",SFMono-Regular,Consolas,"Noto Sans Mono CJK SC",monospace;
  color-scheme: light;
  scrollbar-color: #bcc9c0 transparent;
}
/* ---------- 暗色主题（token 取自 doc.xlingo.fun/langchain 暗色版） ---------- */
:root[data-appearance="dark"] {
  --bg: #0f1614;
  --bg-sidebar: #131c19;
  --bg-elevated: #17211f;
  --bg-input: #16201e;
  --bg-hover: #1d2926;
  --bg-active: #1b3b32;
  --border: #253230;
  --border-soft: #222e2b;
  --border-control: #2b3835;
  --text: #dde6e2;
  --text-body: #c9d5d0;
  --text-title: #edf5f1;
  --text-h2: #7fd3b3;
  --text-secondary: #aab8b2;
  --muted: #8a9893;
  --faint: #78857f;
  --primary: #2c8f76;
  --primary-deep: #58a68c;
  --accent-bar: #46b592;
  --primary-soft: #1b3b32;
  --link: #5fcfad;
  --code-bg: #16221f;
  --code-text: #7fdcbb;
  --pre-bg: #0a1211;
  --pre-text: #d5eee5;
  --danger: #f0a396;
  /* 语义色（暗色降饱和） */
  --card: #17211f;
  --green: #4fb589;
  --green-soft: #16302a;
  --orange: #d9a066;
  --orange-soft: #2e2416;
  --red: #e08a76;
  --red-soft: #2e1d19;
  --table-head-bg: #1a2724;
  --table-head-text: #a4d4c2;
  --table-stripe: #131c19;
  --quote-bg: #14231f;
  --quote-text: #b3c4be;
  --cnt-active-bg: #1b3b32;
  --gold: #d9a066;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-pop: 0 18px 40px rgba(0, 0, 0, 0.5);
  --bg-topbar: rgba(15, 22, 20, .86);
  --border-topbar: rgba(255, 255, 255, .07);
  color-scheme: dark;
  scrollbar-color: #2b3835 transparent;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: 100%;
  /* 滚动条常驻占位：内容长短变化时视口宽度不变，居中布局不会左右横移 7.5px */
  scrollbar-gutter: stable;
}
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  letter-spacing: 0;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--primary-deep); }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

/* ---------- 顶栏（参考站同款：fixed + 毛玻璃） ---------- */
.topbar {
  position: fixed; z-index: 30; top: 0; right: 0; left: 0;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  height: 64px; padding: 0 26px;
  background: var(--bg-topbar);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-topbar);
}
.brand { display: flex; align-items: center; gap: 11px; color: var(--text); user-select: none; flex: none; min-width: 0; }
.brand:hover { opacity: .74; }
/* 顶栏所有文字一律不换行、不逐字竖排（窄屏 flex 收缩的经典坑） */
.topbar, .topbar * { white-space: nowrap; }
.topbar .btn, .topbar .username, .brand-text strong, .brand-text small { flex: none; }
.brand-mark {
  display: grid; width: 33px; height: 33px; place-items: center;
  color: var(--card); border-radius: 10px 10px 10px 2px; background: var(--primary);
}
.brand-mark svg { display: block; }
.brand-text strong { display: block; font-size: 14px; letter-spacing: -.2px; line-height: 1.25; }
.brand-text small {
  display: block; margin-top: 1px; color: var(--muted);
  font-size: 10px; font-weight: 700; letter-spacing: .6px;
}
.topbar-search { flex: 1; max-width: 460px; }
.topbar-search input {
  width: 100%; height: 38px; padding: 0 15px;
  border: 1px solid var(--border-control); border-radius: 10px;
  background: var(--bg-input); font-size: 14px; color: var(--text); outline: none;
}
.topbar-search input:focus {
  border-color: var(--accent-bar);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-bar) 22%, transparent);
}
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar-user .username { color: var(--text-secondary); font-size: 14px; }

/* ---------- 主题切换（参考站同款三格分段控件） ---------- */
.theme-switch {
  display: flex; align-items: center; gap: 2px; padding: 2px; flex: none;
  border: 1px solid var(--border-control); border-radius: 9px; background: var(--bg-elevated);
}
.theme-switch button {
  display: grid; width: 28px; height: 25px; place-items: center; border: 0; border-radius: 7px;
  color: var(--muted); background: transparent;
  transition: color .15s ease, background .15s ease;
}
.theme-switch button:hover { color: var(--accent-bar); background: var(--bg-hover); }
.theme-switch button[aria-pressed="true"] { color: var(--text-h2); background: var(--bg-active); }
.theme-switch svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--border-control); background: var(--bg-elevated);
  font-size: 14px; color: var(--text);
}
.btn:hover { border-color: var(--accent-bar); background: var(--bg-hover); }
/* 禁用态：必须一眼看出不可点（分页首/末页会用到） */
.btn:disabled,
.btn[disabled] {
  opacity: .42; cursor: not-allowed;
  color: var(--muted); background: var(--bg-sidebar); border-color: var(--border-soft);
}
.btn:disabled:hover,
.btn[disabled]:hover { border-color: var(--border-soft); background: var(--bg-sidebar); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fdfdf9; font-weight: 500; }
.btn-primary:hover { background: #1b715e; border-color: #1b715e; color: #fdfdf9; }
.btn-ghost { border: none; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--bg-hover); color: var(--text); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
/* 汉堡按钮（移动端目录） */
.nav-toggle {
  display: none; width: 36px; height: 36px; flex: none;
  border: 1px solid var(--border-control); border-radius: 9px;
  background: var(--bg-elevated); color: var(--text); font-size: 17px; line-height: 1;
}

/* ---------- 布局 ---------- */
.layout { display: flex; max-width: 1160px; margin: 0 auto; align-items: flex-start; }
.sidebar {
  width: 240px; flex: none; position: sticky; top: 80px;
  max-height: calc(100vh - 96px); overflow-y: auto; overflow-anchor: none;
  margin: 16px 0 16px 16px; padding: 12px 10px;
  background: var(--bg-sidebar); border: 1px solid var(--border-soft);
  border-radius: 14px;
}
.sidebar h3 {
  font-size: 12px; color: var(--muted); font-weight: 700;
  padding: 12px 10px 4px; letter-spacing: .5px;
}
.sidebar .cat-item {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 12px; border-radius: 9px; font-size: 14px; color: var(--text);
  /* 字重恒定：600 会让 CJK 字宽变化，导致点击时文字左右挪动 */
  font-weight: 500;
  cursor: pointer;
}
.sidebar .cat-item:hover { background: var(--bg-hover); }
.sidebar .cat-item.active { background: var(--bg-active); color: var(--text-h2); }
/* 激活条用绝对定位的伪元素画，完全脱离文档流，不挤压任何内容 */
.sidebar .cat-item.active::before {
  content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px;
  border-radius: 0 2px 2px 0; background: var(--accent-bar);
}
/* 图标间距走 CSS（原先由 JS 内联注入，重建时会有一帧无间距导致文字横跳） */
.sidebar .cat-item > span:first-child { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.sidebar .cat-item svg { flex: none; }
.sidebar .cat-item .cnt {
  font-size: 12px; color: var(--muted); flex: none;
  background: var(--bg-elevated); border-radius: 9px; padding: 0 8px; line-height: 18px;
}
.sidebar .cat-item.active .cnt { background: var(--cnt-active-bg); color: var(--text-h2); }
.sidebar .divider { height: 1px; background: var(--border); margin: 8px 6px; }
/* min-height 双重作用：1) "加载中→内容"不产生高度塌陷 2) 页面始终略高于视口，
   滚动条恒定存在，兜住不支持 scrollbar-gutter 的旧 Safari（否则布局会左右横移） */
.content { flex: 1; min-width: 0; padding: 96px 22px 60px; min-height: calc(100vh + 1px); }

/* 移动端搜索条 / 横向滚动表格 */
.m-search { display: none; margin-bottom: 14px; }
.m-search input {
  width: 100%; height: 38px; padding: 0 14px;
  border: 1px solid var(--border-control); border-radius: 10px;
  background: var(--bg-input); font-size: 15px; color: var(--text); outline: none;
}
.m-search input:focus { border-color: var(--accent-bar); }
.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* 移动端抽屉 */
.sidebar-mask { display: none; }
.scrim {
  position: fixed; inset: 0; z-index: 39; background: rgba(28, 47, 41, .32);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
:root[data-appearance="dark"] .scrim { background: rgba(0, 0, 0, .5); }
body.nav-open .scrim { opacity: 1; pointer-events: auto; }

/* ---------- 首页 ---------- */
.hero {
  background: linear-gradient(135deg, #1e5d50 0%, #2d6b58 55%, #3f7d63 100%);
  border-radius: 16px; color: #f1fbf7; padding: 36px 34px; margin-bottom: 18px;
  box-shadow: 0 10px 24px rgba(25, 48, 43, .18);
}
.hero h1 { font-family: var(--serif); font-size: 27px; font-weight: 700; margin-bottom: 8px; letter-spacing: 0; text-wrap: balance; }
.hero p { font-size: 15px; opacity: .92; max-width: 640px; }
.stats-row { display: flex; gap: 14px; margin: 18px 0; flex-wrap: wrap; }
.stat-card {
  flex: 1; min-width: 140px; background: var(--bg-elevated); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px;
}
.stat-card .num { font-family: var(--serif); font-size: 26px; font-weight: 700; color: var(--text-h2); }
.stat-card .label { font-size: 13px; color: var(--muted); margin-top: 2px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
/* 首页按语言分三组（Java / Python / 大模型应用），19 张卡不再糊成一片 */
.home-lang {
  font-family: var(--serif); font-size: 15px; color: var(--text-title);
  margin: 22px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.home-lang:first-child { margin-top: 4px; }
.home-card {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.home-card:hover { border-color: var(--accent-bar); box-shadow: 0 4px 14px rgba(25, 48, 43, .08); }
.home-card h4 { font-size: 15px; font-weight: 600; color: var(--text-title); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.home-card h4 .cnt { font-size: 12px; color: var(--muted); font-weight: 400; flex: none; }
.home-card .bar { height: 6px; background: var(--bg-active); border-radius: 3px; margin-top: 12px; overflow: hidden; }
.home-card .bar .fill { height: 100%; background: var(--accent-bar); border-radius: 3px; }
.home-card .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ---------- 列表 ---------- */
.filter-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 14px;
}
.filter-bar .flabel { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.pill {
  height: 28px; padding: 0 13px; border-radius: 14px; border: 1px solid var(--border-control);
  background: var(--bg-elevated); font-size: 13px; color: var(--muted);
}
.pill:hover { border-color: var(--accent-bar); color: var(--text); }
.pill.active { background: var(--primary); border-color: var(--primary); color: #fdfdf9; }
.filter-bar .spacer { flex: 1; }
.q-list { display: flex; flex-direction: column; gap: 10px; }
.q-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; cursor: pointer; transition: border-color .15s;
}
.q-item:hover { border-color: var(--accent-bar); }
.q-item .q-title { font-size: 15px; font-weight: 500; color: var(--text); flex: 1; min-width: 0; }
.q-item:hover .q-title { color: var(--text-h2); }
.q-item .q-tags { display: flex; gap: 6px; flex: none; }
.tag {
  font-size: 12px; color: var(--text-secondary); background: var(--code-bg);
  border-radius: 5px; padding: 1px 8px; line-height: 20px;
}
.diff { flex: none; font-size: 12px; font-weight: 500; border-radius: 5px; padding: 1px 8px; line-height: 20px; }
.diff-1 { color: var(--green); background: var(--green-soft); }
.diff-2 { color: var(--orange); background: var(--orange-soft); }
.diff-3 { color: var(--red); background: var(--red-soft); }
.st-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.st-1 { background: var(--green); }
.st-2 { background: var(--orange); }
.st-3 { background: var(--red); }
.st-none { background: var(--border-control); }
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
.pager .page-info { font-size: 14px; color: var(--muted); }
.fav-star { flex: none; display: inline-flex; color: var(--gold); }
.fav-star svg { vertical-align: -2px; }
.empty {
  text-align: center; color: var(--text-secondary); padding: 54px 20px; font-size: 15px;
  line-height: 1.9;
  background: var(--bg-elevated); border: 1px dashed var(--border-control); border-radius: var(--radius);
}
.empty .empty-sub { font-size: 13px; color: var(--muted); }

/* ---------- 详情 ---------- */
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--link); }
.q-head {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px 26px; margin-bottom: 14px;
  box-shadow: inset 3px 0 0 var(--accent-bar);
}
.q-head h1 { font-family: var(--serif); font-size: 21px; font-weight: 700; line-height: 1.5; color: var(--text-title); margin-bottom: 12px; }
.q-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.answer-card {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 30px;
}
.answer-hidden { text-align: center; padding: 46px 0; }
.answer-hidden p { color: var(--muted); font-size: 14px; margin-bottom: 18px; }
.mark-bar {
  position: sticky; bottom: calc(12px + env(safe-area-inset-bottom)); margin-top: 20px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-pop); padding: 14px 16px;
}
.mark-bar .mk-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.mark-bar .flabel { font-size: 13px; color: var(--text-secondary); }
.mark-bar .flabel em { font-style: normal; color: var(--muted); font-size: 12px; margin-left: 8px; }
.mark-bar .mk-row { display: flex; gap: 10px; }
.mark-bar .mk-row .btn { flex: 1; height: 40px; border-radius: 11px; font-size: 14px; padding: 0 6px; }
/* 主操作实心绿；其余 tonal 淡底深字，语义保留、重量降档 */
.mark-1 { background: var(--primary); border-color: var(--primary); color: #fdfdf9; }
.mark-1:hover { background: #1b715e; border-color: #1b715e; color: #fdfdf9; }
.mark-2 { background: var(--orange-soft); border-color: transparent; color: var(--orange); }
.mark-2:hover { border-color: var(--orange); }
.mark-3 { background: var(--red-soft); border-color: transparent; color: var(--red); }
.mark-3:hover { border-color: var(--red); }
/* 已选：currentColor 描边环高亮，不再用降透明度 */
.mark-bar .marked { box-shadow: 0 0 0 2px var(--bg-elevated), 0 0 0 4px currentColor; }

/* ---------- Markdown 渲染 ---------- */
.md { color: var(--text-body); }
.md h2 {
  font-family: var(--serif); font-size: 17px; font-weight: 700; color: var(--text-title);
  margin: 26px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.md h2:first-child { margin-top: 0; }
.md h3 { font-family: var(--serif); font-size: 15px; font-weight: 600; color: var(--text-h2); margin: 18px 0 8px; }
.md p { margin: 10px 0; }
.md ul, .md ol { margin: 10px 0; padding-left: 24px; }
.md li { margin: 4px 0; }
.md li::marker { color: var(--accent-bar); }
.md strong { font-weight: 600; color: var(--text-h2); }
.md code {
  font-family: var(--mono); font-size: 13px;
  background: var(--code-bg); border: 1px solid var(--border-soft);
  border-radius: 4px; padding: 1px 6px; color: var(--code-text);
}
/* 表格：窄屏包一层横向滚动，列不再被压成逐字竖排 */
.md .tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 14px 0; }
.md .tbl-scroll table { margin: 0; min-width: 460px; }
.md table { border-collapse: collapse; margin: 14px 0; width: 100%; font-size: 14px; }
.md th, .md td { border: 1px solid var(--border-control); padding: 7px 12px; text-align: left; }
.md th { background: var(--table-head-bg); color: var(--table-head-text); font-weight: 600; }
.md tr:nth-child(even) td { background: var(--table-stripe); }
.md blockquote {
  border-left: 3px solid var(--accent-bar); background: var(--quote-bg);
  border-radius: 0 8px 8px 0; padding: 8px 14px; margin: 12px 0; color: var(--quote-text);
}
.md pre code { border: none; background: none; padding: 0; }
.codehilite {
  background: var(--pre-bg); border-radius: 10px; padding: 16px 18px; overflow-x: auto;
  margin: 14px 0; line-height: 1.6; box-shadow: 0 10px 24px rgba(25, 48, 43, .09);
}
.codehilite pre { margin: 0; }
.codehilite code {
  font-family: var(--mono); font-size: 13px; background: none; padding: 0;
  color: var(--pre-text); border-radius: 0;
}

/* ---------- 登录弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(28, 47, 41, 0.4);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px;
}
.modal {
  width: 380px; max-width: 100%;
  background: var(--bg-elevated); border-radius: 14px; padding: 30px 30px 26px;
  box-shadow: var(--shadow-pop);
}
.modal h3 { font-family: var(--serif); font-size: 18px; color: var(--text-title); margin-bottom: 6px; }
.modal .sub { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.modal label { display: block; font-size: 13px; color: var(--text-secondary); margin: 12px 0 4px; }
.modal input {
  width: 100%; height: 38px; padding: 0 12px; font-size: 14px; color: var(--text);
  border: 1px solid var(--border-control); border-radius: 9px; outline: none; background: var(--bg-input);
}
.modal input:focus { border-color: var(--accent-bar); box-shadow: 0 0 0 3px rgba(41, 128, 108, .18); }
.modal .err { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; }
.modal .actions { display: flex; gap: 10px; margin-top: 16px; }
.modal .actions .btn { flex: 1; height: 38px; }

/* ---------- toast ---------- */
#toast {
  position: fixed; top: 76px; left: 50%; transform: translateX(-50%);
  background: var(--bg-active); color: var(--text-title); font-size: 14px;
  border: 1px solid var(--border-control);
  border-radius: 9px; padding: 9px 20px; z-index: 200;
  opacity: 0; transition: opacity .2s; pointer-events: none;
  max-width: calc(100vw - 40px); text-align: center;
}
#toast.show { opacity: .96; }

/* ---------- 响应式 ---------- */
@media (min-width: 861px) {
  .nav-toggle { display: none !important; }
  /* 桌面端顶栏已有用户区，抽屉里不重复 */
  .drawer-user { display: none; }
}
@media (max-width: 860px) {
  .topbar { height: 56px; padding: 0 12px; gap: 8px; }
  .brand-text small { display: none; }
  .theme-switch button { width: 25px; }
  /* 窄屏顶栏只保留：汉堡 + logo + 主题切换 + 登录/头像。
     用户名、我的进度、退出全部移入抽屉，避免 flex 挤压成竖排。 */
  .topbar-user .username,
  .topbar-user #btn-stats,
  .topbar-user #btn-logout { display: none; }
  /* 抽屉里的用户区 */
  .drawer-user { display: block; border-top: 1px solid var(--border); margin: 10px 6px 4px; padding-top: 10px; }
  .drawer-user .du-name {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--muted); padding: 4px 12px 8px;
  }
  .drawer-user .cat-item { color: var(--text); }
  .nav-toggle { display: grid; place-items: center; }
  .topbar-search { display: none; }
  .m-search { display: block; }
  .tbl-wrap { margin: 0 -16px; padding: 0 16px; }
  /* 抽屉式侧栏 */
  .layout { display: block; }
  .content { padding: 76px 14px 40px; }
  .sidebar {
    position: fixed; z-index: 40; top: 0; bottom: 0; left: 0;
    width: 284px; max-height: none; margin: 0; border-radius: 0;
    border-top: none; border-bottom: none; border-left: none;
    box-shadow: 16px 0 32px rgba(28, 47, 41, .12);
    transform: translateX(-100%); transition: transform .22s ease;
    overscroll-behavior: contain;
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .sidebar-mask { display: block; }
  .q-item { padding: 12px 14px; }
  .q-item .q-tags { display: none; }
  .q-head, .answer-card { padding: 18px 16px; }
  /* 悬浮评分条高度的底部留白，避免盖住答案末尾内容 */
  .answer-card { padding-bottom: calc(120px + env(safe-area-inset-bottom)); }
  .mark-bar { bottom: calc(10px + env(safe-area-inset-bottom)); padding: 12px 12px; }
  .mark-bar .mk-row { gap: 8px; }
  .mark-bar .mk-row .btn { height: 42px; font-size: 13px; }
  .hero { padding: 26px 20px; }
  .stats-row { gap: 10px; }
  .stat-card { min-width: calc(50% - 5px); padding: 13px 14px; }
  .stat-card .num { font-size: 22px; }
  .home-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .home-card { padding: 14px; }
  .pager { flex-wrap: wrap; gap: 10px; }
}

@media (max-width: 400px) {
  .home-grid { grid-template-columns: 1fr; }
  .stat-card { min-width: 100%; }
}
