
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "游明朝", "Yu Mincho", "Hiragino Mincho ProN", "Noto Serif JP", serif;
  background: #f0f4f8;
  color: #1e293b;
  min-height: 100vh;
  padding-bottom: 90px;
}

header {
  background: #1e3a5f;
  color: #fff;
  padding: 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.site-title {
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  font-weight: bold;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.home-button,
.login-button {
  background: rgba(255,255,255,0.15);
  border: 1px solid #fff;
  color: #fff;
  padding: 7px 10px;
  border-radius: 16px;
  font-size: 12px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.login-button.admin-on {
  background: #0284c7;
}

main {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  min-height: 70vh;
}

.view {
  display: none;
  min-height: 60vh;
}

.view.active {
  display: flex;
  flex-direction: column;
}

.cats {
  display: flex;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  background: #dce6f2;
  padding: 7px max(7px, calc((100vw - 900px) / 2));
  gap: 5px;
}

.cat-btn {
  flex: 1;
  padding: 10px 4px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #334e68;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
}

.cat-btn.active {
  background: #2b5b9e;
  color: #fff;
}

.search {
  padding: 10px;
  background: #f8fafc;
  border-bottom: 1px solid #cbd5e1;
  display: flex;
  gap: 7px;
  align-items: center;
}

.search select {
  max-width: 150px;
  padding: 8px 6px;
  border: 1px solid #94a3b8;
  border-radius: 8px;
  background: #fff;
  color: #1e3a5f;
  font-size: 13px;
}

.search input {
  flex: 1;
  min-width: 70px;
  padding: 8px;
  border: 1px solid #94a3b8;
  border-radius: 8px;
  font-size: 14px;
}

#cnt {
  font-size: 12px;
  font-weight: bold;
  white-space: nowrap;
}

.list {
  background: #fff;
}

.item {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  gap: 8px;
  background: #fff;
}

.item.dragging {
  opacity: 0.5;
  background: #dbeafe;
}

.drag-handle {
  font-size: 20px;
  color: #94a3b8;
  padding: 4px 6px;
  cursor: grab;
}

.item-main {
  flex: 1;
  display: flex;
  align-items: center;
  cursor: pointer;
  overflow: hidden;
}

.num {
  min-width: 48px;
  font-weight: bold;
  color: #2b5b9e;
  font-size: 14px;
  flex-shrink: 0;
}

.title-wrap {
  flex: 1;
  overflow: hidden;
}

.title {
  font-size: 15px;
  font-family: serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sub-badge {
  display: inline-block;
  font-size: 10px;
  background: #e0f2fe;
  color: #0369a1;
  padding: 2px 6px;
  border-radius: 4px;
  margin-right: 4px;
}

.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.st-tag {
  font-size: 10px;
  padding: 2px 5px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #64748b;
}

.st-tag.ok {
  background: #dcfce7;
  color: #15803d;
}

.btn-edit {
  background: #eff6ff;
  border: 1px solid #2b5b9e;
  color: #2b5b9e;
  padding: 6px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
}

.book {
  position: relative;
  min-height: 65vh;
  background: #fff;
}

.page {
  min-height: 65vh;
  padding: 24px 55px 170px;
  font-family: serif;
}

.ptitle {
  font-size: 21px;
  border-bottom: 1px solid #cbd5e1;
  padding-bottom: 10px;
  margin-bottom: 18px;
}

.lyrics {
  font-size: 17px;
  line-height: 2;
  white-space: pre-wrap;
}

.arrow {
  position: absolute;
  top: 38%;
  background: rgba(30,58,95,0.85);
  color: #fff;
  border: none;
  width: 34px;
  height: 48px;
  font-size: 24px;
  cursor: pointer;
  z-index: 2;
}

.prev { left: 4px; }
.next { right: 4px; }

.arrow:disabled {
  opacity: 0.2;
}

.player {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #e2e8f0;
  border-top: 1px solid #cbd5e1;
  padding: 10px 16px;
  display: none;
  z-index: 10;
}

.player.active {
  display: block;
}

.modes {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}

.mbtn {
  flex: 1;
  max-width: 160px;
  padding: 7px;
  border: 1px solid #2b5b9e;
  border-radius: 20px;
  font-size: 13px;
  font-weight: bold;
  background: #fff;
  color: #2b5b9e;
  cursor: pointer;
}

.mbtn.active {
  background: #2b5b9e;
  color: #fff;
}

audio {
  width: 100%;
  height: 34px;
}

.scroll {
  padding: 18px;
}

.card {
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 16px;
}

.card h3 {
  font-size: 16px;
  color: #1e3a5f;
  margin-bottom: 14px;
  border-left: 4px solid #2b5b9e;
  padding-left: 9px;
}

.fg {
  margin-bottom: 13px;
}

.fg label {
  display: block;
  font-size: 13px;
  font-weight: bold;
  margin-bottom: 5px;
}

.fg input,
.fg select,
.fg textarea {
  width: 100%;
  padding: 9px;
  border: 1px solid #94a3b8;
  border-radius: 6px;
  font-size: 14px;
}

.btn-p {
  width: 100%;
  padding: 12px;
  background: #2b5b9e;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
}

.btn-secondary {
  width: 100%;
  padding: 10px;
  margin-top: 9px;
  background: #fff;
  color: #2b5b9e;
  border: 1px solid #2b5b9e;
  border-radius: 8px;
  cursor: pointer;
}

.rbtn {
  width: 100%;
  padding: 13px;
  margin-bottom: 9px;
  border: 1px solid #2b5b9e;
  background: #fff;
  color: #1e3a5f;
  border-radius: 8px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  text-align: left;
}

.notice {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 12px;
}


@media (max-width: 600px) {
  header {
    padding: 10px;
  }

  .site-title {
    font-size: 12px;
  }

  .home-button,
  .login-button {
    padding: 6px 7px;
    font-size: 11px;
  }

  .cats {
    gap: 2px;
    padding: 5px;
  }

  .cat-btn {
    font-size: 11px;
    padding: 9px 2px;
  }

  .search select {
    max-width: 115px;
    font-size: 11px;
  }

  .page {
    padding: 20px 42px 150px;
  }
}

/* =========================
   フォント統一
========================= */

body,
body * {
  font-family: "游明朝", "Yu Mincho",
    "Hiragino Mincho ProN", "Noto Serif JP", serif !important;
}

button,
input,
select,
textarea,
option {
  font-family: inherit !important;
}

/* =========================
   楽譜・歌詞画像
========================= */
/* =========================
   楽譜・歌詞画像
========================= */

.page img.score-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 75vh;
  height: auto;
  object-fit: contain;
  margin: 20px auto;
}

/* スマホ表示 */
@media (max-width: 600px) {
  .page img.score-image {
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    max-height: none;
    height: auto;
    margin: 16px 0 16px 50%;
    transform: translateX(-50%);
  }
}