/* ==========================================================================
   Pan’s LiFE · site.css
   One stylesheet for every page (Chinese and English).

   How this file is organised
   1. Design tokens   colours, fonts, radii, shadows (change colours here only)
   2. Fonts           self-hosted Source Serif 4 for Latin headings
   3. Reset           Tailwind preflight, kept inside @layer so every rule
                      below overrides it without extra specificity
   4. Components      one section per part of the site; each section holds its
                      own responsive (@media) rules right after the base rules

   Conventions
   - Use the colour variables (var(--color-…)); do not add new hex values.
   - Do not use !important. If a rule does not apply, make the selector match
     the rule it needs to beat, or place it later in the same section.
   - English-only tweaks use the html[lang=en] prefix inside each section.
   ========================================================================== */

/* 1. Design tokens ------------------------------------------------------- */

:root {
  --color-brand-dark: #07221d; /* dark backgrounds: hero, contact, footer */
  --color-ink: #123e32; /* headings and strongest text */
  --color-text: #28473e; /* body text */
  --color-accent: #235745; /* active states, badges, journal names */
  --color-accent-bright: #157258; /* link hover */
  --color-green: #437b52; /* secondary accents, focus outlines */
  --color-text-muted: #4e675c; /* secondary text */
  --color-text-soft: #65766b; /* captions and meta */
  --color-sage: #56785e; /* decorative green text */
  --color-line-green: #7c9f86; /* green underlines and rules */
  --color-line-strong: #94aa99; /* link underlines */
  --color-line: #b9cbbd; /* card and list borders */
  --color-line-soft: #d4e0d6; /* faint separators */
  --color-surface: #e6ede7; /* light green panels */
  --color-surface-2: #d9e6db; /* panel hover tint */
  --color-bg: #f5f7f6; /* page background */
  --color-white: #ffffff; /* white */
  --color-lime: #d8ebaf; /* highlight on dark backgrounds */
  --color-on-dark: #edf7ec; /* text on dark backgrounds */
  --color-on-dark-muted: #bfd2c3; /* secondary text on dark */
  --color-on-dark-soft: #9eb6a8; /* tertiary text on dark */
  --color-focus: #b09438; /* keyboard focus ring */
  --color-bili: #bd3d6c; /* Bilibili accent */
  --color-bili-ink: #742142; /* Bilibili text */
  --color-bili-soft: #f7e6ee; /* Bilibili background */
  --color-fig-green: #0d7d5a; /* interactive figures: main series */
  --color-fig-warm: #c4532a; /* interactive figures: gain, photons */
  --color-fig-violet: #6c55c7; /* interactive figures: third series */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
  --color-border-subtle: rgba(130, 157, 143, 0.28);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-subtle: 0 4px 18px rgba(15, 48, 36, 0.05);
  --shadow-card: 0 6px 22px rgba(15, 48, 36, 0.07);
  --shadow-hover: 0 12px 32px rgba(15, 48, 36, 0.11);
  --shadow-float: 0 10px 28px rgba(11, 48, 44, 0.18);
  --site-header-height: 100px;
  --font-serif: "Source Serif 4", Georgia, "Times New Roman", Cambria, serif;
}

/* 2. Fonts ---------------------------------------------------------------- */

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("/fonts/source-serif-4-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("/fonts/source-serif-4-latin-wght-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* 3. Reset (Tailwind preflight) ------------------------------------------ */

@layer theme {
:root {
  --default-font-family: var(--font-sans);
}
}
@layer base {
* {
  border: 0 solid;
  margin: 0;
  padding: 0;
}
:after,
:before {
  box-sizing: border-box;
  border: 0 solid;
  margin: 0;
  padding: 0;
}
::backdrop {
  box-sizing: border-box;
  border: 0 solid;
  margin: 0;
  padding: 0;
}
::file-selector-button {
  box-sizing: border-box;
  border: 0 solid;
  margin: 0;
  padding: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
  line-height: 1.5;
  font-family: var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
  font-feature-settings: var(--default-font-feature-settings,normal);
  font-variation-settings: var(--default-font-variation-settings,normal);
  -webkit-tap-highlight-color: transparent;
}
:host {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
abbr:where([title]) {
  -webkit-text-decoration: underline dotted;
}
h3 {
  font-size: inherit;
  font-weight: inherit;
}
a {
  -webkit-text-decoration: inherit;
  -webkit-text-decoration: inherit;
  -webkit-text-decoration: inherit;
  -webkit-text-decoration: inherit;
}
strong {
  font-weight: bolder;
}
:-moz-focusring {
  outline: auto;
}
summary {
  display: list-item;
}
ol,
ul {
  list-style: none;
}
img {
  vertical-align: middle;
  display: block;
}
button {
  font: inherit;
  font-feature-settings: inherit;
  font-variation-settings: inherit;
  letter-spacing: inherit;
  color: inherit;
  opacity: 1;
  background-color: #0000;
}
::file-selector-button {
  font: inherit;
  font-feature-settings: inherit;
  font-variation-settings: inherit;
  letter-spacing: inherit;
  color: inherit;
  opacity: 1;
  background-color: #0000;
  border-radius: 0;
}
::file-selector-button {
  margin-inline-end: 4px;
}
::placeholder {
  opacity: 1;
}
@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px) {
::placeholder {
  color: currentColor;
}
@supports (color:color-mix(in lab, red, red)) {
::placeholder {
  color: color-mix(in oklab, currentcolor 50%, transparent);
}
}
}
::-webkit-search-decoration {
  -webkit-appearance: none;
}
::-webkit-date-and-time-value {
  min-height: 1lh;
  text-align: inherit;
}
::-webkit-datetime-edit {
  display: inline-flex;
}
::-webkit-datetime-edit-fields-wrapper {
  padding: 0;
}
::-webkit-datetime-edit {
  padding-block: 0;
}
::-webkit-datetime-edit-year-field {
  padding-block: 0;
}
::-webkit-datetime-edit-month-field {
  padding-block: 0;
}
::-webkit-datetime-edit-day-field {
  padding-block: 0;
}
::-webkit-datetime-edit-hour-field {
  padding-block: 0;
}
::-webkit-datetime-edit-minute-field {
  padding-block: 0;
}
::-webkit-datetime-edit-second-field {
  padding-block: 0;
}
::-webkit-datetime-edit-millisecond-field {
  padding-block: 0;
}
::-webkit-datetime-edit-meridiem-field {
  padding-block: 0;
}
::-webkit-calendar-picker-indicator {
  line-height: 1;
}
:-moz-ui-invalid {
  box-shadow: none;
}
button {
  -webkit-appearance: button;
  appearance: button;
}
input:where([type=button],[type=reset],[type=submit]) {
  -webkit-appearance: button;
}
::file-selector-button {
  -webkit-appearance: button;
  appearance: button;
}
::-webkit-inner-spin-button {
  height: auto;
}
::-webkit-outer-spin-button {
  height: auto;
}
}

/* 4. Base elements -------------------------------------------------------- */

[hidden]:not([hidden="until-found"]) {
  display: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--site-header-height) + 24px);
}

body {
  margin: 0;
  font-size: 16px;
  line-height: 1.8;
  font-family: var(--font-sans);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

:is(a:focus-visible,summary:focus-visible) {
  outline-offset: 5px;
  outline: 3px solid var(--color-focus);
}

h1,
h3 {
  margin: 0;
  color: var(--color-ink);
}

p {
  margin: 0;
}

img {
  max-width: 100%;
  height: auto;
}

h2 {
  letter-spacing: -1px;
  margin: 16px 0 24px;
  font-size: clamp(28px,3vw,44px);
  font-weight: 500;
  line-height: 1.45;
  color: var(--color-ink);
}

.skip-link {
  z-index: 9;
  background: var(--color-white);
  padding: 10px;
  position: absolute;
  top: -80px;
  left: 20px;
}

.skip-link:focus {
  top: 10px;
}

body > .footer {
  margin-top: auto;
}

body > main,
body > .home-layout {
  flex: 1 0 auto;
  width: 100%;
}

@media (max-width: 1679px) {
  html {
    scroll-padding-top: calc(var(--site-header-height) + 72px);
  }
}

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

/* 5. Layout and shared pieces --------------------------------------------- */

.eyebrow {
  letter-spacing: 2.5px;
  font-size: 13px;
  font-weight: 600;
}

.section {
  border-bottom: 1px solid var(--color-line-soft);
  padding: 80px 8%;
}

.section>p {
  color: var(--color-text-muted);
  max-width: 780px;
}

.section-heading {
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin-bottom: 35px;
  display: flex;
}

.text-link {
  white-space: nowrap;
  border-bottom: 1px solid var(--color-line-green);
}

.link-row {
  flex-wrap: wrap;
  gap: 20px;
  margin: 20px 0;
  font-size: 14px;
  display: flex;
}

.details {
  border-top: 1px solid var(--color-line);
  border-bottom: 1px solid var(--color-line);
  margin-top: 30px;
}

.details summary {
  cursor: pointer;
  padding: 20px 0;
  font-size: 16px;
}

.prose p {
  max-width: 940px;
  margin: 15px 0;
  overflow-wrap: anywhere;
}

.prose h3 {
  margin: 28px 0 12px;
  font-size: 22px;
}

.small-note {
  color: var(--color-text-soft);
  margin: 15px 0;
  font-size: 13px;
}

.home-main {
  min-width: 0;
}

.subsection-title {
  margin-top: 42px;
  font-size: 24px;
}

.home-layout {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
}

.prose img {
  display: block;
  transition: transform 0.24s ease, box-shadow 0.24s ease;
  width: 100%;
  max-width: 880px;
  height: auto;
  max-height: none;
  margin: 32px auto;
  padding: 18px;
  background: var(--color-white);
  border: 1px solid rgba(135, 166, 149, 0.32);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  object-fit: contain;
}

.research-figures figure img {
  display: block;
  border: 1px solid rgba(135, 166, 149, 0.35);
  box-shadow: var(--shadow-card);
  transition: transform 0.24s ease, box-shadow 0.24s ease;
  padding: 18px;
  background: var(--color-white);
  border-radius: 14px;
}

.lab-image {
  display: block;
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.prose img:hover,
.research-figures figure img:hover {
  box-shadow: var(--shadow-hover);
}

figcaption.small-note {
  margin-top: 12px;
  text-align: center;
  font-size: 13px;
  color: var(--color-text-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

figcaption.small-note::before {
  content: "FIG.";
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  padding: 1px 6px;
  background: rgba(144, 178, 160, 0.28);
  border-radius: 4px;
  color: var(--color-accent);
}

.lab-image.research-overview {
  width: 100%;
  max-width: 880px;
  height: auto;
  max-height: none;
  margin: 32px auto;
  padding: 18px;
  background: var(--color-white);
  border: 1px solid rgba(135, 166, 149, 0.32);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  object-fit: contain;
}

html[lang=en] .section h2 {
  overflow-wrap: break-word;
}

html[lang=en] .home-main .section:not(.contact) h2 {
  font-size: clamp(30px,3.1vw,46px);
  line-height: 1.25;
}

@media (max-width: 1679px) {
  .home-layout {
    display: block;
  }
}

@media (max-width:750px) {
  .section-heading {
    flex-direction: column;
    align-items: start;
  }
  .section {
    padding: 55px 6%;
  }
  .text-link {
    white-space: normal;
  }
}

@media (max-width: 750px) {
  .prose img,
  .lab-image.research-overview,
  .research-figures figure img {
    padding: 8px;
    border-radius: 10px;
    margin: 20px auto;
  }
}

@media (min-width: 1680px) {
  .home-layout {
    grid-template-columns: 168px minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion:reduce) {
  .shimmer {
    -webkit-text-fill-color: currentColor;
  }
}

/* 6. Header and navigation ------------------------------------------------ */

.brand {
  font: italic 700 42px "Source Serif 4",Georgia,serif;
}

.brand span {
  font: 14px Microsoft YaHei,sans-serif;
}

.header nav {
  flex-wrap: wrap;
  display: flex;
  gap: 24px;
  font-size: 14px;
  align-items: center;
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 6%;
  background: rgba(245, 247, 246, var(--header-alpha, 0.98));
  backdrop-filter: blur(20px) saturate(135%);
  -webkit-backdrop-filter: blur(20px) saturate(135%);
  border-bottom: 1px solid var(--color-border-subtle);
  transition: padding 0.24s ease, min-height 0.24s ease, box-shadow 0.24s ease;
  gap: 16px;
}

.header.is-scrolled {
  min-height: 68px;
  padding-top: 10px;
  padding-bottom: 10px;
  box-shadow: var(--shadow-subtle);
}

.header .brand {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-shrink: 0;
  font-style: normal;
  text-decoration: none;
}

.header .brand .brand-wordmark {
  display: flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
  letter-spacing: -1px;
}

.header .brand .brand-owner {
  font: 400 31px/1.1 var(--font-serif);
  letter-spacing: -1.2px;
  color: var(--color-text-muted);
  transition: font-size 0.24s ease;
}

.header .brand .brand-life {
  font: italic 700 46px/1 var(--font-serif);
  letter-spacing: -2px;
  color: var(--color-ink);
  transition: font-size 0.24s ease;
}

.header .brand .brand-caption {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-left: 18px;
  border-left: 1px solid var(--color-line);
  letter-spacing: 1.5px;
  font: 14px/1.3 var(--font-sans);
}

.brand-caption strong {
  font-weight: 600;
  color: var(--color-ink);
}

.brand-caption small {
  font: 10px/1.3 var(--font-sans);
  letter-spacing: 1.2px;
  color: var(--color-text-muted);
}

.header.is-scrolled .brand .brand-owner {
  font-size: 25px;
}

.header.is-scrolled .brand .brand-life {
  font-size: 35px;
}

.header.is-scrolled .brand .brand-caption {
  gap: 3px;
}

.header nav a {
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  color: var(--color-text-muted);
  font-weight: 500;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.header nav a:hover {
  color: var(--color-ink);
}

.header nav a[aria-current="page"] {
  border-color: var(--color-accent);
  color: var(--color-accent);
  font-weight: 700;
}

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(130, 157, 143, 0.4);
  border-radius: 8px;
  width: 42px;
  height: 42px;
  padding: 0;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  z-index: 101;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.nav-toggle:hover {
  background: rgba(18, 62, 50, 0.05);
  border-color: var(--color-ink);
}

.nav-toggle-bar {
  width: 20px;
  height: 2px;
  background: var(--color-ink);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.header.nav-open .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.header.nav-open .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}

.header.nav-open .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.header nav {
  column-gap: 24px;
  margin-left: auto;
}

.language-switch {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 40px;
  padding: 6px 12px;
  border: 1px solid var(--color-line);
  border-radius: 22px;
  color: var(--color-accent);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  background: rgba(231,239,230,.6);
  white-space: nowrap;
}

.language-switch:hover {
  background: var(--color-surface-2);
  border-color: var(--color-line-green);
}

.language-switch:focus-visible {
  outline: 2px solid var(--color-accent-bright);
  outline-offset: 4px;
}

.header .language-switch {
  margin-left: 0;
}

html[lang=en] .header nav {
  gap: 18px;
}

html[lang=en] .brand-caption small {
  font-size: 8px;
  letter-spacing: .6px;
}

@media (min-width:769px) and (max-width:1200px) {
  .header {
    flex-wrap: wrap;
  }
  .header .brand {
    margin-right: auto;
  }
  .header nav {
    order: 3;
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }
  .header .language-switch {
    order: 2;
  }
}

@media (max-width: 1050px) {
  .header.is-scrolled {
    row-gap: 8px;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }
  .header {
    padding-top: 14px;
    padding-bottom: 14px;
    min-height: 72px;
  }
  .header.is-scrolled {
    min-height: 64px;
  }
  .header.nav-ready nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(245, 247, 246, 0.98);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    border-bottom: 1px solid var(--color-line-soft);
    padding: 20px 8% 28px;
    flex-direction: column;
    align-items: stretch;
    box-shadow: 0 16px 36px rgba(15, 48, 36, 0.12);
    z-index: 100;
  }
  .header.nav-open nav {
    display: flex;
    animation: drawerFadeIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .header nav a {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    border-bottom: 0;
    background: rgba(235, 242, 237, 0.6);
  }
  .header nav a[aria-current="page"] {
    background: var(--color-accent);
    color: var(--color-white);
  }
}

@media (max-width:768px) {
  .header {
    flex-wrap: nowrap;
    gap: 8px;
  }
  .nav-toggle {
    flex-shrink: 0;
  }
  .header.nav-ready nav {
    gap: 10px;
    margin-left: 0;
  }
  .header.nav-ready nav a {
    font-size: 15px;
  }
  .header .brand {
    margin-right: auto;
  }
  .header .language-switch {
    min-width: 38px;
    min-height: 38px;
    padding: 6px 9px;
  }
  .header .brand .brand-caption {
    display: none;
  }
  .header .nav-toggle {
    width: 38px;
    height: 38px;
  }
  html[lang=en] .header.nav-ready nav {
    gap: 10px;
  }
}

@media (max-width:750px) {
  .brand span {
    font-size: 13px;
  }
  .header nav {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .header .brand {
    gap: 10px;
  }
  .header .brand .brand-owner {
    font-size: 24px;
  }
  .header .brand .brand-life {
    font-size: 34px;
  }
  .header .brand .brand-caption {
    padding-left: 10px;
    font-size: 12px;
    letter-spacing: 0.5px;
  }
  .brand-caption small {
    font-size: 8px;
    letter-spacing: 0.5px;
  }
}

@media (max-width:520px) {
  .header nav {
    justify-content: space-between;
  }
}

@media (max-width:420px) {
  .header .brand .brand-caption {
    font-size: 10px;
    padding-left: 8px;
  }
  .brand-caption small {
    font-size: 6px;
    letter-spacing: .4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .header,
  .header .brand .brand-owner,
  .header .brand .brand-life {
    transition: none;
    animation: none;
  }
}

@media (prefers-reduced-motion:reduce) {
  .header.nav-open nav {
    animation: none;
    transition: none;
  }
}
@keyframes drawerFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
  }

/* 7. Page index ----------------------------------------------------------- */

.page-index nav {
  font-size: 13px;
  position: sticky;
  top: calc(var(--site-header-height) + 18px);
  margin: 18px 10px;
  padding: 16px 12px;
  gap: 6px;
  border: 1px solid rgba(167, 190, 177, 0.38);
  border-radius: 14px;
  background: rgba(239, 245, 240, 0.72);
  backdrop-filter: blur(18px) saturate(125%);
  -webkit-backdrop-filter: blur(18px) saturate(125%);
  box-shadow: 0 6px 24px rgba(20, 57, 39, 0.035);
  display: grid;
}

.page-index {
  background: transparent;
  border-right: 1px solid var(--color-border-subtle);
  min-width: 0;
}

.page-index p {
  font-size: 11px;
  letter-spacing: 2px;
  padding: 0 9px;
  margin: 0 0 8px;
  color: var(--color-text-muted);
  font-weight: 600;
}

.page-index a {
  display: block;
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;
}

.page-index a:hover {
  background: rgba(205, 222, 210, 0.55);
  color: var(--color-ink);
}

.page-index a[aria-current="location"] {
  background: rgba(188, 214, 196, 0.68);
  color: var(--color-ink);
  font-weight: 600;
  box-shadow: inset 3px 0 var(--color-green);
}

@media (max-width: 1679px) {
  .page-index {
    position: sticky;
    top: var(--site-header-height);
    z-index: 90;
    border-right: 0;
    border-bottom: 1px solid var(--color-border-subtle);
    background: rgba(245, 247, 246, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }
  .page-index nav {
    position: static;
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    gap: 8px;
    padding: 10px 8%;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .page-index nav::-webkit-scrollbar,
  .page-index p {
    display: none;
  }
  .page-index a {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    background: rgba(228, 239, 232, 0.75);
    border: 1px solid rgba(167, 190, 177, 0.4);
    box-shadow: none;
  }
  .page-index a[aria-current="location"] {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-white);
    box-shadow: none;
  }
}

@media (max-width:1050px) {
  .page-index p {
    width: 100%;
  }
}

@media (max-width: 1050px) {
  .page-index nav {
    -webkit-overflow-scrolling: touch;
  }
  .page-index a {
    font-size: 12px;
  }
}

@media (max-width:768px) {
  html[lang=en] .page-index a {
    flex-shrink: 0;
  }
}

@media (max-width: 750px) {
  .page-index nav {
    padding: 8px 6%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page-index a {
    transition: none;
    animation: none;
  }
}

/* 8. Hero ----------------------------------------------------------------- */

.hero-bottom a span {
  margin-left: 40px;
}

.hero-art {
  height: 340px;
}

.hero {
  background: radial-gradient(circle at 84% 24%, rgba(32, 105, 85, 0.45) 0%, transparent 55%),
              radial-gradient(circle at 16% 85%, rgba(15, 65, 52, 0.48) 0%, transparent 50%),
              var(--color-brand-dark);
  color: var(--color-on-dark);
  padding: 70px 8% 46px;
  position: relative;
  overflow: hidden;
}

.hero .eyebrow {
  font-size: 12px;
  letter-spacing: 2.5px;
  color: var(--color-on-dark-muted);
  font-weight: 600;
}

.hero .hero-science {
  font: 400 clamp(52px, 6.8vw, 104px)/1.06 var(--font-serif);
  letter-spacing: -3px;
  max-width: 850px;
  margin: 36px 0 46px;
  position: relative;
  z-index: 2;
  color: var(--color-on-dark);
}

.hero h1 em {
  display: block;
  color: var(--color-lime);
  font-style: italic;
  font-weight: 400;
}

.hero .hero-art {
  position: absolute;
  top: 70px;
  max-height: 420px;
  opacity: 0.7;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 0 24px rgba(135, 214, 185, 0.22));
  animation: heroArtPulse 8s ease-in-out infinite;
  z-index: 1;
}

.hero-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
  border-top: 1px solid rgba(130, 168, 151, 0.35);
  padding-top: 26px;
  position: relative;
  z-index: 2;
}

.hero-bottom p {
  color: var(--color-on-dark);
  font-size: 16px;
  line-height: 1.7;
}

.hero-bottom a {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  background: rgba(216, 235, 175, 0.12);
  border: 1px solid rgba(216, 235, 175, 0.35);
  color: var(--color-on-dark);
  font-size: 14px;
  transition: all 0.2s ease;
}

.hero-bottom a:hover {
  background: rgba(216, 235, 175, 0.24);
  border-color: rgba(216, 235, 175, 0.6);
  color: var(--color-white);
  transform: translateY(-1px);
}

html[lang=en] .hero-bottom p {
  max-width: 540px;
}

@media (max-width: 768px) {
  .hero .hero-science {
    font-size: clamp(40px, 8.8vw, 68px);
    letter-spacing: -1.7px;
    margin: 24px 0 32px;
    order: 2;
    margin-bottom: 8px;
  }
  .hero {
    display: flex;
    flex-direction: column;
  }
  .hero .eyebrow {
    order: 1;
  }
  .hero .hero-bottom {
    order: 4;
  }
}

@media (max-width:768px) {
  html[lang=en] .hero-science {
    font-size: clamp(38px,8vw,64px);
  }
}

@media (max-width:750px) {
  .hero-bottom {
    flex-direction: column;
  }
  .hero-art {
    float: none;
  }
}

@media (max-width: 520px) {
  .hero {
    padding: 48px 6% 32px;
  }
  .hero-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
  }
}

@media (min-width: 769px) {
  .hero .hero-art {
    width: 34%;
    right: 3%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero .hero-art {
    transition: none;
    animation: none;
  }
}

@media (max-width: 768px) {
  .hero .hero-art {
    order: 3;
    position: relative;
    inset: auto;
    width: 100%;
    max-width: 360px;
    height: 150px;
    margin: 0 0 20px;
    opacity: 0.8;
    animation: none;
  }
}
@keyframes heroArtPulse {
  0%, 100% { transform: translateY(0); opacity: 0.68; }
  50% { transform: translateY(-7px); opacity: 0.85; }
}

/* 9. Research ------------------------------------------------------------- */

.research-grid {
  grid-template-columns: repeat(3,1fr);
  gap: 35px;
  margin-top: 45px;
  display: grid;
}

.research-grid h3 {
  margin: 18px 0 14px;
  font-size: 22px;
}

.research-grid p {
  color: var(--color-text-muted);
}

.research-intro {
  background: var(--color-surface);
}

.research-intro h1 {
  color: var(--color-ink);
  letter-spacing: -2px;
  margin: 30px 0;
  font: clamp(43px,6vw,76px)/1.2 "Source Serif 4",Georgia,Microsoft YaHei,serif;
}

.research-intro h1 em {
  color: var(--color-green);
  font-weight: 400;
}

.research-intro .intro {
  max-width: 870px;
  margin-top: 25px;
  font-size: 19px;
}

.research-grid article {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(160, 188, 172, 0.35);
  border-top: 3px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: 26px 24px;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.research-grid article:hover {
  transform: translateY(-3px);
  background: var(--color-white);
  box-shadow: var(--shadow-card);
}

.research-grid article > span {
  font: italic 26px var(--font-serif);
  color: var(--color-sage);
  display: inline-block;
  margin-bottom: 4px;
}

html[lang=en] .research-intro h1 {
  font-size: clamp(36px,5vw,70px);
  letter-spacing: -1px;
}

@media (max-width:750px) {
  .research-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .research-intro .intro {
    font-size: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .research-grid article {
    transition: none;
    animation: none;
  }
}

/* 10. Publications -------------------------------------------------------- */

.paper {
  border-top: 1px solid var(--color-line);
  grid-template-columns: 130px 1fr 35px;
  gap: 30px;
  display: grid;
  border-radius: var(--radius-md);
  padding: 24px 20px;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.paper h3 {
  max-width: 880px;
  margin-bottom: 12px;
  font: 24px/1.4 "Source Serif 4",Georgia,serif;
}

.paper p {
  color: var(--color-text-muted);
  font-size: 14px;
}

.paper .journal {
  color: var(--color-accent);
  font-size: 15px;
  font-weight: 600;
}

.paper-date {
  color: var(--color-text-muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.paper-arrow {
  font-size: 26px;
}

.archive-list {
  padding-left: 23px;
}

.archive-list li {
  overflow-wrap: anywhere;
  margin-bottom: 20px;
}

.archive-year {
  border-top: 1px solid var(--color-on-dark-muted);
  padding: 20px 0;
}

.archive-year summary {
  cursor: pointer;
  font: 24px "Source Serif 4",Georgia,serif;
}

.group-author {
  color: var(--color-accent);
  font-weight: 750;
}

.paper .paper-summary,
.work-entry .paper-summary {
  color: var(--color-accent);
  border-top: 1px dashed var(--color-on-dark-muted);
  margin-top: 15px;
  padding-top: 12px;
  font-size: 16px;
  line-height: 1.85;
}

.paper .contribution,
.work-entry .contribution {
  color: var(--color-sage);
  margin-top: 10px;
  font-size: 12px;
}

.contribution a {
  text-underline-offset: 3px;
  text-decoration: underline;
}

.work-entry {
  border-bottom: 1px solid var(--color-line-soft);
  overflow-wrap: anywhere;
  margin: 12px 0 24px;
  padding: 22px 18px;
}

.work-entry h3 {
  margin-bottom: 12px;
  font: 23px/1.5 "Source Serif 4",Georgia,serif;
}

.work-entry>p {
  font-size: 15px;
}

.badge {
  font-variant-numeric: tabular-nums;
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-sm);
  margin-top: 8px;
  letter-spacing: 0.5px;
  font-weight: 600;
  color: var(--color-accent);
  background: rgba(228, 240, 232, 0.6);
}

.paper:hover {
  background: rgba(255, 255, 255, 0.68);
  box-shadow: 0 4px 18px rgba(15, 52, 42, 0.05);
}

html[lang=en] .paper,
html[lang=en] .work-entry {
  overflow-wrap: anywhere;
}

@media (max-width: 768px) {
  .paper {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .paper-date {
    display: flex;
    align-items: baseline;
    gap: 10px;
  }
  .paper-arrow {
    display: none;
  }
}

@media (max-width:750px) {
  .paper-date {
    grid-column: 1/-1;
  }
  .paper h3 {
    font-size: 22px;
  }
}

/* 11. News ---------------------------------------------------------------- */

.news-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.news-heading h2 {
  margin-bottom: 0;
}

.news-all {
  font-size: 14px;
  white-space: nowrap;
  border-bottom: 1px solid var(--color-line-strong);
  padding: 10px 0;
}

.news-all span {
  margin-left: 22px;
}

.news-home .news-intro {
  margin: 18px 0 36px;
  color: var(--color-text-soft);
}

.news-selection {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 0 34px;
}

.news-card {
  padding: 26px 0;
  border-top: 1px solid var(--color-line);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 18px;
  min-width: 0;
}

.news-card h3 {
  font-size: 24px;
  line-height: 1.55;
  font-weight: 500;
  margin: 0;
}

.news-card p {
  font-size: 15px;
  line-height: 1.9;
  color: var(--color-text-muted);
  margin: 0;
}

.news-card.news-feature {
  grid-row: span 2;
  background: var(--color-surface);
  padding: 38px;
  border-top: 3px solid var(--color-sage);
  gap: 28px;
  position: relative;
}

.news-feature h3 {
  font-size: clamp(27px,2.6vw,39px);
  line-height: 1.5;
  letter-spacing: -.8px;
}

.news-feature .news-read {
  margin-top: auto;
}

.news-read {
  font-size: 13px;
  letter-spacing: .6px;
  border-bottom: 1px solid var(--color-line-strong);
  padding-bottom: 5px;
}

.news-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: 12px;
  color: var(--color-text-soft);
  line-height: 1.6;
}

.news-meta>span:first-child {
  color: var(--color-accent);
  letter-spacing: 1px;
}

.news-meta time {
  font-variant-numeric: tabular-nums;
}

.news-card a:hover,
.news-entry a:hover {
  color: var(--color-accent-bright);
}

.news-masthead {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-line);
  padding-top: 64px;
  padding-bottom: 62px;
}

.news-masthead h1 {
  font-size: clamp(40px,5.3vw,70px);
  font-weight: 400;
  letter-spacing: -2px;
  line-height: 1.25;
  margin: 30px 0 24px;
}

.news-masthead h1 span {
  display: block;
  color: var(--color-sage);
  font-size: .48em;
  letter-spacing: 0;
  margin-top: 16px;
}

.news-masthead>p {
  color: var(--color-text-soft);
  font-size: 16px;
}

.news-archive {
  padding-top: 32px;
}

.news-filter {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  background: rgba(239,244,239,.84);
  border: 1px solid var(--color-on-dark-muted);
  border-radius: 32px;
  padding: 7px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  width: fit-content;
  position: sticky;
  top: calc(var(--site-header-height) + 12px);
  z-index: 10;
  box-shadow: 0 6px 22px #163e3008;
}

.news-filter button {
  cursor: pointer;
  padding: 10px 23px;
  font-size: 14px;
  border-radius: 24px;
  transition: background .15s,color .15s;
}

.news-filter button[aria-pressed=true] {
  color: var(--color-on-dark);
  background: var(--color-accent);
}

.news-filter button:hover {
  background: var(--color-surface-2);
}

.news-filter button[aria-pressed=true]:hover {
  background: var(--color-accent);
}

.news-count {
  font-size: 12px;
  margin: 18px 0 28px;
}

.news-year {
  display: grid;
  grid-template-columns: 120px minmax(0,1fr);
  gap: 32px;
  border-top: 1px solid var(--color-on-dark-soft);
  padding-top: 8px;
  margin-bottom: 46px;
}

.news-year>h2 {
  font: italic 42px/1.2 "Source Serif 4",Georgia,serif;
  color: var(--color-sage);
  margin-top: 27px;
  letter-spacing: -2px;
}

.news-entry {
  display: grid;
  grid-template-columns: 72px minmax(0,1fr);
  gap: 24px;
  padding: 32px 0;
  border-bottom: 1px solid var(--color-line-soft);
}

.news-entry:last-child {
  border-bottom: 0;
}

.news-date {
  font: 14px/1.8 "Source Serif 4",Georgia,serif;
  color: var(--color-text-soft);
  padding-top: 1px;
  white-space: nowrap;
}

.news-entry h3 {
  font-size: 25px;
  font-weight: 500;
  line-height: 1.5;
  margin: 12px 0;
}

.news-entry-body>p {
  font-size: 15px;
  line-height: 1.95;
  color: var(--color-text-muted);
  max-width: 780px;
}

.news-context {
  font-size: 11px;
  border-left: 1px solid var(--color-on-dark-soft);
  padding-left: 12px;
}

.news-actions {
  display: flex;
  gap: 26px;
  margin-top: 20px;
  font-size: 13px;
  color: var(--color-accent);
}

.news-original {
  font-size: 12px;
  color: var(--color-text-soft);
  margin-top: 14px;
}

.news-original summary {
  cursor: pointer;
  width: fit-content;
}

.news-original p {
  font-size: 12px;
  line-height: 1.8;
  margin-top: 8px;
  color: var(--color-text-soft);
}

.news-home a:focus-visible,
.news-archive a:focus-visible,
.news-filter button:focus-visible,
.news-original summary:focus-visible {
  outline: 2px solid var(--color-accent-bright);
  outline-offset: 5px;
}

html[lang=en] .news-masthead h1 {
  font-size: clamp(40px,5vw,68px);
}

html[lang=en] .news-feature h3 {
  font-size: clamp(26px,2.4vw,36px);
}

html[lang=en] .news-card h3,
html[lang=en] .news-entry h3 {
  line-height: 1.4;
}

@media (max-width:768px) {
  html[lang=en] .news-filter button {
    font-size: 12px;
    padding: 9px 10px;
  }
  html[lang=en] .news-filter {
    flex-wrap: wrap;
    border-radius: 20px;
    justify-content: flex-start;
  }
  html[lang=en] .news-heading {
    align-items: flex-start;
  }
  html[lang=en] .news-all {
    white-space: normal;
    max-width: 90px;
  }
}

@media (max-width:750px) {
  .news-selection {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .news-card.news-feature {
    grid-row: auto;
    padding: 26px;
  }
  .news-card h3 {
    font-size: 23px;
  }
  .news-heading {
    align-items: center;
  }
  .news-heading h2 {
    font-size: 32px;
  }
  .news-all {
    font-size: 12px;
  }
  .news-all span {
    margin-left: 8px;
  }
  .news-filter {
    top: calc(var(--site-header-height) + 8px);
    gap: 2px;
    padding: 5px;
    max-width: 100%;
  }
  .news-filter button {
    font-size: 12px;
    padding: 9px 12px;
  }
  .news-year {
    grid-template-columns: 1fr;
    gap: 0;
    margin-bottom: 24px;
  }
  .news-year>h2 {
    font-size: 34px;
    margin: 20px 0 0;
  }
  .news-entry {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 24px 0;
  }
  .news-entry h3 {
    font-size: 23px;
  }
  .news-date {
    font-size: 12px;
  }
  .news-masthead {
    padding-top: 42px;
    padding-bottom: 42px;
  }
  .news-masthead h1 {
    letter-spacing: -1px;
  }
}

@media (max-width:520px) {
  .news-filter {
    width: 100%;
    justify-content: space-between;
    flex-wrap: nowrap;
  }
  .news-filter button {
    font-size: 11px;
    padding: 9px 8px;
    white-space: nowrap;
  }
}

/* 12. Group leader and people --------------------------------------------- */

.pi {
  background: var(--color-surface);
  grid-template-columns: 280px 1fr;
  gap: 65px;
  display: grid;
}

.portrait {
  object-fit: cover;
  object-position: center top;
  background: var(--color-line-soft);
  border-radius: 50%;
  width: 240px;
  height: 240px;
}

.pi h2 {
  margin-bottom: 6px;
}

.pi-bio {
  max-width: 730px;
  margin: 20px 0;
}

.timeline {
  margin-top: 28px;
  padding: 0;
}

.timeline li {
  border-top: 1px solid var(--color-on-dark-muted);
  grid-template-columns: 145px 1fr;
  gap: 15px;
  padding: 12px 0;
  font-size: 15px;
  list-style: none;
  display: grid;
}

.people-grid {
  display: grid;
}

.person h3 {
  font-size: 22px;
  font-weight: 500;
  margin-top: 12px;
}

.person .role {
  color: var(--color-text-muted);
  margin: 5px 0 14px;
  font-size: 13px;
}

.person p {
  color: var(--color-text-soft);
  font-size: 14px;
}

.english-name {
  color: var(--color-text-soft);
  margin-left: 14px;
  font: italic 25px "Source Serif 4",Georgia,serif;
}

.portrait-pan-chenhao {
  transform-origin: 50% 45%;
  transform: scale(2.7);
}

.person {
  min-width: 0;
}

.member-work {
  background: var(--color-surface);
  border-left: 3px solid var(--color-line-green);
}

.profile-intro {
  background: var(--color-surface);
}

.profile-heading {
  align-items: center;
  gap: 42px;
  margin-top: 35px;
  display: flex;
}

.profile-heading .avatar {
  flex-shrink: 0;
  width: 190px;
  margin: 0;
}

.profile-heading h1 {
  margin: 10px 0;
  font-size: 46px;
  font-weight: 500;
}

.member-history {
  padding: 8px 0 24px;
}

.history-group+.history-group {
  margin-top: 32px;
}

.history-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 12px 0 0;
  font-size: 20px;
  font-weight: 600;
}

.history-heading span {
  font-size: 12px;
  letter-spacing: .1em;
  font-weight: 400;
  color: var(--color-text-soft);
}

.history-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.history-row {
  display: grid;
  grid-template-columns: 100px 170px minmax(0,1fr);
  gap: 20px;
  align-items: baseline;
  padding: 18px 0;
  border-top: 1px solid var(--color-line-soft);
  font-size: 15px;
  line-height: 1.7;
}

.history-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-ink);
}

.history-name a {
  text-decoration: none;
  border-bottom: 1px solid var(--color-line-strong);
  padding-bottom: 2px;
}

.history-name a:hover {
  color: var(--color-green);
}

.history-name a:focus-visible {
  outline: 2px solid var(--color-green);
  outline-offset: 4px;
}

.history-role {
  color: var(--color-text-soft);
  font-size: 14px;
}

.history-role small {
  display: block;
  font-size: 13px;
}

.history-detail {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--color-text);
}

.history-detail small {
  display: block;
  color: var(--color-text-soft);
  font-size: 14px;
  margin-top: 3px;
}

.timeline span {
  font-variant-numeric: tabular-nums;
}

.home-main .people-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px 24px;
}

.people-grid .person {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(160, 188, 172, 0.32);
  border-radius: var(--radius-lg);
  padding: 28px 18px 24px;
  text-align: center;
  transition: transform 0.24s ease, box-shadow 0.24s ease, background 0.24s ease;
}

.people-grid .person:hover {
  transform: translateY(-3px);
  background: var(--color-white);
  box-shadow: var(--shadow-card);
}

.avatar {
  width: min(100%, 180px);
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--color-surface);
  margin: 0 auto 16px;
  border: 3px solid var(--color-white);
  box-shadow: 0 4px 16px rgba(15, 52, 42, 0.1);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.people-grid .person:hover .avatar {
  transform: scale(1.03);
  box-shadow: 0 6px 20px rgba(15, 52, 42, 0.16);
}

.member-portrait {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
}

.member-work-link {
  display: inline-block;
  margin-top: 14px;
  padding: 5px 14px;
  border: 1px solid rgba(135, 170, 150, 0.5);
  border-radius: var(--radius-full);
  font-size: 13px;
  color: var(--color-ink);
  background: var(--color-surface);
  text-decoration: none;
  transition: all 0.18s ease;
}

.member-work-link:hover {
  background: var(--color-surface-2);
  border-color: var(--color-ink);
  color: var(--color-brand-dark);
  transform: translateY(-1px);
}

html[lang=en] .profile-heading h1 {
  overflow-wrap: anywhere;
}

html[lang=en] .history-row {
  gap: 16px;
}

html[lang=en] .history-row>* {
  min-width: 0;
  overflow-wrap: break-word;
}

@media (max-width:1000px) {
  .pi {
    grid-template-columns: 240px 1fr;
    gap: 35px;
  }
}

@media (max-width: 768px) {
  .home-main .people-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 16px;
  }
}

@media (max-width:750px) {
  .pi {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .timeline li {
    grid-template-columns: 1fr;
    gap: 3px;
  }
  .english-name {
    margin: 5px 0;
    display: block;
  }
  .portrait {
    width: 220px;
    height: 220px;
  }
  .profile-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 25px;
  }
  .profile-heading h1 {
    font-size: 36px;
  }
}

@media (max-width:680px) {
  .history-row {
    grid-template-columns: 80px minmax(0,1fr);
    gap: 4px 16px;
    padding: 16px 0;
  }
  .history-role {
    text-align: right;
  }
  .history-role small {
    display: inline;
    margin-left: 8px;
  }
  .history-detail {
    grid-column: 1/-1;
    margin-top: 4px;
  }
  .history-heading span {
    font-size: 11px;
  }
}

@media (max-width: 520px) {
  .home-main .people-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 12px;
  }
  .people-grid .person {
    padding: 18px 10px 16px;
    border-radius: 12px;
  }
  .people-grid .avatar {
    width: 96px;
    margin-bottom: 10px;
    border-width: 2px;
  }
  .people-grid .person h3 {
    font-size: 18px;
    margin-top: 4px;
  }
  .people-grid .person .role {
    font-size: 12px;
    margin: 2px 0 6px;
    line-height: 1.5;
  }
  .people-grid .person p {
    font-size: 12px;
    line-height: 1.55;
  }
  .people-grid .member-work-link {
    margin-top: 10px;
    padding: 3px 10px;
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .people-grid .person,
  .avatar {
    transition: none;
    animation: none;
  }
}

/* 13. Quote --------------------------------------------------------------- */

.quote {
  background: var(--color-surface);
  color: var(--color-brand-dark);
  position: relative;
  overflow: hidden;
}

.quote::before {
  content: "“";
  position: absolute;
  right: 40px;
  bottom: -40px;
  font: italic 220px/1 var(--font-serif);
  color: rgba(41, 104, 83, 0.08);
  pointer-events: none;
  user-select: none;
}

.quote blockquote {
  font: clamp(26px, 2.7vw, 42px)/1.45 var(--font-serif);
  max-width: 980px;
  margin: 18px 0;
  color: var(--color-ink);
  letter-spacing: -0.5px;
}

.quote cite {
  font-size: 14px;
  font-style: normal;
  color: var(--color-text-muted);
  font-weight: 500;
}

.section.quote {
  margin: 56px 8%;
  padding: 48px 56px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(130, 168, 151, 0.28);
  border-left: 6px solid var(--color-accent);
}

@media (max-width: 750px) {
  .section.quote {
    margin: 36px 6%;
    padding: 32px 24px;
  }
  .quote::before {
    font-size: 140px;
    right: 16px;
    bottom: -24px;
  }
}

/* 14. Teaching and outreach ----------------------------------------------- */

.teaching-grid {
  grid-template-columns: 1fr 1fr;
  gap: 55px;
  display: grid;
}

.teaching-grid p {
  margin-top: 18px;
}

.bilibili-link strong {
  font-size: 20px;
  display: block;
}

.bilibili-link small {
  margin-top: 2px;
  font-size: 13px;
  display: block;
}

.bilibili-link>span:last-child {
  margin-left: auto;
  font-size: 25px;
}

.bilibili-link:hover {
  transform: translateY(-2px);
  background: var(--color-bili-soft);
  box-shadow: 0 8px 26px rgba(160, 40, 90, 0.12);
  border-color: var(--color-bili);
  color: var(--color-bili-ink);
}

.bilibili-link {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  margin: 24px 0 12px;
  background: var(--color-bili-soft);
  border: 1px solid rgba(220, 160, 185, 0.55);
  border-radius: var(--radius-md);
  color: var(--color-bili-ink);
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(160, 40, 90, 0.05);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.bilibili-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  background: var(--color-bili);
  color: var(--color-white);
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(189, 61, 108, 0.28);
}

@media (max-width:750px) {
  .teaching-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .bilibili-link strong {
    font-size: 18px;
  }
}

@media (max-width: 520px) {
  .teaching-grid {
    grid-template-columns: 1fr;
    gap: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bilibili-link {
    transition: none;
    animation: none;
  }
}

/* 15. Contact ------------------------------------------------------------- */

.contact-email {
  overflow-wrap: anywhere;
  color: var(--color-on-dark);
  border-bottom: 1px solid rgba(216, 235, 175, 0.45);
  font-size: clamp(16px, 2.4vw, 28px);
  display: inline-block;
  margin: 15px 0 30px;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.contact-grid {
  justify-content: space-between;
  gap: 35px;
  display: flex;
}

.contact {
  background: radial-gradient(circle at 85% 30%, rgba(32, 105, 85, 0.4) 0%, transparent 55%),
              var(--color-brand-dark);
  color: var(--color-on-dark);
  border-bottom: 1px solid rgba(130, 157, 143, 0.22);
}

.contact .eyebrow {
  color: var(--color-on-dark-muted);
  font-size: 12px;
  letter-spacing: 2.5px;
  font-weight: 600;
}

.contact h2 {
  font: 400 clamp(40px, 6vw, 75px)/1.15 var(--font-serif);
  letter-spacing: -2px;
  margin: 20px 0 24px;
  color: var(--color-on-dark);
}

.contact h2 em {
  color: var(--color-lime);
  font-style: italic;
  font-weight: 400;
  display: inline-block;
}

.contact-email:hover {
  color: var(--color-lime);
  border-bottom-color: var(--color-lime);
}

.contact p {
  color: var(--color-on-dark-muted);
  font-size: 16px;
  line-height: 1.8;
}

.contact .small-note {
  color: var(--color-on-dark-soft);
  font-size: 13px;
  line-height: 1.6;
}

.contact a[href^="tel"] {
  color: var(--color-on-dark);
  transition: color 0.2s ease;
}

.contact a[href^="tel"]:hover {
  color: var(--color-lime);
}

@media (max-width:768px) {
  html[lang=en] .contact a {
    overflow-wrap: anywhere;
  }
}

@media (max-width:750px) {
  .contact-grid {
    flex-direction: column;
    align-items: start;
  }
}

/* 16. Footer -------------------------------------------------------------- */

.footer {
  background: var(--color-brand-dark);
  color: var(--color-on-dark-soft);
  border-top: 1px solid rgba(130, 157, 143, 0.22);
  padding: 34px 8%;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.footer .footer-identity {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-identity strong {
  font: italic 700 24px/1.1 var(--font-serif);
  color: var(--color-lime);
  letter-spacing: -0.5px;
}

.footer-identity small {
  display: block;
  font-size: 13px;
  color: var(--color-on-dark-muted);
  line-height: 1.4;
  letter-spacing: 0.3px;
}

.footer a {
  color: var(--color-on-dark-muted);
  transition: color 0.2s ease;
}

.footer a:hover {
  color: var(--color-lime);
}

@media (max-width: 750px) {
  .footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding: 28px 6%;
  }
}

/* 17. Back-to-top button -------------------------------------------------- */

.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(11, 48, 44, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--color-white);
  border: 1px solid rgba(216, 235, 175, 0.4);
  box-shadow: var(--shadow-float);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(14px);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease, background 0.2s ease;
  z-index: 99;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--color-accent);
  border-color: rgba(216, 235, 175, 0.8);
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(11, 48, 44, 0.28);
}

.back-to-top:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 4px;
}

@media (max-width: 520px) {
  .back-to-top {
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .back-to-top {
    transition: none;
    animation: none;
  }
}

/* 18. 404 page ------------------------------------------------------------ */

.error-hero {
  min-height: calc(100vh - 280px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 8%;
  background: radial-gradient(circle at 50% 35%, rgba(18, 62, 50, 0.08) 0%, transparent 65%), var(--color-bg);
}

.error-code {
  font: italic 700 clamp(80px, 12vw, 150px)/1 var(--font-serif);
  color: var(--color-accent);
  letter-spacing: -3px;
  margin-bottom: 12px;
}

.error-title {
  font: 500 clamp(24px, 3.2vw, 36px)/1.4 var(--font-sans);
  color: var(--color-ink);
  margin-bottom: 18px;
}

.error-desc {
  font-size: 16px;
  line-height: 1.8;
  color: var(--color-text-muted);
  max-width: 580px;
  margin: 0 auto 36px;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  align-items: center;
}

.error-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  background: var(--color-ink);
  color: var(--color-white);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 16px rgba(18, 62, 50, 0.2);
  transition: all 0.2s ease;
}

.error-btn-primary:hover {
  background: var(--color-accent-bright);
  color: var(--color-white);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(18, 62, 50, 0.28);
}

.error-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--color-line-soft);
  color: var(--color-ink);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.error-btn-secondary:hover {
  background: var(--color-white);
  border-color: var(--color-ink);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(15, 48, 36, 0.08);
}

@media (prefers-reduced-motion:reduce) {
  .error-btn-primary,
  .error-btn-secondary {
    animation: none;
    transition: none;
  }
}

/* 19. Interactive research figures --------------------------------------- */
/* Built by figures.js. Without JavaScript the original <img> stays visible. */

.ifig {
  margin: 36px auto;
  max-width: 920px;
}

.ifig.is-interactive > img {
  display: none;
}

.ifig-card {
  background: var(--color-white);
  border: 1px solid var(--color-line-soft);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  padding: 22px 22px 18px;
}

.ifig-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  font-family: var(--font-sans);
}

.ifig-plot {
  position: relative;
}

.ifig-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.ifig-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  margin: 4px 0 14px;
}

.ifig-slider {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--color-text-muted);
}

.ifig-slider input[type=range] {
  width: 180px;
  accent-color: var(--color-accent);
}

.ifig-value {
  min-width: 3.2em;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--color-ink);
}

.ifig-seg {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-full);
  background: var(--color-bg);
}

.ifig-seg button,
.ifig-steps button,
.ifig-play {
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  border: 0;
  border-radius: var(--radius-full);
  padding: 6px 14px;
  background: transparent;
  color: var(--color-text-muted);
}

.ifig-seg button[aria-pressed=true] {
  background: var(--color-accent);
  color: var(--color-white);
}

.ifig-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.ifig-steps button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--color-line);
  background: var(--color-bg);
}

.ifig-steps button[aria-selected=true] {
  border-color: var(--color-accent);
  background: var(--color-surface);
  color: var(--color-ink);
  font-weight: 600;
}

.ifig-step-n {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-surface-2);
  font-size: 12px;
  font-weight: 700;
  color: var(--color-ink);
}

.ifig-play {
  margin-left: auto;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  font-weight: 600;
}

.ifig-seg button:focus-visible,
.ifig-steps button:focus-visible,
.ifig-play:focus-visible,
.ifig-svg [tabindex]:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 3px;
}

.ifig-desc {
  min-height: 3.4em;
  margin: 12px 0 4px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--color-text);
}

.ifig-desc strong {
  color: var(--color-ink);
}

.ifig-note {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--color-text-soft);
}

.ifig-sub {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--color-line);
  border-radius: 8px;
  transition: background 0.3s ease;
}

.ifig-sub.is-highlight {
  background: linear-gradient(var(--color-bg), transparent 70%);
}

.ifig-subhead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 14px;
  color: var(--color-ink);
}

.ifig-formula {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 15px;
  color: var(--color-text-muted);
}

.ifig-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.ifig-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ifig-legend i {
  display: inline-block;
  width: 18px;
  height: 0;
  border-top: 2px solid;
}

.ifig-legend .k-band,
.ifig-legend .k-total { border-color: var(--color-fig-green); border-top-width: 3px; }
.ifig-legend .k-gap { height: 10px; border: 0; border-radius: 2px; background: var(--color-fig-warm); opacity: 0.35; }
.ifig-legend .k-light { border-top: 2px dashed var(--color-line-strong); }
.ifig-legend .k-up { border-top: 2px dashed var(--color-fig-warm); }
.ifig-legend .k-dn { border-top: 2px dotted var(--color-fig-violet); }

/* tooltip */
.ifig-tip {
  position: absolute;
  z-index: 3;
  pointer-events: none;
  padding: 6px 10px;
  border: 1px solid var(--color-line);
  border-radius: 8px;
  background: var(--color-white);
  box-shadow: var(--shadow-card);
  font-size: 12px;
  line-height: 1.5;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.ifig-tip strong {
  color: var(--color-ink);
  font-variant-numeric: tabular-nums;
}

/* SVG marks */
.ifig-axis { stroke: var(--color-line-strong); stroke-width: 1; }
.ifig-grid { stroke: var(--color-line-soft); stroke-width: 1; }
.ifig-tick { font-size: 13px; fill: var(--color-text-soft); font-variant-numeric: tabular-nums; }
.ifig-cap { font-size: 14px; fill: var(--color-text-muted); }
.ifig-axis-label { font-family: var(--font-serif); font-style: italic; font-size: 18px; fill: var(--color-ink); }
.ifig-hit { fill: transparent; cursor: crosshair; }
.ifig-hit:focus { outline: none; }
.ifig-cross { stroke: var(--color-text-soft); stroke-width: 1; stroke-dasharray: 3 3; }
.ifig-dot { fill: var(--color-white); stroke: var(--color-fig-green); stroke-width: 2.5; }

/* setup schematic */
.ifig-stage { transition: opacity 0.25s ease; }
.ifig-stage.is-dim { opacity: 0.28; }
.ifig-beam { stroke: var(--color-line-strong); stroke-width: 2; stroke-dasharray: 6 5; fill: none; }
.ifig-substrate { fill: var(--color-text-muted); }
.ifig-grating { fill: none; stroke: var(--color-text-muted); stroke-width: 2; stroke-linejoin: round; }
.ifig-packet-env { fill: var(--color-fig-green); opacity: 0.16; }
.ifig-packet-wave { fill: none; stroke: var(--color-fig-green); stroke-width: 2.5; }
.ifig-packet.is-shaped .ifig-packet-env { fill: var(--color-fig-warm); }
.ifig-packet.is-shaped .ifig-packet-wave { stroke: var(--color-fig-warm); }
.ifig-photon { fill: none; stroke: var(--color-fig-warm); stroke-width: 2.5; }
.ifig-photon-dir, .ifig-emitted-dir { stroke: var(--color-text-muted); stroke-width: 2.5; }
.ifig-emitted { fill: none; stroke: var(--color-fig-violet); stroke-width: 2.5; }
.ifig-device { fill: var(--color-surface); stroke: var(--color-text-muted); stroke-width: 1.5; }
.ifig-device-bar { fill: var(--color-fig-green); }
.ifig-badge { cursor: pointer; }
.ifig-badge circle { fill: var(--color-surface-2); stroke: var(--color-white); stroke-width: 2; transition: fill 0.2s ease; }
.ifig-badge text { font-size: 15px; font-weight: 700; fill: var(--color-ink); }
.ifig-badge.is-active circle, .ifig-badge:hover circle { fill: var(--color-accent); }
.ifig-badge.is-active text, .ifig-badge:hover text { fill: var(--color-white); }

/* PINEM bars */
.ifig-bar { fill: var(--color-fig-green); transition: y 0.15s ease, height 0.15s ease; }
.ifig-bar.is-zero { fill: var(--color-accent); }
.ifig-bar:focus { outline: none; stroke: var(--color-focus); stroke-width: 2; }

/* dispersion */
.ifig-light { stroke: var(--color-line-strong); stroke-width: 1.5; stroke-dasharray: 5 5; fill: none; }
.ifig-band { fill: none; stroke: var(--color-fig-green); stroke-width: 3; stroke-linecap: round; }
.ifig-gapfill { fill: var(--color-fig-warm); opacity: 0.22; stroke: var(--color-fig-warm); stroke-width: 1.5; stroke-dasharray: 4 3; }
.ifig-gaplabel { font-size: 14px; font-weight: 600; fill: var(--color-ink); }
.ifig-wave { fill: none; stroke: var(--color-fig-green); stroke-width: 2; }
.ifig-env { fill: none; stroke: var(--color-fig-warm); stroke-width: 1.5; stroke-dasharray: 5 4; }

/* concept map */
.ifig-edge { stroke: var(--color-line-strong); stroke-width: 3; transition: stroke 0.2s ease, opacity 0.2s ease; }
.ifig-node ellipse { fill: var(--color-white); stroke: var(--color-text-muted); stroke-width: 1.5; transition: fill 0.2s ease, stroke 0.2s ease; }
.ifig-node.is-center ellipse { fill: var(--color-surface); stroke: var(--color-accent); stroke-width: 2; }
.ifig-node-name { font-size: 19px; font-weight: 700; fill: var(--color-ink); }
.ifig-node.is-center .ifig-node-name { font-size: 24px; }
.ifig-node-year { font-size: 16px; fill: var(--color-text-muted); font-variant-numeric: tabular-nums; }
.ifig-node, .ifig-theme { cursor: pointer; transition: opacity 0.2s ease; }
.ifig-theme text { font-size: 16px; fill: var(--color-text-muted); }
.ifig-svg.is-focus .ifig-node:not(.is-on),
.ifig-svg.is-focus .ifig-theme:not(.is-on),
.ifig-svg.is-focus .ifig-edge:not(.is-on) { opacity: 0.22; }
.ifig-svg.is-focus .ifig-node.is-on:not(.is-center) ellipse { fill: var(--color-surface); stroke: var(--color-accent); }
.ifig-svg.is-focus .ifig-edge.is-on { stroke: var(--color-accent); }
.ifig-svg.is-focus .ifig-theme.is-on text { fill: var(--color-ink); font-weight: 600; }

/* measurement */
.ifig-total { fill: none; stroke: var(--color-fig-green); stroke-width: 3; }
.ifig-comp { fill: none; stroke-width: 2; }
.ifig-comp.up { stroke: var(--color-fig-warm); stroke-dasharray: 6 4; }
.ifig-comp.dn { stroke: var(--color-fig-violet); stroke-dasharray: 2 4; }
.ifig-direct { font-size: 16px; font-weight: 600; fill: var(--color-ink); }
.ifig-mean { stroke: var(--color-ink); stroke-width: 1.5; }
.ifig-qc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-bottom: 12px;
  font-size: 15px;
}
.ifig-qc-q, .ifig-qc-c { font-family: var(--font-serif); font-size: 22px; color: var(--color-ink); }
.ifig-qc-arrows { display: flex; flex-direction: column; font-size: 12px; line-height: 1.6; }
.ifig-qc-arrows .to-c { color: var(--color-fig-green); }
.ifig-qc-arrows .to-q { color: var(--color-fig-warm); }
.ifig-badge-pill {
  margin-left: auto;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--color-surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-accent);
}
.ifig-badge-pill[data-regime=strong] { background: var(--color-accent); color: var(--color-white); }

/* key-feature list and gap table (static HTML) */
.ifig-features {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 24px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: feat;
}
.ifig-features li {
  position: relative;
  padding-left: 34px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--color-text);
}
.ifig-features li::before {
  counter-increment: feat;
  content: counter(feat);
  position: absolute;
  left: 0;
  top: 1px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-surface-2);
  font-size: 12px;
  font-weight: 700;
  color: var(--color-ink);
}
.ifig-features em { font-style: normal; color: var(--color-fig-warm); font-weight: 600; }

.gap-table-wrap { overflow-x: auto; }
.gap-table {
  width: 100%;
  min-width: 560px;
  border-collapse: separate;
  border-spacing: 4px;
  font-size: 14px;
  text-align: center;
}
.gap-table th { padding: 10px 8px; background: var(--color-surface); color: var(--color-ink); font-weight: 600; border-radius: 6px; }
.gap-table th[scope=row] { font-family: var(--font-serif); font-size: 16px; }
.gap-table thead th:first-child { background: var(--color-accent); color: var(--color-white); font-family: var(--font-serif); font-style: italic; }
.gap-table td { padding: 10px 8px; border-radius: 6px; }
.gap-table .kk { background: var(--color-surface); color: var(--color-ink); }
.gap-table .uk { background: var(--color-line-soft); color: var(--color-text); }
.gap-table .ku { background: var(--color-line-strong); color: var(--color-brand-dark); }
.gap-table .uu { background: var(--color-text-muted); color: var(--color-white); }
.gap-table .fb { background: var(--color-white); border: 1px dashed var(--color-fig-warm); color: var(--color-fig-warm); font-weight: 600; }

@media (max-width: 750px) {
  .ifig-card { padding: 16px 12px 14px; }
  .ifig-two { grid-template-columns: 1fr; }
  .ifig-slider { width: 100%; }
  .ifig-slider input[type=range] { flex: 1; width: auto; }
  .ifig-play { margin-left: 0; }
  .ifig-features { grid-template-columns: 1fr; }
  .ifig-badge-pill { margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .ifig-stage, .ifig-bar, .ifig-edge, .ifig-node, .ifig-theme, .ifig-sub { transition: none; }
}

/* compact layout (figure narrower than 560px): larger SVG text, fewer labels */
.ifig-card.is-compact .ifig-tick { font-size: 17px; }
.ifig-card.is-compact .ifig-cap { font-size: 17px; }
.ifig-card.is-compact .ifig-axis-label { font-size: 22px; }
.ifig-card.is-compact .ifig-gaplabel { font-size: 17px; }
.ifig-card.is-compact .ifig-setup .ifig-cap { display: none; }
.ifig-card.is-compact .ifig-badge text { font-size: 22px; }
.ifig-card.is-compact .ifig-direct { font-size: 20px; }

.ifig-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ifig-chip {
  font: inherit;
  font-size: 12px;
  padding: 5px 12px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-full);
  background: var(--color-bg);
  color: var(--color-text-muted);
  cursor: pointer;
}
.ifig-chips.is-focus .ifig-chip:not(.is-on) { opacity: 0.4; }
.ifig-chip.is-on { border-color: var(--color-accent); color: var(--color-ink); font-weight: 600; }

/* concept triangle and Floquet figure */
.ifig-core { stroke: var(--color-accent); stroke-width: 1.5; stroke-dasharray: 5 4; }
.ifig-core-text { font-size: 20px; font-weight: 700; fill: var(--color-ink); }
.ifig-card.is-compact .ifig-core-text { font-size: 19px; }
.ifig-zone { fill: var(--color-surface); opacity: 0.7; }
.ifig-replica { fill: none; stroke: var(--color-fig-green); stroke-width: 2; stroke-dasharray: 6 5; opacity: 0.55; }
.ifig-legend .k-replica { border-top: 2px dashed var(--color-fig-green); opacity: 0.6; }
.ifig-heat canvas { display: block; width: 100%; height: auto; aspect-ratio: 328 / 240; border: 1px solid var(--color-line-soft); border-radius: 6px; image-rendering: pixelated; cursor: crosshair; }
.ifig-heat-title { margin: 4px 0 8px; font-size: 13px; color: var(--color-text-muted); }
.ifig-heat-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--color-text-soft); }
.ifig-chip.is-static { cursor: default; color: var(--color-ink); background: var(--color-surface); border-color: var(--color-line-soft); }
.ifig-qc .ifig-note { flex-basis: 100%; margin: 0; }
.prose img.img-cutout,
.research-figures figure img.img-cutout,
img.img-cutout { background: transparent; border: 0; box-shadow: none; padding: 0; }
.prose img.img-cutout:hover,
.research-figures figure img.img-cutout:hover { box-shadow: none; }

/* keep the soliton comparison figure at a readable size */
.research-figures figure img.img-cutout { max-width: 760px; margin-inline: auto; }

/* footer credit line */
.footer .footer-credit { margin-top: 4px; opacity: 0.85; }
.footer .footer-credit a { text-decoration: underline; text-underline-offset: 3px; }
