/* ==========================================================
   动感超人 · 个人主页
   主题：深蓝简洁风（方案 A：HTML + CSS + 原生 JS）
   ========================================================== */

/* ---------- 变量与基础 ---------- */
:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-light: #DBEAFE;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --text: #1E293B;
  --text-muted: #64748B;
  --border: #E2E8F0;
  --shadow: 0 4px 16px rgba(30, 41, 59, .06);
  --shadow-lg: 0 12px 32px rgba(37, 99, 235, .18);
  --radius: 16px;
  --header-h: 64px;
  --maxw: 1100px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", "Noto Sans SC",
    system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

.container {
  width: min(var(--maxw), 100% - 48px);
  margin-inline: auto;
}

.link {
  color: var(--primary);
  font-weight: 500;
  border-bottom: 1px dashed currentColor;
}
.link:hover { color: var(--primary-dark); }

/* ---------- 顶部导航 ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  background: rgba(248, 250, 252, .85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  z-index: 100;
  transition: box-shadow .3s, border-color .3s;
}
.site-header.scrolled {
  box-shadow: var(--shadow);
  border-color: var(--border);
}

.nav {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.15rem;
}
.nav-logo img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.nav-menu { display: flex; gap: 8px; }

.nav-link {
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: .95rem;
  font-weight: 500;
  transition: color .2s, background .2s;
}
.nav-link:hover { color: var(--primary); background: var(--primary-light); }
.nav-link.is-active { color: var(--primary); background: var(--primary-light); }

/* 汉堡按钮（移动端） */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}
.nav-toggle .bar {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform .3s, opacity .3s;
}
.nav-toggle.open .bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open .bar:nth-child(2) { opacity: 0; }
.nav-toggle.open .bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- 首页 Hero ---------- */
.hero {
  position: relative;
  padding: calc(var(--header-h) + 96px) 0 120px;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(160deg, #EFF6FF 0%, var(--bg) 60%);
}
.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(600px 300px at 15% 10%, rgba(37, 99, 235, .10), transparent 60%),
    radial-gradient(500px 260px at 85% 20%, rgba(59, 130, 246, .10), transparent 60%);
}
.hero-content { position: relative; }

.hero-avatar {
  width: 128px;
  height: 128px;
  margin: 0 auto 28px;
  border-radius: 50%;
  box-shadow: var(--shadow-lg), 0 0 0 8px rgba(37, 99, 235, .12);
}

.hero h1 {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  letter-spacing: .5px;
}
.text-accent { color: var(--primary); }

.hero-subtitle {
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 1.08rem;
}

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

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: .98rem;
  transition: transform .2s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline {
  color: var(--primary);
  border: 2px solid var(--primary);
  background: transparent;
}
.btn-outline:hover { background: var(--primary-light); }

.scroll-hint {
  display: inline-block;
  margin-top: 48px;
  font-size: 1.4rem;
  color: var(--primary);
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* ---------- 通用板块 ---------- */
.section { padding: 88px 0; }
.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  text-align: center;
  position: relative;
  padding-bottom: 16px;
}
.section-title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 56px;
  height: 4px;
  border-radius: 4px;
  background: var(--primary);
}
.section-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin: 14px 0 48px;
}

/* ---------- 关于我 ---------- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.info-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.info-card:hover {
  transform: translateY(-4px);
  border-color: #BFDBFE;
  box-shadow: var(--shadow-lg);
}
.info-icon { font-size: 1.7rem; }
.info-card h3 { font-size: .85rem; color: var(--text-muted); font-weight: 500; }
.info-card > div { min-width: 0; }
.info-card p {
  font-weight: 600;
  font-size: 1.02rem;
  overflow-wrap: anywhere;
}

.intro-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow);
}
.intro-card h3 { color: var(--primary); margin-bottom: 12px; }
.intro-card p { color: #334155; }

/* ---------- 兴趣爱好 ---------- */
.hobby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.hobby-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform .25s, box-shadow .25s;
}
.hobby-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}
.hobby-emoji {
  display: block;
  font-size: 3rem;
  margin-bottom: 12px;
}
.hobby-card h3 { margin-bottom: 10px; font-size: 1.25rem; }
.hobby-card p { color: var(--text-muted); text-align: left; }
.hobby-tag {
  display: inline-block;
  margin-top: 18px;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: .85rem;
  font-weight: 600;
}

/* ---------- 联系我 ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}
.contact-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.contact-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: #BFDBFE;
}
.contact-card.bili:hover { border-color: #FBC7D6; }
.contact-icon {
  display: block;
  font-size: 2.6rem;
  margin-bottom: 10px;
}
.contact-card h3 { margin-bottom: 6px; font-size: 1.15rem; }
.contact-card p { color: var(--text-muted); overflow-wrap: anywhere; }
.contact-action {
  display: inline-block;
  margin-top: 14px;
  color: var(--primary);
  font-size: .9rem;
  font-weight: 600;
}
.contact-card.bili .contact-action { color: #FB7299; }

/* ---------- 学习计划（时间轴） ---------- */
.timeline {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  padding-left: 28px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border);
}

.timeline-group { position: relative; margin-bottom: 40px; }
.timeline-group:last-child { margin-bottom: 0; }

.timeline-heading {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  margin-bottom: 16px;
}
.timeline-heading em {
  font-style: normal;
  font-size: .8rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 10px;
  border-radius: 999px;
}
.timeline-dot {
  position: absolute;
  left: -28px;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  border: 4px solid var(--surface);
  box-shadow: 0 0 0 2px #BFDBFE;
}
.timeline-dot.dot-now { animation: pulse 2s infinite; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(37, 99, 235, .35); }
  70%  { box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

.timeline-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  transition: transform .25s, box-shadow .25s;
}
.timeline-card:last-child { margin-bottom: 0; }
.timeline-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-lg);
}

.timeline-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.badge {
  font-size: .78rem;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 999px;
}
.badge-progress { background: #DCFCE7; color: #16A34A; }
.badge-todo     { background: var(--primary-light); color: var(--primary); }
.badge-future   { background: #FEF3C7; color: #D97706; }
.timeline-date  { font-size: .82rem; color: var(--text-muted); }

.timeline-card h4 { margin-bottom: 6px; font-size: 1.05rem; }
.timeline-card p  { color: var(--text-muted); font-size: .95rem; }

/* ---------- 页脚 ---------- */
.site-footer {
  background: #0F172A;
  color: #94A3B8;
  padding: 36px 0;
  text-align: center;
}
.footer-content p { margin: 4px 0; }
.site-footer .link { color: #93C5FD; }

/* 备案信息 */
.footer-beian {
  margin-top: 14px;
  font-size: .85rem;
  letter-spacing: .3px;
}
.footer-beian .link {
  color: #94A3B8;
  transition: color .2s ease;
}
.footer-beian .link:hover { color: #93C5FD; }

/* ---------- 返回顶部 ---------- */
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .3s, transform .3s, background .2s;
  z-index: 90;
}
.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.back-to-top:hover { background: var(--primary-dark); }

/* ---------- 入场动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease;
}
.reveal.visible { opacity: 1; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 768px) {
  .nav-toggle { display: flex; }

  .nav-menu {
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 4px;
    background: var(--surface);
    padding: 16px 24px 20px;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity .25s, transform .25s;
  }
  .nav-menu.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .nav-link { display: block; padding: 12px 16px; }

  .hero { padding-top: calc(var(--header-h) + 64px); }
  .hero-avatar { width: 104px; height: 104px; }
  .section { padding: 64px 0; }
  .intro-card { padding: 24px; }
}

/* ---------- 无障碍：减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-hint, .timeline-dot.dot-now { animation: none; }
}
