/* Academic layout refresh inspired by tangjyan/zh-cn */

:root {
  --site-bg: #ffffff;
  --site-text: #1f2937;
  --site-muted: #6b7280;
  --site-border: #e5e7eb;
  --site-border-strong: #d1d5db;
  --site-subtle: #f8fafc;
  --site-link: #1d4ed8;
  --site-link-hover: #1e3a8a;
  --site-max-width: 1240px;
  --site-sidebar-width: 280px;
  --site-content-width: 780px;
  --site-font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

html,
body,
button,
input,
select,
textarea {
  background: var(--site-bg);
  color: var(--site-text);
  font-family: var(--site-font);
}

body {
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

p + p {
  margin-top: 0;
  text-indent: 0;
}

a {
  color: var(--site-link);
}

a:hover,
a:focus {
  color: var(--site-link-hover);
}

h1,
h2,
h3,
h4,
h5,
h6,
.masthead a,
.page-section-nav a {
  font-family: var(--site-font);
}

.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--site-border);
}

.masthead__inner-wrap {
  max-width: var(--site-max-width);
  margin: 0 auto;
  padding: 0.8rem 1.25rem;
}

.masthead__menu {
  width: 100%;
}

.greedy-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-width: 0;
  background: transparent;
}

.greedy-nav button,
.greedy-nav .hidden-links,
.greedy-nav .navicon {
  display: none;
}

.visible-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 1.15rem;
}

.masthead__menu-item {
  margin: 0;
  list-style: none;
}

.masthead__menu-item a,
.masthead__menu-item a:visited,
.language-switch,
.language-switch:visited {
  display: inline-block;
  border-bottom: 0;
  color: var(--site-muted);
  font-size: 0.96rem;
  line-height: 1.4;
  text-decoration: none;
}

.masthead__menu-item a:hover,
.masthead__menu-item a:focus,
.masthead__menu-item a.is-current,
.language-switch:hover,
.language-switch:focus {
  color: var(--site-text);
}

.masthead__menu-item--home {
  margin-right: 0.75rem;
}

.masthead__menu-item--home a,
.masthead__menu-item--home a:visited {
  color: var(--site-text);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.masthead__menu-meta {
  flex-shrink: 0;
}

.language-switch {
  padding: 0.25rem 0;
}

#main {
  max-width: var(--site-max-width);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  display: grid;
  grid-template-columns: minmax(240px, var(--site-sidebar-width)) minmax(0, var(--site-content-width));
  justify-content: center;
  gap: 2.75rem;
  align-items: start;
  counter-reset: captions;
}

#main:before,
#main:after {
  display: none;
}

.sidebar,
.page,
#main > .page,
#main article.page {
  float: none;
  width: auto;
  margin: 0;
  padding: 0;
}

.sidebar {
  min-width: 0;
}

.sticky {
  position: sticky;
  top: 5rem;
}

.page {
  min-width: 0;
}

.page__inner-wrap {
  width: 100%;
}

.page__hero {
  margin-bottom: 1.4rem;
}

.page__hero img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--site-border);
  border-radius: 10px;
}

.page__header {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--site-border);
}

.page__title {
  margin: 0;
  color: var(--site-text);
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1.25;
}

.page__tagline {
  margin: 0.55rem 0 0;
  color: var(--site-muted);
  font-size: 1rem;
}

.page__section-nav {
  position: sticky;
  top: 4.55rem;
  z-index: 10;
  margin: 0 0 1.4rem;
  padding: 0.3rem 0 0.85rem;
  background: var(--site-bg);
  border-bottom: 1px solid var(--site-border);
}

.page__section-nav[hidden] {
  display: none;
}

.page-section-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
}

.page-section-nav__item {
  margin: 0;
}

.page-section-nav__link,
.page-section-nav__link:visited {
  display: inline-block;
  padding: 0.05rem 0;
  color: var(--site-muted);
  border-bottom: 0;
  font-size: 0.94rem;
  text-decoration: none;
}

.page-section-nav__link:hover,
.page-section-nav__link:focus,
.page-section-nav__link.is-active {
  color: var(--site-text);
  border-bottom: 1px solid var(--site-text);
}

.page__content {
  min-width: 0;
}

.article-wrap {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  backdrop-filter: none;
}

.article-wrap > :last-child {
  margin-bottom: 0;
}

.article-wrap h2,
.article-wrap h3,
.article-wrap h4 {
  color: var(--site-text);
}

.article-wrap h2 {
  margin: 2rem 0 1rem;
  padding-bottom: 0.5rem;
  font-size: 1.36rem;
  font-weight: 600;
  line-height: 1.5;
  border-bottom: 1px solid var(--site-border);
}

.article-wrap h2:first-child {
  margin-top: 0;
}

.article-wrap h3 {
  margin: 1.4rem 0 0.8rem;
  font-size: 1.08rem;
  font-weight: 600;
}

.article-wrap h4 {
  margin: 1rem 0 0.6rem;
  font-size: 1rem;
  font-weight: 600;
}

.article-wrap p,
.article-wrap li,
.article-wrap blockquote,
.article-wrap table,
.article-wrap dd {
  font-size: 1rem;
}

.article-wrap ul,
.article-wrap ol {
  margin: 0.85rem 0 1.2rem 1.35rem;
  padding: 0;
}

.article-wrap li {
  margin-bottom: 0.7rem;
  padding-left: 0.15rem;
}

.article-wrap blockquote {
  margin: 1.4rem 0;
  padding: 0.9rem 1rem;
  color: var(--site-text);
  background: var(--site-subtle);
  border: 1px solid var(--site-border);
  border-left: 3px solid #94a3b8;
  border-radius: 8px;
  font-style: normal;
}

.article-wrap blockquote p,
.article-wrap blockquote p + p {
  text-indent: 0;
}

.article-wrap table {
  width: 100%;
  border-top: 1px solid var(--site-border);
  border-bottom: 1px solid var(--site-border);
}

.article-wrap img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--site-border);
  border-radius: 12px;
  box-shadow: none;
}

img.floatpic {
  float: right;
  width: min(28%, 14rem);
  margin: 0.2rem 0 1.2rem 1.75rem;
  border: 1px solid var(--site-border);
  border-radius: 14px;
  box-shadow: none;
}

.about-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(9.5rem, 22vw, 12rem);
  gap: 1.5rem;
  align-items: start;
  margin: 0 0 2rem;
}

.about-intro__text {
  min-width: 0;
}

.about-intro__text p {
  margin: 0 0 1rem;
  text-indent: 0;
}

.about-intro__text p:last-child {
  margin-bottom: 0;
}

.about-intro__media {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}

.article-wrap .about-intro__image {
  display: block;
  width: 100%;
  max-width: 12rem;
  height: auto;
  border: 1px solid var(--site-border);
  border-radius: 18px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.profile_box {
  padding-top: 0.25rem;
}

.author__avatar {
  margin-bottom: 1rem;
}

.author__avatar img {
  display: block;
  width: 156px;
  max-width: 100%;
  height: 156px;
  object-fit: cover;
  border: 1px solid var(--site-border);
  border-radius: 999px;
  background: #fff;
}

.author__content {
  margin-bottom: 1.2rem;
}

.author__name {
  margin: 0;
  color: var(--site-text);
  font-size: 1.2rem;
  font-weight: 600;
}

.author__bio {
  margin: 0.55rem 0 0;
  color: var(--site-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.author__urls-wrapper {
  min-width: 0;
}

.author__urls {
  list-style: none;
  margin: 0;
  padding: 0;
}

.author__urls li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 0 0 0.85rem;
}

.author__urls li:last-child {
  margin-bottom: 0;
}

.author__urls-label {
  color: var(--site-muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.author__urls a,
.author__urls a:visited {
  border-bottom: 0;
  color: var(--site-text);
  text-decoration: none;
}

.author__urls a:hover,
.author__urls a:focus {
  color: var(--site-link);
}

.listing-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.listing-header h2 {
  margin: 0;
}

.listing-link,
.listing-link:visited {
  border-bottom: 0;
  color: var(--site-muted);
  font-size: 0.94rem;
  text-decoration: none;
}

.listing-link:hover,
.listing-link:focus {
  color: var(--site-text);
}

.listing-item {
  display: block;
  float: none;
  width: auto;
  margin: 0;
  padding: 1rem 0;
  border-top: 1px solid var(--site-border);
}

.listing-item:last-child {
  border-bottom: 1px solid var(--site-border);
}

.listing-item h3 {
  margin: 0 0 0.4rem;
  font-size: 1.02rem;
}

.page__meta {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--site-border);
  color: var(--site-muted);
  font-size: 0.94rem;
}

.footer_site {
  max-width: var(--site-max-width);
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
}

.footer_site p {
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--site-border);
  color: var(--site-muted);
  font-size: 0.9rem;
}

.visitor-counter {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--site-border);
  text-align: center;
}

.visitor-counter__label {
  margin: 0 0 0.8rem;
  color: var(--site-muted);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.visitor-counter__widget {
  display: flex;
  justify-content: center;
}

.visitor-counter__badge {
  display: block;
  max-width: 100%;
}

.footer_site a,
.footer_site a:visited {
  border-bottom: 0;
}

@media (max-width: 72rem) {
  #main {
    grid-template-columns: 1fr;
    gap: 1.8rem;
  }

  .sticky {
    position: static;
  }

  .profile_box {
    display: grid;
    grid-template-columns: 156px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: center;
  }

  .author__avatar,
  .author__content {
    margin-bottom: 0;
  }
}

@media (max-width: 56rem) {
  .greedy-nav {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }

  .visible-links {
    gap: 0.4rem 0.85rem;
  }

  .page__section-nav {
    position: static;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .page-section-nav__list {
    flex-wrap: nowrap;
    min-width: max-content;
  }

  .about-intro {
    grid-template-columns: 1fr;
  }

  .about-intro__media {
    justify-content: center;
  }

  .article-wrap .about-intro__image {
    max-width: min(60vw, 11rem);
  }

  img.floatpic {
    float: none;
    width: min(72vw, 14rem);
    margin: 0 0 1.25rem;
  }
}

@media (max-width: 40rem) {
  #main {
    padding-top: 1.1rem;
    padding-bottom: 2.2rem;
  }

  .profile_box {
    grid-template-columns: 1fr;
  }

  .author__avatar img {
    width: 136px;
    height: 136px;
  }

  .listing-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .page__title {
    font-size: 1.65rem;
  }
}
