/**
 * A-social · 黑白灰 UI
 */
@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&display=swap");

:root {
  --hx-bg-deep: #0a0a0a;
  --hx-bg-card: rgba(23, 23, 23, 0.72);
  --hx-border: rgba(255, 255, 255, 0.08);
  --hx-border-strong: rgba(255, 255, 255, 0.18);
  --hx-text: #e5e5e5;
  --hx-muted: #a3a3a3;
  --hx-glow: rgba(255, 255, 255, 0.06);
}

html {
  font-family: "Noto Sans SC", system-ui, -apple-system, sans-serif;
}

.hx-body {
  color: var(--hx-text);
  background-color: var(--hx-bg-deep);
  background-image:
    radial-gradient(ellipse 100% 80% at 50% 0%, rgba(64, 64, 64, 0.12), transparent 55%),
    radial-gradient(ellipse 80% 50% at 100% 50%, rgba(38, 38, 38, 0.2), transparent 45%);
  background-attachment: fixed;
}

/* 欢迎页：纯黑灰底，星光集中在银河 banner 内 */
.hx-body-welcome {
  background-color: #050505;
  background-image: none;
}

.hx-body-welcome::before {
  display: none;
}

.hx-body-welcome > header,
.hx-body-welcome > main,
.hx-body-welcome > footer {
  position: relative;
  z-index: 1;
}

/* —— 全宽横版银河 Banner —— */
.hx-hero-section {
  position: relative;
}

.hx-galaxy-bleed {
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  width: 100vw;
}

.hx-galaxy-banner {
  position: relative;
  width: 100%;
  min-height: clamp(200px, 36vh, 380px);
  max-height: 420px;
  overflow: hidden;
  background: linear-gradient(180deg, #050505 0%, #030303 42%, #070707 100%);
  /* 不用硬线，与页面背景靠遮罩融合 */
}

/* 银河光带层：极慢自右向左漂移（循环） */
.hx-galaxy-drift--bands {
  position: absolute;
  inset: -4%;
  z-index: 1;
  animation: hx-band-drift 180s linear infinite;
  will-change: transform;
  pointer-events: none;
}

@keyframes hx-band-drift {
  0% {
    transform: translate3d(6%, 0.3%, 0) rotate(-2.8deg) scale(1);
  }
  100% {
    transform: translate3d(-7%, 0.6%, 0) rotate(-3.2deg) scale(1.02);
  }
}

.hx-galaxy-band {
  position: absolute;
  left: -15%;
  top: 50%;
  width: 130%;
  height: 45%;
  margin-top: -12%;
  transform: rotate(-3deg);
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.02) 28%,
    rgba(255, 255, 255, 0.06) 48%,
    rgba(255, 255, 255, 0.1) 50%,
    rgba(255, 255, 255, 0.06) 52%,
    rgba(255, 255, 255, 0.02) 72%,
    transparent 100%
  );
  filter: blur(0.9px);
  opacity: 0.75;
  pointer-events: none;
}

.hx-galaxy-band-2 {
  position: absolute;
  left: -10%;
  top: 42%;
  width: 120%;
  height: 22%;
  margin-top: -5%;
  transform: rotate(-5deg);
  background: radial-gradient(ellipse 100% 100% at 50% 50%, rgba(130, 130, 130, 0.07), transparent 72%);
  opacity: 0.85;
  pointer-events: none;
}

.hx-galaxy-stars {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
}

/* 略大于 100% 的星场，慢移自右向左（循环） */
.hx-galaxy-stars-flow {
  position: absolute;
  width: 118%;
  height: 122%;
  left: -9%;
  top: -11%;
  animation: hx-starfield-drift 170s linear infinite;
  will-change: transform;
  pointer-events: none;
}

@keyframes hx-starfield-drift {
  0% {
    transform: translate3d(5.5%, 1.2%, 0);
  }
  100% {
    transform: translate3d(-6.5%, -0.4%, 0);
  }
}

/* 彗星：彗核 + 彗尾；--comet-angle 为整体轨迹，--tail-angle 为尾相对轨迹的随机偏角 */
.hx-galaxy-comet {
  --comet-angle: -7deg;
  --tail-angle: 0deg;
  position: absolute;
  z-index: 5;
  left: 0;
  top: 0;
  width: min(400px, 70vw);
  height: 4px;
  opacity: 0;
  pointer-events: none;
  transform-origin: 0 50%;
  background: none;
}

.hx-galaxy-comet::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 2px;
  height: 2px;
  margin: -1px 0 0 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffffff 0%, rgba(255, 255, 255, 0.2) 60%, transparent 72%);
  box-shadow:
    0 0 2px 0.5px rgba(255, 255, 255, 0.45),
    0 0 12px 2px rgba(210, 220, 240, 0.1);
  filter: blur(0.25px);
  z-index: 1;
}

.hx-galaxy-comet::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 50%;
  width: min(392px, calc(70vw - 6px));
  height: 1px;
  margin-top: -0.5px;
  transform-origin: left center;
  transform: rotate(var(--tail-angle));
  border-radius: 2px;
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.55) 0%,
    rgba(230, 236, 248, 0.14) 18%,
    rgba(140, 155, 180, 0.04) 48%,
    transparent 76%
  );
  filter: blur(0.85px);
}

.hx-galaxy-comet.hx-comet-active {
  animation: hx-comet-fly 3.4s cubic-bezier(0.22, 0.08, 0.2, 1) forwards;
}

@keyframes hx-comet-fly {
  0% {
    opacity: 0;
    transform: translate3d(108vw, 0, 0) rotate(var(--comet-angle));
  }
  6% {
    opacity: 0.75;
  }
  14% {
    opacity: 1;
  }
  82% {
    opacity: 0.55;
  }
  100% {
    opacity: 0;
    transform: translate3d(-22vw, 14px, 0) rotate(var(--comet-angle));
  }
}

/* 上下柔边：用不透明度与页面底色 #050505 自然衔接 */
.hx-galaxy-edge {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 6;
  pointer-events: none;
}

.hx-galaxy-edge--top {
  top: 0;
  height: 42%;
  background: linear-gradient(
    to bottom,
    rgba(5, 5, 5, 1) 0%,
    rgba(5, 5, 5, 0.72) 22%,
    rgba(5, 5, 5, 0.28) 55%,
    rgba(5, 5, 5, 0) 100%
  );
}

.hx-galaxy-edge--bottom {
  bottom: 0;
  height: 48%;
  background: linear-gradient(
    to top,
    rgba(5, 5, 5, 1) 0%,
    rgba(5, 5, 5, 0.68) 26%,
    rgba(5, 5, 5, 0.22) 58%,
    rgba(5, 5, 5, 0) 100%
  );
}

/* 微尘：小而淡 */
.hx-star--dust {
  position: absolute;
  border-radius: 50%;
  background: #e5e5e5;
  box-shadow: 0 0 2px rgba(255, 255, 255, 0.35);
  animation: hx-twinkle-dust linear infinite;
  pointer-events: none;
  will-change: opacity, transform, filter;
}

@keyframes hx-twinkle-dust {
  0%,
  100% {
    opacity: 0.06;
    transform: scale(0.4);
    filter: brightness(0.85);
  }
  50% {
    opacity: 0.55;
    transform: scale(1);
    filter: brightness(1.15);
  }
}

/* 普通星点：随机周期亮起，峰值更明显 */
.hx-star {
  position: absolute;
  border-radius: 50%;
  background: #fafafa;
  box-shadow: 0 0 2px rgba(255, 255, 255, 0.5);
  pointer-events: none;
  animation: hx-twinkle linear infinite;
  will-change: opacity, transform, filter;
}

@keyframes hx-twinkle {
  0%,
  100% {
    opacity: 0.05;
    transform: scale(0.3);
    filter: brightness(0.75) drop-shadow(0 0 0 transparent);
  }
  38% {
    opacity: 0.35;
    transform: scale(0.85);
    filter: brightness(1.05);
  }
  49% {
    opacity: 1;
    transform: scale(1.12);
    filter: brightness(1.85) drop-shadow(0 0 10px rgba(255, 255, 255, 0.95))
      drop-shadow(0 0 18px rgba(255, 255, 255, 0.45));
  }
  54% {
    opacity: 0.92;
    transform: scale(1.08);
    filter: brightness(1.6) drop-shadow(0 0 8px rgba(255, 255, 255, 0.85));
  }
  72% {
    opacity: 0.12;
    transform: scale(0.55);
    filter: brightness(0.9);
  }
}

/* 大星体 / 行星：与 .hx-star 同用，覆盖动画与外观 */
.hx-star.hx-star--planet {
  background: radial-gradient(circle at 30% 30%, #ffffff 0%, #d4d4d4 45%, #737373 100%);
  box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
  animation: hx-twinkle-planet linear infinite;
}

@keyframes hx-twinkle-planet {
  0%,
  100% {
    opacity: 0.18;
    transform: scale(0.65);
    filter: brightness(0.9) drop-shadow(0 0 2px rgba(255, 255, 255, 0.3));
  }
  45% {
    opacity: 1;
    transform: scale(1.08);
    filter: brightness(2) drop-shadow(0 0 14px rgba(255, 255, 255, 1))
      drop-shadow(0 0 28px rgba(255, 255, 255, 0.55))
      drop-shadow(0 0 42px rgba(255, 255, 255, 0.2));
  }
  58% {
    opacity: 0.35;
    transform: scale(0.88);
    filter: brightness(1.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hx-galaxy-drift--bands,
  .hx-galaxy-stars-flow {
    animation: none !important;
  }

  .hx-galaxy-comet,
  .hx-galaxy-comet.hx-comet-active {
    animation: none !important;
    opacity: 0 !important;
  }

  .hx-star,
  .hx-star--dust,
  .hx-star.hx-star--planet {
    animation: none !important;
    opacity: 0.45;
  }
}

/* 居中内容区 */
/* 全站主内容区：水平居中、统一最大宽度 */
.hx-page {
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: 72rem;
  padding-left: 1rem;
  padding-right: 1rem;
}

.hx-content-narrow {
  width: 100%;
  max-width: 42rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.hx-content-wide {
  width: 100%;
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 768px) {
  .hx-page,
  .hx-content-narrow,
  .hx-content-wide {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.hx-nav-glass {
  background: rgba(5, 5, 5, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hx-border);
}

.hx-card {
  border-radius: 1rem;
  border: 1px solid var(--hx-border);
  background: var(--hx-bg-card);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02) inset;
}

.hx-card:hover {
  border-color: var(--hx-border-strong);
  box-shadow: 0 0 32px -8px var(--hx-glow);
}

.hx-gradient-text {
  background: linear-gradient(120deg, #ffffff 0%, #a3a3a3 55%, #d4d4d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* 欢迎页主标题：所有浏览器保持单行并居中 */
.hx-hero-title {
  display: block;
  width: 100%;
  text-align: center;
  white-space: nowrap;
  text-wrap: nowrap;
  line-height: 1.15;
  font-size: clamp(1.85rem, 7.1vw, 3.75rem);
}

.hx-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 0.5rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #0a0a0a;
  background: #f5f5f5;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.35);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.hx-btn-primary:hover {
  background: #ffffff;
  border-color: rgba(255, 255, 255, 0.35);
}

.hx-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 0.5rem;
  padding: 0.5rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--hx-text);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(23, 23, 23, 0.6);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.hx-btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(38, 38, 38, 0.75);
}

.hx-nav-pill {
  border-radius: 0.5rem;
  padding: 0.5rem 0.875rem;
  font-size: 0.875rem;
  color: var(--hx-muted);
  border: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.hx-nav-pill:hover {
  color: var(--hx-text);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.hx-nav-pill-active {
  color: #fafafa !important;
  border-color: rgba(255, 255, 255, 0.22) !important;
  background: rgba(255, 255, 255, 0.06) !important;
}

.hx-hero-glow {
  display: none;
}

.hx-feature-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--hx-border);
}

input.hx-input,
textarea.hx-input,
select.hx-input {
  color: #f5f5f5;
  background-color: rgba(10, 10, 10, 0.9);
}
