/* ==========================================================================
   Math for Happiness — 结构与基础排版
   颜色与字体由 theme-a/b/c 覆盖；这里只管骨架、间距、响应式。
   ========================================================================== */

:root {
  --rail-w: 288px;
  --content-max: 1040px;
  --pad-x: clamp(20px, 4.2vw, 56px);
  --radius: 10px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --font-sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC",
    system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 104px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

[hidden] { display: none !important; }

a { color: inherit; }

::selection { background: var(--sel); color: var(--sel-ink); }

.skip {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  font-size: 13px;
  transition: top 0.2s var(--ease);
}
.skip:focus-visible { top: 12px; }

/* ---------- 外壳 ---------- */

.shell {
  display: flex;
  align-items: flex-start;
  min-height: 100vh;
}

/* ---------- 左侧目录 ---------- */

.rail {
  position: sticky;
  top: 0;
  z-index: 60;
  flex: 0 0 var(--rail-w);
  width: var(--rail-w);
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 22px 18px 16px;
  border-right: 1px solid var(--rule);
  background: var(--rail-bg);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.rail-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 11px;
  background: var(--accent);
  color: var(--accent-ink);
}

.brand-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.brand-text b {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  white-space: nowrap;
}
.brand-text i {
  font-style: normal;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  color: var(--muted);
  white-space: nowrap;
}

.rail-close { display: none; }

/* 搜索框 */
.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  height: 38px;
  border: 1px solid var(--rule);
  border-radius: 9px;
  background: var(--field-bg);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.search-icon { color: var(--muted); flex: 0 0 auto; }
.search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  height: 100%;
}
.search-input::placeholder { color: var(--muted); }
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* 目录导航 */
.rail-nav { display: flex; flex-direction: column; gap: 6px; }
.rail-label {
  margin: 0 0 2px;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
}
.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav-list a {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 7px;
  text-decoration: none;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.4;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.nav-list a:hover { background: var(--hover); color: var(--ink); }
.nav-no {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  flex: 0 0 17px;
}
.nav-text { flex: 1 1 auto; min-width: 0; }
.nav-count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.nav-list a.is-active {
  background: var(--active-bg);
  color: var(--ink);
  font-weight: 500;
}
.nav-list a.is-active .nav-no { color: var(--accent); }

/* 侧栏页脚 */
.rail-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
}
.rail-stats { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.rail-stats b {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--ink);
  font-weight: 600;
}
.rail-meta { display: flex; flex-direction: column; gap: 2px; font-size: 11.5px; color: var(--muted); }

.skin-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.skin-toggle:hover { color: var(--ink); border-color: var(--ink-3); background: var(--field-bg); }
.skin-toggle svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.skin-toggle .ic-moon { display: none; fill: none; }
html[data-theme="i"] .skin-toggle .ic-sun { display: none; }
html[data-theme="i"] .skin-toggle .ic-moon { display: block; }

/* ---------- 顶部吸顶导航 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  backdrop-filter: blur(16px) saturate(1.15);
  border-bottom: 1px solid var(--rule);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: calc(var(--content-max) + var(--pad-x) * 2);
  margin: 0 auto;
  padding: 11px var(--pad-x);
}

.topbar .brand { flex: 0 0 auto; }
.topbar .brand-mark {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border-radius: 10px;
}
.topbar .brand-text b { font-size: 16px; }

.topbar .search {
  flex: 1 1 auto;
  max-width: 320px;
  margin-left: auto;
}

.topbar .skin-toggle { flex: 0 0 auto; }

.topnav {
  max-width: calc(var(--content-max) + var(--pad-x) * 2);
  margin: 0 auto;
  padding: 0 var(--pad-x) 4px;
}

.topnav .nav-list {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0 18px;
  padding: 0 0 5px;
}

.topnav .nav-list a {
  flex: 0 0 auto;
  gap: 7px;
  padding: 6px 0;
  font-size: 12.5px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  white-space: nowrap;
  background: none;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.topnav .nav-list a:hover { background: none; color: var(--ink); }
.topnav .nav-no,
.topnav .nav-count { font-size: 10px; }
.topnav .nav-no { flex: 0 0 auto; }
.topnav .nav-text { flex: 0 0 auto; }
.topnav .nav-list a.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: none;
}
.topnav .nav-list a.is-active .nav-no { color: var(--accent); }

/* 顶栏分组的下拉分类面板 */
.topnav .nav-list .nav-item { position: relative; }
.topnav .nav-list .nav-item.has-panel > .nav-link::after {
  content: "";
  display: inline-block;
  width: 0.28em;
  height: 0.28em;
  margin-left: 1px;
  border-right: 1.4px solid currentColor;
  border-bottom: 1.4px solid currentColor;
  transform: translateY(-0.18em) rotate(45deg);
  opacity: 0.45;
}
.topnav .nav-list .nav-item.is-open > .nav-link::after { opacity: 0.9; }

.nav-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: -10px;
  z-index: 60;
  min-width: 210px;
  max-width: 300px;
  padding: 7px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--rail-bg);
  box-shadow: 0 14px 34px rgb(0 0 0 / 0.1);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-panel-all {
  padding: 6px 9px 8px;
  margin-bottom: 3px;
  border-bottom: 1px solid var(--rule);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.nav-panel-all:hover { color: var(--accent); }
.nav-panel-list { display: flex; flex-direction: column; gap: 1px; }
.nav-panel-list a {
  padding: 6px 9px;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: normal;
  line-height: 1.5;
}
.nav-panel-list a:hover {
  background: var(--active-bg);
  color: var(--ink);
}
/* 靠右的两项，面板改从右侧对齐，避免溢出视口 */
.topnav .nav-list .nav-item:nth-last-child(-n + 2) .nav-panel {
  left: auto;
  right: -10px;
}

/* ---------- 主区 ---------- */

.main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.mobile-bar { display: none; }

/* 首屏 */
.hero {
  padding: clamp(34px, 5.2vw, 64px) var(--pad-x) clamp(30px, 4vw, 46px);
  max-width: calc(var(--content-max) + var(--pad-x) * 2);
  width: 100%;
  margin: 0 auto;
  border-bottom: 1px solid var(--rule);
}

.hero-title-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 20px;
}
.hero-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(44px, 7.4vw, 92px);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.025em;
}
.hero-toggle {
  flex: 0 0 auto;
  position: relative;
  width: 34px;
  height: 34px;
  margin-top: clamp(8px, 1.4vw, 18px);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.hero-toggle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: translate(-50%, -68%) rotate(45deg);
  transition: transform 0.22s var(--ease);
}
.hero-toggle:hover { background: var(--hover); color: var(--accent); }
.hero-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hero-toggle.is-open::after { transform: translate(-50%, -32%) rotate(-135deg); }
.hero-title em {
  font-style: italic;
  color: var(--accent);
}

.hero-about {
  margin: 0 0 30px;
  max-width: 64em;
}
.hero-about .prose {
  margin: 0 0 13px;
  font-size: clamp(14px, 1.08vw, 15.5px);
  line-height: 1.9;
  color: var(--ink-2);
  max-width: 70ch;
}
.hero-sign {
  margin: 18px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.foot-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 24px;
  margin: 2px 0 0;
  padding: 0;
}
.foot-stats > div { display: flex; align-items: baseline; gap: 7px; }
.foot-stats dt { font-size: 11.5px; letter-spacing: 0.06em; color: var(--muted); }
.foot-stats dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}

.kbd-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 1px 5px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--field-bg);
}

/* ---------- 分组 ---------- */

main#content {
  width: 100%;
  max-width: calc(var(--content-max) + var(--pad-x) * 2);
  margin: 0 auto;
  padding: 0 var(--pad-x) 40px;
}

.group {
  padding: 38px 0 14px;
  scroll-margin-top: 10px;
}
.group + .group { border-top: 1px solid var(--rule); }

.group-head {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: start;
  gap: 18px;
  margin-bottom: 20px;
}

.group-no {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 4px;
}
.group-no-num {
  font-family: var(--font-serif);
  font-size: 27px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.group-titles { min-width: 0; }
.group-title {
  margin: 0;
  font-size: clamp(21px, 2.1vw, 26px);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.group-desc {
  margin: 7px 0 0;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--muted);
  max-width: 62ch;
}

.group-count {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding-top: 6px;
  color: var(--muted);
  font-size: 11.5px;
  white-space: nowrap;
}
.group-count b {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.group-body { padding-left: 80px; }

/* ---------- 条目 ---------- */

.item + .item { margin-top: 26px; }
.item-head { margin-bottom: 8px; }
.item-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 0.005em;
}
.item-desc {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 68ch;
}
.item-desc--solo { margin: 0 0 8px; }

.prose-block { margin: 0 0 6px; }
.prose {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.9;
  color: var(--ink-2);
  max-width: 68ch;
}
.ilink {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-line);
  padding-bottom: 0.5px;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.ilink:hover { border-bottom-color: var(--accent); background: var(--accent-glow); }

.sub-sec + .sub-sec { margin-top: 30px; }

.sub-label {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: 0.02em;
  color: var(--accent);
}
.sub-label.is-first { margin-top: 2px; }
.sub-desc {
  margin: -4px 0 14px;
  max-width: 62ch;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--muted);
}

.group-list--prose { margin-top: 10px; }

/* ---------- 链接行 ---------- */

.group-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.row {
  position: relative;
  border-radius: var(--radius);
  transition: background 0.14s var(--ease);
}
.row-hit {
  display: block;
  padding: 9px 12px;
  text-decoration: none;
  color: inherit;
  border-radius: var(--radius);
}
.row-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.row-name {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 68%;
  font-size: 14px;
  font-weight: 500;
}
.row-lead {
  flex: 1 1 24px;
  min-width: 16px;
  align-self: center;
  border-bottom: 1px dotted var(--leader);
  opacity: 0.65;
}
.row-meta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.row-host { letter-spacing: -0.01em; }
.row-arrow {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  transform: translate(-2px, 2px);
  opacity: 0;
  transition: opacity 0.16s var(--ease), transform 0.16s var(--ease);
}
.row-desc {
  display: block;
  margin: 3px 0 0;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--muted);
  max-width: 78ch;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 17px;
  padding: 0 6px;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 10.5px;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* 无结果 */
.no-result {
  margin: 40px 0;
  padding: 26px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  border: 1px dashed var(--rule);
  border-radius: 12px;
}

/* ---------- 页脚 ---------- */

.foot {
  width: 100%;
  max-width: calc(var(--content-max) + var(--pad-x) * 2);
  margin: 0 auto;
  padding: 26px var(--pad-x) 46px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.foot-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- 回到顶部 ---------- */

.to-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: var(--rail-bg);
  color: var(--ink-2);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.08);
}
.to-top.is-on { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- 搜索过滤态 ---------- */

body.is-filtering .group.is-empty,
body.is-filtering .group.is-empty .group-body { display: none; }
body.is-filtering .item.is-empty { display: none; }
body.is-filtering .row[hidden] { display: none !important; }
body.is-filtering .sub-label[hidden] { display: none !important; }

.mobile-bar .search { flex: 1 1 auto; }

/* ---------- 响应式 ---------- */

@media (max-width: 1000px) {
  :root { --rail-w: 272px; }

  .rail {
    position: fixed;
    left: 0;
    top: 0;
    height: 100dvh;
    width: min(88vw, 320px);
    flex-basis: auto;
    transform: translateX(-102%);
    transition: transform 0.28s var(--ease);
    box-shadow: 0 20px 60px rgb(0 0 0 / 0.18);
  }
  body.rail-open .rail { transform: none; }
  body.rail-open { overflow: hidden; }

  .rail-close {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border: 1px solid var(--rule);
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
  }

  .scrim {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgb(10 12 16 / 0.42);
    backdrop-filter: blur(2px);
  }

  .mobile-bar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px var(--pad-x);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--rule);
  }
  .menu-btn {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border: 1px solid var(--rule);
    border-radius: 9px;
    background: transparent;
    color: var(--ink-2);
    cursor: pointer;
  }
  .mobile-brand {
    font-family: var(--font-serif);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none;
    white-space: nowrap;
    flex: 0 0 auto;
  }
  .search--bar { height: 34px; }

  .hero { padding-top: 34px; }
  .group-head { grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; }
  .group-no-num { font-size: 22px; }
  .group-body { padding-left: 0; }
  .sub-label { margin-top: 16px; }
}

@media (max-width: 700px) {
  body { font-size: 14.5px; }

  /* 标题太长会把展开箭头挤到下一行，改成钉在标题右上角 */
  .hero-toggle { width: 30px; height: 30px; margin-top: 6px; }

  .row-hit { padding: 11px 12px; }
  .row-line { flex-wrap: wrap; row-gap: 2px; }
  .row-name { max-width: 100%; font-size: 14.5px; white-space: normal; }
  .row-lead { display: none; }
  .row-meta { order: 3; width: 100%; justify-content: flex-start; }
  .row-arrow { display: none; }
  .row-desc { margin-top: 2px; }

  .group-count { display: none; }
  .foot-stats { gap: 6px 18px; }
  .group { padding-top: 30px; }
  .foot { padding-bottom: 90px; }
  .to-top { right: 14px; bottom: 14px; }
}

@media (max-width: 420px) {
  .mobile-brand { display: none; }
}

/* ---------- 多链接折叠 ---------- */

.fold-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 0 12px;
  padding: 5px 12px;
  border: 1px dashed var(--rule);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.fold-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-glow);
}
.fold-btn .fold-less { display: none; }
.fold-btn.is-open .fold-more { display: none; }
.fold-btn.is-open .fold-less { display: inline; }

/* 搜索时强制展开，否则命中的条目会被折叠藏起来 */
body.is-filtering .fold[hidden] { display: block !important; }
body.is-filtering .fold-btn { display: none !important; }

@media (max-width: 700px) {
  .topbar-inner { gap: 10px; padding: 8px var(--pad-x); }
  .topbar .brand-text { display: none; }
  .topbar .brand-mark { width: 32px; height: 32px; flex-basis: 32px; }
  .topbar .search { max-width: none; }
  .topbar .skin-toggle { width: 30px; height: 30px; border-radius: 50%; }
  .topnav { padding-bottom: 2px; }
  .topnav .nav-list {
    flex-wrap: nowrap;
    gap: 0 16px;
    padding-bottom: 6px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .topnav .nav-list::-webkit-scrollbar { display: none; }
  .nav-panel { display: none !important; }
  .topnav .nav-list .nav-item.has-panel > .nav-link::after { display: none; }
  .topnav .nav-list a { padding: 5px 0; font-size: 12.5px; }
  .fold-btn { margin-left: 0; }
}
