:root {
  --ink: #263238;
  --muted: #60706f;
  --accent: #0f766e;
  --accent-dark: #0b5d56;
  --rule: #d9e1de;
  --soft: #f5f8f7;
}

html {
  overflow-y: scroll;
}

body {
  background: #fbfcfb;
  color: var(--ink);
  font-family: "Avenir Next", Avenir, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.62;
}

h1,
h2,
h3 {
  color: #173f3a;
  font-weight: 650;
}

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

a:hover {
  text-decoration: underline;
}

.wrapper {
  width: 920px;
}

header {
  color: var(--muted);
  font-size: 14px;
  width: 235px;
}

header h1 {
  color: #103b36;
  font-size: 26px;
  margin-bottom: 4px;
}

header h3 {
  border-top: 1px solid var(--rule);
  font-size: 15px;
  margin: 0;
}

header h3 a {
  color: var(--ink);
  display: block;
  padding: 7px 0;
}

header h3 a:hover {
  color: var(--accent-dark);
  text-decoration: none;
}

.site-nav {
  background: #ffffff;
  border: 1px solid #dfe7e4;
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(38, 50, 56, 0.055);
  box-sizing: border-box;
  margin: 16px 0 20px;
  padding: 13px 15px 15px;
  width: 214px;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
}

.site-nav a:hover {
  color: #102a56;
  text-decoration: none;
}

.site-nav .nav-link {
  border-radius: 6px;
  box-sizing: border-box;
  display: block;
  font-size: 14px;
  line-height: 1.25;
  margin: 1px 0;
  padding: 5px 8px;
}

.site-nav .nav-link.active {
  background: #edf3f7;
  color: #103b36;
  font-weight: 700;
}

.nav-group {
  margin-top: 15px;
}

.nav-heading {
  border-bottom: 1px solid var(--rule);
  color: #263238;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  margin-bottom: 7px;
  padding: 0 0 7px;
  text-transform: uppercase;
}

section {
  border-left: 1px solid var(--rule);
  box-sizing: border-box;
  margin-left: 0;
  padding-left: 38px;
  width: 649px;
}

section.teaching-section {
  margin-top: 0;
}

.gray-line {
  border-top: 1px solid var(--rule);
  margin: -8px 0 16px;
}

.justified-text {
  text-align: justify;
}

.social-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  justify-content: flex-start;
  margin-top: 6px;
}

.profile-block {
  align-items: start;
  border-bottom: 1px solid var(--rule);
  display: grid;
  gap: 32px;
  grid-template-columns: 180px minmax(0, 1fr);
  margin: 0 0 30px;
  padding-bottom: 28px;
}

.profile-photo {
  border: 1px solid var(--rule);
  border-radius: 4px;
  width: 180px;
}

.profile-affiliation {
  line-height: 1.5;
  padding-top: 2px;
}

.official-profile {
  color: #173f3a;
  font-size: 26px;
  font-weight: 750;
  line-height: 1.15;
  margin-bottom: 14px;
}

.profile-title,
.profile-contact {
  margin: 0;
}

.profile-title {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
}

.profile-contact {
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin-top: 13px;
  padding-top: 12px;
}

.homepage-social {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
  max-width: 430px;
}

.homepage-social a {
  align-items: center;
  background: var(--soft);
  border: 1px solid var(--rule);
  border-radius: 5px;
  color: var(--accent-dark);
  display: inline-flex;
  font-size: 13px;
  font-weight: 650;
  gap: 5px;
  line-height: 1;
  padding: 6px 9px;
  text-decoration: none;
  white-space: nowrap;
}

.homepage-social a:hover {
  background: #eaf2ef;
  color: var(--accent-dark);
  text-decoration: none;
}

.homepage-social i {
  font-size: 14px;
  line-height: 1;
}
.research-theme-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 8px 0 28px;
}

.research-theme {
  background: #ffffff;
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 14px 15px;
}

.research-theme strong {
  color: #173f3a;
  display: block;
  font-size: 15px;
  line-height: 1.25;
  margin-bottom: 7px;
}

.research-theme span {
  color: var(--muted);
  display: block;
  font-size: 13px;
  line-height: 1.45;
}

.pub-tag {
  background: var(--soft);
  border-color: var(--rule);
  color: var(--accent-dark);
}

.pub-tag:hover {
  background: #eaf2ef;
}

.person-card {
  background: #ffffff;
  border-color: var(--rule);
  border-radius: 4px;
}

.person-photo,
.avatar-placeholder {
  box-shadow: inset 0 0 0 1px rgba(38, 50, 56, 0.08);
  flex: 0 0 auto;
}

.avatar-placeholder {
  background: linear-gradient(180deg, #f4f6f5 0%, #e9eeec 100%);
  border: 1px solid var(--rule);
  border-radius: 50%;
  height: 110px;
  overflow: hidden;
  position: relative;
  width: 110px;
}

.avatar-placeholder::before {
  background: #8d9391;
  border-radius: 50%;
  content: "";
  height: 48px;
  left: 31px;
  position: absolute;
  top: 17px;
  width: 48px;
}

.avatar-placeholder::after {
  background: #8d9391;
  border-radius: 54% 54% 18% 18%;
  bottom: -8px;
  content: "";
  height: 52px;
  left: 18px;
  position: absolute;
  width: 74px;
}

.person-name,
.former-name,
.award-main,
.service-card b,
.course-title {
  color: #173f3a;
}

.award-item {
  border-bottom-color: var(--rule);
}

.award-year,
.service-meta,
.course-meta {
  color: var(--muted);
}

.student-award-list {
  margin: 6px 0 0;
  padding-left: 18px;
}

.student-award-list li {
  margin-bottom: 3px;
}

.service-card {
  background: #ffffff;
  border-color: var(--rule);
  border-radius: 4px;
}

.pdf-box {
  background: #ffffff;
  border-color: var(--rule);
}

.zhihu-tech-card {
  background: #ffffff;
  border-left-color: var(--accent);
}

.calendar-fullwidth {
  margin-left: 0;
}

.calendar-fullwidth iframe {
  max-width: 100%;
  min-width: 0;
}

.calendar-status {
  color: var(--muted);
  min-height: 22px;
  margin: 10px 0;
}

.availability-calendar {
  margin-top: 22px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  overflow: hidden;
}

.calendar-toolbar {
  align-items: center;
  background: #eef3f5;
  border-bottom: 1px solid var(--rule);
  display: flex;
  gap: 14px;
  justify-content: flex-start;
  padding: 8px 10px;
}

.calendar-nav {
  align-items: center;
  display: flex;
  gap: 6px;
}

.calendar-nav button {
  background: transparent;
  border: 0;
  border-radius: 3px;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  line-height: 1;
  padding: 5px 8px;
}

.calendar-nav button:hover {
  background: #dde6ea;
}

.calendar-title {
  color: var(--ink);
  font-size: 1.05em;
  font-weight: 650;
}

.calendar-week {
  background: #ffffff;
  max-height: 680px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-color: #aeb9b6 #eef3f5;
}

.calendar-week {
  display: grid;
  grid-template-columns: 58px repeat(7, minmax(0, 1fr));
}

.calendar-corner {
  background: #ffffff;
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 4;
}

.calendar-day-header {
  background: #ffffff;
  border-bottom: 1px solid var(--rule);
  color: #3f4846;
  min-height: 70px;
  padding-top: 9px;
  position: sticky;
  top: 0;
  text-align: center;
  z-index: 3;
}

.calendar-day-header span {
  display: block;
  font-size: 0.7em;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.calendar-day-header strong {
  display: inline-grid;
  font-size: 1.55em;
  font-weight: 500;
  height: 42px;
  margin-top: 4px;
  place-items: center;
  width: 42px;
}

.calendar-day-header.is-today span {
  color: #1d5fd1;
}

.calendar-day-header.is-today strong {
  background: #1d5fd1;
  border-radius: 50%;
  color: #ffffff;
}

.calendar-grid-body {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 58px repeat(7, minmax(0, 1fr));
  grid-template-rows: repeat(24, 34px);
  position: relative;
}

.calendar-grid-body::before {
  background-image: repeating-linear-gradient(
    to bottom,
    var(--rule) 0,
    var(--rule) 1px,
    transparent 1px,
    transparent 34px
  );
  content: "";
  grid-column: 2 / -1;
  grid-row: 1 / -1;
  pointer-events: none;
}

.calendar-hour-label {
  border-right: 1px solid var(--rule);
  color: #3f4846;
  font-size: 0.72em;
  padding-right: 8px;
  padding-top: 3px;
  text-align: right;
}

.calendar-day-column {
  border-right: 1px solid var(--rule);
  grid-row: 1 / -1;
  min-width: 0;
}

.calendar-day-column:last-of-type {
  border-right: 0;
}

.calendar-busy-block {
  align-items: center;
  background: #d84235;
  border-radius: 5px;
  box-shadow: 0 1px 3px rgba(94, 37, 31, 0.18);
  color: #ffffff;
  display: flex;
  font-size: 0.72em;
  font-weight: 700;
  left: 8px;
  overflow: hidden;
  padding: 0 8px;
  position: absolute;
  right: 8px;
}

.calendar-busy-block.is-tentative {
  background: #d89a2b;
}

.calendar-busy-block span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-footer {
  align-items: center;
  background: #eef3f5;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  display: flex;
  font-size: 0.85em;
  justify-content: space-between;
  padding: 5px 10px 8px;
}

.teaching-section,
.tech-notes {
  margin-left: 0;
  margin-right: 0;
}

.teaching-intro {
  max-width: none;
}

.teaching-grid {
  grid-template-columns: 1fr;
  gap: 14px;
  width: 100%;
}

.course-tile {
  border-color: var(--rule);
  border-radius: 4px;
  box-sizing: border-box;
  min-width: 0;
  padding: 16px 18px;
}

.course-code,
.resource-link {
  color: var(--accent-dark);
}

.resource-link {
  border-color: var(--rule);
  border-radius: 4px;
}

.resource-link:hover {
  background: #eaf2ef;
  border-color: var(--rule);
}

@media print, screen and (max-width: 960px) {
  .wrapper {
    width: auto;
  }

  header {
    padding-right: 0;
    width: auto;
  }

  .site-nav {
    width: 100%;
  }

  .site-nav .nav-link {
    padding: 7px 9px;
  }

  .profile-block {
    gap: 24px;
    grid-template-columns: 160px minmax(0, 1fr);
  }

  .profile-photo {
    width: 160px;
  }

  .research-theme-grid {
    grid-template-columns: 1fr;
  }

  section {
    border-left: 0;
    margin-left: 0;
    padding-left: 0;
    width: auto;
  }

  .calendar-week {
    grid-template-columns: 44px repeat(7, minmax(42px, 1fr));
    max-height: 620px;
    overflow-x: auto;
  }

  .calendar-grid-body {
    grid-template-columns: 44px repeat(7, minmax(42px, 1fr));
  }

  .calendar-day-header strong {
    font-size: 1.4em;
    height: 38px;
    width: 38px;
  }

  .calendar-hour-label {
    font-size: 0.7em;
    padding-right: 5px;
  }

  .calendar-busy-block {
    left: 3px;
    right: 3px;
  }

  .calendar-busy-block span {
    display: none;
  }

  .calendar-event {
    grid-template-columns: 1fr;
  }

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

@media print, screen and (max-width: 600px) {
  .profile-block {
    grid-template-columns: 1fr;
  }

  body {
    padding: 22px;
  }

  .justified-text {
    text-align: left;
  }
}
