/* Base Styles */
:root {
    --primary-color: #165DFF;
    --secondary-color: #34A853;
    --dark-color: #202124;
    --light-color: #F8F9FA;
    --gray-color: #6C757D;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    scroll-behavior: smooth;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

section {
    position: relative;
}

.py-16 {
    padding-top: 10rem;
    padding-bottom: 10rem;
}

/* Navigation */
.navbar {
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.navbar.scrolled {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    background-color: rgba(255, 255, 255, 0.98);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: var(--transition);
}

.navbar-brand:hover {
    color: var(--primary-color);
    transform: scale(1.05);
}

.nav-link {
    font-weight: 500;
    color: var(--dark-color);
    margin-left: 1.5rem;
    position: relative;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* 现在中英文页面统一使用name标识 */
#hero {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4efe9 100%);
    overflow: hidden;
}

/* 确保hero和name区域的文本在所有屏幕尺寸下都左对齐 */
#hero .name-content,
#name .name-content {
    text-align: left !important;
}

#name {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4efe9 100%);
    overflow: hidden;
}

.hero-content h1,
.name-content h1 {
    font-size: 3.5rem;
    line-height: 1.4;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: fadeIn 1s ease forwards;
    opacity: 0;
}

.hero-content h2,
.name-content h2 {
    font-size: 1.8rem;
    color: var(--gray-color);
    animation: fadeIn 1s ease 0.3s forwards;
    opacity: 0;
}

.hero-content p,
.name-content p {
    font-size: 1.1rem;
    animation: fadeIn 1s ease 0.6s forwards;
    opacity: 0;
}

.hero-content .btn,
.name-content .btn {
    animation: fadeIn 1s ease 0.9s forwards;
    opacity: 0;
}

/* Honors and Awards Styling */
.honors-list {
    margin-top: 1.5rem;
}

.honor-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.honor-item:hover {
    transform: translateX(5px);
}

.honor-item:last-child {
    border-bottom: none;
}

.honor-name {
    flex-grow: 1;
    font-weight: 500;
    padding-right: 1rem;
}

.honor-year {
    flex-shrink: 0;
    color: var(--primary-color);
    font-weight: 600;
    white-space: nowrap;
}

/* Responsive adjustments for Honors and Awards */
@media (max-width: 768px) {
    .honor-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem 0;
    }
    
    .honor-year {
        margin-top: 0.5rem;
        color: var(--gray-color);
    }
}

/* Name Section (中文页面) */
#name {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4efe9 100%);
    overflow: hidden;
}

.name-content h1 {
    font-size: 3.5rem;
    line-height: 1.4;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: fadeIn 1s ease forwards;
    opacity: 0;
}

.name-content h2 {
    font-size: 1.8rem;
    color: var(--gray-color);
    animation: fadeIn 1s ease 0.3s forwards;
    opacity: 0;
}

.name-content p {
    font-size: 1.1rem;
    animation: fadeIn 1s ease 0.6s forwards;
    opacity: 0;
}

.name-content .btn {
    animation: fadeIn 1s ease 0.9s forwards;
    opacity: 0;
}

/* Profile Picture */
.profile-pic-container {
    position: relative;
    width: 320px;
    height: 320px;
    z-index: 1;
}

.profile-pic {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 8px solid white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.profile-pic-container::before {
    content: '';
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    border-radius: 50%;
    border: 2px dashed var(--primary-color);
    animation: rotate 15s linear infinite;
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 5rem;
}

/* 移除About和Education部分之间的多余短线 */
/* 为整个education部分添加特殊处理 */
#education {
    position: relative;
}

#education::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 40px;
    background-color: #f8f9fa;
    z-index: 1;
}

/* 确保section-header的标题和短线仍然可见 */
#education .section-header {
    position: relative;
    z-index: 2;
    margin-top: 20px;
}

.section-title {
    font-size: 2.5rem;
    position: relative;
    display: inline-block;
    padding-bottom: 1rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
}

/* 确保about部分的标题在水平方向上对齐 */
.equal-align {
    text-align: left !important;
    margin-left: 0 !important;
    margin-top: 0 !important;
    padding-left: 0 !important;
    position: static !important;
    font-size: 2.5rem !important;
    line-height: 1.2 !important;
    display: block !important;
    width: auto !important;
}

/* About Section */
.about-content {
    display: flex;
    flex-direction: column;
    text-align: justify;
    margin-bottom: 2.5rem;
}

/* Skill Card Layout */
.skill-category-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
}

.skill-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    transition: var(--transition);
    width: 70px;
    height: 70px;
    background-color: rgba(22, 93, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.skill-card {
    background-color: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    border-top: 4px solid var(--primary-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 100%;
}

.skill-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.skill-card:hover .skill-icon {
    transform: scale(1.1) rotate(5deg);
    background-color: rgba(22, 93, 255, 0.2);
}

/* Responsive Skill Cards */
/* Two-column layout for medium screens */
@media (max-width: 992px) and (min-width: 768px) {
    .col-md-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 768px) {
    .skill-card {
        padding: 1.5rem;
    }
    
    .skill-icon {
        font-size: 2rem;
        width: 60px;
        height: 60px;
    }
}

@media (max-width: 576px) {
    .skill-category-title {
        font-size: 1.25rem;
    }
    
    .skill-card {
        padding: 1.25rem;
    }
}

.skill-item-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.skill-item:hover .skill-item-icon {
    transform: scale(1.1) rotate(5deg);
}

.skill-item-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.skill-item-level {
    font-size: 0.9rem;
    color: var(--gray-color);
    margin-bottom: 1rem;
}

.skill-item-description {
    font-size: 1rem;
    color: var(--dark-color);
    line-height: 1.6;
}

/* Responsive Skill Cards */
@media (max-width: 768px) {
    .skills-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .skill-item {
        padding: 1.5rem;
    }
    
    .skill-item-icon {
        font-size: 2.5rem;
    }
}
/* Education Section */
.education-timeline {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

/* Responsive university logo fix for mobile screens */
@media (max-width: 768px) {
    /* Change absolute positioning to relative for mobile */
    .timeline-content > div[style*="position: relative;"] {
        position: relative !important;
        height: 80px;
        margin-bottom: 15px;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    
    /* Adjust logo positioning for mobile */
    .timeline-content img[style*="position: absolute;"] {
        position: relative !important;
        top: auto !important;
        right: auto !important;
    }
    
    /* Center-align text content for mobile */
    .timeline-content h3,
    .timeline-content h4 {
        text-align: center;
    }
}

.education-timeline::after {
    content: '';
    position: absolute;
    width: 6px;
    background-color: var(--primary-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -3px;
    border-radius: 3px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
    margin-bottom: 2rem;
}

.timeline-item:nth-child(odd) {
    left: 0;
}

.timeline-item:nth-child(even) {
    left: 50%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background-color: white;
    border: 4px solid var(--primary-color);
    border-radius: 50%;
    top: 15px;
    z-index: 1;
}

.timeline-item:nth-child(odd)::after {
    right: -10px;
}

.timeline-item:nth-child(even)::after {
    left: -10px;
}

.timeline-content {
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.timeline-content:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.university-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 1rem;
}

/* Research Section Space-Between Alignment - Visual Test Solution */
.space-between-container {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background-color: rgba(240, 240, 240, 0.5); /* Light background to visualize container */
}

.space-between-item {
    box-sizing: border-box !important;
    margin-bottom: 2rem !important;
    padding: 0 !important;
    border: 1px solid rgba(0, 0, 255, 0.2); /* Subtle border to visualize items */
}

/* Desktop - 3 items per row with clear space between */
@media (min-width: 1200px) {
    .space-between-item {
        width: calc(33.333% - 15px) !important;
    }
}

/* Tablet - 2 items per row with clear space between */
@media (min-width: 768px) and (max-width: 1199px) {
    .space-between-item {
        width: calc(50% - 10px) !important;
    }
}

/* Mobile - 1 item per row */
@media (max-width: 767px) {
    .space-between-item {
        width: 100% !important;
    }
    .space-between-container {
        justify-content: center !important;
    }
}

/* Highlight specific container for debugging */
#research .container {
    position: relative;
}

#research .container::after {
    content: "";
    display: table;
    clear: both;
}

.research-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 280px;
    width: 100%;
}

.research-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.research-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    transition: var(--transition);
}

.research-card:hover .research-icon {
    transform: scale(1.1) rotate(5deg);
}

/* 英文页面保持顶部对齐 */
.research-content {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 230px;
}

/* 中文页面标题上对齐，正文中心对齐 */
[lang="zh-CN"] .research-content {
    justify-content: space-between;
    min-height: 280px;
}

[lang="zh-CN"] .research-content h3 {
    margin-bottom: 1rem;
    align-self: flex-start;
}

[lang="zh-CN"] .research-content p {
    flex-grow: 1;
    display: flex;
    align-items: center;
    text-align: left;
}

.research-content h3 {
    margin-bottom: 1rem;
}

.research-content p {
    margin-top: 0;
}

/* Publications Section */
.publication-item {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.publication-item:hover {
    transform: translateX(10px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.publication-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.publication-authors {
    font-style: italic;
    color: var(--gray-color);
    margin-bottom: 0.5rem;
}

/* Contact Section */
.contact-info {
    margin-bottom: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.contact-icon {
    width: 40px;
    height: 40px;
    background-color: rgba(22, 93, 255, 0.1);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.social-link {
    width: 45px;
    height: 45px;
    background-color: rgba(22, 93, 255, 0.1);
    color: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    font-size: 1.2rem;
}

.social-link:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-5px);
}

.contact-form .form-control {
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid #ced4da;
    transition: var(--transition);
}

.contact-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(22, 93, 255, 0.25);
    outline: none;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    padding: 0.8rem 2rem;
    font-weight: 600;
    border-radius: 8px;
    transition: var(--transition);
}

.btn-primary:hover {
    background-color: #0E4CD1;
    border-color: #0E4CD1;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(22, 93, 255, 0.3);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-15px);
    }
    100% {
        transform: translateY(0px);
    }
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 992px) {
    /* 在中等宽度屏幕下为导航栏添加足够的下方内边距，避免遮挡照片 */
    .navbar {
        padding-bottom: 1rem;
    }
    
    /* 为body添加顶部内边距，使整个页面内容向下平移导航栏的高度 */
    body {
        padding-top: 80px;
    }
    
    .education-timeline::after {
        left: 31px;
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }
    
    .timeline-item:nth-child(even) {
        left: 0;
    }
    
    .timeline-item::after,
    .timeline-item:nth-child(odd)::after,
    .timeline-item:nth-child(even)::after {
        left: 21px;
        right: auto;
    }
    
    /* 确保在中等宽度屏幕下照片在文字上方显示 */
    #hero .row,
    #name .row {
        flex-direction: column;
    }
    
    /* 交换照片和文字的顺序，确保照片在上方 */
    #hero .col-lg-6:nth-child(1),
    #name .col-lg-6:nth-child(1) {
        order: 2;
    }
    
    #hero .col-lg-6:nth-child(2),
    #name .col-lg-6:nth-child(2) {
        order: 1;
    }
}

@media (max-width: 768px) {
    /* 在窄屏模式下为导航栏添加足够的下方内边距，避免遮挡照片 */
    .navbar {
        padding-bottom: 1rem;
    }
    
    /* 为body添加顶部内边距，使整个页面内容向下平移导航栏的高度 */
    body {
        padding-top: 80px;
    }
    
    .py-16 {
        padding-top: 6rem;
        padding-bottom: 6rem;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
    
    .hero-content h2 {
        font-size: 1.5rem;
    }
    
    /* 中文页面样式 */
    .name-content h1 {
        font-size: 2.5rem;
    }
    
    .name-content h2 {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .profile-pic-container {
        width: 250px;
        height: 250px;
        margin-bottom: 2rem;
    }
    
    /* 确保照片在文字上方显示 */
    #hero .row,
    #name .row {
        flex-direction: column;
    }
    
    /* 交换照片和文字的顺序，确保照片在上方 */
    #hero .col-lg-6:nth-child(1),
    #name .col-lg-6:nth-child(1) {
        order: 2;
    }
    
    #hero .col-lg-6:nth-child(2),
    #name .col-lg-6:nth-child(2) {
        order: 1;
    }
    
    /* 为窄屏时的about部分内容底部添加额外间距 */
    .about-content {
        margin-bottom: 2.5rem;
    }
    
    /* 调整中等宽度屏幕下的时间线样式 */
    .education-timeline::after {
        left: 28px;
    }
    
    .timeline-item {
        padding-left: 60px;
    }
    
    .timeline-item::after,
    .timeline-item:nth-child(odd)::after,
    .timeline-item:nth-child(even)::after {
        left: 18px;
        right: auto;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .nav-link {
        margin-left: 0.5rem;
        font-size: 0.9rem;
    }
    
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-content h2 {
        font-size: 1.2rem;
    }
    
    /* 中文页面样式 */
    .name-content h1 {
        font-size: 2rem;
    }
    
    .name-content h2 {
        font-size: 1.2rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .social-link {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    /* 确保照片在文字上方显示 */
    #hero .row,
    #name .row {
        flex-direction: column;
    }
    
    /* 交换照片和文字的顺序，确保照片在上方 */
    #hero .col-lg-6:nth-child(1),
    #name .col-lg-6:nth-child(1) {
        order: 2;
    }
    
    #hero .col-lg-6:nth-child(2),
    #name .col-lg-6:nth-child(2) {
        order: 1;
    }
    
    /* 调整窄屏时的时间线样式 */
    .education-timeline::after {
        left: 25px;
    }
    
    .timeline-item {
        padding-left: 50px;
    }
    
    .timeline-item::after,
    .timeline-item:nth-child(odd)::after,
    .timeline-item:nth-child(even)::after {
        left: 15px;
        right: auto;
    }
}
