/* ==========================================================================
   Site-Wide Fonts & Design Policy (shared across homepage, papers, and demos)
   --------------------------------------------------------------------------
   Fonts (single source of truth — loaded lazily by unicode-range & usage):
     --font-sans  Lato (400/700 normal & italic, v25 woff2)
     --font-mono  Source Code Pro (400–700 variable, v32 woff2)

   Colors:
     --bg            #ffffff  Page, button, and popover background.
     --bg-code       #f7f7f5  Code listing, inline code & control surface.
     --border        #e4e4e0  Hairline dividers & borders (~black!15).
     --text          #000000  All primary content & paper metadata (prose,
                              headings, authors, affiliations, venues, emails,
                              captions, tables, references, code body/keywords).
     --text-muted    #555555  Chrome ONLY: nav/link separators (/), footers,
                              sidebar TOC, eq numbers, hover # anchors, Copy
                              buttons, and code comments. Never use for main
                              content or paper metadata.
     --accent        #1772d0  Clickable links & active navigation ONLY. Never
                              use for non-clickable elements or code keywords.
     --accent-hover  #f09228  Hover/focus state for links & interactive chrome.
     --highlight-bg  #ffffd0  Highlighted paper rows & :target jump highlights.
     (Homepage-only accents: award badges #d40000 / #c64848, Miscellanea boxes.)

   Typography:
     Homepage (index.html): 32px title, 22px h2, 14px body (normal ~1.2 leading),
                            13px footer.
     Papers (paper.css):    32px title, 22px h2, 18px h3/abstract, 15px regular
                            text (prose, authors, emails, affiliations, venue,
                            top nav, TOC, eq numbers; 14px on mobile <= 640px),
                            13px ONLY for LaTeX-\small equivalents (fig/table
                            captions, tables, bibliography, code, algorithms,
                            footnotes) and small UI chrome (footer, popups,
                            Copy buttons). KaTeX math scaled to 1.14em.
   ========================================================================== */

/* Lato — latin-ext italic 400 */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 400;
  font-display: block;
  src: url(https://fonts.gstatic.com/s/lato/v25/S6u8w4BMUTPHjxsAUi-qNiXg7eU0.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Lato — latin italic 400 */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 400;
  font-display: block;
  src: url(https://fonts.gstatic.com/s/lato/v25/S6u8w4BMUTPHjxsAXC-qNiXg7Q.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Lato — latin-ext italic 700 */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 700;
  font-display: block;
  src: url(https://fonts.gstatic.com/s/lato/v25/S6u_w4BMUTPHjxsI5wq_FQftx9897sxZ.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Lato — latin italic 700 */
@font-face {
  font-family: 'Lato';
  font-style: italic;
  font-weight: 700;
  font-display: block;
  src: url(https://fonts.gstatic.com/s/lato/v25/S6u_w4BMUTPHjxsI5wq_Gwftx9897g.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Lato — latin-ext normal 400 */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url(https://fonts.gstatic.com/s/lato/v25/S6uyw4BMUTPHjxAwXiWtFCfQ7A.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Lato — latin normal 400 */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url(https://fonts.gstatic.com/s/lato/v25/S6uyw4BMUTPHjx4wXiWtFCc.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Lato — latin-ext normal 700 */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  font-display: block;
  src: url(https://fonts.gstatic.com/s/lato/v25/S6u9w4BMUTPHh6UVSwaPGQ3q5d0N7w.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Lato — latin normal 700 */
@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  font-display: block;
  src: url(https://fonts.gstatic.com/s/lato/v25/S6u9w4BMUTPHh6UVSwiPGQ3q5d0.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Source Code Pro — greek 400–700 (variable) */
@font-face {
  font-family: 'Source Code Pro';
  font-style: normal;
  font-weight: 400 700;
  font-display: block;
  src: url(https://fonts.gstatic.com/s/sourcecodepro/v32/HI_SiYsKILxRpg3hIP6sJ7fM7PqlPuvWnsUnxlC9.woff2) format('woff2');
  unicode-range: U+0370-0377, U+037A-037F, U+0384-038A, U+038C, U+038E-03A1, U+03A3-03FF;
}
/* Source Code Pro — latin-ext 400–700 (variable) */
@font-face {
  font-family: 'Source Code Pro';
  font-style: normal;
  font-weight: 400 700;
  font-display: block;
  src: url(https://fonts.gstatic.com/s/sourcecodepro/v32/HI_SiYsKILxRpg3hIP6sJ7fM7PqlM-vWnsUnxlC9.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* Source Code Pro — latin 400–700 (variable) */
@font-face {
  font-family: 'Source Code Pro';
  font-style: normal;
  font-weight: 400 700;
  font-display: block;
  src: url(https://fonts.gstatic.com/s/sourcecodepro/v32/HI_SiYsKILxRpg3hIP6sJ7fM7PqlPevWnsUnxg.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #ffffff;
  --bg-code: #f7f7f5;
  --border: #e4e4e0;
  --text: #000000;
  --text-muted: #555555;
  --accent: #1772d0;
  --accent-hover: #f09228;
  --highlight-bg: #ffffd0;
  --font-sans: 'Lato', Helvetica, Arial, sans-serif;
  --font-mono: 'Source Code Pro', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:focus,
a:hover {
  color: var(--accent-hover);
  text-decoration: none;
}

h2 {
  margin: 0;
  font-weight: 400;
  font-size: 22px;
}

.page {
  width: 100%;
  max-width: 816px;
  margin: 0 auto;
  padding: 8px;
}

.bio {
  display: flex;
  align-items: center;
}

.bio-text {
  width: 63%;
  padding: 2.5%;
}

.bio-photo {
  width: 37%;
  padding: 2.5%;
}

.bio-photo img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 50%;
}

.name {
  padding-top: 20px;
  margin: 0;
  font-weight: 400;
  font-size: 32px;
  text-align: center;
}

.bio-links {
  text-align: center;
  color: var(--text-muted);
}

.section-header {
  padding: 16px;
}

.highlight {
  background-color: var(--highlight-bg);
}

.papers {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.paper,
.misc-row {
  display: grid;
  grid-template-columns: 192px minmax(0, 1fr);
  align-items: center;
}

.paper.highlighted {
  background-color: var(--highlight-bg);
}

.paper-media,
.misc-badge {
  padding: 16px;
}

.misc-badge {
  text-align: center;
}

.paper-info,
.misc-links {
  padding: 8px;
}

.papertitle {
  font-size: inherit;
  font-weight: 700;
}

.paper-links {
  color: var(--text-muted);
}

.paper-authors {
  text-wrap: balance;
}

.paper-authors a,
.paper-authors strong,
.paper-authors .author {
  white-space: nowrap;
}

.award {
  color: #d40000;
}

.award-highlight {
  color: #c64848;
}

.paper-desc {
  margin: 14px 0 0;
}

.one {
  width: 160px;
  height: 160px;
  position: relative;
}

.one-short,
.one-short .two {
  height: 120px;
}

.two {
  width: 160px;
  height: 160px;
  position: absolute;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
}

.one img,
.paper-media > img {
  width: 100%;
  height: auto;
  display: block;
}

.one video {
  width: 100%;
  height: 100%;
  display: block;
}

@media (hover: hover) {
  .paper:hover > .paper-media > .one > .two {
    opacity: 1;
    pointer-events: auto;
  }
}

.paper.hover-active > .paper-media > .one > .two {
  opacity: 1;
  pointer-events: auto;
}

.colored-box {
  color: var(--text);
  padding: 20px;
  display: inline-block;
  border-radius: 10px;
}

.site-footer {
  text-align: right;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 18px;
}

@media (max-width: 640px) {
  .page {
    padding: 0;
  }

  .bio {
    flex-direction: column-reverse;
  }

  .bio-text {
    width: 100%;
    padding: 8px 16px;
  }

  .bio-photo {
    width: 100%;
    padding: 20px 16px 0;
    text-align: center;
  }

  .bio-photo img {
    width: 148px;
    margin: 0 auto;
  }

  .name {
    padding-top: 8px;
    font-size: 28px;
  }

  .paper,
  .misc-row {
    grid-template-columns: 124px minmax(0, 1fr);
  }

  .paper-media,
  .misc-badge {
    padding: 12px 8px 12px 12px;
  }

  .paper-info,
  .misc-links {
    padding: 10px 12px 10px 6px;
  }

  .one,
  .two {
    width: 104px;
    height: 104px;
  }

  .one-short,
  .one-short .two {
    height: 78px;
  }

  .colored-box {
    padding: 12px 8px;
    width: 104px;
  }

  .colored-box h2 {
    font-size: 15px;
  }

  .site-footer {
    padding: 0 16px;
  }
}


/* Wenjie Hua: the reference layout and typography above are unchanged. */
:root { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #191919;
  --bg-code: #252525;
  --border: #454545;
  --text: #ededed;
  --text-muted: #bcbcbc;
  --accent: #80baff;
  --accent-hover: #ffbc72;
  --highlight-bg: #343422;
}
.page { position: relative; }
.theme-toggle {
  position: absolute;
  top: 6px;
  right: 16px;
  border: 0;
  padding: 4px 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  cursor: pointer;
}
.theme-toggle:hover { color: var(--accent-hover); }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.paper-thumbnail {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 160px;
  height: 160px;
}
.paper-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.contribution { margin-top: 4px; }
.text-section { margin-top: 12px; }
.talks { list-style: none; padding: 0; margin: 16px 0 0; }
.talks li + li { margin-top: 20px; }
.talk-venue { margin-top: 4px; }
.text-section > p { margin-bottom: 10px; }
.visitor-counter { margin-bottom: 20px; }
.visitor-counter summary { cursor: pointer; }
.visitor-counter img { display: block; margin: 10px 0 0 auto; object-fit: contain; max-width: 100%; }
@media (max-width: 640px) {
  .paper-thumbnail { width: 104px; height: 104px; }
  .theme-toggle { top: 3px; right: 16px; }
}

/* Square thumbnail compositions from original paper figures. Each viewport
   preserves the source aspect ratio; source pixels and scientific labels
   are not regenerated. Click a thumbnail to inspect its complete figure. */
.paper-thumbnail.thumbnail-collage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 3px;
  overflow: hidden;
  background: #fff;
}
.paper-thumbnail.thumbnail-detail { background: #fff; overflow: hidden; }
.thumb-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #fff;
}
.thumb-crop {
  display: block;
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
}
.paper-thumbnail .thumb-crop img {
  display: block;
  position: absolute;
  max-width: none;
  object-fit: fill;
  pointer-events: none;
}
