/* ==========================================================
   个人网站样式表
   深色 / 浅色主题通过 <html data-theme="..."> 切换
   ========================================================== */

:root {
  --bg: #0b1020;
  --bg-soft: #0e1428;
  --card: #141c38;
  --border: rgba(148, 163, 184, 0.16);
  --text: #e9eefb;
  --muted: #97a1b8;
  --accent: #6366f1;
  --accent-2: #22d3ee;
  --accent-soft: rgba(99, 102, 241, 0.14);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  --radius: 18px;
  --header-bg: rgba(11, 16, 32, 0.72);
}

html[data-theme="light"] {
  --bg: #f7f8fc;
  --bg-soft: #eef0f8;
  --card: #ffffff;
  --border: rgba(15, 23, 42, 0.1);
  --text: #151a2b;
  --muted: #5a6378;
  --accent: #4f46e5;
  --accent-2: #0891b2;
  --accent-soft: rgba(79, 70, 229, 0.1);
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
  --header-bg: rgba(247, 248, 252, 0.8);
}

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

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

body {
  font-family: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  transition: background 0.35s ease, color 0.35s ease;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

button {
  font: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

input,
textarea {
  font: inherit;
  color: inherit;
}

.container {
  width: min(1100px, 92%);
  margin-inline: auto;
}

/* ---------- 顶部导航 ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.site-header.scrolled {
  border-bottom-color: var(--border);
}

.nav {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.nav-logo-mark {
  color: var(--accent);
  font-size: 20px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
}

.nav-link {
  font-size: 15px;
  color: var(--muted);
  transition: color 0.25s ease;
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.25s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, border-color 0.25s ease;
}

.icon-btn:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.theme-toggle .icon-sun {
  display: none;
}

html[data-theme="dark"] .theme-toggle .icon-sun {
  display: block;
}

html[data-theme="dark"] .theme-toggle .icon-moon {
  display: none;
}

/* 移动端汉堡菜单 */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: var(--text);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.site-header.menu-open .menu-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.site-header.menu-open .menu-toggle span:nth-child(2) {
  opacity: 0;
}

.site-header.menu-open .menu-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 140px 0 90px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(600px 400px at 18% 22%, rgba(99, 102, 241, 0.28), transparent 65%),
    radial-gradient(640px 460px at 82% 68%, rgba(34, 211, 238, 0.2), transparent 65%),
    repeating-linear-gradient(0deg, transparent, transparent 54px, var(--border) 55px),
    repeating-linear-gradient(90deg, transparent, transparent 54px, var(--border) 55px);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, #000 35%, transparent 78%);
  mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, #000 35%, transparent 78%);
}

.hero-inner {
  position: relative;
  text-align: center;
}

.hero-eyebrow {
  display: inline-block;
  font-size: 14px;
  color: var(--accent-2);
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--border);
}

.hero-title {
  font-size: clamp(2.5rem, 7vw, 4.6rem);
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  max-width: 620px;
  margin: 22px auto 0;
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  color: var(--muted);
}

.hero-motto {
  margin-top: 22px;
  font-family: "Georgia", "Times New Roman", "Songti SC", serif;
  font-style: italic;
  font-size: clamp(1.05rem, 2.6vw, 1.35rem);
  letter-spacing: 0.05em;
  color: var(--accent-2);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  transition: transform 0.2s ease, box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.btn svg {
  width: 17px;
  height: 17px;
}

.btn-primary {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.32);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(99, 102, 241, 0.42);
}

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

.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: clamp(28px, 8vw, 72px);
  margin-top: 64px;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat strong {
  font-size: clamp(1.7rem, 4vw, 2.3rem);
  font-weight: 800;
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat span {
  font-size: 13px;
  color: var(--muted);
}

/* ---------- 教育经历时间线 ---------- */

.education-wrap {
  max-width: 760px;
  margin-inline: auto;
}

.timeline {
  position: relative;
  display: grid;
  gap: 24px;
  padding-left: 36px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  opacity: 0.55;
}

.tl-item {
  position: relative;
  padding: 26px 28px;
}

.tl-item::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 30px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.tl-stage {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 4px 13px;
  margin-bottom: 12px;
}

.tl-school {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.tl-desc {
  font-size: 14.5px;
  color: var(--muted);
}

/* ---------- 通用区块 ---------- */

.section {
  padding: 104px 0;
}

.section-alt {
  background: var(--bg-soft);
  border-block: 1px solid var(--border);
  transition: background 0.35s ease;
}

.section-tag {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 48px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.45);
}

/* ---------- 关于我 ---------- */

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.about-card {
  padding: 32px;
}

.about-card h3 {
  font-size: 1.15rem;
  margin-bottom: 12px;
}

.about-card p {
  color: var(--muted);
  font-size: 15px;
}

/* ---------- 技能 ---------- */

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.skill-tag {
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 15px;
  font-weight: 600;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.skill-tag:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ---------- 作品 ---------- */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}

.project-card {
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  opacity: 0.75;
}

.project-icon {
  font-size: 2rem;
  margin-bottom: 6px;
}

.project-card h3 {
  font-size: 1.15rem;
}

.project-card p {
  color: var(--muted);
  font-size: 14.5px;
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 12px;
}

.project-tags span {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.project-link {
  font-weight: 700;
  font-size: 14.5px;
  color: var(--accent);
  transition: color 0.2s ease;
}

.project-link:hover {
  color: var(--accent-2);
}

.projects-note {
  margin-top: 28px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- 联系 ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 24px;
  align-items: start;
}

.contact-info {
  display: grid;
  gap: 16px;
}

.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
}

.contact-emoji {
  font-size: 1.6rem;
}

.contact-card h3 {
  font-size: 15px;
}

.contact-card p {
  font-size: 14px;
  color: var(--muted);
}

.contact-form {
  padding: 30px;
  display: grid;
  gap: 8px;
}

.contact-form label {
  font-size: 13.5px;
  font-weight: 600;
  margin-top: 6px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px 15px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg);
  outline: none;
  resize: vertical;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.contact-form .btn {
  justify-content: center;
  margin-top: 18px;
}

.form-hint {
  font-size: 12.5px;
  color: var(--muted);
  text-align: center;
}

/* ---------- 点赞 ---------- */

.likes-wrap {
  max-width: 560px;
  margin-inline: auto;
  text-align: center;
}

.likes-box {
  position: relative;
  padding: 46px 30px 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

.like-btn {
  position: relative;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--accent-soft), transparent);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, border-color 0.25s ease;
}

.like-btn svg {
  width: 44px;
  height: 44px;
  color: var(--muted);
  transition: color 0.25s ease, transform 0.25s ease;
}

.like-btn:hover {
  transform: translateY(-2px) scale(1.05);
  border-color: #ef4444;
}

.like-btn.liking {
  animation: heart-beat 0.75s cubic-bezier(0.36, 1.6, 0.4, 1);
}

.like-btn.liking svg,
.like-btn.liked svg {
  color: #ef4444;
  fill: #ef4444;
}

@keyframes heart-beat {
  0% { transform: scale(1); }
  25% { transform: scale(1.3); }
  45% { transform: scale(0.92); }
  65% { transform: scale(1.16); }
  100% { transform: scale(1); }
}

.like-count {
  margin-top: 18px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.like-count strong {
  font-size: 2.6rem;
  font-weight: 800;
  background: linear-gradient(100deg, #ef4444, #f97316);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.like-count strong.pop {
  animation: count-pop 0.45s ease;
}

@keyframes count-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.like-count span {
  color: var(--muted);
  font-size: 14px;
}

.like-today {
  font-size: 14px;
  color: var(--muted);
}

.like-hint {
  font-size: 12.5px;
  color: var(--muted);
  opacity: 0.75;
}

.likes-box.limited .like-btn {
  animation: shake 0.5s ease;
  border-color: #ef4444;
}

.likes-box.limited .like-today {
  color: #ef4444;
  font-weight: 600;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

.like-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.particle {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--size);
  height: var(--size);
  animation: particle-fly 0.85s ease-out forwards;
  animation-delay: var(--delay);
}

.particle::before {
  content: "♥";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: var(--size);
  line-height: 1;
  color: #ef4444;
}

@keyframes particle-fly {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.6);
  }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.15) rotate(var(--rot));
  }
}

.like-plus {
  position: absolute;
  left: 50%;
  top: 46%;
  transform: translateX(-50%);
  font-weight: 800;
  color: #ef4444;
  animation: plus-float 1s ease-out forwards;
  pointer-events: none;
}

@keyframes plus-float {
  0% {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -56px);
  }
}

/* ---------- 页脚 ---------- */

.site-footer {
  padding: 34px 0;
  border-top: 1px solid var(--border);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-inner p {
  font-size: 14px;
  color: var(--muted);
}

.footer-socials {
  display: flex;
  gap: 10px;
}

.footer-socials a {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  display: grid;
  place-items: center;
  transition: transform 0.2s ease, border-color 0.25s ease;
}

.footer-socials a:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.footer-socials svg {
  width: 17px;
  height: 17px;
}

/* ---------- 入场动画 ---------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  * {
    animation: none !important;
  }
}

/* ---------- 响应式 ---------- */

@media (max-width: 860px) {
  .menu-toggle {
    display: flex;
  }

  .nav-links {
    position: fixed;
    inset: 68px 0 auto 0;
    flex-direction: column;
    gap: 0;
    background: var(--header-bg);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
    padding: 10px 0;
    transform: translateY(-110%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.35s ease, opacity 0.35s ease, visibility 0.35s;
  }

  .site-header.menu-open .nav-links {
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-link {
    display: block;
    padding: 14px 6vw;
    font-size: 16px;
  }

  .nav-link::after {
    display: none;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .section {
    padding: 76px 0;
  }
}
