/* ===== 变量与基础 ===== */
:root {
  --bg: #0a0c10;
  --bg-soft: #0f1218;
  --surface: #12161e;
  --border: #1f2632;
  --text: #e6edf3;
  --text-dim: #8b949e;
  --accent: #4dd0ff;
  --accent-2: #7c5cff;
  --accent-grad: linear-gradient(135deg, #4dd0ff 0%, #7c5cff 100%);
  --radius: 14px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Fira Code", Consolas, monospace;
  --nav-h: 64px;
}

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

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

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

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
.accent { color: var(--accent); }

::selection { background: rgba(77, 208, 255, 0.3); }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2a3240; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #3a4354; }

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

.grid-bg {
  position: fixed;
  inset: 0;
  z-index: -4;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}

.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -2;
  pointer-events: none;
  opacity: 0.5;
}
.glow-1 {
  width: 480px; height: 480px;
  background: rgba(77, 208, 255, 0.16);
  top: -120px; left: -120px;
  animation: float 16s ease-in-out infinite;
}
.glow-2 {
  width: 520px; height: 520px;
  background: rgba(124, 92, 255, 0.14);
  bottom: -160px; right: -140px;
  animation: float 20s ease-in-out infinite reverse;
}
@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(40px, 30px); }
}

/* ===== 导航 ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 100;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(10, 12, 16, 0.65);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 20px;
  font-family: var(--font-mono);
}
.logo-mark {
  color: var(--accent);
  font-size: 18px;
}
.nav-links { display: flex; gap: 32px; }
.nav-link {
  font-size: 14px;
  color: var(--text-dim);
  transition: color 0.25s;
  position: relative;
  font-family: var(--font-mono);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -6px;
  width: 0; height: 2px;
  background: var(--accent-grad);
  transition: width 0.25s;
}
.nav-link:hover, .nav-link.active { color: var(--text); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.menu-btn span {
  width: 24px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.3s;
}
.menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-btn.open span:nth-child(2) { opacity: 0; }
.menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 120px 24px 60px;
}
.hero-inner { max-width: 820px; text-align: center; }
.hero-greeting {
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 15px;
  margin-bottom: 16px;
  letter-spacing: 1px;
}
.hero-name {
  font-size: clamp(44px, 8vw, 76px);
  font-weight: 700;
  letter-spacing: -1px;
  line-height: 1.1;
  background: linear-gradient(180deg, #fff 30%, #aab4c4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-role {
  font-family: var(--font-mono);
  font-size: clamp(18px, 3.4vw, 26px);
  font-weight: 500;
  color: var(--text-dim);
  margin: 18px 0 24px;
  min-height: 1.6em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.prompt { color: var(--accent); }
.cursor {
  color: var(--accent);
  animation: blink 1s step-end infinite;
  font-weight: 400;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-desc {
  max-width: 600px;
  margin: 0 auto 32px;
  color: var(--text-dim);
  font-size: 17px;
}
.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 26px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
  font-family: var(--font-mono);
}
.btn-primary {
  background: var(--accent-grad);
  color: #081018;
  border: 1px solid transparent;
  box-shadow: 0 4px 24px rgba(77, 208, 255, 0.35);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(77, 208, 255, 0.5); }
.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--accent); transform: translateY(-2px); background: rgba(77, 208, 255, 0.06); }
.btn-lg { padding: 16px 36px; font-size: 16px; }

.hero-meta {
  display: flex;
  justify-content: center;
  gap: 48px;
  flex-wrap: wrap;
}
.meta-item { display: flex; flex-direction: column; }
.meta-num {
  font-family: var(--font-mono);
  font-size: 34px;
  font-weight: 700;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.meta-label { font-size: 13px; color: var(--text-dim); }

.scroll-hint {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
}
.mouse {
  width: 26px; height: 42px;
  border: 2px solid var(--text-dim);
  border-radius: 14px;
  display: flex;
  justify-content: center;
  padding-top: 7px;
}
.wheel {
  width: 3px; height: 8px;
  background: var(--accent);
  border-radius: 2px;
  animation: scroll-wheel 1.6s ease-in-out infinite;
}
@keyframes scroll-wheel {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(12px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ===== 通用 Section ===== */
.section { padding: 100px 24px; position: relative; }
.section-inner { max-width: 1120px; margin: 0 auto; }
.section-title {
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-title .accent {
  font-family: var(--font-mono);
  font-size: 0.75em;
}
.section-title::after {
  content: "";
  flex: 1;
  max-width: 260px;
  height: 1px;
  background: var(--border);
}
.center-title { justify-content: center; }
.center-title::after { display: none; }
.section-sub { color: var(--text-dim); margin-bottom: 40px; font-size: 16px; }

/* ===== 关于 ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 48px;
  align-items: center;
}
.about-text p { color: var(--text-dim); margin-bottom: 16px; font-size: 16px; }
.about-text strong { color: var(--text); }
.about-points {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.about-points li {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}
.about-points li::before {
  content: "▸";
  color: var(--accent);
}

/* 终端卡片 */
.about-card { display: flex; justify-content: center; }
.card-frame {
  padding: 2px;
  border-radius: var(--radius);
  background: var(--accent-grad);
  width: 100%;
  max-width: 400px;
  box-shadow: 0 16px 48px rgba(77, 208, 255, 0.15);
}
.card-avatar {
  background: var(--bg-soft);
  border-radius: calc(var(--radius) - 2px);
  padding: 30px 24px 28px;
  text-align: center;
}
.card-avatar svg {
  display: block;
  width: 100%;
  max-width: 190px;
  margin: 0 auto 18px;
}
.avatar-name {
  font-family: var(--font-mono);
  font-size: 21px;
  font-weight: 700;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.avatar-role {
  color: var(--text-dim);
  font-size: 14px;
  margin-top: 4px;
}

/* ===== 文章 ===== */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.article-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.25s, border-color 0.25s;
  display: flex;
  flex-direction: column;
}
.article-card:hover {
  transform: translateY(-6px);
  border-color: rgba(77, 208, 255, 0.4);
}
.article-date {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.article-title { font-size: 19px; font-weight: 600; margin-bottom: 10px; }
.article-title a { transition: color 0.2s; }
.article-title a:hover { color: var(--accent); }
.article-desc {
  color: var(--text-dim);
  font-size: 15px;
  margin-bottom: 18px;
  flex: 1;
}
.article-more {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--accent);
  transition: color 0.2s;
}
.article-more:hover { color: var(--accent-2); }

/* ===== 项目 ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: transform 0.25s, border-color 0.25s;
  position: relative;
  overflow: hidden;
}
.project-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent-grad);
  opacity: 0;
  transition: opacity 0.3s;
}
.project-card:hover { transform: translateY(-6px); border-color: rgba(77, 208, 255, 0.4); }
.project-card:hover::before { opacity: 1; }
.project-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.project-folder { font-size: 34px; }
.project-links a { font-size: 20px; transition: color 0.2s; }
.project-links a:hover { color: var(--accent); }
.project-title { font-size: 20px; font-weight: 600; margin-bottom: 12px; }
.project-title:hover { color: var(--accent); cursor: pointer; }
.project-desc { color: var(--text-dim); font-size: 15px; margin-bottom: 18px; }
.project-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.project-tags li {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  background: rgba(77, 208, 255, 0.08);
  padding: 4px 10px;
  border-radius: 20px;
}
.center { text-align: center; margin-top: 40px; }

/* ===== 时间线 ===== */
.timeline {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding-left: 32px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  opacity: 0.4;
}
.timeline-item { position: relative; padding-bottom: 40px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -30px;
  top: 6px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  box-shadow: 0 0 12px rgba(77, 208, 255, 0.6);
}
.timeline-content h3 { font-size: 19px; font-weight: 600; }
.company { color: var(--accent); font-family: var(--font-mono); font-size: 0.85em; }
.timeline-date {
  font-family: var(--font-mono);
  color: var(--text-dim);
  font-size: 13px;
  margin: 4px 0 8px;
}
.timeline-content p:last-child { color: var(--text-dim); font-size: 15px; }

/* ===== 联系 ===== */
.contact-text {
  max-width: 480px;
  margin: 0 auto 32px;
  color: var(--text-dim);
  font-size: 16px;
}
.socials {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 44px;
}
.socials a {
  width: 46px; height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-dim);
  transition: 0.25s;
}
.socials a:hover {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(77, 208, 255, 0.2);
}

/* ===== 页脚 ===== */
.footer {
  padding: 40px 24px;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 14px;
}
.footer-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  margin-top: 6px;
  opacity: 0.6;
}

/* ===== 滚动淡入动画 ===== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .articles-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    background: rgba(10, 12, 16, 0.96);
    backdrop-filter: blur(14px);
    padding: 20px 24px;
    gap: 18px;
    border-bottom: 1px solid var(--border);
    transform: translateY(-120%);
    transition: transform 0.3s ease;
  }
  .nav-links.open { transform: translateY(0); }
  .menu-btn { display: flex; }
  .hero-meta { gap: 28px; }
  .section { padding: 72px 20px; }
}

/* 无障碍：减少动画 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}
