/* ===== 基础 ===== */
:root {
  --bg: #ffffff;
  --bg-alt: #f6f8fb;
  --text: #1f2937;
  --text-muted: #6b7280;
  --accent: #1d4ed8;      /* 科技蓝 */
  --accent-dark: #1e40af;
  --border: #e5e7eb;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(17, 24, 39, 0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.container { max-width: 900px; margin: 0 auto; padding: 0 24px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ===== 导航栏 ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand { font-weight: 700; font-size: 1.1rem; color: var(--text); }
.brand:hover { text-decoration: none; }

.nav-links {
  display: flex;
  gap: 24px;
  list-style: none;
}
.nav-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--accent); text-decoration: none; }

.lang-toggle {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}
.lang-toggle:hover { border-color: var(--accent); color: var(--accent); }

.nav-burger { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--text); }

/* ===== Hero ===== */
.hero {
  padding-top: 140px;
  padding-bottom: 64px;
  text-align: center;
  background: linear-gradient(180deg, #eef3ff 0%, #ffffff 100%);
}

.avatar-wrap {
  width: 150px; height: 150px;
  margin: 0 auto 24px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid #fff;
  box-shadow: var(--shadow);
}
.avatar {
  width: 100%; height: 100%;
  object-fit: cover;          /* 等比填充圆形，只裁四角，不切中心 */
  object-position: 50% 15%;   /* 视窗略上移，露出更多顶部头发 */
  display: block;
}

.hero-name { font-size: 2.4rem; font-weight: 700; letter-spacing: 1px; }
.hero-enname { margin-top: 4px; color: var(--text-muted); font-size: 1.1rem; letter-spacing: 0.5px; }
.hero-title { margin-top: 16px; font-size: 1.05rem; color: var(--accent-dark); font-weight: 500; }
.hero-tagline { margin-top: 10px; color: var(--text-muted); max-width: 560px; margin-left: auto; margin-right: auto; }

/* ===== 章节 ===== */
.section { padding: 72px 0; }
.section.alt { background: var(--bg-alt); }

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 28px;
  position: relative;
  padding-left: 16px;
}
.section-title::before {
  content: "";
  position: absolute;
  left: 0; top: 4px; bottom: 4px;
  width: 4px;
  border-radius: 2px;
  background: var(--accent);
}

.about-text { font-size: 1.02rem; color: #374151; max-width: 760px; }

/* ===== 技能 ===== */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
}
.skill-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.skill-card:hover { transform: translateY(-4px); box-shadow: 0 8px 28px rgba(29, 78, 216, 0.12); }
.skill-item { font-size: 1.02rem; font-weight: 600; }

/* ===== 时间线 ===== */
.timeline { border-left: 2px solid var(--border); padding-left: 24px; display: flex; flex-direction: column; gap: 28px; }
.timeline-item { position: relative; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -31px; top: 6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--accent);
}
.timeline-date { font-size: 0.85rem; color: var(--accent-dark); font-weight: 600; }
.timeline-title { font-size: 1.1rem; margin: 4px 0; }
.timeline-desc { color: var(--text-muted); }

/* ===== 科研经历 ===== */
.research-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 0.95rem;
  font-weight: 500;
}

/* ===== 获奖 ===== */
.award-list { display: flex; flex-direction: column; gap: 14px; }
.award-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
}
.award-year {
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent-dark);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.award-text { font-size: 0.98rem; line-height: 1.6; }

/* ===== 项目仓库 ===== */
.repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
}
.repo-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.repo-card:hover { transform: translateY(-4px); box-shadow: 0 8px 28px rgba(29, 78, 216, 0.12); }
.repo-name { font-size: 1rem; font-weight: 600; line-height: 1.5; }
.repo-link {
  align-self: flex-start;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent-dark);
  border: 1px solid var(--accent);
  border-radius: 999px;
  padding: 6px 18px;
  transition: all 0.2s;
}
.repo-link:hover { background: var(--accent); color: #fff; text-decoration: none; }

/* ===== 占位 ===== */
.placeholder {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg);
}

/* ===== 联系方式 ===== */
.contact-list { display: flex; flex-direction: column; gap: 16px; max-width: 560px; }
.contact-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
}
.contact-label {
  flex-shrink: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg-alt);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 999px;
}
.contact-value { font-size: 0.98rem; word-break: break-all; }

/* ===== 页脚 ===== */
.footer { padding: 28px 0; text-align: center; color: var(--text-muted); font-size: 0.85rem; border-top: 1px solid var(--border); }

/* ===== 响应式 ===== */
@media (max-width: 640px) {
  .nav-burger { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: 60px; left: 0; right: 0;
    flex-direction: column;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    gap: 14px;
  }
  .nav-links.open { display: flex; }
  .hero { padding-top: 120px; }
  .hero-name { font-size: 1.9rem; }
}