:root {
  --blue: #2c98f0;
  --ink: #252525;
  --muted: #666;
  --sidebar: #f2f3f7;
  --line: #e7e7e7;
  --sidebar-width: 326px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: rgba(0,0,0,.7); background: #fff; font-family: "Quicksand", Arial, sans-serif; font-size: 15px; font-weight: 400; line-height: 1.8; }
a { color: var(--blue); text-decoration: none; transition: color .25s ease; }
a:hover { color: #166cae; }
img { display: block; max-width: 100%; }
.page-shell { position: relative; max-width: 1280px; min-height: 100vh; margin: 0 auto; }

.sidebar { position: fixed; z-index: 20; width: var(--sidebar-width); height: 100vh; padding: 46px 32px 32px; overflow-y: auto; text-align: center; background: var(--sidebar); transition: transform .5s ease; }
.profile-photo { width: 150px; height: 150px; margin: 0 auto 30px; border-radius: 50%; background: #ddd url("images/ruixiang-wang-2026-04-24.png") center 33%/cover no-repeat; }
.profile h1 { margin: 0 0 11px; font: 700 25px/1.3 "Playfair Display", serif; }
.profile h1 a { color: #000; }
.profile-details { display: block; font-size: 14px; line-height: 1.72; }
.profile-details span { display: block; }
.profile-contact { margin-top: 16px; font-size: 13px; line-height: 1.85; }
.profile-contact span { display: block; white-space: nowrap; }
.profile-contact a, .wechat-trigger { display: inline-block; margin: 0 2px; padding: 0; border: 0; color: var(--blue); background: transparent; font: inherit; line-height: inherit; white-space: nowrap; cursor: pointer; }
.profile-contact a:hover, .wechat-trigger:hover { color: #166cae; }
.main-menu { margin-top: 32px; }
.main-menu ul { margin: 0; padding: 0; list-style: none; }
.main-menu li { margin-bottom: 5px; font-size: 12px; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; }
.main-menu a { display: inline-block; position: relative; padding: 7px 0; color: rgba(0,0,0,.7); }
.main-menu a::after { content: ""; position: absolute; right: 0; bottom: 5px; left: 0; height: 1px; background: var(--blue); visibility: hidden; transform: scaleX(0); transition: all .3s cubic-bezier(.175,.885,.32,1.275); }
.main-menu a:hover, .main-menu li.active a { color: var(--blue); }
.main-menu a:hover::after, .main-menu li.active a::after { visibility: visible; transform: scaleX(1); }

.wechat-dialog { width: min(390px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 18px; overflow: visible; border: 0; border-radius: 8px; background: #fff; box-shadow: 0 22px 70px rgba(0,0,0,.28); }
.wechat-dialog::backdrop { background: rgba(20,24,28,.54); backdrop-filter: blur(3px); }
.wechat-dialog img { width: 100%; max-height: calc(100vh - 68px); object-fit: contain; }
.wechat-close { position: absolute; z-index: 1; top: 7px; right: 9px; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; color: #222; background: rgba(255,255,255,.9); box-shadow: 0 2px 10px rgba(0,0,0,.14); font: 400 24px/28px sans-serif; cursor: pointer; }
.wechat-close:hover { background: #fff; }

.main-content { float: right; width: calc(100% - var(--sidebar-width)); min-height: 100vh; }
.section { display: block; width: 100%; padding: 48px 0; clear: both; scroll-margin-top: 20px; }
.section-compact { padding-top: 28px; padding-bottom: 22px; }
.section#about { padding-top: 58px; }
.narrow-content { padding: 0 42px 0 56px; }
.section-title { position: relative; margin: 0 0 13px; color: #000; font: 700 18px/1.8 "Playfair Display", Georgia, serif; letter-spacing: 5px; text-transform: uppercase; }
.section p { margin: 0 0 14px; }
.mobile-profile { display: none; }

.news-list { margin: 0; padding-left: 22px; }
.news-list li { margin-bottom: 3px; }
.news-featured { color: #313131; }
.news-badge { display: inline-flex; align-items: center; gap: 4px; margin-left: 5px; padding: 1px 7px 1px 5px; border: 1px solid #e6b84b; border-radius: 999px; color: #805a00; background: linear-gradient(135deg, #fff8d9, #f8d77a); box-shadow: 0 2px 8px rgba(177, 125, 0, .14); font-size: 9px; font-weight: 700; line-height: 1.6; letter-spacing: .8px; text-transform: uppercase; vertical-align: 1px; }
.news-trophy { font-size: 11px; line-height: 1; filter: saturate(.9); transform: translateY(-.5px); }

.timeline { margin-top: 6px; }
.timeline-item { display: grid; grid-template-columns: 145px 25px minmax(0,1fr); gap: 15px; min-height: 88px; }
.timeline-date { padding-top: 2px; color: #555; font-size: 13px; text-align: right; }
.timeline-line { position: relative; display: flex; justify-content: center; }
.timeline-line::after { content: ""; position: absolute; top: 14px; bottom: 0; width: 1px; background: #d8d8d8; }
.timeline-item:last-child .timeline-line::after { display: none; }
.timeline-line span { position: relative; z-index: 1; width: 9px; height: 9px; margin-top: 8px; border: 2px solid var(--blue); border-radius: 50%; background: #fff; }
.timeline-content { padding-bottom: 22px; }
.timeline-content h3 { display: flex; align-items: center; min-height: 25px; margin: 0; font-size: 15px; font-weight: 700; }
.timeline-content p { margin: 0; color: #666; font-size: 13px; line-height: 1.55; }

.education-timeline { display: flex; position: relative; flex-direction: column; gap: 6px; margin-top: 10px; margin-left: -55px; }
.education-timeline::before { content: ""; position: absolute; top: 6px; bottom: 6px; left: 190px; width: 2px; background: #cfd8dc; }
.education-item { display: grid; position: relative; grid-template-columns: 170px 40px minmax(0, 1fr); align-items: flex-start; }
.education-date { padding-top: 8px; color: #6c757d; font-size: 13px; font-style: italic; text-align: right; }
.education-line { display: flex; position: relative; justify-content: center; }
.education-dot { z-index: 2; width: 14px; height: 14px; margin-top: 11px; margin-left: 2px; border: 3px solid #e6f2f2; border-radius: 50%; background: #0484d9; }
.education-content { min-width: 0; padding-top: 5px; padding-left: 3px; }
.education-school { display: flex; align-items: center; gap: 8px; min-height: 24px; }
.education-school a { color: #0484d9; font-size: 16.5px; font-weight: 600; line-height: 1.4; }
.education-school a:hover { text-decoration: underline; }
.education-logo { flex: 0 1 auto; width: auto; height: 22px; object-fit: contain; }
.education-logo-cuhksz { height: 28px; max-width: 240px; }
.education-logo-hit { height: 25px; }
.education-degree { margin-top: 4px; color: #222; font-size: 13.5px; line-height: 1.5; }
.experience-timeline { gap: 10px; }
.experience-timeline .education-school { flex-wrap: wrap; }
.experience-logo-dexforce { height: 24px; max-width: 132px; }
.experience-logo-cuhksz { height: 28px; max-width: 240px; }
.experience-logo-kaust { height: 30px; max-width: 148px; }
.experience-logo-tsinghua { height: 34px; border-radius: 50%; }

.publication-tabs { display: flex; justify-content: center; gap: 5px; margin: 8px 0 22px; }
.tab-button { padding: 8px 17px; border: 0; border-bottom: 2px solid transparent; color: #666; background: transparent; font: 500 14.5px/1.3 "Quicksand", sans-serif; cursor: pointer; }
.tab-button:hover, .tab-button.active { color: var(--blue); border-bottom-color: var(--blue); }
.publication-panel[hidden] { display: none; }
.publication-card { display: grid; grid-template-columns: 29% minmax(0,1fr); gap: 28px; min-height: 155px; margin-bottom: 9px; padding: 14px 0 17px; border-bottom: 1px solid #eee; }
.publication-thumb { display: flex; align-items: center; justify-content: center; align-self: center; min-height: 125px; overflow: hidden; background: #fafafa; }
.publication-thumb img { display: block; width: 100%; height: auto; object-fit: contain; }
.publication-copy { align-self: center; }
.publication-copy h3 { margin: 0 0 7px; color: #222; font-size: 18px; font-weight: 600; line-height: 1.42; }
.authors, .venue, .paper-links { margin: 0 0 4px !important; font-size: 13px; line-height: 1.5; }
.author-notes { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 2px; color: #4a452f; background: #fff7cf; font-size: 10.5px; line-height: 1.4; vertical-align: 1px; }
.paper-links a { margin-right: 2px; }

.interest-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; margin-top: 10px; }
.interest-grid article { min-height: 170px; padding: 21px 19px; border-bottom: 2px solid var(--blue); box-shadow: 0 0 22px rgba(0,0,0,.08); }
.interest-grid span { color: var(--blue); font-size: 11px; font-weight: 700; letter-spacing: 2px; }
.interest-grid h3 { margin: 14px 0 8px; font-size: 15px; }
.interest-grid p { margin: 0; color: #666; font-size: 12px; line-height: 1.65; }

.reveal { opacity: 0; clip-path: inset(0 0 18% 0); transform: translateY(28px); transition: opacity .72s ease var(--reveal-delay, 0ms), clip-path .72s cubic-bezier(.22,1,.36,1) var(--reveal-delay, 0ms), transform .72s cubic-bezier(.22,1,.36,1) var(--reveal-delay, 0ms); will-change: opacity, clip-path, transform; }
.reveal.visible { opacity: 1; clip-path: inset(0); transform: translateY(0); }
.nav-toggle { display: none; }

@media (min-width: 1281px) {
  .page-shell { left: min(16px, calc((100vw - 1280px)/2)); }
}

@media (max-width: 768px) {
  body.menu-open { overflow: hidden; }
  .page-shell { width: 100%; }
  .sidebar { width: 300px; padding-top: 60px; transform: translateX(-300px); box-shadow: 5px 0 30px rgba(0,0,0,.12); }
  body.menu-open .sidebar { transform: translateX(0); }
  .main-content { float: none; width: 100%; padding: 0 16px; transition: transform .5s ease; }
  body.menu-open .main-content { transform: translateX(300px); }
  .nav-toggle { display: block; position: fixed; z-index: 30; top: 20px; left: 20px; width: 32px; height: 32px; padding: 4px; border: 0; background: transparent; cursor: pointer; }
  .nav-toggle span { display: block; width: 22px; height: 2px; margin: 5px 0; background: #222; transition: .3s ease; }
  body.menu-open .nav-toggle span:first-child { transform: translateY(7px) rotate(45deg); }
  body.menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
  body.menu-open .nav-toggle span:last-child { transform: translateY(-7px) rotate(-45deg); }
  .section { padding: 45px 0; scroll-margin-top: 0; }
  .section:first-child, .section#about { padding-top: 34px; }
  .narrow-content { padding: 0; }
  .mobile-profile { display: grid; grid-template-columns: 82px minmax(0, 1fr); align-items: center; gap: 18px; margin: 0 0 30px; padding: 4px 0 24px 44px; border-bottom: 1px solid var(--line); }
  .mobile-profile .profile-photo { width: 82px; height: 82px; margin: 0; }
  .mobile-profile-copy { min-width: 0; }
  .mobile-profile h1 { margin: 0; color: #282828; font: 700 22px/1.3 "Playfair Display", serif; }
  .mobile-profile p { margin: 3px 0 0; color: #666; font-size: 12.5px; line-height: 1.5; }
  .mobile-profile-contact { display: flex; flex-wrap: wrap; gap: 1px 8px; margin-top: 8px; font-size: 10.5px; line-height: 1.5; }
  .mobile-profile-contact a, .mobile-profile-contact .wechat-trigger { display: inline-block; min-height: 28px; padding: 5px 0; border: 0; color: var(--blue); background: transparent; font: inherit; line-height: 1.5; white-space: nowrap; cursor: pointer; }
  .mobile-profile-contact a:hover, .mobile-profile-contact .wechat-trigger:hover { color: #166cae; }
  .timeline-item { grid-template-columns: 92px 18px minmax(0,1fr); gap: 8px; }
  .timeline-date { font-size: 11px; }
  .education-timeline { margin-left: 0; }
  .education-timeline::before { left: 110px; }
  .education-item { grid-template-columns: 90px 40px minmax(0,1fr); }
  .education-date { font-size: 10px; }
  .education-school { align-items: flex-start; flex-direction: column; gap: 4px; }
  .education-logo-cuhksz, .experience-logo-cuhksz { height: 28px; max-width: 170px; }
  .experience-timeline .education-school { flex-direction: row; align-items: center; }
  .experience-timeline .education-school strong { width: 100%; }
  .publication-card { grid-template-columns: 1fr; gap: 13px; }
  .publication-thumb { width: min(100%, 420px); min-height: 0; }
  .publication-copy h3 { font-size: 14px; }
  .interest-grid { grid-template-columns: 1fr; }
}

@media (max-width: 430px) {
  .main-content { padding: 0 14px; }
  .mobile-profile { grid-template-columns: 76px minmax(0, 1fr); gap: 15px; padding-left: 40px; }
  .mobile-profile .profile-photo { width: 76px; height: 76px; }
  .mobile-profile h1 { font-size: 20px; }
  .mobile-profile-contact { gap: 0 7px; font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; clip-path: none; transform: none; transition: none; }
}
