:root {
  --primary-color: #2962ff;
  --secondary-color: #00bfa5;
  --background-color: #ffffff;
  --text-color: #212121;
  --font-family: 'Segoe UI', sans-serif;
  --card-bg: #f5f5f5;
  --border-color: #e0e0e0;
}

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

body {
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: var(--font-family);
  line-height: 1.6;
  min-height: 100vh;
}

header {
  background: rgba(255, 255, 255, 0.9);
  padding: 1rem 2rem;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-size: 2rem;
  font-weight: bold;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-color);
  text-decoration: none;
  position: relative;
  transition: color 0.3s ease;
  font-weight: 500;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  transition: width 0.3s ease;
}

.nav-links a:hover {
  color: var(--primary-color);
}

.nav-links a:hover::after {
  width: 100%;
}

.hero {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(41, 98, 255, 0.1), rgba(0, 191, 165, 0.1));
  z-index: -1;
}

.hero::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('assets/hero-bg.jpg') center/cover;
  z-index: -2;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

.hero h1 {
  font-size: 4rem;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 1rem;
  animation: fadeInUp 1s ease;
}

.hero p {
  font-size: 1.5rem;
  max-width: 800px;
  animation: fadeInUp 1.5s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 新增样式 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.scroll-down {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: var(--text-color);
  animation: bounce 2s infinite;
}

.scroll-down .arrow {
  width: 20px;
  height: 20px;
  border-bottom: 2px solid var(--primary-color);
  border-right: 2px solid var(--primary-color);
  transform: rotate(45deg);
  margin: 0.5rem auto 0;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0) translateX(-50%);
  }
  40% {
    transform: translateY(-20px) translateX(-50%);
  }
  60% {
    transform: translateY(-10px) translateX(-50%);
  }
}

.about {
  padding: 6rem 0;
  background: linear-gradient(135deg, rgba(41, 98, 255, 0.05), rgba(0, 191, 165, 0.05));
  border: 1px solid var(--border-color);
  border-radius: 10px;
  margin: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.about .content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  margin-top: 2rem;
}

.skills {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.skill-bar {
  background: rgba(255, 255, 255, 0.1);
  height: 10px;
  border-radius: 5px;
  overflow: hidden;
}

.skill-level {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  border-radius: 5px;
}

.blog-list {
  padding: 4rem 0;
}

.post-card {
  background: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  margin: 2rem 0;
  border: 1px solid var(--border-color);
  transition: transform 0.3s ease;
  display: flex;
}

.post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(41, 98, 255, 0.1);
}

.post-image {
  flex: 0 0 300px;
  overflow: hidden;
}

.post-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.post-card:hover .post-image img {
  transform: scale(1.1);
}

.post-content {
  flex: 1;
  padding: 2rem;
}

.post-meta {
  color: #666;
  margin: 0.5rem 0;
  font-size: 0.9rem;
}

.post-detail {
  padding: 4rem 0;
}

.post-header {
  margin-bottom: 2rem;
  text-align: center;
}

.post-content {
  line-height: 1.8;
  font-size: 1.1rem;
}

.post-content img {
  max-width: 100%;
  height: auto;
  margin: 1rem 0;
  border-radius: 5px;
}

.post-navigation {
  margin-top: 3rem;
  display: flex;
  justify-content: space-between;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.project-card {
  background: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.3s ease;
  border: 1px solid var(--border-color);
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 30px rgba(41, 98, 255, 0.2);
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: 0.5s;
}

.project-card:hover::before {
  left: 100%;
}

.project-image {
  height: 200px;
  overflow: hidden;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.project-card:hover .project-image img {
  transform: scale(1.1);
}

.project-info {
  padding: 1.5rem;
}

.btn {
  display: inline-block;
  padding: 0.8rem 2rem;
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  color: var(--text-color);
  text-decoration: none;
  border-radius: 5px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300%;
  height: 300%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.3), transparent);
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.5s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(41, 98, 255, 0.3);
}

.btn:hover::before {
  transform: translate(-50%, -50%) scale(1);
}

.btn:hover {
  opacity: 0.9;
}

.contact {
  padding: 6rem 0;
  background: var(--card-bg);
}

.contact-form {
  max-width: 600px;
  margin: 2rem auto 0;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.8rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 5px;
  color: var(--text-color);
}

.form-group textarea {
  resize: vertical;
  min-height: 150px;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* 个人信息页面样式 */
.profile {
  padding: 6rem 0;
}

.profile-content {
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 10px;
  max-width: 800px;
  margin: 2rem auto 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.profile-photo {
  flex: 0 0 300px;
  height: 400px;
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

.profile-info {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.info-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
  border: 1px solid var(--border-color);
}

.label {
  font-weight: bold;
  color: var(--primary-color);
  margin-right: 1rem;
  min-width: 80px;
}

.value {
  color: var(--text-color);
  word-break: break-word;
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
  /* 导航栏响应式 */
  nav {
    flex-direction: column;
    padding: 1rem;
  }

  .nav-links {
    flex-direction: column;
    width: 100%;
    gap: 1rem;
    margin-top: 1rem;
    text-align: center;
  }

  /* 英雄区域响应式 */
  .hero h1 {
    font-size: 2.5rem;
    padding: 0 1rem;
  }

  .hero p {
    font-size: 1.2rem;
    padding: 0 1rem;
  }

  /* 博客卡片响应式 */
  .post-card {
    flex-direction: column;
  }

  .post-image {
    flex: 0 0 200px;
  }

  /* 关于部分响应式 */
  .about .content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  /* 个人信息页面响应式 */
  .profile {
    padding: 4rem 1rem;
  }

  .profile-content {
    flex-direction: column;
    padding: 1rem;
    margin: 1rem;
  }

  .profile-photo {
    flex: none;
    width: 100%;
    height: 300px;
    margin-bottom: 1rem;
  }

  .profile-info {
    width: 100%;
  }

  .info-item {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    gap: 0.5rem;
  }

  .label {
    margin-right: 0;
  }

  /* 容器padding调整 */
  .container {
    padding: 0 1rem;
  }
}

/* 更小屏幕的优化 */
@media screen and (max-width: 480px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .post-content {
    padding: 1rem;
  }

  .about {
    margin: 1rem;
    padding: 3rem 0;
  }

  .profile {
    padding: 3rem 0.5rem;
  }

  .profile-content {
    margin: 0.5rem;
  }

  .profile-photo {
    height: 250px;
  }

  .info-item {
    padding: 0.8rem;
  }
}

/* 确保图片在移动端正确显示 */
img {
  max-width: 100%;
  height: auto;
}

/* 优化触摸屏交互 */
@media (hover: none) {
  .nav-links a:hover::after {
    width: 0;
  }

  .btn:hover {
    transform: none;
  }

  .post-card:hover {
    transform: none;
  }
}
