/* =============================================================================
   留言簿页面
   ========================================================================== */

.page-guestbook .header { border-bottom-color: var(--line-2); }

.gb {
  padding: calc(var(--header-h) + 76px) 0 110px;
  position: relative;
  overflow: hidden;
}
.gb::before {
  content: "";
  position: absolute;
  width: 640px;
  height: 640px;
  border-radius: 50%;
  top: -280px;
  right: -180px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, transparent), transparent 68%);
  filter: blur(50px);
  pointer-events: none;
}

.gb__hero {
  position: relative;
  max-width: 780px;
  text-align: center;
  margin-inline: auto;
}
.gb__hero .eyebrow { justify-content: center; }
.gb__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 6.2vw, 4.4rem);
  line-height: 1.15;
  letter-spacing: 0.04em;
  color: var(--cream);
  margin-top: 22px;
}
.gb__lead {
  margin-top: 22px;
  font-size: 14px;
  line-height: 2.1;
  color: var(--muted);
}
.gb__meta {
  margin-top: 24px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.18em;
  color: var(--muted-2);
  text-transform: uppercase;
}
.gb__meta span { color: var(--accent); }

.gb__body {
  max-width: 860px;
  margin: 60px auto 0;
  position: relative;
}

/* ------------------------------------------------------------------ 表单 */
.gb-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px;
  box-shadow: 0 30px 70px -40px var(--shadow-color);
}
.gb-form__top { display: flex; gap: 14px; }
.field { display: block; }
.field--name { flex: 1; }
.field--hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.field > span {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 9px;
}
.field input,
.field textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  line-height: 1.7;
  padding: 12px 14px;
  transition: border-color 0.25s, background 0.25s;
  resize: vertical;
}
.field textarea { margin-top: 0; min-height: 132px; }
.field input::placeholder,
.field textarea::placeholder { color: var(--muted-2); opacity: 0.8; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
  background: var(--bg-soft);
}
.gb-form > .field { margin-top: 18px; }

.gb-form__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.gb-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.gb-pick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px dashed var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--muted);
  transition: border-color 0.3s, color 0.3s, background 0.3s;
}
.gb-pick svg { width: 17px; height: 17px; }
.gb-pick:hover { border-color: var(--accent); color: var(--cream); background: var(--surface); }
.gb-pick.has-file { border-style: solid; border-color: var(--accent); color: var(--accent); }
.gb-hint { font-size: 11px; color: var(--muted-2); }

.gb-send { display: flex; align-items: center; gap: 16px; }
.gb-counter {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--muted-2);
}
.gb-counter.is-near { color: var(--accent); }
.gb-send .btn { height: 44px; }
.gb-send .btn[disabled] { opacity: 0.55; cursor: progress; }

.gb-wall[hidden],
.gb-preview[hidden] { display: none; }

.gb-form.is-drag {
  border-color: color-mix(in srgb, var(--accent) 70%, var(--line));
  background: color-mix(in srgb, var(--accent) 6%, var(--panel));
}

.gb-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}
.gb-preview img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 7px;
  background: var(--img-bg);
}
.gb-preview__meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--muted-2);
  letter-spacing: 0.05em;
}
.gb-preview__remove {
  align-self: flex-start;
  font-size: 11px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  transition: color 0.25s;
}
.gb-preview__remove:hover { color: var(--accent); }

.gb-status {
  margin-top: 14px;
  min-height: 20px;
  font-size: 12.5px;
  color: var(--muted);
}
.gb-status.is-error { color: #ff8f7a; }
.gb-status.is-ok { color: var(--accent-2); }

/* ------------------------------------------------------------------ 墙 */
.gb-wall__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 64px 0 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.gb-wall__head h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--cream);
}
.gb-wall__head span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--muted-2);
  text-transform: uppercase;
}

.gb-wall {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}
.gb-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: gbIn 0.5s var(--ease) both;
}
.gb-card--fresh { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.gb-card__head { display: flex; align-items: center; gap: 10px; }
.gb-avatar {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  color: var(--accent);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1;
  text-transform: uppercase;
}
.gb-card__who { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.gb-card__name {
  font-size: 13px;
  color: var(--cream);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gb-card__time {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--muted-2);
}
.gb-card__text {
  font-size: 13.5px;
  line-height: 1.95;
  color: var(--text);
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.gb-card__img {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line-2);
  background: var(--img-bg);
  cursor: zoom-in;
}
.gb-card__img img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}
.gb-card__img:hover img { transform: scale(1.02); }

.gb-empty,
.gb-notice {
  margin-top: 18px;
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  text-align: center;
  color: var(--muted-2);
  font-size: 13px;
  line-height: 1.9;
}
.gb-notice { border-style: solid; background: var(--surface); }
.gb-notice b { display: block; color: var(--text); font-size: 13.5px; margin-bottom: 6px; }
.gb-notice code {
  font-family: var(--mono);
  font-size: 11.5px;
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 4px;
}

.gb-more-wrap { display: flex; justify-content: center; margin-top: 30px; }

/* --------------------------------------------------------------- 大图查看 */
.gb-viewer {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: grid;
  place-items: center;
  padding: 40px;
}
.gb-viewer[hidden] { display: none; }
.gb-viewer__backdrop {
  position: absolute;
  inset: 0;
  background: var(--scrim-strong);
  backdrop-filter: blur(16px);
}
.gb-viewer__figure {
  position: relative;
  z-index: 1;
  max-width: min(1000px, 100%);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gb-viewer__figure img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--line);
}
.gb-viewer__figure figcaption {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--muted-2);
  text-align: center;
}
.gb-viewer__close {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 2;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--glass);
  color: var(--cream);
  transition: background 0.3s, transform 0.3s;
}
.gb-viewer__close:hover { background: var(--accent); color: #100d0a; transform: rotate(90deg); }
.gb-viewer__close svg { width: 16px; height: 16px; }

@keyframes gbIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 720px) {
  .gb { padding-top: calc(var(--header-h) + 44px); }
  .gb__lead br { display: none; }
  .gb-form { padding: 18px; }
  .gb-form__foot { flex-direction: column; align-items: stretch; }
  .gb-tools { justify-content: space-between; }
  .gb-send { justify-content: space-between; }
  .gb-wall { grid-template-columns: 1fr; }
  .gb-card { padding: 16px; }
  .gb-viewer { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .gb-card { animation: none; }
}
