/* ==========================================================================
   NavLite Design System — Powered by UI/UX Pro Max Typography & Tokens
   Default: Crisp Light Mode (#f8fafc) | Toggleable: Obsidian Dark Mode (#0b0b10)
   ========================================================================== */

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/static/fonts/dm-sans-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Space Grotesk";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("/static/fonts/space-grotesk-latin.woff2") format("woff2");
}

@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url("/static/fonts/jetbrains-mono-latin.woff2") format("woff2");
}

:root {
  --font-sans: "DM Sans", "Noto Sans SC", "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB", "Microsoft YaHei UI", ui-sans-serif, system-ui, sans-serif;
  --font-heading: "Space Grotesk", "Noto Sans SC", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Light Mode Semantic Tokens (Default) - 拉开底色与纯白卡片的明度对比 */
  --bg-page: #eaeff8;
  --bg-grid: rgba(15, 23, 42, 0.058);
  --bg-glow-1: rgba(37, 99, 235, 0.23);
  --bg-glow-2: rgba(99, 102, 241, 0.19);
  --bg-glow-3: rgba(249, 115, 22, 0.14);

  --surface-panel: rgba(255, 255, 255, 0.92);
  --surface-card: #ffffff;
  --surface-card-hover: #ffffff;
  --surface-subtle: #eef2f7;
  --surface-subtle-hover: #e2e8f0;
  --surface-input: #ffffff;
  --surface-track: rgba(219, 228, 240, 0.92);
  --surface-glider: linear-gradient(135deg, #2563eb, #1d4ed8);

  --text-primary: #0f172a;
  --text-secondary: #1e293b;
  --text-muted: #475569;

  --border-subtle: #cbd5e1;
  --border-strong: #94a3b8;
  --border-hover: #3b82f6;

  --color-primary: #2563eb;
  --color-primary-hover: #1d4ed8;
  --color-primary-soft: #eff6ff;
  --color-primary-border: #bfdbfe;
  --color-ring: #3b82f6;

  --shadow-panel: 0 4px 16px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --shadow-card: 0 2px 8px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-card-hover: 0 16px 28px -6px rgba(37, 99, 235, 0.16), 0 6px 12px -4px rgba(15, 23, 42, 0.06);
  --shadow-glider: 0 3px 10px rgba(37, 99, 235, 0.32), 0 1px 2px rgba(15, 23, 42, 0.10);
}

html.dark {
  color-scheme: dark;
  /* 抗眩光护眼深石板灰体系：提亮底层背景，柔化压暗顶层白字，消除移动端高反差刺眼感 */
  --bg-page: #161b26;
  --bg-grid: rgba(203, 213, 225, 0.045);
  --bg-glow-1: rgba(59, 130, 246, 0.18);
  --bg-glow-2: rgba(99, 102, 241, 0.14);
  --bg-glow-3: rgba(234, 88, 12, 0.09);

  --surface-panel: rgba(30, 37, 52, 0.88);
  --surface-card: #202737;
  --surface-card-hover: #283145;
  --surface-subtle: #273044;
  --surface-subtle-hover: #313c54;
  --surface-input: rgba(26, 33, 47, 0.92);
  --surface-track: rgba(24, 30, 43, 0.92);
  --surface-glider: linear-gradient(135deg, #3b82f6, #2563eb);

  --text-primary: #d5dde8;
  --text-secondary: #aebac9;
  --text-muted: #7f8ea3;

  --border-subtle: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.28);
  --border-hover: rgba(96, 165, 250, 0.45);

  --color-primary: #60a5fa;
  --color-primary-hover: #3b82f6;
  --color-primary-soft: rgba(59, 130, 246, 0.16);
  --color-primary-border: rgba(96, 165, 250, 0.32);
  --color-ring: #60a5fa;

  --shadow-panel: 0 4px 20px rgba(8, 11, 18, 0.30);
  --shadow-card: 0 2px 6px rgba(8, 11, 18, 0.22);
  --shadow-card-hover: 0 12px 24px -6px rgba(8, 11, 18, 0.42);
  --shadow-glider: 0 2px 8px rgba(8, 11, 18, 0.32), inset 0 0 0 1px rgba(96, 165, 250, 0.35);
}

/* ==========================================================================
   NSFW 里世界专属主题：中性微醺暮色烟紫 (Dusk Mauve · 介于昼夜之间的温润中性调)
   ========================================================================== */
html.nsfw {
  color-scheme: dark;
  --bg-page: #372b42;
  --bg-grid: rgba(244, 180, 218, 0.065);
  --bg-glow-1: rgba(236, 72, 153, 0.22);
  --bg-glow-2: rgba(167, 139, 250, 0.20);
  --bg-glow-3: rgba(251, 146, 60, 0.12);

  --surface-panel: rgba(68, 53, 82, 0.86);
  --surface-card: #493958;
  --surface-card-hover: #564368;
  --surface-subtle: #524063;
  --surface-subtle-hover: #614c75;
  --surface-input: rgba(56, 43, 68, 0.92);
  --surface-track: rgba(50, 38, 61, 0.92);
  --surface-glider: linear-gradient(135deg, #ec4899, #8b5cf6);

  --text-primary: #ece5f2;
  --text-secondary: #d2c4de;
  --text-muted: #af9dbe;

  --border-subtle: rgba(232, 190, 224, 0.22);
  --border-strong: rgba(244, 114, 182, 0.38);
  --border-hover: rgba(244, 114, 182, 0.62);

  --color-primary: #f472b6;
  --color-primary-hover: #ec4899;
  --color-primary-soft: rgba(244, 114, 182, 0.18);
  --color-primary-border: rgba(244, 114, 182, 0.38);
  --color-ring: #f472b6;

  --shadow-panel: 0 6px 24px rgba(24, 16, 32, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --shadow-card: 0 2px 7px rgba(24, 16, 32, 0.20);
  --shadow-card-hover: 0 14px 26px -6px rgba(24, 16, 32, 0.34), 0 4px 12px -2px rgba(236, 72, 153, 0.18);
  --shadow-glider: 0 3px 12px rgba(236, 72, 153, 0.34), inset 0 0 0 1px rgba(249, 168, 212, 0.36);
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html {
  scroll-behavior: smooth;
  font-size: 15px;
  max-width: 100%;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

body {
  position: relative;
  margin: 0;
  padding: 0;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: clip;
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  background-image:
    radial-gradient(78% 62% at 10% 8%, var(--bg-glow-1), transparent 72%),
    radial-gradient(68% 55% at 90% 15%, var(--bg-glow-2), transparent 72%),
    radial-gradient(75% 62% at 80% 94%, var(--bg-glow-3), transparent 74%);
  background-attachment: fixed;
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 自适应精密网格背景层（中心清晰、边缘柔和渐隐） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(to right, var(--bg-grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--bg-grid) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse 92% 86% at 50% 36%, #000 52%, transparent 100%);
  mask-image: radial-gradient(ellipse 92% 86% at 50% 36%, #000 52%, transparent 100%);
}

/* NSFW 里世界专属微醺暮色纹理与慢呼吸霞光层（纯 GPU 合成层动画） */
html.nsfw body {
  background-image:
    radial-gradient(85% 65% at 50% 0%, rgba(244, 114, 182, 0.22), transparent 72%),
    radial-gradient(75% 60% at 92% 95%, rgba(167, 139, 250, 0.22), transparent 75%);
}

html.nsfw body::before {
  background-image:
    repeating-linear-gradient(45deg, rgba(249, 168, 212, 0.048) 0px, rgba(249, 168, 212, 0.048) 1px, transparent 1px, transparent 28px),
    repeating-linear-gradient(-45deg, rgba(196, 181, 253, 0.042) 0px, rgba(196, 181, 253, 0.042) 1px, transparent 1px, transparent 28px);
  background-size: auto;
  -webkit-mask-image: radial-gradient(ellipse 90% 84% at 50% 38%, #000 46%, transparent 98%);
  mask-image: radial-gradient(ellipse 90% 84% at 50% 38%, #000 46%, transparent 98%);
}

html.nsfw body::after {
  content: "";
  position: fixed;
  inset: -16%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(42% 38% at 22% 24%, rgba(236, 72, 153, 0.24), transparent 72%),
    radial-gradient(40% 38% at 78% 28%, rgba(167, 139, 250, 0.24), transparent 72%),
    radial-gradient(46% 40% at 52% 82%, rgba(251, 146, 60, 0.14), transparent 74%);
  will-change: transform;
  animation: velvetAuroraBreath 15s ease-in-out infinite alternate;
}

@keyframes velvetAuroraBreath {
  0% { transform: translate3d(-2.5%, -1.5%, 0) scale(1); }
  50% { transform: translate3d(2.5%, 2%, 0) scale(1.06); }
  100% { transform: translate3d(-1.5%, 3%, 0) scale(1.02); }
}

a { color: inherit; text-decoration: none; }
button, select, input, textarea { font-family: inherit; }

a, button, input, select, textarea { outline: none; }

@media (hover: hover) and (pointer: fine) {
  a:focus-visible,
  button:focus-visible,
  input:focus-visible,
  select:focus-visible,
  textarea:focus-visible {
    outline: 2px solid var(--color-ring);
    outline-offset: 2px;
  }
  .engine-tab:focus-visible,
  .search-input:focus-visible {
    outline: none;
  }
}

/* SVG 矢量图标标准尺寸 Token */
.icon-svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  stroke-width: 1.85;
}
.icon-sm {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke-width: 1.85;
}

/* 核心容器与微玻璃面板 */
.glass-surface {
  background-color: var(--surface-panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: var(--shadow-panel);
}

.glass-card {
  background-color: var(--surface-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.glass-card:hover {
  background-color: var(--surface-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.glass-pill {
  background-color: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.glass-pill:hover {
  background-color: var(--surface-subtle-hover);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

/* 布局骨架 */
.container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px 20px 44px;
}

/* 顶部纯净导航栏 */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  margin-bottom: 16px;
}

.brand-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.brand-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 5px rgba(15, 23, 42, 0.12));
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1);
}
a.brand-wrap:hover .brand-logo-img {
  transform: rotate(-6deg) scale(1.06);
}
.brand-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  white-space: nowrap;
}
.brand-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  padding-left: 10px;
  border-left: 1px solid var(--border-subtle);
  white-space: nowrap;
}

/* ==========================================================================
   全新滑动胶囊式聚合搜索舱 (Segmented Glider Tabs + Floating Search Vessel)
   ========================================================================== */
.search-hero {
  max-width: 680px;
  margin: 0 auto 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* 顶部分段滑动轨道：支持横向触控/拖拽平滑滚动 + 弹性跟随滑块 */
.engine-track-wrap {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 2px;
}
.engine-track-wrap::-webkit-scrollbar { display: none; }

.engine-track {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 4px;
  border-radius: 999px;
  background-color: var(--surface-track);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06), var(--shadow-card);
  user-select: none;
}

.engine-glider {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  border-radius: 999px;
  background: var(--surface-glider);
  box-shadow: var(--shadow-glider);
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), width 260ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
  z-index: 0;
}

.engine-tab {
  position: relative;
  z-index: 1;
  border: none;
  background: transparent;
  padding: 5px 16px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: color 180ms ease;
}
.engine-tab:hover {
  color: var(--text-primary);
}
.engine-tab.active,
html.dark .engine-tab.active,
html.nsfw .engine-tab.active {
  color: #ffffff;
  font-weight: 600;
}

/* 下层现代悬浮搜索输入舱 */
.search-vessel {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--surface-input);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 6px 6px 6px 15px;
  box-shadow: 0 6px 20px -4px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.03);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}
html.dark .search-vessel,
html.nsfw .search-vessel {
  box-shadow: 0 8px 28px -6px rgba(0, 0, 0, 0.45);
}
.search-vessel:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15), 0 10px 26px -6px rgba(37, 99, 235, 0.14);
}
html.nsfw .search-vessel:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(244, 114, 182, 0.20), 0 10px 28px -6px rgba(236, 72, 153, 0.24);
}
html.nsfw .search-btn {
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  box-shadow: 0 3px 12px rgba(236, 72, 153, 0.34);
}

.search-lead-icon {
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.search-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  color: var(--text-primary);
  padding: 6px 4px;
  font-size: 14px;
  outline: none;
}
.search-input:focus,
.search-input:focus-visible {
  outline: none;
  box-shadow: none;
}
.search-input::placeholder { color: var(--text-muted); }
/* 隐藏浏览器默认丑陋的蓝色原生 search X 图标，改用自定义精致清空按钮 */
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

.search-clear-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 150ms ease, color 150ms ease;
}
.search-clear-btn.visible { display: inline-flex; }
.search-clear-btn:hover {
  background: var(--surface-subtle-hover);
  color: var(--text-primary);
}

.kbd-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  user-select: none;
  flex-shrink: 0;
}

.search-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 3px 10px rgba(37, 99, 235, 0.24);
  transition: opacity 150ms ease, transform 150ms ease;
}
.search-btn:hover {
  opacity: 0.94;
  transform: translateY(-1px);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.btn-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}
.btn-icon-only {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: 10px;
  border: none;
  background-color: var(--color-primary);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.22);
  transition: background-color 150ms ease, transform 150ms ease;
}
.btn-primary:hover {
  background-color: var(--color-primary-hover);
  transform: translateY(-1px);
}

/* 主体双栏结构 */
.main-layout {
  width: 100%;
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.sidebar {
  width: 196px;
  flex-shrink: 0;
  position: sticky;
  top: 16px;
}
.sidebar-nav {
  padding: 12px;
}
.sidebar-heading {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 4px 10px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cat-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background-color 150ms ease, color 150ms ease;
}
.cat-link:hover {
  background-color: var(--surface-subtle);
  color: var(--text-primary);
}
.cat-count {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.sidebar-footer {
  margin-top: 10px;
  padding: 10px 10px 2px;
  border-top: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-footer strong {
  font-family: var(--font-mono);
  color: var(--text-primary);
}

/* 移动端横向分类栏 */
.mobile-cat-bar {
  display: none;
  width: 100%;
  max-width: 100%;
  position: sticky;
  top: 8px;
  z-index: 30;
  padding: 8px 10px;
  margin-bottom: 16px;
  overflow-x: auto;
  gap: 6px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.mobile-cat-bar::-webkit-scrollbar { display: none; }

.content-area {
  flex: 1;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.content-area > section {
  min-width: 0;
  max-width: 100%;
}

/* 热门常用快捷栏 */
.pinned-box {
  padding: 13px 16px;
  min-width: 0;
}
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.section-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.015em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}
.section-sub {
  font-size: 12px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: color 150ms ease;
}
a.section-sub:hover { color: var(--color-primary); }

.pinned-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pinned-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 500;
  max-width: 100%;
}
.mini-icon {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  object-fit: contain;
  font-family: var(--font-heading);
  font-size: 10px;
  font-weight: 700;
  background-color: var(--color-primary-soft);
  color: var(--color-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* 高密度瑞士网格卡片（严格 minmax(0, 1fr) 防止长文本撑破移动端视口） */
.site-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.site-grid > li {
  min-width: 0;
  max-width: 100%;
}

/* 紧凑上下分区卡片：缩小内边距降低总高，上半部全宽标题简介零挤压，下半部微栏放等宽纯图标 + 详情 */
.site-card {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 8px 11px 6px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
}
.site-main-link {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-width: 0;
  cursor: pointer;
}
.site-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  object-fit: contain;
  background-color: var(--surface-subtle);
  border: 1px solid var(--border-subtle);
  padding: 4px;
}
.site-badge {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  background-color: var(--color-primary-soft);
  border: 1px solid var(--color-primary-border);
  color: var(--color-primary);
}

.site-info {
  flex: 1;
  min-width: 0;
}
.site-name {
  margin: 0;
  min-width: 0;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 150ms ease;
}
.site-card:hover .site-name {
  color: var(--color-primary);
}

.site-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 5px;
  border-top: 1px dashed rgba(148, 163, 184, 0.30);
  min-height: 22px;
  min-width: 0;
}
html.dark .site-card-foot {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.site-host-hint {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
  opacity: 0.78;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* 卡片底部等宽纯图标微章（固定 18x18px 正方形，超出自动收折为 +N） */
.card-badges {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.attr-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border-radius: 5px;
  line-height: 1;
  flex-shrink: 0;
}
.attr-badge.attr-more {
  width: auto;
  padding: 0 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}
.attr-badge svg { flex-shrink: 0; }

/* 6 套自适应日/夜柔和语义色 */
.attr-amber { background: #fef3c7; color: #b45309; border: 1px solid rgba(245, 158, 11, 0.32); }
html.dark .attr-amber, html.nsfw .attr-amber { background: rgba(245, 158, 11, 0.16); color: #fbbf24; border-color: rgba(245, 158, 11, 0.32); }

.attr-purple { background: #f3e8ff; color: #7e22ce; border: 1px solid rgba(168, 85, 247, 0.28); }
html.dark .attr-purple, html.nsfw .attr-purple { background: rgba(168, 85, 247, 0.16); color: #c084fc; border-color: rgba(168, 85, 247, 0.32); }

.attr-emerald { background: #d1fae5; color: #047857; border: 1px solid rgba(16, 185, 129, 0.28); }
html.dark .attr-emerald, html.nsfw .attr-emerald { background: rgba(16, 185, 129, 0.16); color: #34d399; border-color: rgba(16, 185, 129, 0.32); }

.attr-blue { background: #dbeafe; color: #1d4ed8; border: 1px solid rgba(59, 130, 246, 0.28); }
html.dark .attr-blue, html.nsfw .attr-blue { background: rgba(59, 130, 246, 0.16); color: #60a5fa; border-color: rgba(59, 130, 246, 0.32); }

.attr-rose { background: #ffe4e6; color: #be123c; border: 1px solid rgba(244, 63, 94, 0.28); }
html.dark .attr-rose, html.nsfw .attr-rose { background: rgba(244, 63, 94, 0.16); color: #fb7185; border-color: rgba(244, 63, 94, 0.32); }

.attr-slate { background: #e2e8f0; color: #334155; border: 1px solid rgba(100, 116, 139, 0.28); }
html.dark .attr-slate, html.nsfw .attr-slate { background: rgba(148, 163, 184, 0.16); color: #cbd5e1; border-color: rgba(148, 163, 184, 0.30); }

/* 纯 CSS 悬浮提示气泡（兼顾移动端轻触激活 .tip-open） */
.attr-badge[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  transform: translateY(3px);
  padding: 4px 8px;
  border-radius: 6px;
  background: #0f172a;
  color: #f8fafc;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  z-index: 50;
  transition: opacity 140ms ease, transform 140ms ease;
}
html.dark .attr-badge[data-tip]::after,
html.nsfw .attr-badge[data-tip]::after {
  background: #f8fafc;
  color: #0f172a;
}
.attr-badge[data-tip]:hover::after,
.attr-badge[data-tip].tip-open::after {
  opacity: 1;
  transform: translateY(0);
}
.site-desc {
  margin: 2px 0 0;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.detail-link {
  flex-shrink: 0;
  height: 18px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

/* 站点详情内页与聚合内页 */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.breadcrumb a:hover { color: var(--color-primary); }

.detail-panel {
  padding: 24px 26px;
  min-width: 0;
}
.detail-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
}
.detail-head-left {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.detail-icon-lg {
  width: 52px;
  height: 52px;
  border-radius: 13px;
  font-size: 17px;
}
.detail-h1 {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  word-break: break-word;
}
.detail-meta {
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-variant-numeric: tabular-nums;
}
.detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.detail-body {
  padding-top: 18px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-secondary);
  max-width: 68ch;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.tag-chip {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
}

/* 页脚 */
.site-footer {
  padding: 13px 18px;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.site-footer a:hover { color: var(--color-primary); }

/* 投稿弹窗与 Toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.50);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.open { display: flex; }
.modal-card {
  width: 100%;
  max-width: 440px;
  padding: 22px;
}
.form-row { margin-bottom: 13px; }
.form-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--text-secondary);
}
.form-control {
  width: 100%;
  padding: 8px 12px;
  border-radius: 9px;
  background: var(--surface-input);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 13.5px;
  outline: none;
}
.form-control:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.14);
}
.hp-field { position: absolute; left: -9999px; opacity: 0; pointer-events: none; }

.toast-msg {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  display: none;
}
.toast-msg.show { display: block; }
.hidden { display: none !important; }

/* 日夜与模式图标切换显隐 */
html.dark .icon-moon,
html.nsfw .icon-moon { display: none; }
html:not(.dark):not(.nsfw) .icon-sun { display: none; }

.nsfw-mode-pill {
  display: none;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 999px;
  color: #fbcfe8;
  background: rgba(236, 72, 153, 0.22);
  border: 1px solid rgba(244, 114, 182, 0.44);
  box-shadow: 0 0 12px rgba(236, 72, 153, 0.22);
  white-space: nowrap;
}
html.nsfw .nsfw-mode-pill { display: inline-flex; align-items: center; }
html.nsfw .brand-sub { display: none; }

/* 极简 / 常用视图按钮显隐状态 */
.btn-mode-switch {
  height: 34px;
  padding: 0 11px;
  gap: 5px;
}
html:not(.view-minimal) .icon-view-standard,
html:not(.view-minimal) .view-label-to-std { display: none; }
html.view-minimal .icon-view-minimal,
html.view-minimal .view-label-to-min { display: none; }
html.view-minimal .btn-mode-switch {
  background-color: var(--color-primary-soft);
  border-color: var(--color-primary-border);
  color: var(--color-primary);
}

/* 低调 NSFW 开关与激活态微发光 */
.btn-nsfw-switch {
  opacity: 0.78;
  transition: opacity 180ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease, box-shadow 180ms ease;
}
.btn-nsfw-switch:hover {
  opacity: 1;
  border-color: rgba(244, 63, 94, 0.42);
  color: #e11d48;
}
html.dark .btn-nsfw-switch:hover { color: #fb7185; }
html:not(.nsfw) .icon-nsfw-active { display: none; }
html.nsfw .icon-nsfw-enter { display: none; }
html.nsfw .btn-nsfw-switch {
  opacity: 1;
  background: rgba(236, 72, 153, 0.22);
  border-color: rgba(244, 114, 182, 0.52);
  color: #fbcfe8;
  box-shadow: 0 0 14px rgba(236, 72, 153, 0.30);
}

/* NSFW 门禁毛玻璃弹窗专属修饰 */
.nsfw-modal-backdrop {
  background: rgba(11, 5, 10, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.nsfw-modal-card {
  max-width: 400px;
  border-color: rgba(244, 63, 94, 0.28);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(244, 63, 94, 0.12);
}
.nsfw-modal-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 999px;
  color: #e11d48;
  background: rgba(225, 29, 72, 0.12);
  border: 1px solid rgba(225, 29, 72, 0.28);
}
html.dark .nsfw-modal-badge,
html.nsfw .nsfw-modal-badge {
  color: #fda4af;
  background: rgba(225, 29, 72, 0.18);
}
.nsfw-gate-err {
  margin: 8px 0 0;
  font-size: 12.5px;
  font-weight: 500;
  color: #e11d48;
}
html.dark .nsfw-gate-err, html.nsfw .nsfw-gate-err { color: #fb7185; }
.btn-nsfw-confirm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 16px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #e11d48, #9333ea);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(225, 29, 72, 0.34);
  transition: opacity 150ms ease, transform 150ms ease;
}
.btn-nsfw-confirm:hover { opacity: 0.94; transform: translateY(-1px); }

/* ==========================================================================
   瞳孔光圈扩散过渡动画 (Circular Iris Reveal via View Transitions API)
   ========================================================================== */
html.vt-iris-in::view-transition-old(root),
html.vt-iris-out::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}
html.vt-iris-in::view-transition-new(root) {
  z-index: 9999;
  mix-blend-mode: normal;
  animation: nsfwIrisExpand 540ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
html.vt-iris-out::view-transition-old(root) {
  z-index: 9999;
  mix-blend-mode: normal;
  animation: nsfwIrisCollapse 460ms cubic-bezier(0.32, 0, 0.24, 1) both;
}
@keyframes nsfwIrisExpand {
  from { clip-path: circle(0px at var(--vt-x, 90%) var(--vt-y, 32px)); }
  to   { clip-path: circle(var(--vt-r, 150vmax) at var(--vt-x, 90%) var(--vt-y, 32px)); }
}
@keyframes nsfwIrisCollapse {
  from { clip-path: circle(var(--vt-r, 150vmax) at var(--vt-x, 90%) var(--vt-y, 32px)); }
  to   { clip-path: circle(0px at var(--vt-x, 90%) var(--vt-y, 32px)); }
}

.nsfw-iris-ripple {
  position: fixed;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  margin-left: -12px;
  margin-top: -12px;
  border-radius: 50%;
  border: 2px solid rgba(244, 63, 94, 0.72);
  box-shadow: 0 0 24px rgba(225, 29, 72, 0.55);
  pointer-events: none;
  z-index: 9998;
  animation: irisRippleWave 560ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes irisRippleWave {
  0%   { transform: translate3d(var(--rp-x), var(--rp-y), 0) scale(0.4); opacity: 0.95; }
  100% { transform: translate3d(var(--rp-x), var(--rp-y), 0) scale(16); opacity: 0; }
}

/* 响应式断点：手机端保持紧凑双列网格，彻底杜绝溢出与过长单列 */
@media (max-width: 1180px) {
  .site-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .sidebar { display: none; }
  .mobile-cat-bar { display: flex; }
  .brand-sub, .kbd-hint { display: none; }
  .site-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .container { padding: 10px 10px 32px; }
  .site-header { padding: 9px 12px; margin-bottom: 12px; }
  .hide-xs { display: none; }
  .search-hero { margin-bottom: 14px; gap: 8px; }
  .engine-tab { padding: 5px 12px; font-size: 12px; }
  .search-vessel { padding: 5px 5px 5px 12px; border-radius: 14px; }
  .search-input { font-size: 13.5px; }
  .search-btn { padding: 7px 14px; border-radius: 10px; font-size: 12.5px; }

  /* 手机端（如小米14 393px）保持双列高密度排版，微缩内边距确保精致充裕 */
  .site-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .site-card { padding: 7px 8px 5px; gap: 5px; border-radius: 11px; }
  .site-main-link { gap: 7px; }
  .site-icon, .site-badge { width: 28px; height: 28px; border-radius: 7px; font-size: 10.5px; padding: 3px; }
  .site-name { font-size: 12.5px; }
  .site-desc { font-size: 11px; }
  .site-card-foot { padding-top: 4px; min-height: 19px; gap: 4px; }
  .card-badges { gap: 3px; }
  .attr-badge { width: 16px; height: 16px; border-radius: 4px; }
  .attr-badge svg { width: 10px; height: 10px; }
  .site-host-hint { font-size: 10px; }
  .detail-link { height: 16px; padding: 0 5px; font-size: 10.5px; }

  .pinned-box { padding: 10px 11px; }
  .detail-panel { padding: 16px; }
}
@media (max-width: 335px) {
  .site-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================================
   前台极简模式 (html.view-minimal)：单份 DOM 零重排降维为自然流式高对比小胶囊
   使用实体卡片底色 + 清晰描边与微立体投影，在页面底色上清晰浮现不发糊
   ========================================================================== */
html.view-minimal .site-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
html.view-minimal .site-grid > li {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}
html.view-minimal .site-card {
  width: auto;
  height: auto;
  padding: 0;
  border-radius: 9px;
  background-color: var(--surface-card);
  border: 1px solid #bfccdc;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.04);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
html.dark.view-minimal .site-card,
html.nsfw.view-minimal .site-card {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card);
}
html.view-minimal .site-card:hover {
  background-color: var(--surface-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px -2px rgba(37, 99, 235, 0.14), 0 2px 4px -1px rgba(15, 23, 42, 0.06);
}
html.dark.view-minimal .site-card:hover,
html.nsfw.view-minimal .site-card:hover {
  box-shadow: var(--shadow-card-hover);
}
html.view-minimal .site-main-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  width: auto;
  max-width: 100%;
}
html.view-minimal .site-icon,
html.view-minimal .site-badge {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  padding: 0;
  border: none;
  font-size: 10px;
}
html.view-minimal .site-icon {
  background-color: transparent;
}
html.view-minimal .site-info {
  flex: 0 1 auto;
  min-width: 0;
}
html.view-minimal .site-name {
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0;
  color: var(--text-primary);
  max-width: 210px;
}
html.view-minimal .site-card:hover .site-name {
  color: var(--color-primary);
}
html.view-minimal .site-desc,
html.view-minimal .site-card-foot {
  display: none !important;
}
@media (max-width: 600px) {
  .btn-mode-switch { width: 34px; padding: 0; }
  html.view-minimal .site-grid { gap: 7px; }
  html.view-minimal .site-main-link { padding: 5px 10px; gap: 6px; }
  html.view-minimal .site-name { font-size: 12px; max-width: 155px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .glass-card:hover, .btn-primary:hover, .search-btn:hover { transform: none; }
}
