/* Original card styling and motion come from custom.css; only layout overrides live here. */
body.research-profile { margin-top: 0; padding-top: 0; --intro-heading: #000; --intro-text: #292929; --tsinghua-color: #660974; --scut-color: #014099; }
html { scrollbar-gutter: stable; }
[data-theme="dark"] body.research-profile { --intro-heading: #dedede; --intro-text: #cdcdcd; --tsinghua-color: #d79ae1; --scut-color: #7eb4ff; }
.research-profile .main-content { max-width: 1060px; padding: 94px 32px 0; }
.research-profile .nav-container { max-width: 1124px; gap: 24px; padding: 17px 32px; }
.research-profile .nav-brand { font-size: 24px; white-space: nowrap; }
.research-profile .nav-menu { margin-left: auto; gap: 22px; font-size: 17px; }
.research-profile .nav-item a { white-space: nowrap; border-bottom: 0; }
.research-profile .toggle-buttons { position: static; flex-shrink: 0; gap: 8px; }
.research-profile .theme-toggle { width: 44px; height: 44px; font-size: 19px; box-shadow: none; }
.research-profile .lang-toggle { min-width: 56px; height: 44px; padding: 0 12px; font-size: 16px; box-shadow: none; }
.research-profile .hero { text-align: left; padding: 50px 0 30px; animation: none; }
.research-profile .hero-content { display: grid; grid-template-columns: 190px minmax(0,1fr); gap: 42px; align-items: start; width: 100%; animation: fadeInUp .8s ease-out both; }
.research-profile .hero-sidebar { min-width: 0; }
.research-profile .hero-copy { align-self: stretch; display: flex; flex-direction: column; justify-content: space-between; }
.research-profile .profile-links { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; width: fit-content; margin: 20px auto 0; }
.research-profile .profile-location { display: flex; align-items: center; gap: 7px; min-height: 32px; color: var(--text-secondary); font-size: .84rem; }
.research-profile .profile-location svg { width: 19px; height: 19px; flex: 0 0 19px; }
.research-profile .email-reveal { background: none; border: 0; border-radius: 0; padding: 0; font-family: inherit; text-align: left; cursor: pointer; }
.research-profile .footer-contact .email-reveal { display: inline-flex; vertical-align: middle; min-height: 24px; font-size: inherit; }
.research-profile .footer-contact .email-reveal svg { width: 15px; height: 15px; flex-basis: 15px; }
.research-profile .email-dialog { width: min(400px, calc(100vw - 40px)); box-sizing: border-box; padding: 24px; border: 1px solid var(--border-color); border-radius: 14px; background: var(--card-bg); color: var(--text-primary); box-shadow: var(--shadow-md); }
.research-profile .email-dialog::backdrop { background: rgba(0,0,0,.3); backdrop-filter: blur(3px); }
.research-profile .email-dialog-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; }
.research-profile .email-dialog-header h2 { margin: 0; font-size: 1.15rem; }
.research-profile .email-close { display: flex; align-items: center; justify-content: center; flex: 0 0 32px; box-sizing: border-box; width: 32px; height: 32px; margin: 0; padding: 0; border: 1px solid var(--border-color); border-radius: 50%; background: var(--bg-secondary); color: var(--text-primary); line-height: 1; cursor: pointer; }
.research-profile .email-close svg { display: block; width: 18px; height: 18px; flex: none; }
.research-profile .email-addresses { display: flex; flex-direction: column; gap: 14px; }
.research-profile .email-addresses a { font-size: .95rem; color: var(--link-color); overflow-wrap: anywhere; }
.research-profile .hero-photo { margin: 8px 0 0; }
.research-profile .profile-photo { width: 164px; height: 164px; }
.research-profile .hero-title { font-size: 2.15rem; line-height: 1.25; margin: 0 0 16px; color: var(--intro-heading); }
.research-profile .hero-subtitle { font-size: 1rem; margin: 0 0 18px; color: var(--intro-text); }
.research-profile .hero-connections { max-width: 720px; font-size: .92rem; line-height: 1.8; color: var(--intro-text); margin: 0 0 20px; }
.research-profile .hero-connections p { margin: 0 0 12px; }
.research-profile .hero-connections p:last-child { margin-bottom: 0; }
.research-profile .hero-connections a,
.research-profile .hero-connections a:visited { color: inherit; font-weight: 600; border: 0; transition: color .2s ease; }
.research-profile .hero-connections a:hover,
.research-profile .hero-connections a:focus-visible { color: var(--link-color); }
@media (hover: hover) {
  .research-profile .hero-connections .university-tsinghua:hover { color: var(--tsinghua-color); }
  .research-profile .hero-connections .university-scut:hover { color: var(--scut-color); }
}
.research-profile .hero-description { max-width: 720px; font-size: .98rem; margin: 0 0 10px; line-height: 1.75; color: var(--intro-text); }
.research-profile .hero-approach { max-width: 660px; font-size: .92rem; line-height: 1.75; color: var(--intro-text); margin: 0; }
.research-profile .university-tsinghua,
.research-profile .university-scut { color: inherit; transition: color .2s ease; }
@media (hover: hover) {
  .research-profile .university-tsinghua:hover { color: var(--tsinghua-color); }
  .research-profile .university-scut:hover { color: var(--scut-color); }
}
/* One entrance for the whole intro, without nested scaling or staggered children. */
.research-profile #home .hero-photo,
.research-profile #home .profile-links,
.research-profile #home .hero-copy > *,
.research-profile #home .hero-connections > p { animation: none; opacity: 1; transform: none; }
.research-profile .hero-buttons { display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: center; gap: 6px 22px; margin: 0 0 8px; }
.research-profile .social-link { --social-accent: var(--link-color); display: inline-flex; align-items: center; gap: 7px; min-height: 32px; color: var(--text-secondary); font-size: .84rem; line-height: 1.4; border-bottom: 0; text-decoration: none; transition: color .2s ease, background-color .2s ease; }
.research-profile .profile-links .social-link { padding: 2px 8px; margin-left: -8px; border-radius: 6px; }
.research-profile .social-link svg { width: 19px; height: 19px; flex: 0 0 19px; color: inherit; }
.research-profile .social-link.github { --social-accent: var(--text-primary); }
.research-profile .social-link.scholar { --social-accent: #4285f4; }
.research-profile .social-link.linkedin { --social-accent: #0a66c2; }
.research-profile .social-link.orcid { --social-accent: #617d16; }
.research-profile .social-link:hover,
.research-profile .social-link:focus-visible { color: var(--social-accent); background-color: color-mix(in srgb, var(--social-accent) 7%, transparent); transform: none; text-decoration: none; }
.research-profile .social-link:focus-visible { outline: 2px solid var(--social-accent); outline-offset: 3px; }
[data-theme="dark"] .research-profile .social-link.linkedin { --social-accent: #60a5fa; }
[data-theme="dark"] .research-profile .social-link.orcid { --social-accent: #a6ce39; }
.research-profile .hero-contact { font-size: .8rem; margin: 0; line-height: 1.7; display: flex; flex-wrap: wrap; gap: 8px; }
.research-profile .section,
.research-profile .section:first-child { min-height: 0; padding: 40px 0; justify-content: flex-start; scroll-margin-top: 120px; }
.research-profile .section-title { text-align: left; font-size: 1.7rem; margin: 0 0 28px; padding: 0 0 14px; border-bottom: 1px solid var(--border-color); }
.research-profile .section-title::after { left: 0; transform: none; width: 42px; background: var(--accent); bottom: -1px; }
.research-profile .card-grid { margin: 0; }
.research-profile #education .education-details h3 { font-size: 1.2rem; }
.research-profile .research-topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.research-profile .research-topic { min-width: 0; }
.research-profile .research-topic-title { font-size: .92rem; line-height: 1.5; margin: 0 0 7px; color: var(--text-primary); }
.research-profile .research-topic-description { font-size: .84rem; line-height: 1.75; color: var(--text-secondary); }
.research-profile .research-topic-description p { margin: 0; }
@media (max-width: 960px) {
  .research-profile .research-topics { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
.research-profile #talks .timeline { margin: 0; }
.research-profile #talks .timeline-content { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.research-profile #talks .timeline-item:hover .timeline-content { transform: none; box-shadow: none; }
.research-profile #talks .timeline-item { margin-bottom: 30px; }
.research-profile #talks .timeline-item:last-child { margin-bottom: 0; }
.research-profile #talks .talk-title { font-size: 1rem; line-height: 1.5; margin-bottom: 10px; }
.research-profile #talks .talk-meta { font-size: .85rem; line-height: 1.6; gap: 5px; padding: 0; margin-bottom: 10px; border: 0; border-radius: 0; background: none; }
.research-profile #talks .meta-label,
.research-profile #talks .meta-value { font-size: inherit; }
.research-profile #talks .talk-description { font-size: .88rem; line-height: 1.7; padding: 0; margin: 10px 0 0; }
.research-profile #talks .talk-actions { margin-top: 12px; }
.research-profile .pub-authors { color: var(--text-secondary); font-size: .85rem; line-height: 1.6; margin: 8px 0 12px; }
.research-profile .pub-authors strong { color: var(--text-primary); }
.research-profile .pub-abstract { display: block; -webkit-line-clamp: unset; overflow: visible; }
.research-profile .pub-author-role { font-size: .78rem; color: var(--text-secondary); margin: 0 0 12px; }
.research-profile .profile-details { border-top: 1px solid var(--border-color); margin-top: 24px; padding-top: 16px; }
.research-profile .profile-details summary { cursor: pointer; color: var(--text-secondary); font-size: .9rem; padding: 4px 0; width: fit-content; transition: color .3s ease; }
.research-profile .profile-details summary:hover { color: var(--link-color); }
.research-profile .profile-details[open] > summary { margin-bottom: 24px; }
.research-profile .profile-details summary:focus-visible,
.research-profile a:focus-visible,
.research-profile button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.research-profile .music-card { min-width: 0; }
.research-profile .moments-grid { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 44px) / 3); gap: 22px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; padding: 4px 0 14px; scrollbar-width: none; }
.research-profile .moments-grid::-webkit-scrollbar { display: none; }
.research-profile .moments-grid > .moment-card { scroll-snap-align: start; animation: none; opacity: 1; transform: none; transition: box-shadow .3s ease; }
.research-profile .moments-grid > .moment-copy { animation: none; opacity: 1; transform: none; }
.research-profile .moments-grid.is-frozen { scroll-snap-type: none; overflow-x: hidden; }
.research-profile .moment-card.is-expanded { visibility: hidden; opacity: 0; pointer-events: none; }
.research-profile .moments-controls { display: flex; justify-content: flex-end; gap: 8px; margin: -12px 0 12px; }
.research-profile .moments-controls button { display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 10px; border: 1px solid var(--border-color); border-radius: 16px; color: var(--text-secondary); background: var(--card-bg); font: inherit; font-size: .8rem; cursor: pointer; }
.research-profile .moments-indicators { display: flex; justify-content: flex-start; gap: 0; margin: 0; }
.research-profile .moments-dot { display: grid; place-items: center; width: 16px; height: 24px; padding: 0; border: 0; background: none; cursor: pointer; }
.research-profile .moments-dot::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--text-secondary); opacity: .2; transition: opacity .2s ease, background-color .2s ease; }
.research-profile .moments-dot.is-visible::before { background: var(--accent); opacity: .65; }
.research-profile .moment-card { padding: 0; overflow: hidden; min-width: 0; }
.research-profile .moment-photo { display: block; aspect-ratio: 4 / 3; background: var(--bg-secondary); border: 0; }
.research-profile .moment-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.research-profile .moments-grid > .moment-card { cursor: zoom-in; }
@media (max-width: 767px), (pointer: coarse) {
    .research-profile .moments-grid > .moment-card { cursor: default; }
}
.research-profile .moment-card:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.research-profile .photo-dialog { width: min(var(--expanded-card-width, 440px), calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; overflow-x: hidden; border: 1px solid var(--border-color); border-radius: 14px; background: var(--card-bg); color: var(--text-primary); box-shadow: var(--shadow-md); transform-origin: center; }
.research-profile .photo-dialog::backdrop { background: rgba(0,0,0,.3); backdrop-filter: blur(3px); animation: moment-backdrop-in .3s ease both; }
.research-profile .photo-dialog.is-closing::backdrop { animation: moment-backdrop-out .26s ease both; }
@keyframes moment-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes moment-backdrop-out { from { opacity: var(--backdrop-close-opacity, 1); } to { opacity: 0; } }
.research-profile .photo-dialog.is-morphing { overflow: hidden; }
.research-profile .photo-dialog,
.research-profile .photo-dialog * { transition: none; }
.research-profile .photo-dialog .moment-origin { position: absolute; top: 0; left: 0; opacity: 0; pointer-events: none; }
.research-profile .photo-dialog .photo-close { position: absolute; top: 10px; right: 10px; z-index: 1; background: var(--card-bg); }
.research-profile .photo-dialog.is-morphing .photo-close,
.research-profile .photo-dialog.is-closing .photo-close { opacity: 0; visibility: hidden; pointer-events: none; }
.research-profile .photo-dialog .moment-preview { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); overflow: hidden; }
.research-profile .photo-dialog .moment-preview .moment-photo { position: relative; width: 100%; height: 100%; min-width: 0; min-height: 0; align-self: stretch; aspect-ratio: auto; overflow: hidden; }
/* Fill the grid cell, including any height added by the text column. The
   dialog alone clips the corners, avoiding a second antialiased bottom edge. */
.research-profile .photo-dialog .moment-preview .moment-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.research-profile .photo-dialog .moment-preview .moment-body { align-self: start; padding: 36px 36px 32px; }
.research-profile .photo-dialog .moment-preview .moment-meta { font-size: .9rem; margin-bottom: 14px; }
.research-profile .photo-dialog .moment-preview .moment-title { font-size: 1.4rem; line-height: 1.5; margin-bottom: 14px; }
.research-profile .photo-dialog .moment-preview .moment-description { font-size: 1rem; }
@media (max-width: 600px) {
  .research-profile .photo-dialog .moment-preview { grid-template-columns: minmax(0, 1fr); }
  .research-profile .photo-dialog .moment-preview .moment-body { padding: 20px 24px; }
}
@media (prefers-reduced-motion: reduce) { .research-profile .photo-dialog::backdrop { animation: none; } }
html.photo-open, html.photo-open body { overflow: hidden; }
.research-profile .moment-body { padding: 18px 20px 22px; }
.research-profile .moment-meta { font-size: .75rem; color: var(--text-secondary); margin: 0 0 9px; }
.research-profile .moment-title { font-size: 1rem; line-height: 1.5; margin: 0 0 9px; color: var(--text-primary); }
.research-profile .moment-description { font-size: .84rem; line-height: 1.7; color: var(--text-secondary); margin: 0; }
@media (max-width: 960px) { .research-profile .moments-grid { grid-auto-columns: calc((100% - 22px) / 2); } }
@media (max-width: 640px) { .research-profile .moments-grid { grid-auto-columns: 88%; } }
.research-profile #outputs .selected-audio { grid-template-columns: minmax(0, 1fr); }
.research-profile #outputs .more-audio .music-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.research-profile .music-player { width: 100%; min-width: 0; }
.research-profile .dual-audio { flex-direction: column; }
.research-profile .dual-audio .music-player { flex: none; }
.research-profile .audio-label { color: var(--text-secondary); font-size: .85rem; margin: 10px 0 6px; }
.research-profile .profile-footer { padding: 26px 0 36px; border-top: 1px solid var(--border-color); color: var(--text-secondary); font-size: .75rem; }
.research-profile .footer-contact p { margin: 0 0 7px; }
.research-profile .cv-placeholder { height: 44px; padding: 0 14px; border: 1px solid var(--border-color); border-radius: 22px; background: var(--card-bg); color: var(--text-secondary); font: inherit; font-size: 16px; cursor: not-allowed; opacity: .65; }
/* Compact honors only; education and talks retain their original timelines. */
.research-profile #honors .timeline { margin: 0; }
.research-profile #honors .timeline::before,
.research-profile #honors .timeline-item::before { display: none; }
.research-profile #honors .timeline-item { display: grid; grid-template-columns: 104px minmax(0,1fr); gap: 22px; margin: 0; padding: 12px 0; border-bottom: 1px solid var(--border-color); align-items: baseline; }
.research-profile #honors .timeline-item:last-child { border: 0; }
.research-profile #honors .timeline-date { background: none; border: 0; border-radius: 0; padding: 0; font-family: inherit; font-weight: 400; color: var(--text-secondary); margin: 0; font-size: .75rem; }
.research-profile #honors .timeline-content { padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.research-profile #honors .timeline-item:hover .timeline-content { transform: none; box-shadow: none; }
.research-profile #honors h3 { display: inline; font-size: .88rem; font-weight: 550; margin: 0 12px 0 0; }
.research-profile #honors .timeline-content p { display: inline; font-size: .82rem; color: var(--text-secondary); }
.research-profile #honors .award-organizer { display: none !important; }
@media (max-width: 1100px) {
  .research-profile .nav-container { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 10px; padding: 14px 22px; }
  .research-profile .nav-menu { display: flex; grid-column: 1 / -1; grid-row: 2; margin: 0; justify-content: space-between; gap: 10px; font-size: 14px; overflow-x: auto; }
  .research-profile .nav-item a { padding: 4px 0; }
  .research-profile .toggle-buttons { grid-column: 2; grid-row: 1; }
  .research-profile .main-content { padding-top: 128px; }
}
@media (max-width: 800px) {
  .research-profile .hero-content { grid-template-columns: 148px minmax(0,1fr); gap: 26px; }
  .research-profile .profile-photo { width: 124px; height: 124px; }
  .research-profile .hero-title { font-size: 1.8rem; }
}
@media (max-width: 560px) {
  .research-profile .main-content { padding-left: 22px; padding-right: 22px; }
  .research-profile .section { padding: 30px 0; }
  .research-profile .hero { padding: 24px 0 26px; }
  .research-profile .hero-content { display: flex; flex-direction: column; gap: 20px; }
  .research-profile .hero-photo { margin: 0; }
  .research-profile .hero-sidebar { width: 100%; }
  .research-profile .hero-sidebar .hero-photo { text-align: left; }
  .research-profile .profile-links { display: grid; grid-template-columns: repeat(2, max-content); gap: 4px 22px; margin: 16px 0 0; }
  .research-profile .profile-photo { width: 104px; height: 104px; }
  .research-profile .hero-title { font-size: 1.75rem; }
  .research-profile .hero-subtitle { font-size: .87rem; }
  .research-profile .hero-description { font-size: .9rem; }
  .research-profile .hero-connections { font-size: .9rem; }
  .research-profile .hero-approach { font-size: .86rem; }
  .research-profile .hero-contact { font-size: .74rem; }
  .research-profile .section-title { font-size: 1.4rem; }
  .research-profile .card-grid { grid-template-columns: minmax(0,1fr); }
  .research-profile #outputs .more-audio .music-grid { grid-template-columns: minmax(0, 1fr); }
  .research-profile #honors .timeline-item { grid-template-columns: 1fr; gap: 5px; }
  .research-profile #honors h3 { display: block; margin-bottom: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  .research-profile .hero, .research-profile .hero-content, .research-profile .hero-content > *,
  .research-profile .hero-copy > * { animation: none; opacity: 1; transform: none; }
}
