:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --text: #1c1c1c;
  --muted: #767676;
  --border: #e7e5e4;
  --accent: #2f6f4f;
  --accent-soft: #eaf3ee;
  --danger: #c0392b;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 1px 8px rgba(0, 0, 0, 0.03);
  --maxw: 880px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Segoe UI", "Noto Sans KR", sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

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

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

.brand {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
}

.nav-links .muted { color: var(--muted); }

.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}

.btn:hover { border-color: #cfcfcf; }

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

.btn-primary:hover { background: #275e42; }

.btn-danger {
  color: var(--danger);
  border-color: #f3d3ce;
  background: #fdf3f2;
}

.btn-sm { padding: 5px 11px; font-size: 13px; }

/* Layout */
.page {
  padding: 36px 0 80px;
}

.page-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 12px;
  flex-wrap: wrap;
}

.page-head h1 {
  font-size: 22px;
  margin: 0;
  letter-spacing: -0.02em;
}

.page-head .sub { color: var(--muted); font-size: 13.5px; }

/* Category chips */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--muted);
  background: var(--surface);
}

.chip.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* Search */
.search-box {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.search-box input[type="text"] {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}

/* Post list */
.post-list {
  border-top: 1px solid var(--border);
}

.post-row {
  display: block;
  padding: 18px 4px;
  border-bottom: 1px solid var(--border);
}

.post-row:hover .post-title { color: var(--accent); }

.post-row .cat {
  display: inline-block;
  font-size: 12px;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 9px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.post-title {
  font-size: 16.5px;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.post-meta {
  font-size: 12.5px;
  color: var(--muted);
}

.post-meta span + span::before {
  content: "·";
  margin: 0 6px;
}

.empty {
  padding: 60px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 30px;
  font-size: 13.5px;
}

.pagination a, .pagination span {
  padding: 6px 11px;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--muted);
}

.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Post detail */
.post-detail-head { border-bottom: 1px solid var(--border); padding-bottom: 20px; margin-bottom: 24px; }
.post-detail-head h1 { font-size: 24px; margin: 10px 0 14px; letter-spacing: -0.02em; }
.post-body { font-size: 15.5px; white-space: pre-wrap; word-break: break-word; min-height: 120px; }
.post-actions { margin-top: 32px; display: flex; gap: 8px; justify-content: flex-end; }

/* Forms */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.form-narrow { max-width: 420px; margin: 40px auto; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; }

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14.5px;
  font-family: inherit;
  background: #fff;
}

.field textarea { min-height: 320px; resize: vertical; line-height: 1.6; }
.field select { background: #fff; }

.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }

.form-foot { text-align: center; margin-top: 16px; font-size: 13.5px; color: var(--muted); }

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  margin-bottom: 18px;
}

.alert-success { background: #eaf6ee; color: #1e7a3d; border: 1px solid #cdeeda; }
.alert-error { background: #fdecea; color: var(--danger); border: 1px solid #f6cfc9; }

.error-list { margin: 0 0 16px; padding-left: 18px; color: var(--danger); font-size: 13px; }

footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 26px 0;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

@media (max-width: 560px) {
  .page-head { flex-direction: column; align-items: flex-start; }
  .card { padding: 20px; }
}
