/* Color tokens */
:root {
  --color-primary: #002D72;
  --color-name: #043361;
}

/* Entry table (education / experience) */
.entry-table {
  width: 100%;
  border-collapse: collapse;
  margin-left: 12px;
}
.entry-row {
  border: none;
}
.entry-logo-cell {
  width: 50px;
  border: none;
  text-align: center;
  vertical-align: middle;
  padding: 12px 20px 12px 0;
}
.entry-content-cell {
  border: none;
  vertical-align: middle;
  padding: 12px 0;
}
.entry-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 6px;
}
.entry-logo-shadow {
  box-shadow: 0 1px 6px rgba(0,0,0,0.12);
}

/* Publication item layout */
.pub-item-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}
.pub-image-box {
  width: 200px;
  min-width: 200px;
  height: 130px;
  overflow: hidden;
  position: relative;
  margin-right: 16px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.04), 2px 3px 8px rgba(0,0,0,0.14);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.pub-image-box:hover {
  transform: scale(1.06);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.06), 4px 6px 16px rgba(0,0,0,0.22);
}
.pub-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 1;
  background-color: var(--color-primary);
  color: #fff;
}
.pub-image {
  width: 200px;
  height: 130px;
  object-fit: contain;
  display: block;
  cursor: zoom-in;
  /* Set per entry with `image_scale` (a percentage) in publications.yml.
     A figure whose aspect ratio nearly matches the 200x130 box gets no
     letterboxing from object-fit: contain and fills it edge to edge, so
     scaling it down leaves a proportional margin on all four sides.
     Scaling each axis separately keeps that margin even. */
  transform: scale(var(--pub-image-scale, 1));
}
.pub-text {
  flex: 1;
  min-width: 0;
}
.pub-links {
  margin-top: 4px;
}
.btn.btn-sm.z-depth-0 {
  font-size: 12px;
}
.pub-note {
  color: #e74d3c;
}
.pub-tags {
  display: inline;
  margin-left: 6px;
}
.pub-tag {
  display: inline-block;
  padding: 1px 6px;
  margin-right: 3px;
  border-radius: 4px;
  font-size: 10px;
  line-height: 1.4;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.pub-tag-blue    { background-color: #e3f0fd; color: #1f5b9c; border-color: #cfe2f7; }
.pub-tag-green   { background-color: #e6f4e6; color: #2e6b2e; border-color: #d2e8d2; }
.pub-tag-purple  { background-color: #ece0fb; color: #5a3a8e; border-color: #ddcaf1; }
.pub-tag-orange  { background-color: #fde9d4; color: #8b4a13; border-color: #f6d6b3; }
.pub-tag-pink    { background-color: #fce0eb; color: #8b2c5a; border-color: #f4c9d8; }
.pub-tag-teal    { background-color: #d6f0ec; color: #2a6b66; border-color: #bfe3dd; }
.pub-tag-default { background-color: #eeeeee; color: #555;    border-color: #dddddd; }
.author-self {
  font-weight: 550;
}

/* Section headings (publications, presentations) */
.pub-section-heading {
  margin: 2px 0 -15px;
}
.pub-section-heading a {
  color: inherit;
  text-decoration: none;
}

/* Presentation items */
.publications ol.bibliography li[data-pres-index] {
  min-height: 0;
  margin-bottom: 0.25rem;
}
.pres-item {
  margin-bottom: 0.75rem;
}
/* Location and date sit on their own line below the venue */
.pres-meta {
  margin-top: 0.1rem;
}
/* Titles read as plain bold body text, matching the Services / Honors entries */
.pres-item .title {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}

/* Honors list */
.honors-list {
  padding-left: 1.2em;
}
.honors-detail {
  color: #595959;
  font-size: 0.9rem;
}

/* Sidebar */
.name-chinese {
  font-size: 1.3rem;
  margin: -0.5em 0 0.5em;
  color: var(--color-name);
  font-weight: 700;
  font-family: 'Songti SC', 'STSong', 'SimSun', serif;
}
.name-chinese-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  margin-left: 8px;
  vertical-align: middle;
  color: var(--color-name);
  font-size: 1.1rem;
}
.social-icons,
.cv-container {
  display: flex;
  justify-content: center;
}
.social-icons {
  flex-wrap: nowrap;
}
.cv-container {
  margin-top: 8px;
}
.site-footnote {
  text-align: right;
  font-size: 0.58rem;
  color: #d8d8d8;
  margin: 0;
}
.site-footnote a {
  color: #d8d8d8;
}

/* Publications TLDR */
.pub-tldr-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.3s ease, opacity 0.25s ease, margin-top 0.25s ease;
  opacity: 0;
  margin-top: 0;
}

.pub-tldr-body.pub-tldr-open {
  grid-template-rows: 1fr;
  opacity: 1;
  margin-top: 6px;
}

.pub-tldr-content {
  min-height: 0;
  overflow: hidden;
  font-size: 13px;
  color: #555;
  line-height: 1.6;
  padding: 8px 10px;
  background: #f5f7fa;
  border-left: 3px solid var(--color-primary);
  border-radius: 0 4px 4px 0;
}

.pub-tldr-source {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.pub-tldr-source a {
  color: var(--color-primary);
  text-decoration: none;
}

.pub-tldr-source a:hover {
  text-decoration: none;
  opacity: 0.75;
}

.pub-tldr-btn-active {
  background: var(--color-primary) !important;
  color: #fff !important;
  border-color: var(--color-primary) !important;
}

/* Publications pagination */
.pub-pagination {
  display: flex;
  gap: 3px;
  margin-top: -0.25rem;
  margin-bottom: 1rem;
}

.pub-page-btn {
  min-width: 22px;
  height: 22px;
  padding: 0 4px;
  border: 1px solid #d0d7de;
  background: #fff;
  color: var(--color-primary);
  font-size: 11px;
  cursor: pointer;
  border-radius: 3px;
  line-height: 1;
}

.pub-page-btn:hover:not(:disabled) {
  background: #f0f4fa;
}

.pub-page-btn:disabled {
  color: #aaa;
  cursor: default;
}

.pub-page-btn.pub-page-active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  font-weight: 600;
}

/* Inline school logo */
.inline-school-logo {
  height: 1.1em;
  width: auto;
  vertical-align: -0.15em;
  margin-right: 3px;
}

/* Emoji bounce row */
@keyframes emoji-jump {
  0%, 70%, 100% { transform: translateY(0); }
  35%            { transform: translateY(-7px); }
}

.emoji-bounce-row {
  display: inline-flex;
  gap: 3px;
  vertical-align: middle;
  line-height: 1;
}

.emoji-bounce {
  display: inline-block;
  animation: emoji-jump 3s ease-in-out infinite;
  font-size: 1.05em;
}

.publications ol.bibliography li .author,
.publications ol.bibliography li .periodical {
  font-size: 14px;
}

.social-icons a {
  padding: 0 0px !important;
  margin: 0 -3px !important;
}

/* Education card hover effect
   Default: slide-down. Add data-effect="flip" on .edu-flip-card for 3-D flip. */
.edu-flip-card {
  max-width: 60%;
}

.edu-flip-inner {
  position: relative;
  width: 100%;
}

/* --- Slide-down (default) --- */
.edu-flip-back {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  display: flex;
  flex-direction: column;
  font-size: 0.88rem;
  color: inherit;
  line-height: 1.6;
  overflow-wrap: break-word;
  word-break: break-word;
  transition: max-height 0.4s ease, opacity 0.35s ease, padding-top 0.3s ease;
  padding-top: 0;
}

.edu-flip-card:not([data-effect="flip"]):not([data-flip="disabled"]):hover .edu-flip-back {
  max-height: 300px;
  opacity: 1;
  padding-top: 6px;
}

/* --- Flip (data-effect="flip") --- */
.edu-flip-card[data-effect="flip"] {
  perspective: 800px;
}

.edu-flip-card[data-effect="flip"] .edu-flip-inner {
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.edu-flip-card[data-effect="flip"]:hover .edu-flip-inner {
  transform: rotateY(180deg);
}

.edu-flip-card[data-effect="flip"] .edu-flip-front {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.edu-flip-card[data-effect="flip"] .edu-flip-back {
  position: absolute;
  inset: 0;
  max-height: none;
  overflow: visible;
  opacity: 1;
  margin-top: 0;
  transform: rotateY(180deg);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: none;
  justify-content: center;
}

/* --- Shared --- */
.edu-flip-back > span {
  display: block;
  white-space: normal;
}

.edu-flip-back .edu-back-label {
  font-weight: 600;
}

.edu-flip-front p,
.edu-flip-back p {
  margin: 0;
}

/* Consistent inter-section spacing */
section table tr:last-child td {
  padding-bottom: 0 !important;
}
.publications ol.bibliography li:last-child {
  min-height: 0 !important;
}
.publications ol.bibliography li:last-child > div {
  margin-bottom: 0 !important;
}

/* CV pill badge */
.cv-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 10px;
  border: 1.5px solid var(--color-primary);
  border-radius: 4px;
  font-size: 0.82em;
  color: var(--color-primary);
  background: transparent;
  text-decoration: none;
  vertical-align: middle;
  transition: background 0.18s ease, color 0.18s ease;
  white-space: nowrap;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.4;
}

.cv-pill:hover,
.cv-pill[aria-pressed="true"] {
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
}

/* CV embed */
#cv-content {
  display: flex;
  flex-direction: column;
}
#cv-content[hidden] {
  display: none;
}
#cv-frame {
  width: 100%;
  height: calc(100vh - 80px);
  min-height: 600px;
  border: 1px solid #e2e2e2;
  border-radius: 6px;
  background: #fafafa;
}
.cv-fallback {
  margin: 0 0 6px;
  font-size: 0.75rem;
  color: #888;
  text-align: right;
}

/* Wider layout - desktop only */
@media screen and (min-width: 961px) {
  .wrapper {
    width: 1050px;
  }

  section {
    width: 760px;
  }

}

.email-link{font-size:13px;overflow-wrap:anywhere}.figure-controls{position:absolute;bottom:4px;right:4px;display:flex;gap:4px}.figure-controls button{background:#fff;border:1px solid #002d72;border-radius:3px;color:#002d72;cursor:pointer;font-size:11px;min-width:24px;min-height:24px}.figure-controls button[aria-pressed="true"]{background:#002d72;color:#fff}.pub-image{cursor:zoom-in}@media(max-width:600px){.pub-item-row{flex-direction:column;gap:14px}.pub-image-box{max-width:100%}.entry-table{margin-left:0}}

/* Keep transparent technical figures legible, including when enlarged. */
.pub-image-box { background: #fff; }
#lightbox-img { background: #fff; }
.news-short { line-height: 1.65; }


.pub-context { font-size: 13px; line-height: 1.5; margin-top: 5px; color: #555; }

/* A simple dated list, following zhangjiashuo.cn's News structure. */
.news-list { padding-left: 22px; margin: 0 0 28px; }
.news-list li { margin: 0 0 12px; line-height: 1.65; }
.news-month { font-weight: 600; white-space: nowrap; }
/* Override inherited padding and size the original high-resolution image directly. */
.image.avatar { display: block; width: 180px; height: 180px; margin: 0 auto 22px; overflow: hidden; border-radius: 50%; }
.image.avatar #avatar-img { display: block; width: 180px; height: 180px; max-width: none; padding: 0; margin: 0; object-fit: cover; object-position: 50% 42%; transform: none; border-radius: 50%; image-rendering: auto; }
.education-entry { display: flex; align-items: center; gap: 20px; margin: 0 0 24px; }
.school-mark { flex: 0 0 60px; }
.school-mark img { display: block; width: 60px; height: 60px; object-fit: contain; }
.education-copy { min-width: 0; line-height: 1.6; }
.entry-meta { color: #666; }
.work-entry { line-height: 1.6; margin-bottom: 20px; }
@media (max-width: 480px) { .education-entry { gap: 14px; } .school-mark { flex-basis: 48px; } .school-mark img { width: 48px; height: 48px; } }

/* Keep each company wordmark intact beside the position. */
.work-entry { display: flex; align-items: center; gap: 20px; }
.company-mark { flex: 0 0 100px; }
.company-mark img { display: block; width: 100px; height: 60px; object-fit: contain; }
.work-copy { min-width: 0; }
@media (max-width: 480px) { .work-entry { gap: 14px; } .company-mark { flex-basis: 80px; } .company-mark img { width: 80px; height: 48px; } }

