:root {
  --bg: #dcecf7;
  --surface: #f8fcff;
  --surface-2: #cfe4f3;
  --text: #0a2740;
  --muted: #4b6d86;
  --line: #b8d4e6;
  --primary: #0067a5;
  --primary-2: #003f73;
  --accent: #2f8fc7;
  --navy: #002f57;
  --shadow: 0 18px 50px rgba(0, 61, 105, .16);
  --radius: 22px;
  --max: 1180px;
  --header: 78px
}

html[data-theme="dark"] {
  --bg: #061d31;
  --surface: #0b2b45;
  --surface-2: #103a5b;
  --text: #edf7ff;
  --muted: #adc9dc;
  --line: #285879;
  --primary: #54b6ee;
  --primary-2: #8bcdf2;
  --accent: #6bbce9;
  --navy: #d9efff;
  --shadow: 0 18px 55px rgba(0, 0, 0, .32)
}

* {
  box-sizing: border-box
}

html {
  scroll-behavior: smooth
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, -apple-system, sans-serif;
  line-height: 1.75
}

a {
  color: inherit;
  text-decoration: none
}

img {
  max-width: 100%;
  display: block
}

button,
input,
select {
  font: inherit
}

.container {
  width: min(calc(100% - 40px), var(--max));
  margin-inline: auto
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  background: var(--surface);
  padding: 10px 14px;
  z-index: 9999;
  border-radius: 10px
}

.skip-link:focus {
  top: 12px
}

.site-header {
  height: var(--header);
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent)
}

.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--primary-2), var(--accent));
  box-shadow: 0 8px 24px rgba(0, 108, 168, .28);
  color: white;
  font-weight: 800
}

.brand-mark span {
  font-size: 22px
}

.brand strong {
  display: block;
  line-height: 1.1;
  font-size: 19px;
  letter-spacing: .02em
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  margin-top: 3px
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 4px
}

.nav-link {
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650
}

.nav-link:hover,
.nav-link.active {
  background: var(--surface-2);
  color: var(--primary-2)
}

.header-actions {
  display: flex;
  gap: 8px
}

.icon-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 13px;
  display: grid;
  place-items: center;
  cursor: pointer
}

.icon-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow)
}

.mobile-menu-btn,
.mobile-nav {
  display: none
}

.icon {
  vertical-align: -.16em
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 82px 0 72px;
  background: radial-gradient(circle at 15% 20%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 36%), radial-gradient(circle at 85% 0%, color-mix(in srgb, var(--primary-2) 18%, transparent), transparent 36%)
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 56px;
  align-items: center
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--line));
  background: color-mix(in srgb, var(--surface) 75%, transparent);
  border-radius: 999px;
  color: var(--primary-2);
  font-size: 13px;
  font-weight: 750;
  letter-spacing: .04em
}

.hero h1 {
  font-size: clamp(42px, 6.2vw, 76px);
  line-height: 1.05;
  margin: 22px 0 22px;
  letter-spacing: -.045em
}

.gradient-text {
  background: linear-gradient(120deg, var(--primary-2), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent
}

.lead {
  font-size: 18px;
  color: var(--muted);
  max-width: 680px
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  font-weight: 750;
  transition: .2s ease
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-2), var(--primary));
  color: white;
  border-color: transparent;
  box-shadow: 0 14px 30px rgba(0, 63, 107, .22)
}

.btn-secondary {
  background: var(--surface)
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow)
}

.hero-media {
  position: relative
}

.hero-photo {
  border-radius: 30px;
  aspect-ratio: 1.22;
  object-fit: cover;
  box-shadow: 0 35px 80px rgba(8, 47, 73, .24);
  border: 7px solid color-mix(in srgb, var(--surface) 78%, transparent)
}

.floating-card {
  position: absolute;
  left: -28px;
  bottom: -26px;
  padding: 16px 18px;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  border-radius: 18px
}

.floating-card strong {
  display: block;
  font-size: 26px;
  color: var(--primary-2);
  line-height: 1.1
}

.floating-card span {
  font-size: 12px;
  color: var(--muted)
}

.section {
  padding: 78px 0
}

.section.compact {
  padding: 52px 0
}

.section-alt {
  background: var(--surface-2)
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px
}

.section-head h2,
.page-title {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.15;
  margin: 0;
  letter-spacing: -.03em
}

.section-head p {
  max-width: 620px;
  color: var(--muted);
  margin: 0
}

.kicker {
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 10px
}

.grid {
  display: grid;
  gap: 20px
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr)
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr)
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  box-shadow: 0 8px 28px rgba(8, 47, 73, .04)
}

.card:hover {
  box-shadow: var(--shadow)
}

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--primary-2);
  margin-bottom: 18px
}

.card h3 {
  margin: 0 0 8px;
  font-size: 19px
}

.card p {
  margin: 0;
  color: var(--muted)
}

.stat-card strong {
  font-size: 36px;
  line-height: 1;
  color: var(--primary-2);
  display: block
}

.stat-card span {
  color: var(--muted);
  font-size: 13px
}

.research-card {
  min-height: 210px;
  display: flex;
  flex-direction: column
}

.research-card .number {
  margin-top: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em
}

.feature-panel {
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  gap: 44px;
  align-items: center
}

.feature-panel img {
  border-radius: 28px;
  background: white;
  box-shadow: var(--shadow)
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px
}

.tag {
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--primary-2);
  font-size: 13px;
  font-weight: 700
}

.page-hero {
  padding: 64px 0 42px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 85%, transparent), transparent)
}

.breadcrumbs {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 18px
}

.page-subtitle {
  font-size: 17px;
  color: var(--muted);
  max-width: 760px
}

.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 26px 0
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 260px
}

.search-box .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted)
}

.search-box input,
.filter-select {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 14px;
  padding: 0 14px
}

.search-box input {
  padding-left: 44px
}

.filter-select {
  width: auto;
  min-width: 180px
}

.list-stack {
  display: grid;
  gap: 12px
}

.list-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 20px
}

.list-index {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--primary-2);
  font-weight: 800;
  font-size: 13px
}

.list-item h3 {
  font-size: 16px;
  margin: 0 0 5px;
  line-height: 1.45
}

.list-meta {
  color: var(--muted);
  font-size: 13px
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--primary-2);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap
}

.profile-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 28px
}

.profile-card {
  position: sticky;
  top: calc(var(--header) + 24px);
  height: max-content
}

.profile-avatar {
  height: 190px;
  border-radius: 20px;
  background: linear-gradient(145deg, var(--primary-2), var(--accent));
  display: grid;
  place-items: center;
  color: white;
  margin-bottom: 20px;
  overflow: hidden;
  position: relative
}

.profile-avatar::after {
  content: 'SP';
  font-size: 70px;
  font-weight: 850;
  letter-spacing: -.06em;
  opacity: .96
}

.contact-list {
  display: grid;
  gap: 12px
}

.contact-row {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  color: var(--muted);
  font-size: 14px
}

.contact-row .icon {
  color: var(--primary);
  flex: 0 0 auto;
  margin-top: 2px
}

.timeline {
  position: relative;
  padding-left: 28px
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 7px;
  bottom: 7px;
  width: 2px;
  background: var(--line)
}

.timeline-item {
  position: relative;
  margin-bottom: 22px
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -25px;
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 5px var(--surface-2)
}

.timeline-item h3 {
  margin: 0 0 3px;
  font-size: 16px
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
  font-size: 14px
}

.accordion {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  overflow: hidden
}

.accordion summary {
  cursor: pointer;
  padding: 18px 20px;
  font-weight: 800;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center
}

.accordion summary::-webkit-details-marker {
  display: none
}

.accordion-content {
  padding: 0 20px 20px
}

.plain-list {
  margin: 0;
  padding-left: 22px
}

.plain-list li {
  margin: 9px 0
}

.members-current {
  display: flex;
  flex-wrap: wrap;
  gap: 10px
}

.member-chip {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 9px 13px;
  border-radius: 999px;
  font-weight: 700
}

.gallery {
  columns: 3 280px;
  column-gap: 18px
}

.gallery figure {
  break-inside: avoid;
  margin: 0 0 18px;
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line)
}

.gallery img {
  width: 100%;
  transition: .35s
}

.gallery figure:hover img {
  transform: scale(1.025)
}

.gallery figcaption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  background: rgba(3, 25, 38, .78);
  color: white;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  backdrop-filter: blur(8px)
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px
}

.project-card h3 {
  margin: 0 0 9px;
  font-size: 17px
}

.project-card .students {
  color: var(--primary-2);
  font-size: 13px;
  font-weight: 750;
  margin-bottom: 10px
}

.award-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 14px
}

.award-list li {
  margin: 4px 0
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px
}

.resource-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px
}

.resource-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-2px)
}

.resource-card .card-icon {
  margin: 0;
  flex: 0 0 auto
}

.resource-card strong {
  display: block
}

.resource-card small {
  color: var(--muted)
}

.notice {
  display: flex;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--line));
  color: var(--muted)
}

.notice strong {
  color: var(--text)
}

.empty-state {
  display: none;
  text-align: center;
  padding: 42px;
  color: var(--muted)
}

.site-footer {
  background: #032b45;
  color: #dceff7;
  margin-top: 70px;
  padding: 60px 0 24px
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr 1fr;
  gap: 50px
}

.footer-brand {
  color: white
}

.footer-brand small,
.site-footer p {
  color: #9cc0cf
}

.site-footer h3 {
  margin-top: 0;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .09em
}

.footer-links {
  display: grid;
  gap: 8px
}

.site-footer a:hover {
  color: #5eead4
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, .12);
  margin-top: 42px;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: #8fb5c3;
  font-size: 12px
}

.footer-bottom a {
  display: flex;
  align-items: center;
  gap: 6px
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: .6s ease
}

.reveal.visible {
  opacity: 1;
  transform: none
}

@media(max-width:980px) {
  .desktop-nav {
    display: none
  }

  .mobile-menu-btn {
    display: grid
  }

  .mobile-nav {
    display: none;
    position: absolute;
    top: var(--header);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 12px 20px 20px;
    box-shadow: var(--shadow)
  }

  .mobile-nav.open {
    display: grid
  }

  .hero-grid,
  .feature-panel,
  .profile-grid {
    grid-template-columns: 1fr
  }

  .hero-media {
    max-width: 760px
  }

  .profile-card {
    position: static
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr)
  }

  .grid-3,
  .resource-grid {
    grid-template-columns: repeat(2, 1fr)
  }
}

@media(max-width:680px) {
  :root {
    --header: 68px
  }

  .container {
    width: min(calc(100% - 24px), var(--max))
  }

  .brand small {
    display: none
  }

  .hero {
    padding: 54px 0 48px
  }

  .hero-grid {
    gap: 34px
  }

  .hero h1 {
    font-size: 44px
  }

  .floating-card {
    left: 10px;
    bottom: -20px
  }

  .section {
    padding: 58px 0
  }

  .section-head {
    display: block
  }

  .section-head p {
    margin-top: 10px
  }

  .grid-3,
  .grid-4,
  .resource-grid,
  .project-grid {
    grid-template-columns: 1fr
  }

  .list-item {
    grid-template-columns: auto 1fr
  }

  .list-item .pill {
    grid-column: 2
  }

  .toolbar {
    display: grid
  }

  .filter-select {
    width: 100%
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px
  }

  .footer-bottom {
    display: block
  }

  .gallery {
    columns: 1
  }

  .page-hero {
    padding: 44px 0 30px
  }

  .profile-grid {
    gap: 18px
  }
}

@media(prefers-reduced-motion:reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important
  }

  .reveal {
    opacity: 1;
    transform: none
  }
}

/* NTOU-inspired ocean identity */
.site-header::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-2), var(--primary), var(--accent), var(--seafoam))
}

.brand-mark {
  position: relative;
  overflow: hidden;
  background: linear-gradient(145deg, var(--primary-2), var(--primary) 58%, var(--accent))
}

.brand-mark::after {
  content: "";
  position: absolute;
  width: 56px;
  height: 18px;
  left: -7px;
  bottom: -8px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .52);
  transform: rotate(-7deg)
}

.lang-switch {
  height: 42px;
  min-width: 48px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--primary-2);
  border-radius: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .06em;
  transition: .2s ease
}

.lang-switch:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  border-color: color-mix(in srgb, var(--primary) 55%, var(--line))
}

.hero::before {
  content: "";
  position: absolute;
  inset: auto -7% -125px;
  height: 220px;
  border-radius: 50% 50% 0 0/35% 35% 0 0;
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  transform: rotate(-2deg);
  pointer-events: none
}

.hero::after {
  content: "";
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: -145px;
  height: 220px;
  border-radius: 50% 50% 0 0/32% 32% 0 0;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  transform: rotate(2deg);
  pointer-events: none
}

.hero-grid {
  position: relative;
  z-index: 1
}

.research-card {
  border-top: 3px solid color-mix(in srgb, var(--primary) 60%, var(--accent));
  min-height: 190px
}

.research-card:nth-child(3n+2) {
  border-top-color: var(--accent)
}

.research-card:nth-child(3n) {
  border-top-color: var(--seafoam)
}

.page-hero {
  position: relative;
  overflow: hidden
}

.page-hero::after {
  content: "";
  position: absolute;
  width: 420px;
  height: 420px;
  right: -160px;
  top: -280px;
  border: 70px solid color-mix(in srgb, var(--accent) 7%, transparent);
  border-radius: 50%;
  pointer-events: none
}

.bilingual-note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted)
}

@media(max-width:680px) {
  .lang-switch {
    height: 40px;
    min-width: 44px;
    padding: 0 9px
  }

  .header-actions {
    gap: 6px
  }
}


/* Unified NTOU blue theme */
:root {
  --bg: #dcecf8;
  --surface: #f8fcff;
  --surface-2: #cfe4f3;
  --text: #0a2942;
  --muted: #47677d;
  --line: #b7d1e3;
  --primary: #0878b5;
  --primary-2: #004b7a;
  --accent: #26a4d1;
  --seafoam: #6bc4df;
  --navy: #052f50;
  --shadow: 0 18px 50px rgba(0, 59, 101, .14)
}

html[data-theme="dark"] {
  --bg: #031d31;
  --surface: #082b46;
  --surface-2: #0c3a5c;
  --text: #eef8ff;
  --muted: #b0cde0;
  --line: #245779;
  --primary: #50b8e5;
  --primary-2: #8dd7f5;
  --accent: #4fc3ec;
  --seafoam: #7bd4ec;
  --navy: #e8f7ff;
  --shadow: 0 18px 55px rgba(0, 0, 0, .34)
}

body {
  background:
    radial-gradient(circle at 8% 5%, rgba(255, 255, 255, .60), transparent 28%),
    linear-gradient(145deg, #d5e9f6 0%, #eaf5fb 48%, #c8e0f1 100%);
  background-attachment: fixed
}

html[data-theme="dark"] body {
  background:
    radial-gradient(circle at 8% 5%, rgba(48, 139, 191, .16), transparent 30%),
    linear-gradient(145deg, #021725 0%, #062a43 52%, #031d31 100%);
  background-attachment: fixed
}

.site-header {
  background: color-mix(in srgb, #dcecf8 91%, transparent);
  border-bottom-color: rgba(0, 75, 122, .18)
}

html[data-theme="dark"] .site-header {
  background: color-mix(in srgb, #031d31 90%, transparent)
}

.hero {
  color: #fff;
  background:
    radial-gradient(circle at 14% 18%, rgba(87, 195, 235, .28), transparent 35%),
    radial-gradient(circle at 88% 4%, rgba(255, 255, 255, .13), transparent 32%),
    linear-gradient(135deg, #003b63 0%, #005b91 52%, #147eac 100%)
}

.hero .lead {
  color: rgba(238, 248, 255, .88)
}

.hero .eyebrow {
  color: #e3f7ff;
  border-color: rgba(255, 255, 255, .34);
  background: rgba(255, 255, 255, .10)
}

.hero .gradient-text {
  background: linear-gradient(120deg, #ffffff, #9fe3fb);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent
}

.hero .btn-secondary {
  color: #fff;
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .42)
}

.hero .btn-secondary:hover {
  background: rgba(255, 255, 255, .20)
}

.hero-photo {
  border-color: rgba(255, 255, 255, .82);
  box-shadow: 0 35px 80px rgba(0, 25, 48, .38)
}

.hero::before {
  background: rgba(112, 199, 232, .12)
}

.hero::after {
  background: rgba(255, 255, 255, .07)
}

.section-alt {
  background: rgba(195, 222, 240, .76)
}

html[data-theme="dark"] .section-alt {
  background: rgba(8, 47, 76, .78)
}

.page-hero {
  color: #fff;
  background:
    radial-gradient(circle at 86% 10%, rgba(117, 210, 241, .20), transparent 30%),
    linear-gradient(135deg, #00436f 0%, #0878ad 100%)
}

.page-hero .page-subtitle,
.page-hero .breadcrumbs,
.page-hero .bilingual-note {
  color: rgba(235, 247, 255, .84)
}

.page-hero .breadcrumbs a:hover {
  color: #fff
}

.page-hero .kicker {
  color: #bdeaff
}

.page-hero .gradient-text {
  background: linear-gradient(120deg, #fff, #aee7fb);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent
}

.card,
.list-item,
.accordion,
.project-card,
.resource-card,
.member-chip,
.search-box input,
.filter-select {
  box-shadow: 0 8px 28px rgba(0, 66, 108, .06)
}

.site-footer {
  background: linear-gradient(135deg, #022c4a, #064d77)
}

/* Complete NTOU-blue theme overrides */
body {
  background: linear-gradient(180deg, #d4e8f5 0%, var(--bg) 36%, #e7f2f9 100%);
  background-attachment: fixed
}

.site-header {
  background: color-mix(in srgb, #e8f4fb 91%, transparent);
  border-bottom-color: #aecfe3
}

.brand-mark {
  background: linear-gradient(145deg, #003f73, #1481be);
  box-shadow: 0 8px 24px rgba(0, 70, 120, .3)
}

.hero {
  background: linear-gradient(135deg, #00365f 0%, #005b96 52%, #147fb9 100%);
  color: #fff
}

.hero::after {
  content: '';
  position: absolute;
  inset: auto -12% -55% 30%;
  height: 75%;
  background: radial-gradient(ellipse, rgba(255, 255, 255, .12), transparent 68%);
  pointer-events: none
}

.hero .container {
  position: relative;
  z-index: 1
}

.hero .lead {
  color: #dbeef9
}

.hero .eyebrow {
  color: #fff;
  border-color: rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .1)
}

.hero .gradient-text {
  background: none;
  color: #fff;
  -webkit-text-fill-color: initial
}

.hero .btn-secondary {
  background: rgba(255, 255, 255, .12);
  border-color: rgba(255, 255, 255, .35);
  color: #fff
}

.hero-photo {
  border-color: rgba(255, 255, 255, .72);
  box-shadow: 0 35px 80px rgba(0, 24, 48, .34)
}

.page-hero {
  background: linear-gradient(135deg, #003a68, #086ba5);
  color: #fff
}

.page-hero .page-subtitle,
.page-hero .breadcrumbs {
  color: #d6ebf7
}

.page-hero .gradient-text {
  background: none;
  color: #fff;
  -webkit-text-fill-color: initial
}

.page-hero .kicker {
  color: #bfe5fb
}

.section-alt {
  background: #c7deed
}

.card,
.project-card,
.resource-card,
.gallery figure {
  background: rgba(248, 252, 255, .95)
}

.kicker {
  color: #0067a5
}

.card-icon {
  background: #d8ebf7;
  color: #004f86
}

.tag,
.pill {
  background: #d9ebf6;
  color: #004a7d
}

.notice {
  background: #d7eaf6;
  border-color: #91bdd8
}

.site-footer {
  background: #002f57
}

.history-note {
  color: var(--muted);
  margin-top: -6px;
  margin-bottom: 18px
}

.history-list li {
  padding: 7px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 65%, transparent)
}

.history-list li:last-child {
  border-bottom: 0
}

.complete-history .accordion {
  margin-top: 16px
}

html[data-theme="dark"] body {
  background: linear-gradient(180deg, #061d31, #08263e)
}

html[data-theme="dark"] .site-header {
  background: color-mix(in srgb, #08263e 91%, transparent)
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .project-card,
html[data-theme="dark"] .resource-card,
html[data-theme="dark"] .gallery figure {
  background: var(--surface)
}

html[data-theme="dark"] .section-alt {
  background: #0d3451
}

/* Final content enhancements */
.profile-avatar {
  height: 310px;
  background: var(--surface-2)
}

.profile-avatar::after {
  display: none
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top
}

.resource-card {
  align-items: flex-start;
  min-height: 142px;
  position: relative
}

.resource-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px
}

.resource-copy small {
  line-height: 1.45
}

.resource-category {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  margin-top: 7px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--primary-2);
  font-size: 11px;
  font-weight: 750
}

.resource-external {
  margin-left: auto;
  flex: 0 0 auto;
  color: var(--muted)
}

@media(max-width:680px) {
  .profile-avatar {
    height: min(110vw, 390px)
  }

  .resource-card {
    min-height: auto
  }
}


/* Chronological records and restored links */
.sort-control {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 0px 0 20px
}

.sort-control label {
  font-size: 13px;
  font-weight: 800;
  color: var(--muted)
}

.sort-control .filter-select {
  min-width: 180px
}

.record-link {
  display: inline-flex;
  margin-top: 8px;
  color: var(--primary-2);
  font-size: 13px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px
}

.publication-title-link:hover,
.inline-link:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px
}

.sortable-history {
  list-style: none !important;
  padding-left: 0 !important;
  display: grid;
  gap: 10px
}

.sortable-history>li {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: start;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface)
}

.history-index,
.project-index {
  display: grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  padding: 0 7px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--primary-2);
  font-size: 12px;
  font-weight: 850
}

.history-content {
  min-width: 0
}

.project-card {
  position: relative
}

.project-index {
  position: absolute;
  right: 16px;
  top: 16px
}

.project-card>.pill {
  margin-right: 42px
}

.profile-card img,
.director-photo {
  object-fit: cover;
  object-position: center top;
  background: #fff
}

.resource-card .card-icon {
  font-weight: 900
}

@media(max-width:680px) {
  .sort-control {
    justify-content: stretch;
    display: grid
  }

  .sort-control .filter-select {
    width: 100%
  }

  .sortable-history>li {
    grid-template-columns: 34px 1fr;
    padding: 11px
  }

  .history-index {
    min-width: 30px;
    height: 30px
  }
}

/* Exact director portrait supplied by Prof. Ma */
.profile-avatar:has(img) {
  height: auto;
  aspect-ratio: 6/7;
  background: #fff
}

.profile-avatar:has(img)::after {
  display: none !important
}

.profile-avatar:has(img) img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  background: #fff
}

.numbering-note {
  display: inline-block;
  margin-top: 3px;
  font-size: 13px
}