/* Den · 便签墙 — 前后叠放 */

#page-den .den-home > .den-note-wall {
  display: block !important;
  grid-column: 1 / -1 !important;
  margin: 14px 2px 8px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

#page-den .den-note-wall-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 2px 10px;
  color: #6a5a68;
}
#page-den .den-note-wall-head span {
  font: 600 13px/1 -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", sans-serif;
  letter-spacing: .06em;
}
#page-den .den-note-wall-head small {
  font: italic 10px/1 Georgia, "Times New Roman", serif;
  color: #b39aab;
  letter-spacing: .14em;
}

#page-den .den-note-stage {
  display: flex;
  justify-content: center;
  padding: 10px 8px 6px;
  touch-action: pan-y;
}

#page-den .den-note-stack {
  position: relative;
  width: min(58vw, 210px);
  aspect-ratio: 1 / 1;
  margin: 0 auto 8px;
}

#page-den .den-note-stack .den-note {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 18% 14% 20%;
  border: 0;
  border-radius: 12px;
  background-color: #fff;
  background-image: var(--bg);
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  color: #5a4a55;
  text-align: left;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, .55) inset,
    0 10px 22px rgba(90, 60, 80, .14),
    0 2px 4px rgba(90, 60, 80, .06);
  transform-origin: 50% 80%;
  transition:
    transform .42s cubic-bezier(.22, .9, .28, 1),
    opacity .32s ease,
    filter .32s ease;
  overflow: hidden;
  pointer-events: none;
}
#page-den .den-note-stack .den-note.is-front {
  pointer-events: auto;
  cursor: grab;
}

#page-den .den-note-stack .den-note[data-depth="0"] {
  z-index: 5;
  transform: translate3d(0, 0, 0) rotate(-1.2deg) scale(1);
  opacity: 1;
  filter: none;
}
#page-den .den-note-stack .den-note[data-depth="1"] {
  z-index: 4;
  transform: translate3d(10px, 12px, 0) rotate(2.4deg) scale(.96);
  opacity: .96;
}
#page-den .den-note-stack .den-note[data-depth="2"] {
  z-index: 3;
  transform: translate3d(-8px, 20px, 0) rotate(-3.2deg) scale(.92);
  opacity: .9;
}
#page-den .den-note-stack .den-note[data-depth="3"] {
  z-index: 2;
  transform: translate3d(14px, 28px, 0) rotate(4deg) scale(.88);
  opacity: .78;
}

#page-den .den-note-stack.flip-next .den-note.is-front {
  transform: translate3d(-118%, -8%, 0) rotate(-18deg) scale(.92);
  opacity: 0;
}
#page-den .den-note-stack.flip-prev .den-note.is-front {
  transform: translate3d(118%, -8%, 0) rotate(18deg) scale(.92);
  opacity: 0;
}

#page-den .den-note-body {
  position: relative;
  z-index: 1;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  overflow: hidden;
  max-height: 100%;
  font-family: "Ma Shan Zheng", "Long Cang", "Segoe Print", "Bradley Hand", cursive;
  font-size: 13px;
  line-height: 1.35;
  color: #4a3a44;
  word-break: break-word;
  white-space: pre-wrap;
  text-shadow: 0 0 2px rgba(255,255,255,.85);
}

#page-den .den-note-plus {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  height: 100%;
  color: rgba(120, 100, 115, .45);
  font: 300 28px/1 Georgia, serif;
  text-shadow: 0 0 3px rgba(255,255,255,.9);
}

#page-den .den-note-dock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}
#page-den .den-note-nav {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .82);
  color: #5a4a55;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(90, 60, 80, .1);
}
#page-den .den-note-write {
  min-width: 72px;
  padding: 10px 14px;
  border: 0;
  border-radius: 999px;
  background: #4f3f4a;
  color: #fff;
  font: 600 13px/1 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(80, 50, 70, .16);
}
#page-den .den-note-take {
  min-width: 64px;
  padding: 10px 12px;
  border: 1px solid rgba(120, 90, 110, .22);
  border-radius: 999px;
  background: rgba(255, 255, 255, .88);
  color: #6a5a68;
  font: 600 13px/1 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(90, 60, 80, .08);
}
#page-den .den-note-hint {
  margin: 8px 0 0;
  text-align: center;
  color: #b39aab;
  font: 11px/1.2 ui-monospace, monospace;
  letter-spacing: .08em;
}

/* editor sheet */
.den-note-sheet {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(40, 28, 45, .32);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
}
.den-note-sheet.open { display: flex; }

.den-note-sheet-wrap {
  position: relative;
  width: min(92vw, calc(100dvh - 140px), 440px);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.den-note-sheet-close {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: #6a5a68;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(40, 28, 45, .16);
}

.den-note-sheet-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 18px 40px rgba(50, 30, 50, .22);
}

.den-note-sheet-paper {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

.den-note-sheet-text {
  position: absolute;
  left: 16%;
  right: 16%;
  top: 16%;
  bottom: 20%;
  z-index: 1;
  border: 0;
  padding: 4px;
  resize: none;
  background: transparent;
  color: #4f3f4a;
  font-family: "Ma Shan Zheng", "Long Cang", "Segoe Print", cursive;
  font-size: clamp(16px, 4.6vw, 20px);
  line-height: 1.55;
  outline: none;
}

.den-note-sheet-actions {
  display: flex;
  gap: 8px;
}
.den-note-sheet-actions button {
  flex: 1;
  border: 0;
  border-radius: 12px;
  padding: 11px 12px;
  font: 600 14px/1 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  cursor: pointer;
}
.den-note-reroll { background: rgba(255, 255, 255, .92); color: #6a5a68; }
.den-note-clear { background: rgba(255, 255, 255, .72); color: #7a6a78; }
.den-note-save { background: #4f3f4a; color: #fff; }
