* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  background: linear-gradient(to bottom, #2c353d, #333f47, #536878, #5d7185);
  height: 100%;
  max-height: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  font-family: Arial, sans-serif;
  font-size: 16px;
}

header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 25px;
  height: 30vh;
}

h1 {
  background: linear-gradient(
    45deg,
    #00c2ff 15%,
    #fff,
    #ffc640 60%,
    #fff,
    #00c2ff 85%
  );

  background-size: 200% 200%;
  color: transparent;
  -webkit-background-clip: text;
  background-clip: text;
  animation: move-bg 6s infinite alternate;
  padding: 2rem;
  font-size: 3rem;
  font-weight: bold;
  letter-spacing: 2px;
  margin-bottom: 0;
}

@keyframes move-bg {
  0% {
    background-position: 0% 50%;
  }

  100% {
    background-position: 100% 50%;
  }
}

header > p {
  letter-spacing: 2px;
  color: aliceblue;
  font-size: 1.5rem;
  opacity: 0.8;
  margin-top: 0;
  margin-bottom: 20px;
}

.links-container {
  display: flex;
  gap: 20px;
  width: 100%;
  justify-content: flex-end;
}
.links-container a {
  text-decoration: none;
  letter-spacing: 2px;
  color: #fef0ac;
  padding: 1rem;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.1);
  transition: background-color 0.3s, opacity 0.3s;
  font-weight: bold;
  cursor: pointer;
  opacity: 0.8;
}

.links-container a:first-child:hover {
  background-color: #4a90e2;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  opacity: 1;
}

.links-container a:nth-child(2):hover {
  background-color: #333;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  opacity: 1;
}

.links-container a:nth-child(3):hover {
  background-color: #28a745;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  opacity: 1;
}

main {
  display: grid;
  margin: 0 50px;
}

/* 切換卡片組的按鈕 */
.carousel-buttons {
  display: flex;
  gap: 20px;
  margin-top: 25px;
  justify-content: center;
}

.carousel-buttons > button {
  background: none;
  border: none;
  cursor: pointer;
  outline: none;
  font-size: 1.6rem;
  transition: transform 0.3s ease;
  color: aliceblue;
}

.carousel-buttons > button:hover {
  transform: scale(1.3);
}

.carousel-buttons > button.active {
  transform: scale(1.3);
  color: #ffc640;
}

/* 卡片輪播 */
.carousel-container {
  width: 100%;
  position: relative;
  overflow-x: scroll;
  overflow-y: hidden;
  white-space: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 20px 0;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
}

.carousel-container::-webkit-scrollbar {
  display: none;
}

.carousel-group {
  --item-width: 500px;
  list-style: none;
  display: flex;
  align-items: center;
  height: 100%;
  margin: 0;
  padding: 0;
}

.carousel-item {
  flex: 0 0 auto;
  width: var(--item-width);
  height: 450px;
  position: relative;
  perspective: 1000px;
  transform-style: preserve-3d;
  z-index: 1;
  will-change: transform;
  transition: all 0.3s ease;
  margin: 0 10px;
  scroll-snap-align: center;
}

.carousel-item:first-child {
  margin-left: calc(50% - (var(--item-width) / 2));
}

/* 卡片內容 */
.carousel-item-top {
  width: 100%;
  height: 350px;
  position: relative;
  transform-style: preserve-3d;
  overflow: hidden;
}

.carousel-item-top img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-item-bottom {
  background: aliceblue;
  height: 100px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
  padding: 10px;
  transform-style: preserve-3d;
}

.card-name {
  font-size: 1.2rem;
  color: #1d2b49;
  letter-spacing: 1px;
  font-weight: bold;
}

.card-btns {
  display: flex;
  gap: 15px;
}

.card-btns a {
  text-decoration: none;
  padding: 5px 15px;
  border-radius: 4px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.demo-btn {
  background-color: #4a90e2;
  color: white;
}

.github-btn {
  background-color: #333;
  color: white;
}

.note-btn {
  background-color: #28a745;
  color: white;
}

.card-btns a:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
