/* Shared site foundation and homepage layout. Chinese adjustments live in zh-locale.css. */
/* Self-hosted Inter, with a system-font fallback while loading. */
@import url("./design-tokens.css?v=1");
:root {
  --paper: var(--site-paper);
  --bg: var(--site-bg);
  --ink: var(--site-ink);
  --muted: var(--site-muted);
  --accent: var(--site-accent);
  --line: var(--site-line);
  --wash: var(--site-wash);
  --sans: var(--site-sans);
  --serif: var(--site-serif);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 32px; }
body { margin: 0; color: var(--ink); background-color: var(--bg); background-image:
  linear-gradient(180deg, #f8fbff 0%, #edf5fc 65%, #e7f1fa 100%);
  background-size: 100% 100%; font-family: var(--sans); font-size: 16px; line-height: 1.7; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:hover { text-decoration: underline; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 2px; }
img { display: block; max-width: 100%; }
h1, h2, h3, p, figure { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 400; }
h2 { font-size: clamp(27px, 3vw, 34px); line-height: 1.2; letter-spacing: -.7px; }
h3 { font-size: 19px; font-weight: 600; line-height: 1.35; letter-spacing: -.35px; }
.shell, .header-inner { width: min(1080px, calc(100% - 96px)); margin-inline: auto; }
.skip-link { position: absolute; top: 12px; left: 12px; padding: 8px 16px; transform: translateY(-160%); background: var(--ink); color: white; z-index: 30; }
.skip-link:focus { transform: none; }
.site-header { border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .78); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 88px; gap: 24px; }
.brand { color: var(--ink); font-family: var(--serif); font-size: 26px; letter-spacing: -.6px; text-decoration: none; white-space: nowrap; }
.brand-dot { color: var(--accent); }
.site-nav { display: flex; align-items: center; gap: 27px; font-size: 15px; }
.site-nav a { text-decoration: none; color: var(--muted); }
.site-nav a:hover { color: var(--accent); text-decoration: underline; }
.site-nav .lang-switch { padding-left: 22px; border-left: 1px solid var(--line); }
.mobile-nav { display: none; position: relative; }
.mobile-nav summary { display: flex; align-items: center; gap: 14px; list-style: none; cursor: pointer; padding: 8px 0 8px 12px; font-size: 15px; }
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav summary span { font-size: 23px; line-height: 1; }
.mobile-nav[open] summary span { transform: rotate(45deg); }
.mobile-site-nav { position: absolute; top: 48px; right: 0; width: 210px; display: grid; padding: 14px; border: 1px solid var(--line); background: var(--paper); box-shadow: 0 12px 28px #254e7118; z-index: 10; }
.mobile-site-nav a { padding: 9px 12px; text-decoration: none; }
.eyebrow { color: var(--accent); font-size: 11px; font-weight: 600; line-height: 1.5; letter-spacing: 1.65px; text-transform: uppercase; margin-bottom: 14px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 224px; gap: 90px; align-items: start; padding: 82px 0 74px; }
h1 { margin: 13px 0 9px; font-size: clamp(46px, 4.6vw, 58px); line-height: 1.1; letter-spacing: -1.5px; }
/* English name/degree mirrors the Chinese name row without changing either biography. */
body[data-en-page="home"] .hero-name-row { display: flex; align-items: baseline; gap: 14px; margin-bottom: 22px; }
body[data-en-page="home"] .hero-name-row h1 { margin-bottom: 0; }
body[data-en-page="home"] .hero-degree { flex-shrink: 0; font-size: 18px; color: var(--muted); }
.hero-position { color: var(--accent); font-weight: 500; font-size: 16px; margin-bottom: 30px; }
.hero-intro { font-size: 23px; line-height: 1.5; letter-spacing: -.45px; max-width: 620px; margin-bottom: 17px; }
.hero-description { max-width: 62ch; color: var(--muted); font-size: 17px; line-height: 1.8; }
.hero-links { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 25px; font-size: 15px; font-weight: 500; }
.hero-links a { text-decoration: none; }
.hero-links a:hover { text-decoration: underline; }
.hero-links span { margin-left: 5px; }
.portrait-frame { padding-top: 17px; }
.portrait-frame img { width: 224px; height: auto; border-radius: 5px; border: 0; outline: 0; box-shadow: none; }
.portrait-frame figcaption { margin-top: 14px; color: var(--muted); font-size: 11px; text-align: center; }
.content-section { border-top: 1px solid var(--line); padding: 45px 0 52px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 25px; }
.section-heading .eyebrow { margin-bottom: 10px; }
.section-link { flex-shrink: 0; font-size: 14px; text-decoration: none; padding-bottom: 4px; }
.section-link span { margin-left: 8px; }
.research-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 35px; padding: 25px; background: rgba(255, 255, 255, .82); border: 1px solid var(--line); border-radius: 6px; }
.research-item { padding: 0 27px; border-left: 1px solid var(--line); display: flex; flex-direction: column; align-items: start; }
.research-item:first-child { padding-left: 0; border-left: 0; }
.research-item:last-child { padding-right: 0; }
.research-number { color: var(--accent); font-size: 12px; margin-bottom: 14px; font-variant-numeric: tabular-nums; }
.research-item h3 { margin-bottom: 13px; }
.research-item p { font-size: 16px; line-height: 1.8; color: var(--muted); margin-bottom: 18px; }
.research-item a { font-size: 14px; text-decoration: none; margin-top: auto; }
.section-intro { margin: 18px 0 5px; color: var(--muted); font-size: 16px; }
#publication-status { font-size: 15px; color: var(--muted); margin-top: 25px; }
#publication-status[hidden] { display: none; }
.pub-list { margin: 24px 0 0; padding: 0 25px; list-style: none; background: rgba(255, 255, 255, .88); border: 1px solid var(--line); border-radius: 6px; }
.pub-list:empty { display: none; }
.pub-list li { display: grid; grid-template-columns: 176px minmax(0, 1fr); gap: 32px; padding: 29px 0; border-bottom: 1px solid var(--line); }
.pub-list li:last-child { border-bottom: 0; }
.pub-image { display: flex; align-items: center; justify-content: center; align-self: start; height: 132px; background: white; border: 1px solid var(--line); padding: 9px; }
.pub-image img { width: 100%; height: 100%; object-fit: contain; }
.pub-venue { color: var(--accent); font-size: 11px; letter-spacing: .7px; font-weight: 600; margin-bottom: 8px; }
.pub-title { color: var(--ink); font-family: var(--sans); font-size: 18px; font-weight: 600; line-height: 1.5; text-decoration: none; }
.pub-title:hover { color: var(--accent); }
.pub-authors { color: var(--muted); font-size: 14px; line-height: 1.7; margin-top: 9px; }
.pub-authors strong { font-weight: 600; color: var(--ink); }
.pub-note { color: var(--muted); font-size: 15px; line-height: 1.65; margin-top: 7px; }
.pub-links { display: flex; gap: 20px; margin-top: 10px; font-size: 14px; }
.pub-links a { text-decoration: none; }
.about-grid { display: grid; grid-template-columns: 1.12fr 1fr; gap: 82px; }
.about-grid h2 { font-size: 29px; margin-bottom: 23px; }
.about-grid p:not(.eyebrow) { font-size: 16px; line-height: 1.9; color: var(--muted); }
/* Approved English biography: quiet list styling with hanging indentation. */
body[data-en-page="home"] .about-list { margin: 0; padding-inline-start: 20px; list-style: disc outside; font-size: 16px; font-weight: 400; line-height: 1.9; color: var(--muted); }
body[data-en-page="home"] .about-list > li { padding-inline-start: 4px; }
body[data-en-page="home"] .about-list > li + li { margin-top: 16px; }
.selected-honors { margin-top: 25px; }
.selected-honors h3 { font-size: 14px; font-weight: 600; letter-spacing: 0; margin-bottom: 11px; }
.honors-list { list-style: none; margin: 0; padding: 0; }
.honors-list li { display: flex; align-items: baseline; gap: 18px; justify-content: space-between; font-size: 15px; line-height: 1.75; }
.honors-list li + li { margin-top: 7px; }
.honors-list li > span { min-width: 0; }
.honors-list time { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.about-grid .academic-roles { margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); font-size: 14px !important; }
.book-link { margin-top: 22px; display: block; font-family: var(--serif); font-size: 20px; text-decoration: none; }
.book-link span:first-child { display: block; font-family: var(--sans); font-size: 10px; letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 5px; color: var(--muted); }
.book-link span:last-child { font-family: var(--sans); font-size: 15px; margin-left: 8px; }
.join-section { margin-bottom: 62px; padding: 33px 37px; display: flex; align-items: center; justify-content: space-between; gap: 40px; background: linear-gradient(120deg, #f8fcff, #deedf9); border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0; }
.join-section .eyebrow { margin-bottom: 9px; }
.join-section h2 { font-size: 28px; }
.join-section p:not(.eyebrow) { color: var(--muted); font-size: 16px; line-height: 1.8; margin-top: 12px; max-width: 65ch; }
.join-link { font-size: 14px; white-space: nowrap; text-decoration: none; border-bottom: 1px solid var(--accent); padding-bottom: 5px; }
.site-footer { border-top: 1px solid var(--line); padding-block: 31px 24px; }
.footer-top { display: flex; justify-content: space-between; align-items: center; gap: 25px; }
.footer-top .brand { font-size: 23px; }
.footer-top p { color: var(--muted); font-size: 14px; margin-top: 7px; }
.footer-top > a { font-size: 14px; text-decoration: none; }
.footer-bottom { display: flex; justify-content: space-between; gap: 25px; color: var(--muted); font-size: 10px; padding-top: 29px; }
.footer-bottom > div { display: flex; flex-wrap: wrap; gap: 22px; }
.footer-bottom a { color: var(--muted); text-decoration: none; }
@media (max-width: 960px) {
  .hero { gap: 48px; grid-template-columns: minmax(0, 1fr) 190px; }
  .site-nav { gap: 18px; }
  .research-item { padding-inline: 20px; }
  .about-grid { gap: 45px; }
}
@media (max-width: 760px) {
  .shell, .header-inner { width: calc(100% - 48px); }
  .site-nav { display: none; }
  .mobile-nav { display: block; }
  .header-inner { min-height: 72px; }
  .hero { gap: 28px; padding-block: 48px; grid-template-columns: minmax(0, 1fr) 148px; }
  .hero-intro { font-size: 21px; }
  .hero-position { margin-bottom: 24px; }
  .portrait-frame figcaption { font-size: 10px; }
  .research-grid { grid-template-columns: 1fr; gap: 24px; margin-top: 28px; padding: 22px; }
  .research-item, .research-item:first-child, .research-item:last-child { padding: 0 0 22px; border: 0; border-bottom: 1px solid var(--line); }
  .research-item:last-child { border-bottom: 0; padding-bottom: 0; }
  .research-number { margin-bottom: 8px; }
  .research-item p { margin-bottom: 12px; }
  .content-section { padding-block: 35px 40px; }
  .section-heading { align-items: start; }
  .section-link { margin-top: 5px; }
  .pub-list li { grid-template-columns: 130px minmax(0, 1fr); gap: 23px; }
  .pub-image { height: 105px; }
  .about-grid { grid-template-columns: 1fr; gap: 34px; }
  .join-section { display: block; padding: 28px; margin-bottom: 40px; }
  .join-link { display: inline-block; margin-top: 20px; }
}
@media (max-width: 520px) {
  .hero { grid-template-columns: 1fr; gap: 28px; }
  .portrait-frame { grid-row: 1; display: flex; align-items: end; gap: 20px; padding: 0; }
  .portrait-frame img { width: 100px; height: auto; }
  .portrait-frame figcaption { text-align: left; max-width: 130px; font-size: 11px; margin: 0 0 4px; }
  h1 { font-size: 48px; }
  .hero .eyebrow { font-size: 10px; letter-spacing: 1.2px; }
  .hero-intro { font-size: 21px; }
  .hero-links { gap: 22px; }
  .section-heading { display: block; }
  .section-link { display: inline-block; margin-top: 14px; }
  .pub-list { padding-inline: 18px; }
  .pub-list li { grid-template-columns: 1fr; gap: 18px; }
  .pub-image { width: 160px; height: 118px; }
  .footer-top, .footer-bottom { align-items: start; flex-direction: column; gap: 15px; }
  .footer-bottom > div { gap: 18px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Match the Chinese homepage portrait dimensions and undecorated image treatment.
   Preserve the English title and copy layout rather than importing Chinese mobile text rules. */
body[data-en-page="home"] .portrait-frame img { width: 190px; height: auto; border-radius: 5px; border: 0; outline: 0; box-shadow: none; }
@media (min-width: 761px) {
  body[data-en-page="home"] .hero { grid-template-columns: minmax(0, 1fr) 190px; }
}
@media (min-width: 521px) and (max-width: 760px) {
  body[data-en-page="home"] .hero { grid-template-columns: minmax(0, 1fr) 72px; }
}
@media (max-width: 760px) {
  body[data-en-page="home"] .portrait-frame img { width: 72px; }
}

/* Quiet grid background shared by Chinese and English pages.
   Major and minor grid lines sit behind existing white content surfaces. */
body:is(.zh-unified, [data-en-page]) {
  --depth-shadow: 0 3px 8px rgba(37, 65, 87, .025), 0 16px 38px -18px rgba(37, 65, 87, .19);
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 72% 100% at 50% 0%, rgba(255, 255, 255, .76), transparent 78%),
    linear-gradient(180deg, #f7f9fc 0%, #f1f5f9 100%);
}
body:is(.zh-unified, [data-en-page])::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  /* Four minor cells per major cell; a shared origin keeps both scales aligned. */
  background-image:
    linear-gradient(rgba(83, 112, 138, .09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(83, 112, 138, .09) 1px, transparent 1px),
    linear-gradient(rgba(83, 112, 138, .034) 1px, transparent 1px),
    linear-gradient(90deg, rgba(83, 112, 138, .034) 1px, transparent 1px);
  background-size: 192px 192px, 192px 192px, 48px 48px, 48px 48px;
  background-position: 0 0;
  opacity: .85;
}
body:is(.zh-unified, [data-en-page]).en-inner::before { opacity: .60; }
/* Elevate whole content groups, not individual papers, honors or nested cards. */
body:is(.zh-unified, [data-en-page]) .research-grid,
body:is(.zh-unified, [data-en-page]) .pub-list,
body:is(.zh-unified, [data-en-page]) .en-surface {
  background: var(--paper);
  border-color: #d9e3ec;
  box-shadow: var(--depth-shadow);
}

@media (max-width: 1100px) {
  body:is(.zh-unified, [data-en-page])::before { opacity: .65; }
  body:is(.zh-unified, [data-en-page]).en-inner::before { opacity: .45; }
}
@media (max-width: 760px) {
  body:is(.zh-unified, [data-en-page]) { --depth-shadow: 0 5px 16px -9px rgba(37, 65, 87, .14); }
  body:is(.zh-unified, [data-en-page])::before { display: none; }
}
@media print {
  body:is(.zh-unified, [data-en-page]) { background: white; --depth-shadow: none; }
  body:is(.zh-unified, [data-en-page])::before { display: none; }
  body:is(.zh-unified, [data-en-page]) .portrait-frame img { box-shadow: none; }
}

/* English honors and teaching adopt the approved Chinese section geometry. */
body[data-en-page="home"] .home-honors { padding-bottom: 32px; }
body[data-en-page="home"] .home-teaching { padding-top: 32px; }
body[data-en-page="home"] .home-honors-grid, body[data-en-page="home"] .home-teaching-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; align-items: start; margin-top: 26px; }
body[data-en-page="home"] .home-honors-column, body[data-en-page="home"] .home-teaching-grid > div { min-width: 0; }
body[data-en-page="home"] .home-column-heading { margin: 0 0 16px; font-size: 18px; font-weight: 400; line-height: 1.6; }
body[data-en-page="home"] .home-honors .selected-honors { margin-top: 0; }
body[data-en-page="home"] .paper-award-list { list-style: none; margin: 0; padding: 0; }
body[data-en-page="home"] .paper-award-item + .paper-award-item { margin-top: 10px; }
body[data-en-page="home"] .paper-award-main { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
body[data-en-page="home"] .paper-award-title { min-width: 0; color: var(--ink); font-size: 14px; font-weight: 400; line-height: 1.6; overflow-wrap: anywhere; }
body[data-en-page="home"] a.paper-award-title { color: var(--accent); text-decoration: none; }
body[data-en-page="home"] a.paper-award-title:hover { text-decoration: underline; text-underline-offset: 3px; }
body[data-en-page="home"] .paper-award-main time { flex-shrink: 0; color: var(--muted); font-size: 13px; line-height: 1.6; font-variant-numeric: tabular-nums; }
body[data-en-page="home"] .paper-award-role { margin: 3px 0 0; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.5; }
body[data-en-page="home"] .paper-awards-more { margin-top: 12px; }
body[data-en-page="home"] .paper-awards-more > summary { width: fit-content; padding-block: 4px; cursor: pointer; color: var(--accent); font-size: 13px; font-weight: 400; line-height: 1.6; }
body[data-en-page="home"] .paper-awards-more > .paper-award-list { margin-top: 12px; }
body[data-en-page="home"] .paper-awards-show-less { display: none; }
body[data-en-page="home"] .paper-awards-more[open] .paper-awards-show-more { display: none; }
body[data-en-page="home"] .paper-awards-more[open] .paper-awards-show-less { display: inline; }

body[data-en-page="home"] .teaching-intro p { font-size: 15px; font-weight: 400; line-height: 1.8; }
body[data-en-page="home"] .teaching-intro p + p { margin-top: 14px; }
body[data-en-page="home"] .teaching-course-list { list-style: none; margin: 0; padding: 0; }
body[data-en-page="home"] .teaching-course-item + .teaching-course-item { margin-top: 12px; }
body[data-en-page="home"] .teaching-course-title { display: block; color: var(--ink); font-size: 14px; font-weight: 400; line-height: 1.6; overflow-wrap: anywhere; }
body[data-en-page="home"] .teaching-course-meta { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.65; }
body[data-en-page="home"] .teaching-intro .teaching-collaborators { margin-top: 14px; color: var(--muted); font-size: 12px; line-height: 1.75; }

body[data-en-page="home"] .teaching-resource-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; list-style: none; padding: 0; margin: 22px 0 0; }
body[data-en-page="home"] .teaching-resource-grid[hidden] { display: none; }
body[data-en-page="home"] .teaching-resource-grid > li { min-width: 0; }
body[data-en-page="home"] .teaching-resource-card { display: flex; flex-direction: column; height: 100%; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--paper); text-decoration: none; }
body[data-en-page="home"] .teaching-resource-card:hover { border-color: var(--accent); text-decoration: none; }
body[data-en-page="home"] .teaching-resource-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
body[data-en-page="home"] .teaching-resource-cover { display: flex; align-items: center; justify-content: center; height: 132px; padding: 10px; background: var(--wash); }
body[data-en-page="home"] .teaching-resource-cover img { display: block; width: 100%; height: 100%; object-fit: contain; }
body[data-en-page="home"] .teaching-resource-copy { display: flex; flex-direction: column; gap: 5px; padding: 10px; }
body[data-en-page="home"] .teaching-resource-type { color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.5; }
body[data-en-page="home"] .teaching-resource-title { font-size: 13px; font-weight: 400; line-height: 1.65; overflow-wrap: anywhere; }
body[data-en-page="home"] .teaching-resource-card:hover .teaching-resource-title { text-decoration: underline; text-underline-offset: 3px; }

body[data-en-page="home"] .home-about .about-list { margin-top: 26px; }
body[data-en-page="home"] .home-about .academic-roles { margin-top: 20px; color: var(--muted); font-size: 14px; }
@media (max-width: 760px) {
  body[data-en-page="home"] .home-honors-grid, body[data-en-page="home"] .home-teaching-grid { grid-template-columns: 1fr; gap: 24px; margin-top: 22px; }
  body[data-en-page="home"] .teaching-resource-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 360px) {
  body[data-en-page="home"] .teaching-resource-grid { grid-template-columns: 1fr; }
}

/* Mobile biography disclosure: plain text control, with the original desktop paragraph spacing. */
.home-biography-toggle { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; margin-top: 8px; padding: 4px 0; border: 0; background: none; color: var(--accent); font: inherit; font-size: 14px; font-weight: 400; cursor: pointer; }
.home-biography-toggle::after { content: ''; width: 5px; height: 5px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.home-biography-toggle[aria-expanded="true"]::after { transform: translateY(1px) rotate(225deg); }
.home-biography-toggle:hover { text-decoration: underline; text-underline-offset: 4px; }
.home-biography-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 2px; }
.home-biography-toggle[hidden], .home-biography-more[hidden] { display: none; }
.hero-biography .home-biography-more > p { margin: 18px 0 0; }
@media (max-width: 760px) {
  .hero-biography .home-biography-more > p { margin-top: 12px; }
}
@media print {
  .home-biography-toggle { display: none !important; }
  .home-biography-more[hidden] { display: block !important; }
}
