/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background-color: #17171c;
  color: #ffffff;
  line-height: 1.6;
  overflow-x: hidden;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
}

img {
  max-width: 100%;
  display: block;
}

/* Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-medium {
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-small {
  max-width: 896px;
  margin: 0 auto;
  padding: 0 24px;
}

/* 页眉导航 */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: rgba(23, 23, 28, 0);
  transition: all 0.3s ease;
}

/* 页眉背景 */
.navbar.scrolled {
  background-color: rgba(28, 45, 43, 0.9);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px);
  /* 新增：兼容Safari浏览器 */
  -webkit-backdrop-filter: blur(10px);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* logo */
.nav-logo {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 1px;
  transition: transform 0.3s ease;
}

.nav-logo:hover {
  transform: scale(1.05);
}

.logo-text {
  color: #ffffff;
}

.logo-accent {
  color: #00ff88;
}

/* 导航tab样式 */
.nav-links {
  display: flex;
  gap: 32px;
}

.nav-link {
  position: relative;
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
  padding: 4px 8px;
}

.nav-link:hover {
  color: #ffffff;
  transform: translateY(-2px);
}

.nav-link.active {
  color: #ffffff;
}

/* 导航tab选中条 */
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: #00ff88;
}

/* 英雄背景 */
.hero-section {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* 粒子画布样式 - 新增 */
#particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  /* 放在背景图和渐变层下方，内容层上方 */
}

.hero-background {
  position: absolute;
  inset: 0;
  background: url('') center/cover;
  opacity: 0.2;
  animation: backgroundPulse 20s ease-in-out infinite;
  z-index: 2;
  /* 粒子层上方，渐变层下方 */
}

@keyframes backgroundPulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

/* 背景渐变 */
.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(150deg, #188678 0%, #1d2e2e 50%, #0a0e0e 100%);
  z-index: 3;
  /* 背景图上方，内容层下方 */
}

.hero-content {
  position: relative;
  z-index: 10;
  max-width: 1024px;
  margin: 0 auto;
  padding: 0 24px;
  text-align: center;
}

.hero-subtitle {
  color: #00ff88;
  margin-bottom: 16px;
  letter-spacing: 3px;
  text-transform: uppercase;
  font-size: 14px;
}

.hero-title {
  font-size: clamp(48px, 10vw, 96px);
  font-weight: 700;
  margin-bottom: 24px;
  background: linear-gradient(to right, #ffffff, #999999);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 口号样式 */
.hero-slogan {
  font-size: clamp(18px, 3vw, 24px);
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 16px;
  overflow: hidden;
  /* 重新加回来，用于溢出隐藏 */
  display: inline-flex;
  /* 光标和文字垂直居中 */
  align-items: center;
}

/* 打字机文字容器（JS 动态控制） */
.typewriter-text {
  white-space: nowrap;
  /* 不换行 */
  display: inline-block;
  color: inherit;
}

/* 独立光标样式 */
.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: clamp(18px, 3vw, 24px);
  /* 适配文字大小 */
  background-color: rgba(255, 255, 255, 0.8);
  margin-left: 4px;
  animation: blink 0.75s step-end infinite;
  /* 光标闪烁 */
}

/* 光标闪烁动画 */
@keyframes blink {

  from,
  to {
    background-color: transparent;
  }

  50% {
    background-color: rgba(255, 255, 255, 0.8);
  }
}

/* 删除阶段隐藏光标 */
.cursor-hidden {
  animation: none;
  background-color: transparent !important;
}

/* 个人描述 */
.hero-description {
  color: rgba(255, 255, 255, 0.6);
  font-weight: 200;
  margin-bottom: 48px;
  max-width: 768px;
  margin-left: auto;
  margin-right: auto;
}

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* 首页按钮字体 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 32px;
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.3s ease;
  /* 关键：给圆角加过渡动画，确保变化丝滑 */
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 所有按钮悬停时统一变大圆角 */
.btn:hover {
  border-radius: 40px;
  /* 悬停大圆角（可自定义数值，比如30px/60px） */
}

/* 首页查看作品按钮 */
.btn-primary {
  background-color: #00dd77;
  color: #17171c;
}

/* 查看作品按钮悬停 */
.btn-primary:hover {
  background-color: #00dd77;
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(0, 255, 136, 0.3);
}

/* 关于我按钮 - 次要按钮（新增从左到右填充动画） */
.btn-secondary {
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  background-color: transparent;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

/* 填充动画伪元素 */
.btn-secondary::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  /* 透明度从0.1→0.2，绿色更明显，保留渐变层次 */
  background: linear-gradient(90deg, rgba(0, 255, 136, 0.1) 0%, rgba(0, 255, 136, 0.2) 100%);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: -1;
  /* 关键：继承按钮的圆角 */
  border-radius: inherit;
}

/* 悬停时从左到右填充 */
.btn-secondary:hover {
  /* 核心修改：边框改为主题色（可加轻微透明度，更柔和） */
  border-color: rgba(0, 255, 136, 0.8);
  transform: scale(1.05);
  /* 阴影加一点主题色反光，强化效果 */
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15),
    0 0 8px rgba(0, 255, 136, 0.2);
  background-color: transparent;
}

.btn-secondary:hover::before {
  width: 100%;
}

.btn-white {
  background-color: #ffffff;
  color: #17171c;
}

/* 白色按钮悬停 */
.btn-white:hover {
  transform: scale(1.05);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  background-color: #f8f8f8;
  /* hover轻微变灰 */
}

/* 按钮箭头 */
.arrow {
  transition: transform 0.3s ease;
}

/* 箭头悬停 */
.btn:hover .arrow {
  transform: translateX(4px);
}

/* 下滑引导 */
.scroll-indicator {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s ease-in-out infinite;
  z-index: 10;
  /* 保证滚动指示器在最上层 */
}

@keyframes bounce {

  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateY(10px);
  }
}

/* 下滑引导边框 */
.scroll-indicator-border {
  width: 24px;
  height: 40px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  display: flex;
  justify-content: center;
  padding-top: 8px;
}

/* 下滑引导圆点 */
.scroll-indicator-dot {
  width: 6px;
  height: 6px;
  background-color: rgba(5, 255, 197, 1);
  border-radius: 50%;
  animation: scrollDot 2s ease-in-out infinite;
}

@keyframes scrollDot {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(20px);
  }
}

/* 社交媒体平台 */
.social-section {
  padding: 80px 0;
  /* 上下渐变：底部主题色低透 → 顶部原有#242428 */
  background: linear-gradient(to top,
      /* 明确指定：从下到上渐变 */
      rgba(0, 255, 208, 0),
      #00ffbf0d);
}

/* 社交媒体标题 */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  font-size: 36px;
  margin-bottom: 8px;
  margin-bottom: 8px;
  /* 让背景渐变适配文字宽度 */
  display: inline-block;
  background: linear-gradient(135deg, #ffffff, #8e9a98);
  /* 背景裁剪到文字 */
  background-clip: text;
  /* 兼容Chrome/Safari */
  -webkit-background-clip: text;
  /* 隐藏原文字色，显示渐变背景 */
  color: transparent;
}

.section-header p {
  color: rgba(255, 255, 255, 0.6);
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
}

/* 社交卡片 */
.social-card {
  padding: 24px;
  background: linear-gradient(135deg, #2b3339 0%, #13181a 100%);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* 伪元素实现渐变描边（修复兼容性） */
.social-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.5));
  border-radius: 24px;
  padding: 1px;
  /* 描边宽度 */
  /* 兼容写法：先写带前缀的，再写标准属性 */
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  pointer-events: none;
}

/* 社交卡片悬停 */
.social-card:hover {
  background: linear-gradient(to bottom, #4F5860, #363B42);
  transform: translateY(-8px);
  box-shadow: 0 10px 20px rgba(0, 255, 179, 0.1);
}

/* 悬停时描边消失（伪元素背景设为透明） */
.social-card:hover::before {
  background: transparent;
}

.social-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 图片图标样式（核心） */
.icon-img {
  /* 控制图标大小，适配容器 */
  width: 100%;
  height: 100%;
  /* 保持图片比例，不变形 */
  object-fit: contain;
  /* 悬停动效（和卡片呼应） */
  transition: transform 0.3s ease;
  /* 核心：添加圆角（按需调整数值） */
  border-radius: 10px;

}

/* 卡片悬停时图标轻微缩放 */
.social-card:hover .icon-img {
  transform: scale(1.1);
}

.social-card span {
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
}

/* 装逼部分 */
.highlights-section {
  padding: 80px 0;
  background-color: #141418;
}

.highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
}

.highlight-item {
  text-align: center;
  padding: 32px;

}

.highlight-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00ff88, #00aaff);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: rotate 20s linear infinite;
}

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

  to {
    transform: rotate(360deg);
  }
}

.highlight-icon-inner {
  width: 74px;
  height: 74px;
  background-color: #17171c;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.highlight-item h3 {
  font-size: 32px;
  margin-bottom: 8px;
  /* 核心渐变文字属性 */
  display: inline-block;
  /* 让渐变适配文字宽度，不占整行 */
  background: linear-gradient(135deg, #00aaff, #00ff88);
  /* 白→主题绿渐变，可自定义 */
  background-clip: text;
  /* 背景裁剪到文字 */
  -webkit-background-clip: text;
  /* 兼容Chrome/Safari */
  color: transparent;
  /* 隐藏原文字色，显示渐变 */
}

.highlight-item p {
  color: rgba(255, 255, 255, 0.6);
}

/*  banner */
.cta-section {
  padding: 80px 0;
  background: linear-gradient(90deg, #56ffb0, #00aaff);
}

.cta-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}

.cta-content h2 {
  font-size: clamp(24px, 4vw, 36px);
  color: #17171c;
  margin-bottom: 8px;
}

.cta-content p {
  color: rgba(23, 23, 28, 0.7);
}

/* 页脚版权 */
.footer {
  padding: 48px 0;
  background-color: #0d0d10;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
}

.footer p {
  color: rgba(255, 255, 255, 0.4);
  font-size: 14px;
}

/* 回到顶部 */
.scroll-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: #00ff88;
  color: #17171c;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0);
  transition: all 0.3s ease;
  z-index: 1000;
}

.scroll-to-top.show {
  opacity: 1;
  transform: scale(1);
}

.scroll-to-top:hover {
  background-color: #00dd77;
  transform: scale(1.1);
  box-shadow: 0 10px 30px rgba(0, 255, 136, 0.3);
}

.arrow-up {
  font-size: 20px;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.8s ease-out forwards;
}

.animate-fade-up {
  animation: fadeUp 0.8s ease-out forwards;
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-out;
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
  .nav-links {
    gap: 16px;
  }

  .nav-link {
    font-size: 14px;
  }

  .social-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .article-item {
    flex-direction: column;
  }

  .article-thumbnail {
    width: 100%;
    height: 200px;
  }

  .timeline::before {
    left: 32px;
  }

  .timeline-item {
    padding-left: 80px;
  }

  .timeline-node {
    left: 26px;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .cta-content {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {

  .container,
  .container-medium,
  .container-small {
    padding: 0 16px;
  }

  .nav-container {
    padding: 12px 16px;
  }

  .scroll-to-top {
    bottom: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
  }
}