/* Den · 便签墙 — 前后叠放 */

@font-face {
  font-family: "InsLenggan";
  src: url("/fonts/ins-lenggan.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

#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: center;
  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-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}
#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-refresh {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .82);
  color: #6a5a68;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(90, 60, 80, .1);
  transition: transform .35s ease;
}
#page-den .den-note-refresh.is-spin {
  transform: rotate(360deg);
}
#page-den .den-note-stack.is-refreshing {
  opacity: .55;
  transition: opacity .2s ease;
}

#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: block;
  overflow: hidden;
  max-height: 100%;
  font-family: "InsLenggan", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: #1a1018 !important;
  opacity: 1 !important;
  visibility: visible !important;
  word-break: break-word;
  white-space: pre-wrap;
  text-shadow: 0 0 4px rgba(255,255,255,.95);
  -webkit-font-smoothing: none;
  font-smooth: never;
}

#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 !important;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  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,
#page-den .den-note-reroll,
#page-den .den-note-take {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 36px;
  padding: 9px 12px;
  border-radius: 999px;
  font: 600 13px/1 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(90, 60, 80, .1);
}
#page-den .den-note-write {
  border: 0;
  background: #4f3f4a !important;
  color: #fff !important;
}
#page-den .den-note-reroll {
  border: 1px solid rgba(120, 90, 110, .28);
  background: #fff !important;
  color: #5a4a55;
}
#page-den .den-note-take {
  border: 1px solid rgba(120, 90, 110, .28);
  background: #fff !important;
  color: #5a4a55;
}
#page-den .den-note-reroll:disabled,
#page-den .den-note-take:disabled {
  opacity: .45;
  cursor: default;
}
#page-den .den-note-hint {
  margin: 8px 0 0;
  text-align: center;
  color: #8a7484;
  font-family: "InsLenggan", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 12px;
  line-height: 1.35;
  letter-spacing: .04em;
  -webkit-font-smoothing: none;
  font-smooth: never;
  padding: 0 10px;
}

/* 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: "InsLenggan", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: clamp(14px, 4vw, 17px);
  line-height: 1.5;
  outline: none;
  -webkit-font-smoothing: none;
  font-smooth: never;
}
.den-note-sheet-ro {
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  text-shadow: none;
}
#page-den .den-note-wait {
  letter-spacing: .2em;
  opacity: .55;
}

.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; }

/* mutual notes — author chip + compose */
#page-den .den-note-author{
  position:absolute; top:10px; right:12px; z-index:2;
  font-size:10px; letter-spacing:.08em; padding:2px 7px; border-radius:999px;
  background:rgba(255,255,255,.55); color:rgba(60,48,58,.78);
  backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px);
  pointer-events:none; font-weight:600;
}
#page-den .den-note-author.is-me{
  background:rgba(176,96,127,.18); color:rgba(110,50,72,.92);
}
#page-den .den-note-post{
  min-width:64px; border:0; border-radius:999px; padding:8px 12px;
  font:inherit; font-size:12.5px; cursor:pointer;
  background:rgba(176,96,127,.16); color:rgba(90,40,60,.95);
}
#page-den .den-note-post:active{ transform:scale(.97); }
#page-den .den-note-post:disabled{ opacity:.35; }
.den-note-sheet-compose .den-note-sheet-ro{ display:none !important; }
.den-note-sheet-compose .den-note-sheet-input{
  display:block !important; position:absolute; inset:14% 12% 18%;
  width:auto; height:auto; resize:none; border:0; outline:none;
  background:transparent; font:inherit; font-size:15px; line-height:1.55;
  color:#3a2e34; z-index:2;
}
.den-note-sheet-input{ display:none; }
.den-note-sheet-compose .den-note-sheet-actions{
  display:flex; gap:8px; justify-content:flex-end; width:min(78vw,280px);
}
.den-note-sheet-compose .den-note-cancel{
  border:0; border-radius:999px; padding:9px 16px; font:inherit; font-size:13px;
  background:rgba(255,255,255,.55); color:#444; cursor:pointer;
}
.den-note-sheet-meta{
  width:min(78vw,280px); margin:0 0 6px; font-size:11px;
  color:rgba(255,255,255,.78); text-align:left;
}

/* reply thread under note sheet */
.den-note-thread{
  width:100%; max-height:min(34vh,220px); overflow:auto;
  display:flex; flex-direction:column; gap:6px;
  padding:4px 2px 0; -webkit-overflow-scrolling:touch;
}
.den-note-thread:empty{ display:none; }
.den-note-reply-row{
  display:flex; flex-direction:column; gap:2px;
  padding:7px 10px; border-radius:12px;
  background:rgba(255,255,255,.78); color:#3a2e34;
  font-size:13px; line-height:1.45;
  box-shadow:0 2px 8px rgba(40,28,45,.08);
}
.den-note-reply-row.is-me{ background:rgba(176,96,127,.14); }
.den-note-reply-who{
  font-size:10px; letter-spacing:.06em; opacity:.62; font-weight:600;
}
.den-note-reply-compose{
  display:flex; gap:8px; align-items:flex-end; width:100%;
}
.den-note-reply-compose[hidden]{ display:none !important; }
.den-note-reply-input{
  flex:1; min-height:38px; max-height:88px; resize:vertical;
  border:0; border-radius:14px; padding:9px 12px;
  font:inherit; font-size:13.5px; line-height:1.4;
  background:rgba(255,255,255,.92); color:#3a2e34;
  box-shadow:0 2px 10px rgba(40,28,45,.10);
}
.den-note-reply-send{
  flex:0 0 auto; border:0; border-radius:999px; padding:9px 14px;
  font:inherit; font-size:13px; cursor:pointer;
  background:rgba(176,96,127,.88); color:#fff;
}
.den-note-reply-send:disabled{ opacity:.4; }
#page-den .den-note-reply-btn{
  min-width:56px; border:0; border-radius:999px; padding:8px 11px;
  font:inherit; font-size:12.5px; cursor:pointer;
  background:rgba(176,96,127,.16); color:rgba(90,40,60,.95);
}
#page-den .den-note-chip-replies{
  position:absolute; left:10px; bottom:10px; z-index:2;
  font-size:10px; padding:2px 7px; border-radius:999px;
  background:rgba(40,28,45,.45); color:#fff; pointer-events:none;
}

#page-den .den-note-del{
  min-width:52px; border:0; border-radius:999px; padding:8px 11px;
  font:inherit; font-size:12.5px; cursor:pointer;
  background:rgba(228,93,97,.12); color:#c4484c;
}
#page-den .den-note-del:disabled{ opacity:.35; }
#page-den .den-note-del:active{ transform:scale(.97); }
.den-note-sheet-del{
  border:0; border-radius:999px; padding:9px 16px; font:inherit; font-size:13px;
  background:rgba(228,93,97,.14); color:#c4484c; cursor:pointer;
}


/* note / reply timestamps */
.den-note-sheet-at{
  position:absolute; right:10px; bottom:8px; z-index:2;
  margin:0; padding:2px 7px; border-radius:999px;
  font:500 10px/1.3 -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
  letter-spacing:.02em;
  color:rgba(62,48,58,.78);
  background:rgba(255,255,255,.72);
  backdrop-filter:blur(4px); -webkit-backdrop-filter:blur(4px);
  pointer-events:none; user-select:none;
}
.den-note-sheet-at:empty{ display:none; }
.den-note-sheet-compose .den-note-sheet-at{ display:none !important; }
.den-note-reply-row{ position:relative; padding-bottom:18px; }
.den-note-reply-at{
  position:absolute; right:10px; bottom:6px;
  font-size:10px; line-height:1; letter-spacing:.02em;
  color:rgba(90,70,85,.55); pointer-events:none;
}
