/* 全站背景：极光与星光 */
@font-face {
  font-family: "Orbitron";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/orbitron-700.woff2") format("woff2");
}

@font-face {
  font-family: "Orbitron";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("/fonts/orbitron-900.woff2") format("woff2");
}

html {
  background: #05050a;
}

html[data-user-color-scheme="light"] {
  background: linear-gradient(180deg, #0e1b28 0%, #16283a 55%, #1b2f42 100%);
}

body {
  background: transparent !important;
}

#alist-aurora {
  position: fixed;
  inset: -25%;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(38% 32% at 22% 28%, rgba(56, 189, 248, 0.28), transparent 70%),
    radial-gradient(34% 28% at 78% 22%, rgba(139, 92, 246, 0.34), transparent 72%),
    radial-gradient(42% 34% at 62% 82%, rgba(232, 121, 249, 0.18), transparent 72%);
  filter: blur(64px) saturate(1.25);
  opacity: 1;
  animation: alist-aurora-drift 26s ease-in-out infinite alternate;
}

html[data-user-color-scheme="light"] #alist-aurora {
  background:
    radial-gradient(38% 32% at 22% 28%, rgba(111, 158, 158, 0.3), transparent 70%),
    radial-gradient(34% 28% at 78% 22%, rgba(78, 105, 128, 0.3), transparent 72%),
    radial-gradient(42% 34% at 62% 82%, rgba(203, 183, 142, 0.17), transparent 72%);
  filter: blur(64px) saturate(1.08);
}
#alist-starfield {
  position: fixed;
  inset: 0;
  z-index: -1;
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

@keyframes alist-aurora-drift {
  0% {
    transform: translate3d(-2%, -1%, 0) scale(1);
  }

  50% {
    transform: translate3d(2%, 1.5%, 0) scale(1.06);
  }

  100% {
    transform: translate3d(4%, -2%, 0) scale(1.02);
  }
}

/* 首页头图：滚动模糊 */
html.alist-home #banner {
  position: relative;
  overflow: hidden;
  background: none !important;
}

html.alist-home #banner::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: url("/img/banner.webp") center center / cover no-repeat;
  filter: blur(var(--alist-banner-blur, 0px));
  transform: scale(var(--alist-banner-scale, 1.04));
  transition: filter 0.12s linear;
}

html[data-user-color-scheme="light"].alist-home #banner::before {
  background-image: url("/img/banner-light.webp");
}

html.alist-home #banner .full-bg-img {
  position: absolute;
  inset: 0;
  z-index: 1;
}

html.alist-home #banner .mask {
  background:
    radial-gradient(50% 45% at 25% 45%, rgba(56, 189, 248, 0.18), transparent 65%),
    radial-gradient(45% 40% at 75% 55%, rgba(139, 92, 246, 0.22), transparent 68%),
    linear-gradient(180deg, rgba(8, 8, 12, 0.2) 0%, rgba(8, 8, 12, 0.55) 58%, rgba(8, 8, 12, 0.92) 100%) !important;
}

html[data-user-color-scheme="light"].alist-home #banner .mask {
  background:
    radial-gradient(52% 46% at 22% 38%, rgba(111, 158, 158, 0.18), transparent 66%),
    radial-gradient(45% 40% at 78% 52%, rgba(203, 183, 142, 0.1), transparent 68%),
    linear-gradient(180deg, rgba(8, 18, 27, 0.18) 0%, rgba(8, 18, 27, 0.48) 55%, rgba(8, 18, 27, 0.94) 100%) !important;
}

#board,
.board {
  background: rgba(13, 13, 20, 0.72) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

html[data-user-color-scheme="light"] #board,
html[data-user-color-scheme="light"] .board {
  background: rgba(20, 38, 52, 0.7) !important;
}

/* 首页主标题：科技字体 + 蓝白紫网格渐变 */
html.alist-home #banner .banner-text .h2::before {
  content: "ALIST";
  display: block;
  margin-bottom: 0.08em;
  color: transparent;
  font-family: "Orbitron", "Rajdhani", "Exo 2", "Segoe UI", sans-serif;
  font-size: clamp(3.2rem, 9vw, 7.5rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  text-shadow: none;
  background-image:
    repeating-linear-gradient(0deg, rgba(125, 211, 252, 0.18) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(90deg, rgba(196, 181, 253, 0.15) 0 1px, transparent 1px 9px),
    linear-gradient(
      90deg,
      #0b4f8a 0%,
      #0369a1 10%,
      #0ea5e9 20%,
      #22d3ee 28%,
      #bae6fd 36%,
      #f8fafc 43%,
      #f8fafc 47%,
      #c084fc 54%,
      #a855f7 64%,
      #7e22ce 80%,
      #4c1d95 100%
    ),
    repeating-linear-gradient(
      115deg,
      rgba(255, 255, 255, 0) 0 90px,
      rgba(255, 255, 255, 0.18) 112px 142px,
      rgba(255, 255, 255, 0) 164px 230px
    );
  background-size: 100% 9px, 9px 100%, 100% 100%, 230px 100%;
  background-position: 0 0, 0 0, 0 0, 0 0;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 26px rgba(139, 92, 246, 0.38));
  animation: alist-title-grid 9s linear infinite;
}

@media (min-width: 769px) {
  html.alist-home #banner .banner-text .h2::before {
    letter-spacing: 0.18em;
    text-indent: 0.18em;
  }
}

html[data-user-color-scheme="light"].alist-home #banner .banner-text .h2::before {
  background-image:
    repeating-linear-gradient(0deg, rgba(103, 232, 249, 0.18) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(90deg, rgba(94, 234, 212, 0.14) 0 1px, transparent 1px 9px),
    linear-gradient(
      90deg,
      #0c4a6e 0%,
      #0e7490 10%,
      #0891b2 20%,
      #22d3ee 30%,
      #a5f3fc 38%,
      #f8fafc 44%,
      #f8fafc 50%,
      #99f6e4 58%,
      #5eead4 66%,
      #fde68a 78%,
      #fbbf24 90%,
      #f59e0b 100%
    ),
    repeating-linear-gradient(
      115deg,
      rgba(255, 255, 255, 0) 0 90px,
      rgba(255, 244, 214, 0.22) 112px 142px,
      rgba(255, 255, 255, 0) 164px 230px
    );
  filter: drop-shadow(0 0 28px rgba(94, 234, 212, 0.32));
}

@keyframes alist-title-grid {
  to {
    background-position: 9px 9px, -9px 9px, 0 0, -230px 0;
  }
}

body,
.banner-text,
#navbar,
#footer,
.markdown-body,
.post-content,
.about-content,
.index-header,
.index-excerpt,
.post-meta,
#alist-music,
#alist-lang-switch,
.alist-lang-switch-mobile {
  font-family: "LXGW WenKai", "Noto Serif SC", "Songti SC", serif;
}

h1,
h2,
h3,
h4,
h5,
h6,
.banner-text .h1,
.banner-text .h2 {
  font-family: "LXGW WenKai", "Noto Serif SC", "Songti SC", serif;
}

code,
pre,
kbd,
.hljs,
.highlight,
.code-toolbar {
  font-family: "JetBrains Mono", "Cascadia Code", "Consolas", monospace !important;
}

#alist-lang-switch {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

#alist-lang-switch:hover {
  color: var(--alist-violet-2) !important;
}

.alist-lang-switch-mobile {
  color: inherit;
}

.alist-lang-switch-mobile .alist-lang-switch-label {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

/* 无限进步打字机 */
html.alist-home #subtitle {
  cursor: pointer;
}

html.alist-home #subtitle::after {
  content: "_";
  display: inline-block;
  margin-left: 0.06em;
  color: var(--alist-violet-2);
  animation: alist-caret 1s steps(2, end) infinite;
}

html.alist-home #subtitle.is-lyrics::after {
  display: none;
}

@keyframes alist-caret {
  50% {
    opacity: 0;
  }
}

/* 音乐播放器 */
#alist-music {
  position: fixed;
  bottom: 22px;
  left: 22px;
  z-index: 9990;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 8px;
  color: #d8d8e4;
  background: rgba(8, 8, 12, 0.72);
  border: 1px solid rgba(139, 92, 246, 0.28);
  border-radius: 999px;
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

#alist-music[hidden] {
  display: none !important;
}

#alist-music.is-unavailable {
  opacity: 0.72;
}

#alist-music-toggle:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.alist-music-skip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 28px;
  padding: 0;
  color: #a7a7bd;
  background: transparent;
  border: 0;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.alist-music-skip:hover {
  color: var(--alist-violet-2);
}

.alist-music-skip:disabled {
  opacity: 0.26;
  cursor: default;
}

#alist-music-switch .alist-music-switch-icon {
  font-size: 1.05rem;
  line-height: 1;
}

#alist-music-switch.is-on {
  color: var(--alist-violet-2) !important;
}

#alist-music-switch.is-on .alist-music-switch-icon {
  text-shadow: 0 0 12px rgba(167, 139, 250, 0.85);
}

.alist-music-switch-mobile {
  color: inherit;
}

.alist-music-switch-mobile.is-on {
  color: var(--alist-violet-2) !important;
}

.alist-music-switch-mobile .alist-music-switch-icon {
  font-size: 1.25rem;
  line-height: 1;
}

#alist-music-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: #f5f3ff;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.9), rgba(139, 92, 246, 0.95));
  border: 0;
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.4);
  cursor: pointer;
}

.alist-music-icon {
  font-size: 12px;
  line-height: 1;
  transform: translateX(1px);
}

.alist-music-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 96px;
  max-width: 180px;
  overflow: hidden;
  line-height: 1.2;
}

.alist-music-info strong {
  color: #f5f3ff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alist-music-info span {
  color: #8f8fa8;
  font-size: 10px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.alist-music-eq {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  opacity: 0.45;
}

.alist-music-eq i {
  display: block;
  width: 2px;
  height: 5px;
  background: var(--alist-violet-2);
  border-radius: 2px;
  transform-origin: bottom;
}

#alist-music.is-playing .alist-music-eq {
  opacity: 0.95;
}

#alist-music.is-playing .alist-music-eq i {
  animation: alist-eq 0.9s ease-in-out infinite alternate;
}

#alist-music.is-playing .alist-music-eq i:nth-child(2) {
  animation-delay: 0.15s;
}

#alist-music.is-playing .alist-music-eq i:nth-child(3) {
  animation-delay: 0.3s;
}

#alist-music.is-playing .alist-music-eq i:nth-child(4) {
  animation-delay: 0.45s;
}

@keyframes alist-eq {
  from {
    height: 4px;
  }

  to {
    height: 14px;
  }
}

#alist-music-volume {
  width: 58px;
  height: 3px;
  accent-color: var(--alist-violet-2);
  cursor: pointer;
}

/* 节日限定 */
#festival-layer {
  position: fixed;
  inset: 0;
  z-index: 9996;
  overflow: hidden;
  pointer-events: none;
}

.festival-lantern {
  position: absolute;
  top: -10px;
  width: 52px;
  height: 132px;
  transform-origin: 50% 0;
  scale: var(--lantern-scale, 1);
  animation: festival-lantern-sway 4.6s ease-in-out infinite alternate;
  animation-delay: var(--lantern-delay, 0s);
}

.festival-lantern-cord {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1px;
  height: 38px;
  background: linear-gradient(#fbbf24, rgba(251, 191, 36, 0.08));
}

.festival-lantern-cap {
  position: absolute;
  top: 35px;
  left: 50%;
  width: 24px;
  height: 6px;
  border-radius: 2px;
  background: #fbbf24;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.55);
  transform: translateX(-50%);
}

.festival-lantern-body {
  position: absolute;
  top: 40px;
  left: 50%;
  width: 46px;
  height: 58px;
  border-radius: 50% / 42%;
  background: radial-gradient(circle at 35% 30%, #fb7185, #dc2626 55%, #7f1d1d);
  box-shadow: 0 0 26px rgba(239, 68, 68, 0.5), inset 0 0 18px rgba(251, 191, 36, 0.3);
  transform: translateX(-50%);
}

.festival-lantern-rib {
  position: absolute;
  top: 44px;
  left: 50%;
  width: 1px;
  height: 50px;
  background: rgba(251, 191, 36, 0.5);
  box-shadow: 10px 0 0 rgba(251, 191, 36, 0.22), -10px 0 0 rgba(251, 191, 36, 0.22);
  transform: translateX(-50%);
}

.festival-lantern-tassel {
  position: absolute;
  top: 98px;
  left: 50%;
  width: 2px;
  height: 26px;
  background: linear-gradient(#fbbf24, rgba(251, 191, 36, 0));
  transform: translateX(-50%);
}

@keyframes festival-lantern-sway {
  from {
    transform: rotate(-4deg);
  }

  to {
    transform: rotate(4deg);
  }
}

#festival-fireworks {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
}

.festival-bat {
  position: absolute;
  top: 78vh;
  width: 64px;
  height: 32px;
  color: #1e1b2e;
  opacity: 0;
  filter: drop-shadow(0 0 9px rgba(139, 92, 246, 0.8));
  animation: festival-bat-startle 2.8s cubic-bezier(0.1, 0.7, 0.2, 1) forwards;
  animation-delay: var(--bat-delay, 0s);
  will-change: transform, opacity;
}

.festival-bat.from-left {
  left: -74px;
}

.festival-bat.from-right {
  right: -74px;
}

.festival-bat svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  stroke: rgba(196, 181, 253, 0.3);
  stroke-width: 0.6;
}

.festival-bat-wing {
  fill: currentColor;
  transform-origin: 36px 18px;
  animation: festival-bat-flap 0.13s ease-in-out infinite alternate;
}

.festival-bat-wing-right {
  animation-delay: 0.015s;
}

.festival-bat-body,
.festival-bat-ear {
  fill: currentColor;
}

.festival-bat-eye {
  fill: #f87171;
}

@keyframes festival-bat-startle {
  0% {
    transform: translate3d(0, 0, 0) rotate(0) scale(var(--bat-scale, 0.8));
    opacity: 0;
  }

  10% {
    opacity: 0.95;
  }

  68% {
    opacity: 0.9;
  }

  100% {
    transform: translate3d(var(--bat-x, 55vw), var(--bat-y, -80vh), 0) rotate(var(--bat-rot, 24deg)) scale(calc(var(--bat-scale, 0.8) * 1.16));
    opacity: 0;
  }
}

@keyframes festival-bat-flap {
  from {
    transform: scaleY(1);
  }

  to {
    transform: scaleY(0.18);
  }
}

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

.alist-about-en[hidden],
.about-content .markdown-body > [hidden] {
  display: none !important;
}

/* 访问计数 */
.alist-visitors {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #8f8fa8;
}

.alist-visitors .iconfont {
  color: var(--alist-violet-2);
}

@media (max-width: 768px) {
  #alist-music {
    bottom: 14px;
    left: 12px;
    gap: 8px;
    padding: 7px 10px 7px 7px;
  }

  #alist-music-toggle {
    width: 30px;
    height: 30px;
  }

  .alist-music-info {
    min-width: 0;
  }

  .alist-music-info span,
  .alist-music-eq {
    display: none;
  }

  #alist-music-volume {
    width: 44px;
  }

  .festival-lantern {
    width: 40px;
    height: 108px;
  }

  .festival-lantern-body {
    width: 36px;
    height: 46px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #alist-aurora {
    animation: none;
  }

  html.alist-home #banner .banner-text .h2::before {
    animation: none;
  }

  #festival-snow {
    display: none;
  }
}
