/* ==========================================================================
   个人作品集官网 — 样式
   主题：暗色 · 渐变 · 现代
   ========================================================================== */

:root {
  --bg: #0b0d17;
  --bg-soft: #12152a;
  --card: #171b31;
  --card-hover: #1d2240;
  --border: #262b47;
  --text: #e8eaf6;
  --text-dim: #a4a9c7;
  --primary: #6366f1;
  --primary-2: #8b5cf6;
  --accent: #22d3ee;
  --success: #34d399;
  --radius: 16px;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

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

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

.container {
  width: min(1120px, 90%);
  margin: 0 auto;
}

/* ---------- 背景光效 ---------- */
.bg-glow {
  position: fixed;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  filter: blur(140px);
  opacity: 0.35;
  pointer-events: none;
  z-index: -1;
}

.bg-glow--one {
  background: radial-gradient(circle, var(--primary), transparent 70%);
  top: -140px;
  right: -120px;
}

.bg-glow--two {
  background: radial-gradient(circle, var(--accent), transparent 70%);
  bottom: -180px;
  left: -140px;
  opacity: 0.22;
}

/* ---------- 导航栏 ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 18px 0;
  transition: background 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
}

.navbar.scrolled {
  background: rgba(11, 13, 23, 0.85);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  padding: 12px 0;
}

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar__logo {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.navbar__logo span {
  color: var(--primary-2);
}

.navbar__menu {
  display: flex;
  align-items: center;
  gap: 28px;
}

.navbar__link {
  color: var(--text-dim);
  font-size: 0.95rem;
  position: relative;
  transition: color 0.2s;
}

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

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

.navbar__link:hover::after,
.navbar__link.active::after {
  width: 100%;
}

.navbar__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.navbar__toggle span {
  width: 26px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

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

.navbar__toggle.open span:nth-child(2) {
  opacity: 0;
}

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

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  font-family: inherit;
}

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

.btn--primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(99, 102, 241, 0.5);
}

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

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

.btn--small {
  padding: 9px 20px;
  font-size: 0.85rem;
}

.btn--block {
  width: 100%;
}

/* ---------- Hero ---------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  padding: 120px 0 80px;
}

.hero__inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 60px;
}

.hero__hello {
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.hero__name {
  font-size: clamp(3rem, 7vw, 4.8rem);
  font-weight: 800;
  line-height: 1.1;
  background: linear-gradient(120deg, #fff 20%, var(--primary-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__name .dot {
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
}

.hero__role {
  margin: 16px 0 18px;
  font-size: 1.15rem;
  color: var(--text);
}

.hero__role i {
  color: var(--primary);
  font-style: normal;
  margin: 0 4px;
}

.hero__desc {
  color: var(--text-dim);
  max-width: 520px;
  margin-bottom: 34px;
}

.hero__actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* 头像卡片 */
.hero__avatar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
}

.avatar-card {
  position: relative;
  width: 300px;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.avatar-card__ring {
  position: absolute;
  inset: 0;
  border-radius: 32% 68% 61% 39% / 44% 41% 59% 56%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  animation: morph 9s ease-in-out infinite;
  box-shadow: var(--shadow);
}

.avatar-card__emoji {
  position: relative;
  font-size: 8rem;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.35));
}

@keyframes morph {
  0%, 100% {
    border-radius: 32% 68% 61% 39% / 44% 41% 59% 56%;
    transform: rotate(0deg);
  }
  50% {
    border-radius: 61% 39% 40% 60% / 56% 59% 41% 44%;
    transform: rotate(6deg);
  }
}

.hero__stats {
  list-style: none;
  display: flex;
  gap: 40px;
}

.hero__stats strong {
  display: block;
  font-size: 2rem;
  background: linear-gradient(120deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__stats span {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.hero__scroll {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-dim);
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 10px); }
}

/* ---------- 通用区块 ---------- */
.section {
  padding: 110px 0;
}

.section__tag {
  display: inline-block;
  color: var(--primary);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 5px 16px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.section__title {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  margin-bottom: 60px;
  position: relative;
  padding-bottom: 18px;
}

.section__title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 60px;
  height: 4px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

/* ---------- 关于我 ---------- */
.about__grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 60px;
  align-items: start;
}

.about__text p {
  color: var(--text-dim);
  margin-bottom: 18px;
}

.about__info {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 30px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
}

.about__info span {
  display: block;
  color: var(--text-dim);
  font-size: 0.82rem;
}

.about__info b {
  font-weight: 600;
}

.about__info .available {
  color: var(--success);
}

.hobby-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  margin-bottom: 20px;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.hobby-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
}

.hobby-card__icon {
  font-size: 1.8rem;
}

.hobby-card h3 {
  margin: 10px 0 4px;
  font-size: 1.05rem;
}

.hobby-card p {
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ---------- 技能 ---------- */
.skills {
  background: var(--bg-soft);
}

.skills__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.skill-group {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px;
}

.skill-group h3 {
  margin-bottom: 26px;
  font-size: 1.15rem;
}

.skill {
  margin-bottom: 24px;
}

.skill:last-child {
  margin-bottom: 0;
}

.skill__head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.92rem;
}

.skill__head b {
  color: var(--accent);
}

.skill__bar {
  height: 8px;
  background: #262b47;
  border-radius: 8px;
  overflow: hidden;
}

.skill__bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- 作品集 ---------- */
.portfolio__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}

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

.project:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.project__thumb {
  height: 200px;
  background: var(--thumb);
  display: flex;
  align-items: center;
  justify-content: center;
}

.project__emoji {
  font-size: 4rem;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.3));
  transition: transform 0.4s ease;
}

.project:hover .project__emoji {
  transform: scale(1.15) rotate(-6deg);
}

.project__body {
  padding: 26px;
}

.project__tag {
  display: inline-block;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.project__body h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.project__body p {
  color: var(--text-dim);
  font-size: 0.92rem;
  margin-bottom: 18px;
}

.project__link {
  color: var(--primary);
  font-weight: 600;
  font-size: 0.92rem;
}

.project__link span {
  display: inline-block;
  transition: transform 0.2s ease;
}

.project:hover .project__link span {
  transform: translateX(5px);
}

/* ---------- 服务 ---------- */
.services {
  background: var(--bg-soft);
}

.services__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
}

.service {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 26px;
  text-align: center;
  transition: transform 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.service:hover {
  transform: translateY(-6px);
  border-color: var(--primary);
  background: var(--card-hover);
}

.service__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  font-size: 1.7rem;
  background: rgba(99, 102, 241, 0.12);
  margin-bottom: 20px;
}

.service h3 {
  margin-bottom: 10px;
  font-size: 1.05rem;
}

.service p {
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ---------- 联系 ---------- */
.contact__grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 50px;
  align-items: start;
}

.contact__info > p {
  color: var(--text-dim);
  margin-bottom: 28px;
}

.contact__list {
  list-style: none;
  margin-bottom: 28px;
}

.contact__list li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.contact__label {
  color: var(--text-dim);
  font-size: 0.9rem;
  min-width: 110px;
}

.contact__list a {
  transition: color 0.2s;
}

.contact__list a:hover {
  color: var(--primary);
}

.contact__social {
  display: flex;
  gap: 14px;
}

.contact__social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-dim);
  transition: all 0.25s ease;
}

.contact__social a:hover {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  border-color: transparent;
  transform: translateY(-3px);
}

.contact__form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.88rem;
  color: var(--text-dim);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 13px 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form__status {
  margin-top: 14px;
  font-size: 0.88rem;
  color: var(--success);
  min-height: 20px;
}

.form__status.error {
  color: #f87171;
}

/* ---------- 页脚 ---------- */
.footer {
  border-top: 1px solid var(--border);
  padding: 30px 0;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-dim);
  font-size: 0.88rem;
}

.footer__top {
  color: var(--text-dim);
  transition: color 0.2s;
}

.footer__top:hover {
  color: var(--primary);
}

/* ---------- 滚动显现动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal--delay {
  transition-delay: 0.15s;
}

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

  .hero__inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero__desc {
    margin-left: auto;
    margin-right: auto;
  }

  .hero__actions {
    justify-content: center;
  }

  .hero__stats {
    justify-content: center;
  }

  .hero__avatar {
    order: -1;
  }
}

@media (max-width: 768px) {
  .section {
    padding: 80px 0;
  }

  .navbar__menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    max-width: 320px;
    height: 100vh;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
    background: var(--bg-soft);
    border-left: 1px solid var(--border);
    transition: right 0.35s ease;
  }

  .navbar__menu.open {
    right: 0;
  }

  .navbar__toggle {
    display: flex;
  }

  .about__grid,
  .contact__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .skills__grid,
  .portfolio__grid {
    grid-template-columns: 1fr;
  }

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

  .form-row {
    grid-template-columns: 1fr;
  }

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

  .hero__stats {
    gap: 24px;
  }

  .hero__stats strong {
    font-size: 1.6rem;
  }

  .avatar-card {
    width: 220px;
    height: 220px;
  }

  .avatar-card__emoji {
    font-size: 5.5rem;
  }

  .footer__inner {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .avatar-card__ring,
  .hero__scroll {
    animation: none;
  }

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