:root {
  --bg: #070b14;
  --bg-soft: #0d1322;
  --panel: rgba(22, 30, 50, 0.55);
  --panel-border: rgba(120, 160, 255, 0.14);
  --text: #e6ecf7;
  --text-dim: #93a0b8;
  --accent: #5b8cff;
  --accent-2: #a06bff;
  --accent-3: #22d3ee;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --sans: "Inter", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

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

/* 背景装饰 */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(120, 160, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 160, 255, 0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 40%, transparent 100%);
}

.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(600px 320px at 18% 8%, rgba(91, 140, 255, 0.18), transparent 70%),
    radial-gradient(600px 320px at 85% 12%, rgba(160, 107, 255, 0.16), transparent 70%);
}

/* 导航 */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 16px 40px;
  background: rgba(7, 11, 20, 0.7);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--panel-border);
}

.nav-logo {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.5px;
}

.nav-logo .dot { color: var(--accent-3); }

.nav-links { display: flex; gap: 24px; margin-left: auto; }

.nav-links a {
  font-size: 14px;
  color: var(--text-dim);
  transition: color 0.2s;
}

.nav-links a:hover { color: var(--text); }

.nav-cta {
  font-size: 14px;
  padding: 8px 18px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  transition: all 0.2s;
}

.nav-cta:hover { border-color: var(--accent); color: #fff; }

/* Hero */
.hero {
  max-width: 760px;
  margin: 0 auto;
  padding: 96px 24px 64px;
  text-align: center;
}

.hero-avatar {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto 28px;
}

.hero-avatar img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 2px solid rgba(120, 160, 255, 0.35);
  box-shadow: 0 0 0 6px rgba(91, 140, 255, 0.08), 0 0 40px rgba(91, 140, 255, 0.25);
}

.status-dot {
  position: absolute;
  right: 6px;
  bottom: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #34d399;
  border: 3px solid var(--bg);
  box-shadow: 0 0 0 2px rgba(52, 211, 153, 0.4);
}

.hero-name {
  margin: 0;
  font-size: 44px;
  font-weight: 800;
  letter-spacing: -1px;
  background: linear-gradient(120deg, #fff, #b9cfff 60%, #c9b3ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-title {
  margin: 10px 0 0;
  font-family: var(--mono);
  font-size: 15px;
  color: var(--accent-3);
}

.hero-typing {
  margin: 16px 0 0;
  font-family: var(--mono);
  font-size: 16px;
  color: var(--text);
  min-height: 26px;
}

.hero-typing .typing { color: var(--accent); }

.cursor {
  display: inline-block;
  margin-left: 2px;
  color: var(--accent-3);
  animation: blink 1s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.hero-desc {
  max-width: 560px;
  margin: 20px auto 0;
  color: var(--text-dim);
  font-size: 16px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin-top: 32px;
}

.btn {
  font-size: 15px;
  font-weight: 600;
  padding: 11px 26px;
  border-radius: 10px;
  transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
}

.btn:hover { transform: translateY(-2px); }

.btn-primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 8px 24px rgba(91, 140, 255, 0.35);
}

.btn-ghost {
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--text);
}

.btn-ghost:hover { border-color: var(--accent); }

.hero-social {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-top: 26px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-dim);
}

.hero-social a:hover { color: var(--accent-3); }

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-top: 30px;
}

.hero-tags span {
  font-family: var(--mono);
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--text-dim);
}

/* Section 通用 */
.section {
  max-width: 980px;
  margin: 0 auto;
  padding: 72px 24px;
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 32px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.section-title span {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--accent-3);
}

/* About */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}

.about-card {
  padding: 26px;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  backdrop-filter: blur(10px);
}

.about-card p { margin: 0 0 14px; color: var(--text-dim); }
.about-card p:last-child { margin-bottom: 0; }

.about-list { list-style: none; margin: 0; padding: 0; }

.about-list li {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(120, 160, 255, 0.12);
}

.about-list li:last-child { border-bottom: none; }
.about-list strong { font-family: var(--mono); font-weight: 600; color: var(--text); }
.about-list span { color: var(--text-dim); font-size: 14px; }

/* Blog */
.blog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.blog-card {
  padding: 26px;
  border-radius: 14px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  backdrop-filter: blur(10px);
  transition: transform 0.2s, border-color 0.2s;
}

.blog-card:hover {
  transform: translateY(-4px);
  border-color: rgba(91, 140, 255, 0.4);
}

.blog-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
}

.blog-tag {
  color: var(--accent-3);
  border: 1px solid rgba(34, 211, 238, 0.3);
  padding: 2px 10px;
  border-radius: 999px;
}

.blog-card h3 { font-size: 18px; margin: 16px 0 10px; }
.blog-card p { margin: 0; color: var(--text-dim); font-size: 14px; }

.blog-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s ease;
  margin-top: 14px;
}

.blog-body > p {
  overflow: hidden;
  min-height: 0;
  margin: 0 0 10px;
  color: var(--text-dim);
  font-size: 14px;
}

.blog-body > p:last-child { margin-bottom: 0; }

.blog-card.open .blog-body { grid-template-rows: 1fr; }

.blog-link {
  display: inline-block;
  margin-top: 18px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.2s;
}

.blog-card.open .blog-link { margin-top: 14px; }

.blog-link:hover { color: var(--accent-3); }

.blog-card.open .blog-link::before { content: "收起 ▲  "; }

/* Contact */
.contact-card {
  padding: 40px;
  border-radius: 16px;
  text-align: center;
  border: 1px solid var(--panel-border);
  background: var(--panel);
}

.contact-card p { color: var(--text-dim); }

.contact-list {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
  font-family: var(--mono);
  font-size: 14px;
}

.contact-list a {
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid var(--panel-border);
  transition: border-color 0.2s, color 0.2s;
}

.contact-list a:hover { border-color: var(--accent); color: var(--accent-3); }

/* Footer */
.footer {
  text-align: center;
  padding: 40px 24px;
  color: var(--text-dim);
  font-size: 13px;
  border-top: 1px solid var(--panel-border);
}

.footer .heart { color: #ff5d8f; }

/* 返回顶部 */
.back-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--accent-3);
  font-size: 18px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s, border-color 0.2s;
}

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

.back-top:hover { border-color: var(--accent); }

/* 滚动淡入 */
.about-card, .blog-card, .contact-card {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.about-card.in, .blog-card.in, .contact-card.in {
  opacity: 1;
  transform: translateY(0);
}

/* 响应式 */
@media (max-width: 720px) {
  .nav { padding: 14px 20px; gap: 16px; }
  .nav-links { display: none; }
  .nav-cta { margin-left: auto; }
  .hero { padding-top: 72px; }
  .hero-name { font-size: 34px; }
  .about-grid, .blog-grid { grid-template-columns: 1fr; }
}
