/* ===========================================================
   우리들의 커뮤니티 - 공통 스타일 (round & warm 리디자인)
   =========================================================== */

:root {
  --blue-600: #3b7cff;
  --blue-700: #2c63e0;
  --blue-500: #5c93ff;
  --blue-100: #e8f0ff;
  --blue-50: #f2f6ff;
  --accent: #ff9f6b;
  --text-900: #1c2333;
  --text-700: #454c5e;
  --text-500: #767d8c;
  --text-400: #a3a9b7;
  --border: #ebeef4;
  --bg: #f4f6fc;
  --white: #ffffff;
  --red: #ff5a6e;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;
  --shadow: 0 10px 28px rgba(43, 78, 173, 0.08);
  --shadow-sm: 0 4px 14px rgba(43, 78, 173, 0.07);
  --shadow-lift: 0 14px 32px rgba(43, 78, 173, 0.14);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-900);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }

.icon { width: 20px; height: 20px; display: inline-block; vertical-align: middle; }

/* ---------- Header ---------- */
.site-header {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 40px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 800;
  color: var(--text-900);
  white-space: nowrap;
  letter-spacing: -0.2px;
}
.logo .logo-badge {
  width: 38px;
  height: 38px;
  border-radius: 13px;
  background: linear-gradient(140deg, #6ea2ff, var(--blue-600) 60%, #2b5be0);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(59, 124, 255, 0.35);
}
.main-nav {
  display: flex;
  gap: 6px;
  flex: 1;
}
.main-nav a {
  position: relative;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  color: var(--text-500);
  font-size: 15px;
  transition: background .18s ease, color .18s ease;
}
.main-nav a:hover { background: var(--bg); color: var(--text-700); }
.main-nav a.active { color: var(--blue-600); background: var(--blue-50); }
.header-actions { display: flex; align-items: center; gap: 14px; }
.icon-btn {
  border: none; background: none; padding: 9px; color: var(--text-500);
  display: flex; align-items: center; border-radius: var(--radius-pill);
  transition: background .18s ease, color .18s ease;
}
.icon-btn:hover { background: var(--blue-50); color: var(--blue-600); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--radius-pill); border: 1px solid transparent; font-weight: 700; cursor: pointer;
  padding: 11px 20px; font-size: 14px; white-space: nowrap;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
}
.btn-primary {
  background: linear-gradient(135deg, #63a0ff, var(--blue-600));
  color: #fff; box-shadow: 0 8px 18px rgba(59, 124, 255, 0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(59, 124, 255, 0.4); }
.btn-outline { background: #fff; border-color: var(--border); color: var(--text-700); }
.btn-outline:hover { border-color: var(--blue-500); color: var(--blue-600); background: var(--blue-50); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.user-chip {
  display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px;
}
.user-chip .avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(140deg, var(--blue-500), var(--blue-600));
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700;
}

/* ---------- Banner ---------- */
.banner {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #cfe4ff 0%, #a9cdfb 38%, #8ec0f5 72%, #7fb8f2 100%);
  color: #10233f;
  padding: 0;
  margin: 0 0 8px;
}
.banner-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 68px 32px 0;
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 24px;
  min-height: 340px;
}
.banner-text { position: relative; z-index: 3; padding-bottom: 56px; }
.banner h1 {
  font-size: 36px; line-height: 1.35; margin: 0 0 14px; font-weight: 800; letter-spacing: -0.5px;
  text-shadow: 0 2px 18px rgba(255,255,255,.35);
}
.banner p { margin: 0; font-size: 16px; color: #1a3253; opacity: .82; font-weight: 500; }
.banner-art {
  position: absolute; right: 0; bottom: 0; left: 0; top: 0;
  z-index: 1; pointer-events: none;
}
.banner-art svg { position: absolute; right: 0; bottom: 0; height: 100%; width: auto; max-width: 62%; }
.banner-leaf-tl, .banner-leaf-tr {
  position: absolute; top: -6px; z-index: 4; opacity: .95;
}
.banner-leaf-tl { left: 18px; }
.banner-leaf-tr { right: 18px; transform: scaleX(-1); }

/* ---------- Layout ---------- */
.page-body { max-width: 1280px; margin: 0 auto; padding: 32px; display: flex; gap: 24px; align-items: flex-start; }
.sidebar { width: 240px; flex-shrink: 0; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 24px; }
.side-col { width: 320px; flex-shrink: 0; display: flex; flex-direction: column; gap: 20px; }

/* ---------- Sidebar nav ---------- */
.nav-card {
  background: var(--white); border-radius: var(--radius);
  padding: 12px; box-shadow: var(--shadow-sm);
}
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm);
  font-weight: 700; color: var(--text-700); margin-bottom: 2px;
  transition: background .16s ease, color .16s ease;
}
.nav-item .icon { color: var(--text-400); transition: color .16s ease; }
.nav-item:hover { background: var(--bg); }
.nav-item.active { background: linear-gradient(135deg, var(--blue-50), #eef4ff); color: var(--blue-600); }
.nav-item.active .icon { color: var(--blue-600); }
.nav-group-title {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; font-weight: 700; color: var(--text-700);
  margin-top: 6px;
}
.nav-group-title .icon { color: var(--text-400); }
.nav-sub { padding-left: 46px; display: flex; flex-direction: column; }
.nav-sub a { padding: 9px 0; color: var(--text-500); font-weight: 600; font-size: 14px; transition: color .16s ease; }
.nav-sub a:hover, .nav-sub a.active { color: var(--blue-600); }

/* ---------- Card / table ---------- */
.card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.card-head h2 { font-size: 17px; margin: 0; display: flex; align-items: center; gap: 9px; font-weight: 800; }
.card-head .more {
  font-size: 13px; color: var(--text-500); font-weight: 700; display: flex; align-items: center; gap: 2px;
  padding: 6px 12px; border-radius: var(--radius-pill); transition: background .16s ease, color .16s ease;
}
.card-head .more:hover { color: var(--blue-600); background: var(--blue-50); }
.card-body { padding: 4px 0; }

table.list { width: 100%; border-collapse: collapse; }
table.list th {
  text-align: left; font-size: 12.5px; color: var(--text-400); font-weight: 700;
  padding: 12px 24px; border-bottom: 1px solid var(--border);
}
table.list td { padding: 15px 24px; font-size: 14px; border-bottom: 1px solid #f2f3f8; color: var(--text-700); }
table.list tr:last-child td { border-bottom: none; }
table.list tr.row-link { transition: background .14s ease; }
table.list tr.row-link:hover { background: var(--blue-50); cursor: pointer; }
table.list tr.row-link:hover td:first-child { box-shadow: inset 3px 0 0 var(--blue-600); }
table.list td.num, table.list th.num { color: var(--text-400); width: 56px; }
table.list td.views, table.list th.views { text-align: right; width: 80px; color: var(--text-500); }
table.list td.date, table.list th.date { width: 110px; color: var(--text-500); }
table.list td.author, table.list th.author { width: 110px; }
table.list td.title { font-weight: 700; color: var(--text-900); }
.badge-new {
  display: inline-flex; align-items: center; gap: 3px;
  background: linear-gradient(135deg, #ff8a65, var(--red)); color: #fff; font-size: 10px; font-weight: 800;
  padding: 3px 8px; border-radius: var(--radius-pill); margin-left: 6px; vertical-align: middle;
  box-shadow: 0 3px 8px rgba(255, 90, 110, 0.35);
}
.empty-row td { text-align: center; color: var(--text-400); padding: 48px 0; }

/* ---------- Login box ---------- */
.login-box { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.login-box h2 { font-size: 16px; margin: 0 0 16px; font-weight: 800; }
.field { position: relative; margin-bottom: 10px; }
.field .field-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-400);
}
.field input {
  width: 100%; padding: 12px 14px 12px 40px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 14px;
  background: #fbfcff; transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.field input:focus { outline: none; border-color: var(--blue-500); background: #fff; box-shadow: 0 0 0 4px var(--blue-50); }
.login-box .btn-primary { margin-top: 4px; }
.login-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; font-size: 13px; color: var(--text-500); }
.login-meta label { display: flex; align-items: center; gap: 6px; }
.login-meta a { font-weight: 700; color: var(--text-700); }
.login-meta a:hover { color: var(--blue-600); }

.avatar-lg {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(140deg, var(--blue-500), var(--blue-600)); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700;
}

.promo-box {
  background: linear-gradient(150deg, #eef4ff, #f7faff); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 22px; display: flex; gap: 14px; align-items: flex-start;
}
.promo-box p { margin: 0 0 8px; font-size: 13.5px; color: var(--text-700); line-height: 1.55; font-weight: 500; }
.promo-box a { color: var(--blue-600); font-weight: 800; font-size: 13.5px; }

.recent-list { display: flex; flex-direction: column; }
.recent-item {
  display: flex; justify-content: space-between; gap: 10px; padding: 13px 24px; border-bottom: 1px solid #f2f3f8;
  font-size: 13.5px; transition: background .14s ease;
}
.recent-item:hover { background: var(--blue-50); }
.recent-item:last-child { border-bottom: none; }
.recent-item .t { color: var(--text-700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.recent-item .tm { color: var(--text-400); flex-shrink: 0; }
.recent-item:hover .t { color: var(--blue-600); }

/* ---------- User chip / logged-in card ---------- */
.user-card { background: linear-gradient(160deg, #ffffff, #f5f8ff); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; text-align: center; }
.user-card .avatar-lg { margin: 0 auto 12px; width: 56px; height: 56px; font-size: 19px; flex-shrink: 0; box-shadow: 0 8px 18px rgba(59,124,255,.3); }
.user-card .name { font-weight: 800; font-size: 15px; margin-bottom: 2px; }
.user-card .email { color: var(--text-500); font-size: 13px; margin-bottom: 16px; }

/* ---------- Buttons row / pagination-ish ---------- */
.section-toolbar { display: flex; justify-content: flex-end; padding: 16px 24px 0; }

/* ---------- Forms (write/login/register pages) ---------- */
.form-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 32px; max-width: 640px; margin: 0 auto; }
.form-card h1 { font-size: 20px; margin: 0 0 22px; font-weight: 800; }
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-size: 13.5px; font-weight: 700; color: var(--text-700); margin-bottom: 7px; }
.form-row input[type=text], .form-row input[type=password], .form-row textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); font-size: 14px;
  background: #fbfcff; transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.form-row textarea { min-height: 220px; resize: vertical; line-height: 1.6; }
.form-row input:focus, .form-row textarea:focus { outline: none; border-color: var(--blue-500); background: #fff; box-shadow: 0 0 0 4px var(--blue-50); }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }
.hint { font-size: 12.5px; color: var(--text-400); margin-top: 6px; }
.error-text { font-size: 13px; color: var(--red); margin-top: 8px; display: none; font-weight: 600; }
.error-text.show { display: block; }

/* ---------- Post detail ---------- */
.post-detail { padding: 8px 0; }
.post-detail .p-head { padding: 22px 28px; border-bottom: 1px solid var(--border); }
.post-detail .p-head h1 { font-size: 22px; margin: 0 0 12px; font-weight: 800; }
.p-meta { display: flex; gap: 16px; font-size: 13px; color: var(--text-500); font-weight: 600; }
.post-detail .p-body { padding: 28px; min-height: 160px; white-space: pre-wrap; line-height: 1.85; color: var(--text-700); }
.post-detail .p-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 0 28px 24px; }

.comments-card { padding: 4px 0 20px; }
.comments-card .card-head h2 { font-size: 15px; }
.comment-form { display: flex; gap: 10px; padding: 18px 24px; border-bottom: 1px solid var(--border); }
.comment-form textarea { flex: 1; min-height: 56px; padding: 11px 14px; border: 1.5px solid var(--border); border-radius: var(--radius-sm); resize: vertical; font-size: 13.5px; background: #fbfcff; }
.comment-form textarea:focus { outline: none; border-color: var(--blue-500); box-shadow: 0 0 0 4px var(--blue-50); background: #fff; }
.comment-item { padding: 15px 24px; border-bottom: 1px solid #f2f3f8; }
.comment-item:last-child { border-bottom: none; }
.comment-item .c-top { display: flex; gap: 10px; align-items: baseline; margin-bottom: 4px; }
.comment-item .c-author { font-weight: 800; font-size: 13.5px; }
.comment-item .c-date { font-size: 12px; color: var(--text-400); }
.comment-item .c-body { font-size: 14px; color: var(--text-700); white-space: pre-wrap; }
.comment-empty { padding: 34px 24px; text-align: center; color: var(--text-400); font-size: 13.5px; }

/* ---------- Toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%) translateY(20px);
  background: var(--text-900); color: #fff; padding: 13px 22px; border-radius: var(--radius-pill); font-size: 13.5px;
  font-weight: 600;
  opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 999; box-shadow: 0 10px 24px rgba(0,0,0,.22);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.loading-row { text-align: center; color: var(--text-400); padding: 34px 0; font-size: 13.5px; }

@media (max-width: 980px) {
  .page-body { flex-direction: column; }
  .sidebar, .side-col { width: 100%; }
  .main-nav { display: none; }
  .banner-art svg { max-width: 46%; opacity: .8; }
}
