/* Weijie Ma's single-page Jemdoc structure with Ji Jiaming's publication and honors geometry. */
* { box-sizing:border-box; }
html { background:#eee; scroll-behavior:smooth; scroll-padding-top:70px; }
body { max-width:960px; margin:30px auto; padding:10px 50px 30px; color:#1a1a1a; background:#fff; font-family:Constantia,"Lucida Bright","DejaVu Serif",Georgia,serif; font-size:16px; line-height:1.45; text-align:left; }
.home-page,.blog-page { padding-top:60px; }
a { color:#224b8d; text-decoration:none; }
a:hover { text-decoration:underline; }
a:focus-visible,button:focus-visible { outline:2px solid #2c5aa0; outline-offset:3px; }
p { margin:0 0 .8em; padding:0; line-height:1.55; }
h1,h2,h3 { color:#1a1a1a; line-height:1.2; font-weight:bold; }
h1 { font-size:165%; }
h2 { margin:1em 0 .6em; padding:.8em 0 .25em; border-bottom:1px solid #ccc; font-size:125%; }
h3 { font-size:110%; }
[hidden] { display:none!important; }

.topline { display:flex; justify-content:flex-end; flex-wrap:wrap; gap:8px 18px; margin:0 0 16px; font-size:14px; }
.topline a { padding-bottom:1px; }
.topline a[aria-current="page"] { color:#022b6d; border-bottom:1px solid #777; }
.anchor-section { scroll-margin-top:70px; }

#navbar { position:fixed; z-index:1000; top:0; left:0; width:100%; border-bottom:1px solid #e0e0e0; background:rgba(255,255,255,.88); box-shadow:0 1px 8px rgba(0,0,0,.04); font-family:Constantia,"Lucida Bright","DejaVu Serif",Georgia,serif; font-size:15px; backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px); }
#navbar .nav-container { display:flex; align-items:center; gap:20px; max-width:960px; margin:0 auto; padding:10px 50px; }
#navbar a { color:#224b8d; font-weight:600; white-space:nowrap; }
#navbar a:hover { text-decoration:none; }
#navbar .nav-brand { padding-bottom:2px; border-bottom:2px solid transparent; }
#navbar .nav-links { display:flex; align-items:center; gap:20px; }
#navbar .nav-links a { padding-bottom:2px; border-bottom:2px solid transparent; transition:border-color .2s ease,color .2s ease; }
#navbar a[aria-current="page"] { color:#1a1a1a; border-bottom-color:#224b8d; }
#navbar .nav-links a:hover,#navbar .nav-links a:focus-visible { border-bottom-color:#224b8d; }
#navbar .last-updated { display:flex; align-items:center; margin-left:auto; color:#666; font-size:12px; line-height:1; white-space:nowrap; }
.nav-toggle { display:none; flex-direction:column; gap:5px; padding:4px; border:0; background:none; cursor:pointer; }
.nav-toggle span { display:block; width:24px; height:2px; border-radius:2px; background:#1a1a1a; transition:opacity .3s ease,transform .3s ease; }
.nav-toggle.open span:nth-child(1) { transform:translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity:0; }
.nav-toggle.open span:nth-child(3) { transform:translateY(-7px) rotate(-45deg); }

.profile { width:100%; border-collapse:collapse; }
.profile > tbody > tr > td:first-child { padding-top:8px; padding-right:32px; }
.profile-photo { display:block; width:190px; height:254px; object-fit:cover; object-position:center top; }
.name { margin:0 0 16px; padding:0; border:0; font-size:180%; }
.profile-title { margin:0 0 8px; padding:0; border:0; font-size:110%; line-height:1.4; }
.meta { margin-bottom:0; line-height:1.6; }
.contact { margin:14px 0 16px; border-collapse:collapse; }
.contact td { padding:0 7px 0 0; line-height:1.45; white-space:nowrap; }
.profile-icons { display:flex; align-items:center; gap:14px; height:30px; margin-top:0; }
.profile-icon { display:inline-flex; align-items:center; justify-content:center; width:30px; height:30px; color:#111; border:0!important; }
.profile-icon svg { display:block; width:28px; height:28px; fill:currentColor; }
.profile-icon:hover,.profile-icon:focus-visible { opacity:.65; }
.motto { max-width:500px; margin:18px 0 0; color:#555; font-size:85%; font-style:italic; line-height:1.45; }

.dated-list { margin:.2em 0 .8em; padding:0; list-style:none; }
.dated-list li { position:relative; display:flex; align-items:center; gap:12px; margin-top:.7em; padding-left:16px; }
.dated-list li::before { position:absolute; top:50%; left:1px; width:6px; height:6px; background:#1a1a1a; content:""; transform:translateY(-50%); }
.dated-list time { flex:0 0 92px; color:#555; font-weight:600; font-variant-numeric:tabular-nums; white-space:nowrap; }
.dated-list span { min-width:0; flex:1 1 auto; }

.publication-controls { display:flex; gap:8px; margin:2px 0 9px; overflow-x:auto; }
.pub-button { padding:8px 16px; color:#666; border:0; border-radius:20px; background:#f0f0f0; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; font-size:14px; font-weight:500; cursor:pointer; transition:background .2s ease,box-shadow .2s ease,transform .2s ease; }
.pub-button:hover { background:#e0e0e0; box-shadow:0 2px 8px rgba(0,0,0,.12); transform:translateY(-1px); }
.pub-button.active { color:#fff; background:#2c5aa0; }
.publication-note { margin-bottom:9px; color:#666; font-size:80%; }
.publications-list { width:100%; }
.publication-container { display:flex; align-items:center; justify-content:flex-start; margin-bottom:12px; padding:14px 16px; border:1px solid transparent; border-radius:8px; transition:border-color .25s ease,box-shadow .25s ease,transform .25s ease; }
.publication-container:hover { border-color:#e0e0e0; box-shadow:0 4px 16px rgba(0,0,0,.08); transform:translateY(-2px); }
.publication-media { flex:0 0 240px; margin-left:10px; }
.publication-media a { display:block; }
.publication-media img { display:block; width:240px; height:auto; border:0; border-radius:8px; background:#fff; box-shadow:1px 1px 4px rgba(0,0,0,.15); }
.publication-details { min-width:0; flex:1 1 auto; margin:0 0 3.5px 15px; line-height:1.38; }
.paper-title { display:inline-block; margin-bottom:3px; color:#0066cc; font-weight:700; line-height:1.28; }
.paper-authors { margin-bottom:3px; }
.paper-venue { margin-bottom:3px; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; font-style:italic; font-weight:600; }
.venue-highlight { display:inline-block; margin-left:7px; padding:2px 8px; color:#fff; border-radius:4px; background:linear-gradient(135deg,#8b0012 0%,#c83e4d 100%); box-shadow:0 2px 6px rgba(139,0,18,.28); font-size:12px; font-style:normal; font-weight:700; letter-spacing:.2px; vertical-align:1px; }
.review-note { margin:-1px 0 3px; color:#555; font-size:88%; font-style:italic; font-weight:400; }
.publication-links { color:#333; font-size:16px; line-height:1.2; }
.publication-links a { color:#0066cc; font-weight:400; white-space:nowrap; }
.bibtex-trigger { display:inline; margin:0; padding:0; color:#0066cc; border:0; background:none; font:inherit; font-weight:400; line-height:inherit; cursor:pointer; white-space:nowrap; }
.bibtex-trigger:hover { text-decoration:underline; }
.repo-stars { display:inline-flex; align-items:center; gap:3px; margin-left:6px; padding:0 5px; color:#666!important; border:1px solid #d8d8d8; border-radius:3px; background:#f5f5f5; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; font-size:80%; font-variant-numeric:tabular-nums; line-height:1.45; text-decoration:none!important; white-space:nowrap; vertical-align:1px; }
.repo-stars:hover { color:#333!important; border-color:#bbb; background:#eee; }
.repo-stars__icon { color:inherit; }

.honors-list time { flex-basis:92px; }
.service-list time { flex-basis:92px; }
.footer { margin-top:4em; padding-top:.45em; color:#888; border-top:1px solid #c0c0c0; font-size:small; text-align:right; }

/* Blog pages keep the same restrained Jemdoc vocabulary. */
.post-list { margin:0; padding:0; list-style:none; }
.post-list li { display:grid; grid-template-columns:105px 1fr; gap:16px; margin:0; padding:17px 0; border-bottom:1px solid #ddd; }
.post-list time { color:#666; font-size:85%; }
.post-list h3 { margin:0 0 7px; padding:0; border:0; color:#224b8d; }
.post-list p { font-size:92%; }
.post-title { color:#1a1a1a; }
.post-meta { color:#666; font-size:90%; }
.post-content { max-width:720px; }
.post-content p { line-height:1.55; }
.note { padding:12px 15px; border:1px solid #cfcfcf; background:#f6f6f6; }

.modal-open { overflow:hidden; }
.bibtex-modal { position:fixed; z-index:2000; inset:0; display:flex; align-items:flex-start; justify-content:center; padding:5vh 20px; background:rgba(0,0,0,.5); animation:bibtex-fade-in .3s ease-out; }
.bibtex-modal-content { position:relative; width:min(800px,80vw); max-height:80vh; padding:20px; overflow-y:auto; border-radius:8px; background:#fff; box-shadow:0 4px 20px rgba(0,0,0,.3); animation:bibtex-slide-in .3s ease-out; }
.bibtex-modal-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:20px; padding-bottom:15px; border-bottom:1px solid #eee; }
.bibtex-modal-header h3 { margin:0; padding:0; border:0; color:#333; font-size:24px; }
.bibtex-close { display:flex; align-items:center; justify-content:center; width:40px; height:40px; padding:0; color:#1a1a1a; border:0; border-radius:50%; background:#f0f0f0; font-family:Arial,sans-serif; font-size:24px; line-height:1; cursor:pointer; transition:background .2s ease,transform .2s ease; }
.bibtex-close:hover { background:#e0e0e0; transform:scale(1.08); }
.bibtex-content { min-height:150px; margin:0 0 12px; padding:20px; overflow-x:auto; color:#495057; border:1px solid #e9ecef; border-radius:6px; background:#f8f9fa; font-family:Monaco,Menlo,"Ubuntu Mono",Consolas,monospace; font-size:14px; line-height:1.5; white-space:pre-wrap; }
.bibtex-status { min-height:1.45em; margin:0 0 8px; color:#666; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; font-size:13px; text-align:right; }
.bibtex-actions { display:flex; justify-content:flex-end; gap:12px; }
.bibtex-copy-btn,.bibtex-download-btn { padding:10px 20px; color:#fff; border:0; border-radius:6px; background:#2c5aa0; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; font-size:14px; font-weight:500; cursor:pointer; transition:background .2s ease,box-shadow .2s ease,transform .2s ease; }
.bibtex-copy-btn:hover,.bibtex-download-btn:hover { background:#1e3f73; box-shadow:0 2px 8px rgba(0,0,0,.15); transform:translateY(-1px); }
.bibtex-download-btn { background:#6c757d; }
.bibtex-download-btn:hover { background:#545b62; }
.bibtex-copy-btn.copy-success { background:#28a745; }
@keyframes bibtex-fade-in { from { opacity:0; } to { opacity:1; } }
@keyframes bibtex-slide-in { from { opacity:0; transform:translateY(-50px); } to { opacity:1; transform:translateY(0); } }

@media(min-width:701px){
  html { scrollbar-gutter:stable; }
}

@media(max-width:700px){
  body { margin:0; padding:16px 22px 28px; }
  .home-page,.blog-page { padding-top:70px; }
  .topline { justify-content:flex-start; gap:7px 16px; margin-bottom:18px; }
  #navbar .nav-container { position:relative; justify-content:space-between; padding:10px 22px; }
  #navbar .last-updated { display:none; }
  .js .nav-toggle { display:flex; }
  .js #navbar .nav-links { position:absolute; top:100%; left:0; display:none; align-items:stretch; width:100%; padding:8px 22px 12px; border-bottom:1px solid #e0e0e0; background:#fff; box-shadow:0 5px 12px rgba(0,0,0,.06); }
  .js #navbar .nav-links.open { display:flex; flex-direction:column; gap:5px; }
  .js #navbar .nav-links a { padding:7px 0; }
  .profile,.profile > tbody,.profile > tbody > tr,.profile > tbody > tr > td { display:block; width:100%; }
  .profile > tbody > tr > td:first-child { padding-top:0; padding-right:0; }
  .profile > tbody > tr > td:last-child { padding-top:15px; }
  .name { font-size:165%; }
  .contact td { display:table-cell; width:auto; }
  .contact td:last-child { padding-top:0; }
  .profile-photo { width:162px; height:216px; }
  .publication-container { display:block; padding:12px 10px 14px; }
  .publication-media { width:100%; margin:0 0 13px; }
  .publication-media img { width:100%; height:auto; }
  .publication-details { margin:0; }
  .dated-list li { gap:9px; padding-left:14px; }
  .dated-list time { flex-basis:84px; }
  .post-list li { grid-template-columns:1fr; gap:4px; }
  .bibtex-modal { align-items:center; padding:16px; }
  .bibtex-modal-content { width:100%; max-height:calc(100vh - 32px); padding:16px; }
  .bibtex-modal-header h3 { font-size:20px; }
  .bibtex-content { padding:14px; font-size:12px; }
}

@media(prefers-reduced-motion:reduce){
  .bibtex-modal,.bibtex-modal-content { animation:none; }
}

@media(max-width:390px){
  body { padding-right:17px; padding-left:17px; }
  .contact { width:100%; font-size:94%; }
  .contact td { white-space:normal; }
  .publication-controls { margin-bottom:10px; }
  .pub-button { padding:7px 14px; }
  .dated-list li { display:grid; grid-template-columns:92px minmax(0,1fr); }
  .dated-list time { width:auto; }
}
