/* ==========================================================================
   Pro Minimalist Theme - 极简学术与高管风
   ========================================================================== */

/* --- 1. 基础变量与重置 (CSS Variables & Reset) --- */
:root {
  /* 核心色彩体系：克制、专业、现代 */
  --bg-main: #ffffff;          /* 纯白主背景 */
  --bg-secondary: #f9fafb;     /* 极浅灰区块背景 */
  --text-main: #111827;        /* 深碳灰主文本 (比纯黑更柔和护眼) */
  --text-muted: #4b5563;       /* 中灰次文本 (用于描述、时间、辅助信息) */
  --text-light: #9ca3af;       /* 浅灰文本 */
  --primary-color: #2563eb;    /* 科技蓝强调色 (适合新能源/电力系统领域) */
  --primary-hover: #1d4ed8;
  --border-color: #e5e7eb;     /* 极细边框色 */
  
  /* 排版参数 */
  --max-width: 900px;          /* 最佳阅读宽度的容器 */
  --font-base: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-base);
  color: var(--text-main);
  background-color: var(--bg-main);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- 2. 基础排版 (Typography & Links) --- */
a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
  text-underline-offset: 4px;
}

h1, h2, h3, h4 {
  color: var(--text-main);
  font-weight: 600;
  line-height: 1.3;
}

p {
  margin-bottom: 1.2rem;
  color: var(--text-muted);
}

/* --- 3. 全局布局容器 (Layout) --- */
header, nav, main, footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

/* --- 4. 头部区域 (Header) --- */
header {
  padding-top: 30px;
  padding-bottom: 20px;
}

/* 响应式头部：手机端保持较大间距 */
@media (max-width: 768px) {
  header {
    padding-top: 40px;
    padding-bottom: 20px;
  }
}

.header-content {
  display: flex;
  align-items: flex-start;
  gap: 30px;
}

/* 桌面端：左右布局，头像左信息右 */
@media (min-width: 769px) {
  .header-content {
    flex-direction: row;
    align-items: flex-start;
  }
  
  .header-content .profile-img {
    flex-shrink: 0;
    align-self: flex-start;
  }
  
  .header-content > div {
    flex: 1;
    min-width: 0; /* 防止flex item溢出 */
  }
  
  .header-content h1 {
    white-space: nowrap;
  }
  
  .header-content .affiliation p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* 移动端：垂直布局保持不变 */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

.profile-img {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 1px solid var(--border-color);
  /* 放弃厚重阴影，改用极其微妙的弥散光 */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

/* 响应式头像：手机端使用小尺寸 */
@media (max-width: 768px) {
  .profile-img {
    width: 100px;
    height: 100px;
  }
}

.header-info h1 {
  font-size: 2.25rem;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.affiliation {
  font-size: 1.05rem;
  color: var(--text-muted);
}

.affiliation p {
  margin: 2px 0;
}

.affiliation a {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px solid var(--border-color);
}

.affiliation a:hover {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  text-decoration: none;
}

/* 个人简介样式 */
.bio-text {
  font-style: italic;
  color: var(--text-muted);
  margin: 12px 0;
  line-height: 1.6;
  font-size: 0.95rem;
}

/* 头部联系方式 */
.header-contacts {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.contact-email {
  color: var(--primary-color);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  padding: 4px 8px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  transition: all 0.2s ease;
}

.contact-email:hover {
  background-color: var(--bg-secondary);
  border-color: var(--primary-color);
  color: var(--primary-hover);
}

/* --- 5. 极简导航栏 (Navigation) --- */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  padding-top: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 40px;
}

nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-brand {
  font-weight: 600;
  color: var(--text-main);
  margin-right: auto; /* 将菜单推向右侧，或者保持现在的居中 */
  font-size: 1.1rem;
}

.nav-menu {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

nav a.nav-link, nav a.english-link {
  display: inline-block;
  padding: 8px 16px;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s ease;
  text-decoration: none;
}

/* 悬停效果：浅灰底色，不突兀 */
nav a.nav-link:hover, nav a.english-link:hover {
  background-color: var(--bg-secondary);
  color: var(--text-main);
}

/* 激活状态：淡蓝色背景 + 主题色文字 */
nav a.nav-link.active {
  background-color: #eff6ff;
  color: var(--primary-color);
}

/* --- 6. 核心内容区 (Main & Sections) --- */
main {
  min-height: 50vh;
  padding-bottom: 80px;
}

section {
  margin-bottom: 60px;
}

section h2 {
  font-size: 1.5rem;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

/* 通用列表排版优化 */
section ul, section ol {
  padding-left: 20px;
  margin-bottom: 20px;
  color: var(--text-muted);
}

section li {
  margin-bottom: 10px;
}

/* --- 7. 论文模块卡片化 (Papers) --- */
.papers-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.paper-item {
  padding: 24px;
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.paper-item:hover {
  border-color: #d1d5db;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.paper-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 12px;
}

.paper-index {
  color: var(--text-light);
  font-weight: 500;
  font-family: monospace;
  font-size: 1.1rem;
  margin-top: 2px;
}

.paper-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.5;
}

.paper-title-zh {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 400;
  display: block;
  margin-top: 4px;
}

.paper-authors {
  font-size: 0.95rem;
  color: var(--text-main);
  margin-bottom: 8px;
}

.paper-journal, .paper-conference {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.paper-journal em, .paper-conference em {
  color: var(--text-main);
  font-style: normal;
  font-weight: 500;
}

/* 论文摘要框 */
.paper-abstract, .paper-abstract-en {
  background-color: var(--bg-secondary);
  padding: 16px;
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin-top: 16px;
}

.paper-abstract strong, .paper-abstract-en strong {
  color: var(--text-main);
  font-weight: 600;
}

.paper-keywords, .paper-keywords-en {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 12px;
}

/* --- 8. 页脚 (Footer) --- */
footer {
  border-top: 1px solid var(--border-color);
  padding-top: 40px;
  padding-bottom: 40px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.footer-contacts h3 {
  font-size: 1rem;
  margin-bottom: 16px;
  color: var(--text-main);
}

.contact-item {
  margin-bottom: 8px;
}

.contact-item strong {
  font-weight: 500;
  color: var(--text-main);
}

.footer-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 24px;
}

/* --- 9. 动画与响应式 (Animations & Responsive) --- */
.fade-in {
  animation: fadeIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (min-width: 768px) {
  .footer-content {
    flex-direction: row;
    justify-content: space-between;
  }
}

@media (max-width: 768px) {
  header {
    padding-top: 40px;
  }
  .header-content {
    flex-direction: column;
    text-align: center;
    gap: 24px;
  }
  .nav-menu {
    justify-content: center;
    width: 100%;
    margin-top: 12px;
  }

/* --- 10. 工具提示 (Tips) --- */
.tip {
  position: relative;
  border-bottom: 1px dashed var(--border-color);
  cursor: help;
  color: inherit;
}
.tip span {
  display: none;
}

/* ==========================================================================
   Timeline Modules (教育、工作经历双栏时间轴)
   ========================================================================== */
.timeline-container {
  display: flex;
  flex-direction: column;
  margin-top: 20px;
}

.timeline-item {
  display: flex;
  flex-direction: row;
  margin-bottom: 32px;
  position: relative;
}

/* 左侧：时间轨道 */
.timeline-date {
  flex: 0 0 160px; /* 左侧固定宽度 */
  padding-right: 24px;
  text-align: right;
  font-family: monospace; /* 等宽字体凸显严谨 */
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  border-right: 2px solid var(--border-color); /* 中间的分割线 */
  position: relative;
  line-height: 1.6;
}

/* 时间轴上的小圆点 */
.timeline-date::after {
  content: '';
  position: absolute;
  top: 8px;
  right: -5px; /* 对齐到右侧边框线上 */
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--primary-color);
  box-shadow: 0 0 0 4px var(--bg-main); /* 制造镂空效果 */
}

/* 右侧：履历详情 */
.timeline-content {
  flex: 1;
  padding-left: 32px;
  padding-bottom: 16px;
}

.timeline-text {
  font-size: 1.05rem;
  color: var(--text-main);
  line-height: 1.6;
}

/* 针对正文里加粗的机构名称（如 <strong>特锐德</strong>）强化视觉 */
.timeline-text strong {
  color: var(--text-main);
  font-weight: 600;
  font-size: 1.1rem;
  display: block; /* 让公司/学校名称单独占一行 */
  margin-bottom: 4px;
}

.timeline-sublist {
  margin-top: 12px;
  padding-left: 16px;
  color: var(--text-muted);
  font-size: 0.95rem;
  list-style-type: circle;
}

/* 响应式：手机端变为上下堆叠结构 */
@media (max-width: 768px) {
  .timeline-item {
    flex-direction: column;
  }
  
  .timeline-date {
    flex: none;
    text-align: left;
    border-right: none;
    padding-right: 0;
    margin-bottom: 12px;
  }
  
  /* 手机端隐藏小圆点和中轴线 */
  .timeline-date::after {
    display: none;
  }
  
  .timeline-content {
    padding-left: 0;
    border-left: 2px solid var(--border-color); /* 竖线移到内容左侧 */
    padding-left: 16px;
    margin-left: 8px;
  }
}

/* ==========================================================================
   Tags & Cards (标签与卡片化组件)
   ========================================================================== */

/* 小标题样式 (替代原本的段落 P) */
.section-subtitle {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 32px;
  margin-bottom: 16px;
}
.section-subtitle:first-of-type {
  margin-top: 0;
}

/* 标签组 (Tags) */
.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.tag-item {
  display: inline-flex;
  align-items: center;
  background-color: #F3F4F6;
  color: #374151;
  padding: 6px 16px;
  border-radius: 9999px; /* 胶囊形状 */
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid #E5E7EB;
  transition: all 0.2s ease;
}

.tag-item:hover {
  background-color: #E5E7EB;
  transform: translateY(-1px);
}

/* 卡片组 (Cards - 专利与获奖) */
.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* 响应式网格 */
  gap: 20px;
  margin-bottom: 32px;
}

.card-item {
  background-color: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 20px;
  transition: border-color 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.card-item:hover {
  border-color: #D1D5DB;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

/* 卡片角标 (Badge) */
.card-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.badge-year {
  background-color: #EFF6FF;
  color: #2563EB; /* 科技蓝 */
}

.badge-patent {
  background-color: #ECFDF5;
  color: #059669; /* 翡翠绿，显得更硬核 */
}

.card-body {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-main);
}

/* 专利号专属样式 */
.patent-number {
  font-family: monospace;
  color: var(--text-muted);
  font-size: 0.9rem;
  display: block;
  margin-bottom: 4px;
}
