* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: 'KaiTi', 'STKaiti', serif;
  background: #f7f3ec;
  color: #333;
  transition: background 0.4s, color 0.4s;
}
body.dark {
  background: #1a1a1a;
  color: #ddd;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem;
}
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1rem;
  border-bottom: 1px solid #ccc;
  flex-wrap: wrap;
  gap: 1rem;
}
.header-ctrl {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}
#search,
#typeFilter {
  padding: 6px 10px;
  border: 1px solid #aaa;
  border-radius: 4px;
  font-size: 16px;
}
button {
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  background: #5b7c99;
  color: white;
  cursor: pointer;
}
button:hover {
  background: #48637c;
}
.main-wrap {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 2rem;
  margin-top: 1rem;
}
.sidebar {
  overflow-y: auto;
  height: calc(100vh - 140px);
}
.sidebar ul {
  list-style: none;
  margin-top: 0.8rem;
}
.sidebar li {
  padding: 5px 0;
  cursor: pointer;
}
.sidebar li:hover {
  color: #8b4513;
}
.book {
  padding: 2rem;
  line-height: 2;
}
.book-inner {
  min-height: 420px;
}
#poemTitle {
  font-size: 28px;
  text-align: center;
  margin-bottom: 0.6rem;
}
.author {
  text-align: center;
  font-size: 18px;
  margin-bottom: 2rem;
  color: #666;
}
.poem-content {
  font-size: 22px;
  text-align: center;
  line-height: 2.2;
}
.poem-desc {
  margin-top: 2rem;
  font-size: 16px;
  line-height: 1.8;
}
.poem-desc h4 {
  margin-top: 1rem;
  margin-bottom: 0.3rem;
}
.page-ctrl {
  margin-top: 2rem;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
ruby {
  font-size: 24px;
}
rt {
  font-size: 14px;
  color: #888;
}
/* 收藏弹窗 */
.modal {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.modal-box {
  background: #fff;
  padding: 2rem;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 8px;
}
.modal-box h3 {
  margin-bottom: 1rem;
}
.modal-box ul {
  list-style: none;
}
.modal-box li {
  padding: 6px 0;
  cursor: pointer;
}
.modal-box li:hover {
  color: #8b4513;
}
body.dark .modal-box {
  background: #222;
}
@media (max-width: 768px) {
  .main-wrap {
    grid-template-columns: 1fr;
  }
  .sidebar {
    height: auto;
  }
}
