/* ============================================
   王楦澜 · 个人主页 样式
   浅色优雅风 / 响应式
   ============================================ */

:root {
  --primary: #4f6df5;
  --primary-dark: #3a54d4;
  --accent: #f59e42;
  --ink: #1e2433;
  --ink-soft: #4a5468;
  --ink-mute: #8a93a6;
  --bg: #ffffff;
  --bg-soft: #f5f7fc;
  --bg-card: #ffffff;
  --border: #e6eaf3;
  --shadow: 0 10px 40px rgba(40, 60, 120, 0.08);
  --shadow-hover: 0 16px 48px rgba(40, 60, 120, 0.14);
  --radius: 16px;
  --max-w: 1120px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 导航栏 ---------- */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s;
}
.navbar.scrolled {
  border-bottom-color: var(--border);
  box-shadow: 0 4px 20px rgba(40, 60, 120, 0.06);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--ink);
  text-decoration: none;
}
.logo span { color: var(--primary); }
.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}
.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: color .25s;
}
.nav-links a:hover { color: var(--primary); }
.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(--ink);
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 110px 0 60px;
  background:
    radial-gradient(900px 500px at 85% 10%, rgba(79, 109, 245, 0.10), transparent 60%),
    radial-gradient(700px 420px at 5% 90%, rgba(245, 158, 66, 0.08), transparent 60%),
    var(--bg);
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 56px;
  align-items: center;
}
.hero-greeting {
  color: var(--primary);
  font-weight: 600;
  font-size: 17px;
  margin-bottom: 6px;
}
.hero-name {
  font-size: clamp(40px, 6vw, 60px);
  font-weight: 800;
  letter-spacing: 4px;
  line-height: 1.15;
  margin-bottom: 10px;
}
.hero-title {
  font-size: 18px;
  color: var(--ink-soft);
  font-weight: 600;
  margin-bottom: 18px;
}
.hero-desc {
  color: var(--ink-mute);
  max-width: 540px;
  margin-bottom: 30px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 42px; }

.btn {
  display: inline-block;
  padding: 13px 30px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform .25s, box-shadow .25s, background .25s, color .25s;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 24px rgba(79, 109, 245, 0.35);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); }
.btn-ghost {
  border-color: var(--border);
  color: var(--ink-soft);
  background: #fff;
}
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }

.hero-facts {
  display: flex;
  gap: 40px;
  list-style: none;
  flex-wrap: wrap;
}
.hero-facts li { display: flex; flex-direction: column; }
.hero-facts strong {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
}
.hero-facts span { font-size: 13px; color: var(--ink-mute); }

.hero-photo { display: flex; justify-content: center; }

/* 圆形 QQ 头像（显著展示） */
.avatar-wrap {
  position: relative;
  width: min(280px, 62vw);
  aspect-ratio: 1 / 1;
}
.avatar-main {
  width: 100%; height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 6px solid #fff;
  box-shadow: 0 18px 50px rgba(40, 60, 120, 0.22);
  position: relative;
  z-index: 2;
  transition: transform .4s;
}
.avatar-main:hover { transform: scale(1.04); }
.avatar-main.avatar-switching {
  opacity: 0.25;
  transition: opacity .3s;
}
.avatar-ring {
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 2px dashed rgba(79, 109, 245, 0.5);
  animation: spin 18s linear infinite;
  z-index: 1;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 关于我侧栏 */
.about-side { display: flex; flex-direction: column; gap: 24px; }

/* ---------- 通用 Section ---------- */
.section { padding: 96px 0; }
.section-alt { background: var(--bg-soft); }
.section-title {
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 800;
  margin-bottom: 48px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.section-title .num {
  font-size: 16px;
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 1px;
}
.section-lead {
  color: var(--ink-mute);
  margin-top: -32px;
  margin-bottom: 40px;
}

/* ---------- 关于我 ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 48px;
  align-items: start;
}
.about-text p { margin-bottom: 18px; color: var(--ink-soft); }
.about-text strong { color: var(--ink); }
.about-quote {
  background: var(--bg-card);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 28px;
  box-shadow: var(--shadow);
}
.about-quote p {
  color: var(--ink-soft);
  font-style: italic;
  margin-bottom: 14px;
}
.about-quote footer { color: var(--ink-mute); font-size: 14px; }

/* ---------- 技能 ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.skill-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 26px;
  transition: transform .3s, box-shadow .3s;
}
.skill-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }
.skill-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(79,109,245,.12), rgba(79,109,245,.04));
  color: var(--primary);
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}
.skill-card h3 { font-size: 18px; margin-bottom: 8px; }
.skill-card p { font-size: 14px; color: var(--ink-mute); margin-bottom: 16px; }
.skill-bar {
  height: 6px;
  border-radius: 6px;
  background: var(--bg-soft);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  width: 0;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--primary), #7d97ff);
  transition: width 1.2s cubic-bezier(.22,.61,.36,1);
}
.bar-fill.animate { width: var(--w); }

/* ---------- 项目 ---------- */
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: transform .3s, box-shadow .3s;
}
.project-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.project-card.featured {
  border: none;
  background: linear-gradient(135deg, #ffffff 0%, #f2f5ff 100%);
  box-shadow: var(--shadow);
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}
.project-card.featured::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}
.project-badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(79,109,245,.1);
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.project-card h3 { font-size: 21px; margin-bottom: 6px; }
.project-sub { color: var(--ink-mute); font-size: 14px; margin-bottom: 14px; }
.project-card p { color: var(--ink-soft); font-size: 15px; }
.project-points {
  margin: 16px 0 20px;
  padding-left: 4px;
  list-style: none;
}
.project-points li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 10px;
  color: var(--ink-soft);
  font-size: 15px;
}
.project-points li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--primary);
}
.project-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.project-tags span {
  font-size: 13px;
  color: var(--primary-dark);
  background: rgba(79,109,245,.08);
  border: 1px solid rgba(79,109,245,.18);
  padding: 4px 12px;
  border-radius: 999px;
}
.project-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.project-row .project-card h3 { font-size: 18px; }

/* ---------- 荣誉时间线 ---------- */
.timeline {
  position: relative;
  max-width: 760px;
  padding-left: 34px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 9px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--primary), rgba(79,109,245,.15));
  border-radius: 2px;
}
.tl-item { position: relative; margin-bottom: 34px; }
.tl-item:last-child { margin-bottom: 0; }
.tl-dot {
  position: absolute;
  left: -31px; top: 8px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--primary);
  box-shadow: 0 0 0 4px rgba(79,109,245,.12);
}
.tl-body {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  transition: transform .3s, box-shadow .3s;
}
.tl-body:hover { transform: translateX(6px); box-shadow: var(--shadow); }
.tl-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.tag-province { background: rgba(245,158,66,.15); color: #c2710b; }
.tag-city { background: rgba(79,109,245,.12); color: var(--primary-dark); }
.tag-school { background: rgba(46,160,120,.12); color: #1f8059; }
.tl-body h3 { font-size: 17px; margin-bottom: 6px; }
.tl-body p { color: var(--ink-mute); font-size: 14px; }

/* ---------- 社会实践 ---------- */
.practice-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.practice-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  transition: transform .3s, box-shadow .3s, border-color .3s;
}
.practice-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(79,109,245,.35);
}
.practice-date {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 10px;
}
.practice-card h3 { font-size: 17px; margin-bottom: 8px; }
.practice-card p { font-size: 14px; color: var(--ink-mute); }

/* ---------- 兴趣爱好 ---------- */
.hobby-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.hobby-cloud span {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  transition: transform .25s, box-shadow .25s, color .25s, border-color .25s;
  cursor: default;
}
.hobby-cloud span:hover {
  transform: translateY(-4px) scale(1.04);
  color: var(--primary);
  border-color: rgba(79,109,245,.4);
  box-shadow: var(--shadow);
}

/* ---------- 页脚 ---------- */
.footer {
  padding: 30px 0;
  background: var(--ink);
  color: rgba(255,255,255,.75);
  font-size: 14px;
}
.footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 16px;
}

/* ---------- 友情链接（低调置于页脚） ---------- */
.friend-links {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding-bottom: 14px;
  margin-bottom: 2px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.fl-label {
  font-size: 12px;
  color: rgba(255,255,255,.35);
  letter-spacing: 1px;
}
.friend-links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  list-style: none;
}
.friend-links a {
  font-size: 12.5px;
  color: rgba(255,255,255,.45);
  text-decoration: none;
  transition: color .25s;
}
.friend-links a:hover {
  color: rgba(255,255,255,.85);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.to-top {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.25);
  background: transparent;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: background .25s, transform .25s;
}
.to-top:hover { background: var(--primary); transform: translateY(-3px); }

/* ---------- 入场动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; gap: 44px; }
  .hero-photo { order: -1; }
  .about-grid { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .project-row { grid-template-columns: 1fr; }
  .practice-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: 64px; left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 16px 30px rgba(40,60,120,.1);
    max-height: 0;
    overflow: hidden;
    transition: max-height .35s ease;
  }
  .nav-links.open { max-height: 380px; }
  .nav-links li { padding: 0 24px; }
  .nav-links a {
    display: block;
    padding: 14px 0;
    border-top: 1px solid var(--bg-soft);
  }

  .section { padding: 64px 0; }
  .skills-grid { grid-template-columns: 1fr; }
  .practice-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .hero-facts { gap: 24px; }
  .hero-actions .btn { width: 100%; text-align: center; }
}
