/* style.css — 自定义样式与动画 */

/* 基础 */
html { scroll-behavior: smooth; }
body { background: #05070f; }

/* 区块标题：前缀 > 高亮 */
.section-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #fff;
  margin-bottom: 2rem;
}
.section-title::before {
  content: '> ';
  color: #a78bfa;
}

/* ===== 按钮：流光扫过效果 ===== */
.btn-primary,
.btn-secondary {
  position: relative;
  overflow: hidden;
  padding: 0.75rem 1.75rem;
  border-radius: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary {
  background: linear-gradient(135deg, #0891b2, #22d3ee);
  color: #05070f;
}
.btn-secondary {
  border: 1px solid #22d3ee;
  color: #22d3ee;
}
/* 流光条（伪元素） */
.btn-primary::before,
.btn-secondary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: skewX(-20deg);
}
.btn-primary:hover::before,
.btn-secondary:hover::before {
  animation: shine 0.6s ease forwards;
}
.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(34, 211, 238, 0.5);
}
@keyframes shine {
  from { left: -120%; }
  to { left: 160%; }
}

/* ===== 项目卡片：抖动 + 高斯模糊背景 ===== */
.project-card {
  position: relative;
  padding: 1.5rem;
  border-radius: 1rem;
  border: 1px solid #1e293b;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(0px);
  transition: border-color 0.2s ease, backdrop-filter 0.3s ease;
}
.project-card:hover {
  border-color: #a78bfa;
  backdrop-filter: blur(6px);
  animation: card-shake 0.3s ease;
}
@keyframes card-shake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(-2px, 1px) rotate(-0.5deg); }
  50% { transform: translate(2px, -1px) rotate(0.5deg); }
  75% { transform: translate(-1px, -1px) rotate(-0.3deg); }
}

/* ===== 开屏星空旋转动画层 ===== */
.loader-starfield {
  width: 200px;
  height: 200px;
  background:
    radial-gradient(1px 1px at 20px 30px, #fff, transparent),
    radial-gradient(1px 1px at 120px 80px, #fff, transparent),
    radial-gradient(2px 2px at 60px 150px, #22d3ee, transparent),
    radial-gradient(1px 1px at 160px 140px, #fff, transparent),
    radial-gradient(1px 1px at 90px 40px, #fff, transparent),
    radial-gradient(1px 1px at 150px 30px, #fff, transparent);
  animation: spin 3s linear infinite;
}
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ===== 按钮悬停粒子扩散（预留装饰） ===== */
@keyframes particle-burst {
  0% { transform: scale(0); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* ===== 程序化星系背景（Three.js canvas） ===== */
#galaxy-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -40;
}

/* ===== 恒星导航 ===== */
#panel-layer {
  display: flex;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
#panel-layer.active {
  opacity: 1;
  pointer-events: auto;
}

#orbit {
  pointer-events: none;
}

.orbit-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(34, 211, 238, 0.12);
  border-radius: 50%;
  pointer-events: none;
}

.star-node {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  background: none;
  border: none;
  cursor: pointer;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  transition: transform 0.25s ease;
}
.star-node:hover {
  transform: translate(-50%, -50%) scale(1.16);
}

/* 恒星本体：白热核心 + 主色过渡，边缘完全模糊、无硬边 */
.star-glow {
  display: block;
  width: 92px;
  height: 92px;
  border-radius: 50%;
}

/* 白热核心 + 主色过渡 + 无硬边 + 多层光晕（更亮、更大、更柔） */
.star-about {
  background: radial-gradient(circle, #ffffff 0%, #e0fbff 16%, #7ce7f8 36%, #0891b2 60%, rgba(8,145,178,0.28) 82%, transparent 100%);
  box-shadow: 0 0 26px rgba(103,232,249,0.95), 0 0 64px rgba(34,211,238,0.7), 0 0 130px rgba(8,145,178,0.5), 0 0 220px rgba(8,145,178,0.3);
}
.star-projects {
  background: radial-gradient(circle, #ffffff 0%, #e6efff 16%, #93c5fd 36%, #2563eb 60%, rgba(37,99,235,0.28) 82%, transparent 100%);
  box-shadow: 0 0 26px rgba(147,197,253,0.95), 0 0 64px rgba(96,165,250,0.7), 0 0 130px rgba(37,99,235,0.5), 0 0 220px rgba(37,99,235,0.3);
}
.star-blog {
  background: radial-gradient(circle, #ffffff 0%, #fefce8 16%, #fde047 36%, #eab308 60%, rgba(234,179,8,0.28) 82%, transparent 100%);
  box-shadow: 0 0 26px rgba(253,224,71,0.95), 0 0 64px rgba(250,204,21,0.7), 0 0 130px rgba(234,179,8,0.5), 0 0 220px rgba(234,179,8,0.3);
}
.star-contact {
  background: radial-gradient(circle, #ffffff 0%, #f8fafc 16%, #e2e8f0 36%, #cbd5e1 60%, rgba(226,232,240,0.28) 82%, transparent 100%);
  box-shadow: 0 0 26px rgba(255,255,255,0.95), 0 0 64px rgba(226,232,240,0.7), 0 0 130px rgba(203,213,225,0.5), 0 0 220px rgba(203,213,225,0.3);
}

.star-label {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: #e2e8f0;
  text-shadow: 0 0 10px rgba(0, 0, 0, 1), 0 0 3px rgba(0, 0, 0, 1);
  transition: color 0.2s ease;
  white-space: nowrap;
}
.star-node:hover .star-label { color: #fff; }

/* 首页中心文字阴影，增强在亮星系上的可读性 */
#center-view h1,
#center-view p {
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.9), 0 0 3px rgba(0, 0, 0, 1);
}

/* ===== 恒星点击聚焦光斑（打开面板时放大铺满、关闭时缩回） ===== */
.star-focus {
  position: fixed;
  left: 0;
  top: 0;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  z-index: 18;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.5s ease;
}

/* ===== 背景模糊层（点开面板时模糊整个背景） ===== */
.bg-blur {
  position: fixed;
  inset: 0;
  z-index: 16;
  pointer-events: none;
  opacity: 0;
  backdrop-filter: blur(16px);
  transition: opacity 0.4s ease;
}
.bg-blur.active {
  opacity: 1;
}

/* ===== 内容面板 ===== */
.panel {
  width: 100%;
  max-width: 52rem;
  opacity: 0;
  transform: scale(0.72);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}
.panel.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.panel-card {
  position: relative;
  max-height: 82vh;
  overflow-y: auto;
  padding: 2.5rem;
  border-radius: 1rem;
  /* 背景统一为蓝紫色，半透明 + 模糊，透出后方背景 */
  background: rgba(var(--panel-color, 139, 92, 246), 0.16);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(var(--panel-color, 139, 92, 246), 0.26);
}

/* 文章日期 */
.blog-date {
  flex-shrink: 0;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.panel-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2rem;
  height: 2rem;
  border-radius: 9999px;
  border: 1px solid #334155;
  color: #94a3b8;
  background: transparent;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.panel-close:hover {
  color: #fff;
  border-color: #a78bfa;
  transform: rotate(90deg);
}
