/* 自定义滚动条 */
:root {
  --card-padding: 1.25rem;
  --card-radius: 14px;
  --glass-blur: 15px;
  --frosted-glass-blur: 15px;
  --glass-backdrop: blur(15px) saturate(140%);
  --card-glass-backdrop: blur(15px);
  --card-icon-size: 44px;
}

.home-title-block:empty {
  display: none;
}

.home-search-field {
  position: relative;
}

.home-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

#addSiteForm {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.\!hidden,
.site-card.hidden,
.home-panel.hidden,
.panel-sub-group.hidden,
.panel-l3-group.hidden,
.panel-pane-empty.hidden,
.search-empty-state.hidden {
  display: none !important;
}

/* 粘性页脚：内容不足一屏时推到底部，内容较多时自然跟随文档流 */
#app-scroll > .main-content {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

#app-scroll > .main-content > header,
#app-scroll > .main-content > div,
#app-scroll > .main-content > section {
  width: 100%;
  flex-shrink: 0;
}

#app-scroll > .main-content > footer {
  flex-shrink: 0;
  margin-top: auto;
  /* 与 eooce/Nav-Item 页脚字体一致：桌面 14px，移动端 0.7rem */
  font-size: 14px;
  /* 桌面风格一/二：黑色；桌面风格三在下方 media 中覆盖为白色 */
  color: #111827;
}

/* 仅继承字号，不锁死 color，避免盖掉 hover:text-primary-500 */
#app-scroll > .main-content > footer a,
#app-scroll > .main-content > footer p,
#app-scroll > .main-content > footer span {
  font-size: inherit;
}

#app-scroll > .main-content > footer .text-gray-300 {
  color: rgba(17, 24, 39, 0.35);
}

.footer-brand,
.footer-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
}

#app-scroll > .main-content > footer .flex {
  gap: 0.85rem;
}

.footer-brand-link {
  color: inherit;
  text-decoration: none;
  border-radius: 0.5rem;
  padding: 0.15rem 0.4rem;
  transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease;
}

.footer-brand-link:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  background-color: rgba(148, 163, 184, 0.16);
}

.footer-brand-icon {
  flex-shrink: 0;
}

html.dark #app-scroll > .main-content > footer {
  color: #e5e7eb;
}

html.dark #app-scroll > .main-content > footer .text-gray-300 {
  color: rgba(229, 231, 235, 0.35);
}

@media (max-width: 768px) {
  #app-scroll > .main-content > footer {
    font-size: 0.7rem;
  }
}

/* 手机端不区分卡片风格，页脚统一使用白色文字 */
@media (max-width: 767px) {
  #app-scroll > .main-content > footer,
  #app-scroll > .main-content > footer a,
  #app-scroll > .main-content > footer p,
  #app-scroll > .main-content > footer span {
    color: #ffffff !important;
  }

  #app-scroll > .main-content > footer .text-gray-300 {
    color: rgba(255, 255, 255, 0.35) !important;
  }
}

/* ========================================= */
/*  Theme Switch Animation (View Transitions)*/
/* ========================================= */
::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

/* 仅在主题切换时应用自定义动画 */
.theme-animating::view-transition-group(root) {
  animation-duration: 0.5s;
}

.theme-animating::view-transition-old(root) {
  z-index: 1;
}

/* 默认：从上往下 (Dark Mode 出现) */
.theme-animating.dark::view-transition-new(root) {
  z-index: 999;
  animation: theme-wipe-down 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

/* 反向：从下往上 (Light Mode 出现) */
.theme-animating:not(.dark)::view-transition-new(root) {
  z-index: 999;
  animation: theme-wipe-up 0.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes theme-wipe-down {
  from {
    clip-path: inset(0 0 100% 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes theme-wipe-up {
  from {
    clip-path: inset(100% 0 0 0);
  }
  to {
    clip-path: inset(0 0 0 0);
  }
}

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #c3d0e3;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: #416d9d;
}

/* Dark Mode Scrollbar */
.dark ::-webkit-scrollbar-track {
  background: transparent;
}
.dark ::-webkit-scrollbar-thumb {
  background: #4b5563;
}
.dark ::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

/* ========================================= */
/*  Dark Mode & Wallpaper Optimizations      */
/* ========================================= */

/* 1. 背景压暗 (仅在有壁纸且夜间模式时) */
html.dark body.custom-wallpaper::before {
    content: '';
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6); /* 60% 黑色遮罩 */
    z-index: -1;
    pointer-events: none;
    transition: background-color 0.3s ease;
}

/* 2. 侧边栏毛玻璃与悬浮圆角岛样式已在文件下方侧边栏独立章节统一定义 */

/* 3. 卡片基础与悬停样式 */
.site-card {
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
              box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1),
              background-color 0.3s ease,
              border-color 0.3s ease,
              color 0.3s ease;
  will-change: auto;
  container-type: inline-size; /* 开启容器查询，允许子元素监听卡片宽度 */
  container-name: card;
  border-radius: var(--card-radius) !important;
  width: 100%;
  height: 100%; /* 撑满 Grid 单元高度 */
  display: flex;
  flex-direction: column;
  backface-visibility: hidden;
  transform: translateZ(0);
  contain: content; /* 关键：隔离卡片内部渲染，防止大量图片加载或颜色改变引发全局重绘 */
}

/* 悬停反馈：轻微上浮 + 柔阴影，避免放大导致邻居错位 */
.site-card:hover {
  will-change: transform;
  transform: translateY(-3px);
  box-shadow: 0 12px 24px -8px rgba(15, 23, 42, 0.22), 0 4px 8px -4px rgba(15, 23, 42, 0.12);
  z-index: 5;
}

@media (prefers-reduced-motion: reduce) {
  .site-card:hover {
    transform: none;
  }
}

.site-card-content {
  padding: var(--card-padding);
  flex: 1; /* 占据卡片所有垂直空间 */
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.site-card-content a {
    /* flex: 1; Removed to compact height */
    display: flex;
    flex-direction: column;
}

/* 书签卡片描述统一单行截断省略，紧凑利落，不写死两行高度 */
.site-card p {
  display: block !important;
  width: 100%;
  margin-bottom: 0;
  height: auto !important;
  line-height: 1.45 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  -webkit-line-clamp: unset !important;
}

/* 夜间模式卡片 - 仅在开启毛玻璃时应用半透明 */
.dark .site-card.frosted-glass-effect {
    background-color: rgba(30, 41, 59, 0.4) !important;
    backdrop-filter: var(--card-glass-backdrop, blur(15px)) !important;
    -webkit-backdrop-filter: var(--card-glass-backdrop, blur(15px)) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

/* 确保实色模式下也有边框颜色 */
.dark .site-card:not(.frosted-glass-effect) {
    border-color: rgba(255, 255, 255, 0.05);
}

.dark .site-card:hover {
  border-color: rgba(255, 255, 255, 0.22) !important;
  box-shadow: 0 12px 24px -8px rgba(0, 0, 0, 0.55), 0 4px 8px -4px rgba(0, 0, 0, 0.4);
}

.dark .site-card-content h3 {
    color: #f3f4f6 !important;
}

.dark .site-card-content p {
    color: #9ca3af !important;
}

/* 文字颜色过渡 */
.site-title, 
.site-card p, 
.site-card-content span,
.site-card-content a,
.nav-btn,
.search-engine-option {
  /* 优化：指定特定属性，减少主题切换时的计算量 */
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.dark .site-card-content .text-primary-600 {
    color: #60a5fa !important;
}

/* 4. 头部/容器深色化 */
header {
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.top-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  color: rgba(255, 255, 255, 0.9);
  background: transparent;
  border: 0;
  border-radius: 9999px;
  box-shadow: none;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.35));
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.top-action-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.top-action-icon:hover {
  opacity: 1;
  transform: translateY(-1px);
}

.top-action-icon:focus-visible {
  outline: 2px solid rgba(65, 109, 157, 0.55);
  outline-offset: 3px;
}

.theme-action-icon:hover {
  color: #d97706;
}

.admin-action-icon:hover {
  color: #bfdbfe;
}

.dark .top-action-icon {
  color: rgba(229, 231, 235, 0.82);
}

.dark .theme-action-icon:hover {
  color: #fde047;
}

.dark .admin-action-icon:hover {
  color: #93c5fd;
}

body.custom-wallpaper .top-action-icon {
  color: rgba(255, 255, 255, 0.9);
}

body.custom-wallpaper .theme-action-icon:hover {
  color: #fbbf24;
}

body.custom-wallpaper .admin-action-icon:hover {
  color: #bfdbfe;
}

.dark body.custom-wallpaper header {
    background-color: transparent !important;
}

/* 搜索框深色化 */
.dark .search-input-target {
    background-color: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: #fff !important;
    backdrop-filter: blur(8px);
}
.dark .search-input-target::placeholder {
    color: rgba(255, 255, 255, 0.5);
}
.dark .search-input-target:focus {
    background-color: rgba(0, 0, 0, 0.6) !important;
    border-color: rgba(255, 255, 255, 0.3) !important;
}

/* 5. 分类标签深色化 */
.dark .site-card .inline-flex {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #d1d5db !important;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* 6. 公开投稿弹窗深色适配 */
html.dark #addSiteModal > div {
    background-color: #111827 !important;
    border: 1px solid #374151;
    color: #f3f4f6;
}
html.dark #addSiteModal h2 {
    color: #f9fafb !important;
}
html.dark #addSiteModal label {
    color: #d1d5db !important;
}
html.dark #addSiteModal input,
html.dark #addSiteModal textarea,
html.dark #addSiteModal select {
    background-color: #1f2937 !important;
    border-color: #374151 !important;
    color: #f3f4f6 !important;
}
html.dark #addSiteModal #cancelAddSite {
    background-color: #1f2937 !important;
    border-color: #374151 !important;
    color: #e5e7eb !important;
}
html.dark #addSiteModal #cancelAddSite:hover {
    background-color: #374151 !important;
}

body:not(.app-ready) #sidebar a[data-id],
body:not(.app-ready) #sidebar a[href="?catalog=all"] {
  transition: none !important;
}

/* 通用图标尺寸由 --card-icon-size 驱动（桌面默认 44px，手机默认 40px，支持 28px–72px 实时缩放不变形） */
.site-card .site-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--card-icon-size, 44px);
  height: var(--card-icon-size, 44px);
  flex-shrink: 0;
  opacity: 1;
  transition: transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.site-card .site-icon img,
.site-card .site-icon div {
  width: 100%;
  height: 100%;
  border-radius: clamp(6px, calc(var(--card-icon-size, 44px) * 0.22), 14px);
  object-fit: cover;
}

.site-card .site-icon .site-icon-fallback {
  font-size: clamp(0.75rem, calc(var(--card-icon-size, 44px) * 0.42), 1.75rem);
  line-height: 1;
}

/* ==========================================================================
   桌面端卡片网格与风格一/风格二（严格限定在 >= 768px，与手机端零交叉污染）
   网格列数严格遵循 --desktop-grid-cols（4/5/6/7列），统一左对齐、同行等高。
   ========================================================================== */
@media (min-width: 768px) {
  .panel-pane-grid {
    display: grid !important;
    grid-template-columns: repeat(var(--desktop-grid-cols, 4), minmax(0, 1fr)) !important;
    gap: 1rem;
    justify-items: stretch;
    align-items: stretch;
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }

  /* 桌面风格一：横向紧凑布局（左图标 + 右标题/单行描述） */
  .panel-pane-grid.desktop-card-style1 .site-card .site-card-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    height: 100%;
    padding: 0.82rem 0.92rem;
  }

  .panel-pane-grid.desktop-card-style1 .site-card .site-card-content > a {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
    height: 100%;
  }

  .panel-pane-grid.desktop-card-style1 .site-card .site-card-head {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    min-width: 0;
  }

  .panel-pane-grid.desktop-card-style1 .site-card .site-icon {
    margin: 0 0.8rem 0 0;
  }

  .panel-pane-grid.desktop-card-style1 .site-card:hover .site-icon {
    transform: scale(1.06);
  }

  .panel-pane-grid.desktop-card-style1 .site-card .site-card-meta {
    flex: 1 1 auto;
    min-width: 0;
    display: block;
  }

  .panel-pane-grid.desktop-card-style1 .site-card .site-title {
    display: block;
    width: 100%;
    text-align: left;
    line-height: 1.35;
    transform-origin: left center;
  }

  .panel-pane-grid.desktop-card-style1 .site-card:hover .site-title {
    transform: scale(1.02);
  }

  .panel-pane-grid.desktop-card-style1 .site-card p {
    text-align: left;
    margin-top: 0.4rem;
  }

  /* 桌面风格二：纵向居中图标卡片（上图标 + 下标题 + 可选单行描述） */
  .panel-pane-grid.desktop-card-style2 .site-card .site-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0.78rem 0.65rem;
  }

  .panel-pane-grid.desktop-card-style2 .site-card .site-card-content > a {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .panel-pane-grid.desktop-card-style2 .site-card .site-card-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    text-align: center;
  }

  .panel-pane-grid.desktop-card-style2 .site-card .site-icon {
    margin: 0 auto 0.42rem;
  }

  .panel-pane-grid.desktop-card-style2 .site-card:hover .site-icon {
    transform: scale(1.06);
  }

  .panel-pane-grid.desktop-card-style2 .site-card .site-icon img,
  .panel-pane-grid.desktop-card-style2 .site-card .site-icon div {
    margin: 0 auto;
  }

  .panel-pane-grid.desktop-card-style2 .site-card .site-card-meta {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .panel-pane-grid.desktop-card-style2 .site-card .site-title {
    display: block;
    width: 100%;
    padding: 0 0.35rem;
    box-sizing: border-box;
    text-align: center;
    line-height: 1.32;
    transform-origin: center;
  }

  .panel-pane-grid.desktop-card-style2 .site-card p {
    text-align: center;
    padding: 0 0.25rem;
    box-sizing: border-box;
    margin-top: 0.22rem;
  }
}

/* 卡片加载/切换动画（桌面端与手机端各自独立生效） */
.card-anim-enter {
  opacity: 0;
  animation-name: cardRadialIn;
  animation-duration: 0.6s;
  animation-timing-function: ease-out;
  animation-fill-mode: forwards;
  backface-visibility: hidden;
  transition: none !important;
  will-change: opacity, transform;
}

.card-anim-cleanup {
  transition: none !important;
}

.card-anim-flip-settle {
  position: relative;
}

@media (min-width: 768px) {
  .card-anim-d-slideUp { animation-name: cardSlideUpIn; animation-duration: 0.6s; }
  .card-anim-d-radial { animation-name: cardRadialIn; animation-duration: 0.5s; }
  .card-anim-d-fadeIn { animation-name: cardFadeIn; animation-duration: 0.6s; }
  .card-anim-d-slideLeft { animation-name: cardSlideLeftIn; animation-duration: 0.6s; }
  .card-anim-d-slideRight { animation-name: cardSlideRightIn; animation-duration: 0.6s; }
  .card-anim-d-convergeIn { animation-name: cardConvergeIn; animation-duration: 0.7s; }
  .card-anim-d-flipIn {
    animation-name: cardFlipShellIn;
    animation-duration: 0.68s;
    animation-timing-function: cubic-bezier(0.25, 0.6, 0.25, 1);
    perspective: 900px;
    transform-origin: center;
    transform-style: preserve-3d;
    will-change: opacity, transform;
    position: relative;
  }
  .site-card.card-anim-d-flipIn.frosted-glass-effect {
    animation-name: cardFrostedFlipShellIn;
  }
}

@media (max-width: 767px) {
  .card-anim-m-slideUp { animation-name: cardSlideUpIn; animation-duration: 0.6s; }
  .card-anim-m-radial { animation-name: cardRadialIn; animation-duration: 0.5s; }
  .card-anim-m-fadeIn { animation-name: cardFadeIn; animation-duration: 0.6s; }
  .card-anim-m-slideLeft { animation-name: cardSlideLeftIn; animation-duration: 0.6s; }
  .card-anim-m-slideRight { animation-name: cardSlideRightIn; animation-duration: 0.6s; }
  .card-anim-m-convergeIn { animation-name: cardConvergeIn; animation-duration: 0.7s; }
  .card-anim-m-flipIn {
    animation-name: cardFlipShellIn;
    animation-duration: 0.68s;
    animation-timing-function: cubic-bezier(0.25, 0.6, 0.25, 1);
    perspective: 900px;
    transform-origin: center;
    transform-style: preserve-3d;
    will-change: opacity, transform;
    position: relative;
  }
  .site-card.card-anim-m-flipIn.frosted-glass-effect {
    animation-name: cardFrostedFlipShellIn;
  }
}

.card-anim-d-flipIn::before,
.card-anim-m-flipIn::before,
.card-anim-flip-settle::before {
  content: none;
}

.card-anim-d-flipIn .site-card-content,
.card-anim-m-flipIn .site-card-content {
  backface-visibility: hidden;
  transform-origin: center;
}

.card-anim-d-flipIn.frosted-glass-effect .site-card-content,
.card-anim-m-flipIn.frosted-glass-effect .site-card-content {
  animation: none;
  will-change: auto;
}

@keyframes cardSlideUpIn {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cardRadialIn {
  0% { opacity: 0; transform: scale(0.3); }
  50% { opacity: 1; transform: scale(1.1); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cardSlideLeftIn {
  from { opacity: 0; transform: translateX(-50px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes cardSlideRightIn {
  from { opacity: 0; transform: translateX(50px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes cardConvergeIn {
  from {
    opacity: 0;
    transform: translate(var(--card-anim-x, 0), var(--card-anim-y, -28px));
  }
  to { opacity: 1; transform: translate(0, 0); }
}

@keyframes cardFlipShellIn {
  0% { opacity: 0; transform: perspective(900px) rotateY(-82deg); }
  30% { opacity: 0.6; transform: perspective(900px) rotateY(-45deg); }
  55% { opacity: 0.86; transform: perspective(900px) rotateY(-24deg); }
  75% { opacity: 1; transform: perspective(900px) rotateY(-11deg); }
  90% { opacity: 1; transform: perspective(900px) rotateY(-4deg); }
  100% { opacity: 1; transform: perspective(900px) rotateY(0deg); }
}

@keyframes cardFrostedFlipShellIn {
  0% { opacity: 0; transform: perspective(900px) rotateY(-82deg); }
  16% { opacity: 1; transform: perspective(900px) rotateY(-82deg); }
  34% { opacity: 1; transform: perspective(900px) rotateY(-45deg); }
  58% { opacity: 1; transform: perspective(900px) rotateY(-24deg); }
  78% { opacity: 1; transform: perspective(900px) rotateY(-11deg); }
  92% { opacity: 1; transform: perspective(900px) rotateY(-4deg); }
  100% { opacity: 1; transform: perspective(900px) rotateY(0deg); }
}

@media (prefers-reduced-motion: reduce) {
  .card-anim-enter {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}

/* 搜索引擎切换选项 - 胶囊按钮样式 */
.search-engine-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25rem 0.75rem; /* 稍微比分类按钮小一点 */
  border-radius: 9999px;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  
  /* Default Inactive (Light Mode - Dark Header) */
  background-color: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid transparent; /* Reset old style */
}

.search-engine-option:hover {
  background-color: rgba(255, 255, 255, 0.25);
  color: white;
  opacity: 1;
}

.search-engine-option.active {
  background-color: white;
  color: #1d4ed8; /* Dark Blue */
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.1);
  font-weight: 600;
  border-bottom-color: transparent; /* Reset old style */
}

/* Custom Wallpaper Mode */
.custom-wallpaper .search-engine-option {
  background-color: rgba(255, 255, 255, 0.7);
  color: #374151;
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}
.custom-wallpaper .search-engine-option:hover {
  background-color: white;
  color: #2563eb;
}
.custom-wallpaper .search-engine-option.active {
  background-color: #2563eb;
  color: white;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

/* Dark Mode */
.dark .search-engine-option {
  background-color: rgba(255, 255, 255, 0.05);
  color: #9ca3af;
  border: 1px solid transparent;
}
.dark .search-engine-option:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: #e5e7eb;
}
.dark .search-engine-option.active {
  background-color: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}

/* 外部搜索：统一使用纯文字 + 蓝色下划线，文字颜色跟随对应设备的书签标题设置 */
@media (min-width: 768px) {
  body {
    --search-engine-text-color: var(--desktop-card-title-color, #111827);
  }
}

@media (max-width: 767px) {
  body {
    --search-engine-text-color: var(--mobile-card-title-color, #111827);
  }
}

.search-engine-option {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0.2rem 0.7rem 0.35rem !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  font-size: 0.8rem !important;
  font-weight: 400 !important;
  line-height: 1.25rem !important;
  color: var(--search-engine-text-color, #111827) !important;
  opacity: 1 !important;
  text-shadow: none !important;
  cursor: pointer;
}

.search-engine-option::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 2px;
  background: #399dff;
  border-radius: 1px;
  transform: translateX(-50%);
  transition: width 0.25s ease;
}

body .search-engine-option:hover {
  color: var(--search-engine-text-color, #111827) !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  font-weight: 400 !important;
  text-shadow: none !important;
}

body .search-engine-option.active {
  color: #399dff !important;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  font-weight: 500 !important;
  text-shadow: none !important;
}

.search-engine-option:hover::after {
  width: 45%;
  background: rgba(57, 157, 255, 0.65);
}

.search-engine-option.active::after {
  width: 60%;
  background: #399dff;
}

.search-engine-wrapper {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  flex-wrap: wrap !important;
  gap: 0.35rem 0.5rem !important;
  margin-bottom: 0.45rem !important;
}

.search-engine-option span {
  color: inherit !important;
}

/* ==========================================================================
   左侧全分类导航栏：悬浮圆角毛玻璃岛（桌面端） + 抽屉（移动端） + ‹ / › 折叠小把手
   ========================================================================== */

.mobile-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.56);
  color: #1e293b;
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  box-shadow: 0 4px 16px -4px rgba(15, 23, 42, 0.16);
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.mobile-menu-trigger:hover {
  background: rgba(255, 255, 255, 0.82);
  transform: translateY(-1px);
}

html.dark .mobile-menu-trigger {
  background: rgba(17, 24, 39, 0.62);
  border-color: rgba(148, 163, 184, 0.3);
  color: #e2e8f0;
  box-shadow: 0 6px 18px -4px rgba(0, 0, 0, 0.45);
}

html.dark .mobile-menu-trigger:hover {
  background: rgba(30, 41, 59, 0.82);
}

/* 悬浮圆角毛玻璃侧栏本体（外层 overflow: visible，让右边缘 ‹ 小把手自然外凸不被裁剪） */
#sidebar.sidebar {
  position: fixed;
  top: 1.25rem;
  left: 1.25rem;
  bottom: 1.25rem;
  height: auto;
  width: var(--sidebar-width, 16rem);
  border-radius: var(--panel-radius, 1.5rem);
  overflow: visible;
  z-index: 45;
  background-color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.92);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.05), 0 12px 32px -12px rgba(15, 23, 42, 0.16);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
}

html.dark #sidebar.sidebar {
  background-color: rgba(31, 41, 55, 0.92);
  border-color: rgba(55, 65, 81, 0.92);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.32), 0 14px 36px -12px rgba(0, 0, 0, 0.58);
}

/* 有壁纸层时与右侧 .home-panel 保持一致的半透明毛玻璃材质 */
body.has-bg-layer #sidebar.sidebar,
body.custom-wallpaper #sidebar.sidebar {
  background-color: rgba(255, 255, 255, 0.44) !important;
  backdrop-filter: var(--glass-backdrop, blur(15px) saturate(140%));
  -webkit-backdrop-filter: var(--glass-backdrop, blur(15px) saturate(140%));
  border: 1px solid rgba(255, 255, 255, 0.56) !important;
  box-shadow: 0 8px 32px -12px rgba(15, 23, 42, 0.16);
}

html.dark body.has-bg-layer #sidebar.sidebar,
html.dark body.custom-wallpaper #sidebar.sidebar {
  background-color: rgba(17, 24, 39, 0.52) !important;
  backdrop-filter: var(--glass-backdrop, blur(15px) saturate(140%));
  -webkit-backdrop-filter: var(--glass-backdrop, blur(15px) saturate(140%));
  border: 1px solid rgba(148, 163, 184, 0.28) !important;
  box-shadow: 0 12px 32px -10px rgba(0, 0, 0, 0.55);
}

/* 内层滚动容器：继承大圆角 + 极细隐形滚动条 */
.sidebar-scroll {
  height: 100%;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: inherit;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.sidebar-scroll:hover {
  scrollbar-color: rgba(148, 163, 184, 0.38) transparent;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 4px;
}

.sidebar-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 9999px;
}

.sidebar-scroll:hover::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.38);
}

html.dark .sidebar-scroll:hover::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.28);
}

.sidebar-inner {
  padding: 1rem 0.75rem 1.15rem;
}

.sidebar-brand-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.15rem 0.55rem 0.65rem;
}

.sidebar-brand-title {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(71, 85, 105, 0.85);
}

html.dark .sidebar-brand-title {
  color: rgba(203, 213, 225, 0.72);
}

.sidebar-footer {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
}

/* ‹ / › 折叠小把手：精致半透明竖向毛玻璃胶囊 */
.sidebar-edge-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.55rem;
  height: 3.1rem;
  padding: 0;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: rgba(255, 255, 255, 0.72);
  color: #475569;
  backdrop-filter: blur(12px) saturate(160%);
  -webkit-backdrop-filter: blur(12px) saturate(160%);
  box-shadow: 0 4px 14px -2px rgba(15, 23, 42, 0.16);
  cursor: pointer;
  transition: transform 0.22s ease, background-color 0.2s ease, color 0.2s ease, opacity 0.24s ease, box-shadow 0.2s ease;
}

.sidebar-edge-handle svg {
  width: 0.95rem;
  height: 0.95rem;
}

.sidebar-edge-handle:hover {
  background: rgba(255, 255, 255, 0.94);
  color: #2563eb;
  box-shadow: 0 6px 18px -2px rgba(37, 99, 235, 0.24);
}

html.dark .sidebar-edge-handle {
  background: rgba(17, 24, 39, 0.72);
  border-color: rgba(148, 163, 184, 0.32);
  color: #cbd5e1;
  box-shadow: 0 6px 18px -2px rgba(0, 0, 0, 0.48);
}

html.dark .sidebar-edge-handle:hover {
  background: rgba(30, 41, 59, 0.94);
  color: #7dd3fc;
  border-color: rgba(125, 211, 252, 0.45);
}

.sidebar-collapse-handle {
  position: absolute;
  top: 50%;
  right: -0.8rem;
  transform: translateY(-50%);
  z-index: 4;
}

.sidebar-collapse-handle:hover {
  transform: translateY(-50%) scale(1.06);
}

.sidebar-expand-handle {
  position: fixed;
  top: 50%;
  left: 0.65rem;
  z-index: 46;
  opacity: 0;
  pointer-events: none;
  transform: translate(-14px, -50%);
}

/* 桌面端 (>= 1024px)：主内容为悬浮岛让出左侧留白，收起时平滑居中扩宽 */
@media (min-width: 1024px) {
  #app-scroll > .main-content.sidebar-offset {
    margin-left: calc(var(--sidebar-width, 16rem) + 1.75rem);
    transition: margin-left 0.32s cubic-bezier(0.22, 1, 0.36, 1);
  }

  body.sidebar-collapsed #sidebar.sidebar {
    transform: translateX(calc(-100% - 2.5rem));
    opacity: 0;
    pointer-events: none;
  }

  body.sidebar-collapsed #app-scroll > .main-content.sidebar-offset {
    margin-left: 0;
  }

  body.sidebar-collapsed #sidebarExpandHandle {
    opacity: 1;
    pointer-events: auto;
    transform: translate(0, -50%);
  }

  body.sidebar-collapsed #sidebarExpandHandle:hover {
    transform: translate(2px, -50%) scale(1.06);
  }
}

/* 移动端 (< 1024px)：默认收起，滑出圆角毛玻璃抽屉；点任意分类/‹小把手/空白遮罩自动关闭 */
@media (max-width: 1023px) {
  #sidebarExpandHandle {
    display: none !important;
  }

  .mobile-menu-trigger-wrap {
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }

  /* 抽屉展开时立即隐藏底部的左上角汉堡按钮，彻底消除滑出过程与静止时的白色光晕伪影 */
  body.mobile-sidebar-open .mobile-menu-trigger-wrap {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: none !important;
  }

  #sidebar.sidebar {
    top: 0.75rem;
    left: 0.75rem;
    bottom: 0.75rem;
    width: min(var(--sidebar-width, 16rem), calc(100vw - 3.25rem));
    border-radius: var(--panel-radius, 1.25rem);
    z-index: 50;
    transform: translateX(calc(-100% - 2.5rem));
    pointer-events: none;
  }

  #sidebar.sidebar,
  body.has-bg-layer #sidebar.sidebar,
  body.custom-wallpaper #sidebar.sidebar {
    background-color: rgba(255, 255, 255, 0.86) !important;
    border: 1px solid rgba(255, 255, 255, 0.68) !important;
    box-shadow: 0 12px 36px -8px rgba(15, 23, 42, 0.24);
  }

  html.dark #sidebar.sidebar,
  html.dark body.has-bg-layer #sidebar.sidebar,
  html.dark body.custom-wallpaper #sidebar.sidebar {
    background-color: rgba(15, 23, 42, 0.90) !important;
    border: 1px solid rgba(148, 163, 184, 0.26) !important;
    box-shadow: 0 14px 40px -8px rgba(0, 0, 0, 0.62);
  }

  html.dark #sidebar.sidebar .sidebar-brand-title {
    color: rgba(226, 232, 240, 0.86);
  }

  html.dark #sidebar.sidebar .nav-link {
    color: var(--nav-top-color, #f1f5f9);
  }

  html.dark #sidebar.sidebar .nav-sub-link {
    color: var(--nav-sub-color, #cbd5e1);
  }

  #sidebar.sidebar::before,
  #sidebar.sidebar::after,
  #sidebar.sidebar .sidebar-scroll::before,
  #sidebar.sidebar .sidebar-scroll::after {
    content: none !important;
    display: none !important;
  }

  #sidebar.sidebar.open,
  body.has-bg-layer #sidebar.sidebar.open,
  body.custom-wallpaper #sidebar.sidebar.open,
  html.dark body.has-bg-layer #sidebar.sidebar.open,
  html.dark body.custom-wallpaper #sidebar.sidebar.open {
    transform: translateX(0) !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* 轻度半透明暗色遮罩，绝不将右侧背景涂黑，点击右侧空白即可关闭抽屉 */
  .mobile-overlay {
    background-color: rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
  }

  html.dark .mobile-overlay {
    background-color: rgba(0, 0, 0, 0.45);
  }

  .mobile-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  body.mobile-sidebar-open #app-scroll {
    overflow: hidden;
  }
}

/* 毛玻璃效果 - Light Mode */
.frosted-glass-effect {
  background: rgba(255, 255, 255, 0.4) !important;
  backdrop-filter: var(--card-glass-backdrop, blur(15px)) !important;
  -webkit-backdrop-filter: var(--card-glass-backdrop, blur(15px)) !important;
  border: 1px solid rgba(255, 255, 255, 0.6) !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05) !important;
}

.frosted-glass-effect:hover {
  border: 1px solid rgba(255, 255, 255, 0.9) !important;
}

/* 限制一言显示范围，防止移动端撑开导致标题换行 */
#hitokoto {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%; 
  text-align: right;
  margin-left: auto; /* 确保在 flex 容器中靠右 */
}

/* 确保一言的父级容器也靠右对齐 */
#hitokoto-parent {
  display: flex;
  justify-content: flex-end;
  flex: 1;
}

/* 压过 md:block 与上面的 display: flex，保证隐藏设置和加载失败时确实不显示 */
#hitokoto-parent.hidden {
  display: none;
}

[data-role="list-heading"] {
  white-space: nowrap; 
  flex-shrink: 0; 
  margin-right: 1rem;
}

@media (max-width: 440px) {
  #hitokoto {
    max-width: 50%;
    font-size: 0.75rem; /* 窄屏缩小字体 */
  }
}
@media (max-width: 389px) {
  .panel-pane-grid.grid-cols-2.mobile-card-style1,
  .panel-pane-grid.grid-cols-3.mobile-card-style1,
  .panel-pane-grid.grid-cols-3.mobile-card-style2 {
    gap: 0.5rem;
  }

  .panel-pane-grid.grid-cols-2.mobile-card-style1 .site-card .site-card-content,
  .panel-pane-grid.grid-cols-3.mobile-card-style1 .site-card .site-card-content,
  .panel-pane-grid.grid-cols-3.mobile-card-style2 .site-card .site-card-content {
    padding: 0.55rem 0.45rem;
  }

  .panel-pane-grid.grid-cols-2.mobile-card-style1 .site-card .site-icon,
  .panel-pane-grid.grid-cols-3.mobile-card-style1 .site-card .site-icon {
    margin-right: 0.45rem;
  }

  .panel-pane-grid.grid-cols-3.mobile-card-style2 .site-card .site-icon {
    margin-bottom: 0.3rem;
  }
}

/* ==========================================================================
   首页面板式布局（X-DH）
   --------------------------------------------------------------------------
   顶级分类各自成为一个纵向大面板，面板内分组平铺（多色小圆点 + 二级折叠）。
   ========================================================================== */

.home-panels {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-bottom: 0.75rem;
}

@media (min-width: 768px) {
  .home-panels {
    gap: 1.35rem;
  }
}

/* 面板主体：浅底 + 圆角 + 细边框，深浅色与壁纸下都保持可读 */
.home-panel {
  position: relative;
  /* 圆角由后台「大卡片圆角」注入的 --panel-radius 控制，缺省 1rem */
  border-radius: var(--panel-radius, 1rem);
  background-color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -12px rgba(15, 23, 42, 0.12);
  /* 锚点跳转时在视口顶部留出呼吸空间：面板标题不会被顶到最上沿 */
  scroll-margin-top: 5rem;
  overflow: hidden;
}

html.dark .home-panel {
  background-color: rgba(31, 41, 55, 0.92);
  border-color: rgba(55, 65, 81, 0.9);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.5);
}

body.custom-wallpaper .home-panel {
  background-color: rgba(255, 255, 255, 0.82);
  backdrop-filter: var(--glass-backdrop, blur(15px) saturate(140%));
  -webkit-backdrop-filter: var(--glass-backdrop, blur(15px) saturate(140%));
}

html.dark body.custom-wallpaper .home-panel {
  background-color: rgba(17, 24, 39, 0.78);
}

/* 大面板毛玻璃：统一读取 --glass-backdrop 变量，0px 时显式为 none 无任何模糊。
   桌面与手机各自受后台开关控制，用媒体查询门控互不干扰。 */
@media (min-width: 768px) {
  .home-panel.panel-frosted,
  body.custom-wallpaper .home-panel.panel-frosted {
    background-color: rgba(255, 255, 255, 0.42);
    backdrop-filter: var(--glass-backdrop, blur(15px) saturate(140%));
    -webkit-backdrop-filter: var(--glass-backdrop, blur(15px) saturate(140%));
    border-color: rgba(255, 255, 255, 0.55);
  }

  html.dark .home-panel.panel-frosted,
  html.dark body.custom-wallpaper .home-panel.panel-frosted {
    background-color: rgba(17, 24, 39, 0.46);
    border-color: rgba(148, 163, 184, 0.28);
  }
}

@media (max-width: 767px) {
  .home-panel.panel-frosted-mobile,
  body.custom-wallpaper .home-panel.panel-frosted-mobile {
    background-color: rgba(255, 255, 255, 0.42);
    backdrop-filter: var(--glass-backdrop, blur(15px) saturate(140%));
    -webkit-backdrop-filter: var(--glass-backdrop, blur(15px) saturate(140%));
    border-color: rgba(255, 255, 255, 0.55);
  }

  html.dark .home-panel.panel-frosted-mobile,
  html.dark body.custom-wallpaper .home-panel.panel-frosted-mobile {
    background-color: rgba(17, 24, 39, 0.46);
    border-color: rgba(148, 163, 184, 0.28);
  }
}

/* 毛玻璃开启时卡片底色也降一点，避免卡片本身把面板的透光糊掉 */
@media (min-width: 768px) {
  .home-panels .panel-frosted .site-card.frosted-glass-effect {
    background: rgba(255, 255, 255, 0.28) !important;
  }

  html.dark .home-panels .panel-frosted .site-card.frosted-glass-effect {
    background: rgba(31, 41, 55, 0.32) !important;
  }
}

@media (max-width: 767px) {
  .home-panels .panel-frosted-mobile .site-card.frosted-glass-effect {
    background: rgba(255, 255, 255, 0.28) !important;
  }

  html.dark .home-panels .panel-frosted-mobile .site-card.frosted-glass-effect {
    background: rgba(31, 41, 55, 0.32) !important;
  }
}

/* 多色分类小圆点调色板：深浅色均柔和通透，顶级/二级/三级与左侧导航同色呼应 */
.cat-dot {
  --dot-color: #38bdf8;
  --dot-glow: rgba(56, 189, 248, 0.34);
  background-color: var(--dot-color);
  box-shadow: 0 0 0 2px var(--dot-glow);
  border-radius: 9999px;
  display: inline-block;
  flex: 0 0 auto;
}

.cat-dot[data-dot-tone="0"] { --dot-color: #38bdf8; --dot-glow: rgba(56, 189, 248, 0.3); }
.cat-dot[data-dot-tone="1"] { --dot-color: #14b8a6; --dot-glow: rgba(20, 184, 166, 0.3); }
.cat-dot[data-dot-tone="2"] { --dot-color: #8b5cf6; --dot-glow: rgba(139, 92, 246, 0.3); }
.cat-dot[data-dot-tone="3"] { --dot-color: #f43f5e; --dot-glow: rgba(244, 63, 94, 0.3); }
.cat-dot[data-dot-tone="4"] { --dot-color: #f59e0b; --dot-glow: rgba(245, 158, 11, 0.3); }
.cat-dot[data-dot-tone="5"] { --dot-color: #10b981; --dot-glow: rgba(16, 185, 129, 0.3); }
.cat-dot[data-dot-tone="6"] { --dot-color: #6366f1; --dot-glow: rgba(99, 102, 241, 0.3); }
.cat-dot[data-dot-tone="7"] { --dot-color: #ec4899; --dot-glow: rgba(236, 72, 153, 0.3); }

html.dark .cat-dot[data-dot-tone="0"] { --dot-color: #38bdf8; --dot-glow: rgba(56, 189, 248, 0.25); }
html.dark .cat-dot[data-dot-tone="1"] { --dot-color: #2dd4bf; --dot-glow: rgba(45, 212, 191, 0.25); }
html.dark .cat-dot[data-dot-tone="2"] { --dot-color: #a78bfa; --dot-glow: rgba(167, 139, 250, 0.25); }
html.dark .cat-dot[data-dot-tone="3"] { --dot-color: #fb7185; --dot-glow: rgba(251, 113, 133, 0.25); }
html.dark .cat-dot[data-dot-tone="4"] { --dot-color: #fbbf24; --dot-glow: rgba(251, 191, 36, 0.25); }
html.dark .cat-dot[data-dot-tone="5"] { --dot-color: #34d399; --dot-glow: rgba(52, 211, 153, 0.25); }
html.dark .cat-dot[data-dot-tone="6"] { --dot-color: #818cf8; --dot-glow: rgba(129, 140, 248, 0.25); }
html.dark .cat-dot[data-dot-tone="7"] { --dot-color: #f472b6; --dot-glow: rgba(244, 114, 182, 0.25); }

.home-panel-inner {
  padding: 0.72rem 0.9rem 0.95rem;
}

@media (min-width: 768px) {
  .home-panel-inner {
    padding: 0.85rem 1.25rem 1.15rem;
  }
}

/* 面板标题行 */
.panel-head {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0;
  border-bottom: none !important;
}

@media (min-width: 768px) {
  .panel-head {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
  }
}

.panel-head-main {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.02rem;
  font-weight: 600;
  color: #1f2937;
  white-space: nowrap;
}

html.dark .panel-title {
  color: #f3f4f6;
}

.panel-title-dot {
  width: 0.5rem;
  height: 0.5rem;
}

/* 窗格容器 */
.panel-panes {
  position: relative;
}

.panel-pane[hidden] {
  display: none !important;
}

.panel-pane-grid {
  display: grid;
  align-items: stretch;
  justify-items: stretch;
}

.panel-pane-empty {
  margin: 0.5rem 0 0;
  padding: 1rem;
  width: 100%;
  text-align: center;
  font-size: 0.8125rem;
  color: #9ca3af;
  border: 1px dashed rgba(226, 232, 240, 1);
  border-radius: 0.75rem;
}

html.dark .panel-pane-empty {
  color: #6b7280;
  border-color: rgba(55, 65, 81, 1);
}

.home-panels.is-searching .panel-pane[hidden] {
  display: block !important;
}

/* 首页空态 */
.home-panels-empty {
  padding: 3rem 1.5rem;
  text-align: center;
  border-radius: 1rem;
  border: 1px dashed rgba(226, 232, 240, 1);
  background-color: rgba(255, 255, 255, 0.7);
}

html.dark .home-panels-empty {
  border-color: rgba(55, 65, 81, 1);
  background-color: rgba(31, 41, 55, 0.6);
}

.home-panels-empty h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 0.375rem;
}

html.dark .home-panels-empty h3 {
  color: #d1d5db;
}

.home-panels-empty p {
  font-size: 0.8125rem;
  color: #9ca3af;
  margin-bottom: 0.75rem;
}

.home-panels-empty-link {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.25rem;
  border-radius: 0.75rem;
  background-color: #2563eb;
  color: #fff;
  font-size: 0.875rem;
  box-shadow: 0 8px 20px -8px rgba(37, 99, 235, 0.6);
}

.home-panels-empty-link:hover {
  background-color: #1d4ed8;
}

/* 搜索无结果提示 */
.search-empty-state {
  margin-top: 1.5rem;
  padding: 2.5rem 1.5rem;
  text-align: center;
  border-radius: 1rem;
  border: 1px dashed rgba(226, 232, 240, 1);
  color: #6b7280;
}

html.dark .search-empty-state {
  border-color: rgba(55, 65, 81, 1);
  color: #9ca3af;
}

.search-empty-state svg {
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 auto 0.75rem;
  color: #d1d5db;
}

.search-empty-state p {
  font-size: 0.875rem;
  margin-bottom: 0.75rem;
}

.search-empty-reset {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  border: 1px solid rgba(37, 99, 235, 0.4);
  color: #2563eb;
  font-size: 0.8125rem;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.search-empty-reset:hover {
  background-color: #2563eb;
  color: #fff;
}

/* ==========================================================================
   左侧分类导航：柔和圆角胶囊 + 多色圆点 + 清晰子级缩进与左细线
   ========================================================================== */

.panel-nav {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.nav-group {
  border-radius: 0.75rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.48rem 0.72rem;
  border-radius: 0.85rem;
  font-size: var(--nav-top-size, 14px);
  font-weight: 500;
  color: var(--nav-top-color, #334155);
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.nav-dot {
  width: 0.45rem;
  height: 0.45rem;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.58);
  color: #1d4ed8;
}

.nav-link.is-active {
  background-color: rgba(37, 99, 235, 0.13);
  color: #1d4ed8;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.16);
}

html.dark .nav-link {
  color: var(--nav-top-color, #e2e8f0);
}

html.dark .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #93c5fd;
}

html.dark .nav-link.is-active {
  background-color: rgba(56, 189, 248, 0.18);
  color: #7dd3fc;
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.22);
}

body.custom-wallpaper .nav-link {
  color: var(--nav-top-color, #1e293b);
}

html.dark body.custom-wallpaper .nav-link {
  color: var(--nav-top-color, #f1f5f9);
}

.nav-link-text,
.nav-sub-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 二/三级子分类：柔和左侧细线 + 清晰递增缩进 + 胶囊悬停 */
.nav-sublinks {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  margin: 0.16rem 0 0.35rem 0.9rem;
  padding-left: 0.5rem;
  border-left: 1.5px solid rgba(148, 163, 184, 0.32);
}

html.dark .nav-sublinks {
  border-left-color: rgba(148, 163, 184, 0.22);
}

.nav-sub-link {
  display: flex;
  align-items: center;
  gap: 0.42rem;
  padding: 0.3rem 0.62rem 0.3rem calc(0.45rem + (var(--nav-depth, 1) - 1) * 0.72rem);
  border-radius: 0.7rem;
  font-size: var(--nav-sub-size, 12px);
  color: var(--nav-sub-color, #475569);
  transition: background-color 0.18s ease, color 0.18s ease;
}

.nav-sub-dot {
  width: 0.36rem;
  height: 0.36rem;
  box-shadow: none;
  opacity: 0.88;
}

.nav-sub-link[data-nav-depth="3"] .nav-sub-dot,
.nav-sub-link[data-nav-depth="4"] .nav-sub-dot {
  width: 0.3rem;
  height: 0.3rem;
  opacity: 0.76;
}

.nav-sub-link:hover {
  background-color: rgba(255, 255, 255, 0.52);
  color: #1d4ed8;
}

.nav-sub-link.is-active {
  background-color: rgba(37, 99, 235, 0.11);
  color: #1d4ed8;
  font-weight: 600;
}

html.dark .nav-sub-link {
  color: var(--nav-sub-color, #cbd5e1);
}

html.dark .nav-sub-link:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: #93c5fd;
}

html.dark .nav-sub-link.is-active {
  background-color: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
}

@media (prefers-reduced-motion: reduce) {
  .home-panel,
  .nav-link,
  .nav-sub-link,
  #sidebar.sidebar,
  #app-scroll > .main-content.sidebar-offset {
    transition: none !important;
  }

  .card-anim-enter {
    animation: none !important;
    opacity: 1 !important;
  }
}

/* ==========================================================================
   分组平铺与多色圆点（无横线、二级多色小圆点折叠、紧凑间距）
   ========================================================================== */
.panel-flat-flow {
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}

.panel-sub-group {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  scroll-margin-top: 5rem;
}

.panel-l2-head {
  display: flex;
  align-items: center;
}

.panel-l2-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: transparent;
  border: none;
  padding: 0.1rem 0;
  cursor: pointer;
  text-align: left;
}

.panel-l2-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.panel-l2-dot {
  width: 0.44rem;
  height: 0.44rem;
}

.panel-l2-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.3;
}

html.dark .panel-l2-title {
  color: #e2e8f0;
}

.panel-l2-toggle {
  font-size: 0.75rem;
  color: #64748b;
  background: rgba(148, 163, 184, 0.14);
  padding: 0.15rem 0.55rem;
  border-radius: 0.5rem;
  transition: background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.panel-l2-trigger:hover .panel-l2-toggle {
  color: #1e293b;
  background: rgba(148, 163, 184, 0.24);
}

html.dark .panel-l2-toggle {
  color: #94a3b8;
  background: rgba(148, 163, 184, 0.14);
}

html.dark .panel-l2-trigger:hover .panel-l2-toggle {
  color: #f8fafc;
  background: rgba(148, 163, 184, 0.25);
}

.panel-l2-body {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.panel-l2-body[hidden] {
  display: none;
}

.panel-l3-group {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  scroll-margin-top: 5rem;
}

.panel-l3-head {
  display: flex;
  align-items: center;
}

.panel-l3-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.18rem 0.62rem;
  border-radius: 9999px;
  background: rgba(148, 163, 184, 0.14);
  color: #334155;
}

.panel-l3-dot {
  width: 0.375rem;
  height: 0.375rem;
  box-shadow: none;
}

html.dark .panel-l3-badge {
  background: rgba(148, 163, 184, 0.16);
  color: #e2e8f0;
}

@keyframes panelScrollFlash {
  0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.35); border-radius: 0.75rem; }
  45% { box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25); border-radius: 0.75rem; }
  100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); border-radius: 0.75rem; }
}

.panel-scroll-flash {
  animation: panelScrollFlash 1s ease;
}

/* ==========================================================================
   手机端卡片网格与风格一/风格二（严格限定在 <= 767px，与桌面端完全隔离）
   网格列数严格遵循 --mobile-grid-cols（1/2/3列），全部接入 --card-icon-size。
   ========================================================================== */
@media (max-width: 767px) {
  .panel-pane-grid {
    display: grid !important;
    grid-template-columns: repeat(var(--mobile-grid-cols, 3), minmax(0, 1fr)) !important;
    gap: 0.72rem;
    justify-items: stretch;
    align-items: stretch;
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
  }

  /* 手机风格一：横排左对齐（左图标 + 右标题/单行描述） */
  .panel-pane-grid.mobile-card-style1 .site-card .site-card-content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    height: 100%;
    padding: 0.72rem 0.78rem;
  }

  .panel-pane-grid.mobile-card-style1 .site-card .site-card-content > a {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
  }

  .panel-pane-grid.mobile-card-style1 .site-card .site-card-head {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    min-width: 0;
  }

  .panel-pane-grid.mobile-card-style1 .site-card .site-icon {
    margin: 0 0.65rem 0 0;
  }

  .panel-pane-grid.mobile-card-style1 .site-card .site-card-meta {
    flex: 1 1 auto;
    min-width: 0;
    display: block;
  }

  .panel-pane-grid.mobile-card-style1 .site-card .site-title {
    display: block;
    width: 100%;
    text-align: left;
    line-height: 1.3;
    white-space: nowrap;
  }

  .panel-pane-grid.mobile-card-style1 .site-card p {
    text-align: left;
    margin-top: 0.3rem;
  }

  /* 手机风格二：竖向居中图标卡片（上图标 + 下标题 + 可选单行描述） */
  .panel-pane-grid.mobile-card-style2 .site-card .site-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 0.68rem 0.55rem;
  }

  .panel-pane-grid.mobile-card-style2 .site-card .site-card-content > a {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .panel-pane-grid.mobile-card-style2 .site-card .site-card-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 0;
    text-align: center;
  }

  .panel-pane-grid.mobile-card-style2 .site-card .site-icon {
    margin: 0 auto 0.38rem;
  }

  .panel-pane-grid.mobile-card-style2 .site-card .site-icon img,
  .panel-pane-grid.mobile-card-style2 .site-card .site-icon div {
    margin: 0 auto;
  }

  .panel-pane-grid.mobile-card-style2 .site-card .site-card-meta {
    width: 100%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .panel-pane-grid.mobile-card-style2 .site-card .site-title {
    display: block;
    width: 100%;
    padding: 0 0.25rem;
    box-sizing: border-box;
    text-align: center;
    line-height: 1.3;
    white-space: nowrap;
  }

  .panel-pane-grid.mobile-card-style2 .site-card p {
    text-align: center;
    padding: 0 0.2rem;
    box-sizing: border-box;
    margin-top: 0.2rem;
  }
}

/* ==========================================================================
   通用透明开关（大卡片背景透明 / 书签背景透明）+ 隐藏书签名称 + 悬浮气泡 Tooltip
   桌面端与手机端通过媒体查询严格独立生效，并严格遵循所选网格列数。
   ========================================================================== */

/* --- 1. 大卡片背景透明（桌面端 >= 768px） --- */
@media (min-width: 768px) {
  body.desktop-container-transparent .home-panel,
  body.desktop-container-transparent.custom-wallpaper .home-panel,
  body.desktop-container-transparent .home-panel.panel-frosted,
  html.dark body.desktop-container-transparent .home-panel,
  html.dark body.desktop-container-transparent .home-panel.panel-frosted {
    background: transparent !important;
    background-color: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body.desktop-container-transparent .home-panel-inner {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
  }

  body.desktop-container-transparent .panel-title {
    text-shadow: 0 1px 6px rgba(255, 255, 255, 0.72), 0 1px 2px rgba(15, 23, 42, 0.18);
  }

  body.desktop-container-transparent .panel-l2-title {
    text-shadow: 0 1px 5px rgba(255, 255, 255, 0.68), 0 1px 2px rgba(15, 23, 42, 0.16);
  }

  html.dark body.desktop-container-transparent .panel-title,
  html.dark body.desktop-container-transparent .panel-l2-title {
    color: #f8fafc;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.65), 0 1px 2px rgba(0, 0, 0, 0.5);
  }

  body.desktop-container-transparent .panel-l3-badge,
  body.desktop-container-transparent .panel-l2-toggle {
    background: rgba(255, 255, 255, 0.62);
    color: #1e293b;
  }

  html.dark body.desktop-container-transparent .panel-l3-badge,
  html.dark body.desktop-container-transparent .panel-l2-toggle {
    background: rgba(15, 23, 42, 0.55);
    color: #f1f5f9;
  }
}

/* --- 1b. 大卡片背景透明（手机端 <= 767px） --- */
@media (max-width: 767px) {
  body.mobile-container-transparent .home-panel,
  body.mobile-container-transparent.custom-wallpaper .home-panel,
  body.mobile-container-transparent .home-panel.panel-frosted-mobile,
  html.dark body.mobile-container-transparent .home-panel,
  html.dark body.mobile-container-transparent .home-panel.panel-frosted-mobile {
    background: transparent !important;
    background-color: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body.mobile-container-transparent .home-panel-inner {
    padding-left: 0.2rem;
    padding-right: 0.2rem;
  }

  body.mobile-container-transparent .panel-title {
    text-shadow: 0 1px 6px rgba(255, 255, 255, 0.72), 0 1px 2px rgba(15, 23, 42, 0.18);
  }

  body.mobile-container-transparent .panel-l2-title {
    text-shadow: 0 1px 5px rgba(255, 255, 255, 0.68), 0 1px 2px rgba(15, 23, 42, 0.16);
  }

  html.dark body.mobile-container-transparent .panel-title,
  html.dark body.mobile-container-transparent .panel-l2-title {
    color: #f8fafc;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.65), 0 1px 2px rgba(0, 0, 0, 0.5);
  }

  body.mobile-container-transparent .panel-l3-badge,
  body.mobile-container-transparent .panel-l2-toggle {
    background: rgba(255, 255, 255, 0.62);
    color: #1e293b;
  }

  html.dark body.mobile-container-transparent .panel-l3-badge,
  html.dark body.mobile-container-transparent .panel-l2-toggle {
    background: rgba(15, 23, 42, 0.55);
    color: #f1f5f9;
  }
}

/* --- 2. 书签背景透明（通用作用于风格一、风格二；桌面 / 手机独立） --- */
@media (min-width: 768px) {
  body.desktop-card-transparent .home-panels .site-card,
  body.desktop-card-transparent .home-panels .site-card.frosted-glass-effect,
  body.desktop-card-transparent .home-panels .panel-frosted .site-card.frosted-glass-effect,
  html.dark body.desktop-card-transparent .home-panels .site-card,
  html.dark body.desktop-card-transparent .home-panels .site-card.frosted-glass-effect,
  html.dark body.desktop-card-transparent .home-panels .panel-frosted .site-card.frosted-glass-effect {
    background: transparent !important;
    background-color: transparent !important;
    border: 1px solid transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body.desktop-card-transparent .home-panels .site-card:hover,
  body.desktop-card-transparent .home-panels .site-card.frosted-glass-effect:hover,
  body.desktop-card-transparent .home-panels .panel-frosted .site-card.frosted-glass-effect:hover {
    background: rgba(255, 255, 255, 0.22) !important;
    border-color: rgba(255, 255, 255, 0.42) !important;
    box-shadow: 0 8px 20px -8px rgba(15, 23, 42, 0.16) !important;
    transform: translateY(-3px);
  }

  html.dark body.desktop-card-transparent .home-panels .site-card:hover,
  html.dark body.desktop-card-transparent .home-panels .site-card.frosted-glass-effect:hover,
  html.dark body.desktop-card-transparent .home-panels .panel-frosted .site-card.frosted-glass-effect:hover {
    background: rgba(255, 255, 255, 0.11) !important;
    border-color: rgba(255, 255, 255, 0.22) !important;
    box-shadow: 0 8px 22px -8px rgba(0, 0, 0, 0.45) !important;
    transform: translateY(-3px);
  }

  body.desktop-card-transparent .site-card .site-title {
    text-shadow: 0 1px 4px rgba(255, 255, 255, 0.55);
  }

  html.dark body.desktop-card-transparent .site-card .site-title {
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.62);
  }
}

@media (max-width: 767px) {
  body.mobile-card-transparent .home-panels .site-card,
  body.mobile-card-transparent .home-panels .site-card.frosted-glass-effect,
  body.mobile-card-transparent .home-panels .panel-frosted-mobile .site-card.frosted-glass-effect,
  html.dark body.mobile-card-transparent .home-panels .site-card,
  html.dark body.mobile-card-transparent .home-panels .site-card.frosted-glass-effect,
  html.dark body.mobile-card-transparent .home-panels .panel-frosted-mobile .site-card.frosted-glass-effect {
    background: transparent !important;
    background-color: transparent !important;
    border: 1px solid transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  body.mobile-card-transparent .home-panels .site-card:hover,
  body.mobile-card-transparent .home-panels .site-card.frosted-glass-effect:hover,
  body.mobile-card-transparent .home-panels .panel-frosted-mobile .site-card.frosted-glass-effect:hover {
    background: rgba(255, 255, 255, 0.22) !important;
    border-color: rgba(255, 255, 255, 0.42) !important;
    transform: translateY(-2px);
  }

  html.dark body.mobile-card-transparent .home-panels .site-card:hover,
  html.dark body.mobile-card-transparent .home-panels .site-card.frosted-glass-effect:hover,
  html.dark body.mobile-card-transparent .home-panels .panel-frosted-mobile .site-card.frosted-glass-effect:hover {
    background: rgba(255, 255, 255, 0.11) !important;
    border-color: rgba(255, 255, 255, 0.22) !important;
    transform: translateY(-2px);
  }

  body.mobile-card-transparent .site-card .site-title {
    text-shadow: 0 1px 4px rgba(255, 255, 255, 0.55);
  }

  html.dark body.mobile-card-transparent .site-card .site-title {
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.62);
  }
}

/* --- 3. 隐藏书签名称（桌面 / 手机独立，严格保持用户设定的网格列数） --- */
@media (min-width: 768px) {
  body.desktop-hide-title .site-card .site-title,
  body.desktop-hide-title .site-card .site-card-meta {
    display: none !important;
  }

  body.desktop-hide-title .panel-pane-grid .site-card .site-card-head {
    justify-content: center;
  }

  body.desktop-hide-title .panel-pane-grid .site-card .site-icon {
    margin: 0 auto !important;
  }

  body.desktop-hide-title .panel-pane-grid .site-card .site-card-content {
    padding: 0.6rem 0.55rem;
  }
}

@media (max-width: 767px) {
  body.mobile-hide-title .site-card .site-title,
  body.mobile-hide-title .site-card .site-card-meta {
    display: none !important;
  }

  body.mobile-hide-title .panel-pane-grid .site-card .site-card-head {
    justify-content: center;
  }

  body.mobile-hide-title .panel-pane-grid .site-card .site-icon {
    margin: 0 auto !important;
  }

  body.mobile-hide-title .panel-pane-grid .site-card .site-card-content {
    padding: 0.52rem 0.45rem;
  }
}

/* --- 4. 精致悬停浮层气泡（Tooltip）：展示完整站名，挂在 body 顶层不裁切、不溢出屏幕 --- */
.xdh-card-tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 85;
  pointer-events: none;
  max-width: min(280px, calc(100vw - 24px));
  padding: 0.36rem 0.72rem;
  border-radius: 0.625rem;
  background: rgba(15, 23, 42, 0.92);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 26px -6px rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.35;
  overflow: visible;
  opacity: 0;
  transform: translateY(4px) scale(0.96);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.xdh-card-tooltip-text {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

html.dark .xdh-card-tooltip {
  background: rgba(30, 41, 59, 0.95);
  color: #f8fafc;
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow: 0 12px 30px -6px rgba(0, 0, 0, 0.65);
}

.xdh-card-tooltip::after {
  content: '';
  position: absolute;
  left: var(--tip-arrow-x, 50%);
  bottom: -5px;
  width: 9px;
  height: 9px;
  background: inherit;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  transform: translateX(-50%) rotate(45deg);
}

.xdh-card-tooltip.is-bottom {
  transform: translateY(-4px) scale(0.96);
}

.xdh-card-tooltip.is-bottom::after {
  bottom: auto;
  top: -5px;
  border-right: none;
  border-bottom: none;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.xdh-card-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}
