:root {
  --paper: #fff8f2;
  --ink: #2a2422;
  --muted: #746963;
  --rose: #d45d67;
  --peach: #f4c7b8;
  --sage: #cfe0c8;
  --gold: #d7b07a;
  --line: rgba(42, 36, 34, 0.12);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-move: cubic-bezier(0.77, 0, 0.175, 1);
  --serif: "Songti SC", "STSong", "Noto Serif SC", Palatino, "Iowan Old Style", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: light; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}
img { display: block; width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.wash {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(42rem 28rem at 8% -8%, rgba(244, 199, 184, 0.7), transparent 58%),
    radial-gradient(36rem 24rem at 96% 12%, rgba(207, 224, 200, 0.55), transparent 60%),
    radial-gradient(30rem 22rem at 70% 90%, rgba(212, 93, 103, 0.16), transparent 62%);
}
.orb {
  position: fixed;
  width: 280px;
  height: 280px;
  margin: -140px 0 0 -140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(215, 176, 122, 0.28), transparent 68%);
  pointer-events: none;
  z-index: -1;
  transform: translate3d(-40vw, 20vh, 0);
  will-change: transform;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  width: min(100% - 40px, 1180px);
  margin: 0 auto;
  background: rgba(255, 248, 242, 0.78);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.08em;
}
.brand img {
  width: 30px;
  height: 30px;
  object-fit: cover;
  border-radius: 50%;
}
.site-header nav { display: flex; gap: 2px; }
.site-header nav a {
  padding: 8px 10px;
  color: var(--muted);
  font-size: 13px;
  transition: color 160ms ease;
}
.site-header nav a:hover { color: var(--ink); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 42vw);
  min-height: calc(100dvh - 64px);
  width: min(100%, 1340px);
  margin: 0 auto;
}
.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 36px 40px 48px;
  max-width: 680px;
}
.hero-kicker {
  margin: 0 0 14px;
  color: var(--rose);
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.16em;
}
.hero h1 {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: 0.04em;
  background: linear-gradient(120deg, #9b3140 0%, #2a2422 42%, #b8894a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-lead {
  margin: 0 0 24px;
  max-width: 32em;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }
.hero-photo { margin: 0; min-height: 460px; }
.hero-photo img {
  height: 100%;
  object-fit: cover;
}

.wechat-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.06em;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}
.wechat-btn {
  border: 1px solid var(--rose);
  background: var(--rose);
  color: #fff7f4;
}
.ghost-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
}
.wechat-btn:active,
.ghost-btn:active { transform: scale(0.97); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.chips li {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(212, 93, 103, 0.18);
  color: #6d3a3d;
  font-size: 12px;
  opacity: 0;
  transform: translateY(8px);
  animation: rise 420ms var(--ease-out) forwards;
}
.chips li:nth-child(1) { animation-delay: 80ms; }
.chips li:nth-child(2) { animation-delay: 120ms; }
.chips li:nth-child(3) { animation-delay: 160ms; }
.chips li:nth-child(4) { animation-delay: 200ms; }
.chips li:nth-child(5) { animation-delay: 240ms; }
.chips li:nth-child(6) { animation-delay: 280ms; }

.hero-copy > .hero-kicker,
.hero-copy > h1,
.hero-copy > .hero-lead,
.hero-copy > .hero-actions {
  opacity: 0;
  transform: translateY(12px);
  animation: rise 500ms var(--ease-out) forwards;
}
.hero-copy > .hero-kicker { animation-delay: 40ms; }
.hero-copy > h1 { animation-delay: 90ms; }
.hero-copy > .hero-lead { animation-delay: 140ms; }
.hero-copy > .hero-actions { animation-delay: 190ms; }

@keyframes rise {
  to { opacity: 1; transform: none; }
}

.marquee {
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.38);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex;
  gap: 2.4rem;
  width: max-content;
  padding: 14px 0;
  animation: drift 28s linear infinite;
  color: var(--rose);
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.12em;
}
@keyframes drift {
  to { transform: translateX(-50%); }
}

.about, .study, .work, .papers, .skills, .closing, .footer {
  width: min(100% - 40px, 1180px);
  margin-inline: auto;
}
.about { padding: 96px 0 72px; }
.about-inner { max-width: 680px; }
.about-avatar {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  object-fit: cover;
  border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(244, 199, 184, 0.55);
}
.about-name {
  margin: 0 0 12px;
  color: var(--rose);
  font-family: var(--serif);
  letter-spacing: 0.14em;
}
.about h2, .study h2, .work h2, .papers h2, .skills h2 {
  margin: 0 0 22px;
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 46px);
  font-weight: 500;
  line-height: 1.25;
}
.about p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.9;
}

.study { padding: 20px 0 80px; }
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 22px;
}
.timeline li {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 24px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
}
.timeline time {
  color: var(--rose);
  font-size: 13px;
  font-weight: 650;
}
.timeline strong { display: block; font-family: var(--serif); font-size: 22px; font-weight: 500; }
.timeline em { color: var(--gold); font-style: normal; font-size: 13px; }
.timeline p { margin: 8px 0 0; color: var(--muted); }

.full-photo {
  margin: 0 0 8px;
  width: 100%;
  overflow: hidden;
}
.full-photo img {
  width: 100%;
  height: 58vh;
  object-fit: cover;
}

.work { padding: 88px 0 40px; }
.project-hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 36px;
  margin-bottom: 28px;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(255,255,255,.7), rgba(244,199,184,.35));
  border: 1px solid rgba(212, 93, 103, 0.12);
}
.project-hero figure { margin: 0; overflow: hidden; border-radius: 16px; }
.project-hero img { height: 100%; min-height: 320px; object-fit: cover; }
.project h3 {
  margin: 6px 0 10px;
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 500;
}
.project p { margin: 0 0 14px; color: var(--muted); }
.tag {
  margin: 0;
  color: var(--rose);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}
.mini {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.mini li {
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12px;
}
.project-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 18px;
}
.project-grid .project {
  padding: 22px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.62);
}
.project-grid .project:last-child {
  background: linear-gradient(180deg, rgba(207,224,200,.45), rgba(255,255,255,.7));
}

.papers { padding: 48px 0 64px; }
.papers ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.papers li {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 16px 20px;
  padding: 18px 20px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
}
.papers li span {
  color: #fff;
  background: var(--rose);
  align-self: start;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  text-align: center;
}
.papers strong { font-family: var(--serif); font-size: 20px; font-weight: 500; }
.papers p { grid-column: 2; margin: 0; color: var(--muted); font-size: 13px; }

.skills { padding: 10px 0 72px; }
.skill-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.skill-board div {
  padding: 20px;
  border-radius: 20px;
  border: 1px solid var(--line);
}
.skill-board div:nth-child(1) { background: rgba(244, 199, 184, 0.45); }
.skill-board div:nth-child(2) { background: rgba(207, 224, 200, 0.5); }
.skill-board div:nth-child(3) { background: rgba(215, 176, 122, 0.28); }
.skill-board div:nth-child(4) { background: rgba(255,255,255,.75); }
.skill-board strong { display: block; margin-bottom: 8px; font-family: var(--serif); font-size: 22px; font-weight: 500; }
.skill-board p { margin: 0; color: var(--muted); }

.closing {
  padding: 10px 0 88px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
}
.closing p {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 500;
  line-height: 1.35;
}

.footer {
  display: flex;
  justify-content: space-between;
  padding: 22px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.reveal-clip {
  clip-path: inset(18% 8% 18% 8%);
  transition: clip-path 700ms var(--ease-move);
}
.reveal-clip.is-in { clip-path: inset(0); }

.item {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 420ms var(--ease-out), transform 420ms var(--ease-out);
}
.item.is-in {
  opacity: 1;
  transform: none;
}

.wechat-dialog {
  width: min(320px, calc(100% - 32px));
  padding: 28px 22px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff8f2;
  color: var(--ink);
  text-align: center;
  transform: scale(1);
  opacity: 1;
  transition: transform 280ms var(--ease-out), opacity 280ms var(--ease-out);
}
.wechat-dialog[open] {
  @starting-style {
    opacity: 0;
    transform: scale(0.96);
  }
}
.wechat-dialog::backdrop {
  background: rgba(42, 36, 34, 0.28);
}
.wechat-dialog p { margin: 0; }
.wechat-dialog p:first-child { font-family: var(--serif); font-size: 18px; }
.wechat-dialog img {
  width: 220px;
  height: 220px;
  margin: 18px auto 12px;
  object-fit: contain;
  background: #fff;
  border-radius: 12px;
}
.wechat-dialog p:nth-of-type(2) { color: var(--muted); font-size: 13px; }
.wechat-dialog button {
  min-height: 42px;
  margin-top: 18px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
  transition: transform 160ms var(--ease-out);
}
.wechat-dialog button:active { transform: scale(0.97); }

@media (hover: hover) and (pointer: fine) {
  .wechat-btn:hover { transform: translateY(-2px) scale(1.02); }
  .ghost-btn:hover { background: #fff; }
  .project-grid .project:hover,
  .timeline li:hover,
  .papers li:hover {
    transform: translateY(-3px);
    transition: transform 220ms var(--ease-out);
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .chips li,
  .hero-copy > * { animation: none; opacity: 1; transform: none; }
  .marquee-track { animation: none; }
  .reveal-clip, .item { clip-path: none; opacity: 1; transform: none; transition: none; }
  .orb { display: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .site-header, .project-hero, .skill-board div, .timeline li { background: #fff; backdrop-filter: none; }
}

@media (max-width: 940px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-photo { order: -1; max-height: 52vh; min-height: 46vw; }
  .hero-copy { padding: 28px 20px 40px; }
  .timeline li, .project-hero, .project-grid, .papers li, .skill-board {
    grid-template-columns: 1fr;
  }
  .papers p, .papers strong { grid-column: auto; }
}

@media (max-width: 620px) {
  .site-header, .about, .study, .work, .papers, .skills, .closing, .footer {
    width: min(100% - 24px, 1180px);
  }
  .hero h1 { font-size: 32px; }
  .wechat-btn, .ghost-btn { width: 100%; }
  .full-photo img { height: 38vh; }
  .site-header nav a { padding: 6px 7px; font-size: 12px; }
}
