body {
  font-family: 'Pretendard', 'Malgun Gothic', sans-serif;
  background: #f0f2f5;
  margin: 0;
  padding: 40px 16px;
  color: #222;
}
.view { max-width: 600px; margin: 0 auto; }

h1 { color: #2563eb; font-size: 36px; margin-bottom: 8px; }
h2 { color: #2563eb; font-size: 30px; margin: 12px 0; }
p, .body { font-size: 18px; line-height: 1.7; color: #555; }
.body {
  background: white;
  padding: 20px;
  border-radius: 12px;
  min-height: 160px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

ul { padding: 0; list-style: none; }
li {
  background: white;
  padding: 14px 18px;
  margin-bottom: 10px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: 0.2s;
}
li::after { content: '→'; float: right; color: #93c5fd; }
li:hover { transform: translateX(4px); }

/* 수정 모드일 때 */
body.edit li { cursor: text; }
body.edit li::after { content: ''; }
body.edit li:hover { transform: none; }
body.edit [data-key]:hover { outline: 2px dashed #93c5fd; }
body.edit [data-key]:focus { outline: 2px solid #2563eb; background: #eff6ff; }

.nav { display: flex; justify-content: space-between; margin-top: 20px; }
.nav a, .back { color: #2563eb; text-decoration: none; font-size: 16px; }
.nav a:hover, .back:hover { text-decoration: underline; }

button {
  margin: 20px 8px 0 0;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  background: #2563eb;
  color: white;
  font-size: 15px;
  cursor: pointer;
  transition: 0.2s;
}
button:hover { background: #1d4ed8; }
#reset { background: #9ca3af; }
#status { color: #16a34a; font-size: 14px; }
h3 { margin-top: 32px; font-size: 20px; color: #333; }

li .t { display: inline-block; min-width: 40px; }

/* 삭제 / 추가 버튼은 수정 모드에서만 보이기 */
.del {
  display: none;
  float: right;
  margin: 0 0 0 8px;
  padding: 2px 10px;
  background: #ef4444;
  font-size: 13px;
}
.del:hover { background: #dc2626; }
#addSub { display: none; margin-top: 0; }
body.edit .del { display: inline-block; }
body.edit #addSub { display: inline-block; }

/* 수정 모드에서 항목 이름 / 페이지 제목 표시 */
body.edit li .t:hover,
body.edit #title:hover { outline: 2px dashed #93c5fd; }
body.edit li .t:focus,
body.edit #title:focus { outline: 2px solid #2563eb; background: #eff6ff; }

/* 도구 막대 (수정 모드에서만 보임) */
#toolbar { display: none; margin: 16px 0 8px; }
body.edit #toolbar { display: block; }
#toolbar button { margin: 0 8px 8px 0; background: #e0e7ff; color: #1e3a8a; }
#toolbar button:hover { background: #c7d2fe; }

#emojiPanel {
  background: white;
  padding: 10px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-bottom: 8px;
}
#emojiPanel button {
  background: none;
  font-size: 24px;
  padding: 4px 6px;
  margin: 2px;
}
#emojiPanel button:hover { background: #eff6ff; }

/* 본문 이미지 */
.body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 8px 0;
}
body.edit .body img { cursor: pointer; }

/* 방문자에게는 수정 관련 버튼 숨기기 */
body.visitor #toggle,
body.visitor #reset,
body.visitor #status { display: none; }

/* 하단 연락처 */
.contact {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #d1d5db;
}
.contact h3 { margin-top: 0; }
.contact div { font-size: 16px; line-height: 1.8; color: #555; }

/* 제목 줄: 제목은 왼쪽, 방문자 수는 오른쪽 끝 */
.title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.title-row h1 { margin: 0; }

#visitCounter {
  font-size: 15px;
  color: #6b7280;
  background: #f3f4f6;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

/* 언어 선택 화면 */
#langScreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(17, 24, 39, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lang-card {
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px;
  text-align: center;
  min-width: 260px;
  max-width: 90vw;
}
.lang-globe { font-size: 48px; }
.lang-card h2 { margin: 8px 0 20px; font-size: 20px; color: #111827; }
.lang-card button {
  display: block;
  width: 100%;
  margin: 10px 0 0;
  padding: 14px;
  font-size: 18px;
  border: 0;
  border-radius: 10px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
}
.lang-card button:hover { background: #1d4ed8; }

/* 오른쪽 아래 언어 변경 버튼 */
#langBtn {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 100;
  padding: 8px 14px;
  font-size: 14px;
  color: #374151;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}
#langBtn:hover { background: #f3f4f6; }

/* 한국어 내용 복사 버튼 (관리자, 한국어 외 언어) */
#copyKo {
  padding: 8px 14px;
  font-size: 14px;
  color: #fff;
  background: #7c3aed;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
#copyKo:hover { background: #6d28d9; }

/* 모바일 보정 */
body {
  overflow-wrap: anywhere;      /* 긴 글자가 화면 밖으로 넘치지 않게 */
  padding-bottom: 70px;         /* 오른쪽 아래 🌐 버튼이 글을 가리지 않게 */
}
html[lang="ko"] body { word-break: keep-all; }  /* 한국어만 단어 단위로 줄바꿈 */
img { max-width: 100%; height: auto; }          /* 본문 이미지가 화면보다 크지 않게 */

@media (max-width: 600px) {
  h1 { font-size: 1.6rem; }
  ul li { padding: 14px 12px; }                 /* 손가락으로 누르기 편하게 */
  button { min-height: 44px; }
  .title-row { flex-wrap: wrap; }               /* 방문자 수가 제목 아래로 내려가게 */
  #langBtn { right: 10px; bottom: 10px; }
  .lang-card { padding: 24px 20px; }
}
