/*
Theme Name: Shinan Editorial
Theme URI: https://www.shinan.info/
Author: Shinan Liu
Description: An academic block theme with a complete biography and selected publications. Uses the native WordPress editor and preserves existing document URLs.
Version: 1.3.9
Requires at least: 6.6
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: shinan-editorial
Tags: full-site-editing, block-patterns, custom-colors, custom-menu, editor-style, wide-blocks
*/
:root {
  --sl-ink: var(--wp--preset--color--ink, #172434);
  --sl-accent: var(--wp--preset--color--hku-green, #024638);
  --sl-muted: var(--wp--preset--color--muted, #536172);
  --sl-line: var(--wp--preset--color--line, #dfe5ec);
  --sl-surface: var(--wp--preset--color--surface, #f2f7f5);
  --sl-serif: Georgia, 'Times New Roman', serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 1.5rem; }
body { margin: 0; -webkit-font-smoothing: antialiased; }
::selection { background: #dcebe4; color: #172434; }
a { text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: #02624d; }
a:focus-visible, summary:focus-visible, button:focus-visible { outline: 3px solid #448675; outline-offset: 4px; }
img { max-width: 100%; height: auto; }
.wp-site-blocks > *, .homepage-content, .homepage-content > .wp-block-post-content { margin-block-start: 0; }
.site-shell { width: min(1120px, calc(100% - 96px)); margin-inline: auto; }
.site-header { display: flex; justify-content: space-between; align-items: center; min-height: 76px; gap: 30px; border-bottom: 1px solid var(--sl-line); }
.site-header > * { margin: 0; }
.site-brand { flex-shrink: 0; font-family: var(--sl-serif); font-size: 1.25rem; }
.site-brand a { text-decoration: none; color: var(--sl-ink); }
.site-navigation { font-size: .875rem; }
.site-navigation .wp-block-navigation__container { gap: 24px; }
.site-navigation .wp-block-navigation-item__content { color: var(--sl-muted); text-decoration: none; }
.site-navigation .wp-block-navigation-item__content:hover { color: var(--sl-accent); text-decoration: underline; }
.academic-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 56px; align-items: start; padding-top: 42px; }
.academic-layout > *, .academic-body > * { margin-block-start: 0; }
.academic-body, .year-publications { min-width: 0; overflow-wrap: anywhere; }
.academic-body > section { width: 100%; }
.academic-profile { position: sticky; top: 30px; border-right: 1px solid var(--sl-line); padding-right: 28px; }
.academic-profile .hero-name { font-size: 2.6rem; margin-bottom: 22px; }
.academic-profile .portrait { margin-bottom: 22px; }
.academic-profile .portrait img { width: 210px; height: 218px; }
.academic-profile .hero-role { font-size: .9375rem; }
.academic-profile .hero-affiliation { font-size: .9375rem; line-height: 1.75; margin-bottom: 14px; }
.academic-profile .hero-email { font-size: .875rem; margin-bottom: 20px; }
.academic-profile .profile-links { flex-direction: column; gap: 9px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 195px; gap: 60px; align-items: center; padding-block: 46px 34px; }
.hero > *, .hero-copy > *, .portrait-wrap > * { margin-block-start: 0; }
.hero-name { font-family: var(--sl-serif); font-size: clamp(2.6rem, 5vw, 3.25rem); letter-spacing: -.035em; font-weight: 400; line-height: 1.1; margin-bottom: 14px; }
.hero-role { font-size: 1rem; font-weight: 600; margin-bottom: 3px; }
.hero-affiliation { font-size: 1rem; line-height: 1.6; margin-bottom: 9px; }
.hero-affiliation a { color: var(--sl-ink); text-decoration: none; }
.hero-affiliation a:hover { color: var(--sl-accent); text-decoration: underline; }
.hero-email { font-size: .9375rem; margin-bottom: 14px; }
.hero-email a { text-decoration: none; }
.profile-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.profile-links p { margin: 0; font-size: .875rem; }
.profile-links a { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--sl-accent); }
.profile-links a::before { content: ''; flex: 0 0 17px; width: 17px; height: 17px; background: currentColor; -webkit-mask: var(--profile-icon) center / contain no-repeat; mask: var(--profile-icon) center / contain no-repeat; }
.profile-links a[href*="scholar.google.com"] { --profile-icon: url('assets/icons/scholar.svg'); }
.profile-links a[href*="linkedin.com"] { --profile-icon: url('assets/icons/linkedin.svg'); }
.profile-links a[href$="/cv.pdf"] { --profile-icon: url('assets/icons/cv.svg'); }
.profile-links a[href*="naisslab.github.io"] { --profile-icon: url('assets/icons/lab.svg'); }
.profile-links a:hover { text-decoration: underline; }
.portrait-wrap, .portrait { margin: 0; }
.portrait img { display: block; width: 195px; height: 200px; object-fit: cover; background: var(--sl-surface); }
.biography { padding-bottom: 22px; }
.biography > *, .biography-service > * { margin-top: 0; }
.biography h2, .section-title h2, .recruiting h2 { font-family: inherit; font-size: 1.65rem; letter-spacing: -.025em; font-weight: 600; line-height: 1.3; margin-top: 0; }
.biography h2 { margin-bottom: 18px; }
.biography p { font-size: 1.025rem; line-height: 1.85; margin-bottom: 18px; }
@media (min-width: 901px) {
  .biography p { text-align: justify; text-align-last: left; hyphens: auto; }
}
.biography strong { font-weight: 600; }
.biography a { text-decoration: none; }
.biography a.advisor-link { font-weight: 400; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.biography a:hover { text-decoration: underline; }
.biography-service p { margin-bottom: 0; }
.recruiting { padding: 22px 26px; margin-block: 0 12px; border-left: 2px solid var(--sl-accent); background: #f2f7f5; }
.recruiting > * { margin-top: 0; }
.recruiting h2 { font-family: inherit; font-size: 1rem; font-weight: 600; letter-spacing: 0; margin-bottom: 10px; }
.recruiting p { font-size: 1rem; line-height: 1.75; margin-bottom: 10px; }
.recruiting strong { font-weight: 500; }
.recruiting .recruiting-note { font-size: .875rem; color: var(--sl-muted); margin-bottom: 0; }
.content-section { padding-block: 32px 36px; border-bottom: 1px solid var(--sl-line); }
.content-section > * { margin-block-start: 0; }
.section-header { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.section-header > *, .section-title > * { margin: 0; }
.section-more { font-size: .875rem; flex-shrink: 0; }
.section-more a { text-decoration: none; }
.section-more a:hover { text-decoration: underline; }
.research-directions { margin-bottom: 24px; }
.research-direction { font-size: 1rem; line-height: 1.75; margin: 0 0 12px; }
.research-direction strong { font-weight: 600; }
.research-overview { margin: 0; }
.research-overview img { display: block; width: 100%; height: auto; }
.research-overview figcaption { text-align: center; font-size: .875rem; color: var(--sl-muted); margin-block: 12px 0; }
.publication-note { color: var(--sl-muted); font-size: .875rem; margin-bottom: 24px; }
.publication-year-group { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: 24px; margin: 0; padding-block: 22px 7px; border-top: 1px solid var(--sl-line); }
.publication-year { font-family: var(--sl-serif); font-size: 1.125rem; font-weight: 400; line-height: 1.5; margin: 0; color: var(--sl-muted); }
.year-publications { margin: 0; }
.publication { padding: 0 0 25px; margin: 0; }
.publication > * { margin-block-start: 0; }
.paper-title { font-size: 1.0625rem; line-height: 1.5; font-weight: 600; margin-bottom: 6px; letter-spacing: 0; }
.paper-title a { color: var(--sl-ink); text-decoration: none; }
.paper-title a:hover { color: var(--sl-accent); text-decoration: underline; }
.paper-authors { font-size: .9375rem; color: var(--sl-muted); line-height: 1.75; margin-bottom: 4px; }
.paper-authors strong { font-weight: 600; color: var(--sl-ink); }
.lab-member { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.paper-venue { font-size: .9375rem; line-height: 1.65; color: var(--sl-ink); margin-bottom: 7px; }
.paper-resources { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 22px; }
.paper-resources > * { margin: 0; }
.paper-links { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: .875rem; }
.paper-links a { text-decoration: none; }
.paper-links a:hover { text-decoration: underline; }
.paper-acceptance { font-size: .8125rem; color: var(--sl-muted); }
.paper-acceptance a { color: var(--sl-muted); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.paper-acceptance a:hover { color: var(--sl-accent); }
.news-item { display: grid; grid-template-columns: 6rem minmax(0, 1fr); gap: 12px; align-items: baseline; padding-block: 7px; margin: 0; }
.news-item > * { margin: 0; }
.news-category { width: fit-content; white-space: nowrap; padding: 1px 6px; border: 1px solid; border-radius: 2px; font-size: .75rem; font-weight: 600; line-height: 1.5; }
.news-category-talk { color: #235788; background: #edf4fa; border-color: #d4e3ef; }
.news-category-award { color: #815400; background: #fff6df; border-color: #efdfb8; }
.news-category-service { color: #684583; background: #f5effa; border-color: #e3d8ec; }
.news-category-paper { color: #024638; background: #edf6f0; border-color: #cfe4d7; }
.news-category-milestone { color: #844250; background: #fbf0f2; border-color: #efd9df; }
.news-text { font-size: .9375rem; line-height: 1.65; color: var(--sl-ink); }
.news-text strong { font-weight: 600; }
.news-text a { text-decoration: none; }
.news-text a:hover { text-decoration: underline; }
#news .section-header { margin-bottom: 16px; }
.disclosure { margin-top: 16px; }
.disclosure summary { cursor: pointer; color: var(--sl-accent); font-size: .875rem; padding: 10px 0; width: fit-content; max-width: 100%; }
.disclosure summary::marker { color: var(--sl-accent); font-size: .75em; }
.disclosure[open] > summary { margin-bottom: 12px; }
.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; padding-block: 25px 30px; color: var(--sl-muted); font-size: .8125rem; }
.site-footer p { margin: 0; }
.site-footer a { color: var(--sl-muted); text-decoration: none; }
.site-footer a:hover { color: var(--sl-accent); text-decoration: underline; }
.standard-content { max-width: 850px; padding-block: 50px; min-height: 55vh; }
.standard-content h1 { font-family: var(--sl-serif); font-size: clamp(2.3rem, 6vw, 3.2rem); letter-spacing: -.035em; }
.standard-content .wp-block-post-content { overflow-wrap: anywhere; }
.standard-content .wp-block-post-template > li { border-bottom: 1px solid var(--sl-line); padding-bottom: 24px; }
.standard-content .wp-block-query-pagination { gap: 24px; }
.editor-styles-wrapper .site-shell { max-width: 1120px; }
.editor-styles-wrapper .hero-name { font-family: var(--sl-serif); }
@media (max-width: 900px) {
  .site-shell { width: calc(100% - 64px); }
  .academic-layout { grid-template-columns: 190px minmax(0, 1fr); gap: 32px; }
  .academic-profile { padding-right: 20px; }
  .academic-profile .hero-name { font-size: 2.1rem; }
  .academic-profile .portrait img { width: 170px; height: 176px; }
  .site-navigation .wp-block-navigation__container { gap: 17px; }
  .hero { grid-template-columns: minmax(0, 1fr) 180px; gap: 34px; }
  .portrait img { width: 180px; height: 190px; }
}
@media (max-width: 800px) {
  .site-header { min-height: 70px; }
  .site-navigation .wp-block-navigation__responsive-container:not(.is-menu-open) { display: none; }
  .site-navigation .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
  .site-navigation .wp-block-navigation__responsive-container.is-menu-open { display: flex; padding: 32px; }
  .site-navigation .is-menu-open .wp-block-navigation__container { gap: 24px; font-size: 1.125rem; }
  .publication-year-group { grid-template-columns: 55px minmax(0, 1fr); gap: 20px; }
}
@media (max-width: 760px) {
  .site-shell { width: calc(100% - 40px); }
  .academic-layout { display: block; padding-top: 28px; }
  .academic-profile { position: static; border: 0; border-bottom: 1px solid var(--sl-line); padding: 0 0 24px; margin-bottom: 28px; }
  .academic-profile .hero-copy { display: grid; grid-template-columns: minmax(0, 1fr) 90px; column-gap: 18px; align-items: start; }
  .academic-profile .hero-name { font-size: 2.5rem; margin-bottom: 8px; }
  .academic-profile .portrait { grid-column: 2; grid-row: 1 / 3; margin: 0; }
  .academic-profile .portrait img { width: 90px; height: 96px; }
  .academic-profile .profile-links { flex-direction: row; gap: 8px 18px; }
  .hero { grid-template-columns: minmax(0, 1fr) 90px; align-items: start; column-gap: 20px; padding-block: 32px 28px; }
  .hero-copy { display: contents; }
  .hero-name { grid-column: 1; grid-row: 1; font-size: 2.6rem; margin-bottom: 8px; }
  .hero-role { grid-column: 1; grid-row: 2; font-size: .9375rem; margin-bottom: 9px; }
  .hero-affiliation { grid-column: 1 / -1; grid-row: 3; }
  .hero-email { grid-column: 1 / -1; grid-row: 4; }
  .profile-links { grid-column: 1 / -1; grid-row: 5; gap: 8px 19px; }
  .portrait-wrap { grid-column: 2; grid-row: 1 / 3; }
  .portrait img { width: 90px; height: 96px; }
  .biography p { font-size: 1rem; line-height: 1.85; }
  .biography h2, .section-title h2 { font-size: 1.6rem; }
  .recruiting { padding: 18px; }
  .content-section { padding-block: 28px; }
  .section-header { flex-wrap: wrap; gap: 9px 20px; margin-bottom: 20px; }
  .research-direction { font-size: 1rem; }
  .publication-year-group { grid-template-columns: 1fr; gap: 15px; padding-block: 18px 0; }
  .publication-year { font-size: 1.125rem; font-weight: 600; }
  .paper-title { font-size: 1.0625rem; }
  .paper-authors, .paper-venue { font-size: .875rem; }
  .news-item { grid-template-columns: 6rem minmax(0, 1fr); gap: 8px; padding-block: 7px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Institution colors follow the named university, independently of link state. */
.wp-site-blocks a.institution-hku, .editor-styles-wrapper a.institution-hku { color: #024638; font-weight: 700; }
.wp-site-blocks a.institution-uchicago, .editor-styles-wrapper a.institution-uchicago { color: #800000; font-weight: 700; }
.wp-site-blocks a.institution-uestc, .editor-styles-wrapper a.institution-uestc { color: #005bac; font-weight: 700; }
.wp-site-blocks a[href="https://naisslab.github.io/"], .editor-styles-wrapper a[href="https://naisslab.github.io/"] { font-weight: 700; }
.wp-site-blocks .academic-profile a, .editor-styles-wrapper .academic-profile a, .academic-profile .hero-role { font-weight: 700; }
#research .section-header { margin-bottom: 14px; }
.research-instructions { margin-bottom: 12px; color: var(--sl-muted); font-size: .9375rem; }
.research-explorer > *, .research-map > *, .map-layer > *, .map-stage > * { margin-block-start: 0; }
/* Monochrome, typeset research figure; links remain native editable blocks. */
.research-map { container: research-figure / inline-size; padding: 0; color: #222; font-family: 'Times New Roman', Times, serif; }
/* Draw outlines behind the controls without clipping text or focus rings. */
.map-layer { position: relative; isolation: isolate; }
.map-layer::before, .map-layer::after { content: ''; position: absolute; pointer-events: none; z-index: -1; clip-path: var(--map-outline); }
.map-layer::before { inset: 0; background: #555; }
.map-layer::after { inset: 1px; background: #fff; }
.applications-layer { --map-outline: polygon(0 0, 100% 0, 94% 100%, 6% 100%); padding: 10px 9% 14px; }
.frameworks-layer { --map-outline: polygon(6% 0, 94% 0, 100% 100%, 0 100%); padding: 10px 8% 12px; }
.map-layer-label { margin: 0 0 8px; text-align: center; font-size: 1.1875rem; font-weight: 400; font-style: italic; color: #222; }
.map-applications { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.research-choice-wrap { margin: 0; display: flex; min-width: 0; }
.research-map .research-choice { display: flex; width: 100%; min-height: 44px; padding: 6px 9px; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px solid #888; border-radius: 0; text-align: center; text-decoration: none; color: #222; background: #fff; line-height: 1.25; transition: background .16s, border-color .16s; }
.research-choice strong { font-weight: 400; font-size: 1.0625rem; }
.research-choice span { font-size: .875rem; font-style: italic; }
.research-map .research-choice:hover { background: #f5f5f5; border-color: #222; color: #111; }
.research-map .research-choice.is-selected { background: #eeeeec; border-color: #222; color: #111; box-shadow: inset 0 0 0 1px #222; }
.research-map .research-choice.is-selected strong { font-weight: 700; }
.research-map .research-choice:focus-visible { outline: 2px solid #222; outline-offset: 3px; }
.map-hub { position: relative; width: 88%; margin: 10px auto; }
.map-hub .research-choice { border: 1px solid #222; min-height: 56px; }
.map-hub .research-choice strong { font-size: 1.375rem; font-weight: 700; }
.map-frameworks { display: grid; grid-template-columns: 2fr 1.1fr 1.2fr; gap: 24px; align-items: stretch; margin-top: 10px; }
.map-stage { position: relative; display: flex; flex-direction: column; margin: 0; min-width: 0; padding: 0 8px 8px; border: 1px solid #777; border-radius: 0; background: #fafafa; }
.map-stage-label { min-height: 48px; margin: 0 -8px 6px; padding: 4px; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 1.0625rem; line-height: 1.15; font-weight: 700; color: #222; background: transparent; border: 0; border-bottom: 1px solid #bbb; }
.map-inference::before, .map-adaptation::before { position: absolute; left: -24px; width: 24px; top: calc(50% + 20px); text-align: center; color: #333; font-size: 1.25rem; line-height: 1; pointer-events: none; }
.map-inference::before { content: '→'; }
.map-adaptation::before { content: '⇄'; }
.map-stage > .research-choice-wrap, .map-training-choices { flex: 1; }
.map-training-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.map-frameworks .research-choice { min-height: 64px; padding: 5px 6px; border-color: #888; }
.map-frameworks .research-choice strong { font-size: 1rem; }
.map-flow-label { margin: 16px 0 0; text-align: center; font-size: .875rem; color: #555; }
.research-panels { margin-top: 0; }
.research-panel { margin: 0; padding: 23px 0 4px; }
.research-panel + .research-panel { border-top: 1px solid var(--sl-line); }
.is-enhanced .research-panel { border-top: 0; }
.research-panel[hidden] { display: none !important; }
.research-panel > * { margin-block-start: 0; }
.research-panel h3 { margin-bottom: 12px; font-size: 1.25rem; font-weight: 600; }
.research-panel h4 { margin: 21px 0 10px; font-size: 1rem; font-weight: 600; }
.research-panel p { font-size: 1rem; line-height: 1.75; }
.research-panel-description { margin-bottom: 15px; }
.research-panel .research-related-paper { margin: 0; font-size: .9375rem; line-height: 1.5; }
.research-related > .research-related-paper + .research-related-paper { margin-block-start: 8px; }
.research-related-paper a { text-decoration: none; }
.research-related-paper a:hover { text-decoration: underline; }
.research-related-paper a.research-preprint-link { display: inline-block; color: #765a22; font-size: .75rem; line-height: 1.4; text-decoration: underline; text-underline-offset: 2px; }
.research-citation { display: inline; margin-inline-start: .6em; color: var(--sl-muted); font-size: .8125rem; white-space: normal; }
.publication:target { background: var(--sl-surface); box-shadow: -8px 0 0 var(--sl-surface); }
@container research-figure (max-width: 680px) {
  .applications-layer { padding-block: 10px 14px; }
  .frameworks-layer { padding-block: 10px 12px; }
  .map-frameworks { grid-template-columns: 1fr 1fr; }
  .map-training { grid-column: 1 / -1; }
  .map-stage-label { min-height: 50px; }
  .map-training .map-stage-label { min-height: 34px; }
  .map-inference::before { content: '↓'; left: calc(50% - 12px); top: -24px; }
  .map-frameworks .research-choice { min-height: 64px; }
}
@container research-figure (max-width: 340px) {
  .map-applications { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .research-choice { transition: none; } }

.news-date { color: var(--sl-muted); font-size: .8125rem; white-space: nowrap; }
@media (max-height: 740px) {
  .academic-profile { position: static; }
}

/* Keep profile resources light; institutional affiliations retain their weight. */
.wp-site-blocks .academic-profile .profile-links a,
.editor-styles-wrapper .academic-profile .profile-links a { font-weight: 400; }
/* Decorative crests accompany the university names, not department links. */
.biography a[href="https://www.hku.hk/"]::before,
.biography a[href="https://www.uchicago.edu/"]::before,
.biography a[href="https://en.uestc.edu.cn/"]::before {
  content: ''; display: inline-block; width: 18px; height: 18px;
  margin-inline-end: 5px; vertical-align: -3px;
  background: var(--institution-crest) center / contain no-repeat;
}
.biography a[href="https://www.hku.hk/"] { --institution-crest: url('assets/crests/hku.png'); }
.biography a[href="https://www.uchicago.edu/"] { --institution-crest: url('assets/crests/uchicago.ico'); }
.biography a[href="https://en.uestc.edu.cn/"] { --institution-crest: url('assets/crests/uestc.png'); }
.biography a[href="https://en.uestc.edu.cn/"]::before { background-size: auto 100%; }

.biography a[href="https://www.hku.hk/"],
.biography a[href="https://www.uchicago.edu/"],
.biography a[href="https://en.uestc.edu.cn/"] { white-space: nowrap; }
