:root {
  --bg: #ffffff;
  --bg-alt: #f6f8fb;
  --text: #1f2937;
  --text-light: #6b7280;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --border: #e5e7eb;
  --shadow: 0 4px 20px rgba(31, 41, 55, 0.08);
  --shadow-lg: 0 12px 40px rgba(31, 41, 55, 0.12);
  --radius: 14px;
  --transition: all 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  overflow-x: hidden;
}

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

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
}

/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: var(--transition);
}

.navbar.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 2px 12px rgba(31, 41, 55, 0.06);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}

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

.logo span {
  color: var(--primary);
}

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

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

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

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

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

.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Hero ===== */
.hero {
  position: relative;
  background: linear-gradient(135deg, #eef2ff 0%, #f6f8fb 50%, #ecfeff 100%);
  padding: 150px 0 120px;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 60px;
  align-items: center;
}

.hero-greeting {
  font-size: 1.1rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 8px;
}

.hero h1 {
  font-size: 3.6rem;
  font-weight: 800;
  letter-spacing: -2px;
  line-height: 1.15;
  margin-bottom: 10px;
}

.hero h1 .dot {
  color: var(--primary);
}

.hero-role {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 18px;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text-light);
  max-width: 520px;
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 16px;
}

.btn {
  display: inline-block;
  padding: 13px 32px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 600;
  transition: var(--transition);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.4);
}

.btn-outline {
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-2px);
}

.hero-avatar {
  display: flex;
  justify-content: center;
}

.avatar-ring {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  padding: 12px;
  background: conic-gradient(from 180deg, #2563eb, #48c78e, #f2994a, #2563eb);
  animation: spin 12s linear infinite;
}

.avatar-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  font-weight: 800;
  color: var(--primary);
  animation: spin-reverse 12s linear infinite;
}

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

@keyframes spin-reverse {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

.hero-wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  line-height: 0;
}

.hero-wave svg {
  width: 100%;
  height: 80px;
  display: block;
}

/* ===== Sections ===== */
.section {
  padding: 100px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: -1px;
  text-align: center;
}

.section-subtitle {
  text-align: center;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 3px;
  font-size: 0.85rem;
  margin-bottom: 48px;
}

/* ===== About ===== */
.about-content {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 60px;
  align-items: start;
}

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

.about-info {
  list-style: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.about-info li {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
  font-weight: 500;
}

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

.about-info li span {
  color: var(--text-light);
  font-weight: 400;
}

/* ===== Skills ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

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

.skill-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.skill-card h3 {
  margin-bottom: 20px;
  font-size: 1.1rem;
  color: var(--primary);
}

.skill-bar {
  margin-bottom: 18px;
  position: relative;
}

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

.skill-bar b {
  float: right;
  font-size: 0.85rem;
  color: var(--text-light);
  font-weight: 500;
}

.skill-track {
  display: block;
  height: 8px;
  background: var(--bg-alt);
  border-radius: 10px;
  overflow: hidden;
  clear: both;
}

.skill-fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--primary), #60a5fa);
  border-radius: 10px;
  transition: width 1.2s ease;
}

/* ===== Projects ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

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

.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.project-thumb {
  height: 160px;
  position: relative;
}

.project-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.15), rgba(0,0,0,0.15));
}

.project-body {
  padding: 24px;
}

.project-body h3 {
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.project-body p {
  font-size: 0.92rem;
  color: var(--text-light);
  margin-bottom: 14px;
}

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

.project-tags span {
  font-size: 0.78rem;
  padding: 4px 12px;
  background: var(--bg-alt);
  border-radius: 20px;
  color: var(--primary);
  font-weight: 500;
}

.project-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--primary);
  transition: var(--transition);
}

.project-link:hover {
  color: var(--primary-dark);
  letter-spacing: 0.5px;
}

/* ===== Timeline ===== */
.timeline {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-left: 56px;
  margin-bottom: 32px;
}

.timeline-dot {
  position: absolute;
  left: 7px;
  top: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  border: 4px solid #dbeafe;
}

.timeline-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.timeline-card:hover {
  box-shadow: var(--shadow-lg);
}

.timeline-date {
  font-size: 0.82rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 6px;
}

.timeline-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.timeline-card p:last-child {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* ===== Contact ===== */
.contact-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  max-width: 900px;
  margin: 0 auto;
}

.contact-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 36px 24px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
  text-align: center;
}

.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
}

.contact-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #60a5fa);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.contact-card span:nth-child(2) {
  font-weight: 600;
  font-size: 1.05rem;
}

.contact-card small {
  color: var(--text-light);
}

.contact-note {
  text-align: center;
  color: var(--text-light);
  margin-top: 36px;
  font-size: 0.95rem;
}

/* ===== Footer ===== */
.footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 28px 0;
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
}

.heart {
  color: #ef4444;
}

/* ===== Back to top ===== */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: var(--transition);
  z-index: 90;
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary-dark);
}

/* ===== Reveal animation ===== */
.reveal-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero-inner,
  .about-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

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

  .hero {
    padding: 120px 0 90px;
  }

  .hero h1 {
    font-size: 2.8rem;
  }

  .avatar-ring {
    width: 220px;
    height: 220px;
  }

  .nav-links {
    position: fixed;
    top: 68px;
    right: -100%;
    flex-direction: column;
    background: var(--bg);
    width: 240px;
    height: calc(100vh - 68px);
    padding: 32px 28px;
    box-shadow: var(--shadow-lg);
    transition: right 0.3s ease;
    gap: 24px;
  }

  .nav-links.open {
    right: 0;
  }

  .hamburger {
    display: flex;
  }
}
