@import url('https://fonts.googleapis.com/css?family=Roboto:400,700&display=swap');

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

body {
  font-family: 'Roboto', sans-serif;
  background: #111;
  color: #fff;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  width: 90vw;
  max-width: 800px;
  position: relative;
}

.title {
  text-align: center;
  margin-bottom: 2rem;
}

.title h2 {
  font-size: 2.5rem;
  letter-spacing: 2px;
}

.title span {
  color: #fca311;
}

.underline {
  width: 6rem;
  height: 0.25rem;
  background: #fca311;
  margin: 0.5rem auto 0;
}

.slider-container {
  border: 5px solid #fca311;
  width: 100%;
  height: 450px;
  margin: 0 auto;
  position: relative;
  overflow: hidden; /* 关键：隐藏溢出的幻灯片 */
  border-radius: 0.5rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  transition: all 0.5s ease-in-out;
  /* 默认所有 slide 都在视口外，JS 会重新定位它们 */
}

.slide-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5; /* 让文字更清晰 */
}

.slide-info {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  background: rgba(0, 0, 0, 0.6);
  padding: 2rem;
  border-radius: 10px;
  width: 70%;
}

.slide-info h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: #fca311;
}

.slide-info p {
  font-size: 1.1rem;
  line-height: 1.5;
}

/* 按钮样式 */
.prev-btn,
.next-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border-color: transparent;
  font-size: 1.2rem;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s linear;
}

.prev-btn:hover,
.next-btn:hover {
  background: #fca311;
  color: #111;
}

.prev-btn {
  left: 1rem;
}

.next-btn {
  right: 1rem;
}

/* 指示点样式 */
.dots-container {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  gap: 10px;
}

.dot {
  width: 12px;
  height: 12px;
  background: #555;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
}

.dot.active {
  background: #fca311;
  transform: scale(1.2);
}
