/* Cards rotate between the main discussion and a compact, cyclic topic queue. */
body.page-message-board main.main .guestbook-layout {
  display: grid; grid-template-areas: "intro" "square" "topics";
  grid-template-columns: minmax(0, 1fr); align-items: start; gap: 28px;
  width: calc(100% - var(--site-gutter) * 2); max-width: 680px; margin-inline: auto;
}
.guestbook-layout { overflow-anchor: none; }
.guestbook-layout > * { min-width: 0; }
.guestbook-layout [hidden] { display: none !important; }
.guestbook-intro { grid-area: intro; max-width: 680px; }
.guestbook-square { grid-area: square; }
.guestbook-sidebar { grid-area: topics; min-width: 0; color: var(--color-typography); font-family: var(--font-body); }
body.page-message-board main.main .guestbook-layout [data-post-hero] { padding-inline: 0; }
body.page-message-board main.main .guestbook-layout [data-post-hero] > div { margin-bottom: 0; padding-bottom: 32px; }
body.page-message-board main.main .guestbook-layout [data-post-hero] > div::before { display: none; }
body.page-message-board main.main .guestbook-layout .ghost-content {
  grid-template-columns: [full-start wide-start main-start] minmax(0, 1fr) [main-end wide-end full-end]; margin-bottom: 0;
}
.guestbook-card {
  min-width: 0; border: 1px solid var(--color-border); border-radius: var(--radius-lg, 24px);
  background: var(--color-background-tone); overflow: clip; scroll-margin-top: 100px;
  position: relative; box-sizing: border-box; transform-origin: top left;
  transition: border-color 700ms cubic-bezier(.4,0,.2,1), background-color 700ms cubic-bezier(.4,0,.2,1);
}
.guestbook-topics__list { display: flex; flex-direction: column; gap: 14px; }
.guestbook-board__select {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px;
  width: 100%; min-height: 72px; padding: 22px 24px; margin: 0;
  border: 0; border-radius: inherit; background: transparent; color: var(--color-typography);
  font-family: var(--font-body); text-align: left; cursor: pointer;
}
.guestbook-board__heading { min-width: 0; font-size: 18px; line-height: 26px; font-weight: 600; letter-spacing: -.02em; }
.guestbook-board__action { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; color: var(--color-typography-tone); }
.guestbook-board__action svg { display: block; width: 18px; height: 18px; }
.guestbook-board__select:hover .guestbook-board__action { color: var(--color-typography); }
.guestbook-board__question { grid-column: 1 / -1; color: var(--color-typography-tone); font-size: 13px; line-height: 21px; }
.guestbook-board__preview { display: block; grid-column: 1 / -1; margin-top: 4px; color: var(--color-typography-tone); font-size: 13px; line-height: 21px; overflow-wrap: anywhere; }
.guestbook-board__preview.has-comment {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 11px;
  margin-top: 6px; padding-top: 14px; border-top: 1px solid var(--color-border);
}
.guestbook-board__avatar {
  position: relative; display: grid; place-items: center; width: 34px; height: 34px;
  overflow: hidden; border-radius: 50%; flex-shrink: 0;
  background: transparent;
  color: var(--color-typography); font-size: 14px; font-weight: 500;
}
.guestbook-board__avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.guestbook-board__avatar-fallback { display: grid; place-items: center; }
.guestbook-board__avatar-fallback svg { width: 28px; height: 28px; }
.guestbook-board__preview-content { display: block; min-width: 0; }
.guestbook-board__preview-meta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; margin-bottom: 5px; line-height: 18px; }
.guestbook-board__preview-author { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-typography); font-size: 12px; font-weight: 600; }
.guestbook-board__preview-meta time { flex-shrink: 0; color: var(--color-typography-tone); font-size: 11px; font-weight: 400; }
.guestbook-board__preview-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; color: var(--color-typography-tone); font-size: 13px; line-height: 21px; font-weight: 400; }
.guestbook-card.has-preview:not(.is-active) > .guestbook-board__select .guestbook-board__question { display: none; }
.guestbook-board__select:hover .guestbook-board__heading { color: var(--color-brand); }
.guestbook-board__select:focus-visible { outline: 2px solid var(--color-brand); outline-offset: -5px; }
.guestbook-card.is-active > .guestbook-board__select { cursor: default; }
.guestbook-card.is-active > .guestbook-board__select .guestbook-board__action,
.guestbook-card.is-active > .guestbook-board__select .guestbook-board__preview { display: none; }
.guestbook-square.is-active > .guestbook-board__select:hover .guestbook-board__heading { color: var(--color-typography); }
.guestbook-topic.is-active { order: -1; }
.guestbook-topic.is-active > .guestbook-board__select .guestbook-board__action { color: var(--color-brand); }
.guestbook-board__panel { padding: 0 24px 24px; animation: guestbook-reveal 260ms ease both; }
body.page-message-board main.main .guestbook-layout :is(#comments, .siwei-fc-section) { margin: 0; scroll-margin-top: 100px; }
body.page-message-board main.main .guestbook-layout :is(#comments, .siwei-fc-section) .siwei-fc-panel {
  width: 100%; max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent;
}
body.page-message-board .guestbook-layout .siwei-fc-editor-shell { grid-template-areas: "native"; row-gap: 0; }
.guestbook-preview-retry { margin-top: 12px; min-height: 44px; padding: 8px 14px; border: 1px solid var(--color-border); border-radius: 12px; background: transparent; font: inherit; font-size: 13px; color: var(--color-typography); cursor: pointer; }
@keyframes guestbook-reveal { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@media (min-width: 1000px) {
  body.page-message-board main.main .guestbook-layout {
    max-width: var(--site-layout-width); grid-template-columns: minmax(0, 2.15fr) minmax(0, 1fr);
    grid-template-areas: "intro intro" "square topics"; column-gap: 32px; row-gap: 36px;

  }
}
@media (max-width: 599px) {
  .guestbook-board__select { padding: 18px; }
  .guestbook-board__panel { padding: 0 16px 20px; }
  .guestbook-layout { gap: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  body.page-message-board main.main .guestbook-layout, .guestbook-card { transition: none; }
  .guestbook-board__panel { animation: none; }
}

/* Flatten only the layout boxes; comment iframes retain their DOM and drafts. */
body.page-message-board main.main .guestbook-layout.is-orbit-ready {
  grid-template-areas: none; grid-template-rows: auto 0; gap: 14px;
}
.guestbook-layout.is-orbit-ready .guestbook-intro { grid-area: 1 / 1; margin-bottom: 0; }
.guestbook-layout.is-orbit-ready .guestbook-sidebar,
.guestbook-layout.is-orbit-ready .guestbook-topics__list { display: contents; }
.guestbook-layout.is-orbit-ready .guestbook-card { grid-area: var(--mobile-row) / 1; order: 0; }
.guestbook-layout.is-orbit-ready .guestbook-card.is-active { grid-area: 3 / 1; }
.guestbook-layout.is-orbit-ready .guestbook-preview-retry { grid-area: var(--board-end) / 1; justify-self: start; margin-top: 0; }
.guestbook-layout.is-orbit-ready .guestbook-board__panel { animation: none; }
@media (min-width: 1000px) {
  body.page-message-board main.main .guestbook-layout.is-orbit-ready {
    --main-column: 1; --rail-column: 2;
    grid-template-rows: auto 0 repeat(var(--rail-count), min-content) minmax(0, 1fr) auto;
    column-gap: 32px;
  }
  .guestbook-layout.is-orbit-ready .guestbook-intro { grid-area: 1 / 1 / 2 / -1; }
  .guestbook-layout.is-orbit-ready .guestbook-card { grid-area: var(--rail-row) / var(--rail-column); }
  .guestbook-layout.is-orbit-ready .guestbook-card.is-active { grid-area: 3 / var(--main-column) / var(--board-end); }
  .guestbook-layout.is-orbit-ready .guestbook-preview-retry { grid-area: var(--board-end) / var(--rail-column); }
}

.guestbook-draft-badge {
  display: inline-block; grid-column: 1 / -1; margin-top: 0; color: var(--color-typography-tone);
  font-size: 12px; line-height: 1.5; font-weight: 400;
}
.guestbook-draft-badge[hidden] { display: none; }

.guestbook-card.is-active > .guestbook-board__select .guestbook-draft-badge { display: none; }

/* Site-wide discovery fills the rail without setting the discussion's height. */
.guestbook-wander {
  position: relative; min-width: 0; box-sizing: border-box;
  border: 1px solid var(--color-border); border-radius: var(--radius-lg, 24px);
  background: var(--color-background-tone); color: var(--color-typography);
  font-family: var(--font-body);
}
.guestbook-layout.is-orbit-ready .guestbook-wander { grid-area: calc(var(--board-end) + 1) / 1; }
.guestbook-wander__inner { padding: 20px 24px 14px; }
.guestbook-wander__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-shrink: 0; }
.guestbook-wander__header h2 { margin: 0; font: inherit; font-size: 18px; font-weight: 600; line-height: 26px; letter-spacing: -.02em; }
.guestbook-wander__header button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; padding: 0; min-height: 40px; border: 0; background: transparent;
  font: inherit; font-size: 12px; color: var(--color-typography-tone); cursor: pointer;
}
.guestbook-wander__header button svg { display: block; width: 18px; height: 18px; }
.guestbook-wander__header button:hover { color: var(--color-brand); }
.guestbook-wander__header button:disabled { opacity: .5; cursor: wait; }
.guestbook-wander__header button:focus-visible, .guestbook-wander__item:focus-visible { outline: 2px solid var(--color-brand); outline-offset: 3px; border-radius: 8px; }
.guestbook-wander__status { font-size: 13px; line-height: 22px; color: var(--color-typography-tone); margin: 16px 0; }
.guestbook-wander__list { display: grid; min-height: 0; margin-top: 6px; }
.guestbook-wander__item {
  display: grid; grid-template-columns: 34px minmax(0, 1fr); align-content: center; gap: 11px;
  padding: 17px 0; min-width: 0; min-height: 142px; box-sizing: border-box;
  text-decoration: none; color: inherit; border-top: 1px solid var(--color-border);
}
.guestbook-wander__content { display: block; min-width: 0; }
.guestbook-wander__name { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12px; line-height: 18px; font-weight: 600; }
.guestbook-wander__text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; overflow-wrap: anywhere; margin-top: 5px; font-size: 13px; line-height: 21px; color: var(--color-typography-tone); }
.guestbook-wander__source { display: block; margin-top: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; line-height: 17px; color: var(--color-typography-tone); opacity: .8; }
.guestbook-wander__item:hover .guestbook-wander__text { color: var(--color-typography); }
.guestbook-wander__item:hover .guestbook-wander__source { color: var(--color-brand); opacity: 1; }
@media (min-width: 1000px) {
  .guestbook-layout.is-orbit-ready .guestbook-card.is-active { align-self: stretch; }
  .guestbook-layout.is-orbit-ready .guestbook-wander {
    grid-area: calc(var(--board-end) - 1) / var(--rail-column) / var(--board-end);
    align-self: stretch; min-height: 224px; border: 0; background: transparent;
  }
  .guestbook-wander__inner {
    position: absolute; inset: 0; display: flex; flex-direction: column; box-sizing: border-box;
    border: 1px solid var(--color-border); border-radius: inherit;
    background: var(--color-background-tone); overflow: clip;
  }
  .guestbook-wander__list { flex: 1; overflow: hidden; grid-auto-rows: minmax(142px, 1fr); }
}
@media (max-width: 599px) {
  .guestbook-wander__inner { padding: 16px 18px 10px; }
}
