* { box-sizing: border-box; }

html, body {
  margin: 0;
  overflow-x: hidden;
  padding: 0;
  background: #041014;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

/* ---------- 科技感背景（固定在视口后方） ---------- */
.bg-fx {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(360px 240px at 90% 0%, rgba(0, 224, 198, 0.13), transparent 70%),
    linear-gradient(180deg, #041014 0%, #06161b 62%, #071b21 100%);
}

/* 缓慢漂移的网格 */
.bg-fx::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(120, 240, 230, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 240, 230, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, #000 30%, transparent 95%);
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 95%);
  animation: gridDrift 30s linear infinite;
}

/* 旋转光环 */
.bg-glow {
  position: absolute;
  width: 520px;
  height: 520px;
  left: 50%;
  top: 60%;
  margin: -260px 0 0 -260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 224, 198, 0.2), transparent 64%);
  filter: blur(10px);
}

/* 中心轨道：三圈同心圆，外圈反向虚线 */
.bg-orbits {
  position: absolute;
  left: 50%;
  top: 60%;
  width: 0;
  height: 0;
}

.orbit {
  position: absolute;
  border: 1px solid rgba(0, 224, 198, 0.12);
  border-radius: 50%;
  animation: spin 30s linear infinite;
}

.orbit::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 50%;
  width: 5px;
  height: 5px;
  margin-left: -2.5px;
  border-radius: 50%;
  background: #00e0c6;
  box-shadow: 0 0 12px #00e0c6;
}

.orbit-a { width: 440px; height: 440px; left: -220px; top: -220px; }
.orbit-b { width: 340px; height: 340px; left: -170px; top: -170px; animation-direction: reverse; animation-duration: 42s; border-style: dashed; opacity: 0.7; }
.orbit-c { width: 540px; height: 540px; left: -270px; top: -270px; opacity: 0.35; animation-duration: 60s; }

/* 背景水印字 */
.bg-watermark {
  position: absolute;
  right: -2vw;
  bottom: -8vw;
  font-size: clamp(220px, 34vw, 520px);
  font-weight: 800;
  letter-spacing: -0.08em;
  line-height: 0.8;
  color: transparent;
  -webkit-text-stroke: 1px rgba(150, 255, 245, 0.07);
  user-select: none;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes gridDrift {
  from { background-position: 0 0; }
  to   { background-position: 48px 48px; }
}

.home {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: 90px;
  position: relative;
  z-index: 1;
}

/* ---------- 顶部分类菜单 ---------- */
.menu-bar-fixed {
  position: fixed;
  top: 0.6rem;
  left: 0;
  width: 100%;
  z-index: 100;
}

.menu-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 1rem;
}

.menu-bar button {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  padding: 0.8rem 2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  font-family: inherit;
}

/* 底部发光下划线：悬停/激活时展开 */
.menu-bar button::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: #00e0c6;
  box-shadow: 0 0 8px rgba(0, 224, 198, 0.6);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.menu-bar button:hover { color: #00e0c6; transform: translateY(-1px); }
.menu-bar button.active { color: #00e0c6; }
.menu-bar button.active::before { width: 60%; }

/* ---------- 卡片网格 ---------- */
.container {
  max-width: 55rem;
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 15px;
  align-content: start;
  position: relative;
  z-index: 2;
  flex: 1;
}

.link-item {
  background-color: rgba(120, 240, 230, 0.06);
  border: 1px solid rgba(180, 230, 230, 0.14);
  border-radius: 15px;
  transition: all 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  min-height: 85px;
  height: 85px;
  display: flex;
}

.link-item:hover {
  background-color: rgba(0, 224, 198, 0.12);
  border-color: rgba(0, 224, 198, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 0 18px rgba(0, 224, 198, 0.15);
}

.link-item a {
  text-decoration: none;
  color: #fff;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 0 4px;
  text-align: center;
}

.link-icon {
  width: 25px;
  height: 25px;
  margin: 4px auto;
  object-fit: contain;
  border-radius: 6px;
}

.link-fallback {
  width: 25px;
  height: 25px;
  margin: 4px auto;
  border-radius: 6px;
  background: #009999;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.link-text {
  font-size: 14px;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
  min-height: 1.5em;
}

.container.animate .link-item {
  animation: slideUp 0.6s ease-out both;
  animation-delay: calc(var(--i) * 0.04s);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 页脚 ---------- */
.footer {
  margin-top: auto;
  text-align: center;
  padding: 2rem 0;
  position: relative;
  z-index: 2;
}

.copyright {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
  .container { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
  .home { padding-top: 80px; }
  .menu-bar { gap: 0.2rem; }
  .menu-bar button { font-size: 14px; padding: 0.4rem 0.8rem; }
  .container { grid-template-columns: repeat(3, 1fr); width: 95%; }
  .bg-watermark { font-size: 42vw; right: -4vw; bottom: -6vw; }
  .bg-orbits { transform: scale(0.75); }
}

@media (max-width: 480px) {
  .home { padding-top: 72px; }
  .menu-bar button { font-size: 13px; padding: 0.4rem 0.6rem; }
  .container { gap: 10px; padding: 0 0.6rem; }
  .link-item { height: 78px; min-height: 78px; border-radius: 12px; }
  .link-text { font-size: 13px; }
  .link-icon, .link-fallback { width: 22px; height: 22px; }
  .bg-orbits { transform: scale(0.55); }
  .copyright { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-fx::before, .orbit { animation: none; }
  .container.animate .link-item { animation: none; }
}
