* { box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Malgun Gothic", sans-serif; max-width: 1080px; margin: 32px auto; padding: 0 20px; color: #222; line-height: 1.6; background: #fff; word-break: keep-all; overflow-wrap: anywhere; }
h1 { font-size: 1.5rem; margin: 0 0 4px; }
h2 { font-size: 1.05rem; margin: 0; }
a { color: #1a5fb4; text-decoration: none; }
a:hover { text-decoration: underline; }
.home { display: inline-block; margin-bottom: 20px; color: #666; font-size: 0.9rem; }
.sub { color: #666; margin: 0 0 20px; }
.muted { color: #999; font-size: 0.85rem; }

button, .btn { font: inherit; cursor: pointer; border-radius: 8px; padding: 7px 16px; border: 1px solid #1a5fb4; background: #1a5fb4; color: #fff; display: inline-block; text-decoration: none; font-size: 0.92rem; }
button.ghost, .btn.ghost { background: #fff; color: #1a5fb4; }
button.danger { background: #fff; color: #c62828; border-color: #c62828; }
button.link { background: none; border: none; color: #1a5fb4; padding: 0; font-size: inherit; }
button:disabled { opacity: .5; cursor: default; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }

input[type=text], textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #ccc; border-radius: 8px; }
textarea { min-height: 260px; resize: vertical; }
label { display: block; font-size: 0.85rem; color: #555; margin: 14px 0 4px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.spacer { flex: 1; }

/* 제목 목록 */
.list { list-style: none; padding: 0; margin: 0; }
.list li { border-bottom: 1px solid #eee; }
.list li a { display: flex; gap: 12px; justify-content: space-between; padding: 10px 2px; color: #222; }
.list li a:hover { background: #f6f8fc; text-decoration: none; }
.list .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .m { flex: none; color: #999; font-size: 0.8rem; }
.empty { color: #999; padding: 18px 2px; font-size: 0.9rem; }

/* 글 보기 */
.post-title { font-size: 1.35rem; margin: 0 0 6px; }
.post-meta { color: #999; font-size: 0.85rem; margin-bottom: 18px; }
.post-body { white-space: pre-wrap; border-top: 1px solid #eee; padding-top: 18px; min-height: 120px; }
.box { border: 1px solid #e3e6ec; border-radius: 12px; padding: 16px; }

.comments { margin-top: 32px; }
.comment { border-top: 1px solid #eee; padding: 10px 0; }
.comment .who { font-weight: 600; font-size: 0.85rem; color: #1a5fb4; }
.comment .body { white-space: pre-wrap; }

.adminbar { margin-top: 40px; color: #999; font-size: 0.85rem; text-align: right; }
#toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: #222; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 0.9rem; opacity: 0; pointer-events: none; transition: .25s; }
#toast.show { opacity: 1; transform: translateX(-50%); }
.hidden { display: none !important; }

/* 넓은 화면: 페이지 전체가 정확히 한 화면, 남는 높이를 목록·본문이 씀 */
@media (min-width: 761px) {
  html { overflow: hidden; }
  body { height: 100vh; height: 100dvh; margin: 0 auto; padding: 20px 20px 10px; display: flex; flex-direction: column; overflow: hidden; }
  .home { margin-bottom: 10px; flex: none; }
  .sub { margin-bottom: 14px; }
  .adminbar { margin-top: 10px; flex: none; }
  .fill { flex: 1; min-height: 0; }
  #view:not(.hidden), #edit:not(.hidden) { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  #view .post-body { flex: 1; min-height: 60px; overflow-y: auto; }
  #view .comments { flex: none; max-height: 40%; overflow-y: auto; margin-top: 16px; }
  #edit textarea { flex: 1; min-height: 80px; }
  #edit label { margin-top: 8px; }
}
