﻿* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  position: relative;
  color: #fff;
  font: 14px/1.6 "Noto Sans SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: linear-gradient(180deg, #0a0a1a 0%, #0d1127 50%, #0a0a1a 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: none;
}

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

.clearfix::after {
  content: "";
  display: block;
  clear: both;
}

.wrap,
.wrapper {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.wrapper::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(100, 120, 255, 0.2), transparent 45%),
    radial-gradient(circle at 78% 70%, rgba(120, 160, 255, 0.18), transparent 42%),
    url("../images/bg-optimized.jpg") center center / cover no-repeat;
  opacity: 0.32;
  z-index: 1;
}

.header,
.subpage-main,
.footer {
  position: relative;
  z-index: 3;
}

.header {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.head {
  width: min(1220px, 96vw);
  margin: 0 auto;
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo_box {
  float: none;
}

.site-title-link {
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 1px;
}

.site-title-link:hover {
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 24px rgba(255, 255, 255, 0.35);
}

.subpage-main {
  height: calc(100% - 160px);
  padding: clamp(18px, 3.6vh, 40px) 20px 12px;
  display: grid;
  place-items: center;
}

.subpage-panel {
  width: min(1020px, 95vw);
  max-height: 100%;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: clamp(20px, 4.2vw, 34px);
  background: linear-gradient(135deg, rgba(16, 19, 38, 0.78), rgba(18, 25, 52, 0.7));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.35), 0 0 70px rgba(100, 120, 255, 0.1);
  transform-origin: center center;
  transition: opacity 0.45s ease, filter 0.45s ease;
}

.subpage-panel h1 {
  margin: 0;
  text-align: center;
  font-weight: 300;
  font-size: clamp(28px, 4.8vw, 42px);
  letter-spacing: 3px;
  text-shadow: 0 0 20px rgba(150, 170, 255, 0.35);
}

.subpage-panel .intro {
  margin: 8px auto 0;
  max-width: 760px;
  text-align: center;
  color: rgba(255, 255, 255, 0.78);
}

.links {
  margin-top: 24px;
}

.links h2 {
  margin: 0 0 12px;
  font-weight: 400;
  letter-spacing: 1px;
  color: rgba(180, 198, 255, 0.9);
}

.links ul {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.links a {
  display: block;
  padding: 11px 12px;
  text-align: center;
  border-radius: 12px;
  border: 1px solid rgba(150, 170, 255, 0.25);
  background: linear-gradient(180deg, rgba(80, 100, 220, 0.2), rgba(16, 20, 40, 0.42));
  transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s, text-shadow 0.25s;
}

.links a:hover {
  transform: translateY(-2px);
  border-color: rgba(170, 188, 255, 0.65);
  box-shadow: 0 0 12px rgba(96, 124, 255, 0.38);
  text-shadow: 0 0 8px rgba(210, 220, 255, 0.75);
}

.links a:focus-visible,
.site-title-link:focus-visible {
  outline: 2px solid rgba(160, 180, 255, 0.95);
  outline-offset: 2px;
  border-radius: 8px;
}

body.is-loading .subpage-panel {
  transform: scaleY(0.04);
  opacity: 0;
  filter: blur(2px);
}

body.is-ready .subpage-panel {
  animation: panelRevealBounce 0.92s cubic-bezier(0.2, 0.85, 0.22, 1) both;
}

@keyframes panelRevealBounce {
  0% {
    transform: scaleY(0.04);
    opacity: 0;
    filter: blur(2px);
  }
  62% {
    transform: scaleY(1.02);
    opacity: 1;
    filter: blur(0);
  }
  80% {
    transform: scaleY(0.995);
  }
  100% {
    transform: scaleY(1);
    opacity: 1;
    filter: blur(0);
  }
}

.footer {
  position: absolute;
  width: 100%;
  left: 0;
  bottom: 10px;
  z-index: 4;
}

.foot {
  text-align: center;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.28);
}

.icp-link {
  color: rgba(255, 255, 255, 0.3);
  margin-left: 6px;
  transition: color 0.2s;
}

.icp-link:hover {
  color: rgba(255, 255, 255, 0.62);
}

.scale_box {
  transform-origin: center center;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #0a0a1a 0%, #0d1127 50%, #0a0a1a 100%);
  transition: opacity 0.6s ease;
}

.loading-screen.fade-out {
  opacity: 0;
}

.loading-text {
  font-size: 28px;
  font-weight: 300;
  letter-spacing: 6px;
  animation: loadingPulse 1.5s ease-in-out infinite;
}

@keyframes loadingPulse {
  0%,
  100% {
    opacity: 0.4;
    text-shadow: 0 0 10px rgba(150, 170, 255, 0.2);
  }
  50% {
    opacity: 1;
    text-shadow: 0 0 30px rgba(150, 170, 255, 0.6), 0 0 60px rgba(100, 120, 255, 0.3);
  }
}

.cursor-glow {
  position: fixed;
  left: 0;
  top: 0;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(100, 120, 255, 0.12) 0%, rgba(80, 100, 220, 0.05) 40%, transparent 70%);
}

@media (max-width: 960px) {
  .links ul {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body,
  html {
    overflow: auto;
  }

  .header {
    position: sticky;
    top: 0;
    z-index: 8;
  }

  .head {
    padding: 12px 0;
  }

  .subpage-main {
    height: auto;
    min-height: calc(100% - 170px);
    padding: 16px 12px 72px;
  }

  .subpage-panel {
    width: 100%;
    max-height: none;
    border-radius: 14px;
    padding: 18px 14px;
  }

  .links ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer {
    position: static;
    padding: 10px 0 16px;
  }
}

@media (pointer: coarse) {
  .cursor-glow {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .cursor-glow {
    display: none;
  }
}
