@charset "UTF-8";

:root {
  color-scheme: light;
  --wine-950: #26070f;
  --wine-900: #350914;
  --wine-800: #4b101d;
  --wine-700: #681c2d;
  --wine-600: #873047;
  --gold-700: #80632f;
  --gold-600: #a98442;
  --gold-500: #c6a15b;
  --gold-400: #e3c781;
  --ivory-100: #fffaf0;
  --ivory-200: #f7ecd8;
  --ivory-300: #ead8b5;
  --ink: #2a1715;
  --muted: #79645a;
  --danger: #9d2638;
  --admin: #604a22;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--wine-950);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(
      circle at 10% 0%,
      rgba(227, 199, 129, 0.13),
      transparent 27%
    ),
    radial-gradient(
      circle at 90% 100%,
      rgba(198, 161, 91, 0.11),
      transparent 31%
    ),
    repeating-linear-gradient(
      45deg,
      rgba(227, 199, 129, 0.025) 0 2px,
      transparent 2px 16px
    ),
    linear-gradient(
      rgba(35, 5, 13, 0.96),
      rgba(25, 3, 9, 0.98)
    );
  color: var(--ink);
  font-family:
    Georgia,
    "Times New Roman",
    "Noto Serif SC",
    "Songti SC",
    "SimSun",
    serif;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.top-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 78px;
  border-bottom: 1px solid var(--gold-700);
  background:
    linear-gradient(
      180deg,
      rgba(99, 24, 42, 0.98),
      rgba(50, 7, 17, 0.99)
    );
  box-shadow:
    0 10px 28px rgba(12, 1, 5, 0.5),
    inset 0 -1px 0 rgba(227, 199, 129, 0.28);
}

.top-header::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: min(92%, 1100px);
  height: 13px;
  transform: translateX(-50%);
  background:
    radial-gradient(
      ellipse at center,
      var(--gold-400) 0 2px,
      transparent 2.5px
    )
    center / 24px 12px repeat-x;
  opacity: 0.75;
  pointer-events: none;
}

.top-header-inner {
  width: min(calc(100% - 28px), 1180px);
  min-height: 78px;
  margin: 0 auto;
  display: grid;
  grid-template-columns:
    minmax(116px, 1fr)
    auto
    minmax(116px, 1fr);
  align-items: center;
  gap: 12px;
}

.site-title {
  margin: 0;
  color: var(--gold-400);
  text-align: center;
  white-space: nowrap;
  font-size: clamp(20px, 3.2vw, 30px);
  letter-spacing: 0.12em;
  text-shadow:
    0 2px 0 #16040a,
    0 0 18px rgba(227, 199, 129, 0.2);
}

.site-title::before {
  content: "❦";
  margin-right: 0.55em;
  color: var(--gold-500);
}

.site-title::after {
  content: "❦";
  display: inline-block;
  margin-left: 0.55em;
  color: var(--gold-500);
  transform: scaleX(-1);
}

.admin-button {
  justify-self: start;
  min-height: 38px;
  border: 1px solid var(--gold-700);
  border-radius: 2px;
  padding: 8px 12px;
  background:
    linear-gradient(
      180deg,
      var(--ivory-100),
      var(--ivory-300)
    );
  color: var(--wine-800);
  font-weight: 700;
  cursor: pointer;
  box-shadow:
    inset 0 0 0 2px rgba(255, 250, 240, 0.7),
    0 4px 11px rgba(18, 2, 7, 0.3);
}

.admin-button.logged-in {
  border-color: var(--gold-400);
  background:
    linear-gradient(
      180deg,
      #f0d89b,
      #b68a42
    );
  color: #351019;
}

.publish-button {
  justify-self: end;
  width: 44px;
  height: 44px;
  border: 1px solid var(--gold-400);
  border-radius: 50%;
  background:
    radial-gradient(
      circle at 35% 28%,
      #92364b,
      var(--wine-800) 58%,
      var(--wine-950)
    );
  color: var(--gold-400);
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
  box-shadow:
    inset 0 0 0 3px rgba(198, 161, 91, 0.22),
    0 6px 17px rgba(18, 2, 7, 0.44);
}

.page-shell {
  width: min(calc(100% - 28px), 1180px);
  margin: 34px auto 70px;
  display: grid;
  grid-template-columns: 230px minmax(0, 820px);
  justify-content: center;
  align-items: start;
  gap: 26px;
}

.board-sidebar {
  position: sticky;
  top: 108px;
}

.sidebar-frame {
  position: relative;
  border: 1px solid var(--gold-700);
  padding: 8px;
  background:
    linear-gradient(
      145deg,
      #6e5022,
      #d5b96f 50%,
      #6e5022
    );
  box-shadow:
    0 18px 42px rgba(12, 1, 5, 0.4),
    inset 0 0 0 2px rgba(255, 239, 191, 0.25);
}

.sidebar-frame::before,
.sidebar-frame::after {
  position: absolute;
  z-index: 2;
  color: #f0d68e;
  font-size: 24px;
  line-height: 1;
  pointer-events: none;
}

.sidebar-frame::before {
  content: "❧";
  top: 5px;
  left: 7px;
}

.sidebar-frame::after {
  content: "❧";
  right: 7px;
  bottom: 5px;
  transform: rotate(180deg);
}

.sidebar-title {
  padding: 19px 15px 13px;
  border-bottom: 1px solid rgba(128, 99, 47, 0.5);
  background:
    linear-gradient(
      180deg,
      var(--ivory-100),
      var(--ivory-200)
    );
  color: var(--wine-800);
  text-align: center;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.sidebar-title span::before,
.sidebar-title span::after {
  content: "✦";
  margin: 0 0.45em;
  color: var(--gold-600);
  font-size: 0.75em;
}

.board-navigation {
  padding: 10px;
  background:
    linear-gradient(
      180deg,
      rgba(255, 250, 240, 0.98),
      rgba(239, 224, 197, 0.98)
    );
}

.board-link {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 9px;
  margin: 4px 0;
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 11px 10px;
  background: transparent;
  color: #503028;
  text-align: left;
  cursor: pointer;
}

.board-link::before {
  content: "◆";
  margin-right: 4px;
  color: var(--gold-600);
  font-size: 9px;
}

.board-link-name {
  grid-column: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-link-count {
  grid-column: 2;
  min-width: 25px;
  border: 1px solid rgba(128, 99, 47, 0.38);
  border-radius: 999px;
  padding: 1px 6px;
  color: var(--muted);
  text-align: center;
  font-size: 11px;
}

.board-link:hover {
  border-color: rgba(128, 99, 47, 0.42);
  background:
    linear-gradient(
      90deg,
      rgba(198, 161, 91, 0.13),
      rgba(255, 250, 240, 0)
    );
}

.board-link.active {
  border-color: var(--gold-700);
  background:
    linear-gradient(
      180deg,
      #7c2b3e,
      var(--wine-800)
    );
  color: #f8e8bf;
  box-shadow:
    inset 0 0 0 2px rgba(227, 199, 129, 0.13);
}

.board-link.active::before {
  color: var(--gold-400);
}

.board-link.active .board-link-count {
  border-color: rgba(227, 199, 129, 0.55);
  color: var(--gold-400);
}

.forum-main {
  min-width: 0;
}

.board-heading {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 15px;
  border: 1px solid var(--gold-700);
  padding: 20px 25px;
  background:
    linear-gradient(
      180deg,
      rgba(255, 250, 240, 0.98),
      rgba(238, 221, 190, 0.98)
    );
  box-shadow:
    0 14px 34px rgba(12, 1, 5, 0.3),
    inset 0 0 0 4px rgba(198, 161, 91, 0.12);
}

.board-heading::before {
  content: "❧";
  position: absolute;
  top: 7px;
  right: 10px;
  color: var(--gold-600);
  font-size: 27px;
}

.board-kicker {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.16em;
}

.board-heading h2 {
  margin: 4px 0 0;
  color: var(--wine-800);
  font-size: 27px;
  letter-spacing: 0.06em;
}

.board-count {
  color: var(--muted);
  font-size: 13px;
}

.feed {
  min-width: 0;
}

.status-card,
.post-card {
  position: relative;
  margin-bottom: 15px;
  border: 1px solid var(--gold-700);
  background:
    linear-gradient(
      rgba(255, 250, 240, 0.97),
      rgba(246, 235, 213, 0.98)
    );
  box-shadow:
    0 19px 46px rgba(15, 2, 6, 0.34),
    inset 0 0 0 4px rgba(198, 161, 91, 0.14),
    inset 0 0 0 5px rgba(128, 99, 47, 0.38);
}

.status-card {
  padding: 48px 24px;
  color: var(--muted);
  text-align: center;
  line-height: 1.8;
}

.status-card strong {
  display: block;
  margin-bottom: 6px;
  color: var(--wine-800);
  font-size: 20px;
}

.post-card {
  padding: 29px 30px 24px;
}

.post-card::before,
.post-card::after {
  position: absolute;
  color: var(--gold-700);
  font-size: 27px;
  line-height: 1;
  pointer-events: none;
}

.post-card::before {
  content: "❧";
  top: 7px;
  left: 9px;
}

.post-card::after {
  content: "❧";
  right: 9px;
  bottom: 7px;
  transform: rotate(180deg);
}

.post-author {
  margin: 0;
  color: var(--wine-800);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.035em;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 13px;
  margin-top: 5px;
  color: #91755b;
  font-size: 13px;
  font-style: italic;
}

.post-board-label {
  color: var(--gold-700);
  font-style: normal;
  font-weight: 700;
}

.post-content {
  margin: 18px 0;
  color: #2f1c18;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 17px;
  line-height: 1.9;
}

.post-content:empty {
  display: none;
}

.image-grid {
  display: grid;
  gap: 7px;
  margin: 18px 0;
  border: 1px solid var(--gold-700);
  padding: 7px;
  background:
    linear-gradient(
      135deg,
      #6f5124,
      #d8bc72 50%,
      #6f5124
    );
  box-shadow:
    inset 0 0 0 3px rgba(45, 15, 15, 0.28),
    0 8px 22px rgba(62, 22, 22, 0.16);
}

.image-grid.one {
  grid-template-columns: 1fr;
}

.image-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.image-grid.many {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.image-button {
  min-width: 0;
  border: 1px solid rgba(255, 245, 216, 0.72);
  padding: 0;
  background: #1d0b0f;
  overflow: hidden;
  cursor: zoom-in;
}

.two .image-button,
.many .image-button {
  aspect-ratio: 1 / 1;
}

.post-image {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 620px;
  object-fit: cover;
}

.one .post-image {
  object-fit: contain;
  background: #f0eadc;
}

.post-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
  border-top: 1px solid rgba(128, 99, 47, 0.4);
  padding-top: 12px;
}

.action-button,
.admin-delete-button {
  min-height: 35px;
  border: 1px solid transparent;
  border-radius: 2px;
  padding: 7px 10px;
  background: transparent;
  color: var(--wine-800);
  font-weight: 700;
  cursor: pointer;
}

.action-button:hover,
.admin-delete-button:hover {
  border-color: rgba(128, 99, 47, 0.42);
  background:
    linear-gradient(
      180deg,
      rgba(255, 248, 231, 0.95),
      rgba(225, 203, 158, 0.58)
    );
}

.like-button.liked {
  color: #a31831;
}

.action-spacer {
  flex: 1 1 auto;
}

.admin-delete-button {
  color: var(--danger);
}

.admin-move-box {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr) auto;
  align-items: center;
  gap: 9px;
  margin-top: 10px;
  border: 1px solid rgba(128, 99, 47, 0.45);
  padding: 10px;
  background: rgba(198, 161, 91, 0.09);
}

.admin-move-label {
  color: var(--admin);
  font-size: 13px;
  font-weight: 800;
}

.move-button {
  border: 1px solid var(--gold-700);
  border-radius: 2px;
  padding: 9px 12px;
  background:
    linear-gradient(
      180deg,
      var(--ivory-100),
      var(--ivory-300)
    );
  color: var(--wine-800);
  font-weight: 800;
  cursor: pointer;
}

.comment-list {
  margin-top: 15px;
  border-top: 1px solid rgba(128, 99, 47, 0.38);
  padding-top: 11px;
}

.comment-item {
  position: relative;
  margin: 7px 0;
  border-left: 3px double var(--gold-700);
  padding: 9px 11px 9px 14px;
  background:
    linear-gradient(
      90deg,
      rgba(198, 161, 91, 0.11),
      rgba(255, 250, 240, 0)
    );
  color: #36221c;
  line-height: 1.7;
}

.comment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}

.comment-author {
  color: var(--wine-800);
  font-weight: 800;
}

.comment-time {
  color: #987e69;
  font-size: 12px;
  font-style: italic;
}

.comment-content {
  margin-top: 3px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.comment-delete {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
  font-size: 12px;
}

dialog {
  width: min(550px, calc(100% - 22px));
  max-height: calc(100vh - 22px);
  border: 1px solid var(--gold-400);
  padding: 0;
  background:
    linear-gradient(
      rgba(255, 250, 240, 0.99),
      rgba(240, 226, 199, 0.99)
    );
  box-shadow:
    0 34px 100px rgba(12, 1, 5, 0.6),
    inset 0 0 0 4px rgba(198, 161, 91, 0.2),
    inset 0 0 0 5px rgba(128, 99, 47, 0.48);
}

dialog::backdrop {
  background:
    radial-gradient(
      circle at center,
      rgba(80, 18, 32, 0.36),
      rgba(9, 1, 4, 0.88)
    );
  backdrop-filter: blur(4px);
}

.modal {
  position: relative;
  max-height: calc(100vh - 22px);
  overflow-y: auto;
  padding: 30px;
}

.modal::before,
.modal::after {
  position: absolute;
  color: var(--gold-700);
  font-size: 25px;
  pointer-events: none;
}

.modal::before {
  content: "❧";
  top: 8px;
  left: 10px;
}

.modal::after {
  content: "❧";
  right: 10px;
  bottom: 8px;
  transform: rotate(180deg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 21px;
  border-bottom: 1px solid rgba(128, 99, 47, 0.38);
  padding-bottom: 14px;
}

.modal-header h2 {
  margin: 0;
  color: var(--wine-800);
  font-size: 21px;
  letter-spacing: 0.05em;
}

.close-button {
  width: 36px;
  height: 36px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--wine-800);
  font-size: 25px;
  cursor: pointer;
}

.field {
  display: block;
  margin-bottom: 18px;
}

.field-title,
.image-picker-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: #4d2d25;
  font-weight: 700;
}

.counter,
.image-help,
.modal-description {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #a88950;
  border-radius: 2px;
  padding: 12px 14px;
  background:
    linear-gradient(
      180deg,
      #fffdf8,
      #f7edda
    );
  color: var(--ink);
  box-shadow:
    inset 0 1px 3px rgba(70, 35, 20, 0.11);
}

textarea {
  min-height: 135px;
  resize: vertical;
  line-height: 1.65;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--wine-800);
  outline: 2px solid rgba(198, 161, 91, 0.32);
}

.image-picker {
  margin-bottom: 18px;
}

.pick-images-button {
  display: inline-flex;
  min-height: 39px;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--gold-700);
  padding: 8px 13px;
  background:
    linear-gradient(
      180deg,
      var(--ivory-100),
      var(--ivory-300)
    );
  color: var(--wine-800);
  font-weight: 800;
  cursor: pointer;
}

.hidden-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.image-previews {
  display: grid;
  grid-template-columns:
    repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
}

.image-preview {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 2px solid var(--gold-700);
  overflow: hidden;
  background: #2b0a12;
}

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

.remove-image {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 25px;
  height: 25px;
  border: 1px solid var(--gold-400);
  border-radius: 50%;
  background: rgba(69, 12, 25, 0.92);
  color: var(--gold-400);
  cursor: pointer;
}

.primary-button {
  width: 100%;
  border: 1px solid var(--gold-400);
  border-radius: 2px;
  padding: 13px;
  background:
    linear-gradient(
      180deg,
      #72253a,
      #470f1c
    );
  color: #f7e7bd;
  font-weight: 800;
  letter-spacing: 0.07em;
  cursor: pointer;
  box-shadow:
    inset 0 0 0 2px rgba(198, 161, 91, 0.18),
    0 5px 13px rgba(45, 5, 14, 0.24);
}

.primary-button:disabled,
.action-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.notice {
  display: none;
  margin-bottom: 16px;
  border: 1px solid #9d3b49;
  padding: 11px 13px;
  background: #fae5e3;
  color: #701625;
  line-height: 1.55;
}

.notice.error {
  display: block;
}

.delete-code {
  margin: 16px 0;
  border: 3px double var(--gold-700);
  padding: 16px;
  background:
    linear-gradient(
      180deg,
      var(--ivory-100),
      #e9d7b4
    );
  color: var(--wine-800);
  text-align: center;
  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Consolas,
    monospace;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: 0.07em;
  user-select: all;
}

.image-viewer-dialog {
  width: min(1100px, calc(100% - 18px));
  border: 0;
  background: transparent;
  box-shadow: none;
}

.image-viewer {
  display: grid;
  place-items: center;
  min-height: 60vh;
}

.image-viewer img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 40px);
  object-fit: contain;
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.5);
}

.image-viewer-close {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 43px;
  height: 43px;
  border: 1px solid var(--gold-400);
  border-radius: 50%;
  background: rgba(69, 12, 25, 0.92);
  color: var(--gold-400);
  font-size: 27px;
  cursor: pointer;
}

@media (max-width: 900px) {
  .page-shell {
    display: block;
    width: min(calc(100% - 22px), 820px);
    margin-top: 26px;
  }

  .board-sidebar {
    position: static;
    margin-bottom: 15px;
  }

  .sidebar-title {
    padding: 13px;
  }

  .board-navigation {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding: 9px;
  }

  .board-link {
    width: auto;
    min-width: max-content;
    grid-template-columns: auto auto;
    margin: 0;
  }

  .board-link-name {
    grid-column: 1;
  }

  .board-link-count {
    grid-column: 2;
  }
}

@media (max-width: 620px) {
  .top-header,
  .top-header-inner {
    min-height: 70px;
  }

  .top-header-inner {
    grid-template-columns:
      minmax(87px, 1fr)
      auto
      minmax(87px, 1fr);
    gap: 5px;
  }

  .site-title {
    font-size: 17px;
  }

  .site-title::before,
  .site-title::after {
    display: none;
  }

  .admin-button {
    padding: 7px 8px;
    font-size: 12px;
  }

  .board-heading {
    padding: 17px 19px;
  }

  .board-heading h2 {
    font-size: 22px;
  }

  .post-card {
    padding: 25px 20px 21px;
  }

  .post-content {
    font-size: 16px;
  }

  .admin-move-box {
    grid-template-columns: 1fr;
  }

  .modal {
    padding: 26px 21px;
  }
}
