/* =====================================================================
   陈力 Li Chen — academic homepage
   Tokens → base → components → pages → figures → responsive → print
   ===================================================================== */

/* Theme: dark by default (html[data-theme="dark"], also used when the attribute is missing) and light when the
   visitor picks it (html[data-theme="light"]; chosen with the sun / moon button, remembered in localStorage).
   Palette and type follow the Human Cortex lncRNA Atlas (http://172.16.78.77:8060/). */
:root, html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c0e12;
  --bg-2: #101318;
  --surface: #151920;
  --surface-2: #1a1f27;
  --surface-3: #222833;
  --ink: #f2f4f7;
  --ink-2: #c3c9d3;
  --ink-3: #8a92a2;
  --line: #2a303b;
  --line-2: #3a414d;
  --accent: #5a9cea;
  --accent-2: #8ab8f0;      /* hover, and text on --accent-soft */
  --accent-soft: #1b2b41;
  --on-accent: #0b1220;

  --c-plant: #8cc472;  --c-plant-soft: #1c2a1a;
  --c-brain: #ad93e6;  --c-brain-soft: #241f36;
  --c-cell:  #e89a5e;  --c-cell-soft:  #33261d;
  --c-space: #4fc3c9;  --c-space-soft: #12292c;

  --if-bg: #3a2a18; --if-ink: #f2c38c;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -12px rgba(0, 0, 0, .55);
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f5f7;
  --bg-2: #eceef2;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --surface-3: #eef0f4;
  --ink: #0f1216;
  --ink-2: #464d5a;
  --ink-3: #687080;
  --line: #e1e4ea;
  --line-2: #cfd4dc;
  --accent: #2a78d6;
  --accent-2: #1c5cab;
  --accent-soft: #e7f0fb;
  --on-accent: #ffffff;

  --c-plant: #4d8a37;  --c-plant-soft: #e9f1e3;
  --c-brain: #6a4ca0;  --c-brain-soft: #efeaf7;
  --c-cell:  #c2652a;  --c-cell-soft:  #f8ebe1;
  --c-space: #0e7c83;  --c-space-soft: #e0f1f1;

  --if-bg: #fbe9cf; --if-ink: #8a4a12;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .07);
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 10px 30px -12px rgba(16, 24, 40, .18);
}
:root {
  --radius: 12px;
  --wrap: 1120px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", "WenQuanYi Micro Hei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

/* ------------------------------------------------------------- language switch
   Every bilingual fragment is rendered twice (.l-zh / .l-en); <html data-lang> decides which one shows. */
html[data-lang="zh"] .l-en,
html[data-lang="en"] .l-zh { display: none !important; }

/* ------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 76px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-sans); font-size: 16px; line-height: 1.7;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
  min-height: 100vh; display: flex; flex-direction: column;   /* short pages keep the footer at the bottom */
}
main { flex: 1 0 auto; }
html[data-lang="zh"] body { line-height: 1.8; }
img, svg { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
p, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; }
button { font: inherit; color: inherit; }
sup { line-height: 0; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 12px; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--ink-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }

.icon { width: 1em; height: 1em; flex: none; display: inline-block; vertical-align: -0.125em; fill: currentColor; }
.icon-stroke { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------- top bar */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 12px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; white-space: nowrap; }
.brand:hover { color: var(--ink); text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, #2a78d6, #9b4fb0); color: #fff; font-size: 15px; font-weight: 700;
}
.brand-name { font-size: 15.5px; }
.brand-name .en { font-weight: 500; color: var(--ink-3); margin-left: 6px; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.nav a { color: var(--ink-2); font-size: 14.5px; font-weight: 520; padding: 7px 10px; border-radius: 7px; white-space: nowrap; }
.nav a:hover { color: var(--ink); background: var(--surface-3); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--accent-2); background: var(--accent-soft); font-weight: 600; }
html[data-lang="zh"] .nav a { order: var(--oz); }
html[data-lang="en"] .nav a { order: var(--oe); }
.lang-switch { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: var(--surface); flex: none; }
.lang-switch button { border: 0; background: transparent; cursor: pointer; font-size: 13px; font-weight: 600; padding: 0 11px; height: 34px; color: var(--ink-2); }
.lang-switch button + button { border-left: 1px solid var(--line); }
.lang-switch button:hover { background: var(--surface-3); }
.lang-switch button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.theme-toggle, .menu-btn {
  flex: none; width: 36px; height: 36px; display: inline-grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface); border-radius: 8px; color: var(--ink-2);
}
.theme-toggle:hover, .menu-btn:hover { background: var(--surface-3); color: var(--ink); }
.theme-toggle .icon { font-size: 18px; }
html[data-theme="light"] .theme-toggle .i-sun, html:not([data-theme="light"]) .theme-toggle .i-moon { display: none; }
.menu-btn { display: none; }
.menu-btn .icon { font-size: 20px; }

/* ------------------------------------------------------------- buttons, chips, badges */
.btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface);
  color: var(--ink); font-size: 14.5px; font-weight: 600; white-space: nowrap; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: border-color .15s, background .15s, color .15s;
}
.btn:hover { text-decoration: none; color: var(--ink); border-color: var(--ink-3); background: var(--surface-3); }
.btn .icon { font-size: 17px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); color: var(--on-accent); }
.btn .ic-mail { color: var(--accent); }
.ic-scholar { color: #4285f4; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; box-shadow: none; }
.btn-group .btn:first-child { border-radius: 8px 0 0 8px; }
.btn-group .btn:last-child { border-radius: 0 8px 8px 0; }
.btn-group .btn + .btn { margin-left: -1px; }
.btn-group { box-shadow: var(--shadow-sm); border-radius: 8px; }
.btn-icon { padding: 0 11px; color: var(--ink-3); }
.btn-icon.done { color: var(--accent); }

.copy-btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--surface);
  border-radius: 8px; padding: 3px 10px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; line-height: 1.6;
  transition: border-color .15s, color .15s;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-btn.done { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn.copy-btn { font-size: 14.5px; padding: 0 11px; border-radius: 0 8px 8px 0; line-height: 1; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; line-height: 1.5;
  padding: 3px 9px; border-radius: 7px; border: 1px solid var(--line-2); color: var(--ink-2); background: var(--surface);
  white-space: nowrap; transition: border-color .15s, color .15s;
}
a.chip:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.chip .icon { font-size: 13px; }
.chip .k { font-weight: 700; color: var(--ink); }
a.chip:hover .k { color: var(--accent); }
.chip-doi { font-family: var(--font-mono); font-size: 12px; white-space: normal; word-break: break-all; }
.chip-doi .k { font-family: var(--font-sans); }
.chip-gh { border-color: var(--ink-3); color: var(--ink); }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 650; line-height: 1.5; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.badge-first   { background: var(--accent-soft); color: var(--accent-2); }
.badge-cofirst { background: var(--c-brain-soft); color: var(--c-brain); }
.badge-corr    { background: var(--c-space-soft); color: var(--c-space); }
.badge-preprint, .badge-review { background: var(--c-cell-soft); color: var(--c-cell); }
.badge-kind    { background: var(--surface-2); color: var(--ink-3); }
.badge-role    { background: var(--accent-soft); color: var(--accent-2); }
.badge-role.key, .badge-own { background: var(--accent); color: var(--on-accent); }
.tag { font-size: 11.5px; color: var(--ink-3); background: var(--surface-2); border-radius: 6px; padding: 1px 7px; white-space: nowrap; }

/* ------------------------------------------------------------- pages (one per tab) */
.page { padding: 52px 0 0; }
.page-head { margin-bottom: 36px; max-width: 780px; }
.eyebrow { display: block; font-size: 12.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.page-head h1 { font-size: clamp(28px, 3.4vw, 36px); letter-spacing: -.015em; }
html[data-lang="zh"] .page-head h1 { letter-spacing: .02em; }
.page-head .lead { margin-top: 12px; color: var(--ink-2); font-size: 16.5px; }
.sub-head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 16px; }
.sub-head h2 { font-size: 18px; }
.subsection + .subsection { margin-top: 44px; }

/* previous / next page */
.pager { margin-top: 80px; }
.pager .wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pager-link {
  display: flex; flex-direction: column; gap: 2px; padding: 16px 20px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); transition: border-color .15s;
}
.pager-link:hover { text-decoration: none; color: var(--ink); border-color: var(--accent); }
.pager-link.next { grid-column: 2; align-items: flex-end; text-align: right; }
.pager-link .k { font-size: 12.5px; font-weight: 600; color: var(--ink-3); }
.pager-link .t { font-size: 17px; font-weight: 700; line-height: 1.4; }
.pager-link:hover .t { color: var(--accent); }

/* ------------------------------------------------------------- home: hero card + introduction
   The hero card stays dark in both themes (like the hero of the Human Cortex lncRNA Atlas). */
.hero { padding: 28px 0 0; }
.hero-card {
  position: relative; overflow: hidden; border-radius: 16px; padding: 44px 48px; color: #f4f6fa;
  border: 1px solid rgba(255, 255, 255, .06);
  background: radial-gradient(1100px 420px at 88% -14%, rgba(233, 123, 164, .32), transparent 60%),
              radial-gradient(900px 380px at 6% 126%, rgba(57, 135, 229, .38), transparent 60%), #0b0e14;
  display: grid; grid-template-columns: minmax(0, 1fr) 228px; gap: 48px; align-items: center;
}
.name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; color: #fff; }
.name-primary { font-size: clamp(40px, 5vw, 56px); line-height: 1.05; letter-spacing: -.02em; font-weight: 750; }
html[data-lang="zh"] .name-primary { letter-spacing: .05em; }
.name-secondary { font-weight: 600; color: #aab2c0; font-size: clamp(20px, 2.4vw, 26px); }
.role { margin-top: 12px; font-size: 16.5px; color: #c9cfda; }
.role strong { color: #fff; font-weight: 650; }
.nw { white-space: nowrap; }
.tagline { margin-top: 20px; font-size: clamp(20px, 2.2vw, 25px); line-height: 1.45; font-weight: 700; color: #fff; max-width: 28em; letter-spacing: -.005em; }
/* hero actions: row 1 = CV + email (larger buttons), row 2 = profile links as quieter pills */
.hero-links { margin-top: 28px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.hero-cta .btn { height: 44px; padding: 0 18px; font-size: 15px; border-radius: 10px; }
.hero-cta .btn .icon { font-size: 18px; }
.hero-cta .btn-cv { padding: 0 22px; box-shadow: 0 6px 18px -8px rgba(90, 156, 234, .7); }
.hero-cta .btn-group { border-radius: 10px; }
.hero-cta .btn-group .btn:first-child { border-radius: 10px 0 0 10px; }
.hero-cta .btn-group .btn:last-child { border-radius: 0 10px 10px 0; padding: 0 14px; }
.hero-profiles { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-profiles a {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 15px;
  border: 1px solid rgba(255, 255, 255, .14); border-radius: 999px; background: rgba(255, 255, 255, .04);
  color: #d3d9e3; font-size: 13.5px; font-weight: 600; white-space: nowrap; text-decoration: none; transition: background .15s, border-color .15s, color .15s;
}
.hero-profiles a:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .32); color: #fff; text-decoration: none; }
.hero-profiles .icon { font-size: 16px; }
.hero-card .btn { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .18); color: #fff; box-shadow: none; }
.hero-card .btn:hover { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .32); color: #fff; }
.hero-card .btn-primary { background: #5a9cea; border-color: #5a9cea; color: #0b1220; }
.hero-card .btn-primary:hover { background: #8ab8f0; border-color: #8ab8f0; color: #0b1220; }
.hero-card .btn-group { box-shadow: none; }
.hero-card .btn-icon { color: #c9cfda; }
.hero-card .btn-icon.done { color: #8ab8f0; }
.hero-card .btn .ic-mail { color: #8ab8f0; }
.hero-card .ic-scholar { color: #8ab8f0; }
.hero-card :focus-visible { outline-color: #8ab8f0; }
.portrait { margin: 0; }
.portrait img {
  display: block; width: 100%; height: auto; aspect-ratio: 500 / 606; object-fit: cover; object-position: 50% 20%;
  border-radius: 12px; border: 1px solid rgba(255, 255, 255, .1); background: #222833; box-shadow: 0 22px 44px -20px rgba(0, 0, 0, .8);
}

.intro { padding-top: 20px; }
.intro-card { padding: 34px 44px 36px; display: grid; grid-template-columns: 150px minmax(0, 1fr); column-gap: 40px; }
.intro-card .eyebrow { margin: 4px 0 0; }
.intro-card p { font-size: 16.5px; line-height: 1.8; color: var(--ink-2); }
html[data-lang="zh"] .intro-card p { line-height: 1.95; text-align: justify; }
.intro-card p + p { margin-top: 16px; }
.intro-card .intro-lead { color: var(--ink); font-size: 17.5px; }
.intro-card .intro-next { padding-left: 16px; border-left: 3px solid var(--accent); }

/* home: education & experience — two cards side by side (one column on narrow screens), each a small timeline, newest first */
.bg { padding-top: 20px; }
.bg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.bg-card { padding: 30px 34px 32px; }
.bg-card .eyebrow { margin-bottom: 18px; }
.tl > li { position: relative; padding: 0 0 20px 26px; list-style: none; }
.tl > li:last-child { padding-bottom: 0; }
.tl > li::before { content: ""; position: absolute; left: 0; top: 7px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--accent); background: var(--surface); }
.tl > li:not(:last-child)::after { content: ""; position: absolute; left: 5px; top: 22px; bottom: -3px; width: 1px; background: var(--line-2); }
.tl > li.now::before { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tl-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 16px; }   /* 长标题在左栏内换行，日期始终靠右 */
.tl-title { font-size: 16.5px; font-weight: 700; color: var(--ink); line-height: 1.5; }
.tl-when { font-family: var(--font-mono); font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.tl-org { margin-top: 3px; font-size: 15px; color: var(--ink-2); line-height: 1.6; }
.tl-note { margin-top: 2px; font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.tl-note .k { color: var(--ink-3); }

/* ------------------------------------------------------------- research (text only: index + one card per direction) */
.tone-brain { --tone: var(--c-brain); --tone-soft: var(--c-brain-soft); }
.tone-space { --tone: var(--c-space); --tone-soft: var(--c-space-soft); }
.tone-cell  { --tone: var(--c-cell);  --tone-soft: var(--c-cell-soft); }

.rs-index { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: -10px 0 26px; }
.rs-index-item {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); box-shadow: var(--shadow-sm);
  transition: border-color .15s, transform .15s;
}
.rs-index-item:hover { text-decoration: none; color: var(--ink); border-color: var(--tone); transform: translateY(-1px); }
.rs-index-item .no {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px;
  background: var(--tone-soft); color: var(--tone); font-family: var(--font-mono); font-size: 13.5px; font-weight: 700;
}
.rs-index-item .t { font-size: 14.5px; font-weight: 650; line-height: 1.4; }

.rs {
  position: relative; overflow: hidden; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 0 28px;
  padding: 36px 44px 38px 32px; scroll-margin-top: 80px;
}
.rs + .rs { margin-top: 20px; }
.rs::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--tone); }
.rs-side { display: flex; flex-direction: column; align-items: center; }
.rs-no { font-family: var(--font-mono); font-size: 34px; font-weight: 700; line-height: 1; letter-spacing: -.03em; color: var(--tone); }
.rs-side::after { content: ""; flex: 1; width: 2px; margin-top: 16px; border-radius: 2px; background: linear-gradient(var(--tone), transparent 85%); opacity: .45; }
.rs-kicker { font-size: 13px; font-weight: 700; letter-spacing: .1em; color: var(--tone); margin-bottom: 6px; }
.rs h2 { font-size: clamp(22px, 2.4vw, 27px); line-height: 1.35; }
.rs-body { margin-top: 18px; max-width: 52em; }   /* Chinese: about 50 characters a line */
html[data-lang="en"] .rs-body { max-width: 45em; }   /* English: keep lines readable */
.rs-body > * + * { margin-top: 14px; }
.rs-body p, .rs-body li { font-size: 16.5px; line-height: 1.85; color: var(--ink-2); }
html[data-lang="zh"] .rs-body p, html[data-lang="zh"] .rs-body li { line-height: 1.95; }
.rs-body .rs-lead { font-size: 17.5px; color: var(--ink); }
.rs-body strong { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.cite { font-weight: 700; white-space: nowrap; }   /* a citation never breaks across lines */
.rs-tools { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.rs-body .rs-tools li { padding: 12px 16px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-size: 16px; line-height: 1.75; }
.rs-tools .tool { font-family: var(--font-mono); font-weight: 700; color: var(--ink); margin-right: 2px; }
.rs-box { padding: 14px 18px 14px; border-radius: 10px; background: var(--tone-soft); border-left: 3px solid var(--tone); }
.rs-body .rs-box-h { font-size: 14.5px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.rs-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.rs-body .rs-list li { position: relative; padding-left: 18px; font-size: 16px; }
.rs-list li::before { content: ""; position: absolute; left: 2px; top: .8em; width: 6px; height: 6px; border-radius: 50%; background: var(--tone); }
.rs-body .rs-next { padding: 12px 18px; border-radius: 10px; background: var(--tone-soft); border-left: 3px solid var(--tone); color: var(--ink); }
.proj-link { color: inherit; text-decoration: underline; text-decoration-color: var(--line-2); text-decoration-thickness: 1px; text-underline-offset: 4px; }
.proj-link:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* ------------------------------------------------------------- publications */
.selected { margin-bottom: 40px; }
.list-label { font-size: 12.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; line-height: 1.6; }
.sel-grid { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.sel-card { padding: 18px 20px; display: flex; flex-direction: column; }
.sel-j { font-size: 13px; font-weight: 750; color: var(--accent); letter-spacing: .01em; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.sel-j .yr { color: var(--ink-3); font-weight: 600; font-family: var(--font-mono); font-size: 12px; }
.sel-t { margin-top: 6px; display: block; font-size: 16px; font-weight: 650; line-height: 1.45; color: var(--ink); }
.sel-t:hover { color: var(--accent); }
.sel-a { margin-top: 5px; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.sel-n { margin-top: 8px; font-size: 13.5px; color: var(--ink-2); line-height: 1.65; padding-left: 11px; border-left: 2px solid var(--line-2); }
.sel-card .pub-links { margin-top: auto; padding-top: 12px; }


.pub-group { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 24px; padding: 6px 0 18px; }
.pub-group + .pub-group { border-top: 1px solid var(--line); padding-top: 18px; }
.pub-group[hidden] { display: none; }
.group-label { position: sticky; top: 84px; align-self: start; }
.group-label .y { font-size: 28px; font-weight: 700; color: var(--ink); line-height: 1.1; }
.pub-list { list-style: none; display: flex; flex-direction: column; }
.pub { padding: 12px 0 14px; border-bottom: 1px dashed var(--line); }
.pub:last-child { border-bottom: 0; }
.pub-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.pub-badges:empty { display: none; }
.pub-title { font-size: 16px; font-weight: 650; line-height: 1.45; color: var(--ink); display: block; }
.pub-title:hover { color: var(--accent); }
.pub-authors { margin-top: 5px; font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.pub-venue { margin-top: 2px; font-size: 14px; color: var(--ink-3); }
.pub-venue em { color: var(--ink-2); font-style: italic; font-weight: 600; }
.pub-links { margin-top: 9px; display: flex; flex-wrap: wrap; gap: 6px; }
.me { color: var(--ink); font-weight: 750; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
sup.eq { color: var(--c-brain); font-weight: 800; font-size: .78em; margin-left: 1px; }
sup.corr { color: var(--c-space); font-weight: 800; font-size: .78em; margin-left: 1px; }
.n-auth { color: var(--ink-3); font-size: .92em; }
.pub-foot { margin-top: 12px; font-size: 14px; color: var(--ink-3); }

/* ------------------------------------------------------------- software & resources */
.sw-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.sw-card { padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; transition: border-color .15s, transform .15s; }
.sw-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.sw-card.own { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent), var(--shadow-sm); }
.sw-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sw-name { font-family: var(--font-mono); font-size: 17px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.sw-desc { font-size: 14.5px; color: var(--ink-2); line-height: 1.65; }
.sw-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.sw-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 4px; }
/* 网页上只有一个软件时（现为 PcircRNA_finder）：卡片占满整行，标签紧跟名称，说明文字限制行宽便于阅读 */
.sw-card:only-child { grid-column: 1 / -1; }
.sw-card:only-child > .sw-top { justify-content: flex-start; gap: 12px; }
.sw-card:only-child > .sw-desc { max-width: 52em; }   /* 与研究方向页中文正文同宽；中文简介恰好两行，末行不会只剩两三个字 */
html[data-lang="en"] .sw-card:only-child > .sw-desc { max-width: 42em; }
.res-wrap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }   /* two equal cards */
.res-card { padding: 22px 24px; display: flex; flex-direction: column; gap: 10px;
            border-color: var(--c-brain); box-shadow: inset 0 3px 0 var(--c-brain), var(--shadow-sm); }   /* every data card: same frame */
.res-top { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; }
.res-src { font-size: 12.5px; font-weight: 750; color: var(--c-brain); letter-spacing: .02em; }
.res-name { font-size: 18px; font-weight: 700; color: var(--ink); line-height: 1.4; }
.stats { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; margin: 4px 0 2px; }
.stats li { background: var(--c-brain-soft); border-radius: 12px; padding: 10px 12px; }
.stats b { display: block; font-size: 20px; line-height: 1.2; color: var(--ink); }
.stats span { display: block; font-size: 12px; color: var(--ink-2); line-height: 1.4; margin-top: 2px; }
.res-card .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }   /* same grid in both cards */
.res-card .stats li:last-child:nth-child(odd) { grid-column: 1 / -1; }   /* an odd last figure spans the row */
.res-contents { font-size: 13.5px; color: var(--ink-3); }

/* ------------------------------------------------------------- projects */
.proj-rows { list-style: none; border-top: 1px solid var(--line); }
.proj-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 8.5em; gap: 8px 22px; align-items: center;
  padding: 16px 4px; border-bottom: 1px solid var(--line);
}
.proj-name { font-size: 16px; font-weight: 650; color: var(--ink); line-height: 1.5; }
.proj-funder { display: block; font-size: 13px; font-weight: 600; color: var(--ink-3); margin-bottom: 2px; }
.proj-no { margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--line-2); font-weight: 500; white-space: nowrap; }
.proj-no .v { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-2); letter-spacing: .02em; }
.proj-parent { display: block; font-size: 12.5px; font-weight: 400; color: var(--ink-3); margin-top: 1px; }
.proj-role { justify-self: start; }
.proj-years { font-family: var(--font-mono); font-size: 13.5px; color: var(--ink-2); text-align: right; }

/* ------------------------------------------------------------- collaboration & contact */
.collab-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.collab-card { padding: 24px 26px 26px; display: flex; flex-direction: column; gap: 12px; }
.collab-head { display: flex; align-items: center; gap: 12px; }
.collab-ic { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 20px; }
.collab-card h2 { font-size: 17.5px; }
.collab-card > p { font-size: 15px; color: var(--ink-2); line-height: 1.75; }
.collab-meta { margin-top: 2px; padding-top: 12px; border-top: 1px dashed var(--line-2); display: flex; flex-direction: column; gap: 4px; }
.collab-meta p { font-size: 14px; color: var(--ink-2); line-height: 1.65; }
.collab-meta .k { color: var(--ink-3); font-weight: 650; }
.collab-meta a { font-weight: 650; white-space: nowrap; }
.contact-card { margin-top: 18px; padding: 24px 26px; display: flex; gap: 16px; align-items: flex-start; }
.contact-card > .copy-btn { margin-top: 22px; }
.contact-tip { margin-top: 10px; font-size: 14.5px; color: var(--ink-2); line-height: 1.7; }
.contact-tip .eg { color: var(--ink); font-weight: 600; }
.contact-links { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.contact-links a { display: inline-flex; align-items: center; gap: 7px; padding: 5px 13px; white-space: nowrap; border: 1px solid var(--line-2); border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.contact-links a:hover { border-color: var(--accent); color: var(--accent); }
.contact-links .icon { font-size: 15px; }
.contact-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--accent); color: var(--on-accent); font-size: 21px; }
.contact-main { flex: 1; min-width: 0; }
.contact-main .lbl { font-size: 12.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.contact-card .val { font-size: 21px; font-weight: 700; margin-top: 2px; line-height: 1.4; word-break: break-word; }
.contact-card .val a { color: var(--ink); }
.contact-card .val a:hover { color: var(--accent); }
.contact-card .addr { font-size: 13.5px; color: var(--ink-3); margin-top: 6px; }

/* ------------------------------------------------------------- footer */
.footer { margin-top: 40px; border-top: 1px solid var(--line); padding: 28px 0 40px; font-size: 13.5px; color: var(--ink-3); }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; justify-content: space-between; }
.footer-links { display: flex; flex-wrap: wrap; gap: 16px; }
.footer-links a { color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; }
.footer-links a:hover { color: var(--accent); }

/* ------------------------------------------------------------- publications: groups, one-line notes, impact factor */
.pub-sec + .pub-sec { margin-top: 48px; }
.pub-sec-head { padding-bottom: 12px; border-bottom: 2px solid var(--line-2); }
.sec-lead .pub-sec-head { border-bottom-color: var(--accent); }
.pub-sec-head h2 { font-size: clamp(19px, 2.1vw, 23px); line-height: 1.35; }
.pub-sec-head .yrs { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--ink-3); margin-left: 4px; white-space: nowrap; }
.pub-sec-head p { margin-top: 6px; font-size: 14.5px; color: var(--ink-2); max-width: 54em; }
.pub-sec .pub { padding: 16px 0 18px; }
.pub-note {
  margin-top: 8px; padding: 7px 12px; font-size: 14px; line-height: 1.65; color: var(--ink-2);
  background: var(--surface); border-left: 3px solid var(--line-2); border-radius: 0 8px 8px 0; max-width: 62em;
}
.sec-lead .pub-note { border-left-color: var(--accent); }
.badge-if { margin-left: 8px; background: var(--if-bg); color: var(--if-ink); font-family: var(--font-mono); font-size: 11.5px; vertical-align: 1px; }
.badge-feat { background: var(--accent); color: var(--on-accent); }

/* part 2: all publications by date (year labels stay in view while the list scrolls) */
.pub-sec-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px 24px; flex-wrap: wrap; }
.seg { display: inline-flex; flex: none; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: transparent; padding: 0 12px; height: 32px; font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button:hover { background: var(--surface-3); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.pub-years { margin-top: 18px; }
.group-label .y { font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.pub-sec .pub.pub-c { padding: 10px 0 14px; }
.pub-c .pub-title { font-size: 15.5px; }
.pub-c .pub-authors, .pub-c .pub-venue { font-size: 13.5px; }
.pub-c .pub-links { margin-top: 8px; }

/* ------------------------------------------------------------- software page: section order per language, analysis code */
.sw-sections { display: flex; flex-direction: column; gap: 48px; }
.sw-sections > .subsection { margin-top: 0; }
html[data-lang="en"] .sub-data { order: 1; }
html[data-lang="en"] .sub-sw { order: 2; }
html[data-lang="en"] .sub-code { order: 3; }
.sub-head { flex-wrap: wrap; column-gap: 14px; row-gap: 2px; }
.sub-note { font-size: 13.5px; color: var(--ink-3); }
.code-list { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.code-row { padding: 16px 20px; background: var(--surface); border: 1px solid var(--c-brain); border-radius: 14px; display: flex; flex-direction: column; gap: 6px;
            box-shadow: inset 0 3px 0 var(--c-brain), var(--shadow-sm); }   /* same frame as the data cards above (same two papers) */
.code-name { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 15px; font-weight: 700; color: var(--ink); align-self: flex-start; }
.code-name:hover { color: var(--accent); }
.code-desc { font-size: 14px; color: var(--ink-2); line-height: 1.6; }
.code-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--ink-3); }
.code-meta span:first-child { font-weight: 650; color: var(--c-brain); }

/* ------------------------------------------------------------- projects page: honours (Chinese) */
.page-projects .subsection { margin-top: 48px; }
.honor-rows { list-style: none; border-top: 1px solid var(--line); }
.honor-row { display: grid; grid-template-columns: 8.5em minmax(0, 1fr); gap: 16px; align-items: baseline; padding: 13px 4px; border-bottom: 1px solid var(--line); }
.honor-yr { font-family: var(--font-mono); font-size: 13.5px; color: var(--ink-3); }
.honor-t { font-size: 15.5px; color: var(--ink); }

/* ------------------------------------------------------------- responsive */
@media (max-width: 1060px) {
  .nav a { padding: 6px 7px; font-size: 14px; }
  .sw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  .menu-btn { display: inline-grid; }
  .nav {
    position: absolute; top: 62px; left: 0; right: 0; margin: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--line); padding: 6px 16px 14px; display: none; box-shadow: var(--shadow);
  }
  .topbar.nav-open .nav { display: flex; }
  .nav a { padding: 11px 10px; font-size: 15.5px; border-radius: 10px; }
  .lang-switch { margin-left: auto; }
  .hero-card { grid-template-columns: minmax(0, 1fr) 180px; gap: 30px; padding: 34px 32px; }
  .intro-card { grid-template-columns: minmax(0, 1fr); padding: 30px 32px; }
  .bg-grid { grid-template-columns: minmax(0, 1fr); }
  .bg-card { padding: 28px 32px 30px; }
  .intro-card .eyebrow { margin-bottom: 12px; }
  .sel-grid { grid-template-columns: minmax(0, 1fr); }
  .res-wrap { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .code-list { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px) {
  .wrap { padding: 0 16px; }
  .topbar .wrap { gap: 10px; }
  .brand-name .en { display: none; }
  .page { padding-top: 32px; }
  .hero { padding-top: 16px; }
  .hero-card { grid-template-columns: minmax(0, 1fr); gap: 22px; padding: 26px 20px 24px; border-radius: 14px; }
  .portrait { order: -1; width: 44%; max-width: 170px; }
  .name-primary { font-size: 40px; }
  .tagline { margin-top: 14px; }
  .role .role-sep { display: none; }                    /* 英文：职称一行，单位另起一行 */
  .role .role-unit { display: block; margin-top: 2px; }
  .intro-card { padding: 22px 18px 24px; grid-template-columns: minmax(0, 1fr); }
  .bg-card { padding: 22px 18px 24px; }
  .tl-head { display: block; }   /* 手机上日期统一放在标题下一行 */
  .tl-when { display: block; margin-top: 1px; }
  .proj-no { display: block; margin: 2px 0 0; padding: 0; border: 0; }
  .intro-card .eyebrow { margin-bottom: 12px; }
  .intro-card p { font-size: 16px; }
  .intro-card .intro-lead { font-size: 16.5px; }
  html[data-lang="zh"] .intro-card p { text-align: left; }   /* justify stretches the gaps around Latin words in narrow columns */
  .btn { height: 38px; padding: 0 12px; font-size: 14px; }
  .hero-links { align-items: stretch; }                 /* phone: full-width buttons, three equal pills */
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { height: 44px; font-size: 15px; }
  .hero-cta .btn-cv { justify-content: center; }
  .hero-cta .btn-mail { display: flex; }
  .hero-cta .btn-mail > .btn:first-child { flex: 1; min-width: 0; justify-content: center; }
  .hero-profiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero-profiles a { padding: 0 8px; font-size: 13px; }
  .hero-profiles .g { display: none; }                  /* “Google Scholar” → “Scholar” so the three fit on one row */
  .collab-meta a { white-space: normal; }              /* 长期刊名（The American Journal of Human Genetics）在手机上折行 */
  .res-card .sw-links a { white-space: normal; text-align: left; }   /* 同上：数据卡片里的论文链接在手机上可折行，不超出卡片 */
  .rs-index { grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: -14px; }
  .rs { grid-template-columns: minmax(0, 1fr); padding: 24px 20px 26px 24px; }
  .rs-side { flex-direction: row; margin-bottom: 12px; }
  .rs-side::after { display: none; }
  .rs-no { font-size: 26px; }
  .rs-body p, .rs-body li { font-size: 16px; }
  .rs-body .rs-lead { font-size: 16.5px; }
  .rs-body .rs-tools li { padding: 10px 14px; font-size: 15.5px; }
  .pub-group { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .group-label { position: static; }
  .group-label .y { font-size: 24px; }
  .sw-grid, .collab-grid { grid-template-columns: minmax(0, 1fr); }
  .pub-note { padding: 6px 10px; }
  .honor-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .pager { margin-top: 56px; }
  .pager .wrap { gap: 10px; }
  .pager-link { padding: 12px 14px; }
  .pager-link .t { font-size: 15.5px; }
  .proj-row { grid-template-columns: minmax(0, 1fr) auto; }
  .proj-row .proj-name { grid-column: 1 / -1; }
  .proj-years { text-align: right; }
  .contact-card { flex-wrap: wrap; padding: 20px 18px 22px; }
  .contact-ic { display: none; }                      /* 手机上让文字占满整张卡片 */
  .contact-main { flex: 1 1 100%; }
  .contact-card > .copy-btn { margin-top: 4px; }      /* 复制按钮换到下一行 */
  .contact-card .val { font-size: 18px; }
  .footer .wrap { flex-direction: column; align-items: flex-start; }
}

/* ------------------------------------------------------------- print */
@media print {
  /* paper is white whatever the screen theme */
  :root, html[data-theme="dark"], html[data-theme="light"] {
    color-scheme: light;
    --bg: #f4f5f7;
    --bg-2: #eceef2;
    --surface: #ffffff;
    --surface-2: #f8f9fb;
    --surface-3: #eef0f4;
    --ink: #0f1216;
    --ink-2: #464d5a;
    --ink-3: #687080;
    --line: #e1e4ea;
    --line-2: #cfd4dc;
    --accent: #2a78d6;
    --accent-2: #1c5cab;
    --accent-soft: #e7f0fb;
    --on-accent: #ffffff;
  
    --c-plant: #4d8a37;  --c-plant-soft: #e9f1e3;
    --c-brain: #6a4ca0;  --c-brain-soft: #efeaf7;
    --c-cell:  #c2652a;  --c-cell-soft:  #f8ebe1;
    --c-space: #0e7c83;  --c-space-soft: #e0f1f1;
  
    --if-bg: #fbe9cf; --if-ink: #8a4a12;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .07);
    --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 10px 30px -12px rgba(16, 24, 40, .18);
  }
  .topbar, .copy-btn, .menu-btn, .theme-toggle, .lang-switch, .skip, .pager { display: none !important; }
  body { background: #fff; display: block; }
  .page { padding-top: 0; }
  .card { box-shadow: none; }
  .rs, .pub, .sw-card, .res-card, .collab-card { break-inside: avoid; }
  a { color: inherit; }
}
