:root {
  color-scheme: dark;
  --bg: #07101d;
  --surface: rgba(15, 27, 46, 0.86);
  --surface-strong: #111f34;
  --surface-soft: #142743;
  --line: rgba(152, 180, 218, 0.16);
  --line-bright: rgba(77, 225, 210, 0.32);
  --text: #f3f7ff;
  --muted: #98a9c0;
  --cyan: #43e0cf;
  --cyan-dark: #16a99c;
  --violet: #9d7cff;
  --pink: #ff6c9f;
  --warning: #ffca67;
  --danger: #ff7588;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 16% 8%, rgba(67, 224, 207, 0.08), transparent 28rem),
    radial-gradient(circle at 90% 18%, rgba(157, 124, 255, 0.11), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
  line-height: 1.6;
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-150%);
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--cyan);
  color: #041411;
  font-weight: 800;
}
.skip-link:focus { transform: translateY(0); }

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(1px);
  opacity: 0.7;
  pointer-events: none;
}
.ambient::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid currentColor;
  border-radius: inherit;
}
.ambient-one { width: 460px; height: 460px; right: -280px; top: 220px; color: rgba(67, 224, 207, 0.12); }
.ambient-two { width: 300px; height: 300px; left: -190px; top: 640px; color: rgba(157, 124, 255, 0.12); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 16, 29, 0.84);
  backdrop-filter: blur(18px);
}

.brand { display: inline-flex; align-items: center; gap: 12px; letter-spacing: 0.08em; }
.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line-bright);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(67, 224, 207, 0.18), rgba(157, 124, 255, 0.16));
  color: var(--cyan);
  font-weight: 900;
  box-shadow: inset 0 0 24px rgba(67, 224, 207, 0.08);
}
.brand strong { display: block; font-size: 0.94rem; line-height: 1.1; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 0.58rem; }
.top-nav { display: flex; align-items: center; gap: 8px; }
.user-chip { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--cyan); font-size: 0.82rem; }

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, opacity 160ms ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:focus-visible, .text-button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, .board-link:focus-visible, .post-row:focus-visible {
  outline: 3px solid rgba(67, 224, 207, 0.32);
  outline-offset: 2px;
}
.button:disabled { cursor: not-allowed; opacity: 0.4; }
.button-primary { background: linear-gradient(135deg, var(--cyan), #65f0b6); color: #041411; box-shadow: 0 10px 30px rgba(67, 224, 207, 0.14); }
.button-secondary { border-color: rgba(157, 124, 255, 0.36); background: rgba(157, 124, 255, 0.12); color: #d9ccff; }
.button-ghost { border-color: var(--line); background: rgba(255, 255, 255, 0.025); color: var(--text); }
.button-danger { border-color: rgba(255, 117, 136, 0.42); background: rgba(255, 117, 136, 0.12); color: #ffb3be; }
.button-large { min-height: 50px; padding-inline: 21px; }
.button-full { width: 100%; }

.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 42px;
  align-items: end;
  min-height: 520px;
  padding: 72px 0 70px;
}
.hero-logo {
  display: block;
  width: min(100%, 620px);
  height: auto;
  margin: 0 0 18px;
  filter: drop-shadow(0 12px 34px rgba(255, 41, 48, 0.2));
}
.eyebrow { margin: 0 0 10px; color: var(--cyan); font-size: 0.74rem; font-weight: 900; letter-spacing: 0.2em; }
.pulse { display: inline-block; width: 7px; height: 7px; margin-right: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 5px rgba(67, 224, 207, 0.1); }
.hero h1 { max-width: 760px; margin: 0; font-size: clamp(2.6rem, 5vw, 4.6rem); line-height: 1; letter-spacing: -0.055em; }
.hero h1 span { color: transparent; background: linear-gradient(90deg, var(--cyan), #8bd4ff 48%, var(--violet)); background-clip: text; -webkit-background-clip: text; }
.hero-description { max-width: 640px; margin: 28px 0 0; color: var(--muted); font-size: 1.05rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.policy-card {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  padding: 22px;
  border: 1px solid var(--line-bright);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(67, 224, 207, 0.08), rgba(17, 31, 52, 0.82));
  box-shadow: var(--shadow);
}
.policy-card strong { display: block; margin-top: 1px; }
.policy-card p { margin: 5px 0 0; color: var(--muted); font-size: 0.86rem; }
.policy-icon { display: grid; width: 34px; height: 34px; flex: 0 0 34px; place-items: center; border-radius: 10px; background: rgba(67, 224, 207, 0.14); color: var(--cyan); font-weight: 900; }

.community-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 22px; padding-bottom: 90px; }
.board-sidebar, .board-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); backdrop-filter: blur(18px); }
.board-sidebar { align-self: start; padding: 16px; }
.sidebar-heading { display: flex; align-items: baseline; justify-content: space-between; padding: 10px 10px 14px; border-bottom: 1px solid var(--line); }
.sidebar-heading span { color: var(--cyan); font-size: 0.7rem; font-weight: 900; letter-spacing: 0.2em; }
.sidebar-heading small { color: var(--muted); }
.board-list { display: grid; gap: 4px; padding: 10px 0; }
.board-link {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 4px 8px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.board-icon {
  grid-row: 1 / 3;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  object-fit: cover;
  opacity: 0.78;
  transition: opacity 160ms ease, transform 160ms ease, filter 160ms ease;
}
.board-link:hover .board-icon, .board-link.active .board-icon {
  opacity: 1;
  transform: scale(1.04);
  filter: drop-shadow(0 0 9px rgba(67, 224, 207, 0.22));
}
.board-link small { grid-column: 2 / -1; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-link .count { color: var(--muted); font-size: 0.78rem; }
.board-link.active { border-color: var(--line-bright); background: rgba(67, 224, 207, 0.08); }
.board-link.active strong, .board-link.active .count { color: var(--cyan); }
.download-card { margin-top: 8px; padding: 18px; border-radius: 16px; background: linear-gradient(145deg, rgba(157, 124, 255, 0.14), rgba(255, 108, 159, 0.06)); }
.download-kicker { color: #cab9ff; font-size: 0.64rem; font-weight: 900; letter-spacing: 0.16em; }
.download-card strong { display: block; margin-top: 6px; }
.download-card p { margin: 7px 0 14px; color: var(--muted); font-size: 0.8rem; }
.download-card .button { width: 100%; font-size: 0.84rem; }

.board-panel { min-height: 600px; overflow: hidden; }
.board-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 24px 30px; border-bottom: 1px solid var(--line); }
.board-title-icon { width: 72px; height: 72px; flex: 0 0 72px; border-radius: 18px; object-fit: cover; filter: drop-shadow(0 0 13px rgba(255, 79, 86, 0.2)); }
.board-toolbar-copy { min-width: 0; flex: 1; }
.board-toolbar h2 { margin: 0; font-size: 1.8rem; letter-spacing: -0.04em; }
.board-toolbar p:last-child { margin: 5px 0 0; color: var(--muted); font-size: 0.9rem; }
.list-heading, .post-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 64px 90px; gap: 14px; align-items: center; }
.list-heading { padding: 12px 24px; color: #6f829d; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; }
.list-heading span:not(:first-child) { text-align: center; }
.post-row {
  width: 100%;
  padding: 18px 24px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: background-color 160ms ease;
}
.post-row:hover { background: rgba(255, 255, 255, 0.025); }
.post-title { min-width: 0; }
.post-title strong { display: flex; align-items: center; gap: 8px; overflow: hidden; font-size: 0.96rem; text-overflow: ellipsis; white-space: nowrap; }
.post-title p { overflow: hidden; margin: 4px 0 0; color: var(--muted); font-size: 0.78rem; text-overflow: ellipsis; white-space: nowrap; }
.post-badge { flex: 0 0 auto; padding: 2px 7px; border-radius: 999px; background: rgba(255, 108, 159, 0.12); color: var(--pink); font-size: 0.62rem; }
.post-video { color: var(--violet); font-size: 0.68rem; }
.post-image { color: var(--cyan); }
.post-cell { color: var(--muted); font-size: 0.78rem; text-align: center; }
.empty-state { display: grid; min-height: 310px; place-content: center; place-items: center; color: var(--muted); text-align: center; }
.empty-state p { margin: 12px 0 0; }
.loader { width: 28px; height: 28px; border: 3px solid rgba(67, 224, 207, 0.16); border-top-color: var(--cyan); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 24px; border-top: 1px solid var(--line); }
.pagination span { min-width: 34px; text-align: center; font-weight: 800; }

.site-footer { display: flex; justify-content: space-between; gap: 20px; width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 26px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.8rem; }
.site-footer span { color: var(--text); font-weight: 900; letter-spacing: 0.1em; }
.site-footer p { margin: 0; }

.modal {
  width: min(520px, calc(100% - 28px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: transparent;
  color: var(--text);
  overflow: visible;
}
.modal::backdrop { background: rgba(2, 7, 14, 0.78); backdrop-filter: blur(8px); }
.modal-wide { width: min(780px, calc(100% - 28px)); }
.modal-card { position: relative; max-height: calc(100vh - 32px); padding: 34px; border: 1px solid var(--line-bright); border-radius: 24px; background: #0e1b2e; box-shadow: var(--shadow); overflow-y: auto; }
.modal-card h2 { margin: 0 0 5px; font-size: 1.65rem; letter-spacing: -0.04em; }
.modal-description { margin: 0 0 24px; color: var(--muted); }
.modal-close { position: absolute; top: 15px; right: 16px; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.03); color: var(--muted); cursor: pointer; font-size: 1.35rem; }
.modal label { display: grid; gap: 7px; margin-top: 15px; color: #cbd6e6; font-size: 0.82rem; font-weight: 800; }
.modal label span { color: var(--muted); font-weight: 500; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #091526;
  color: var(--text);
}
input, select { min-height: 46px; padding: 10px 12px; }
textarea { padding: 12px; resize: vertical; }
input::placeholder, textarea::placeholder { color: #60718a; }
.form-row { display: grid; grid-template-columns: 1fr 1.45fr; gap: 12px; }
.form-error { min-height: 24px; margin: 10px 0; color: var(--danger); font-size: 0.82rem; }
.form-hint { color: var(--muted); font-size: 0.78rem; }
.image-upload-panel { margin-top: 18px; padding: 16px; border: 1px solid rgba(157, 124, 255, 0.3); border-radius: 16px; background: rgba(157, 124, 255, 0.07); }
.image-upload-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.image-upload-heading strong { display: block; color: #e6ddff; }
.image-upload-heading div > span { display: block; margin-top: 2px; color: var(--muted); font-size: 0.76rem; }
.image-status { flex: 0 0 auto; color: #cab9ff; font-size: 0.74rem; font-weight: 800; }
.image-picker input[type="file"] { padding: 8px; color: var(--muted); }
.image-picker input[type="file"]::file-selector-button { margin-right: 10px; padding: 8px 12px; border: 1px solid rgba(157, 124, 255, 0.36); border-radius: 9px; background: rgba(157, 124, 255, 0.13); color: #e2d8ff; cursor: pointer; font-weight: 800; }
.image-preview { display: grid; gap: 10px; margin-top: 14px; }
.image-preview img { display: block; width: 100%; max-height: 330px; border: 1px solid var(--line); border-radius: 13px; background: #07111f; object-fit: contain; }
.image-preview .button { justify-self: end; min-height: 36px; padding-block: 5px; }
.text-button { display: block; margin: 16px auto 0; border: 0; background: transparent; color: var(--cyan); cursor: pointer; }
.turnstile-container { min-height: 70px; margin-top: 18px; }
.success-mark { display: grid; width: 54px; height: 54px; margin-bottom: 20px; place-items: center; border-radius: 16px; background: rgba(67, 224, 207, 0.12); color: var(--cyan); font-size: 1.5rem; }
.recovery-card code { display: block; margin: 20px 0; padding: 16px; border: 1px dashed var(--line-bright); border-radius: 12px; background: #07111f; color: var(--cyan); font-size: clamp(0.9rem, 4vw, 1.2rem); letter-spacing: 0.08em; text-align: center; word-break: break-all; }
.recovery-card .button + .button { margin-top: 9px; }

.post-detail { padding: 38px; }
.post-detail h2 { padding-right: 30px; font-size: clamp(1.55rem, 4vw, 2.2rem); }
.detail-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; color: var(--muted); font-size: 0.8rem; }
.detail-body { margin-top: 28px; padding: 24px 0; border-top: 1px solid var(--line); color: #dbe5f2; white-space: pre-wrap; word-break: break-word; }
.detail-image { margin: 4px 0 24px; }
.detail-image img { display: block; width: 100%; max-height: 760px; border: 1px solid var(--line); border-radius: 16px; background: #07111f; object-fit: contain; }
.detail-image figcaption { margin-top: 9px; color: var(--muted); font-size: 0.78rem; text-align: center; }
.video-frame { position: relative; padding-top: 56.25%; border-radius: 16px; overflow: hidden; background: #03070c; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.detail-actions { display: flex; justify-content: flex-end; margin-top: 20px; }
.comments-section { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--line); }
.comments-heading { display: flex; align-items: center; gap: 10px; }
.comments-heading h3 { margin: 0; }
.comments-heading span { color: var(--cyan); font-weight: 900; }
.comment { padding: 16px 0; border-bottom: 1px solid var(--line); }
.comment-meta { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 0.76rem; }
.comment strong { color: var(--text); }
.comment p { margin: 8px 0 0; color: #ccd7e6; white-space: pre-wrap; word-break: break-word; }
.comment-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; margin-top: 18px; }
.comment-form textarea { min-height: 82px; }
.comment-form .button { min-height: 82px; }

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  max-width: min(380px, calc(100% - 44px));
  padding: 13px 17px;
  border: 1px solid var(--line-bright);
  border-radius: 12px;
  background: #10243a;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

[hidden] { display: none !important; }

@media (max-width: 880px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 64px; }
  .policy-card { max-width: 520px; }
  .community-grid { grid-template-columns: 1fr; }
  .board-sidebar { display: grid; grid-template-columns: 1fr; }
  .board-list { grid-template-columns: repeat(4, minmax(148px, 1fr)); overflow-x: auto; }
  .board-link small { display: none; }
  .board-icon { grid-row: 1; }
  .download-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 16px; }
  .download-card p { grid-column: 1; margin: 2px 0 0; }
  .download-card .button { grid-column: 2; grid-row: 1 / 4; width: auto; }
}

@media (max-width: 660px) {
  .site-header, .shell, .site-footer { width: min(100% - 22px, 1180px); }
  .brand small { display: none; }
  .user-chip { display: none !important; }
  .top-nav .button { padding-inline: 11px; }
  .hero { padding: 44px 2px 48px; }
  .hero-logo { width: min(100%, 495px); margin-bottom: 12px; }
  .hero h1 { font-size: clamp(2.3rem, 11vw, 3.6rem); }
  .hero-description { font-size: 0.94rem; }
  .policy-card { padding: 18px; }
  .board-sidebar { padding: 10px; }
  .board-list { grid-template-columns: repeat(4, 138px); }
  .board-link { grid-template-columns: 30px 1fr; gap: 2px 7px; }
  .board-icon { width: 30px; height: 30px; }
  .board-link .count { grid-column: 2; grid-row: 2; }
  .download-card { grid-template-columns: 1fr; }
  .download-card .button { grid-column: 1; grid-row: auto; margin-top: 8px; }
  .board-toolbar { align-items: flex-start; gap: 12px; padding: 20px 18px; }
  .board-title-icon { width: 52px; height: 52px; flex-basis: 52px; border-radius: 13px; }
  .board-toolbar h2 { font-size: 1.45rem; }
  .board-toolbar p:last-child { max-width: 210px; }
  .list-heading { display: none; }
  .post-row { grid-template-columns: 1fr auto; padding: 17px 18px; }
  .post-cell.author { grid-column: 1; text-align: left; }
  .post-cell.comments { grid-column: 2; grid-row: 1; align-self: start; color: var(--cyan); }
  .post-cell.date { grid-column: 2; grid-row: 2; }
  .site-footer { flex-direction: column; }
  .modal-card, .post-detail { padding: 28px 20px; }
  .form-row { grid-template-columns: 1fr; }
  .image-upload-heading { align-items: flex-start; }
  .image-preview img { max-height: 250px; }
  .comment-form { grid-template-columns: 1fr; }
  .comment-form .button { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
