/* 童佳亮科研主页：疏朗学术排版 */

:root {
  --bg: #f4f0e8;
  --paper: #fffcf7;
  --ink: #1a2230;
  --muted: #667082;
  --line: #e4ddd1;
  --accent: #1b3a5a;
  --accent-soft: #e8eef5;
  --shadow: 0 16px 40px rgba(27, 58, 90, 0.08);
  --header-h: 68px;
  --max: 1120px;
  --serif: "Source Serif 4", "Noto Serif SC", "Songti SC", "SimSun", serif;
  --sans: "Source Sans 3", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 18px);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.8;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -40px;
  z-index: 100;
  background: var(--accent);
  color: #fff;
  padding: 8px 12px;
}

.skip-link:focus {
  top: 12px;
}

.wrap {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
}

/* ---------- 顶栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--header-h);
  background: rgba(255, 252, 247, 0.9);
  backdrop-filter: saturate(1.15) blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 28px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-name {
  font-family: var(--serif);
  font-size: 1.12rem;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.brand-en {
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 2px;
}

.nav a {
  color: #3d4656;
  text-decoration: none;
  padding: 8px 14px;
  font-size: 0.95rem;
  position: relative;
}

.nav a:hover,
.nav a.is-active {
  color: var(--accent);
}

.nav a.is-active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 4px;
  height: 1px;
  background: var(--accent);
}

/* ---------- 首页关于我 ---------- */
.about-section {
  padding: 72px 0 80px;
}

.about-hero {
  display: grid;
  grid-template-columns: minmax(240px, 360px) minmax(0, 1fr);
  gap: 64px;
  align-items: center;
}

.about-photo {
  margin: 0;
}

.about-photo img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  background: #fff;
  box-shadow: var(--shadow);
  cursor: zoom-in;
}

.about-copy {
  min-width: 0;
  max-width: 38rem;
}

.about-name {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4vw, 3rem);
  font-weight: 650;
  letter-spacing: 0.16em;
  line-height: 1.15;
}

.about-en {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.about-identity {
  margin: 22px 0 0;
  color: #3d4656;
  font-size: 1.02rem;
  line-height: 1.8;
}

.about-intro {
  margin: 24px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: #2c3442;
  font-size: 1.02rem;
  line-height: 2;
}

.about-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--accent);
  text-decoration: none;
  font: inherit;
  font-size: 0.88rem;
  padding: 8px 14px;
  cursor: pointer;
}

.contact-chip svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.contact-chip:hover {
  border-color: #c5d3e2;
  background: var(--accent-soft);
}

.copy-status {
  min-height: 1.3em;
  margin: 8px 0 0;
  color: var(--accent);
  font-size: 0.82rem;
}

/* ---------- 通用区块 ---------- */
section {
  padding: 72px 0;
}

.section-band {
  background: var(--paper);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.section-label {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.74rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h2 {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-size: 1.85rem;
  font-weight: 650;
  letter-spacing: 0.06em;
}

.lead {
  margin: 0;
  max-width: 42rem;
  font-size: 1.02rem;
  color: #3d4656;
  line-height: 1.9;
}

/* ---------- 研究 Tab 与项目 ---------- */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 28px 0 32px;
  border-bottom: 1px solid var(--line);
}

.tabs button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.95rem;
  padding: 10px 16px;
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.tabs button:hover {
  color: var(--ink);
}

.tabs button[aria-selected="true"] {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.project-list {
  display: grid;
  gap: 28px;
}

.project-list[hidden] {
  display: none !important;
}

.project {
  background: var(--paper);
  border: 1px solid var(--line);
  overflow: hidden;
}

.project[hidden] {
  display: none !important;
}

.project-head {
  padding: 24px 28px 8px;
}

.project-kicker {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
}

.project h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.28rem;
  font-weight: 650;
  line-height: 1.45;
}

.project-figure {
  margin: 10px 28px 0;
}

.project-figure img {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  cursor: zoom-in;
}

.project-body {
  padding: 16px 28px 28px;
}

.project-body p {
  margin: 0 0 0.9em;
}

.project-body p:last-child {
  margin-bottom: 0;
}

.outcome {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  color: #24364a;
  font-size: 0.92rem;
}

.project-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.project--card {
  display: grid;
  grid-template-rows: auto 1fr;
}

.project--card img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  background: #fff;
  cursor: zoom-in;
  border-bottom: 1px solid var(--line);
}

.project--card .project-body {
  padding: 16px 20px 22px;
}

.project--card h3 {
  font-size: 1.08rem;
}

.related-block[hidden] {
  display: none !important;
}

.group-title {
  margin: 48px 0 18px;
  font-family: var(--serif);
  font-size: 1.2rem;
  letter-spacing: 0.04em;
}

/* ---------- 成果 ---------- */
.outcome-list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.outcome-list li {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.outcome-list .year {
  color: var(--accent);
  font-family: var(--serif);
}

/* ---------- 五种时间 ---------- */
.life-lead {
  margin-bottom: 28px;
}

.time-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
}

.time-card {
  background: var(--bg);
  border: 1px solid var(--line);
  overflow: hidden;
}

.time-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  cursor: zoom-in;
}

.time-card strong,
.time-card span,
.time-card p {
  padding-left: 14px;
  padding-right: 14px;
}

.time-card strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.02rem;
  margin: 14px 0 6px;
}

.time-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
  margin-bottom: 8px;
}

.time-card p {
  margin: 0 0 16px;
  font-size: 0.88rem;
  color: #3d4656;
  line-height: 1.7;
}

/* ---------- 联系 ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 48px;
  align-items: start;
}

.contact-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.form {
  display: grid;
  gap: 14px;
}

.form label {
  display: grid;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--muted);
}

.form input,
.form textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 11px 12px;
}

.form textarea {
  min-height: 140px;
  resize: vertical;
}

.form button {
  justify-self: start;
  border: 0;
  background: var(--accent);
  color: #f7f3ea;
  font: inherit;
  padding: 10px 20px;
  cursor: pointer;
}

.form button:hover {
  background: #142c45;
}

.form-status {
  min-height: 1.4em;
  font-size: 0.88rem;
  color: var(--accent);
}

/* ---------- 页脚 ---------- */
.site-footer {
  padding: 24px 0 36px;
  color: var(--muted);
  font-size: 0.86rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 24px;
}

.site-footer a {
  color: inherit;
}

/* ---------- 灯箱 ---------- */
.lightbox {
  border: 0;
  padding: 0;
  max-width: min(1200px, 96vw);
  background: transparent;
}

.lightbox::backdrop {
  background: rgba(16, 24, 36, 0.72);
}

.lightbox img {
  max-height: 88vh;
  background: #fff;
}

.lightbox-close {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 0;
  background: #fff;
  color: var(--ink);
  padding: 6px 10px;
  cursor: pointer;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .time-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .about-hero,
  .project-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .about-hero {
    gap: 32px;
  }

  .about-photo {
    max-width: 360px;
  }

  .about-section {
    padding-top: 44px;
  }
}

@media (max-width: 720px) {
  .wrap {
    width: min(var(--max), calc(100% - 28px));
  }

  .nav {
    width: 100%;
    justify-content: flex-start;
  }

  .time-grid,
  .outcome-list li {
    grid-template-columns: 1fr;
  }

  .project-figure {
    margin-left: 16px;
    margin-right: 16px;
  }

  .project-head,
  .project-body {
    padding-left: 16px;
    padding-right: 16px;
  }

  .about-section,
  section {
    padding: 48px 0;
  }
}
