:root {
  --bg-white: #ffffff;
  --bg-gray: #fafafa;
  --dark-text: #2d2d3a;

  --pastel-green: #d4f4a7;
  --pastel-green-strong: #b8e986;
  --pastel-green-soft: #f0fce0;
  --pastel-mint: #c8f0d4;
  --pastel-yellow: #f5f4b3;

  --top-bg: linear-gradient(180deg, #f0fce0 0%, #f7ffe9 55%, #ffffff 100%);
  --content-bg: #fafafa;

  --header-h: 64px;

  --surface: #ffffff;
  --text: var(--dark-text);
  --muted: rgba(45, 45, 58, 0.58);

  --line: rgba(45, 45, 58, 0.08);
  --line-strong: rgba(45, 45, 58, 0.12);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow: 0 8px 20px rgba(0, 0, 0, 0.08);

  --radius: 16px;
  --radius-sm: 12px;

  --focus: 0 0 0 4px rgba(212, 244, 167, 0.45);
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, "Noto Sans KR", Arial, sans-serif;
  color: var(--text);
  background: var(--top-bg);
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 16px;
}

.page {
  padding: calc(var(--header-h) + 18px) 0 44px;
  background: var(--content-bg);
  border-top: 1px solid rgba(45, 45, 58, 0.05);
  min-height: 100vh;
}

/* Header fixed */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;

  height: var(--header-h);
  display: flex;
  align-items: center;

  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.06);
}

.header-inner {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--pastel-green-soft) 0%, var(--pastel-green) 100%);
  border: 1px solid rgba(212, 244, 167, 0.55);
  color: var(--dark-text);
  font-weight: 900;
  font-size: 12px;
}

.brand-title {
  font-weight: 900;
  color: var(--dark-text);
  letter-spacing: -0.2px;
}

/* User area */
.header-right {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  justify-content: flex-end;
}

.user-links {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: rgba(45, 45, 58, 0.72);
}

.user-link {
  color: rgba(45, 45, 58, 0.72);
  transition: color 0.2s ease;
}

.user-link:hover {
  color: var(--pastel-green-strong);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.user-link.as-button {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: inherit;
}

.user-nickname {
  color: var(--dark-text);
  font-weight: 700;
}

.avatar {
  display: inline-block;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--pastel-green-soft) 0%, var(--pastel-mint) 100%);
  border: 1px solid rgba(212, 244, 167, 0.40);
}

.avatar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  border-radius: 999px;
}

.avatar-btn:disabled {
  cursor: default;
  pointer-events: none;
}

.avatar-btn--disabled {
  cursor: default;
}

/* Dropdown menu */
.user-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 190px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.10);
  padding: 10px;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: all 0.18s ease;
  font-size: 12px;
}

.user-menu.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.user-menu-head {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}

.user-menu-nick {
  font-weight: 800;
  color: var(--dark-text);
  font-size: 12px;
}

.user-menu-item {
  width: 100%;
  height: 32px;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  padding: 0 10px;
  color: rgba(45, 45, 58, 0.86);
  font-weight: 600;
  font-size: 12px;
  line-height: 1;
  transition: all 0.15s ease;
}

.user-menu-item:hover {
  background: rgba(212, 244, 167, 0.22);
  border-color: rgba(212, 244, 167, 0.40);
}

/* Card common */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 16px;
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.10);
  transform: translateY(-2px);
  border-color: rgba(212, 244, 167, 0.35);
}

.card-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.card-avatar {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--pastel-green-soft) 0%, var(--pastel-yellow) 100%);
  border: 1px solid rgba(212, 244, 167, 0.40);
}

.card-title {
  font-weight: 800;
  font-size: 16px;
  margin: 0;
  color: var(--dark-text);
}

.card-sub {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.card-body {
  margin-top: 10px;
  color: rgba(45, 45, 58, 0.76);
  font-size: 13px;
  line-height: 1.6;
}

.tags {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  border: 1px solid rgba(212, 244, 167, 0.40);
  background: rgba(212, 244, 167, 0.18);
  color: rgba(45, 45, 58, 0.82);
  font-size: 12px;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tag:hover {
  background: rgba(212, 244, 167, 0.35);
  border-color: rgba(184, 233, 134, 0.55);
  transform: translateY(-1px);
}

.card-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.card-cta h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--dark-text);
}

.card-cta p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.cta-btn {
  height: 38px;
  padding: 0 18px;
  border: 1px solid rgba(45, 45, 58, 0.18);
  border-radius: 12px;
  background: var(--dark-text);
  color: white;
  cursor: pointer;
  font-weight: 800;
  transition: all 0.2s ease;
}

.cta-btn:hover {
  background: rgba(45, 45, 58, 0.90);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(45, 45, 58, 0.20);
}

.empty {
  margin-top: 18px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* Pagination common */
.pagination {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.page-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  border-radius: 10px;
  font-size: 12px;
  color: rgba(45, 45, 58, 0.78);
  transition: all 0.2s ease;
}

.page-btn:hover {
  border-color: var(--pastel-green);
  background: rgba(212, 244, 167, 0.20);
}

.page-btn.active {
  background: var(--pastel-green-strong);
  color: var(--dark-text);
  border-color: var(--pastel-green-strong);
  font-weight: 600;
}

.page-btn.arrow { width: 36px; }

/* Focus */
:where(button, a, input, textarea):focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 12px;
}

/* Responsive */
@media (max-width: 980px) {
  .header-right { min-width: auto; }
}

/* 좁아지면 브랜드 중앙, 우측 텍스트 숨김, 메뉴는 아바타로만 */
@media (max-width: 720px) {
  .header-inner {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
  }

  .header-left {
    grid-column: 2;
    justify-content: center;
  }

  .header-right {
    grid-column: 3;
    justify-content: flex-end;
  }

  .user-links {
    display: none;
  }
}

@media (min-width: 721px) {
  .user-menu {
    display: none;
  }
}
