/* 常用导航 —— 版式与几何照搬「灵动搜索」新标签页原版
   数值来源：56\新标签本地版\css\style.css 的实测 computed style（1440/929 宽下量得）
   搜索框全宽 100vw-40、高 54、圆角 26、blur 30；图标瓦 60×60 圆角 22、图 32×32、blur 15；
   dock 固定底部高 80、胶囊 62×34 圆角 14；左下 44×44 圆钮。 */

:root {
  --blue: #8ab4f8;
  --green: #81c995;
  --red: #f28b82;
  --bg: #17181a;
  --card-bg: #202124;
  --text-primary: #e8eaed;
  --text-secondary: #bdc1c6;
  --border-color: #3c4043;
  --hover-shadow-color: rgba(0, 0, 0, .35);
  --rebound-easing: cubic-bezier(0.34, 1.56, 0.64, 1);
  /* 下面这组是「外观设置」可调项的挂点，出厂值＝原版实测值，改之前先保证默认态和以前逐像素一致 */
  --nav-item-size: 80px;
  --nav-grid-gap: 24px;
  --nav-col-min: 120px;
  --nav-align: center;
  --body-top: 1vh;
  --main-max: 1500px;
  --search-blur: 30px;
  --icon-blur: 15px;
  --scope-menu-w: 322px;
  --dock-scale: 1;
  --main-pad: 20px;
  --dock-space: calc(104px * var(--dock-scale));
  --search-bg-col: 255, 255, 255;
  --search-bg-a: .15;
  --search-border-col: 255, 255, 255;
  --search-border-a: .35;
  --search-bg: rgba(var(--search-bg-col), var(--search-bg-a));
  --search-border: rgba(var(--search-border-col), var(--search-border-a));
  --pop-bg: rgba(255, 255, 255, .11);
  --pop-border: rgba(255, 255, 255, .18);
  --icon-bg-col: 255, 255, 255;
  --icon-bg-a: .13;
  --icon-bg: rgba(var(--icon-bg-col), var(--icon-bg-a));
  --icon-border: rgba(255, 255, 255, .25);
  --input-color: rgba(212, 212, 222, .9);
  --btn-color: rgb(189, 193, 198);
  --clock-color: #C89B5C;
  --label-shadow-a: .8;
  --label-shadow: 0 1px 3px rgba(0, 0, 0, var(--label-shadow-a));
  /* 全局遮罩：这两位颜色只跟主题走（深色压黑、浅色压白），JS 从不碰颜色；
     强度出厂 .3 / .42，只有拖过「全局遮罩」滑杆才由 app.js applyFx() 覆写 --ov-a。 */
  --ov-col: 0, 0, 0;
  --ov-a: .3;
  --tile-hover: rgba(255, 255, 255, .06);
}

/* 原版没有浅色态，这里只作为面板里的可选项存在 */
html[data-theme='light'] {
  --bg: #f1f3f4;
  --card-bg: #ffffff;
  --text-primary: #202124;
  --text-secondary: #5f6368;
  --border-color: #dadce0;
  --hover-shadow-color: rgba(60, 64, 67, .28);
  --search-bg-col: 255, 255, 255;
  --search-bg-a: .78;
  --search-border-col: 0, 0, 0;
  --search-border-a: .08;
  --pop-bg: rgba(255, 255, 255, .94);
  --pop-border: rgba(0, 0, 0, .1);
  --icon-bg-col: 255, 255, 255;
  --icon-bg-a: .72;
  --icon-border: rgba(0, 0, 0, .08);
  --input-color: #202124;
  --btn-color: #5f6368;
  --label-shadow-a: 0;
  --ov-col: 255, 255, 255;
  --ov-a: .42;
  --tile-hover: rgba(0, 0, 0, .05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; overflow-x: hidden; }

body {
  min-height: 100vh;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg);
  color: var(--text-primary);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding-top: var(--body-top);
  padding-bottom: var(--dock-space);
  transition: background-color .3s ease;
}
/* 原版背景：CSS 蓝紫渐变（不是壁纸图），z-index -1 */
body::before {
  content: '';
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #7e22ce 100%);
  background-attachment: fixed;
  z-index: -1;
}
/* 原版全局暗遮罩：压在渐变之上，对应原版那一位 --overlay-opacity。
   颜色只跟主题走（深色压黑、浅色压白）；强度出厂 .3 / .42，用户拖过才由 app.js applyFx() 覆写 --ov-a。 */
body::after {
  content: '';
  position: fixed; inset: 0;
  background: rgba(var(--ov-col), var(--ov-a));
  pointer-events: none;
  z-index: 0;
}

a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; background: none; border: none; }
.hidden { display: none !important; }

#main {
  position: relative; z-index: 1;
  width: 100%; max-width: var(--main-max);
  padding-top: 20px;
  display: flex; flex-direction: column; align-items: center;
  flex: 1; min-height: 0;
}

/* ---------- 顶部搜索胶囊（全宽）---------- */
#header-container { width: 100%; padding: 0 var(--main-pad); position: relative; z-index: 100; }
#search-form-wrapper {
  width: 100%;
  padding: 6px;
  background: var(--search-bg);
  backdrop-filter: blur(var(--search-blur)) brightness(1.1);
  -webkit-backdrop-filter: blur(var(--search-blur)) brightness(1.1);
  border: 1px solid var(--search-border);
  border-radius: 26px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, .1), 0 2px 8px rgba(0, 0, 0, .08);
  transition: box-shadow .3s ease, background-color .3s ease;
}
#search-form-wrapper:hover, #search-form-wrapper.focus { box-shadow: 0 6px 20px var(--hover-shadow-color); }
.header-content { display: flex; align-items: center; width: 100%; gap: 4px; }
.header-group-left { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
#engine-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 2px;
  height: 40px; padding: 0 12px; border-radius: 20px;
  color: rgba(209, 209, 219, .8); cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
#engine-btn:hover, #engine-btn.open { background: rgba(255, 255, 255, .12); color: var(--text-primary); }
html[data-theme='light'] #engine-btn { color: var(--text-secondary); }
html[data-theme='light'] #engine-btn:hover { background: rgba(0, 0, 0, .06); }
.engine-caret { flex: none; opacity: .8; }
#active-engine-name { font-size: 14px; font-weight: 500; white-space: nowrap; }

/* 浮层统一用搜索胶囊那套玻璃配方（深色渐变页上不能用不透明深灰） */
.engine-menu {
  position: absolute; left: var(--main-pad); top: calc(100% + 8px); z-index: 120;
  min-width: 168px; padding: 6px;
  border-radius: 18px;
  background: var(--pop-bg);
  backdrop-filter: blur(30px) brightness(1.1); -webkit-backdrop-filter: blur(30px) brightness(1.1);
  border: 1px solid var(--pop-border);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .28);
}
html[data-theme='light'] .engine-menu { box-shadow: 0 8px 26px rgba(0, 0, 0, .12); }
.engine-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 9px 12px; border-radius: 12px;
  font-size: 14px; text-align: left; cursor: pointer; color: var(--text-primary);
  transition: background-color .15s ease;
}
.engine-opt:hover { background: var(--tile-hover); }
.engine-opt.on { color: var(--blue); }
.engine-opt .tick { font-size: 12px; opacity: .9; }

/* 搜索联想下拉（照搬原版 .dropdown-menu 的几何与弹性入场） */
.suggest-box {
  position: absolute; left: var(--main-pad); right: var(--main-pad); top: calc(100% + 10px); z-index: 130;
  padding: 6px; border-radius: 16px;
  background: var(--pop-bg);
  backdrop-filter: blur(30px) brightness(1.1); -webkit-backdrop-filter: blur(30px) brightness(1.1);
  border: 1px solid var(--pop-border);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
  max-height: min(680px, calc(100vh - 200px)); overflow-y: auto; overflow-x: hidden;
  scrollbar-width: thin;
}
html[data-theme='light'] .suggest-box { box-shadow: 0 6px 18px rgba(0, 0, 0, .1); }
.suggest-box::-webkit-scrollbar { width: 6px; }
.suggest-box::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .22); border-radius: 3px; }
.sug-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 14px; border-radius: 16px;
  font-size: 14px; color: var(--text-primary); text-align: left; cursor: pointer;
  transition: background-color .15s ease;
}
.sug-item:hover, .sug-item.active { background: var(--tile-hover); }
.sug-item .sug-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sug-item .sug-src { font-size: 12px; color: var(--text-secondary); opacity: .7; flex: none; }
.sug-item svg { flex: none; opacity: .55; }
/* 下拉里的段标题（建议 / 站内 两段同屏时用），照 Edge 版库面板 .library-flat-head 的一行小字做法 */
.sug-sec {
  margin: 4px 8px 2px; padding: 0 6px 4px;
  font-size: 10px; color: var(--text-secondary); opacity: .75;
  border-bottom: 1px solid var(--pop-border);
}
#search-container { flex: 1; min-width: 0; display: flex; align-items: center; position: relative; }
#search-input-container { flex: 1; min-width: 0; display: flex; align-items: center; }
/* 原版那颗时钟：叠在输入区正中，点进输入框或有内容时 0.2s 淡出。
   原版只在开页画一次、没有任何定时器，这里照做（零常驻监听）。 */
#search-clock {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  z-index: 1; pointer-events: none; text-align: center; white-space: nowrap;
  font-size: 16px; font-weight: 500; color: var(--clock-color);
  opacity: 1; transition: opacity .2s ease;
}
#search-clock .day { font-size: 12px; color: var(--input-color); opacity: .7; }
#search-form-wrapper.focus #search-clock,
#search-container.has-content #search-clock { opacity: 0; }
#real-search-input {
  width: 100%; height: 40px; padding: 0 4px;
  background: transparent; border: none; outline: none;
  font-size: 14px; color: var(--input-color);
}
#real-search-input::placeholder { color: var(--text-secondary); opacity: .75; }
#search-submit-btn {
  width: 40px; height: 40px; border-radius: 20px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--btn-color); cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
#search-submit-btn:hover { background: rgba(255, 255, 255, .12); color: var(--text-primary); }
html[data-theme='light'] #search-submit-btn:hover { background: rgba(0, 0, 0, .06); }

/* ---------- 搜索框左侧的范围按钮 ---------- */
#scope-btn {
  width: 36px; height: 40px; flex: none; border-radius: 18px; margin-left: -4px;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-secondary); cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}
#scope-btn:hover, #scope-btn.open { background: rgba(255, 255, 255, .12); color: var(--text-primary); }
html[data-theme='light'] #scope-btn:hover, html[data-theme='light'] #scope-btn.open { background: rgba(0, 0, 0, .06); }

/* ---------- 已选条件胶囊行（原版位置：搜索胶囊上方）---------- */
.pills {
  width: 100%; padding: 0 var(--main-pad) 8px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
}
.pills-label { font-size: 12px; color: var(--text-secondary); }
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 26px; padding: 0 4px 0 10px; border-radius: 13px;
  font-size: 12px; color: var(--text-primary);
  background: var(--pop-bg); border: 1px solid var(--pop-border);
}
.pill-x {
  width: 18px; height: 18px; border-radius: 9px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1; color: var(--text-secondary); cursor: pointer;
}
.pill-x:hover { background: rgba(255, 255, 255, .16); color: var(--text-primary); }
html[data-theme='light'] .pill-x:hover { background: rgba(0, 0, 0, .08); }

/* ---------- 弹层公共件 ---------- */
.engine-opt .eng-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.engine-opt.ai .tick { opacity: .45; }
.pop-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 2px 4px 6px; }
.pop-tab { padding: 4px 10px; border-radius: 12px; font-size: 12px; color: var(--text-secondary); cursor: pointer; }
.pop-tab:hover { background: var(--tile-hover); }
.pop-tab.on { color: var(--blue); background: var(--tile-hover); }
.pop-sec { padding: 8px 12px 4px; font-size: 11px; color: var(--text-secondary); opacity: .85; }
.pop-empty { padding: 6px 12px; font-size: 12px; color: var(--text-secondary); }
.pop-del {
  width: 18px; height: 18px; flex: none; border-radius: 9px; margin-left: -6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; line-height: 1; color: var(--text-secondary);
  opacity: 0; cursor: pointer; transition: opacity .15s ease;
}
.engine-opt:hover .pop-del { opacity: .8; }
.pop-del:hover { background: rgba(242, 139, 130, .22); color: #f28b82; opacity: 1; }
.pop-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-top: 6px; padding: 7px 6px 3px; border-top: 1px solid var(--pop-border);
}
.pop-form { display: flex; gap: 4px; padding: 6px 6px 2px; }
.pop-form input, .cond-line input, .pop-foot input {
  flex: 1; min-width: 0; height: 26px; padding: 0 8px; border-radius: 8px;
  font-size: 12px; outline: none;
  background: rgba(0, 0, 0, .18); border: 1px solid var(--pop-border); color: var(--input-color);
}
html[data-theme='light'] .pop-form input, html[data-theme='light'] .cond-line input, html[data-theme='light'] .pop-foot input {
  background: rgba(255, 255, 255, .72);
}

/* ---------- 范围菜单 ---------- */
.scope-menu {
  /* 「范围菜单宽度」可调，但用 min() 夹住视口，拖过头也不会跑出屏幕（原版靠 JS 监听 resize 做这件事） */
  width: min(var(--scope-menu-w), calc(100vw - 40px));
  max-height: calc(100vh - 150px); overflow-y: auto; overflow-x: hidden;
  scrollbar-gutter: stable;
}
.scope-menu::-webkit-scrollbar { width: 9px; background: transparent; }
.scope-menu::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.scope-menu::-webkit-scrollbar-track { background: transparent; border: none; }
.scope-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .26);
  border: 3px solid transparent; border-radius: 6px; background-clip: padding-box;
}
.scope-menu::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, .46); }
html[data-theme='light'] .scope-menu::-webkit-scrollbar-thumb { background-color: rgba(0, 0, 0, .2); }
@supports not selector(::-webkit-scrollbar) {
  .scope-menu { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .26) transparent; }
  html[data-theme='light'] .scope-menu { scrollbar-color: rgba(0, 0, 0, .2) transparent; }
}
.chip-row { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 10px 4px; }
.chip {
  padding: 4px 9px; border-radius: 11px; font-size: 12px; cursor: pointer;
  color: var(--text-secondary); background: var(--tile-hover);
}
.chip:hover { color: var(--text-primary); }
.chip.on { color: var(--blue); background: rgba(138, 180, 248, .16); }
.cond-line { display: flex; align-items: center; gap: 5px; padding: 2px 10px; }
.cond-line > span { flex: none; width: 28px; font-size: 12px; color: var(--text-secondary); }
.link-btn.small, .solid-btn.small { height: 26px; padding: 0 10px; font-size: 12px; border-radius: 13px; }

/* ---------- 联想下拉的三张 tab ---------- */
.sug-tabs { display: flex; align-items: center; gap: 4px; padding: 2px 8px 6px; }
.sug-tab { padding: 4px 12px; border-radius: 12px; font-size: 12px; color: var(--text-secondary); cursor: pointer; }
.sug-tab:hover { background: var(--tile-hover); }
.sug-tab.on { color: var(--blue); background: var(--tile-hover); }
.sug-clear { margin-left: auto; padding: 4px 10px; border-radius: 12px; font-size: 12px; color: var(--text-secondary); cursor: pointer; }
.sug-clear:hover { color: var(--text-primary); background: var(--tile-hover); }
.sug-empty { padding: 10px 14px; font-size: 12px; color: var(--text-secondary); }

/* ---------- 中间图标区 ---------- */
#navigation-container {
  width: 100%; padding: 0 var(--main-pad);
  margin-top: clamp(2px, .5vh, 6px);
  display: flex; align-items: flex-start; justify-content: var(--nav-align);
  overflow-y: auto; overflow-x: hidden;
  flex: 1; min-height: 0;
  /* 原版同款约束：图标区在自己的盒子里滚动，不被固定 dock 压住 */
  max-height: calc(100vh - var(--body-top) - 74px - clamp(2px, 0.5vh, 6px) - var(--dock-space));
  scrollbar-width: none; -ms-overflow-style: none;
  padding-bottom: 20px;
  position: relative; z-index: 1;
}
#navigation-container::-webkit-scrollbar { display: none; }
#navigation-grid {
  display: grid;
  width: max-content; max-width: 100%;
  grid-template-columns: repeat(auto-fit, minmax(var(--nav-col-min), auto));
  gap: var(--nav-grid-gap);
  padding: 10px;
  justify-items: center; align-items: start;
}
/* 搜索结果与分组视图共用同一条连续网格（第六版起不再插分组标题，避免每组自成一带） */
.nav-item {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 8px; border-radius: 24px;
  color: var(--text-primary); background: transparent;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  transition: transform .3s cubic-bezier(0.4, 0, 0.2, 1), background-color .2s ease;
}
.nav-item:hover { background: var(--tile-hover); }
.nav-item-icon-wrapper {
  width: calc(var(--nav-item-size) * .75);
  height: calc(var(--nav-item-size) * .75);
  border-radius: 22px;
  display: flex; justify-content: center; align-items: center;
  margin-bottom: 6px;
  background: var(--icon-bg);
  backdrop-filter: blur(var(--icon-blur));
  -webkit-backdrop-filter: blur(var(--icon-blur));
  border: 1px solid var(--icon-border);
  transition: transform .2s var(--rebound-easing), box-shadow .2s ease;
  flex-shrink: 0; pointer-events: none; overflow: hidden;
}
.nav-item-icon {
  width: calc(var(--nav-item-size) * .40);
  height: calc(var(--nav-item-size) * .40);
  border-radius: 8px;
  object-fit: contain; display: block; margin: auto;
  transition: transform .2s var(--rebound-easing);
}
.nav-item-title {
  font-size: calc(var(--nav-item-size) * .15);
  line-height: 16px;
  max-width: 108px;
  text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: var(--label-shadow);
  pointer-events: none;
}
.nav-item:hover .nav-item-icon-wrapper { transform: translateY(-10px) scale(1.10); box-shadow: 0 8px 20px rgba(0, 0, 0, .25); }
.nav-item:hover .nav-item-icon { transform: scale(1.15); }
.nav-item:active .nav-item-icon-wrapper { transform: scale(.95); transition-duration: .1s; }
.nav-item.pinned .nav-item-icon-wrapper { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }

/* 横向胶囊瓦片（原版 body.shape-h-capsule 那套，本站用 html[data-shape] 表达）：
   图标和标题并排、整颗瓦片自己带底色，图标盒子的玻璃与模糊撤掉交给外层胶囊。 */
html[data-shape='capsule'] #navigation-grid .nav-item {
  flex-direction: row; justify-content: flex-start;
  padding: 4px 26px 4px 12px; gap: 12px;
  min-width: 160px; max-width: clamp(160px, 28vw, 360px);
  height: calc(var(--nav-item-size) * .8);
  border-radius: 999px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08);
  overflow: hidden;
  transition: transform .45s var(--rebound-easing), box-shadow .35s ease, background-color .25s ease;
}
html[data-shape='capsule'] #navigation-grid .nav-item:hover { background: rgba(255, 255, 255, .05); transform: translateY(-8px); }
html[data-shape='capsule'] #navigation-grid .nav-item:active { transform: translateY(-2px) scale(.98); transition-duration: .12s; }
html[data-shape='capsule'] #navigation-grid .nav-item-icon-wrapper {
  margin-bottom: 0;
  width: calc(var(--nav-item-size) * .72); height: calc(var(--nav-item-size) * .72);
  border-radius: 50%; background: transparent; border: none;
  backdrop-filter: none; -webkit-backdrop-filter: none;
  transition: transform .45s var(--rebound-easing), box-shadow .35s ease;
}
html[data-shape='capsule'] #navigation-grid .nav-item:hover .nav-item-icon-wrapper { transform: translateY(-4px) scale(1.06); box-shadow: 0 12px 28px rgba(0, 0, 0, .32); }
html[data-shape='capsule'] #navigation-grid .nav-item-icon { width: calc(var(--nav-item-size) * .42); height: calc(var(--nav-item-size) * .42); flex-shrink: 0; }
html[data-shape='capsule'] #navigation-grid .nav-item-title {
  font-size: calc(var(--nav-item-size) * .25);
  max-width: calc(100% - 72px);
}
html[data-theme='light'][data-shape='capsule'] #navigation-grid .nav-item { background: rgba(0, 0, 0, .04); border-color: rgba(0, 0, 0, .08); }
html[data-theme='light'][data-shape='capsule'] #navigation-grid .nav-item:hover { background: rgba(0, 0, 0, .06); }

/* 取不到 favicon 时的首字母色块：宽度与圆角都跟 .nav-item-icon 同档，
   两种图标占同一块位置，混排时才不会一大一小 */
.letter-tile {
  width: calc(var(--nav-item-size) * .40); height: calc(var(--nav-item-size) * .40);
  flex: none; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: calc(var(--nav-item-size) * .19); font-weight: 700; color: #fff;
}
html[data-shape='capsule'] #navigation-grid .letter-tile {
  width: calc(var(--nav-item-size) * .42); height: calc(var(--nav-item-size) * .42);
}

/* 瓦片的置顶/移出导航入口：右键（触屏长按）出来的玻璃菜单，跟原版一样瓦片面上不放任何按钮 */
.tile-menu { position: fixed; left: 0; top: 0; z-index: 140; min-width: 148px; }
.tile-head {
  padding: 6px 12px 4px; font-size: 12px; color: var(--text-secondary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px;
}

/* 「全部」视图里的分组小标题（一次一组时不出现，和原版一致） */
#no-hit { width: 100%; max-width: 560px; text-align: center; padding: 40px 20px; color: var(--text-secondary); font-size: 14px; }
#no-hit a { color: var(--blue); }
#no-hit b { color: var(--blue); font-weight: 600; }

/* ---------- 底部 dock ---------- */
#navigation-tabs-container {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  display: flex; justify-content: center; align-items: center; gap: 8px;
  padding: calc(16px * var(--dock-scale));
  transform: translateZ(0);
}
#navigation-tabs {
  display: flex; flex-wrap: nowrap; justify-content: flex-start; gap: calc(8px * var(--dock-scale));
  overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -ms-overflow-style: none;
  overscroll-behavior-x: contain;
  max-width: min(1140px, calc(100vw - 230px));
  padding: calc(6px * var(--dock-scale)); border-radius: calc(20px * var(--dock-scale));
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .1);
}
html[data-theme='light'] #navigation-tabs { background: rgba(255, 255, 255, .8); border-color: rgba(0, 0, 0, .08); }
#navigation-tabs::-webkit-scrollbar { display: none; }
.dock-arrow {
  flex: none;
  width: calc(34px * var(--dock-scale)); height: calc(34px * var(--dock-scale));
  border-radius: calc(17px * var(--dock-scale));
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-primary); cursor: pointer;
  background: rgba(255, 255, 255, .08);
  backdrop-filter: blur(20px) brightness(1.1); -webkit-backdrop-filter: blur(20px) brightness(1.1);
  border: 1px solid rgba(255, 255, 255, .14);
  transition: background-color .2s ease, opacity .2s ease;
}
.dock-arrow:hover { background: rgba(255, 255, 255, .18); }
html[data-theme='light'] .dock-arrow { background: rgba(255, 255, 255, .82); border-color: rgba(0, 0, 0, .08); color: var(--text-secondary); }
html[data-theme='light'] .dock-arrow:hover { background: #fff; color: var(--text-primary); }
.nav-tab {
  flex: none;
  padding: calc(6px * var(--dock-scale)) calc(16px * var(--dock-scale));
  border-radius: calc(14px * var(--dock-scale));
  font-size: calc(14px * var(--dock-scale)); font-weight: 600; letter-spacing: .05px;
  white-space: nowrap; text-align: center; min-width: calc(60px * var(--dock-scale));
  cursor: pointer; color: var(--text-primary);
  background-color: rgba(0, 0, 0, .14);
  border: 1px solid transparent;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .1);
  transition: all .3s var(--rebound-easing);
  -webkit-font-smoothing: subpixel-antialiased;
}
html[data-theme='light'] .nav-tab { background-color: rgba(255, 255, 255, .7); border-color: var(--border-color); }
.nav-tab:hover { background-color: rgba(255, 255, 255, .15); transform: translateY(-2px); }
html[data-theme='light'] .nav-tab:hover { background-color: #fff; }
.nav-tab.active { border-color: rgba(255, 255, 255, .9); }
html[data-theme='light'] .nav-tab.active { border-color: var(--blue); color: var(--blue); }
.nav-tab .n { font-size: calc(11px * var(--dock-scale)); font-weight: 500; color: var(--text-secondary); margin-left: 5px; font-variant-numeric: tabular-nums; }
.nav-tab.active .n { color: var(--blue); }
.dock-arrow svg { width: calc(18px * var(--dock-scale)); height: calc(18px * var(--dock-scale)); }

/* ---------- 左下抽屉钮（原版壁纸库按钮的位置与尺寸）---------- */
/* 第十四版起：原来的三颗圆钮收成一颗 ∧，点开是一条两级抽屉（抽屉 → 浮层）。
   圆钮配方一字不改地搬过来，所以出厂态左下角的视觉重量和上一版一致。 */
#drawer-btn {
  position: fixed; left: 20px; bottom: 20px; z-index: 101;
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(32, 33, 36, .3);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(232, 234, 237, .2);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .1);
  color: rgba(232, 234, 237, .6); cursor: pointer;
  transition: all .25s var(--rebound-easing);
}
html[data-theme='light'] #drawer-btn { background: rgba(255, 255, 255, .7); color: var(--text-secondary); border-color: rgba(0, 0, 0, .08); }
#drawer-btn:hover { transform: scale(1.08); color: var(--text-primary); background: rgba(32, 33, 36, .55); }
#drawer-btn svg { transition: transform .25s var(--rebound-easing); }
#drawer-btn.on svg { transform: rotate(180deg); }

/* 抽屉本体：同一套白玻璃配方，竖排几行，右侧小圆点承载原来的 .on / .dirty 状态 */
.drawer-pop {
  position: fixed; left: 20px; bottom: 76px; z-index: 195;
  display: flex; flex-direction: column; gap: 2px;
  padding: 6px; border-radius: 16px;
  background: var(--pop-bg);
  backdrop-filter: blur(30px) brightness(1.1); -webkit-backdrop-filter: blur(30px) brightness(1.1);
  border: 1px solid var(--pop-border);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .28);
  color: var(--text-primary);
}
html[data-theme='light'] .drawer-pop { box-shadow: 0 8px 26px rgba(0, 0, 0, .12); }
.dr-row {
  display: flex; align-items: center; gap: 10px;
  min-width: 148px; height: 34px; padding: 0 10px;
  border-radius: 10px; font-size: 13px; text-align: left;
  color: var(--text-primary); background: transparent; cursor: pointer;
}
.dr-row:hover { background: rgba(128, 132, 140, .16); }
.dr-row svg { flex: none; opacity: .75; }
.dr-name { flex: 1; }
.dr-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: transparent; }
.dr-row.on .dr-dot, .dr-row.dirty .dr-dot { background: var(--blue); }
.dr-row.on .dr-name { color: var(--blue); }

/* ---------- 站点库（抽屉第二级）---------- */
/* 与壁纸/外观同一颗锚点、同一套白玻璃，互斥所以永不相叠。
   库里一行只用首字占位，不拉 favicon：177 条一起开图会打爆请求，也把「库」和「已启用」的边界画得更清楚。 */
.store-pop {
  position: fixed; left: 20px; bottom: 76px; z-index: 210;
  width: min(640px, calc(100vw - 40px));
  max-height: calc(100vh - 200px);
  padding: 0 14px 12px;
  border-radius: 20px;
  display: flex; flex-direction: column;
  background: var(--pop-bg);
  backdrop-filter: blur(30px) brightness(1.1); -webkit-backdrop-filter: blur(30px) brightness(1.1);
  border: 1px solid var(--pop-border);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .28);
  color: var(--text-primary);
}
html[data-theme='light'] .store-pop { box-shadow: 0 8px 26px rgba(0, 0, 0, .12); }
.st-count { font-style: normal; color: var(--text-secondary); font-weight: 400; font-size: 12px; }
.st-bar { flex: none; display: flex; gap: 8px; margin-bottom: 8px; }
.st-bar input {
  flex: 1; height: 32px; padding: 0 10px; border-radius: 10px; font-size: 13px;
  background: rgba(32, 33, 36, .28); border: 1px solid rgba(232, 234, 237, .16); color: var(--text-primary);
}
html[data-theme='light'] .st-bar input { background: rgba(255, 255, 255, .8); color: var(--text-primary); border-color: rgba(0, 0, 0, .1); }
.st-tabs {
  flex: none; display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px;
  scrollbar-width: none;
}
.st-tabs::-webkit-scrollbar { display: none; }
.st-tab {
  flex: none; height: 26px; padding: 0 11px; border-radius: 13px; font-size: 12px;
  color: var(--text-secondary); background: rgba(32, 33, 36, .26); border: 1px solid transparent; cursor: pointer;
}
html[data-theme='light'] .st-tab { background: rgba(255, 255, 255, .7); color: var(--text-secondary); }
.st-tab.on { color: var(--blue); border-color: var(--blue); }
.st-list { display: flex; flex-direction: column; gap: 2px; padding: 2px 0; }
.st-row {
  display: grid; grid-template-columns: 24px minmax(64px, .9fr) minmax(0, 1.1fr) auto auto auto;
  align-items: center; gap: 10px;
  min-height: 34px; padding: 3px 6px; border-radius: 10px;
}
.st-row:hover { background: rgba(128, 132, 140, .12); }
.st-row.on { background: rgba(128, 132, 140, .08); }
.st-ic {
  width: 24px; height: 24px; border-radius: 7px; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-primary); background: rgba(32, 33, 36, .3);
}
.st-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-host { font-size: 11px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-grp { font-size: 11px; color: var(--text-secondary); }
.st-btn {
  flex: none; height: 26px; padding: 0 10px; border-radius: 13px; font-size: 12px; cursor: pointer;
  color: var(--blue); background: transparent; border: 1px solid var(--blue);
}
.st-btn.dim { color: var(--text-secondary); border-color: rgba(128, 132, 140, .4); }
.st-pick { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 4px 0 6px 34px; }
.st-pick .chip { font-size: 12px; }
.st-pick .hint { font-size: 11px; color: var(--text-secondary); }
@media (max-width: 720px) {
  .store-pop { left: 12px; right: 12px; bottom: 62px; width: auto; max-height: calc(100vh - 190px); }
  .st-row { grid-template-columns: 24px minmax(64px, 1fr) auto auto; gap: 8px; }
  .st-host, .st-grp { display: none; }
}

/* ---------- 壁纸 ---------- */
/* 压在渐变之上、遮罩之下；未选壁纸时这个元素根本不存在于绘制流里，零请求 */
#wallpaper {
  position: fixed; inset: 0; z-index: -1;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  display: none;
}
html[data-wall] #wallpaper { display: block; }
/* 遮罩不分壁纸类型：照片、纯色、渐变都压在同一层同一个值上，跟原版那一位 --overlay-opacity 一样。
   想看清纯色的本味就把「全局遮罩」拖到 0，这是用户的一个可调项，不该由 CSS 替他分档。 */

/* 浮层沿用搜索胶囊那套白玻璃配方（--pop-bg / --pop-border），不用不透明深灰。
   第七版起放大成 4 列 + 内部分区滚动：整层高度由视口兜住，不遮挡顶部搜索胶囊。
   第十四版起底部锚点从「让开三颗圆钮」收成「让开一颗抽屉钮」，三个浮层同一个值。 */
.wall-pop {
  position: fixed; left: 20px; bottom: 76px; z-index: 210;
  width: min(720px, calc(100vw - 40px));
  max-height: calc(100vh - 200px);
  padding: 0 14px 14px;
  border-radius: 20px;
  display: flex; flex-direction: column;
  background: var(--pop-bg);
  backdrop-filter: blur(30px) brightness(1.1); -webkit-backdrop-filter: blur(30px) brightness(1.1);
  border: 1px solid var(--pop-border);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .28);
  color: var(--text-primary);
}
html[data-theme='light'] .wall-pop { box-shadow: 0 8px 26px rgba(0, 0, 0, .12); }
.wall-head {
  flex: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0 10px; font-size: 14px; font-weight: 600;
}
.wall-body {
  /* overflow-x 必须显式写死：只给 overflow-y 时它的 visible 会被算成 auto，
     悬停放大的瓦片一溢出就弹横向滚动条 → 网格变窄 → 鼠标掉出瓦片 → 无限抖动 */
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden;
  scrollbar-gutter: stable; padding: 2px 0;
}
/* 悬浮式滚动条：轨道全透、上下按钮撤掉，滑块用「透明描边 + padding-box 裁切」向内缩，
   看起来是浮在内容边上的圆角短条，而不是一整条贴边的原生灰轨。
   注意 scrollbar-width / scrollbar-color 与 ::-webkit-scrollbar 互斥（一旦设了前者，
   Chromium 直接走标准滚动条渲染，下面的自定义规则全部失效），所以只给 Firefox 用。 */
.wall-body::-webkit-scrollbar { width: 9px; background: transparent; }
.wall-body::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.wall-body::-webkit-scrollbar-track { background: transparent; border: none; }
.wall-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, .26);
  border: 3px solid transparent; border-radius: 6px;
  background-clip: padding-box;
}
.wall-body::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, .46); }
html[data-theme='light'] .wall-body::-webkit-scrollbar-thumb { background-color: rgba(0, 0, 0, .2); }
html[data-theme='light'] .wall-body::-webkit-scrollbar-thumb:hover { background-color: rgba(0, 0, 0, .34); }
@supports not selector(::-webkit-scrollbar) {
  .wall-body { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .26) transparent; }
  html[data-theme='light'] .wall-body { scrollbar-color: rgba(0, 0, 0, .2) transparent; }
}
.wall-sec {
  grid-column: 1 / -1;
  margin: 12px 0 7px; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); letter-spacing: .3px;
}
.wall-sec:first-child { margin-top: 0; }
.wall-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.wall-tile {
  position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden;
  background-size: cover; background-position: center; background-color: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .18); cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.wall-tile img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block; opacity: 0;
  transition: opacity .3s ease, transform .2s var(--rebound-easing);
}
.wall-tile img.loaded { opacity: 1; }
/* 放大只作用在被 overflow:hidden 裁住的内部图片上：瓦片自身的盒子尺寸不变，
   布局与滚动条都不受影响，所以不会再和悬停互相触发。 */
.wall-tile:hover img { transform: scale(1.06); }
.wall-tile:hover { border-color: rgba(255, 255, 255, .55); }
.wall-tile.on { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(138, 180, 248, .45) inset; }
.wall-tile.bad { opacity: .35; cursor: not-allowed; }
.wall-tile .cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 12px 8px 5px; font-size: 11px; line-height: 1.2;
  color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .9);
  background: linear-gradient(to top, rgba(0, 0, 0, .55), transparent);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wall-tile .del {
  position: absolute; top: 4px; right: 4px; z-index: 2;
  width: 20px; height: 20px; border-radius: 50%; border: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; line-height: 1; cursor: pointer;
  background: rgba(20, 22, 26, .62); color: #fff;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.wall-tile .del:hover { background: rgba(220, 80, 80, .9); }
.wall-foot { flex: none; display: flex; gap: 8px; margin: 12px 0 8px; }
.wall-foot input {
  flex: 1; min-width: 0; padding: 7px 10px; border-radius: 10px; font-size: 13px;
  background: rgba(0, 0, 0, .16); border: 1px solid var(--pop-border); color: var(--text-primary);
}
html[data-theme='light'] .wall-foot input { background: rgba(0, 0, 0, .05); color: var(--text-primary); }
.wall-foot .solid-btn { flex: none; padding: 7px 14px; border-radius: 10px; }
.wall-pop .hint { flex: none; font-size: 11px; line-height: 1.5; }

/* ---------- 外观设置（抽屉第二级）---------- */
/* 与壁纸浮层同一颗锚点、同一套白玻璃配方，互斥所以永不相叠 */
.fx-pop {
  position: fixed; left: 20px; bottom: 76px; z-index: 210;
  width: min(560px, calc(100vw - 40px));
  max-height: calc(100vh - 220px);
  padding: 0 14px 14px;
  border-radius: 20px;
  display: flex; flex-direction: column;
  background: var(--pop-bg);
  backdrop-filter: blur(30px) brightness(1.1); -webkit-backdrop-filter: blur(30px) brightness(1.1);
  border: 1px solid var(--pop-border);
  box-shadow: 0 8px 26px rgba(0, 0, 0, .28);
  color: var(--text-primary);
}
html[data-theme='light'] .fx-pop { box-shadow: 0 8px 26px rgba(0, 0, 0, .12); }
.fx-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 20px; padding: 2px 0 6px; }
.fx-sec {
  grid-column: 1 / -1;
  margin: 8px 0 0; font-size: 12px; font-weight: 600;
  color: var(--text-secondary); letter-spacing: .3px;
}
.fx-sec:first-child { margin-top: 0; }
.fx-item { min-width: 0; }
.fx-item.wide { grid-column: 1 / -1; }
.fx-cap { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.fx-cap span:first-child { font-size: 12px; color: var(--text-primary); }
.fx-val { font-size: 11px; color: var(--text-secondary); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fx-val.dft { opacity: .65; }
.fx-range {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 4px; border-radius: 2px; outline: none; cursor: pointer;
  background: rgba(255, 255, 255, .24);
}
html[data-theme='light'] .fx-range { background: rgba(0, 0, 0, .14); }
.fx-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 15px; height: 15px; border-radius: 50%; border: none;
  background: var(--blue); cursor: pointer;
}
.fx-range::-moz-range-thumb { width: 15px; height: 15px; border-radius: 50%; border: none; background: var(--blue); cursor: pointer; }
.fx-range::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .24); }
.fx-seg { display: flex; gap: 6px; }
.fx-seg button {
  flex: 1; padding: 5px 0; border-radius: 10px; font-size: 12px; cursor: pointer;
  color: var(--text-secondary); background: var(--tile-hover); border: 1px solid transparent;
  transition: background-color .15s ease, color .15s ease;
}
.fx-seg button:hover { color: var(--text-primary); }
.fx-seg button.on { color: var(--blue); background: rgba(138, 180, 248, .16); }
.fx-foot {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--pop-border);
}
.fx-foot .hint { font-size: 11px; line-height: 1.5; }
/* 窄屏上提示语换行会把按钮挤断行，这四个字本身不许拆 */
.fx-foot .link-btn { white-space: nowrap; flex: none; }

/* ---------- 面板 ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.modal-card {
  width: 100%; max-width: 420px;
  background: rgba(32, 33, 36, .92);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .35);
  color: var(--text-primary);
  overflow: hidden;
}
html[data-theme='light'] .modal-card { background: rgba(255, 255, 255, .96); border-color: rgba(0, 0, 0, .1); }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; font-size: 15px; font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
html[data-theme='light'] .modal-head { border-bottom-color: rgba(0, 0, 0, .08); }
.modal-x { color: var(--text-secondary); cursor: pointer; font-size: 14px; width: 26px; height: 26px; border-radius: 13px; }
.modal-x:hover { background: rgba(255, 255, 255, .12); color: var(--text-primary); }
.modal-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.hint { color: var(--text-secondary); font-size: 12px; line-height: 1.6; }
.add-form { display: flex; gap: 8px; flex-wrap: wrap; }
.add-form input {
  flex: 1; min-width: 130px; height: 34px; padding: 0 12px;
  border-radius: 17px; border: 1px dashed rgba(255, 255, 255, .3);
  background: rgba(255, 255, 255, .08); color: var(--text-primary); outline: none;
}
html[data-theme='light'] .add-form input { border-color: rgba(0, 0, 0, .2); background: rgba(0, 0, 0, .04); }
.add-form input:focus { border-style: solid; border-color: var(--blue); }
.solid-btn {
  height: 34px; padding: 0 16px; border-radius: 17px;
  background: var(--blue); color: var(--bg);
  cursor: pointer; font-size: 13px; font-weight: 600;
  transition: transform .2s var(--rebound-easing);
}
.solid-btn:hover { transform: scale(1.05); }
.mine-list { display: flex; flex-direction: column; gap: 6px; max-height: 200px; overflow-y: auto; }
.mine-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 12px;
  background: rgba(255, 255, 255, .06); font-size: 13px;
}
html[data-theme='light'] .mine-row { background: rgba(0, 0, 0, .05); }
.mine-row .u { flex: 1; min-width: 0; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.mine-row button { color: var(--text-secondary); cursor: pointer; font-size: 13px; padding: 2px 6px; border-radius: 8px; }
.mine-row button:hover { background: rgba(255, 255, 255, .12); color: var(--text-primary); }
.panel-rows { display: flex; gap: 14px; flex-wrap: wrap; padding-top: 2px; }
.link-btn { color: var(--text-secondary); cursor: pointer; font-size: 12px; }
.link-btn:hover { color: var(--blue); text-decoration: underline; }
.link-btn.danger:hover { color: var(--red); }

/* ---------- 窄屏 ---------- */
@media (max-width: 720px) {
  :root { --nav-item-size: 76px; --nav-grid-gap: 18px; --main-pad: 12px; --nav-col-min: 96px; --dock-space: calc(84px * var(--dock-scale)); }
  #navigation-grid { width: 100%; }
  /* 窄屏：整行左对齐滚动，左侧留出圆钮的位置 */
  #navigation-tabs-container { padding: 10px 10px 10px 62px; gap: 6px; }
  #navigation-tabs { justify-content: flex-start; max-width: 100%; }
  .dock-arrow { width: calc(30px * var(--dock-scale)); height: calc(30px * var(--dock-scale)); }
  #drawer-btn { left: 12px; bottom: 12px; width: 40px; height: 40px; }
  .drawer-pop { left: 12px; bottom: 62px; }
  .wall-pop { left: 12px; right: 12px; bottom: 62px; width: auto; max-height: calc(100vh - 120px); }
  .fx-pop { left: 12px; right: 12px; bottom: 62px; width: auto; max-height: calc(100vh - 120px); }
  .wall-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  #active-engine-name { font-size: 13px; }
}
@media (max-width: 400px) {
  :root { --nav-item-size: 72px; --nav-grid-gap: 14px; --nav-col-min: 84px; }
}
