/* 全局变量 */
:root {
  /* 深色主题（默认） */
  --primary-color: #00f0ff;
  --primary-gradient: linear-gradient(135deg, #00f0ff, #8a2be2);
  --secondary-color: #8a2be2;
  --text-color: #e0e0e0;
  --bg-color: #0a0a14;
  --card-bg: #12121e;
  --header-font: 'Orbitron', 'Microsoft YaHei', '微软雅黑', sans-serif;
  --body-font: 'Rajdhani', 'Microsoft YaHei', '微软雅黑', sans-serif;
  --transition: all 0.3s ease;
  --shadow: 0 0 15px rgba(0, 240, 255, 0.7);
  --border-radius: 12px;
  
  /* 优化的间距系统 - 基于黄金比例 */
  --space-unit: 1.618rem;
  --space-xs: calc(var(--space-unit) * 0.382); /* ~0.62rem */
  --space-sm: calc(var(--space-unit) * 0.618); /* ~1rem */
  --space-md: var(--space-unit); /* 1.618rem */
  --space-lg: calc(var(--space-unit) * 1.618); /* ~2.62rem */
  --space-xl: calc(var(--space-unit) * 2.618); /* ~4.24rem */
  --space-xxl: calc(var(--space-unit) * 4.236); /* ~6.85rem */
  
  /* 统一的section间距 */
  --section-padding: var(--space-xxl) 0;
  --section-margin: var(--space-xl) 0;
  --section-header-margin: var(--space-xl);
  
  /* 卡片和组件间距 */
  --card-gap: var(--space-lg);
  --card-padding: var(--space-lg);
  --button-gap: var(--space-sm);
  
  /* 主题切换过渡 */
  --theme-transition: background-color 0.3s ease, color 0.3s ease;
}

/* 浅色主题 */
[data-theme="light"] {
  --primary-color: #0066cc;
  --primary-gradient: linear-gradient(135deg, #0066cc, #4a90e2);
  --secondary-color: #4a90e2;
  --text-color: #333333;
  --bg-color: #f5f5f5;
  --card-bg: #ffffff;
  --shadow: 0 0 15px rgba(0, 102, 204, 0.3);
}

/* 基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--body-font);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--header-font);
  margin-bottom: 1rem;
  line-height: 1.2;
}

h1 {
  font-size: 3.5rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
}

p {
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

a {
  color: var(--text-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-color);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

section {
  padding: var(--section-padding);
  margin: var(--section-margin);
}

/* 确保第一个section不会与导航栏重叠 */
section:first-of-type {
  margin-top: 0;
  padding-top: calc(var(--space-xxl) + 80px); /* 导航栏高度 + 额外间距 */
}

/* 最后一个section的底部间距 */
section:last-of-type {
  margin-bottom: 0;
  padding-bottom: var(--space-xxl);
}

/* 导航栏 */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background-color: rgba(18, 18, 18, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: var(--transition);
}

#navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  min-height: 80px; /* 确保导航栏有固定高度 */
}

.logo {
  position: relative;
  overflow: hidden;
  display: inline-block;
}

.nav-logo {
  height: 30px;
  width: auto;
  vertical-align: middle;
  transition: var(--transition);
  background-color: transparent;
  object-fit: contain;
  border-radius: 4px;
}

.logo::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary-gradient);
  transform: translateX(-100%);
  transition: var(--transition);
}

.logo:hover::after {
  transform: translateX(0);
}

.nav-links {
  display: flex;
  gap: var(--space-lg); /* 使用统一的间距变量 */
}

.nav-item {
  position: relative;
  padding: 5px 0;
}

.nav-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--primary-gradient);
  transform: scaleX(0);
  transition: var(--transition);
  transform-origin: right;
}

.nav-item:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* 主题切换按钮 */
.theme-toggle {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 2px solid var(--primary-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--theme-transition);
}

.theme-toggle:hover {
  transform: scale(1.1);
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
  fill: var(--primary-color);
  transition: var(--theme-transition);
}

/* 太阳图标在深色模式下显示白色 */
.theme-toggle .sun-icon {
  fill: #ffffff;
}

/* 月亮图标保持主题色 */
.theme-toggle .moon-icon {
  fill: var(--primary-color);
}

/* 主题切换动画 */
@keyframes themeSwitch {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.theme-toggle.active {
  animation: themeSwitch 0.3s ease;
}

.icon {
  width: 24px;
  height: 24px;
  fill: var(--text-color);
  transition: var(--transition);
}

.icon:hover {
  fill: var(--primary-color);
}

.social-links .icon {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: invert(1);
  transition: var(--transition);
}

.social-links .icon:hover {
  filter: invert(0.8) sepia(1) saturate(5) hue-rotate(155deg);
}

/* Hero部分 */
.hero {
  position: relative;
  height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding-top: 80px;
  margin-bottom: 0; /* 移除额外margin，使用统一的section间距 */
}

#particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.hero-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl); /* 使用统一的间距变量 */
}

.hero-text {
  flex: 1;
  max-width: 600px;
}

.hero-text h1 {
  font-size: 3.5rem;
  margin-bottom: var(--space-xs);
}

.hero-text h2 {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  color: var(--text-color);
}

.hero-text p {
  font-size: 1.2rem;
  margin-bottom: var(--space-lg);
  opacity: 0.9;
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  gap: var(--button-gap);
  margin-top: var(--space-lg);
  flex-wrap: wrap;
}

.btn {
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--border-radius);
  font-family: var(--header-font);
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: var(--transition);
  cursor: pointer;
  border: none;
  display: inline-block;
  min-width: 140px;
  text-align: center;
}

.primary-btn {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(0, 240, 255, 0.4);
}

.primary-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 240, 255, 0.6);
  color: white;
}

.secondary-btn {
  background: transparent;
  color: var(--text-color);
  border: 2px solid var(--primary-color);
}

.secondary-btn:hover {
  background-color: rgba(0, 240, 255, 0.1);
  color: var(--primary-color);
}

.hero-image {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-container {
  width: 300px;
  height: 300px;
  position: relative;
  animation: float 6s ease-in-out infinite;
}

.hero-logo {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 20px rgba(0, 238, 255, 0.329));
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

/* 技能卡片部分 */
.section-header {
  text-align: center;
  margin-bottom: var(--section-header-margin);
}

.section-header h2 {
  position: relative;
  display: inline-block;
  margin-bottom: 15px;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: calc(-1 * var(--space-xs));
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 3px;
  background: var(--primary-gradient);
  border-radius: 2px;
}

.section-header p {
  color: rgba(244, 244, 244, 0.7);
  max-width: 600px;
  margin: 0 auto;
}

.skills-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--card-gap);
  margin-top: var(--space-lg);
}

.skill-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  padding: var(--card-padding);
  text-align: center;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow);
}

.skill-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  border-color: rgba(255, 94, 98, 0.3);
}

.skill-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

.skill-card h3 {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
  color: var(--primary-color);
}

.skill-card p {
  font-size: 1rem;
  color: rgba(244, 244, 244, 0.8);
}



/* 页脚样式开始 */


/* 页脚 */
footer {
  background-color: rgba(18, 18, 18, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 60px 0 20px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-xl);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-md);
  margin-bottom: var(--space-xl);
}

.footer-logo {
  margin-bottom: var(--space-md);
}

.footer-logo-container {
  margin-bottom: var(--space-xs);
}

.footer-nav-logo {
  height: 30px;
  width: auto;
  margin-bottom: 5px;
  background-color: transparent;
  object-fit: contain;
  border-radius: 4px;
}

.footer-logo p {
  font-size: 1.1rem;
  margin-bottom: 10px;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  max-width: 300px;
}

.footer-links {
  display: flex;
  gap: var(--space-xxl);
}

.footer-section h4 {
  font-size: 1.2rem;
  margin-bottom: var(--space-md);
  color: var(--text-color);
  position: relative;
}

.footer-section h4::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 30px;
  height: 2px;
  background: var(--primary-gradient);
}

.footer-section a {
  display: block;
  margin-bottom: var(--space-xs);
  color: rgba(244, 244, 244, 0.7);
  transition: var(--transition);
}

.footer-section a:hover {
  color: var(--primary-color);
  transform: translateX(5px);
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
}

/* 备案信息通用样式 */
.icp-info,
.beian-info {
  width: 100%;
  text-align: center;
  margin-top: var(--space-xs);
  margin-bottom: 0;
  font-size: 0.85rem;
  color: rgba(244, 244, 244, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.icp-info a,
.beian-info a {
  color: rgba(244, 244, 244, 0.5);
  text-decoration: none;
  transition: var(--transition);
}

.icp-info a:hover,
.beian-info a:hover {
  color: rgba(244, 244, 244, 0.7);
}

.beian-info img {
  height: 1em;
  width: auto;
  vertical-align: middle;
  margin-right: 3px;
}

.social-links {
  display: flex;
  gap: var(--space-sm);
}

/* 响应式设计 - 添加更多断点和优化 */

/* 大屏幕平板电脑 */
@media (max-width: 992px) {
  :root {
    --space-unit: 1.4rem; /* 减小基础单位 */
    --section-padding: calc(var(--space-unit) * 3.5) 0;
    --section-margin: calc(var(--space-unit) * 2.5) 0;
    --section-header-margin: calc(var(--space-unit) * 2.2);
    --card-gap: calc(var(--space-unit) * 1.8);
    --card-padding: calc(var(--space-unit) * 1.5);
  }
  
  .hero-text h1 {
    font-size: 3rem;
  }
  
  .hero-text h2 {
    font-size: 2.2rem;
  }
  
  /* 恢复原有的样式 */
  .hero-content {
    flex-direction: column;
    text-align: center;
  }
  
  .hero-text {
    max-width: 100%;
  }
  
  .hero-buttons {
    justify-content: center;
  }
  

  
  .footer-content {
    flex-direction: column;
    gap: var(--space-lg);
  }
  
  .footer-links {
    width: 100%;
    justify-content: space-between;
    gap: var(--space-xl);
  }
}

/* 平板电脑和小屏幕设备 */
@media (max-width: 768px) {
  :root {
    --space-unit: 1.2rem; /* 进一步减小基础单位 */
    --section-padding: calc(var(--space-unit) * 3) 0;
    --section-margin: calc(var(--space-unit) * 2) 0;
    --section-header-margin: calc(var(--space-unit) * 1.8);
    --card-gap: calc(var(--space-unit) * 1.5);
    --card-padding: var(--space-unit);
  }
  
  #navbar .container {
    flex-direction: column;
    gap: 15px;
  }
  
  .nav-links {
    width: 100%;
    justify-content: center;
  }
  
  .nav-right {
    width: 100%;
    justify-content: center;
  }
  
  .hero {
    padding-top: 120px;
    height: auto; /* 允许hero部分高度自适应 */
    min-height: 100vh; /* 确保最小高度仍为全屏 */
  }
  
  .logo-container {
    width: 200px;
    height: 200px;
  }
  
  .skills-container,
  .projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); /* 调整网格列宽 */
  }
  
  .footer-links {
    flex-direction: column;
    gap: var(--space-lg);
  }
  
  .section-header h2 {
    font-size: 2rem;
  }
  
  .container {
    padding: 0 var(--space-sm); /* 减小容器内边距 */
  }
}

/* 手机设备 */
@media (max-width: 480px) {
  :root {
    --space-unit: 1rem; /* 大幅减小基础单位 */
    --section-padding: calc(var(--space-unit) * 2.5) 0;
    --section-margin: calc(var(--space-unit) * 1.5) 0;
    --section-header-margin: calc(var(--space-unit) * 1.5);
    --card-gap: var(--space-unit);
    --card-padding: calc(var(--space-unit) * 0.8);
  }
  
  h1 {
    font-size: 2.2rem;
  }
  
  h2 {
    font-size: 1.8rem;
  }
  
  .hero-text p {
    font-size: 1rem;
  }
  
  .hero-buttons {
    flex-direction: column;
    width: 100%;
  }
  
  .btn {
    width: 100%;
    text-align: center;
  }
  
  .footer-bottom {
    flex-direction: column-reverse;
    text-align: center;
  }
  
  .social-links {
    justify-content: center;
  }
  
  .project-image {
    height: 180px; /* 减小项目图片高度 */
  }
  
  /* 导航栏在手机上的优化 */
  .nav-item {
    font-size: 0.9rem; /* 减小导航链接字体大小 */
  }
  

}

/* 超小屏幕设备 */
@media (max-width: 360px) {
  :root {
    --space-unit: 0.8rem; /* 最小基础单位 */
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .hero-text h2 {
    font-size: 1.3rem;
  }
  
  .filter-tags button {
    font-size: 0.9rem;
  }
  
  .logo-container {
    width: 150px;
    height: 150px;
  }
  
  /* 超小屏幕上的额外优化 */
  .project-title {
    font-size: 1.3rem;
  }
  
  .project-description {
    font-size: 0.9rem;
  }
  
  .skill-card h3 {
    font-size: 1.3rem;
  }
}

/* 移动端导航菜单 */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
}

.mobile-menu-btn span {
  display: block;
  width: 25px;
  height: 2px;
  background: var(--text-color);
  margin: 5px 0;
  transition: var(--transition);
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    background: rgba(18, 18, 18, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    flex-direction: column;
    align-items: center;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-item {
    width: 100%;
    text-align: center;
    padding: 15px 0;
  }
}