/* ============================================================
   张明远 · 个人主页样式
   配色：深蓝（主色）+ 金色（点缀）
   ============================================================ */

:root {
  --primary: #14365d;
  --primary-light: #1e4d80;
  --accent: #c9a227;
  --bg: #f7f8fa;
  --bg-alt: #eef1f5;
  --text: #2b2f36;
  --text-light: #5f6b7a;
  --white: #ffffff;
  --border: #e2e6ec;
  --shadow: 0 8px 30px rgba(20, 54, 93, 0.08);
  --shadow-hover: 0 14px 40px rgba(20, 54, 93, 0.14);
  --radius: 14px;
  --container: 1080px;
  --nav-height: 64px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 16px);
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC",
    "Source Han Sans SC", -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent);
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 导航栏 ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.04em;
}

.brand-dot {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
}

.nav-link {
  position: relative;
  font-size: 0.95rem;
  color: var(--text-light);
  padding: 6px 2px;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

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

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  padding: calc(var(--nav-height) + 72px) 0 72px;
  text-align: center;
  background:
    radial-gradient(ellipse at top left, rgba(30, 77, 128, 0.10), transparent 55%),
    radial-gradient(ellipse at bottom right, rgba(201, 162, 39, 0.12), transparent 55%),
    linear-gradient(180deg, #fdfdff 0%, var(--bg) 100%);
  overflow: hidden;
}

.hero-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(20, 54, 93, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 54, 93, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 75%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
}

.hero-avatar {
  position: relative;
  width: 108px;
  height: 108px;
  margin: 0 auto 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--white);
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  box-shadow: 0 10px 30px rgba(20, 54, 93, 0.25);
  outline: 6px solid rgba(20, 54, 93, 0.08);
  outline-offset: -1px;
}

.hero-avatar span {
  position: relative;
  z-index: 0;
}

.hero-avatar img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.hero-name {
  font-size: 2.6rem;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 8px;
}

.hero-en-name {
  font-size: 0.95rem;
  color: var(--text-light);
  letter-spacing: 0.24em;
  margin-bottom: 8px;
}

.hero-title {
  font-size: 1.15rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.12em;
  margin-bottom: 6px;
}

.hero-affiliation {
  color: var(--text-light);
  margin-bottom: 18px;
}

.hero-tagline {
  max-width: 640px;
  margin: 0 auto 30px;
  color: var(--text-light);
  font-size: 1.02rem;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 48px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 11px 28px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 6px 18px rgba(20, 54, 93, 0.28);
}

.btn-primary:hover {
  background: var(--primary-light);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(20, 54, 93, 0.32);
}

.btn-ghost {
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-ghost:hover {
  background: rgba(20, 54, 93, 0.06);
  transform: translateY(-2px);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 12px;
  list-style: none;
  flex-wrap: wrap;
}

.hero-stats li {
  min-width: 128px;
  padding: 16px 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-stats strong {
  display: block;
  font-size: 1.5rem;
  color: var(--primary);
}

.hero-stats span {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* ---------- 通用区块 ---------- */

.section {
  padding: 84px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-title {
  position: relative;
  text-align: center;
  font-size: 1.75rem;
  color: var(--primary);
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

.section-title::after {
  content: "";
  display: block;
  width: 52px;
  height: 3px;
  margin: 12px auto 0;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent), var(--primary-light));
}

.section-subtitle {
  text-align: center;
  color: var(--text-light);
  margin-bottom: 40px;
  font-size: 0.98rem;
}

/* ---------- 个人简介 ---------- */

.about-grid {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 56px;
  align-items: start;
}

.about-text p {
  margin-bottom: 16px;
  text-align: justify;
}

.about-points {
  margin-top: 18px;
  padding-left: 0;
  list-style: none;
}

.about-points li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 10px;
  color: var(--text-light);
}

.about-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
}

/* 基本信息卡片 */

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 40px;
}

.info-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
  text-align: center;
  box-shadow: var(--shadow);
}

.info-item dt {
  font-size: 0.78rem;
  color: var(--text-light);
  letter-spacing: 0.08em;
  margin-bottom: 3px;
}

.info-item dd {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--primary);
}

/* 时间线 */

.timeline {
  position: relative;
  padding-left: 28px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 26px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: -28px;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--white);
  border: 3px solid var(--accent);
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.18);
}

.timeline-date {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 2px;
}

.timeline-body h3 {
  font-size: 1.02rem;
  color: var(--primary);
  margin-bottom: 2px;
}

.timeline-body p:last-child {
  font-size: 0.9rem;
  color: var(--text-light);
}

/* ---------- 研究方向 ---------- */

.research-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.research-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 28px;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.research-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.research-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--white);
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  margin-bottom: 18px;
}

.research-icon svg {
  width: 26px;
  height: 26px;
}

.research-card h3 {
  font-size: 1.12rem;
  color: var(--primary);
  margin-bottom: 8px;
}

.research-card > p {
  font-size: 0.94rem;
  color: var(--text-light);
  margin-bottom: 14px;
}

.research-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

.research-tags li {
  font-size: 0.8rem;
  color: var(--primary-light);
  background: rgba(30, 77, 128, 0.08);
  border: 1px solid rgba(30, 77, 128, 0.16);
  border-radius: 999px;
  padding: 3px 12px;
}

/* 主要研究内容 */

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
  margin-bottom: 32px;
}

.topic-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.topic-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.topic-num {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #d8b43b, var(--accent));
  color: var(--white);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.topic-card h3 {
  font-size: 1.1rem;
  color: var(--primary);
  margin-bottom: 8px;
}

.topic-card p {
  font-size: 0.94rem;
  color: var(--text-light);
}

/* 研究图片画廊 */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.gallery-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.gallery-item img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
}

.gallery-item figcaption {
  padding: 10px 12px;
  font-size: 0.84rem;
  color: var(--text-light);
  text-align: center;
}

/* ---------- 学术成果（标签页） ---------- */

.tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 36px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 9px 26px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  color: var(--text-light);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.tab-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary);
}

.tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
  box-shadow: 0 6px 18px rgba(20, 54, 93, 0.24);
}

.tab-panel {
  max-width: 820px;
  margin: 0 auto;
}

.pub-list {
  list-style: none;
  counter-reset: pub;
}

.pub-summary {
  text-align: center;
  color: var(--text-light);
  font-size: 0.92rem;
  margin-bottom: 20px;
}

.pub-item {
  position: relative;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 18px;
  align-items: start;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.pub-year {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(201, 162, 39, 0.10);
  border-radius: 8px;
  padding: 5px 0;
  text-align: center;
  letter-spacing: 0.05em;
}

.pub-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 3px;
}

.pub-meta {
  font-size: 0.88rem;
  color: var(--text-light);
}

.pub-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.pub-tags span {
  font-size: 0.74rem;
  line-height: 1;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(30, 77, 128, 0.08);
  color: var(--primary-light);
  border: 1px solid rgba(30, 77, 128, 0.15);
}

.pub-tags .tag-role {
  background: rgba(201, 162, 39, 0.12);
  color: #8a6d13;
  border-color: rgba(201, 162, 39, 0.28);
  font-weight: 600;
}

.pub-tags .tag-metric {
  background: rgba(22, 163, 74, 0.10);
  color: #157347;
  border-color: rgba(22, 163, 74, 0.22);
}

.plain-list {
  list-style: none;
}

.plain-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.plain-item h3 {
  font-size: 1.02rem;
  color: var(--primary);
  margin-bottom: 4px;
}

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--white);
  background: linear-gradient(135deg, #d8b43b, var(--accent));
  border-radius: 999px;
  padding: 3px 11px;
  margin-left: 8px;
  vertical-align: middle;
  letter-spacing: 0.06em;
}

.plain-item p {
  font-size: 0.92rem;
  color: var(--text-light);
}

/* ---------- 教学工作 ---------- */

.teaching-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
}

.teaching-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}

.teaching-card h3 {
  font-size: 1.1rem;
  color: var(--primary);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--bg-alt);
}

.teaching-card p {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 10px;
}

.teaching-card .note {
  color: var(--primary-light);
  font-weight: 600;
  margin-top: 14px;
}

.course-list {
  list-style: none;
}

.course-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
}

.course-list li:last-child {
  border-bottom: none;
}

.course-name {
  font-size: 0.95rem;
}

.course-type {
  font-size: 0.8rem;
  color: var(--accent);
  background: rgba(201, 162, 39, 0.10);
  border-radius: 999px;
  padding: 2px 12px;
  white-space: nowrap;
}

/* ---------- 联系方式 ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.contact-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.contact-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.contact-card h3 {
  font-size: 0.95rem;
  color: var(--text-light);
  font-weight: 600;
  margin-bottom: 8px;
}

.contact-card p {
  font-size: 0.95rem;
  word-break: break-all;
}

.contact-note {
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
}

/* ---------- 页脚 ---------- */

.site-footer {
  background: var(--primary);
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
  padding: 28px 0;
  font-size: 0.88rem;
}

.site-footer p {
  margin-bottom: 4px;
}

/* ---------- 滚动显现动画 ---------- */

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ---------- 响应式 ---------- */

@media (max-width: 860px) {
  .about-grid,
  .teaching-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .research-grid {
    grid-template-columns: 1fr;
  }

  .contact-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-item img {
    height: auto;
    max-height: 220px;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .nav-links.open {
    max-height: 380px;
  }

  .nav-links li {
    border-bottom: 1px solid var(--bg-alt);
  }

  .nav-links li:last-child {
    border-bottom: none;
  }

  .nav-link {
    display: block;
    padding: 14px 24px;
  }

  .nav-link::after {
    display: none;
  }
}

@media (max-width: 520px) {
  .hero {
    padding-top: calc(var(--nav-height) + 48px);
  }

  .hero-name {
    font-size: 2rem;
  }

  .hero-stats {
    gap: 8px;
  }

  .hero-stats li {
    min-width: 42%;
  }

  .section {
    padding: 64px 0;
  }

  .pub-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .pub-year {
    justify-self: start;
    padding: 2px 14px;
  }
}
