:root {
  color-scheme: light;
  --navy: #12324a;
  --ink: #182631;
  --muted: #5c6974;
  --blue: #1769aa;
  --orange: #e45d19;
  --orange-dark: #bb4510;
  --line: #d8e0e6;
  --soft: #f3f7fa;
  --white: #fff;
  font-family: "Source Sans 3", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: clamp(1rem, .965rem + .16vw, 1.1rem);
  line-height: 1.58;
  color: var(--ink);
  background: var(--white);
  scroll-behavior: smooth;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 5.25rem; }
body { min-width: 320px; margin: 0; border-top: 5px solid var(--navy); background: var(--white); }
main, footer, .site-nav { width: min(1120px, calc(100% - clamp(28px, 6vw, 80px))); margin-inline: auto; }
main { padding-top: clamp(2.5rem, 5.5vw, 4.75rem); }
a, button { color: var(--blue); }
a { text-decoration-thickness: .075em; text-underline-offset: .17em; }
a:not(:hover) { text-decoration-color: transparent; }
a:hover { color: var(--orange-dark); text-decoration-color: currentColor; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
:where(a, button, input, select):focus-visible { outline: 3px solid color-mix(in srgb, var(--orange) 70%, white); outline-offset: 3px; }
[hidden] { display: none !important; }
.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; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 100; padding: 8px 12px; color: var(--white); background: var(--navy); }
.skip-link:focus { top: 12px; }

.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.site-header.is-scrolled { box-shadow: 0 8px 22px rgba(18,50,74,.08); }
.site-nav { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.site-name { display: flex; align-items: baseline; gap: 9px; color: var(--navy); font-weight: 700; font-size: 1rem; letter-spacing: -.01em; text-decoration: none; }
.site-name small { color: var(--muted); font-size: .74rem; font-weight: 500; letter-spacing: .03em; }
.site-menu { display: flex; align-items: center; gap: clamp(15px, 2vw, 25px); }
.site-menu a, .site-menu button { position: relative; color: var(--muted); font-size: .88rem; font-weight: 600; text-decoration: none; }
.site-menu a { padding: 19px 0 17px; }
.site-menu a::after { content: ""; position: absolute; right: 0; bottom: 10px; left: 0; height: 2px; background: var(--orange); transform: scaleX(0); transform-origin: right; transition: transform 180ms ease; }
.site-menu a:hover, .site-menu a.is-active { color: var(--navy); }
.site-menu a:hover::after, .site-menu a.is-active::after { transform: scaleX(1); transform-origin: left; }
.site-menu button, .menu-toggle { border: 0; background: none; }
.site-menu button { padding: 10px 0; }
.menu-toggle { display: none; align-items: center; gap: 8px; padding: 8px 0; color: var(--navy); font-weight: 600; }

.profile { display: grid; grid-template-columns: minmax(0, 1fr) clamp(210px, 22vw, 270px); gap: clamp(42px, 7vw, 92px); align-items: center; }
.bio { min-width: 0; }
h1 { margin: 0 0 16px; color: var(--navy); font-size: clamp(2.45rem, 2.02rem + 1.55vw, 3.45rem); line-height: 1.04; font-weight: 700; letter-spacing: -.035em; }
h1 span { display: inline-block; margin-left: .22em; color: var(--muted); font-size: .57em; font-weight: 500; letter-spacing: 0; }
.role-line { margin: 0 0 22px; color: var(--orange-dark); font-size: 1.02rem; font-weight: 700; }
.motto { min-height: 1.45em; margin: -10px 0 18px; color: var(--muted); font-size: .95rem; font-style: italic; letter-spacing: .01em; }
.motto-caret { display: inline-block; width: 1px; height: 1em; margin-left: 3px; background: currentColor; vertical-align: -.12em; animation: motto-caret 800ms steps(1, end) infinite; }
@keyframes motto-caret { 50% { opacity: 0; } }
p { margin: 0 0 13px; }
.bio > p:not(.role-line) { max-width: 770px; }
.portrait { display: block; width: 100%; height: clamp(265px, 27vw, 330px); object-fit: cover; object-position: center 28%; border: 4px solid var(--white); border-radius: 14px; box-shadow: 14px 14px 0 #e7eef3, 0 0 0 1px var(--line); }
.links { display: flex; flex-wrap: wrap; gap: 7px 13px; margin-top: 17px; font-size: .95rem; font-weight: 600; }
.links a + a::before, .inline-links a + a::before { content: "/"; display: inline-block; margin-right: 13px; color: #99a4ac; }
.link-label-short { display: none; }

section { margin-top: clamp(3.4rem, 6.5vw, 5.2rem); scroll-margin-top: 5.25rem; }
h2 { display: flex; align-items: center; gap: 14px; margin: 0 0 25px; padding-bottom: 9px; color: var(--navy); border-bottom: 2px solid var(--line); font-size: clamp(1.65rem, 1.48rem + .55vw, 2rem); line-height: 1.2; font-weight: 700; letter-spacing: -.02em; }
h2::after { content: ""; width: 46px; height: 4px; margin-bottom: -13px; background: var(--orange); }
h3 { margin: 0 0 5px; color: var(--navy); font-size: 1.08rem; line-height: 1.38; font-weight: 700; }
h3 a { color: inherit; }

.news-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.news-list li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 20px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.news-list time { color: var(--orange-dark); font-size: .88rem; font-weight: 700; }
.date, .meta { color: var(--muted); font-size: .88rem; }

.publication { padding: 26px 0; border-bottom: 1px solid var(--line); }
.publication:first-child { border-top: 1px solid var(--line); }
.publication p, .project p { margin: 5px 0; }
.publication-featured { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(0, 1.45fr); gap: clamp(26px, 4vw, 48px); align-items: start; }
.research-media { position: relative; display: block; overflow: hidden; background: var(--soft); border: 1px solid var(--line); border-radius: 6px; color: var(--white); text-decoration: none; }
.research-media img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; transition: filter 200ms ease; }
.research-media::after { content: ""; position: absolute; inset: 38% 0 0; background: linear-gradient(transparent, rgba(13,33,47,.78)); pointer-events: none; }
.research-media:hover img { filter: saturate(1.12) contrast(1.03); }
.research-media-static { margin: 0; color: var(--muted); background: var(--white); }
.research-media-static::after { display: none; }
.research-media-static img { aspect-ratio: 1555 / 710; object-fit: contain; }
.research-media-static figcaption { padding: 7px 10px; border-top: 1px solid var(--line); background: var(--soft); font-size: .78rem; font-weight: 600; }
.media-action { position: absolute; right: 14px; bottom: 11px; z-index: 1; display: flex; align-items: center; gap: 6px; color: #fff; font-size: .82rem; font-weight: 700; }
.media-action svg { width: 17px; height: 17px; fill: currentColor; }
.authors { color: #41515d; }
.research-result { color: #41515d; font-size: .94rem; }
.inline-links, .more-link { font-size: .9rem; font-weight: 600; }
.inline-links { display: flex; flex-wrap: wrap; gap: 5px 13px; }

.timeline { border-top: 1px solid var(--line); }
.experience { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 22px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--line); }
.logo-link { width: 88px; height: 58px; display: flex; justify-content: center; align-items: center; padding: 4px; background: var(--white); border-radius: 4px; }
.experience img { display: block; width: auto; height: auto; max-width: 82px; max-height: 50px; object-fit: contain; }
.experience img.nstc-logo { max-width: 88px; }
.experience p { margin: 0; }
.experience .detail { margin-top: 4px; color: #41515d; }
.experience > .date { align-self: start; white-space: nowrap; text-align: right; }
.education { border-top: 1px solid var(--line); }
.service-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.service-list li { display: grid; grid-template-columns: 150px 24px minmax(0, 1fr); gap: 14px; align-items: stretch; min-height: 86px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.service-item > .date { padding-top: 4px; text-align: right; white-space: nowrap; }
.service-axis { position: relative; align-self: stretch; }
.service-axis::before { content: ""; position: absolute; top: -15px; bottom: -16px; left: 50%; width: 1px; background: var(--line); transform: translateX(-50%); }
.service-axis::after { content: ""; position: absolute; top: 9px; left: 50%; width: 9px; height: 9px; background: var(--orange); border: 3px solid var(--white); border-radius: 50%; box-shadow: 0 0 0 1px var(--orange); transform: translateX(-50%); }
.service-list li:first-child .service-axis::before { top: 13px; }
.service-list li:last-child .service-axis::before { bottom: calc(100% - 17px); }
.service-entry { min-width: 0; display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 15px; align-items: start; }
.service-mark { width: 58px; height: 56px; display: flex; align-items: center; justify-content: center; padding: 5px; background: var(--white); border: 1px solid var(--line); border-radius: 5px; }
.service-mark[href] { text-decoration: none; transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease; }
.service-mark[href]:hover { border-color: var(--orange); box-shadow: 0 4px 12px rgba(18,50,74,.1); transform: translateY(-1px); }
.service-mark img { display: block; width: auto; height: auto; max-width: 46px; max-height: 46px; object-fit: contain; }
.service-mark-wide img { max-width: 48px; }
.service-text-mark { color: var(--navy); background: var(--soft); font-size: .72rem; font-weight: 700; letter-spacing: .07em; }
.service-copy { min-width: 0; }
.service-copy strong { display: block; color: var(--navy); line-height: 1.35; }
.service-copy strong a { color: inherit; }
.service-copy span { display: block; margin-top: 3px; color: #41515d; font-size: .9rem; }

.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.project { min-width: 0; margin: 0; padding: 20px 21px; background: var(--soft); border-top: 4px solid var(--blue); border-radius: 0 0 6px 6px; }
.project:nth-child(3n) { border-top-color: var(--orange); }
.more-link { margin-top: 16px; }
.awards { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.awards li { padding: 12px 0 12px 24px; border-bottom: 1px solid var(--line); }
.awards li::before { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 13px 2px -20px; border-radius: 50%; background: var(--orange); }
.credentials { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.credentials li { display: grid; grid-template-columns: 108px 52px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 15px 0; border-bottom: 1px solid var(--line); }
.credentials time { color: var(--orange-dark); font-size: .88rem; font-weight: 700; }
.credential-mark { box-sizing: border-box; width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; margin: 0; overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: 5px; }
.credential-mark img { display: block; width: 28px; height: 28px; object-fit: contain; }
.credentials li > div strong, .credentials li > div span { display: block; }
.credentials li > div strong { color: var(--navy); line-height: 1.35; }
.credentials li > div span { margin-top: 2px; color: var(--muted); font-size: .9rem; }
.credentials a { font-size: .9rem; font-weight: 600; white-space: nowrap; }

footer { margin-top: clamp(3.5rem, 7vw, 5.5rem); padding: 24px 0 36px; border-top: 3px solid var(--navy); color: var(--muted); font-size: .84rem; }
footer p { margin: 10px 0 0; text-align: right; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px 18px; }

@media (max-width: 940px) {
  .publication-featured { grid-template-columns: minmax(250px, .8fr) minmax(0, 1.2fr); gap: 28px; }
}

@media (max-width: 860px) {
  html { scroll-padding-top: 4.75rem; }
  main, footer, .site-nav { width: calc(100% - 36px); }
  main { padding-top: 38px; }
  .menu-toggle { display: flex; }
  .site-nav { position: relative; min-height: 56px; }
  .site-menu { position: absolute; top: calc(100% + 1px); right: 0; left: 0; display: grid; gap: 0; padding: 8px 18px 15px; background: var(--white); border: 1px solid var(--line); border-top: 0; box-shadow: 0 16px 28px rgba(18,50,74,.12); }
  .js .site-menu:not(.is-open) { display: none; }
  .site-menu a, .site-menu button { padding: 9px 0; }
  .site-menu a::after { display: none; }
  .site-menu button { justify-self: start; }
  .profile { grid-template-columns: minmax(0, 1fr) 185px; gap: 34px; align-items: start; }
  .portrait { height: 235px; }
  .publication-featured { grid-template-columns: 1fr; gap: 21px; }
  .research-media { max-width: 620px; }
  .experience { grid-template-columns: 72px minmax(0, 1fr); gap: 16px; align-items: start; }
  .logo-link { width: 64px; height: 52px; grid-row: 1 / 3; }
  .experience img { max-width: 56px; max-height: 42px; }
  .experience img.nstc-logo { max-width: 60px; }
  .experience > .date { grid-column: 2; margin-top: 3px; text-align: left; }
}

@media (max-width: 600px) {
  main, footer, .site-nav { width: calc(100% - 28px); }
  main { padding-top: 30px; }
  .profile { grid-template-columns: minmax(0, 1fr) 108px; gap: 18px; }
  .site-name small { display: none; }
  .bio { display: contents; }
  .bio h1, .bio .role-line { grid-column: 1; }
  .bio h1 { align-self: end; margin-bottom: 0; font-size: clamp(2rem, 9vw, 2.55rem); }
  h1 span { display: block; margin: 6px 0 0; font-size: .57em; }
  .bio .role-line { align-self: start; margin: 8px 0 0; font-size: .87rem; line-height: 1.4; }
  .portrait { grid-column: 2; grid-row: 1 / 3; height: 142px; border-width: 3px; border-radius: 9px; box-shadow: 7px 7px 0 #e7eef3, 0 0 0 1px var(--line); }
  .bio > p:not(.role-line), .links { grid-column: 1 / -1; }
  .bio > p:not(.role-line):first-of-type { margin-top: 12px; }
  .links { flex-wrap: nowrap; justify-content: flex-start; gap: 0; width: 100%; font-size: 1rem; letter-spacing: 0; }
  .links a { white-space: nowrap; }
  .links a + a::before { margin-right: 6px; margin-left: 6px; }
  .link-label-full { display: none; }
  .link-label-short { display: inline; }
  section { margin-top: 3.4rem; }
  h2 { margin-bottom: 20px; font-size: 1.62rem; }
  .news-list li { grid-template-columns: 88px minmax(0, 1fr); gap: 11px; padding: 10px 0; }
  .publication { padding: 22px 0; }
  .experience { grid-template-columns: 70px minmax(0, 1fr); gap: 12px; padding: 16px 0; }
  .logo-link { width: 64px; height: 48px; padding: 3px; }
  .experience img { max-width: 58px; max-height: 40px; }
  .experience img.nstc-logo { max-width: 60px; }
  .service-list li { grid-template-columns: 20px minmax(0, 1fr); gap: 2px 12px; min-height: 0; padding: 16px 0; }
  .service-item > .date { grid-column: 2; grid-row: 1; padding: 0; text-align: left; }
  .service-axis { grid-column: 1; grid-row: 1 / 3; }
  .service-axis::before { top: -16px; bottom: -17px; }
  .service-axis::after { top: 5px; }
  .service-list li:first-child .service-axis::before { top: 9px; }
  .service-list li:last-child .service-axis::before { bottom: calc(100% - 13px); }
  .service-entry { grid-column: 2; grid-row: 2; grid-template-columns: 54px minmax(0, 1fr); gap: 11px; margin-top: 6px; }
  .service-mark { width: 50px; height: 48px; padding: 4px; }
  .service-mark img { max-width: 40px; max-height: 40px; }
  .service-mark-wide img { max-width: 42px; }
  .project-grid { grid-template-columns: 1fr; gap: 14px; }
  .project { padding: 18px; }
  .credentials li { grid-template-columns: 52px minmax(0, 1fr) auto; gap: 8px 12px; }
  .credentials time { grid-column: 1 / -1; }
  .footer-links { justify-content: flex-start; }
  footer p { text-align: left; }
}

@media (max-width: 380px) {
  .profile { grid-template-columns: minmax(0, 1fr) 96px; gap: 14px; }
  .portrait { height: 128px; }
  .news-list li { grid-template-columns: 1fr; gap: 1px; }
}

@media (max-width: 350px) {
  .links a + a::before { margin-right: 2.5px; margin-left: 2.5px; }
}

@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  .motto-caret { display: none; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
  .site-header, .skip-link { display: none; }
  main, footer { width: 100%; }
  main { padding-top: 0; }
  a { color: inherit; }
  .publication, .project, .experience { break-inside: avoid; }
}
