:root {
  --purple: #6a2475;
  --purple-dark: #541b5d;
  --purple-tint: #f8f3f9;
  --purple-border: #e6d7e9;
  --blue: #0751a0;
  --ink: #2c2c2c;
  --ink-secondary: #4d4d4d;
  --muted: #767676;
  --line: #e8e8e8;
  --line-soft: #efefef;
  --band: #f4f4f6;
  --stage-bg: #f7f7f8;
  --paper: #ffffff;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
  background-color: var(--paper);
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

img {
  max-width: 100%;
  height: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* =========================================================
   1. 顶部纯紫色标题栏（保持顶部吸附，去除 EN 按钮）
   ========================================================= */
.sticky-brand {
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  background-color: var(--purple);
  padding-top: env(safe-area-inset-top);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
}

.sticky-brand-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 760px;
  min-height: 46px;
  margin: 0 auto;
  padding: 10px 16px;
}

.sticky-brand-title {
  color: #ffffff;
  font-size: 19px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.02em;
  text-align: center;
  white-space: nowrap;
}

/* =========================================================
   2. 首页三张科研方向图片（保持原样，无导航框与多余留白）
   ========================================================= */
.home-panels {
  width: 100%;
  background-color: var(--paper);
  border-bottom: 8px solid var(--band);
}

.home-panels-inner {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
}

.home-panels img {
  display: block;
  width: 100%;
  height: auto;
}

/* =========================================================
   主内容容器与章节样式
   ========================================================= */
.page {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  background-color: var(--paper);
}

.content-section {
  padding: 0 16px 24px;
  border-bottom: 8px solid var(--band);
  scroll-margin-top: 56px;
}

.content-section:last-of-type {
  border-bottom: 0;
  padding-bottom: 12px;
}

.section-title {
  margin: 0 -16px 16px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--purple);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

/* =========================================================
   3. 导师介绍
   ========================================================= */
.advisor-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.advisor-avatar {
  display: block;
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  background-color: var(--stage-bg);
}

.advisor-meta {
  min-width: 0;
  flex: 1;
}

.advisor-name-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-bottom: 5px;
}

.advisor-name {
  color: #222222;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
}

.advisor-title {
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.45;
}

.advisor-affiliation {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 14px;
  line-height: 1.55;
}

.advisor-bio p {
  margin: 0 0 11px;
  color: var(--ink-secondary);
  font-size: 15px;
  line-height: 1.8;
}

.advisor-bio p:last-child {
  margin-bottom: 0;
}

/* =========================================================
   4. 实验室介绍
   ========================================================= */
.lab-lead {
  margin: 0 0 16px;
  color: var(--ink-secondary);
  font-size: 15px;
  line-height: 1.8;
}

.sub-heading {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.direction-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line-soft);
}

.direction-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.direction-item:last-child {
  padding-bottom: 2px;
  border-bottom: 0;
}

.direction-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 4px;
  color: var(--purple);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
}

.direction-index {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--purple);
  opacity: 0.85;
}

.direction-desc {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 14px;
  line-height: 1.75;
}

/* =========================================================
   5. 实验室仪器设备与 V100 GPU 计算资源
   ========================================================= */
.equipment-intro {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.instrument {
  margin: 0 0 22px;
  padding: 0 0 22px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 64px;
}

.instrument:last-child {
  margin-bottom: 0;
  padding-bottom: 10px;
  border-bottom: 0;
}

.photo-panel {
  margin: 0;
}

.photo-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background-color: var(--stage-bg);
  border: 1px solid var(--line-soft);
  overflow: hidden;
  cursor: zoom-in;
}

.photo-stage img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
}

.photo-stage.server-stage {
  background-color: #f2f2f2;
  padding: 12px 10px;
}

.photo-stage.server-stage img {
  max-height: 280px;
}

.photo-caption {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.content-panel {
  padding-top: 14px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--purple);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.4;
}

.instrument-name {
  margin: 0;
  color: #222222;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
}

.model-line {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.meta-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 12px;
}

.meta-label {
  color: var(--muted);
  font-size: 12px;
}

.meta-tag {
  display: inline-block;
  padding: 2px 8px;
  color: var(--purple);
  background-color: var(--purple-tint);
  border: 1px solid var(--purple-border);
  border-radius: 2px;
  font-size: 12px;
  line-height: 1.5;
}

.detail-block {
  margin-top: 10px;
}

.detail-label {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.detail-block p {
  margin: 0;
  color: var(--ink-secondary);
  font-size: 14px;
  line-height: 1.78;
}

.detail-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-secondary);
  font-size: 14px;
  line-height: 1.78;
}

.detail-list li {
  margin-bottom: 3px;
}

.detail-list li:last-child {
  margin-bottom: 0;
}

.function-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin: 12px 0;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.function-row .detail-label {
  margin: 0;
  white-space: nowrap;
}

.function-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.function-item {
  display: inline-block;
  color: var(--ink-secondary);
  background-color: #f4f4f6;
  font-size: 13px;
  line-height: 1.45;
  padding: 2px 9px;
  border-radius: 2px;
}

/* =========================================================
   页脚与返回顶部
   ========================================================= */
.footer {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.backtop {
  position: fixed;
  right: 14px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 90;
  width: 38px;
  height: 38px;
  border: 1px solid #dddddd;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.94);
  color: var(--purple);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.backtop.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* =========================================================
   图片点击全屏预览层（轻量无依赖）
   ========================================================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(18px + env(safe-area-inset-top)) 16px calc(22px + env(safe-area-inset-bottom));
  background-color: rgba(0, 0, 0, 0.88);
}

.lightbox.is-open {
  display: flex;
}

.lightbox-close {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-img {
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
  background-color: #ffffff;
}

.lightbox-caption {
  margin-top: 12px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

/* =========================================================
   大屏响应式适配（手机优先，兼容平板与桌面浏览）
   ========================================================= */
@media (min-width: 410px) {
  .advisor-avatar {
    width: 78px;
    height: 78px;
  }
}

@media (min-width: 761px) {
  .content-section {
    padding: 0 24px 28px;
  }

  .section-title {
    margin: 0 -24px 18px;
    padding: 16px 24px 13px;
    font-size: 21px;
  }

  .instrument {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 20px;
    align-items: start;
    padding: 4px 0 24px;
  }

  .photo-stage img {
    max-height: 340px;
  }

  .content-panel {
    padding-top: 2px;
  }

  .footer {
    padding-left: 24px;
    padding-right: 24px;
  }

  .footer-inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}
