/* Shared, bounded design controls. Loaded after each layout's stylesheet. */
@font-face{font-family:'Source Sans 3';src:url('fonts/sourcesans3.woff') format('woff');font-weight:200 900;font-display:swap}
@font-face{font-family:Inter;src:url('fonts/inter.woff') format('woff');font-weight:100 900;font-display:swap}
@font-face{font-family:'IBM Plex Sans';src:url('fonts/ibmplexsans.woff') format('woff');font-weight:100 700;font-display:swap}
@font-face{font-family:'Source Serif 4';src:url('fonts/sourceserif4.woff2') format('woff2');font-weight:200 900;font-display:swap}
:root{--measure:var(--d-page-width)}
body{font-family:var(--d-body-font)!important;font-size:var(--d-body-size)!important;line-height:var(--d-line-height)!important}
body .wrap,body .page-shell,body .header-inner,body .site-footer{max-width:var(--d-page-width)!important}
body .lab-shell main{max-width:none}
body .prose,body .lab-mission,body .lede,body main>p{max-width:none}
body main p,body .bio p,body main li,body main time{line-height:var(--d-line-height)!important}
body p{margin-bottom:var(--d-paragraph-gap)}
body main p,body main li,body main time,body nav a,body .paper-links,body .paper-links a,body .citation summary,body .citation pre,body .copy-citation,body .profile-button,body .contact-chip,body .contact-chips a,body .contact-chips span,body .resource-buttons a,body .venue,body .paper-venue,body .profile-links,body .contact,body .affiliation,body .role,body .identity span,body .theme-toggle,body .menu-toggle,body .site-footer,body .site-footer p,body .site-footer address{font-size:var(--d-body-size)!important}
body .paper-venue,body .venue{white-space:nowrap;overflow-wrap:normal;word-break:normal}
body .paper,body .pub{grid-template-columns:minmax(calc(var(--d-body-size)*8),max-content) minmax(0,1fr)}
body .news-item,body .news li{grid-template-columns:calc(var(--d-body-size)*5.6) minmax(0,1fr)}
body main span,body main small,body main label,body main input,body main select,body main button,body main figcaption{font-size:var(--d-body-size)!important}
body main h1,body .lab-hero h1{font-family:var(--d-heading-font)!important;font-size:var(--d-heading-size)!important}
body main h2,body .section-heading h2{font-family:var(--d-heading-font)!important;font-size:var(--d-section-size)!important}
body main h3,body main h4{font-family:var(--d-heading-font)!important;font-size:max(var(--d-body-size),18px)!important}
body .paper h3{font-size:var(--d-body-size)!important}
body .chinese-name{font-size:var(--d-chinese-size)!important}
body nav,body nav a,body .identity,body .brand,body .profile-button,body .resource-buttons{font-family:var(--d-nav-font)!important}
body .section{margin-top:var(--d-section-gap);padding-top:calc(var(--d-section-gap)*.65)}
body main.wrap>section+section{margin-top:var(--d-section-gap)}
body main.wrap>section>h2{margin-top:0}
body .paper{margin-bottom:var(--d-publication-gap)}
body .pub{padding-block:calc(var(--d-publication-gap)/2)}
body .news-scroll{max-height:var(--d-news-height)}
body .portrait,body .home-profile .portrait{width:var(--d-portrait-size);height:var(--d-portrait-size);object-fit:cover}
body .home-profile,body .intro{grid-template-columns:var(--d-portrait-size) minmax(0,1fr)}
body .intro-columns{grid-template-columns:minmax(0,1fr) var(--d-portrait-size)}
html[data-portrait="left"] .intro-columns{grid-template-columns:var(--d-portrait-size) minmax(0,1fr)}
html[data-portrait="left"] .intro-columns>.portrait{grid-column:1;grid-row:1}
html[data-portrait="left"] .intro-columns>div{grid-column:2;grid-row:1}
html[data-portrait="right"] .home-profile,html[data-portrait="right"] .intro{grid-template-columns:minmax(0,1fr) var(--d-portrait-size)}
html[data-portrait="right"] .home-profile>.portrait,html[data-portrait="right"] .intro>.portrait{grid-column:2;grid-row:1}
html[data-portrait="right"] .home-profile>div,html[data-portrait="right"] .intro>div{grid-column:1;grid-row:1}
@media(max-width:700px){body main h1,body .lab-hero h1{font-size:clamp(32px,6vw,var(--d-heading-size))!important}body .portrait,body .home-profile .portrait{width:min(var(--d-portrait-size),120px);height:min(var(--d-portrait-size),120px)}body .home-profile,body .intro,body .intro-columns,html[data-portrait] .home-profile,html[data-portrait] .intro,html[data-portrait] .intro-columns{grid-template-columns:1fr}html[data-portrait] .portrait{grid-column:1!important;grid-row:1!important}html[data-portrait] .home-profile>div,html[data-portrait] .intro>div,html[data-portrait] .intro-columns>div{grid-column:1;grid-row:2}body .home-profile{gap:18px}}
@media(max-width:700px){body .paper,body .pub,body .news-item,body .news li{grid-template-columns:1fr}}
@media print{body .news-scroll{max-height:none;overflow:visible}body .portrait{width:120px;height:120px}}

/* Shared institutional header and one-row profile controls. */
body .institution-logos{display:flex;align-items:center;gap:16px;flex:0 0 auto;max-width:100%;padding:0;background:transparent;border-radius:0}
body .institution-logo{display:flex;align-items:center;flex:0 0 auto;text-decoration:none}
body .institution-logo img{display:block;object-fit:contain;width:auto;height:auto;max-width:100%}
body .university-logo img{width:128px}
body .college-logo img{width:160px}
body .site-header .header-inner,body .site-header .header-row{justify-content:flex-end;flex-wrap:wrap;gap:12px 18px;padding-block:10px}
body .site-header nav{justify-content:flex-end;justify-content:safe flex-end;flex-wrap:wrap;gap:12px 18px}
body .home-profile-details,body .intro-text,body .intro-columns>div{min-width:0}
body .profile-controls{display:flex;flex-wrap:nowrap;align-items:center;gap:7px;min-width:0;max-width:100%;overflow-x:auto;scrollbar-width:thin;padding:4px;margin:8px -4px 14px;overscroll-behavior-x:contain}
body .profile-controls:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
body .profile-controls>a,body .profile-controls>span{display:inline-flex;align-items:center;flex:0 0 auto;white-space:nowrap;overflow-wrap:normal;font-family:var(--d-nav-font);font-size:var(--d-body-size)!important;line-height:1.5;padding:5px 10px;min-height:36px;background:var(--accent-soft);color:var(--ink);border:1px solid var(--line);border-radius:4px}
body .profile-controls .profile-button{font-weight:400;color:var(--ink)}
body .profile-controls>a:hover{border-color:var(--accent);text-decoration:none}
@media(max-width:700px){body .institution-logos{gap:12px;padding:0}body .university-logo img{width:112px}body .college-logo img{width:144px}body .site-header #site-nav{order:4;width:100%}body .site-header .nav{order:4;width:100%;overflow-x:auto;flex-wrap:nowrap}body .profile-controls{margin-top:10px}}
@media print{body .profile-controls{overflow:visible;max-width:none}}

body .site-header .menu-toggle,body .site-header .theme-toggle{margin-left:0;margin-inline-start:0}

/* Institutional logos stay left; navigation and theme control stay right. */
body .site-header .institution-logos{margin-inline-end:auto}
body .site-footer .last-update{display:inline}

/* Shared, evenly aligned lab directory; no profile dividers. */
body #people .section-heading{border-bottom:0}
body #people .people-group{margin-top:24px}
body #people .people-group>h3{margin:0 0 16px}
body #people .people-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:24px 28px;align-items:start}
body #people .person{display:block;padding:0;border:0;min-width:0}
body #people .person h4{margin:0 0 6px;line-height:1.4}
body #people .person p{margin:4px 0;overflow-wrap:anywhere}
@media(max-width:850px){body #people .people-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){body #people .people-grid{grid-template-columns:1fr}}

/* Portrait modules share dimensions, hover details, and keyboard/touch access. */
body #people .person-card{text-align:center}
body #people .person-portrait{position:relative;width:180px;height:180px;margin:0 auto 16px}
body #people .person-photo,body #people .person-photo-placeholder{display:block;width:180px;height:180px;object-fit:cover;border-radius:4px;background:var(--accent-soft)}
body #people .person-photo-placeholder{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:8px;color:var(--muted)}
body #people .person-photo-placeholder>span:first-child{font-size:36px!important}
body #people .photo-pending{font-size:var(--d-body-size)!important}
body #people .person-card h4{min-height:0;margin-bottom:0}
body #people .person-card>.person-role{min-height:3em;margin-top:0}
body #people .person-keywords{display:flex;justify-content:center;flex-wrap:wrap;gap:4px 12px;list-style:none;padding:0;margin:8px 0;color:var(--accent)}
body #people .person-keywords li{font-size:var(--d-body-size)!important}
body #people .person-info{position:absolute;inset:0;visibility:hidden;overflow-y:auto;text-align:left;padding:12px;background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:4px;z-index:1}
body #people .person-portrait:hover .person-info,body #people .person-portrait:focus-within .person-info{visibility:visible}
body #people .person-portrait:focus-visible{outline:2px solid var(--accent);outline-offset:4px}
body #people .person-touch-details{margin-top:8px;text-align:left}
body #people .person-touch-details summary{text-align:center;cursor:pointer;color:var(--accent)}
@media(hover:none){body #people .person-info{display:none}}
@media print{body #people .person-info{position:static;visibility:visible;overflow:visible;border:0}body #people .person-portrait{height:auto}body #people .person-touch-details{display:none}}

body .profile-controls>a,body .profile-controls>span{font-weight:400}

/* Built-in team gallery with native accessible biography dialogs. */
body #people .person-open{display:block;padding:0;font:inherit;cursor:pointer;color:var(--ink);background:var(--paper);border:0;border-radius:8px;overflow:hidden}
body #people .person-view{position:absolute;inset:auto 0 0;padding:8px;background:var(--accent);color:#fff;opacity:0;transition:opacity .15s;font-size:var(--d-body-size)}
body #people .person-open:hover .person-view,body #people .person-open:focus-visible .person-view{opacity:1}
body #people .person-interactive>.person-touch-details{display:none}
body .person-dialog{position:fixed;inset:0;margin:auto;padding:32px;max-width:720px;width:calc(100% - 32px);max-height:85vh;overflow:auto;border:1px solid var(--line);border-radius:10px;background:var(--paper);color:var(--ink);box-shadow:0 18px 70px #0005}
body .person-dialog[open]{display:grid;grid-template-columns:180px minmax(0,1fr);gap:28px}
body .person-dialog::backdrop{background:#0009}
body .person-dialog .person-close{position:absolute;right:10px;top:8px;border:0;background:transparent;color:var(--ink);font-size:28px;cursor:pointer;width:40px;height:40px}
body .person-dialog-photo img,body .person-dialog-photo .person-photo-placeholder{width:180px;height:180px;object-fit:cover;border-radius:8px}
body .person-dialog-copy h3{margin-top:0;padding-right:24px}
body .person-dialog-copy>p:first-of-type{display:none}
@media(max-width:600px){body .person-dialog[open]{grid-template-columns:1fr;padding:28px 20px;gap:16px}body .person-dialog-photo{margin:auto}}
@media(prefers-reduced-motion:reduce){body #people .person-view{transition:none}}

body .portfolio-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}
body .portfolio-card{display:flex;flex-direction:column;gap:12px;padding:28px;border:1px solid var(--line);border-top:4px solid var(--accent);border-radius:8px;background:var(--paper);color:var(--ink);text-decoration:none;transition:transform .15s,border-color .15s}
body .portfolio-card h3,body .portfolio-card p{margin:0}
body .portfolio-card:hover{transform:translateY(-3px);border-color:var(--accent);text-decoration:none}
body .portfolio-card:focus-visible{outline:2px solid var(--accent);outline-offset:4px}
body .portfolio-more{margin-top:auto;color:var(--accent);font-size:var(--d-body-size)}
html[data-theme="dark"] body .sponsor-logo-panel{background:#fff;border-radius:8px}
@media(prefers-color-scheme:dark){html:not([data-theme="light"]) body .sponsor-logo-panel{background:#fff;border-radius:8px}}
@media(max-width:640px){body .portfolio-grid{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){body .portfolio-card{transition:none}body .portfolio-card:hover{transform:none}}

body .project-paper{padding:12px 0;border-bottom:1px solid var(--line)}
body .project-paper h3{margin:0 0 4px;font-size:var(--d-body-size);line-height:1.5}
body .project-paper .project-paper-meta{margin:0 0 4px;line-height:1.5}
body .project-paper-venue{color:var(--muted)}
body .project-paper>a{font-size:var(--d-body-size)}

body .project-detail-section{margin-top:28px;margin-bottom:28px}
body .project-detail-section+ .project-detail-section{margin-top:36px}
body .project-detail-section>h2{margin-bottom:12px}
body .site-footer{margin-block:0;padding-block:10px}
body .site-footer .footer-row{padding-block:0}
body .site-footer p,body .site-footer address{margin-block:0}

body .hpdi-header-logo{display:block;line-height:0}
body .hpdi-header-logo img{width:240px;max-width:100%;height:auto}
body .hpdi-header-logo .hpdi-logo-dark{display:none}
html[data-theme="dark"] body .hpdi-header-logo .hpdi-logo-light{display:none}
html[data-theme="dark"] body .hpdi-header-logo .hpdi-logo-dark{display:block}
@media(prefers-color-scheme:dark){html:not([data-theme="light"]) body .hpdi-header-logo .hpdi-logo-light{display:none}html:not([data-theme="light"]) body .hpdi-header-logo .hpdi-logo-dark{display:block}}
@media(max-width:600px){body .hpdi-header-logo img{width:200px}}

body .site-header nav a{padding-block:4px 3px;line-height:1.5}

body .cv-dialog{position:fixed;inset:0;margin:auto;width:min(960px,calc(100% - 24px));height:90vh;max-height:90vh;padding:0;border:1px solid var(--line);border-radius:8px;background:var(--paper);color:var(--ink)}
body .cv-dialog[open]{display:flex;flex-direction:column}
body .cv-dialog::backdrop{background:#0009}
body .cv-dialog-header{display:flex;align-items:center;justify-content:space-between;padding:10px 18px;gap:16px}
body .cv-dialog-header h2{margin:0;font-size:var(--d-body-size)}
body .cv-dialog-header button{background:transparent;border:0;color:var(--ink);font-size:28px;cursor:pointer;width:40px;height:40px}
body .cv-dialog iframe{width:100%;flex:1;border:0;min-height:0;background:#fff}
