* { margin: 0; padding: 0; box-sizing: border-box; }

/* 使用原始背景图片设置 */
body {
  background: url('./images/bg.jpg') no-repeat center center fixed;
  background-size: cover;
  color: rgba(11, 11, 11, 0.8);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  position: relative;
  overflow: hidden;
}

/* 开场动画 */
#intro {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(18, 18, 18, 0.8);
  z-index: 999;
  overflow: hidden;
}

#intro h1 {
  font-size: 8rem;
  font-weight: 700;
  color: #ffffff;
  opacity: 0;
  text-shadow: 0 0 15px rgba(66, 159, 255, 0.8);
  animation: fadeInOut 3s ease forwards;
  position: relative;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: scale(0.8) translateY(20px); }
  20% { opacity: 1; transform: scale(1.1) translateY(0); }
  60% { opacity: 1; transform: scale(1) translateY(0); }
  100% { opacity: 0; transform: scale(0.8) translateY(-20px); }
}

/* 主内容区域 */
#main {
  display: grid;
  width: 80%;
  max-width: 1400px;
  margin: 60px auto;
  height: calc(100vh - 120px);
  grid-template-columns: minmax(250px, 0.6fr) minmax(0, 2.5fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 20px;
  opacity: 0;
  animation: fadeInMain 1.5s ease forwards;
  animation-delay: 0s;
  position: relative;
  display: none; /* 初始隐藏 */
}

@keyframes fadeInMain {
  to { opacity: 1; }
}

/* 卡片样式 */
.card {
  background: rgba(18, 18, 18, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 16px;
  padding: 20px;
  backdrop-filter: blur(10px); /* 玻璃模糊效果 */
  color: white;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15), 
             0 0 3px rgba(255, 255, 255, 0.1) inset;
  transition: all 0.3s ease;
}

/* 鼠标悬停效果 */
.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3), 
              0 0 8px rgba(255, 255, 255, 0.1) inset;
}

/* 卡片头部样式 */
.card h2, .card h3 {
  margin-bottom: 15px;
  color: #fff;
  font-weight: 600;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  position: relative;
  padding-bottom: 5px;
}

.card h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 2px;
  background: #3498db;
  border-radius: 2px;
}

/* 内容区域文本样式 */
.card p, .card li {
  margin: 8px 0;
  font-size: 0.95rem;
  line-height: 1.5;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* 网格区域分配 */
#profile { grid-column: 1; grid-row: 1; }
#contacts { grid-column: 1; grid-row: 2; }
#todo { grid-column: 1; grid-row: 3; }
#projects { 
  grid-column: 2;
  grid-row: 1 / span 3;
  position: relative;
  overflow: hidden;
}

/* 个人资料部分 */
#profile {
  display: flex;
  align-items: center;
  flex-direction: column;
  text-align: center;
}

#profile img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin-bottom: 15px;
  border: 3px solid rgba(255,255,255,0.2);
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

/* 联系信息 */
#contacts ul {
  list-style: none;
  margin-top: 5px;
}

#contacts li {
  margin-bottom: 12px;
}

#contacts a {
  color: #5dade2;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

#contacts a:hover {
  color: #fff;
  text-decoration: underline;
}

/* 待办事项列表样式 */
#todo {
  overflow: hidden;
}

#todo-container {
  height: 100%;
  overflow-y: auto;
  padding-right: 10px;
}

#todo ul {
  list-style: none;
  padding: 0;
}

.todo-item {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px dashed rgba(255,255,255,0.1);
}

.todo-item:last-child {
  border-bottom: none;
}

.todo-item input {
  margin-right: 12px;
}

.todo-item label {
  flex-grow: 1;
  cursor: pointer;
}

.todo-item input:checked + label {
  text-decoration: line-through;
  opacity: 0.7;
}

/* 自定义滚动条 */
#todo-container::-webkit-scrollbar {
  width: 6px;
}

#todo-container::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
}

#todo-container::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
}

/* 项目区域 */
#projects .slide {
  position: absolute;
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-size: 1.25rem;
  padding: 40px;
  text-align: center;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.8s ease;
}

#projects .active {
  opacity: 1;
  transform: translateX(0);
}

#projects .prev {
  opacity: 0;
  transform: translateX(-100%);
}

.project-title {
  font-size: 2rem;
  margin-bottom: 25px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 10px rgba(0,0,0,0.5);
}

.project-description {
  max-width: 80%;
  margin: 0 auto 30px;
  font-size: 1.1rem;
  line-height: 1.7;
}

.project-tech {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 30px;
}

.tech-tag {
  background: rgba(52, 152, 219, 0.3);
  border: 1px solid rgba(41, 128, 185, 0.5);
  border-radius: 20px;
  padding: 6px 15px;
  font-size: 0.85rem;
}

.project-link {
  background: linear-gradient(45deg, #3498db, #2ecc71);
  color: white;
  padding: 12px 35px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.05rem;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.project-link:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.project-link-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
}

/* 导航点 */
.slide-nav {
  position: absolute;
  bottom: 15px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.nav-dot {
  width: 10px;
  height: 10px;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.nav-dot.active {
  background: white;
  transform: scale(1.2);
}

/* 音乐播放器样式 */
.aplayer-fixed {
  position: fixed !important;
  bottom: 20px;
  right: -100px;
  transition: right 0.5s ease;
  opacity: 0.6;
}

.aplayer-fixed:hover {
  right: 20px;
  opacity: 1;
}

/* 响应式调整 */
@media (max-width: 1000px) {
  body {
    overflow: auto; /* 允许整个页面滚动 */
  }
  
  #main {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    height: auto; /* 高度自适应 */
    min-height: calc(100vh - 40px); /* 最小高度 */
    margin: 20px auto; /* 减小边距 */
    gap: 15px; /* 增加卡片间距 */
    overflow: visible;
  }
  #profile img {
    width: 70px;
    height: 70px;
  }
  #profile { grid-row: 1; grid-column: 1; }
  #contacts { grid-row: 2; grid-column: 1; }
  #todo { grid-row: 3; grid-column: 1; }
  #projects { grid-row: 4; grid-column: 1; height: 80vh; }
  
  .aplayer-fixed {
    width: calc(100% - 40px);
    right: 20px;
    left: auto;
    opacity: 0.8;
  }
  .aplayer-fixed:hover {
    right: 20px;
    opacity: 1;
  }
}