/* ============================================================
   diary.css — 日记模块：与散文同款纸张，横线手账 + 霞鹜文楷
   ============================================================ */

.diary-paper { background: #fdfbf4; border-color: #e8dfc8; }
.diary-paper::before { opacity: .035; }

/* 手账封面头 */
.diary-cover-head {
  text-align: center;
  position: relative;
  padding: 26px 0 30px;
  margin-bottom: 30px;
  border-bottom: 1px dashed #e0d4b5;
}
.diary-cover-head .tape {
  position: absolute;
  width: 92px; height: 26px;
  background: repeating-linear-gradient(45deg,
    rgba(245, 165, 36, .4) 0 8px,
    rgba(250, 195, 100, .4) 8px 16px);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .1);
  clip-path: polygon(2% 0, 98% 6%, 100% 94%, 0 100%);
  pointer-events: none;
}
.diary-cover-head .tape.t1 { top: -12px; left: 16%; transform: rotate(-5deg); }
.diary-cover-head .tape.t2 { top: -10px; right: 14%; transform: rotate(4deg); }
.dch-label {
  font-size: 12px;
  letter-spacing: .5em;
  text-indent: .5em;
  color: #c99b3f;
  font-weight: 700;
}
.dch-title {
  font-family: var(--font-kai);
  font-size: clamp(24px, 3.6vw, 34px);
  color: #3d3a34;
  font-weight: 700;
  margin: 12px 0 10px;
  line-height: 1.5;
}
.dch-date {
  font-family: var(--font-kai);
  color: #a3967d;
  font-size: 13.5px;
  letter-spacing: .18em;
}
.dch-stamp {
  display: inline-block;
  margin-top: 16px;
  font-family: var(--font-brush);
  color: #fff;
  background: #b3342e;
  border-radius: 4px;
  padding: 4px 9px;
  font-size: 14px;
  transform: rotate(3deg);
  letter-spacing: 2px;
  box-shadow: inset 0 0 5px rgba(80, 10, 10, .5);
}

/* 正文：横线纸（行高 33px 与条纹严格对齐）+ 文楷 */
.diary-body {
  font-family: var(--font-kai);
  font-size: 17px;
  line-height: 33px;
  color: #3d3a34;
  letter-spacing: .02em;
  text-align: justify;
  background: repeating-linear-gradient(transparent 0 32px, rgba(120, 144, 178, .22) 32px 33px);
  padding-left: 0;  /* 正文顶着横线起点书写 */
  max-width: 40em;  /* 与散文页 .essay-body 同宽，保证两张纸宽度一致 */
  margin: 0 auto;
}
/* 首元素从第一根横线起排 */
.diary-body > :first-child { margin-top: 0; }
.diary-body p { margin: 0; }
.diary-body h1, .diary-body h2, .diary-body h3 {
  font-family: var(--font-kai);
  color: #2f4d3a;
  font-size: 20px;
  line-height: 33px;
  /* 标题占整行（33px）且间距为整行倍数，保证正文始终落在横线上 */
  margin: 33px 0 0;
}
.diary-body h2 { color: #8a5a17; }
.diary-body img {
  max-width: 82%;
  border-radius: 4px;
  margin: 14px auto;
  box-shadow: 0 8px 20px rgba(80, 60, 20, .24);
  transform: rotate(-1.4deg);
  background: #fff;
  padding: 6px 6px 22px;
}
.diary-body blockquote {
  margin: .6em 0;
  padding: 2px 14px;
  border-left: 3px solid #f5a524;
  color: #6b6353;
  text-indent: 0;
}
.diary-body code { font-family: var(--font-mono); font-size: .82em; background: rgba(245, 165, 36, .18); padding: 0 5px; border-radius: 4px; }
.diary-body pre {
  background: #2f3a46;
  color: #e8edf2;
  padding: 12px 14px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.6;
}
.diary-body a { color: #b97a1e; text-decoration: underline; text-underline-offset: 3px; }
.diary-body ul, .diary-body ol { padding-left: 1.4em; }
.diary-body li { margin-bottom: 2px; }

@media (max-width: 640px) {
  .diary-body { font-size: 16px; line-height: 31px;
    background: repeating-linear-gradient(transparent 0 30px, rgba(120, 144, 178, .22) 30px 31px);
  }
  .diary-body h1, .diary-body h2, .diary-body h3 { margin-top: 31px; }
}
