/* ============================================================
   modern.css — dark-tech reskin layered on top of jemdoc.css
   Theme: deep dark base + cyan→indigo accent. Light mode via
   [data-theme="light"] on <html>. Content/structure untouched.
   ============================================================ */

:root {
    --bg:        #0b0f17;
    --bg-soft:   #0f1623;
    --card:      #131c2b;
    --card-2:    #18233480;
    --border:    #243044;
    --border-soft:#1c2638;
    --text:      #e6edf3;
    --text-dim:  #9aa7b8;
    --text-mute: #6b7888;
    --accent:    #38bdf8;
    --accent-2:  #6366f1;
    --accent-3:  #22d3ee;
    --grad:      linear-gradient(120deg, #22d3ee 0%, #6366f1 100%);
    --glass:     rgba(13, 19, 30, 0.72);
    --shadow:    0 8px 30px rgba(0, 0, 0, 0.45);
    --radius:    14px;
    --mono:      "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    --sans:      "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

html[data-theme="light"] {
    --bg:        #fcfdff;
    --bg-soft:   #f1f5fb;
    --card:      #ffffff;
    --card-2:    #f7f9fd;
    --border:    #e4e9f2;
    --border-soft:#eef2f8;
    --text:      #0b1424;
    --text-dim:  #51607a;
    --text-mute: #9aa6ba;
    --accent:    #0284c7;
    --accent-2:  #4f46e5;
    --accent-3:  #0e7490;
    --grad:      linear-gradient(120deg, #0891b2 0%, #4f46e5 100%);
    --glass:     rgba(255, 255, 255, 0.7);
    --shadow:    0 10px 30px rgba(20, 33, 61, 0.08);
}

/* ---------- light-mode specific polish (does not touch dark) ---------- */
html[data-theme="light"] body {
    background:
        radial-gradient(1100px 520px at 80% -10%, rgba(79, 70, 229, 0.07), transparent 60%),
        radial-gradient(900px 460px at 6% 2%, rgba(8, 145, 178, 0.06), transparent 55%),
        var(--bg) !important;
}
/* inline code needs a tint to separate from white surfaces */
html[data-theme="light"] tt,
html[data-theme="light"] pre {
    background: var(--bg-soft) !important;
    color: #0e7490;
}
/* journey diagram (white png) gets a clean border on light card */
html[data-theme="light"] #journey img { border: 1px solid var(--border); }
/* soften card hover glows so they read as shadow, not neon, on white */
html[data-theme="light"] #publication div:has(> li):hover,
html[data-theme="light"] #experience li:hover {
    box-shadow: 0 12px 28px rgba(20, 33, 61, 0.12);
}
html[data-theme="light"] #research_summary .publication_container:hover {
    box-shadow: 0 10px 24px rgba(8, 145, 178, 0.16);
}
html[data-theme="light"] #technical_report div:has(> li):hover {
    box-shadow: 0 10px 24px rgba(79, 70, 229, 0.14);
}
/* logo tiles already white; give a hairline so they don't merge with cards */
html[data-theme="light"] #experience li img { border-color: #e0e6f0; }

/* ---------- base overrides ---------- */
html {
    background: var(--bg) !important;
    scroll-behavior: smooth;
    scroll-padding-top: 112px;
}

body {
    font-family: var(--sans) !important;
    color: var(--text) !important;
    background:
        radial-gradient(1100px 520px at 78% -8%, rgba(99, 102, 241, 0.18), transparent 60%),
        radial-gradient(900px 480px at 8% 4%, rgba(34, 211, 238, 0.12), transparent 55%),
        var(--bg) !important;
    background-attachment: fixed;
    max-width: 1000px !important;
    padding-left: 28px !important;
    padding-right: 28px !important;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background 0.4s ease, color 0.3s ease;
}

p, li, dd, dt, td, div { color: var(--text); }

a, a > tt {
    color: var(--accent) !important;
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}
a:hover { border-bottom: none !important; opacity: 0.82; }

tt, pre { background: var(--card) !important; color: var(--accent-3); border-radius: 6px; }

/* ---------- sticky nav ---------- */
nav.navbar { background: transparent; }

#layout-menu {
    position: sticky;
    top: 12px;
    z-index: 50;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    background: var(--glass) !important;
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid var(--border) !important;
    border-radius: 999px;
    padding: 8px 10px !important;
    box-shadow: var(--shadow);
    width: auto !important;
    white-space: normal !important;
    margin-bottom: 8px;
}

#layout-menu a {
    float: none !important;
    width: auto !important;
    margin: 0 !important;
    padding: 6px 12px !important;
    border-radius: 999px;
    font-family: var(--sans);
    font-size: 0.82rem !important;
    font-weight: 500;
    letter-spacing: 0.2px;
    color: var(--text-dim) !important;
    line-height: 1.2 !important;
    transition: background 0.2s ease, color 0.2s ease;
}
#layout-menu a:hover { color: var(--text) !important; background: var(--card); }

/* brand monogram on the left of the nav */
#layout-menu a.nav-brand {
    display: inline-flex;
    align-items: center;
    padding: 2px !important;
    margin-right: 4px !important;
    background: transparent;
    box-shadow: none;
}
#layout-menu a.nav-brand img {
    width: 26px;
    height: 26px;
    display: block;
    border-radius: 7px;
    box-shadow: 0 3px 10px rgba(56, 189, 248, 0.3);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
#layout-menu a.nav-brand:hover { opacity: 1; transform: translateY(-1px); }
#layout-menu a.nav-brand:hover img { box-shadow: 0 5px 16px rgba(56, 189, 248, 0.5); }
#layout-menu a.active {
    color: #fff !important;
    background: var(--grad);
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.35);
}

/* theme toggle button lives inside the nav */
#theme-toggle {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px; height: 34px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    cursor: pointer;
    font-size: 16px;
    transition: transform 0.2s ease, background 0.2s ease;
}
#theme-toggle:hover { transform: rotate(-12deg) scale(1.06); }

/* ---------- layout wrappers ---------- */
#layout-content {
    background: transparent !important;
    padding: 0 !important;
    border: none !important;
}
#layout-content table { background: transparent !important; }

/* ---------- hero ---------- */
#hero {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 32px;
    margin: 14px 0 8px;
    padding: 30px 32px;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.02), transparent),
        var(--card-2);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}
#hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(var(--border-soft) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
    background-size: 34px 34px;
    -webkit-mask-image: radial-gradient(420px 240px at 80% 12%, #000 0%, transparent 72%);
            mask-image: radial-gradient(420px 240px at 80% 12%, #000 0%, transparent 72%);
    opacity: 0.5;
    pointer-events: none;
}
/* neural-network motif: abstract "AI" background, vector + themeable */
.hero-net {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    opacity: 0.85;
    -webkit-mask-image: radial-gradient(720px 380px at 66% 32%, #000 0%, rgba(0,0,0,0.4) 58%, transparent 82%);
            mask-image: radial-gradient(720px 380px at 66% 32%, #000 0%, rgba(0,0,0,0.4) 58%, transparent 82%);
}
/* base faint wiring */
.hero-net .net-edges line {
    stroke: var(--accent);
    stroke-width: 1.1;
    opacity: 0.3;
}
/* flowing "data stream" pulses travelling along the wires */
.hero-net .net-edges line:nth-child(2n) {
    stroke: var(--accent-3);
    stroke-dasharray: 5 14;
    animation: dataFlow 2.4s linear infinite;
}
.hero-net .net-edges line:nth-child(3n) {
    stroke: var(--accent-2);
    stroke-dasharray: 4 16;
    animation: dataFlow 3.1s linear infinite;
}
@keyframes dataFlow { to { stroke-dashoffset: -38; } }
.hero-net .net-nodes circle {
    fill: var(--accent-3);
    animation: nodeTwinkle 3.4s ease-in-out infinite;
}
.hero-net .net-nodes circle:nth-child(2n)   { fill: var(--accent-2); animation-delay: 0.6s; }
.hero-net .net-nodes circle:nth-child(3n)   { fill: var(--accent); animation-delay: 1.2s; }
.hero-net .net-nodes circle:nth-child(4n)   { animation-delay: 1.8s; }
@keyframes nodeTwinkle {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .hero-net .net-edges line { animation: none; }
    .hero-net .net-nodes circle { animation: none; opacity: 0.7; }
}

/* name + meta on one row, filling the top width */
.hero-head {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 4px 24px;
}
.hero-head-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-bottom: 9px;
}
.hero-head-meta .bio-line { margin-bottom: 0 !important; }
.hero-head-meta .tagline { margin: 0 !important; }

#hero-text {
    flex: 1 1 360px;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
#hero-photo {
    position: relative;
    z-index: 1;
    flex: 0 0 340px;
    display: flex;
    min-height: 300px;
}
#hero-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 30%;
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

#hero h1, #hero #toptitle h1 {
    font-family: var(--sans) !important;
    font-size: 2.3rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.5px;
    background: var(--grad);
    -webkit-background-clip: text;
            background-clip: text;
    -webkit-text-fill-color: transparent;
    border: none !important;
    margin: 0 0 6px !important;
    padding: 0 0 0.12em !important;
    line-height: 1.18 !important;
    display: inline-block;
}
#hero .tagline {
    font-family: var(--mono);
    font-size: 0.9rem;
    color: var(--accent-3);
    margin: 2px 0 16px;
    letter-spacing: 0.3px;
}
#hero .bio-line { color: var(--text-dim); margin-bottom: 16px; }

/* social pill buttons */
.social-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.social-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text) !important;
    font-size: 0.84rem;
    font-weight: 500;
    transition: transform 0.18s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.social-pill:hover {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: 0 6px 18px rgba(56, 189, 248, 0.25);
    opacity: 1;
}
.social-pill img { height: 18px; width: 18px; border-radius: 4px; }
.social-pill .pill-svg { height: 16px; width: 16px; color: var(--text); display: inline-block; vertical-align: middle; }

/* 小红书 brand mark (Chinese), label stays English "Rednote" */
.xhs-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ff2442;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    padding: 3px 4px;
    border-radius: 5px;
    white-space: nowrap;
}

/* "live" pulse dot for frequently-updated accounts (Scholar, Rednote) */
.social-pill .live-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent-3);
    box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.55);
    animation: livePulse 1.9s ease-out infinite;
    flex: 0 0 auto;
}
@keyframes livePulse {
    0%   { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0.55); }
    70%  { box-shadow: 0 0 0 7px rgba(34, 211, 238, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); }
}
.social-pill.is-live:hover { border-color: var(--accent-3); }
@media (prefers-reduced-motion: reduce) {
    .social-pill .live-dot { animation: none; }
}

/* ---------- top scroll progress bar ---------- */
#scroll-progress {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 3px;
    z-index: 100;
    background: var(--grad);
    transform: scaleX(0);
    transform-origin: 0 50%;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
}

/* ---------- hero staggered load reveal ---------- */
@keyframes heroIn {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: none; }
}
#hero #toptitle,
#hero .bio-line,
#hero .tagline,
#hero .hero-quote,
#hero .social-row,
#hero .hero-motto,
#hero-photo {
    opacity: 0;
    animation: heroIn 0.7s cubic-bezier(0.22, 0.7, 0.2, 1) forwards;
}
#hero #toptitle  { animation-delay: 0.05s; }
#hero-photo      { animation-delay: 0.16s; }
#hero .bio-line  { animation-delay: 0.20s; }
#hero .tagline   { animation-delay: 0.28s; }
#hero .hero-quote{ animation-delay: 0.38s; }
#hero .social-row{ animation-delay: 0.48s; }
#hero .hero-motto{ animation-delay: 0.58s; }

/* ---------- typewriter tagline ---------- */
.tagline .type-prompt { color: var(--accent-2); font-weight: 700; }
.tagline #typewriter { color: var(--accent-3); }
.tagline .type-caret {
    display: inline-block;
    width: 8px; height: 1.05em;
    margin-left: 2px;
    vertical-align: text-bottom;
    background: var(--accent);
    border-radius: 1px;
    animation: caretBlink 1s steps(1) infinite;
}
@keyframes caretBlink { 50% { opacity: 0; } }

/* ---------- click-to-copy button feedback ---------- */
button.social-pill { cursor: pointer; font-family: var(--sans); }
.social-pill.copied {
    border-color: #34d399 !important;
    box-shadow: 0 6px 18px rgba(52, 211, 153, 0.3);
}
.social-pill.copied .copy-text { color: #34d399; }

/* ---------- RedNote card lightbox ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(5, 9, 16, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: modalFade 0.25s ease;
}
.modal-overlay[hidden] { display: none; }
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
    position: relative;
    max-width: 360px;
    width: 100%;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    animation: modalPop 0.28s cubic-bezier(0.22, 0.9, 0.3, 1.1);
}
@keyframes modalPop { from { opacity: 0; transform: translateY(16px) scale(0.96); } to { opacity: 1; transform: none; } }
.modal-card img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
}
.modal-hint {
    margin-top: 12px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-dim);
    line-height: 1.5;
}
.modal-close {
    position: absolute;
    top: -14px; right: -14px;
    width: 34px; height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    font-size: 15px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.18s ease, background 0.18s ease;
}
.modal-close:hover { transform: rotate(90deg); background: var(--card-2); }

@media (prefers-reduced-motion: reduce) {
    #hero #toptitle, #hero .tagline, #hero .bio-line,
    #hero .social-row, #hero-photo {
        opacity: 1 !important; animation: none !important;
    }
    .tagline .type-caret { animation: none; }
}

/* ---------- scroll reveal animations ---------- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 0.7s cubic-bezier(0.22, 0.7, 0.2, 1),
        transform 0.7s cubic-bezier(0.22, 0.7, 0.2, 1);
    will-change: opacity, transform;
}
.reveal.in {
    opacity: 1;
    transform: none;
}
/* section headings sweep in from the left for a clear section-change cue */
h2.reveal {
    transform: translateX(-26px);
}
h2.reveal.in {
    transform: none;
}
h2.reveal::before {
    transform: scale(0.4);
    transition: transform 0.5s cubic-bezier(0.22, 0.7, 0.2, 1) 0.1s;
}
h2.reveal.in::before {
    transform: scale(1);
}
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* ---------- research journey banner ---------- */
#journey {
    margin: 16px 0 8px;
    padding: 16px 18px 14px;
    background: var(--card-2);
    border: 1px solid var(--border);
    border-radius: 18px;
    box-shadow: var(--shadow);
}
#journey figcaption {
    font-family: var(--mono);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent-3);
    margin-bottom: 10px;
}
#journey img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
}
html[data-theme="dark"] #journey img {
    /* time.png has a light background; soften it on dark theme */
    background: #fff;
    padding: 6px;
}

/* ---------- hero aspiration quote ---------- */
.hero-quote {
    position: relative;
    margin: 6px 0 18px;
    padding: 4px 0 4px 18px;
    max-width: 56ch;
}
.hero-quote::before {
    content: "";
    position: absolute;
    left: 0; top: 3px; bottom: 3px;
    width: 3px;
    border-radius: 3px;
    background: var(--grad);
}
.hero-quote p {
    margin: 0 0 6px;
    font-size: 1.05rem;
    line-height: 1.5;
    font-weight: 500;
    color: var(--text);
    font-style: italic;
}
.hero-quote cite {
    font-style: normal;
    font-family: var(--mono);
    font-size: 0.73rem;
    color: var(--text-dim);
    letter-spacing: 0.2px;
}

/* ---------- hero motto (terminal, typed once) ---------- */
.hero-motto {
    margin-top: 16px;
    font-family: var(--mono);
    font-size: 0.85rem;
    background: var(--card-2);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 9px 13px;
    max-width: 100%;
    align-self: stretch;
}
.hero-motto .m-prompt { color: var(--accent-2); font-weight: 700; margin-right: 8px; }
.hero-motto #motto-type { color: var(--accent-3); letter-spacing: 2px; }
.hero-motto .m-caret {
    display: inline-block;
    width: 7px; height: 1em;
    margin-left: 3px;
    vertical-align: -1px;
    background: var(--accent);
    border-radius: 1px;
    animation: caretBlink 1s steps(1) infinite;
}
.hero-motto .m-trans {
    margin-top: 6px;
    font-size: 0.72rem;
    line-height: 1.45;
    color: var(--text-dim);
    font-style: italic;
    letter-spacing: 0.2px;
}
@media (prefers-reduced-motion: reduce) { .hero-motto .m-caret { animation: none; } }

/* ---------- section headings ---------- */
h2 {
    font-family: var(--sans) !important;
    color: var(--text) !important;
    font-size: 1.45rem !important;
    font-weight: 700 !important;
    border: none !important;
    margin: 46px 0 18px !important;
    padding: 0 0 12px 0 !important;
    position: relative;
    letter-spacing: -0.3px;
}
h2::before {
    content: "";
    display: inline-block;
    width: 9px; height: 9px;
    margin-right: 11px;
    border-radius: 3px;
    background: var(--grad);
    vertical-align: middle;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.6);
}
h2::after {
    content: "";
    position: absolute;
    left: 0; bottom: 0;
    width: 100%; height: 1px;
    background: linear-gradient(90deg, var(--border) 0%, transparent 70%);
}
h2 a { color: var(--accent) !important; font-size: 0.95rem; font-weight: 500; }

h3 {
    font-family: var(--sans) !important;
    color: var(--accent-3) !important;
    font-size: 1.06rem !important;
    font-weight: 600 !important;
    border: none !important;
    margin-top: 1.4em !important;
}

/* ---------- neutralize legacy color blocks ---------- */
.color-1, .color-2, .color-3, .color-4, .color-5, .color-6, .color-7,
.div-1, .div-2, .div-3, .div-4 {
    background-color: transparent !important;
    color: var(--text) !important;
}

/* Biography blocks become soft cards */
.div-2, .div-3 {
    background: var(--card-2) !important;
    border: 1px solid var(--border-soft);
    border-left: 3px solid var(--accent);
    border-radius: 10px;
    padding: 12px 16px !important;
    margin-bottom: 8px;
}
.div-3 { border-left-color: var(--accent-2); }

/* ---------- collaborator logo marquee ---------- */
.collab-wrap { margin: 22px 0 10px; }
.collab-label {
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent-3);
    margin-bottom: 10px;
}
#collab-logos {
    overflow: hidden;
    padding: 4px 0;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
            mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
}
#collab-logos .logo-track {
    display: flex;
    width: max-content;
    will-change: transform;
}
/* animation starts only once JS adds .run (after all logos have loaded) */
#collab-logos .logo-track.run {
    animation: logoScroll 38s linear infinite;
}
#collab-logos:hover .logo-track.run { animation-play-state: paused; }
@keyframes logoScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}
.logo-item {
    flex: 0 0 auto;
    height: 78px;
    margin-right: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 28px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.logo-item:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}
.logo-item img {
    height: 44px;
    width: auto;
    display: block;
    object-fit: contain;
}
@media (prefers-reduced-motion: reduce) {
    #collab-logos .logo-track { animation: none; }
}

/* ---------- news ---------- */
.news-filter {
    display: flex;
    gap: 6px;
    margin: 0 0 14px;
    flex-wrap: wrap;
}
.news-tab {
    font-family: var(--mono);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: var(--text-dim);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 14px;
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.news-tab:hover { color: var(--text); border-color: var(--accent); }
.news-tab.active {
    color: #fff;
    background: var(--grad);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.news-date {
    display: inline-block;
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--accent-3);
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.28);
    border-radius: 6px;
    padding: 1px 7px;
    margin-right: 6px;
    letter-spacing: 0.3px;
    vertical-align: 1px;
}
.news-venue {
    font-family: var(--mono);
    font-size: 0.78em;
    font-weight: 600;
    color: var(--accent-2);
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.28);
    border-radius: 5px;
    padding: 0 5px;
    margin: 0 1px;
    white-space: nowrap;
}
html[data-theme="light"] .news-venue { color: #4338ca; }

#news ul { list-style: none; padding-left: 0; }
#news > ul > li {
    position: relative;
    list-style: none;
    margin: 0 0 2px;
    padding: 9px 12px 9px 18px;
    border-radius: 9px;
    border: 1px solid transparent;
    transition: background 0.18s ease, border-color 0.18s ease;
    font-size: 0.94rem;
}
#news > ul > li::marker { content: none; }
#news > ul > li:hover {
    background: var(--card-2);
    border-color: var(--border-soft);
}
#news > ul > li b { font-weight: 500; }
#news details {
    width: auto !important;
    font-family: var(--sans) !important;
    margin: 10px 0;
}
#news details > summary {
    width: auto !important;
    display: inline-block;
    background: var(--card) !important;
    color: var(--accent) !important;
    border: 1px solid var(--border) !important;
    border-radius: 999px !important;
    box-shadow: none !important;
    padding: 6px 16px !important;
    font-size: 0.85rem;
    font-weight: 500;
}
#news details[open] > summary { background: var(--card-2) !important; }

/* ---------- publication cards ---------- */
#publication ul { list-style: none; padding-left: 0; }
/* every paper = a <div> directly wrapping an <li>; class-agnostic so all
   entries (selective + full) get an identical card frame */
#publication div:has(> li) {
    background: var(--card) !important;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin: 12px 0;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
#publication div:has(> li):hover {
    transform: translateY(-3px);
    border-color: var(--accent);
    box-shadow: 0 10px 28px rgba(56, 189, 248, 0.18);
}
#publication li { list-style: none; margin: 0; overflow: hidden; }
#publication li img {
    border-radius: 10px;
    border: 1px solid var(--border);
    margin-right: 16px;
    margin-bottom: 6px;
}
#publication li a { font-weight: 600; }

/* venue badge: standalone <em> inside a publication <li> */
#publication li em {
    display: inline-block;
    font-style: normal;
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: var(--accent-3);
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.3);
    border-radius: 6px;
    padding: 2px 8px;
    margin: 2px 0;
}
/* category labels (bold+em, outside <li>) */
#publication > ul > b em,
#publication b > em {
    display: inline-block;
    font-style: normal;
    font-family: var(--mono);
    color: var(--accent-2);
    font-size: 0.95rem;
    margin: 22px 0 4px;
}
#publication li p { margin: 6px 0 0 !important; }
#publication li p a {
    font-family: var(--mono);
    font-size: 0.78rem;
    font-weight: 500;
}

/* ---------- research summary: cloned paper cards ----------
   Distinct style from the main Publications cards: softer surface +
   cyan left accent bar (vs. full-border lift on the main list).      */
#research_summary .goal_progress { margin-top: 6px; }
#research_summary .publication_container {
    display: block;                 /* override jemdoc's flex row */
    background: var(--card-2);
    border: 1px solid var(--border-soft);
    border-left: 3px solid var(--accent-3);
    border-radius: 12px;
    padding: 13px 16px;
    margin: 10px 0 !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
#research_summary .publication_container:hover {
    border-left-color: var(--accent);
    box-shadow: 0 8px 22px rgba(34, 211, 238, 0.14);
    transform: translateX(2px);
}
#research_summary .publication_container li {
    list-style: none;
    margin: 0;
    overflow: hidden;               /* contain the floated image */
}
#research_summary .publication_container li img {
    float: left;
    margin-right: 18px;             /* breathing room between img and text */
    margin-bottom: 6px;
    border-radius: 10px;
    border: 1px solid var(--border);
}
#research_summary .publication_container li a { font-weight: 600; }
#research_summary .publication_container li p { margin: 6px 0 0 !important; }
#research_summary .publication_container li p a {
    font-family: var(--mono);
    font-size: 0.78rem;
    font-weight: 500;
}
/* venue badge, matching the Publications list */
#research_summary .publication_container li em {
    display: inline-block;
    font-style: normal;
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: var(--accent-3);
    background: rgba(34, 211, 238, 0.1);
    border: 1px solid rgba(34, 211, 238, 0.3);
    border-radius: 6px;
    padding: 2px 8px;
    margin: 2px 0;
}

/* ---------- robust paper card: flex two-column (img | body) ----------
   Applied only to JS-wrapped cards (.pub-flex) so image-less entries
   keep their normal flow. Kills the "links drop under the image" bug.   */
#publication li.pub-flex,
#research_summary .publication_container li.pub-flex,
#technical_report li.pub-flex {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
li.pub-flex > img {
    float: none !important;
    margin: 0 !important;
    flex: 0 0 auto;
}
li.pub-flex > .pub-body {
    flex: 1 1 auto;
    min-width: 0;            /* allow text to wrap instead of overflowing */
}
@media screen and (max-width: 760px) {
    #publication li.pub-flex,
    #research_summary .publication_container li.pub-flex,
    #technical_report li.pub-flex { flex-direction: column; }
    li.pub-flex > img { width: 100% !important; height: auto !important; }
}

/* ---------- technical report: dashed "preprint" cards (distinct style) ---------- */
#technical_report ul { list-style: none; padding-left: 0; }
#technical_report div:has(> li) {
    background: var(--bg-soft);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin: 12px 0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
#technical_report div:has(> li):hover {
    border-color: var(--accent-2);
    border-style: solid;
    background: var(--card);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.16);
}
#technical_report li { list-style: none; margin: 0; }
#technical_report li img { border-radius: 10px; border: 1px solid var(--border); }
#technical_report li a { font-weight: 600; }
#technical_report li p { margin: 6px 0 0 !important; }
#technical_report li p a { font-family: var(--mono); font-size: 0.78rem; font-weight: 500; }
/* Arxiv tag in a distinct indigo tone */
#technical_report li em {
    display: inline-block;
    font-style: normal;
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.4px;
    color: var(--accent-2);
    background: rgba(99, 102, 241, 0.1);
    border: 1px dashed rgba(99, 102, 241, 0.5);
    border-radius: 6px;
    padding: 2px 8px;
    margin: 2px 0;
}

/* ---------- research summary tabs (recolor only) ---------- */
.highlight_research_tab { background-color: var(--accent-2) !important; border-color: var(--accent) !important; }
.research_tab {
    background-color: var(--card) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
    border-radius: 10px !important;
}
.research_tab:hover { background-color: var(--card-2) !important; }
.highlight_goal_tab { background-color: var(--accent-3) !important; color: #06121c !important; }
.goal_tab {
    background-color: var(--card) !important;
    border-color: var(--border) !important;
    color: var(--text) !important;
}

/* generic details outside news */
details { width: auto !important; font-family: var(--sans) !important; }
details > summary, details > p {
    background: var(--card) !important;
    color: var(--text) !important;
    box-shadow: none !important;
    border: 1px solid var(--border) !important;
}

/* ---------- intern experiences: logo cards ---------- */
#experience ul { list-style: none; padding-left: 0; }
#experience li {
    list-style: none;
    display: flow-root;            /* contain the floated logo + date */
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 18px;
    margin: 12px 0;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
#experience li:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(56, 189, 248, 0.16);
}
#experience li img {
    margin-right: 18px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: #fff;             /* logos are often on white */
    padding: 4px;
    box-sizing: border-box;
}
#experience li a { font-weight: 600; }
#experience li > div:first-of-type a { font-size: 1.02rem; }
/* company name: drop the left float so the role/advisor/topic lines below
   it align left consistently (instead of being squeezed beside the float) */
#experience li > div[style*="float:left"] {
    float: none !important;
    display: inline !important;
}
/* the date (right-floated div) in mono, stays right-aligned */
#experience li > div[style*="right"] {
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--text-dim);
}

/* ---------- footer ---------- */
#footer {
    border-top: 1px solid var(--border) !important;
    color: var(--text-mute) !important;
    margin-top: 5em !important;
}
#footer a { color: var(--text-dim) !important; }

/* ---------- responsive ---------- */
@media screen and (max-width: 760px) {
    body { padding-left: 16px !important; padding-right: 16px !important; }
    #hero { padding: 22px; gap: 22px; }
    #hero-photo { flex: 1 1 100%; min-height: 0; }
    #hero-photo img { height: auto; max-height: 320px; }
    #hero h1, #hero #toptitle h1 { font-size: 1.8rem !important; }
    #publication li img { float: none !important; display: block; width: 100% !important; height: auto !important; }
    #layout-menu { border-radius: 16px; }
}
