
:root {
  --primary-color: #2c3e50;
  --accent-color: #2980b9;
  --bg-color: #f9f9f9;
  --text-color: #333;
}

.logo-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 0;
}
.logo-container img {
  height: 50px;
  object-fit: contain;
}
.logo-container h1 {
  margin: 0;
  font-size: 1.8rem;
  color: #333;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: "Noto Sans TC", sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}
header {
  background: white;
  color: #f27799;
  padding: 1rem;
}
}
header h1 {
  text-align: center;
  font-size: 2rem;
}
nav ul {
  display: flex;
  justify-content: center;
  list-style: none;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
nav ul li {
  margin: 0.5rem 1rem;
}
nav ul li a {
  color: #f27799;
  text-decoration: none;
  font-weight: bold;
}
nav ul li a:hover {
  text-decoration: underline;
}
.banner {
  background-color: #f27799;
  color: white;
  text-align: center;
  padding: 2rem;
}
.marquee-container {
  overflow: hidden;
  white-space: nowrap;
  position: relative;
  width: 100%;
  height: 2rem;
  display: flex;
  align-items: center;
}

.marquee-text {
  display: inline-block;
  padding-left: 100%;
  animation: marquee-scroll 15s linear infinite;
  font-size: 1.2rem;
  color: white;
}

@keyframes marquee-scroll {
  0% {
    transform: translateX(0%);
  }
  100% {
    transform: translateX(-100%);
  }
}
.news, .books, .info, .search {
  padding: 2rem;
  max-width: 900px;
  margin: auto;
}
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.book {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.search input {
  padding: 0.8rem 1rem;
  width: 100%;
  max-width: 400px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
}
footer {
  text-align: center;
  background: #ddd;
  padding: 1rem;
  margin-top: 2rem;
}
/* RWD 響應式設計 */
@media (max-width: 768px) {
  header h1 {
    font-size: 1.5rem;
  }
  .banner {
    padding: 1.5rem 1rem;
  }
  .book-grid {
    grid-template-columns: 1fr;
  }
  nav ul {
    flex-direction: column;
    align-items: center;
  }
}
.carousel {
  background-color: #f5f5f5;
  padding: 20px;
  text-align: center;
}
.carousel-container {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
  overflow: hidden;
}
.carousel-slide {
  display: none;
  transition: opacity 1s ease-in-out;
}
.carousel-slide img {
  width: 100%;
  height: auto;
  border-radius: 10px;
}
.carousel-slide.active {
  display: block;
}
.carousel-prev, .carousel-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0,0,0,0.4);
  color: white;
  border: none;
  font-size: 24px;
  padding: 8px 12px;
  cursor: pointer;
  border-radius: 50%;
}
.carousel-prev {
  left: 10px;
}
.carousel-next {
  right: 10px;
}
.carousel-dots {
  text-align: center;
  margin-top: 10px;
}
.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin: 0 4px;
  background-color: #bbb;
  border-radius: 50%;
  cursor: pointer;
}
.dot.active {
  background-color: #717171;
}
@media screen and (max-width: 600px) {
  .carousel-container {
    max-width: 100%;
    padding: 0 10px;
  }
  .carousel-prev, .carousel-next {
    font-size: 18px;
    padding: 6px 10px;
  }
}


nav ul li {
  position: relative;
}

nav ul li ul.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: white;
  list-style: none;
  padding: 0;
  margin: 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 999;
}

nav ul li:hover ul.dropdown {
  display: block;
}

nav ul li ul.dropdown li a {
  display: block;
  padding: 10px 15px;
  text-decoration: none;
  color: #333;
  white-space: nowrap;
}

nav ul li ul.dropdown li a:hover {
  background-color: #f0f0f0;
}
