:root {
  color-scheme: light;
  --navy: #102941;
  --ink: #24313c;
  --muted: #53616a;
  --line: #dce2e4;
  --tint: #f3f5f4;
  --serif: "Songti SC", "Noto Serif CJK SC", "SimSun", "STSong", serif;
  --gutter: clamp(20px, 6.2vw, 120px);
  --section-space: clamp(58px, 7vw, 112px);
  --grid-gap: clamp(15px, 2vw, 32px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: #fff;
  color: var(--ink);
  font: 15px/1.65 "PingFang SC", "Microsoft YaHei", sans-serif;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { display: block; width: 100%; object-fit: cover; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid #567693; outline-offset: 4px; }
.container { width: min(calc(100% - 2 * var(--gutter)), 1520px); margin-inline: auto; }
.section { padding-block: var(--section-space); }

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 7px 20px;
  border: 1px solid currentColor;
  border-radius: 99px;
  background: transparent;
  color: inherit;
  font-size: 13px;
  white-space: nowrap;
  transition: background-color .2s, color .2s;
}
.pill:hover { background: var(--navy); color: #fff; }
.hero .pill:hover, .live .pill:hover, .project .pill:hover {
  background: #fff;
  color: var(--navy);
}
.hero :focus-visible, .live :focus-visible, .project :focus-visible { outline-color: #fff; }

.hero {
  --hero-image: url("assets/hd/hero.webp");
  --hero-position: 64% 45%;
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: center;
  min-height: clamp(530px, 49vw, 850px);
  background: #172423;
  color: #fff;
}
.hero[data-slide="1"] {
  --hero-image: url("assets/hd/hero-projects.webp");
  --hero-position: 60% 36%;
}
.hero[data-slide="2"] {
  --hero-image: url("assets/hd/exam.webp");
  --hero-position: 63% 43%;
}
.hero-photo {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, #081719e0, #0817199c 37%, #08171928 73%),
    var(--hero-image) var(--hero-position) / cover no-repeat;
}
.hero-content { padding-block: 86px 96px; }
.hero h1 {
  max-width: 10em;
  font: 600 clamp(42px, 5.05vw, 82px)/1.17 var(--serif);
  letter-spacing: .035em;
  text-wrap: balance;
}
.hero:not([data-slide="1"], [data-slide="2"]) h1 {
  max-width: 8.65em;
  text-wrap: wrap;
}
.hero p {
  margin: 24px 0 32px;
  max-width: 34em;
  color: #fff;
  font-size: clamp(14px, 1.18vw, 18px);
  line-height: 1.95;
}
.hero-arrow {
  position: absolute;
  top: calc(50% - 22px);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
}
.hero-arrow:hover { background: #ffffff25; }
.hero-arrow::before {
  content: "";
  width: 10px;
  height: 10px;
  border-top: 1px solid;
  border-right: 1px solid;
  transform: rotate(45deg);
}
.hero-prev { left: max(0px, calc(var(--gutter) / 2 - 22px)); }
.hero-prev::before { transform: rotate(-135deg); }
.hero-next { right: max(0px, calc(var(--gutter) / 2 - 22px)); }
.hero-dots {
  position: absolute;
  inset: auto 0 22px;
  display: flex;
  justify-content: center;
  width: max-content;
  margin-inline: auto;
}
.hero-dots button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 38px;
  padding: 0;
  border: 0;
  background: transparent;
}
.hero-dots button::before {
  content: "";
  width: 10px;
  height: 10px;
  border: 1px solid #fff;
  border-radius: 50%;
}
.hero-dots button[aria-pressed="true"]::before { background: #fff; }

.quick {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  padding-block: clamp(20px, 3vw, 42px);
}
.quick a, .quick button {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  padding: 3px;
  border: 0;
  border-right: 1px solid var(--line);
  background: none;
  color: var(--navy);
  font-size: clamp(13px, 1.12vw, 17px);
}
.quick > :last-child { border-right: 0; }
.quick img {
  width: 39px;
  aspect-ratio: 1;
}
.quick a:hover, .quick button:hover { text-decoration: underline; text-underline-offset: 5px; }

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: clamp(22px, 3vw, 42px);
}
.section-heading h2, .promo h2 {
  color: var(--navy);
  font: 600 clamp(26px, 3.15vw, 49px)/1.2 var(--serif);
  letter-spacing: .025em;
}
.section-heading a {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 5px;
}
.section-heading a:hover { color: var(--navy); }

.project-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 3.55fr);
  align-items: center;
  gap: var(--grid-gap);
}
.project-section .section-heading { display: grid; gap: 22px; margin: 0; }
.project-section .section-heading h2 { font-size: clamp(27px, 2.9vw, 44px); }
.project-section .section-heading a { text-decoration: none; }
.projects, .courses, .teachers, .news, .community { display: grid; gap: var(--grid-gap); }
.projects, .news { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.project {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: end;
  overflow: hidden;
  min-height: clamp(265px, 26vw, 420px);
  border-radius: 6px;
  background: #283c44;
  color: #fff;
}
.project img { position: absolute; z-index: -2; inset: 0; height: 100%; object-position: center 20%; }
.project::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, transparent 20%, #0b1a2070 44%, #0b1a20ef 100%);
}
.project-copy { padding: 20px clamp(14px, 1.6vw, 24px); }
.project h3 { font: 600 clamp(18px, 1.63vw, 27px)/1.25 var(--serif); text-wrap: balance; }
.project p { margin: 9px 0 15px; font-size: 13px; }
.project .pill { min-height: 36px; padding-inline: 13px; font-size: 12px; }

.course-band { background: var(--tint); }
.courses { grid-template-columns: repeat(4, minmax(0, 1fr)); row-gap: 34px; }
.card {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}
.card img { aspect-ratio: 1.73; border-radius: 4px; transition: filter .2s; }
button.card:hover img { filter: brightness(.86); }
.card-body { display: block; padding-top: 12px; }
.card strong { display: block; color: var(--navy); font-size: clamp(14px, 1.24vw, 20px); line-height: 1.38; }
.card small { display: block; margin-top: 5px; color: var(--muted); font-size: 13px; line-height: 1.55; }

.live {
  display: grid;
  place-items: center;
  min-height: clamp(320px, 33vw, 530px);
  padding: 62px var(--gutter);
  background:
    linear-gradient(90deg, #091e32f0, #102b42ba 50%, #1024378c),
    url("assets/hd/live.webp") center 53% / cover no-repeat;
  background-color: var(--navy);
  color: #fff;
  text-align: center;
}
.live h2 { color: inherit; }
.promo p { margin: 17px 0 24px; line-height: 1.85; }
.promo-actions { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; }
.promo-actions small { font-size: 13px; }
.exam { display: grid; grid-template-columns: 1fr 1fr; min-height: clamp(330px, 32vw, 510px); }
.exam-photo { background: #dde0de url("assets/hd/exam.webp") 61% center / cover no-repeat; }
.exam .promo-copy { align-self: center; padding: 60px var(--gutter); }
.exam p { color: var(--muted); }
.exam .pill { color: var(--navy); }
.exam .pill:hover { color: #fff; }

.teachers { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.teachers img { aspect-ratio: .91; object-position: center top; }
.teachers .card strong { font: 600 clamp(19px, 1.65vw, 25px)/1.3 var(--serif); }
.teacher-role {
  display: block;
  margin-top: 4px;
  color: var(--navy);
  font: 500 12px/1.55 "PingFang SC", "Microsoft YaHei", sans-serif;
}

.community { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(24px, 4vw, 64px); }
.panel { min-width: 0; padding-top: 24px; }
.panel .section-heading { margin-bottom: 8px; }
.panel .section-heading h2 { font-size: clamp(20px, 2.2vw, 34px); }
#topics { display: grid; grid-template-rows: auto 1fr; }
#topic-list { display: grid; grid-auto-rows: 1fr; }
.list-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(8px, 1vw, 16px);
  width: 100%;
  min-height: 55px;
  padding: 11px 0;
  border: 0;
  background: transparent;
  text-align: left;
}
#article-list img { width: clamp(84px, 9vw, 140px); aspect-ratio: 1.72; border-radius: 4px; }
#topic-list img { width: 27px; aspect-ratio: 1; }
.list-item b { display: block; color: var(--navy); font-size: 14px; }
.list-item:hover b { text-decoration: underline; text-underline-offset: 3px; }
.list-item small, .list-item time { display: block; color: var(--muted); font-size: 12px; }
.list-item time { font-variant-numeric: tabular-nums; }
.news img { aspect-ratio: 2; }
.card .news-date { margin-top: 12px; font-variant-numeric: tabular-nums; }

#detail {
  width: min(calc(100% - 36px), 480px);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
#detail::backdrop { background: #0a192bc0; }
#detail h2 { margin-bottom: 12px; padding-right: 25px; color: var(--navy); font: 600 28px/1.3 var(--serif); }
.dialog-close { position: absolute; top: 5px; right: 12px; border: 0; background: none; color: var(--navy); font-size: 28px; }

@media (max-width: 980px) {
  .project-section { grid-template-columns: 1fr; }
  .project-section .section-heading { display: flex; }
  .courses { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .community { gap: 27px; }
  .list-item b { font-size: 13px; }
}

@media (max-width: 640px) {
  .hero { min-height: clamp(490px, 135vw, 650px); align-items: end; }
  .hero-photo {
    background:
      linear-gradient(0deg, #081719f2, #081719b5 35%, #08171926 74%),
      var(--hero-image) var(--hero-position) / cover no-repeat;
  }
  .hero-content { padding-block: 168px 84px; }
  .hero h1 { max-width: 11em; font-size: clamp(31px, 8.5vw, 49px); }
  .hero p { margin: 14px 0 22px; font-size: 13px; }
  .hero p br { display: none; }
  .hero-arrow { top: 25%; background: #0003; }
  .hero-dots { bottom: 15px; }
  .quick { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 14px; }
  .quick > :nth-child(3n) { border-right: 0; }
  .quick img { width: 35px; }
  .projects, .courses, .teachers, .news { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .project { min-height: 248px; }
  .projects > :last-child { grid-column: 1 / -1; min-height: 220px; }
  .projects > :last-child img { object-position: center 46%; }
  .project-copy { padding: 13px; }
  .project p { font-size: 12px; }
  .courses { row-gap: 23px; }
  .card small { font-size: 12px; }
  .live { min-height: 310px; }
  .exam { grid-template-columns: 1fr; }
  .exam-photo { aspect-ratio: 1.6; }
  .exam .promo-copy { padding: 36px var(--gutter) 47px; }
  .community { grid-template-columns: 1fr; gap: 36px; }
  .news { grid-template-columns: 1fr; gap: 26px; }
  .news img { aspect-ratio: 2.7; }
}

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