/* ============ Base ============ */
:root {
  --accent: #0e7490;        /* teal — medical / tech */
  --accent-dark: #155e75;
  --accent-soft: #ecfeff;
  --ink: #1f2937;
  --ink-soft: #4b5563;
  --muted: #6b7280;
  --line: #e5e7eb;
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --serif: Georgia, "Times New Roman", "Songti SC", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2.5rem 2rem 3rem;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 3.5rem;
  align-items: start;
}

/* ============ Sidebar ============ */
.sidebar { position: sticky; top: 2.5rem; }

.avatar-wrap { margin-bottom: 1.1rem; }
.avatar {
  width: 170px;
  height: 170px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-soft);
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.name {
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: .2px;
  color: #111827;
}
.cn-name {
  margin: .15rem 0 .6rem;
  color: var(--muted);
  font-size: 1rem;
  letter-spacing: .35em;
}

/* animated ECG divider */
.ecg-line { margin: 0 0 1rem; height: 34px; }
.ecg-line svg { width: 190px; height: 34px; overflow: visible; }
.ecg-line polyline {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 560;
  stroke-dashoffset: 560;
  animation: ecg 5s linear infinite;
}
@keyframes ecg {
  0%   { stroke-dashoffset: 560; }
  70%  { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ecg-line polyline { animation: none; stroke-dashoffset: 0; }
  html { scroll-behavior: auto; }
}

.slots p { margin: .3rem 0; font-size: .875rem; color: var(--ink-soft); }

.nav { display: flex; flex-direction: column; gap: .1rem; margin: 1.4rem 0; }
.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: .95rem;
  padding: .3rem .7rem;
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0;
  transition: all .15s ease;
}
.nav a:hover { color: var(--accent); background: var(--accent-soft); }
.nav a.active {
  color: var(--accent-dark);
  border-left-color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.links { margin-top: 1.2rem; }
.btn {
  display: inline-block;
  padding: .25rem .8rem;
  font-size: .82rem;
  border: 1px solid #9ca3af;
  border-radius: 5px;
  color: var(--ink-soft);
  text-decoration: none;
  transition: all .15s ease;
  background: transparent;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-solid {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  padding: .4rem 1rem;
  font-size: .9rem;
}
.btn-solid:hover { background: var(--accent-dark); color: #fff; }

.icon-links { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: .8rem; }
.icon-links a {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .85rem;
  color: var(--muted);
  text-decoration: none;
  word-break: break-all;
}
.icon-links a:hover { color: var(--accent); }
.icon-links svg { width: 16px; height: 16px; flex: none; }

/* ============ Content ============ */
.content section { margin-bottom: 2.6rem; }
.content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 1rem;
  padding-bottom: .4rem;
  border-bottom: 2px solid var(--line);
  position: relative;
}
.content h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 46px;
  height: 2px;
  background: var(--accent);
}
.content p { margin: .65rem 0; color: var(--ink); }
.sec-note { font-size: .85rem; color: var(--muted); }

/* research-interest chips */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.chips span {
  font-size: .8rem;
  padding: .25rem .75rem;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  color: var(--ink-soft);
}

/* news & awards lists */
.news-list, .awards { list-style: none; margin: 0; padding: 0; }
.news-list li, .awards li {
  padding: .35rem 0 .35rem 6.5rem;
  position: relative;
  border-bottom: 1px dashed var(--line);
}
.news-list li:last-child, .awards li:last-child { border-bottom: none; }
.date {
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--mono);
  font-size: .82rem;
  white-space: nowrap;
}
.awards .date { color: var(--muted); }

/* publications */
.pubs { list-style: none; margin: 0; padding: 0; counter-reset: pub; }
.pubs li {
  counter-increment: pub;
  margin-bottom: 1.4rem;
  padding-left: 2.2rem;
  position: relative;
}
.pubs li::before {
  content: "[" counter(pub) "]";
  position: absolute;
  left: 0;
  top: .1rem;
  font-size: .9rem;
  color: var(--muted);
}
.pub-title { font-weight: 600; color: #111827; }
.pub-authors { font-size: .92rem; color: var(--ink-soft); }
.pub-venue { font-size: .92rem; color: var(--ink-soft); }
.pub-links { margin-top: .35rem; display: flex; flex-wrap: wrap; gap: .45rem; }

/* timeline (experience / education / projects) */
.timeline { display: flex; flex-direction: column; }
.t-item {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 1.2rem;
  padding: .55rem 0;
  border-bottom: 1px dashed var(--line);
}
.t-item:last-child { border-bottom: none; }
.t-date { font-family: var(--mono); font-size: .82rem; color: var(--muted); padding-top: .15rem; }
.t-role { font-weight: 600; }
.t-org { color: var(--accent-dark); font-size: .92rem; margin-bottom: .15rem; }
.t-body p { margin: .25rem 0 0; font-size: .93rem; color: var(--ink-soft); }

.footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 2px solid var(--line);
  color: var(--muted);
  font-size: .85rem;
}
.footer a { color: var(--accent); text-decoration: none; }

/* ============ Responsive ============ */
@media (max-width: 900px) {
  .page { grid-template-columns: 1fr; gap: 1.5rem; padding: 1.5rem 1.2rem 2rem; }
  .sidebar { position: static; text-align: center; }
  .avatar-wrap { display: inline-block; }
  .ecg-line svg { margin: 0 auto; display: block; }
  .slots p { margin: .2rem 2rem; }
  .nav { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: .3rem; }
  .nav a { border-left: none; border-radius: 6px; padding: .25rem .6rem; }
  .icon-links { justify-content: center; }
  .t-item { grid-template-columns: 1fr; gap: .2rem; }
  .news-list li, .awards li { padding-left: 0; padding-top: 1.5rem; }
  .date { position: static; display: block; }
}
