@font-face {
    font-family: 'Pretendard';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Thin.woff2') format('woff2');
    font-weight: 100;
    font-display: swap;
}

@font-face {
    font-family: 'Pretendard';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-ExtraLight.woff2') format('woff2');
    font-weight: 200;
    font-display: swap;
}

@font-face {
    font-family: 'Pretendard';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Light.woff2') format('woff2');
    font-weight: 300;
    font-display: swap;
}

@font-face {
    font-family: 'Pretendard';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Regular.woff2') format('woff2');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Pretendard';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Medium.woff2') format('woff2');
    font-weight: 500;
    font-display: swap;
}

@font-face {
    font-family: 'Pretendard';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-display: swap;
}

@font-face {
    font-family: 'Pretendard';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Bold.woff2') format('woff2');
    font-weight: 700;
    font-display: swap;
}

@font-face {
    font-family: 'Pretendard';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-ExtraBold.woff2') format('woff2');
    font-weight: 800;
    font-display: swap;
}

@font-face {
    font-family: 'Pretendard';
    src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/pretendard@1.0/Pretendard-Black.woff2') format('woff2');
    font-weight: 900;
    font-display: swap;
}

:root {
  --color-primary: #2f6fed;
  --color-primary-dark: #1f56c9;
  --color-primary-light: #eaf1ff;
  --color-bg: #f4f6fa;
  --color-surface: #ffffff;
  --color-border: #e5e9f0;
  --color-text: #222833;
  --color-text-muted: #6b7280;
  --color-text-faint: #9aa1ac;
  --color-new: #ff5470;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(20, 30, 60, 0.06);
  --shadow-md: 0 4px 16px rgba(20, 30, 60, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Pretendard", "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Malgun Gothic", sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--color-primary), #6ea1ff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}

.main-nav {
  display: flex;
  gap: 36px;
}

.main-nav a {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text-muted);
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}

.main-nav a.active,
.main-nav a:hover {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: var(--color-primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--color-primary-dark);
}

.btn-outline {
  background: #fff;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}

.btn-block {
  width: 100%;
}

/* ---------- Auth widget ---------- */
.auth-widget {
  display: flex;
  align-items: center;
}

.auth-profile {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}

.auth-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-logout {
  border: none;
  background: transparent;
  color: var(--color-text-faint);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
}

.auth-logout:hover {
  color: var(--color-primary);
}

.author-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-bg);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}

.auth-gate {
  padding: 48px 24px;
  text-align: center;
}

.auth-gate p {
  color: var(--color-text-muted);
  font-size: 15px;
  margin: 0 0 20px;
}

.auth-gate .signin-slot {
  display: flex;
  justify-content: center;
}

/* ---------- Hero ---------- */
.hero {
  overflow: hidden;
  line-height: 0;
  background: #dfeaff;
}

.hero-banner-img {
  width: 100%;
  height: 340px;
  object-fit: cover;
  object-position: center 40%;
}

@media (max-width: 640px) {
  .hero-banner-img {
    height: 220px;
    object-position: 30% 40%;
  }
}

/* ---------- Layout ---------- */
.page-body {
  padding: 32px 24px 64px;
}

.layout {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 220px 1fr 300px;
  gap: 24px;
  align-items: start;
}

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

/* ---------- Side nav ---------- */
.side-nav {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 12px;
  position: sticky;
  top: 96px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 15px;
  color: var(--color-text);
}

.side-nav a:hover {
  background: var(--color-bg);
}

.side-nav a.active {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.side-nav .group-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 4px;
  font-weight: 700;
  font-size: 14px;
  color: var(--color-text-faint);
  margin-top: 8px;
}

.side-nav .sub-link {
  padding-left: 42px;
  font-weight: 500;
  font-size: 14px;
  color: var(--color-text-muted);
}

/* ---------- Cards / panels ---------- */
.panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--color-border);
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 800;
}

.panel-title .badge-icon {
  color: var(--color-primary);
}

.more-link {
  font-size: 13px;
  color: var(--color-text-muted);
  font-weight: 600;
}

.more-link:hover {
  color: var(--color-primary);
}

/* ---------- Post table ---------- */
.post-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.post-table th {
  text-align: left;
  color: var(--color-text-faint);
  font-weight: 600;
  font-size: 13px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.post-table td {
  padding: 14px 24px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

.post-table tbody tr:last-child td {
  border-bottom: none;
}

.post-table tbody tr:hover {
  background: var(--color-bg);
  cursor: pointer;
}

.post-table td.col-title {
  color: var(--color-text);
  font-weight: 600;
  max-width: 0;
}

.post-table td.col-title a {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.col-num,
.col-views {
  width: 90px;
  text-align: center !important;
}

.col-author,
.col-date {
  width: 130px;
  white-space: nowrap;
}

.tag-new {
  display: inline-block;
  background: var(--color-new);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.icon-img {
  color: var(--color-text-faint);
  flex-shrink: 0;
}

/* ---------- Sidebar widgets ---------- */
.widget {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
}

.welcome-card {
  background: linear-gradient(135deg, var(--color-primary-light), #f8fbff);
  text-align: center;
}

.welcome-card .avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.welcome-card p {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 0 0 16px;
  line-height: 1.6;
}

.widget-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 15px;
  margin: 0 0 14px;
}

.recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.recent-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}

.recent-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.recent-list a {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13.5px;
}

.recent-list .title {
  color: var(--color-text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-list .time {
  color: var(--color-text-faint);
  font-size: 12px;
  flex-shrink: 0;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
}

.tag-chip:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 28px 24px;
  text-align: center;
  color: var(--color-text-faint);
  font-size: 13px;
}

/* ---------- Board list page ---------- */
.board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

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

.search-box {
  display: flex;
  gap: 8px;
}

.search-box select,
.search-box input {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 20px 0 4px;
}

.pagination button {
  min-width: 34px;
  height: 34px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text-muted);
  font-weight: 600;
  cursor: pointer;
}

.pagination button.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* ---------- Write / view page ---------- */
.write-form {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-muted);
  margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--color-text);
}

.field textarea {
  min-height: 260px;
  resize: vertical;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .field {
  flex: 1;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.post-view-header {
  padding: 24px;
  border-bottom: 1px solid var(--color-border);
}

.post-view-header h1 {
  font-size: 22px;
  margin: 0 0 12px;
}

.post-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: var(--color-text-faint);
}

.post-view-body {
  padding: 28px 24px;
  min-height: 200px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--color-text);
  white-space: pre-wrap;
}

.post-view-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
}
