/* ── 日记详情弹窗 ─────────────────────────────────────────────── */
#diary-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#diary-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(3px);
}

#diary-modal-box {
  position: relative;
  background: var(--surface);
  border-radius: 16px;
  padding: 28px 28px 24px;
  width: 100%;
  max-width: 480px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 12px 48px rgba(0,0,0,.18);
  animation: modal-in .18s ease-out;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to   { opacity: 1; transform: none; }
}

#diary-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 16px;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
#diary-modal-close:hover { color: var(--text); }

.dm-date { font-size: 12px; color: var(--muted); letter-spacing: 1px; margin-bottom: 16px; }
.dm-mood-row { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.dm-mood-emoji { font-size: 32px; }
.dm-feeling {
  font-size: 13px;
  color: var(--muted);
  background: var(--accent-bg);
  padding: 3px 10px;
  border-radius: 20px;
}
.dm-activities { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.dm-highlight {
  font-size: 14px;
  line-height: 1.8;
  border-left: 2px solid var(--accent);
  padding-left: 14px;
  color: var(--text);
  margin-bottom: 20px;
}
.dm-encounter { border-top: 1px solid var(--border); padding-top: 18px; margin-top: 4px; }
.dm-enc-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.dm-enc-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: #fff;
  flex-shrink: 0;
}
.dm-enc-name { font-size: 14px; font-weight: 500; }
.dm-enc-meta { font-size: 11px; color: var(--muted); }
.dm-enc-response { font-size: 14px; line-height: 1.9; color: var(--text); margin-bottom: 12px; }
.dm-enc-story { font-size: 13px; line-height: 1.9; color: var(--muted); margin-bottom: 12px; }
.dm-enc-fav { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }

/* ── 剧情回顾区块 ─────────────────────────────────────────────── */
.dm-story-recap { border-top: 1px solid var(--border); padding-top: 18px; margin-top: 4px; display: flex; flex-direction: column; gap: 14px; }
.dm-recap-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.dm-recap-header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.dm-recap-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #fff; font-weight: 600; flex-shrink: 0;
}
.dm-recap-name { font-size: 14px; font-weight: 500; }
.dm-recap-title { font-size: 11px; color: var(--muted); }
.dm-recap-diary { font-size: 13px; line-height: 1.9; color: var(--text); margin-bottom: 10px; }
.dm-recap-choice {
  display: flex; align-items: baseline; gap: 8px;
  padding: 8px 10px; background: var(--surface);
  border-radius: 6px; border-left: 3px solid var(--accent);
}
.dm-recap-choice-label { font-size: 11px; color: var(--muted); white-space: nowrap; }
.dm-recap-choice-text { font-size: 12px; color: var(--text); }
.dm-recap-ending-badge {
  display: inline-block; font-size: 11px; padding: 3px 10px;
  background: linear-gradient(135deg, #f5c842, #e8a020);
  color: #fff; border-radius: 20px; font-weight: 500;
}

/* ── 日记详情底部 ─────────────────────────────────────────────── */
.dm-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.dm-edit-btn {
  font-size: 13px;
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
  font-family: var(--font);
}
.dm-edit-btn:hover { border-color: var(--accent); color: var(--accent); }


/* ── 个人资料弹窗 ─────────────────────────────────────────────── */
#profile-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
#profile-modal[hidden] { display: none; }
#profile-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.35);
}
#profile-modal-box {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  width: min(360px, 90vw);
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
}
#profile-modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none; border: none;
  font-size: 16px; color: var(--muted);
  cursor: pointer; line-height: 1;
}
#profile-modal-close:hover { color: var(--text); }
.pm-title { font-size: 16px; font-weight: 500; margin-bottom: 24px; }
.pm-field { margin-bottom: 18px; }
.pm-label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 6px; }
.pm-hint { font-size: 11px; color: var(--muted); opacity: .7; margin-left: 4px; }
.pm-username { font-size: 14px; color: var(--text); }
.pm-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color .15s;
}
.pm-input:focus { border-color: var(--accent); }
.pm-error { font-size: 13px; color: #c04040; margin-bottom: 12px; }
.pm-save { width: 100%; margin-top: 4px; }
.pm-privacy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.pm-privacy-row:last-child { border-bottom: none; }
