/* ==========================================================================
   14. 闲言碎语 / 留言板 / 笔记页
   ========================================================================== */

/* ---------------------------------------------------------------- 通用小件 */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-3);
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--ink-3);
}

.pill--owner {
  border-color: color-mix(in srgb, var(--warm, #e8895f) 45%, transparent);
  background: color-mix(in srgb, #e8895f 12%, transparent);
  color: #a85a32;
}

[data-theme="dark"] .pill--owner {
  color: #e8a06f;
}

.form-notice {
  margin: 18px 0 0;
  padding: 12px 16px;
  border-radius: var(--radius);
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  font-size: 14px;
  color: var(--ink-2);
}

.form-notice--ok { border-left-color: #3f9e6f; }
.form-notice--err { border-left-color: #b23b2e; }

.widget-text { margin-top: 12px; font-size: 13.5px; line-height: 1.8; color: var(--ink-2); }

/* ---------------------------------------------------------------- 发布器 */
.composer {
  margin-top: 22px;
  padding: 18px 20px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-2);
  box-shadow: var(--shadow-1);
}

.composer-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  font-size: 13.5px;
  color: var(--ink-2);
}

.composer-who { font-weight: 600; color: var(--ink); }

.composer-form textarea {
  width: 100%;
  min-height: 88px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 16.5px;
  line-height: 1.8;
  color: var(--ink);
  resize: vertical;
}

.composer-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.token-field {
  display: block;
  margin-bottom: 12px;
  font-size: 12.5px;
  color: var(--ink-3);
}

.token-field span { display: block; margin-bottom: 5px; }

.token-field input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 14px;
  letter-spacing: 0.08em;
}

.token-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.composer-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.counter {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.counter.is-near { color: #a85a32; }
.counter.is-over { color: #b23b2e; }

/* ---------------------------------------------------------------- 图片上传 */
.composer-media {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.media-pick {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  background: var(--bg);
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 0.18s var(--ease);
}

.media-pick:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.media-pick svg { width: 16px; height: 16px; }

.media-hint {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink-3);
}

.media-error {
  margin: 10px 0 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  border-left: 3px solid #b23b2e;
  background: rgba(178, 59, 46, 0.08);
  font-size: 12.5px;
  color: #8f2f25;
}

[data-theme="dark"] .media-error { color: #e89286; }

.composer-previews {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.composer-previews[hidden] { display: none; }

.preview-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-3);
  aspect-ratio: 1 / 1;
}

.preview-item img { width: 100%; height: 100%; object-fit: cover; }

.preview-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(10, 11, 13, 0.66);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  backdrop-filter: blur(4px);
}

.preview-remove:hover { background: rgba(10, 11, 13, 0.88); }

/* 碎语配图 */
.musing-main { min-width: 0; }

.musing-media {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.musing-media--1 { grid-template-columns: minmax(0, 1fr); max-width: 520px; }
.musing-media--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.musing-media--3,
.musing-media--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.musing-media img {
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  cursor: zoom-in;
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

.musing-media img:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-1);
}

@media (max-width: 620px) {
  .composer-previews { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .musing-media--1 { max-width: none; }
}

/* ---------------------------------------------------------------- 碎语列表 */
.musing-list { list-style: none; margin-top: 26px; }

.musing-day {
  margin-top: 26px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}

.musing-day:first-child { margin-top: 6px; }

.musing-item {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.musing-time {
  padding-top: 3px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.musing-body { font-size: 16px; line-height: 1.85; color: var(--ink); }
.musing-body > * + * { margin-top: 0.7em; }
.musing-body a { border-bottom: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); }

/* ---------------------------------------------------------------- 留言板 */
.gb-board {
  margin-top: 22px;
  padding: 30px 26px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background-color: var(--bg-3);
  background-image: radial-gradient(rgba(23, 24, 26, 0.055) 1px, transparent 1.2px);
  background-size: 18px 18px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .gb-board {
  background-image: radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1.2px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.gb-form {
  position: relative;
  margin: 0 0 26px;
  padding: 22px 22px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 14px 26px -22px rgba(23, 24, 26, 0.45);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}

.gb-form::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  width: 58px;
  height: 16px;
  transform: translateX(-50%) rotate(-2.2deg);
  background: repeating-linear-gradient(115deg, rgba(232, 137, 95, 0.26) 0 6px, rgba(232, 137, 95, 0.16) 6px 12px);
  border-radius: 2px;
}

.gb-form-title {
  grid-column: 1 / -1;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.gb-field { display: block; margin: 0; }
.gb-field--wide { grid-column: 1 / -1; }

.gb-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 12.5px;
  color: var(--ink-3);
}

.gb-field input,
.gb-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 15px;
  color: var(--ink);
}

.gb-field input { height: 42px; }
.gb-field textarea { min-height: 96px; resize: vertical; }

.gb-field input:focus,
.gb-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.gb-hint { display: block; margin-top: 5px; font-size: 11.5px; color: var(--ink-3); }

.gb-hp {
  position: absolute !important;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.gb-form .submit {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
}

/* comment_form 自带的两个段落也要占满整行 */
.gb-form .form-submit {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  margin: 0;
}

.gb-form .comment-form-cookies-consent {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-3);
}

.gb-form .comment-form-cookies-consent input {
  width: 15px;
  height: 15px;
  margin-top: 3px;
  flex: none;
  accent-color: var(--accent);
}

.gb-form .comment-form-cookies-consent label {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-3);
}

.gb-notes {
  columns: 2;
  column-gap: 22px;
}

@media (max-width: 780px) {
  .gb-form { grid-template-columns: 1fr; padding: 20px 18px 16px; }
  .gb-notes { columns: 1; }
}

.gb-note {
  position: relative;
  break-inside: avoid;
  margin: 0 0 20px;
  padding: 18px 18px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset, 0 14px 26px -22px rgba(23, 24, 26, 0.45);
  transform: rotate(-0.35deg);
  transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

.gb-note:nth-child(3n + 2) { transform: rotate(0.3deg); }
.gb-note:nth-child(3n) { transform: rotate(0deg); }
.gb-note:hover { transform: rotate(0deg) translateY(-2px); box-shadow: var(--shadow-1); }

.gb-note:nth-child(4n + 1)::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  width: 54px;
  height: 15px;
  transform: translateX(-50%) rotate(2deg);
  background: repeating-linear-gradient(115deg, rgba(232, 137, 95, 0.26) 0 6px, rgba(232, 137, 95, 0.16) 6px 12px);
  border-radius: 2px;
}

.gb-note-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.gb-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
}

.gb-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.gb-time { margin-left: auto; font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }

.gb-body { font-size: 15px; line-height: 1.8; color: var(--ink-2); }
.gb-body p { margin: 0 0 0.6em; }
.gb-body p:last-child { margin-bottom: 0; }

.gb-pending {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--ink-3);
}

.gb-empty {
  padding: 48px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  text-align: center;
  font-family: var(--font-serif);
  font-size: 17px;
  font-style: italic;
  color: var(--ink-3);
}

/* 表单提示里的补充说明（例如「图片需要重新选择」） */
.form-notice__aside {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  opacity: 0.78;
}
