:root {
  --bg: #EAF4EE;
  --bg-soft: #F6FBF7;
  --ink: #274235;
  --ink-soft: #5C7566;
  --pink: #FF8FA3;
  --yellow: #FFD76B;
  --blue: #7FC6E0;
  --purple: #C4A6E0;
  --white: #FFFFFF;
  --shadow: 0 10px 24px rgba(39, 66, 53, 0.12);
  --font-title: 'Paperlogy', sans-serif;
  --font-body: 'Nunito', sans-serif;
  --font-name: 'Baloo 2', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg) radial-gradient(circle at 20px 20px, rgba(39,66,53,0.05) 2px, transparent 2px);
  background-size: 28px 28px;
  color: var(--ink);
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }

/* 상단 네비게이션 */
.topnav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 32px;
  background: var(--bg-soft);
  box-shadow: 0 2px 10px rgba(39,66,53,0.06);
}
.topnav .brand { font-family: var(--font-title); font-weight: 800; font-size: 1.3rem; }
.nav-links { display: flex; align-items: center; gap: 18px; font-weight: 700; font-family: var(--font-title); }
.nav-user { color: var(--ink-soft); }
.nav-current { text-decoration: underline; text-underline-offset: 4px; }
.nav-cta { background: var(--pink); color: var(--white) !important; padding: 8px 18px; border-radius: 999px; }

.wrap { max-width: 100%; margin: 0 auto; padding: 48px 24px 100px; }

/* 게시판 헤더 */
.board-header { text-align: center; margin-bottom: 36px; }
.board-header h1 { font-family: var(--font-title); font-weight: 800; font-size: clamp(2.2rem, 6vw, 3.6rem); margin: 0; }
.board-header h1 span { display: inline-block; transform: rotate(-4deg); }
.subtitle { font-size: 1.1rem; color: var(--ink-soft); margin-top: 10px; font-weight: 600; }

/* 글쓰기 버튼 / 폼 */
.add-btn {
  display: block;
  width: fit-content;
  margin: 0 auto;
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--white);
  background: var(--pink);
  border: none;
  border-radius: 999px;
  padding: 16px 40px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
  list-style: none;
}
.add-btn::-webkit-details-marker { display: none; }
.add-btn:hover { transform: translateY(-3px) scale(1.03); }
.add-btn-link { text-align: center; }
.add-btn-small { display: inline-block; margin: 14px auto 0; padding: 10px 24px; font-size: 1rem; }

.write-box { margin-bottom: 8px; }
.already-posted {
  max-width: 480px;
  margin: 0 auto 8px;
  text-align: center;
  background: var(--bg-soft);
  border: 2px dashed #DCEBE0;
  border-radius: 20px;
  padding: 20px;
  color: var(--ink-soft);
  font-weight: 700;
}
.write-form {
  max-width: 560px;
  margin: 24px auto 0;
  background: var(--bg-soft);
  border-radius: 20px;
  padding: 24px;
  box-shadow: var(--shadow);
}
.write-form textarea {
  width: 100%;
  min-height: 110px;
  font-family: var(--font-body);
  font-size: 1.1rem;
  border: 2px solid #DCEBE0;
  border-radius: 14px;
  padding: 14px 16px;
  resize: vertical;
  margin-bottom: 16px;
}
.write-form textarea:focus { outline: none; border-color: var(--pink); }

.btn-submit {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  border-radius: 14px;
  padding: 14px 20px;
  background: var(--pink);
  color: var(--white);
  cursor: pointer;
  width: 100%;
}
.btn-submit.full { margin-top: 8px; }

/* 게시판 그리드 (마소너리) */
.board { margin-top: 48px; column-width: 320px; column-gap: 32px; }
.card-wrap { position: relative; padding-top: 14px; break-inside: avoid; margin-bottom: 32px; width: 100%; }
.empty { grid-column: 1 / -1; text-align: center; padding: 60px 20px; color: var(--ink-soft); font-size: 1.25rem; font-weight: 600; }

.card {
  background: var(--white);
  border-radius: 20px;
  padding: 28px 24px 22px;
  box-shadow: var(--shadow);
  position: relative;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

.tape { position: absolute; top: 0; left: 50%; transform: translateX(-50%) rotate(-3deg); width: 90px; height: 26px; border-radius: 4px; opacity: 0.9; z-index: 2; }
.tape-pink { background: var(--pink); }
.tape-yellow { background: var(--yellow); }
.tape-blue { background: var(--blue); }
.tape-purple { background: var(--purple); }

.card-owner-actions { position: absolute; top: 10px; right: 12px; display: flex; gap: 6px; }
.card-owner-actions a, .card-owner-actions button { border: none; background: transparent; font-size: 1rem; opacity: 0.4; cursor: pointer; padding: 2px 4px; }
.card-owner-actions a:hover, .card-owner-actions button:hover { opacity: 0.9; }
.card-owner-actions form { display: inline; }

.card .msg { font-size: 1.2rem; font-weight: 600; line-height: 1.5; flex: 1; word-break: break-word; }
.card .from { margin-top: 18px; font-family: var(--font-name); font-size: 1rem; font-weight: 700; text-align: right; color: var(--ink-soft); }
.card .from::before { content: "from. "; font-weight: 400; }
.card .time { display: block; font-family: var(--font-body); font-weight: 600; font-size: 0.8rem; opacity: 0.7; }

.provider-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 50%;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.7rem;
  margin-right: 4px;
  vertical-align: middle;
}
.provider-google { background: var(--white); color: #4285F4; border: 1.5px solid #E3E3E3; }
.provider-kakao { background: #FEE500; color: #3C1E1E; }
.provider-facebook, .social-facebook { background: #1877F2; color: var(--white); }

/* 페이지네이션 */
.pagination { display: flex; justify-content: center; align-items: center; gap: 20px; margin-top: 48px; font-weight: 700; }
.pagination a { background: var(--white); padding: 10px 18px; border-radius: 999px; box-shadow: var(--shadow); }
.page-info { color: var(--ink-soft); }

/* 로그인 / 수정 카드 */
.auth-card { max-width: 420px; margin: 20px auto; background: var(--bg-soft); border-radius: 24px; padding: 36px 32px; box-shadow: var(--shadow); }
.auth-card h1 { font-family: var(--font-title); font-size: 1.7rem; margin: 0 0 8px; text-align: center; }
.auth-desc { text-align: center; color: var(--ink-soft); font-weight: 600; margin-bottom: 24px; }
.auth-card label { display: block; font-weight: 700; margin-bottom: 8px; color: var(--ink-soft); }
.auth-card input, .auth-card textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1.05rem;
  border: 2px solid #DCEBE0;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 18px;
  background: var(--white);
  color: var(--ink);
}
.auth-card textarea { min-height: 120px; resize: vertical; }
.auth-card input:focus, .auth-card textarea:focus { outline: none; border-color: var(--pink); }
.auth-switch { text-align: center; margin-top: 18px; font-weight: 600; color: var(--ink-soft); }
.auth-switch a { color: var(--pink); font-weight: 800; }

.alert-error { background: #FDE8EA; border: 2px solid #F7B9C0; color: #99303F; border-radius: 14px; padding: 12px 16px; margin-bottom: 18px; font-weight: 700; }
.alert-error ul { margin: 0; padding-left: 20px; }

/* 소셜 로그인 버튼 */
.social-buttons { display: flex; flex-direction: column; gap: 14px; margin-top: 10px; }
.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-name);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 14px;
  border-radius: 14px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
}
.social-btn:hover { transform: translateY(-2px); }
.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.95rem;
}
.social-google { background: var(--white); color: #3C4043; border: 2px solid #E3E3E3; }
.social-google .social-icon, .provider-google { background: var(--white); color: #4285F4; border: 1.5px solid #E3E3E3; }
.social-kakao { background: #FEE500; color: #3C1E1E; }
.social-kakao .social-icon { background: #3C1E1E; color: #FEE500; }
.social-facebook .social-icon { background: var(--white); color: #1877F2; }

/* 관리자 페이지 */
.admin-search { display: flex; gap: 10px; max-width: 560px; margin: 0 auto 32px; align-items: center; }
.admin-search input {
  flex: 1;
  font-family: var(--font-body);
  font-size: 1rem;
  border: 2px solid #DCEBE0;
  border-radius: 14px;
  padding: 12px 16px;
  background: var(--white);
}
.admin-search input:focus { outline: none; border-color: var(--pink); }
.admin-search .btn-submit { width: auto; padding: 12px 22px; }
.admin-clear { color: var(--ink-soft); font-weight: 700; white-space: nowrap; }

.admin-list { display: flex; flex-direction: column; gap: 14px; }
.admin-row { background: var(--white); border-radius: 16px; padding: 18px 20px; box-shadow: var(--shadow); display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.admin-row-main { flex: 1; min-width: 0; }
.admin-row-content { font-weight: 600; line-height: 1.5; word-break: break-word; margin-bottom: 8px; }
.admin-row-meta { font-size: 0.85rem; color: var(--ink-soft); font-weight: 600; }
.admin-email { font-weight: 400; }
.admin-row-delete button { border: none; background: #FDE8EA; color: #99303F; font-weight: 700; padding: 8px 16px; border-radius: 10px; cursor: pointer; white-space: nowrap; }
.admin-row-delete button:hover { background: #F7B9C0; }

@media (max-width: 480px) {
  .topnav { padding: 14px 18px; }
  .wrap { padding: 32px 16px 80px; }
  .admin-row { flex-direction: column; }
}