/* 全局样式 */
:root {
  --primary-color: #49b1f5;
  --secondary-color: #FF0066;
  --text-color: #4c4948;
  --heading-color: #344c67;
  --bg-color: #f5f5f5;
  --card-bg: #ffffff;
  --shadow: 0 4px 12px rgba(7, 17, 27, .1);
  --transition: all 0.3s ease;
  --border-radius: 8px;
  --font-main: 'Roboto', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-color);
  background-color: var(--bg-color);
  overflow-x: hidden;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--secondary-color);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--heading-color);
  font-weight: 600;
  margin: 1.5rem 0 1rem;
  position: relative;
}

h2 {
  padding-left: 1rem;
  font-size: 1.8rem;
  border-left: 4px solid var(--primary-color);
}

hr {
  position: relative;
  margin: 2rem auto;
  width: 100%;
  border: 0;
  height: 2px;
  background-image: linear-gradient(to right, rgba(0, 0, 0, 0), var(--primary-color), rgba(0, 0, 0, 0));
}

img {
  max-width: 100%;
  height: auto;
  transition: var(--transition);
  border-radius: var(--border-radius);
}

/* 布局 */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

.layout {
  display: flex;
  flex-wrap: wrap;
  margin-top: 1rem;
  gap: 2rem; /* 增加两列之间的间距 */
}

.main-content {
  flex: 1;
  min-width: 0;
}

.sidebar {
  width: 300px;
}

/* 项目导航栏 */
.project-nav {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 1rem 0;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.project-nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.project-nav-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
  color: white;
}

.project-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.project-nav-links a {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.project-nav-links a:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  color: white;
}

.project-nav-links a i {
  margin-right: 0.5rem;
}

/* 导航栏 */
.header {
  position: relative;
  height: 20rem;
  background-color: var(--primary-color);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  margin-top: -2rem;
  overflow: hidden;
}

.header-content {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  transform: translateY(-50%);
  text-align: center;
  color: white;
  padding: 0 1rem;
  z-index: 1;
}

.header-content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header-content .typed-text {
  font-size: 1.3rem;
  margin-top: 1rem;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.3);
}

/* 卡片样式 */
.card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  box-shadow: 0 8px 16px rgba(7, 17, 27, .2);
  transform: translateY(-3px);
}

.card-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(0, 0, 0, .05);
  font-weight: 600;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
}

.card-header i {
  margin-right: 0.5rem;
  color: var(--primary-color);
}

.card-body {
  padding: 1.5rem;
}

/* 个人资料卡片 */
.profile-card .avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  display: block;
  border: 3px solid white;
  box-shadow: 0 0 10px rgba(0, 0, 0, .1);
  transition: var(--transition);
}

.profile-card .avatar:hover {
  transform: rotate(360deg);
  transition: transform 1s ease-in-out;
}

.profile-card .name {
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 0.5rem;
}

.profile-card .bio {
  text-align: center;
  color: #666;
  margin-bottom: 1rem;
}

/* 技能条 */
.skill-bars .skill-bar {
  position: relative;
  margin-bottom: 1.5rem;
}

.skill-bars .skill-bar-name {
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
}

.skill-bars .skill-bar-container {
  height: 10px;
  background-color: #eee;
  border-radius: 5px;
  overflow: hidden;
}

.skill-bars .skill-bar-fill {
  height: 100%;
  border-radius: 5px;
  transition: width 1s ease-in-out;
}

/* 相册样式 */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.gallery-item img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

/* 社交链接 */
.social-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.social-links a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #f5f5f5;
  color: var(--text-color);
  transition: var(--transition);
}

.social-links a:hover {
  background-color: var(--primary-color);
  color: white;
  transform: translateY(-3px);
}

.social-links img {
  width: 30px;
  height: 30px;
  border-radius: 0;
}

/* 页脚 */
.footer {
  text-align: center;
  padding: 2rem 0;
  background: linear-gradient(to right, #f2f2f2, white, #f2f2f2);
  margin-top: 3rem;
}

.copyright {
  color: #666;
  font-size: 0.9rem;
}

/* 动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* 响应式设计 */
@media (max-width: 992px) {
  .layout {
    flex-direction: column;
    gap: 1.5rem; /* 移动端减少间距 */
  }
  
  .main-content {
    margin-right: 0;
    margin-bottom: 1.5rem;
  }
  
  .sidebar {
    width: 100%;
  }
  
  .header {
    height: 15rem;
  }
  
  .header-content h1 {
    font-size: 2rem;
  }
  
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
  
  .project-nav-content {
    flex-direction: column;
    text-align: center;
  }
  
  .project-nav-links {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .header {
    height: 12rem;
  }
  
  .header-content h1 {
    font-size: 1.8rem;
  }
  
  .header-content .typed-text {
    font-size: 1rem;
  }
  
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .project-nav-links a {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
}

/* 雪花动画 */
.snowflake {
  color: #fff;
  font-size: 1em;
  position: fixed;
  top: -10%;
  z-index: 9999;
  animation: fall linear infinite;
}

@keyframes fall {
  to {
    transform: translateY(100vh);
  }
}

/* 视频响应式容器 */
.video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 宽高比 */
  height: 0;
  overflow: hidden;
  margin: 1rem 0;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, var(--secondary-color), var(--primary-color));
}