/* ===== 基础变量 ===== */
:root {
  --bg: #0b1020;
  --bg-alt: #0f1630;
  --card: #151d3b;
  --border: #232d52;
  --text: #e6ebff;
  --text-dim: #9aa5c9;
  --accent: #6c8bff;
  --accent-2: #41e0d0;
  --gradient: linear-gradient(135deg, #6c8bff 0%, #41e0d0 100%);
  --radius: 14px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

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

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

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

/* ===== 导航栏 ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 16px 0;
  transition: background .3s, box-shadow .3s, padding .3s;
}
.navbar.scrolled {
  background: rgba(11, 16, 32, .88);
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, .35);
  padding: 10px 0;
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo { font-size: 1.25rem; font-weight: 700; }
.logo-icon { color: var(--accent-2); margin-right: 4px; }

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}
.nav-links a {
  font-size: .95rem;
  color: var(--text-dim);
  transition: color .2s;
  position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -6px;
  height: 2px;
  background: var(--gradient);
  border-radius: 2px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: .3s;
}

/* ===== 首屏 ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}
#neuralCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-content {
  position: relative;
  z-index: 2;
  padding-top: 80px;
}
.hero-tag {
  color: var(--accent-2);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: .95rem;
  margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: 1px;
}
.typing-line {
  font-size: clamp(1.3rem, 3vw, 2rem);
  font-weight: 600;
  margin: 12px 0 20px;
  min-height: 1.6em;
}
.cursor {
  color: var(--accent-2);
  animation: blink 1s step-start infinite;
}
@keyframes blink { 50% { opacity: 0; } }

.hero-desc {
  max-width: 560px;
  color: var(--text-dim);
  margin-bottom: 32px;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 999px;
  font-size: .95rem;
  font-weight: 600;
  transition: transform .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--gradient);
  color: #081020;
  box-shadow: 0 8px 24px rgba(108, 139, 255, .35);
}
.btn-ghost {
  border: 1px solid var(--border);
  color: var(--text);
  margin-left: 12px;
}
.btn-ghost:hover { border-color: var(--accent); }

.scroll-down {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 2;
  font-size: 1.6rem;
  color: var(--text-dim);
  animation: float 2s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* ===== 通用区块 ===== */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-alt); }

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 40px;
}
.section-title .accent { margin-right: 6px; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tags span {
  font-size: .78rem;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(108, 139, 255, .12);
  color: var(--accent);
  border: 1px solid rgba(108, 139, 255, .25);
}

/* ===== 关于我 ===== */
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
}
.about-text p { color: var(--text-dim); margin-bottom: 16px; }
.about-text strong { color: var(--text); }

.about-facts {
  list-style: none;
  margin-top: 24px;
  display: grid;
  gap: 12px;
}
.about-facts li {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: .92rem;
}
.about-facts li span {
  display: inline-block;
  min-width: 96px;
  color: var(--accent-2);
  font-weight: 600;
  margin-right: 8px;
}

.terminal {
  background: #0d1330;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .4);
}
.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: #101838;
  border-bottom: 1px solid var(--border);
}
.terminal-bar i {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #ff5f57;
}
.terminal-bar i:nth-child(2) { background: #febc2e; }
.terminal-bar i:nth-child(3) { background: #28c840; }
.terminal-bar span {
  margin-left: 8px;
  font-size: .8rem;
  color: var(--text-dim);
  font-family: Consolas, monospace;
}
.terminal pre {
  padding: 22px;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: .85rem;
  line-height: 1.8;
  overflow-x: auto;
}
.c-kw  { color: #c792ea; }
.c-cls { color: #82aaff; }
.c-fn  { color: #41e0d0; }
.c-str { color: #ecc48d; }

/* ===== 技术栈 ===== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.skill-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: transform .25s, border-color .25s;
}
.skill-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
}
.skill-icon { font-size: 2rem; margin-bottom: 12px; }
.skill-card h3 { font-size: 1.05rem; margin-bottom: 14px; }

/* ===== 项目实践 ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.project-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.project-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
  box-shadow: 0 20px 44px rgba(0, 0, 0, .35);
}
.project-cover {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cover-1 { background: linear-gradient(135deg, #2b3a75, #4a5fc9); }
.cover-2 { background: linear-gradient(135deg, #1f4d5a, #2f8a8a); }
.cover-3 { background: linear-gradient(135deg, #4a2f6b, #7a4fb0); }
.project-emoji { font-size: 3rem; filter: drop-shadow(0 6px 12px rgba(0,0,0,.3)); }
.project-body { padding: 22px; }
.project-body h3 { font-size: 1.08rem; margin-bottom: 10px; }
.project-body p {
  font-size: .9rem;
  color: var(--text-dim);
  margin-bottom: 16px;
}

/* ===== 学习笔记 ===== */
.blog-list { display: grid; gap: 18px; }
.blog-item {
  display: flex;
  gap: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  transition: transform .25s, border-color .25s;
  cursor: pointer;
}
.blog-item:hover {
  transform: translateX(6px);
  border-color: var(--accent);
}
.blog-date {
  flex-shrink: 0;
  width: 64px;
  text-align: center;
  border-right: 1px solid var(--border);
  padding-right: 24px;
}
.blog-date strong {
  display: block;
  font-size: 1.3rem;
  color: var(--accent-2);
  white-space: nowrap;
}
.blog-date span {
  font-size: .78rem;
  color: var(--text-dim);
}
.blog-body h3 { font-size: 1.08rem; margin-bottom: 8px; }
.blog-body p {
  font-size: .9rem;
  color: var(--text-dim);
  margin-bottom: 12px;
}

/* ===== 联系我 ===== */
.contact-desc {
  color: var(--text-dim);
  max-width: 520px;
  margin-bottom: 36px;
}
.contact-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.contact-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  transition: transform .25s, border-color .25s;
}
.contact-card:hover {
  transform: translateY(-6px);
  border-color: var(--accent-2);
}
.contact-icon { font-size: 2rem; margin-bottom: 10px; }
.contact-card h3 { font-size: 1rem; margin-bottom: 6px; }
.contact-card p { font-size: .85rem; color: var(--text-dim); }

/* ===== 页脚 ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  text-align: center;
  color: var(--text-dim);
  font-size: .85rem;
}
.beian { margin-top: 8px; }
.beian a { color: var(--text-dim); }
.beian a:hover { color: var(--accent); }

/* ===== 响应式 ===== */
@media (max-width: 860px) {
  .about-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    top: 0; right: -100%;
    height: 100vh;
    width: min(70vw, 280px);
    flex-direction: column;
    justify-content: center;
    gap: 32px;
    padding: 0 40px;
    background: rgba(15, 22, 48, .97);
    backdrop-filter: blur(16px);
    transition: right .35s ease;
  }
  .nav-links.open { right: 0; }
  .nav-links a { font-size: 1.1rem; }
  .nav-toggle { display: flex; z-index: 101; }
  .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); }

  .section { padding: 64px 0; }
  .blog-item { flex-direction: column; gap: 12px; }
  .blog-date {
    width: auto;
    text-align: left;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 0 0 10px;
    display: flex;
    gap: 8px;
    align-items: baseline;
  }
  .btn-ghost { margin-left: 0; margin-top: 12px; }
  .hero-btns { display: flex; flex-direction: column; align-items: flex-start; gap: 0; }
}
