/* Layout adapted from the approved Researcher / Chiri preview. */
:root {
  --ink: #201f1d;
  --dim: #62615d;
  --rule: #e7e6e2;
  --accent: #1c6e9c;
  --honor-color: #9a3f32;
  --font-serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
/* Keep the same available width on long and short pages. */
html { overflow-y: scroll; scrollbar-gutter: stable; }
body { margin: 0; background: #fff; color: var(--ink); font: 14px/1.55 var(--font-serif); }
a { color: var(--accent); text-underline-offset: .23em; text-decoration-thickness: 1px; }
a:hover { text-decoration: underline; }
a:focus-visible, summary:focus-visible, .nav-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 1rem; top: 1rem; z-index: 5; background: white; }
.wrap, .mast { max-width: 700px; margin-inline: auto; }
.sitehead { border-bottom: 1px solid var(--rule); }
.mast {
  min-height: 102px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 43px 0 21px;
}
.brand { font-size: 25px; color: var(--ink); font-weight: 700; text-decoration: none; line-height: 1.28; }
.nav-toggle { display: none; }
.mast nav { font-size: 13px; display: flex; align-items: center; gap: 11px; white-space: nowrap; }
.mast nav a { color: var(--ink); text-decoration: none; }
.mast nav a:hover { text-decoration: underline; }
.mast nav a[aria-current] { color: var(--accent); }
.sep { color: #85817d; }
.wrap { padding: 24px 0 55px; }
h1, h2, p, ol { margin: 0; }
h1, h2 { font-size: 21px; line-height: 1.3; letter-spacing: -.8px; }
.bio h1, .pubhead { margin-bottom: 16px; }
.bio-profile { display: contents; }
.bio-profile .connections { display: none; }
.bio p { margin: 0 0 13px; }
.bio p a { color: inherit; text-decoration-color: #b9b6af; }
.bio p a.honor-award { color: var(--honor-color); font-weight: 700; text-decoration-color: currentColor; }
.portrait { float: right; width: 176px; height: auto; aspect-ratio: 8 / 9; object-fit: cover; border-radius: 8px; margin: 1px 0 12px 24px; }
.connections { font-size: 12.5px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.connections a, .aux, .resources a { text-decoration: none; }
.connections a:hover, .resources a:hover, .aux:hover { text-decoration: underline; }
.connections span, .resources span { color: #aaa; }
.pubs, .news, .service { margin-top: 32px; clear: both; }
.news h2, .service h2 { margin-bottom: 16px; }
.news-list { list-style: none; padding: 0; margin: 0; }
.news-item { display: grid; grid-template-columns: 8ch minmax(0, 1fr); gap: 16px; margin-bottom: 12px; font-size: 13px; }
.news-item time { color: var(--dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.news-content a { text-decoration: none; }
.news-content a:hover { text-decoration: underline; }
.news-honor { font-weight: 600; }
.older-news { font-size: 12px; }
.older-news summary { color: var(--dim); cursor: pointer; width: fit-content; }
.older-news .news-list { margin-top: 12px; }
.service-heading { font-size: 15px; line-height: 1.4; margin-top: 24px; margin-bottom: 10px; }
.service-content > .service-heading:first-child { margin-top: 0; }
.teaching-list { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.teaching-item + .teaching-item { margin-top: 15px; }
.teaching-title { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.teaching-title strong { min-width: 0; font-weight: 600; }
.teaching-title a { color: inherit; text-decoration-color: #b9b6af; }
.teaching-period { flex-shrink: 0; color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums; }
.teaching-meta { margin-top: 3px; color: var(--dim); font-size: 12px; }
.service-list { list-style: none; margin: 0; padding: 0; font-size: 13px; line-height: 1.6; color: #333; }
.review-row { display: grid; grid-template-columns: 3.1ch minmax(0, 1fr); gap: 9px; margin-top: 20px; }
.review-row:first-child { margin-top: 0; }
.review-dot { font-size: 18px; line-height: 1.3; color: #666; text-align: center; }
.review-row .service-heading { margin: 0 0 5px; }
.service-list li + li { margin-top: 8px; }
.service-year { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; }
.pubhead { display: flex; align-items: baseline; justify-content: space-between; gap: 15px; }
.pubhead .aux { font-size: 12px; color: var(--dim); white-space: nowrap; }
.standalone .pubs { margin: 0; }
.paperlist { list-style: none; padding: 0; }
.paper { display: grid; grid-template-columns: 3.1ch minmax(0, 1fr); gap: 9px; padding: 0 0 19px; }
.paper:last-child { padding-bottom: 0; }
.number { color: var(--dim); font-size: 13px; padding-top: 1px; }
.ptitle { display: inline; color: var(--ink); font-weight: 650; letter-spacing: -.3px; font-size: 15px; line-height: 1.38; text-decoration: none; }
.ptitle:hover { color: var(--accent); }
.authors, .venue, .resources, .notation { font-size: 12px; line-height: 1.65; }
.authors { color: var(--dim); margin-top: 3px; }
.authors b { color: #373632; }
.authors sup { font-size: .86em; line-height: 0; }
.resources { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.resources .venue { color: var(--ink); font-style: normal; margin-right: 3px; }
.honors { display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 9px; margin: 5px 0 6px; font-size: 12px; color: var(--honor-color); }
.honor { font-weight: 700; }
.honor-separator { color: #aaa; }
.notation { margin-top: 12px; color: var(--dim); }
.placeholder { color: var(--dim); }
/* Blog content keeps the site's serif style, with local Chinese font fallbacks. */
.post-list { list-style: none; padding: 0; margin: 0; }
.post-list-item { padding: 0 0 25px; margin-bottom: 25px; border-bottom: 1px solid var(--rule); overflow-wrap: anywhere; }
.post-list-item time, .post-meta, .post-back { color: var(--dim); font-size: 12px; }
.post-list-item h2 { margin: 7px 0 9px; font-size: 19px; letter-spacing: 0; }
.post-list-item h2 a { color: var(--ink); text-decoration: none; }
.post-list-item h2 a:hover { color: var(--accent); text-decoration: underline; }
.post-list-item p { color: var(--dim); line-height: 1.8; }
.post, .post-list-item {
  font-family: "Libre Baskerville", Georgia, "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
}
.post-header { margin-bottom: 30px; }
.post-header h1 { margin: 22px 0 12px; font-size: 28px; line-height: 1.55; letter-spacing: 0; overflow-wrap: anywhere; }
.post-meta { line-height: 1.8; }
.post-content { font-size: 17px; line-height: 1.95; overflow-wrap: anywhere; }
.post-content p, .post-content ul, .post-content ol, .post-content blockquote, .post-content pre, .post-content table { margin: 0 0 1.3em; }
.post-content h1, .post-content h2, .post-content h3, .post-content h4, .post-content h5, .post-content h6 { margin: 1.8em 0 .7em; line-height: 1.55; letter-spacing: 0; }
.post-content h1 { font-size: 1.7em; }
.post-content h2 { font-size: 1.4em; }
.post-content h3 { font-size: 1.15em; }
.post-content ul, .post-content ol { padding-left: 1.6em; }
.post-content li > ul, .post-content li > ol { margin-bottom: 0; }
.post-content blockquote { margin-left: 0; padding-left: 1em; border-left: 3px solid var(--rule); color: var(--dim); }
.post-content blockquote p:last-child { margin-bottom: 0; }
.post-content img, .post-content video { max-width: 100%; height: auto; }
.post-content code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "PingFang SC", "Microsoft YaHei", monospace; font-size: .86em; padding: .12em .3em; background: #f6f5f2; border-radius: 3px; }
.post-content pre { padding: 16px; background: #f6f5f2; border: 1px solid var(--rule); border-radius: 4px; overflow-x: auto; line-height: 1.6; }
.post-content pre code { padding: 0; background: none; border: 0; }
.post-content .highlight { margin: 0; }
.post-content div.highlighter-rouge { margin-bottom: 1.3em; }
.post-content .highlight .c, .post-content .highlight .c1, .post-content .highlight .cm { color: #62615d; font-style: italic; }
.post-content .highlight .k, .post-content .highlight .kn, .post-content .highlight .kd { color: #85407a; }
.post-content .highlight .s, .post-content .highlight .s1, .post-content .highlight .s2 { color: #356345; }
.post-content .highlight .nf, .post-content .highlight .nb { color: #9a3f32; }
.post-content table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; font-size: .9em; }
.post-content th, .post-content td { padding: 9px 14px; border: 1px solid var(--rule); text-align: left; }
.post-content th { background: #f6f5f2; }
.post-content hr { border: 0; border-top: 1px solid var(--rule); margin: 2em 0; }
.post-content .footnotes { margin-top: 2em; border-top: 1px solid var(--rule); padding-top: 1em; font-size: .85em; }
@media (max-width: 760px) {
  .mast, .wrap { margin-inline: 24px; }
  .mast { padding-top: 28px; min-height: 82px; }
}
@media (max-width: 640px) {
  .mast { position: relative; align-items: center; flex-wrap: wrap; min-height: 64px; padding: 10px 0; gap: 8px; }
  .brand { font-size: 23px; }
  .nav-toggle:not([hidden]) {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    color: var(--ink);
    background: transparent;
    cursor: pointer;
  }
  .nav-toggle[aria-expanded="true"] { background: #f6f5f2; }
  .nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
    display: block;
    width: 21px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
  }
  .nav-toggle span { position: relative; }
  .nav-toggle span::before, .nav-toggle span::after { content: ""; position: absolute; left: 0; }
  .nav-toggle span::before { transform: translateY(-6px); }
  .nav-toggle span::after { transform: translateY(6px); }
  .nav-toggle[aria-expanded="true"] span { background: transparent; }
  .nav-toggle[aria-expanded="true"] span::before { transform: rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span::after { transform: rotate(-45deg); }

  .mast nav { flex-basis: 100%; flex-wrap: wrap; }
  .nav-toggle:not([hidden])[aria-expanded="false"] + nav { display: none; }
  .nav-toggle[aria-expanded="true"] + nav {
    position: absolute;
    z-index: 1100;
    top: calc(100% - 4px);
    right: 0;
    display: grid;
    gap: 0;
    min-width: 10rem;
    padding: 4px;
    background: #fff;
    border: 1px solid var(--rule);
    border-radius: 8px;
    box-shadow: 0 5px 18px rgb(32 31 29 / 10%);
  }
  .nav-toggle[aria-expanded="true"] + nav .sep { display: none; }
  .nav-toggle[aria-expanded="true"] + nav a { display: flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 4px; }
  .nav-toggle[aria-expanded="true"] + nav a[aria-current] { background: #f1f6f8; }

  .bio { display: grid; }
  .bio-profile {
    grid-row: 1;
    display: block;
    margin-bottom: 16px;
  }
  .portrait { display: block; float: none; width: 100%; aspect-ratio: auto; margin: 0; }
  .bio-profile .connections { display: flex; gap: 0; margin-top: 4px; font-size: 14px; }
  .bio-profile .connections a { display: grid; place-items: center; flex: 1 0 auto; min-height: 44px; }
  .bio-profile .connections span, .bio > .connections { display: none; }
  .bio h1 { margin-bottom: 12px; }
  .bio p { font-size: 14px; line-height: 1.65; }
  .bio p:last-of-type { margin-bottom: 0; }
}
@media (max-width: 500px) {
  .brand:hover { text-decoration: none; }
  .mast, .wrap { margin-inline: 20px; }
  body { font-size: 13px; }
  .wrap { padding-top: 21px; }
  .ptitle { font-size: 14px; }
  .pubs, .news, .service { margin-top: 27px; }
  .news-item { grid-template-columns: 1fr; gap: 3px; }
  .teaching-title { gap: 12px; }
  .review-row { gap: 6px; }
  .review-row .service-heading { font-size: 14px; }
  .honors { display: block; }
  .honor { display: block; width: fit-content; }
  .honor-separator { display: none; }
  .paper { gap: 6px; padding-bottom: 17px; }
  .post-header h1 { font-size: 24px; }
  .post-content { font-size: 16px; }
}
@media (max-width: 370px) {
  .pubhead { gap: 8px; }
  h2 { font-size: 19px; }
}
