:root {
  --font-main: "Noto Sans SC", sans-serif;
  --font-main-en: "Geist", "Geist Placeholder", sans-serif;
  --bg: #ffffff;
  --bg-strong: #ffffff;
  --hero-bg: #ffffff;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-strong: #f8f9fc;
  --text: #111827;
  --muted: #5b657a;
  --line: rgba(17, 24, 39, 0.16);
  --blue: #0f3573;
  --blue-strong: #0b2a5c;
  --hero-text-main: #111826;
  --hero-text-sub: #798093;
  --hero-net-stroke: rgba(20, 40, 86, 0.24);
  --shadow: 0 14px 40px rgba(15, 23, 42, 0.12);
  --skills-card-top: rgba(15, 53, 115, 0.12);
  --skills-badge-bg: rgba(15, 53, 115, 0.08);
  --skills-pill-bg: rgba(17, 24, 39, 0.04);
  --skills-pill-bg-hover: rgba(17, 24, 39, 0.08);
  --skills-pill-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  --skills-card-shadow: 0 16px 36px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.05);
  --skills-card-shadow-hover: 0 22px 50px rgba(15, 23, 42, 0.16), 0 8px 18px rgba(15, 23, 42, 0.08);
  --skills-card-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  --skills-badge-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 8px 18px rgba(15, 23, 42, 0.08);
  --skills-pill-border: var(--line);
  --timeline-card-shadow: 0 16px 36px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.05);
  --timeline-card-shadow-hover: 0 20px 44px rgba(0, 0, 0, 0.28), 0 8px 18px rgba(15, 23, 42, 0.08);
  --timeline-card-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  --panel-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  --contact-shell-shadow: 0 18px 44px rgba(15, 23, 42, 0.12);
  --contact-icon-bg: rgba(100, 140, 235, 0.08);
  --contact-icon-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), 0 12px 24px rgba(15, 23, 42, 0.08);
  --contact-icon-shadow-hover: 0 0 0 4px rgba(78, 119, 208, 0.16), 0 0 26px rgba(78, 119, 208, 0.24);
}

[data-theme="dark"] {
  --bg: #05070b;
  --bg-strong: linear-gradient(180deg, #05070b 0%, #08111f 44%, #070a10 100%);
  --hero-bg: linear-gradient(180deg, #04060a 0%, #09101b 100%);
  --panel: rgba(8, 11, 16, 0.64);
  --panel-strong: #0a0d13;
  --text: #f3f4f6;
  --muted: #acb2bc;
  --line: rgba(240, 244, 255, 0.16);
  --blue: #4d79ba;
  --blue-strong: #5a86c6;
  --hero-text-main: #f6f7fb;
  --hero-text-sub: #b3b8c3;
  --hero-net-stroke: rgba(129, 158, 214, 0.26);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --skills-card-top: rgba(62, 101, 159, 0.2);
  --skills-badge-bg: rgba(62, 101, 159, 0.16);
  --skills-pill-bg: rgba(255, 255, 255, 0.04);
  --skills-pill-bg-hover: rgba(255, 255, 255, 0.08);
  --skills-pill-shadow: inset 0 1px 0 rgba(185, 208, 255, 0.12), 0 0 0 1px rgba(88, 125, 201, 0.18),
    0 0 16px rgba(49, 92, 173, 0.14);
  --skills-card-shadow: inset 0 1px 0 rgba(135, 164, 215, 0.08), 0 0 0 1px rgba(62, 101, 159, 0.12),
    0 0 28px rgba(37, 88, 168, 0.1);
  --skills-card-shadow-hover: inset 0 1px 0 rgba(185, 208, 255, 0.12), 0 0 0 1px rgba(88, 125, 201, 0.2),
    0 0 40px rgba(49, 92, 173, 0.16);
  --skills-card-highlight: inset 0 1px 0 rgba(135, 164, 215, 0.08);
  --skills-badge-shadow: inset 0 1px 0 rgba(185, 208, 255, 0.18), 0 0 0 1px rgba(88, 125, 201, 0.24),
    0 0 18px rgba(49, 92, 173, 0.18);
  --skills-pill-border: rgba(88, 125, 201, 0.2);
  --timeline-card-shadow: inset 0 1px 0 rgba(135, 164, 215, 0.08), 0 0 0 1px rgba(62, 101, 159, 0.12),
    0 0 28px rgba(37, 88, 168, 0.1);
  --timeline-card-shadow-hover: inset 0 1px 0 rgba(185, 208, 255, 0.12), 0 0 0 1px rgba(88, 125, 201, 0.2),
    0 0 40px rgba(49, 92, 173, 0.16);
  --timeline-card-highlight: inset 0 1px 0 rgba(135, 164, 215, 0.08);
  --panel-highlight: inset 0 1px 0 rgba(135, 164, 215, 0.1);
  --contact-shell-shadow: inset 0 1px 0 rgba(135, 164, 215, 0.08), 0 0 0 1px rgba(62, 101, 159, 0.12),
    0 0 36px rgba(37, 88, 168, 0.12);
  --contact-icon-bg: linear-gradient(180deg, rgba(14, 24, 43, 0.96), rgba(7, 14, 26, 0.96));
  --contact-icon-shadow: inset 0 1px 0 rgba(160, 190, 255, 0.16), 0 0 0 1px rgba(88, 125, 201, 0.22),
    0 0 18px rgba(49, 92, 173, 0.16);
  --contact-icon-shadow-hover: inset 0 1px 0 rgba(185, 208, 255, 0.24), 0 0 0 1px rgba(109, 148, 229, 0.38),
    0 0 0 4px rgba(78, 119, 208, 0.12), 0 0 28px rgba(88, 125, 201, 0.3);
}

[data-theme="light"] .logo,
[data-theme="light"] .hero-name {
  color: var(--hero-text-main);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-main);
  color: var(--text);
  background: var(--bg-strong);
  line-height: 1.55;
  overflow-x: hidden;
}

html[lang="en"] body {
  font-family: var(--font-main-en);
}

main {
  width: min(1320px, 92vw);
  margin: 0 auto;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  isolation: isolate;
  width: 100%;
  padding: 1.4rem max(4vw, calc((100vw - 1320px) / 2)) 0.9rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: transparent;
  pointer-events: none;
  transition: background 0.24s ease, backdrop-filter 0.24s ease, box-shadow 0.24s ease, opacity 0.24s ease;
}

.topbar.is-scrolled::before {
  background: var(--panel);
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.logo {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.18);
}

.nav {
  display: flex;
  gap: clamp(0.4rem, 1.1vw, 1.2rem);
  justify-content: center;
  flex-wrap: wrap;
}

.nav a {
  position: relative;
  color: var(--text);
  text-decoration: none;
  font-size: clamp(1rem, 1.38vw, 1.06rem);
  font-weight: 500;
  padding: 0.4rem 0.3rem 0.72rem;
  transition: color 0.22s ease, transform 0.22s ease;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.16);
}

.nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0.18rem;
  width: 100%;
  height: 2px;
  border-radius: 99px;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.24s ease;
}

.nav a:hover {
  color: var(--text);
  transform: translateY(-1px);
}

.nav a.active {
  color: var(--text);
  font-size: clamp(1.06rem, 1.5vw, 1.12rem);
}

.nav a.active::after {
  transform: scaleX(1);
}

.actions {
  display: flex;
  gap: 0.7rem;
  justify-self: end;
}

.ghost-btn,
.primary-btn,
.secondary-btn,
.tab-btn,
.chip-btn {
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  color: var(--text);
}

.ghost-btn {
  background: var(--panel);
  backdrop-filter: blur(8px);
  padding: 0.48rem 0.86rem;
  cursor: pointer;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.ghost-btn:hover {
  border-color: rgba(136, 156, 197, 0.6);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08);
}

.theme-btn {
  width: 2.7rem;
  height: 2.7rem;
  padding: 0;
  border-radius: 14px;
  position: relative;
}

.theme-icon {
  width: 1.28rem;
  height: 1.28rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  position: absolute;
  inset: 0;
  margin: auto;
}

.icon-sun {
  display: none;
}

.icon-moon {
  display: block;
}

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

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

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

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

.hero {
  position: relative;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  min-height: 100vh;
  margin-top: 0;
  padding: clamp(6.2rem, 8vw, 8.2rem) 0 clamp(7.2rem, 9vw, 9.2rem);
  overflow: hidden;
  background: var(--hero-bg);
  display: flex;
  align-items: center;
  padding-top: clamp(7rem, 9vw, 8.8rem);
}

.hero-net {
  position: absolute;
  inset: -50px calc(-1 * clamp(36px, 4vw, 96px)) 50px calc(-1 * clamp(36px, 4vw, 96px));
  z-index: 1;
  pointer-events: none;
  opacity: 0.9;
  transform-origin: center center;
  transform: translateY(50px) rotate(-7deg) translateX(clamp(18px, 2vw, 42px)) scaleX(1.25) scaleY(0.78) skewY(11.2deg);
}

.hero-net g {
  fill: none;
  stroke: var(--hero-net-stroke);
  stroke-width: 1.25;
  stroke-linecap: round;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1320px, 92vw);
  max-width: 980px;
  margin: clamp(2.2rem, 6vh, 4.6rem) auto 0;
}

h1 {
  margin: 0 0 1.55rem;
  line-height: 1.08;
  font-size: 56px;
  letter-spacing: -0.03em;
}

.hero-line {
  color: #a6a6a6;
}

.hero-line:first-child {
  color: #a6a6a6;
  font-weight: 700;
}

.hero-name {
  color: #ffffff;
}

.typed-role {
  color: var(--hero-text-main);
  font-weight: 600;
}

.cursor {
  display: inline-block;
  color: var(--hero-text-main);
  animation: blink 0.85s step-end infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.hero-copy {
  max-width: 28ch;
  color: var(--hero-text-sub);
  margin: 0;
  font-size: clamp(0.96rem, 1.48vw, 1.72rem);
  line-height: 1.42;
}

.hero-scroll-indicator {
  position: absolute;
  left: 50%;
  bottom: clamp(3.7rem, 6.8vw, 5.3rem);
  transform: translateX(-50%);
  width: 18px;
  height: 24px;
  border: 2.2px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-top: 0;
  z-index: 3;
  opacity: 0.95;
}

.hero-scroll-wheel {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  animation: scrollDot 1.8s ease-in-out infinite;
}

[data-theme="light"] .hero-scroll-indicator {
  border-color: rgba(0, 0, 0, 0.9);
}

[data-theme="light"] .hero-scroll-wheel {
  background: rgba(0, 0, 0, 0.96);
}

@keyframes scrollDot {
  0% {
    transform: translateY(-2px);
    opacity: 1;
  }
  45% {
    transform: translateY(4px);
    opacity: 0.65;
  }
  70% {
    transform: translateY(5px);
    opacity: 0.35;
  }
  100% {
    transform: translateY(-2px);
    opacity: 1;
  }
}

.primary-btn,
.secondary-btn,
.chip-btn,
.tab-btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.66rem 1.1rem;
  transition: 0.22s ease;
}

.primary-btn {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.primary-btn:hover {
  background: var(--blue-strong);
  border-color: var(--blue-strong);
  transform: translateY(-1px);
}

.secondary-btn,
.chip-btn {
  background: rgba(100, 140, 235, 0.08);
}

.secondary-btn:hover,
.chip-btn:hover {
  background: rgba(100, 140, 235, 0.18);
}

.section {
  padding: clamp(3.8rem, 6vw, 5.8rem) 0;
}

.about {
  position: relative;
  --about-stage-gap: clamp(1rem, 2vw, 1.8rem);
  --about-rail-width: clamp(76px, 8vw, 104px);
}

.about-head {
  margin-bottom: 0;
}

.about-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--about-rail-width) minmax(0, 1fr);
  gap: var(--about-stage-gap);
  margin-top: 80px;
  align-items: stretch;
}

.about-manifesto {
  align-self: center;
  justify-self: end;
  width: 100%;
  max-width: 420px;
  padding: 0;
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1rem;
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
}

.about-manifesto p {
  margin: 0;
  max-width: 26ch;
  font-size: clamp(1.04rem, 1.4vw, 1.28rem);
  line-height: 1.65;
  color: rgba(243, 244, 246, 0.9);
}

.about-resume-wrap {
  position: relative;
  width: fit-content;
  margin-top: 100px;
}

.about-resume-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(120, 153, 216, 0.34);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(18, 28, 48, 0.9), rgba(9, 15, 29, 0.96));
  color: rgba(243, 244, 246, 0.96);
  font: inherit;
  font-size: 0.96rem;
  font-weight: 500;
  padding: 0.72rem 1.2rem;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(172, 194, 255, 0.16), 0 14px 30px rgba(10, 18, 34, 0.28);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.about-resume-btn:hover,
.about-resume-btn:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(139, 174, 238, 0.58);
  box-shadow: inset 0 1px 0 rgba(198, 214, 255, 0.24), 0 18px 36px rgba(36, 65, 124, 0.3);
}

.about-resume-btn:focus-visible {
  outline: 2px solid rgba(139, 174, 238, 0.55);
  outline-offset: 4px;
}

.about-resume-tooltip {
  position: absolute;
  left: 0;
  bottom: calc(100% + 14px);
  padding: 0.62rem 0.82rem;
  min-width: max-content;
  border-radius: 12px;
  border: 1px solid rgba(139, 174, 238, 0.3);
  background: rgba(9, 14, 24, 0.94);
  color: rgba(243, 244, 246, 0.94);
  font-size: 0.86rem;
  line-height: 1.4;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.about-resume-wrap:hover .about-resume-tooltip,
.about-resume-wrap:focus-within .about-resume-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

html[lang="zh-CN"] .about-manifesto p {
  white-space: nowrap;
}

[data-theme="light"] .about-manifesto p {
  color: rgba(17, 24, 39, 0.86);
}

[data-theme="light"] .about-resume-btn {
  border-color: rgba(15, 53, 115, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 247, 252, 0.96));
  color: rgba(15, 23, 42, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), 0 14px 30px rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .about-resume-btn:hover,
[data-theme="light"] .about-resume-btn:focus-visible {
  border-color: rgba(15, 53, 115, 0.3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 18px 36px rgba(15, 23, 42, 0.12);
}

[data-theme="light"] .about-resume-tooltip {
  background: rgba(255, 255, 255, 0.98);
  color: rgba(17, 24, 39, 0.92);
  border-color: rgba(139, 174, 238, 0.4);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.12);
}

.about-rail {
  position: relative;
  display: flex;
  justify-content: center;
}

.about-rail-line {
  width: 1px;
  height: 100%;
  min-height: 100%;
  background: linear-gradient(180deg, transparent 0%, rgba(100, 139, 214, 0.94) 14%, rgba(100, 139, 214, 0.72) 82%, transparent 100%);
  box-shadow: 0 0 16px rgba(87, 125, 201, 0.24);
}

.timeline-list {
  display: grid;
  gap: clamp(1rem, 2.2vw, 1.6rem);
  justify-items: start;
}

.timeline-item.panel {
  position: relative;
  width: 100%;
  max-width: 430px;
  padding: 1.35rem 1.4rem 1.4rem;
  border: none;
  border-radius: 20px;
  background:
    linear-gradient(90deg, transparent, var(--skills-card-top), transparent) top / 100% 1px no-repeat,
    var(--panel);
  box-shadow: var(--skills-card-shadow), var(--skills-card-highlight);
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease, filter 0.24s ease;
}

.timeline-item.panel::before {
  content: "";
  position: absolute;
  top: 1.55rem;
  left: calc(-1 * var(--about-stage-gap) - (var(--about-rail-width) / 2));
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(177, 205, 255, 0.98) 0%, rgba(109, 148, 229, 0.94) 48%, rgba(109, 148, 229, 0.18) 100%);
  box-shadow: 0 0 0 4px rgba(87, 125, 201, 0.12), 0 0 18px rgba(109, 148, 229, 0.55);
  transform: translate(-50%, -50%);
}

.timeline-item.panel:hover {
  transform: translateX(6px);
  border-color: rgba(98, 140, 220, 0.34);
  box-shadow: var(--skills-card-shadow-hover), var(--skills-card-highlight);
  filter: brightness(1.03);
}

.timeline-head {
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.timeline-date,
.timeline-role,
.timeline-desc {
  margin: 0;
}

.timeline-date {
  color: rgba(166, 170, 179, 0.82);
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
  font-weight: 500;
}

.timeline-role {
  font-size: 18px;
  line-height: 1.3;
  font-weight: 500;
  color: var(--text);
}

[data-theme="dark"] .timeline-date,
[data-theme="dark"] .timeline-role {
  color: #ffffff;
}

[data-theme="light"] .timeline-date,
[data-theme="light"] .timeline-role {
  color: var(--text);
}

.timeline-desc {
  margin-top: 0.55rem;
  color: rgba(166, 170, 179, 0.86);
  font-size: 0.98rem;
  line-height: 1.65;
}

[data-theme="light"] .timeline-desc {
  color: rgba(91, 101, 122, 0.92);
}

.section-head h2 {
  color: var(--text);
}

.section-head p {
  color: var(--muted);
}

.section + .section {
  border-top: 1px solid var(--line);
}

.section-head {
  text-align: center;
  max-width: 780px;
  margin: 0 auto 1.8rem;
}

.projects .section-head {
  margin-bottom: 80px;
}

h2 {
  margin: 0;
  font-size: clamp(2rem, 4.2vw, 4rem);
  line-height: 1.08;
}

.section-head p {
  color: var(--muted);
  font-size: clamp(1rem, 1.55vw, 1.35rem);
}

.split {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 1rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1.2rem;
  box-shadow: var(--shadow);
}

.intro-card {
  display: grid;
  grid-template-columns: minmax(230px, 300px) 1fr;
  gap: 1rem;
  align-items: stretch;
}

.portrait-fake {
  border-radius: 16px;
  min-height: 330px;
  background: linear-gradient(160deg, rgba(62, 108, 198, 0.88) 0%, rgba(15, 27, 58, 0.95) 70%),
    radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.35), transparent 38%);
}

.intro-copy h2 {
  font-size: clamp(1.8rem, 3vw, 3rem);
}

.intro-copy p {
  color: var(--muted);
  max-width: 52ch;
}

.social-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.metric-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 330px;
  background: linear-gradient(160deg, rgba(6, 42, 93, 0.88), rgba(8, 24, 56, 0.94));
  color: #fff;
}

.metric-label,
.metric-desc {
  opacity: 0.88;
}

.metric-number {
  margin: 0.25rem 0;
  font-size: clamp(3.2rem, 7vw, 6rem);
  font-weight: 800;
  line-height: 1;
}

.metric-desc {
  max-width: 37ch;
}

.project-tabs {
  display: flex;
  justify-content: center;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.tab-btn {
  cursor: pointer;
  background: rgba(130, 149, 189, 0.12);
}

.tab-btn.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
  box-shadow: 0 0 18px rgba(15, 53, 115, 0.35);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 1rem;
}

.project-card {
  position: relative;
  min-height: 280px;
  border-radius: 18px;
  border: 1px solid var(--line);
  overflow: hidden;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--panel);
  transform-style: preserve-3d;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.project-card:hover {
  border-color: rgba(85, 130, 255, 0.45);
}

.project-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.project-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(4, 7, 16, 0.92), rgba(9, 20, 45, 0.24));
}

.p1 {
  background: linear-gradient(140deg, #0a1124, #232f57);
}

.p2 {
  background: linear-gradient(140deg, #233344, #6a8aa8);
}

.p3 {
  background: linear-gradient(140deg, #111522, #394062);
}

.p4 {
  background: linear-gradient(140deg, #2f241e, #6a4d38);
}

.project-card h3,
.project-card p {
  margin: 0;
  position: relative;
  z-index: 1;
  color: #fff;
}

.project-card p {
  margin-top: 0.45rem;
  color: #d4d9e6;
}

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

.project-card-copy h3 {
  font-size: clamp(1.65rem, 2.3vw, 2.1rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.project-card-copy p {
  max-width: none;
  margin-top: 0;
  font-size: 1.02rem;
  line-height: 1.65;
  color: rgba(243, 244, 246, 0.82);
}

.project-card-actions {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 1rem;
}

.project-card-featured {
  padding: 1.55rem;
  justify-content: flex-start;
}

.project-card-featured:hover {
  border-color: rgba(85, 130, 255, 0.45);
}

.project-featured-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 1.3rem;
  padding: 0.5rem 0.55rem 0.45rem;
}

.project-featured-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.85rem;
  max-width: none;
}

.project-card-featured h3 {
  font-size: clamp(1.65rem, 2.3vw, 2.1rem);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.03em;
  white-space: normal;
}

.project-card-featured p {
  max-width: none;
  margin-top: 0;
  font-size: 1.02rem;
  line-height: 1.65;
  color: rgba(243, 244, 246, 0.82);
  white-space: normal;
}

.project-featured-actions {
  position: absolute;
  left: 50%;
  bottom: 1.6rem;
  display: flex;
  justify-content: center;
  transform: translateX(-50%);
}

.project-featured-btn {
  border: 1px solid rgba(240, 244, 255, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-weight: 600;
  padding: 0.7rem 1.15rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 10px 24px rgba(0, 0, 0, 0.18);
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.project-featured-btn:hover,
.project-featured-btn:focus-visible {
  transform: translateY(-2px);
  border-color: rgba(139, 174, 238, 0.48);
  background: rgba(100, 140, 235, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 16px 32px rgba(15, 23, 42, 0.22);
}

.project-featured-btn:focus-visible {
  outline: 2px solid rgba(139, 174, 238, 0.45);
  outline-offset: 4px;
}

.project-featured-btn:disabled {
  cursor: default;
  opacity: 0.78;
  transform: none;
  border-color: rgba(240, 244, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 24px rgba(0, 0, 0, 0.14);
}

.project-featured-btn:disabled:hover,
.project-featured-btn:disabled:focus-visible {
  transform: none;
  border-color: rgba(240, 244, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 24px rgba(0, 0, 0, 0.14);
  outline: none;
}

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

.skills-card {
  position: relative;
  overflow: hidden;
  border: none;
  padding: 1.35rem;
  box-shadow: var(--skills-card-shadow), var(--skills-card-highlight);
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.skills .section-head {
  margin-bottom: 80px;
}

.skills .section-head p {
  max-width: 40ch;
}

.skills-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--skills-card-top), transparent);
}

.skills-card:hover {
  transform: translateY(-4px);
  border-color: rgba(85, 130, 255, 0.24);
  box-shadow: var(--skills-card-shadow-hover), var(--skills-card-highlight);
}

.skills-card-head {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  margin-bottom: 1.15rem;
}

.skills-card-badge {
  flex-shrink: 0;
  min-width: 3rem;
  height: 3rem;
  padding: 0 0.85rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  background: var(--badge-bg, var(--skills-badge-bg));
  color: var(--badge-text, var(--blue));
  box-shadow: var(--skills-badge-shadow);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

[data-skill-group="ai"] {
  --badge-bg: rgba(57, 108, 190, 0.24);
  --badge-text: #8bb7ff;
}

[data-theme="light"] [data-skill-group="ai"] {
  --badge-bg: rgba(57, 108, 190, 0.16);
  --badge-text: #2f69c2;
}

[data-skill-group="product"] {
  --badge-bg: rgba(38, 143, 151, 0.22);
  --badge-text: #7fd3d9;
}

[data-theme="light"] [data-skill-group="product"] {
  --badge-bg: rgba(38, 143, 151, 0.15);
  --badge-text: #23878f;
}

[data-skill-group="dev"] {
  --badge-bg: rgba(108, 93, 184, 0.22);
  --badge-text: #b7afff;
}

[data-theme="light"] [data-skill-group="dev"] {
  --badge-bg: rgba(108, 93, 184, 0.15);
  --badge-text: #6859ba;
}

.skills-card-title-wrap {
  min-width: 0;
}

.skills-card h3 {
  margin: 0;
  font-size: clamp(1.16rem, 1.55vw, 1.42rem);
  line-height: 1.22;
  letter-spacing: -0.02em;
}

.skills-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.skill-pill {
  border: 1px solid var(--skills-pill-border);
  background: var(--skills-pill-bg);
  color: var(--text);
  border-radius: 999px;
  padding: 0.72rem 0.98rem;
  line-height: 1;
  font-size: 0.94rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.skill-pill:hover {
  background: var(--skills-pill-bg-hover);
  transform: translateY(-2px);
  border-color: rgba(98, 140, 220, 0.28);
  box-shadow: var(--skills-pill-shadow);
}

.contact-block {
  padding-bottom: 3.6rem;
}

.contact-shell {
  border: none;
  border-radius: 24px;
  background: var(--panel);
  box-shadow: var(--contact-shell-shadow), var(--panel-highlight);
  padding: clamp(1.8rem, 3.4vw, 2.8rem) 1.2rem;
  text-align: center;
}

.contact-shell h2 {
  font-size: clamp(2rem, 3.8vw, 3.25rem);
}

.contact-note {
  max-width: 40ch;
  margin: 50px auto 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.45vw, 1.2rem);
}

.contact-actions {
  margin-top: 1.8rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: calc(clamp(1.2rem, 3vw, 2.2rem) + 50px);
  flex-wrap: wrap;
}

.contact-action-item {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.contact-action-label {
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1;
}

.contact-icon-btn {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  border: 1px solid var(--line);
  padding: 0;
  background: var(--contact-icon-bg);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--contact-icon-shadow);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.contact-icon-btn svg {
  width: 2rem;
  height: 2rem;
}

.contact-icon-btn img {
  width: 2rem;
  height: 2rem;
  display: block;
}

[data-theme="light"] #wechatTrigger img {
  filter: brightness(0);
}

.contact-icon-btn:hover,
.contact-icon-btn:focus-visible {
  transform: scale(1.06);
  border-color: rgba(98, 140, 220, 0.78);
  box-shadow: var(--contact-icon-shadow-hover);
  opacity: 0.98;
}

.contact-icon-btn:focus-visible {
  outline: none;
}

.contact-popover {
  position: absolute;
  left: 50%;
  top: calc(60px + 0.75rem);
  transform: translateX(-50%);
  width: max-content;
  max-width: min(92vw, 310px);
  border: 1px solid var(--line);
  background: var(--panel-strong);
  border-radius: 14px;
  padding: 0.75rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem;
  z-index: 12;
}

.contact-popover[hidden] {
  display: none;
}

.contact-email {
  font-size: 0.92rem;
  color: var(--text);
  word-break: break-all;
}

.contact-copy-btn {
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  flex-shrink: 0;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(100, 140, 235, 0.08);
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.2s ease;
}

.contact-copy-btn:hover,
.contact-copy-btn:focus-visible {
  background: rgba(100, 140, 235, 0.18);
}

.contact-copy-btn:focus-visible {
  outline: none;
}

.contact-copy-btn .icon-copy,
.contact-copy-btn .icon-success {
  width: 1rem;
  height: 1rem;
}

.contact-copy-btn .icon-success {
  display: none;
}

.contact-copy-btn.is-copied {
  color: #3bb273;
  border-color: rgba(59, 178, 115, 0.5);
  background: rgba(59, 178, 115, 0.12);
}

.contact-copy-btn.is-copied .icon-copy {
  display: none;
}

.contact-copy-btn.is-copied .icon-success {
  display: block;
}

.contact-toast {
  margin: 1rem auto 0;
  width: fit-content;
  color: var(--text);
  border: 1px solid var(--line);
  background: var(--panel-strong);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.88rem;
}

.contact-toast[hidden] {
  display: none;
}

.contact-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.contact-modal[hidden] {
  display: none;
}

.contact-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(2px);
}

.contact-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 380px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  padding: 1.1rem;
  text-align: center;
}

.contact-modal-dialog h3 {
  margin: 0 0 0.9rem;
  font-size: 1.2rem;
}

.contact-modal-dialog img {
  width: min(72vw, 280px);
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: block;
  margin: 0 auto;
}

.contact-modal-note {
  margin: 0.8rem 0 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}

.contact-modal-close {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: absolute;
  right: 0.8rem;
  top: 0.8rem;
}

.contact-modal-close svg {
  width: 1rem;
  height: 1rem;
}

.footer {
  width: min(1480px, 92vw);
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 1.4rem 0 2.6rem;
  color: var(--muted);
  text-align: center;
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: 0.75s ease;
}

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

@media (max-width: 1150px) {
  .split {
    grid-template-columns: 1fr;
  }

  .about-stage {
    --about-rail-width: 72px;
  }

  .metric-card {
    min-height: 240px;
  }

  .skills-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 960px) {
  .topbar {
    top: 0.9rem;
    left: 50%;
    transform: translateX(-50%);
    width: 94vw;
    max-width: 700px;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 0.45rem;
    padding: 0.9rem 1rem 0.8rem;
  }

  .logo {
    display: none;
  }

  #about {
    scroll-margin-top: 9.5rem;
  }

  .about-stage {
    grid-template-columns: 1fr;
    gap: 1.2rem;
    margin-top: 1.8rem;
  }

  .about-manifesto {
    min-height: auto;
    max-width: none;
    justify-self: stretch;
  }

  .about-rail {
    display: none;
  }

  .timeline-list {
    position: relative;
    gap: 0.95rem;
    width: 100%;
    padding-left: 2.2rem;
    justify-items: stretch;
    overflow: clip;
  }

  .timeline-list::before {
    content: "";
    position: absolute;
    top: 0.35rem;
    bottom: 0.35rem;
    left: 14px;
    width: 1px;
    background: linear-gradient(180deg, transparent 0%, rgba(100, 139, 214, 0.94) 12%, rgba(100, 139, 214, 0.72) 86%, transparent 100%);
    box-shadow: 0 0 16px rgba(87, 125, 201, 0.24);
  }

  .timeline-item.panel {
    max-width: none;
    min-width: 0;
  }

  .timeline-item.panel::before {
    left: -1.55rem;
  }

  .nav {
    width: 100%;
  }

  .actions {
    justify-self: center;
  }

  .intro-card {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .section {
    padding: 3rem 0;
  }

  main,
  .footer {
    width: min(1480px, 94vw);
  }

  .topbar {
    width: 95vw;
    gap: 0.4rem;
    padding: 0.72rem 0.85rem 0.7rem;
  }

  .nav {
    gap: 0.3rem 0.8rem;
  }

  .nav a {
    font-size: 0.96rem;
    padding: 0.2rem 0.12rem 0.58rem;
  }

  .nav a.active {
    font-size: 1rem;
  }

  .actions {
    gap: 0.55rem;
  }

  .ghost-btn,
  .primary-btn,
  .secondary-btn,
  .tab-btn,
  .chip-btn {
    border-radius: 10px;
    font-size: 0.92rem;
  }

  .ghost-btn {
    padding: 0.42rem 0.72rem;
  }

  .theme-btn {
    width: 2.45rem;
    height: 2.45rem;
  }

  .theme-icon {
    width: 1.12rem;
    height: 1.12rem;
  }

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

  .about-head {
    margin-bottom: 0;
  }

  .about-manifesto {
    min-height: auto;
  }

  .about-manifesto p {
    max-width: none;
    font-size: 0.95rem;
    white-space: normal;
  }

  .about-resume-wrap {
    width: 100%;
    margin-top: 1.5rem;
  }

  .about-resume-btn {
    width: 100%;
    justify-content: center;
    font-size: 0.9rem;
    padding: 0.66rem 1rem;
  }

  .about-resume-tooltip {
    min-width: 0;
    width: min(100%, 260px);
    white-space: normal;
    font-size: 0.8rem;
  }

  .timeline-item {
    padding: 0.95rem 0.95rem 1rem;
    max-width: none;
    border-radius: 18px;
  }

  .timeline-list {
    padding-left: 1.8rem;
  }

  .timeline-list::before {
    left: 10px;
  }

  .timeline-item.panel::before {
    left: -1.2rem;
  }

  .timeline-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .timeline-date {
    font-size: 0.92rem;
    letter-spacing: 0.05em;
  }

  .timeline-role {
    font-size: 1rem;
  }

  .timeline-desc {
    font-size: 0.88rem;
    line-height: 1.55;
  }

  .hero {
    min-height: auto;
    padding-top: 6.35rem;
    padding-bottom: 5.4rem;
  }

  h1 {
    margin-bottom: 1rem;
    font-size: clamp(2.35rem, 11vw, 3.15rem);
  }

  .hero-copy {
    max-width: 36ch;
    font-size: 0.95rem;
    line-height: 1.55;
  }

  .hero-scroll-indicator {
    bottom: 2rem;
    transform: translateX(-50%) scale(0.82);
  }

  .section-head {
    margin-bottom: 1.1rem;
  }

  .projects .section-head,
  .skills .section-head {
    margin-bottom: 2.5rem;
  }

  h2 {
    font-size: clamp(1.8rem, 8vw, 2.4rem);
  }

  .section-head p {
    font-size: 0.94rem;
  }

  .panel {
    border-radius: 18px;
    padding: 1rem;
  }

  .project-tabs {
    gap: 0.5rem;
    margin-bottom: 0.8rem;
  }

  .tab-btn {
    padding: 0.58rem 0.82rem;
  }

  .project-card {
    min-height: 220px;
    padding: 0.85rem;
    border-radius: 16px;
  }

  .project-card-featured {
    padding: 1rem;
  }

  .project-featured-content {
    gap: 0.95rem;
    padding: 0.15rem 0.15rem 3.5rem;
  }

  .project-card-copy h3,
  .project-card-featured h3 {
    font-size: 1.35rem;
  }

  .project-card-copy p,
  .project-card-featured p {
    font-size: 0.9rem;
    line-height: 1.55;
  }

  .project-featured-actions {
    bottom: 1rem;
  }

  .project-featured-btn {
    border-radius: 12px;
    font-size: 0.9rem;
    padding: 0.62rem 0.95rem;
  }

  .skills-card {
    padding: 1rem;
    border-radius: 18px;
  }

  .skills-card-head {
    gap: 0.8rem;
    margin-bottom: 0.8rem;
  }

  .skills-card-badge {
    min-width: 2.45rem;
    height: 2.45rem;
    padding: 0 0.68rem;
    font-size: 0.78rem;
  }

  .skills-card h3 {
    font-size: 1.04rem;
  }

  .skills-pill-list {
    gap: 0.5rem;
  }

  .skill-pill {
    width: auto;
    text-align: left;
    padding: 0.62rem 0.8rem;
    font-size: 0.86rem;
  }

  .contact-block {
    padding-bottom: 2.6rem;
  }

  .contact-shell {
    border-radius: 20px;
    padding: 1.35rem 0.95rem;
  }

  .contact-note {
    margin-top: 1.4rem;
    font-size: 0.92rem;
  }

  .contact-actions {
    margin-top: 1.35rem;
    gap: 1.2rem;
  }

  .contact-icon-btn {
    width: 52px;
    height: 52px;
    border-radius: 14px;
  }

  .contact-icon-btn svg,
  .contact-icon-btn img {
    width: 1.65rem;
    height: 1.65rem;
  }

  .footer {
    padding: 1.2rem 0 2rem;
    font-size: 0.88rem;
  }
}

@media (max-width: 480px) {
  .topbar {
    top: 0.6rem;
    width: 96vw;
    padding: 0.65rem 0.72rem;
  }

  #about {
    scroll-margin-top: 8.8rem;
  }

  .nav {
    gap: 0.2rem 0.65rem;
  }

  .nav a {
    font-size: 0.88rem;
    padding-bottom: 0.5rem;
  }

  .nav a.active {
    font-size: 0.92rem;
  }

  .ghost-btn,
  .primary-btn,
  .secondary-btn,
  .tab-btn,
  .chip-btn,
  .project-featured-btn {
    font-size: 0.86rem;
  }

  .hero {
    padding-top: 5.95rem;
    padding-bottom: 4.7rem;
  }

  .hero-content {
    margin-top: 1.4rem;
  }

  h1 {
    font-size: clamp(2rem, 10.8vw, 2.6rem);
  }

  .hero-copy {
    font-size: 0.9rem;
  }

  .timeline-list {
    padding-left: 1.45rem;
  }

  .timeline-list::before {
    left: 8px;
  }

  .timeline-item.panel::before {
    left: -0.98rem;
    width: 10px;
    height: 10px;
  }

  .timeline-item {
    padding: 0.9rem 0.88rem 0.95rem;
  }

  .project-card {
    min-height: 200px;
  }

  .project-card-copy h3,
  .project-card-featured h3 {
    font-size: 1.2rem;
  }

  .project-card-copy p,
  .project-card-featured p,
  .timeline-desc,
  .section-head p,
  .contact-note {
    font-size: 0.85rem;
  }

  .skill-pill {
    padding: 0.58rem 0.72rem;
    font-size: 0.82rem;
  }
}
