/* Portfolio Page */
.portfolio-page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: #000;
  overflow-y: auto;
  overflow-x: hidden;
}

/* 添加一个顶部保护区，阻止任何元素遮挡Header - 只在Header区域生效 */
.portfolio-page::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100px; /* 只覆盖Header本身的高度 */
  z-index: 10001;
  pointer-events: auto;
  background: transparent;
}

.animate-wrapper {
  height: 60px;
  margin-top: 5px;
  flex: 1;
  display: flex;
  justify-content: center;
}

.animate-wrapper spline-viewer {
  width: 750px;
  height: 380px;

  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

@media (max-width: 768px) {
  .animate-wrapper {
    display: none;
  }
}
/* Header - Sticky */
.header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 30px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10002 !important; /* 提高z-index确保在Spline元素之上 */
  height: 100px;
  pointer-events: auto !important; /* 确保header可以接收点击事件 */
}

/* 确保header中的所有元素都可以接收点击事件，并且在最高层 */
.header *,
.header .nav,
.header .nav-filters,
.header .filter-btn {
  pointer-events: auto !important;
  position: relative;
  z-index: 10003; /* 提升到最高层 */
}

.logo {
  display: flex;
  flex-direction: column;
  min-width: 140px;
}

.logo h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -1px;
  cursor: pointer;
  transition: opacity 0.3s ease;
  margin: 0;
}

.logo h1:hover {
  opacity: 0.7;
}

.subtitle {
  font-size: 14px;
  opacity: 0.6;
  font-weight: 400;
  letter-spacing: 2px;
  margin-top: 2px;
}

.nav {
  display: flex;
  align-items: center;
}

.nav-filters {
  display: flex;
  gap: 40px;
}

.filter-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 1px;
  cursor: pointer !important;
  padding: 8px 12px !important; /* 增加左右padding确保整个区域可点击 */
  position: relative;
  transition: opacity 0.3s ease;
  opacity: 0.6;
  pointer-events: auto !important; /* 确保按钮可以点击 */
}

.filter-btn.active {
  opacity: 1;
}

.filter-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 1px;
  background: #fff;
  transition: width 0.3s ease;
  pointer-events: none !important; /* 确保伪元素不会阻挡点击 */
}

.filter-btn.active::after,
.filter-btn:hover::after {
  width: 100%;
}

/* Sidebar - Clean & Minimal Design */
.sidebar {
  position: fixed !important;
  left: 40px !important;
  top: 50vh !important;
  transform: translateY(-50%) !important;
  z-index: 10003 !important; /* 提高z-index确保在所有元素之上 */
  margin: 0 !important;
  padding: 20px 16px !important;
  width: auto !important;
  height: auto !important;
  display: none !important; /* 默认隐藏 */
  flex-direction: column !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  background: rgba(0, 0, 0, 0.6) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  border-radius: 12px !important;
  backdrop-filter: blur(10px) !important;
  transition: all 0.3s ease !important;
}

/* 确保sidebar中的所有元素都可以接收点击事件 */
.sidebar *,
.sidebar .sidebar-nav,
.sidebar .nav-link {
  pointer-events: auto !important;
}

.sidebar:hover {
  background: rgba(0, 0, 0, 0.7) !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
}

/* 显示sidebar的条件 */
.sidebar.show {
  display: flex !important;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: center;
}

.nav-link {
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 1px;
  opacity: 0.7;
  transition: all 0.3s ease;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  text-transform: uppercase;
  position: relative;
  padding: 10px 10px !important; /* 增加左右padding确保整个区域可点击 */
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto !important; /* 确保可以点击 */
  cursor: pointer !important; /* 确保显示手型光标 */
}

.nav-link::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 0;
  background: rgba(255, 255, 255, 0.8);
  transition: height 0.3s ease;
  pointer-events: none !important; /* 确保伪元素不会阻挡点击 */
}

.nav-link:hover {
  opacity: 1;
  color: #fff;
}

.nav-link:hover::before {
  height: 40px;
}

/* Main Content - Scrollable */
.main-content {
  margin-left: 120px;
  margin-top: 0;
  padding: 50px 60px 100px;
  min-height: calc(100vh - 100px);
}

/* Work Grid */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 60px 40px;
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 40px;
}

.project-card {
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  opacity: 0;
  transform: translateY(40px);
  position: relative;
  overflow: hidden;
  will-change: transform, opacity;
  backface-visibility: hidden;
  transform-style: preserve-3d;
}

.project-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.project-card:hover {
  transform: translateY(-2px) scale(1.002) !important;
  filter: brightness(1.02) !important;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25) !important;
}

/* 移除可能导致闪烁的伪元素动画 */
.project-card::before {
  display: none;
}

.project-image {
  width: 100%;
  height: 280px;
  margin-bottom: 24px;
  overflow: hidden;
  border-radius: 12px;
  position: relative;
  background: #111;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform, box-shadow;
}

.project-card:hover .project-image {
  border-radius: 14px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* 专门为Float项目卡片添加的图片样式 */
.project-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.project-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
  backface-visibility: hidden;
}

.project-card:hover .project-video,
.project-card:hover .project-card-image {
  transform: scale(1.005);
}

.placeholder-image {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #2a2a2a, #3a3a3a);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 16px;
  font-weight: 300;
  letter-spacing: 1px;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
  will-change: transform;
}

/* 移除可能导致闪烁的动画效果 */
.placeholder-image::after {
  display: none;
}

.project-card:hover .placeholder-image {
  background: linear-gradient(135deg, #3a3a3a, #4a4a4a);
  color: #888;
  transform: scale(1.005);
}

.project-info {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  position: relative;
  z-index: 2;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.project-card:hover .project-info {
  transform: translateY(-1px);
}

.project-title {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: -0.5px;
  line-height: 1.3;
  flex: 1;
  margin: 0;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.project-card:hover .project-title {
  color: #fff;
  transform: translateX(1px);
}

.project-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 4px;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.project-card:hover .project-meta {
  transform: translateX(-2px);
}

.project-category {
  font-size: 11px;
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 400;
  transition: opacity 0.3s ease;
}

.project-card:hover .project-category {
  opacity: 0.8;
}

.project-year {
  font-size: 14px;
  font-weight: 500;
  opacity: 0.8;
  transition: opacity 0.3s ease;
}

.project-card:hover .project-year {
  opacity: 1;
}
