/* marshmallow.css — 棉花糖留言板.
   Shared page chrome (.page-wrap, .page-header, .tag-bar, .tag-btn,
   .btn) lives in theme.css; only the submit card + message list are
   styled here. */

/* Event chips reuse .tag-bar/.tag-btn from theme.css via JS classes. */

/* Candy-tinted bg orbs — every page declares its own colors; 棉花糖
   leans pink over the site blue. */
.orb1 { --c: #ecb8d2; width: 520px; height: 520px; top: -150px; left: -150px; opacity: 0.3; animation: orb-drift1 20s ease-in-out infinite; }
.orb2 { --c: #b0d4e8; width: 400px; height: 400px; bottom: -80px; right: -100px; opacity: 0.28; animation: orb-drift2 24s ease-in-out infinite; }

.mhm-body { max-width: 780px; margin: 0 auto; position: relative; z-index: 1; }

.mhm-event-desc {
  text-align: center; color: var(--text2); font-size: 13px;
  margin: 0 0 14px; white-space: pre-wrap;
}

/* ── Submit card ── */
.mhm-form-card {
  max-width: 640px;
  background: var(--surface);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border: 1px solid var(--surface-hover);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 14px;
  margin: 0 auto 26px;
}
.mhm-form-card textarea {
  width: 100%; box-sizing: border-box; resize: vertical;
  min-height: 84px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface-muted); color: var(--text);
  font: inherit; font-size: 13px; padding: 10px 12px;
  outline: none; transition: border-color .15s;
}
.mhm-form-card textarea:focus { border-color: var(--border-hover); }
.mhm-form-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 10px;
}
.mhm-form-row input[type="text"] {
  flex: 0 1 150px; min-width: 110px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface-muted); color: var(--text);
  font: inherit; font-size: 12px; padding: 6px 10px;
  outline: none; transition: border-color .15s;
}
.mhm-form-row input[type="text"]:focus { border-color: var(--border-hover); }
.mhm-form-row input[type="text"]:disabled { opacity: .45; cursor: not-allowed; }
.mhm-anon-label {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text2); cursor: pointer;
  user-select: none; white-space: nowrap;
}
.mhm-identity { font-size: 11px; color: var(--text3); flex: 1; min-width: 0; }
/* flex:none overrides .btn's flex:1 so margin-left:auto actually pins
   it right at natural width — otherwise it grows to share the row with
   the flex:1 identity hint. */
.mhm-form-row .btn { flex: none; margin-left: auto; }
.mhm-form-hint { font-size: 12px; margin-top: 8px; min-height: 15px; }

/* Narrow screens: the row used to wrap into an awkward 2-2-1. Pin it
   to 署名+匿名 / 身份提示 / full-width button instead. */
@media (max-width: 640px) {
  .mhm-form-row input[type="text"] { flex: 1 1 0; min-width: 0; }
  .mhm-identity { flex-basis: 100%; order: 3; }
  .mhm-identity:empty { display: none; }
  .mhm-form-row .btn { flex-basis: 100%; margin-left: 0; order: 4; }
}
.mhm-form-hint.ok  { color: #4d9e6e; }
.mhm-form-hint.err { color: #c96a6a; }

.mhm-closed-hint {
  text-align: center; color: var(--text3); font-size: 13px;
  padding: 18px 0 26px;
}

/* ── Message list — two-column masonry, same vocabulary as /fanart's
      gallery; single column on narrow screens. ── */
.mhm-list { columns: 2; column-gap: 12px; }
@media (max-width: 640px) { .mhm-list { columns: 1; } }
.mhm-card {
  position: relative;
  break-inside: avoid;
  margin-bottom: 12px;
  background: var(--surface);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  border: 1px solid var(--surface-hover);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: 12px 14px;
  transition: box-shadow .22s, border-color .22s;
}
.mhm-card:hover {
  box-shadow: 0 10px 28px rgba(var(--blue-rgb), 0.12);
  border-color: var(--surface-strong);
}
/* A tiny resident star in each card's corner; wakes up on hover.
   ::before, not ::after: the holo shine (theme.css [data-tilt]::after)
   already owns ::after, and an element only gets one of each. Sharing it
   merged the two — the shine inherited the star's little top-right box
   (so the gradient sat off-card and spilled past the corner), showed at
   the star's 0.3 opacity even at rest instead of only when lit, and got
   rotated 20° on hover by the star's transform. */
.mhm-card::before {
  content: '✦';
  position: absolute; top: 8px; right: 11px;
  z-index: 4;                 /* above the shine layer (z-index 3) */
  font-size: 11px; color: var(--bow);
  opacity: .3; transition: opacity .25s, transform .25s;
  pointer-events: none;
}
.mhm-card:nth-child(even)::before { content: '✧'; }
.mhm-card:hover::before {
  opacity: .9;
  transform: rotate(20deg) scale(1.25);
  text-shadow: 0 0 6px rgba(var(--bow-rgb), 0.8);
}
.mhm-card-content {
  font-size: 13.5px; color: var(--text); line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
}
.mhm-card-meta {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px; font-size: 11px; color: var(--text3);
}
.mhm-card-name { color: var(--text2); }
.mhm-card-event {
  margin-left: auto;
  font: inherit; font-size: 10px; cursor: pointer;
  padding: 1px 9px; border-radius: var(--r-full);
  border: 1px solid var(--border);
  background: var(--surface-muted); color: var(--text2);
  transition: all .15s;
}
.mhm-card-event:hover { border-color: var(--border-hover); background: var(--surface-hover); }
.mhm-reply {
  margin-top: 10px; padding: 9px 12px;
  background: rgba(var(--bow-rgb), 0.22);
  border-left: 3px solid var(--bow);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: 13px; color: var(--text); line-height: 1.65;
  white-space: pre-wrap; word-break: break-word;
}
.mhm-reply-label {
  display: block; font-size: 11px; color: var(--text2);
  margin-bottom: 3px;
}

.empty-hint {
  text-align: center; color: var(--text3);
  font-size: 13px; padding: 40px 0;
  position: relative; z-index: 1;
}

/* ── Submit-success star burst (spawned by JS on the button) ── */
.mhm-burst-star {
  position: fixed; z-index: 9999; pointer-events: none;
  color: var(--bow); font-size: 15px; user-select: none;
  animation: mhm-burst var(--dur, .8s) ease-out forwards;
}
@keyframes mhm-burst {
  0%   { opacity: 1; transform: translate(0, 0) scale(.6) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--dx, 0), var(--dy, -80px)) scale(1.3) rotate(90deg); }
}
@media (prefers-reduced-motion: reduce) {
  .mhm-burst-star { animation: none; opacity: 0; }
}
