*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --accent: #2563eb;
    --accent-bright: #38bdf8;
    --accent-deep: #1d4ed8;
    --accent-dim: rgba(37, 99, 235, .1);
    --emerald: #059669;
    --emerald-dim: rgba(16, 185, 129, .12);
    --amber: #b45309;
    --amber-dim: rgba(245, 158, 11, .15);
    --violet: #7c3aed;
    --text: #0c1222;
    --text-secondary: #526070;
    --text-muted: #718096;
    --surface-solid: #ffffff;
    --surface-soft: rgba(248, 250, 252, .78);
    --border: rgba(30, 41, 59, .1);
    --card-bg: rgba(255, 255, 255, .88);
    --card-shadow: 0 18px 45px rgba(15, 23, 42, .07), 0 1px 2px rgba(15, 23, 42, .04);
    --card-shadow-hover: 0 22px 55px rgba(15, 23, 42, .11), 0 2px 8px rgba(15, 23, 42, .05);
    --mono: 'JetBrains Mono', ui-monospace, monospace;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    background:
        linear-gradient(90deg, rgba(37, 99, 235, .035) 1px, transparent 1px),
        linear-gradient(0deg, rgba(5, 150, 105, .026) 1px, transparent 1px),
        linear-gradient(180deg, #f7fbff 0%, #ffffff 42%, #f6fbf8 100%);
    background-size: 42px 42px, 42px 42px, auto;
    background-attachment: fixed;
}

/* ===== CANVAS BACKGROUND ===== */
#bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: .48;
}

/* ===== SCROLL FADE-IN ===== */
.fade-in {
    opacity: 1;
    transform: none;
    transition: opacity .55s ease, transform .55s ease;
}
.js .fade-in {
    opacity: 0;
    transform: translateY(18px);
}
.js .fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    .fade-in,
    .js .fade-in { opacity: 1; transform: none; transition: none; }
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== NAVIGATION ===== */
nav {
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, .78);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(30, 41, 59, .08);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .9) inset,
        0 2px 12px rgba(10, 60, 120, .05);
    z-index: 100;
    padding: 0 1.5rem;
    transition: box-shadow .3s;
}

nav.scrolled {
    box-shadow:
        0 1px 0 rgba(255, 255, 255, .9) inset,
        0 6px 24px rgba(10, 60, 120, .11);
}

.nav-inner {
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
}

.nav-name {
    font-weight: 700;
    font-size: 1.02rem;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #0c1222 0%, var(--accent-deep) 58%, var(--emerald) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    margin-left: 1.5rem;
    font-size: .84rem;
    font-weight: 500;
    transition: color .2s;
}

.nav-links a:hover {
    color: var(--accent);
    text-decoration: none;
}

/* ===== CONTAINER ===== */
.container {
    position: relative;
    z-index: 2;
    max-width: 980px;
    margin: 0 auto;
    padding: 0 1.5rem 2.5rem;
}

/* ===== CARD ===== */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 8px;
    border: 1px solid rgba(30, 41, 59, .09);
    box-shadow: var(--card-shadow);
    margin-bottom: 1.5rem;
    transition: box-shadow .3s, border-color .3s, transform .3s;
}

.card:hover {
    border-color: rgba(37, 99, 235, .16);
}

/* ===== PROFILE ===== */
.profile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 2.25rem;
    padding: 2.25rem 2.5rem;
    margin-top: 2.15rem;
    overflow: hidden;
}

.profile::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, .1), transparent 38%),
        linear-gradient(315deg, rgba(16, 185, 129, .1), transparent 42%);
    pointer-events: none;
}

.profile > * {
    position: relative;
}

.avatar-wrap {
    position: relative;
    flex-shrink: 0;
}

.avatar-wrap::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-bright), var(--accent), var(--emerald));
    z-index: -1;
}

.avatar-wrap::after {
    content: '';
    position: absolute;
    inset: -16px;
    border-radius: 50%;
    background: conic-gradient(from 180deg, var(--accent-bright), rgba(16, 185, 129, .7), var(--accent), rgba(245, 158, 11, .5), var(--accent-bright));
    opacity: .28;
    filter: blur(20px);
    z-index: -2;
    animation: avatar-glow 10s linear infinite;
}

@keyframes avatar-glow { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .avatar-wrap::after { animation: none; opacity: .2; }
}

.avatar {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 3px solid var(--surface-solid);
    box-shadow: 0 16px 38px rgba(15, 23, 42, .16);
}

.profile-info h1 {
    font-size: clamp(1.8rem, 3vw, 2.35rem);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, #0c1222 0%, #1e3a8a 52%, var(--emerald) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.profile-info h1 .cn {
    font-size: .65em;
    font-weight: 400;
    -webkit-text-fill-color: var(--text-secondary);
    background: none;
}

.profile-info .subtitle {
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: 0;
    color: var(--text-secondary);
    margin-top: .4rem;
}

.profile-info .affiliation {
    font-size: .92rem;
    color: var(--text-secondary);
    margin: .55rem 0 .75rem;
    line-height: 1.65;
}

.profile-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin: .2rem 0 1rem;
}

.profile-tags span {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    min-height: 30px;
    padding: .28rem .62rem;
    border-radius: 8px;
    background: rgba(248, 250, 252, .85);
    border: 1px solid rgba(30, 41, 59, .1);
    color: var(--text-secondary);
    font-size: .76rem;
    font-weight: 600;
}

.profile-tags i {
    color: var(--accent-deep);
}

.social-links { display: flex; gap: .45rem; flex-wrap: wrap; }

.social-links a {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .85rem;
    background: rgba(255, 255, 255, .9);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: .79rem;
    font-weight: 500;
    text-decoration: none;
    transition: transform .15s, border-color .2s, box-shadow .2s, color .2s;
    box-shadow: 0 1px 3px rgba(10, 60, 120, .06);
}

.social-links a:hover {
    color: var(--accent-deep);
    border-color: rgba(37, 99, 235, .32);
    box-shadow: 0 0 0 1px rgba(37, 99, 235, .1), 0 8px 20px rgba(37, 99, 235, .12);
    transform: translateY(-1px);
    text-decoration: none;
}

/* ===== SECTIONS ===== */
.section {
    padding: 1.85rem 2.35rem;
}

.section[id] {
    scroll-margin-top: 76px;
}

.section-title {
    font-size: 1.08rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: .65rem;
    color: var(--text);
}

.section-title::before {
    content: '';
    width: 4px;
    height: 1.08em;
    border-radius: 3px;
    background: linear-gradient(180deg, var(--accent-bright), var(--emerald));
    box-shadow: 0 0 10px rgba(37, 99, 235, .28);
    flex-shrink: 0;
}

.section p {
    font-size: .93rem;
    line-height: 1.9;
    color: var(--text);
}

.section a { font-weight: 500; }

.section-intro {
    color: var(--text-secondary);
    margin: -.45rem 0 1rem;
}

/* ===== NEWS ===== */
.news-section { margin-top: 1.5rem; }

.block-label {
    font-size: .72rem;
    font-weight: 700;
    font-family: var(--mono);
    color: var(--accent-deep);
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: .65rem;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: .85rem .95rem;
    background: var(--surface-soft);
    border: 1px solid rgba(30, 41, 59, .08);
    border-radius: 8px;
}

.news-item {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    font-size: .845rem;
    line-height: 1.65;
}

.news-item::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--emerald);
    box-shadow: 0 0 5px rgba(16, 185, 129, .45);
    flex-shrink: 0;
    margin-top: .52em;
}

.news-date {
    font-family: var(--mono);
    font-size: .74rem;
    color: var(--accent-deep);
    font-weight: 600;
    flex-shrink: 0;
    min-width: 62px;
    margin-top: .02em;
}

.news-text { color: var(--text-secondary); }
.news-text strong { color: var(--text); font-weight: 600; }

/* ===== RESEARCH INTERESTS ===== */
.interests-section { margin-top: 1.4rem; }

.interest-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .75rem;
}

.interest-card {
    background: linear-gradient(145deg, rgba(248, 250, 252, .95), rgba(239, 246, 255, .72));
    border: 1px solid rgba(30, 41, 59, .09);
    border-radius: 8px;
    padding: .95rem 1rem .85rem;
    text-align: center;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}

.interest-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
    border-color: rgba(37, 99, 235, .22);
}

@media (prefers-reduced-motion: reduce) {
    .interest-card:hover { transform: none; }
}

.interest-icon {
    font-size: 1.45rem;
    color: var(--accent-deep);
    margin-bottom: .42rem;
}

.interest-name {
    font-size: .83rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: .2rem;
}

.interest-desc {
    font-size: .72rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* ===== PUBLICATIONS ===== */
.pub-list { display: flex; flex-direction: column; gap: 1rem; }

.pub-item {
    position: relative;
    padding: 1.15rem;
    background: rgba(255, 255, 255, .94);
    border: 1px solid rgba(30, 41, 59, .09);
    border-radius: 8px;
    transition: box-shadow .3s, border-color .25s, transform .2s;
    box-shadow: 0 2px 10px rgba(15, 23, 42, .05);
    overflow: hidden;
}

.pub-item::before {
    content: '';
    position: absolute;
    left: 0; top: 12px; bottom: 12px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, var(--accent-bright), var(--emerald));
    opacity: 0;
    transition: opacity .25s;
}

.pub-item:hover {
    border-color: rgba(37, 99, 235, .22);
    box-shadow: 0 16px 38px rgba(15, 23, 42, .09), 0 0 0 1px rgba(37, 99, 235, .06);
    transform: translateY(-2px);
}

.pub-item:hover::before { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
    .pub-item:hover { transform: none; }
}

.pub-item--row {
    display: flex;
    gap: 1.15rem;
    align-items: flex-start;
}

.pub-thumb {
    flex: 0 0 210px;
    max-width: 42%;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(30, 41, 59, .1);
    background: rgba(15, 23, 42, .03);
    line-height: 0;
}

.pub-thumb img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    display: block;
    transition: transform .38s ease;
}

.pub-thumb:hover img { transform: scale(1.05); }
.pub-thumb[href] { text-decoration: none; }

.pub-main { flex: 1; min-width: 0; }

/* Venue badge */
.pub-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .4rem;
    margin-bottom: .45rem;
}

.pub-venue-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    font-family: var(--mono);
    font-size: .69rem;
    font-weight: 700;
    font-style: normal;
    padding: .18rem .52rem;
    border-radius: 6px;
    letter-spacing: .045em;
    vertical-align: middle;
}
.pub-venue-badge.cv {
    background: rgba(37, 99, 235, .1);
    color: #1d4ed8;
    border: 1px solid rgba(37, 99, 235, .22);
}
.pub-venue-badge.robotics {
    background: var(--emerald-dim);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, .26);
}
.pub-venue-badge.ml {
    background: rgba(139, 92, 246, .12);
    color: #5b21b6;
    border: 1px solid rgba(139, 92, 246, .26);
}
.pub-venue-badge.default {
    background: rgba(100, 116, 139, .1);
    color: #475569;
    border: 1px solid rgba(100, 116, 139, .2);
}

.pub-award-badge {
    display: inline-flex;
    align-items: center;
    gap: .32rem;
    min-height: 24px;
    padding: .18rem .52rem;
    border-radius: 6px;
    font-family: var(--mono);
    font-size: .69rem;
    font-weight: 800;
    letter-spacing: .045em;
    text-transform: uppercase;
    color: var(--amber);
    background: var(--amber-dim);
    border: 1px solid rgba(245, 158, 11, .28);
}

.pub-title {
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.42;
    margin-bottom: .3rem;
}

.pub-title a { color: var(--text); }
.pub-title a:hover { color: var(--accent); text-decoration: none; }

.pub-authors {
    font-size: .83rem;
    color: var(--text-secondary);
    margin-bottom: .18rem;
    line-height: 1.65;
}

.pub-authors .me { color: var(--violet); font-weight: 600; }

.pub-links { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .5rem; }

.pub-links a {
    display: inline-flex;
    align-items: center;
    gap: .32rem;
    font-size: .74rem;
    font-family: var(--mono);
    font-weight: 500;
    padding: .3rem .66rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, .9);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all .2s;
}

.pub-links a.pub-arxiv:hover {
    color: #b45309;
    border-color: rgba(180, 83, 9, .3);
    background: rgba(251, 191, 36, .08);
    box-shadow: 0 3px 10px rgba(180, 83, 9, .1);
}

.pub-links a.pub-github:hover {
    color: #1f2937;
    border-color: rgba(15, 23, 42, .22);
    background: rgba(15, 23, 42, .04);
}

.pub-links a.pub-project:hover {
    color: #4338ca;
    border-color: rgba(79, 70, 229, .3);
    background: rgba(99, 102, 241, .08);
    box-shadow: 0 3px 10px rgba(99, 102, 241, .1);
}

.pub-empty, .pub-error {
    font-size: .88rem;
    color: var(--text-secondary);
    padding: 1rem 1.2rem;
    background: var(--accent-dim);
    border-radius: 10px;
    border: 1px dashed rgba(14, 165, 233, .25);
}

/* ===== EDUCATION ===== */
.edu-timeline { display: flex; flex-direction: column; }

.edu-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: .9rem 0;
    position: relative;
}

.edu-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 19px;
    top: 50px;
    bottom: -4px;
    width: 2px;
    background: linear-gradient(180deg,
        rgba(14, 165, 233, .28),
        rgba(14, 165, 233, .08),
        transparent
    );
}

.edu-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: linear-gradient(145deg, rgba(224, 242, 254, .98), rgba(199, 230, 254, .5));
    color: var(--accent-deep);
    border: 1px solid rgba(14, 165, 233, .2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
    box-shadow: 0 2px 8px rgba(14, 165, 233, .1);
}

.edu-info h3 { font-size: .94rem; font-weight: 600; letter-spacing: -.01em; }
.edu-info p  { font-size: .82rem; color: var(--text-secondary); margin: .18rem 0 0; font-family: var(--mono); }

/* ===== FOOTER ===== */
footer {
    position: relative;
    z-index: 2;
    max-width: 980px;
    margin: 0 auto;
    padding: 0 1.5rem 2.5rem;
}

.footer-inner {
    background: rgba(255, 255, 255, .75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 8px;
    border: 1px solid rgba(30, 41, 59, .08);
    box-shadow: 0 2px 12px rgba(15, 23, 42, .05);
    padding: 1.1rem 1.6rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

footer p {
    color: var(--text-secondary);
    font-size: .77rem;
    font-family: var(--mono);
}

.footer-right {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.footer-right a {
    font-size: .74rem;
    color: var(--text-secondary);
    font-family: var(--mono);
    text-decoration: none;
    transition: color .2s;
}
.footer-right a:hover { color: var(--accent); }

/* ===== BACK TO TOP ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 1.75rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(37, 99, 235, .22);
    color: var(--accent-deep);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(15, 23, 42, .12);
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .3s, transform .3s, box-shadow .2s, border-color .2s;
    z-index: 50;
    text-decoration: none;
    font-size: .88rem;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    box-shadow: 0 6px 24px rgba(37, 99, 235, .18);
    border-color: rgba(37, 99, 235, .36);
    color: var(--accent);
    text-decoration: none;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .profile {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.5rem 1.4rem;
        gap: 1.25rem;
    }
    .profile-tags { justify-content: center; }
    .social-links { justify-content: center; }
    .avatar { width: 132px; height: 132px; }
    .nav-links a { margin-left: .8rem; font-size: .78rem; }
    .profile-info h1 { font-size: 1.58rem; }
    .section { padding: 1.4rem 1.4rem; }
    .interest-grid { grid-template-columns: 1fr; gap: .55rem; }
    .interest-card {
        text-align: left;
        display: flex;
        align-items: center;
        gap: .8rem;
        padding: .7rem .9rem;
    }
    .interest-icon { font-size: 1.2rem; margin-bottom: 0; flex-shrink: 0; }
    .interest-desc { display: none; }
    .news-date { min-width: 54px; }
    .pub-item--row { flex-direction: column; }
    .pub-thumb { max-width: 100%; flex-basis: auto; width: 100%; }
    .edu-item:not(:last-child)::after { left: 19px; }
    .footer-inner { flex-direction: column; gap: .45rem; text-align: center; }
    .back-to-top { bottom: 1.25rem; right: 1rem; }
}

@media (max-width: 480px) {
    .container { padding: 0 1rem 2rem; }
    footer { padding: 0 1rem 2rem; }
    .card { border-radius: 8px; }
    nav { padding: 0 1rem; }
    .nav-inner { height: 52px; }
    .nav-name { font-size: .96rem; }
    .nav-links a { margin-left: .55rem; font-size: .73rem; }
    .profile-tags span { font-size: .72rem; padding: .24rem .5rem; }
}
