/* ============================================================
   Nolbir developer — 视觉系统
   ------------------------------------------------------------
   1  设计令牌 / 主题
   2  基础与背景
   3  顶栏 Dock
   4  Hero
   5  区块与分类导航
   6  卡片
   7  搜索态
   8  页脚 / 悬浮按钮
   9  动效
   10 响应式
   ============================================================ */

/* ============================================================
   1  设计令牌 / 主题
   ============================================================ */
:root {
  --bg: #f6f7fb;
  --bg-2: #fdfdff;
  --surface: #ffffff;
  --surface-2: #f1f2f7;
  --text: #101114;
  --text-2: #585c68;
  --text-3: #8a8e9a;
  --line: rgba(16, 17, 20, 0.075);
  --line-2: rgba(16, 17, 20, 0.13);

  --accent: #0a6cff;
  --accent-2: #7a5cff;
  --accent-soft: rgba(10, 108, 255, 0.10);

  --glass: rgba(255, 255, 255, 0.72);
  --glass-line: rgba(255, 255, 255, 0.65);

  --shadow-s: 0 1px 2px rgba(16, 17, 20, 0.045), 0 1px 1px rgba(16, 17, 20, 0.03);
  --shadow-m: 0 12px 26px -12px rgba(16, 17, 20, 0.18), 0 2px 6px rgba(16, 17, 20, 0.05);
  --shadow-l: 0 24px 52px -20px rgba(16, 17, 20, 0.28), 0 4px 14px rgba(16, 17, 20, 0.07);

  --aurora-1: rgba(10, 108, 255, 0.22);
  --aurora-2: rgba(122, 92, 255, 0.19);
  --aurora-3: rgba(255, 92, 138, 0.14);
  --noise-op: 0.032;
  --tile-filter: none;

  --wrap: 1200px;
  --dock-h: 60px;
  --anchor: calc(var(--dock-h) + 78px);

  --r-s: 10px;
  --r-m: 14px;
  --r-l: 18px;
  --r-xl: 22px;

  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --pop: cubic-bezier(0.34, 1.42, 0.5, 1);

  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
}

html[data-theme='dark'] {
  --bg: #07070a;
  --bg-2: #0b0b10;
  --surface: #141419;
  --surface-2: #1c1c23;
  --text: #f4f4f7;
  --text-2: #a2a6b1;
  --text-3: #7d828f;
  --line: rgba(255, 255, 255, 0.085);
  --line-2: rgba(255, 255, 255, 0.17);

  --accent: #4d94ff;
  --accent-2: #a78bfa;
  --accent-soft: rgba(77, 148, 255, 0.16);

  --glass: rgba(16, 16, 22, 0.72);
  --glass-line: rgba(255, 255, 255, 0.075);

  --shadow-s: 0 1px 2px rgba(0, 0, 0, 0.55);
  --shadow-m: 0 14px 30px -14px rgba(0, 0, 0, 0.8), 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-l: 0 28px 58px -22px rgba(0, 0, 0, 0.9);

  --aurora-1: rgba(40, 110, 255, 0.21);
  --aurora-2: rgba(130, 90, 255, 0.18);
  --aurora-3: rgba(255, 80, 140, 0.10);
  --noise-op: 0.045;
  --tile-filter: saturate(1.12) brightness(1.08);
}

@media (min-width: 1360px) { :root { --wrap: 1280px; } }

/* ============================================================
   2  基础与背景
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

/* hidden 必须压过下面各处的 display 声明 */
[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--anchor);
}

body {
  margin: 0;
  position: relative;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
kbd { font-family: var(--font); }
code {
  font-family: var(--mono); font-size: 0.9em;
  background: var(--accent-soft); color: var(--accent);
  padding: 0.12em 0.42em; border-radius: 6px;
}

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

.skip-link {
  position: fixed; top: 10px; left: 50%; z-index: 300;
  transform: translate(-50%, -180%);
  padding: 9px 18px; border-radius: 999px;
  background: var(--surface); box-shadow: var(--shadow-l);
  font-size: 14px; transition: transform 0.35s var(--ease-out);
}
.skip-link:focus { transform: translate(-50%, 0); }

/* 极光：只装饰首屏，向下淡出，正文区保持干净的中性底色
   用径向渐变代替 blur 滤镜——渐变只栅格化一次，之后纯位移合成，成本极低 */
.aurora {
  position: absolute; top: 0; left: 0; right: 0;
  height: min(94vh, 900px);
  z-index: 0;
  pointer-events: none; overflow: hidden;
  background: linear-gradient(180deg, var(--bg-2), var(--bg) 70%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 58%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 58%, transparent 100%);
}
.aurora i {
  position: absolute; display: block;
  border-radius: 50%;
  will-change: transform;
  backface-visibility: hidden;
}
.aurora .b1 {
  width: 96vw; height: 96vw; max-width: 1450px; max-height: 1450px;
  left: -36vw; top: -48vw;
  background: radial-gradient(circle closest-side, var(--aurora-1), rgba(0, 0, 0, 0) 72%);
  animation: drift1 26s var(--ease) infinite alternate;
}
.aurora .b2 {
  width: 84vw; height: 84vw; max-width: 1250px; max-height: 1250px;
  right: -30vw; top: -36vw;
  background: radial-gradient(circle closest-side, var(--aurora-2), rgba(0, 0, 0, 0) 72%);
  animation: drift2 32s var(--ease) infinite alternate;
}
.aurora .b3 {
  width: 62vw; height: 54vw; max-width: 960px; max-height: 840px;
  left: 38%; top: 40vw;
  background: radial-gradient(circle closest-side, var(--aurora-3), rgba(0, 0, 0, 0) 74%);
  animation: drift3 38s var(--ease) infinite alternate;
}
@keyframes drift1 { to { transform: translate3d(6vw, 5vw, 0) scale(1.13); } }
@keyframes drift2 { to { transform: translate3d(-5vw, 4vw, 0) scale(1.08); } }
@keyframes drift3 { to { transform: translate3d(-7vw, -4vw, 0) scale(1.16); } }

/* 颗粒质感，只铺在首屏极光上，正文区保持干净 */
.noise {
  position: absolute; top: 0; left: 0; right: 0;
  height: min(94vh, 900px);
  z-index: 0; pointer-events: none;
  opacity: var(--noise-op);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* 顶部阅读进度 */
.progress {
  position: fixed; top: 0; left: 0; right: 0; height: 2px;
  z-index: 120; pointer-events: none;
}
.progress i {
  display: block; height: 100%; width: 100%;
  transform: scaleX(0); transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2) 60%, #ff5c8a);
  opacity: 0; transition: opacity 0.4s var(--ease);
}
.progress.show i { opacity: 1; }

main, .dock, .footer { position: relative; z-index: 1; }

/* ============================================================
   3  顶栏 Dock
   ============================================================ */
.dock {
  position: sticky; top: 0; z-index: 90;
  height: var(--dock-h);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: saturate(170%) blur(20px);
  backdrop-filter: saturate(170%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.dock.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 8px 24px -18px rgba(0, 0, 0, 0.4);
}

.dock-inner {
  height: 100%;
  max-width: var(--wrap); margin: 0 auto;
  padding: 0 max(20px, env(safe-area-inset-left)) 0 max(20px, env(safe-area-inset-right));
  display: flex; align-items: center; gap: 16px;
}

.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-logo {
  width: 31px; height: 31px; border-radius: 10px; flex: none;
  box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.32), 0 0 0 1px var(--line);
  transition: transform 0.5s var(--pop), box-shadow 0.4s var(--ease);
}
.brand:hover .brand-logo {
  transform: scale(1.08) rotate(-3deg);
  box-shadow: 0 6px 16px -4px rgba(0, 0, 0, 0.34), 0 0 0 1px var(--line);
}
.brand-text { display: flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.brand-name { font-size: 15.5px; font-weight: 650; letter-spacing: -0.025em; }
.brand-sub { font-size: 13px; color: var(--text-3); letter-spacing: 0.005em; }

.icon-btn {
  width: 38px; height: 38px; flex: none; border-radius: 12px;
  display: grid; place-items: center; color: var(--text-2);
  transition: background-color 0.28s var(--ease), color 0.28s var(--ease), transform 0.28s var(--pop);
}
.icon-btn:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 18px; height: 18px; }
.i-moon { display: none; }
html[data-theme='dark'] .i-sun { display: none; }
html[data-theme='dark'] .i-moon { display: block; }

/* 顶栏右侧只留主题切换 */
.dock-inner .icon-btn { margin-left: auto; }

/* ============================================================
   4  Hero
   ============================================================ */
.hero {
  max-width: var(--wrap); margin: 0 auto;
  padding: clamp(46px, 8vw, 96px) max(20px, env(safe-area-inset-left)) clamp(22px, 3vw, 34px);
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0 0 18px;
  height: 30px; padding: 0 14px 0 11px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-s);
  font-size: 13px; color: var(--text-2);
  letter-spacing: 0.005em;
}
.hero-eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: #34c759;
  animation: beat 2.6s var(--ease) infinite;
}
@keyframes beat {
  0%   { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0.5); }
  60%  { box-shadow: 0 0 0 8px rgba(52, 199, 89, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 199, 89, 0); }
}

.hero-title {
  margin: 0;
  font-size: clamp(36px, 7vw, 66px);
  font-weight: 700;
  letter-spacing: -0.042em;
  line-height: 1.04;
}
.hero-title .grad {
  background: linear-gradient(100deg, #0a6cff 0%, #6b5bff 38%, #b14cff 68%, #ff5c8a 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  animation: hue 11s var(--ease) infinite alternate;
}
html[data-theme='dark'] .hero-title .grad {
  background-image: linear-gradient(100deg, #4d94ff 0%, #9d8bff 38%, #c98bff 68%, #ff7aa2 100%);
}
@keyframes hue { to { background-position: 100% 0; } }

.hero-desc {
  margin: 18px auto 0; max-width: 32em;
  color: var(--text-2);
  font-size: clamp(14.5px, 1.3vw, 16.5px);
  line-height: 1.6;
}

/* 搜索框 */
.hero-search {
  position: relative;
  max-width: 640px; margin: clamp(28px, 4vw, 40px) auto 0;
}
.hs-icon {
  position: absolute; left: 20px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; color: var(--text-3); pointer-events: none;
  transition: color 0.3s var(--ease), transform 0.4s var(--pop);
}
.hero-search:focus-within .hs-icon { color: var(--accent); transform: translateY(-50%) scale(1.08); }
#searchInput {
  width: 100%; height: 58px;
  padding: 0 96px 0 52px;
  font-size: 16px; font-family: inherit; color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-s);
  outline: none;
  -webkit-appearance: none; appearance: none;
  transition: box-shadow 0.35s var(--ease), border-color 0.35s var(--ease), transform 0.35s var(--ease-out);
}
#searchInput::placeholder { color: var(--text-3); }
#searchInput::-webkit-search-cancel-button { -webkit-appearance: none; }
.hero-search:focus-within #searchInput {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 18px 40px -18px color-mix(in srgb, var(--accent) 55%, transparent), var(--shadow-m);
  transform: translateY(-2px);
}
.hs-clear {
  position: absolute; right: 52px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; color: var(--text-3);
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--pop);
}
.hs-clear:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); transform: translateY(-50%) scale(1.06); }
.hs-clear svg { width: 16px; height: 16px; }
.hs-kbd {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  font-size: 12px; color: var(--text-3); pointer-events: none;
  border: 1px solid var(--line-2); border-radius: 7px;
  padding: 3px 7px; line-height: 1.2;
  transition: opacity 0.25s var(--ease);
}
.hs-kbd.off { opacity: 0; }

/* 搜索提示 */
.search-hint {
  margin: 14px 0 0; font-size: 13px; color: var(--accent);
  min-height: 1.4em; opacity: 0; transform: translateY(-4px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease-out);
}
.search-hint.show { opacity: 1; transform: none; }

/* ============================================================
   5  区块与分类导航
   ============================================================ */
main > .block {
  max-width: var(--wrap); margin: 0 auto;
  padding: 24px max(20px, env(safe-area-inset-left)) 6px;
}
.block-head { display: flex; align-items: center; gap: 11px; margin-bottom: 15px; }
.block-title { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -0.025em; }
.block-count {
  font-size: 12.5px; color: var(--text-3);
  padding: 2px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--text) 6%, transparent);
}
.link-btn {
  margin-left: auto; font-size: 13px; color: var(--text-3);
  padding: 6px 11px; border-radius: 9px;
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}
.link-btn:hover { background: color-mix(in srgb, var(--text) 8%, transparent); color: var(--text); }

/* 最近使用 chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 14px 0 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-s);
  font-size: 13.5px; color: var(--text-2);
  max-width: 100%;
  transition: transform 0.35s var(--ease-out), border-color 0.3s var(--ease),
              color 0.3s var(--ease), box-shadow 0.35s var(--ease);
}
.chip:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--brand, var(--accent)) 40%, transparent);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -10px color-mix(in srgb, var(--brand, var(--accent)) 50%, transparent), var(--shadow-s);
}
.chip .dot {
  width: 20px; height: 20px; border-radius: 7px; flex: none;
  display: grid; place-items: center;
  font-size: 10px; font-weight: 700; color: #fff;
  background-image: linear-gradient(150deg, var(--tile-a), var(--tile-b));
  filter: var(--tile-filter);
}
.chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 分类导航：常驻的胶囊玻璃条，吸顶时与顶栏严丝合缝贴合成一整块 */
.catbar {
  position: sticky; top: var(--dock-h); z-index: 80;
  max-width: var(--wrap); margin: 26px auto 0;
  padding: 0 max(20px, env(safe-area-inset-left));
}
.catbar::before {
  content: ''; position: absolute; inset: 0 max(20px, env(safe-area-inset-left));
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  -webkit-backdrop-filter: saturate(170%) blur(20px);
  backdrop-filter: saturate(170%) blur(20px);
  box-shadow: var(--shadow-s);
  border: 1px solid var(--line);
  pointer-events: none;
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.catbar.is-stuck::before {
  border-color: transparent;
  box-shadow: 0 10px 22px -18px rgba(0, 0, 0, 0.42);
}

.cat-inner {
  position: relative;
  display: flex; justify-content: safe center;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none; -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  border-radius: 16px;
  padding: 6px;
}
.cat-inner::-webkit-scrollbar { display: none; }

.cat-track { position: relative; display: flex; gap: 4px; width: max-content; }

.cat-ind {
  position: absolute; left: 0; top: 0;
  height: 36px; width: 0; border-radius: 11px;
  background: var(--surface);
  box-shadow: var(--shadow-m);
  opacity: 0;
  transition: transform 0.5s var(--ease-out), width 0.5s var(--ease-out), opacity 0.3s var(--ease);
  pointer-events: none;
}
.cat-ind.on { opacity: 1; }

.cat-link {
  position: relative; z-index: 1; flex: none;
  height: 36px; padding: 0 15px; border-radius: 11px;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13.5px; color: var(--text-2);
  white-space: nowrap;
  transition: color 0.35s var(--ease);
}
.cat-link:hover { color: var(--text); }
.cat-link.active { color: var(--accent); font-weight: 600; }
.cat-link .n {
  font-size: 11.5px; font-variant-numeric: tabular-nums;
  color: var(--text-3);
  padding: 1px 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--text) 6%, transparent);
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease);
}
.cat-link.active .n { background: var(--accent-soft); color: var(--accent); }

/* 分组 */
.group {
  max-width: var(--wrap); margin: 0 auto;
  padding: 34px max(20px, env(safe-area-inset-left)) 6px;
}
.group-head { display: flex; align-items: center; gap: 12px; }
.group-idx {
  flex: none;
  font-family: var(--mono); font-size: 11.5px; font-weight: 600;
  letter-spacing: 0.06em; font-variant-numeric: tabular-nums;
  padding: 3px 8px; border-radius: 8px;
  color: hsl(var(--ch, 212) 72% 42%);
  background: hsl(var(--ch, 212) 84% 56% / 0.11);
}
html[data-theme='dark'] .group-idx {
  color: hsl(var(--ch, 212) 90% 72%);
  background: hsl(var(--ch, 212) 84% 60% / 0.16);
}
.group-title { margin: 0; font-size: 20px; font-weight: 650; letter-spacing: -0.028em; }
.group-desc { font-size: 13.5px; color: var(--text-3); }
.group-count {
  margin-left: auto; flex: none;
  font-size: 12px; color: var(--text-3);
  font-variant-numeric: tabular-nums;
  padding: 3px 9px; border-radius: 999px;
  background: color-mix(in srgb, var(--text) 6%, transparent);
}
.group-line {
  height: 1px; margin: 16px 0 16px;
  background: linear-gradient(90deg, var(--line-2), var(--line) 22%, transparent 78%);
}

/* ============================================================
   6  卡片
   ============================================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.item { position: relative; min-width: 0; }

.card {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  min-width: 0; min-height: 64px;
  padding: 12px 13px;
  border-radius: var(--r-l);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-s);
  transition: transform 0.45s var(--ease-out), box-shadow 0.45s var(--ease-out),
              border-color 0.35s var(--ease), background-color 0.35s var(--ease);
}
.card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--brand, var(--accent)) 34%, transparent);
  box-shadow: 0 18px 34px -16px color-mix(in srgb, var(--brand, var(--accent)) 62%, transparent),
              0 4px 12px rgba(16, 17, 20, 0.06);
}
.card:active {
  transform: translateY(-1px) scale(0.988);
  transition-duration: 0.12s;
}

/* 图标瓦片 */
.mark {
  width: 38px; height: 38px; flex: none;
  border-radius: 12px;
  display: grid; place-items: center;
  overflow: hidden;
  background-image: linear-gradient(150deg, var(--tile-a, #6b7280), var(--tile-b, #4b5563));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34),
              0 3px 8px -3px color-mix(in srgb, var(--brand, #4b5563) 55%, transparent);
  filter: var(--tile-filter);
  transition: transform 0.45s var(--pop), box-shadow 0.45s var(--ease-out);
}
.card:hover .mark {
  transform: scale(1.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4),
              0 6px 16px -4px color-mix(in srgb, var(--brand, #4b5563) 72%, transparent);
}
.mark-txt {
  font-size: 16px; font-weight: 700; color: #fff;
  letter-spacing: -0.01em; line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
.mark img { width: 100%; height: 100%; object-fit: cover; }
.mark.emoji {
  background-image: none;
  background: color-mix(in srgb, var(--text) 6%, transparent);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 19px;
}

.card-meta { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 1px; }
.card-name {
  font-size: 14px; font-weight: 600; letter-spacing: -0.014em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-desc {
  font-size: 12px; color: var(--text-3); line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.copy {
  position: absolute; top: 6px; right: 6px;
  width: 28px; height: 28px; border-radius: 9px;
  display: grid; place-items: center;
  color: var(--text-3);
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; transform: scale(0.86);
  transition: opacity 0.25s var(--ease), transform 0.3s var(--pop),
              color 0.25s var(--ease), background-color 0.25s var(--ease);
}
.copy svg { width: 15px; height: 15px; }
.item:hover .copy, .copy:focus-visible { opacity: 1; transform: none; }
.copy:hover { color: var(--text); background: var(--surface); box-shadow: var(--shadow-s); }
.copy.done { color: #34c759; }

.item.sel .card {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  box-shadow: 0 0 0 3px var(--accent-soft), 0 16px 30px -14px color-mix(in srgb, var(--accent) 55%, transparent);
}
.item.sel .copy { opacity: 1; transform: none; }

/* 搜索无结果 */
.empty { padding: 46px 4px 30px; text-align: center; }
.empty-title { margin: 0; font-size: 16.5px; font-weight: 600; }
.empty-sub { margin: 8px 0 0; font-size: 13.5px; color: var(--text-3); }

.external {
  margin: 22px 0 6px; padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.external-label { font-size: 13px; color: var(--text-3); flex: none; }
.external .chips { flex: 1 1 auto; min-width: 0; }

/* ============================================================
   7  搜索态切换
   ============================================================ */
#groups, .catbar, #recentBlock {
  transition: opacity 0.16s var(--ease), transform 0.16s var(--ease);
}
.leaving { opacity: 0; transform: translateY(-10px); pointer-events: none; }

#results:not([hidden]) { animation: blockIn 0.5s var(--ease-out) both; }
@keyframes blockIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   8  页脚 / 悬浮按钮
   ============================================================ */
.footer {
  max-width: var(--wrap); margin: 46px auto 0;
  padding: 42px max(20px, env(safe-area-inset-left)) calc(46px + env(safe-area-inset-bottom));
  text-align: center;
  border-top: 1px solid var(--line);
}

.footer-brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 13.5px; font-weight: 600; color: var(--text-2);
  letter-spacing: -0.01em;
}
.footer-logo {
  width: 24px; height: 24px; border-radius: 8px; flex: none;
  box-shadow: 0 0 0 1px var(--line);
  transition: transform 0.5s var(--pop);
}
.footer-brand:hover .footer-logo { transform: scale(1.08) rotate(-3deg); }

.footer-desc { margin: 10px 0 0; font-size: 12.5px; color: var(--text-3); }

.footer-meta {
  margin: 20px 0 0;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  font-size: 12.5px; color: var(--text-3);
}
.fm-item { padding: 0 12px; }
.fm-sep { width: 1px; height: 11px; flex: none; background: var(--line-2); }
.footer-meta a {
  color: var(--text-2);
  border-bottom: 1px solid transparent;
  padding-bottom: 1px;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.footer-meta a:hover { color: var(--accent); border-bottom-color: currentColor; }

.fab {
  position: fixed; z-index: 85;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  width: 48px; height: 48px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-2);
  background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  box-shadow: var(--shadow-m), inset 0 0 0 1px var(--glass-line);
  opacity: 0; pointer-events: none;
  transform: translateY(16px) scale(0.86);
  transition: opacity 0.4s var(--ease), transform 0.5s var(--pop),
              color 0.3s var(--ease), box-shadow 0.4s var(--ease);
}
.fab.show { opacity: 1; pointer-events: auto; transform: none; }
.fab:hover { color: var(--text); transform: translateY(-2px); box-shadow: var(--shadow-l), inset 0 0 0 1px var(--glass-line); }
.fab:active { transform: scale(0.94); }
.fab svg { width: 20px; height: 20px; }

/* ============================================================
   9  动效
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  .hero > * { animation: rise 0.75s var(--ease-out) both; }
  .hero > :nth-child(1) { animation-delay: 0.02s; }
  .hero > :nth-child(2) { animation-delay: 0.08s; }
  .hero > :nth-child(3) { animation-delay: 0.14s; }
  .hero > :nth-child(4) { animation-delay: 0.2s; }
  .hero > :nth-child(5) { animation-delay: 0.27s; }
  .hero > :nth-child(6) { animation-delay: 0.32s; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
  }
  .dock-inner > * { animation: dropIn 0.7s var(--ease-out) both; }
  .dock-inner > :nth-child(2) { animation-delay: 0.06s; }
  .dock-inner > :nth-child(3) { animation-delay: 0.12s; }
  @keyframes dropIn {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: none; }
  }

  /* 分组滚动入场 */
  .js .group { opacity: 0; transform: translateY(22px); }
  .js .group.in {
    opacity: 1; transform: none;
    transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out);
  }
  .js .group.in .item {
    animation: cardIn 0.6s var(--ease-out) both;
    animation-delay: calc(var(--i, 0) * 24ms);
  }
  @keyframes cardIn {
    from { opacity: 0; transform: translateY(12px) scale(0.985); }
    to   { opacity: 1; transform: none; }
  }
  #resultsGrid .item { animation: cardIn 0.5s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 22ms); }
}

/* 主题切换：临时给全页打开配色过渡，整屏颜色一起淡过去 */
.theme-switching,
.theme-switching *,
.theme-switching *::before,
.theme-switching *::after {
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease),
              border-color 0.4s var(--ease), box-shadow 0.4s var(--ease),
              background-image 0.4s var(--ease), transform 0.4s var(--ease),
              opacity 0.4s var(--ease) !important;
}

/* ============================================================
   10  响应式
   ============================================================ */
@media (min-width: 1400px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

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

@media (max-width: 700px) {
  :root { --dock-h: 54px; --catbar-h: 46px; }

  body { font-size: 14.5px; }

  .dock-inner { padding: 0 max(14px, env(safe-area-inset-left)) 0 max(14px, env(safe-area-inset-right)); gap: 10px; }
  .brand-logo { width: 28px; height: 28px; border-radius: 9px; }
  .brand-name { font-size: 15px; }
  .icon-btn { width: 40px; height: 40px; border-radius: 13px; margin-right: -4px; }
  .icon-btn svg { width: 19px; height: 19px; }

  .hero { padding: 34px 16px 10px; text-align: left; }
  .hero-eyebrow { margin-bottom: 14px; height: 28px; font-size: 12.5px; }
  .hero-title { font-size: clamp(30px, 9.5vw, 40px); }
  .hero-desc { margin: 14px 0 0; font-size: 14px; }
  .hero-search { margin: 22px 0 0; max-width: none; }
  #searchInput { height: 52px; padding: 0 50px 0 46px; border-radius: 16px; font-size: 15.5px; }
  .hs-icon { left: 16px; width: 18px; height: 18px; }
  .hs-kbd { display: none; }
  .hs-clear { right: 9px; }

  main > .block { padding: 20px 16px 4px; }
  .catbar { margin-top: 14px; padding: 0 16px; }
  .catbar::before { inset: 0 16px; border-radius: 14px; }
  .cat-inner { padding: 5px; border-radius: 14px; }
  .cat-ind { height: 36px; border-radius: 10px; }
  .cat-link { height: 36px; padding: 0 13px; font-size: 13px; border-radius: 10px; }

  .group { padding: 24px 16px 4px; }
  .group-title { font-size: 18px; }
  .group-line { margin: 13px 0 14px; }

  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; }
  .card { min-height: 60px; padding: 10px; gap: 9px; border-radius: 15px; }
  .mark { width: 34px; height: 34px; border-radius: 11px; }
  .mark-txt { font-size: 14.5px; }
  .card-name { font-size: 13.5px; }
  .card-desc { font-size: 11.5px; }

  /* 触屏没有 hover：复制按钮常驻但弱化，并给标题让出位置避免压字 */
  @media (hover: none) {
    .copy { opacity: 0.38; transform: none; width: 28px; height: 28px; border-radius: 9px; top: 5px; right: 5px; }
    .copy svg { width: 15px; height: 15px; }
    .card-meta { padding-right: 22px; }
    .card:hover { transform: none; }
  }

  .footer { margin-top: 30px; padding: 32px 16px calc(36px + env(safe-area-inset-bottom)); }
  .footer-desc { margin-top: 9px; font-size: 12px; line-height: 1.6; }
  .footer-meta { margin-top: 16px; flex-direction: column; gap: 9px; }
  .fm-item { padding: 0; }
  .fm-sep { display: none; }
  .fab { width: 46px; height: 46px; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); }

  .aurora .b3 { display: none; }
}

@media (max-width: 420px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .group-head { flex-wrap: wrap; gap: 6px 10px; }
  .group-desc { flex: 1 1 100%; order: 3; font-size: 12.5px; }
}

@media (max-width: 340px) {
  .grid { grid-template-columns: 1fr; }
}

/* 横屏矮屏 */
@media (max-height: 520px) and (orientation: landscape) {
  .hero { padding-top: 22px; padding-bottom: 12px; }
  .hero-desc { display: none; }
  .hero-title { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .group { opacity: 1 !important; transform: none !important; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .dock, .catbar, .aurora, .noise, .copy, .hero-search, .fab, .progress { display: none !important; }
  .js .group { opacity: 1 !important; transform: none !important; }
  .grid { grid-template-columns: repeat(3, 1fr); }
}

/* 不支持 color-mix 的旧浏览器兜底 */
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .dock, .catbar::before, .fab { background: var(--surface); }
  .icon-btn:hover, .link-btn:hover, .cat-link:hover { background: rgba(127, 127, 127, 0.14); }
  .copy { background: var(--surface); }
  .mark.emoji { background: rgba(127, 127, 127, 0.12); }
  .cat-link .n, .block-count, .group-count { background: rgba(127, 127, 127, 0.14); }
  .card:hover { border-color: var(--accent); }
  .item.sel .card { border-color: var(--accent); }
}
