/* ===== 变量 & 重置 ===== */
:root {
  --bg: #0a0a0f;
  --bg-card: #12121a;
  --bg-card-hover: #1a1a26;
  --border: rgba(255, 255, 255, 0.06);
  --text: #e8e8f0;
  --text-muted: #8888a0;
  --accent-1: #667eea;
  --accent-2: #764ba2;
  --accent-3: #f093fb;
  --gradient: linear-gradient(135deg, var(--accent-1), var(--accent-2));
  --gradient-2: linear-gradient(135deg, var(--accent-2), var(--accent-3));
  --radius: 16px;
  --radius-sm: 8px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Inter', 'Noto Sans SC', -apple-system, sans-serif;
  --nav-h: 64px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { display: block; max-width: 100%; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== 粒子背景 ===== */
#particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ===== 导航 ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.nav.scrolled {
  background: rgba(10, 10, 15, 0.95);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -1px;
}

.nav-logo span { color: var(--accent-1); }

.nav-links {
  display: flex;
  gap: 32px;
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient);
  transition: var(--transition);
}

.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: var(--transition);
}

/* ===== Hero ===== */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--nav-h) + 40px) 24px 80px;
  gap: 60px;
}

.hero-content { flex: 1; max-width: 560px; }

.hero-greeting {
  font-size: 1.1rem;
  color: var(--accent-1);
  font-weight: 500;
  margin-bottom: 8px;
  opacity: 0;
  animation: fadeUp 0.8s 0.2s forwards;
}

.hero-name {
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -2px;
  margin-bottom: 16px;
  opacity: 0;
  animation: fadeUp 0.8s 0.4s forwards;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeUp 0.8s 0.6s forwards;
}

.hero-desc {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  opacity: 0;
  animation: fadeUp 0.8s 0.8s forwards;
}

.hero-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 48px;
  opacity: 0;
  animation: fadeUp 0.8s 1s forwards;
}

.btn {
  display: inline-flex;
  align-items: center;
  padding: 12px 28px;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  border: none;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(102, 126, 234, 0.5);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--accent-1);
  color: var(--accent-1);
}

.hero-stats {
  display: flex;
  gap: 40px;
  opacity: 0;
  animation: fadeUp 0.8s 1.2s forwards;
}

.stat-num {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Hero 视觉 */
.hero-visual {
  position: relative;
  width: 320px;
  height: 320px;
  flex-shrink: 0;
  opacity: 0;
  animation: fadeIn 1s 0.6s forwards;
}

.avatar-ring {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-ring::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: var(--gradient);
  animation: spin 8s linear infinite;
}

.avatar {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-card);
  position: relative;
  z-index: 1;
  border: 4px solid var(--bg);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(102, 126, 234, 0.2);
  animation: spin 20s linear infinite;
}

.orbit-1 { inset: -30px; }
.orbit-2 { inset: -60px; animation-direction: reverse; animation-duration: 30s; }

.scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.75rem;
  opacity: 0;
  animation: fadeIn 1s 2s forwards;
}

.scroll-arrow {
  width: 20px;
  height: 20px;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg);
  animation: bounce 2s infinite;
}

/* ===== 通用 Section ===== */
.section {
  position: relative;
  z-index: 1;
  padding: 100px 0;
}

.section-dark {
  background: rgba(255, 255, 255, 0.02);
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 60px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.section-num {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-1);
  opacity: 0.6;
}

/* ===== 关于 ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.about-text p {
  color: var(--text-muted);
  margin-bottom: 16px;
  font-size: 1.05rem;
}

.about-text strong { color: var(--text); }

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.tag {
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.8rem;
  background: rgba(102, 126, 234, 0.1);
  color: var(--accent-1);
  border: 1px solid rgba(102, 126, 234, 0.2);
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.info-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.info-item:last-child { border-bottom: none; }

.info-icon { font-size: 1.5rem; }
.info-label { font-size: 0.75rem; color: var(--text-muted); }
.info-value { font-weight: 500; }
.info-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* ===== 技能 ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: var(--transition);
}

.skill-card:hover {
  border-color: rgba(102, 126, 234, 0.3);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.skill-icon { font-size: 2rem; margin-bottom: 16px; }
.skill-card h3 { font-size: 1.1rem; margin-bottom: 20px; }

.skill-bar {
  margin-bottom: 14px;
}

.skill-bar span {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.bar::after {
  content: '';
  display: block;
  height: 100%;
  width: 0;
  background: var(--gradient);
  border-radius: 3px;
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.bar.animated::after { width: var(--w); }

.tech-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.tech-cloud span {
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  transition: var(--transition);
  cursor: default;
}

.tech-cloud span:hover {
  background: rgba(102, 126, 234, 0.15);
  border-color: rgba(102, 126, 234, 0.3);
  color: var(--accent-1);
  transform: translateY(-2px);
}

/* ===== 时间线 ===== */
.timeline {
  position: relative;
  padding-left: 32px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-1), var(--accent-2), transparent);
}

.timeline-item {
  position: relative;
  margin-bottom: 48px;
}

.timeline-dot {
  position: absolute;
  left: -32px;
  top: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--gradient);
  box-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  transition: var(--transition);
}

.timeline-content:hover {
  border-color: rgba(102, 126, 234, 0.3);
  transform: translateX(8px);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.timeline-header h3 { font-size: 1.15rem; }

.timeline-date {
  font-size: 0.8rem;
  color: var(--accent-1);
  font-weight: 500;
  padding: 4px 12px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 50px;
}

.timeline-company {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.timeline-content ul li {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding-left: 20px;
  position: relative;
  margin-bottom: 8px;
}

.timeline-content ul li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent-1);
}

.timeline-dot-current {
  box-shadow: 0 0 24px rgba(240, 147, 251, 0.8);
  animation: pulse-dot 2s ease-in-out infinite;
}

.timeline-content-featured {
  border-color: rgba(102, 126, 234, 0.25);
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.08), rgba(118, 75, 162, 0.05));
}

.badge-current {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 10px;
  margin-left: 8px;
  border-radius: 50px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  vertical-align: middle;
  letter-spacing: 0.5px;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 16px rgba(240, 147, 251, 0.5); }
  50% { box-shadow: 0 0 28px rgba(240, 147, 251, 0.9); }
}

/* ===== 项目 ===== */
.project-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 36px;
}

.filter-btn {
  padding: 8px 20px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: var(--font);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover {
  border-color: rgba(102, 126, 234, 0.4);
  color: var(--text);
}

.filter-btn.active {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 16px rgba(102, 126, 234, 0.35);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow);
  border-color: rgba(102, 126, 234, 0.3);
}

.project-img {
  position: relative;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-emoji { font-size: 3rem; }

.project-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 50px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  color: #fff;
  letter-spacing: 0.5px;
}

.project-role {
  display: block;
  font-size: 0.75rem;
  color: var(--accent-1);
  opacity: 0.85;
}

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

.project-body { padding: 24px; }

.project-body h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.project-body p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 16px;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.project-tags span {
  font-size: 0.7rem;
  padding: 3px 10px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.project-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-1);
  transition: var(--transition);
}

.project-link:hover { color: var(--accent-3); }

/* ===== 联系 ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.contact-text h3 {
  font-size: 1.8rem;
  margin-bottom: 16px;
}

.contact-text p { color: var(--text-muted); }

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}

.contact-card:hover {
  border-color: rgba(102, 126, 234, 0.3);
  transform: translateX(8px);
  background: var(--bg-card-hover);
}

.contact-icon { font-size: 1.5rem; }
.contact-label { font-size: 0.75rem; color: var(--text-muted); }
.contact-value { font-weight: 500; font-size: 0.95rem; }

/* ===== 页脚 ===== */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 40px 24px;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
}

.back-to-top {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  z-index: 99;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover { transform: translateY(-4px); }

/* ===== 滚动动画 ===== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s, transform 0.8s;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 关键帧 ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes bounce {
  0%, 100% { transform: rotate(45deg) translateY(0); }
  50% { transform: rotate(45deg) translateY(6px); }
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .hero {
    flex-direction: column-reverse;
    text-align: center;
    gap: 40px;
    padding-top: calc(var(--nav-h) + 60px);
  }

  .hero-actions { justify-content: center; }
  .hero-stats { justify-content: center; }
  .hero-visual { width: 240px; height: 240px; }
  .avatar { width: 200px; height: 200px; }

  .about-grid,
  .contact-grid { grid-template-columns: 1fr; }

  .skills-grid,
  .projects-grid { grid-template-columns: 1fr; }

  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: rgba(10, 10, 15, 0.98);
    flex-direction: column;
    padding: 24px;
    gap: 16px;
    transform: translateY(-120%);
    transition: var(--transition);
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open { transform: translateY(0); }
  .nav-toggle { display: flex; }
}

@media (max-width: 480px) {
  .hero-stats { gap: 24px; }
  .stat-num { font-size: 1.5rem; }
  .hero-actions { flex-direction: column; align-items: center; }
}
