@tailwind base;
@tailwind components;
@tailwind utilities;

html,
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden; /*修复拖拽时出现滚动条的问题*/
}

.mobile-only {
  display: none;
}


html {
  --primary: #09090B;
  --muted-foreground: #09090B;
  --secondary: #000000;
}

html.dark  {
  --primary: #F8FAFC;
  --muted-foreground: #F8FAFC;
  --secondary: #000000;
}




@media (max-width: 768px) {
  .mobile-only {
    display: initial;
  }
  .pc-only {
    display: none;
  }
}

.typography {
  font-family: "Noto Sans SC", sans-serif;
  h1 {
    font-size: 2.25rem;
    line-height: 2.5rem;
    scroll-margin: 5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
  }
  h2 {
    scroll-margin: 5rem;
    border-bottom-width: 1px;
    padding-bottom: 0.5rem;
    font-size: 1.875rem;
    line-height: 2.25rem;
    font-weight: 600;
    letter-spacing: -0.025em;
  }
  h2:first-child {
    margin-top: 0;
  }
  h3 {
    font-size: 1.2rem;
  }
  h4 {
    font-size: 1rem;
  }
  p {
    line-height: 1.75rem;
  }
  p:not(:first-child) {
    margin-top: 1.5rem;
  }
  blockquote {
    margin-top: 1.5rem;
    padding-left: 1.5rem;
    border-left-width: 2px;
    font-style: italic;
  }
  @media (min-width: 1024px) {
    h1 {
      font-size: 3rem;
      line-height: 1;
    }
  }
}

.main-container {
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  gap: 2rem;
  padding: 8px 0;
  width: 80%;
  flex-grow: 1;
  h1 {
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
  }
  .page-info {
    margin: -1rem 0;
    text-align: center;
    span {
      margin: 0 3px;
    }
  }
}

@media (max-width: 768px) {
  .main-container {
    width: 95%;
    gap: 1.2rem;
    h1 {
      font-size: 1.5rem;
    }
  }
}

/*ThemeSwitch*/
.themeToggle {
  /*color: #bbb;*/
  width: 2em;
  height: 2rem;
  display: block;
}

.st-sunMoonThemeToggleBtn {
  position: relative;
  cursor: pointer;
}

.st-sunMoonThemeToggleBtn .themeToggleInput {
  opacity: 0;
  width: 100%;
  aspect-ratio: 1;
  z-index: 10;
}

.st-sunMoonThemeToggleBtn svg {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  transition: transform 0.4s ease;
  transform: rotate(40deg);
}

.st-sunMoonThemeToggleBtn svg .sunMoon {
  transform-origin: center center;
  transition: inherit;
  transform: scale(1);
}

.st-sunMoonThemeToggleBtn svg .sunRay {
  transform-origin: center center;
  transform: scale(0);
}

.st-sunMoonThemeToggleBtn svg mask > circle {
  transition: transform 0.64s cubic-bezier(0.41, 0.64, 0.32, 1.575);
  transform: translate(0px, 0px);
}

.st-sunMoonThemeToggleBtn svg .sunRay2 {
  animation-delay: 0.05s !important;
}
.st-sunMoonThemeToggleBtn svg .sunRay3 {
  animation-delay: 0.1s !important;
}
.st-sunMoonThemeToggleBtn svg .sunRay4 {
  animation-delay: 0.17s !important;
}
.st-sunMoonThemeToggleBtn svg .sunRay5 {
  animation-delay: 0.25s !important;
}
.st-sunMoonThemeToggleBtn svg .sunRay5 {
  animation-delay: 0.29s !important;
}

.st-sunMoonThemeToggleBtn .themeToggleInput:checked + svg {
  transform: rotate(90deg);
}
.st-sunMoonThemeToggleBtn .themeToggleInput:checked + svg mask > circle {
  transform: translate(16px, -3px);
}
.st-sunMoonThemeToggleBtn .themeToggleInput:checked + svg .sunMoon {
  transform: scale(0.55);
}
.st-sunMoonThemeToggleBtn .themeToggleInput:checked + svg .sunRay {
  animation: showRay1832 0.4s ease 0s 1 forwards;
}

@keyframes showRay1832 {
  0% {
    transform: scale(0);
  }
  100% {
    transform: scale(1);
  }
}

.flexMain {
  padding: 0 15%;
}

@media (max-width: 768px) {
  .flexMain {
    margin: 0 1.5rem;
  }
}

:root::highlight(rainbow-color) {
  display: inline-block;
  background-color: #6D28D9;
  margin: 0 2px;
  color: #fff;
  font-weight: bold;
  line-height: 1;
  text-decoration: underline wavy #0284C7;
  text-underline-offset: 3px;
}
