/* 全局样式 */
:root {
  --primary-color: #00A1D6;
  /* bilibili蓝 */
  --primary-hover: #00B5E5;
  --secondary-color: #6B7280;
  --light-bg: #F0F8FF;
  --dark-bg: #18222E;
  --text-primary: #1F2937;
  --text-secondary: #4B5563;
  --accent-blue: #00A1D6;
  --accent-green: #00C9A7;
  --accent-purple: #9370DB;
  --accent-red: #FB7299;
  /* bilibili粉 */
  --accent-yellow: #FFD700;
  --footer-height: 64px;
  /* 页脚高度 */
}

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  background-color: #FAFCFF;
  color: var(--text-primary);
  min-height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* 主要内容区域 */
.main-content {
  flex: 1;
  padding-bottom: var(--footer-height);
  /* 给页脚留出空间 */
}

/* 页脚固定在底部 */
footer {
  position: relative;
  /* 在移动端改为相对定位 */
  width: 100%;
  z-index: 10;
  display: flex;
  align-items: center;
}

/* 头像样式 */
.avatar-container {
  width: 220px;
  height: 220px;
  border-radius: 50%;
  overflow: hidden;
  background-color: #fff;
  box-shadow: 0 10px 25px rgba(0, 161, 214, 0.2);
  padding: 5px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.avatar-container:hover {
  transform: scale(1.05);
  box-shadow: 0 15px 30px rgba(0, 161, 214, 0.25);
}

.avatar-container::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  padding: 5px;
  background: linear-gradient(45deg, var(--accent-blue), var(--accent-purple), var(--accent-red));
  -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;
  opacity: 0.7;
  z-index: -1;
}

.avatar-container img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

/* 技能卡片样式 */
.skill-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem;
  background-color: white;
  border-radius: 0.8rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid rgba(0, 0, 0, 0.02);
}

.skill-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 25px rgba(0, 0, 0, 0.08);
}

/* 项目卡片样式 */
.project-card {
  background-color: white;
  border-radius: 0.8rem;
  overflow: hidden;
  /* 改回hidden确保按钮在卡片内 */
  box-shadow: 0 4px 15px rgba(0, 161, 214, 0.1);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid rgba(0, 161, 214, 0.05);
  position: relative;
  height: 520px;
  /* 增加高度确保按钮在卡片内显示 */
  display: flex;
  flex-direction: column;
  width: 350px;
  /* 进一步增加宽度让内容更醒目 */
  flex: 0 0 350px;
  /* 防止收缩 */
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 30px rgba(0, 161, 214, 0.15);
}

.project-card::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 3px;
  bottom: 0;
  left: 0;
  background: linear-gradient(to right, var(--accent-blue), var(--accent-purple));
  transform: scaleX(0);
  transform-origin: bottom right;
  transition: transform 0.4s ease;
}

.project-card:hover::after {
  transform: scaleX(1);
  transform-origin: bottom left;
}

.project-image {
  height: 240px;
  /* 进一步增加图片高度 */
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  flex: 0 0 240px;
  /* 与height保持一致 */
}

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

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

/* 可点击图片的样式 */
.project-image[data-website] {
  cursor: pointer;
  transition: all 0.3s ease;
}

.project-image[data-website]:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 15px rgba(0, 161, 214, 0.2);
}

.project-image[data-website]:active {
  transform: scale(0.98);
}

/* 为可点击图片添加悬停时的遮罩效果 */
.project-image[data-website]::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 161, 214, 0.1);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.project-image[data-website]:hover::before {
  opacity: 1;
}

/* 为可点击图片添加点击指示图标 */
.project-image[data-website]::after {
  content: '\f35d';
  /* Font Awesome 的外部链接图标 */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  background: rgba(0, 161, 214, 0.8);
  padding: 8px;
  border-radius: 50%;
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.project-image[data-website]:hover::after {
  opacity: 1;
}

.project-card .p-6 {
  flex: 1 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /* 确保按钮在底部 */
  min-height: 260px;
  /* 调整内容区域高度 */
  max-height: 260px;
  /* 限制最大高度确保按钮在卡片内 */
  overflow: hidden;
  /* 确保内容在卡片内 */
}

.project-card h3 {
  font-size: 1.2rem;
  /* 增加标题字体大小 */
  margin-bottom: 0.5rem;
  font-weight: 600;
  /* 增加字体粗细 */
}

.project-card p {
  font-size: 0.9rem;
  /* 恢复到更大的字体 */
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
  flex-grow: 1;
  /* 让描述文本占据剩余空间 */
  line-height: 1.5;
  /* 恢复到更舒适的行高 */
}

.project-card a {
  color: var(--accent-blue);
  display: inline-flex;
  align-items: center;
  font-weight: 500;
  transition: color 0.3s ease;
}

.project-card a.text-blue-600 {
  color: var(--accent-blue);
}

.project-card a.text-green-600 {
  color: var(--accent-green);
}

.project-card a.text-purple-600 {
  color: var(--accent-purple);
}

.project-card a:hover {
  text-decoration: underline;
}

/* 项目链接按钮样式 */
.project-link,
.project-link i,
.project-link svg,
.website-link,
.website-link:hover,
.bilibili-link,
/* 移除了不需要的空CSS规则 */

/* 项目轮播区域 */
.projects-slider {
  position: relative;
  width: 100%;
  overflow: visible;
  /* 确保内容不被裁剪 */
  padding: 1rem 0 2rem;
}

.projects-wrapper {
  display: flex;
  gap: 2rem;
  /* 恢复到更舒适的间距 */
  padding: 1rem;
  justify-content: flex-start;
  overflow-x: auto;
  /* 启用水平滚动 */
  scroll-behavior: smooth;
  scrollbar-width: none;
  /* Firefox */
  -ms-overflow-style: none;
  /* IE 10+ */
  min-width: 100%;
  /* 确保容器宽度足够 */
}

.projects-wrapper::-webkit-scrollbar {
  display: none;
  /* Chrome, Safari, Opera */
}

/* 滑动控制按钮 */
.slider-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}

.slider-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.3s;
  box-shadow: 0 4px 6px rgba(0, 161, 214, 0.2);
  z-index: 10;
  /* 确保按钮在最上层 */
  position: relative;
  /* 确保z-index生效 */
}

.slider-btn:hover {
  background-color: var(--primary-hover);
}

/* 联系方式样式 */
.contact-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 0.6rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  color: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.05);
  min-width: 70px;
}

.contact-link:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  background-color: rgba(255, 255, 255, 0.15);
}

.contact-link span {
  font-size: 0.8rem;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.9);
}

/* 响应式设计调整 */
@media (max-width: 768px) {
  .avatar-container {
    width: 150px;
    height: 150px;
    margin: 0 auto 1rem;
  }

  .contact-link {
    padding: 0.5rem 0.75rem;
  }

  /* 改进导航栏 */
  nav .container {
    padding: 0.5rem 1rem;
  }

  /* 改进页脚定位 */
  footer {
    position: relative;
    margin-top: 2rem;
    bottom: auto;
  }

  .main-content {
    padding-bottom: 0;
  }

  /* 改进项目卡片 - 保持固定宽度，通过滚动展示 */
  .project-card {
    height: auto;
    min-height: 420px;
    /* 增加移动端最小高度 */
    width: 280px;
    /* 固定宽度，不压缩 */
    flex: 0 0 280px;
    /* 防止收缩 */
    margin: 0;
  }

  .project-image {
    height: 180px;
    flex: 0 0 180px;
  }

  /* 调整项目轮播 - 启用水平滚动 */
  .projects-wrapper {
    gap: 1rem;
    padding: 0.5rem;
    justify-content: flex-start;
    /* 保持桌面端的滚动设置 */
  }

  /* 确保滚动控制按钮在移动端也显示 */
  .slider-controls {
    display: flex;
    margin-top: 1rem;
  }

  /* 改进头像与简介区域 */
  #about .container {
    padding: 0 1.5rem;
  }

  #about h1 {
    font-size: 1.75rem;
    text-align: center;
    margin-top: 0.5rem;
  }

  #about p {
    font-size: 1rem;
    text-align: center;
  }

  /* 社交媒体图标优化 */
  .contact-link {
    margin: 0 0.25rem;
  }
}

/* 小屏幕手机适配 */
@media (max-width: 375px) {
  .avatar-container {
    width: 120px;
    height: 120px;
  }

  #about h1 {
    font-size: 1.5rem;
  }

  .project-card {
    width: 260px;
    /* 小屏幕固定宽度 */
    flex: 0 0 260px;
    /* 防止收缩 */
    min-height: 400px;
    /* 增加小屏幕最小高度 */
  }

  .project-image {
    height: 160px;
    flex: 0 0 160px;
  }

  nav .container {
    padding: 0.4rem 0.75rem;
  }

  .contact-link {
    padding: 0.4rem 0.6rem;
    margin: 0 0.15rem;
  }
}

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

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

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }

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

.animate-pulse {
  animation: pulse 1.5s infinite;
}

section {
  animation: fadeIn 0.8s ease-out forwards;
}

/* 页面滚动指示器 */
.scroll-indicator {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(to right, var(--accent-blue), var(--accent-purple));
  z-index: 100;
  width: 0%;
  transition: width 0.2s ease;
}

/* Bilibili图标 */
.bilibili-icon {
  color: #999;
  transition: color 0.3s ease;
}

/* 闪光效果 */
.shine-effect {
  position: relative;
  overflow: hidden;
}

.shine-effect::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 20%;
  height: 200%;
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(30deg);
  transition: transform 0.7s ease;
}

.shine-effect:hover::after {
  transform: rotate(30deg) translateX(300%);
}

/* 科技感背景图案 */
.tech-pattern {
  background-image: radial-gradient(#00A1D6 1px, transparent 1px);
  background-size: 30px 30px;
  background-position: -19px -19px;
}

.tech-dots {
  background-image:
    linear-gradient(rgba(0, 161, 214, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 161, 214, 0.15) 1px, transparent 1px);
  background-size: 20px 20px;
}

.tech-circuit {
  background:
    linear-gradient(90deg, transparent 9px, #00A1D6 1px, transparent 10px),
    linear-gradient(transparent 9px, #00A1D6 1px, transparent 10px),
    radial-gradient(#00A1D6 1px, transparent 1px),
    radial-gradient(#00A1D6 1px, transparent 1px);
  background-position:
    0 0,
    0 0,
    0 0,
    10px 10px;
  background-size:
    20px 20px,
    20px 20px,
    20px 20px,
    20px 20px;
}

/* 移除旧的项目卡片链接样式 */
.project-card a {
  margin-top: auto;
  transition: all 0.3s ease;
  width: fit-content;
}

/* 图标按钮样式 */
.icon-btn {
  display: flex !important;
  /* 强制显示 */
  align-items: center;
  justify-content: center;
  width: 36px;
  /* 减小按钮尺寸 */
  height: 36px;
  border-radius: 50%;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
  visibility: visible !important;
  /* 强制可见 */
  opacity: 1 !important;
  /* 强制不透明 */
}

.icon-btn i,
.icon-btn svg {
  font-size: 16px;
  /* 减小图标尺寸 */
}

/* 按钮间距 */
.project-card .flex.gap-3 {
  margin-top: auto;
  /* 将按钮推到底部 */
  margin-bottom: 0;
  /* 确保底部没有额外边距 */
  gap: 0.5rem;
  /* 减小按钮间距以适应更窄的卡片 */
  justify-content: flex-start;
  /* 左对齐显示按钮 */
  display: flex !important;
  /* 强制显示flex */
  visibility: visible !important;
  /* 强制可见 */
  opacity: 1 !important;
  /* 强制不透明 */
  align-items: center;
  /* 垂直居中对齐 */
  padding: 0;
  /* 移除可能的内边距 */
  min-height: 36px;
  /* 确保按钮区域有足够高度 */
}

.website-icon {
  background-color: rgba(59, 130, 246, 0.1);
  color: #3B82F6;
}

.website-icon:hover {
  background-color: rgba(59, 130, 246, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(59, 130, 246, 0.2);
}

.bilibili-icon {
  background-color: rgba(251, 114, 153, 0.1);
  color: #FB7299;
}

.bilibili-icon:hover {
  background-color: rgba(251, 114, 153, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(251, 114, 153, 0.2);
}

/* 修复图标样式冲突 */
.footer-bilibili-icon {
  width: 1.25rem !important;
  height: 1.25rem !important;
  fill: currentColor;
}

/* 确保项目卡片中所有SVG图标大小一致 */
.project-card svg {
  width: 20px;
  height: 20px;
}

/* 小红书按钮样式 */
.xiaohongshu-icon {
  background-color: rgba(254, 44, 85, 0.1);
  color: #FE2C55;
}

.xiaohongshu-icon:hover {
  background-color: rgba(254, 44, 85, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(254, 44, 85, 0.2);
}

/* ===========================================
   自定义样式 - 替代TailwindCSS
   =========================================== */

/* 基础重置和字体 */
.font-sans {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 布局容器 */
.container {
  max-width: 1200px;
  width: 100%;
}

.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

/* 内边距 */
.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.py-3 {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.py-6 {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}

.py-12 {
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.p-6 {
  padding: 1.5rem;
}

/* 外边距 */
.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mb-8 {
  margin-bottom: 2rem;
}

/* Flexbox */
.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-3 {
  gap: 0.75rem;
}

/* 定位 */
.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.sticky {
  position: sticky;
}

.top-0 {
  top: 0;
}

.inset-0 {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

/* 层级 */
.z-10 {
  z-index: 10;
}

/* 尺寸 */
.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.w-5 {
  width: 1.25rem;
}

.h-5 {
  height: 1.25rem;
}

/* 背景颜色 */
.bg-white {
  background-color: #ffffff;
}

.bg-gray-50 {
  background-color: #f9fafb;
}

.bg-blue-100 {
  background-color: #dbeafe;
}

.bg-green-100 {
  background-color: #dcfce7;
}

.bg-purple-100 {
  background-color: #f3e8ff;
}

/* 背景渐变 */
.bg-gradient-to-br {
  background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
}

.bg-gradient-to-r {
  background-image: linear-gradient(to right, var(--tw-gradient-stops));
}

.from-blue-50 {
  --tw-gradient-from: #eff6ff;
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(239, 246, 255, 0));
}

.via-indigo-50 {
  --tw-gradient-stops: var(--tw-gradient-from), #eef2ff, var(--tw-gradient-to, rgba(238, 242, 255, 0));
}

.to-blue-100 {
  --tw-gradient-to: #dbeafe;
}

.from-gray-50 {
  --tw-gradient-from: #f9fafb;
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(249, 250, 251, 0));
}

.to-blue-50 {
  --tw-gradient-to: #eff6ff;
}

.from-gray-800 {
  --tw-gradient-from: #1f2937;
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(31, 41, 55, 0));
}

.via-gray-900 {
  --tw-gradient-stops: var(--tw-gradient-from), #111827, var(--tw-gradient-to, rgba(17, 24, 39, 0));
}

.to-blue-900 {
  --tw-gradient-to: #1e3a8a;
}

.from-accent-blue {
  --tw-gradient-from: #00a1d6;
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(0, 161, 214, 0));
}

.via-accent-purple {
  --tw-gradient-stops: var(--tw-gradient-from), #8b5cf6, var(--tw-gradient-to, rgba(139, 92, 246, 0));
}

.to-accent-red {
  --tw-gradient-to: #ef4444;
}

/* 文字颜色 */
.text-white {
  color: #ffffff;
}

.text-gray-300 {
  color: #d1d5db;
}

.text-gray-600 {
  color: #4b5563;
}

.text-gray-800 {
  color: #1f2937;
}

/* 文字大小和粗细 */
.text-xl {
  font-size: 1.25rem;
  line-height: 1.75rem;
}

.text-4xl {
  font-size: 2.25rem;
  line-height: 2.5rem;
}

.font-bold {
  font-weight: 700;
}

/* 阴影 */
.shadow-sm {
  box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

/* 溢出 */
.overflow-hidden {
  overflow: hidden;
}

/* 对象拟合 */
.object-contain {
  object-fit: contain;
}

/* 透明度 */
.opacity-5 {
  opacity: 0.05;
}

.opacity-10 {
  opacity: 0.1;
}

.opacity-20 {
  opacity: 0.2;
}

/* 光标 */
.cursor-pointer {
  cursor: pointer;
}

/* 悬停效果 */
.hover\:shadow-xl:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.group:hover .group-hover\:text-blue-500 {
  color: #3b82f6;
}

.group:hover .group-hover\:text-gray-800 {
  color: #1f2937;
}

.group:hover .group-hover\:text-red-500 {
  color: #ef4444;
}

.group:hover .group-hover\:text-blue-400 {
  color: #60a5fa;
}

.group:hover .group-hover\:text-black {
  color: #000000;
}

.group:hover .group-hover\:text-red-600 {
  color: #dc2626;
}

/* 响应式设计 */
@media (min-width: 768px) {
  .md\:flex-row {
    flex-direction: row;
  }

  .md\:w-1\/3 {
    width: 33.333333%;
  }

  .md\:w-2\/3 {
    width: 66.666667%;
  }

  .md\:pl-12 {
    padding-left: 3rem;
  }

  .md\:mb-0 {
    margin-bottom: 0;
  }
}

/* 底部边框渐变 */
.bottom-0 {
  bottom: 0;
}

.h-1 {
  height: 0.25rem;
}

/* 分组样式 */
.group {
  position: relative;
}

/* SVG图标样式 - 替代Font Awesome */
.icon-svg {
  width: 1em;
  height: 1em;
  display: inline-block;
  fill: currentColor;
  vertical-align: middle;
}

.icon-svg-lg {
  width: 1.25rem;
  height: 1.25rem;
}

/* SVG图标定义 - 预留用于未来扩展 */

/* ===========================================
   自定义样式结束
   =========================================== */