body {
  position: relative;
  font-family: 'Shippori Mincho B1', serif;
  letter-spacing: 0.15em;
  background-color: #fdfdfb;
  color: #333;
  padding: 40px 10%;
  line-height: 2.0;
  z-index: 0;
  overflow-x: hidden;
  font-size: 14px;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("/static/paper_texture.png");
  background-repeat: repeat;
  background-size: auto;
  opacity: 0.2;
  z-index: -1;
  pointer-events: none;
}

h2 {
  margin-top: 60px;
  font-size: 1.4em;
  color: #555;
}

.entry {
  margin-bottom: 40px;
  opacity: 0.9;
}

.content {
  margin-top: 0.5em;
  white-space: pre-line;
}

.diary-block {
  margin-top: 0em;
  margin-bottom: 0em;
}

/* === Pager === */
.pager {
  margin: 48px auto 16px;
  padding: 8px 0;
  text-align: center;
}

.pager-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 10px;
  vertical-align: middle;
}

.pager-item,
.pager-prev,
.pager-next {
  display: inline-block;
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 9999px;
  text-decoration: none;
  color: #333;
  background: #fdfdfb;
  line-height: 1.25;
}

.pager-item:hover,
.pager-prev:hover,
.pager-next:hover {
  transform: translateY(-1px);
}

.pager-item.is-current {
  font-weight: 600;
  border-color: #555;
  cursor: default;
}

.pager a:focus,
.pager-item:focus,
.pager-prev:focus,
.pager-next:focus {
  outline: 2px solid #555;
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .pager-item,
  .pager-prev,
  .pager-next {
    padding: 6px 10px;
  }
}

/* 数字位置調整 */
.pager-item,
.pager-prev,
.pager-next {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  letter-spacing: 0;
  box-sizing: border-box;
}

.pager-item {
  min-width: 2.8ch;
  text-align: center;
}

/* === 縦棒 === */
.diary-divider {
  width: 0;
  height: 10em;
  margin: 42px auto 34px;
  border-left: 0.5px solid rgba(0, 0, 0, .15);
}

:root { --divider-lines: 3; }
.diary-divider { height: calc(var(--divider-lines) * 2em); }

.diary-divider[data-aos="fade-up"] {
  will-change: transform, opacity;
}

/* === Shuffleボタン === */

/* OFF状態 */
#shuffle-btn {
  isolation: isolate;
  position: fixed;
  overflow: hidden;
  bottom: 32px;
  right: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3); /* 透明度 */
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow:
      0 2px 6px rgba(0, 0, 0, 0.1),
      inset 0 0 3px rgba(255, 255, 255, 0.6);
  cursor: pointer;
  opacity: 0.92;
  transition: background 0.6s ease, opacity 0.6s ease, box-shadow 0.6s ease;
  z-index: 1000;

  backdrop-filter: blur(20px) saturate(150%); /* 背景ぼかし */
  -webkit-backdrop-filter: blur(20px) saturate(150%); /* Safari対応 */
}

/* hover時（OFF） */
/* #shuffle-btn:hover {
  opacity: 1;
} */

/* ON状態：背景グレー＋アイコン白 */
#shuffle-btn.is-active {
  background: rgba(60, 60, 60, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.2);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.25),
    inset 0 0 4px rgba(255, 255, 255, 0.2);
  opacity: 1;
}

/* アイコン共通（OFF） */
#shuffle-btn img {
  width: 22px;
  height: 22px;
  display: block;
  margin: auto;
  opacity: 0.7;
  filter: brightness(1.1) grayscale(1);
  transition: opacity 0.6s ease, filter 0.6s ease;
  transform: translateZ(0); /* GPUレイヤーを常に生成 */
  backface-visibility: hidden;
}

/* ON状態のアイコン（白く反転） */
#shuffle-btn.is-active img {
  opacity: 0.95;
  filter: invert(1) brightness(1.6);
}

/* 回転アニメーション */
@keyframes rotate-once {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 回転だけ適用（transform競合なし） */
#shuffle-btn.spin img {
  animation: rotate-once 0.6s ease-in-out;
  transform-origin: center center;
}