@import url('./github-markdown.css');
@import "remixicon/fonts/remixicon.css";
@import "remark-aside.css";
@tailwind base;
@tailwind components;
@tailwind utilities;

@font-face {
  font-family: "jetbrains-mono";
  src: url('./JetBrainsMono-Regular.ttf');
}

/**
覆写tailwindcss 默认样式
 */

html {
  height: 100%;
  scroll-padding-top: 72px;
}

body {
  height: 100%;
}

ol,
ul,
menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

@layer base {

  :root,
  html[data-theme="light"] {
    --color-fill: 241, 241, 241;
    --color-fill-secondary: 251, 251, 251;
    --color-card: 241, 241, 241;
    --color-text: 80, 73, 69;
    --color-text-dodge: 150, 150, 150;
    --color-text-active: 181, 118, 20;
    --color-border: 104, 157, 106;
    --color-border-active: 14, 192, 124;
    --color-modal: 52, 58, 64;
  }

  html[data-theme="dark"] {
    --color-fill: 40, 40, 40;
    --color-fill-secondary: 52, 58, 64;
    --color-card: 40, 42, 54;
    --color-text: 249, 244, 227;
    --color-text-dodge: 150, 150, 150;
    --color-text-active: 250, 189, 47;
    --color-border: 214, 93, 14;
    --color-border-active: 7, 102, 120;
    --color-modal: 251, 251, 251;
  }

  #sun-icon,
  html[data-theme="dark"] #moon-icon {
    display: none;
  }

  #moon-icon,
  html[data-theme="dark"] #sun-icon {
    display: block;
  }

}

@layer components {

  /* 导航栏的按钮样式 */
  .header-link-active {
    @apply underline underline-offset-4 decoration-wavy decoration-skin-active;
  }

  .header-link-hover {
    @apply underline underline-offset-4 decoration-wavy decoration-skin-base;
  }

  .header-btn {
    @apply cursor-pointer border rounded py-1 px-2 bg-skin-fill hover:text-skin-active mx-2 z-10
  }

  /*侧边栏每个栏目共有样式*/
  .aside-widget {
    @apply flex items-center w-full mb-2;
    border-bottom:  1px solid rgba(var(--color-text), .3);
  }

  /* 侧边最近评论列表样式 */
  .waline-comment-content {
    @apply p-1 overflow-auto break-words max-h-72 hover:text-skin-active;
  }

  .waline-comment-author {
    @apply mb-1 break-words text-end hover:text-skin-active;
  }

  a {
    @apply cursor-pointer;
  }

  .menu-icon {
    @apply text-xl mr-2
  }

  /* markdown内容图片样式 */
  .image-cols-2 {
    @apply grid gap-4 grid-cols-2 my-2
  }

  .image-cols-3 {
    @apply grid gap-4 grid-cols-3 my-2
  }

  .image-cols-4 {
    @apply grid gap-4 grid-cols-4 my-2
  }
}

* {
  scroll-behavior: smooth;
}

/* 分割线 */
.divider-vertical {
  height: .9em;
  width: 1px;
  background-color: rgba(var(--color-text), .2);
  border: none;
  margin: 0 8px;
}

.divider-horizontal {
  clear: both;
  width: 100%;
  height: 1px;
  min-width: 100%;
  margin: 12px 0;
  background-color: rgba(var(--color-text), .2);
}

.divider-horizontal-mini {
  display: flex;
  clear: both;
  width: 100%;
  height: 1px;
  min-width: 100%;
  margin: 8px 0;
  background-color: rgba(var(--color-text), .2);
}

/* 重写markdown样式 */
.markdown-body {
  background-color: inherit;
}

.markdown-body p,
li,
ul,
ol,
div,
a {
  line-height: 26px;
}

/* 修改waline评论侧边栏样式 */
.waline-comment-content-author {
  text-align: end;
  margin-bottom: 6px;
}

.wl-emoji {
  height: 24px;
  display: inline-block;
}

/*  网站列表样式清空 */
ul,
ol,
menu {
  list-style: none;
}

/* markdown 列表样式 */
.markdown-body menu,
.markdown-body ul {
  list-style: disc;
}

.markdown-body ol {
  list-style: decimal;
}

.markdown-body img {
  /* 修改图片居中 */
  /* margin: 0 auto; */
}

/* 修改滚动条样式 */

::-webkit-scrollbar {
  width: 10px;
  height: 16px;
  background-color: #edede9;
}

::-webkit-scrollbar-thumb {
  background-color: #c0c4cc;
  border-radius: 4px;
}

/* 置顶文字样式 */
.post-sticky {
  font-weight: 400;
  height: 20px;
  padding: 0 6px;
  margin-right: 5px;
  line-height: 20px;
  font-size: 16px;
  white-space: nowrap;
  vertical-align: 2px;
  color: rgb(var(--color-fill));
  background-color: rgb(var(--color-text));
  opacity: 0.8;
  border-radius: 2px 6px;
}

#toc a:hover {
  color: rgb(var(--color-text-active));
}

.github-avatar{
  border-radius: 50%;
  width: 32px;
  height: 32px;
  object-fit: cover;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.avatar {
  border-radius: 50%;
  padding: 4px;
  width: 96px;
  height: 96px;
  object-fit: cover;
  background-color: transparent;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.expressive-code {
  margin: 1rem 0;
}

/* fix mathjax style */
.MathJax {
  text-align: left !important;
}

.MathJax svg {
  display: inline;
}
