/* ============================================================
   공지사항 · 자유게시판 + 회원 공개 프로필 · 포인트 거래
   ------------------------------------------------------------
   · 데스크톱 기준. 모바일 규칙은 responsive.css 한 곳에만 둔다.
   · 색·모서리·그림자는 사이트 공통 토큰(variables.css)을 따른다.
   ============================================================ */

.gg-board { padding-bottom: 24px; }
.bd-page { width: 1060px; max-width: 100%; margin: 18px auto 0; padding: 0 0 18px; }

/* ---------- 머리말 ---------- */
.bd-hero {
  display: flex; align-items: center; gap: 14px;
  background: #fff; border: 1px solid var(--card-border); border-radius: 22px;
  padding: 18px 22px; margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(96, 143, 214, .10), 0 1px 3px rgba(96, 143, 214, .06);
}
.bd-hero-ico {
  width: 52px; height: 52px; flex: none; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, #eaf3ff, #dbe9ff); font-size: 26px;
}
.bd-hero-tx { min-width: 0; flex: 1 1 auto; }
.bd-title { margin: 0 0 3px; font-size: 22px; font-weight: 900; color: var(--tx); }
.bd-sub { margin: 0; font-size: 12.5px; font-weight: 700; color: var(--tx-sub); }
.bd-hero-right { display: flex; align-items: center; gap: 10px; flex: none; }

/* 게시판 전환 탭 */
.bd-tabs { display: flex; gap: 6px; padding: 4px; border-radius: 12px; background: #f2f7fc; }
.bd-tab {
  padding: 7px 14px; border-radius: 9px; text-decoration: none;
  font-size: 12.5px; font-weight: 800; color: var(--tx-sub);
  transition: background .18s ease, color .18s ease;
}
.bd-tab:hover { color: var(--tx); }
.bd-tab.is-on { background: #fff; color: var(--blue); box-shadow: 0 1px 3px rgba(96, 143, 214, .2); }

/* ---------- 카드 ---------- */
.bd-card {
  background: #fff; border: 1px solid var(--card-border); border-radius: 22px;
  padding: 18px 22px 22px;
  box-shadow: 0 8px 24px rgba(96, 143, 214, .10), 0 1px 3px rgba(96, 143, 214, .06);
}

/* ---------- 목록 위 줄 (개수 · 검색) ---------- */
.bd-listtop { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.bd-count { font-size: 12.5px; font-weight: 800; color: var(--tx-sub); }
.bd-count b { color: var(--tx); font-weight: 900; }
.bd-search { display: flex; gap: 6px; }
.bd-search-in {
  width: 220px; height: 36px; border-radius: 11px; padding: 0 13px;
  border: 1px solid var(--card-border); background: #f7fafd;
  font-family: inherit; font-size: 12.5px; color: var(--tx);
}
.bd-search-in:focus { outline: none; border-color: var(--blue); background: #fff; }
.bd-search-btn {
  height: 36px; padding: 0 16px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--card-border); background: #fff; color: var(--tx);
  font-family: inherit; font-size: 12.5px; font-weight: 800;
}
.bd-search-btn:hover { background: #f2f8ff; }

/* ---------- 분류 칩 ---------- */
.bd-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.bd-cat {
  padding: 6px 13px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--card-border); background: #fff;
  font-family: inherit; font-size: 12px; font-weight: 800; color: var(--tx-sub);
  transition: all .18s ease;
}
.bd-cat:hover { background: #f2f8ff; color: var(--tx); }
.bd-cat.is-on { background: linear-gradient(180deg, #3b86fa, #1d6bfa); border-color: transparent; color: #fff; }

/* ---------- 목록 ---------- */
.bd-table { border-top: 2px solid #dfe9f7; }
.bd-row {
  display: grid; grid-template-columns: 62px 76px minmax(0, 1fr) 120px 62px 62px;
  gap: 8px; align-items: center;
  padding: 12px 6px; border-bottom: 1px solid #edf3fa;
  font-size: 13px; color: var(--tx);
}
.bd-row-head {
  padding: 10px 6px; background: #f7fafd;
  font-size: 11.5px; font-weight: 800; color: var(--tx-sub); text-align: center;
}
.bd-row-head span:nth-child(3) { text-align: left; padding-left: 4px; }
.bd-row:not(.bd-row-head):hover { background: #f7fbff; }
.bd-row.is-pinned { background: #fffdf3; }
.bd-row.is-pinned:hover { background: #fff9e6; }
.bd-no, .bd-date, .bd-view { text-align: center; font-size: 12px; font-weight: 700; color: var(--tx-sub); }
.bd-no.bd-pin { font-size: 13px; }
.bd-author { text-align: center; min-width: 0; }

/* 분류 배지 — 색은 게시판별로 다르지 않게 한 가지 계열로 통일한다 */
.bd-badge {
  display: inline-block; justify-self: center; max-width: 100%;
  padding: 3px 10px; border-radius: 999px;
  background: #eef3fb; color: #5a6b88;
  font-size: 11px; font-weight: 800; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.bd-badge.bd-cat-필독 { background: rgba(224, 49, 49, .10); color: #e03131; }
.bd-badge.bd-cat-점검 { background: rgba(245, 166, 35, .15); color: #cf8a11; }
.bd-badge.bd-cat-업데이트 { background: rgba(37, 110, 235, .12); color: var(--blue); }
.bd-badge.bd-cat-이벤트 { background: rgba(76, 175, 80, .15); color: #37a63c; }

/* 제목 */
.bd-t { display: flex; align-items: center; gap: 6px; min-width: 0; padding-left: 4px; }
.bd-t-link {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--tx); font-weight: 800; text-decoration: none;
}
.bd-t-link:hover { color: var(--blue); text-decoration: underline; }
.bd-t-cnt { flex: none; font-size: 11.5px; font-weight: 900; color: #f0803c; }

/* 작성자 (누르면 공개 프로필) */
.bd-author-btn {
  max-width: 100%; padding: 0; border: none; background: none; cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 800; color: var(--tx);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.bd-author-btn:hover { color: var(--blue); text-decoration: underline; }

.bd-empty { margin: 34px 0; text-align: center; font-size: 13px; font-weight: 700; color: var(--tx-sub); }
.bd-empty-sm { margin: 18px 0; font-size: 12.5px; }

/* ---------- 페이지 이동 ---------- */
.bd-pager { display: flex; justify-content: center; gap: 6px; margin-top: 18px; }
.bd-pg {
  min-width: 34px; height: 34px; padding: 0 10px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--card-border); background: #fff;
  font-family: inherit; font-size: 12.5px; font-weight: 800; color: var(--tx-sub);
}
.bd-pg:hover:not(:disabled) { background: #f2f8ff; color: var(--tx); }
.bd-pg.is-on { background: linear-gradient(180deg, #3b86fa, #1d6bfa); border-color: transparent; color: #fff; }
.bd-pg:disabled { opacity: .4; cursor: default; }

/* ---------- 상세 ---------- */
.bd-dt-head { padding-bottom: 14px; border-bottom: 2px solid #dfe9f7; }
.bd-dt-head .bd-badge { justify-self: start; }
.bd-dt-title {
  margin: 8px 0 10px; font-size: 20px; font-weight: 900; color: var(--tx);
  line-height: 1.4; word-break: break-all;
}
.bd-dt-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
  font-size: 12px; font-weight: 700; color: var(--tx-sub);
}
.bd-dt-meta b { color: var(--tx); font-weight: 800; }
.bd-dt-pin { color: #cf8a11; font-weight: 800; }
.bd-dt-body {
  min-height: 160px; padding: 20px 2px 26px;
  font-size: 14px; font-weight: 600; color: var(--tx); line-height: 1.85;
  white-space: pre-wrap;          /* 줄바꿈 그대로 (입력값은 textContent 로만 넣는다) */
  word-break: break-word;
}
.bd-dt-btns {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding-top: 14px; border-top: 1px solid #edf3fa;
}
.bd-dt-right { display: flex; gap: 8px; flex-wrap: wrap; }

.bd-btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 36px; padding: 0 16px; border-radius: 11px; cursor: pointer;
  border: 1px solid var(--card-border); background: #fff; color: var(--tx);
  font-family: inherit; font-size: 12.5px; font-weight: 800; text-decoration: none;
  transition: filter .18s ease;
}
.bd-btn:hover { filter: brightness(.98); }
.bd-btn-ghost { color: var(--tx-sub); }
.bd-btn-ghost:hover { color: var(--tx); background: #f2f8ff; }
.bd-btn-danger { color: #e03131; border-color: rgba(224, 49, 49, .3); }
.bd-btn-danger:hover { background: rgba(224, 49, 49, .07); }

/* ---------- 댓글 ---------- */
.bd-cmts { margin-top: 22px; padding-top: 18px; border-top: 2px solid #dfe9f7; }
.bd-cmts-h { font-size: 14px; font-weight: 900; color: var(--tx); margin-bottom: 12px; }
.bd-cmts-h b { color: var(--blue); }
.bd-cmt { padding: 13px 2px; border-bottom: 1px solid #edf3fa; }
.bd-cmt-head { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-bottom: 6px; }
.bd-cmt-date { font-size: 11.5px; font-weight: 700; color: var(--tx-sub); }
.bd-cmt-act {
  padding: 0; border: none; background: none; cursor: pointer;
  font-family: inherit; font-size: 11.5px; font-weight: 800; color: var(--tx-sub);
}
.bd-cmt-act:hover { color: var(--blue); text-decoration: underline; }
.bd-cmt-act.is-danger:hover { color: #e03131; }
.bd-cmt-body {
  margin: 0; font-size: 13px; font-weight: 600; color: var(--tx); line-height: 1.75;
  white-space: pre-wrap; word-break: break-word;
}
.bd-cmt-edit { display: flex; align-items: flex-start; gap: 6px; margin-top: 9px; }
.bd-cmt-edit .bd-cmt-in { flex: 1; }
.bd-cmt-write { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; }
.bd-cmt-in {
  flex: 1; min-width: 0; border-radius: 12px; padding: 11px 13px; resize: vertical;
  border: 1px solid var(--card-border); background: #f7fafd;
  font-family: inherit; font-size: 13px; color: var(--tx); line-height: 1.6;
}
.bd-cmt-in:focus { outline: none; border-color: var(--blue); background: #fff; }
.bd-cmt-write .gg-btn { flex: none; height: 42px; }

/* ---------- 작성 · 수정 ---------- */
.bd-form { display: flex; flex-direction: column; gap: 8px; }
.bd-f-label { font-size: 12px; font-weight: 900; color: var(--tx); margin-top: 8px; }
.bd-f-sel, .bd-f-in, .bd-f-body {
  width: 100%; border-radius: 12px; padding: 0 14px;
  border: 1px solid var(--card-border); background: #f7fafd;
  font-family: inherit; font-size: 13.5px; color: var(--tx);
}
.bd-f-sel, .bd-f-in { height: 44px; }
.bd-f-sel { max-width: 200px; cursor: pointer; }
.bd-f-body { padding: 13px 14px; line-height: 1.8; resize: vertical; min-height: 260px; }
.bd-f-sel:focus, .bd-f-in:focus, .bd-f-body:focus { outline: none; border-color: var(--blue); background: #fff; }
.bd-f-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* ============================================================
   회원 공개 프로필 · 포인트 거래 모달
   ============================================================ */
.pm-back {
  position: fixed; inset: 0; z-index: 12500;         /* 모바일 하단 메뉴보다 위 */
  background: rgba(15, 35, 75, .45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: ggFadeIn .18s ease;
}
.pm-card {
  position: relative; width: 340px; max-width: 100%;
  max-height: calc(100vh - 40px); overflow-y: auto;
  background: #fff; border-radius: 20px; padding: 26px 24px 22px;
  box-shadow: 0 20px 50px rgba(20, 45, 90, .3);
  animation: ggRise .22s ease;
}
.pm-card-wide { width: 400px; }
.pm-x {
  position: absolute; top: 12px; right: 14px;
  width: 30px; height: 30px; border-radius: 9px; cursor: pointer;
  border: none; background: none; color: var(--tx-sub);
  font-family: inherit; font-size: 20px; font-weight: 800; line-height: 1;
}
.pm-x:hover { background: #f2f7fc; color: var(--tx); }
.pm-loading { margin: 30px 0; text-align: center; font-size: 13px; font-weight: 700; color: var(--tx-sub); }

.pm-top { display: flex; flex-direction: column; align-items: center; gap: 7px; margin-bottom: 18px; }
.pm-avatar { border-radius: 50%; background: #f2f7fc; object-fit: cover; }
.pm-nick { font-size: 17px; font-weight: 900; color: var(--tx); word-break: break-all; text-align: center; }
.pm-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 16px; }
.pm-stat {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 11px 4px; border-radius: 13px; background: #f7fafd;
}
.pm-stat span { font-size: 11px; font-weight: 800; color: var(--tx-sub); }
.pm-stat b { font-size: 14px; font-weight: 900; color: var(--tx); }
.pm-note { margin: 0; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--tx-sub); }

/* ---------- 포인트 거래 ---------- */
.tf-title { margin: 0 0 5px; font-size: 18px; font-weight: 900; color: var(--tx); }
.tf-sub { margin: 0 0 16px; font-size: 12px; font-weight: 700; color: var(--tx-sub); line-height: 1.6; }
.tf-to { margin-bottom: 14px; }
.tf-label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 900; color: var(--tx); }
.tf-nickrow { display: flex; gap: 6px; }
.tf-in {
  flex: 1; min-width: 0; width: 100%; height: 42px; border-radius: 12px; padding: 0 13px;
  border: 1px solid var(--card-border); background: #f7fafd;
  font-family: inherit; font-size: 13.5px; color: var(--tx);
}
.tf-in:focus { outline: none; border-color: var(--blue); background: #fff; }
.tf-in:disabled { color: var(--tx-sub); }
.tf-found { margin: 7px 0 0; min-height: 16px; font-size: 11.5px; font-weight: 800; color: #e03131; }
.tf-found.is-ok { color: #2db14e; }

.tf-amtbox { position: relative; }
.tf-amt { padding-right: 40px; text-align: right; font-size: 16px; font-weight: 900; }
.tf-unit {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  font-size: 12px; font-weight: 800; color: var(--tx-sub); pointer-events: none;
}

.tf-calc { margin-top: 14px; padding: 13px 15px; border-radius: 14px; background: #f7fafd; }
.tf-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 5px 0; }
.tf-row span { font-size: 12px; font-weight: 800; color: var(--tx-sub); }
.tf-row b { font-size: 13.5px; font-weight: 900; color: var(--tx); font-variant-numeric: tabular-nums; }
.tf-row.is-total { margin-top: 5px; padding-top: 9px; border-top: 1px solid #e2eaf5; }
.tf-row.is-total span { color: var(--tx); }
.tf-row.is-total b { font-size: 16px; color: var(--blue); }
.tf-err { margin: 9px 0 0; min-height: 17px; font-size: 11.5px; font-weight: 800; color: #e03131; line-height: 1.5; }
.tf-btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.tf-btns .bd-btn, .tf-btns .gg-btn { min-width: 84px; }

.tf-confirm-to { display: flex; flex-direction: column; align-items: center; gap: 7px; margin: 6px 0 14px; }
.tf-confirm-to b { font-size: 15px; font-weight: 900; color: var(--tx); word-break: break-all; text-align: center; }
.tf-warn { margin: 12px 0 0; text-align: center; font-size: 12px; font-weight: 800; color: #e03131; }
