/* 歌词本统一样式 */
body {
  margin: 0;
  background: #fdfcf9;
  color: #2b2823;
  font-family: "Times New Roman", "Yu Mincho", "YuMincho", "游明朝",
               "Hiragino Mincho ProN", "MS PMincho", serif;
}

/* ---- 左右布局 ---- */
.layout { display: flex; min-height: 100vh; }

/* ---- 左侧目录 ---- */
.sidebar {
  flex: 0 0 264px;
  width: 264px;
  max-height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 26px 20px 20px;
  background: #f6f3ec;
  border-right: 1px solid #e7e1d4;
}
.site-title {
  font-size: 26px;
  font-weight: bold;
  text-align: center;
  margin: 0 0 16px;
}
.side-tools {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
}
#searchBox {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 14px;
  padding: 7px 12px;
  color: #2b2823;
  background: #fff;
  border: 1px solid #d5cebe;
  border-radius: 999px;
}
#searchBox:focus {
  outline: none;
  border-color: #a89e8a;
}
#hideSidebar {
  flex: 0 0 auto;
  font-size: 14px;
  padding: 7px 12px;
  color: #57534a;
  background: #fff;
  border: 1px solid #d5cebe;
  border-radius: 999px;
  cursor: pointer;
}
#hideSidebar:hover { background: #f4f0e6; }

.song-nav {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 2px 4px 8px 0;
}
.song-btn {
  font-family: inherit;
  font-size: 15px;
  padding: 8px 14px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #57534a;
  background: #fff;
  border: 1px solid #e2dccd;
  border-radius: 10px;
  cursor: pointer;
}
.song-btn:hover { background: #f4f0e6; }
.song-btn.active {
  background: #57534a;
  color: #fdfcf9;
  border-color: #57534a;
}
.index-badge {
  flex: none;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  font-size: 12px;
  font-weight: bold;
  color: #fdfcf9;
  background: #a89e8a;
  border-radius: 4px;
}
.song-btn:hover .index-badge { background: #8d8472; }
.song-btn.active .index-badge {
  background: #fdfcf9;
  color: #57534a;
}

/* 分页 */
.pager {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding-top: 14px;
}
.pager-btn {
  font-family: inherit;
  font-size: 13px;
  min-width: 30px;
  padding: 5px 8px;
  color: #57534a;
  background: #fff;
  border: 1px solid #d5cebe;
  border-radius: 8px;
  cursor: pointer;
}
.pager-btn:hover:not(:disabled) { background: #f4f0e6; }
.pager-btn:disabled { opacity: .4; cursor: default; }
.pager-btn.current {
  background: #57534a;
  color: #fdfcf9;
  border-color: #57534a;
}
.pager-ellipsis {
  align-self: center;
  color: #9b937f;
}

/* 目录隐藏时：歌词全屏 + 悬浮恢复按钮 */
body.sidebar-hidden .sidebar { display: none; }
.show-catalog-btn {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 10;
  font-family: inherit;
  font-size: 14px;
  padding: 7px 14px;
  color: #57534a;
  background: #fff;
  border: 1px solid #d5cebe;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .08);
}
.show-catalog-btn:hover { background: #f4f0e6; }
body.sidebar-hidden .show-catalog-btn { display: inline-block; }

/* ---- 右侧主区 ---- */
.main {
  flex: 1;
  padding: 48px 40px;
}
.song-view {
  max-width: 780px;
  margin: 0 auto;
}
.song-view h1 {
  font-size: 30px;
  font-weight: bold;
  text-align: center;
  margin: 0 0 10px;
}
.credits {
  text-align: center;
  font-size: 15px;
  color: #6f6a60;
  line-height: 1.8;
  margin: 0 0 36px;
}
.lyrics p {
  font-size: 21px;
  line-height: 2.15;
  margin: 0 0 .3em;
}
.lyrics .trans {
  font-size: 16px;
  font-weight: bold;
  line-height: 1.7;
  margin: 0 0 .55em;
  color: #57534a;
}
.lyrics .blank { height: .9em; }
.hide-trans .trans { display: none; }

/* 工具栏 */
.toolbar { text-align: center; margin: 0 0 18px; }
#transToggle {
  font-family: inherit;
  font-size: 14px;
  padding: 6px 18px;
  color: #57534a;
  background: #fff;
  border: 1px solid #d5cebe;
  border-radius: 999px;
  cursor: pointer;
}
#transToggle:hover { background: #f4f0e6; }

/* 振假名 */
ruby { ruby-align: center; }
rt { font-size: .5em; color: #5a554c; }

/* 窄屏：目录移到顶部 */
@media (max-width: 720px) {
  .layout { flex-direction: column; }
  .sidebar {
    position: static;
    width: 100%;
    flex: none;
    max-height: none;
    border-right: none;
    border-bottom: 1px solid #e7e1d4;
  }
  .song-nav {
    flex: none;
    max-height: 280px;
  }
}
