/* ============================================================
   보육교직원을 위한 생성형 AI — 자료집
   파스텔 디자인 시스템
   ============================================================ */

:root {
  /* 표지에서 가져온 색 */
  --cream: #fdf8f0;
  --cream-deep: #f7eede;
  --paper: #ffffff;

  --navy: #2b3a7a;
  --navy-soft: #4a5a9e;
  --purple: #9b8ae6;
  --purple-deep: #7c6ad0;
  --purple-pale: #ece7fb;
  --blue: #4a90e2;
  --blue-deep: #3273c4;
  --blue-pale: #e3f0fd;

  --peach: #ffd9b0;
  --pink: #ffc9d9;
  --mint: #b8e6d5;
  --yellow: #ffe9a8;
  --lavender: #ded6f8;
  --sky: #cbe6fb;

  --ink: #33324a;
  --ink-soft: #6a6884;
  --ink-faint: #9c9ab2;
  --line: #ece6dc;

  --ok: #34a97b;
  --warn: #e08b3e;
  --danger: #e2657a;

  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --radius-pill: 999px;

  --shadow-sm: 0 2px 8px rgba(80, 70, 120, 0.06);
  --shadow: 0 8px 24px rgba(80, 70, 120, 0.10);
  --shadow-lg: 0 18px 44px rgba(80, 70, 120, 0.16);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  --font: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo',
    'Malgun Gothic', 'Segoe UI', system-ui, sans-serif;
  --mono: 'SFMono-Regular', 'D2Coding', Consolas, 'Courier New', monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 배경에 떠다니는 파스텔 방울들 */
.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  pointer-events: none;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(46px);
  opacity: 0.5;
  animation: float-blob 22s var(--ease) infinite;
}
.blob:nth-child(1) { width: 340px; height: 340px; background: var(--lavender); top: -80px; left: -60px; }
.blob:nth-child(2) { width: 280px; height: 280px; background: var(--peach); top: 18%; right: -70px; animation-delay: -5s; }
.blob:nth-child(3) { width: 300px; height: 300px; background: var(--mint); bottom: 12%; left: -80px; animation-delay: -11s; }
.blob:nth-child(4) { width: 240px; height: 240px; background: var(--sky); bottom: -60px; right: 12%; animation-delay: -16s; }
.blob:nth-child(5) { width: 200px; height: 200px; background: var(--pink); top: 46%; left: 42%; animation-delay: -8s; opacity: 0.32; }

@keyframes float-blob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(34px, -26px) scale(1.09); }
  66% { transform: translate(-24px, 22px) scale(0.94); }
}

/* 별똥별 커서 자취 */
#star-canvas {
  position: fixed;
  inset: 0;
  z-index: 9998;
  pointer-events: none;
}

/* ------------------------------------------------------------ 레이아웃 */

.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(253, 248, 240, 0.86);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
/* 본문(1180px)보다 넓게 잡아 메뉴 8개가 들어갈 자리를 만든다 */
.topbar-inner {
  max-width: 1420px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--navy);
  text-decoration: none;
  font-size: 1.02rem;
  white-space: nowrap;
  flex-shrink: 0;
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--purple) 0%, var(--blue) 100%);
  display: grid; place-items: center;
  color: #fff; font-size: 0.82rem; font-weight: 900;
  box-shadow: var(--shadow-sm);
  animation: mark-pop 5s var(--ease) infinite;
}
@keyframes mark-pop {
  0%, 88%, 100% { transform: rotate(0) scale(1); }
  92% { transform: rotate(-7deg) scale(1.1); }
  96% { transform: rotate(6deg) scale(1.06); }
}

/* 항목이 많아 좁은 화면에서는 가로 스크롤된다. 잘린 게 보이도록 끝에 페이드를 준다. */
.nav {
  display: flex; gap: 2px; flex: 1;
  overflow-x: auto; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 18px), transparent 100%);
  mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - 18px), transparent 100%);
}
.nav::-webkit-scrollbar { display: none; }

.nav-item {
  border: none;
  background: transparent;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 7px 11px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  transition: color 0.2s, background 0.2s, transform 0.2s var(--ease-bounce);
}
.nav-item:hover { color: var(--purple-deep); background: var(--purple-pale); transform: translateY(-1px); }
.nav-item.active { color: #fff; background: linear-gradient(135deg, var(--purple) 0%, var(--blue) 100%); box-shadow: var(--shadow-sm); }
.nav-ico { margin-right: 4px; }
.nav-item .badge-dot {
  position: absolute; top: 4px; right: 6px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--danger);
}

.topbar-user { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.user-chip {
  display: flex; align-items: center; gap: 7px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 5px 12px 5px 6px;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--ink-soft);
  max-width: 240px;
}
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--peach), var(--pink));
  display: grid; place-items: center;
  font-size: 0.78rem; font-weight: 800; color: var(--navy);
  flex-shrink: 0;
}
.user-chip .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 128px; }
.admin-tag {
  background: var(--navy); color: #fff;
  font-size: 0.68rem; font-weight: 800;
  padding: 2px 7px; border-radius: var(--radius-pill);
  flex-shrink: 0;
}

.main { flex: 1; max-width: 1180px; width: 100%; margin: 0 auto; padding: 26px 20px 80px; }

.footer {
  border-top: 1px solid var(--line);
  padding: 22px 20px 30px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.82rem;
}

/* --------------------------------------------------- 페이지 전환 애니메이션 */

.page { animation: page-in 0.44s var(--ease) both; }
@keyframes page-in {
  from { opacity: 0; transform: translateY(16px) scale(0.995); }
  to { opacity: 1; transform: none; }
}
.page.leaving { animation: page-out 0.2s var(--ease) both; }
@keyframes page-out {
  to { opacity: 0; transform: translateY(-10px) scale(0.995); }
}

/* 자식 요소가 순차적으로 올라오는 효과 */
.stagger > * { animation: rise 0.5s var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: 0.02s; }
.stagger > *:nth-child(2) { animation-delay: 0.06s; }
.stagger > *:nth-child(3) { animation-delay: 0.10s; }
.stagger > *:nth-child(4) { animation-delay: 0.14s; }
.stagger > *:nth-child(5) { animation-delay: 0.18s; }
.stagger > *:nth-child(6) { animation-delay: 0.22s; }
.stagger > *:nth-child(7) { animation-delay: 0.26s; }
.stagger > *:nth-child(8) { animation-delay: 0.30s; }
.stagger > *:nth-child(n+9) { animation-delay: 0.34s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------- 공통 부품 */

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease);
}
.card.hoverable:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.section-head { margin: 0 0 18px; }
.section-head h2 {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.02em;
}
.section-head p { margin: 0; color: var(--ink-soft); font-size: 0.94rem; }

.btn {
  font: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  border: none;
  border-radius: var(--radius-pill);
  padding: 10px 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: transform 0.18s var(--ease-bounce), box-shadow 0.2s, filter 0.2s, background 0.2s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

.btn-primary {
  background: linear-gradient(135deg, var(--purple) 0%, var(--blue) 100%);
  color: #fff;
  box-shadow: 0 5px 16px rgba(123, 106, 208, 0.32);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 9px 24px rgba(123, 106, 208, 0.42); }

.btn-soft { background: var(--purple-pale); color: var(--purple-deep); }
.btn-soft:hover:not(:disabled) { background: #e2dbf8; transform: translateY(-2px); }

.btn-ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--line); }
.btn-ghost:hover:not(:disabled) { background: var(--paper); color: var(--navy); border-color: var(--purple); }

.btn-danger { background: #fdeaee; color: var(--danger); }
.btn-danger:hover:not(:disabled) { background: #fbdae1; }

.btn-sm { padding: 6px 13px; font-size: 0.81rem; }
.btn-block { width: 100%; }

label.field { display: block; margin-bottom: 14px; }
label.field > .label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}
label.field > .hint { display: block; font-size: 0.78rem; color: var(--ink-faint); margin-top: 5px; }

input[type='text'], input[type='number'], textarea, select {
  font: inherit;
  font-size: 0.93rem;
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 4px rgba(155, 138, 230, 0.16);
}
textarea { resize: vertical; min-height: 110px; line-height: 1.7; }
select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' stroke='%236a6884' stroke-width='2' fill='none' stroke-linecap='round'/></svg>"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.76rem; font-weight: 700;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: var(--purple-pale);
  color: var(--purple-deep);
}
.chip.track-공통 { background: var(--yellow); color: #8a6a13; }
.chip.track-교사 { background: var(--mint); color: #1d7355; }
.chip.track-원장 { background: var(--sky); color: #245b8c; }
.chip.gray { background: #f0eef6; color: var(--ink-soft); }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }

.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }

.muted { color: var(--ink-soft); }
.tiny { font-size: 0.78rem; }
.center { text-align: center; }

.empty {
  text-align: center;
  padding: 54px 20px;
  color: var(--ink-faint);
}
.empty .emoji { font-size: 2.6rem; display: block; margin-bottom: 10px; animation: bob 2.6s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* 로딩 */
.loader { display: inline-block; width: 17px; height: 17px; border: 2.5px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
.loader.dark { border-color: rgba(123,106,208,0.25); border-top-color: var(--purple-deep); }
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, #f2eee8 25%, #faf7f2 50%, #f2eee8 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* 토스트 */
#toasts {
  position: fixed;
  bottom: 22px; left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex; flex-direction: column; gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--navy);
  color: #fff;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.4s var(--ease-bounce) both;
  display: flex; align-items: center; gap: 8px;
  max-width: 90vw;
}
.toast.ok { background: linear-gradient(135deg, #46b98c, #34a97b); }
.toast.err { background: linear-gradient(135deg, #e87e91, #d9536c); }
.toast.leaving { animation: toast-out 0.3s var(--ease) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(24px) scale(0.9); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-12px) scale(0.95); } }

/* 모달 */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(43, 58, 122, 0.28);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: grid; place-items: center;
  padding: 20px;
  animation: fade-in 0.25s var(--ease) both;
}
@keyframes fade-in { from { opacity: 0; } }
.modal {
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: 26px;
  width: min(560px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.4s var(--ease-bounce) both;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(28px) scale(0.94); } }
.modal h3 { margin: 0 0 4px; color: var(--navy); font-size: 1.2rem; }

/* ============================================================ 로그인 */

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
/*
 * 표지가 16:9라 옆에 세우면 세로 여백이 크게 남는다.
 * 위에 가로로 꽉 채우고 그 아래 입력란을 두는 편이 표지도 크게 보이고 여백도 없다.
 */
.gate-card {
  width: min(600px, 100%);
  background: var(--paper);
  border-radius: 32px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  animation: modal-in 0.6s var(--ease-bounce) both;
}
.gate-cover { display: block; }
.gate-cover .cover { border-radius: 0; }

.gate-form { padding: 26px 32px 30px; display: flex; flex-direction: column; justify-content: center; }
.gate-form h1 { margin: 0 0 5px; font-size: 1.3rem; color: var(--navy); letter-spacing: -0.02em; }
.gate-form .sub { margin: 0 0 18px; color: var(--ink-soft); font-size: 0.9rem; }

.gate-note {
  margin-top: 14px;
  background: var(--blue-pale);
  border-radius: var(--radius);
  padding: 13px 15px;
  font-size: 0.8rem;
  color: #2c5f92;
  line-height: 1.6;
}

/* ============================================================ 표지 */

/* 표지는 항상 16:9. 실제 표지 이미지(1536×864)가 잘리지 않게 한다. */
.cover {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: linear-gradient(150deg, #fff6e8 0%, #fdf3ff 48%, #eef4ff 100%);
  overflow: hidden;
  display: grid;
  place-items: center;
  /* 안쪽 글자 크기를 화면이 아니라 표지 상자 너비에 맞춰 키운다 */
  container-type: inline-size;
}
.cover.hero {
  border-radius: var(--radius-lg);
  /* 16:9로 두면 본문 폭(1180px)에서 660px가 넘어 첫 화면을 다 덮는다. 폭을 제한한다. */
  max-width: 820px;
  margin: 0 auto 26px;
  box-shadow: var(--shadow);
}
/* contain이라 비율이 조금 어긋난 이미지를 올려도 잘리지 않는다 */
.cover-photo { width: 100%; height: 100%; object-fit: contain; display: block; }

.cover-art { position: relative; z-index: 2; text-align: center; padding: 4cqw 26px; }
.cover-art .line1 {
  font-size: clamp(0.95rem, 4.2cqw, 1.85rem);
  font-weight: 900;
  color: var(--navy);
  letter-spacing: -0.03em;
  text-shadow: 0 2px 0 #fff, 0 3px 10px rgba(255,255,255,0.9);
  margin-bottom: 2px;
}
.cover-art .line2 {
  font-size: clamp(1.7rem, 8.6cqw, 3.5rem);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 1.08;
  text-shadow: 0 3px 0 #fff, 0 5px 16px rgba(255,255,255,0.95);
}
.cover-art .line2 .g { color: var(--purple); }
.cover-art .line2 .ai { color: var(--blue); position: relative; }
.cover-art .line2 .ai::after {
  content: '';
  position: absolute; top: -6px; right: -13px;
  width: 12px; height: 12px;
  background: var(--blue);
  clip-path: polygon(50% 0, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0 50%, 39% 39%);
  animation: twinkle 2.2s ease-in-out infinite;
}
@keyframes twinkle { 0%, 100% { opacity: 0.35; transform: scale(0.75) rotate(0); } 50% { opacity: 1; transform: scale(1.15) rotate(90deg); } }

.cover-art .byline { margin-top: 2.2cqw; font-size: clamp(0.85rem, 2.8cqw, 1.15rem); font-weight: 800; color: var(--blue-deep); }
.cover-art .pub { font-size: clamp(0.7rem, 1.9cqw, 0.86rem); color: var(--ink-soft); font-weight: 600; letter-spacing: 0.02em; }
.cover-art .rule {
  width: 116px; height: 1px; margin: 2cqw auto 0;
  background: linear-gradient(90deg, transparent, var(--lavender), transparent);
  position: relative;
}
.cover-art .rule::after {
  content: '♥'; position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  color: var(--purple); font-size: 0.72rem;
}

/* 표지에 떠다니는 아이콘 */
.cover-icon { position: absolute; font-size: clamp(0.95rem, 3.4cqw, 1.7rem); opacity: 0.85; animation: drift 7s ease-in-out infinite; z-index: 1; }
/* 실제 표지 사진이 들어오면 장식 아이콘은 숨긴다 */
.cover.has-photo .cover-icon { display: none; }
@keyframes drift { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-14px) rotate(4deg); } }

/* ============================================================ 홈 */

.quick-grid { margin-top: 24px; }
.quick {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  font: inherit;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s;
  position: relative;
  overflow: hidden;
}
.quick::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(155,138,230,0.09), rgba(74,144,226,0.09));
  opacity: 0; transition: opacity 0.3s;
}
.quick:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: var(--purple); }
.quick:hover::before { opacity: 1; }
.quick .ico {
  width: 46px; height: 46px; border-radius: 15px;
  display: grid; place-items: center;
  font-size: 1.35rem; margin-bottom: 12px;
  position: relative; z-index: 1;
  transition: transform 0.4s var(--ease-bounce);
}
.quick:hover .ico { transform: scale(1.12) rotate(-6deg); }
.quick h3 { margin: 0 0 5px; font-size: 1.02rem; color: var(--navy); position: relative; z-index: 1; }
.quick p { margin: 0; font-size: 0.85rem; color: var(--ink-soft); position: relative; z-index: 1; line-height: 1.55; }

.stat-strip { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.stat {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 18px; min-width: 108px;
  transition: transform 0.25s var(--ease);
}
.stat:hover { transform: translateY(-3px); }
.stat .n { font-size: 1.42rem; font-weight: 900; color: var(--purple-deep); line-height: 1.2; }
.stat .k { font-size: 0.76rem; color: var(--ink-soft); font-weight: 600; }

/* ============================================================ 프롬프트 라이브러리 */

.filter-bar {
  position: sticky; top: 58px; z-index: 40;
  background: rgba(253, 248, 240, 0.92);
  backdrop-filter: blur(12px);
  padding: 12px 0;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip {
  font: inherit; font-size: 0.81rem; font-weight: 700;
  border: 1.5px solid var(--line); background: var(--paper);
  color: var(--ink-soft);
  padding: 6px 14px; border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s var(--ease-bounce);
}
.fchip:hover { border-color: var(--purple); color: var(--purple-deep); transform: translateY(-2px); }
.fchip.on { background: var(--navy); border-color: var(--navy); color: #fff; }

.prompt-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex; flex-direction: column; gap: 11px;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s;
  position: relative;
  overflow: hidden;
}
.prompt-card:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--lavender); }
.prompt-card h3 { margin: 0; font-size: 1rem; color: var(--navy); line-height: 1.4; }
.prompt-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.prompt-body {
  font-family: var(--mono);
  font-size: 0.79rem;
  line-height: 1.62;
  white-space: pre-wrap;
  word-break: break-word;
  background: #faf8f4;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 13px;
  max-height: 168px;
  overflow: hidden;
  position: relative;
  color: var(--ink-soft);
  transition: max-height 0.4s var(--ease);
}
.prompt-body.open { max-height: 1800px; overflow: auto; }
.prompt-body:not(.open)::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0; height: 52px;
  background: linear-gradient(transparent, #faf8f4 78%);
  pointer-events: none;
}

.slot-list { display: flex; gap: 5px; flex-wrap: wrap; }
.slot {
  font-size: 0.71rem; font-weight: 700;
  background: var(--yellow); color: #8a6a13;
  padding: 2px 8px; border-radius: 6px;
}

/* 복사 버튼 성공 애니메이션 */
.btn-copy { position: relative; overflow: visible; }
.btn-copy.copied { background: linear-gradient(135deg, #46b98c, #34a97b) !important; }
.btn-copy.copied::after {
  content: '';
  position: absolute; inset: -4px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--ok);
  animation: pulse-ring 0.62s var(--ease) both;
}
@keyframes pulse-ring {
  from { opacity: 0.85; transform: scale(1); }
  to { opacity: 0; transform: scale(1.5); }
}

/* ============================================================ 도구 (익명화 / AI) */

.tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 900px) { .tool-grid { grid-template-columns: 1fr; } }

.output-box {
  background: #faf8f4;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 16px;
  min-height: 180px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.9rem;
  line-height: 1.75;
}
.output-box.empty-state { display: grid; place-items: center; color: var(--ink-faint); }

.name-row {
  display: grid;
  grid-template-columns: 1fr 132px 34px;
  gap: 7px;
  align-items: center;
  margin-bottom: 7px;
  animation: rise 0.34s var(--ease) both;
}
.icon-btn {
  border: none; background: #f5f1ea; color: var(--ink-soft);
  width: 34px; height: 34px; border-radius: 10px;
  cursor: pointer; font-size: 1rem; display: grid; place-items: center;
  transition: all 0.2s var(--ease-bounce);
}
.icon-btn:hover { background: #fdeaee; color: var(--danger); transform: rotate(90deg); }

.suggestion {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.8rem; font-weight: 600;
  background: var(--paper); border: 1.5px dashed var(--purple);
  color: var(--purple-deep);
  padding: 5px 12px; border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s var(--ease-bounce);
  animation: rise 0.34s var(--ease) both;
}
.suggestion:hover { background: var(--purple-pale); transform: translateY(-2px) scale(1.03); }
.suggestion.used { opacity: 0.4; pointer-events: none; text-decoration: line-through; }

.risk {
  background: #fff6ee;
  border-left: 4px solid var(--warn);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 0.84rem;
  color: #9a6520;
  margin-top: 9px;
  animation: rise 0.4s var(--ease) both;
}
.risk .samples { font-family: var(--mono); font-size: 0.76rem; opacity: 0.85; margin-top: 3px; }

.notice {
  background: var(--blue-pale);
  border-left: 4px solid var(--blue);
  border-radius: var(--radius-sm);
  padding: 12px 15px;
  font-size: 0.85rem;
  color: #2c5f92;
  line-height: 1.62;
}
.notice.warn { background: #fff6ee; border-color: var(--warn); color: #9a6520; }
.notice.danger { background: #fdeaee; border-color: var(--danger); color: #a33d52; }

/* 챗봇 */
.chat-window {
  height: 460px;
  overflow-y: auto;
  padding: 16px;
  background: #faf8f4;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px;
  scroll-behavior: smooth;
}
.bubble {
  max-width: 84%;
  padding: 11px 15px;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.68;
  white-space: pre-wrap;
  word-break: break-word;
  animation: bubble-in 0.4s var(--ease-bounce) both;
}
@keyframes bubble-in { from { opacity: 0; transform: translateY(12px) scale(0.94); } }
.bubble.me { align-self: flex-end; background: linear-gradient(135deg, var(--purple), var(--blue)); color: #fff; border-bottom-right-radius: 5px; }
.bubble.bot { align-self: flex-start; background: var(--paper); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.bubble.typing { display: flex; gap: 4px; align-items: center; padding: 14px 16px; }
.bubble.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--purple); display: block; animation: dot 1.2s infinite; }
.bubble.typing i:nth-child(2) { animation-delay: 0.18s; }
.bubble.typing i:nth-child(3) { animation-delay: 0.36s; }
@keyframes dot { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-6px); opacity: 1; } }

.quota-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--paper); border: 1.5px solid var(--line);
  border-radius: var(--radius-pill); padding: 6px 15px;
  font-size: 0.83rem; font-weight: 700; color: var(--ink-soft);
}
.quota-pill .dots { display: flex; gap: 3px; }
.quota-pill .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); display: block; transition: background 0.3s; }
.quota-pill .dots i.left { background: linear-gradient(135deg, var(--purple), var(--blue)); }
.quota-pill.out { border-color: var(--danger); color: var(--danger); }

/* ============================================================ 게시판 */

.post-item {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 17px 20px;
  cursor: pointer;
  transition: transform 0.26s var(--ease), box-shadow 0.26s var(--ease), border-color 0.26s;
}
.post-item:hover { transform: translateX(5px); box-shadow: var(--shadow-sm); border-color: var(--purple); }
.post-item h3 { margin: 0 0 6px; font-size: 1.02rem; color: var(--navy); }
.post-item .excerpt { margin: 0 0 9px; font-size: 0.86rem; color: var(--ink-soft); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 0.78rem; color: var(--ink-faint); align-items: center; }

.metoo-btn {
  font: inherit; font-size: 0.81rem; font-weight: 700;
  border: 1.5px solid var(--line); background: var(--paper);
  color: var(--ink-soft);
  padding: 5px 14px; border-radius: var(--radius-pill);
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.24s var(--ease-bounce);
}
.metoo-btn:hover { border-color: var(--pink); color: #c2496a; transform: translateY(-2px); }
.metoo-btn.on { background: var(--pink); border-color: var(--pink); color: #a8365a; }
.metoo-btn.on .hand { animation: wiggle 0.6s var(--ease-bounce); }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-18deg) scale(1.25); } 60% { transform: rotate(14deg) scale(1.15); } }

.comment {
  background: var(--purple-pale);
  border-radius: var(--radius);
  padding: 13px 16px;
  margin-bottom: 9px;
  animation: rise 0.4s var(--ease) both;
}
.comment .who { font-size: 0.8rem; font-weight: 800; color: var(--purple-deep); margin-bottom: 3px; display: flex; align-items: center; gap: 6px; }
.comment .txt { font-size: 0.89rem; white-space: pre-wrap; line-height: 1.68; }

/* ============================================================ 관리자 */

.admin-tabs { display: flex; gap: 6px; margin-bottom: 18px; flex-wrap: wrap; }

table.data { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
table.data th {
  text-align: left; padding: 10px 12px;
  font-size: 0.76rem; font-weight: 800; color: var(--ink-soft);
  border-bottom: 2px solid var(--line);
  white-space: nowrap;
}
table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr { transition: background 0.18s; }
table.data tbody tr:hover { background: #faf8f4; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

.num-input { width: 74px; padding: 6px 9px; font-size: 0.85rem; text-align: center; }

/* ============================================================ 반응형 */

/* 메뉴가 8개다. 너비가 줄어드는 순서대로 브랜드 글자 → 아이콘을 접는다. */
@media (max-width: 1320px) {
  .brand span.brand-text { display: none; }
}
@media (max-width: 1080px) {
  .nav-ico { display: none; }
  .nav-item { padding: 7px 10px; }
}
@media (max-width: 900px) {
  .user-chip .who { display: none; }
  .user-chip { padding: 5px 8px 5px 6px; }
}

/* 한 줄에 다 들어가지 않는 지점부터는 메뉴를 아랫줄로 내려 전체를 보여 준다 */
@media (max-width: 860px) {
  .topbar-inner { flex-wrap: wrap; gap: 10px; }
  .nav { order: 3; width: 100%; flex-basis: 100%; padding-bottom: 2px; }
  .nav-ico { display: inline; }
  .topbar-user { margin-left: auto; }
  .user-chip .who { display: inline; max-width: 130px; }
}

@media (max-width: 700px) {
  .topbar-inner { padding: 8px 14px; }
  .user-chip .who { max-width: 96px; }
  .main { padding: 18px 14px 70px; }
  .card { padding: 17px; }
  .filter-bar { top: 96px; }
  .gate-form { padding: 30px 24px; }
  .bubble { max-width: 92%; }
}

/* 애니메이션을 줄이는 설정을 존중한다 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  #star-canvas { display: none; }
}
