/* ===== Shared design tokens (mirrors index.html) ===== */
:root {
  --brand: #1B6BFF;
  --brand-600: #1559e0;
  --brand-700: #0f47b8;
  --brand-50: #eef3ff;
  --brand-100: #dde7ff;
  --ink: #0B1B33;
  --ink-2: #1F2D45;
  --muted: #5A6B85;
  --muted-2: #8694AA;
  --line: #E5EAF2;
  --line-2: #EEF1F6;
  --bg: #ffffff;
  --bg-2: #F7F9FC;
  --bg-3: #F0F4FA;
  --ok: #16A34A;
  --warn: #F59E0B;
  --danger: #EF4444;
  --accent: #FF6B3D;
  --accent-600: #E85420;
  --accent-50: #FFF1EB;
  --accent-100: #FFE0D1;
  --shadow-sm: 0 1px 2px rgba(15,23,42,.04), 0 1px 1px rgba(15,23,42,.03);
  --shadow-md: 0 4px 14px rgba(15,40,90,.06), 0 2px 4px rgba(15,40,90,.04);
  --shadow-lg: 0 24px 60px rgba(15,40,90,.12), 0 8px 20px rgba(15,40,90,.06);
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Pretendard', 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  line-height: 1.5;
  font-size: 16px;
  letter-spacing: -0.01em;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Top bar ===== */
.topbar { background: #0B1B33; color: #C5D2E5; font-size: 13px; }
.topbar-inner {
  display: flex; justify-content: space-between; align-items: center;
  height: 36px;
}
.topbar a { color: #C5D2E5; opacity: .85; }
.topbar a:hover { opacity: 1; }
.topbar .links { display: flex; gap: 18px; }

/* ===== Header ===== */
header.site {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 36px; height: 72px; }
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 20px; letter-spacing: -0.03em;
  color: var(--ink);
}
.logo-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), #4D8AFF);
  display: grid; place-items: center;
  color: white; font-weight: 800; font-size: 15px;
  box-shadow: 0 6px 16px rgba(27,107,255,.35);
}
.logo-tag {
  font-size: 14px; color: rgb(37, 13, 231);
}
nav.main { display: flex; gap: 4px; flex: 1; }
nav.main a {
  padding: 10px 14px; border-radius: 8px;
  font-weight: 500; font-size: 15px; color: var(--ink-2);
  transition: all .15s;
}
nav.main a:hover { background: var(--bg-2); color: var(--brand); }
nav.main a.active { background: var(--brand-50); color: var(--brand); }
.nav-actions { display: flex; gap: 8px; align-items: center; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 10px;
  font-size: 14px; font-weight: 600;
  border: 1px solid transparent;
  transition: all .15s;
  background: transparent; color: var(--ink);
}
.btn:hover { transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--bg-2); }
.btn.outline { border-color: var(--line); background: white; color: var(--ink-2); }
.btn.outline:hover { border-color: var(--brand); color: var(--brand); }
.btn.primary {
  background: var(--brand); color: white;
  box-shadow: 0 6px 16px rgba(27,107,255,.25);
}
.btn.primary:hover { background: var(--brand-600); box-shadow: 0 8px 22px rgba(27,107,255,.35); }
.btn.danger { background: white; color: var(--danger); border-color: var(--line); }
.btn.danger:hover { border-color: var(--danger); background: #FEF2F2; }
.btn.lg { padding: 13px 22px; font-size: 15px; border-radius: 12px; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }

/* ===== Page header (board) ===== */
.page-head {
  background: linear-gradient(180deg, var(--bg-2) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line-2);
  padding: 56px 0 40px;
}
.page-head .eyebrow {
  color: var(--brand); font-size: 13px; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  margin-bottom: 10px;
}
.page-head h1 {
  font-size: 36px; line-height: 1.2; letter-spacing: -0.03em;
  font-weight: 800; margin: 0 0 10px;
}
.page-head .desc {
  color: var(--muted); font-size: 15px; line-height: 1.65; max-width: 640px;
}
.page-head-row {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
}
.crumbs {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--muted-2); margin-bottom: 18px;
}
.crumbs a:hover { color: var(--brand); }
.crumbs .sep { opacity: .5; }

/* ===== Tabs ===== */
.board-tabs {
  display: flex; gap: 4px;
  border-bottom: 1px solid var(--line);
  margin: 32px 0 0;
}
.board-tabs a {
  padding: 12px 18px;
  font-size: 15px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .15s;
}
.board-tabs a:hover { color: var(--ink); }
.board-tabs a.active { color: var(--brand); border-bottom-color: var(--brand); }

/* ===== Section / page body ===== */
.page-body { padding: 48px 0 88px; }

/* ===== Toolbar above list ===== */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.toolbar .count { color: var(--muted); font-size: 14px; }
.toolbar .count b { color: var(--ink); font-weight: 700; }
.search-box {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px;
  background: white; min-width: 280px;
}
.search-box svg { color: var(--muted-2); flex-shrink: 0; }
.search-box input {
  border: none; outline: none; flex: 1;
  font-size: 14px; font-family: inherit; color: var(--ink);
  background: transparent;
}
.search-box input::placeholder { color: var(--muted-2); }

/* ===== Tables ===== */
.board-table {
  width: 100%; border-collapse: collapse;
  background: white; border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.board-table thead {
  background: var(--bg-2);
}
.board-table th {
  font-weight: 600; font-size: 13px; color: var(--muted);
  text-align: left; padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  letter-spacing: 0.01em;
}
.board-table th.center { text-align: center; }
.board-table td {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-2);
  font-size: 14.5px; color: var(--ink-2);
  vertical-align: middle;
}
.board-table tbody tr:last-child td { border-bottom: none; }
.board-table tbody tr { transition: background .12s; }
.board-table tbody tr:hover { background: var(--bg-2); }
.board-table tbody tr.pinned { background: #FFFBF5; }
.board-table tbody tr.pinned:hover { background: #FFF6EB; }
.board-table td.num {
  text-align: center; color: var(--muted-2);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px; width: 70px;
}
.board-table td.title {
  font-weight: 500; color: var(--ink);
}
.board-table td.title a { display: inline-flex; align-items: center; gap: 8px; }
.board-table td.title a:hover { color: var(--brand); }
.board-table td.center { text-align: center; }
.board-table td.meta { color: var(--muted); font-size: 13px; white-space: nowrap; }
.board-table td.views {
  text-align: right; color: var(--muted);
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 13px; width: 90px;
}
.board-table td.author { color: var(--ink-2); font-size: 14px; white-space: nowrap; }
.board-table td.author .company { color: var(--muted-2); font-size: 12px; display: block; margin-top: 1px; }

/* ===== Badges & icons ===== */
.pin {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 6px;
  background: var(--accent-50); color: var(--accent-600);
  font-size: 11px; font-weight: 700;
  margin-right: 8px;
  letter-spacing: 0.02em;
}
.lock {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  color: var(--muted-2);
  margin-right: 4px;
}
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge.answered { background: var(--brand-50); color: var(--brand); }
.badge.pending  { background: #FFF7E6; color: #B7791F; }
.badge.private  { background: var(--bg-3); color: var(--muted); }
.badge.notice   { background: var(--accent-50); color: var(--accent-600); }
.badge.lg { font-size: 13px; padding: 5px 12px; }
.reply-count { color: var(--muted-2); font-size: 12px; margin-left: 4px; }

/* ===== Pagination ===== */
.pagination {
  display: flex; justify-content: center; align-items: center;
  gap: 4px; margin-top: 36px;
}
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 10px;
  border-radius: 8px; font-size: 14px; font-weight: 500;
  color: var(--muted); transition: all .12s;
}
.pagination a:hover { background: var(--bg-2); color: var(--ink); }
.pagination a.active { background: var(--brand); color: white; font-weight: 700; }
.pagination .nav-btn { color: var(--muted-2); }
.pagination .nav-btn:hover { color: var(--brand); }
.pagination .nav-btn.disabled { opacity: .35; pointer-events: none; }

/* ===== Empty state ===== */
.empty {
  text-align: center; padding: 80px 24px;
  background: var(--bg-2); border-radius: 14px;
  border: 1px dashed var(--line);
  color: var(--muted);
}
.empty svg { color: var(--muted-2); margin-bottom: 16px; }
.empty h3 { margin: 0 0 8px; color: var(--ink-2); font-size: 17px; font-weight: 700; }
.empty p { margin: 0 0 20px; font-size: 14px; line-height: 1.6; }

/* ===== Detail view ===== */
.detail-card {
  background: white; border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.detail-head {
  padding: 32px 36px 24px;
  border-bottom: 1px solid var(--line-2);
}
.detail-head .badges {
  display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap;
}
.detail-title {
  font-size: 26px; line-height: 1.35; letter-spacing: -0.025em;
  font-weight: 800; margin: 0 0 18px; color: var(--ink);
}
.detail-meta {
  display: flex; gap: 18px; color: var(--muted); font-size: 13.5px;
  flex-wrap: wrap; align-items: center;
}
.detail-meta .item { display: inline-flex; align-items: center; gap: 6px; }
.detail-meta .item svg { color: var(--muted-2); }
.detail-meta .sep { color: var(--line); }
.detail-body {
  padding: 36px;
  font-size: 15.5px; line-height: 1.85; color: var(--ink-2);
  white-space: pre-wrap; word-break: break-word;
}
.detail-body p { margin: 0 0 1.2em; }
.detail-body p:last-child { margin-bottom: 0; }
.detail-body strong { color: var(--ink); font-weight: 700; }

.detail-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 36px; border-top: 1px solid var(--line-2);
  background: var(--bg-2);
  flex-wrap: wrap; gap: 12px;
}
.detail-foot .left { display: flex; gap: 8px; align-items: center; }
.detail-foot .right { display: flex; gap: 8px; align-items: center; }

/* ===== Reply / answer block ===== */
.reply-block {
  margin-top: 24px;
  background: white; border: 1px solid var(--brand-100);
  border-left: 4px solid var(--brand);
  border-radius: 12px; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.reply-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 18px 28px; background: var(--brand-50);
  border-bottom: 1px solid var(--brand-100);
}
.reply-head .who {
  display: flex; align-items: center; gap: 12px;
}
.reply-avatar {
  width: 38px; height: 38px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), #4D8AFF);
  color: white; display: grid; place-items: center;
  font-size: 13px; font-weight: 800; letter-spacing: -0.02em;
  box-shadow: 0 4px 10px rgba(27,107,255,.3);
}
.reply-head .name { font-weight: 700; font-size: 15px; color: var(--ink); }
.reply-head .role { font-size: 12px; color: var(--brand); font-weight: 600; }
.reply-head .when { font-size: 13px; color: var(--muted); }
.reply-body {
  padding: 24px 28px;
  font-size: 15px; line-height: 1.85; color: var(--ink-2);
  white-space: pre-wrap;
}

/* ===== Authentication-needed dropdown ===== */
.auth-popover {
  position: relative;
}
.auth-popover-card {
  display: none;
  position: absolute; right: 0; top: calc(100% + 8px);
  background: white; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-lg);
  padding: 18px; width: 280px;
  z-index: 10;
}
.auth-popover.open .auth-popover-card { display: block; }
.auth-popover-card label {
  font-size: 12px; font-weight: 700; color: var(--muted);
  letter-spacing: 0.04em; text-transform: uppercase;
  display: block; margin-bottom: 6px;
}
.auth-popover-card .row {
  display: flex; gap: 6px; margin-top: 10px;
}

/* ===== Form ===== */
.form-card {
  background: white; border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.form-head {
  padding: 28px 36px 24px;
  border-bottom: 1px solid var(--line-2);
  background: var(--bg-2);
}
.form-head h2 {
  margin: 0 0 8px; font-size: 22px; font-weight: 800; letter-spacing: -0.025em;
}
.form-head p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.65; }

.notice-strip {
  display: flex; gap: 12px; align-items: flex-start;
  margin: 20px 36px 0;
  padding: 14px 18px;
  background: var(--brand-50); border: 1px solid var(--brand-100);
  border-radius: 10px;
  color: var(--ink-2); font-size: 13.5px; line-height: 1.65;
}
.notice-strip svg { color: var(--brand); flex-shrink: 0; margin-top: 2px; }
.notice-strip b { color: var(--brand); font-weight: 700; }

.form-body { padding: 28px 36px 32px; }
.form-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  margin-bottom: 18px;
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group.full { grid-column: 1 / -1; }
.form-group label {
  font-size: 13px; font-weight: 700; color: var(--ink-2);
  letter-spacing: 0.01em;
}
.form-group label .req { color: var(--accent); margin-left: 3px; }
.form-group label .opt {
  font-size: 11px; color: var(--muted-2); font-weight: 500;
  margin-left: 6px; letter-spacing: 0;
}
.form-group .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.input, .textarea, .select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--ink);
  background: white;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(27,107,255,.12);
}
.textarea { resize: vertical; min-height: 220px; line-height: 1.7; }
.checkbox-row {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s;
}
.checkbox-row:hover { background: var(--bg-3); border-color: var(--line); }
.checkbox-row input[type="checkbox"] {
  width: 18px; height: 18px; accent-color: var(--brand);
  cursor: pointer; margin: 0;
}
.checkbox-row .label-text { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.checkbox-row .label-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.form-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 20px 36px;
  border-top: 1px solid var(--line-2);
  background: var(--bg-2);
}

/* ===== Password gate (centered card) ===== */
.gate-wrap {
  display: flex; justify-content: center; align-items: flex-start;
  padding: 80px 24px;
}
.gate-card {
  width: 100%; max-width: 440px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  padding: 40px 36px 32px;
  text-align: center;
}
.gate-icon {
  width: 64px; height: 64px;
  background: var(--brand-50);
  border-radius: 16px;
  display: grid; place-items: center;
  color: var(--brand);
  margin: 0 auto 20px;
}
.gate-card h2 {
  margin: 0 0 10px;
  font-size: 22px; font-weight: 800; letter-spacing: -0.025em;
}
.gate-card .gate-desc {
  margin: 0 0 28px;
  font-size: 14.5px; color: var(--muted); line-height: 1.65;
}
.gate-card .gate-form {
  display: flex; flex-direction: column; gap: 12px;
  text-align: left;
}
.error-msg {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px;
  background: #FEF2F2; border: 1px solid #FECACA;
  border-radius: 10px;
  color: var(--danger); font-size: 13.5px; font-weight: 500;
}
.error-msg svg { flex-shrink: 0; }

.gate-back {
  margin-top: 24px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13.5px; color: var(--muted);
}
.gate-back:hover { color: var(--brand); }

/* ===== Footer ===== */
footer.site {
  background: #0B1B33; color: #B8C5DA;
  padding: 64px 0 28px;
}
.foot-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px; margin-bottom: 40px;
}
footer h5 { color: white; font-size: 14px; margin: 0 0 16px; font-weight: 700; }
footer ul { padding: 0; margin: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
footer ul a { color: #B8C5DA; opacity: .8; font-size: 13px; }
footer ul a:hover { opacity: 1; }
.foot-info { color: #8694AA; font-size: 12px; line-height: 1.7; margin-top: 14px; }
.foot-bottom {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding-top: 28px; border-top: 1px solid #1F2D45;
  font-size: 12px; color: #6B7C99;
  gap: 24px; flex-wrap: wrap;
}

/* ===== Responsive ===== */
@media (max-width: 880px) {
  .page-head { padding: 36px 0 28px; }
  .page-head h1 { font-size: 26px; }
  .page-head .desc { font-size: 14px; }
  nav.main { display: none; }
  .topbar .links { gap: 12px; }

  /* Mobile tables → card list */
  .board-table thead { display: none; }
  .board-table, .board-table tbody, .board-table tr, .board-table td { display: block; width: 100%; }
  .board-table { border-radius: 12px; }
  .board-table tr {
    padding: 16px 18px;
    border-bottom: 1px solid var(--line-2);
  }
  .board-table tr:last-child { border-bottom: none; }
  .board-table td { padding: 0; border: none; }
  .board-table td.num { display: none; }
  .board-table td.title { font-size: 15.5px; margin-bottom: 8px; line-height: 1.45; }
  .board-table td.title a { display: inline; }
  .board-table td.author { display: inline; font-size: 13px; color: var(--muted); }
  .board-table td.author .company { display: inline; margin: 0; }
  .board-table td.author .company::before { content: " · "; color: var(--muted-2); }
  .board-table td.meta { display: inline; font-size: 13px; color: var(--muted); }
  .board-table td.meta::before { content: " · "; color: var(--muted-2); }
  .board-table td.views { display: inline; font-size: 13px; text-align: left; width: auto; }
  .board-table td.views::before { content: " · 조회 "; color: var(--muted-2); }
  .board-table td.center { display: inline-block; margin-top: 6px; text-align: left; }

  /* Mobile detail */
  .detail-head, .detail-body, .detail-foot { padding-left: 22px; padding-right: 22px; }
  .detail-title { font-size: 21px; }
  .detail-meta { gap: 10px; font-size: 12.5px; }
  .detail-meta .sep { display: none; }
  .reply-head, .reply-body { padding-left: 22px; padding-right: 22px; }
  .reply-head { flex-wrap: wrap; }

  /* Mobile form */
  .form-head, .notice-strip, .form-body, .form-actions {
    padding-left: 22px; padding-right: 22px;
    margin-left: 0; margin-right: 0;
  }
  .notice-strip { margin: 16px 22px 0; padding: 14px; }
  .form-row { grid-template-columns: 1fr; gap: 16px; }
  .form-actions { flex-direction: column-reverse; gap: 10px; }
  .form-actions .btn { width: 100%; justify-content: center; }

  /* Mobile toolbar / search */
  .toolbar { flex-direction: column; align-items: stretch; }
  .search-box { min-width: 0; width: 100%; }

  /* Mobile footer */
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .detail-foot { flex-direction: column; align-items: stretch; }
  .detail-foot .left, .detail-foot .right { justify-content: space-between; }
}

@media (max-width: 520px) {
  .foot-grid { grid-template-columns: 1fr; }
  .topbar-inner { font-size: 12px; }
  .topbar > .container > div:first-child { display: none; }
  .gate-card { padding: 32px 24px 28px; }
}
