:root {
  --bg: #0a0e17;
  --bg-soft: #111827;
  --bg-card: #141d2e;
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --text-faint: #64748b;
  --accent: #22d3ee;
  --accent-2: #a78bfa;
  --accent-3: #34d399;
  --border: #1f2a3d;
  --mono: 'JetBrains Mono', 'Courier New', monospace;
  --sans: 'Noto Sans SC', 'PingFang SC', sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 70px;
}

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

::selection {
  background: var(--accent);
  color: var(--bg);
}

::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg);
}
::-webkit-scrollbar-thumb {
  background: #243047;
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent);
}

.container {
  width: min(1100px, 90%);
  margin: 0 auto;
}

/* ---------- 背景装饰 ---------- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.04) 1px, transparent 1px);
  background-size: 46px 46px;
  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;
  z-index: -1;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  pointer-events: none;
}
.glow-1 {
  width: 500px;
  height: 500px;
  top: -150px;
  left: -100px;
  background: var(--accent);
}
.glow-2 {
  width: 420px;
  height: 420px;
  bottom: -120px;
  right: -80px;
  background: var(--accent-2);
}

/* ---------- 导航栏 ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 14, 23, 0.75);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}
.navbar.scrolled {
  border-color: var(--border);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-family: var(--mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
}
.nav-links {
  display: flex;
  gap: 28px;
}
.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.25s;
  position: relative;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s;
}
.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

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

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 64px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  color: var(--accent-3);
  border: 1px solid rgba(52, 211, 153, 0.3);
  padding: 6px 14px;
  border-radius: 99px;
  margin-bottom: 28px;
}
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-3);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  50% { box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
}
.hero-title {
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  font-weight: 700;
  line-height: 1.15;
}
.hero-title .hello {
  display: block;
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  font-weight: 400;
  color: var(--text-dim);
  margin-bottom: 10px;
}
.hero-title .name {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-typed {
  font-family: var(--mono);
  font-size: clamp(1rem, 3vw, 1.5rem);
  color: var(--text-dim);
  margin-top: 22px;
  min-height: 2.4rem;
}
.hero-typed .prefix {
  color: var(--accent-3);
  margin-right: 8px;
}
.cursor {
  color: var(--accent);
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}
.hero-desc {
  margin-top: 18px;
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 520px;
}
.hero-actions {
  margin-top: 34px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.btn {
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.25s;
  cursor: pointer;
  font-family: var(--sans);
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #071018;
  font-weight: 600;
  border: none;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(34, 211, 238, 0.3);
}
.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
  background: transparent;
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.hero-stats {
  display: flex;
  gap: 48px;
  margin-top: 60px;
}
.stat {
  display: flex;
  flex-direction: column;
}
.stat-num {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-faint);
}

/* ---------- 通用板块 ---------- */
.section {
  padding: 100px 0;
}
.section-title {
  font-size: 1.9rem;
  font-weight: 700;
  margin-bottom: 48px;
}
.section-title .hash {
  color: var(--accent);
  margin-right: 8px;
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 56px;
  align-items: start;
}
.about-text p {
  color: var(--text-dim);
  margin-bottom: 16px;
  font-size: 1.02rem;
}
.skills h3 {
  font-size: 1rem;
  color: var(--accent);
  font-family: var(--mono);
  margin: 24px 0 14px;
}
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tag {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  border: 1px solid rgba(34, 211, 238, 0.3);
  background: rgba(34, 211, 238, 0.06);
  padding: 5px 12px;
  border-radius: 6px;
  transition: all 0.25s;
}
.tag:hover {
  background: var(--accent);
  color: var(--bg);
}

.terminal {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #0b1120;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #151d2e;
  border-bottom: 1px solid var(--border);
}
.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.dot.red { background: #f87171; }
.dot.yellow { background: #fbbf24; }
.dot.green { background: #34d399; }
.term-title {
  margin-left: 8px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-faint);
}
.terminal-body {
  padding: 18px 20px;
  font-family: var(--mono);
  font-size: 0.88rem;
  line-height: 1.9;
}
.terminal-body .prompt {
  color: var(--accent-3);
}
.terminal-body .out {
  color: var(--text-dim);
  padding-left: 12px;
}

/* ---------- 项目 ---------- */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 26px;
  transition: all 0.3s;
}
.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(34, 211, 238, 0.5);
  box-shadow: 0 12px 40px rgba(34, 211, 238, 0.12);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.folder {
  font-size: 1.6rem;
  color: var(--accent);
}
.card-links {
  display: flex;
  gap: 14px;
}
.card-links a {
  color: var(--text-faint);
  text-decoration: none;
  font-size: 1.1rem;
  transition: color 0.25s;
}
.card-links a:hover {
  color: var(--accent);
}
.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text);
  transition: color 0.25s;
}
.project-card:hover .card-title {
  color: var(--accent);
}
.card-desc {
  color: var(--text-dim);
  font-size: 0.92rem;
  min-height: 84px;
}
.card-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-faint);
}
.more-link {
  text-align: center;
  margin-top: 44px;
}
.more-link a {
  color: var(--accent);
  text-decoration: none;
  font-size: 1rem;
  transition: letter-spacing 0.25s;
}
.more-link a:hover {
  letter-spacing: 2px;
}

/* ---------- 时间线 ---------- */
.timeline {
  position: relative;
  padding-left: 32px;
  max-width: 760px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2), transparent);
}
.timeline-item {
  position: relative;
  padding-bottom: 48px;
}
.timeline-item:last-child {
  padding-bottom: 0;
}
.timeline-marker {
  position: absolute;
  left: -32px;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  box-shadow: 0 0 12px rgba(34, 211, 238, 0.5);
}
.period {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent-2);
}
.timeline-content h3 {
  font-size: 1.15rem;
  margin: 6px 0 8px;
}
.timeline-content p {
  color: var(--text-dim);
  font-size: 0.95rem;
}

/* ---------- 博客 ---------- */
.blog-list {
  display: flex;
  flex-direction: column;
  max-width: 760px;
}
.blog-item {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  transition: all 0.25s;
}
.blog-item:hover {
  background: var(--bg-card);
  padding-left: 24px;
}
.blog-date {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-faint);
  flex-shrink: 0;
  width: 72px;
}
.blog-title {
  flex: 1;
  color: var(--text);
  font-size: 1rem;
  transition: color 0.25s;
}
.blog-item:hover .blog-title {
  color: var(--accent);
}
.blog-arrow {
  color: var(--text-faint);
  transition: transform 0.25s;
}
.blog-item:hover .blog-arrow {
  transform: translateX(4px);
  color: var(--accent);
}

/* ---------- 联系 ---------- */
.contact-inner {
  text-align: center;
}
.contact-inner .section-title {
  text-align: left;
}
.contact-sub {
  color: var(--text-dim);
  margin-bottom: 44px;
  text-align: left;
}
.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}
.contact-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  text-decoration: none;
  transition: all 0.3s;
}
.contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
}
.contact-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid rgba(34, 211, 238, 0.4);
  border-radius: 10px;
  background: rgba(34, 211, 238, 0.06);
  margin-bottom: 6px;
}
.contact-label {
  font-size: 0.8rem;
  color: var(--text-faint);
}
.contact-value {
  color: var(--text);
  font-size: 0.95rem;
  word-break: break-all;
}

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 36px 0;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
}
.footer p {
  color: var(--text-faint);
  font-size: 0.9rem;
}
.footer-code {
  font-family: var(--mono);
  font-size: 0.78rem !important;
}

/* ---------- 滚动进场动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 响应式 ---------- */
@media (max-width: 860px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
  .nav-toggle {
    display: flex;
  }
  .nav-links {
    position: fixed;
    top: 64px;
    right: 0;
    flex-direction: column;
    background: rgba(10, 14, 23, 0.97);
    border-left: 1px solid var(--border);
    padding: 24px 32px;
    gap: 18px;
    transform: translateX(100%);
    transition: transform 0.3s;
    min-width: 200px;
  }
  .nav-links.open {
    transform: translateX(0);
  }
  .hero-stats {
    gap: 28px;
  }
}
@media (max-width: 480px) {
  .section {
    padding: 70px 0;
  }
  .blog-item {
    flex-wrap: wrap;
    gap: 8px;
  }
}
