:root {
  --alist-violet: #8b5cf6;
  --alist-violet-2: #a78bfa;
  --alist-violet-3: #c4b5fd;
  --alist-black: #08080c;
  --alist-panel: #111118;
  --alist-line: rgba(139, 92, 246, 0.18);
}

html {
  scroll-behavior: smooth;
}

body {
  cursor: url("/img/cursors/millennium_base.cur"), auto;
}

a,
a *,
button,
button *,
[role="button"],
.btn,
.tag,
.post-tag,
.post-meta a,
.navbar a,
.pagination a,
.social-icon a {
  cursor: url("/img/cursors/millennium_link.cur"), pointer;
}

input,
textarea,
select,
[contenteditable="true"] {
  cursor: url("/img/cursors/millennium_text.ani"), text;
}

/* 导航栏 */
#navbar {
  background: rgba(8, 8, 12, 0.74) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(139, 92, 246, 0.16);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

#navbar .navbar-brand {
  color: #f5f3ff !important;
  font-family: "Orbitron", "Rajdhani", "Exo 2", "Segoe UI", sans-serif;
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 0.24em;
}

#navbar .navbar-brand:hover {
  color: var(--alist-violet-3) !important;
}

#navbar .nav-link {
  color: #d8d8e4 !important;
  letter-spacing: 0.08em;
  transition: color 0.2s ease;
}

#navbar .nav-link:hover,
#navbar .nav-item.active .nav-link {
  color: var(--alist-violet-3) !important;
}

#navbar .nav-item.active .nav-link::after {
  background: var(--alist-violet);
}

/* 头图 */
#banner {
  background-color: var(--alist-black);
}

#banner .mask {
  background: linear-gradient(
    180deg,
    rgba(8, 8, 12, 0.18) 0%,
    rgba(8, 8, 12, 0.55) 58%,
    rgba(8, 8, 12, 0.92) 100%
  ) !important;
}

.banner-text .h1,
.banner-text .h2 {
  letter-spacing: 0.1em;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.75), 0 0 60px rgba(139, 92, 246, 0.35);
}

.banner-text .subtitle {
  color: #e9e4ff !important;
  letter-spacing: 0.18em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.7);
}

#scroll-down {
  color: var(--alist-violet-3) !important;
}

/* 链接与选中 */
::selection {
  background: rgba(139, 92, 246, 0.45);
  color: #fff;
}

.post-content a,
.about-content a,
.markdown-body a {
  color: var(--alist-violet-2);
  border-bottom: 1px solid rgba(167, 139, 250, 0.28);
}

.post-content a:hover,
.about-content a:hover,
.markdown-body a:hover {
  color: var(--alist-violet-3);
  border-bottom-color: var(--alist-violet-3);
}

/* 文章与面板 */
.board,
.card,
#board {
  border-radius: 14px;
}

.post-content,
.about-content {
  line-height: 1.85;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.about-content h1,
.about-content h2,
.about-content h3,
.about-content h4 {
  letter-spacing: 0.02em;
}

.post-content h2 {
  padding-bottom: 0.35em;
  border-bottom: 1px solid var(--alist-line);
}

.markdown-body blockquote {
  background: rgba(139, 92, 246, 0.08);
  border-left: 3px solid var(--alist-violet);
  border-radius: 0 8px 8px 0;
}

.markdown-body code {
  border-radius: 5px;
}

.markdown-body pre {
  border: 1px solid var(--alist-line);
  border-radius: 12px;
}

.markdown-body img {
  border-radius: 10px;
}

/* 标签 */
.post-tag,
.tag,
.post-meta .tag,
a.tag {
  padding: 2px 10px !important;
  color: var(--alist-violet-3) !important;
  background: rgba(139, 92, 246, 0.08) !important;
  border: 1px solid rgba(139, 92, 246, 0.35) !important;
  border-radius: 999px !important;
  transition: all 0.2s ease;
}

.post-tag:hover,
.tag:hover,
a.tag:hover {
  color: #fff !important;
  background: var(--alist-violet) !important;
  border-color: var(--alist-violet) !important;
}

/* 关于页 */
.about-info .about-name {
  letter-spacing: 0.08em;
}

.about-info .about-intro {
  color: #c4b5fd;
}

.about-info .about-icons a {
  color: var(--alist-violet-2);
}

.about-info .about-icons a:hover {
  color: var(--alist-violet-3);
}

.about-avatar,
.about-info img {
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.4), 0 0 30px rgba(139, 92, 246, 0.25);
}

/* 页脚 */
#footer,
.footer {
  color: #8f8fa8;
}

#footer a,
.footer a {
  color: var(--alist-violet-2);
}

#footer a:hover,
.footer a:hover {
  color: var(--alist-violet-3);
}

.footer-sep {
  margin: 0 6px;
  opacity: 0.5;
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #0b0b12;
}

::-webkit-scrollbar-thumb {
  background: #2c2c42;
  border: 2px solid #0b0b12;
  border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
  background: #4a3b78;
}

/* 加载遮罩 */
#alist-loader {
  position: fixed;
  inset: 0;
  z-index: 100000;
  overflow: hidden;
  background: #05050a;
  animation: alist-loader-failsafe 0.4s 6s forwards;
}

#alist-loader::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(circle at center, rgba(5, 5, 10, 0.08), rgba(5, 5, 10, 0.72));
  pointer-events: none;
}

#alist-loader.is-hidden {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

#alist-binary {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

#alist-loader .alist-loader-brand {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  color: #f5f3ff;
  font-family: "Orbitron", "Rajdhani", "Exo 2", "Segoe UI", sans-serif;
  font-size: clamp(2.6rem, 9vw, 6rem);
  font-weight: 900;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  text-shadow: 0 0 50px rgba(139, 92, 246, 0.85);
  transform: translate(-50%, -50%);
}

#alist-loader .alist-loader-sub {
  position: absolute;
  top: calc(50% + clamp(3rem, 10vw, 6rem));
  left: 50%;
  z-index: 2;
  color: #8b5cf6;
  font-family: "Orbitron", "Rajdhani", "Exo 2", "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  animation: alist-blink 1.1s steps(2, end) infinite;
  transform: translateX(-50%);
}

@keyframes alist-blink {
  50% {
    opacity: 0.25;
  }
}

@keyframes alist-loader-failsafe {
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* 鼠标拖尾 */
#rainbow-trail {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9998;
}

/* 点击爱心 */
.click-heart {
  position: fixed;
  z-index: 99999;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: alist-heart 1.45s cubic-bezier(0.17, 0.67, 0.3, 1) forwards;
  filter: drop-shadow(0 0 6px rgba(255, 107, 129, 0.35));
}

@keyframes alist-heart {
  0% {
    transform: translate(-50%, -50%) scale(0.35) rotate(0deg);
    opacity: 0;
  }
  12% {
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% - 130px)) scale(1)
      rotate(var(--rot, 0deg));
    opacity: 0;
  }
}

/* 贪吃蛇彩蛋 */
body.snake-playing {
  user-select: none;
  -webkit-user-select: none;
}

#snake-layer {
  position: fixed;
  inset: 0;
  z-index: 100001;
  overflow: hidden;
  cursor: inherit;
  touch-action: none;
}

#snake-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#snake-hud {
  position: fixed;
  top: 84px;
  left: 50%;
  z-index: 100002;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 16px;
  color: var(--alist-violet-3);
  font-size: 12px;
  letter-spacing: 0.06em;
  white-space: nowrap;
  background: rgba(5, 5, 10, 0.72);
  border: 1px solid rgba(139, 92, 246, 0.35);
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
  transform: translateX(-50%);
}

#snake-hud b {
  color: #f5f3ff;
  font-weight: 600;
}

#snake-hud.is-win {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.45);
}

#snake-hud.is-dead {
  color: #f87171;
  background: rgba(30, 5, 10, 0.8);
  border-color: rgba(248, 113, 113, 0.5);
}

#snake-hud.is-dead b {
  color: #fecaca;
}

#snake-hud .snake-key {
  color: #8f8fa8;
}

.snake-eaten {
  animation: alist-snake-bite 0.22s ease-in forwards;
  pointer-events: none;
}

@keyframes alist-snake-bite {
  0% {
    opacity: 1;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(0.88);
    visibility: hidden;
  }
}

/* 响应式 */
@media (max-width: 768px) {
  #navbar .navbar-brand {
    letter-spacing: 0.16em;
  }

  .banner-text .h1 {
    font-size: 2.2rem;
  }

  .banner-text .h2 {
    font-size: 1.4rem;
  }

  .banner-text .subtitle {
    letter-spacing: 0.1em;
  }

  #rainbow-trail {
    display: none;
  }

  #snake-hud {
    top: 68px;
    gap: 7px;
    padding: 6px 11px;
    font-size: 11px;
    letter-spacing: 0;
  }
}

/* 减少动态 */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  #alist-loader,
  #rainbow-trail,
  .click-heart {
    display: none !important;
  }

  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* 白天模式：太空1 的暮色星空 */
html[data-user-color-scheme="light"] {
  --body-bg-color: #142536;
  --board-bg-color: #1c3042;
  --text-color: #e7f0f2;
  --sec-text-color: #9eb3be;
  --post-text-color: #d8e5e9;
  --post-heading-color: #f2f8f9;
  --post-link-color: #a6d9d0;
  --link-hover-color: #ecd6a4;
  --link-hover-bg-color: rgba(127, 178, 175, 0.12);
  --line-color: rgba(159, 202, 199, 0.18);
  --navbar-bg-color: #08141f;
  --navbar-text-color: #e7f0f2;
  --subtitle-color: #f4fbfa;
  --scrollbar-color: #36515c;
  --scrollbar-hover-color: #587782;
  --button-bg-color: #152a3b;
  --button-hover-bg-color: #1d3548;
  --highlight-bg-color: #0f2231;
  --inlinecode-bg-color: rgba(127, 178, 175, 0.14);
  --fold-title-color: #e7f0f2;
  --fold-border-color: rgba(159, 202, 199, 0.18);
  --alist-violet: #6fa9a5;
  --alist-violet-2: #9fd3ca;
  --alist-violet-3: #d4efe9;
  --alist-black: #0d1b28;
  --alist-panel: #142a3b;
  --alist-line: rgba(159, 202, 199, 0.18);
}

html[data-user-color-scheme="light"] #navbar {
  background: rgba(7, 18, 27, 0.74) !important;
  border-bottom-color: rgba(159, 202, 199, 0.16);
}

html[data-user-color-scheme="light"] #navbar .navbar-brand {
  color: #f2fbfa !important;
}

html[data-user-color-scheme="light"] #navbar .nav-link {
  color: #d7e8ea !important;
}

html[data-user-color-scheme="light"] #navbar .nav-link:hover,
html[data-user-color-scheme="light"] #navbar .nav-item.active .nav-link {
  color: #d4efe9 !important;
}

html[data-user-color-scheme="light"] #navbar .nav-item.active .nav-link::after {
  background: #6fa9a5;
}

html[data-user-color-scheme="light"] #banner {
  background-color: #0e1b28;
  background-image: url("/img/banner-light.webp") !important;
}

html[data-user-color-scheme="light"] #banner .mask {
  background: linear-gradient(
    180deg,
    rgba(8, 18, 27, 0.2) 0%,
    rgba(8, 18, 27, 0.5) 58%,
    rgba(8, 18, 27, 0.94) 100%
  ) !important;
}

html[data-user-color-scheme="light"] .banner-text .h1,
html[data-user-color-scheme="light"] .banner-text .h2 {
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.7), 0 0 60px rgba(111, 158, 158, 0.3);
}

html[data-user-color-scheme="light"] .banner-text .subtitle {
  color: #eef8f6 !important;
}

html[data-user-color-scheme="light"] #scroll-down {
  color: #b8e4dc !important;
}

html[data-user-color-scheme="light"] ::selection {
  background: rgba(111, 169, 165, 0.45);
  color: #fff;
}

html[data-user-color-scheme="light"] .post-content a,
html[data-user-color-scheme="light"] .about-content a,
html[data-user-color-scheme="light"] .markdown-body a {
  color: #a6d9d0;
  border-bottom-color: rgba(166, 217, 208, 0.28);
}

html[data-user-color-scheme="light"] .post-content a:hover,
html[data-user-color-scheme="light"] .about-content a:hover,
html[data-user-color-scheme="light"] .markdown-body a:hover {
  color: #ecd6a4;
  border-bottom-color: rgba(236, 214, 164, 0.55);
}

html[data-user-color-scheme="light"] .alist-visitors {
  color: #9eb3be;
}
