@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;500;600;700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,500;8..60,600&display=swap');

:root {
  --page-bg: #2f3f3a;
  --panel: #f3efe6;
  --text: #202622;
  --muted: #65706a;
  --nav: #21332e;
  --nav-hover: #8a4a3f;
  --link: #8a4a3f;
  --link-hover: #3d6a5b;
  --line: #ddd8cc;
  --sidebar-line: #ddd8cc;
  --radius: 7px;
  --page-width: 1120px;
  --font: "Source Serif 4", Georgia, "Times New Roman", serif;
  --ui-font: "Source Sans 3", "Aptos", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html {
  min-height: 100%;
  text-align: center;
}

body {
  min-height: 100%;
  margin: 0 auto;
  padding: 0;
  color: var(--text);
  background: linear-gradient(180deg, #263631 0%, #2f3f3a 300px, #40524c 100%);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.68;
  text-align: left;
  letter-spacing: -0.005em;

  padding-bottom: 0;}

#page {
  max-width: var(--page-width);
  min-width: 0;
  margin: 0 auto;
  position: relative;
}

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

a:hover,
a:focus {
  color: var(--link-hover);
  text-decoration: underline;
}

h1, h2, h3, h4 {
  color: #202622;
  font-family: var(--font);
  font-weight: 600;
  line-height: 1.18;
}

h1 {
  margin: 0 0 0.68em;
  font-size: 1.9rem;
}

h2 {
  margin: 1.35em 0 0.52em;
  font-size: 1.45rem;
}

h3 {
  margin: 1.35em 0 0.45em;
  font-size: 1.16rem;
}

p { margin: 0 0 1.12em; }

ul, ol {
  margin: 0.6em 0 1.35em 1.5em;
  padding: 0;
}

li { margin-bottom: 0.42em; }

hr {
  clear: both;
  margin: 2em 0;
  border: 0;
  border-top: 3px solid #ddd8cc;
}

#banner { padding-top: 4px; }

.banner-visual {
  position: relative;
  display: block;
  width: 91%;
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: #241735;
}

.banner-image-link {
  display: block;
  margin: 0;
  padding: 0;
  line-height: 0;
}

.banner-image-link:hover,
.banner-image-link:focus {
  text-decoration: none;
}

.banner-visual img {
  display: block;
  width: 100%;
  height: 225px;
  object-fit: cover;
  object-position: center 50%;
  border-radius: var(--radius);
}

.banner-note {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 2;
  margin: 0;
  padding: 4px 8px;
  color: rgba(255, 255, 255, 0.94);
  background: rgba(10, 20, 24, 0.34);
  border-radius: 3px;
  font-size: 0.75rem;
  font-style: italic;
  line-height: 1.2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

#banner nav {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  width: auto;
  min-height: 43px;
  margin: 0;
  color: #fff;
  background: rgba(13, 32, 38, 0.68);
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 -8px 22px rgba(0, 0, 0, 0.10);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

#banner nav ul {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0 18px 0 24px;
}

#banner nav li {
  flex: 0 0 122px;
  margin: 0;
}

#banner nav a {
  display: block;
  box-sizing: border-box;
  width: 100%;
  padding: 12px 8px 11px;
  color: #fff;
  font-size: 1.02rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  letter-spacing: 0.004em;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
  border-radius: 2px 2px 0 0;
}

#banner nav a:hover,
#banner nav a:focus {
  color: #fff;
  background: rgba(139, 48, 53, 0.88);
  text-decoration: none;
}

#layout {
  display: grid;
  grid-template-columns: minmax(0, 3.05fr) minmax(230px, 1fr);
  gap: 14px;
  width: 91%;
  margin: 10px auto 16px;
  align-items: stretch;
}

#content {
  min-width: 0;
  padding: 42px 7.2%;
  overflow: hidden;
  background: linear-gradient(180deg, #f4f0e7 0%, #eee8dc 100%);
  border-radius: var(--radius);

  box-shadow: 0 18px 42px rgba(19, 29, 25, 0.22);
  align-self: stretch;}

#sidebar {
  min-width: 0;
  padding: 14px 17px 18px;
  overflow: hidden;
  background: linear-gradient(180deg, #f2ede4 0%, #ebe4d8 100%);
  border-radius: var(--radius);
  font-size: 0.91rem;

  box-shadow: 0 18px 42px rgba(19, 29, 25, 0.18);
  align-self: stretch;}

#sidebar section + section { margin-top: 1.25em; }

#sidebar h2 {
  margin: 0 0 0.35em;
  padding: 0 2px;
  color: var(--link);
  font-size: 1.17rem;
  font-weight: 560;
}

#sidebar ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#sidebar li { margin: 0; }

#sidebar li a,
#sidebar li span {
  display: block;
  padding: 0.48em 0.25em;
  color: #4d5a54;
  border-bottom: 1px solid var(--sidebar-line);
  text-decoration: none;
}

#sidebar li a:hover {
  padding-left: 0.55em;
  color: #fff;
  background: var(--nav-hover);
}

#sidebar p { color: #4d5a54; }

.topic-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.topic-cloud a {
  padding: 3px 7px;
  color: #4d5a54;
  background: #eee8dc;
  border: 1px solid #ddd8cc;
  border-radius: 3px;
  font-size: 0.79rem;
}

.topic-cloud a:hover {
  color: #fff;
  background: var(--nav-hover);
  border-color: var(--nav-hover);
  text-decoration: none;
}

.home-intro .portrait {
  float: left;
  width: 158px;
  margin: 0 25px 16px 0;
  border-radius: 8px;

  box-shadow: 0 10px 24px rgba(29, 24, 38, 0.18);
}

.clear { clear: both; }

.more-link { font-weight: 650; }

.news-list {
  list-style: none;
  margin-left: 0;
}

.news-list li {
  margin-bottom: 1.2em;
  padding-bottom: 0.8em;
  border-bottom: 1px solid var(--line);
}

.news-date {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.news-list p {
  margin: 0.3em 0 0;
  color: #4d5a54;
}

.post-info {
  margin: -0.6em 0 1.5em;
  color: var(--muted);
  font-size: 0.85rem;
}

.publication-list { margin-left: 1.4em; }

.publication-list li {
  margin-bottom: 1.35em;
  padding-left: 0.25em;
}

.pub-meta {
  color: #3f4944;
}

.pub-note {
  color: #65706a;
  font-size: 0.88rem;
}

.cv-table {
  width: 100%;
  margin: 0.4em 0 1.6em;
  border-collapse: collapse;
}

.cv-table th,
.cv-table td {
  padding: 0.68em 0.55em;
  vertical-align: top;
  border-bottom: 1px solid #ddd8cc;
}

.cv-table th {
  width: 125px;
  color: #65706a;
  font-size: 0.88rem;
  font-weight: 500;
  text-align: left;
}

#footer {
  clear: both;
  width: 91%;
  margin: 0 auto;
  padding: 0 0 14px;
  color: #cfd9d3;
  font-size: 0.8rem;
  text-align: center;
}

#footer p { margin: 0; }

pre {
  padding: 12px;
  overflow: auto;
  color: #202622;
  background: #eee8dc;
  border-radius: 4px;
}

code { font-family: Consolas, "Liberation Mono", monospace; }

table { max-width: 100%; }

@media (max-width: 900px) {
  #page { width: 100%; }

  .banner-visual,
  #layout,
  #footer {
    width: calc(100% - 28px);
  }

  #layout { grid-template-columns: 1fr; }

  #sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
  }

  #sidebar section + section { margin-top: 0; }
}

@media (max-width: 640px) {
  body { font-size: 14.8px; }

  #banner { padding-top: 12px; }

  .banner-visual img {
    height: 220px;
    object-position: center 50%;
  }

  .banner-note {
    top: 9px;
    right: 10px;
    font-size: 0.7rem;
  }

  #banner nav ul { padding: 0; }

  #banner nav a {
    padding: 8px 9px;
    font-size: 0.84rem;
  }

  #layout { margin-top: 10px; }

  #content { padding: 30px 7%; }

  #sidebar { display: block; }

  #sidebar section + section { margin-top: 1.25em; }

  .home-intro .portrait {
    float: none;
    width: 135px;
    margin: 0 0 18px;
  }

  .cv-table,
  .cv-table tbody,
  .cv-table tr,
  .cv-table th,
  .cv-table td {
    display: block;
    width: 100%;
  }

  .cv-table th {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .cv-table td { padding-top: 0.25em; }
}







/* Smooth motion refinements */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: no-preference) {
  .reveal-on-scroll {
    opacity: 0;
    transform: translateY(9px);
    transition:
      opacity 420ms cubic-bezier(0.22, 1, 0.36, 1),
      transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
  }

  .reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  .banner-visual img {
    transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
  }

  #sidebar li a {
    transition:
      padding-left 220ms cubic-bezier(0.22, 1, 0.36, 1),
      background-color 220ms cubic-bezier(0.22, 1, 0.36, 1),
      color 220ms cubic-bezier(0.22, 1, 0.36, 1);
  }

  a {
    transition: color 180ms ease;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}


#banner,
#sidebar,
#footer,
.cv-table,
.news-date,
.post-info,
.topic-cloud,
#banner nav,
.site-title,
.site-subtitle {
  font-family: var(--ui-font);
}

#content {
  font-family: var(--font);
}

#content h1,
#content h2,
#content h3,
#content h4 {
  font-family: var(--ui-font);
  letter-spacing: -0.015em;
}

.home-intro {
  max-width: 760px;
}

.home-intro p {
  font-weight: 400;
  line-height: 1.72;
  font-size: 1.03rem;
}

.home-intro .position {
  margin-bottom: 1.28em;
  font-family: var(--ui-font);
  font-size: 1.05rem;
  line-height: 1.55;
  font-weight: 500;
  color: var(--text);
}

.home-intro p + p {
  margin-top: 1.02em;
}


/* ziwei final aligned footer */

@media (max-width: 760px) {
  #layout {
    align-items: initial;
    margin: 10px auto 14px;
  }

  #content,
  #sidebar {
    align-self: auto;
  }

  #footer {
    padding-bottom: 12px;
  }
}














/* ziwei final cv nowrap nav */
@media (max-width: 760px) {
  #banner nav ul {
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0 6px 0 8px;
  }

  #banner nav li {
    flex: 0 0 90px;
  }

  #banner nav a {
    padding: 9px 6px 8px;
    font-size: 0.9rem;
    white-space: nowrap;
  }
}
