/* css/style.css */
:root {
    --bg-color: #1a1a1a;
    --text-color: #e0e0e0;
    --primary-color: #89650ab0;
    --block-color: #89650a2d;
    --secondary-color: #333;
    --border-color: #444;
    --card-bg-color: #252525;
    --heading-font: 'Lora', serif;
    --body-font: 'Nunito Sans', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--body-font);
    line-height: 1.8;
    transition: background-color 0.3s, color 0.3s;
}

/* 确保英文内容默认显示，即使JavaScript失败 */
.language-container[data-lang="en"] {
    display: block;
}

.language-container[data-lang="zh"] {
    display: none;
}

.container {
    max-width: 1000px; /* 恢复原来的宽度 */
    margin: 0 auto;
    padding: 0 20px;
}

h1, h2, h3 {
    font-family: var(--heading-font);
    color: #fff;
    margin-bottom: 1rem;
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 4rem;
    position: relative;
}

h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 10px auto 0;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

p {
    margin-bottom: 1rem;
}

/* 增加About部分正文字体大小 */
#about-en p {
    font-size: 1.1rem;
    line-height: 1.8;
}

.content-section {
    padding: 100px 0;
}

.text-center {
    text-align: center;
}

/* 专门针对About部分的间距优化 */
#about-en .container {
    max-width: 800px; /* 只让About部分的间距变小 */
    padding: 0 40px;
}

/* Navbar */
.navbar {
    background: rgba(26, 26, 26, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
    border-bottom: 1px solid var(--border-color);
}

.navbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-family: var(--heading-font);
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
}

#main-nav ul {
    list-style: none;
    display: flex;
}

#main-nav li {
    margin-left: 30px;
}

#main-nav a {
    color: var(--text-color);
    font-weight: 600;
    padding: 5px 0;
    transition: color 0.3s;
}

#main-nav a:hover {
    color: var(--primary-color);
}

.lang-btn {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s, color 0.3s;
}

.lang-btn:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* Hero Section */
.hero-section {
    padding: 80px 0;
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 50px;
}

.profile-pic {
    width: 220px;
    height: 220px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--secondary-color);
}

.hero-text h1 {
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 1.3rem;
    color: #bbb;
    margin-bottom: 3px;
}

.mission {
    font-size: 1.1rem;
    margin-bottom: 0.1px;
}

.mission2 {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* 邮件链接保持正常文字颜色 */
.mission2 a {
    color: #e0e0e0;
    text-decoration: none;
}

.mission2 a:hover {
    color: #fff;
    text-decoration: underline;
}

.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: #fff;
    padding: 12px 25px;
    border-radius: 5px;
    margin-right: 15px;
    font-weight: 600;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 170, 255, 0.3);
}

/* 调暗social-links中的按钮颜色 */
.social-links .btn {
    background-color: rgba(137, 101, 10, 0.2);
}

.social-links .btn:hover {
    background-color: rgba(137, 101, 10, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(137, 101, 10, 0.3);
}

/* ==================== CSS MODIFICATION START ==================== */
/* 这是更新后的Timeline样式，融合了校徽展示功能 */
.timeline {
    position: relative;
    max-width: 950px; /* 稍微加宽以容纳校徽 */
    margin: 0 auto;
}

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

.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    display: flex; /* 使用Flexbox布局 */
    align-items: center; /* 垂直居中对齐 */
    gap: 20px; /* 校徽和文字之间的间距 */
}

.timeline-item:nth-child(odd) {
    left: 0;
    flex-direction: row-reverse; /* 左侧条目，校徽在右 */
    text-align: right;
}

.timeline-item:nth-child(even) {
    left: 50%;
    flex-direction: row; /* 右侧条目，校徽在左 */
}

.timeline-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    flex-shrink: 0;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    padding: 5px;
}

.timeline-details {
    flex-grow: 1;
}

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

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

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

.timeline-details h3 {
    font-size: 1.3rem; /* 从1.5rem减小到1.3rem */
    margin-bottom: 8px;
}

.timeline-details p {
    color: #bbb;
    margin-bottom: 5px;
    line-height: 1.6;
}

.timeline-details p:last-child {
    margin-bottom: 0;
}
/* ==================== CSS MODIFICATION END ==================== */


/* Card Grid */
.card-grid,.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}
.card,.skill-category {
    background-color: var(--card-bg-color);
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    transition: transform 0.3s, box-shadow 0.3s;
}
.card:hover,.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}
.card-grid-single-col {
    display: grid;
    gap: 25px;
}
.card ul {
    padding-left: 20px;
    margin-top: 10px;
}

/* Publications */
.publication-entry {
    background: var(--card-bg-color);
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
}
.publication-entry.links a {
    margin-right: 15px;
    font-weight: 600;
}

/* Publication Categories */
.publication-category {
    margin-bottom: 3rem;
}

.publication-subtitle {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-weight: 600;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
}

.publication-list {
    list-style: none;
    counter-reset: publication-counter;
    padding-left: 0;
}

.publication-item {
    counter-increment: publication-counter;
    background: rgba(111, 80, 3, 0.15);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 15px;
    position: relative;
    padding-left: 50px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.publication-item::before {
    content: counter(publication-counter);
    position: absolute;
    left: 20px;
    top: 20px;
    background: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 600;
}

.publication-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Contact */
.email-link {
    font-size: 1.3rem;
    font-weight: 600;
    display: inline-block;
    margin-top: 20px;
    padding: 15px 30px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s;
}
.email-link:hover {
    background-color: var(--secondary-color);
}

/* Footer */
.footer {
    background: var(--secondary-color);
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid var(--border-color);
}

/* 桌面端特别优化 */
@media (min-width: 769px) {
    /* 只优化About部分的间距和字体 */
    #about-en .container {
        max-width: 750px; /* 桌面端About部分更窄 */
        padding: 0 50px;
    }
    
    /* About部分字体更大 */
    #about-en p {
        font-size: 1.15rem;
        line-height: 1.9;
    }
    
    /* Education标题适中 */
    .timeline-details h3 {
        font-size: 1.25rem;
    }
    
    /* Timeline整体宽度保持原样 */
    .timeline {
        max-width: 950px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    /* 容器内边距调整 - 增加左右边距 */
    .container {
        padding: 0 25px;
    }
    
    /* 特别针对内容区域增加更多边距 */
    .content-section .container {
        padding: 0 30px;
    }
    
    /* 标题字体大小调整 */
    h1 {
        font-size: 2rem !important;
    }
    
    h2 {
        font-size: 2rem !important;
        margin-bottom: 2.5rem;
    }
    
    h3 {
        font-size: 1.3rem !important;
    }
    
    /* 正文字体大小调整 */
    body {
        font-size: 14px;
        line-height: 1.6;
    }
    
    p {
        font-size: 14px;
        line-height: 1.6;
    }
    
    /* 导航栏移动端优化 */
    .navbar-content {
        flex-direction: column;
        height: auto;
        padding: 15px 0;
        gap: 15px;
    }
    
    .logo {
        font-size: 1.5rem;
        order: 1;
    }
    
    .lang-btn {
        order: 2;
        align-self: flex-end;
        position: absolute;
        top: 15px;
        right: 15px;
        padding: 6px 12px;
        font-size: 12px;
    }
    
    #main-nav {
        order: 3;
        width: 100%;
    }
    
    #main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        margin: 0;
        padding: 0;
        gap: 8px;
    }
    
    #main-nav li {
        margin: 0;
    }
    
    #main-nav a {
        font-size: 13px;
        padding: 8px 12px;
        border-radius: 6px;
        background: rgba(137, 101, 10, 0.15);
        border: 1px solid rgba(137, 101, 10, 0.3);
        display: block;
        text-align: center;
        min-width: 80px;
    }
    
    /* Hero Section 移动端优化 */
    .hero-content {
        flex-direction: column;
        text-align: center;
        gap: 30px;
    }
    
    .profile-pic {
        width: 150px;
        height: 150px;
    }
    
    .hero-text h1 {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }
    
    .subtitle {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }
    
    .mission, .mission2 {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    /* Social Links 移动端特别优化 */
    .social-links {
        display: flex;
        flex-direction: column;
        gap: 12px;
        align-items: center;
        margin-top: 20px;
    }
    
    .social-links .btn {
        display: block;
        width: 200px;
        text-align: center;
        margin-right: 0;
        padding: 14px 20px;
        font-size: 14px;
        font-weight: 600;
        border-radius: 8px;
        background-color: rgba(137, 101, 10, 0.3);
        transition: all 0.3s ease;
    }
    
    .social-links .btn:hover {
        background-color: rgba(137, 101, 10, 0.5);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(137, 101, 10, 0.4);
    }
    
    /* Content sections 移动端优化 */
    .content-section {
        padding: 60px 0;
    }
    
    /* Card Grid - 在移动端改为单列显示 */
    .card-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .card, .skill-category {
        padding: 20px;
        font-size: 14px;
    }
    
    /* Publications 移动端优化 */
    .publication-subtitle {
        font-size: 1.2rem;
    }
    
    .publication-item {
        padding: 15px;
        padding-left: 45px;
        font-size: 13px;
        line-height: 1.5;
    }
    
    .publication-item::before {
        width: 20px;
        height: 20px;
        font-size: 0.8rem;
        left: 15px;
    }
    
  /* Timeline 移动端优化 */
 .timeline::after {
      left: 30px;
  }
 .timeline-item {
      width: 100%;
      padding-left: 70px;
      padding-right: 15px;
  }
 .timeline-item:nth-child(odd),.timeline-item:nth-child(even) {
      left: 0;
      flex-direction: row;
      text-align: left!important;
  }
 
 /* 移动端所有圆圈都应该在同一位置（时间线中心） */
 .timeline-item::after {
      left: 24px; /* 时间线中心对齐 */
      right: auto; /* 重置桌面版的right属性 */
      width: 15px;
      height: 15px;
  }
  
 /* 重写移动端的圆圈位置规则，覆盖桌面版的奇偶数规则 */
 .timeline-item:nth-child(odd)::after,
 .timeline-item:nth-child(even)::after {
      left: 24px;
      right: auto;
 }
 
 .timeline-logo {
      width: 50px;
      height: 50px;
  }
  
  .timeline-details h3 {
      font-size: 1rem !important;
      margin-bottom: 5px;
      line-height: 1.3;
  }
  
  .timeline-details p {
      font-size: 12px !important;
      margin-bottom: 3px;
      line-height: 1.4;
  }
  
  .timeline-details em {
      font-size: 11px !important;
  }
  
  /* Footer 移动端优化 */
  .footer {
      padding: 20px 0;
      font-size: 13px;
  }
  
  /* Contact section 移动端优化 */
  .email-link {
      font-size: 1.1rem;
      padding: 12px 20px;
      margin-top: 15px;
  }
}

/* 小屏幕设备优化 (iPhone SE 等) */
@media (max-width: 480px) {
    .container {
        padding: 0 20px;
    }
    
    .content-section .container {
        padding: 0 25px;
    }
    
    .hero-text h1 {
        font-size: 1.6rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .mission, .mission2 {
        font-size: 13px;
    }
    
    .social-links .btn {
        width: 180px;
        padding: 12px 16px;
        font-size: 13px;
    }
    
    #main-nav a {
        font-size: 12px;
        padding: 6px 10px;
        min-width: 70px;
    }
    
    .profile-pic {
        width: 120px;
        height: 120px;
    }
    
    h2 {
        font-size: 1.8rem !important;
    }
    
    .content-section {
        padding: 40px 0;
    }
    
    /* 进一步优化Education部分 */
    .timeline-details h3 {
        font-size: 0.9rem !important;
    }
    
    .timeline-details p {
        font-size: 11px !important;
    }
}