@font-face {  
  font-family: 'title-font';  
  src: url('/fonts/GenWanMin2TW-SB.woff2') format('woff2');  
  font-weight: normal;  
  font-style: normal;  
  /*unicode-range: U+4E00-9FFF;  /* 只包含 CJK 中文范围 */
}
@font-face {
    font-family: 'main';
    src: url('/fonts/DreamHanSerifCN-W4.woff2') format('woff2');
    font-weight: normal;  
    font-style: normal;  
    
}

html {
    font-family: main, "PingFang SC", "Noto Serif SC", "Microsoft YaHei";  ;
}

/* 中文标题样式（作用于 h1-h6） */
h1:lang(zh), h2:lang(zh), h3:lang(zh), h4:lang(zh), h5:lang(zh), h6:lang(zh) {  
  font-family: title-font-en, title-font, "PingFang SC", "Noto Serif SC", "Microsoft YaHei";  
}

body {
    background-color: rgb(242, 242, 241);
    background-image:
        linear-gradient(0deg, rgba(0, 0, 0, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.04) 1px, transparent 1px);
    background-size: 8px 8px;
}

.dark body {
    background-color: rgba(68, 91, 149);
    background-image:
        linear-gradient(0deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 8px 8px;
}

.homepage-container html, .homepage-container body {
    margin: 0;
    padding: 0;
    height: 100%;
}

/* 顶部右上角语言切换 */
.language-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 100px;
    z-index: 50;
    color: #445b95;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* 整个页面布局容器 */
.homepage-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* 左侧图片区域 */
.image-section {
    width: 100%;
    height: 100%;
}

.background-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 右侧文字区域 */
.text-section {
    width: 66.66%;
    padding: 4rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* 文本内容区域 */
.text-content {
    margin-top: 16rem;
}

/* 标题与文本样式 */
.homepage-title {
    color: rgba(68, 91, 149);
    font-size: 2rem;
    line-height: 1.25;
    font-weight: 600;
    margin-bottom: 1rem;
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
}

.dark .homepage-title {
    color: rgb(242, 242, 241);
    font-size: 2rem;
    line-height: 1.25;
    font-weight: 600;
    margin-bottom: 1rem;
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 1024px) {
    .homepage-title {
        font-size: 2.5rem; /* Tailwind: lg:text-5xl */
        margin-left: 0;
        margin-right: 0;
    }
}

.homepage-subtitle {
    font-size: 1rem;
    color: #445b95;
    margin-bottom: 1rem;
}

.homepage-description {
    font-size: 1.125rem; /* Tailwind: text-lg */
    color: #445b95; /* Tailwind: text-gray-700 */
    line-height: 1.75;
    max-width: 28rem;
    margin: 1.5rem auto 2rem auto;
    white-space: nowrap;
}

@media (min-width: 1024px) {
    .homepage-description {
        margin-left: 0;
        margin-right: 0;
    }
}

.homepage-action-link {
    margin-top: 5rem;
}

/* 进入按钮的样式 */
.link-hover-effect {
    color: rgba(68, 91, 149);
    text-decoration: none;
    transition: all 0.1s ease-in-out;
    padding: 0.1rem 0.3rem;
    border-bottom: 2px solid rgba(68, 91, 149, 0.7);
    margin-top: 24px;
}

.dark .link-hover-effect {
    color: rgb(242, 242, 241);
    text-decoration: none;
    transition: all 0.1s ease-in-out;
    padding: 0.1rem 0.3rem;
    border-bottom: 2px solid rgba(242, 242, 241, 0.7);
    margin-top: 24px;
}

/* 鼠标移动到进入按钮上显示的样式 */
.link-hover-effect:hover {
    background-color: rgba(46, 64, 91, 0.94);
    color: rgb(243, 244, 246);
}

.dark .link-hover-effect:hover {
    background-color: rgb(243, 244, 246);
    color: rgba(46, 64, 91, 0.94);
}

/* 底部版权等信息 */
.footer-info {
    display: flex;
    flex-direction: column;
}

.footer-text {
    font-size: 0.875rem;
    color: rgb(29, 40, 65); /* Tailwind: text-neutral-500 */
}

.footer-attribution {
    font-size: 0.75rem;
}

/* 仅移动端覆盖，不影响桌面布局 */
@media (max-width: 768px) {
    /* 容器：单列、合理留白 */
    .homepage-container {
        display: grid; /* 若原本不是 grid 也无妨 */
        grid-template-columns: 1fr; /* 强制单列 */
        gap: 16px;
        min-height: 100dvh;
    }

    /* 大图：占满宽度、限制最高，避免只露窄条 */
    .image-section {
        overflow: hidden;
        max-height: 42vh; /* 你可调成 36~50vh */
        /* 如需“文字先出现”，可加：order: 1;（或把 .text-section 设为 order: -1）*/
    }
    .image-section img {
        width: 100%;
        height: 100%;
        object-fit: cover; /* 铺满裁切，观感更好 */
        display: block;
    }

    /* 文案区：缩小字号，提升可读性 */
    .text-section {
        padding: 0 16px 16px;
    }
    .text-content {
        max-width: 640px;
        margin: 0 auto;
    }
    .homepage-title {
        font-size: 30px;
        line-height: 1.2;
        margin: 8px 0 10px 16px;
    }
    .homepage-subtitle {
        font-size: 17px;
        margin: 0 0 10px 16px;
    }
    .homepage-description {
        font-size: 15px;
        line-height: 1.75;
        margin: 0 0 16px 16px;
    }

    /* CTA：可换行、不溢出、触控友好 */
    .homepage-action-link a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        max-width: 100%;
        word-break: break-word;
        margin: 0 0 16px 16px;
    }

    /* 版权与语言按钮：不遮挡内容 */
    .footer-info {
        width: max-content;
        font-size: 13px;
        line-height: 1.7;
        padding: 0 16px 16px;
        margin-top: 12px;
    }
    .language-toggle {
        right: 12px;
        bottom: 56px;
    }
    body {
        padding-bottom: 70px; /* 预留空间，避免浮动按钮遮挡 */
    }
}

/* 让文章内容中的链接使用actionlink样式 */
.prose a:not(.not-prose) {
    color: rgba(68, 91, 149);
    text-decoration: none;
    transition: all 0.1s ease-in-out;
    padding: 0.1rem 0.3rem;
    border-bottom: 2px solid rgba(68, 91, 149, 0.7);
    font-weight: 500;
}

.dark .prose a:not(.not-prose) {
    color: rgb(242, 242, 241);
    border-bottom: 2px solid rgba(242, 242, 241, 0.7);
}

/* 鼠标悬停效果 */
.prose a:not(.not-prose):hover {
    background-color: rgba(46, 64, 91, 0.94);
    color: rgb(243, 244, 246);
}

.dark .prose a:not(.not-prose):hover {
    background-color: rgb(243, 244, 246);
    color: rgba(46, 64, 91, 0.94);
}

/* 标签和分类链接样式 - 交换默认和悬停样式，修复抖动问题 */
.flex.flex-row.flex-wrap.items-center a[href*="/tags/"],
.flex.flex-row.flex-wrap.items-center a[href*="/categories/"] {
    background-color: rgba(46, 64, 91, 0.94);
    color: rgb(243, 244, 246);
    text-decoration: none;
    transition: all 0.1s ease-in-out;
    padding: 0.1rem 0.3rem;
    border-bottom: 2px solid rgba(46, 64, 91, 0.94); /* 添加下划线保持高度 */
    font-weight: 500;
    margin-top: 0.5rem;
    margin-right: 0.5rem;
}

/* 暗色模式 */
.dark .flex.flex-row.flex-wrap.items-center a[href*="/tags/"],
.dark .flex.flex-row.flex-wrap.items-center a[href*="/categories/"] {
    background-color: rgb(243, 244, 246);
    color: rgba(46, 64, 91, 0.94);
    border-bottom: 2px solid rgb(243, 244, 246); /* 添加下划线保持高度 */
}

/* 鼠标悬停效果 */
.flex.flex-row.flex-wrap.items-center a[href*="/tags/"]:hover,
.flex.flex-row.flex-wrap.items-center a[href*="/categories/"]:hover {
    color: rgba(68, 91, 149);
    border-bottom: 2px solid rgba(68, 91, 149, 0.7);
    background-color: transparent;
}

.dark .flex.flex-row.flex-wrap.items-center a[href*="/tags/"]:hover,
.dark .flex.flex-row.flex-wrap.items-center a[href*="/categories/"]:hover {
    color: rgb(242, 242, 241);
    border-bottom: 2px solid rgba(242, 242, 241, 0.7);
    background-color: transparent;
}

/* 移除 badge 内部的 span 样式 */
.flex.flex-row.flex-wrap.items-center a[href*="/tags/"] span,
.flex.flex-row.flex-wrap.items-center a[href*="/categories/"] span {
    border: none;
    padding: 0;
    margin: 0;
    color: inherit;
    background: transparent;
}

/* ===== Resume Styles ===== */

/* Resume Container */
.resume-container {
    max-width: 210mm;
    margin: 0 auto;
    padding: 2rem;
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    min-height: 297mm;
}

.dark .resume-container {
    background: #1e293b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.resume-content {
    width: 100%;
}

/* Resume Header */
.resume-header {
    border-bottom: 3px solid #445b95;
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.dark .resume-header {
    border-bottom-color: rgb(242, 242, 241);
}

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
}

.header-text {
    flex: 1;
}

.resume-name {
    font-size: 2.5rem;
    font-weight: 700;
    color: #445b95;
    margin: 0 0 0.5rem 0;
    line-height: 1.2;
}

.dark .resume-name {
    color: rgb(242, 242, 241);
}

.resume-subtitle {
    font-size: 1.25rem;
    color: #666;
    margin: 0 0 1rem 0;
}

.dark .resume-subtitle {
    color: #94a3b8;
}

/* Contact Info */
.contact-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: #444;
}

.dark .contact-info {
    color: #cbd5e1;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.contact-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

/* Social Links */
.social-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.9rem;
}

.social-link {
    color: #445b95;
    text-decoration: none;
    border-bottom: 1px solid #445b95;
    transition: all 0.2s;
}

.dark .social-link {
    color: rgb(242, 242, 241);
    border-bottom-color: rgb(242, 242, 241);
}

.social-link:hover {
    background-color: #445b95;
    color: white;
}

.dark .social-link:hover {
    background-color: rgb(242, 242, 241);
    color: #1e293b;
}

/* Avatar */
.header-avatar {
    flex-shrink: 0;
}

.avatar-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #445b95;
}

.dark .avatar-img {
    border-color: rgb(242, 242, 241);
}

/* Resume Sections */
.resume-section {
    margin-bottom: 2rem;
    page-break-inside: avoid;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #445b95;
    margin: 0 0 1rem 0;
    border-bottom: 2px solid #445b95;
    padding-bottom: 0.5rem;
}

.dark .section-title {
    color: rgb(242, 242, 241);
    border-bottom-color: rgb(242, 242, 241);
}

.section-content {
    color: #333;
}

.dark .section-content {
    color: #e2e8f0;
}

/* Research Interests Section */
.interests-list {
    line-height: 1.6;
    margin: 0;
    font-size: 1rem;
}

/* Publications Section */
.publication-item {
    margin-bottom: 1.25rem;
    page-break-inside: avoid;
}

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

.publication-title {
    font-size: 1rem;
    font-weight: 500;
    color: #222;
    margin: 0 0 0.25rem 0;
    line-height: 1.4;
}

.dark .publication-title {
    color: #f1f5f9;
}

.publication-link {
    color: #445b95;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.dark .publication-link {
    color: rgb(242, 242, 241);
}

.publication-link:hover {
    border-bottom-color: #445b95;
}

.dark .publication-link:hover {
    border-bottom-color: rgb(242, 242, 241);
}

.publication-authors {
    font-size: 0.9rem;
    color: #444;
    margin: 0 0 0.25rem 0;
}

.dark .publication-authors {
    color: #cbd5e1;
}

.publication-venue {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

.dark .publication-venue {
    color: #94a3b8;
}

.publication-note {
    font-style: normal;
    color: #445b95;
    font-weight: 500;
}

.dark .publication-note {
    color: rgb(242, 242, 241);
}

/* Awards Section */
.award-item {
    margin-bottom: 1rem;
    page-break-inside: avoid;
}

.award-item:last-child {
    margin-bottom: 0;
}

.award-title {
    font-size: 1rem;
    font-weight: 600;
    color: #222;
    margin: 0 0 0.25rem 0;
}

.dark .award-title {
    color: #f1f5f9;
}

.award-issuer {
    font-size: 0.9rem;
    color: #445b95;
    margin: 0;
}

.dark .award-issuer {
    color: #94a3b8;
}

/* Advisor Info */
.advisor-info {
    font-size: 0.9rem;
    color: #666;
    margin: 0.25rem 0 0 0;
    font-style: italic;
}

.dark .advisor-info {
    color: #94a3b8;
}

/* Experience & Education Items */
.experience-item,
.education-item,
.project-item {
    margin-bottom: 1.5rem;
    page-break-inside: avoid;
}

.experience-item:last-child,
.education-item:last-child,
.project-item:last-child {
    margin-bottom: 0;
}

.item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.item-title-group {
    flex: 1;
}

.item-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #222;
    margin: 0 0 0.25rem 0;
}

.dark .item-title {
    color: #f1f5f9;
}

.item-company {
    font-size: 1rem;
    color: #445b95;
    margin: 0;
}

.dark .item-company {
    color: #94a3b8;
}

.company-link,
.project-link {
    color: #445b95;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.dark .company-link,
.dark .project-link {
    color: rgb(242, 242, 241);
}

.company-link:hover,
.project-link:hover {
    border-bottom-color: #445b95;
}

.dark .company-link:hover,
.dark .project-link:hover {
    border-bottom-color: rgb(242, 242, 241);
}

.item-date {
    font-size: 0.875rem;
    color: #666;
    white-space: nowrap;
    flex-shrink: 0;
}

.dark .item-date {
    color: #94a3b8;
}

.item-details {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin: 0.5rem 0 0 0;
}

.item-details li {
    margin-bottom: 0.25rem;
    line-height: 1.5;
}

.item-details li:last-child {
    margin-bottom: 0;
}

/* Project Description */
.project-description {
    font-size: 0.9rem;
    color: #666;
    margin: 0.25rem 0 0 0;
    font-style: italic;
}

.dark .project-description {
    color: #94a3b8;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.skill-group {
    margin-bottom: 0.5rem;
}

.skill-group-name {
    font-size: 1rem;
    font-weight: 600;
    color: #222;
    margin: 0 0 0.25rem 0;
}

.dark .skill-group-name {
    color: #f1f5f9;
}

.skill-items {
    font-size: 0.9rem;
    color: #444;
    margin: 0;
    line-height: 1.5;
}

.dark .skill-items {
    color: #cbd5e1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .resume-container {
        padding: 1rem;
        box-shadow: none;
    }
    
    .header-main {
        flex-direction: column-reverse;
        align-items: center;
        text-align: center;
    }
    
    .header-text {
        width: 100%;
    }
    
    .resume-name {
        font-size: 2rem;
    }
    
    .contact-info {
        justify-content: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .item-header {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .item-date {
        align-self: flex-start;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
}

/* Print Styles */
@media print {
    body {
        background: white !important;
        background-image: none !important;
    }
    
    .resume-container {
        max-width: 100%;
        margin: 0;
        padding: 15mm;
        box-shadow: none;
        background: white !important;
    }
    
    .dark .resume-container {
        background: white !important;
    }
    
    .resume-name,
    .section-title,
    .item-title,
    .skill-group-name {
        color: #000 !important;
    }
    
    .resume-subtitle,
    .contact-info,
    .section-content,
    .item-company,
    .item-date,
    .skill-items,
    .project-description {
        color: #333 !important;
    }
    
    .resume-header {
        border-bottom-color: #000 !important;
    }
    
    .section-title {
        border-bottom-color: #000 !important;
    }
    
    .resume-section {
        page-break-inside: avoid;
    }
    
    .experience-item,
    .education-item,
    .project-item {
        page-break-inside: avoid;
    }
    
    /* Show URLs for links */
    a[href]:not(.social-link):after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
    
    .social-link:after {
        content: "";
    }
    
    /* Remove link styling for print */
    a {
        color: inherit;
        text-decoration: none;
        border: none;
    }
    
    @page {
        size: A4;
        margin: 15mm;
    }
}
