/* ===================================================
   서식 자료실 — 2025 Premium Light Design System
   =================================================== */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Color Palette - Light Theme */
  --bg-main: #f4f7fb;       /* 밝고 깨끗한 배경 */
  --bg-card: #ffffff;       /* 카드 배경 */
  --bg-header: rgba(255, 255, 255, 0.85); /* 투명한 헤더 */
  --text-main: #111827;     /* 매우 진한 텍스트 (가독성 향상) */
  --text-muted: #4b5563;    /* 설명용 서브 텍스트 */
  --border: #e5e7eb;        /* 연한 테두리 */
  --primary: #2563eb;       /* 밝고 강렬한 파란색 포인트 */
  --primary-hover: #1d4ed8;
  
  /* Category Colors (밝은 배경에 맞는 산뜻하고 선명한 컬러) */
  --c-admin: #3b82f6;       /* Blue */
  --c-labor: #f59e0b;       /* Amber */
  --c-tax:   #10b981;       /* Emerald */
  --c-real:  #8b5cf6;       /* Purple */
  --c-health:#ec4899;       /* Pink */
  --c-legal: #6366f1;       /* Indigo */
  --c-edu:   #14b8a6;       /* Teal */
  --c-biz:   #f43f5e;       /* Rose */

  /* UI Tokens */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 32px;
  --radius-full: 9999px;
  
  /* 부드럽고 고급스러운 그림자 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 24px 48px rgba(0, 0, 0, 0.12);

  /* 애니메이션 */
  --spring: cubic-bezier(0.175, 0.885, 0.32, 1.15);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Typography & Global ────────────────────────── */
body {
  background-color: var(--bg-main);
  color: var(--text-main);
  /* 글씨체와 기본 크기를 키워 가독성을 극대화 */
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  font-size: 17px; 
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button, input { font: inherit; outline: none; border: none; }
ul, ol { list-style: none; }

/* ── Header (Topbar) ────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; width: 100%; height: 96px;
  background: var(--bg-header);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  z-index: 100;
}
.logo {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo span {
  color: var(--primary);
}

.sister-links {
  display: flex;
  gap: 12px;
  align-items: center;
  overflow-x: auto;
  max-width: 65%;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.sister-links::-webkit-scrollbar {
  display: none;
}
.sister-links a {
  font-size: 1.25rem;
  font-weight: 800;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  box-shadow: 0 3px 6px rgba(0,0,0,0.03), inset 0 -3px 0 rgba(0,0,0,0.06);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 14px 24px;
  border-radius: 30px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sister-links a:hover {
  background: #ffffff;
  border-color: #cbd5e1;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08), inset 0 -2px 0 rgba(0,0,0,0.02);
  color: #0f172a;
}
.sister-links a:active {
  transform: translateY(0);
  box-shadow: none;
}
.live-badge {
  display: flex; align-items: center; gap: 8px;
  background: #eff6ff;
  color: var(--primary);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid #bfdbfe;
}
.pulse-dot {
  width: 10px; height: 10px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

/* ── Hero Section ───────────────────────────────── */
.hero {
  padding: 160px 20px 80px;
  text-align: center;
  position: relative;
  background: linear-gradient(180deg, #ffffff 0%, var(--bg-main) 100%);
  border-bottom: 1px solid var(--border);
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: var(--primary);
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}
.hero h1 {
  font-size: 4rem;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
  color: var(--text-main);
}
.hero-highlight {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-sub {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 50px;
  font-weight: 500;
}

/* ── Search Bar ─────────────────────────────────── */
.search-container {
  max-width: 760px;
  margin: 0 auto;
  position: relative;
  z-index: 10;
}
.search-inner {
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 2px solid var(--primary);
  border-radius: var(--radius-full);
  padding: 8px 12px 8px 24px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s var(--ease);
}
.search-inner:focus-within {
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2);
}
.search-icon {
  width: 26px; height: 26px;
  color: var(--primary);
}
.search-input {
  flex: 1;
  background: transparent;
  padding: 16px;
  font-size: 1.25rem; /* 입력창 글씨 크게 */
  color: var(--text-main);
  font-weight: 500;
}
.search-input::placeholder {
  color: #9ca3af;
}
.search-clear {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: #f3f4f6;
  color: var(--text-muted);
  border-radius: 50%;
  cursor: pointer;
  opacity: 0; pointer-events: none;
  transition: all 0.2s;
}
.search-clear.visible {
  opacity: 1; pointer-events: auto;
}
.search-clear:hover {
  background: #e5e7eb;
  color: var(--text-main);
}
.search-hint {
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 12px;
  font-weight: 500;
}

/* ── Stats ──────────────────────────────────────── */
.stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 50px;
}
.stat-item {
  text-align: center;
}
.stat-num {
  display: block;
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label {
  font-size: 1.05rem;
  color: var(--text-muted);
  font-weight: 600;
}
.stat-div {
  width: 1px;
  background: var(--border);
}

/* ── Main Content ───────────────────────────────── */
.main-content {
  max-width: 1300px;
  margin: 0 auto;
  padding: 60px 20px 100px;
}

/* ── Category Nav ───────────────────────────────── */
.cat-nav {
  position: sticky;
  top: 72px;
  background: var(--bg-main);
  padding: 20px 0;
  margin-bottom: 40px;
  z-index: 90;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  transition: box-shadow 0.3s;
}
.cat-list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.cat-list::-webkit-scrollbar { display: none; }

.cat-pill {
  padding: 14px 28px;
  border-radius: var(--radius-full);
  background: #ffffff;
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s var(--spring);
}
.cat-pill:hover {
  background: #f8fafc;
  transform: translateY(-2px);
}
.cat-pill.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.25);
}

/* ── Result Header ──────────────────────────────── */
.result-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 30px;
}
.result-label {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
}
.result-count {
  background: var(--primary);
  color: #fff;
  padding: 4px 16px;
  border-radius: var(--radius-full);
  font-size: 1.1rem;
  font-weight: 700;
}

/* ── Grid & Cards ───────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 30px;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 32px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  position: relative;
  transition: all 0.4s var(--spring);
  animation: slideUp 0.6s var(--spring) backwards;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Top accent line based on category */
.card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: var(--card-color, var(--primary));
  opacity: 0.8;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-hover);
  border-color: var(--card-color, var(--primary));
}

.card-head {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 20px;
}
.card-emoji {
  width: 56px; height: 56px;
  background: #f3f4f6;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
  transition: transform 0.3s var(--spring);
}
.card:hover .card-emoji {
  transform: scale(1.1) rotate(5deg);
  background: #eef2ff;
}

.card-info { flex: 1; }
.card-cat {
  font-size: 1rem;
  font-weight: 700;
  color: var(--card-color, var(--primary));
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.card-title {
  font-size: 1.4rem; /* 제목 더 크게 */
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.35;
}

.card-desc {
  font-size: 1.15rem; /* 본문 더 크게 */
  color: var(--text-muted);
  margin-bottom: 24px;
  flex: 1;
  line-height: 1.6;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}
.tag {
  background: #f1f5f9;
  color: #475569;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
}
.card:hover .tag {
  background: #e2e8f0;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.card-source-tag {
  display: flex; align-items: center; gap: 8px;
  font-size: 1.05rem;
  color: #64748b;
  font-weight: 600;
}
.card-source-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--card-color, var(--primary));
}

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--card-color, var(--primary));
  font-weight: 800;
  font-size: 1.15rem;
  transition: gap 0.2s;
}
.card-cta svg {
  width: 22px; height: 22px;
}
.card:hover .card-cta {
  gap: 12px;
}

/* ── Category Colors ────────────────────────────── */
.c-admin      { --card-color: var(--c-admin); }
.c-labor      { --card-color: var(--c-labor); }
.c-tax        { --card-color: var(--c-tax); }
.c-realestate { --card-color: var(--c-real); }
.c-health     { --card-color: var(--c-health); }
.c-legal      { --card-color: var(--c-legal); }
.c-edu        { --card-color: var(--c-edu); }
.c-business   { --card-color: var(--c-biz); }

/* ── Empty State ────────────────────────────────── */
.empty-state {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 20px;
  text-align: center;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px dashed #cbd5e1;
}
.empty-icon {
  font-size: 4rem;
  margin-bottom: 24px;
}
.empty-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-main);
}
.empty-desc {
  font-size: 1.15rem;
  color: var(--text-muted);
}

/* ── Animations ─────────────────────────────────── */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 768px) {
  .sister-links { display: none; }
  .topbar { padding: 0 20px; }
  .hero { padding: 120px 20px 60px; }
  .hero h1 { font-size: 2.75rem; }
  .hero-sub { font-size: 1.1rem; }
  .stats { gap: 20px; }
  .stat-num { font-size: 1.75rem; }
  
  .cat-pill { font-size: 1rem; padding: 12px 20px; }
  .grid { grid-template-columns: 1fr; }
  
  .card-title { font-size: 1.25rem; }
  .card-desc { font-size: 1.05rem; }
}
