/* CSS重置和基础变量 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #4361ee;
  --secondary-color: #3a0ca3;
  --accent-color: #4cc9f0;
  --dark-color: #1a1a2e;
  --light-color: #f8f9fa;
  --gray-color: #6c757d;
  --border-radius: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  line-height: 1.6;
  color: #333;
  overflow-x: hidden;
}

/* 模块划分 */
.section {
  text-align: center;
  color: white;
}

/* 首屏 */
.home-section {
  background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
  color: white;
  text-align: center;
}

.fa-eye {
  color: var(--primary-color) !important;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  transform: translateY(0);
  opacity: 1;
  transition: var(--transition);
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.25rem;
  opacity: 0.9;
  margin-bottom: 2rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  padding: 1rem 2rem;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: white;
  color: var(--primary-color);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.btn-secondary {
  background: transparent;
  border: 2px solid white;
  color: white;
}

.btn-secondary:hover {
  background: white;
  color: var(--primary-color) !important;
}

/* 页面区域 */
.page-section {
  min-height: 100vh;
  scroll-snap-align: start;
  position: relative;
  padding: 80px 5% 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

/* 作品展示区 */
.portfolio-section {
  background: var(--light-color);
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title h2 {
  font-size: 2.5rem;
  color: var(--dark-color);
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;
}

.section-title h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--primary-color);
  border-radius: 2px;
}

.section-subtitle {
  color: var(--gray-color);
  max-width: 600px;
  margin: 0 auto;
}

/* 作品分类导航 */
.portfolio-filter {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--primary-color);
  background: transparent;
  color: var(--primary-color);
  border-radius: 25px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

/* 作品网格 */
.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 30px;
  margin-bottom: 40px;
  padding: 30px 0;
}

.portfolio-item {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
}

.portfolio-item:nth-child(1) {
  animation-delay: 0.1s;
}

.portfolio-item:nth-child(2) {
  animation-delay: 0.2s;
}

.portfolio-item:nth-child(3) {
  animation-delay: 0.3s;
}

.portfolio-item:nth-child(4) {
  animation-delay: 0.4s;
}

.portfolio-item:nth-child(5) {
  animation-delay: 0.5s;
}

.portfolio-item:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.item-image-wrapper {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.item-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}

.portfolio-item:hover .item-image {
  transform: scale(1.05);
}

.item-content {
  padding: 1.5rem;
  text-align: left;
}

.item-category {
  color: var(--accent-color);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.item-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--dark-color);
}

.item-description {
  color: var(--gray-color);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.view-more {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.view-more:hover {
  gap: 1rem;
}

.view-more i {
  transition: transform 0.3s ease;
}

.view-more:hover i {
  transform: translateX(5px);
}

/* 作品详情页 */
.project-detail {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  z-index: 2000;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-detail.active {
  transform: translateX(0);
}

.detail-header {
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
  padding: 1.5rem 5%;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.detail-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--gray-color);
  cursor: pointer;
  padding: 0.5rem;
  transition: var(--transition);
}

.detail-close:hover {
  color: var(--dark-color);
  transform: rotate(90deg);
}

.detail-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 5%;
}

.detail-main-image {
  width: 100%;
  object-fit: contain;
  margin-bottom: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
}

.detail-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--dark-color);
}

.detail-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  margin: 2rem 0;
  padding: 2rem;
  background: var(--light-color);
  border-radius: var(--border-radius);
}

.info-item h4 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.detail-description {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--dark-color);
  margin-bottom: 3rem;
}

.overview-content p {
  margin: .5rem 0;
}

.detail-description h3 {
  margin-bottom: .5rem;
}

/* 个人优势区 */
#advantages {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: white;
}

#advantages .section-title h2,
#contact .section-title h2 {
  color: white;
}

.advantages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.advantage-card {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  transition: transform 0.3s ease;
}

.advantage-card:hover {
  transform: translateY(-10px);
  background: rgba(255, 255, 255, 0.15);
}

.advantage-icon {
  font-size: 3rem;
  color: #4cc9f0;
  margin-bottom: 1.5rem;
}

.advantage-card h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

/* 联系我 */
.contact-section {
  background: linear-gradient(135deg, #3a0ca3 0%, #4361ee 100%);
  color: white;
  text-align: center;
}

#contact .fas {
  color: white !important;
}

#contact .section-subtitle {
  color: rgba(255, 255, 255, 0.5)
}

.contact-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 3rem auto;
}

.contact-item {
  padding: 2rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--border-radius);
  backdrop-filter: blur(10px);
  transition: var(--transition);
}

.contact-item:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.15);
}

.contact-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--accent-color);
}

#contact .tips {
  position: absolute;
  bottom: 5%;
  left: 50%;
  transform: translateX(-50%);
  opacity: .4;
}

/* 侧边指示 */
#fp-nav ul li a span,
.fp-slidesNav ul li a span {
  width: 8px;
  height: 8px;
  margin: -2px 0 0 -4px
}

#fp-nav ul li a span,
.fp-slidesNav ul li a span {
  background-color: rgba(67, 97, 238, 0.3);
}

#fp-nav ul li a.active span,
#fp-nav ul li:hover a.active span,
.fp-slidesNav ul li a.active span,
.fp-slidesNav ul li:hover a.active span {
  background-color: rgba(67, 97, 238, 1)
}

/* 作品容器 */
.portfolio-container {
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

/* 加载状态 */
.loading,
.empty-state,
.error-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #3498db;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

/* 空状态提示优化 */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

/* 分页样式 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 30px 0 20px;
  gap: 10px;
}

.pagination-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f5f5f5;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #333;
  font-size: 14px;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-numbers {
  display: flex;
  gap: 8px;
}

.page-number {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #f5f5f5;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #333;
  font-size: 14px;
}

.page-number:hover {
  background: #e9e9e9;
}

.page-number.active {
  background: var(--primary-color);
  color: white;
  font-weight: 600;
}

.pagination-info {
  text-align: center;
  color: #666;
  font-size: 14px;
  margin-bottom: 30px;
}

.pagination-info span {
  font-weight: 600;
  color: #333;
}

/* 返回顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--primary-color);
  transform: translateY(-5px);
}

/* Toast提示 */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--dark-color);
  color: white;
  padding: 12px 24px;
  border-radius: 25px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* 动画关键帧 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* ===== 响应式优化 ===== */

/* 平板设备 (768px-1024px) */
@media (max-width: 1024px) {
  .portfolio-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
  }

  .hero-title {
    font-size: clamp(2.2rem, 4vw, 3rem);
  }

  .hero-subtitle {
    font-size: 1.1rem;
    max-width: 90%;
  }

  .advantages-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 1rem;
  }

  .contact-info {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    max-width: 90%;
  }

  .detail-info {
    grid-template-columns: repeat(2, 1fr);
    padding: 1.5rem;
  }
}

/* 移动设备 (768px以下) */
@media (max-width: 768px) {
  .page-section {
    padding: 60px 4% 30px;
    min-height: auto;
  }

  .section-title {
    margin-bottom: 2rem;
  }

  .section-title h2 {
    font-size: 1.8rem;
  }

  .section-subtitle {
    font-size: 0.95rem;
    padding: 0 15px;
  }

  /* 首屏优化 */
  .hero-content {
    padding-top: 40px;
  }

  .hero-title {
    font-size: 2rem;
    margin-bottom: 1rem;
  }

  .hero-subtitle {
    font-size: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
    gap: 15px;
  }

  .btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
    padding: 0.875rem 1.5rem;
  }

  /* 作品筛选 */
  .portfolio-filter {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
  }

  .filter-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    margin: 0.25rem;
  }

  /* 作品网格 */
  .portfolio-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
  }

  .portfolio-item {
    max-width: 100%;
  }

  .item-image-wrapper {
    height: 180px;
  }

  .item-content {
    padding: 1.25rem;
  }

  .item-title {
    font-size: 1.1rem;
  }

  .item-description {
    font-size: 0.9rem;
  }

  /* 分页 */
  .pagination {
    gap: 5px;
    margin: 20px 0 15px;
  }

  .page-numbers {
    gap: 5px;
  }

  .pagination-btn,
  .page-number {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .pagination-info {
    font-size: 13px;
    margin-bottom: 20px;
  }

  /* 优势区域 */
  .advantages-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 0;
  }

  .advantage-card {
    padding: 1.5rem;
  }

  /* 联系区域 */
  .contact-info {
    grid-template-columns: 1fr;
    gap: 1.25rem;
    max-width: 100%;
    padding: 0 10px;
  }

  .contact-item {
    padding: 1.5rem;
  }

  .tips {
    position: relative;
    bottom: auto;
    margin-top: 2rem;
    padding: 0 15px;
    font-size: 0.85rem;
  }

  /* 详情页 */
  .detail-header {
    padding: 1rem 4%;
  }

  .detail-content {
    padding: 1.5rem 4%;
  }

  .detail-title {
    font-size: 1.5rem;
  }

  .detail-info {
    grid-template-columns: 1fr;
    padding: 1.25rem;
    gap: 1.25rem;
  }

  .detail-description {
    font-size: 1rem;
    line-height: 1.6;
  }

  /* 返回顶部按钮 */
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
  }
}

/* 小屏手机 (480px以下) */
@media (max-width: 480px) {
  .portfolio-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .hero-title {
    font-size: 1.8rem;
  }

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .section-title h2 {
    font-size: 1.6rem;
  }

  .filter-btn {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }

  .item-image-wrapper {
    height: 160px;
  }

  .pagination-btn,
  .page-number {
    width: 32px;
    height: 32px;
    font-size: 12px;
  }

  .advantage-card h3 {
    font-size: 1.3rem;
  }

  .contact-item h3 {
    font-size: 1.1rem;
  }

  .contact-item p {
    font-size: 1rem;
  }
}

/* 横屏模式优化 */
@media (max-height: 600px) and (orientation: landscape) {
  .page-section {
    padding: 40px 4% 20px;
  }

  .hero-content {
    padding-top: 30px;
  }

  .hero-title {
    font-size: 1.8rem;
    margin-bottom: 0.75rem;
  }

  .hero-subtitle {
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }

  .portfolio-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
  }

  .item-image-wrapper {
    height: 150px;
  }
}

/* 超小屏设备 */
@media (max-width: 360px) {
  .hero-title {
    font-size: 1.6rem;
  }

  .btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
  }

  .portfolio-item {
    border-radius: 8px;
  }

  .item-content {
    padding: 1rem;
  }

  .view-more {
    font-size: 0.9rem;
  }
}

/* ===== 移动端滚动修复（不影响布局） ===== */
@media (max-width: 768px) {

  /* 禁用 fullpage 的滚动效果，但保留所有布局样式 */
  #fullpage {
    height: auto !important;
    transform: none !important;
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
  }

  .section,
  .page-section {
    height: auto !important;
    min-height: 100vh;
    position: relative !important;
    transform: none !important;
    padding: 80px 20px 40px;
    margin: 0 !important;
    opacity: 1 !important;
  }

  /* 恢复body滚动 */
  body {
    overflow-y: auto !important;
    height: auto !important;
  }

  /* 隐藏fullpage导航 */
  #fp-nav {
    display: none !important;
  }

  /* 你的其他响应式布局样式 */
  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 280px;
  }

  .portfolio-grid {
    grid-template-columns: 1fr;
  }

  .advantages-grid {
    grid-template-columns: 1fr;
  }

  .contact-info {
    grid-template-columns: 1fr;
  }
}