/* ============================================================
   玻璃导航 · 浅色奶白液态玻璃
   ------------------------------------------------------------
   1. 变量与重置   2. 背景层   3. 首屏   4. 搜索
   5. 分类与卡片   6. Dock    7. 响应式  8. 深色主题
   ============================================================ */

/* ---------------------------------------------- 1. 变量与重置 */
:root {
  --bg: #f4f0e9;
  --bg-2: #ece5db;
  --ink: #2a2521;
  --ink-2: #5f574e;
  --ink-3: #8f8579;
  --accent: #c98f6b;

  --glass-hi: rgba(255, 255, 255, .72);
  --glass-lo: rgba(255, 255, 255, .40);
  --glass-border: rgba(255, 255, 255, .78);

  --card-radius: 20px;
  --shadow-sm: 0 2px 8px rgba(84, 68, 50, .06);
  --shadow: 0 18px 40px -24px rgba(84, 68, 50, .45);
  --shadow-lg: 0 28px 60px -28px rgba(84, 68, 50, .5);

  --wall-blur: 0px;
  --wall-alpha: .7;

  --ease: cubic-bezier(.4, .14, .3, 1);
  --ease-spring: cubic-bezier(.22, 1.15, .36, 1);

  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC",
          "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

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

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 18px; height: 18px; display: inline-block; flex: none; }

kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, .1);
  background: rgba(255, 255, 255, .55);
  color: var(--ink-3);
}

/* ---------------------------------------------- 2. 背景层 */
.bg {
  position: fixed;
  inset: 0;
  z-index: -3;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% -10%, #fdfaf5 0%, var(--bg) 42%, var(--bg-2) 100%);
}

.bg-wall {
  position: absolute;
  inset: -3%;
  background-image: var(--wall, none);
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.06);
  filter: saturate(1.06) contrast(1.02);
  transition: opacity 1.4s var(--ease), transform 14s linear;
  will-change: opacity, transform;
}
.bg-wall.is-on { opacity: 1; transform: scale(1.02); }

.bg-veil {
  position: absolute;
  inset: 0;
  background: rgba(246, 242, 235, var(--wall-alpha));
  -webkit-backdrop-filter: blur(var(--wall-blur)) saturate(120%);
  backdrop-filter: blur(var(--wall-blur)) saturate(120%);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(72px);
  opacity: .62;
  will-change: transform;
}
.blob-a {
  width: 46vw; height: 46vw;
  left: -10vw; top: -12vw;
  background: radial-gradient(circle at 40% 40%, #ffd3b9, rgba(255, 211, 185, 0) 68%);
  animation: drift-a 26s ease-in-out infinite;
}
.blob-b {
  width: 40vw; height: 40vw;
  right: -8vw; top: 4vh;
  background: radial-gradient(circle at 50% 50%, #c9e7d9, rgba(201, 231, 217, 0) 68%);
  animation: drift-b 32s ease-in-out infinite;
}
.blob-c {
  width: 54vw; height: 54vw;
  left: 18vw; bottom: -28vw;
  background: radial-gradient(circle at 50% 50%, #e3d6f6, rgba(227, 214, 246, 0) 68%);
  animation: drift-c 38s ease-in-out infinite;
}

@keyframes drift-a {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(5vw, 4vh, 0) scale(1.1); }
}
@keyframes drift-b {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1.04); }
  50%      { transform: translate3d(-4vw, 6vh, 0) scale(.96); }
}
@keyframes drift-c {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50%      { transform: translate3d(-6vw, -5vh, 0) scale(1.08); }
}

.grain {
  position: absolute;
  inset: 0;
  background-image: url("../img/noise.svg");
  background-size: 180px 180px;
  opacity: .045;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.spotlight {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background: radial-gradient(560px circle at var(--px, 50%) var(--py, 15%),
              rgba(255, 222, 196, .55), transparent 64%);
  opacity: 0;
  transition: opacity .8s var(--ease);
  mix-blend-mode: soft-light;
}
body.has-pointer .spotlight { opacity: 1; }

/* ---------------------------------------------- 3. 首屏 */
.wrap {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: clamp(46px, 8.5vh, 100px) 0 120px;
}

.hero { text-align: center; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 6px 15px 6px 12px;
  border-radius: 999px;
  font-size: 12.4px;
  letter-spacing: .07em;
  color: var(--ink-2);
  background: var(--glass-hi);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
}
.hero-eyebrow .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(201, 143, 107, .18);
}

.hero-title {
  margin: 18px 0 0;
  font-size: clamp(34px, 5.4vw, 58px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.035em;
  background: linear-gradient(112deg, var(--ink) 24%, #7a6152 66%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .3);
}

.hero-sub {
  margin: 12px 0 0;
  font-size: clamp(13.5px, 1.5vw, 15.5px);
  color: var(--ink-2);
  letter-spacing: .01em;
}

/* ---------------------------------------------- 4. 搜索 */
.search {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 4px;
  width: min(672px, 100%);
  margin: 26px auto 0;
  padding: 6px 6px 6px 4px;
  border-radius: 999px;
  background: linear-gradient(140deg, rgba(255, 255, 255, .74), rgba(255, 255, 255, .42));
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(24px) saturate(170%);
  backdrop-filter: blur(24px) saturate(170%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), var(--shadow);
  transition: transform .45s var(--ease-spring), box-shadow .45s var(--ease), border-color .45s;
}
.search:focus-within {
  transform: translateY(-1px);
  border-color: rgba(201, 143, 107, .45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95),
              0 24px 50px -26px rgba(140, 100, 70, .55),
              0 0 0 4px rgba(201, 143, 107, .13);
}

.engine { position: relative; flex: none; }
.engine-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 44px;
  padding: 0 10px 0 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .25s, color .25s;
}
.engine-btn:hover { background: rgba(255, 255, 255, .55); color: var(--ink); }
.engine-chev { width: 14px; height: 14px; transition: transform .35s var(--ease); }
.engine.open .engine-chev { transform: rotate(180deg); }

.engine-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 40;
  width: 238px;
  padding: 8px;
  display: grid;
  gap: 2px;
  border-radius: 20px;
  background: rgba(255, 253, 250, .86);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  box-shadow: var(--shadow-lg);
  transform-origin: top left;
  animation: pop .28s var(--ease-spring);
}
@keyframes pop {
  from { opacity: 0; transform: scale(.94) translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

.engine-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition: background .2s;
}
.engine-item:hover { background: rgba(201, 143, 107, .12); }
.engine-item.is-active { background: rgba(201, 143, 107, .16); font-weight: 600; }
.en-hint { font-size: 11.5px; color: var(--ink-3); font-weight: 400; }

.search-field {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 6px;
}
.search-icon { width: 18px; height: 18px; color: var(--ink-3); }
#searchInput {
  flex: 1;
  min-width: 0;
  padding: 13px 0;
  border: 0;
  background: transparent;
  outline: none;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
}
#searchInput::placeholder { color: var(--ink-3); }
#searchInput::-webkit-search-cancel-button { display: none; }

.search-kbd { margin-right: 4px; transition: opacity .2s; }
.search:focus-within .search-kbd { opacity: 0; }

.search-go {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  background: linear-gradient(140deg, #d9a684, var(--accent));
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 20px -10px rgba(201, 143, 107, .9);
  transition: transform .4s var(--ease-spring), filter .3s;
}
.search-go:hover { transform: scale(1.06) rotate(-5deg); filter: brightness(1.05); }
.search-go .ic { width: 17px; height: 17px; }

.search-hint {
  position: absolute;
  left: 0; right: 0;
  top: calc(100% + 10px);
  font-size: 12.4px;
  color: var(--ink-3);
  text-align: center;
  pointer-events: none;
}

/* 顶部信息条 */
.meta-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px 4px;
  width: fit-content;
  max-width: min(780px, 100%);
  margin: 22px auto 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: linear-gradient(140deg, rgba(255, 255, 255, .52), rgba(255, 255, 255, .26));
  border: 1px solid rgba(255, 255, 255, .62);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 12px 28px -22px rgba(84, 68, 50, .8);
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
}
.meta-item .ic { width: 14px; height: 14px; opacity: .7; }

.meta-sep {
  width: 1px;
  height: 14px;
  background: linear-gradient(transparent, rgba(90, 74, 58, .18), transparent);
}

.w-emoji { font-size: 15px; line-height: 1; }
.w-temp { font-weight: 650; color: var(--ink); font-size: 13.5px; }
.w-city { color: var(--ink-3); }

.clock-time {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .02em;
}
.clock-date { color: var(--ink-3); }

.meta-quote { max-width: 440px; overflow: hidden; }
.q-icon { opacity: .45; }
.q-text {
  display: inline-block;
  max-width: 330px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  transition: opacity .55s var(--ease), filter .55s var(--ease), transform .55s var(--ease);
}
.q-text.swap { opacity: 0; filter: blur(4px); transform: translateY(5px); }
.q-from { flex: none; font-size: 11.4px; color: var(--ink-3); }

/* ---------------------------------------------- 5. 分类与卡片 */
.cat-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: min(880px, 100%);
  margin: clamp(22px, 3.6vh, 32px) auto clamp(26px, 4vh, 40px);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px 7px 11px;
  border-radius: 999px;
  font-size: 12.8px;
  color: var(--ink-2);
  text-decoration: none;
  background: rgba(255, 255, 255, .42);
  border: 1px solid rgba(255, 255, 255, .62);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  transition: transform .4s var(--ease-spring), background .3s, color .3s, box-shadow .3s;
}
.chip:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, .74);
  transform: translateY(-2px);
  box-shadow: 0 14px 26px -20px rgba(84, 68, 50, .9);
}
.chip-icon { font-size: 13px; }
.chip-count {
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10.8px;
  color: var(--ink-3);
  background: rgba(90, 74, 58, .07);
}

.sections { display: grid; gap: clamp(30px, 4.4vh, 46px); }

.cat { scroll-margin-top: 32px; }

.cat-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 14px 3px;
}
.cat-icon {
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  font-size: 15px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .55);
  border: 1px solid rgba(255, 255, 255, .72);
  box-shadow: 0 8px 16px -12px rgba(84, 68, 50, .9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.cat-name {
  margin: 0;
  font-size: 15.5px;
  font-weight: 650;
  letter-spacing: -.01em;
}
.cat-count {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.2px;
  color: var(--ink-3);
  background: rgba(255, 255, 255, .45);
  border: 1px solid rgba(255, 255, 255, .5);
}
.cat-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(90, 74, 58, .12), rgba(90, 74, 58, 0));
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 12px;
}

.site {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 14px;
  border-radius: var(--card-radius);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  background: linear-gradient(145deg, var(--glass-hi), var(--glass-lo));
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(20px) saturate(165%);
  backdrop-filter: blur(20px) saturate(165%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9),
              0 14px 30px -22px rgba(84, 68, 50, .75);
  transition: transform .5s var(--ease-spring), box-shadow .5s var(--ease),
              border-color .5s, background .5s;
  animation: rise .72s var(--ease-spring) backwards;
  animation-delay: calc(var(--i, 0) * 45ms);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(16px) scale(.975); }
  to   { opacity: 1; transform: none; }
}

/* 鼠标跟随的光斑 */
.site::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%),
              rgba(255, 255, 255, .9), transparent 62%);
  transition: opacity .5s var(--ease);
}
.site:hover::before { opacity: 1; }

.site:hover {
  transform: translateY(-4px);
  border-color: rgba(201, 143, 107, .38);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95),
              0 26px 46px -26px rgba(84, 68, 50, .7),
              0 0 0 1px rgba(201, 143, 107, .12);
}
.site:active { transform: translateY(-1px) scale(.995); }

.site-icon {
  position: relative;
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: rgba(255, 255, 255, .8);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .95),
              0 8px 16px -12px rgba(84, 68, 50, .9);
  transition: transform .5s var(--ease-spring);
}
.site-icon::before {
  content: attr(data-letter);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-3);
}
.site-icon img {
  position: relative;
  z-index: 1;
  width: 26px;
  height: 26px;
  object-fit: contain;
  border-radius: 4px;
}
.site:hover .site-icon { transform: scale(1.07) rotate(-4deg); }

.site-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.site-name {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.site-desc {
  font-size: 11.8px;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-arrow {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--accent);
  opacity: 0;
  transform: translate(-4px, 4px);
  transition: opacity .4s var(--ease), transform .45s var(--ease-spring);
}
.site:hover .site-arrow { opacity: .85; transform: none; }

.site.is-hidden, .cat.is-hidden { display: none; }

.empty, .no-result {
  padding: 64px 20px;
  text-align: center;
  color: var(--ink-3);
}
.empty-emoji { margin: 0 0 12px; font-size: 34px; }
.empty-title { margin: 0 0 6px; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.empty-sub { margin: 0; font-size: 12.8px; }

.footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: clamp(46px, 8vh, 78px);
  font-size: 12px;
  color: var(--ink-3);
}
.footer-dot { opacity: .45; }

/* ---------------------------------------------- 6. Dock */
.dock {
  position: fixed;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 7px;
  border-radius: 22px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .62), rgba(255, 255, 255, .32));
  border: 1px solid rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9),
              0 22px 44px -28px rgba(84, 68, 50, .9);
}

.dock-btn {
  position: relative;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--ink-2);
  text-decoration: none;
  cursor: pointer;
  transition: background .3s, color .3s, transform .45s var(--ease-spring);
}
.dock-btn .ic { width: 18px; height: 18px; }
.dock-btn:hover { background: rgba(255, 255, 255, .72); color: var(--accent); transform: scale(1.1); }
.dock-btn:active { transform: scale(.95); }

.dock-btn[data-act="top"] { opacity: .32; pointer-events: none; }
.dock-btn[data-act="top"].is-on { opacity: 1; pointer-events: auto; }

.dock-btn::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translate(-6px, -50%);
  padding: 5px 10px;
  border-radius: 9px;
  white-space: nowrap;
  font-size: 11.5px;
  color: var(--ink);
  background: rgba(255, 255, 255, .92);
  border: 1px solid rgba(255, 255, 255, .85);
  box-shadow: 0 12px 26px -18px rgba(0, 0, 0, .55);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .35s var(--ease);
}
.dock-btn:hover::after { opacity: 1; transform: translate(0, -50%); }

.ic-sun { display: none; }
[data-theme="dark"] .ic-moon { display: none; }
[data-theme="dark"] .ic-sun { display: block; }

/* 提示条 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  z-index: 60;
  transform: translate(-50%, 14px);
  padding: 10px 18px;
  border-radius: 14px;
  font-size: 13px;
  color: var(--ink);
  background: rgba(255, 253, 250, .86);
  border: 1px solid rgba(255, 255, 255, .85);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .4s var(--ease), transform .45s var(--ease-spring);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------------------------------------- 7. 响应式 */
@media (max-width: 1180px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(224px, 1fr)); }
}

@media (max-width: 900px) {
  .wrap { padding-bottom: 150px; }
  .dock {
    left: 50%;
    top: auto;
    bottom: max(18px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    flex-direction: row;
  }
  .dock-btn::after {
    left: 50%;
    top: auto;
    bottom: calc(100% + 10px);
    transform: translate(-50%, 6px);
  }
  .dock-btn:hover::after { transform: translate(-50%, 0); }
  .toast { bottom: 86px; }
}

@media (max-width: 720px) {
  .wrap { width: calc(100% - 30px); padding-top: 42px; }
  .meta-bar { border-radius: 22px; padding: 8px 10px; }
  .meta-sep { display: none; }
  .meta-quote { order: 3; width: 100%; justify-content: center; }
  .q-text { max-width: 60vw; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .site { padding: 11px; gap: 10px; border-radius: 17px; }
  .site-icon { width: 36px; height: 36px; border-radius: 11px; }
  .site-icon img { width: 22px; height: 22px; }
  .site-name { font-size: 13.4px; }
  .site-desc { font-size: 11px; }
  .site-arrow { display: none; }
  .cat-nav { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
  .cat-nav::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
}

@media (max-width: 560px) {
  .search { padding: 5px 5px 5px 3px; }
  .engine-btn { padding: 0 6px 0 12px; font-size: 12.6px; }
  .search-kbd { display: none; }
  #searchInput { font-size: 14.5px; }
  .search-go { width: 40px; height: 40px; }
  .hero-title { letter-spacing: -.03em; }
  .site-desc { display: none; }
  .site { padding: 12px 10px; }
}

@media (max-width: 380px) {
  .grid { grid-template-columns: 1fr; }
  .site-desc { display: block; }
}

/* 触屏没有 hover，去掉悬停位移 */
@media (hover: none) {
  .site:hover { transform: none; }
  .site:hover .site-icon { transform: none; }
  .spotlight { display: none; }
}

/* ---------------------------------------------- 8. 深色主题 */
[data-theme="dark"] {
  --bg: #14110f;
  --bg-2: #0d0b0a;
  --ink: #f3ece3;
  --ink-2: #c3b8ab;
  --ink-3: #8b8075;
  --glass-hi: rgba(255, 255, 255, .10);
  --glass-lo: rgba(255, 255, 255, .035);
  --glass-border: rgba(255, 255, 255, .15);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .5);
  --shadow: 0 20px 46px -26px rgba(0, 0, 0, .95);
  --shadow-lg: 0 30px 66px -30px rgba(0, 0, 0, 1);
}

[data-theme="dark"] .bg {
  background: radial-gradient(120% 90% at 50% -10%, #221c17 0%, var(--bg) 46%, var(--bg-2) 100%);
}
[data-theme="dark"] .bg-veil { background: rgba(14, 12, 10, calc(var(--wall-alpha) * .9)); }
[data-theme="dark"] .blob { opacity: .3; }
[data-theme="dark"] .grain { mix-blend-mode: screen; opacity: .035; }
[data-theme="dark"] .spotlight {
  background: radial-gradient(560px circle at var(--px, 50%) var(--py, 15%),
              rgba(201, 143, 107, .4), transparent 64%);
}
[data-theme="dark"] .hero-title {
  background: linear-gradient(112deg, #f7f0e6 18%, #d8b79c 62%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}
[data-theme="dark"] .engine-menu { background: rgba(32, 28, 24, .92); }
[data-theme="dark"] .engine-item:hover { background: rgba(201, 143, 107, .18); }
[data-theme="dark"] .engine-item.is-active { background: rgba(201, 143, 107, .24); }
[data-theme="dark"] .site-icon { background: rgba(255, 255, 255, .12); }
[data-theme="dark"] .site-icon::before { color: var(--ink-2); }
[data-theme="dark"] .site::before {
  background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%),
              rgba(255, 255, 255, .14), transparent 62%);
}
[data-theme="dark"] .dock-btn::after,
[data-theme="dark"] .toast {
  background: rgba(38, 33, 28, .94);
  border-color: rgba(255, 255, 255, .12);
}
[data-theme="dark"] kbd {
  border-color: rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .08);
}

/* 浏览器不支持 backdrop-filter 时用不透明底兜底 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site, .search, .meta-bar, .dock, .chip, .cat-icon, .engine-menu, .toast {
    background: rgba(255, 255, 255, .93);
  }
  [data-theme="dark"] .site,
  [data-theme="dark"] .search,
  [data-theme="dark"] .meta-bar,
  [data-theme="dark"] .dock,
  [data-theme="dark"] .chip,
  [data-theme="dark"] .engine-menu,
  [data-theme="dark"] .toast { background: rgba(34, 30, 26, .96); }
}

/* 减少动态效果 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .blob { animation: none; }
  .bg-wall { transition: none; }
}

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(120, 100, 80, .22);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(120, 100, 80, .36); background-clip: content-box; }
