:root {
    --sidebar-width: 310px;
    --accent: #244b72;
    --accent-dark: #173650;
    --accent-soft: #e8f0f6;
    --sidebar-bg: #f5f2eb;
    --page-bg: #edf1f4;
    --surface: #ffffff;
    --border: #dce3e8;
    --text-primary: #24323d;
    --text-secondary: #566570;
    --shadow: 0 18px 50px rgba(36, 58, 76, 0.1);
}

html {
    min-height: 100%;
    background: var(--page-bg);
}

body {
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    background: var(--page-bg);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration-thickness: 1px;
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--accent-dark);
}

a:focus-visible,
button:focus-visible {
    outline: 3px solid rgba(36, 75, 114, 0.32);
    outline-offset: 4px;
}

.site-shell {
    min-height: 100vh;
}

.profile-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: var(--sidebar-width);
    overflow-y: auto;
    border-right: 1px solid rgba(36, 75, 114, 0.12);
    background:
        radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.9), transparent 32%),
        var(--sidebar-bg);
    scrollbar-color: rgba(36, 75, 114, 0.28) transparent;
    scrollbar-width: thin;
}

.profile-sidebar::-webkit-scrollbar {
    width: 5px;
}

.profile-sidebar::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(36, 75, 114, 0.28);
}

.sidebar-inner {
    display: flex;
    min-height: 100%;
    padding: 2rem 2rem 1.2rem;
    flex-direction: column;
}

.site-brand {
    align-self: flex-start;
    margin-bottom: 1.45rem;
    color: var(--accent-dark);
    font-family: 'Merriweather', Georgia, serif;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    text-decoration: none;
}

.site-brand::after {
    display: block;
    width: 2rem;
    height: 2px;
    margin-top: 0.65rem;
    background: var(--accent);
    content: '';
}

.profile-block {
    margin-bottom: 1.55rem;
}

.profile-photo {
    display: block;
    width: 116px;
    height: 116px;
    margin-bottom: 1rem;
    border: 5px solid rgba(255, 255, 255, 0.92);
    border-radius: 50%;
    box-shadow: 0 14px 30px rgba(30, 55, 75, 0.2);
    object-fit: cover;
    object-position: center;
}

.profile-name {
    color: var(--text-primary);
    font-family: 'Merriweather', 'Noto Serif SC', Georgia, serif;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.45;
}

.profile-name .english-name,
.profile-name .chinese-name {
    display: block;
}

.profile-name .chinese-name {
    margin-top: 0.2rem;
    font-family: 'Noto Serif SC', Georgia, serif;
    font-size: 1.08em;
    letter-spacing: 0.12em;
}

.section-navigation {
    display: grid;
    gap: 0.35rem;
}

.section-link {
    display: grid;
    min-height: 2.85rem;
    padding: 0.58rem 0.85rem;
    border: 1px solid transparent;
    border-radius: 12px;
    color: #40515e;
    font-weight: 600;
    grid-template-columns: 1.8rem 1fr;
    align-items: center;
    text-decoration: none;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.section-link i {
    color: #728695;
    font-size: 1rem;
    text-align: center;
    transition: color 160ms ease;
}

.section-link:hover {
    border-color: rgba(36, 75, 114, 0.16);
    background: rgba(255, 255, 255, 0.64);
    color: var(--accent-dark);
    transform: translateX(2px);
}

.section-link.is-active {
    border-color: var(--accent);
    background: var(--accent);
    box-shadow: 0 8px 20px rgba(36, 75, 114, 0.2);
    color: #ffffff;
}

.section-link.is-active i {
    color: #ffffff;
}

.language-toggle {
    width: 100%;
    min-height: 2.8rem;
    margin-top: 1rem;
    border: 1px solid rgba(36, 75, 114, 0.35);
    border-radius: 10px;
    background: transparent;
    color: var(--accent);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    transition: background-color 160ms ease, color 160ms ease;
}

.language-toggle:hover {
    background: var(--accent-soft);
    color: var(--accent-dark);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    color: #7b888f;
    font-size: 0.72rem;
    line-height: 1.55;
}

.footer-links {
    display: flex;
    margin-top: 0.55rem;
    gap: 0.5rem;
    align-items: center;
}

.sidebar-footer a {
    color: #667985;
}

.content-workspace {
    min-height: 100vh;
    margin-left: var(--sidebar-width);
    padding: clamp(2rem, 4vw, 4.5rem);
}

.content-frame {
    width: min(100%, 1040px);
    margin: 0 auto;
}

.content-panel {
    min-height: calc(100vh - clamp(4rem, 8vw, 9rem));
    overflow: hidden;
    border: 1px solid rgba(36, 75, 114, 0.1);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.content-panel[hidden] {
    display: none;
}

.content-panel.is-active {
    animation: panel-in 220ms ease-out;
}

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

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

.hero-banner {
    position: relative;
    display: flex;
    min-height: 270px;
    padding: clamp(1.8rem, 5vw, 4rem);
    overflow: hidden;
    background-image:
        linear-gradient(100deg, rgba(14, 31, 44, 0.82) 0%, rgba(14, 31, 44, 0.45) 55%, rgba(14, 31, 44, 0.18) 100%),
        url('../assets/img/luxueqi.jpg');
    background-position: center;
    background-size: cover;
    align-items: flex-end;
}

.hero-banner::after {
    position: absolute;
    right: -3rem;
    bottom: -5rem;
    width: 17rem;
    height: 17rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    content: '';
}

.hero-quote {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0;
    color: #ffffff;
    font-family: 'Newsreader', 'Noto Serif SC', Georgia, serif;
    font-size: clamp(2rem, 4.1vw, 3.8rem);
    font-style: italic;
    font-weight: 500;
    letter-spacing: -0.025em;
    line-height: 1.08;
    text-wrap: balance;
}

.panel-header {
    padding: clamp(2rem, 4vw, 3.2rem) clamp(1.5rem, 5vw, 4.4rem) 1.5rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(180deg, #fbfcfd 0%, #ffffff 100%);
}

.panel-header h2 {
    margin: 0;
    color: var(--accent-dark);
    font-family: 'Merriweather', 'Noto Serif SC', Georgia, serif;
    font-size: clamp(1.65rem, 3vw, 2.3rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.25;
}

.panel-header h2:focus,
.main-body [tabindex="-1"]:focus {
    outline: none;
}

.panel-header h2 i {
    margin-right: 0.55rem;
    color: var(--accent);
    font-size: 0.8em;
}

.panel-body {
    padding: clamp(2rem, 4.5vw, 4.2rem) clamp(1.5rem, 5vw, 4.4rem);
}

.home-body {
    padding-top: clamp(2.3rem, 5vw, 4.4rem);
}

.main-body {
    color: var(--text-secondary);
    font-size: 1.04rem;
    line-height: 1.82;
}

.main-body h2,
.main-body h3,
.main-body h4 {
    color: var(--accent-dark);
    font-family: 'Merriweather', 'Noto Serif SC', Georgia, serif;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.35;
}

.main-body h2 {
    margin: 2.5rem 0 1rem;
    font-size: 1.45rem;
}

.main-body h2:first-child,
.main-body h3:first-child {
    margin-top: 0;
}

.main-body h3 {
    margin: 2rem 0 0.85rem;
    font-size: 1.15rem;
}

.main-body p {
    margin: 0 0 1rem;
}

.main-body strong {
    color: var(--text-primary);
    font-weight: 650;
}

.main-body em {
    color: #455662;
}

.main-body hr {
    margin: 2.25rem 0;
    border: 0;
    border-top: 1px solid var(--border);
    opacity: 1;
}

.main-body ul,
.main-body ol {
    margin: 0 0 1.5rem;
    padding-left: 1.45rem;
}

.main-body li {
    margin-bottom: 0.68rem;
    padding-left: 0.25rem;
}

#awards-md > ul {
    padding: 1.25rem 1.35rem 1.25rem 2.8rem;
    border: 1px solid #dce6ed;
    border-radius: 14px;
    background: #f7fafc;
}

#publications-md ol {
    padding-left: 1.65rem;
}

#publications-md ol li {
    margin-bottom: 1.15rem;
    padding-left: 0.45rem;
}

#publications-md a {
    font-weight: 600;
}

@media (max-width: 900px) {
    .profile-sidebar {
        position: relative;
        inset: auto;
        width: 100%;
        overflow: visible;
        border-right: 0;
        border-bottom: 1px solid rgba(36, 75, 114, 0.12);
    }

    .sidebar-inner {
        display: grid;
        min-height: 0;
        padding: 1.4rem clamp(1rem, 4vw, 2rem);
        gap: 1.2rem;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "profile language"
            "navigation navigation"
            "footer footer";
    }

    .site-brand {
        display: none;
    }

    .profile-block {
        display: flex;
        margin: 0;
        gap: 1rem;
        grid-area: profile;
        align-items: center;
    }

    .profile-photo {
        width: 74px;
        height: 74px;
        margin: 0;
        border-width: 3px;
    }

    .profile-name {
        font-size: 1rem;
    }

    .section-navigation {
        grid-area: navigation;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .section-link {
        display: flex;
        min-height: 2.8rem;
        padding: 0.6rem 0.55rem;
        justify-content: center;
        gap: 0.45rem;
    }

    .section-link:hover {
        transform: none;
    }

    .language-toggle {
        width: auto;
        min-width: 6rem;
        margin: 0;
        padding: 0 1rem;
        grid-area: language;
        align-self: center;
    }

    .sidebar-footer {
        display: flex;
        margin: 0;
        padding: 0.2rem 0 0;
        border-top: 1px solid rgba(36, 75, 114, 0.1);
        gap: 0.8rem;
        grid-area: footer;
        justify-content: space-between;
        align-items: center;
    }

    .footer-links {
        margin: 0;
    }

    .content-workspace {
        margin-left: 0;
        padding: clamp(1rem, 4vw, 2.25rem);
    }

    .content-panel {
        min-height: 60vh;
    }
}

@media (max-width: 580px) {
    .sidebar-inner {
        grid-template-columns: 1fr auto;
    }

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

    .section-link {
        justify-content: flex-start;
        padding-inline: 0.85rem;
    }

    .sidebar-footer {
        display: block;
    }

    .footer-links {
        margin-top: 0.35rem;
    }

    .hero-banner {
        min-height: 210px;
    }

    .hero-quote {
        font-size: clamp(1.8rem, 10vw, 2.55rem);
    }

    .content-panel {
        border-radius: 16px;
    }

    .main-body {
        font-size: 0.98rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
