/* 自定义样式 + Tailwind 补充 */

@layer utilities {
  .text-link {
    @apply text-primary hover:underline;
  }
  .sidebar-active {
    @apply bg-primary/10 text-primary border-r-2 border-primary;
  }

  /* 自定义滚动条 */
  .dark ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  .dark ::-webkit-scrollbar-track {
    background: #1A1F29;
  }
  .dark ::-webkit-scrollbar-thumb {
    background: #434C5E;
    border-radius: 4px;
  }
  .dark ::-webkit-scrollbar-thumb:hover {
    background: #0891b2;
  }
  html:not(.dark) ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }
  html:not(.dark) ::-webkit-scrollbar-track {
    background: #f1f5f9;
  }
  html:not(.dark) ::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
  }
  html:not(.dark) ::-webkit-scrollbar-thumb:hover {
    background: #0891b2;
  }



  /* 代码块样式 */
  pre {
    @apply bg-gray-900 dark:bg-black rounded-lg p-4 overflow-x-auto my-4;
  }
  pre code {
    @apply text-gray-100 text-sm font-mono leading-relaxed;
  }
  code {
    @apply bg-gray-100 dark:bg-gray-800 text-primary px-1.5 py-0.5 rounded text-sm font-mono;
  }
  pre code {
    @apply bg-transparent text-gray-100 dark:text-gray-100 px-0 py-0;
  }

  /* 图片样式 */
  img {
    @apply rounded-lg shadow-md my-4;
  }

  /* 文件夹展开动画 */
  [class^="folder-children-"] {
    @apply overflow-hidden;
  }

  /* 左侧边栏树形目录样式 - 飞书风格 */
  .tree-item {
    @apply select-none;
  }
  .tree-item > div {
    @apply transition-all duration-150;
  }
  .tree-item > div:hover {
    @apply bg-gray-100 dark:bg-dark-hover;
  }
  .tree-item .fa-caret-right,
  .tree-item .fa-caret-down {
    @apply transition-transform duration-150;
  }
  [class^="tree-children-"] {
    @apply overflow-hidden;
  }
}
