@import "./styles.css";

:root{
    --h-title-color:#000000;
}

.header {
    border-bottom: solid 2px var(--bs-blue);
}

.bg-bottom {
    background-color: var(--h-title-color);
}

.top-section {
    position: relative;
    padding: 10rem 0;
    background-position: center;
    background-size: cover;
    height: 25rem;
}

.top-section h2 {
    font-weight: 400;
}

.top-section .top-section-content {
    position: relative;
    z-index: 1;
}

.top-section:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

section header h2{
    font-family: "Kanit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji" !important;
    color: #2c3e50;
    font-size: calc(1.3rem + 0.6vw);
    line-height: 1.5;
    margin-bottom: 1rem;
}

section .main-body{
    font-size: 1.3rem;
    font-weight: 200;
    line-height: 2.4rem;
}

/* Global Background */
body {
    background-color: #f4f6f8;
}

/* Card Style */
.card-section {
    background-color: #ffffff;
    border-radius: 16px; /* 稍微增加圆角 */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05); /* 优化阴影，使其更柔和且有层次感 */
    padding: 3rem; /* 增加桌面端内边距，增加呼吸感 */
    margin-bottom: 2rem;
    border: 1px solid rgba(0,0,0,0.02);
    
    /* 固定宽度与居中布局 */
    max-width: 980px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    position: relative; /* 确保层级正确 */
}

/* Reduce section spacing */
section.mt5 {
    margin-top: 2rem !important; /* 稍微增加顶部间距，使卡片之间分离更清晰 */
    padding-top: 0 !important;
}

section.md5 {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Override Section Backgrounds to be transparent */
.bg-gradient-primary-to-secondary-light,
.bg-gradient-primary-to-secondary-gray {
    background: transparent !important;
}

.on-top {
    position: relative;
    z-index: 10000;
}

.top-bg {
    background-position: center;
    background-size: fill;
    width: 100%;
    height: 100%;
}

.top-bg::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

.photo {
    position: relative;
}

.photo img {
    margin-right: 10%;
    height: 12rem;
    margin-top: 8rem;
}

.photo .screen {
    position: absolute;
    background-size: cover;
    pointer-events: auto;
}

.photo .button {
    position: absolute;
    cursor: pointer;
}

/* 移动端优化 - 导航栏 */
@media screen and (max-width: 991px) {
    .photo img {
        height: 12rem;
        margin-top: 3rem;
    }
    
    .navbar-nav {
        text-align: center;
    }
    
    .nav-link {
        padding: 0.5rem 1rem;
        font-size: 1.1rem;
    }
}

/* 移动端优化 - 小屏幕设备 */
@media screen and (max-width: 768px) {
    .top-section {
        padding: 6rem 0;
        height: 20rem;
    }
    
    .photo img {
        height: 10rem;
        margin-top: 5rem;
        margin-right: 0;
    }
    
    section header h2 {
        font-size: 1.5rem;
        line-height: 1.5;
    }
    
    section .main-body {
        font-size: 1.1rem;
        line-height: 2rem;
    }
    
    .container.px-5 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    .display-3 {
        font-size: 2rem;
    }
}

/* 移动端优化 - 超小屏幕设备 */
@media screen and (max-width: 576px) {
    .top-section {
        padding: 4rem 0;
        height: 18rem;
    }
    
    .photo img {
        height: 8rem;
        margin-top: 3rem;
    }
    
    section header h2 {
        font-size: 1.3rem;
        line-height: 1.5;
    }
    
    section .main-body {
        font-size: 1rem;
        line-height: 1.8rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .nav-link {
        font-size: 1rem;
        padding: 0.4rem 0.8rem;
    }
    
    .top-section h2.display-3 {
        font-size: 1.8rem;
    }
}

/* 移动端优化 - 横向布局优化 */
@media screen and (max-width: 736px) {
    .photo img {
        height: 7rem;
        margin-top: 7rem;
    }
    
    .row {
        flex-direction: column;
    }
    
    .col-lg-8, .col-lg-4 {
        width: 100%;
    }
    
    .top-section .row {
        text-align: center;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .nav-link {
        padding: 0.8rem 1rem;
    }
    
    .navbar-toggler {
        padding: 0.5rem 0.75rem;
        font-size: 1.2rem;
    }
}

/* 高分辨率屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .photo img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* News 滚动容器样式 - 新设计 */
.news-container {
    margin: 1rem 0;
    /* border: 1px solid #e0e0e0; */ /* Removed border */
    /* background: #fafafa; */ /* Removed background */
    /* border-radius: 8px; */
    overflow: hidden; /* 防止内容溢出容器 */
}

.news-scroll {
    max-height:250px; /* 增加高度以完整显示3条新闻 */
    overflow-y: auto; /* 启用垂直滚动 */
    padding-right: 10px; /* 为滚动条预留空间 */
}

/* 自定义滚动条样式 */
.news-scroll::-webkit-scrollbar {
    width: 6px;
}

.news-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.news-scroll::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.news-scroll::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

.news-item {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin-bottom: 1.2rem; /* 稍微减小间距 */
    padding: 0 0 0 1.5rem;
    border-left: 4px solid #4a90e2; /* Blue vertical line */
    border-radius: 0;
    background-color: transparent;
    transition: none;
    position: relative;
}

.news-item:hover {
    background-color: transparent;
}

.news-date {
    display: block;
    width: auto;
    font-weight: 600;
    color: #555;
    margin-bottom: 0.25rem;
    padding-right: 0;
    font-size: 0.95rem;
}

.news-content {
    display: block;
    color: #333;
    line-height: 1.5;
    font-size: 1rem;
}

/* 移动端优化 - News */
@media screen and (max-width: 768px) {
    .card-section {
        padding: 1.5rem; /* 保持移动端较小的内边距 */
        border-radius: 12px;
        margin-bottom: 1.5rem; /* 减小移动端卡片底部间距 */
    }
    
    section.mt5 {
        margin-top: 1rem !important; /* 减小移动端板块顶部间距 */
    }

    .news-item {
        margin-bottom: 1rem;
    }
}

/* Timeline Style for Education/Experience */
.timeline-item {
    border-left: 4px solid #4a90e2;
    padding-left: 1.2rem;
    margin-bottom: 1.5rem;
}

.timeline-date {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
    font-weight: 500;
}

.timeline-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #212529;
    margin-bottom: 0.2rem;
}

.timeline-desc {
    color: #495057;
    font-size: 0.95rem;
}

/* Research Interest Badges */
.badge-interest {
    background-color: #e8f0fe;
    color: #1967d2;
    font-weight: 500;
    padding: 0.5em 1em;
    border-radius: 50rem;
    font-size: 0.9rem;
    display: inline-block;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.badge-interest:hover {
    background-color: #d2e3fc;
    color: #174ea6;
    text-decoration: none;
}

/* Photo Position - 正常布局，随页面滚动 */
.photo-sticky {
    position: relative;
    top: 0;
}

.photo-sticky img {
    width: 100%;
    max-width: 280px;
    border-radius: 8px;
}

/* 移动端照片适配 */
@media screen and (max-width: 991px) {
    .photo-sticky {
        text-align: center;
        margin-bottom: 20px;
    }
    
    .photo-sticky img {
        max-width: 280px;
    }
}

/* Profile Header Links */
.profile-link {
    display: inline-flex;
    align-items: center;
    color: #0d6efd;
    text-decoration: none;
    font-weight: 500;
    margin-right: 1.5rem;
    transition: color 0.2s;
}

.profile-link:hover {
    color: #0a58ca;
    text-decoration: underline;
}

.profile-link i {
    margin-right: 0.4rem;
    font-size: 1.1rem;
}

/* Publications 移动端优化 */
@media screen and (max-width: 768px) {
    .paper-section {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 20px;
        padding: 15px;
    }
    
    .journal-logo {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .paper-img {
        width: 100%;
        max-width: 280px;
        height: auto;
        margin: 0 auto;
        display: block;
    }
    
    .paper-title {
        font-size: 1.15rem;
        line-height: 1.5;
        margin-bottom: 10px;
    }
    
    .authors, .conference-info {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 8px;
    }
    
    .action-buttons {
        flex-direction: row;
        justify-content: flex-start;
        gap: 10px;
        margin-top: 5px;
    }
    
    .button {
        padding: 6px 12px;
        height: auto;
        line-height: 1.4;
        font-size: 0.85rem;
        min-width: 60px;
    }
    
    .pub-section-title {
        font-size: 1.1rem;
    }
}

@media screen and (max-width: 576px) {
    .paper-section {
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .paper-title {
        font-size: 1.05rem;
    }
    
    .authors, .conference-info {
        font-size: 0.85rem;
    }
    
    .action-buttons {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .button {
        font-size: 0.8rem;
        padding: 5px 10px;
        min-width: 55px;
    }
    
    .pub-section-title {
        font-size: 1rem;
    }
}

/* Code Repository 移动端优化 */
@media screen and (max-width: 768px) {
    #project-md div[style*="display: flex"] {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    #project-md img {
        max-width: 100%;
        width: 300px !important;
        height: auto;
    }
    
    #project-md a {
        display: block;
        margin-bottom: 10px;
    }
}

/* GitHub徽章移动端优化 */
@media screen and (max-width: 768px) {
    #project-md a[href*="github.com"] img {
        max-width: 100%;
        height: auto;
        transform: scale(0.8); /* 缩小徽章尺寸 */
        margin: 5px;
    }
    
    #project-md a[href*="github.com"] {
        display: inline-block;
        margin: 0 5px 10px 5px;
    }
    
    /* 徽章容器布局优化 */
    #project-md > a:first-child,
    #project-md > a:nth-child(2),
    #project-md > a:nth-child(3) {
        display: inline-block;
        margin: 0 8px 12px 8px;
    }
}

@media screen and (max-width: 576px) {
    #project-md a[href*="github.com"] img {
        transform: scale(0.7); /* 更小屏幕进一步缩小 */
        margin: 3px;
    }
    
    #project-md a[href*="github.com"] {
        margin: 0 3px 8px 3px;
    }
    
    /* 超小屏幕改为垂直布局 */
    @media screen and (max-width: 400px) {
        #project-md > a:first-child,
        #project-md > a:nth-child(2),
        #project-md > a:nth-child(3) {
            display: block;
            margin: 0 auto 8px auto;
            text-align: center;
        }
        
        #project-md a[href*="github.com"] img {
            transform: scale(0.65);
            margin: 0 auto;
            display: block;
        }
    }
}

@media screen and (max-width: 576px) {
    #project-md div[style*="display: flex"] {
        gap: 10px;
    }
    
    #project-md img {
        width: 280px !important;
    }
}