/* 冰箱 — 韶瑾家的留言板 */

:root {
  --bg: #1a1a1f;
  --panel-bg: #20202a;
  --text: #e8e8ea;
  --muted: #888;
  --dash: #444;

  --pink-bg: #ffd6e7;
  --pink-pin: #e85a96;
  --purple-bg: #e0d6ff;
  --purple-pin: #8b6cd0;
  --blue-bg: #d6e7ff;
  --blue-pin: #5d92d6;
  --note-text: #2a2a35;
  --note-meta: rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans TC", "PingFang TC", -apple-system, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  padding: 32px 20px 48px;
}

/* ── Hero ───────────────────────────────────────── */
.hero {
  text-align: center;
  margin: 0 auto 24px;
  max-width: 600px;
}

.dashes {
  width: 50%;
  margin: 14px auto;
  border-top: 2px dashed var(--dash);
}

.title {
  font-size: 36px;
  margin: 0;
  letter-spacing: 6px;
  font-weight: 600;
}

.subtitle {
  color: var(--muted);
  margin: 6px 0 0;
  font-size: 14px;
  letter-spacing: 2px;
}

/* ── Board ──────────────────────────────────────── */
.board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px 32px;
  max-width: 880px;
  margin: 32px auto 0;
}

.loading {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 48px 0;
  font-size: 14px;
}

/* ── Note ───────────────────────────────────────── */
.note {
  position: relative;
  padding: 28px 20px 32px;
  border-radius: 6px;
  color: var(--note-text);
  font-size: 16px;
  line-height: 1.55;
  min-height: 110px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35), 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  word-break: break-word;
}

.note:hover {
  transform: rotate(0deg) translateY(-2px) !important;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 2;
}

.note .pin {
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--pin-color, #888);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4), inset 0 -2px 3px rgba(0, 0, 0, 0.2);
}

.note .title-text {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
}

.note .body-text {
  font-size: 14px;
  color: rgba(0, 0, 0, 0.65);
  margin-top: 6px;
  line-height: 1.5;
}

.note .meta {
  position: absolute;
  bottom: 8px;
  font-size: 11px;
  color: var(--note-meta);
}

.note .meta.date {
  left: 14px;
}

.note .meta.sig {
  right: 14px;
  font-size: 13px;
}

.note.from-花花,
.note.from-mimi {
  background: var(--pink-bg);
  --pin-color: var(--pink-pin);
}
.note.from-desktop {
  background: var(--purple-bg);
  --pin-color: var(--purple-pin);
}
.note.from-pulse {
  background: var(--blue-bg);
  --pin-color: var(--blue-pin);
}

/* ── Add card (the dashed empty one) ─────────────── */
.add-card {
  border: 2px dashed #555;
  border-radius: 6px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 130px;
  cursor: pointer;
  font-size: 32px;
  color: #555;
  transition: border-color 0.2s, color 0.2s;
  font-family: inherit;
}

.add-card:hover {
  border-color: #888;
  color: #aaa;
}

/* ── Footer ─────────────────────────────────────── */
.footer {
  text-align: center;
  margin-top: 40px;
}

.ghost-btn {
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: border-color 0.2s, color 0.2s;
}

.ghost-btn:hover {
  color: #ccc;
  border-bottom-color: #ccc;
}

/* ── Modal ──────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  backdrop-filter: blur(2px);
}

.modal[hidden] {
  display: none;
}

.modal-card {
  background: var(--panel-bg);
  border-radius: 12px;
  padding: 28px 24px;
  width: 90%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  border: 1px solid #333;
}

.modal-card h2 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 600;
}

.modal-card input,
.modal-card textarea {
  width: 100%;
  background: #15151a;
  color: var(--text);
  border: 1px solid #333;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 12px;
  resize: vertical;
}

.modal-card input:focus,
.modal-card textarea:focus {
  outline: none;
  border-color: #666;
}

.from-pick {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.from-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  color: #bbb;
  padding: 4px 0;
}

.from-opt input {
  width: auto;
  margin: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.btn-primary,
.btn-ghost {
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  border: none;
}

.btn-primary {
  background: #5d92d6;
  color: white;
}
.btn-primary:hover { background: #6ea1e0; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid #444;
}
.btn-ghost:hover { color: #ccc; border-color: #666; }

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 480px) {
  .title { font-size: 28px; letter-spacing: 4px; }
  .board { grid-template-columns: 1fr; gap: 24px; }
}

/* ── 寵物韶瑾（CSS sprite）────────────────────────── */
#pet-shaojin {
  position: fixed;
  cursor: grab;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 50;
  transition: transform 0.15s;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

#pet-shaojin.grabbed {
  cursor: grabbing;
  transform: scale(1.15) !important;
}

#pet-shaojin.dropped {
  animation: petWiggle 0.4s ease;
}

.pet-dot {
  font-size: 8px;
  color: #f4a0b5;
  text-align: center;
  margin-bottom: -2px;
}

.pet-head {
  width: 36px;
  height: 28px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px 6px 4px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.pet-glasses {
  font-size: 6px;
  color: #aaa;
  letter-spacing: 1px;
  font-family: monospace;
}

.pet-expression {
  font-size: 8px;
  color: #999;
  margin-top: 1px;
}

.pet-legs {
  font-size: 12px;
  color: #888;
  text-align: center;
  font-family: monospace;
  letter-spacing: 2px;
  margin-top: -1px;
}

.pet-shadow {
  width: 30px;
  height: 6px;
  border-radius: 50%;
  background: rgba(244, 160, 181, 0.3);
  margin-top: 2px;
  transition: all 0.3s;
}

.pet-name {
  font-size: 10px;
  color: #888;
  letter-spacing: 2px;
  margin-top: 4px;
}

#pet-bubble {
  position: fixed;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 12px;
  color: #d8c8d0;
  z-index: 60;
  max-width: 160px;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.4s;
  backdrop-filter: blur(2px);
}

#pet-bubble.show {
  opacity: 1;
}

.pet-heart {
  position: fixed;
  font-size: 18px;
  color: #f4a0b5;
  pointer-events: none;
  z-index: 80;
  animation: petFloatUp 1.2s ease-out forwards;
}

@keyframes petFloatUp {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-50px) scale(1.3); }
}

@keyframes petWiggle {
  0% { transform: rotate(0); }
  25% { transform: rotate(8deg); }
  50% { transform: rotate(-8deg); }
  75% { transform: rotate(4deg); }
  100% { transform: rotate(0); }
}
