/* ============================================
   首页样式 - Homepage Hub Design
   ============================================ */

/* --- 首页容器 --- */
.home-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 80px var(--space-md) var(--space-xl);
  position: relative;
}

/* --- 中央 Hub --- */
.hub-container {
  position: relative;
  width: 700px;
  height: 700px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: var(--space-xl) auto;
}

/* Hub 光环 */
.hub-rings {
  position: absolute;
  inset: 50px;
  pointer-events: none;
}

.hub-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(99,102,241,0.12);
  animation: spin-slow 30s linear infinite;
}

.hub-ring:nth-child(2) {
  inset: -50px;
  border-color: rgba(139,92,246,0.10);
  animation-duration: 40s;
  animation-direction: reverse;
}

.hub-ring:nth-child(3) {
  inset: -100px;
  border-color: rgba(6,182,212,0.08);
  animation-duration: 35s;
}

/* Hub 中心 */
.hub-core {
  position: relative;
  z-index: 2;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(79,70,229,0.3) 0%, rgba(139,92,246,0.25) 50%, rgba(6,182,212,0.2) 100%);
  border: 2px solid rgba(255,255,255,0.2);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  box-shadow:
    0 0 60px rgba(99,102,241,0.25),
    0 0 120px rgba(99,102,241,0.1),
    inset 0 0 40px rgba(255,255,255,0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: default;
  transition: all var(--transition-slow);
  animation: float 6s ease-in-out infinite;
}

.hub-core:hover {
  box-shadow:
    0 0 80px rgba(99,102,241,0.35),
    0 0 160px rgba(99,102,241,0.18);
  border-color: rgba(255,255,255,0.3);
}

.hub-core .hub-icon {
  font-size: 2.8rem;
  margin-bottom: 4px;
}

.hub-core .hub-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 1px;
}

.hub-core .hub-user {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Hub 标签 — 在 Hub 容器下方，不受卡片遮挡 */
.hub-tagline {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 3px;
  font-weight: 500;
  margin-top: var(--space-md);
}

/* --- 模块卡片环 --- */
.modules-ring {
  position: absolute;
  inset: -80px;
  pointer-events: none;
}

.module-card {
  position: absolute;
  pointer-events: auto;
  width: 150px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-sm);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
  transform: translate(-50%, -50%);
}

.module-card:hover {
  background: var(--glass-bg-hover);
  border-color: rgba(255,255,255,0.22);
  box-shadow: var(--shadow-md), 0 0 30px rgba(99,102,241,0.15);
  transform: translate(-50%, -50%) translateY(-4px) scale(1.04);
}

.module-card .card-icon {
  font-size: 2rem;
  margin-bottom: var(--space-xs);
  display: block;
}

.module-card .card-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.module-card .card-count {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/*
 * 8个卡片均匀分布在圆形轨道上
 * 容器 860x860 (700 + 80*2), 圆心 (430, 430), 半径 310px
 * 所有卡片到Hub中心距离完全相等，形成标准正圆
 * 相邻圆心距≈237px, 卡片宽150px, 间距≈87px
 */
.module-card:nth-child(1) { top: 16.7%; left: 63.8%; }   /* 22.5°  右上 */
.module-card:nth-child(2) { top: 36.2%; left: 83.3%; }   /* 67.5°  右 */
.module-card:nth-child(3) { top: 63.8%; left: 83.3%; }   /* 112.5° 右下 */
.module-card:nth-child(4) { top: 83.3%; left: 63.8%; }   /* 157.5° 下 */
.module-card:nth-child(5) { top: 83.3%; left: 36.2%; }   /* 202.5° 左下 */
.module-card:nth-child(6) { top: 63.8%; left: 16.7%; }   /* 247.5° 左 */
.module-card:nth-child(7) { top: 36.2%; left: 16.7%; }   /* 292.5° 左上 */
.module-card:nth-child(8) { top: 16.7%; left: 36.2%; }   /* 337.5° 上 */

/* --- SVG 连接线 --- */
.connections-svg {
  position: absolute;
  inset: -80px;
  width: 860px;
  height: 860px;
  pointer-events: none;
  z-index: 0;
}

.connection-line {
  fill: none;
  stroke: rgba(99,102,241,0.2);
  stroke-width: 1;
  stroke-dasharray: 4 6;
  animation: connectPulse 3s ease-in-out infinite;
}

/* --- 底部统计 --- */
.home-stats {
  display: flex;
  gap: var(--space-xl);
  margin-top: var(--space-2xl);
  flex-wrap: wrap;
  justify-content: center;
}

.stat-item {
  text-align: center;
  padding: var(--space-md) var(--space-lg);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  min-width: 130px;
  transition: all var(--transition-base);
}

.stat-item:hover {
  background: var(--glass-bg-hover);
  transform: translateY(-2px);
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, #a5b4fc, #67e8f9);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  letter-spacing: 0.5px;
}

/* --- 响应式 --- */
@media (max-width: 900px) {
  .hub-container {
    width: 500px;
    height: 500px;
  }

  .hub-core {
    width: 150px;
    height: 150px;
  }

  .hub-core .hub-icon { font-size: 2rem; }
  .hub-core .hub-title { font-size: 0.7rem; }

  .module-card {
    width: 110px;
    padding: var(--space-sm);
  }

  .module-card .card-icon { font-size: 1.4rem; }
  .module-card .card-label { font-size: 0.7rem; }

  .modules-ring { inset: -60px; }

  .connections-svg {
    width: 620px;
    height: 620px;
    inset: -60px;
  }

  .hub-rings { inset: 30px; }
  .hub-ring:nth-child(2) { inset: -30px; }
  .hub-ring:nth-child(3) { inset: -60px; }
}

@media (max-width: 640px) {
  .hub-container {
    width: auto;
    height: auto;
  }

  .modules-ring {
    position: relative;
    inset: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
    margin-top: var(--space-xl);
    width: 100%;
  }

  .module-card {
    position: static;
    width: 100%;
    transform: none !important;
  }

  .module-card:hover {
    transform: translateY(-2px) scale(1.02) !important;
  }

  .connections-svg { display: none; }
  .hub-rings { display: none; }

  .home-stats {
    gap: var(--space-sm);
  }

  .stat-item {
    min-width: 100px;
    padding: var(--space-sm) var(--space-md);
  }

  .stat-value { font-size: 1.3rem; }
}
