@charset "utf-8";

/* ===== Base ===== */
body {
    font-family: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-weight: 400;
    padding-top: 5.0rem;
    color: #2d3436;
}

/* Always show the scrollbar so page-to-page navigation doesn't shift the layout */
html {
    overflow-y: scroll;
}

.footer {
    margin-top: auto;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-weight: 600;
}

.font-weight-500 {
    font-weight: 500;
}

a {
    color: #4a7298;
    transition: color 0.2s ease;
}

a:hover {
    color: #2d3436;
}

hr {
    border-top: 1px solid #f0f0f0;
}

/* ===== Cards: flat, hairline border instead of drop shadow ===== */
.card {
    border-radius: 0.8rem !important;
    box-shadow: none !important;
    border: 1px solid #f0f0f0 !important;
}

.card:hover {
    border-color: #e0e0e0 !important;
    transition: border-color 0.2s ease;
}

/* Neutralise Bootstrap's shadow utility so the whole site reads flat */
.shadow-sm {
    box-shadow: none !important;
}

.card-img-overlay {
    border-radius: 0.8rem !important;
}

.rounded-xl {
    border-radius: 0.8rem !important;
}

.rounded-xl-bottom {
    border-bottom-right-radius: 0.8rem !important;
    border-bottom-left-radius: 0.8rem !important;
}

.rounded-xl-top {
    border-top-left-radius: 0.8rem !important;
    border-top-right-radius: 0.8rem !important;
}

.border-gray {
    border-color: #f0f0f0 !important;
}

.border-bottom,
.border-top {
    border-color: #f0f0f0 !important;
}

/* ===== Navbar ===== */
.navbar {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.navbar-brand {
    letter-spacing: -0.01em;
}

.navbar .nav-link {
    color: #6c757d;
    padding-left: 0.85rem !important;
    padding-right: 0.85rem !important;
    transition: color 0.2s ease;
}

.navbar .nav-link:hover {
    color: #2d3436;
}

.navbar .nav-item.active .nav-link {
    color: #2d3436;
    font-weight: 600;
}

.navbar-toggler {
    border: 1px solid #e6e6e6;
    border-radius: 999px;
    padding: 0.3rem 0.7rem;
    font-size: 0.9rem;
    color: #6c757d;
}

/* The expanded mobile menu overlays page content, so it needs to be opaque */
@media (max-width: 767.98px) {
    .navbar .navbar-collapse.show,
    .navbar .navbar-collapse.collapsing {
        background: #fff;
        margin: 0 -1rem;
        padding: 0.5rem 1rem;
    }
}

/* ===== Profile ===== */
.text-profile-position {
    font-weight: 400;
}

.text-profile-bio {
    font-weight: 400;
    line-height: 1.7;
}

.text-profile-bio h6 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.email-text {
    font-family: Source Code Pro, monospace;
}

.inline-badge {
    height: 16px;
    vertical-align: -10%;
    margin-right: 4px;
    line-break: unset;
}

.no-break {
    white-space: nowrap;
}

/* ===== Publications / projects ===== */
.cover-image {
    width: 180px;
    max-height: 120px;
}

.abstract-body {
    min-height: 100px;
}

/* Venue-rank badges (CCF-A, JCR Q1, ...): the one signal a recruiter scans for
   first. Earlier this used five unrelated hues in a small-radius box — bold
   enough to notice, but a rainbow next to the single-hue, fully-rounded
   keyword chips two lines below made the card feel like two unrelated tag
   systems. A same-hue redesign fixed the clash but then lost tier
   differentiation entirely (CCF-B looked identical to CCF-C). This is the
   middle ground: one hue family, three intensities, so rank is still legible
   at a glance without a new color entering the page.
     - Top   (CCF-A, JCR Q1, CCF Chinese T1 — top of their respective lists):
       solid fill.
     - Mid   (CCF-B): a mid-saturation tint, clearly darker than Low.
     - Low   (CCF-C): the same pale tint as the topic keyword chips.
   When a venue qualifies for more than one (e.g. IEEE TCSVT is both JCR Q1
   and CCF-B), both badges are shown with the higher tier listed first. */
.badge-publication {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.5;
    border-radius: 999px;
    padding: 0.1em 0.65em;
    margin-left: 0.3rem;
    vertical-align: 1px;
    border: none;
}

/* Top tier: CCF-A, JCR Q1, CCF Chinese T1. */
.badge-publication.badge-danger,
.badge-publication.badge-info,
.badge-publication.badge-warning {
    background-color: #4a7298;
    color: #fff;
}

/* Mid tier: CCF-B. */
.badge-publication.badge-primary {
    background-color: #aec4d8;
    color: #1f3f57;
}

/* Low tier: CCF-C (badge-success kept in the same tier for parity — unused
   in the current publication list). */
.badge-publication.badge-secondary,
.badge-publication.badge-success {
    background-color: #eef2f7;
    color: #4a7298;
}

.badge-publication.badge-danger,
.badge-publication.badge-info {
    background-color: #4a7298;
    color: #fff;
}

.badge-light {
    background-color: #f5f5f5;
    color: #666;
    font-weight: 500;
}

/* ===== Topic keyword chips (publications + projects) =====
   One flat blue for every tag read as monotonous with enough chips on the page
   to notice. This is a small categorical palette instead — five hues, one per
   research/work area (video understanding, vision & detection, learning
   paradigms, multimodal LLM & agents, systems & engineering) — validated with
   the dataviz skill's CVD checker against every pair of categories that actually
   co-occurs on a single card in this site's real data (not an abstract
   worst case: this palette's 8 hues can't all pass pairwise at once, so a
   validated-safe subset picked for *this* data is the correct scope). Weight
   500 keeps them from competing with the title; the hue is what differentiates
   them from the equally-important-but-deliberately-monochrome rank badges above,
   and from the outlined, neutral tech-stack chips below. See
   _data/keyword_categories.yml for the tag → category mapping. */
.keyword-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.keyword-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1.5;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    white-space: nowrap;
}

.tag-video     { background-color: #eaf2fb; color: #2a78d6; }
.tag-vision    { background-color: #fdf1ed; color: #eb6834; }
.tag-learning  { background-color: #e6f2ee; color: #0a7d52; }
.tag-mllm      { background-color: #efedf7; color: #4a3aa7; }
.tag-systems   { background-color: #f8ecf1; color: #b83e70; }

/* ===== Project tech stack chips =====
   Deliberately a short, curated list (3-5 items) rather than a full inventory —
   the point is to surface what an algorithm-role JD would actually keyword-match
   on, not to be exhaustive. Outlined rather than filled, so next to the filled
   keyword-tag topic pills the two rows read as distinct but related: "what this
   project is about" (filled) vs. "what I built it with" (outlined). Same accent
   hue as everything else on the page — no new color introduced. */
.tech-stack-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.tech-stack-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 0.15rem;
}

.tech-chip {
    display: inline-block;
    background-color: transparent;
    color: #4a7298;
    border: 1px solid #c7d7e3;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.5;
    padding: 0.1rem 0.55rem;
    border-radius: 999px;
    white-space: nowrap;
}

.project-highlights li {
    margin-bottom: 0.35rem;
    line-height: 1.6;
}

.project-highlights li:last-child {
    margin-bottom: 0;
}

/* Year headings on the publications / blog pages */
h2.pt-4 {
    font-weight: 500;
    color: #999;
    font-size: 1.1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Sidebar year navigation */
#navbar-year .nav-link {
    color: #999;
    font-size: 0.875rem;
    padding: 0.25rem 0.75rem;
}

#navbar-year .nav-link.active {
    background-color: transparent;
    color: #2d3436;
    font-weight: 600;
}

/* ===== Buttons ===== */
.btn-outline-primary {
    color: #4a7298;
    border-color: #d0dde8;
    border-radius: 999px;
}

.btn-outline-primary:hover {
    background-color: #4a7298;
    border-color: #4a7298;
    color: #fff;
}

/* ===== Lazy-loading placeholders ===== */
img.lazy {
    background-image: url('images/loading.gif');
    background-repeat: no-repeat;
    background-position: 50% 50%;
    background-size: 50px 50px;
    min-height: 80px;
}

div.lazy {
    background-image: url('images/loading.gif');
    background-repeat: no-repeat;
    background-position: 50% 50%;
    background-size: 50px 50px;
    min-height: 80px;
}

/* ===== Blog layout ===== */
.blog-layout-wrapper {
    display: flex;
    justify-content: center;
    padding: 0 15px;
    gap: 1.5rem;
}

.blog-main {
    flex: 0 1 950px;
    min-width: 0;
}

.blog-toc-sidebar {
    flex: 0 0 auto;
    width: clamp(160px, 18vw, 360px);
    display: none;
}

@media (min-width: 992px) {
    .blog-toc-sidebar {
        display: block;
    }
}

.blog-toc-nav {
    position: sticky;
    top: 6rem;
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
    padding-left: 0.75rem;
    border-left: 2px solid #f0f0f0;
    scrollbar-width: none;
}

.blog-toc-nav::-webkit-scrollbar {
    width: 0;
}

.blog-toc-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #aaa;
    margin-bottom: 0.75rem;
}

.blog-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.blog-toc-list li {
    margin-bottom: 0.25rem;
}

.blog-toc-list a {
    display: block;
    font-size: 0.8rem;
    line-height: 1.4;
    color: #999;
    text-decoration: none;
    padding: 0.15rem 0;
    transition: color 0.2s ease;
}

.blog-toc-list a:hover {
    color: #2d3436;
    text-decoration: none;
}

.blog-toc-list a.toc-active {
    color: #4a7298;
    font-weight: 500;
}

.blog-toc-list .toc-h3 { padding-left: 0.75rem; }
.blog-toc-list .toc-h4 { padding-left: 1.5rem; }

/* ===== i18n ===== */
/* Both languages are present in the markup; only the active one is displayed. */
html.lang-active-en .lang-zh {
    display: none !important;
}

html.lang-active-zh .lang-en {
    display: none !important;
}

/* Pill-shaped EN / 中 switch in the navbar */
.lang-toggle {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e0e6ec;
    border-radius: 999px;
    background-color: #f7f9fb;
    padding: 2px;
    font-size: 0.75rem;
    line-height: 1;
}

.lang-toggle-label {
    appearance: none;
    -webkit-appearance: none;
    background: none;
    border: 0;
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    color: #8b949e;
    font-family: inherit;
    font-size: inherit;
    line-height: 1.4;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.lang-toggle-label:hover {
    color: #4a7298;
}

.lang-toggle-label:focus {
    outline: none;
}

.lang-toggle-label:focus-visible {
    box-shadow: 0 0 0 2px rgba(74, 114, 152, 0.35);
}

.lang-toggle-label.lang-toggle-active {
    background-color: #4a7298;
    color: #fff;
    font-weight: 500;
}

/* ===== Layout & style polish ===== */

/* Hero name: tighter tracking reads more "designed"; clamp on narrow phones so
   name + positions don't wrap to three lines under the portrait. */
.h1.font-weight-normal {
    letter-spacing: -0.02em;
}

@media (max-width: 575.98px) {
    .h1.font-weight-normal {
        font-size: 2rem;
    }
}

/* Section header icon: same accent color everywhere a card/subsection has an
   icon + label heading (News, Selected Publications, Education, More page...),
   so the whole site reads as one system rather than per-widget one-offs. */
.section-title i {
    color: #4a7298;
}

/* Sub-headings inside a shared card (Education / Experience / Honors on the
   homepage) get a hairline rule of their own, distinct from the full-width
   card headers which already have border-bottom + padding. */
.subsection-title {
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
}

/* "Open to work" callout in the bio: the one paragraph a recruiter most needs
   to notice, so it gets a tinted box instead of blending into plain prose. */
.callout-hire-me {
    margin-top: 1rem;
    padding: 0.85rem 1.1rem;
    background-color: #eef4f9;
    border: 1px solid #d8e6ee;
    border-left: 3px solid #4a7298;
    border-radius: 0.6rem;
}

.callout-hire-me i {
    color: #4a7298;
    margin-right: 0.4rem;
}

/* Active navbar tab: a small underline in addition to the bold+dark text,
   so the current page is legible at a glance rather than requiring a re-read. */
.navbar .nav-link {
    position: relative;
}

.navbar .nav-item.active .nav-link::after {
    content: "";
    position: absolute;
    left: 0.85rem;
    right: 0.85rem;
    bottom: 0;
    height: 2px;
    background-color: #4a7298;
    border-radius: 2px;
}

/* Publications/Blog year sidebar: left accent bar on the active year plus a
   hover color, matching the blog table-of-contents' active-link treatment. */
#navbar-year .nav-link {
    border-left: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

#navbar-year .nav-link:hover {
    color: #4a7298;
}

#navbar-year .nav-link.active {
    border-left-color: #4a7298;
}

/* Awards: hairline dividers instead of bullet points, consistent with the
   dividers used between news-year groups and publication/project rows. */
.award-list li {
    padding: 0.4rem 0;
}

.award-list li + li {
    border-top: 1px dashed #f0f0f0;
}

/* Project entries without a real institution logo get a designed placeholder
   badge instead of a bare gray icon, so it reads as intentional. */
.project-icon-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: #eef2f7;
    color: #4a7298;
    font-size: 0.75rem;
}

/* Publication cover thumbnails: force a consistent aspect ratio so real cover
   images and the generated bubble-hash placeholders line up the same way,
   regardless of the source image's native size. */
.col-md-3.col-xl-2 > img.lazy,
.col-md-3.col-xl-2 > svg.bubble-visual-hash {
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border: 1px solid #f0f0f0;
    border-radius: 0.4rem !important;
}

/* Subtle hover tint on list rows (publications, projects, blog posts) to
   invite the click without adding any shadow/motion. */
.list-row {
    transition: background-color 0.15s ease;
}

.list-row:hover {
    background-color: #fafbfc;
}

/* News feed item: sized between the muted meta text (0.8rem) and full body
   copy (1rem) — large enough to read as content, not so large that a feed of
   six one-line entries feels heavy. */
.news-item-title {
    font-size: 0.9rem;
    line-height: 1.5;
}

.news-icon {
    margin-right: 0.4rem;
}
