* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Georgia, serif;
    line-height: 1.6;
    color: #202122;
    background: #eeeeee;
    min-height: 100vh;
    position: relative;
    padding-bottom: 40px; /* 为 footer 预留空间 */
}

/* Global rule: make link underlines follow text color */
a {
    text-decoration: underline;
    text-decoration-color: inherit;
}

/* When links contain styled spans, remove link underline and let span handle it */
a span[style*="color"] {
    text-decoration: underline;
    text-decoration-color: currentColor;
}

a:has(span[style*="color"]) {
    text-decoration: none;
}

.sidebar {
    position: absolute;
    top: 0px;
    left: 0;  /* Always visible */
    width: 220px;
    min-height: auto;
    background: #f8f9fa;
    border-right: 1px solid #a2a9b1;
    border-bottom: 1px solid #a2a9b1;
    padding: 20px;
    transition: left 0.6s ease;
    z-index: 99;
}

.sidebar-trigger {
    position: absolute;
    top: 0px;
    left: 0;
    width: 30px;
    min-height: 600px;
    z-index: 98;
}

/* Sidebar is always visible now, no need for hover effects */

.nav-section {
    margin: 8px 0;
}

.nav-section-title {
    display: flex;
    align-items: center;
    cursor: pointer;
    color: #202122;
    padding: 6px 0;
    font-weight: 500;
}

.nav-toggle {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    position: relative;
}

.nav-toggle::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 6px;
    height: 6px;
    border-right: 2px solid #72777d;
    border-bottom: 2px solid #72777d;
    transform: translate(-75%, -50%) rotate(45deg);
    transition: transform 0.2s;
}

.nav-section.collapsed .nav-toggle::before {
    transform: translate(-75%, -75%) rotate(-45deg);
}

.nav-section.collapsed .nav-items {
    display: none;
}

.nav-items {
    margin-left: 24px;
}

.nav-link {
    color: #3366cc;
    text-decoration: none;
    display: block;
    padding: 4px 0;
    font-size: 14px;
}

.nav-link:visited {
    color: #3366cc;
}

.nav-link:hover {
    text-decoration: underline;
}

.header {
    position: sticky;
    top: 0;
    max-width: 1200px;
    margin: 0 auto;
    height: 50px;
    background: #fff;
    border-bottom: 3px double #a2a9b1;
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 100;
    justify-content: space-between;
    box-shadow: -4px 0 6px rgba(0, 0, 0, 0.08), 4px 0 6px rgba(0, 0, 0, 0.08);
}

.header-title {
    font-size: 1.5em;
    font-weight: 500;
    text-decoration: none;
}

.header-title:hover {
    text-decoration: underline;
    text-decoration-thickness: 0.75px;
}

.header-links {
    display: flex;
    gap: 9px;
    align-items: center;
    transform: translateY(5px);
}

.nav-separator {
    color: #a2a9b1;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
}

.header-link {
    color: #000;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.header-link:visited {
    color: #000;
}

.header-link:hover {
    color: #000;
    text-decoration: underline;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 8px 20px 0 20px;
    min-height: calc(100vh - 200px); /* 确保内容区域至少占满屏幕 */
    background: #fff;
    box-shadow: -4px 0 6px rgba(0, 0, 0, 0.08), 4px 0 6px rgba(0, 0, 0, 0.08), 0 4px 6px rgba(0, 0, 0, 0.08);
}

.title {
    text-align: center;
    font-size: 2em;
    margin-bottom: 20px;
    color: #000;
}

.authors {
    text-align: center;
    margin: 20px 0 10px;
    line-height: 1.8;
}

.author-link {
    color: #3366cc;
    text-decoration: none;
}

.author-link:visited {
    color: #3366cc;
}

.author-link:hover {
    text-decoration: underline;
}

.affiliations {
    text-align: center;
    margin: 10px 0;
    color: #666;
}

.links {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.button {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    background: #f8f9fa;
    border: 1px solid #a2a9b1;
    border-radius: 4px;
    color: #202122;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.button:hover {
    background: #f0f0f0;
}

.button i {
    margin-right: 8px;
}

.video-container {
    width: 100%;
    max-width: 100%;
    margin: 20px 0;
    /* 移除了固定的 padding-bottom 和 height: 0 */
}

.video-container video {
    width: 100%;
    height: auto; /* 高度会根据视频比例自动调整 */
    display: block; /* 防止底部可能出现的小空隙 */
}

/* Markdown and HTML section styles */
.markdown-section, .html-section {
    margin: 0 0 40px 0;
    padding-bottom: 10px;
    scroll-margin-top: 70px;
}

/* Special case for teaser section - no margin */
#teaser.html-section {
    margin: 0;
}

/* Teaser section as flex container */
.teaser-section {
    display: flex;
    align-items: stretch;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.markdown-section h1, .html-section h1 {
    font-size: 1.8em;
    margin-bottom: 0.8em;
    padding-bottom: 0.3em;
    border-bottom: 3px solid #a2a9b1;
    color: #000;
    font-family: 'Linux Libertine','Georgia','Times',serif;
    position: relative;
}

.markdown-section h2, .html-section h2 {
    font-size: 1.5em;
    margin: 1em 0;
    padding-bottom: 0.2em;
    border-bottom: 2px solid #c8ccd1;
    color: #162441;
    position: relative;
}

.markdown-section h3, .html-section h3 {
    font-size: 1.2em;
    margin: 0.8em 0;
    color: #162441;
    position: relative;
}

/* 标题锚点链接样式 */
.markdown-section .header-link,
.html-section .header-link {
    position: absolute;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s;
    text-decoration: none;
    color: #666;
    font-weight: normal;
}

.markdown-section h1:hover .header-link,
.markdown-section h2:hover .header-link,
.markdown-section h3:hover .header-link,
.markdown-section h4:hover .header-link,
.markdown-section h5:hover .header-link,
.markdown-section h6:hover .header-link,
.html-section h1:hover .header-link,
.html-section h2:hover .header-link,
.html-section h3:hover .header-link,
.html-section h4:hover .header-link,
.html-section h5:hover .header-link,
.html-section h6:hover .header-link {
    opacity: 1;
}

.markdown-section .header-link:hover,
.html-section .header-link:hover {
    color: #3366cc;
    text-decoration: none;
}

.markdown-section p, .html-section p {
    margin: 1em 0;
    line-height: 1.6;
}

/* Restore the indentation removed by the global reset for Markdown blockquotes. */
.markdown-section blockquote,
.html-section blockquote {
    margin: 1em 0 1em 2em;
}

/* Markdown section links - use standard link blue */
.markdown-section a, .html-section a {
    color: #0000EE;  /* Standard link blue */
    text-decoration-color: currentColor;  /* Underline follows text color */
}

/* Ensure markdown links don't change color when visited */
.markdown-section a:visited, .html-section a:visited {
    color: #0000EE;  /* Keep same blue after visit */
}

/* For links with colored spans inside, ensure underline matches text color */
.markdown-section a span, .html-section a span {
    text-decoration-color: inherit;
}

.markdown-section pre, .html-section pre {
    margin: 1em 0;
    padding: 16px;
    background: #f6f8fa;
    border-radius: 4px;
    overflow-x: auto;
    font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
}

.markdown-section code, .html-section code {
    font-family: SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace;
    font-size: 0.9em;
    padding: 0.2em 0.4em;
    background: #f6f8fa;
    border-radius: 3px;
}

.markdown-section img, .html-section img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1em auto;
}

.markdown-section img.inline-logo, .html-section img.inline-logo {
    height: 1.1em;
    width: auto;
    max-width: unset;
    vertical-align: middle;
    display: inline;
    margin: 0 2px 0 0;
}

/* Demo section specific styles */
.demo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0px;
    margin: 0px 0;
}

.demo-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s;
}

.demo-item:hover {
    transform: translateY(-5px);
}

.demo-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.demo-content {
    padding: 15px;
}

.demo-title {
    font-size: 1.2em;
    margin-bottom: 10px;
    color: #162441;
}

.demo-description {
    font-size: 0.9em;
    color: #666;
}

.lock-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    font-size: 16px;
    padding: 5px;
    z-index: 100;
}

footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 0px;
    margin-top: 0px;
    border-top: 1px solid #a2a9b1;
    font-size: 14px;
    color: #666;
    background: #f6f6f6;
}

footer a {
    color: #3366cc;
    text-decoration: none;
}

footer a:visited {
    color: #3366cc;
}

footer a:hover {
    text-decoration: underline;
}

/* Unordered lists style */
.markdown-section ul, .html-section ul {
    padding-left: 40px; /* Consistent with main content padding */
    margin: 1em 0;      /* Same margin as paragraphs */
}

/* Ordered lists style */
.markdown-section ol, .html-section ol {
    padding-left: 40px; /* Consistent with main content padding */
    margin: 1em 0;      /* Same margin as paragraphs */
}

.icon-links a, .icon-links a:visited, .icon-links a:hover {
    color: inherit;
}

.icon-links .footnote,
.icon-links fn {
    font-size: 0.75rem;
    vertical-align: 1.5rem;
}

.icon-sep {
    display: inline-block;
    border-left: 1.5px solid currentColor;
    height: 1em;
    vertical-align: -0.15em;
    margin: 0 0.3em;
    opacity: 0.4;
}

/* Old-style footnote: data-note attribute (not translatable) */
.footnote {
    color: #3366cc;
    position: relative;
    cursor: help;
    font-size: 0.75em;
}
.footnote:hover::after {
    content: attr(data-note);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 10px;
    border-radius: 4px;
    white-space: normal;
    max-width: 300px;
    min-width: 200px;
    font-size: 0.9em;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 1000;
    word-wrap: break-word;
}
.footnote:hover::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #333;
    z-index: 1001;
}

/* New-style footnote: <fn> element (DOM text, translatable) */
fn {
    color: #3366cc;
    position: relative;
    display: inline-block;
    cursor: help;
    font-size: 0.75em;
    vertical-align: baseline;
    line-height: 0;
}
fn::after {
    content: 'o';
    display: inline-block;
    line-height: 1;
    transform: translateY(-0.45em);
}
.icon-links fn::after {
    transform: none;
}
fn .fn-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}
fn:hover .fn-text {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: #333;
    color: white;
    padding: 8px 10px;
    border-radius: 4px;
    max-width: 300px;
    min-width: 200px;
    font-size: 0.9em;
    line-height: 1.4;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    z-index: 1000;
    word-wrap: break-word;
}
fn:hover::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #333;
    z-index: 1001;
}

/* Text Wall Logo Styles */
.text-wall-logo {
    width: 100%;
    max-width: 1100px;  /* Adjusted for wider container */
    margin: 0 auto;  /* Remove top and bottom margin */
    padding: 0;
}

.text-wall-container {
    position: relative;
    height: 175px;
    background: #ffffff;  /* Pure white background */
    border-radius: 8px;  /* 12px * 0.7 */
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Text Wall Background */
.text-wall-background {
    position: absolute;
    width: 100%;
    height: 100%;
    padding: 0 14px 14px 14px;  /* Remove top padding */
    font-family: 'Lucida Calligraphy', 'Lucida Handwriting', 'Apple Chancery', 'URW Chancery L', 'Monotype Corsiva', 'Georgia', cursive;
    font-size: 0.62em;
    line-height: 1.6;
    color: #333333;  /* Dark gray/black text */
    opacity: 0.4;
    text-align: justify;
    overflow: hidden;
    font-weight: 500;  /* Slightly bolder for readability */
}

/* Name Outline - creates semi-transparent gray text */
.name-outline {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
}

.name-outline span {
    font-family: 'Playfair Display', 'Didot', 'Georgia', serif;
    font-size: 4.34em;  /* 6.2em * 0.7 */
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #333333;  /* Same gray as background text */
    opacity: 0.15;  /* 30% opacity */
    white-space: nowrap;
    display: inline-block;
    user-select: none;
    pointer-events: none;
}


/* Responsive Design */
@media (max-width: 768px) {
    .text-wall-logo {
        margin: 21px auto;  /* 30px * 0.7 */
        padding: 0;
    }
    
    .text-wall-container {
        min-height: 122px;  /* 175px * 0.7 */
    }
    
    .name-outline span {
        font-size: 3.5em;  /* 5em * 0.7 */
        letter-spacing: 0.06em;
    }
    
    .text-wall-background {
        font-size: 0.56em;  /* 0.8em * 0.7 */
        padding: 10px;  /* Scale padding too */
    }
}

@media (max-width: 480px) {
    .name-outline span {
        font-size: 2.52em;  /* 3.6em * 0.7 */
        letter-spacing: 0.05em;
    }
    
    .text-wall-background {
        font-size: 0.49em;  /* 0.7em * 0.7 */
    }
}

/* Teaser section photo container */
.teaser-section .photo-container {
    flex-shrink: 0;
    width: fit-content;  /* Container width fits the image */
    height: fit-content; /* Container height fits the image */
    line-height: 0;  /* Remove line-height spacing */
    font-size: 0;  /* Remove any font-size related spacing */
}

.teaser-section .photo-container img {
    height: 175px;
    width: auto;
    display: block;
    border-radius: 8px;
    margin: 0;  /* Remove any default margins */
    padding: 0;  /* Remove any default padding */
}

/* Teaser section text wall container */
.teaser-section .text-wall-container {
    flex: 1;
    height: 175px;
    position: relative;
}

.text-wall-banner {
    position: absolute;
    inset: 0;
    z-index: 12;
    overflow: hidden;
    border-radius: 8px;
    background: #ffffff;
}

/* Triangle link - hidden by default, shown on hover */
.text-wall-triangle {
    position: absolute;
    bottom: 5px;
    right: 10px;
    font-size: 0.62em;  /* Same size as background text */
    color: #333333;
    opacity: 0;  /* Hidden by default */
    text-decoration: none;
    z-index: 10;  /* Above other elements */
    transition: opacity 0.3s ease;
}

.text-wall-close {
    position: absolute;
    right: 29px;
    bottom: 0;
    z-index: 10;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #333333;
    font: 22px/24px Georgia, serif;
    opacity: 0;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.2s ease;
}

/* Show triangle when hovering over text wall container */
.text-wall-container:hover .text-wall-triangle,
.text-wall-container:hover .text-wall-close {
    opacity: 0.4;  /* Same opacity as background text */
}

/* Make triangle slightly more visible when hovering over it directly */
.text-wall-triangle:hover,
.text-wall-close:hover,
.text-wall-close:focus-visible {
    opacity: 0.6 !important;
}

.text-wall-close:hover {
    transform: scale(1.08);
}

.teaser-intro {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    overflow: hidden;
    background: #ffffff;
}

.teaser-intro p {
    margin: 0;
}

.text-wall-container.is-intro .text-wall-banner {
    display: none;
}

@media (max-width: 480px) {
    .teaser-section {
        flex-direction: column;
        gap: 12px;
    }

    .teaser-section .photo-container img {
        height: 175px;
    }

    .teaser-section .text-wall-container {
        flex: none;
        width: 100%;
        height: 240px;
    }
}

/* Tabs Component Styles */
.tabs {
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #c8ccd1;
    width: 90%;
}

.tab {
    cursor: pointer;
    margin-right: 10px;
    padding: 2px 8px;
    border: 1px solid #c8ccd1;
    border-bottom: 1px solid #c8ccd1;
    border-radius: 4px 4px 0 0;
    position: relative;
    top: 1px;
    display: inline-block;
}

.tab.active {
    border-color: #a2a9b1;
    border-bottom-color: #fff;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.03) 0%, rgba(0, 0, 0, 0.01) 50%, rgba(0, 0, 0, 0.06) 100%);
}


.tab-content {
    visibility: hidden;
    height: 0;
    overflow: hidden;
    background: #FFFFFF;
    margin-top: 5px;
}

.tab-content.active {
    visibility: visible;
    height: auto;
    overflow: visible;
    display: block;
}

/* imgtable: used in biography for edu/experience rows */
table.imgtable,
table.imgtable td {
    border: none;
    text-align: left;
    vertical-align: middle;
    background: transparent;
}

table.imgtable p b,
table.imgtable p a {
    display: inline-block;
    white-space: nowrap;
}

.exp-tab-content .experience-entry-title {
    box-sizing: border-box;
    display: block;
    margin: 0 0 3px -8px;
    padding: 1px 12px 2px 8px;
    border-left: 3px solid #71849a;
    border-radius: 2px;
    background: linear-gradient(
        90deg,
        rgba(113, 132, 154, 0.17) 0%,
        rgba(142, 158, 176, 0.08) 58%,
        rgba(160, 174, 190, 0) 100%
    );
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
    transition: background 180ms ease, border-color 180ms ease;
}

.exp-tab-content .experience-entry-title:hover {
    border-left-color: #536b84;
    background: linear-gradient(
        90deg,
        rgba(96, 121, 148, 0.22) 0%,
        rgba(132, 151, 171, 0.1) 58%,
        rgba(160, 174, 190, 0) 100%
    );
}

table.imgtable td:first-child {
    width: 110px;
    min-width: 110px;
    height: 110px;
    text-align: center;
    vertical-align: middle;
    padding-right: 20px;
}

table.imgtable img {
    display: block;
    margin: auto;
    height: 100px;
    width: auto;
    max-width: 100px;
}

/* Multi-column tab layout: add cols-2, cols-3, etc. to tab-content */
.tab-content.cols-2 {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    align-items: start;
}

.tab-content.cols-2.active {
    display: grid;
}

.tab-content.cols-3 {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    align-items: start;
}

.tab-content.cols-3.active {
    display: grid;
}

.tab-content.cols-2 > br,
.tab-content.cols-3 > br {
    display: none;
}

/* News specific - with max height */
.tab-content.news {
    max-height: 300px;
    overflow: auto;
}

.venue-accent {
    /* Legacy venue red: rgb(204, 0, 0); */
    color: red;
}

/* Browser translators often wrap partial text in nested elements. Keep the accent color stable. */
.venue-accent,
.venue-accent *,
.venue-accent font {
    color: red !important;
}

.special-accent,
.special-accent *,
.special-accent font {
    color: red !important;
    text-decoration: none !important;
}

.special-accent {
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.translation-line {
    display: block;
    margin: 0;
    padding: 0;
}

a.venue-accent {
    text-decoration-color: currentColor;
}

a.venue-accent:not([href]) {
    text-decoration: none;
}

a.venue-accent:not([href]) *,
a.venue-accent:not([href]) font {
    text-decoration: none !important;
}

.markdown-section a.venue-accent,
.markdown-section a.venue-accent:visited,
.markdown-section a.venue-accent:hover,
.html-section a.venue-accent,
.html-section a.venue-accent:visited,
.html-section a.venue-accent:hover {
    color: red;
    text-decoration-color: currentColor;
}

#back-to-top {
    position: fixed;
    bottom: 18%;
    right: 28px;
    background: none;
    border: none;
    color: #202122;
    opacity: 0.3;
    font-size: 18px;
    font-family: Georgia, serif;
    cursor: pointer;
    padding: 4px 2px;
    transition: opacity 0.2s;
    z-index: 200;
    writing-mode: horizontal-tb;
}

#back-to-top:hover {
    opacity: 0.7;
}
