:root {
  --bg: #0f0f0f;
  --panel: #141414;
  --text: #eaeaea;
  --muted: #a8a8a8;
  --border: #2a2a2a;
  --orange: #ff6a3d;
  --blue: #3b82f6;
  --gradient: linear-gradient(90deg,#ff7a18 0%,#f81ce5 60%,#8b5cf6 100%);
  --shadow: rgba(0,0,0,.4);
}

:root.light {
  --bg: #fafafa;
  --panel: #ffffff;
  --text: #1a1a1a;
  --muted: #555;
  --border: #e4e4e4;
  --orange: #e8612a;
  --blue: #2563eb;
  --gradient: linear-gradient(90deg,#f97316 0%,#ec4899 60%,#6366f1 100%);
  --shadow: rgba(0,0,0,0.12);
}

html, body, .section, header, footer {
  transition: background-color .5s, color .5s, box-shadow .5s;
}

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
  overflow-y: scroll;
}

body {
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

/* --- Navbar --- */
.site-nav { background: var(--panel); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.site-nav nav a {
  color: var(--text); text-decoration: none; margin-left: 24px; font-weight: 500;
}
.site-nav nav a:hover {
  background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
#themeToggle {
  background: none; border: none; color: var(--text); font-size: 1.3rem;
  cursor: pointer; transition: transform .3s;
}
#themeToggle:hover { transform: rotate(20deg); }

/* --- Hero --- */
.hero { padding: 100px 0; text-align: center; }
.avatar {
  width: 140px; height: 140px; border-radius: 50%;
  box-shadow: 0 10px 30px var(--shadow); margin-bottom: 28px;
}
.hero h1 { font-size: 56px; font-weight: 800; line-height: 1.1; margin-bottom: 12px; }
.gradient { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.lede { color: var(--muted); max-width: 720px; margin: 0 auto; font-size: 18px; }
.cta { margin-top: 28px; display: flex; justify-content: center; gap: 16px; }
.btn {
  padding: 14px 24px; border-radius: 999px; font-weight: 700; text-decoration: none;
  background: var(--gradient); color: #111;
}
.btn.outline { background: transparent; color: var(--text); border: 2px solid var(--border); }


/* --- Experience --- */
.timeline { display: flex; flex-direction: column; gap: 24px; }
.job { background: var(--panel); padding: 20px; border-radius: 12px; box-shadow: 0 4px 20px var(--shadow); }
.job-time { color: var(--muted); font-size: 14px; display: block; margin-bottom: 8px; }



/* --- Footer --- */
.site-footer { padding: 32px 0; text-align: center; color: var(--muted); background: var(--panel); }

/* --- Animations --- */
.reveal { opacity: 0; transform: translateY(20px); transition: all .8s; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }


/* --- Section layout tuning --- */
.section {
  height: 100vh; /* 每个区块占一屏 */
  scroll-snap-align: start;
  padding: 80px 0;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 60px; /* 给标题下留足呼吸空间 */
}

/* Projects & Experience grid alignment fix */
/* #projects .grid, 
#experience .timeline {
  margin: 0 auto;
  max-width: 950px; /* 限制主要内容宽度 */
/* } */ 

#projects .grid,
#experience .experience-item,
#skills .skills-grid {
  margin: 0 auto;
  max-width: 960px;
  width: 100%;
}

/* 让 Experience 内部 job 内容不会贴边 */
.job {
  padding: 24px 28px;
  line-height: 1.65;
}

/* 调整 section 间的视觉间距，防止“顶” */
.section + .section {
  margin-top: 80px;
}


/* --- Skills / Experience With --- */
.skills-grid {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 40px;
  flex-wrap: wrap;
  margin-top: 40px;
}

.skills-grid img {
  width: 60px;
  height: 60px;
  filter: none; /* 默认彩色显示 */
  transition: all 0.3s ease;
  opacity: 0.85;
}

/* .skills-grid img:hover {
  filter: grayscale(0%) brightness(1);
  transform: scale(1.1);
  opacity: 1;
} */

.skills-grid img:hover {
  transform: scale(1.12);
  filter: drop-shadow(0 0 6px rgba(255,255,255,0.3));
}

/* 每个技能项：图标 + 文字 */
.skills-grid .skill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 96px;
  text-align: center;
}

.skills-grid .skill img {
  width: 60px;
  height: 60px;
  opacity: 0.95;
}

.skill-label {
  font-size: 13px;
  color: var(--muted);
  line-height: 1;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

@media (max-width: 768px) {
  .skills-grid img {
    width: 48px;
    height: 48px;
  }
}
/* --- EXPERIENCE --- */
#experience {
  text-align: center;
  padding: 100px 0;
  max-width: 1100px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

#experience .section-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--blue);
  letter-spacing: 0.5px;
  margin-bottom: 60px;
}

.experience-item {
  max-width: 960px;
  margin: 0 auto 60px;
  text-align: left;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.experience-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  margin-bottom: 10px;
}

.experience-logo img {
  width: 42px;
  height: 42px;
  margin-right: 14px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(255,255,255,0.08);
}

.experience-header h3 {
  flex: 1;
  margin: 0 16px;
  font-weight: 700;
  font-size: 19px;
  color: var(--text);
  line-height: 1.3;
}

.experience-date {
  font-size: 14px;
  color: var(--muted);
  min-width: 110px;
  text-align: right;
}

.experience-item p {
  font-size: 15.5px;
  color: var(--muted);
  line-height: 1.7;
  margin-left: 56px;
  max-width: 720px;
}

/* hover 轻动效 */
.experience-item:hover h3 {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}



/* --- Projects Section --- */
#projects {
  text-align: center;
  padding: 100px 0;
}

#projects .section-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 60px;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: 36px;
  justify-items: center;
  max-width: 1000px;
  margin: 0 auto;
}

.project-card {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 10px 25px var(--shadow);
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
}

.project-card img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.project-info {
  padding: 24px;
  text-align: left;
}

.project-info .pill {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
  color: var(--muted);
}

.project-info h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.project-info .desc {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 20px;
}

.project-link {
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  letter-spacing: 0.5px;
  transition: color 0.3s ease;
}

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

/* --- CONTACT --- */
#contact {
  text-align: center;
  padding: 100px 0 80px;
}

#contact .section-title {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 24px;
}

.contact-text {
  color: var(--muted);
  font-size: 17px;
  max-width: 640px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.contact-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.contact-links .email {
  font-weight: 600;
  color: var(--text);
  font-size: 18px;
  text-decoration: underline;
}

.social-links {
  display: flex;
  gap: 24px;
}

.social-links a {
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
}

.social-links a:hover {
  color: var(--orange);
}


.site-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
body {
  padding-top: 64px; /* 给正文留出导航栏高度空间 */
}
