/* 기본 레이아웃 */
body {
  font-family: 'Pretendard', sans-serif;
  background: #FFFFFF;
  margin: 0;
  padding: 20px;
}

/* 제목 스타일 */
h2 {
  text-align: center;
  color: #1e90ff;
  font-size: 15px;
  margin-bottom: 24px;
}

/* 공통 기본 - flex 방식 */
.category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
}

/* ✅ index 페이지 전용 2열 grid 적용 */
body.index-page .category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  justify-content: center;
  max-width: 600px;
  margin: 0 auto;
}

/* 공통 박스 */
.category-box {
  background: white;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  font-size: 16px;
  color: #333;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  animation: fadeInUp 0.6s ease both;
  text-decoration: none;
}

.category-box:hover {
  transform: translateY(-6px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.12);
  background-color: #eaf5ff;
}

/* 뒤로가기 버튼 */
.back-btn {
  margin-top: 30px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.back-btn a {
  text-decoration: none;
  font-size: 15px;
  color: #555;
  background: #fff5f5;
  border: 1px solid #ccc;
  padding: 10px 18px;
  border-radius: 8px;
  transition: background 0.3s;
}

.back-btn a:hover {
  background: #f0f0f0;
}

/* fadeIn 애니메이션 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 반응형 */
@media (max-width: 768px) {
  .category-box {
    flex: 0 1 calc(50% - 12px);
  }
}

@media (max-width: 480px) {
  .category-box {
    flex: 0 1 100%;
  }
}

/* 버튼 컨테이너 (answer 전용) */
.button-wrapper {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.button-wrapper a {
  flex: 1 1 min(200px, 48%);
  text-align: center;
  text-decoration: none;
  animation: fadeInUp 0.6s ease both;
}

.button-wrapper a:nth-child(1) {
  animation-delay: 0.1s;
}
.button-wrapper a:nth-child(2) {
  animation-delay: 0.2s;
}

.button-wrapper button {
  width: 100%;
  padding: 12px 0;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  background-color: #1e90ff;
  color: white;
  cursor: pointer;
  transition: background 0.3s;
}

.button-wrapper button:hover {
  background-color: #0078e7;
}

/* 링크 버튼 */
.btn-link {
  flex: 1 1 min(200px, 48%);
  text-align: center;
  text-decoration: none;
  padding: 12px 0;
  font-size: 16px;
  border-radius: 8px;
  background-color: #1e90ff;
  color: white;
  transition: background 0.3s;
}

.btn-link:hover {
  background-color: #0078e7;
}

.btn-link-secondary {
  flex: 1 1 180px;
  max-width: 180px;
  text-align: center;
  padding: 12px 0;
  font-size: 16px;
  border-radius: 12px;
  border: 1px solid #ccc;
  color: #555;
  background-color: white;
  text-decoration: none;
  transition: all 0.3s ease;
}

.btn-link-secondary:hover {
  background-color: #f0f0f0;
  color: #333;
  border-color: #999;
}

/* Q&A 보기 박스 */
.qa-box {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  margin-top: 24px;
  animation: fadeInUp 0.6s ease both;
}

.qa-box h3 {
  color: #007bff;
  font-size: 18px;
  margin-bottom: 16px;
}

.qa-box p {
  font-size: 16px;
  color: #333;
  line-height: 1.6;
}

