html {
  box-sizing: border-box;
}

*,
*:before,
*:after {
  box-sizing: inherit;
}

body {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding-top: 65px;
  min-height: 100vh;
  font-family: "Noto Sans TC", Arial, sans-serif;
  color: #fff;
}

.navWrap {
  width: 300px;
  height: 50px;
}

img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 75px;
  background: #fff;

  display: flex;
  align-items: center;
  padding-left: 20px;
  line-height: 1.4;
  font-size: 12.5px;
  z-index: 5;
}

.logo {
  display: grid !important;
  grid-template-columns: auto auto;
  place-items: center;
  font-size: 20px;
  margin: 5px 5px 0 0;
}

.tag {
  display: flex;
}

.degree {
  color: rgb(38 157 98);
  border: 2px solid rgb(38 157 98);
  border-radius: 999px;
  padding: 2px 5px;
  font-weight: 600;
  margin-left: 10px;
}

/*.right {
  border-top-right-radius: 999px;
  border-bottom-right-radius: 999px;
  background: rgba(110, 96, 84, 0.884);
  padding: 4px 5px 2px 2px;
  color: aliceblue;
}*/

main {
  flex: 1 0 auto;
}

header {
  background-image: url("./images/banner.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  width: 100%;
  height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero {
  max-width: 1120px;
  width: 100%;
  padding: 0 20px;
  display: flex;
  gap: 20px;
  color: aliceblue;
}

.hero .book {
  width: 150px;
  height: 186px;
}

.hero .book img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 5px;
}

.description {
  padding: 20px 0;
}

.description .tag {
  display: grid;
  place-items: center;
  width: 65px;
  height: 25px;
  font-size: 12px;
  border-radius: 5px;
  background: rgb(201, 98, 115);
}

.description h1 {
  margin-top: 10px;
  font-size: 28px;
  color: #333;
}

.function {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  margin-top: -5px;
}

.download {
  border-radius: 5px;
  padding: 5px;
  background: rgb(101, 120, 155);
  color: aliceblue;
  text-decoration: none;
  cursor: pointer;
}

.loop {
  border-radius: 5px;
  background: rgb(72, 163, 107);
  /* rgb(97, 168, 159); */
  padding: 5px 8px;
}

.checkbox-container {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: inherit;
  color: aliceblue;
  user-select: none;
}

.checkbox-container input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  height: 13px;
  width: 13px;
  background: transparent;
  border: 2px solid aliceblue;
  border-radius: 3.5px;
  margin-right: 3px;
  position: relative;
  transition: all 0.2s ease;
}

.checkbox-container:hover input~.checkmark {
  background: rgba(255, 255, 255, 0.1);
}

.checkbox-container input:checked~.checkmark {
  background-color: aliceblue;
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
  left: 3px;
  width: 4px;
  height: 8px;
  border: solid #333;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-container input:checked~.checkmark:after {
  display: block;
}

.content {
  max-width: 1120px;
  width: 100%;
  padding: 0 20px;
  margin: 10px auto;
  color: #333;
  font-size: 13.5px;
}

.list {
  background: #f7f7f7;
  border-radius: 0 0 8px 8px;
  padding: 5px;
  min-height: 60px;
  transition: padding-top 0.4s ease;
}

.track-top {
  background: #f0f0f0;
  width: 100%;
  padding: 15px 15px 10px 15px;
  overflow: hidden;
  transition: all 0.5s ease;
}

.track-top p {
  font-size: 15px;
  font-weight: 600;
  margin: 0 3px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.scrolled .track-top {
  max-height: 0;
  visibility: hidden;
  padding: 0;
}

.playlist {
  list-style: none;
  padding: 0 25px 10px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.8;
}

/* Unit 分類區塊 */
.unit-section {
  margin-bottom: 10px;
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
}

/* Unit標題 */
.unit-header {
  background-color: #f8f9fa;
  padding: 12px 15px;
  cursor: pointer;
  align-items: center;
  font-weight: bold;
  border-bottom: 1px solid #eee;
}

.unit-title {
  color: #2c3e50;
  font-size: 1.1em;
}

.unit-count {
  font-size: 0.85em;
  color: #7f8c8d;
}

/* 當展開時的樣式 */
.unit-section[open] .unit-header {
  background-color: #e9ecef;
}

/* 歌曲列表清單 */
.unit-track-list,
.unit-list-plain {
  list-style: none;
  padding: 0;
  margin: 0;
}

.playlist-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid #e5e5e5;
  overflow: hidden;
}

.playlist-item-left {
  display: flex;
  align-items: center;
  min-width: 0;
  flex-grow: 1;
  margin-right: 10px;
}

.playlist-item-left .track-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-item-right {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.playlist-item-right>* {
  margin-left: 10px;
}

.playlist-item-right .playback-speed-select {
  margin-right: 0;
}

.download-button {
  padding: 4px 8px;
  background: transparent;
  color: #333;
  border: 1px solid #33333336;
  border-radius: 10px;
  cursor: pointer;
  font-size: 11px;
  white-space: nowrap;
  transition: background-color 0.2s;
}

/* Tab */
.tab-container {
  display: flex;
  width: 100%;
}

.tab {
  flex: 1;
  padding: 12px 24px;
  background: #fff;
  border-radius: 10px 10px 0 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  background: #e9ecef;
  color: #6c757d;
  transition: all 0.2s ease;
  text-align: center;
}

.tab:hover {
  background: #dee2e6;
}

.tab.active {
  background: rgba(218, 131, 73, 0.89);
  color: #fff;
  border-color: #bbb;
  position: relative;
}

.notice {
  background: rgb(232, 240, 238);
  padding: 2px 20px;
  border-radius: 4px;
}

.notice h4 {
  margin: 10px 0 -10px;
  font-size: 16px;
}

.bottom-section {
  flex-shrink: 0;
  margin-top: auto;
}

footer {
  display: flex;
  justify-content: center;
  height: 160px;
  line-height: 60px;
  background: #f5f5f5;
  color: #333;
  font-weight: 500;
  font-size: 12.5px;
  font-family: Georgia, Cambria, "Times New Roman", Times, serif;
}

.wrap {
  width: 120px;
  height: 58px;
  margin-right: 8px;
}

.wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.track-bottom {
  background: rgb(155, 147, 140);
  color: #fff;
  font-weight: 600;
  border: none;
  padding: 15px;
  position: fixed;
  bottom: 0;
  width: 100%;
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transform: translateY(100%);
  transition: all 0.4s ease;
}

.track-bottom p {
  margin: -2px 0 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.scrolled .track-bottom {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#audio-player {
  width: 100%;
  height: 40px;
  /* box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); */
}

audio,
audio:focus,
audio:active {
  background: inherit !important;
}

audio::-webkit-media-controls-enclosure,
audio::-webkit-media-controls-panel,
audio::-webkit-media-controls-timeline,
audio::-webkit-media-controls-current-time-display,
audio::-webkit-media-controls-time-remaining-display,
audio::-webkit-media-controls-volume-slider,
audio::-webkit-media-controls-fullscreen-button {
  background: inherit !important;
  -webkit-appearance: none !important;
  border: none !important;
  outline: none !important;
}

.track-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.playing-icon {
  width: 25px;
  height: 25px;
  border-radius: 50px;
  border: 2px solid rgb(230, 135, 71);
  color: rgba(230, 135, 71);
}

.playing {
  display: inline-block;
  text-align: center;
  width: 50px;
  font-size: 10.5px;
  font-weight: 500;
  padding: 3px;
  border-radius: 15px;
  color: aliceblue;
  background: rgb(230, 135, 71);
}

.playlist-item .playing-icon,
.playlist-item .playing {
  display: none;
}

.playlist-item .icon-pause {
  display: none;
}

.playlist-item.is-playing .playing-icon,
.playlist-item.is-playing .playing {
  display: inline-block;
}

.playlist-item.is-playing .icon-play {
  display: none;
}

.playlist-item.is-playing .icon-pause {
  display: inline-block;
}

.playlist-item.is-paused .playing-icon,
.playlist-item.is-paused .playing {
  display: inline-block;
}

.playlist-item.is-paused .icon-play {
  display: inline-block;
}

.playlist-item.is-paused .icon-pause {
  display: none;
}

.playback-speed-select {
  width: 80px;
  padding: 5px 0 5px 3px;
  margin-right: 20px;
  border-radius: 10px;
  border: 1px solid #33333336;
  outline: none;
  background: transparent;
  color: #333;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
}

/* TOP 按鈕 */
.top-button {
  position: fixed;
  bottom: 120px;
  right: 30px;
  width: 55px;
  height: 55px;
  border-radius: 50%;
  background: linear-gradient(125deg, #a6c7af, #677e73);
  color: white;
  border: none;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.4s ease;
}

.top-button span {
  font-size: 13.5px;
  font-weight: bold;
  line-height: 1.8;
}

.top-button::before {
  content: "";
  position: absolute;
  top: 80%;
  left: 50%;
  width: 6.5px;
  height: 6.5px;
  border-top: 2px solid white;
  border-right: 2px solid white;
  transform: translate(-50%, -75%) rotate(-45deg);
}

.top-button:hover {
  background: linear-gradient(150deg, #8bb094, #6b8a7b);
}

.top-button:active {
  transform: scale(0.95);
}

.top-button.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

body.scrolled .top-button {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.image-container {
  position: relative;
  display: inline-block;
}

.no-download-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
}

@media (max-width: 768px) {
  .hero {
    justify-content: center;
  }

  .hero .book {
    display: none;
  }

  .description h1 {
    font-size: 25px;
  }

  .track-top p {
    font-size: 13.5px;
  }

  .track-bottom p {
    font-size: 14.5px;
  }

  .playing {
    margin-right: 0;
  }

  .top-button {
    bottom: 120px;
    right: 12px;
    width: 50px;
    height: 50px;
    font-size: 12px;
  }

  ul {
    margin-left: -10px;
  }
}

@media (max-width: 480px) {
  header {
    background: gray;
  }

  .description {
    display: grid;
    place-items: center;
  }

  .description h1 {
    color: #f5f5f5;
    font-size: 22px;
  }

  .playlist-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .playlist-item-left {
    width: 100%;
  }

  .playlist-item-right {
    width: 100%;
    justify-content: flex-end;
    padding-top: 8px;
  }

  li,
  .notice p {
    font-size: 12.5px;
  }

  footer {
    padding: 0 5px;
  }

  .copyright,
  .contract,
  .privacy {
    display: flex;
    justify-content: center;
    align-content: center;
    white-space: nowrap;
  }
}