:root {
    --bg-base: #f4edde;
    --bg-soft: #fbf7ef;
    --panel: rgba(255, 252, 246, 0.86);
    --panel-strong: #fffaf1;
    --line: #d8c6a2;
    --line-strong: #b8945a;
    --text-main: #1d2a3d;
    --text-muted: #5f6a7a;
    --accent: #8a6330;
    --accent-strong: #6f4d21;
    --shadow-soft: 0 18px 34px rgba(28, 39, 56, 0.12);
    --shadow-card: 0 10px 22px rgba(29, 40, 58, 0.1);
    --shadow-card-hover: 0 18px 28px rgba(29, 40, 58, 0.16);
    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --content-max-width: 1240px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    color: var(--text-main);
    background:
        radial-gradient(1200px 520px at 0% -12%, rgba(177, 139, 84, 0.16), transparent 62%),
        radial-gradient(980px 440px at 100% 104%, rgba(35, 57, 88, 0.12), transparent 64%),
        linear-gradient(180deg, #f6f0e4, #efe4cf 56%, #f4edde);
    font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "Times New Roman", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", serif;
    line-height: 1.65;
    overflow-x: hidden;
    min-height: 100svh;
    min-height: 100dvh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 11px 18px;
    border-bottom: 1px solid rgba(153, 117, 66, 0.42);
    background: rgba(252, 247, 238, 0.9);
    backdrop-filter: blur(10px);
    box-shadow: 0 6px 18px rgba(52, 39, 20, 0.08);
}

@supports not ((backdrop-filter: blur(1px))) {
    .topbar {
        background: rgba(252, 247, 238, 0.98);
    }
}

.topbar-brand-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 220px;
}

.topbar-brand {
    font-size: 17px;
    letter-spacing: 0.28px;
    color: #19293f;
    white-space: nowrap;
    font-weight: 600;
}

.topbar-slogan {
    font-size: 12px;
    letter-spacing: 0.15px;
    color: #746246;
    white-space: normal;
    line-height: 1.35;
    max-width: 360px;
}

.topbar-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.top-nav-link {
    text-decoration: none;
    color: #3a2d1d;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 13px;
    letter-spacing: 0.15px;
    transition: 0.2s ease;
    font-weight: 500;
}

.top-nav-link:hover {
    border-color: var(--line-strong);
    background: #f8efde;
    color: #2e200f;
    transform: translateY(-1px);
}

.top-nav-link-cv {
    border: 1px solid var(--line-strong);
    background: linear-gradient(180deg, #fbf2e0, #f0dcc0);
    box-shadow: 0 6px 14px rgba(73, 48, 16, 0.14);
    font-weight: 600;
}

.top-nav-link:focus-visible,
.copy-btn:focus-visible,
.carousel-arrow:focus-visible,
.dot:focus-visible,
.avatar-image:focus-visible {
    outline: 2px solid #8b6b3a;
    outline-offset: 2px;
}

a,
button {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.page-shell {
    max-width: none;
    width: 100%;
    margin: 0;
    padding: 12px 0 0;
    display: grid;
    grid-template-columns: 336px minmax(0, 1fr);
    gap: 10px;
}

.sidebar {
    position: sticky;
    top: 78px;
    align-self: start;
    display: grid;
    gap: 10px;
    max-height: calc(100vh - 96px);
    overflow-y: hidden;
    overflow-x: hidden;
    padding: 0 8px 0 10px;
    scrollbar-width: thin;
    scrollbar-color: #8e6c3d rgba(238, 223, 193, 0.7);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.content-pane {
    scrollbar-width: thin;
    scrollbar-color: #8e6c3d rgba(238, 223, 193, 0.7);
    max-height: calc(100vh - 96px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.sidebar::-webkit-scrollbar,
.content-pane::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.sidebar::-webkit-scrollbar:horizontal {
    height: 0;
}

.sidebar::-webkit-scrollbar-track,
.content-pane::-webkit-scrollbar-track {
    background: linear-gradient(180deg, rgba(246, 236, 214, 0.84), rgba(236, 218, 184, 0.68));
    border-radius: 999px;
}

.sidebar::-webkit-scrollbar-thumb,
.content-pane::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #a68452, #7e5a31);
    border-radius: 999px;
    border: 1px solid rgba(255, 248, 234, 0.62);
}

.sidebar::-webkit-scrollbar-thumb:hover,
.content-pane::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #8f6d3f, #684723);
}

.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--panel);
    box-shadow: 0 10px 22px rgba(28, 39, 56, 0.1);
    backdrop-filter: blur(2px);
    min-width: 0;
}

.profile-panel {
    padding: 12px 12px 10px;
}

.avatar-carousel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.avatar-container {
    position: relative;
    width: clamp(150px, 16.8vh, 190px);
    height: clamp(210px, 23.8vh, 266px);
}

.avatar-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 1px solid #cfba96;
    border-radius: 14px;
    box-shadow: 0 14px 26px rgba(22, 35, 53, 0.24);
    opacity: 0;
    transform: rotateY(0deg) rotateZ(0deg) scale(1);
    transition: all 0.55s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    backface-visibility: hidden;
    cursor: pointer;
}

.avatar-image.active {
    position: relative;
    opacity: 1;
    z-index: 5;
}

.avatar-image.exit-left {
    transform: rotateY(-90deg) rotateZ(-8deg) translateX(-64px) translateY(16px) scale(0.93);
    opacity: 0;
}

.avatar-image.exit-right {
    transform: rotateY(90deg) rotateZ(8deg) translateX(64px) translateY(16px) scale(0.93);
    opacity: 0;
}

.carousel-arrow {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid #be9a62;
    color: #65451f;
    background: linear-gradient(180deg, #f8efdf, #ecd7b8);
    box-shadow: 0 5px 12px rgba(70, 47, 19, 0.18);
    cursor: pointer;
    transition: 0.2s ease;
}

.carousel-arrow:hover {
    transform: translateY(-1px);
    background: linear-gradient(180deg, #fbf3e4, #efdcbf);
}

.carousel-dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 7px;
    margin-top: 8px;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    border: 1px solid #b09061;
    background: #e0d1b7;
    padding: 0;
    cursor: pointer;
    transition: 0.2s ease;
}

.dot.active {
    background: #845b2e;
    border-color: #845b2e;
    transform: scale(1.2);
}

.profile-name {
    margin: 10px 0 0;
    font-size: 23px;
    line-height: 1.25;
    color: #16253a;
    text-align: center;
}

.profile-name-cn {
    font-size: 18px;
    font-weight: 500;
    color: #324863;
}

.profile-role {
    margin: 6px 0 0;
    text-align: center;
    color: #4c5870;
    font-size: 13px;
}

.contact-group {
    padding: 10px;
    display: grid;
    gap: 8px;
    min-width: 0;
}

.contact-card {
    border: 1px solid #d5bf99;
    border-radius: var(--radius-md);
    background: var(--panel-strong);
    box-shadow: var(--shadow-card);
    padding: 10px;
    min-width: 0;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.contact-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
    border-color: #bf9b64;
}

.card-title {
    margin: 0 0 6px;
    font-size: 14px;
    color: #1b304d;
}

.card-content {
    font-size: 12px;
    color: #2b3f5b;
}

.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.info-row:last-child {
    margin-bottom: 0;
}

.wechat-name {
    font-size: 14px;
    font-weight: 600;
}

.email-link,
.text-link {
    color: #244975;
    text-decoration: underline;
    text-decoration-color: rgba(36, 73, 117, 0.38);
    text-underline-offset: 2px;
    word-break: break-all;
}

.address-en {
    margin-bottom: 6px;
    line-height: 1.5;
}

.address-cn {
    margin-bottom: 7px;
    font-weight: 600;
    line-height: 1.45;
}

.copy-btn {
    border: 1px solid #b58d53;
    border-radius: 999px;
    background: linear-gradient(180deg, #f7ebd6, #ebd3ae);
    color: #593c19;
    font-family: inherit;
    font-size: 10.5px;
    padding: 2px 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: 0.2s ease;
}

.copy-btn:hover {
    background: linear-gradient(180deg, #fbf2e2, #edd9ba);
    transform: translateY(-1px);
}

.address-copy-btn {
    margin-top: 2px;
}

.content-pane {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 252, 246, 0.92);
    box-shadow:
        0 18px 32px rgba(21, 33, 50, 0.13),
        0 1px 0 rgba(255, 255, 255, 0.88) inset;
    padding: 28px 30px 34px;
    min-height: 0;
}

.section-block {
    margin-bottom: 32px;
    scroll-margin-top: 88px;
    animation: section-in 0.5s ease both;
}

.section-block:last-child {
    margin-bottom: 0;
}

.section-block:nth-child(2) {
    animation-delay: 0.04s;
}

.section-block:nth-child(3) {
    animation-delay: 0.08s;
}

.section-block:nth-child(4) {
    animation-delay: 0.12s;
}

.section-block:nth-child(5) {
    animation-delay: 0.16s;
}

h2 {
    margin: 0 0 16px;
    font-size: 24px;
    font-weight: 600;
    color: #142844;
    letter-spacing: 0.16px;
    border-bottom: 1px solid rgba(185, 152, 96, 0.42);
    padding-bottom: 10px;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.info-table td {
    vertical-align: top;
    padding: 9px 0;
}

.info-table tr + tr td {
    border-top: 1px dashed rgba(135, 114, 77, 0.34);
}

.info-label {
    width: 112px;
    min-width: 100px;
    color: #725c3a;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 12px;
    font-weight: 700;
}

.affiliation-cn {
    color: #354862;
    font-family: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
}

.body-text {
    font-size: 17px;
    line-height: 1.86;
    letter-spacing: 0.12px;
    color: #1d2d43;
    max-width: 75ch;
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    text-wrap: pretty;
}

#about .body-text,
#research .body-text {
    max-width: 100%;
}

.body-text-with-margin {
    margin-top: 20px;
}

.paragraph-start {
    margin-top: 0;
}

.paragraph-end {
    margin-bottom: 0;
}

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

.news-item {
    position: relative;
    padding-left: 18px;
    margin-bottom: 12px;
    font-size: 15px;
}

.news-item::before {
    content: "\25A0";
    position: absolute;
    left: 0;
    top: 2px;
    color: #7c5a2d;
    font-size: 9px;
}

.news-date {
    display: inline-block;
    margin-right: 8px;
    padding: 1px 6px;
    font-family: "Courier New", monospace;
    font-size: 12px;
    border-radius: 4px;
    border: 1px solid #c6ab79;
    background: #f2e4cb;
}

.paper-card {
    border: 1px solid #d5bf99;
    border-radius: 14px;
    background: #fffaf2;
    box-shadow: var(--shadow-card);
    padding: 16px;
    margin-bottom: 13px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.paper-card:hover {
    transform: translateY(-2px);
    border-color: #bf9b64;
    box-shadow: var(--shadow-card-hover);
}

.paper-card:last-child {
    margin-bottom: 0;
}

.paper-header,
.paper-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.paper-header,
.paper-title {
    color: #16304f;
    font-weight: 700;
}

.paper-meta,
.paper-citation,
.paper-journal {
    margin-top: 8px;
    font-size: 14px;
}

.pdf-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    text-decoration: none;
    border: 1px solid #8e3321;
    color: #8e3321;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    padding: 2px 10px;
    transition: 0.2s ease;
}

.pdf-link:hover {
    color: #fff;
    background: #8e3321;
}

#toast {
    visibility: hidden;
    position: fixed;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%);
    z-index: 200;
    border: 1px solid #3f2a10;
    border-radius: 8px;
    background: rgba(37, 29, 17, 0.92);
    color: #fff7eb;
    padding: 8px 14px;
    font-size: 13px;
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.25);
}

@supports (padding: max(0px)) {
    .topbar {
        padding-top: max(11px, env(safe-area-inset-top));
        padding-left: max(18px, env(safe-area-inset-left));
        padding-right: max(18px, env(safe-area-inset-right));
    }

    .page-shell {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}

@media (hover: none) and (pointer: coarse) {
    .top-nav-link {
        min-height: 38px;
        display: inline-flex;
        align-items: center;
    }

    .copy-btn {
        min-height: 32px;
        padding: 4px 10px;
    }

    .carousel-arrow {
        min-width: 36px;
        min-height: 36px;
    }
}

@media (forced-colors: active) {
    .topbar,
    .panel,
    .contact-card,
    .content-pane,
    .paper-card {
        border: 1px solid CanvasText;
        box-shadow: none;
    }

    .top-nav-link,
    .copy-btn,
    .carousel-arrow,
    .pdf-link {
        border: 1px solid ButtonText;
    }

    .sidebar,
    .content-pane {
        scrollbar-color: auto;
    }
}

#toast.show {
    visibility: visible;
    animation: fade-in 0.25s ease, fade-out 0.25s ease 2.25s;
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes fade-out {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    to {
        opacity: 0;
        transform: translateX(-50%) translateY(8px);
    }
}

@keyframes section-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1100px) {
    .page-shell {
        grid-template-columns: 300px minmax(0, 1fr);
        padding-top: 12px;
    }

    .avatar-container {
        width: 190px;
        height: 266px;
    }

    .content-pane {
        padding: 24px 24px;
    }
}

@media (max-width: 900px) {
    .topbar {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .topbar-brand {
        text-align: center;
    }

    .topbar-brand-block {
        min-width: 0;
        align-items: center;
    }

    .topbar-slogan {
        text-align: center;
        max-width: 100%;
    }

    .topbar-nav {
        justify-content: center;
    }

    .top-nav-link-cv {
        justify-self: center;
    }

    .page-shell {
        grid-template-columns: 1fr;
        gap: 12px;
        padding-top: 10px;
    }

    .sidebar {
        position: relative;
        top: 0;
        gap: 12px;
        padding: 0 10px;
        max-height: none;
        overflow: visible;
    }

    .content-pane {
        min-height: 0;
        border-radius: 14px;
        max-height: none;
        overflow: visible;
    }

    .contact-group {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .page-shell {
        padding: 8px 0 14px;
    }

    .profile-name {
        font-size: 22px;
    }

    .profile-name-cn {
        font-size: 17px;
    }

    .content-pane {
        padding: 18px 12px;
        border-radius: 0;
    }

    h2 {
        font-size: 21px;
    }

    .body-text {
        font-size: 16px;
    }

    .contact-group {
        grid-template-columns: 1fr;
    }

    .info-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .copy-btn {
        align-self: flex-end;
    }

}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

