/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    color-scheme: light;
    /* Light theme colors */
    --bg-primary: #ffffff;
    --bg-secondary: transparent;
    --text-primary: #333333;
    --text-secondary: #374151;
    --text-tertiary: #6b7280;
    --text-heading: #111827;
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --accent-color: #2e8da8;
    --accent-hover: #236d82;
    --venue-gold: #c9971c;
    --placeholder-bg: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    --placeholder-border: #d1d5db;
    --placeholder-text: #9ca3af;
    --news-date-bg: linear-gradient(135deg, #e0f2f7 0%, #b2ebf2 100%);
    --news-date-border: #80deea;
    --profile-border: #e5e7eb;
    --modal-bg: rgba(0, 0, 0, 0.5);
    --modal-content-bg: #ffffff;
    --code-bg: #f8f9fa;
}

html {
    background-color: var(--bg-primary);
}

html[data-theme="dark"],
body.dark-theme {
    color-scheme: dark;
    /* Dark theme colors */
    --bg-primary: #1a1a1a;
    --bg-secondary: transparent;
    --text-primary: #e5e5e5;
    --text-secondary: #d1d5db;
    --text-tertiary: #9ca3af;
    --text-heading: #f3f4f6;
    --border-color: #374151;
    --border-light: #2d3748;
    --accent-color: #52adc8;
    --accent-hover: #6bc1dc;
    --venue-gold: #e3b341;
    --placeholder-bg: linear-gradient(135deg, #2d3748 0%, #374151 100%);
    --placeholder-border: #4b5563;
    --placeholder-text: #6b7280;
    --news-date-bg: linear-gradient(135deg, #1e3a47 0%, #2a5567 100%);
    --news-date-border: #3d7a8c;
    --profile-border: #374151;
    --modal-bg: rgba(0, 0, 0, 0.7);
    --modal-content-bg: #2d3748;
    --code-bg: #1a1a1a;
}

body {
    font-family: 'Noto Serif', 'PT Serif', 'Source Serif Pro', Georgia, 'Times New Roman', serif;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    font-size: 16px;
    padding-top: 64px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

html.theme-booting body,
html.theme-booting .top-nav {
    transition: none !important;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.2s;
}

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

/* Top Navigation */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    min-height: 64px;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.nav-container {
    display: flex;
    width: min(100%, 1240px);
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
}

.nav-link {
    color: var(--text-tertiary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.2s;
}

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

.nav-link.active {
    color: var(--accent-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--accent-color);
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: 1rem;
    border-radius: 50%;
    transition: color 0.2s, background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.theme-toggle:hover {
    color: var(--accent-color);
    background-color: var(--border-color);
}

.theme-toggle.is-active {
    color: var(--accent-color);
    background-color: rgba(82, 173, 200, 0.16);
}

body.dark-theme .theme-toggle.is-active {
    background-color: rgba(107, 193, 220, 0.24);
}

/* Layout wrapper */
.wrapper {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    align-items: start;
    column-gap: 46px;
    min-height: calc(100vh - 64px);
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 84px;
    width: 240px;
    max-height: calc(100vh - 100px);
    align-self: start;
    background-color: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
}

.sidebar-content {
    padding: 2.5rem 28px 2.5rem 0;
    text-align: center;
}

.profile-image {
    margin-bottom: 1.5rem;
}

.profile-pic {
    width: 164px;
    height: 164px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--profile-border);
}

.name {
    font-size: 1.65rem;
    font-weight: 650;
    color: var(--text-heading);
    margin-bottom: 0.25rem;
}

.chinese-name {
    font-size: 1.25rem;
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
}

.tagline {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-tertiary);
    margin-bottom: 2rem;
    line-height: 1.5;
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: flex-start;
}

/* Primary CV link stays visible beside the profile and above contact links. */
.cv-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
    max-width: 212px;
    min-height: 46px;
    margin-bottom: 1.4rem;
    padding: 0.7rem 1rem;
    border: 1px solid transparent;
    border-radius: 6px;
    background-color: #236d82;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    transition: background-color 0.2s;
}

.cv-button:hover {
    background-color: #195669;
    color: #ffffff;
    text-decoration: none;
}

.cv-button:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 4px;
}

.cv-icon {
    flex-shrink: 0;
}

.cv-format {
    margin-left: auto;
    padding: 0.15rem 0.35rem;
    border: 1px solid currentColor;
    border-radius: 3px;
    font-family: system-ui, sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.04em;
}

body.dark-theme .cv-button {
    background-color: #52adc8;
    color: #111827;
}

body.dark-theme .cv-button:hover {
    background-color: #6bc1dc;
    color: #111827;
}

.location {
    display: flex;
    align-items: center;
    color: var(--text-tertiary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0.4rem 0;
    margin-bottom: 0;
}

.location i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
    color: var(--accent-color);
}

.sidebar-link {
    display: flex;
    align-items: center;
    color: var(--text-tertiary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.88rem;
    font-weight: 550;
    padding: 0.4rem 0;
    transition: color 0.2s;
    width: 100%;
}

.sidebar-link i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
    color: var(--accent-color);
}

.sidebar-link:hover {
    color: var(--accent-color);
    text-decoration: none;
}

/* Main content */
.main-content {
    min-width: 0;
    padding: 2.8rem 0 3.5rem;
    max-width: 900px;
}

/* Content sections */
.content-section {
    margin-bottom: 2rem;
}

.section-title {
    color: var(--text-heading);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.5rem;
    font-weight: 650;
}

/* About section */
.about-content p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
    line-height: 1.75;
    font-size: 1rem;
}

/* Research Interests section */
.interests-list {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin: 0;
}

.interests-list li {
    color: var(--text-secondary);
    line-height: 1.65;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.interests-list li:last-child {
    margin-bottom: 0;
}

/* News section */
.news-container {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.news-item {
    display: flex;
    gap: 1rem;
    padding: 0.3rem 0.4rem;
    align-items: flex-start;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.news-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

body.dark-theme .news-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.news-date {
    font-weight: 600;
    color: var(--accent-color);
    background: var(--news-date-bg);
    width: 85px;
    flex-shrink: 0;
    font-size: 0.8rem;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(82, 173, 200, 0.15);
    letter-spacing: 0.3px;
    border: 1px solid var(--news-date-border);
    line-height: 1.3;
}

.news-content {
    color: var(--text-secondary);
    line-height: 1.55;
    font-size: 0.95rem;
    padding-top: 0;
}

/* Education section */
.education-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.education-item {
    display: flex;
    gap: 1.25rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.education-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.edu-logo {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.edu-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.edu-content {
    flex: 1;
}

.edu-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.4rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.edu-header h3 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-heading);
}

.edu-date {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    font-style: italic;
}

.edu-degree {
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
    font-size: 0.95rem;
}

.edu-detail {
    color: var(--text-tertiary);
    margin-bottom: 0.2rem;
    font-size: 0.9rem;
    font-style: italic;
}

.edu-location {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

/* Publications and Projects sections */
.publications-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.publication-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 0 0 1.125rem;
    margin-bottom: 1.125rem;
    border-bottom: 1px solid var(--border-color);
}

.publication-item:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
    border-bottom: none;
}

.pub-image,
.pub-image-placeholder {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 184px;
    height: 136px;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--code-bg);
    overflow: hidden;
    margin-top: 4px;
}

.pub-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pub-image img[src$=".svg"] {
    object-fit: contain;
    padding: 0.25rem;
}

.pub-image-placeholder {
    background: var(--placeholder-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--placeholder-border);
}

.placeholder-text {
    color: var(--placeholder-text);
    font-size: 0.85rem;
    font-weight: 500;
}

.pub-content {
    flex: 1;
    min-width: 0;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: baseline;
}

.pub-content > :not(.pub-title):not(.pub-links) {
    grid-column: 1 / -1;
}

.pub-title {
    font-size: 1.1rem;
    font-weight: 650;
    color: var(--text-heading);
    margin-bottom: 0.4rem;
    line-height: 1.4;
}

.pub-authors {
    color: var(--text-secondary);
    margin-bottom: 0.2rem;
    font-size: 0.94rem;
}

.pub-venue {
    color: var(--text-tertiary);
    font-style: italic;
    margin-bottom: 0.6rem;
    font-size: 0.9rem;
}

.pub-description {
    color: var(--text-secondary);
    margin-bottom: 0.65rem;
    line-height: 1.65;
    font-size: 0.96rem;
}

.pub-links {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: flex-end;
    margin-left: 0.75rem;
}

.pub-link {
    color: var(--accent-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid var(--accent-color);
    padding: 0.2rem 0.65rem;
    border-radius: 4px;
    transition: all 0.2s;
}

.pub-link:hover {
    background-color: var(--accent-color);
    color: white;
    text-decoration: none;
}

.pub-link.disabled {
    color: var(--placeholder-text);
    border-color: var(--placeholder-border);
    cursor: not-allowed;
}

.pub-link.disabled:hover {
    background-color: transparent;
    color: var(--placeholder-text);
}

/* Venue badge for the NeurIPS paper. */
.venue-badge {
    display: inline-block;
    flex-shrink: 0;
    padding: 0.12rem 0.5rem;
    border-radius: 4px;
    background: var(--venue-gold);
    color: #1a1a1a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.publication-item.is-featured .pub-image {
    border-color: color-mix(in srgb, var(--venue-gold) 60%, var(--border-color));
}

.pub-venue .venue-badge {
    margin-right: 0.35rem;
}

/* FastAFD diagram: attention GPUs and MoE/FFN GPUs trading tokens. */
.afd-figure svg {
    display: block;
    width: 100%;
    height: 100%;
}

.afd-attn {
    fill: color-mix(in srgb, var(--accent-color) 18%, var(--code-bg));
    stroke: var(--accent-color);
    stroke-width: 1.2;
}

.afd-ffn {
    fill: color-mix(in srgb, var(--venue-gold) 20%, var(--code-bg));
    stroke: var(--venue-gold);
    stroke-width: 1.2;
}

.afd-arrow {
    fill: none;
    stroke: var(--accent-color);
    stroke-width: 1.4;
}

.afd-arrow-back {
    stroke: var(--venue-gold);
}

.afd-head {
    fill: var(--accent-color);
}

.afd-head-back {
    fill: var(--venue-gold);
}

.afd-label {
    fill: var(--text-secondary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 10px;
    font-weight: 600;
}

.afd-label-mono {
    fill: var(--text-tertiary);
    font-family: "SFMono-Regular", Consolas, monospace;
    letter-spacing: 0.06em;
}

/* Honors section */
.honors-content {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.honor-item {
    display: flex;
    gap: 1rem;
    padding: 0.3rem 0;
    align-items: flex-start;
}

.honor-date {
    font-weight: 600;
    color: var(--accent-color);
    background: var(--news-date-bg);
    width: 85px;
    flex-shrink: 0;
    font-size: 0.8rem;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(82, 173, 200, 0.15);
    letter-spacing: 0.3px;
    border: 1px solid var(--news-date-border);
    line-height: 1.3;
}

.honor-text {
    color: var(--text-secondary);
    line-height: 1.55;
    font-size: 0.95rem;
    padding-top: 0;
}

/* Footer */
footer {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Modal Styles */
.modal {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: var(--modal-bg);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: var(--modal-content-bg);
    padding: 2rem;
    border-radius: 16px;
    width: 80%;
    max-width: 700px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    position: relative;
    transform: translateY(24px) scale(0.97);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
    opacity: 0;
}

.modal.show .modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.close-modal {
    color: #c06060;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    padding: 0.1rem 0.4rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    line-height: 1;
    line-height: 1;
    transition: color 0.2s;
}

.close-modal:hover,
.close-modal:focus {
    color: #a04040;
    background-color: rgba(192, 96, 96, 0.08);
    text-decoration: none;
}

body.dark-theme .close-modal {
    color: #d08080;
}

body.dark-theme .close-modal:hover,
body.dark-theme .close-modal:focus {
    color: #e09090;
    background-color: rgba(208, 128, 128, 0.12);
}

.esc-hint {
    font-size: 0.55rem;
    font-family: inherit;
    color: inherit;
    opacity: 0.7;
    border: 1px solid currentColor;
    border-radius: 3px;
    padding: 0.1rem 0.3rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    margin-top: 1px;
}

.modal-content h3 {
    margin-bottom: 1.5rem;
    color: var(--text-heading);
    font-size: 1.4rem;
}

.bibtex-container {
    position: relative;
}

#bibtex-text {
    background-color: var(--code-bg);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    white-space: pre-wrap;
    border: 1px solid var(--border-color);
}

.copy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background-color 0.2s, transform 0.1s;
    margin-left: auto;
}

.copy-btn:hover {
    background-color: var(--accent-hover);
}

.copy-btn:active {
    transform: translateY(1px);
}

/* Responsive design */
@media (max-width: 1050px) {
    body {
        padding-top: 64px;
    }

    .wrapper {
        display: block;
        padding: 0 24px;
    }

    .sidebar {
        width: 100%;
        position: relative;
        top: 0;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .sidebar-content {
        display: grid;
        grid-template-columns: 96px minmax(0, 1fr) auto;
        grid-template-areas:
            "photo identity cv"
            "links links links";
        align-items: center;
        column-gap: 18px;
        row-gap: 16px;
        padding: 20px 0;
        text-align: left;
    }

    .profile-image { grid-area: photo; margin: 0; }
    .profile-identity { grid-area: identity; }
    .cv-button { grid-area: cv; width: auto; max-width: none; margin: 0; }
    .sidebar-links {
        grid-area: links;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        gap: 5px 14px;
    }

    .main-content { padding: 2.25rem 0 3rem; }

    .profile-pic {
        width: 96px;
        height: 96px;
    }

    .name { font-size: 1.45rem; }
    .tagline { margin-bottom: 0; }

    .publication-item {
        gap: 1.25rem;
    }

    .pub-image,
    .pub-image-placeholder {
        width: 160px;
        height: 118px;
    }

    .modal-content {
        width: 90%;
        margin: 20% auto;
    }
}

@media (max-width: 640px) {
    body { padding-top: 88px; }

    .top-nav { min-height: 76px; }
    .nav-container {
        flex-wrap: wrap;
        gap: 4px 13px;
        padding: 8px 12px;
    }
    .nav-link { font-size: 0.8rem; padding: 3px 0; }
    .theme-toggle { width: 30px; height: 30px; margin-left: 0; font-size: 0.95rem; }

    .wrapper { padding: 0 16px; }
    .sidebar-content {
        grid-template-columns: 72px minmax(0, 1fr);
        grid-template-areas:
            "photo identity"
            "photo cv"
            "links links";
        column-gap: 14px;
        row-gap: 9px;
        padding: 16px 0;
    }
    .profile-pic { width: 72px; height: 72px; border-width: 2px; }
    .name { font-size: 1.25rem; margin-bottom: 0.1rem; }
    .tagline { font-size: 0.82rem; line-height: 1.45; }
    .cv-button { min-height: 40px; padding: 0.45rem 0.7rem; font-size: 0.88rem; justify-self: start; }
    .cv-format { font-size: 0.65rem; }
    .sidebar-links { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 10px; }
    .location, .sidebar-link { font-size: 0.82rem; padding: 0.28rem 0; }
    .location i, .sidebar-link i { width: 16px; margin-right: 0.45rem; }

    .main-content {
        padding: 1.8rem 0 2.5rem;
    }

    .section-title {
        font-size: 1.3rem;
    }

    .content-section {
        margin-bottom: 1.75rem;
    }
    
    .news-item,
    .honor-item {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .news-date,
    .honor-date {
        min-width: auto;
    }
    
    .education-item {
        flex-direction: column;
    }
    
    .edu-logo {
        width: 60px;
        height: 60px;
    }
    
    .edu-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .publication-item { flex-direction: column; gap: 10px; padding-bottom: 1rem; margin-bottom: 1rem; }
    .pub-image, .pub-image-placeholder { width: 132px; height: 96px; padding: 7px; }
    .pub-content { display: block; }
    .pub-links { margin: 10px 0 0; justify-content: flex-start; }
    .pub-title { font-size: 1.04rem; }
    .pub-authors, .pub-venue, .pub-description { font-size: 0.9rem; }
    .pub-description { line-height: 1.6; }
}

/* About section popup links */
.about-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.experience-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border: 1px solid var(--accent-color);
    border-radius: 6px;
    transition: background-color 0.2s, color 0.2s;
}

.experience-link:hover {
    background-color: var(--accent-color);
    color: #fff;
    text-decoration: none;
}

.experience-modal-content {
    max-width: 1060px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 2.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-color) transparent;
}

.experience-modal-content::-webkit-scrollbar {
    width: 6px;
}

.experience-modal-content::-webkit-scrollbar-track {
    background: transparent;
    margin: 12px 0;
}

.experience-modal-content::-webkit-scrollbar-thumb {
    background-color: var(--accent-color);
    border-radius: 3px;
}

.experience-modal-content::-webkit-scrollbar-thumb:hover {
    background-color: var(--accent-hover);
}

.experience-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 0;
    margin-left: 0;
}

.exp-item {
    padding: 1.25rem 0.5rem;
    position: relative;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.exp-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    flex-shrink: 0;
    margin-top: 0.1rem;
    border-radius: 8px;
}

.exp-body {
    flex: 1;
    min-width: 0;
}

.exp-item::before {
    display: none;
}

.exp-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

body.dark-theme .exp-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.exp-item + .exp-item {
    border-top: 1px solid var(--border-light);
}

.exp-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.exp-header h4 {
    color: var(--text-heading);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.exp-date {
    color: var(--modal-content-bg);
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    padding: 0.15rem 0.65rem;
    border-radius: 12px;
    letter-spacing: 0.02em;
}

.exp-org {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    margin-bottom: 0.65rem;
    font-style: italic;
}

.exp-details {
    list-style: none;
    padding-left: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
}

.exp-details li {
    margin-bottom: 0.25rem;
    padding-left: 0;
}

.research-modal-content {
    max-width: 420px;
}

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

.research-list li {
    padding: 0.5rem 0.4rem;
    color: var(--text-primary);
    font-size: 1rem;
    border-bottom: 1px solid var(--border-light);
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.research-list li:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

body.dark-theme .research-list li:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.research-list li:last-child {
    border-bottom: none;
}

/* Print styles */
@media print {
    .sidebar {
        position: relative;
        height: auto;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .wrapper {
        display: block;
    }
    
    .modal {
        display: none !important;
    }
}
