/* ============ 基础设置 ============ */
html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

/* ============ 背景渐变 & 光晕 ============ */
.bg-overlay {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(135deg,
      #FDE8E8 0%,
      #FEF5E0 20%,
      #E8F5F0 45%,
      #E8EEF8 70%,
      #F0E8F8 100%);
  z-index: -2;
}

.bg-blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  z-index: -1;
  pointer-events: none;
}

.bg-blob-1 {
  width: 500px;
  height: 500px;
  background: linear-gradient(135deg, #FFD6E0, #FFC4D6);
  top: -150px;
  left: -100px;
  animation: blobMove 18s ease-in-out infinite;
}

.bg-blob-2 {
  width: 600px;
  height: 600px;
  background: linear-gradient(135deg, #E0F5E8, #C8F0D8);
  top: 40%;
  right: -200px;
  animation: blobMove 22s ease-in-out infinite reverse;
}

.bg-blob-3 {
  width: 450px;
  height: 450px;
  background: linear-gradient(135deg, #E8E0FF, #D8CCF8);
  bottom: -100px;
  left: 30%;
  animation: blobMove 25s ease-in-out infinite;
}

.bg-blob-4 {
  width: 400px;
  height: 400px;
  background: linear-gradient(135deg, #FFF0D6, #FFE8C0);
  top: 20%;
  left: 40%;
  animation: blobMove 20s ease-in-out infinite reverse;
}

@keyframes blobMove {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(60px, -40px) scale(1.1); }
  66% { transform: translate(-40px, 60px) scale(0.95); }
}

/* ============ 导航栏 ============ */
#navbar {
  background: transparent;
}

#navbar.scrolled {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.nav-link {
  position: relative;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #4B5563;
  border-radius: 0.5rem;
  transition: all 0.2s;
}

.nav-link:hover {
  color: #111827;
  background: rgba(255, 255, 255, 0.5);
}

.nav-link.active {
  color: #111827;
  background: rgba(255, 255, 255, 0.8);
  font-weight: 600;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: linear-gradient(90deg, #8B5CF6, #EC4899);
  border-radius: 2px;
}

/* ============ 按钮 ============ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  padding: 0.875rem 1.75rem;
  background: #111827;
  color: white;
  font-weight: 600;
  border-radius: 9999px;
  transition: all 0.3s;
  box-shadow: 0 4px 20px rgba(17, 24, 39, 0.15);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(17, 24, 39, 0.25);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  padding: 0.875rem 1.75rem;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  color: #111827;
  font-weight: 600;
  border-radius: 9999px;
  border: 1.5px solid rgba(17, 24, 39, 0.15);
  transition: all 0.3s;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
}

/* ============ 标签 / Tag ============ */
.tag {
  display: inline-block;
  padding: 0.5rem 1.1rem;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #4B5563;
  border: 1px solid rgba(255, 255, 255, 0.8);
  transition: all 0.2s;
}

.tag:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.tag-purple {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(139, 92, 246, 0.08));
  color: #7C3AED;
  border-color: rgba(139, 92, 246, 0.2);
}

.tag-teal {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.15), rgba(20, 184, 166, 0.08));
  color: #0D9488;
  border-color: rgba(20, 184, 166, 0.2);
}

.tag-pink {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(236, 72, 153, 0.08));
  color: #DB2777;
  border-color: rgba(236, 72, 153, 0.2);
}

/* ============ 教育卡片 ============ */
.edu-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.06);
  transition: all 0.4s;
  position: relative;
  overflow: hidden;
}

.edu-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #8B5CF6, #EC4899, #14B8A6);
  opacity: 0;
  transition: opacity 0.4s;
}

.edu-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

.edu-card:hover::before {
  opacity: 1;
}

.edu-card-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  border-radius: 1rem;
  background: linear-gradient(135deg, #8B5CF6, #A78BFA);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.edu-card-badge-green {
  background: linear-gradient(135deg, #10B981, #34D399);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

/* ============ 工作经历时间线 ============ */
.exp-item {
  position: relative;
  padding: 2rem 0;
}

.exp-dot {
  position: absolute;
  left: -8px;
  top: 2.5rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8B5CF6, #EC4899);
  color: white;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.35);
  z-index: 2;
}

.exp-dot-teal {
  background: linear-gradient(135deg, #14B8A6, #06B6D4);
  box-shadow: 0 8px 25px rgba(20, 184, 166, 0.35);
}

.exp-dot-pink {
  background: linear-gradient(135deg, #F472B6, #F472B6);
  box-shadow: 0 8px 25px rgba(236, 72, 153, 0.35);
}

@media (min-width: 1024px) {
  .exp-dot {
    left: 50%;
    transform: translateX(-50%);
  }
}

.exp-company-card {
  padding: 1rem;
}

.exp-detail-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  border-radius: 1.25rem;
  padding: 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s;
  margin-left: 4rem;
}

@media (min-width: 1024px) {
  .exp-detail-card {
    margin-left: 0;
  }
}

.exp-detail-card:hover {
  transform: translateY(-4px);
}

.company-underline {
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, #8B5CF6, #EC4899);
  border-radius: 2px;
  margin-top: 0.75rem;
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.75rem;
  background: linear-gradient(135deg, #F3F4F6, #F9FAFB);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #374151;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* 经历详情中：指标与描述的分隔线 */
.stat-divider {
  margin: 1rem 0 0.75rem;
  border-top: 1px dashed rgba(0, 0, 0, 0.12);
}

/* 经历中的方向小标签 */
.exp-role-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(20, 184, 166, 0.12);
  color: #0D9488;
  border: 1px solid rgba(20, 184, 166, 0.2);
}

.exp-role-tag-gray {
  background: rgba(107, 114, 128, 0.1);
  color: #4B5563;
  border-color: rgba(107, 114, 128, 0.2);
}

/* 移动端：给时间线留空间 */
@media (max-width: 1023px) {
  .exp-item {
    padding-left: 4rem;
  }
  .exp-dot {
    left: 0;
  }
}

/* ============ 项目卡片 ============ */
.project-card {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(20px);
  border-radius: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: all 0.4s;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.12);
}

@media (min-width: 1024px) {
  .project-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

.project-screenshot {
  position: relative;
  background:
    radial-gradient(circle at 20% 20%, rgba(139, 92, 246, 0.08), transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(20, 184, 166, 0.08), transparent 50%),
    linear-gradient(135deg, #F3F4F6 0%, #E5E7EB 100%);
  aspect-ratio: 16 / 10;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.1rem;
}

@media (min-width: 1024px) {
  .project-screenshot {
    aspect-ratio: auto;
    min-height: 100%;
    padding: 2rem;
  }
}

.project-screenshot img {
  width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 0.75rem;
  box-shadow: 0 12px 36px rgba(17, 24, 39, 0.18);
  background: #fff;
  transition: transform 0.6s;
}

.project-card:hover .project-screenshot img {
  transform: scale(1.02);
}

.project-info {
  padding: 1.75rem;
}

@media (min-width: 768px) {
  .project-info {
    padding: 2.5rem;
  }
}

.project-num {
  font-family: 'Inter', monospace;
  font-size: 1.5rem;
  font-weight: 800;
  color: #8B5CF6;
}

.project-stat {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 1rem;
  padding: 0.75rem;
  text-align: center;
  transition: all 0.2s;
}

.project-stat:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.03);
}

/* 完整案例详情折叠区 */
.project-detail-reveal {
  animation: fadeUp 0.5s ease-out;
}

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

.glass-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

/* ============ 技能 & 档案卡 ============ */
.card-draw-container {
  display: grid;
  gap: 3rem;
}

@media (min-width: 1024px) {
  .card-draw-container {
    grid-template-columns: 1fr 1.2fr;
    gap: 4rem;
  }
}

.card-stack-area {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card-pile {
  position: relative;
  width: 220px;
  height: 280px;
  perspective: 1000px;
}

.card-pile-sheet {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 1.25rem;
}

.sheet-1 {
  top: 8px;
  left: 8px;
  background: linear-gradient(135deg, #F0E8FF, #E8F5FF);
  transform: rotate(3deg);
}

.sheet-2 {
  top: 4px;
  left: 4px;
  background: linear-gradient(135deg, #FFE8F0, #FFF0E8);
  transform: rotate(1.5deg);
}

.sheet-3 {
  top: 0;
  left: 0;
  background: linear-gradient(135deg, #E8FFF5, #F0FFE8);
  transform: rotate(-1deg);
}

.card-back {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #1F2937, #374151);
  border-radius: 1.25rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.5s;
  cursor: pointer;
}

.card-back:hover {
  transform: translateY(-8px) rotate(-2deg);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}

.card-pile.drawing .card-back {
  animation: cardFly 0.6s ease-out forwards;
}

@keyframes cardFly {
  0% { transform: translate(0, 0) rotate(-2deg); }
  50% { transform: translate(20px, -30px) rotate(8deg); opacity: 0.5; }
  100% { transform: translate(100px, -10px) rotate(25deg); opacity: 0; }
}

.revealed-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  border-radius: 1.5rem;
  padding: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.08);
  animation: cardReveal 0.5s ease-out;
  min-height: 400px;
}

@keyframes cardReveal {
  from { opacity: 0; transform: rotateY(-15deg) scale(0.95); }
  to { opacity: 1; transform: rotateY(0) scale(1); }
}

.radar-chart {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 技能标签墙 */
.skill-chip {
  display: inline-block;
  padding: 0.3rem 0.7rem;
  background: rgba(17, 24, 39, 0.04);
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
  color: #374151;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

/* ============ 奖励证明 · 证书墙 ============ */
.award-mini-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 1rem;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #4B5563;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
}

.award-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1.1rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4B5563;
  background: rgba(255, 255, 255, 0.65);
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.04);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}

.award-filter:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.09);
}

.award-filter.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
  transform: scale(1.05);
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.25);
}

.award-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 0.3rem;
  border-radius: 9999px;
  font-size: 0.68rem;
  background: rgba(0, 0, 0, 0.08);
}

.award-filter.active .award-filter-count {
  background: rgba(255, 255, 255, 0.25);
}

/* 瀑布流照片墙 */
.award-grid {
  columns: 2;
  column-gap: 1.1rem;
}

@media (min-width: 768px) {
  .award-grid { columns: 3; column-gap: 1.4rem; }
}

@media (min-width: 1280px) {
  .award-grid { columns: 4; }
}

.award-card {
  position: relative;
  break-inside: avoid;
  margin: 0 0 1.4rem;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 1.1rem;
  padding: 0.7rem 0.7rem 0.9rem;
  box-shadow: 0 8px 26px rgba(17, 24, 39, 0.08);
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s, opacity 0.3s;
  transform: rotate(-0.8deg);
}

.award-card:nth-child(2n) { transform: rotate(0.9deg); }
.award-card:nth-child(3n) { transform: rotate(-0.3deg); }

.award-card:hover {
  transform: rotate(0deg) translateY(-8px) scale(1.03);
  box-shadow: 0 22px 48px rgba(17, 24, 39, 0.18);
  z-index: 5;
}

/* 装饰胶带 */
.award-card::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  width: 72px;
  height: 22px;
  background: rgba(251, 191, 36, 0.35);
  transform: translateX(-50%) rotate(-3deg);
  border-radius: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  z-index: 2;
}

.award-card:nth-child(3n)::before {
  background: rgba(236, 72, 153, 0.25);
  transform: translateX(-50%) rotate(4deg);
}

.award-card:nth-child(4n)::before {
  background: rgba(20, 184, 166, 0.28);
  transform: translateX(-50%) rotate(-1deg);
}

.award-card-img {
  border-radius: 0.7rem;
  overflow: hidden;
  background: #F3F4F6;
  display: flex;
  align-items: center;
  justify-content: center;
}

.award-landscape { aspect-ratio: 4 / 3; }
.award-portrait { aspect-ratio: 3 / 4.2; }

.award-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.award-card:hover .award-card-img img {
  transform: scale(1.06);
}

.award-card figcaption {
  padding: 0.7rem 0.2rem 0;
}

.award-card figcaption h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: #111827;
  line-height: 1.4;
  margin: 0.4rem 0 0.15rem;
}

.award-card figcaption p {
  font-size: 0.72rem;
  color: #9CA3AF;
  line-height: 1.4;
}

.award-cat-tag {
  display: inline-block;
  padding: 0.18rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.66rem;
  font-weight: 700;
}

.award-cat-scholarship { background: rgba(251, 191, 36, 0.15); color: #B45309; }
.award-cat-contest { background: rgba(139, 92, 246, 0.14); color: #7C3AED; }
.award-cat-honor { background: rgba(236, 72, 153, 0.13); color: #DB2777; }
.award-cat-cert { background: rgba(20, 184, 166, 0.14); color: #0D9488; }

.award-card.award-hiding {
  opacity: 0;
  transform: scale(0.85);
  pointer-events: none;
}

.award-card.award-hidden {
  display: none;
}

.award-card.award-pop {
  animation: awardPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes awardPop {
  from { opacity: 0; transform: scale(0.8) rotate(0deg); }
  to { opacity: 1; }
}

/* ============ 证书灯箱 ============ */
.award-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(17, 24, 39, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.award-lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

.award-lightbox-content {
  max-width: min(92vw, 880px);
  max-height: 88vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.92) translateY(16px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.award-lightbox.open .award-lightbox-content {
  transform: scale(1) translateY(0);
}

.award-lightbox-content img {
  max-width: 100%;
  max-height: 74vh;
  border-radius: 0.9rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  background: #fff;
}

.award-lightbox-content figcaption {
  text-align: center;
  margin-top: 1rem;
  color: #fff;
}

.award-lightbox-content figcaption h4 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.award-lightbox-content figcaption p {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.65);
}

.award-lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s;
}

.award-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: rotate(90deg);
}

.award-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s;
}

.award-lightbox-nav:hover { background: rgba(255, 255, 255, 0.28); transform: translateY(-50%) scale(1.08); }
.award-lightbox-prev { left: 1.25rem; }
.award-lightbox-next { right: 1.25rem; }

@media (max-width: 640px) {
  .award-lightbox-nav { width: 42px; height: 42px; }
  .award-lightbox-prev { left: 0.6rem; }
  .award-lightbox-next { right: 0.6rem; }
}

/* ============ 联系卡片 ============ */
.contact-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  border-radius: 1.25rem;
  padding: 1.75rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
  transition: all 0.3s;
  cursor: pointer;
}

.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.1);
}

/* ============ 滚动揭示动画 ============ */
.reveal,
.reveal-text,
.reveal-img {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-text {
  transition-delay: 0.1s;
}

.reveal-img {
  transition-delay: 0.25s;
}

.reveal.visible,
.reveal-text.visible,
.reveal-img.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ 移动端汉堡菜单动画 ============ */
#hamburger.active #bar1 {
  transform: rotate(45deg) translate(5px, 5px);
}

#hamburger.active #bar2 {
  opacity: 0;
}

#hamburger.active #bar3 {
  transform: rotate(-45deg) translate(6px, -6px);
}

#mobileMenu.open {
  max-height: 400px;
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #D1D5DB, #E5E7EB);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #9CA3AF, #D1D5DB);
}

/* 选中文本样式 */
::selection {
  background: rgba(139, 92, 246, 0.3);
  color: #111827;
}

/* ============ 移动端 375px 专项适配 ============ */
@media (max-width: 480px) {
  /* 1. 防止横向溢出：所有装饰背景缩小 */
  .bg-blob { opacity: 0.35; }
  .bg-blob-1, .bg-blob-2, .bg-blob-3, .bg-blob-4 {
    width: 320px;
    height: 320px;
  }

  /* 2. 导航栏增加底部安全区（iOS） */
  #navbar {
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  #mobileMenu {
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  /* 3. Hero 区：避免首屏过高 */
  #home {
    min-height: auto;
    padding-top: 5rem;
    padding-bottom: 3rem;
  }

  /* 4. 教育卡片：badge 缩小并保证日期不被遮挡 */
  .edu-card-badge {
    width: 38px;
    height: 38px;
    top: 0.75rem;
    right: 0.75rem;
    border-radius: 0.85rem;
    font-size: 0.85rem;
  }
  .edu-card .p-6 { padding: 1.15rem 1.15rem 1.35rem; }
  .edu-card .pr-14 { padding-right: 3.5rem; }

  /* 5. 实习时间线：左侧间距 + 圆点缩小 */
  .exp-item { padding-left: 3.25rem; }
  .exp-dot {
    width: 48px;
    height: 48px;
    font-size: 0.95rem;
    top: 2.25rem;
  }
  .exp-detail-card {
    margin-left: 3.25rem;
    padding: 1.25rem;
  }

  /* 6. 技能抽卡：缩小卡片堆尺寸 */
  .card-pile {
    width: 170px;
    height: 215px;
  }
  .revealed-card {
    padding: 1.25rem;
    min-height: 320px;
  }

  /* 7. 奖励证书网格：2 列改为紧凑 2 列 */
  .award-grid {
    columns: 2;
    column-gap: 0.75rem;
  }
  .award-card {
    padding: 0.55rem 0.55rem 0.7rem;
    margin-bottom: 0.9rem;
  }
  .award-card figcaption { padding: 0.5rem 0.1rem 0; }
  .award-card figcaption h4 { font-size: 0.78rem; }
  .award-card figcaption p { font-size: 0.68rem; }

  /* 8. 证书胶带缩小 */
  .award-card::before {
    width: 56px;
    height: 18px;
    top: -8px;
  }

  /* 9. 灯箱：导航按钮 + 关闭按钮更大（触控区 >= 44px） */
  .award-lightbox-close {
    width: 48px;
    height: 48px;
    top: 0.75rem;
    right: 0.75rem;
  }
  .award-lightbox-nav {
    width: 46px;
    height: 46px;
  }
  .award-lightbox-prev { left: 0.5rem; }
  .award-lightbox-next { right: 0.5rem; }

  /* 10. 筛选按钮：增加点击区域 */
  .award-filter {
    padding: 0.5rem 0.85rem;
    font-size: 0.78rem;
    min-height: 38px;
  }

  /* 11. 联系卡片：保证最小触控高度 */
  .contact-card {
    padding: 1.25rem 0.75rem;
    min-height: 110px;
  }

  /* 12. 按钮：最小 44px 触控高度 */
  .btn-primary, .btn-secondary {
    padding: 0.75rem 1.35rem;
    min-height: 44px;
  }

  /* 13. Section 标题：避免在 375px 下换行太难看 */
  .text-3xl { font-size: 1.65rem !important; }
  .text-4xl { font-size: 2rem !important; }

  /* 14. 汉堡菜单按钮：保证触控区域 */
  #hamburger { min-width: 44px; min-height: 44px; }

  /* 15. 避免长链接/邮箱撑破容器 */
  .break-all { word-break: break-all; }
  a { word-break: break-word; }
}

/* ============ 触屏设备：hover → active 替代 ============ */
@media (hover: none) and (pointer: coarse) {
  /* 教育卡片 */
  .edu-card:active {
    transform: translateY(-4px);
  }
  .edu-card:active::before { opacity: 1; }

  /* 经历详情卡片 */
  .exp-detail-card:active {
    transform: translateY(-3px);
  }

  /* 项目卡片 */
  .project-card:active {
    transform: translateY(-3px);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.1);
  }
  .project-card:active .project-screenshot img {
    transform: scale(1.02);
  }

  /* 项目数据卡片 */
  .project-stat:active {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 1);
  }

  /* 证书卡片：点击反馈（替代 hover） */
  .award-card:active {
    transform: rotate(0deg) scale(0.97);
    transition: transform 0.15s ease-out;
  }

  /* 技能抽卡按钮 */
  .card-back:active {
    transform: translateY(-4px) rotate(-1deg);
  }

  /* 联系卡片 */
  .contact-card:active {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  }

  /* 导航链接点击反馈 */
  .nav-link:active,
  .mobile-link:active {
    background: rgba(0, 0, 0, 0.06);
  }

  /* 筛选按钮点击反馈 */
  .award-filter:active {
    transform: scale(0.96);
  }

  /* 汉堡菜单条点击动画（点击时加深颜色） */
  #hamburger:active span { opacity: 0.7; }
}

/* 禁用 hover 设备上的 :hover 样式（触屏不使用） */
@media (hover: none) and (pointer: coarse) {
  .edu-card::before { opacity: 1 !important; }
}
