@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/fonts/ibm-plex-mono-medium.woff2") format("woff2");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

:root {
  color-scheme: only light;
  --paper: #fbfaf7;
  --paper-strong: #ffffff;
  --ink: #20242a;
  --ink-soft: #3f4650;
  --muted: #737b85;
  --line: #dad7cf;
  --accent: #1f6f68;
  --accent-2: #376f91;
  --accent-3: #174f4a;
  --shadow: none;
  --header-offset: 74px;
  --font-display: "Fraunces", "Noto Sans SC", "Iowan Old Style", serif;
  --font-sans: "IBM Plex Sans", "Noto Sans SC", "Gill Sans", sans-serif;
  --font-mono: "IBM Plex Mono", "Noto Sans SC", "Courier New", monospace;
  --font-hero-zh: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Heiti SC", sans-serif;
  --news-list-max-height: 455px;
  --skeleton: #e2e1dc;
}

html {
  scroll-padding-top: var(--header-offset);
  overflow-x: clip;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: clip;
}

body.lang-zh [data-lang="en"],
body.lang-en [data-lang="zh"] {
  display: none !important;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent-3);
}

img {
  max-width: 100%;
  display: block;
}

::selection {
  background: rgba(46, 108, 183, 0.28);
}

.site-header {
  width: 100%;
  padding: 10px clamp(18px, 6vw, 72px);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 250, 247, 0.96);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.site-nav {
  display: flex;
  gap: 22px;
  font-size: 0.9rem;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}

.site-nav a {
  position: relative;
  padding: 8px 0;
  font-weight: 500;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}

.site-nav a::before {
  display: none;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 0;
  height: 2px;
  border-radius: 999px;
  background: var(--accent);
  transform: translateX(-50%);
  transition: width 0.25s ease;
}

.site-nav a:hover {
  color: var(--accent-3);
}

.site-nav a:hover::after {
  width: 100%;
}

.site-nav a.is-active {
  color: var(--accent-3);
}

.site-nav a.is-active::after {
  width: 100%;
}

.site-nav a.is-active::before {
  display: none;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}

.lang-toggle {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper-strong);
  overflow: hidden;
  box-shadow: none;
}

.lang-button {
  border: none;
  background: transparent;
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  cursor: pointer;
  color: var(--muted);
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.lang-button:hover {
  color: var(--ink);
}

.lang-button.is-active {
  background: var(--ink);
  color: var(--paper);
  box-shadow: none;
}

main {
  max-width: 1640px;
  margin: 0 auto;
  padding: 38px clamp(20px, 2.5vw, 44px) 96px;
}

.page-shell {
  display: grid;
  grid-template-columns: 184px minmax(0, 920px) 360px;
  column-gap: clamp(28px, 3.2vw, 52px);
  justify-content: center;
  align-items: start;
}

.profile-sidebar {
  position: sticky;
  top: calc(var(--header-offset) + 24px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.widget-sidebar {
  position: sticky;
  top: calc(var(--header-offset) + 24px);
  min-width: 0;
}

.widget-card-wrap {
  position: relative;
  width: 100%;
  max-width: 360px;
  min-height: 764px;
}

.tokenflow-sidebar-frame {
  width: 100%;
  height: 764px;
  border: 0;
  display: block;
  background: transparent;
}

.sidebar-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-link {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 7px 10px;
  margin: 0 -10px;
  border-radius: 7px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  transition: background 0.18s ease, color 0.18s ease;
}

.sidebar-link .button-icon {
  width: 1.05rem;
  height: 1.05rem;
  opacity: 0.85;
  color: var(--ink);
  flex-shrink: 0;
  transition: color 0.18s ease, opacity 0.18s ease;
}

.sidebar-link:hover,
.sidebar-link:focus-visible {
  background: rgba(31, 111, 104, 0.08);
  color: var(--accent-3);
  outline: none;
}

.sidebar-link:hover .button-icon,
.sidebar-link:focus-visible .button-icon {
  color: var(--accent-3);
  opacity: 1;
}

.page-content {
  min-width: 0;
}

main [id] {
  scroll-margin-top: var(--header-offset);
}

.hero {
  padding: 0 0 28px;
  border-bottom: 1px solid var(--line);
}

.profile-block {
  margin-bottom: 18px;
}

.profile-name {
  font-size: clamp(1.9rem, 3vw, 2.55rem);
  line-height: 1.12;
  margin: 0 0 8px;
  letter-spacing: 0.02em;
  color: #243449;
}

.profile-name[data-lang="en"] {
  font-size: clamp(1.52rem, 2.4vw, 2.15rem);
}

.profile-name[data-lang="zh"] {
  font-family: var(--font-hero-zh);
}

.profile-name[data-lang="en"] {
  font-family: var(--font-display);
  letter-spacing: 0.04em;
}

.profile-summary {
  margin: 0 0 12px;
  color: var(--ink-soft);
  font-size: 1rem;
}

.profile-summary:last-child {
  margin-bottom: 0;
}

.profile-summary strong {
  color: var(--ink);
  font-weight: 600;
}

.profile-summary a {
  color: var(--accent);
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 1px solid rgba(31, 111, 104, 0.34);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.profile-summary a:hover {
  color: var(--accent-3);
  border-bottom-color: rgba(23, 79, 74, 0.65);
}

.profile-alert {
  color: #c31f24;
  font-weight: 600;
}

.profile-email {
  margin: 6px 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.profile-email a {
  color: var(--ink-soft);
  font-weight: 500;
}

.profile-email a:hover {
  color: var(--accent);
}

.hero-actions {
  margin: 16px 0 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  gap: 8px;
  border: 1px solid var(--line);
  transition: border-color 0.2s ease, color 0.2s ease;
}

.button-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05em;
  height: 1.05em;
  opacity: 0.78;
}

.button-icon svg {
  width: 1.05em;
  height: 1.05em;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.button.primary {
  background: var(--ink);
  color: var(--paper-strong);
  border-color: var(--ink);
}

.button.ghost {
  background: var(--paper-strong);
}

.button:hover {
  border-color: var(--accent);
  color: var(--accent-3);
}

.button.primary:hover {
  background: var(--accent-3);
  border-color: var(--accent-3);
  color: var(--paper-strong);
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 16px;
}

.hero-meta strong {
  display: block;
  font-weight: 600;
  margin-top: 6px;
}

.label {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  font-size: 0.7rem;
  color: var(--muted);
}

.experiences-card {
  border-radius: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  box-shadow: none;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-height: none;
}

.experiences-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.experience-list {
  container: experiences / inline-size;
  display: grid;
  overflow-y: visible;
  padding-right: 0;
  min-height: 0;
  flex: 1;
  scrollbar-color: rgba(31, 31, 27, 0.3) transparent;
}

.experience-list::-webkit-scrollbar {
  width: 6px;
}

.experience-list::-webkit-scrollbar-thumb {
  background: rgba(31, 31, 27, 0.2);
  border-radius: 999px;
}

.experience-logo {
  display: block;
  justify-self: center;
  height: var(--logo-height);
  width: auto;
}

.experience-logo[data-shape="round"] {
  border-radius: 50%;
}

.experience-item {
  --date-width: 131px;
  --line-height: 22px;
  --line-gap: 5px;
  --logo-height: calc(2 * var(--line-height) + var(--line-gap));
  display: grid;
  grid-template-columns: var(--date-width) calc(var(--logo-height) * 1.55) minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.experience-item:last-child {
  border-bottom: none;
}

.experience-date {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.45;
  letter-spacing: 0.025em;
  color: var(--ink-soft);
}

.experience-detail {
  min-width: 0;
  display: grid;
  gap: var(--line-gap);
  color: var(--ink-soft);
  font-size: 15px;
  line-height: var(--line-height);
  overflow-wrap: break-word;
}

.experience-detail strong {
  color: var(--ink);
  font-weight: 500;
}

.experience-detail strong a {
  color: inherit;
  border-bottom: 1px solid rgba(31, 111, 104, 0.32);
  transition: color 0.2s ease, border-color 0.2s ease;
}

.experience-detail strong a:hover {
  color: var(--accent-3);
  border-bottom-color: rgba(23, 79, 74, 0.65);
}

.experience-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 9px;
}

.experience-role {
  font-weight: 600;
  color: var(--accent-3);
  font-size: 0.96em;
}

.experience-meta {
  color: var(--ink-soft);
}

@container experiences (max-width: 510px) {
  .experience-item {
    --date-width: 58px;
    --line-height: 20px;
    --line-gap: 3px;
    gap: 8px;
  }

  .experience-date {
    font-size: 11px;
    letter-spacing: 0;
  }

  .experience-detail {
    font-size: 14px;
  }

  .experience-head {
    column-gap: 6px;
  }
}

.hero-aside {
  display: grid;
  gap: 20px;
}

.experiences-section {
  margin: 34px 0 24px;
}

.service-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  width: 100%;
}

.service-card {
  border-radius: 0;
  border: none;
  background: transparent;
  padding: 0 0 4px;
  display: grid;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.service-card::before {
  display: none;
}

.service-card > * {
  position: relative;
  z-index: 1;
}

.service-card-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.service-role {
  font-family: var(--font-display);
  font-size: 1.08rem;
  letter-spacing: 0.04em;
  color: var(--accent-3);
  text-transform: none;
  padding: 0;
}

[data-lang="zh"] .service-role {
  font-family: var(--font-hero-zh);
}

.service-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 22px 40px;
}

.service-group {
  border-radius: 0;
  border: none;
  background: transparent;
  padding: 0;
  display: grid;
  align-self: start;
  align-content: start;
  gap: 12px;
}

.service-group + .service-group {
  padding-top: 0;
  border-top: none;
}

.service-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.service-group-label {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--ink-soft);
}

.service-chips {
  list-style: disc;
  margin: 0;
  padding-left: 1.1rem;
  display: grid;
  gap: 5px;
}

.service-chip {
  display: list-item;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink);
}

.service-chip-name {
  font-weight: 600;
}

.service-chip-year {
  font-family: var(--font-sans);
  font-size: 0.86rem;
  letter-spacing: 0;
  color: var(--muted);
  background: transparent;
  border-radius: 0;
  padding: 0;
}

.service-chip-note {
  font-size: 0.82rem;
  color: #b3232a;
  background: transparent;
  border-radius: 0;
  padding: 0;
  white-space: nowrap;
}

.contact-grid {
  display: grid;
  width: 100%;
}

.contact-card {
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--paper-strong);
  padding: 20px 22px;
  box-shadow: none;
  display: grid;
  gap: 14px;
}

.contact-lead {
  margin: 0;
  font-weight: 600;
  color: var(--ink);
}

.contact-email {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  color: var(--accent-3);
}

.contact-form {
  display: grid;
  gap: 12px;
}

.contact-field {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.contact-field input,
.contact-field textarea {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(29, 42, 58, 0.2);
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
}

.contact-field input::placeholder,
.contact-field textarea::placeholder {
  color: var(--muted);
}

.contact-field input:focus,
.contact-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30, 95, 168, 0.15);
}

.contact-button {
  justify-self: flex-start;
}

.portrait-card {
  background: transparent;
  border: none;
  padding: 0;
  box-shadow: none;
  display: grid;
  gap: 0;
  max-width: 184px;
  width: 100%;
  justify-self: start;
}

.portrait-frame {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0;
  overflow: hidden;
  position: relative;
  box-shadow: none;
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}

.hero-news {
  padding: 0;
}

.hero-news {
  margin-top: 28px;
}

.news-list {
  --news-fade-top: 18px;
  --news-fade-bottom: 52px;
  display: grid;
  gap: 8px;
  max-height: var(--news-list-max-height);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 8px 28px 0;
  scrollbar-color: rgba(31, 31, 27, 0.3) transparent;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0,
    #000 var(--news-fade-top),
    #000 calc(100% - var(--news-fade-bottom)),
    transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0,
    #000 var(--news-fade-top),
    #000 calc(100% - var(--news-fade-bottom)),
    transparent 100%
  );
}

.news-list::-webkit-scrollbar {
  width: 6px;
}

.news-list::-webkit-scrollbar-thumb {
  background: rgba(31, 31, 27, 0.25);
  border-radius: 999px;
}

.news-item {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 14px;
  padding: 7px 0 10px;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.news-item:last-child {
  border-bottom: none;
}

.news-date {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--muted);
}

.news-text {
  margin: 0;
  font-weight: 400;
}

.news-author-role {
  color: var(--accent-2);
  font-weight: 500;
}

.news-paper-title {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
  background-color: transparent;
  color: var(--ink);
}

.news-venue {
  display: inline;
  color: #c0392b;
  font-weight: 600;
}

.news-link {
  color: var(--accent-2);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(30, 95, 168, 0.35);
}

.news-link:hover {
  color: var(--accent-3);
  border-bottom-color: rgba(24, 74, 122, 0.5);
}


.section {
  padding: 30px 0 4px;
  border-bottom: 1px solid var(--line);
}

.section-header {
  margin-bottom: 16px;
  max-width: 680px;
}

.section-header h2 {
  margin: 0;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.55rem, 2.2vw, 2rem);
  margin: 0;
  color: #243449;
}

body.lang-en .section-title {
  font-size: clamp(1.35rem, 1.9vw, 1.72rem);
}

.pub-page {
  padding-top: 12px;
}

.project-page {
  padding-top: 12px;
}

.project-section {
  padding-top: 24px;
}

.project-page .project-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.page-hero {
  padding: 6px 0 26px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}

.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 4.5vw, 3.8rem);
  letter-spacing: 0.04em;
}

body.lang-en .page-title {
  font-size: clamp(2rem, 3.6vw, 3.04rem);
}

.page-title[data-lang="zh"] {
  font-family: var(--font-hero-zh);
  letter-spacing: 0.02em;
}

.page-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.pub-groups {
  display: grid;
  gap: 32px;
}

[data-publications-page] {
  display: grid;
  gap: 32px;
}

.pub-year-block {
  display: grid;
  grid-template-columns: minmax(90px, 150px) minmax(0, 1fr);
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.pub-year-block:last-child {
  border-bottom: none;
}

.pub-year {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  color: var(--accent-2);
  letter-spacing: 0.04em;
}

.pub-entry-list {
  display: grid;
  gap: 16px;
}

.pub-entry {
  padding: 16px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 220px);
  gap: 18px;
  border: none;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  align-items: center;
  transition: color 0.2s ease;
}

.pub-entry:hover {
  color: var(--accent-3);
}

.pub-entry.is-clickable {
  cursor: pointer;
}


.pub-entry-content {
  display: grid;
  gap: 8px;
}

.pub-entry-media {
  border-radius: 8px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(30, 95, 168, 0.16), rgba(42, 127, 160, 0.12)),
    repeating-linear-gradient(
      135deg,
      rgba(31, 31, 27, 0.08) 0,
      rgba(31, 31, 27, 0.08) 6px,
      transparent 6px,
      transparent 12px
    );
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.pub-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.12rem;
  line-height: 1.4;
}

[data-publications-page="en"] .pub-title,
[data-lang="en"] .pub-title {
  font-family: var(--font-sans);
}

.pub-title a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.pub-title a:hover {
  color: var(--accent-3);
}

.pub-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.pub-link-chip {
  appearance: none;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(31, 31, 27, 0.25);
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink-soft);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.pub-link-chip:hover {
  transform: translateY(-1px);
  border-color: var(--accent-2);
  color: var(--accent-2);
}

.pub-timeline {
  position: relative;
}

.timeline-track {
  position: relative;
  display: grid;
  grid-auto-flow: row;
  grid-template-columns: 1fr;
  gap: 0;
  overflow: visible;
  padding: 0;
  scroll-snap-type: none;
  scrollbar-color: auto;
  cursor: default;
  z-index: 1;
}

.timeline-track::-webkit-scrollbar {
  height: 8px;
}

.timeline-track::-webkit-scrollbar-thumb {
  background: rgba(31, 31, 27, 0.25);
  border-radius: 999px;
}

.timeline-card {
  scroll-snap-align: none;
  background: transparent;
  border: none;
  border-top: 1px solid var(--line);
  border-radius: 0;
  padding: 20px 0;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 9px 22px;
  box-shadow: none;
  position: relative;
  z-index: 1;
  transition: color 0.2s ease;
}

.timeline-card:hover {
  color: var(--accent-3);
}


.timeline-card.is-clickable {
  cursor: pointer;
}

.pub-thumb {
  grid-column: 1;
  grid-row: 1 / span 4;
  width: 100%;
  height: 150px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(30, 95, 168, 0.2), rgba(42, 127, 160, 0.14)),
    repeating-linear-gradient(
      135deg,
      rgba(31, 31, 27, 0.08) 0,
      rgba(31, 31, 27, 0.08) 6px,
      transparent 6px,
      transparent 12px
    );
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center;
}

.pub-thumb img,
.pub-entry-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: white;
}

.pub-thumb img[data-unavailable],
.pub-entry-media img[data-unavailable] {
  visibility: hidden;
}

.pub-thumb:has(img:not([data-unavailable])),
.pub-entry-media:has(img:not([data-unavailable])) {
  background: white;
}

.timeline-card h3 {
  grid-column: 2;
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.08rem;
  line-height: 1.3;
}

[data-publications-home="en"] .timeline-card h3,
[data-lang="en"] .timeline-card h3 {
  font-family: var(--font-sans);
}

.pub-meta {
  grid-column: 2;
  margin: 0;
  color: var(--accent-3);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.pub-venue {
  display: inline;
}

.pub-date-inline {
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--muted);
  white-space: nowrap;
}

.venue-oral {
  color: #c31f24;
  font-weight: 700;
}

.pub-authors {
  grid-column: 2;
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
  line-height: 1.45;
}

[data-lang="zh"] .pub-authors {
  font-family: var(--font-hero-zh);
}

.pub-link {
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--accent-2);
}

.pub-actions {
  grid-column: 2;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  align-items: center;
}

.pub-link-button:not(.pub-link-chip):not(.pub-icon-btn) {
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.pub-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper-strong);
  color: var(--ink-soft);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.pub-icon-btn:hover,
.pub-icon-btn:focus-visible {
  transform: translateY(-1px);
  border-color: var(--accent);
  background: rgba(31, 111, 104, 0.08);
  color: var(--accent-3);
  outline: none;
}

.pub-icon-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  transform: translate(-50%, 3px);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper-strong);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 10;
}

.pub-icon-btn:hover::after,
.pub-icon-btn:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.pub-icon-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
}

.pub-icon-glyph svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.timeline-track.is-dragging {
  cursor: default;
}

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

.project-grid article {
  padding: 16px 0;
  border-radius: 0;
  border: none;
  border-top: 1px solid var(--line);
  background: transparent;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.project-grid article:hover {
  color: var(--accent-3);
}

.project-grid article:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.project-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.project-grid h3 {
  margin: 0;
  font-family: var(--font-display);
}

.project-grid[data-projects-grid="en"] h3 {
  font-family: var(--font-sans);
}

.project-grid a {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  font-size: 0.8rem;
  color: var(--accent-2);
}

.project-type {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: var(--accent-3);
}

.project-stars {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--paper-strong);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--accent-3);
  white-space: nowrap;
}

.project-stars-icon {
  width: 0.9rem;
  height: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #d9a441;
}

.project-stars-icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.project-stars-count {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cite-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 120;
}

.cite-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.cite-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 26, 44, 0.45);
  backdrop-filter: blur(6px);
}

.cite-dialog {
  position: relative;
  width: min(720px, calc(100% - 48px));
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px 16px;
  box-shadow: 0 18px 48px rgba(32, 36, 42, 0.16);
  display: grid;
  gap: 12px;
  z-index: 1;
}

.cite-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cite-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
}

.cite-close {
  border: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.18em;
  cursor: pointer;
  color: var(--muted);
}

.cite-content {
  margin: 0;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.5;
  max-height: 320px;
  overflow: auto;
  white-space: pre-wrap;
}

.cite-actions {
  display: flex;
  justify-content: flex-end;
}

.cite-copy.is-copied::after {
  content: "OK";
  margin-left: 6px;
  font-weight: 600;
}

body.modal-open {
  overflow: hidden;
}


.site-footer {
  padding: 40px 32px 60px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
}

.site-footer-inner {
  width: min(100%, 680px);
  margin: 0 auto;
  padding-top: 18px;
  border-top: 1px solid rgba(29, 42, 58, 0.12);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.site-footer-brand {
  margin: 0;
}

[data-list-preview][hidden],
[data-news-list]:empty,
.widget-card-wrap[aria-busy="false"] .widget-skeleton {
  display: none;
}

.skeleton-bar,
.skeleton-row .pub-thumb,
img[data-loading],
.project-stars[aria-busy="true"] .project-stars-count {
  background: var(--skeleton);
}

.skeleton-bar {
  display: block;
  width: 100%;
  height: 0.75rem;
  border-radius: 4px;
  align-self: center;
}

.skeleton-meta { width: min(5rem, 80%); height: 0.65rem; }
.skeleton-title { width: 83%; height: 1.05rem; }
.skeleton-short { width: 64%; }
.skeleton-total { width: 7.5rem; height: 1.9rem; }
.skeleton-icons {
  width: 106px;
  height: 30px;
  background: repeating-linear-gradient(to right, var(--skeleton) 0 30px, transparent 30px 38px);
}
.skeleton-lines { display: grid; gap: 0.65rem; }
.skeleton-row { overflow-anchor: none; }
img[data-loading] { color: transparent; }
.skeleton-row .pub-thumb { border-color: transparent; }
.project-grid article.skeleton-row { cursor: default; }
.project-grid .skeleton-row > .skeleton-bar { align-self: flex-start; }
.project-stars[aria-busy="true"] .project-stars-count { width: 3ch; height: 1em; border-radius: 3px; }

.widget-skeleton {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--paper);
  pointer-events: none;
}

.widget-skeleton-body {
  padding: 16px 17px 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  display: grid;
  gap: 15px;
}

.widget-skeleton-head { display: flex; justify-content: space-between; align-items: center; }
.widget-skeleton-head .skeleton-title { width: 48%; }
.widget-skeleton-head > .skeleton-meta { width: 17%; }
.skeleton-trend { height: 1.1rem; }
.widget-skeleton-section {
  display: grid;
  gap: 13px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}
.skeleton-bars {
  height: 44px;
  border-radius: 8px;
  background: repeating-linear-gradient(to right, var(--skeleton) 0 calc(33.333% - 3px), transparent 0 33.333%);
}
.skeleton-heatmap {
  aspect-ratio: 16 / 7;
  background-color: var(--skeleton);
  background-image: linear-gradient(to right, var(--paper) 3px, transparent 3px),
    linear-gradient(to bottom, var(--paper) 3px, transparent 3px);
  background-size: 6.25% calc(100% / 7);
}
.skeleton-ranks {
  height: 94px;
  background: linear-gradient(to right, transparent 43%, var(--paper) 43% 80%, transparent 80%),
    repeating-linear-gradient(to bottom, var(--skeleton) 0 9px, transparent 9px 25px);
}
.skeleton-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.skeleton-tiles span { height: 46px; background: var(--skeleton); border-radius: 8px; }

.cite-content[aria-busy="true"]::before {
  content: "";
  display: block;
  width: 78%;
  height: 6.5em;
  background: repeating-linear-gradient(to bottom, var(--skeleton) 0 0.75em, transparent 0.75em 1.65em);
}

.load-notice {
  margin: 0;
  padding: 12px 0;
  color: var(--muted);
}
.load-notice button {
  margin-inline-start: 0.65em;
  padding: 0;
  font: inherit;
  color: var(--accent);
  background: none;
  border: 0;
  text-decoration: underline;
  cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
  html:not(:has(.page-content section[aria-busy="true"], .hero-news[aria-busy="true"])) {
    scroll-behavior: smooth;
  }
  .skeleton-row,
  .widget-skeleton-body,
  .project-stars[aria-busy="true"] .project-stars-count,
  .cite-content[aria-busy="true"]::before {
    animation: loading-pulse 1.55s ease-in-out infinite alternate;
  }
  img[data-loading] { animation: loading-image 1.55s ease-in-out infinite alternate; }
  [data-reveal].reveal-in { animation: reveal-in 0.32s ease-out; }
}

@keyframes loading-pulse {
  to { opacity: 0.48; }
}
@keyframes loading-image {
  to { background-color: #efeee9; }
}
@keyframes reveal-in {
  from { opacity: 0.8; transform: translateY(4px); }
}

@media (max-width: 1180px) {
  .page-shell {
    grid-template-columns: 184px minmax(0, 1fr);
    row-gap: 32px;
  }

  .widget-sidebar {
    position: static;
    grid-column: 2;
  }
}

@media (max-width: 1024px) {
  .hero-meta {
    grid-template-columns: 1fr;
  }

  .project-page .project-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  :root {
    --header-offset: 104px;
  }

  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .site-nav {
    width: 100%;
    justify-content: flex-start;
    gap: 4px 16px;
  }

  .site-nav a {
    padding: 4px 0;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }

  .page-shell {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 24px;
  }

  .widget-sidebar {
    grid-column: 1;
    display: flex;
    justify-content: center;
  }

  .widget-card-wrap {
    width: 100%;
    max-width: 360px;
  }

  .profile-sidebar {
    position: static;
    display: grid;
    grid-template-columns: 124px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
  }

  .portrait-card {
    max-width: 124px;
  }

  .sidebar-actions {
    gap: 2px;
  }

  .sidebar-link {
    padding: 5px 8px;
    margin: 0 -8px;
    font-size: 0.88rem;
  }

  .pub-year-block {
    grid-template-columns: 1fr;
  }

  .pub-year {
    margin-bottom: 6px;
  }

  .pub-entry {
    grid-template-columns: 1fr;
  }

  .pub-entry-media {
    max-width: 320px;
  }
}

@media (max-width: 720px) {
  .site-nav {
    width: 100%;
    justify-content: flex-start;
    gap: 4px 14px;
    font-size: 0.88rem;
  }

  main,
  .site-header,
  .site-footer {
    padding-left: 20px;
    padding-right: 20px;
  }

  .hero {
    padding-top: 0;
  }

  .hero-meta {
    gap: 12px;
  }

  .hero-meta strong {
    font-size: 0.95rem;
  }

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

  .news-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .service-groups {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .service-chip:has(.service-chip-year ~ .service-chip-year) {
    letter-spacing: -0.015em;
  }

  .service-group + .service-group {
    padding-top: 14px;
    border-top: 1px solid var(--line);
  }

  .timeline-track {
    grid-auto-columns: auto;
  }

  .timeline-card {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .pub-thumb,
  .timeline-card h3,
  .timeline-card .pub-meta,
  .timeline-card .pub-authors,
  .timeline-card .pub-actions {
    grid-column: 1;
    grid-row: auto;
  }

  .pub-thumb {
    height: 150px;
    max-width: 260px;
  }

  .pub-date-inline {
    margin-left: 8px;
    padding-left: 8px;
  }

}

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

  [data-reveal] {
    transition: none;
    opacity: 1;
    transform: none;
  }
}
