﻿:root {
  --red-950: #3b0505;
  --red-900: #6f1514;
  --red-800: #922927;
  --red-600: #d83b38;
  --red-500: #fd5653;
  --red-100: #ffe6e3;
  --ink: #231817;
  --muted: #756866;
  --paper: #fffaf8;
  --white: #ffffff;
  --line: rgba(146, 41, 39, 0.16);
  --shadow: 0 24px 70px rgba(71, 9, 8, 0.18);
  --radius: 8px;
  --section-pad: clamp(72px, 9vw, 120px);
  --nav-height: 64px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

body {
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  overflow-x: hidden;
}

body:not(.intro-finished) {
  overflow: hidden;
}

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

button {
  font: inherit;
}

li {
  list-style: none;
}

.cursor-glow {
  position: fixed;
  left: 50%;
  top: 50%;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1000;
  opacity: 0;
  background: radial-gradient(circle, rgba(253, 86, 83, 0.45), transparent 68%);
  transform: translate(-50%, -50%);
  mix-blend-mode: screen;
  transition: opacity 0.2s ease, left 0.08s linear, top 0.08s linear;
}

body:hover .cursor-glow {
  opacity: 0.2;
}

.intro-curtain {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--red-950);
  color: var(--white);
  pointer-events: auto;
}

.intro-layer {
  position: absolute;
  inset: -12%;
  transform: translate3d(0, 0, 0) scale(1.08);
}

.intro-layer-back {
  background:
    radial-gradient(circle at 20% 28%, rgba(255, 255, 255, 0.18), transparent 24%),
    linear-gradient(135deg, var(--red-950), var(--red-800));
  animation: introIdleBack 8s ease-in-out infinite alternate;
}

.intro-layer-mid {
  opacity: 0.72;
  background-image:
    linear-gradient(115deg, transparent 0 32%, rgba(255, 255, 255, 0.16) 32% 33%, transparent 33% 100%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 100% 100%, 84px 84px, 84px 84px;
  animation: introIdleMid 10s ease-in-out infinite alternate;
}

.intro-layer-front {
  inset: auto -10% -18% -10%;
  height: 46%;
  background: linear-gradient(8deg, var(--red-500), rgba(255, 255, 255, 0.12));
  clip-path: polygon(0 25%, 100% 0, 100% 100%, 0 100%);
  animation: introIdleFront 7s ease-in-out infinite alternate;
}

.intro-content {
  position: relative;
  z-index: 2;
  width: min(760px, calc(100% - 40px));
  text-align: center;
  transform: translateY(0);
}

.intro-content span,
.intro-content strong,
.intro-content em {
  display: block;
}

.intro-content span {
  color: rgba(255, 255, 255, 0.64);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.intro-content strong {
  margin-top: 14px;
  font-size: clamp(44px, 9vw, 108px);
  line-height: 1;
}

.intro-content em {
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(14px, 2vw, 18px);
  font-style: normal;
}

.intro-enter {
  position: relative;
  min-width: 154px;
  min-height: 48px;
  margin-top: 34px;
  padding: 0 24px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: var(--radius);
  color: var(--red-900);
  background: rgba(255, 255, 255, 0.92);
  font-weight: 800;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 20px 54px rgba(38, 3, 3, 0.26);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.intro-enter::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0 35%, rgba(253, 86, 83, 0.22) 46%, transparent 58% 100%);
  transform: translateX(-100%);
  transition: transform 0.55s ease;
}

.intro-enter:hover,
.intro-enter:focus-visible {
  transform: translateY(-4px);
  background: var(--white);
  box-shadow: 0 28px 72px rgba(38, 3, 3, 0.32);
  outline: none;
}

.intro-enter:hover::before,
.intro-enter:focus-visible::before {
  transform: translateX(100%);
}

body.intro-finished .intro-curtain {
  animation: introCurtainOut 1.05s cubic-bezier(0.74, 0, 0.24, 1) forwards;
  pointer-events: none;
}

body.intro-finished .intro-layer-back {
  animation: introBackOut 1.05s cubic-bezier(0.74, 0, 0.24, 1) forwards;
}

body.intro-finished .intro-layer-mid {
  animation: introMidOut 1.05s cubic-bezier(0.74, 0, 0.24, 1) forwards;
}

body.intro-finished .intro-layer-front {
  animation: introFrontOut 1.05s cubic-bezier(0.74, 0, 0.24, 1) forwards;
}

body.intro-finished .intro-content {
  animation: introTextOut 0.78s cubic-bezier(0.5, 0, 0.15, 1) forwards;
}

.header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--nav-height);
  z-index: 999;
  background: rgba(146, 41, 39, 0.86);
  backdrop-filter: blur(16px);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}

.header.is-scrolled {
  background: rgba(87, 15, 14, 0.9);
  box-shadow: 0 12px 32px rgba(44, 4, 4, 0.18);
}

.nav {
  width: min(1180px, calc(100% - 40px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-weight: 700;
  letter-spacing: 0;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.12);
  border-radius: 8px;
}

.nav-ul {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-li a {
  position: relative;
  display: block;
  padding: 22px 14px 19px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
  transition: color 0.25s ease;
}

.nav-li a::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 13px;
  height: 2px;
  background: var(--white);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s ease;
}

.nav-li a:hover,
.nav-li a.navactive {
  color: var(--white);
}

.nav-li a:hover::after,
.nav-li a.navactive::after {
  transform: scaleX(1);
}

.hamburger {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
}

.hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--white);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.hamburger.is-open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

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

.hamburger.is-open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.section-panel {
  position: relative;
  padding: var(--section-pad) 0;
  overflow: hidden;
}

.section-light {
  background:
    linear-gradient(135deg, rgba(253, 86, 83, 0.08), transparent 38%),
    var(--paper);
}

.section-red {
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.13), transparent 28%),
    linear-gradient(135deg, var(--red-900), var(--red-800));
  color: var(--white);
}

.home {
  min-height: 100vh;
  padding-top: calc(var(--nav-height) + 56px);
  display: grid;
  align-items: center;
  background:
    radial-gradient(circle at 82% 24%, rgba(253, 86, 83, 0.62), transparent 28%),
    linear-gradient(135deg, #5f1110 0%, var(--red-800) 58%, #c23d3a 100%);
  color: var(--white);
}

.hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  transform: translateY(calc(var(--scroll-y, 0px) * 0.12));
  transition: transform 0.08s linear;
}

.orb {
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  animation: float 7s ease-in-out infinite alternate;
}

.orb-one {
  width: 180px;
  height: 180px;
  left: 7%;
  top: 18%;
}

.orb-two {
  width: 110px;
  height: 110px;
  right: 9%;
  bottom: 13%;
  animation-delay: -2s;
}

.grid-line {
  position: absolute;
  inset: 0;
  opacity: 0.13;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.6) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.6) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, transparent, black 16%, black 78%, transparent);
}

.home-content,
.about-layout,
.skill-content,
.project-grid,
.timeline-list,
.section-head,
.contact-content {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.home-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 480px);
  gap: clamp(36px, 7vw, 92px);
  align-items: center;
  transform: translateY(calc(var(--scroll-y, 0px) * -0.035));
}

.home-split-left,
.home-split-right {
  opacity: 0;
  transition:
    opacity 0.9s ease,
    transform 1.05s cubic-bezier(0.18, 0.82, 0.18, 1);
}

.home-split-left {
  transform: translate3d(-80px, 0, 0);
}

.home-split-right {
  transform: translate3d(80px, 0, 0);
}

body.intro-finished .home-split-left,
body.intro-finished .home-split-right {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

body.intro-finished .home-split-right {
  transition-delay: 0.14s;
}

.eyebrow {
  margin-bottom: 14px;
  color: currentColor;
  opacity: 0.72;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.hero-title {
  max-width: 780px;
  font-size: clamp(46px, 8vw, 104px);
  line-height: 1.04;
  font-weight: 900;
  letter-spacing: 0;
}

.hero-title span {
  display: block;
}

.hero-desc {
  max-width: 640px;
  margin-top: 24px;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(16px, 2vw, 19px);
  line-height: 1.9;
}

.hero-actions,
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.34);
  font-weight: 700;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

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

.btn-primary {
  background: var(--white);
  color: var(--red-800);
  box-shadow: 0 18px 42px rgba(45, 3, 3, 0.24);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.hero-tags span,
.project-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
}

.hero-stage {
  position: relative;
  min-height: 520px;
}

.circle {
  /* margin-top: 800px; */
  position: relative;
  width: min(82vw, 440px);
  height: min(82vw, 440px);
  /* margin: 0 auto; */
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 20%, rgba(255, 255, 255, 0.32), transparent 28%),
    linear-gradient(145deg, #ff7773, var(--red-500));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.22),
    0 38px 90px rgba(48, 4, 4, 0.28);
  transform: translate3d(var(--px, 0), var(--py, 0), 0);
  transition: transform 0.18s ease-out;
}

.circle::before,
.circle::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.circle::before {
  inset: -22px;
}

.circle::after {
  inset: 36px;
  opacity: 0.35;
}

.circle img {
  position: absolute;
  user-select: none;
  pointer-events: none;
  transform: translate3d(var(--px, 0), var(--py, 0), 0);
  transition: transform 0.18s ease-out;
}

.rabbit {
  width: 56%;
  left: 17%;
  bottom: -19%;
  z-index: 5;
  animation: riseIn 1s ease both 0.35s, softBounce 3s ease-in-out infinite 1.4s;
}

.sofa {
  width: 76%;
  right: 15%;
  bottom: 5%;
  z-index: 2;
  animation: riseIn 0.9s ease both 0.1s;
}

.grass {
  width: 34%;
  right: -5%;
  top: 10%;
  z-index: 4;
  animation: spinIn 0.9s ease both 0.8s;
}

.grasstwo {
  width: 24%;
  left: -2%;
  top: 12%;
  z-index: 4;
  animation: spinIn 1s ease both 0.95s;
}

.flower1 {
  width: 12%;
  left: 36%;
  top: -1%;
  z-index: 6;
  transform-origin: bottom center;
  animation: flowerSwing 2.4s ease-in-out infinite alternate;
}

.flower2 {
  width: 96%;
  left: 0;
  top: -2%;
  z-index: 3;
  animation: scaleIn 1s ease both 0.55s;
}

.hero-stat {
  position: absolute;
  right: 0;
  bottom: 26px;
  width: 190px;
  padding: 18px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 40px rgba(52, 4, 4, 0.18);
}

.hero-stat strong {
  display: block;
  font-size: 42px;
  line-height: 1;
}

.hero-stat span {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.section-head {
  margin-bottom: clamp(34px, 5vw, 58px);
  text-align: center;
}

.section-head h2,
.contact-content h2 {
  font-size: clamp(34px, 6vw, 78px);
  line-height: 1.12;
  letter-spacing: 0;
}

.section-head p:last-child,
.contact-content>p {
  max-width: 680px;
  margin: 16px auto 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.section-red .section-head p:last-child,
.section-red .eyebrow,
.contact-content>p {
  color: rgba(255, 255, 255, 0.72);
}

.about-layout {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: clamp(28px, 6vw, 72px);
  align-items: center;
}

.portrait-card {
  position: relative;
  padding: 24px;
  border-radius: var(--radius);
  background: var(--white);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.portrait-card img {
  display: block;
  width: 100%;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--red-100), var(--white));
}

.portrait-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: var(--white);
  background: var(--red-800);
  box-shadow: 0 16px 36px rgba(146, 41, 39, 0.26);
  font-weight: 700;
}

.about-copy h3 {
  color: var(--red-800);
  font-size: clamp(28px, 4vw, 42px);
}

.about-copy>p {
  margin-top: 18px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.9;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 26px;
}

.about-grid article,
.project-card,
.timeline-item {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 34px rgba(88, 17, 16, 0.08);
}

.about-grid article {
  padding: 18px;
}

.about-grid span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.about-grid strong {
  color: var(--ink);
  font-size: 16px;
}

.reveal-card {
  position: relative;
  min-height: 170px;
  margin-top: 24px;
  overflow: hidden;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--red-900), var(--red-800));
  box-shadow: 0 18px 48px rgba(80, 9, 8, 0.22);
}

.about-text {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 28px;
  color: var(--white);
  line-height: 1.8;
}

.about-text strong {
  font-size: 22px;
}

.box-wrapper {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(7, 1fr);
}

.box-wrapper .box {
  background: var(--white);
  border: 1px solid rgba(146, 41, 39, 0.22);
  transition: transform 0.6s ease, opacity 0.6s ease, background 0.3s ease;
}

.box-wrapper .box.active {
  opacity: 0;
  transform: translateY(210px) rotate(35deg) scale(0.8);
  pointer-events: none;
}

.skill-content {
  display: grid;
  gap: 16px;
}

.skill-group {
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

.skill-trigger {
  width: 100%;
  min-height: 86px;
  padding: 18px 22px;
  border: 0;
  color: var(--white);
  background: transparent;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 30px;
  gap: 16px;
  align-items: center;
  text-align: left;
  cursor: pointer;
}

.skill-trigger .iconfont {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin: 0;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.13);
  font-size: 28px;
  line-height: 1;
}

.skill-trigger strong {
  display: block;
  font-size: 20px;
}

.skill-trigger em {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 14px;
  font-style: normal;
  line-height: 1.6;
}

.skill-trigger .icon-xiajianhao {
  font-size: 18px;
  transition: transform 0.25s ease;
}

.skill-group.open .icon-xiajianhao {
  transform: rotate(180deg);
}

.skill-items {
  display: grid;
  gap: 10px;
  max-height: 0;
  padding: 0 22px;
  overflow: hidden;
  transition: max-height 0.38s ease, padding 0.38s ease;
}

.skill-group.open .skill-items {
  max-height: 620px;
  padding: 0 22px 22px;
}

.skillli {
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  transition: transform 0.25s ease, background 0.25s ease;
}

.skillli:hover {
  transform: translateX(6px);
  background: var(--white);
}

.skill-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.skill-meta span,
.skill-meta b {
  font-size: 14px;
}

.progress-wrap {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #f1d9d6;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red-800), var(--red-500));
  transition: width 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.project-card {
  position: relative;
  min-height: 310px;
  padding: 26px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(253, 86, 83, 0.14), transparent 42%);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.project-card:hover {
  transform: translateY(-8px);
  border-color: rgba(253, 86, 83, 0.34);
  box-shadow: var(--shadow);
}

.project-card:hover::before {
  opacity: 1;
}

.project-card>* {
  position: relative;
  z-index: 1;
}

.project-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--red-600);
  font-size: 13px;
  font-weight: 700;
}

.project-topline b {
  color: rgba(146, 41, 39, 0.18);
  font-size: 42px;
}

.project-card h3 {
  margin-top: 38px;
  font-size: 24px;
  line-height: 1.35;
}

.project-card p {
  margin-top: 16px;
  color: var(--muted);
  line-height: 1.8;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 26px;
}

.project-tags span {
  background: var(--red-100);
  border-color: transparent;
  color: var(--red-800);
}

.project-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-height: 42px;
  margin-top: auto;
  padding: 0 18px;
  border-radius: var(--radius);
  color: var(--white);
  background: var(--red-800);
  font-weight: 700;
  box-shadow: 0 14px 32px rgba(146, 41, 39, 0.18);
  transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.project-link:hover,
.project-link:focus-visible {
  transform: translateY(-3px);
  background: var(--red-600);
  box-shadow: 0 18px 42px rgba(146, 41, 39, 0.26);
  outline: none;
}

.timeline-list {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.timeline-item {
  padding: 24px;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--white);
  backdrop-filter: blur(14px);
}

.timeline-item span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.timeline-item h3 {
  margin-top: 28px;
  font-size: 20px;
}

.timeline-item p {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.8;
  font-size: 14px;
}

.bag {
  position: relative;
  width: min(1180px, calc(100% - 40px));
  min-height: 470px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

.card {
  position: absolute;
  width: clamp(180px, 20vw, 238px);
  min-height: clamp(286px, 30vw, 350px);
  padding: 28px 24px;
  border: 8px solid var(--white);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    var(--red-800);
  color: var(--white);
  box-shadow: 0 18px 44px rgba(58, 8, 7, 0.16);
  transform-origin: 50% 100%;
  transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease, z-index 0.3s ease;
  pointer-events: auto;
}

.card-img {
  display: block;
  width: 130px;
  height: 130px;
  margin: 0 auto 20px;
  object-fit: contain;
}

.card p {
  font-size: clamp(16px, 2vw, 22px);
  line-height: 1.55;
  text-align: center;
}

.bag:hover .card,
.bag:focus-within .card {
  transform: rotate(calc(var(--i) * 5deg)) translate(calc(var(--i) * 104px), -72px);
}

.bag .card:hover {
  z-index: 20;
  transform: rotate(calc(var(--i) * 2deg)) translate(calc(var(--i) * 104px), -96px) scale(1.04);
  box-shadow: 0 28px 70px rgba(58, 8, 7, 0.25);
}

.contact {
  min-height: 620px;
  display: grid;
  align-items: center;
}

.contact-content {
  text-align: center;
}

.contact-content h2 {
  max-width: 920px;
  margin: 0 auto;
}

.contact-box {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 42px;
}

.contact-item {
  min-height: 120px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius);
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: transform 0.25s ease, background 0.25s ease;
}

.contact-item::before {
  display: block;
  margin: 0 auto 14px;
  font-size: 30px;
  line-height: 1;
}

.contact-item span {
  display: block;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.contact-item:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.16);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 1001;
  padding: 12px 18px;
  border-radius: 999px;
  color: var(--white);
  background: rgba(35, 24, 23, 0.86);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translate(-50%, 14px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease var(--delay, 0ms), transform 0.7s ease var(--delay, 0ms);
}

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

@keyframes float {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(18px, -22px, 0);
  }
}

@keyframes introIdleBack {
  from {
    transform: translate3d(-1%, -1%, 0) scale(1.08);
  }

  to {
    transform: translate3d(1.5%, 1%, 0) scale(1.12);
  }
}

@keyframes introIdleMid {
  from {
    transform: translate3d(1%, 0, 0) scale(1.08);
  }

  to {
    transform: translate3d(-2%, -1.5%, 0) scale(1.13);
  }
}

@keyframes introIdleFront {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(0, 7%, 0);
  }
}

@keyframes introCurtainOut {
  0% {
    opacity: 1;
    visibility: visible;
  }

  70% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes introBackOut {
  to {
    transform: translate3d(0, -18%, 0) scale(1.18);
  }
}

@keyframes introMidOut {
  to {
    transform: translate3d(0, -32%, 0) scale(1.28);
    opacity: 0;
  }
}

@keyframes introFrontOut {
  to {
    transform: translate3d(0, 72%, 0);
  }
}

@keyframes introTextOut {
  to {
    opacity: 0;
    transform: translateY(-34px) scale(0.96);
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translate3d(0, 42px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.75);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes spinIn {
  from {
    opacity: 0;
    transform: rotate(55deg) translateY(-30px);
  }

  to {
    opacity: 1;
    transform: rotate(0) translateY(0);
  }
}

@keyframes softBounce {

  0%,
  100% {
    translate: 0 0;
  }

  50% {
    translate: 0 -8px;
  }
}

@keyframes flowerSwing {
  from {
    rotate: -8deg;
  }

  to {
    rotate: 12deg;
  }
}

@media (max-width: 980px) {

  .home-content,
  .about-layout,
  .project-grid,
  .timeline-list,
  .contact-box {
    grid-template-columns: 1fr;
  }

  .hero-stage {
    min-height: 460px;
  }

  .project-card {
    min-height: auto;
  }

  .timeline-list,
  .contact-box {
    max-width: 680px;
  }
}

@media (max-width: 820px) {
  :root {
    --nav-height: 58px;
  }

  .cursor-glow {
    display: none;
  }

  .nav {
    width: min(100% - 28px, 1180px);
  }

  .hamburger {
    display: block;
  }

  .nav-ul {
    position: absolute;
    top: calc(var(--nav-height) + 10px);
    left: 14px;
    right: 14px;
    display: grid;
    gap: 2px;
    padding: 12px;
    border-radius: var(--radius);
    background: rgba(99, 17, 16, 0.96);
    box-shadow: 0 18px 44px rgba(34, 3, 3, 0.24);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-14px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
  }

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

  .nav-li a {
    padding: 13px 14px;
    border-radius: 6px;
  }

  .nav-li a::after {
    display: none;
  }

  .nav-li a.navactive {
    background: rgba(255, 255, 255, 0.1);
  }

  .home {
    padding-top: calc(var(--nav-height) + 42px);
  }

  .home-content,
  .about-layout,
  .skill-content,
  .project-grid,
  .timeline-list,
  .section-head,
  .contact-content {
    width: min(100% - 28px, 1180px);
  }

  .hero-copy {
    text-align: left;
  }

  .hero-stage {
    min-height: 390px;
  }

  .hero-stat {
    right: 8px;
    bottom: 0;
  }

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

  .bag {
    width: 100%;
    min-height: auto;
    justify-content: flex-start;
    gap: 14px;
    padding: 12px 14px 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    pointer-events: auto;
  }

  .card,
  .bag:hover .card,
  .bag:focus-within .card,
  .bag .card:hover {
    position: relative;
    flex: 0 0 230px;
    min-height: 312px;
    transform: none;
    scroll-snap-align: center;
  }
}

@media (max-width: 560px) {
  :root {
    --section-pad: 64px;
  }

  .brand span:last-child {
    display: none;
  }

  .hero-actions,
  .hero-tags {
    align-items: stretch;
  }

  .btn {
    flex: 1 1 140px;
  }

  .circle {
    width: min(88vw, 350px);
    height: min(88vw, 350px);
  }

  .hero-stage {
    min-height: 330px;
  }

  .hero-stat {
    width: 158px;
    padding: 14px;
  }

  .hero-stat strong {
    font-size: 34px;
  }

  .skill-trigger {
    grid-template-columns: 42px minmax(0, 1fr) 24px;
    padding: 16px;
  }

  .skill-trigger .iconfont {
    width: 42px;
    height: 42px;
    font-size: 24px;
  }

  .skill-trigger em {
    display: none;
  }

  .skill-group.open .skill-items {
    padding: 0 14px 16px;
  }

  .skill-items {
    padding: 0 14px;
  }

  .contact-item {
    min-height: 98px;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

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

  .home-split-left,
  .home-split-right {
    opacity: 1;
    transform: none;
  }

  body:not(.intro-finished) {
    overflow: auto;
  }

  .intro-curtain {
    display: none;
  }
}

/* Viewport-fit layout: keep each main content block inside one desktop viewport. */
@media (min-width: 981px) {
  :root {
    --section-pad: clamp(34px, 4.6vh, 54px);
  }

  .section-panel {
    min-height: 100vh;
    display: grid;
    align-content: center;
  }

  .home {
    height: 100vh;
    min-height: 680px;
    padding-top: var(--nav-height);
  }

  .home-content {
    grid-template-columns: minmax(0, 1.08fr) minmax(320px, 420px);
    gap: clamp(28px, 5vw, 72px);
  }

  .hero-title {
    font-size: clamp(42px, 6.2vw, 76px);
    line-height: 1.02;
  }

  .hero-desc {
    max-width: 600px;
    margin-top: 18px;
    font-size: 16px;
    line-height: 1.75;
  }

  .hero-actions,
  .hero-tags {
    margin-top: 22px;
  }

  .hero-stage {
    min-height: 430px;
  }

  .circle {
    width: min(37vw, 380px);
    height: min(37vw, 380px);
    margin-top: 60px;
  }

  .hero-stat {
    bottom: 4px;
  }

  .section-head {
    margin-bottom: clamp(20px, 3.2vh, 34px);
  }

  .section-head h2,
  .contact-content h2 {
    font-size: clamp(30px, 4.6vw, 56px);
  }

  .section-head p:last-child,
  .contact-content>p {
    margin-top: 10px;
    font-size: 15px;
    line-height: 1.65;
  }

  .about-layout {
    grid-template-columns: minmax(240px, 340px) minmax(0, 1fr);
    gap: clamp(26px, 5vw, 58px);
  }

  .portrait-card {
    padding: 18px;
  }

  .about-copy>p {
    margin-top: 12px;
    font-size: 16px;
    line-height: 1.75;
  }

  .about-grid {
    gap: 10px;
    margin-top: 18px;
  }

  .about-grid article {
    padding: 14px;
  }

  .reveal-card {
    min-height: 128px;
    margin-top: 18px;
  }

  .about-text {
    padding: 22px;
    line-height: 1.65;
  }

  .skill-trigger {
    min-height: 72px;
    padding: 14px 18px;
  }

  .skill-group.open .skill-items {
    padding-bottom: 16px;
  }

  .skillli {
    padding: 10px 14px;
  }

  .project-grid {
    gap: 14px;
  }

  .project-card {
    min-height: 260px;
    padding: 22px;
  }

  .project-card h3 {
    margin-top: 22px;
    font-size: 21px;
  }

  .project-card p {
    margin-top: 12px;
    line-height: 1.65;
    font-size: 14px;
  }

  .project-tags {
    margin-top: 18px;
  }

  .bag {
    min-height: 360px;
  }

  .card {
    width: clamp(156px, 15vw, 190px);
    min-height: 270px;
    padding: 20px 16px;
    border-width: 6px;
  }

  .card-img {
    width: 102px;
    height: 102px;
    margin-bottom: 16px;
  }

  .card p {
    font-size: clamp(14px, 1.45vw, 18px);
  }

  .bag:hover .card,
  .bag:focus-within .card {
    transform: rotate(calc(var(--i) * 5deg)) translate(calc(var(--i) * 82px), -48px);
  }

  .bag .card:hover {
    transform: rotate(calc(var(--i) * 2deg)) translate(calc(var(--i) * 82px), -66px) scale(1.04);
  }

  .contact {
    min-height: 100vh;
  }

  .contact-box {
    margin-top: 30px;
  }

  .contact-item {
    min-height: 104px;
    padding: 14px;
  }
}
/* Responsive stability pass: medium screens and short viewports */
@media (max-width: 1180px) {
  .home {
    height: auto;
    min-height: 100svh;
    padding-top: calc(var(--nav-height) + 30px);
  }

  .home-content {
    grid-template-columns: 1fr;
    align-items: center;
    gap: 24px;
  }

  .hero-copy {
    max-width: 760px;
  }

  .hero-title {
    max-width: 760px;
    font-size: clamp(38px, 8.2vw, 68px);
    line-height: 1.08;
  }

  .hero-desc {
    max-width: 720px;
    font-size: clamp(15px, 2.2vw, 17px);
    line-height: 1.75;
  }

  .hero-actions,
  .hero-tags {
    margin-top: 22px;
  }

  .hero-stage {
    width: min(100%, 620px);
    min-height: clamp(300px, 54vw, 460px);
    margin: 0 auto;
  }

  .circle {
    width: min(68vw, 390px);
    height: min(68vw, 390px);
    margin: 0 auto;
  }

  .hero-stat {
    right: clamp(8px, 5vw, 72px);
    bottom: 6px;
  }

  .contact-box {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    width: min(100%, 760px);
    margin-inline: auto;
  }
}

@media (max-width: 760px) {
  .home-content,
  .about-layout,
  .skill-content,
  .project-grid,
  .section-head,
  .contact-content {
    width: min(100% - 28px, 1180px);
  }

  .hero-title {
    font-size: clamp(34px, 10.5vw, 54px);
  }

  .hero-desc {
    font-size: 15px;
  }

  .hero-stage {
    min-height: clamp(280px, 76vw, 390px);
  }

  .circle {
    width: min(86vw, 340px);
    height: min(86vw, 340px);
  }

  .hero-stat {
    width: 150px;
    padding: 12px;
    right: 4px;
  }

  .hero-stat strong {
    font-size: 32px;
  }

  .contact-box {
    grid-template-columns: 1fr;
    width: min(100%, 560px);
  }
}

@media (max-height: 760px) and (min-width: 821px) {
  .home {
    height: auto;
    min-height: 100svh;
  }

  .hero-title {
    font-size: clamp(34px, 6.6vw, 58px);
  }

  .hero-desc {
    margin-top: 14px;
    line-height: 1.65;
  }

  .hero-actions,
  .hero-tags {
    margin-top: 16px;
  }

  .hero-stage {
    min-height: 340px;
  }

  .circle {
    width: min(46vw, 320px);
    height: min(46vw, 320px);
    margin-top: 0;
  }
}

/* Final responsive polish for portfolio cards and about image */
.project-tags {
  margin-bottom: 24px;
}

.project-link {
  margin-top: 6px;
}

@media (max-width: 1180px) {
  .project-card {
    min-height: 280px;
    padding: 24px;
  }

  .project-card h3 {
    margin-top: 26px;
  }

  .portrait-card {
    width: min(100%, 360px);
    margin-inline: auto;
    padding: 18px;
  }

  .about-layout {
    align-items: start;
  }
}

@media (max-width: 820px) {
  .about-layout {
    gap: 24px;
  }

  .portrait-card {
    width: min(82vw, 300px);
    padding: 14px;
  }

  .portrait-badge {
    right: 8px;
    bottom: 8px;
    padding: 9px 11px;
    font-size: 13px;
  }

  .about-copy h3 {
    font-size: clamp(25px, 7vw, 34px);
  }

  .about-copy>p {
    font-size: 15px;
    line-height: 1.75;
  }

  .project-card {
    min-height: auto;
  }
}

@media (max-width: 560px) {
  .section-panel {
    padding-block: 54px;
  }

  .home {
    padding-top: calc(var(--nav-height) + 24px);
  }

  .hero-title {
    font-size: clamp(30px, 12vw, 46px);
  }

  .hero-actions {
    gap: 10px;
  }

  .hero-tags {
    gap: 8px;
  }

  .hero-tags span,
  .project-tags span {
    min-height: 30px;
    font-size: 12px;
    padding-inline: 10px;
  }

  .portrait-card {
    width: min(72vw, 240px);
  }

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

  .project-grid {
    gap: 14px;
  }

  .project-card {
    padding: 20px;
  }

  .project-card h3 {
    margin-top: 18px;
    font-size: 22px;
  }

  .project-card p {
    margin-top: 12px;
    line-height: 1.65;
  }

  .project-tags {
    margin-top: 18px;
    margin-bottom: 20px;
  }

  .project-link {
    width: 100%;
    min-height: 46px;
  }
}
