/* Academic home page (used only by _layouts/home.html) */
:root {
    --bg: #fbfaf7;
    --surface: #ffffff;
    --text: #1f2328;
    --muted: #636b74;
    --line: #e4e1da;
    --accent: #1d5c8f;
    --chip: #eef3f7;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #14171a;
        --surface: #1b1f23;
        --text: #e6e8ea;
        --muted: #9aa3ad;
        --line: #2c3238;
        --accent: #7db8e8;
        --chip: #222a31;
    }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.7 -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue",
          "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1000px; margin: 0 auto; padding: 0 24px; }

/* top bar */
.topbar {
    position: sticky; top: 0; z-index: 10;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}
.topbar .wrap {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; height: 56px;
}
.brand { color: var(--text); font-weight: 600; white-space: nowrap; }
.topbar nav { display: flex; gap: 20px; overflow-x: auto; }
.topbar nav a { color: var(--muted); font-size: 15px; white-space: nowrap; }
.topbar nav a:hover { color: var(--accent); text-decoration: none; }

/* two columns */
.layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 56px;
    padding-top: 48px;
    padding-bottom: 32px;
}

.profile { position: sticky; top: 104px; align-self: start; }
.avatar {
    width: 160px; height: 160px; border-radius: 50%;
    object-fit: cover; border: 1px solid var(--line); display: block;
}
.profile h1 { font-size: 24px; line-height: 1.3; margin: 20px 0 6px; }
.profile p { margin: 0; }
.role { font-weight: 500; }
.affiliation { color: var(--muted); font-size: 15px; line-height: 1.5; margin-top: 2px !important; }
.links { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 6px 14px; }
.links a { font-size: 15px; }
.motto { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); }
.side-label {
    display: block; margin-bottom: 8px; color: var(--muted);
    font-size: 12px; letter-spacing: .08em; text-transform: uppercase; font-weight: 600;
}
.motto-text { color: var(--text); font-style: italic; font-size: 15px; line-height: 1.5; }
.motto-zh { color: var(--muted); font-size: 14px; line-height: 1.6; margin-top: 4px !important; }

.visitors { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); max-width: 240px; }
.visitors img, .visitors canvas, .visitors iframe { max-width: 100%; height: auto; border-radius: 6px; }

/* sections */
section { margin-bottom: 44px; }
section h2 {
    font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
    color: var(--muted); font-weight: 600;
    margin: 0 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
}
section p { margin: 0 0 12px; }

.chips { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { background: var(--chip); border-radius: 999px; padding: 3px 12px; font-size: 14px; }

.rows { list-style: none; padding: 0; margin: 0; }
.rows li { display: flex; gap: 18px; padding: 7px 0; }
.rows .when {
    flex: 0 0 132px; color: var(--muted); font-size: 14px;
    font-variant-numeric: tabular-nums; padding-top: 2px;
}
.rows .what { flex: 1; min-width: 0; }
.rows.with-logo li { align-items: flex-start; gap: 14px; padding: 10px 0; }
.rows.with-logo .when { order: 3; flex: 0 0 auto; text-align: right; white-space: nowrap; }
.logo {
    flex: 0 0 44px; width: 44px; height: 44px; border-radius: 8px;
    background: #fff; border: 1px solid var(--line);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; margin-top: 2px;
}
.logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; display: block; }
.logo.mono { background: var(--chip); color: var(--muted); font-weight: 600; font-size: 18px; }
.detail { color: var(--muted); font-size: 15px; }
.more { margin-top: 10px; font-size: 15px; }

.pubs { padding-left: 22px; margin: 0; }
.pubs li { margin-bottom: 18px; padding-left: 4px; }
.pubs li::marker { color: var(--muted); font-size: 14px; }
section h3 { font-size: 15px; margin: 26px 0 10px; }
.pubs.plain { list-style: none; padding-left: 0; }
.pubs.plain li { padding-left: 0; }
.pub-title { font-weight: 600; line-height: 1.45; }
.pub-authors { color: var(--muted); font-size: 15px; }
.pub-authors strong { color: var(--text); }
.pub-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; margin-top: 2px; align-items: center; }
.venue { font-style: italic; }
.note { background: var(--chip); border-radius: 4px; padding: 0 7px; }

.foot {
    color: var(--muted); font-size: 13px;
    padding-top: 20px; padding-bottom: 40px;
    border-top: 1px solid var(--line);
}

@media (max-width: 760px) {
    .wrap { padding: 0 16px; }
    .layout { grid-template-columns: 1fr; gap: 32px; padding-top: 28px; }
    .profile { position: static; }
    .avatar { width: 112px; height: 112px; }
    .rows li { flex-direction: column; gap: 0; }
    .rows.with-logo li { flex-direction: row; flex-wrap: wrap; }
    .rows.with-logo .what { flex: 1 1 0; }
    .rows.with-logo .when { order: 3; flex: 0 0 100%; text-align: left; padding-left: 58px; }
    .rows .when { flex: none; }
}
