
/* ===== 基础重置和通用样式 ===== */
* {
    box-sizing: border-box;
}

html {
    font-family: sans-serif;
    -ms-text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font: normal 16px/1.6 'Source Serif Pro', 'PT Serif', "Helvetica Neue", "Helvetica", Arial, sans-serif;
    width: 100%;
    height: 100%;
    background: #fdfdfd;
    color: #222;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== 基础元素样式 ===== */
a {
    color: #003057;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover, a:focus, a:active {
    text-decoration: none;
    color: #000;
}

h1, h2, h3, h5, h6 {
    font-family: 'Roboto Condensed', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

h1 { font-size: 2em; margin-bottom: 10px; }
h2 { font-size: 1.6em; margin-top: 20px; margin-bottom: 25px; font-weight: 600; color: #B3A369; }
h3 { font-size: 1.2em; }

img {
    border: 0;
    max-width: 100%;
    height: auto;
}

/* ===== 布局容器 ===== */
.content-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 40px;
}

main {
    padding-top: 3em;
}

/* ===== 响应式布局 ===== */
@media screen and (max-width: 1024px) {
    .content-wrapper {
        padding: 0 20px;
    }
}

@media screen and (max-width: 768px) {
    .content-wrapper {
        padding: 0 15px;
    }
}

@media screen and (max-width: 480px) {
    .content-wrapper {
        padding: 0 15px;
    }
}

/* ===== Profile 区域样式 ===== */
.profile-container {
    display: flex;
    align-items: flex-start;
    gap: 60px;
    margin: 0;
}

.profile-left {
    flex: 0 0 280px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: sticky;
    top: 20px;
    height: fit-content;
}

.profile-right {
    flex: 1;
}

/* ===== 头像样式 ===== */
.profile-image {
    margin-top: 10px;
    margin-bottom: 20px;
    width: 100%;
}

.avatar {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.avatar:hover {
    transform: scale(1.02);
}

/* ===== 名字和标题样式 ===== */
.name-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
    text-align: center;
}

.name {
    font-size: 2.2em;
    font-weight: 600;
    margin-top: 5px;
    margin-bottom: 10px;
    white-space: nowrap;
    letter-spacing: -0.03em;
}

.title-affiliation {
    padding-top: 0;
    margin-top: 20px;
    text-align: center;
}

.title-affiliation p {
    margin: 0;
    line-height: 1.6;
    font-size: 1.1em;
    font-weight: 500;
    color: #555;
}

/* ===== 社交链接样式 ===== */
.social-links {
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
}

.social-icons {
    font-size: 1.41rem;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
}

.social-icons:hover {
    color: #4a4a4a;
    transform: translateY(-1px);
}

/* ===== 介绍文字样式 ===== */
.introduction {
    line-height: 1.7;
    margin-bottom: 30px;
    width: 100%;
    font-size: 1.05em;
}

.introduction p {
    margin-bottom: 1.2em;
}

/* ===== 高亮框样式 ===== */
.publication-highlight {
    background-color: #ddeefe; /* #e5e2b9; #fff8dc; */
    padding: 15px;
    margin-bottom: 1em;
}

/* ===== 章节样式 ===== */
.section {
    margin-top: -10px;
    margin-bottom: 15px;
}

.section-divider {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
    margin-top: 0px;
    margin-bottom: 10px;
}

/* ===== 新闻容器样式 ===== */
/* 确保News容器不会创建新的堆叠上下文 */
#news-container {
    position: static;
    z-index: auto;
}

#news-container ul {
    list-style-type: none;
    padding-left: 10px;
    line-height: 1.4;
    position: static;
    z-index: auto;
}

#news-container li {
    margin-bottom: 2px;
    position: relative;
    z-index: auto; /* 确保不会创建新的堆叠上下文 */
}

#news-container li:before {
    content: "•";
    position: absolute;
    left: -15px;
    z-index: auto;
}


/* ===== 筛选器链接样式 ===== */
#year-filter-container a {
    transition: color 0.2s ease;
}

#year-filter-container a:hover {
    color: #B3A369 !important;
    text-decoration: none;
}

/* 暗色模式下的筛选器链接 */
body[data-theme="dark"] #year-filter-container a {
    color: #ccc;
}

body[data-theme="dark"] #year-filter-container a:hover {
    color: #B3A369 !important;
}

body[data-theme="dark"] #year-filter-container a[style*="color: #B3A369"] {
    color: #B3A369 !important;
}

/* ===== 显示更多按钮样式 ===== */
.show-more-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 5px 10px;
    font-size: 0.9em;
    margin-top: -1em;
    display: block;
}

.show-more-btn:hover {
    text-decoration: underline;
}

/* ===== 主题切换按钮样式 ===== */
.theme-switch-wrapper {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 999;
}

.theme-switch {
    width: 40px;
    height: 40px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.theme-switch:hover {
    transform: scale(1.1);
}

/* ===== 暗色模式样式 ===== */
body[data-theme="dark"] {
    background-color: #252525;
    color: #ffffff;
}

/* 暗色模式下的链接颜色 */
body[data-theme="dark"] a {
    color: #ddeefe;
}

body[data-theme="dark"] a:hover {
    color: #c091a8; /* #B3A369; /* 悬停时仍使用金色 */
}

/* 暗色模式下的按钮样式 */
body[data-theme="dark"] .theme-switch {
    background-color: #333;
    border-color: #444;
    color: #ffffff;
}

/* 暗色模式下的其他文字 */
body[data-theme="dark"] p,
body[data-theme="dark"] h3,
body[data-theme="dark"] h4,
body[data-theme="dark"] h5,
body[data-theme="dark"] h6,
body[data-theme="dark"] span,
body[data-theme="dark"] li {
    color: #ffffff;
}

body[data-theme="dark"] h1,
body[data-theme="dark"] h2{
    color: #B3A369;
}

/* 暗色模式下的图标颜色 */
body[data-theme="dark"] .social-icons {
    color: #ffffff;
}

/* 暗色模式下的高亮框 */
body[data-theme="dark"] .publication-highlight {
    background-color: #003057;
}

body[data-theme="dark"] .publication-highlight p {
    color: #ffffff;
}

/* 暗色模式下的年份筛选器 */
body[data-theme="dark"] #year-filter {
    background-color: #333;
    color: #ffffff;
    border-color: #555;
}

/* 暗色模式下的显示更多按钮 */
body[data-theme="dark"] .show-more-btn {
    color: #ccc;
}

/* 暗色模式下的分隔线 */
body[data-theme="dark"] .section-divider {
    background-image: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0));
}

/* 暗色模式下的页脚 */
body[data-theme="dark"] .blog-footer {
    border-image: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0)) 1;
}

/* ===== 名字发音提示样式 ===== */
.name-info {
    position: relative;
    margin-left: 8px;
    cursor: help;
}

.name-info i {
    font-size: 0.5em;
    color: #666;
    vertical-align: super;
}

.tooltip {
    visibility: hidden;
    position: absolute !important;
    left: 100% !important;
    top: 100% !important;
    transform: translate(0%) !important;
    background-color: white !important;
    color: #333 !important;
    padding: 20px !important;
    border-radius: 8px !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2) !important;
    width: 320px !important;
    font-size: 14px !important;
    line-height: 1.6 !important;
    z-index: 999999 !important; /* 使用最大可能的z-index值 */
    margin: 0 !important;
    white-space: normal !important;
    border: 2px solid #e0e0e0 !important;
    font-family: 'Source Serif Pro', 'PT Serif', 'Noto Serif', Georgia, serif !important;
    font-family: inherit !important;
    max-width: 90vw !important;
    max-height: 80vh !important;
    overflow-y: auto !important;
    letter-spacing: 0.02em !important;
}

.tooltip strong {
    color: #1a73e8 !important;
    font-weight: 600 !important;
}

.name-info:hover .tooltip {
    visibility: visible !important;
}

#news-container,
#news-container ul,
#news-container li,
#news-container li:before,
.profile-right,
.introduction,
.section {
    position: static !important;
    z-index: auto !important;
    overflow: visible !important;
}

/* 添加一个遮罩层来确保tooltip在最上层 */
.tooltip::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.1);
    z-index: -1;
    pointer-events: none;
}

/* ===== 邮箱提示样式 ===== */
.email-info {
    position: relative;
    cursor: pointer;
}

.email-tooltip {
    visibility: hidden;
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(0%);
    background-color: white;
    border-radius: 6px;
    padding: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    width: max-content;
    max-width: 300px;
}

.email-info:hover .email-tooltip {
    visibility: visible;
    opacity: 1;
}

.email-image {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 暗色模式下的提示框 */
body[data-theme="dark"] .tooltip {
    background-color: #333 !important;
    color: #fff !important;
    border-color: #555 !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5) !important;
}

body[data-theme="dark"] .name-info i {
    color: #999;
}

body[data-theme="dark"] .tooltip strong {
    color: #77b6ff !important;
}

body[data-theme="dark"] .email-tooltip {
    background-color: #333;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

/* ===== Services 列表样式 ===== */
.services-list {
    margin-top: 10px;
    margin-bottom: 0;
}

.service-category {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
    line-height: 1.4;
    margin-left: 10px;
}

/* 最后一个service-category不需要底部间距 */
.service-category:last-child {
    margin-bottom: 0;
}

.service-type {
    font-weight: 600;
    color: #333;
    min-width: 80px;
    flex-shrink: 0;
}

.service-details {
    color: #555;
    margin-left: 10px;
}

/* 暗色模式适配 */
body[data-theme="dark"] .service-type {
    color: #e2e8f0;
}

body[data-theme="dark"] .service-details {
    color: #a0aec0;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .service-category {
        flex-direction: column;
        align-items: flex-start;
        margin-bottom: 15px;
    }
    
    .service-type {
        margin-bottom: 5px;
    }
    
    .service-details {
        margin-left: 0;
    }
}

/* ===== 页脚样式 ===== */
.blog-footer {
    height: 4em;
    margin: 4em auto 0;
    font-size: 70%;
    border-top: 1px solid;
    border-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0)) 1;
    text-align: center;
    line-height: 1.5em;
}

.footer-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.footer-left {
    flex: 1;
    text-align: left;
    line-height: 1.8;
    margin-top: -10px;
}

.footer-right {
    flex: 0 0 auto;
    min-width: 200px;
}

/* ===== 出版物布局样式 ===== */
.item {
    display: table;
    width: 100%;
    margin-bottom: 15px;
}

.item_inline {
    display: table-cell;
    vertical-align: middle;
}

.item p {
    margin: 5px 0;
}

/* 为所有文章的文字部分添加 padding */
.item_inline:not(.item_image) {
    padding: 15px;
}

/* 确保高亮文章不会有双重 padding */
.publication-highlight.item_inline:not(.item_image) {
    padding: 15px;
}

/* 移动端隐藏图片 */
@media screen and (max-width: 920px) {
    .item_image {
        display: none;
    }
}

/* ===== 摘要容器样式 ===== */
.abstract-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.abstract-container.expanded {
    max-height: 500px;
}

.abstract-container p {
    color: #666;
}

/* 暗色模式下的摘要文字 */
body[data-theme="dark"] .abstract-container p {
    color: #aaa;
}

/* ===== 移动端适配 ===== */
@media (max-width: 768px) {
    .content-wrapper {
        margin: 0 20px; 
        padding: 20px 15px;
    }

    .profile-container {
        flex-direction: column;
        align-items: center;
        margin-top: 20px;
        gap: 30px;
    }
    
    .profile-left {
        position: static;
        flex: 0 0 auto;
        width: 100%;
        margin-bottom: 20px;
    }

    .name-title {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .name {
        font-size: 2em;
        margin-top: 0px;
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .title-affiliation {
        text-align: center;
    }

    .introduction {
        font-size: 1em;
        line-height: 1.6;
    }

    .footer-container {
        flex-direction: column;
        align-items: center;
    }
    
    .footer-left {
        text-align: center;
        margin-bottom: 20px;
        margin-top: 10px;
        order: 2;
    }
    
    .footer-right {
        order: 1;
        margin-bottom: 0px;
        margin-top: 20px;
    }

    /* 移动端提示框调整 */
    /* 移动端tooltip调整 */
    .name-info .tooltip {
        position: fixed !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        width: 280px !important; /* 减小宽度 */
        max-width: 85vw !important;
        max-height: 70vh !important;
        padding: 16px !important; /* 减小内边距 */
        font-size: 13px !important; /* 减小字体 */
        line-height: 1.5 !important; /* 减小行高 */
        margin: 0 !important;
        border-radius: 6px !important;
        box-shadow: 0 4px 20px rgba(0,0,0,0.25) !important;
    }

    /* 移动端tooltip标题调整 */
    .tooltip h3 {
        font-size: 15px !important;
        margin: 0 0 12px 0 !important;
    }

    /* 移动端tooltip段落调整 */
    .tooltip p {
        font-size: 13px !important;
        line-height: 1.5 !important;
        margin: 0 0 12px 0 !important;
    }

    /* 移动端tooltip列表调整 */
    .tooltip ul {
        font-size: 13px !important;
        line-height: 1.5 !important;
        margin: 10px 0 12px 0 !important;
        padding-left: 20px !important;
    }

    .tooltip li {
        font-size: 13px !important;
        line-height: 1.5 !important;
        margin-bottom: 6px !important;
    }

    /* 移动端email tooltip调整 */
    .email-info .email-tooltip {
        position: fixed !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        bottom: auto !important;
        left: 50% !important;
        max-width: 80vw !important; /* 限制最大宽度 */
        max-height: 60vh !important; /* 限制最大高度 */
        padding: 15px !important;
        border-radius: 8px !important;
        box-shadow: 0 6px 24px rgba(0,0,0,0.3) !important;
        z-index: 999999 !important;
    }

    /* 移动端email tooltip图片调整 - 限制尺寸 */
    .email-info .email-tooltip .email-image {
        max-width: 75vw !important; /* 限制图片最大宽度 */
        max-height: 50vh !important; /* 限制图片最大高度 */
        width: auto !important;
        height: auto !important;
        display: block !important;
        object-fit: contain !important;
        opacity: 1 !important;
    }

    /* 移动端遮罩层调整 */
    .tooltip::before {
        display: none !important;
    }
}

/* 超小屏幕的额外调整 */
@media (max-width: 480px) {
    .tooltip {
        width: 260px !important;
        max-width: 90vw !important;
        padding: 14px !important;
        font-size: 12px !important;
    }

    .tooltip h3 {
        font-size: 14px !important;
        margin: 0 0 10px 0 !important;
    }

    .tooltip p,
    .tooltip ul,
    .tooltip li {
        font-size: 12px !important;
        line-height: 1.4 !important;
    }

    /* 超小屏幕email tooltip调整 */
    .email-info .email-tooltip {
        max-width: 85vw !important;
        max-height: 70vh !important;
        padding: 12px !important;
    }

    .email-info .email-tooltip .email-image {
        max-width: 80vw !important;
        max-height: 60vh !important;
    }
}

/* ===== 悬停效果 ===== */
.hover-gold:hover {
    color: #B3A369; 
}

.hover-red:hover {
    color: #c8161e; 
}

/* ===== 出版物头部样式 ===== */
.publications-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.publications-header h2 {
    margin: 0;
    font-size: 1.5em;
}