/* CSS Reset: http://meyerweb.com/eric/tools/css/reset */

html,
body,
div,
span,
applet,
object,
iframe,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
pre,
a,
abbr,
acronym,
address,
big,
cite,
code,
del,
dfn,
em,
img,
ins,
kbd,
q,
s,
samp,
small,
strike,
strong,
sub,
sup,
tt,
var,
b,
u,
i,
center,
dl,
dt,
dd,
ol,
ul,
li,
fieldset,
form,
label,
legend,
table,
caption,
tbody,
tfoot,
thead,
tr,
th,
td,
article,
aside,
canvas,
details,
embed,
figure,
figcaption,
footer,
header,
hgroup,
menu,
nav,
output,
ruby,
section,
summary,
time,
mark,
audio,
video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}

/* HTML5 display-role reset for older browsers */
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
menu,
nav,
section {
  display: block;
}

body {
  line-height: 1;
}

ol,
ul {
  list-style: none;
}

blockquote,
q {
  quotes: none;
}

blockquote:before,
blockquote:after,
q:before,
q:after {
  content: '';
  content: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/**************************************************/

#body {
  font-family: 'Asap', roboto, sans-serif;
  font-size: 1em;
  line-height: 1.5em;
  color: #150c21;
}

#main {
  width: 54em;
  margin: 0px auto;
  position: relative;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: rgb(20, 110, 190);
}

a:hover {
  text-decoration: none;
  border-bottom: 1px solid rgb(20, 110, 190);
}

i {
  font-style: italic;
}

b {
  font-weight: 700;
}

h1 {
  font-size: 2.4em;
  line-height: 2.4em;
  font-weight: 500;
}

/**************************************************/
/* Profile image and description. */

#intro {
  padding-top: 6em;
  display: flex;
}

#intro-text {
  width: 40em;
  float: left;
}

#intro-image {
  margin: 3em 0 0 2em;
  width: 12em;
  height: 12em;
  float: left;
  overflow: hidden;
  border-radius: 1em;
}

#intro-image img {
  width: 12em;
}

/**************************************************/
/* Section buttons. */

#menu {
  display: flex;
}

.menu-item {
  float: left;
  margin-right: 2em;
}

h2 {
  font-size: 1.6em;
  line-height: 2.4em;
  margin-top: 0.5em;
  color: #a0a8b0;
}

.selected h2 {
  color: #150c21;
}

.button {
  display: inline-block;
  cursor: pointer;
  border: none;
  background: none;
  color: #a0a8b0;
  font-size: 1.6em;
  line-height: 2.4em;
  margin-top: 0.5em;
  margin-right: 1em;
  float: left;
  padding: 0;
}

.button:hover {
  color: #150c21;
}

.button:active,
.button.is-checked {
  color: #150c21;
}

.button-group:after {
  content: '';
  display: block;
  clear: both;
}

/**************************************************/
/* Isotope grid list of items. */

.grid {
  padding-bottom: 6em;
}

/* clear fix */
.grid:after {
  content: '';
  display: block;
  clear: both;
}

.description {
  margin-bottom: 1em;
  padding-bottom: 0.5em;
}

.list-item {
  width: 100%;
  line-height: 1em;
  margin-top: 1em;
}

.list-item p.date {
  display: inline-block;
  width: 3em;
  color: #a0a8b0;
}

/**************************************************/
/* Gallery of 3 preview videos. */

.previews {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  grid-auto-rows: minmax(100px, auto);
  height: 12.5em;
}

.previews video {
  border-radius: 5px;
}

.previews a:hover {
  border: none;
}

.preview1 {
  grid-column: 1;
  width: 100%;
}

.preview2 {
  grid-column: 2;
  width: 100%;
}

.preview3 {
  grid-column: 3;
  width: 100%;
}

/**************************************************/
/* Buttons for showing more or less highlights. */

.toggle-button {
  margin-top: 1em;
}

.toggle-button a {
  color: #a0a8b0;
}

.toggle-button a:hover {
  color: rgb(20, 110, 190);
}

/**************************************************/
/* Publication details (thumbnail media, title, and description). */

.thumbnail {
  /*  width: 21%;*/
  width: 18%;
  float: left;
  margin-right: 2%;
}

.thumbnail:hover {
  border-bottom: none;
}

.thumbnail img {
  margin-top: 0.4em;
  border-radius: 5px;
  width: 100%;
  height: 100%;
}

.thumbnail video {
  margin-top: 0.4em;
  border-radius: 5px;
  width: 100%;
  height: 100%;
}

h3 {
  font-size: 1em;
  line-height: 1.5em;
}

h3 a {
  color: #150c21;
}

h3 a:hover {
  color: rgb(20, 110, 190);
}

.publication {
  margin-bottom: 0.5em;
}

.publication p {
  font-size: 1em;
  line-height: 1.5em;
  color: #a0a8b0;
}

.project-description {
  width: 80%;
  float: left;
}

/**************************************************/
/* Subtle footer at the bottom of the page. */

#footer {
  color: #a0a8b0;
  position: absolute;
  bottom: 0;
  line-height: 2.5em;
}

/**************************************************/
/* added layout. */
.list-item.service.description+.list-item.service {
  margin-top: -0.25em;
}

.previews a {
  display: flex;
  align-items: stretch;
  justify-content: center;
  height: 100%;
  background: #000;
}

.previews video {
  height: 100%;
  width: auto;
  object-fit: contain;
  border-radius: 5px;
}

/**************************************************/
/* Carousel wrapper and buttons */
.previews-carousel {
  position: relative;
}

/* Horizontal track with scroll snapping */
.previews.track {
  /* replaces the previous grid layout */
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  height: 12.5em;
  /* keep your unified height */
  padding: 0 40px;
  /* room for buttons; adjust if desired */
}

/* Individual slides (responsive column count) */
.previews.track {
  --slides-per-view: 3;
  /* 3 on desktop */
}

.previews.track .slide {
  flex: 0 0 calc((100% - (var(--slides-per-view) - 1) * 10px) / var(--slides-per-view));
  scroll-snap-align: center;
  display: flex;
  align-items: stretch;
  justify-content: center;
  height: 100%;
  background: #000;
  /* letterbox for non-matching aspect ratios */
  border-radius: 5px;
  text-decoration: none;
}

/* Keep height aligned, don't crop width */
.previews.track .slide video {
  height: 100%;
  width: auto;
  object-fit: contain;
  border-radius: 5px;
}

/* Hide default scrollbar (optional; keeps scroll functionality) */
.previews.track::-webkit-scrollbar {
  height: 0;
}

.previews.track {
  scrollbar-width: none;
}

/* Prev/Next buttons */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 48px;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  z-index: 1;
  line-height: 48px;
  text-align: center;
  user-select: none;
}

.carousel-btn:hover {
  background: rgba(0, 0, 0, 0.6);
}

.carousel-btn.prev {
  left: 6px;
}

.carousel-btn.next {
  right: 6px;
}

/* Mobile: show 1 per view */
@media (max-width: 768px) {
  .previews.track {
    --slides-per-view: 1;
  }
}

/* keep the carousel below any floated elements above it */
.previews-carousel {
  display: block;
  clear: both;
  margin-top: 1.25rem;
  /* tweak this spacing as you like */
}

/* if you didn't use the wrapper and still use .previews directly */
.list-item.highlight.previews {
  display: block;
  clear: both;
  margin-top: 1.25rem;
}

/* make the carousel occupy its own row in the isotope grid */
.list-item.highlight.previews-carousel {
  display: block;
  clear: both;
  margin: 1rem 0;
  /* spacing above/below so it won't touch text */
  line-height: 0;
  /* avoid extra vertical gap from line-height */
  position: relative;
  /* anchor for buttons */
}

/* keep the track height; you already set 12.5em elsewhere */
.previews.track {
  height: 12.5em;
}

/* ensure arrow buttons are vertically centered within this item */
.carousel-btn {
  top: 50%;
  transform: translateY(-50%);
}

.student-name {
  display: inline-block;
  width: 160px;
  /* 你可以根据最长名字的长度调整这个数值 */
}