:root {
  --bg: #ffffff;
  --text: #222222;
  --muted: #666666;
  --link: #1a5fb4;
  --rule: #e5e5e5;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 -apple-system, "Segoe UI", "Helvetica Neue", Arial,
        "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}

main {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 16px 32px;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
img, video { max-width: 100%; }

/* Header */
.intro {
  display: flex;
  flex-direction: row-reverse;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 40px;
}
.avatar {
  width: 120px;
  height: 120px;
  flex: none;
  border-radius: 12px;
  object-fit: cover;
}
.intro h1 { margin: 0; font-size: 28px; line-height: 1.3; font-weight: 600; }
.name-local { color: var(--muted); font-weight: 400; font-size: 22px; }
.bio { margin: 4px 0 8px; color: var(--muted); }
.links .sep { color: var(--muted); }

/* One-line research interests between two rules */
.interests {
  margin: -16px 0 32px;
  padding: 10px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

/* Sections (headings in the markdown files) */
section { margin-bottom: 40px; }
section h1, section h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rule);
}
section h1:not(:first-child), section h2:not(:first-child) { margin-top: 32px; }
section ul { padding-left: 20px; }
section li { margin-bottom: 6px; }

/* Fixed-height list that scrolls when long (front matter `scroll: true`) */
.scroll ul {
  max-height: 260px;
  overflow-y: auto;
  margin: 0;
  padding: 10px 12px 4px 32px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  scrollbar-width: thin;
}

/* Dated list (news): `- <time>2026.08</time> text` puts the date in a left column */
ul:has(> li > time:first-child) { list-style: none; padding-left: 0; }
.scroll ul:has(> li > time:first-child) { padding: 4px 12px; }
li:has(> time:first-child) {
  position: relative;
  margin: 0;
  padding: 8px 0 8px 76px;
  border-bottom: 1px solid var(--rule);
}
li:has(> time:first-child):last-child { border-bottom: none; }
li > time:first-child {
  position: absolute;
  left: 0;
  top: 8px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Timeline (experience): logo | org + role, date + place on the right */
.tl { display: flex; gap: 16px; margin-bottom: 20px; }
.tl-logo { width: 48px; height: 48px; flex: none; object-fit: contain; }
.tl-text { flex: 1; min-width: 0; }
.tl-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  column-gap: 12px;
  margin: 0;
}
.tl-meta { color: var(--muted); font-size: 15px; }
.tl .summary { margin-top: 4px; }
.tl .summary ul { margin: 0; padding-left: 18px; }
.tl .summary li { margin: 0; }

/* Publications */
.pub {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  margin-bottom: 28px;
}
.pub.no-media { grid-template-columns: 1fr; }
.pub-media { position: relative; align-self: start; display: block; }
.pub-media img, .pub-media video {
  display: block;
  width: 100%;
  border-radius: 4px;
}
.pub-media img + video {
  position: absolute;
  inset: 0;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.2s;
}
.pub-media:hover video.hover { opacity: 1; }
/* Second image (`hover:` field) shown on mouse-over, fitted inside the thumbnail box */
.pub-media img.hover-img {
  position: absolute;
  inset: 0;
  height: 100%;
  object-fit: contain;
  background: var(--bg);
  opacity: 0;
  transition: opacity 0.2s;
}
.pub-media:hover img.hover-img { opacity: 1; }
@media (hover: none) { .pub-media video.hover { opacity: 1; } }

.pub h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; line-height: 1.4; }
.pub p { margin: 0 0 4px; }
.authors { font-size: 15px; }
.pub-links { font-size: 15px; }
.venue { font-weight: 600; margin-right: 4px; }
/* Award inside the venue (**Runner-Up**) shown as a small badge */
.venue strong {
  font-weight: 500;
  font-size: 13px;
  color: var(--link);
  background: #e8f0fb;
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 2px;
  white-space: nowrap;
}
.note { color: var(--muted); font-size: 14px; }
.stars { color: var(--muted); margin-left: 2px; }
.summary { font-size: 15px; color: var(--muted); }
.summary p { margin: 0; }

footer {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 560px) {
  main { padding-top: 32px; }
  .intro { flex-direction: column; text-align: center; gap: 16px; }
  .pub { grid-template-columns: 1fr; gap: 12px; }
}
