/* ==========================================================
   Yicong Li — homepage stylesheet
   Theme: Efficient AI ("do more with less")
   Edit colours in :root; everything else reads from them.
   ========================================================== */

/* Inter (variable, Latin subset), self-hosted. Chinese text falls back to system fonts. */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('fonts/inter-latin-wght-normal.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --zh: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Noto Sans SC', 'Source Han Sans SC', sans-serif;
    --ink: #0f172a;          /* headings */
    --text: #334155;         /* body text */
    --muted: #64748b;        /* secondary text */
    --faint: #94a3b8;
    --bg: #f6f8fa;           /* page background */
    --card: #ffffff;
    --line: #e2e8f0;

    --brand: #0f766e;        /* teal: links, accents */
    --brand-2: #0d9488;
    --brand-3: #2dd4bf;
    --brand-soft: #e7f6f3;
    --brand-soft-2: #cdeee8;

    --night-1: #03192a;      /* hero gradient */
    --night-2: #062f45;
    --night-3: #0b5a5e;

    --amber: #fbbf24;        /* "after" numbers on dark */
    --amber-ink: #92400e;
    --amber-soft: #fef3c7;

    --maxw: 960px;
    --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', 'Noto Sans SC', sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
strong, b { color: var(--ink); font-weight: 600; }

.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: .5rem 1rem; z-index: 999; }
.skip:focus { left: 1rem; top: .5rem; }

/* ---------- NAV ---------- */
.topnav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 200;
    height: 56px;
    display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
    padding: 0 2.5rem;
    background: rgba(3, 25, 42, 0.86);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.nav-name { color: #fff; font-weight: 700; font-size: 1.02rem; letter-spacing: .01em; white-space: nowrap; }
.nav-name:hover { text-decoration: none; color: var(--brand-3); }
.nav-links {
    display: flex; gap: 1.8rem; list-style: none;
    overflow-x: auto; scrollbar-width: none; white-space: nowrap;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a { color: rgba(255, 255, 255, 0.66); font-size: .875rem; font-weight: 500; transition: color .18s; }
.nav-links a:hover { color: #fff; text-decoration: none; }
.nav-links a.active { color: var(--brand-3); }

/* ---------- HERO ---------- */
.hero {
    position: relative; overflow: hidden;
    padding: 118px 0 64px;
    background: linear-gradient(140deg, var(--night-1) 0%, var(--night-2) 50%, var(--night-3) 100%);
}
.hero::before {               /* faint grid: "measured" feel */
    content: ''; position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
    background-size: 44px 44px;
    -webkit-mask-image: radial-gradient(ellipse at 75% 40%, #000 0%, transparent 70%);
            mask-image: radial-gradient(ellipse at 75% 40%, #000 0%, transparent 70%);
    pointer-events: none;
}
.hero::after {
    content: ''; position: absolute; top: -30%; right: -10%; width: 70%; height: 160%;
    background: radial-gradient(ellipse, rgba(45, 212, 191, 0.18) 0%, transparent 65%);
    pointer-events: none;
}
.hero-inner {
    position: relative; z-index: 1;
    max-width: var(--maxw); margin: 0 auto; padding: 0 2.5rem;
    display: flex; align-items: center; gap: 3.2rem;
}
.hero-photo { flex-shrink: 0; }
.hero-photo img {
    width: 176px; height: 176px; border-radius: 50%; object-fit: cover; object-position: center 30%;
    border: 3px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 0 0 6px rgba(45, 212, 191, 0.18), 0 12px 40px rgba(0, 0, 0, 0.45);
}
.eyebrow {
    display: inline-flex; align-items: center; gap: .45rem;
    font-size: .74rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
    color: var(--brand-3);
    background: rgba(45, 212, 191, 0.1); border: 1px solid rgba(45, 212, 191, 0.28);
    padding: .22rem .75rem; border-radius: 999px; margin-bottom: .9rem;
}
.hero-text h1 {
    color: #fff; font-size: 2.7rem; font-weight: 800; letter-spacing: -.025em; line-height: 1.15;
    margin-bottom: .45rem;
}
.hero-text h1 .zh { font-family: var(--zh); font-weight: 500; font-size: .62em; color: rgba(255,255,255,.72); margin-left: .35rem; letter-spacing: .04em; }
.hero-subtitle {
    color: rgba(255, 255, 255, 0.6); font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
    margin-bottom: 1.1rem;
}
.hero-affil { display: flex; align-items: flex-start; gap: .6rem; color: rgba(255,255,255,.84); font-size: .93rem; margin-bottom: .25rem; }
.hero-affil i { width: 15px; margin-top: .38rem; font-size: .82rem; color: rgba(255,255,255,.45); flex-shrink: 0; text-align: center; }
.hero-affil a { color: rgba(255,255,255,.9); border-bottom: 1px solid rgba(255,255,255,.25); }
.hero-affil .zh-sub { font-family: var(--zh); font-size: .86em; color: rgba(255,255,255,.6); }
.hero-affil a:hover { color: #fff; text-decoration: none; border-color: #fff; }
.hero-buttons { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.4rem; }
.btn {
    display: inline-flex; align-items: center; gap: .45rem;
    padding: .42rem 1.05rem; border-radius: 999px;
    font-size: .84rem; font-weight: 500; color: #fff;
    background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22);
    transition: all .18s;
}
.btn:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.36); text-decoration: none; }
.btn-primary { background: var(--brand-2); border-color: var(--brand-2); }
.btn-primary:hover { background: #0fa596; border-color: #0fa596; }

.wave { background: linear-gradient(140deg, var(--night-1) 0%, var(--night-2) 50%, var(--night-3) 100%); line-height: 0; }
.wave svg { display: block; width: 100%; height: 56px; }

/* compact header for sub-pages */
.hero.hero-compact { padding: 104px 0 46px; }
.hero-compact h1 { color: #fff; font-size: 2.1rem; font-weight: 800; letter-spacing: -.02em; }
.hero-compact p { color: rgba(255,255,255,.72); margin-top: .35rem; font-size: .95rem; }
.hero-compact p a { color: #fff; border-bottom: 1px solid rgba(255,255,255,.3); }
.hero-compact p a:hover { text-decoration: none; border-color: #fff; }
.hero-compact .hero-inner { display: block; }

/* ---------- LAYOUT ---------- */
.content { padding: 3.2rem 0 4.5rem; }
.content.tight { padding-top: 1.6rem; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 2.5rem; }
.section { margin-bottom: 3.8rem; }
.section-title { font-size: 1.45rem; font-weight: 700; color: var(--ink); letter-spacing: -.01em; margin-bottom: .35rem; }
.section-title::after {
    content: ''; display: block; width: 38px; height: 3px; margin-top: .42rem; border-radius: 2px;
    background: linear-gradient(90deg, var(--brand), var(--brand-3));
}
.section-lead { color: var(--muted); font-size: .93rem; margin: .9rem 0 1.4rem; }

/* ---------- BIO ---------- */
.bio p { font-size: .97rem; margin-top: .9rem; }
.hl {
    display: inline-block; padding: .04rem .5rem; border-radius: 5px;
    background: var(--brand-soft); color: var(--brand); font-weight: 600; font-size: .95em;
}
.zh-inline { font-family: var(--zh); }

/* ---------- RESEARCH DIRECTIONS ---------- */
.dir-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.dir-card {
    position: relative; overflow: hidden;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.4rem 1.3rem 1.25rem;
    display: flex; flex-direction: column;
    transition: transform .2s, box-shadow .2s;
}
.dir-card::before { content: ''; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--accent, var(--brand)); }
.dir-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(15, 118, 110, .12); }
.dir-card.gen   { --accent: #c2410c; --accent-soft: #fdeee4; }
.dir-card.post  { --accent: #1d4ed8; --accent-soft: #e6edfd; }
.dir-card.agent { --accent: #0f766e; --accent-soft: #e7f6f3; }
.dir-icon {
    width: 40px; height: 40px; border-radius: 10px; margin-bottom: .85rem;
    display: flex; align-items: center; justify-content: center;
    background: var(--accent-soft); color: var(--accent); font-size: 1.05rem;
}
.dir-card h3 { font-size: 1.04rem; font-weight: 700; color: var(--ink); line-height: 1.3; }
.dir-sub { font-size: .76rem; font-weight: 600; color: var(--accent); letter-spacing: .04em; margin: .2rem 0 .6rem; }
.dir-card p.dir-desc { font-size: .86rem; color: var(--muted); line-height: 1.6; margin-bottom: 1rem; flex: 1; }
.cut-label { font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-bottom: .45rem; }
.tags { display: flex; flex-wrap: wrap; gap: .32rem; }
.tags span {
    font-size: .74rem; font-weight: 500; padding: .14rem .58rem; border-radius: 999px;
    background: var(--accent-soft, var(--brand-soft)); color: var(--accent, var(--brand));
}
.tags span em { font-style: normal; opacity: .7; }

.thread {
    margin-top: 1.1rem; padding: .9rem 1.2rem;
    display: flex; align-items: baseline; gap: .7rem;
    background: var(--card); border: 1px dashed var(--brand-soft-2); border-radius: 12px;
    font-size: .9rem; color: var(--text);
}
.thread i { color: var(--brand); }

/* ---------- METRIC CARDS ("doing more with less") ---------- */
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.metric-card {
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    transition: transform .2s, box-shadow .2s;
}
.metric-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(3, 25, 42, .14); }
.metric {
    position: relative; padding: 1.05rem 1.15rem 1.15rem; min-height: 132px;
    display: flex; flex-direction: column; justify-content: space-between; gap: .6rem;
    background: linear-gradient(140deg, var(--night-1) 0%, var(--night-2) 60%, var(--night-3) 130%);
    color: #fff;
}
.metric-label { font-size: .68rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.62); line-height: 1.45; }
.metric-values { display: flex; align-items: baseline; flex-wrap: wrap; gap: .25rem .55rem; }
.metric-values s { font-size: 1.12rem; font-weight: 600; color: rgba(255,255,255,.42); text-decoration-thickness: 2px; }
.metric-values .arrow { font-size: .85rem; color: rgba(255,255,255,.5); }
.metric-values b { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; color: var(--amber); line-height: 1.05; }
.metric-values small { font-size: .78rem; color: rgba(255,255,255,.7); font-weight: 500; }
.metric-body { padding: 1rem 1.15rem 1.05rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.metric-title { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.metric-title a, .metric-title span.name { font-size: .98rem; font-weight: 700; color: var(--ink); }
.metric-title a:hover { color: var(--brand); text-decoration: none; }
.venue {
    flex-shrink: 0; font-size: .7rem; font-weight: 700; letter-spacing: .02em;
    color: var(--brand); background: var(--brand-soft); padding: .1rem .5rem; border-radius: 999px;
}
.metric-body p { font-size: .82rem; color: var(--muted); line-height: 1.55; flex: 1; }
.links { display: flex; flex-wrap: wrap; gap: .9rem; font-size: .8rem; }
.links a { display: inline-flex; align-items: center; gap: .3rem; }
.links .soon { color: var(--faint); }

/* ---------- TOPIC PANELS ---------- */
.topic {
    background: var(--card); border: 1px solid var(--line); border-radius: 12px;
    padding: 1.1rem 1.4rem; margin-top: .9rem;
}
.topic-head { display: flex; align-items: center; gap: .55rem; margin-bottom: .55rem; }
.topic-head i { color: var(--brand); font-size: .92rem; width: 18px; text-align: center; }
.topic-head strong { font-size: .95rem; }
.topic-list { list-style: none; }
.topic-list li {
    position: relative; padding-left: 1rem; margin-bottom: .38rem;
    font-size: .86rem; color: #475569; line-height: 1.6;
}
.topic-list li::before { content: '›'; position: absolute; left: 0; top: 0; color: var(--brand); font-weight: 700; }
.topic-list .k { color: var(--ink); font-weight: 600; }
.topic-list a, .topic-list .nolink { white-space: nowrap; }
.topic-list .nolink { color: var(--text); }
.pill {
    display: inline-block; font-size: .68rem; font-weight: 600; letter-spacing: .03em;
    padding: .02rem .45rem; border-radius: 999px; vertical-align: 1px;
    color: var(--amber-ink); background: var(--amber-soft);
}
.more { margin-top: 1rem; font-size: .9rem; font-weight: 600; }

/* ---------- NEWS ---------- */
.news-list { list-style: none; }
.news-item { display: flex; gap: 1.2rem; padding: 1rem 0; border-bottom: 1px solid #edf1f5; }
.news-item:last-child { border-bottom: none; }
.news-date {
    flex-shrink: 0; height: fit-content; white-space: nowrap; margin-top: .1rem;
    width: 5.4rem; text-align: center;
    font-size: .76rem; font-weight: 700; color: var(--brand);
    background: var(--brand-soft); border: 1px solid var(--brand-soft-2);
    padding: .18rem .62rem; border-radius: 6px;
}
.news-body strong { display: block; font-size: .9rem; margin-bottom: .15rem; }
.news-body .note { font-size: .83rem; color: var(--muted); }
.news-papers { display: flex; flex-direction: column; gap: .2rem; margin-top: .3rem; }
.news-papers a, .news-papers span { font-size: .83rem; line-height: 1.45; padding-left: 1.05rem; position: relative; }
.news-papers span { color: var(--text); }
.news-papers a::before, .news-papers span::before {
    content: ''; position: absolute; left: 0; top: .5em; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-3);
}

/* ---------- JOIN ---------- */
.recruit {
    background: linear-gradient(135deg, #ecfaf7 0%, #dff4ef 100%);
    border: 1px solid var(--brand-soft-2); border-radius: var(--radius);
    padding: 1.5rem 1.8rem; font-size: .93rem; color: #134e4a; line-height: 1.75;
}
.recruit p + p { margin-top: .8rem; }
.recruit strong { color: #0b4f49; }
.recruit .zh-line { font-family: var(--zh); }
.recruit a { font-weight: 600; }

/* ---------- AWARDS / SERVICE ---------- */
.plain-list { list-style: none; }
.plain-list li {
    display: flex; gap: .75rem; align-items: flex-start;
    padding: .6rem 0; border-bottom: 1px solid #edf1f5; font-size: .91rem;
}
.plain-list li:last-child { border-bottom: none; }
.plain-list i { flex-shrink: 0; margin-top: .3rem; width: 16px; text-align: center; color: var(--brand); }
.plain-list i.gold { color: #f59e0b; }
.plain-list .yr { flex-shrink: 0; width: 3.1rem; font-size: .8rem; font-weight: 700; color: var(--brand); margin-top: .12rem; }
.plain-list .zh-inline { color: var(--muted); font-size: .85em; }

/* ---------- TIMELINE ---------- */
.timeline { list-style: none; }
.tl-item { position: relative; padding: .5rem 0 .5rem 1.8rem; margin-left: .55rem; border-left: 2px solid var(--brand-soft-2); }
.tl-item::before { content: ''; position: absolute; left: -5px; top: 1.05rem; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.tl-year { font-size: .78rem; font-weight: 700; color: var(--brand); }
.tl-desc { font-size: .92rem; color: var(--ink); font-weight: 500; }
.tl-sub { font-size: .83rem; color: var(--muted); }

/* ---------- PUBLICATIONS PAGE ---------- */
.pub-legend { font-size: .85rem; color: var(--muted); margin: .9rem 0 .3rem; }
.year-head {
    display: flex; align-items: center; gap: .8rem;
    font-size: 1.05rem; font-weight: 700; color: var(--ink); margin: 2.2rem 0 .4rem;
}
.year-head::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.pub { display: flex; gap: 1rem; padding: .85rem 0; border-bottom: 1px solid #edf1f5; }
.pub:last-child { border-bottom: none; }
.pub-venue {
    flex-shrink: 0; width: 7.6rem; height: fit-content; margin-top: .12rem;
    font-size: .72rem; font-weight: 700; text-align: center; line-height: 1.35;
    color: var(--brand); background: var(--brand-soft); border: 1px solid var(--brand-soft-2);
    padding: .22rem .4rem; border-radius: 6px;
}
.pub-venue.pre { color: #475569; background: #f1f5f9; border-color: #e2e8f0; }
.pub-main { min-width: 0; }
.pub-title { display: block; font-size: .95rem; font-weight: 600; color: var(--ink); line-height: 1.45; }
a.pub-title:hover { color: var(--brand); text-decoration: none; }
.pub-authors { font-size: .84rem; color: var(--muted); margin-top: .15rem; }
.pub-authors b { color: var(--ink); }
.pub-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .9rem; margin-top: .3rem; font-size: .8rem; }
.badge { font-size: .7rem; font-weight: 700; padding: .06rem .5rem; border-radius: 999px; color: var(--amber-ink); background: var(--amber-soft); }

/* ---------- FOOTER ---------- */
footer { text-align: center; padding: 2rem 1rem; font-size: .8rem; color: var(--faint); border-top: 1px solid var(--line); }
footer a { color: var(--faint); border-bottom: 1px solid transparent; }
footer a:hover { color: var(--brand); text-decoration: none; border-color: currentColor; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 900px) {
    .dir-grid, .metric-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
    .topnav { padding: 0 1rem; gap: 1rem; }
    .nav-links { gap: 1.1rem; }
    .hero { padding: 96px 0 46px; }
    .hero-inner { flex-direction: column; text-align: center; gap: 1.5rem; padding: 0 1rem; }
    .hero-photo img { width: 140px; height: 140px; }
    .hero-text h1 { font-size: 2.05rem; }
    .hero-text h1 .zh { display: block; margin: .3rem 0 0; font-size: .55em; }
    .hero-affil { justify-content: center; text-align: left; }
    .hero-buttons { justify-content: center; }
    .hero.hero-compact { padding: 88px 0 34px; }
    .hero-compact .hero-inner { text-align: left; }
    .container { padding: 0 1rem; }
    .content { padding-top: 2.4rem; }
    .dir-grid, .metric-grid { grid-template-columns: 1fr; }
    .news-item { flex-direction: column; gap: .45rem; }
    .news-date { align-self: flex-start; }
    .content.tight { padding-top: 1rem; }
    .pub { flex-direction: column; gap: .4rem; }
    .pub-venue { width: auto; align-self: flex-start; }
    .thread { flex-direction: row; }
}
@media (max-width: 420px) {
    .nav-name, .hide-sm { display: none; }
    .nav-links { gap: 1rem; }
    .nav-links a { font-size: .82rem; }
    .hero-subtitle { letter-spacing: .08em; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .dir-card, .metric-card { transition: none; }
}
